diff --git a/apps/jest-expo-mock-generator/App.js b/apps/jest-expo-mock-generator/App.js index 5b6406c93af881..5e45028e102e2d 100644 --- a/apps/jest-expo-mock-generator/App.js +++ b/apps/jest-expo-mock-generator/App.js @@ -1,10 +1,10 @@ import mux from '@expo/mux'; import { setStringAsync } from 'expo-clipboard'; import Constants from 'expo-constants'; +import { uuidv4 } from 'expo-modules-core'; import getInstallationIdAsync from 'expo/build/environment/getInstallationIdAsync'; import React from 'react'; import { Button, NativeModules, StyleSheet, Text, View } from 'react-native'; -import { v4 as uuidV4 } from 'uuid'; // A workaround for `TypeError: Cannot read property 'now' of undefined` error thrown from reanimated code. global.performance = { @@ -12,7 +12,7 @@ global.performance = { }; const logUrl = Constants.expoGoConfig.logUrl; -const sessionId = uuidV4(); +const sessionId = uuidv4(); const { ExpoNativeModuleIntrospection } = NativeModules; diff --git a/home/api/__tests__/AuthSessions-test.js b/home/api/__tests__/AuthSessions-test.js index 3ba5fb64be42dd..b4ceeab5a14b0a 100644 --- a/home/api/__tests__/AuthSessions-test.js +++ b/home/api/__tests__/AuthSessions-test.js @@ -1,5 +1,5 @@ +import { uuidv4 } from 'expo-modules-core'; import gql from 'graphql-tag'; -import { v4 as uuidv4 } from 'uuid'; jest.mock('@react-native-async-storage/async-storage', () => ({ setItem: jest.fn(() => new Promise((resolve) => resolve(null))), diff --git a/packages/expo-constants/CHANGELOG.md b/packages/expo-constants/CHANGELOG.md index f1b8e04b2270ff..d8bab7e57dcc52 100644 --- a/packages/expo-constants/CHANGELOG.md +++ b/packages/expo-constants/CHANGELOG.md @@ -10,6 +10,8 @@ ### 💡 Others +- Fork `uuid@3.4.0` and move into `expo-modules-core`. Remove the original dependency. ([#23249](https://github.com/expo/expo/pull/23249) by [@alanhughes](https://github.com/alanjhughes)) + ## 14.4.2 — 2023-06-24 ### 💡 Others diff --git a/packages/expo-constants/build/ExponentConstants.web.d.ts.map b/packages/expo-constants/build/ExponentConstants.web.d.ts.map index 650993b3873ed0..642116b499bbae 100644 --- a/packages/expo-constants/build/ExponentConstants.web.d.ts.map +++ b/packages/expo-constants/build/ExponentConstants.web.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ExponentConstants.web.d.ts","sourceRoot":"","sources":["../src/ExponentConstants.web.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,eAAe,EAGhB,MAAM,mBAAmB,CAAC;;AAmC3B,wBAmGqB"} \ No newline at end of file +{"version":3,"file":"ExponentConstants.web.d.ts","sourceRoot":"","sources":["../src/ExponentConstants.web.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,eAAe,EAGhB,MAAM,mBAAmB,CAAC;;AAmC3B,wBAmGqB"} \ No newline at end of file diff --git a/packages/expo-constants/build/ExponentConstants.web.js b/packages/expo-constants/build/ExponentConstants.web.js index 5949d9e29e49a2..01ac5c873c76f8 100644 --- a/packages/expo-constants/build/ExponentConstants.web.js +++ b/packages/expo-constants/build/ExponentConstants.web.js @@ -1,5 +1,4 @@ -import { Platform } from 'expo-modules-core'; -import { v4 as uuidv4 } from 'uuid'; +import { Platform, uuidv4 } from 'expo-modules-core'; import { ExecutionEnvironment, } from './Constants.types'; const ID_KEY = 'EXPO_CONSTANTS_INSTALLATION_ID'; const _sessionId = uuidv4(); diff --git a/packages/expo-constants/build/ExponentConstants.web.js.map b/packages/expo-constants/build/ExponentConstants.web.js.map index 62b62d98037bc8..4d99c2ffe37c75 100644 --- a/packages/expo-constants/build/ExponentConstants.web.js.map +++ b/packages/expo-constants/build/ExponentConstants.web.js.map @@ -1 +1 @@ -{"version":3,"file":"ExponentConstants.web.js","sourceRoot":"","sources":["../src/ExponentConstants.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EACL,oBAAoB,GAIrB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,GAAG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;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,eAAe;QACjB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,eAAe;QACjB,wGAAwG;QACxG,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,QAAQ;QACV,2CAA2C;QAC3C,8GAA8G;QAC9G,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;IACxC,CAAC;IACD,IAAI,SAAS;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,aAAa;QACf,IAAI,QAAQ,CAAC,cAAc,EAAE;YAC3B,OAAO,QAAQ,CAAC,MAAM,CAAC;SACxB;aAAM;YACL,OAAO,EAAE,CAAC;SACX;IACH,CAAC;IACD,IAAI,SAAS;QACX,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,wBAAwB;QAC5B,IAAI,QAAQ,CAAC,cAAc,EAAE;YAC3B,OAAO,SAAS,CAAC,SAAS,CAAC;SAC5B;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;CACiB,CAAC","sourcesContent":["import { Platform } from 'expo-modules-core';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport {\n ExecutionEnvironment,\n NativeConstants,\n PlatformManifest,\n WebManifest,\n} from './Constants.types';\n\nconst ID_KEY = 'EXPO_CONSTANTS_INSTALLATION_ID';\n\ndeclare let __DEV__: boolean;\ndeclare let process: { env: any };\ndeclare let navigator: Navigator;\ndeclare let location: Location;\ndeclare let localStorage: Storage;\n\nconst _sessionId = uuidv4();\n\nfunction getBrowserName(): string | undefined {\n if (Platform.isDOMAvailable) {\n const agent = navigator.userAgent.toLowerCase();\n if (agent.includes('edge')) {\n return 'Edge';\n } else if (agent.includes('edg')) {\n return 'Chromium Edge';\n } else if (agent.includes('opr') && !!window['opr']) {\n return 'Opera';\n } else if (agent.includes('chrome') && !!window['chrome']) {\n return 'Chrome';\n } else if (agent.includes('trident')) {\n return 'IE';\n } else if (agent.includes('firefox')) {\n return 'Firefox';\n } else if (agent.includes('safari')) {\n return 'Safari';\n }\n }\n\n return undefined;\n}\n\nexport default {\n get name(): string {\n return 'ExponentConstants';\n },\n get appOwnership() {\n return null;\n },\n get executionEnvironment() {\n return ExecutionEnvironment.Bare;\n },\n get installationId(): string {\n let installationId;\n try {\n installationId = localStorage.getItem(ID_KEY);\n if (installationId == null || typeof installationId !== 'string') {\n installationId = uuidv4();\n localStorage.setItem(ID_KEY, installationId as string);\n }\n } catch {\n installationId = _sessionId;\n } finally {\n return installationId;\n }\n },\n get sessionId(): string {\n return _sessionId;\n },\n get platform(): PlatformManifest {\n return { web: Platform.isDOMAvailable ? { ua: navigator.userAgent } : undefined };\n },\n get isHeadless(): boolean {\n if (!Platform.isDOMAvailable) return true;\n\n return /\\bHeadlessChrome\\//.test(navigator.userAgent);\n },\n get isDevice(): true {\n // TODO: Bacon: Possibly want to add information regarding simulators\n return true;\n },\n get expoVersion(): string | null {\n return this.manifest!.sdkVersion || null;\n },\n get linkingUri(): string {\n if (Platform.isDOMAvailable) {\n // On native this is `exp://`\n // On web we should use the protocol and hostname (location.origin)\n return location.origin;\n } else {\n return '';\n }\n },\n get expoRuntimeVersion(): string | null {\n return this.expoVersion;\n },\n get deviceName(): string | undefined {\n return getBrowserName();\n },\n get nativeAppVersion(): null {\n return null;\n },\n get nativeBuildVersion(): null {\n return null;\n },\n get systemFonts(): string[] {\n // TODO: Bacon: Maybe possible.\n return [];\n },\n get statusBarHeight(): number {\n return 0;\n },\n get deviceYearClass(): number | null {\n // TODO: Bacon: The android version isn't very accurate either, maybe we could try and guess this value.\n return null;\n },\n get manifest(): WebManifest {\n // This is defined by @expo/webpack-config.\n // If your site is bundled with a different config then you may not have access to the app.json automatically.\n return process.env.APP_MANIFEST || {};\n },\n get manifest2(): null {\n return null;\n },\n get experienceUrl(): string {\n if (Platform.isDOMAvailable) {\n return location.origin;\n } else {\n return '';\n }\n },\n get debugMode(): boolean {\n return __DEV__;\n },\n async getWebViewUserAgentAsync(): Promise {\n if (Platform.isDOMAvailable) {\n return navigator.userAgent;\n } else {\n return null;\n }\n },\n} as NativeConstants;\n"]} \ No newline at end of file +{"version":3,"file":"ExponentConstants.web.js","sourceRoot":"","sources":["../src/ExponentConstants.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EACL,oBAAoB,GAIrB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,GAAG,gCAAgC,CAAC;AAQhD,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC;AAE5B,SAAS,cAAc;IACrB,IAAI,QAAQ,CAAC,cAAc,EAAE;QAC3B,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;QAChD,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;YAC1B,OAAO,MAAM,CAAC;SACf;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAChC,OAAO,eAAe,CAAC;SACxB;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YACnD,OAAO,OAAO,CAAC;SAChB;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;YACzD,OAAO,QAAQ,CAAC;SACjB;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;YACpC,OAAO,IAAI,CAAC;SACb;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;YACpC,OAAO,SAAS,CAAC;SAClB;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YACnC,OAAO,QAAQ,CAAC;SACjB;KACF;IAED,OAAO,SAAS,CAAC;AAC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AC,MAAM,CAAC;SACxB;aAAM;YACL,OAAO,EAAE,CAAC;SACX;IACH,CAAC;IACD,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IACD,IAAI,UAAU;QACZ,OAAO,cAAc,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,WAAW;QACb,+BAA+B;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,eAAe;QACjB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,eAAe;QACjB,wGAAwG;QACxG,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,QAAQ;QACV,2CAA2C;QAC3C,8GAA8G;QAC9G,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC;IACxC,CAAC;IACD,IAAI,SAAS;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,aAAa;QACf,IAAI,QAAQ,CAAC,cAAc,EAAE;YAC3B,OAAO,QAAQ,CAAC,MAAM,CAAC;SACxB;aAAM;YACL,OAAO,EAAE,CAAC;SACX;IACH,CAAC;IACD,IAAI,SAAS;QACX,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,wBAAwB;QAC5B,IAAI,QAAQ,CAAC,cAAc,EAAE;YAC3B,OAAO,SAAS,CAAC,SAAS,CAAC;SAC5B;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;CACiB,CAAC","sourcesContent":["import { Platform, uuidv4 } from 'expo-modules-core';\n\nimport {\n ExecutionEnvironment,\n NativeConstants,\n PlatformManifest,\n WebManifest,\n} from './Constants.types';\n\nconst ID_KEY = 'EXPO_CONSTANTS_INSTALLATION_ID';\n\ndeclare let __DEV__: boolean;\ndeclare let process: { env: any };\ndeclare let navigator: Navigator;\ndeclare let location: Location;\ndeclare let localStorage: Storage;\n\nconst _sessionId = uuidv4();\n\nfunction getBrowserName(): string | undefined {\n if (Platform.isDOMAvailable) {\n const agent = navigator.userAgent.toLowerCase();\n if (agent.includes('edge')) {\n return 'Edge';\n } else if (agent.includes('edg')) {\n return 'Chromium Edge';\n } else if (agent.includes('opr') && !!window['opr']) {\n return 'Opera';\n } else if (agent.includes('chrome') && !!window['chrome']) {\n return 'Chrome';\n } else if (agent.includes('trident')) {\n return 'IE';\n } else if (agent.includes('firefox')) {\n return 'Firefox';\n } else if (agent.includes('safari')) {\n return 'Safari';\n }\n }\n\n return undefined;\n}\n\nexport default {\n get name(): string {\n return 'ExponentConstants';\n },\n get appOwnership() {\n return null;\n },\n get executionEnvironment() {\n return ExecutionEnvironment.Bare;\n },\n get installationId(): string {\n let installationId;\n try {\n installationId = localStorage.getItem(ID_KEY);\n if (installationId == null || typeof installationId !== 'string') {\n installationId = uuidv4();\n localStorage.setItem(ID_KEY, installationId as string);\n }\n } catch {\n installationId = _sessionId;\n } finally {\n return installationId;\n }\n },\n get sessionId(): string {\n return _sessionId;\n },\n get platform(): PlatformManifest {\n return { web: Platform.isDOMAvailable ? { ua: navigator.userAgent } : undefined };\n },\n get isHeadless(): boolean {\n if (!Platform.isDOMAvailable) return true;\n\n return /\\bHeadlessChrome\\//.test(navigator.userAgent);\n },\n get isDevice(): true {\n // TODO: Bacon: Possibly want to add information regarding simulators\n return true;\n },\n get expoVersion(): string | null {\n return this.manifest!.sdkVersion || null;\n },\n get linkingUri(): string {\n if (Platform.isDOMAvailable) {\n // On native this is `exp://`\n // On web we should use the protocol and hostname (location.origin)\n return location.origin;\n } else {\n return '';\n }\n },\n get expoRuntimeVersion(): string | null {\n return this.expoVersion;\n },\n get deviceName(): string | undefined {\n return getBrowserName();\n },\n get nativeAppVersion(): null {\n return null;\n },\n get nativeBuildVersion(): null {\n return null;\n },\n get systemFonts(): string[] {\n // TODO: Bacon: Maybe possible.\n return [];\n },\n get statusBarHeight(): number {\n return 0;\n },\n get deviceYearClass(): number | null {\n // TODO: Bacon: The android version isn't very accurate either, maybe we could try and guess this value.\n return null;\n },\n get manifest(): WebManifest {\n // This is defined by @expo/webpack-config.\n // If your site is bundled with a different config then you may not have access to the app.json automatically.\n return process.env.APP_MANIFEST || {};\n },\n get manifest2(): null {\n return null;\n },\n get experienceUrl(): string {\n if (Platform.isDOMAvailable) {\n return location.origin;\n } else {\n return '';\n }\n },\n get debugMode(): boolean {\n return __DEV__;\n },\n async getWebViewUserAgentAsync(): Promise {\n if (Platform.isDOMAvailable) {\n return navigator.userAgent;\n } else {\n return null;\n }\n },\n} as NativeConstants;\n"]} \ No newline at end of file diff --git a/packages/expo-constants/src/ExponentConstants.web.ts b/packages/expo-constants/src/ExponentConstants.web.ts index 04de8a4f58d197..428445a85ca92a 100644 --- a/packages/expo-constants/src/ExponentConstants.web.ts +++ b/packages/expo-constants/src/ExponentConstants.web.ts @@ -1,5 +1,4 @@ -import { Platform } from 'expo-modules-core'; -import { v4 as uuidv4 } from 'uuid'; +import { Platform, uuidv4 } from 'expo-modules-core'; import { ExecutionEnvironment, diff --git a/packages/expo-contacts/CHANGELOG.md b/packages/expo-contacts/CHANGELOG.md index e04f41b69734d1..2653304a4f55aa 100644 --- a/packages/expo-contacts/CHANGELOG.md +++ b/packages/expo-contacts/CHANGELOG.md @@ -10,6 +10,8 @@ ### 💡 Others +- Fork `uuid@3.4.0` and move into `expo-modules-core`. Remove the original dependency. ([#23249](https://github.com/expo/expo/pull/23249) by [@alanhughes](https://github.com/alanjhughes)) + ## 12.2.0 — 2023-06-21 ### 🐛 Bug fixes diff --git a/packages/expo-contacts/build/Contacts.d.ts.map b/packages/expo-contacts/build/Contacts.d.ts.map index 1b103f94182c6b..04354e251a7dbe 100644 --- a/packages/expo-contacts/build/Contacts.d.ts.map +++ b/packages/expo-contacts/build/Contacts.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Contacts.d.ts","source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;IACH,mBAAmB,wBAAwB;IAC3C;;OAEG;IACH,iBAAiB,sBAAsB;IACvC;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,YAAY,iBAAiB;IAC7B;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,eAAe,oBAAoB;IACnC;;OAEG;IACH,cAAc,mBAAmB;IACjC;;OAEG;IACH,gBAAgB,qBAAqB;CACtC;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,UAAU,eAAe;CAC1B;AAED,oBAAY,SAAS;IACnB;;;OAGG;IACH,WAAW,gBAAgB;IAC3B;;OAEG;IACH,SAAS,cAAc;IACvB;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,IAAI,SAAS;CACd;AAED,oBAAY,YAAY;IACtB;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,OAAO,YAAY;CACpB"} \ No newline at end of file +{"version":3,"file":"Contacts.d.ts","sourceRoot":"","sources":["../src/Contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAK3B,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG,GAAG,eAAe,EAAE,CAAC;AAExE,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,GAAG,cAAc,EAAE,CAAC;AAEjE,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,GAAG,YAAY,EAAE,CAAC;AAE3D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;AAE7C,MAAM,MAAM,IAAI,GAAG;IACjB;;OAE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G;IACH,KAAK,UAAU;IACf;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,UAAU,eAAe;CAC1B;AAED,oBAAY,SAAS;IACnB;;;OAGG;IACH,WAAW,gBAAgB;IAC3B;;OAEG;IACH,SAAS,cAAc;IACvB;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,IAAI,SAAS;CACd;AAED,oBAAY,YAAY;IACtB;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,OAAO,YAAY;CACpB"} \ No newline at end of file diff --git a/packages/expo-contacts/build/Contacts.js b/packages/expo-contacts/build/Contacts.js index 0b7c541938078c..b553d21ac4fd0c 100644 --- a/packages/expo-contacts/build/Contacts.js +++ b/packages/expo-contacts/build/Contacts.js @@ -1,6 +1,5 @@ -import { PermissionStatus, UnavailabilityError } from 'expo-modules-core'; +import { PermissionStatus, UnavailabilityError, uuidv4, } from 'expo-modules-core'; import { Platform, Share } from 'react-native'; -import { v4 as uuidv4 } from 'uuid'; import ExpoContacts from './ExpoContacts'; export { PermissionStatus }; /** diff --git a/packages/expo-contacts/build/Contacts.js.map b/packages/expo-contacts/build/Contacts.js.map index 47e98167d971af..f086860e91ff8d 100644 --- a/packages/expo-contacts/build/Contacts.js.map +++ b/packages/expo-contacts/build/Contacts.js.map @@ -1 +1 @@ -{"version":3,"file":"Contacts.js","sourceRoot":"","sources":["../src/Contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AA+hB1C,OAAO,EAAE,gBAAgB,EAAsB,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAA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AN,IAAY,YASX;AATD,WAAY,YAAY;IACtB;;OAEG;IACH,iCAAiB,CAAA;IACjB;;OAEG;IACH,mCAAmB,CAAA;AACrB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB","sourcesContent":["import { PermissionResponse, PermissionStatus, UnavailabilityError } from 'expo-modules-core';\nimport { Platform, Share } from 'react-native';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport ExpoContacts from './ExpoContacts';\n\nexport type CalendarFormatType = CalendarFormats | `${CalendarFormats}`;\n\nexport type ContainerType = ContainerTypes | `${ContainerTypes}`;\n\nexport type ContactType = ContactTypes | `${ContactTypes}`;\n\nexport type FieldType = Fields | `${Fields}`;\n\nexport type Date = {\n /**\n * Day.\n */\n day?: number;\n /**\n * Month - adjusted for JavaScript `Date` which starts at `0`.\n */\n month?: number;\n /**\n * Year.\n */\n year?: number;\n /**\n * Unique ID.\n */\n id: string;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Format for the input date.\n */\n format?: CalendarFormatType;\n};\n\nexport type Relationship = {\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Name of related contact.\n */\n name?: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\nexport type Email = {\n /**\n * Email address.\n */\n email?: string;\n /**\n * Flag signifying if it is a primary email address.\n */\n isPrimary?: boolean;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\nexport type PhoneNumber = {\n /**\n * Phone number.\n */\n number?: string;\n /**\n * Flag signifying if it is a primary phone number.\n */\n isPrimary?: boolean;\n /**\n * Phone number without format.\n * @example `8674305`\n */\n digits?: string;\n /**\n * Country code.\n * @example `+1`\n */\n countryCode?: string;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\nexport type Address = {\n /**\n * Street name.\n */\n street?: string;\n /**\n * City name.\n */\n city?: string;\n /**\n * Country name\n */\n country?: string;\n /**\n * Region or state name.\n */\n region?: string;\n /**\n * Neighborhood name.\n */\n neighborhood?: string;\n /**\n * Local post code.\n */\n postalCode?: string;\n /**\n * P.O. Box.\n */\n poBox?: string;\n /**\n * [Standard country code](https://www.iso.org/iso-3166-country-codes.html).\n */\n isoCountryCode?: string;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\n/**\n * @platform ios\n */\nexport type SocialProfile = {\n /**\n * Name of social app.\n */\n service?: string;\n /**\n * Localized profile name.\n */\n localizedProfile?: string;\n /**\n * Web URL.\n */\n url?: string;\n /**\n * Username in social app.\n */\n username?: string;\n /**\n * Username ID in social app.\n */\n userId?: string;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\nexport type InstantMessageAddress = {\n /**\n * Name of instant messaging app.\n */\n service?: string;\n /**\n * Username in IM app.\n */\n username?: string;\n /**\n * Localized name of app.\n */\n localizedService?: string;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\nexport type UrlAddress = {\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Web URL.\n */\n url?: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\n// @needs-audit\n/**\n * Information regarding thumbnail images.\n * > On Android you can get dimensions using [`Image.getSize`](https://reactnative.dev/docs/image#getsize) method.\n */\nexport type Image = {\n uri?: string;\n /**\n * Image width.\n * @platform ios\n */\n width?: number;\n /**\n * Image height\n * @platform ios\n */\n height?: number;\n /**\n * Image as Base64 string.\n */\n base64?: string;\n};\n\n/**\n * A set of fields that define information about a single contact entity.\n */\nexport type Contact = {\n /**\n * Immutable identifier used for querying and indexing.\n */\n id: string;\n /**\n * Denoting a person or company.\n */\n contactType: ContactType;\n /**\n * Full name with proper format.\n */\n name: string;\n /**\n * Given name.\n */\n firstName?: string;\n /**\n * Middle name\n */\n middleName?: string;\n /**\n * Last name.\n */\n lastName?: string;\n /**\n * Maiden name.\n */\n maidenName?: string;\n /**\n * Dr. Mr. Mrs. ect…\n */\n namePrefix?: string;\n /**\n * Jr. Sr. ect…\n */\n nameSuffix?: string;\n /**\n * An alias to the proper name.\n */\n nickname?: string;\n /**\n * Pronunciation of the first name.\n */\n phoneticFirstName?: string;\n /**\n * Pronunciation of the middle name.\n */\n phoneticMiddleName?: string;\n /**\n * Pronunciation of the last name.\n */\n phoneticLastName?: string;\n /**\n * Organization the entity belongs to.\n */\n company?: string;\n /**\n * Job description.\n */\n jobTitle?: string;\n /**\n * Job department.\n */\n department?: string;\n /**\n * Additional information.\n * > On iOS 13+, the `note` field [requires your app to request additional entitlements](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_contacts_notes).\n * > The Expo Go app does not contain those entitlements, so in order to test this feature you will need to [request the entitlement from Apple](https://developer.apple.com/contact/request/contact-note-field),\n * > set the [`ios.accessesContactNotes`](./config/app.mdx#accessescontactnotes) field in app.json to `true`, and [create your development build](/develop/development-builds/create-a-build/).\n */\n note?: string;\n /**\n * Used for efficient retrieval of images.\n */\n imageAvailable?: boolean;\n /**\n * Thumbnail image. On iOS it size is set to 320×320px, on Android it may vary.\n */\n image?: Image;\n /**\n * Raw image without cropping, usually large.\n */\n rawImage?: Image;\n /**\n * Birthday information in Gregorian format.\n */\n birthday?: Date;\n /**\n * A labeled list of other relevant user dates in Gregorian format.\n */\n dates?: Date[];\n /**\n * Names of other relevant user connections.\n */\n relationships?: Relationship[];\n /**\n * Email addresses.\n */\n emails?: Email[];\n /**\n * Phone numbers.\n */\n phoneNumbers?: PhoneNumber[];\n /**\n * Locations.\n */\n addresses?: Address[];\n /**\n * Instant messaging connections.\n */\n instantMessageAddresses?: InstantMessageAddress[];\n /**\n * Associated web URLs.\n */\n urlAddresses?: UrlAddress[];\n /**\n * Birthday that doesn't conform to the Gregorian calendar format, interpreted based on the [calendar `format`](#date) setting.\n * @platform ios\n */\n nonGregorianBirthday?: Date;\n /**\n * Social networks.\n * @platform ios\n */\n socialProfiles?: SocialProfile[];\n};\n\n/**\n * The return value for queried contact operations like `getContactsAsync`.\n */\nexport type ContactResponse = {\n /**\n * An array of contacts that match a particular query.\n */\n data: Contact[];\n /**\n * This will be `true` if there are more contacts to retrieve beyond what is returned.\n */\n hasNextPage: boolean;\n /**\n * This will be `true if there are previous contacts that weren't retrieved due to `pageOffset` limit.\n */\n hasPreviousPage: boolean;\n};\n\nexport type ContactSort = `${SortTypes}`;\n\n/**\n * Used to query contacts from the user's device.\n */\nexport type ContactQuery = {\n /**\n * The max number of contacts to return. If skipped or set to `0` all contacts will be returned.\n */\n pageSize?: number;\n /**\n * The number of contacts to skip before gathering contacts.\n */\n pageOffset?: number;\n /**\n * If specified, the defined fields will be returned. If skipped, all fields will be returned.\n */\n fields?: FieldType[];\n /**\n * Sort method used when gathering contacts.\n */\n sort?: ContactSort;\n /**\n * Get all contacts whose name contains the provided string (not case-sensitive).\n */\n name?: string;\n /**\n * Get contacts with a matching ID or array of IDs.\n */\n id?: string | string[];\n /**\n * Get all contacts that belong to the group matching this ID.\n * @platform ios\n */\n groupId?: string;\n /**\n * Get all contacts that belong to the container matching this ID.\n * @platform ios\n */\n containerId?: string;\n /**\n * Prevent unification of contacts when gathering.\n * @default false\n * @platform ios\n */\n rawContacts?: boolean;\n};\n\n/**\n * Denotes the functionality of a native contact form.\n */\nexport type FormOptions = {\n /**\n * The properties that will be displayed. On iOS those properties does nothing while in editing mode.\n */\n displayedPropertyKeys?: FieldType[];\n /**\n * Controller title.\n */\n message?: string;\n /**\n * Used if contact doesn't have a name defined.\n */\n alternateName?: string;\n /**\n * Allows for contact mutation.\n */\n allowsEditing?: boolean;\n /**\n * Actions like share, add, create.\n */\n allowsActions?: boolean;\n /**\n * Show or hide the similar contacts.\n */\n shouldShowLinkedContacts?: boolean;\n /**\n * Present the new contact controller. If set to `false` the unknown controller will be shown.\n */\n isNew?: boolean;\n /**\n * The name of the left bar button.\n */\n cancelButtonTitle?: string;\n /**\n * Prevents the controller from animating in.\n */\n preventAnimation?: boolean;\n /**\n * The parent group for a new contact.\n */\n groupId?: string;\n};\n\n/**\n * Used to query native contact groups.\n * @platform ios\n */\nexport type GroupQuery = {\n /**\n * Query the group with a matching ID.\n */\n groupId?: string;\n /**\n * Query all groups matching a name.\n */\n groupName?: string;\n /**\n * Query all groups that belong to a certain container.\n */\n containerId?: string;\n};\n\n/**\n * A parent to contacts. A contact can belong to multiple groups. Here are some query operations you can perform:\n * - Child Contacts: `getContactsAsync({ groupId })`\n * - Groups From Container: `getGroupsAsync({ containerId })`\n * - Groups Named: `getContainersAsync({ groupName })`\n * @platform ios\n */\nexport type Group = {\n /**\n * Immutable id representing the group.\n */\n name?: string;\n /**\n * The editable name of a group.\n */\n id?: string;\n};\n\n/**\n * Used to query native contact containers.\n * @platform ios\n */\nexport type ContainerQuery = {\n /**\n * Query all the containers that parent a contact.\n */\n contactId?: string;\n /**\n * Query all the containers that parent a group.\n */\n groupId?: string;\n /**\n * Query all the containers that matches ID or an array od IDs.\n */\n containerId?: string | string[];\n};\n\nexport type Container = {\n name: string;\n id: string;\n type: ContainerType;\n};\n\nexport { PermissionStatus, PermissionResponse };\n\n/**\n * Returns whether the Contacts API is enabled on the current device. This method does not check the app permissions.\n * @returns A promise that fulfills with a `boolean`, indicating whether the Contacts API is available on the current device. It always resolves to `false` on web.\n */\nexport async function isAvailableAsync(): Promise {\n return !!ExpoContacts.getContactsAsync;\n}\n\nexport async function shareContactAsync(\n contactId: string,\n message: string,\n shareOptions: object = {}\n): Promise {\n if (Platform.OS === 'ios') {\n const url = await writeContactToFileAsync({\n id: contactId,\n });\n return await Share.share(\n {\n url,\n message,\n },\n shareOptions\n );\n } else if (!ExpoContacts.shareContactAsync) {\n throw new UnavailabilityError('Contacts', 'shareContactAsync');\n }\n return await ExpoContacts.shareContactAsync(contactId, message);\n}\n\n/**\n * Return a list of contacts that fit a given criteria. You can get all of the contacts by passing no criteria.\n * @param contactQuery Object used to query contacts.\n * @return A promise that fulfills with `ContactResponse` object returned from the query.\n * @example\n * ```js\n * const { data } = await Contacts.getContactsAsync({\n * fields: [Contacts.Fields.Emails],\n * });\n *\n * if (data.length > 0) {\n * const contact = data[0];\n * console.log(contact);\n * }\n * ```\n */\nexport async function getContactsAsync(contactQuery: ContactQuery = {}): Promise {\n if (!ExpoContacts.getContactsAsync) {\n throw new UnavailabilityError('Contacts', 'getContactsAsync');\n }\n return await ExpoContacts.getContactsAsync(contactQuery);\n}\n\nexport async function getPagedContactsAsync(\n contactQuery: ContactQuery = {}\n): Promise {\n const { pageSize, ...nOptions } = contactQuery;\n\n if (pageSize && pageSize <= 0) {\n throw new Error('Error: Contacts.getPagedContactsAsync: `pageSize` must be greater than 0');\n }\n\n return await getContactsAsync({\n ...nOptions,\n pageSize,\n });\n}\n\n/**\n * Used for gathering precise data about a contact. Returns a contact matching the given `id`.\n * @param id The ID of a system contact.\n * @param fields If specified, the fields defined will be returned. When skipped, all fields will be returned.\n * @return A promise that fulfills with `Contact` object with ID matching the input ID, or `undefined` if there is no match.\n * @example\n * ```js\n * const contact = await Contacts.getContactByIdAsync('161A368D-D614-4A15-8DC6-665FDBCFAE55');\n * if (contact) {\n * console.log(contact);\n * }\n * ```\n */\nexport async function getContactByIdAsync(\n id: string,\n fields?: FieldType[]\n): Promise {\n if (!ExpoContacts.getContactsAsync) {\n throw new UnavailabilityError('Contacts', 'getContactsAsync');\n }\n\n if (id == null) {\n throw new Error('Error: Contacts.getContactByIdAsync: Please pass an ID as a parameter');\n } else {\n const results = await ExpoContacts.getContactsAsync({\n pageSize: 1,\n pageOffset: 0,\n fields,\n id,\n });\n if (results && results.data && results.data.length > 0) {\n return results.data[0];\n }\n }\n return undefined;\n}\n\n/**\n * Creates a new contact and adds it to the system.\n * > **Note**: For Android users, the Expo Go app does not have the required `WRITE_CONTACTS` permission to write to Contacts.\n * > You will need to create a [development build](/develop/development-builds/create-a-build/) and add permission in there manually to use this method.\n * @param contact A contact with the changes you wish to persist. The `id` parameter will not be used.\n * @param containerId @tag-ios The container that will parent the contact.\n * @return A promise that fulfills with ID of the new system contact.\n * @example\n * ```js\n * const contact = {\n * [Contacts.Fields.FirstName]: 'Bird',\n * [Contacts.Fields.LastName]: 'Man',\n * [Contacts.Fields.Company]: 'Young Money',\n * };\n * const contactId = await Contacts.addContactAsync(contact);\n * ```\n */\nexport async function addContactAsync(contact: Contact, containerId?: string): Promise {\n if (!ExpoContacts.addContactAsync) {\n throw new UnavailabilityError('Contacts', 'addContactAsync');\n }\n return await ExpoContacts.addContactAsync(contact, containerId);\n}\n\n/**\n * Mutate the information of an existing contact. Due to an iOS bug, `nonGregorianBirthday` field cannot be modified.\n * > **info** On Android, you can use [`presentFormAsync`](#contactspresentformasynccontactid-contact-formoptions) to make edits to contacts.\n * @param contact A contact object including the wanted changes.\n * @return A promise that fulfills with ID of the updated system contact if mutation was successful.\n * @example\n * ```js\n * const contact = {\n * id: '161A368D-D614-4A15-8DC6-665FDBCFAE55',\n * [Contacts.Fields.FirstName]: 'Drake',\n * [Contacts.Fields.Company]: 'Young Money',\n * };\n * await Contacts.updateContactAsync(contact);\n * ```\n * @platform ios\n */\nexport async function updateContactAsync(contact: Contact): Promise {\n if (!ExpoContacts.updateContactAsync) {\n throw new UnavailabilityError('Contacts', 'updateContactAsync');\n }\n return await ExpoContacts.updateContactAsync(contact);\n}\n\n// @needs-audit\n/**\n * Delete a contact from the system.\n * @param contactId ID of the contact you want to delete.\n * @example\n * ```js\n * await Contacts.removeContactAsync('161A368D-D614-4A15-8DC6-665FDBCFAE55');\n * ```\n * @platform ios\n */\nexport async function removeContactAsync(contactId: string): Promise {\n if (!ExpoContacts.removeContactAsync) {\n throw new UnavailabilityError('Contacts', 'removeContactAsync');\n }\n return await ExpoContacts.removeContactAsync(contactId);\n}\n\n/**\n * Query a set of contacts and write them to a local URI that can be used for sharing.\n * @param contactQuery Used to query contact you want to write.\n * @return A promise that fulfills with shareable local URI, or `undefined` if there was no match.\n * @example\n * ```js\n * const localUri = await Contacts.writeContactToFileAsync({\n * id: '161A368D-D614-4A15-8DC6-665FDBCFAE55',\n * });\n * Share.share({ url: localUri, message: 'Call me!' });\n * ```\n */\nexport async function writeContactToFileAsync(\n contactQuery: ContactQuery = {}\n): Promise {\n if (!ExpoContacts.writeContactToFileAsync) {\n throw new UnavailabilityError('Contacts', 'writeContactToFileAsync');\n }\n return await ExpoContacts.writeContactToFileAsync(contactQuery);\n}\n\n// @needs-audit\n/**\n * Present a native form for manipulating contacts.\n * @param contactId The ID of a system contact.\n * @param contact A contact with the changes you want to persist.\n * @param formOptions Options for the native editor.\n * @example\n * ```js\n * await Contacts.presentFormAsync('161A368D-D614-4A15-8DC6-665FDBCFAE55');\n * ```\n */\nexport async function presentFormAsync(\n contactId?: string | null,\n contact?: Contact | null,\n formOptions: FormOptions = {}\n): Promise {\n if (!ExpoContacts.presentFormAsync) {\n throw new UnavailabilityError('Contacts', 'presentFormAsync');\n }\n if (Platform.OS === 'ios') {\n const adjustedOptions = formOptions;\n\n if (contactId) {\n if (contact) {\n contact = undefined;\n console.log(\n 'Expo.Contacts.presentFormAsync: You should define either a `contact` or a `contactId` but not both.'\n );\n }\n if (adjustedOptions.isNew !== undefined) {\n console.log(\n 'Expo.Contacts.presentFormAsync: `formOptions.isNew` is not supported with `contactId`'\n );\n }\n }\n return await ExpoContacts.presentFormAsync(contactId, contact, adjustedOptions);\n } else {\n return await ExpoContacts.presentFormAsync(contactId, contact, formOptions);\n }\n}\n\n// iOS Only\n\n/**\n * Add a group to a container.\n * @param groupId The group you want to target.\n * @param containerId The container you want to add membership to.\n * @example\n * ```js\n * await Contacts.addExistingGroupToContainerAsync(\n * '161A368D-D614-4A15-8DC6-665FDBCFAE55',\n * '665FDBCFAE55-D614-4A15-8DC6-161A368D'\n * );\n * ```\n * @platform ios\n */\nexport async function addExistingGroupToContainerAsync(\n groupId: string,\n containerId: string\n): Promise {\n if (!ExpoContacts.addExistingGroupToContainerAsync) {\n throw new UnavailabilityError('Contacts', 'addExistingGroupToContainerAsync');\n }\n\n return await ExpoContacts.addExistingGroupToContainerAsync(groupId, containerId);\n}\n\n/**\n * Create a group with a name, and add it to a container. If the container is undefined, the default container will be targeted.\n * @param name Name of the new group.\n * @param containerId The container you to add membership to.\n * @return A promise that fulfills with ID of the new group.\n * @example\n * ```js\n * const groupId = await Contacts.createGroupAsync('Sailor Moon');\n * ```\n * @platform ios\n */\nexport async function createGroupAsync(name?: string, containerId?: string): Promise {\n if (!ExpoContacts.createGroupAsync) {\n throw new UnavailabilityError('Contacts', 'createGroupAsync');\n }\n\n name = name || uuidv4();\n if (!containerId) {\n containerId = await getDefaultContainerIdAsync();\n }\n\n return await ExpoContacts.createGroupAsync(name, containerId);\n}\n\n/**\n * Change the name of an existing group.\n * @param groupName New name for an existing group.\n * @param groupId ID of the group you want to edit.\n * @example\n * ```js\n * await Contacts.updateGroupName('Expo Friends', '161A368D-D614-4A15-8DC6-665FDBCFAE55');\n * ```\n * @platform ios\n */\nexport async function updateGroupNameAsync(groupName: string, groupId: string): Promise {\n if (!ExpoContacts.updateGroupNameAsync) {\n throw new UnavailabilityError('Contacts', 'updateGroupNameAsync');\n }\n\n return await ExpoContacts.updateGroupNameAsync(groupName, groupId);\n}\n\n// @needs-audit\n/**\n * Delete a group from the device.\n * @param groupId ID of the group you want to remove.\n * @example\n * ```js\n * await Contacts.removeGroupAsync('161A368D-D614-4A15-8DC6-665FDBCFAE55');\n * ```\n * @platform ios\n */\nexport async function removeGroupAsync(groupId: string): Promise {\n if (!ExpoContacts.removeGroupAsync) {\n throw new UnavailabilityError('Contacts', 'removeGroupAsync');\n }\n\n return await ExpoContacts.removeGroupAsync(groupId);\n}\n\n// @needs-audit\n/**\n * Add a contact as a member to a group. A contact can be a member of multiple groups.\n * @param contactId ID of the contact you want to edit.\n * @param groupId ID for the group you want to add membership to.\n * @example\n * ```js\n * await Contacts.addExistingContactToGroupAsync(\n * '665FDBCFAE55-D614-4A15-8DC6-161A368D',\n * '161A368D-D614-4A15-8DC6-665FDBCFAE55'\n * );\n * ```\n * @platform ios\n */\nexport async function addExistingContactToGroupAsync(\n contactId: string,\n groupId: string\n): Promise {\n if (!ExpoContacts.addExistingContactToGroupAsync) {\n throw new UnavailabilityError('Contacts', 'addExistingContactToGroupAsync');\n }\n\n return await ExpoContacts.addExistingContactToGroupAsync(contactId, groupId);\n}\n\n// @needs-audit\n/**\n * Remove a contact's membership from a given group. This will not delete the contact.\n * @param contactId ID of the contact you want to remove.\n * @param groupId ID for the group you want to remove membership of.\n * @example\n * ```js\n * await Contacts.removeContactFromGroupAsync(\n * '665FDBCFAE55-D614-4A15-8DC6-161A368D',\n * '161A368D-D614-4A15-8DC6-665FDBCFAE55'\n * );\n * ```\n * @platform ios\n */\nexport async function removeContactFromGroupAsync(\n contactId: string,\n groupId: string\n): Promise {\n if (!ExpoContacts.removeContactFromGroupAsync) {\n throw new UnavailabilityError('Contacts', 'removeContactFromGroupAsync');\n }\n\n return await ExpoContacts.removeContactFromGroupAsync(contactId, groupId);\n}\n\n// @needs-audit\n/**\n * Query and return a list of system groups.\n * @param groupQuery Information regarding which groups you want to get.\n * @example\n * ```js\n * const groups = await Contacts.getGroupsAsync({ groupName: 'sailor moon' });\n * const allGroups = await Contacts.getGroupsAsync({});\n * ```\n * @return A promise that fulfills with array of groups that fit the query.\n * @platform ios\n */\nexport async function getGroupsAsync(groupQuery: GroupQuery): Promise {\n if (!ExpoContacts.getGroupsAsync) {\n throw new UnavailabilityError('Contacts', 'getGroupsAsync');\n }\n\n return await ExpoContacts.getGroupsAsync(groupQuery);\n}\n\n/**\n * Get the default container's ID.\n * @return A promise that fulfills with default container ID.\n * @example\n * ```js\n * const containerId = await Contacts.getDefaultContainerIdAsync();\n * ```\n * @platform ios\n */\nexport async function getDefaultContainerIdAsync(): Promise {\n if (!ExpoContacts.getDefaultContainerIdentifierAsync) {\n throw new UnavailabilityError('Contacts', 'getDefaultContainerIdentifierAsync');\n }\n\n return await ExpoContacts.getDefaultContainerIdentifierAsync();\n}\n\n/**\n * Query a list of system containers.\n * @param containerQuery Information used to gather containers.\n * @return A promise that fulfills with array of containers that fit the query.\n * @example\n * ```js\n * const allContainers = await Contacts.getContainersAsync({\n * contactId: '665FDBCFAE55-D614-4A15-8DC6-161A368D',\n * });\n * ```\n * @platform ios\n */\nexport async function getContainersAsync(containerQuery: ContainerQuery): Promise {\n if (!ExpoContacts.getContainersAsync) {\n throw new UnavailabilityError('Contacts', 'getContainersAsync');\n }\n\n return await ExpoContacts.getContainersAsync(containerQuery);\n}\n\n/**\n * Checks user's permissions for accessing contacts data.\n * @return A promise that resolves to a [PermissionResponse](#permissionresponse) object.\n */\nexport async function getPermissionsAsync(): Promise {\n if (!ExpoContacts.getPermissionsAsync) {\n throw new UnavailabilityError('Contacts', 'getPermissionsAsync');\n }\n\n return await ExpoContacts.getPermissionsAsync();\n}\n\n/**\n * Asks the user to grant permissions for accessing contacts data.\n * @return A promise that resolves to a [PermissionResponse](#permissionresponse) object.\n */\nexport async function requestPermissionsAsync(): Promise {\n if (!ExpoContacts.requestPermissionsAsync) {\n throw new UnavailabilityError('Contacts', 'requestPermissionsAsync');\n }\n\n return await ExpoContacts.requestPermissionsAsync();\n}\n\n/**\n * Possible fields to retrieve for a contact.\n */\nexport enum Fields {\n ID = 'id',\n ContactType = 'contactType',\n Name = 'name',\n FirstName = 'firstName',\n MiddleName = 'middleName',\n LastName = 'lastName',\n MaidenName = 'maidenName',\n NamePrefix = 'namePrefix',\n NameSuffix = 'nameSuffix',\n Nickname = 'nickname',\n PhoneticFirstName = 'phoneticFirstName',\n PhoneticMiddleName = 'phoneticMiddleName',\n PhoneticLastName = 'phoneticLastName',\n Birthday = 'birthday',\n /**\n * @platform ios\n */\n NonGregorianBirthday = 'nonGregorianBirthday',\n Emails = 'emails',\n PhoneNumbers = 'phoneNumbers',\n Addresses = 'addresses',\n /**\n * @platform ios\n */\n SocialProfiles = 'socialProfiles',\n InstantMessageAddresses = 'instantMessageAddresses',\n UrlAddresses = 'urlAddresses',\n Company = 'company',\n JobTitle = 'jobTitle',\n Department = 'department',\n ImageAvailable = 'imageAvailable',\n Image = 'image',\n RawImage = 'rawImage',\n ExtraNames = 'extraNames',\n Note = 'note',\n Dates = 'dates',\n Relationships = 'relationships',\n}\n\n/**\n * This format denotes the common calendar format used to specify how a date is calculated in `nonGregorianBirthday` fields.\n */\nexport enum CalendarFormats {\n Gregorian = 'gregorian',\n /**\n * @platform ios\n */\n Buddhist = 'buddhist',\n /**\n * @platform ios\n */\n Chinese = 'chinese',\n /**\n * @platform ios\n */\n Coptic = 'coptic',\n /**\n * @platform ios\n */\n EthiopicAmeteMihret = 'ethiopicAmeteMihret',\n /**\n * @platform ios\n */\n EthiopicAmeteAlem = 'ethiopicAmeteAlem',\n /**\n * @platform ios\n */\n Hebrew = 'hebrew',\n /**\n * @platform ios\n */\n ISO8601 = 'iso8601',\n /**\n * @platform ios\n */\n Indian = 'indian',\n /**\n * @platform ios\n */\n Islamic = 'islamic',\n /**\n * @platform ios\n */\n IslamicCivil = 'islamicCivil',\n /**\n * @platform ios\n */\n Japanese = 'japanese',\n /**\n * @platform ios\n */\n Persian = 'persian',\n /**\n * @platform ios\n */\n RepublicOfChina = 'republicOfChina',\n /**\n * @platform ios\n */\n IslamicTabular = 'islamicTabular',\n /**\n * @platform ios\n */\n IslamicUmmAlQura = 'islamicUmmAlQura',\n}\n\n/**\n * @platform ios\n */\nexport enum ContainerTypes {\n /**\n * A local non-iCloud container.\n */\n Local = 'local',\n /**\n * In association with email server.\n */\n Exchange = 'exchange',\n /**\n * With cardDAV protocol used for sharing.\n */\n CardDAV = 'cardDAV',\n /**\n * Unknown container.\n */\n Unassigned = 'unassigned',\n}\n\nexport enum SortTypes {\n /**\n * The user default method of sorting.\n * @platform android\n */\n UserDefault = 'userDefault',\n /**\n * Sort by first name in ascending order.\n */\n FirstName = 'firstName',\n /**\n * Sort by last name in ascending order.\n */\n LastName = 'lastName',\n /**\n * No sorting should be applied.\n */\n None = 'none',\n}\n\nexport enum ContactTypes {\n /**\n * Contact is a human.\n */\n Person = 'person',\n /**\n * Contact is group or company.\n */\n Company = 'company',\n}\n"]} \ No newline at end of file +{"version":3,"file":"Contacts.js","sourceRoot":"","sources":["../src/Contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,GACP,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AA+hB1C,OAAO,EAAE,gBAAgB,EAAsB,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,OAAO,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAAiB,EACjB,OAAe,EACf,eAAuB,EAAE;IAEzB,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;QACzB,MAAM,GAAG,GAAG,MAAM,uBAAuB,CAAC;YACxC,EAAE,EAAE,SAAS;SACd,CAAC,CAAC;QACH,OAAO,MAAM,KAAK,CAAC,KAAK,CACtB;YACE,GAAG;YACH,OAAO;SACR,EACD,YAAY,CACb,CAAC;KACH;SAAM,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE;QAC1C,MAAM,IAAI,mBAAmB,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;KAChE;IACD,OAAO,MAAM,YAAY,CAAC,iBAAiB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,eAA6B,EAAE;IACpE,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE;QAClC,MAAM,IAAI,mBAAmB,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;KAC/D;IACD,OAAO,MAAM,YAAY,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;AAC3D,CA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AEG;IACH,uCAAqB,CAAA;IACrB;;OAEG;IACH,qCAAmB,CAAA;IACnB;;OAEG;IACH,2CAAyB,CAAA;AAC3B,CAAC,EAjBW,cAAc,KAAd,cAAc,QAiBzB;AAED,MAAM,CAAN,IAAY,SAkBX;AAlBD,WAAY,SAAS;IACnB;;;OAGG;IACH,wCAA2B,CAAA;IAC3B;;OAEG;IACH,oCAAuB,CAAA;IACvB;;OAEG;IACH,kCAAqB,CAAA;IACrB;;OAEG;IACH,0BAAa,CAAA;AACf,CAAC,EAlBW,SAAS,KAAT,SAAS,QAkBpB;AAED,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB;;OAEG;IACH,iCAAiB,CAAA;IACjB;;OAEG;IACH,mCAAmB,CAAA;AACrB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB","sourcesContent":["import {\n PermissionResponse,\n PermissionStatus,\n UnavailabilityError,\n uuidv4,\n} from 'expo-modules-core';\nimport { Platform, Share } from 'react-native';\n\nimport ExpoContacts from './ExpoContacts';\n\nexport type CalendarFormatType = CalendarFormats | `${CalendarFormats}`;\n\nexport type ContainerType = ContainerTypes | `${ContainerTypes}`;\n\nexport type ContactType = ContactTypes | `${ContactTypes}`;\n\nexport type FieldType = Fields | `${Fields}`;\n\nexport type Date = {\n /**\n * Day.\n */\n day?: number;\n /**\n * Month - adjusted for JavaScript `Date` which starts at `0`.\n */\n month?: number;\n /**\n * Year.\n */\n year?: number;\n /**\n * Unique ID.\n */\n id: string;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Format for the input date.\n */\n format?: CalendarFormatType;\n};\n\nexport type Relationship = {\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Name of related contact.\n */\n name?: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\nexport type Email = {\n /**\n * Email address.\n */\n email?: string;\n /**\n * Flag signifying if it is a primary email address.\n */\n isPrimary?: boolean;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\nexport type PhoneNumber = {\n /**\n * Phone number.\n */\n number?: string;\n /**\n * Flag signifying if it is a primary phone number.\n */\n isPrimary?: boolean;\n /**\n * Phone number without format.\n * @example `8674305`\n */\n digits?: string;\n /**\n * Country code.\n * @example `+1`\n */\n countryCode?: string;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\nexport type Address = {\n /**\n * Street name.\n */\n street?: string;\n /**\n * City name.\n */\n city?: string;\n /**\n * Country name\n */\n country?: string;\n /**\n * Region or state name.\n */\n region?: string;\n /**\n * Neighborhood name.\n */\n neighborhood?: string;\n /**\n * Local post code.\n */\n postalCode?: string;\n /**\n * P.O. Box.\n */\n poBox?: string;\n /**\n * [Standard country code](https://www.iso.org/iso-3166-country-codes.html).\n */\n isoCountryCode?: string;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\n/**\n * @platform ios\n */\nexport type SocialProfile = {\n /**\n * Name of social app.\n */\n service?: string;\n /**\n * Localized profile name.\n */\n localizedProfile?: string;\n /**\n * Web URL.\n */\n url?: string;\n /**\n * Username in social app.\n */\n username?: string;\n /**\n * Username ID in social app.\n */\n userId?: string;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\nexport type InstantMessageAddress = {\n /**\n * Name of instant messaging app.\n */\n service?: string;\n /**\n * Username in IM app.\n */\n username?: string;\n /**\n * Localized name of app.\n */\n localizedService?: string;\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\nexport type UrlAddress = {\n /**\n * Localized display name.\n */\n label: string;\n /**\n * Web URL.\n */\n url?: string;\n /**\n * Unique ID.\n */\n id: string;\n};\n\n// @needs-audit\n/**\n * Information regarding thumbnail images.\n * > On Android you can get dimensions using [`Image.getSize`](https://reactnative.dev/docs/image#getsize) method.\n */\nexport type Image = {\n uri?: string;\n /**\n * Image width.\n * @platform ios\n */\n width?: number;\n /**\n * Image height\n * @platform ios\n */\n height?: number;\n /**\n * Image as Base64 string.\n */\n base64?: string;\n};\n\n/**\n * A set of fields that define information about a single contact entity.\n */\nexport type Contact = {\n /**\n * Immutable identifier used for querying and indexing.\n */\n id: string;\n /**\n * Denoting a person or company.\n */\n contactType: ContactType;\n /**\n * Full name with proper format.\n */\n name: string;\n /**\n * Given name.\n */\n firstName?: string;\n /**\n * Middle name\n */\n middleName?: string;\n /**\n * Last name.\n */\n lastName?: string;\n /**\n * Maiden name.\n */\n maidenName?: string;\n /**\n * Dr. Mr. Mrs. ect…\n */\n namePrefix?: string;\n /**\n * Jr. Sr. ect…\n */\n nameSuffix?: string;\n /**\n * An alias to the proper name.\n */\n nickname?: string;\n /**\n * Pronunciation of the first name.\n */\n phoneticFirstName?: string;\n /**\n * Pronunciation of the middle name.\n */\n phoneticMiddleName?: string;\n /**\n * Pronunciation of the last name.\n */\n phoneticLastName?: string;\n /**\n * Organization the entity belongs to.\n */\n company?: string;\n /**\n * Job description.\n */\n jobTitle?: string;\n /**\n * Job department.\n */\n department?: string;\n /**\n * Additional information.\n * > On iOS 13+, the `note` field [requires your app to request additional entitlements](https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_contacts_notes).\n * > The Expo Go app does not contain those entitlements, so in order to test this feature you will need to [request the entitlement from Apple](https://developer.apple.com/contact/request/contact-note-field),\n * > set the [`ios.accessesContactNotes`](./config/app.mdx#accessescontactnotes) field in app.json to `true`, and [create your development build](/develop/development-builds/create-a-build/).\n */\n note?: string;\n /**\n * Used for efficient retrieval of images.\n */\n imageAvailable?: boolean;\n /**\n * Thumbnail image. On iOS it size is set to 320×320px, on Android it may vary.\n */\n image?: Image;\n /**\n * Raw image without cropping, usually large.\n */\n rawImage?: Image;\n /**\n * Birthday information in Gregorian format.\n */\n birthday?: Date;\n /**\n * A labeled list of other relevant user dates in Gregorian format.\n */\n dates?: Date[];\n /**\n * Names of other relevant user connections.\n */\n relationships?: Relationship[];\n /**\n * Email addresses.\n */\n emails?: Email[];\n /**\n * Phone numbers.\n */\n phoneNumbers?: PhoneNumber[];\n /**\n * Locations.\n */\n addresses?: Address[];\n /**\n * Instant messaging connections.\n */\n instantMessageAddresses?: InstantMessageAddress[];\n /**\n * Associated web URLs.\n */\n urlAddresses?: UrlAddress[];\n /**\n * Birthday that doesn't conform to the Gregorian calendar format, interpreted based on the [calendar `format`](#date) setting.\n * @platform ios\n */\n nonGregorianBirthday?: Date;\n /**\n * Social networks.\n * @platform ios\n */\n socialProfiles?: SocialProfile[];\n};\n\n/**\n * The return value for queried contact operations like `getContactsAsync`.\n */\nexport type ContactResponse = {\n /**\n * An array of contacts that match a particular query.\n */\n data: Contact[];\n /**\n * This will be `true` if there are more contacts to retrieve beyond what is returned.\n */\n hasNextPage: boolean;\n /**\n * This will be `true if there are previous contacts that weren't retrieved due to `pageOffset` limit.\n */\n hasPreviousPage: boolean;\n};\n\nexport type ContactSort = `${SortTypes}`;\n\n/**\n * Used to query contacts from the user's device.\n */\nexport type ContactQuery = {\n /**\n * The max number of contacts to return. If skipped or set to `0` all contacts will be returned.\n */\n pageSize?: number;\n /**\n * The number of contacts to skip before gathering contacts.\n */\n pageOffset?: number;\n /**\n * If specified, the defined fields will be returned. If skipped, all fields will be returned.\n */\n fields?: FieldType[];\n /**\n * Sort method used when gathering contacts.\n */\n sort?: ContactSort;\n /**\n * Get all contacts whose name contains the provided string (not case-sensitive).\n */\n name?: string;\n /**\n * Get contacts with a matching ID or array of IDs.\n */\n id?: string | string[];\n /**\n * Get all contacts that belong to the group matching this ID.\n * @platform ios\n */\n groupId?: string;\n /**\n * Get all contacts that belong to the container matching this ID.\n * @platform ios\n */\n containerId?: string;\n /**\n * Prevent unification of contacts when gathering.\n * @default false\n * @platform ios\n */\n rawContacts?: boolean;\n};\n\n/**\n * Denotes the functionality of a native contact form.\n */\nexport type FormOptions = {\n /**\n * The properties that will be displayed. On iOS those properties does nothing while in editing mode.\n */\n displayedPropertyKeys?: FieldType[];\n /**\n * Controller title.\n */\n message?: string;\n /**\n * Used if contact doesn't have a name defined.\n */\n alternateName?: string;\n /**\n * Allows for contact mutation.\n */\n allowsEditing?: boolean;\n /**\n * Actions like share, add, create.\n */\n allowsActions?: boolean;\n /**\n * Show or hide the similar contacts.\n */\n shouldShowLinkedContacts?: boolean;\n /**\n * Present the new contact controller. If set to `false` the unknown controller will be shown.\n */\n isNew?: boolean;\n /**\n * The name of the left bar button.\n */\n cancelButtonTitle?: string;\n /**\n * Prevents the controller from animating in.\n */\n preventAnimation?: boolean;\n /**\n * The parent group for a new contact.\n */\n groupId?: string;\n};\n\n/**\n * Used to query native contact groups.\n * @platform ios\n */\nexport type GroupQuery = {\n /**\n * Query the group with a matching ID.\n */\n groupId?: string;\n /**\n * Query all groups matching a name.\n */\n groupName?: string;\n /**\n * Query all groups that belong to a certain container.\n */\n containerId?: string;\n};\n\n/**\n * A parent to contacts. A contact can belong to multiple groups. Here are some query operations you can perform:\n * - Child Contacts: `getContactsAsync({ groupId })`\n * - Groups From Container: `getGroupsAsync({ containerId })`\n * - Groups Named: `getContainersAsync({ groupName })`\n * @platform ios\n */\nexport type Group = {\n /**\n * Immutable id representing the group.\n */\n name?: string;\n /**\n * The editable name of a group.\n */\n id?: string;\n};\n\n/**\n * Used to query native contact containers.\n * @platform ios\n */\nexport type ContainerQuery = {\n /**\n * Query all the containers that parent a contact.\n */\n contactId?: string;\n /**\n * Query all the containers that parent a group.\n */\n groupId?: string;\n /**\n * Query all the containers that matches ID or an array od IDs.\n */\n containerId?: string | string[];\n};\n\nexport type Container = {\n name: string;\n id: string;\n type: ContainerType;\n};\n\nexport { PermissionStatus, PermissionResponse };\n\n/**\n * Returns whether the Contacts API is enabled on the current device. This method does not check the app permissions.\n * @returns A promise that fulfills with a `boolean`, indicating whether the Contacts API is available on the current device. It always resolves to `false` on web.\n */\nexport async function isAvailableAsync(): Promise {\n return !!ExpoContacts.getContactsAsync;\n}\n\nexport async function shareContactAsync(\n contactId: string,\n message: string,\n shareOptions: object = {}\n): Promise {\n if (Platform.OS === 'ios') {\n const url = await writeContactToFileAsync({\n id: contactId,\n });\n return await Share.share(\n {\n url,\n message,\n },\n shareOptions\n );\n } else if (!ExpoContacts.shareContactAsync) {\n throw new UnavailabilityError('Contacts', 'shareContactAsync');\n }\n return await ExpoContacts.shareContactAsync(contactId, message);\n}\n\n/**\n * Return a list of contacts that fit a given criteria. You can get all of the contacts by passing no criteria.\n * @param contactQuery Object used to query contacts.\n * @return A promise that fulfills with `ContactResponse` object returned from the query.\n * @example\n * ```js\n * const { data } = await Contacts.getContactsAsync({\n * fields: [Contacts.Fields.Emails],\n * });\n *\n * if (data.length > 0) {\n * const contact = data[0];\n * console.log(contact);\n * }\n * ```\n */\nexport async function getContactsAsync(contactQuery: ContactQuery = {}): Promise {\n if (!ExpoContacts.getContactsAsync) {\n throw new UnavailabilityError('Contacts', 'getContactsAsync');\n }\n return await ExpoContacts.getContactsAsync(contactQuery);\n}\n\nexport async function getPagedContactsAsync(\n contactQuery: ContactQuery = {}\n): Promise {\n const { pageSize, ...nOptions } = contactQuery;\n\n if (pageSize && pageSize <= 0) {\n throw new Error('Error: Contacts.getPagedContactsAsync: `pageSize` must be greater than 0');\n }\n\n return await getContactsAsync({\n ...nOptions,\n pageSize,\n });\n}\n\n/**\n * Used for gathering precise data about a contact. Returns a contact matching the given `id`.\n * @param id The ID of a system contact.\n * @param fields If specified, the fields defined will be returned. When skipped, all fields will be returned.\n * @return A promise that fulfills with `Contact` object with ID matching the input ID, or `undefined` if there is no match.\n * @example\n * ```js\n * const contact = await Contacts.getContactByIdAsync('161A368D-D614-4A15-8DC6-665FDBCFAE55');\n * if (contact) {\n * console.log(contact);\n * }\n * ```\n */\nexport async function getContactByIdAsync(\n id: string,\n fields?: FieldType[]\n): Promise {\n if (!ExpoContacts.getContactsAsync) {\n throw new UnavailabilityError('Contacts', 'getContactsAsync');\n }\n\n if (id == null) {\n throw new Error('Error: Contacts.getContactByIdAsync: Please pass an ID as a parameter');\n } else {\n const results = await ExpoContacts.getContactsAsync({\n pageSize: 1,\n pageOffset: 0,\n fields,\n id,\n });\n if (results && results.data && results.data.length > 0) {\n return results.data[0];\n }\n }\n return undefined;\n}\n\n/**\n * Creates a new contact and adds it to the system.\n * > **Note**: For Android users, the Expo Go app does not have the required `WRITE_CONTACTS` permission to write to Contacts.\n * > You will need to create a [development build](/develop/development-builds/create-a-build/) and add permission in there manually to use this method.\n * @param contact A contact with the changes you wish to persist. The `id` parameter will not be used.\n * @param containerId @tag-ios The container that will parent the contact.\n * @return A promise that fulfills with ID of the new system contact.\n * @example\n * ```js\n * const contact = {\n * [Contacts.Fields.FirstName]: 'Bird',\n * [Contacts.Fields.LastName]: 'Man',\n * [Contacts.Fields.Company]: 'Young Money',\n * };\n * const contactId = await Contacts.addContactAsync(contact);\n * ```\n */\nexport async function addContactAsync(contact: Contact, containerId?: string): Promise {\n if (!ExpoContacts.addContactAsync) {\n throw new UnavailabilityError('Contacts', 'addContactAsync');\n }\n return await ExpoContacts.addContactAsync(contact, containerId);\n}\n\n/**\n * Mutate the information of an existing contact. Due to an iOS bug, `nonGregorianBirthday` field cannot be modified.\n * > **info** On Android, you can use [`presentFormAsync`](#contactspresentformasynccontactid-contact-formoptions) to make edits to contacts.\n * @param contact A contact object including the wanted changes.\n * @return A promise that fulfills with ID of the updated system contact if mutation was successful.\n * @example\n * ```js\n * const contact = {\n * id: '161A368D-D614-4A15-8DC6-665FDBCFAE55',\n * [Contacts.Fields.FirstName]: 'Drake',\n * [Contacts.Fields.Company]: 'Young Money',\n * };\n * await Contacts.updateContactAsync(contact);\n * ```\n * @platform ios\n */\nexport async function updateContactAsync(contact: Contact): Promise {\n if (!ExpoContacts.updateContactAsync) {\n throw new UnavailabilityError('Contacts', 'updateContactAsync');\n }\n return await ExpoContacts.updateContactAsync(contact);\n}\n\n// @needs-audit\n/**\n * Delete a contact from the system.\n * @param contactId ID of the contact you want to delete.\n * @example\n * ```js\n * await Contacts.removeContactAsync('161A368D-D614-4A15-8DC6-665FDBCFAE55');\n * ```\n * @platform ios\n */\nexport async function removeContactAsync(contactId: string): Promise {\n if (!ExpoContacts.removeContactAsync) {\n throw new UnavailabilityError('Contacts', 'removeContactAsync');\n }\n return await ExpoContacts.removeContactAsync(contactId);\n}\n\n/**\n * Query a set of contacts and write them to a local URI that can be used for sharing.\n * @param contactQuery Used to query contact you want to write.\n * @return A promise that fulfills with shareable local URI, or `undefined` if there was no match.\n * @example\n * ```js\n * const localUri = await Contacts.writeContactToFileAsync({\n * id: '161A368D-D614-4A15-8DC6-665FDBCFAE55',\n * });\n * Share.share({ url: localUri, message: 'Call me!' });\n * ```\n */\nexport async function writeContactToFileAsync(\n contactQuery: ContactQuery = {}\n): Promise {\n if (!ExpoContacts.writeContactToFileAsync) {\n throw new UnavailabilityError('Contacts', 'writeContactToFileAsync');\n }\n return await ExpoContacts.writeContactToFileAsync(contactQuery);\n}\n\n// @needs-audit\n/**\n * Present a native form for manipulating contacts.\n * @param contactId The ID of a system contact.\n * @param contact A contact with the changes you want to persist.\n * @param formOptions Options for the native editor.\n * @example\n * ```js\n * await Contacts.presentFormAsync('161A368D-D614-4A15-8DC6-665FDBCFAE55');\n * ```\n */\nexport async function presentFormAsync(\n contactId?: string | null,\n contact?: Contact | null,\n formOptions: FormOptions = {}\n): Promise {\n if (!ExpoContacts.presentFormAsync) {\n throw new UnavailabilityError('Contacts', 'presentFormAsync');\n }\n if (Platform.OS === 'ios') {\n const adjustedOptions = formOptions;\n\n if (contactId) {\n if (contact) {\n contact = undefined;\n console.log(\n 'Expo.Contacts.presentFormAsync: You should define either a `contact` or a `contactId` but not both.'\n );\n }\n if (adjustedOptions.isNew !== undefined) {\n console.log(\n 'Expo.Contacts.presentFormAsync: `formOptions.isNew` is not supported with `contactId`'\n );\n }\n }\n return await ExpoContacts.presentFormAsync(contactId, contact, adjustedOptions);\n } else {\n return await ExpoContacts.presentFormAsync(contactId, contact, formOptions);\n }\n}\n\n// iOS Only\n\n/**\n * Add a group to a container.\n * @param groupId The group you want to target.\n * @param containerId The container you want to add membership to.\n * @example\n * ```js\n * await Contacts.addExistingGroupToContainerAsync(\n * '161A368D-D614-4A15-8DC6-665FDBCFAE55',\n * '665FDBCFAE55-D614-4A15-8DC6-161A368D'\n * );\n * ```\n * @platform ios\n */\nexport async function addExistingGroupToContainerAsync(\n groupId: string,\n containerId: string\n): Promise {\n if (!ExpoContacts.addExistingGroupToContainerAsync) {\n throw new UnavailabilityError('Contacts', 'addExistingGroupToContainerAsync');\n }\n\n return await ExpoContacts.addExistingGroupToContainerAsync(groupId, containerId);\n}\n\n/**\n * Create a group with a name, and add it to a container. If the container is undefined, the default container will be targeted.\n * @param name Name of the new group.\n * @param containerId The container you to add membership to.\n * @return A promise that fulfills with ID of the new group.\n * @example\n * ```js\n * const groupId = await Contacts.createGroupAsync('Sailor Moon');\n * ```\n * @platform ios\n */\nexport async function createGroupAsync(name?: string, containerId?: string): Promise {\n if (!ExpoContacts.createGroupAsync) {\n throw new UnavailabilityError('Contacts', 'createGroupAsync');\n }\n\n name = name || uuidv4();\n if (!containerId) {\n containerId = await getDefaultContainerIdAsync();\n }\n\n return await ExpoContacts.createGroupAsync(name, containerId);\n}\n\n/**\n * Change the name of an existing group.\n * @param groupName New name for an existing group.\n * @param groupId ID of the group you want to edit.\n * @example\n * ```js\n * await Contacts.updateGroupName('Expo Friends', '161A368D-D614-4A15-8DC6-665FDBCFAE55');\n * ```\n * @platform ios\n */\nexport async function updateGroupNameAsync(groupName: string, groupId: string): Promise {\n if (!ExpoContacts.updateGroupNameAsync) {\n throw new UnavailabilityError('Contacts', 'updateGroupNameAsync');\n }\n\n return await ExpoContacts.updateGroupNameAsync(groupName, groupId);\n}\n\n// @needs-audit\n/**\n * Delete a group from the device.\n * @param groupId ID of the group you want to remove.\n * @example\n * ```js\n * await Contacts.removeGroupAsync('161A368D-D614-4A15-8DC6-665FDBCFAE55');\n * ```\n * @platform ios\n */\nexport async function removeGroupAsync(groupId: string): Promise {\n if (!ExpoContacts.removeGroupAsync) {\n throw new UnavailabilityError('Contacts', 'removeGroupAsync');\n }\n\n return await ExpoContacts.removeGroupAsync(groupId);\n}\n\n// @needs-audit\n/**\n * Add a contact as a member to a group. A contact can be a member of multiple groups.\n * @param contactId ID of the contact you want to edit.\n * @param groupId ID for the group you want to add membership to.\n * @example\n * ```js\n * await Contacts.addExistingContactToGroupAsync(\n * '665FDBCFAE55-D614-4A15-8DC6-161A368D',\n * '161A368D-D614-4A15-8DC6-665FDBCFAE55'\n * );\n * ```\n * @platform ios\n */\nexport async function addExistingContactToGroupAsync(\n contactId: string,\n groupId: string\n): Promise {\n if (!ExpoContacts.addExistingContactToGroupAsync) {\n throw new UnavailabilityError('Contacts', 'addExistingContactToGroupAsync');\n }\n\n return await ExpoContacts.addExistingContactToGroupAsync(contactId, groupId);\n}\n\n// @needs-audit\n/**\n * Remove a contact's membership from a given group. This will not delete the contact.\n * @param contactId ID of the contact you want to remove.\n * @param groupId ID for the group you want to remove membership of.\n * @example\n * ```js\n * await Contacts.removeContactFromGroupAsync(\n * '665FDBCFAE55-D614-4A15-8DC6-161A368D',\n * '161A368D-D614-4A15-8DC6-665FDBCFAE55'\n * );\n * ```\n * @platform ios\n */\nexport async function removeContactFromGroupAsync(\n contactId: string,\n groupId: string\n): Promise {\n if (!ExpoContacts.removeContactFromGroupAsync) {\n throw new UnavailabilityError('Contacts', 'removeContactFromGroupAsync');\n }\n\n return await ExpoContacts.removeContactFromGroupAsync(contactId, groupId);\n}\n\n// @needs-audit\n/**\n * Query and return a list of system groups.\n * @param groupQuery Information regarding which groups you want to get.\n * @example\n * ```js\n * const groups = await Contacts.getGroupsAsync({ groupName: 'sailor moon' });\n * const allGroups = await Contacts.getGroupsAsync({});\n * ```\n * @return A promise that fulfills with array of groups that fit the query.\n * @platform ios\n */\nexport async function getGroupsAsync(groupQuery: GroupQuery): Promise {\n if (!ExpoContacts.getGroupsAsync) {\n throw new UnavailabilityError('Contacts', 'getGroupsAsync');\n }\n\n return await ExpoContacts.getGroupsAsync(groupQuery);\n}\n\n/**\n * Get the default container's ID.\n * @return A promise that fulfills with default container ID.\n * @example\n * ```js\n * const containerId = await Contacts.getDefaultContainerIdAsync();\n * ```\n * @platform ios\n */\nexport async function getDefaultContainerIdAsync(): Promise {\n if (!ExpoContacts.getDefaultContainerIdentifierAsync) {\n throw new UnavailabilityError('Contacts', 'getDefaultContainerIdentifierAsync');\n }\n\n return await ExpoContacts.getDefaultContainerIdentifierAsync();\n}\n\n/**\n * Query a list of system containers.\n * @param containerQuery Information used to gather containers.\n * @return A promise that fulfills with array of containers that fit the query.\n * @example\n * ```js\n * const allContainers = await Contacts.getContainersAsync({\n * contactId: '665FDBCFAE55-D614-4A15-8DC6-161A368D',\n * });\n * ```\n * @platform ios\n */\nexport async function getContainersAsync(containerQuery: ContainerQuery): Promise {\n if (!ExpoContacts.getContainersAsync) {\n throw new UnavailabilityError('Contacts', 'getContainersAsync');\n }\n\n return await ExpoContacts.getContainersAsync(containerQuery);\n}\n\n/**\n * Checks user's permissions for accessing contacts data.\n * @return A promise that resolves to a [PermissionResponse](#permissionresponse) object.\n */\nexport async function getPermissionsAsync(): Promise {\n if (!ExpoContacts.getPermissionsAsync) {\n throw new UnavailabilityError('Contacts', 'getPermissionsAsync');\n }\n\n return await ExpoContacts.getPermissionsAsync();\n}\n\n/**\n * Asks the user to grant permissions for accessing contacts data.\n * @return A promise that resolves to a [PermissionResponse](#permissionresponse) object.\n */\nexport async function requestPermissionsAsync(): Promise {\n if (!ExpoContacts.requestPermissionsAsync) {\n throw new UnavailabilityError('Contacts', 'requestPermissionsAsync');\n }\n\n return await ExpoContacts.requestPermissionsAsync();\n}\n\n/**\n * Possible fields to retrieve for a contact.\n */\nexport enum Fields {\n ID = 'id',\n ContactType = 'contactType',\n Name = 'name',\n FirstName = 'firstName',\n MiddleName = 'middleName',\n LastName = 'lastName',\n MaidenName = 'maidenName',\n NamePrefix = 'namePrefix',\n NameSuffix = 'nameSuffix',\n Nickname = 'nickname',\n PhoneticFirstName = 'phoneticFirstName',\n PhoneticMiddleName = 'phoneticMiddleName',\n PhoneticLastName = 'phoneticLastName',\n Birthday = 'birthday',\n /**\n * @platform ios\n */\n NonGregorianBirthday = 'nonGregorianBirthday',\n Emails = 'emails',\n PhoneNumbers = 'phoneNumbers',\n Addresses = 'addresses',\n /**\n * @platform ios\n */\n SocialProfiles = 'socialProfiles',\n InstantMessageAddresses = 'instantMessageAddresses',\n UrlAddresses = 'urlAddresses',\n Company = 'company',\n JobTitle = 'jobTitle',\n Department = 'department',\n ImageAvailable = 'imageAvailable',\n Image = 'image',\n RawImage = 'rawImage',\n ExtraNames = 'extraNames',\n Note = 'note',\n Dates = 'dates',\n Relationships = 'relationships',\n}\n\n/**\n * This format denotes the common calendar format used to specify how a date is calculated in `nonGregorianBirthday` fields.\n */\nexport enum CalendarFormats {\n Gregorian = 'gregorian',\n /**\n * @platform ios\n */\n Buddhist = 'buddhist',\n /**\n * @platform ios\n */\n Chinese = 'chinese',\n /**\n * @platform ios\n */\n Coptic = 'coptic',\n /**\n * @platform ios\n */\n EthiopicAmeteMihret = 'ethiopicAmeteMihret',\n /**\n * @platform ios\n */\n EthiopicAmeteAlem = 'ethiopicAmeteAlem',\n /**\n * @platform ios\n */\n Hebrew = 'hebrew',\n /**\n * @platform ios\n */\n ISO8601 = 'iso8601',\n /**\n * @platform ios\n */\n Indian = 'indian',\n /**\n * @platform ios\n */\n Islamic = 'islamic',\n /**\n * @platform ios\n */\n IslamicCivil = 'islamicCivil',\n /**\n * @platform ios\n */\n Japanese = 'japanese',\n /**\n * @platform ios\n */\n Persian = 'persian',\n /**\n * @platform ios\n */\n RepublicOfChina = 'republicOfChina',\n /**\n * @platform ios\n */\n IslamicTabular = 'islamicTabular',\n /**\n * @platform ios\n */\n IslamicUmmAlQura = 'islamicUmmAlQura',\n}\n\n/**\n * @platform ios\n */\nexport enum ContainerTypes {\n /**\n * A local non-iCloud container.\n */\n Local = 'local',\n /**\n * In association with email server.\n */\n Exchange = 'exchange',\n /**\n * With cardDAV protocol used for sharing.\n */\n CardDAV = 'cardDAV',\n /**\n * Unknown container.\n */\n Unassigned = 'unassigned',\n}\n\nexport enum SortTypes {\n /**\n * The user default method of sorting.\n * @platform android\n */\n UserDefault = 'userDefault',\n /**\n * Sort by first name in ascending order.\n */\n FirstName = 'firstName',\n /**\n * Sort by last name in ascending order.\n */\n LastName = 'lastName',\n /**\n * No sorting should be applied.\n */\n None = 'none',\n}\n\nexport enum ContactTypes {\n /**\n * Contact is a human.\n */\n Person = 'person',\n /**\n * Contact is group or company.\n */\n Company = 'company',\n}\n"]} \ No newline at end of file diff --git a/packages/expo-contacts/src/Contacts.ts b/packages/expo-contacts/src/Contacts.ts index e039011ab19c02..e76dbf1d6388cf 100644 --- a/packages/expo-contacts/src/Contacts.ts +++ b/packages/expo-contacts/src/Contacts.ts @@ -1,6 +1,10 @@ -import { PermissionResponse, PermissionStatus, UnavailabilityError } from 'expo-modules-core'; +import { + PermissionResponse, + PermissionStatus, + UnavailabilityError, + uuidv4, +} from 'expo-modules-core'; import { Platform, Share } from 'react-native'; -import { v4 as uuidv4 } from 'uuid'; import ExpoContacts from './ExpoContacts'; diff --git a/packages/expo-file-system/CHANGELOG.md b/packages/expo-file-system/CHANGELOG.md index 3be28a567462f1..39d176fb030307 100644 --- a/packages/expo-file-system/CHANGELOG.md +++ b/packages/expo-file-system/CHANGELOG.md @@ -10,6 +10,8 @@ ### 💡 Others +- Fork `uuid@3.4.0` and move into `expo-modules-core`. Remove the original dependency. ([#23249](https://github.com/expo/expo/pull/23249) by [@alanhughes](https://github.com/alanjhughes)) + ## 15.4.2 — 2023-06-28 _This version does not introduce any user-facing changes._ diff --git a/packages/expo-file-system/build/FileSystem.d.ts.map b/packages/expo-file-system/build/FileSystem.d.ts.map index 4b2ff28ab73af5..8e7e7d9dd4d75b 100644 --- a/packages/expo-file-system/build/FileSystem.d.ts.map +++ b/packages/expo-file-system/build/FileSystem.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"FileSystem.d.ts","sourceRoot":"","sources":["../src/FileSystem.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,qCAAqC,EACrC,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EAER,wBAAwB,EACxB,2CAA2C,EAE3C,uBAAuB,EACvB,sBAAsB,EAGtB,cAAc,EACd,cAAc,EACd,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAiB5B;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,eAA6D,CAAC;AAE5F;;;;GAIG;AACH,eAAO,MAAM,cAAc,eAA0D,CAAC;AAGtF,eAAO,MAAQ,aAAa,iBAAE,eAAe,eAAuB,CAAC;AAErE;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAKhG;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CASzE;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAK/F;AAED,wBAAsB,oCAAoC,IAAI,OAAO,CAAC,IAAI,CAAC,CAM1E;AAED;;;GAGG;AACH,wBAAs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C;IACzD;;OAEG;IACI,MAAM,iBAAiB,iDAAwB,CAAC;IACvD;;OAEG;IACI,MAAM,WAAW,2CAAkB,CAAC;IAC3C;;OAEG;IACI,MAAM,SAAS,yCAAgB,CAAC;IACvC;;OAEG;IACI,MAAM,SAAS,yCAAgB,CAAC;CACxC"} \ No newline at end of file +{"version":3,"file":"FileSystem.d.ts","sourceRoot":"","sources":["../src/FileSystem.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,qCAAqC,EACrC,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EAER,wBAAwB,EACxB,2CAA2C,EAE3C,uBAAuB,EACvB,sBAAsB,EAGtB,cAAc,EACd,cAAc,EACd,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAiB5B;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,eAA6D,CAAC;AAE5F;;;;GAIG;AACH,eAAO,MAAM,cAAc,eAA0D,CAAC;AAGtF,eAAO,MAAQ,aAAa,iBAAE,eAAe,eAAuB,CAAC;AAErE;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAKhG;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CASzE;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CA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SAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAKjB;IAED;;OAEG;IACI,MAAM,kBAAkB,kDAAyB,CAAC;IACzD;;OAEG;IACI,MAAM,iBAAiB,iDAAwB,CAAC;IACvD;;OAEG;IACI,MAAM,WAAW,2CAAkB,CAAC;IAC3C;;OAEG;IACI,MAAM,SAAS,yCAAgB,CAAC;IACvC;;OAEG;IACI,MAAM,SAAS,yCAAgB,CAAC;CACxC"} \ No newline at end of file diff --git a/packages/expo-file-system/build/FileSystem.js b/packages/expo-file-system/build/FileSystem.js index 5a49cf9cede6cb..a9187ca49fe3a3 100644 --- a/packages/expo-file-system/build/FileSystem.js +++ b/packages/expo-file-system/build/FileSystem.js @@ -1,6 +1,5 @@ -import { EventEmitter, UnavailabilityError } from 'expo-modules-core'; +import { EventEmitter, UnavailabilityError, uuidv4 } from 'expo-modules-core'; import { Platform } from 'react-native'; -import { v4 as uuidv4 } from 'uuid'; import ExponentFileSystem from './ExponentFileSystem'; import { FileSystemSessionType, FileSystemUploadType, } from './FileSystem.types'; if (!ExponentFileSystem) { diff --git a/packages/expo-file-system/build/FileSystem.js.map b/packages/expo-file-system/build/FileSystem.js.map index 05c8d1ebb74f0f..5e3ca2afadba46 100644 --- a/packages/expo-file-system/build/FileSystem.js.map +++ b/packages/expo-file-system/build/FileSystem.js.map @@ -1 +1 @@ -{"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../src/FileSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAUL,qBAAqB,EA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C,CAAC;IAChE,CAAC;IARqB,yCAAkB,qBAQvC,CAAA;IAED;;;;;OAKG;IACI,KAAK,UAAU,kBAAkB,CAAC,SAAiB,EAAE,OAAe;QACzE,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,EAAE;YAC7C,MAAM,IAAI,mBAAmB,CAC3B,kBAAkB,EAClB,2CAA2C,CAC5C,CAAC;SACH;QACD,OAAO,MAAM,kBAAkB,CAAC,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IARqB,yCAAkB,qBAQvC,CAAA;IAED;;;;;;OAMG;IACI,KAAK,UAAU,eAAe,CACnC,SAAiB,EACjB,QAAgB,EAChB,QAAgB;QAEhB,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,EAAE;YAC1C,MAAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,wCAAwC,CAAC,CAAC;SAC7F;QACD,OAAO,MAAM,kBAAkB,CAAC,kBAAkB,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpF,CAAC;IATqB,sCAAe,kBASpC,CAAA;IAED;;OAEG;IACU,yCAAkB,GAAG,sBAAsB,CAAC;IACzD;;OAEG;IACU,wCAAiB,GAAG,qBAAqB,CAAC;IACvD;;OAEG;IACU,kCAAW,GAAG,eAAe,CAAC;IAC3C;;OAEG;IACU,gCAAS,GAAG,aAAa,CAAC;IACvC;;OAEG;IACU,gCAAS,GAAG,aAAa,CAAC;AACzC,CAAC,EApGgB,sBAAsB,KAAtB,sBAAsB,QAoGtC","sourcesContent":["import { EventEmitter, Subscription, UnavailabilityError } from 'expo-modules-core';\nimport { Platform } from 'react-native';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport ExponentFileSystem from './ExponentFileSystem';\nimport {\n DownloadOptions,\n DownloadPauseState,\n FileSystemNetworkTaskProgressCallback,\n DownloadProgressData,\n UploadProgressData,\n FileInfo,\n FileSystemAcceptedUploadHttpMethod,\n FileSystemDownloadResult,\n FileSystemRequestDirectoryPermissionsResult,\n FileSystemSessionType,\n FileSystemUploadOptions,\n FileSystemUploadResult,\n FileSystemUploadType,\n ProgressEvent,\n ReadingOptions,\n WritingOptions,\n DeletingOptions,\n InfoOptions,\n RelocatingOptions,\n MakeDirectoryOptions,\n} from './FileSystem.types';\n\nif (!ExponentFileSystem) {\n console.warn(\n \"No native ExponentFileSystem module found, are you sure the expo-file-system's module is linked properly?\"\n );\n}\n// Prevent webpack from pruning this.\nconst _unused = new EventEmitter(ExponentFileSystem); // eslint-disable-line\n\nfunction normalizeEndingSlash(p: string | null): string | null {\n if (p != null) {\n return p.replace(/\\/*$/, '') + '/';\n }\n return null;\n}\n\n/**\n * `file://` URI pointing to the directory where user documents for this app will be stored.\n * Files stored here will remain until explicitly deleted by the app. Ends with a trailing `/`.\n * Example uses are for files the user saves that they expect to see again.\n */\nexport const documentDirectory = normalizeEndingSlash(ExponentFileSystem.documentDirectory);\n\n/**\n * `file://` URI pointing to the directory where temporary files used by this app will be stored.\n * Files stored here may be automatically deleted by the system when low on storage.\n * Example uses are for downloaded or generated files that the app just needs for one-time usage.\n */\nexport const cacheDirectory = normalizeEndingSlash(ExponentFileSystem.cacheDirectory);\n\n// @docsMissing\nexport const { bundledAssets, bundleDirectory } = ExponentFileSystem;\n\n/**\n * Get metadata information about a file, directory or external content/asset.\n * @param fileUri URI to the file or directory. See [supported URI schemes](#supported-uri-schemes).\n * @param options A map of options represented by [`GetInfoAsyncOptions`](#getinfoasyncoptions) type.\n * @return A Promise that resolves to a `FileInfo` object. If no item exists at this URI,\n * the returned Promise resolves to `FileInfo` object in form of `{ exists: false, isDirectory: false }`.\n */\nexport async function getInfoAsync(fileUri: string, options: InfoOptions = {}): Promise {\n if (!ExponentFileSystem.getInfoAsync) {\n throw new UnavailabilityError('expo-file-system', 'getInfoAsync');\n }\n return await ExponentFileSystem.getInfoAsync(fileUri, options);\n}\n\n/**\n * Read the entire contents of a file as a string. Binary will be returned in raw format, you will need to append `data:image/png;base64,` to use it as Base64.\n * @param fileUri `file://` or [SAF](#saf-uri) URI to the file or directory.\n * @param options A map of read options represented by [`ReadingOptions`](#readingoptions) type.\n * @return A Promise that resolves to a string containing the entire contents of the file.\n */\nexport async function readAsStringAsync(\n fileUri: string,\n options: ReadingOptions = {}\n): Promise {\n if (!ExponentFileSystem.readAsStringAsync) {\n throw new UnavailabilityError('expo-file-system', 'readAsStringAsync');\n }\n return await ExponentFileSystem.readAsStringAsync(fileUri, options);\n}\n\n/**\n * Takes a `file://` URI and converts it into content URI (`content://`) so that it can be accessed by other applications outside of Expo.\n * @param fileUri The local URI of the file. If there is no file at this URI, an exception will be thrown.\n * @example\n * ```js\n * FileSystem.getContentUriAsync(uri).then(cUri => {\n * console.log(cUri);\n * IntentLauncher.startActivityAsync('android.intent.action.VIEW', {\n * data: cUri,\n * flags: 1,\n * });\n * });\n * ```\n * @return Returns a Promise that resolves to a `string` containing a `content://` URI pointing to the file.\n * The URI is the same as the `fileUri` input parameter but in a different format.\n * @platform android\n */\nexport async function getContentUriAsync(fileUri: string): Promise {\n if (Platform.OS === 'android') {\n if (!ExponentFileSystem.getContentUriAsync) {\n throw new UnavailabilityError('expo-file-system', 'getContentUriAsync');\n }\n return await ExponentFileSystem.getContentUriAsync(fileUri);\n } else {\n return fileUri;\n }\n}\n\n/**\n * Write the entire contents of a file as a string.\n * @param fileUri `file://` or [SAF](#saf-uri) URI to the file or directory.\n * > Note: when you're using SAF URI the file needs to exist. You can't create a new file.\n * @param contents The string to replace the contents of the file with.\n * @param options A map of write options represented by [`WritingOptions`](#writingoptions) type.\n */\nexport async function writeAsStringAsync(\n fileUri: string,\n contents: string,\n options: WritingOptions = {}\n): Promise {\n if (!ExponentFileSystem.writeAsStringAsync) {\n throw new UnavailabilityError('expo-file-system', 'writeAsStringAsync');\n }\n return await ExponentFileSystem.writeAsStringAsync(fileUri, contents, options);\n}\n\n/**\n * Delete a file or directory. If the URI points to a directory, the directory and all its contents are recursively deleted.\n * @param fileUri `file://` or [SAF](#saf-uri) URI to the file or directory.\n * @param options A map of write options represented by [`DeletingOptions`](#deletingoptions) type.\n */\nexport async function deleteAsync(fileUri: string, options: DeletingOptions = {}): Promise {\n if (!ExponentFileSystem.deleteAsync) {\n throw new UnavailabilityError('expo-file-system', 'deleteAsync');\n }\n return await ExponentFileSystem.deleteAsync(fileUri, options);\n}\n\nexport async function deleteLegacyDocumentDirectoryAndroid(): Promise {\n if (Platform.OS !== 'android' || documentDirectory == null) {\n return;\n }\n const legacyDocumentDirectory = `${documentDirectory}ExperienceData/`;\n return await deleteAsync(legacyDocumentDirectory, { idempotent: true });\n}\n\n/**\n * Move a file or directory to a new location.\n * @param options A map of move options represented by [`RelocatingOptions`](#relocatingoptions) type.\n */\nexport async function moveAsync(options: RelocatingOptions): Promise {\n if (!ExponentFileSystem.moveAsync) {\n throw new UnavailabilityError('expo-file-system', 'moveAsync');\n }\n return await ExponentFileSystem.moveAsync(options);\n}\n\n/**\n * Create a copy of a file or directory. Directories are recursively copied with all of their contents.\n * It can be also used to copy content shared by other apps to local filesystem.\n * @param options A map of move options represented by [`RelocatingOptions`](#relocatingoptions) type.\n */\nexport async function copyAsync(options: RelocatingOptions): Promise {\n if (!ExponentFileSystem.copyAsync) {\n throw new UnavailabilityError('expo-file-system', 'copyAsync');\n }\n return await ExponentFileSystem.copyAsync(options);\n}\n\n/**\n * Create a new empty directory.\n * @param fileUri `file://` URI to the new directory to create.\n * @param options A map of create directory options represented by [`MakeDirectoryOptions`](#makedirectoryoptions) type.\n */\nexport async function makeDirectoryAsync(\n fileUri: string,\n options: MakeDirectoryOptions = {}\n): Promise {\n if (!ExponentFileSystem.makeDirectoryAsync) {\n throw new UnavailabilityError('expo-file-system', 'makeDirectoryAsync');\n }\n return await ExponentFileSystem.makeDirectoryAsync(fileUri, options);\n}\n\n/**\n * Enumerate the contents of a directory.\n * @param fileUri `file://` URI to the directory.\n * @return A Promise that resolves to an array of strings, each containing the name of a file or directory contained in the directory at `fileUri`.\n */\nexport async function readDirectoryAsync(fileUri: string): Promise {\n if (!ExponentFileSystem.readDirectoryAsync) {\n throw new UnavailabilityError('expo-file-system', 'readDirectoryAsync');\n }\n return await ExponentFileSystem.readDirectoryAsync(fileUri);\n}\n\n/**\n * Gets the available internal disk storage size, in bytes. This returns the free space on the data partition that hosts all of the internal storage for all apps on the device.\n * @return Returns a Promise that resolves to the number of bytes available on the internal disk, or JavaScript's [`MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\n * if the capacity is greater than 253 - 1 bytes.\n */\nexport async function getFreeDiskStorageAsync(): Promise {\n if (!ExponentFileSystem.getFreeDiskStorageAsync) {\n throw new UnavailabilityError('expo-file-system', 'getFreeDiskStorageAsync');\n }\n return await ExponentFileSystem.getFreeDiskStorageAsync();\n}\n\n/**\n * Gets total internal disk storage size, in bytes. This is the total capacity of the data partition that hosts all the internal storage for all apps on the device.\n * @return Returns a Promise that resolves to a number that specifies the total internal disk storage capacity in bytes, or JavaScript's [`MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\n * if the capacity is greater than 253 - 1 bytes.\n */\nexport async function getTotalDiskCapacityAsync(): Promise {\n if (!ExponentFileSystem.getTotalDiskCapacityAsync) {\n throw new UnavailabilityError('expo-file-system', 'getTotalDiskCapacityAsync');\n }\n return await ExponentFileSystem.getTotalDiskCapacityAsync();\n}\n\n/**\n * Download the contents at a remote URI to a file in the app's file system. The directory for a local file uri must exist prior to calling this function.\n * @param uri The remote URI to download from.\n * @param fileUri The local URI of the file to download to. If there is no file at this URI, a new one is created.\n * If there is a file at this URI, its contents are replaced. The directory for the file must exist.\n * @param options A map of download options represented by [`DownloadOptions`](#downloadoptions) type.\n * @example\n * ```js\n * FileSystem.downloadAsync(\n * 'http://techslides.com/demos/sample-videos/small.mp4',\n * FileSystem.documentDirectory + 'small.mp4'\n * )\n * .then(({ uri }) => {\n * console.log('Finished downloading to ', uri);\n * })\n * .catch(error => {\n * console.error(error);\n * });\n * ```\n * @return Returns a Promise that resolves to a `FileSystemDownloadResult` object.\n */\nexport async function downloadAsync(\n uri: string,\n fileUri: string,\n options: DownloadOptions = {}\n): Promise {\n if (!ExponentFileSystem.downloadAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadAsync');\n }\n\n return await ExponentFileSystem.downloadAsync(uri, fileUri, {\n sessionType: FileSystemSessionType.BACKGROUND,\n ...options,\n });\n}\n\n/**\n * Upload the contents of the file pointed by `fileUri` to the remote url.\n * @param url The remote URL, where the file will be sent.\n * @param fileUri The local URI of the file to send. The file must exist.\n * @param options A map of download options represented by [`FileSystemUploadOptions`](#filesystemuploadoptions) type.\n * @example\n * **Client**\n *\n * ```js\n * import * as FileSystem from 'expo-file-system';\n *\n * try {\n * const response = await FileSystem.uploadAsync(`http://192.168.0.1:1234/binary-upload`, fileUri, {\n * fieldName: 'file',\n * httpMethod: 'PATCH',\n * uploadType: FileSystem.FileSystemUploadType.BINARY_CONTENT,\n * });\n * console.log(JSON.stringify(response, null, 4));\n * } catch (error) {\n * console.log(error);\n * }\n * ```\n *\n * **Server**\n *\n * Please refer to the \"[Server: Handling multipart requests](#server-handling-multipart-requests)\" example - there is code for a simple Node.js server.\n * @return Returns a Promise that resolves to `FileSystemUploadResult` object.\n */\nexport async function uploadAsync(\n url: string,\n fileUri: string,\n options: FileSystemUploadOptions = {}\n): Promise {\n if (!ExponentFileSystem.uploadAsync) {\n throw new UnavailabilityError('expo-file-system', 'uploadAsync');\n }\n\n return await ExponentFileSystem.uploadAsync(url, fileUri, {\n sessionType: FileSystemSessionType.BACKGROUND,\n uploadType: FileSystemUploadType.BINARY_CONTENT,\n ...options,\n httpMethod: (options.httpMethod || 'POST').toUpperCase(),\n });\n}\n\n/**\n * Create a `DownloadResumable` object which can start, pause, and resume a download of contents at a remote URI to a file in the app's file system.\n * > Note: You need to call `downloadAsync()`, on a `DownloadResumable` instance to initiate the download.\n * The `DownloadResumable` object has a callback that provides download progress updates.\n * Downloads can be resumed across app restarts by using `AsyncStorage` to store the `DownloadResumable.savable()` object for later retrieval.\n * The `savable` object contains the arguments required to initialize a new `DownloadResumable` object to resume the download after an app restart.\n * The directory for a local file uri must exist prior to calling this function.\n * @param uri The remote URI to download from.\n * @param fileUri The local URI of the file to download to. If there is no file at this URI, a new one is created.\n * If there is a file at this URI, its contents are replaced. The directory for the file must exist.\n * @param options A map of download options represented by [`DownloadOptions`](#downloadoptions) type.\n * @param callback This function is called on each data write to update the download progress.\n * > **Note**: When the app has been moved to the background, this callback won't be fired until it's moved to the foreground.\n * @param resumeData The string which allows the api to resume a paused download. This is set on the `DownloadResumable` object automatically when a download is paused.\n * When initializing a new `DownloadResumable` this should be `null`.\n */\nexport function createDownloadResumable(\n uri: string,\n fileUri: string,\n options?: DownloadOptions,\n callback?: FileSystemNetworkTaskProgressCallback,\n resumeData?: string\n): DownloadResumable {\n return new DownloadResumable(uri, fileUri, options, callback, resumeData);\n}\n\nexport function createUploadTask(\n url: string,\n fileUri: string,\n options?: FileSystemUploadOptions,\n callback?: FileSystemNetworkTaskProgressCallback\n): UploadTask {\n return new UploadTask(url, fileUri, options, callback);\n}\n\nexport abstract class FileSystemCancellableNetworkTask<\n T extends DownloadProgressData | UploadProgressData\n> {\n private _uuid = uuidv4();\n protected taskWasCanceled = false;\n private emitter = new EventEmitter(ExponentFileSystem);\n private subscription?: Subscription | null;\n\n // @docsMissing\n public async cancelAsync(): Promise {\n if (!ExponentFileSystem.networkTaskCancelAsync) {\n throw new UnavailabilityError('expo-file-system', 'networkTaskCancelAsync');\n }\n\n this.removeSubscription();\n this.taskWasCanceled = true;\n return await ExponentFileSystem.networkTaskCancelAsync(this.uuid);\n }\n\n protected isTaskCancelled(): boolean {\n if (this.taskWasCanceled) {\n console.warn('This task was already canceled.');\n return true;\n }\n\n return false;\n }\n\n protected get uuid(): string {\n return this._uuid;\n }\n\n protected abstract getEventName(): string;\n\n protected abstract getCallback(): FileSystemNetworkTaskProgressCallback | undefined;\n\n protected addSubscription() {\n if (this.subscription) {\n return;\n }\n\n this.subscription = this.emitter.addListener(this.getEventName(), (event: ProgressEvent) => {\n if (event.uuid === this.uuid) {\n const callback = this.getCallback();\n if (callback) {\n callback(event.data);\n }\n }\n });\n }\n\n protected removeSubscription() {\n if (!this.subscription) {\n return;\n }\n this.emitter.removeSubscription(this.subscription);\n this.subscription = null;\n }\n}\n\nexport class UploadTask extends FileSystemCancellableNetworkTask {\n private options: FileSystemUploadOptions;\n\n constructor(\n private url: string,\n private fileUri: string,\n options?: FileSystemUploadOptions,\n private callback?: FileSystemNetworkTaskProgressCallback\n ) {\n super();\n\n const httpMethod = (options?.httpMethod?.toUpperCase() ||\n 'POST') as FileSystemAcceptedUploadHttpMethod;\n\n this.options = {\n sessionType: FileSystemSessionType.BACKGROUND,\n uploadType: FileSystemUploadType.BINARY_CONTENT,\n ...options,\n httpMethod,\n };\n }\n\n protected getEventName(): string {\n return 'expo-file-system.uploadProgress';\n }\n protected getCallback(): FileSystemNetworkTaskProgressCallback | undefined {\n return this.callback;\n }\n\n // @docsMissing\n public async uploadAsync(): Promise {\n if (!ExponentFileSystem.uploadTaskStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'uploadTaskStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n const result = await ExponentFileSystem.uploadTaskStartAsync(\n this.url,\n this.fileUri,\n this.uuid,\n this.options\n );\n this.removeSubscription();\n\n return result;\n }\n}\n\nexport class DownloadResumable extends FileSystemCancellableNetworkTask {\n constructor(\n private url: string,\n private _fileUri: string,\n private options: DownloadOptions = {},\n private callback?: FileSystemNetworkTaskProgressCallback,\n private resumeData?: string\n ) {\n super();\n }\n\n public get fileUri(): string {\n return this._fileUri;\n }\n\n protected getEventName(): string {\n return 'expo-file-system.downloadProgress';\n }\n\n protected getCallback(): FileSystemNetworkTaskProgressCallback | undefined {\n return this.callback;\n }\n\n /**\n * Download the contents at a remote URI to a file in the app's file system.\n * @return Returns a Promise that resolves to `FileSystemDownloadResult` object, or to `undefined` when task was cancelled.\n */\n async downloadAsync(): Promise {\n if (!ExponentFileSystem.downloadResumableStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumableStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n return await ExponentFileSystem.downloadResumableStartAsync(\n this.url,\n this._fileUri,\n this.uuid,\n this.options,\n this.resumeData\n );\n }\n\n /**\n * Pause the current download operation. `resumeData` is added to the `DownloadResumable` object after a successful pause operation.\n * Returns an object that can be saved with `AsyncStorage` for future retrieval (the same object that is returned from calling `FileSystem.DownloadResumable.savable()`).\n * @return Returns a Promise that resolves to `DownloadPauseState` object.\n */\n async pauseAsync(): Promise {\n if (!ExponentFileSystem.downloadResumablePauseAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumablePauseAsync');\n }\n\n if (this.isTaskCancelled()) {\n return {\n fileUri: this._fileUri,\n options: this.options,\n url: this.url,\n };\n }\n\n const pauseResult = await ExponentFileSystem.downloadResumablePauseAsync(this.uuid);\n this.removeSubscription();\n if (pauseResult) {\n this.resumeData = pauseResult.resumeData;\n return this.savable();\n } else {\n throw new Error('Unable to generate a savable pause state');\n }\n }\n\n /**\n * Resume a paused download operation.\n * @return Returns a Promise that resolves to `FileSystemDownloadResult` object, or to `undefined` when task was cancelled.\n */\n async resumeAsync(): Promise {\n if (!ExponentFileSystem.downloadResumableStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumableStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n return await ExponentFileSystem.downloadResumableStartAsync(\n this.url,\n this.fileUri,\n this.uuid,\n this.options,\n this.resumeData\n );\n }\n\n /**\n * Method to get the object which can be saved with `AsyncStorage` for future retrieval.\n * @returns Returns object in shape of `DownloadPauseState` type.\n */\n savable(): DownloadPauseState {\n return {\n url: this.url,\n fileUri: this.fileUri,\n options: this.options,\n resumeData: this.resumeData,\n };\n }\n}\n\nconst baseReadAsStringAsync = readAsStringAsync;\nconst baseWriteAsStringAsync = writeAsStringAsync;\nconst baseDeleteAsync = deleteAsync;\nconst baseMoveAsync = moveAsync;\nconst baseCopyAsync = copyAsync;\n\n/**\n * The `StorageAccessFramework` is a namespace inside of the `expo-file-system` module, which encapsulates all functions which can be used with [SAF URIs](#saf-uri).\n * You can read more about SAF in the [Android documentation](https://developer.android.com/guide/topics/providers/document-provider).\n *\n * @example\n * # Basic Usage\n *\n * ```ts\n * import { StorageAccessFramework } from 'expo-file-system';\n *\n * // Requests permissions for external directory\n * const permissions = await StorageAccessFramework.requestDirectoryPermissionsAsync();\n *\n * if (permissions.granted) {\n * // Gets SAF URI from response\n * const uri = permissions.directoryUri;\n *\n * // Gets all files inside of selected directory\n * const files = await StorageAccessFramework.readDirectoryAsync(uri);\n * alert(`Files inside ${uri}:\\n\\n${JSON.stringify(files)}`);\n * }\n * ```\n *\n * # Migrating an album\n *\n * ```ts\n * import * as MediaLibrary from 'expo-media-library';\n * import * as FileSystem from 'expo-file-system';\n * const { StorageAccessFramework } = FileSystem;\n *\n * async function migrateAlbum(albumName: string) {\n * // Gets SAF URI to the album\n * const albumUri = StorageAccessFramework.getUriForDirectoryInRoot(albumName);\n *\n * // Requests permissions\n * const permissions = await StorageAccessFramework.requestDirectoryPermissionsAsync(albumUri);\n * if (!permissions.granted) {\n * return;\n * }\n *\n * const permittedUri = permissions.directoryUri;\n * // Checks if users selected the correct folder\n * if (!permittedUri.includes(albumName)) {\n * return;\n * }\n *\n * const mediaLibraryPermissions = await MediaLibrary.requestPermissionsAsync();\n * if (!mediaLibraryPermissions.granted) {\n * return;\n * }\n *\n * // Moves files from external storage to internal storage\n * await StorageAccessFramework.moveAsync({\n * from: permittedUri,\n * to: FileSystem.documentDirectory!,\n * });\n *\n * const outputDir = FileSystem.documentDirectory! + albumName;\n * const migratedFiles = await FileSystem.readDirectoryAsync(outputDir);\n *\n * // Creates assets from local files\n * const [newAlbumCreator, ...assets] = await Promise.all(\n * migratedFiles.map>(\n * async fileName => await MediaLibrary.createAssetAsync(outputDir + '/' + fileName)\n * )\n * );\n *\n * // Album was empty\n * if (!newAlbumCreator) {\n * return;\n * }\n *\n * // Creates a new album in the scoped directory\n * const newAlbum = await MediaLibrary.createAlbumAsync(albumName, newAlbumCreator, false);\n * if (assets.length) {\n * await MediaLibrary.addAssetsToAlbumAsync(assets, newAlbum, false);\n * }\n * }\n * ```\n * @platform Android\n */\nexport namespace StorageAccessFramework {\n /**\n * Gets a [SAF URI](#saf-uri) pointing to a folder in the Android root directory. You can use this function to get URI for\n * `StorageAccessFramework.requestDirectoryPermissionsAsync()` when you trying to migrate an album. In that case, the name of the album is the folder name.\n * @param folderName The name of the folder which is located in the Android root directory.\n * @return Returns a [SAF URI](#saf-uri) to a folder.\n */\n export function getUriForDirectoryInRoot(folderName: string) {\n return `content://com.android.externalstorage.documents/tree/primary:${folderName}/document/primary:${folderName}`;\n }\n\n /**\n * Allows users to select a specific directory, granting your app access to all of the files and sub-directories within that directory.\n * @param initialFileUrl The [SAF URI](#saf-uri) of the directory that the file picker should display when it first loads.\n * If URI is incorrect or points to a non-existing folder, it's ignored.\n * @platform android 11+\n * @return Returns a Promise that resolves to `FileSystemRequestDirectoryPermissionsResult` object.\n */\n export async function requestDirectoryPermissionsAsync(\n initialFileUrl: string | null = null\n ): Promise {\n if (!ExponentFileSystem.requestDirectoryPermissionsAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.requestDirectoryPermissionsAsync'\n );\n }\n\n return await ExponentFileSystem.requestDirectoryPermissionsAsync(initialFileUrl);\n }\n\n /**\n * Enumerate the contents of a directory.\n * @param dirUri [SAF](#saf-uri) URI to the directory.\n * @return A Promise that resolves to an array of strings, each containing the full [SAF URI](#saf-uri) of a file or directory contained in the directory at `fileUri`.\n */\n export async function readDirectoryAsync(dirUri: string): Promise {\n if (!ExponentFileSystem.readSAFDirectoryAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.readDirectoryAsync'\n );\n }\n return await ExponentFileSystem.readSAFDirectoryAsync(dirUri);\n }\n\n /**\n * Creates a new empty directory.\n * @param parentUri The [SAF](#saf-uri) URI to the parent directory.\n * @param dirName The name of new directory.\n * @return A Promise that resolves to a [SAF URI](#saf-uri) to the created directory.\n */\n export async function makeDirectoryAsync(parentUri: string, dirName: string): Promise {\n if (!ExponentFileSystem.makeSAFDirectoryAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.makeDirectoryAsync'\n );\n }\n return await ExponentFileSystem.makeSAFDirectoryAsync(parentUri, dirName);\n }\n\n /**\n * Creates a new empty file.\n * @param parentUri The [SAF](#saf-uri) URI to the parent directory.\n * @param fileName The name of new file **without the extension**.\n * @param mimeType The MIME type of new file.\n * @return A Promise that resolves to a [SAF URI](#saf-uri) to the created file.\n */\n export async function createFileAsync(\n parentUri: string,\n fileName: string,\n mimeType: string\n ): Promise {\n if (!ExponentFileSystem.createSAFFileAsync) {\n throw new UnavailabilityError('expo-file-system', 'StorageAccessFramework.createFileAsync');\n }\n return await ExponentFileSystem.createSAFFileAsync(parentUri, fileName, mimeType);\n }\n\n /**\n * Alias for [`writeAsStringAsync`](#filesystemwriteasstringasyncfileuri-contents-options) method.\n */\n export const writeAsStringAsync = baseWriteAsStringAsync;\n /**\n * Alias for [`readAsStringAsync`](#filesystemreadasstringasyncfileuri-options) method.\n */\n export const readAsStringAsync = baseReadAsStringAsync;\n /**\n * Alias for [`deleteAsync`](#filesystemdeleteasyncfileuri-options) method.\n */\n export const deleteAsync = baseDeleteAsync;\n /**\n * Alias for [`moveAsync`](#filesystemmoveasyncoptions) method.\n */\n export const moveAsync = baseMoveAsync;\n /**\n * Alias for [`copyAsync`](#filesystemcopyasyncoptions) method.\n */\n export const copyAsync = baseCopyAsync;\n}\n"]} \ No newline at end of file +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esContent":["import { EventEmitter, Subscription, UnavailabilityError, uuidv4 } from 'expo-modules-core';\nimport { Platform } from 'react-native';\n\nimport ExponentFileSystem from './ExponentFileSystem';\nimport {\n DownloadOptions,\n DownloadPauseState,\n FileSystemNetworkTaskProgressCallback,\n DownloadProgressData,\n UploadProgressData,\n FileInfo,\n FileSystemAcceptedUploadHttpMethod,\n FileSystemDownloadResult,\n FileSystemRequestDirectoryPermissionsResult,\n FileSystemSessionType,\n FileSystemUploadOptions,\n FileSystemUploadResult,\n FileSystemUploadType,\n ProgressEvent,\n ReadingOptions,\n WritingOptions,\n DeletingOptions,\n InfoOptions,\n RelocatingOptions,\n MakeDirectoryOptions,\n} from './FileSystem.types';\n\nif (!ExponentFileSystem) {\n console.warn(\n \"No native ExponentFileSystem module found, are you sure the expo-file-system's module is linked properly?\"\n );\n}\n// Prevent webpack from pruning this.\nconst _unused = new EventEmitter(ExponentFileSystem); // eslint-disable-line\n\nfunction normalizeEndingSlash(p: string | null): string | null {\n if (p != null) {\n return p.replace(/\\/*$/, '') + '/';\n }\n return null;\n}\n\n/**\n * `file://` URI pointing to the directory where user documents for this app will be stored.\n * Files stored here will remain until explicitly deleted by the app. Ends with a trailing `/`.\n * Example uses are for files the user saves that they expect to see again.\n */\nexport const documentDirectory = normalizeEndingSlash(ExponentFileSystem.documentDirectory);\n\n/**\n * `file://` URI pointing to the directory where temporary files used by this app will be stored.\n * Files stored here may be automatically deleted by the system when low on storage.\n * Example uses are for downloaded or generated files that the app just needs for one-time usage.\n */\nexport const cacheDirectory = normalizeEndingSlash(ExponentFileSystem.cacheDirectory);\n\n// @docsMissing\nexport const { bundledAssets, bundleDirectory } = ExponentFileSystem;\n\n/**\n * Get metadata information about a file, directory or external content/asset.\n * @param fileUri URI to the file or directory. See [supported URI schemes](#supported-uri-schemes).\n * @param options A map of options represented by [`GetInfoAsyncOptions`](#getinfoasyncoptions) type.\n * @return A Promise that resolves to a `FileInfo` object. If no item exists at this URI,\n * the returned Promise resolves to `FileInfo` object in form of `{ exists: false, isDirectory: false }`.\n */\nexport async function getInfoAsync(fileUri: string, options: InfoOptions = {}): Promise {\n if (!ExponentFileSystem.getInfoAsync) {\n throw new UnavailabilityError('expo-file-system', 'getInfoAsync');\n }\n return await ExponentFileSystem.getInfoAsync(fileUri, options);\n}\n\n/**\n * Read the entire contents of a file as a string. Binary will be returned in raw format, you will need to append `data:image/png;base64,` to use it as Base64.\n * @param fileUri `file://` or [SAF](#saf-uri) URI to the file or directory.\n * @param options A map of read options represented by [`ReadingOptions`](#readingoptions) type.\n * @return A Promise that resolves to a string containing the entire contents of the file.\n */\nexport async function readAsStringAsync(\n fileUri: string,\n options: ReadingOptions = {}\n): Promise {\n if (!ExponentFileSystem.readAsStringAsync) {\n throw new UnavailabilityError('expo-file-system', 'readAsStringAsync');\n }\n return await ExponentFileSystem.readAsStringAsync(fileUri, options);\n}\n\n/**\n * Takes a `file://` URI and converts it into content URI (`content://`) so that it can be accessed by other applications outside of Expo.\n * @param fileUri The local URI of the file. If there is no file at this URI, an exception will be thrown.\n * @example\n * ```js\n * FileSystem.getContentUriAsync(uri).then(cUri => {\n * console.log(cUri);\n * IntentLauncher.startActivityAsync('android.intent.action.VIEW', {\n * data: cUri,\n * flags: 1,\n * });\n * });\n * ```\n * @return Returns a Promise that resolves to a `string` containing a `content://` URI pointing to the file.\n * The URI is the same as the `fileUri` input parameter but in a different format.\n * @platform android\n */\nexport async function getContentUriAsync(fileUri: string): Promise {\n if (Platform.OS === 'android') {\n if (!ExponentFileSystem.getContentUriAsync) {\n throw new UnavailabilityError('expo-file-system', 'getContentUriAsync');\n }\n return await ExponentFileSystem.getContentUriAsync(fileUri);\n } else {\n return fileUri;\n }\n}\n\n/**\n * Write the entire contents of a file as a string.\n * @param fileUri `file://` or [SAF](#saf-uri) URI to the file or directory.\n * > Note: when you're using SAF URI the file needs to exist. You can't create a new file.\n * @param contents The string to replace the contents of the file with.\n * @param options A map of write options represented by [`WritingOptions`](#writingoptions) type.\n */\nexport async function writeAsStringAsync(\n fileUri: string,\n contents: string,\n options: WritingOptions = {}\n): Promise {\n if (!ExponentFileSystem.writeAsStringAsync) {\n throw new UnavailabilityError('expo-file-system', 'writeAsStringAsync');\n }\n return await ExponentFileSystem.writeAsStringAsync(fileUri, contents, options);\n}\n\n/**\n * Delete a file or directory. If the URI points to a directory, the directory and all its contents are recursively deleted.\n * @param fileUri `file://` or [SAF](#saf-uri) URI to the file or directory.\n * @param options A map of write options represented by [`DeletingOptions`](#deletingoptions) type.\n */\nexport async function deleteAsync(fileUri: string, options: DeletingOptions = {}): Promise {\n if (!ExponentFileSystem.deleteAsync) {\n throw new UnavailabilityError('expo-file-system', 'deleteAsync');\n }\n return await ExponentFileSystem.deleteAsync(fileUri, options);\n}\n\nexport async function deleteLegacyDocumentDirectoryAndroid(): Promise {\n if (Platform.OS !== 'android' || documentDirectory == null) {\n return;\n }\n const legacyDocumentDirectory = `${documentDirectory}ExperienceData/`;\n return await deleteAsync(legacyDocumentDirectory, { idempotent: true });\n}\n\n/**\n * Move a file or directory to a new location.\n * @param options A map of move options represented by [`RelocatingOptions`](#relocatingoptions) type.\n */\nexport async function moveAsync(options: RelocatingOptions): Promise {\n if (!ExponentFileSystem.moveAsync) {\n throw new UnavailabilityError('expo-file-system', 'moveAsync');\n }\n return await ExponentFileSystem.moveAsync(options);\n}\n\n/**\n * Create a copy of a file or directory. Directories are recursively copied with all of their contents.\n * It can be also used to copy content shared by other apps to local filesystem.\n * @param options A map of move options represented by [`RelocatingOptions`](#relocatingoptions) type.\n */\nexport async function copyAsync(options: RelocatingOptions): Promise {\n if (!ExponentFileSystem.copyAsync) {\n throw new UnavailabilityError('expo-file-system', 'copyAsync');\n }\n return await ExponentFileSystem.copyAsync(options);\n}\n\n/**\n * Create a new empty directory.\n * @param fileUri `file://` URI to the new directory to create.\n * @param options A map of create directory options represented by [`MakeDirectoryOptions`](#makedirectoryoptions) type.\n */\nexport async function makeDirectoryAsync(\n fileUri: string,\n options: MakeDirectoryOptions = {}\n): Promise {\n if (!ExponentFileSystem.makeDirectoryAsync) {\n throw new UnavailabilityError('expo-file-system', 'makeDirectoryAsync');\n }\n return await ExponentFileSystem.makeDirectoryAsync(fileUri, options);\n}\n\n/**\n * Enumerate the contents of a directory.\n * @param fileUri `file://` URI to the directory.\n * @return A Promise that resolves to an array of strings, each containing the name of a file or directory contained in the directory at `fileUri`.\n */\nexport async function readDirectoryAsync(fileUri: string): Promise {\n if (!ExponentFileSystem.readDirectoryAsync) {\n throw new UnavailabilityError('expo-file-system', 'readDirectoryAsync');\n }\n return await ExponentFileSystem.readDirectoryAsync(fileUri);\n}\n\n/**\n * Gets the available internal disk storage size, in bytes. This returns the free space on the data partition that hosts all of the internal storage for all apps on the device.\n * @return Returns a Promise that resolves to the number of bytes available on the internal disk, or JavaScript's [`MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\n * if the capacity is greater than 253 - 1 bytes.\n */\nexport async function getFreeDiskStorageAsync(): Promise {\n if (!ExponentFileSystem.getFreeDiskStorageAsync) {\n throw new UnavailabilityError('expo-file-system', 'getFreeDiskStorageAsync');\n }\n return await ExponentFileSystem.getFreeDiskStorageAsync();\n}\n\n/**\n * Gets total internal disk storage size, in bytes. This is the total capacity of the data partition that hosts all the internal storage for all apps on the device.\n * @return Returns a Promise that resolves to a number that specifies the total internal disk storage capacity in bytes, or JavaScript's [`MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\n * if the capacity is greater than 253 - 1 bytes.\n */\nexport async function getTotalDiskCapacityAsync(): Promise {\n if (!ExponentFileSystem.getTotalDiskCapacityAsync) {\n throw new UnavailabilityError('expo-file-system', 'getTotalDiskCapacityAsync');\n }\n return await ExponentFileSystem.getTotalDiskCapacityAsync();\n}\n\n/**\n * Download the contents at a remote URI to a file in the app's file system. The directory for a local file uri must exist prior to calling this function.\n * @param uri The remote URI to download from.\n * @param fileUri The local URI of the file to download to. If there is no file at this URI, a new one is created.\n * If there is a file at this URI, its contents are replaced. The directory for the file must exist.\n * @param options A map of download options represented by [`DownloadOptions`](#downloadoptions) type.\n * @example\n * ```js\n * FileSystem.downloadAsync(\n * 'http://techslides.com/demos/sample-videos/small.mp4',\n * FileSystem.documentDirectory + 'small.mp4'\n * )\n * .then(({ uri }) => {\n * console.log('Finished downloading to ', uri);\n * })\n * .catch(error => {\n * console.error(error);\n * });\n * ```\n * @return Returns a Promise that resolves to a `FileSystemDownloadResult` object.\n */\nexport async function downloadAsync(\n uri: string,\n fileUri: string,\n options: DownloadOptions = {}\n): Promise {\n if (!ExponentFileSystem.downloadAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadAsync');\n }\n\n return await ExponentFileSystem.downloadAsync(uri, fileUri, {\n sessionType: FileSystemSessionType.BACKGROUND,\n ...options,\n });\n}\n\n/**\n * Upload the contents of the file pointed by `fileUri` to the remote url.\n * @param url The remote URL, where the file will be sent.\n * @param fileUri The local URI of the file to send. The file must exist.\n * @param options A map of download options represented by [`FileSystemUploadOptions`](#filesystemuploadoptions) type.\n * @example\n * **Client**\n *\n * ```js\n * import * as FileSystem from 'expo-file-system';\n *\n * try {\n * const response = await FileSystem.uploadAsync(`http://192.168.0.1:1234/binary-upload`, fileUri, {\n * fieldName: 'file',\n * httpMethod: 'PATCH',\n * uploadType: FileSystem.FileSystemUploadType.BINARY_CONTENT,\n * });\n * console.log(JSON.stringify(response, null, 4));\n * } catch (error) {\n * console.log(error);\n * }\n * ```\n *\n * **Server**\n *\n * Please refer to the \"[Server: Handling multipart requests](#server-handling-multipart-requests)\" example - there is code for a simple Node.js server.\n * @return Returns a Promise that resolves to `FileSystemUploadResult` object.\n */\nexport async function uploadAsync(\n url: string,\n fileUri: string,\n options: FileSystemUploadOptions = {}\n): Promise {\n if (!ExponentFileSystem.uploadAsync) {\n throw new UnavailabilityError('expo-file-system', 'uploadAsync');\n }\n\n return await ExponentFileSystem.uploadAsync(url, fileUri, {\n sessionType: FileSystemSessionType.BACKGROUND,\n uploadType: FileSystemUploadType.BINARY_CONTENT,\n ...options,\n httpMethod: (options.httpMethod || 'POST').toUpperCase(),\n });\n}\n\n/**\n * Create a `DownloadResumable` object which can start, pause, and resume a download of contents at a remote URI to a file in the app's file system.\n * > Note: You need to call `downloadAsync()`, on a `DownloadResumable` instance to initiate the download.\n * The `DownloadResumable` object has a callback that provides download progress updates.\n * Downloads can be resumed across app restarts by using `AsyncStorage` to store the `DownloadResumable.savable()` object for later retrieval.\n * The `savable` object contains the arguments required to initialize a new `DownloadResumable` object to resume the download after an app restart.\n * The directory for a local file uri must exist prior to calling this function.\n * @param uri The remote URI to download from.\n * @param fileUri The local URI of the file to download to. If there is no file at this URI, a new one is created.\n * If there is a file at this URI, its contents are replaced. The directory for the file must exist.\n * @param options A map of download options represented by [`DownloadOptions`](#downloadoptions) type.\n * @param callback This function is called on each data write to update the download progress.\n * > **Note**: When the app has been moved to the background, this callback won't be fired until it's moved to the foreground.\n * @param resumeData The string which allows the api to resume a paused download. This is set on the `DownloadResumable` object automatically when a download is paused.\n * When initializing a new `DownloadResumable` this should be `null`.\n */\nexport function createDownloadResumable(\n uri: string,\n fileUri: string,\n options?: DownloadOptions,\n callback?: FileSystemNetworkTaskProgressCallback,\n resumeData?: string\n): DownloadResumable {\n return new DownloadResumable(uri, fileUri, options, callback, resumeData);\n}\n\nexport function createUploadTask(\n url: string,\n fileUri: string,\n options?: FileSystemUploadOptions,\n callback?: FileSystemNetworkTaskProgressCallback\n): UploadTask {\n return new UploadTask(url, fileUri, options, callback);\n}\n\nexport abstract class FileSystemCancellableNetworkTask<\n T extends DownloadProgressData | UploadProgressData\n> {\n private _uuid = uuidv4();\n protected taskWasCanceled = false;\n private emitter = new EventEmitter(ExponentFileSystem);\n private subscription?: Subscription | null;\n\n // @docsMissing\n public async cancelAsync(): Promise {\n if (!ExponentFileSystem.networkTaskCancelAsync) {\n throw new UnavailabilityError('expo-file-system', 'networkTaskCancelAsync');\n }\n\n this.removeSubscription();\n this.taskWasCanceled = true;\n return await ExponentFileSystem.networkTaskCancelAsync(this.uuid);\n }\n\n protected isTaskCancelled(): boolean {\n if (this.taskWasCanceled) {\n console.warn('This task was already canceled.');\n return true;\n }\n\n return false;\n }\n\n protected get uuid(): string {\n return this._uuid;\n }\n\n protected abstract getEventName(): string;\n\n protected abstract getCallback(): FileSystemNetworkTaskProgressCallback | undefined;\n\n protected addSubscription() {\n if (this.subscription) {\n return;\n }\n\n this.subscription = this.emitter.addListener(this.getEventName(), (event: ProgressEvent) => {\n if (event.uuid === this.uuid) {\n const callback = this.getCallback();\n if (callback) {\n callback(event.data);\n }\n }\n });\n }\n\n protected removeSubscription() {\n if (!this.subscription) {\n return;\n }\n this.emitter.removeSubscription(this.subscription);\n this.subscription = null;\n }\n}\n\nexport class UploadTask extends FileSystemCancellableNetworkTask {\n private options: FileSystemUploadOptions;\n\n constructor(\n private url: string,\n private fileUri: string,\n options?: FileSystemUploadOptions,\n private callback?: FileSystemNetworkTaskProgressCallback\n ) {\n super();\n\n const httpMethod = (options?.httpMethod?.toUpperCase() ||\n 'POST') as FileSystemAcceptedUploadHttpMethod;\n\n this.options = {\n sessionType: FileSystemSessionType.BACKGROUND,\n uploadType: FileSystemUploadType.BINARY_CONTENT,\n ...options,\n httpMethod,\n };\n }\n\n protected getEventName(): string {\n return 'expo-file-system.uploadProgress';\n }\n protected getCallback(): FileSystemNetworkTaskProgressCallback | undefined {\n return this.callback;\n }\n\n // @docsMissing\n public async uploadAsync(): Promise {\n if (!ExponentFileSystem.uploadTaskStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'uploadTaskStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n const result = await ExponentFileSystem.uploadTaskStartAsync(\n this.url,\n this.fileUri,\n this.uuid,\n this.options\n );\n this.removeSubscription();\n\n return result;\n }\n}\n\nexport class DownloadResumable extends FileSystemCancellableNetworkTask {\n constructor(\n private url: string,\n private _fileUri: string,\n private options: DownloadOptions = {},\n private callback?: FileSystemNetworkTaskProgressCallback,\n private resumeData?: string\n ) {\n super();\n }\n\n public get fileUri(): string {\n return this._fileUri;\n }\n\n protected getEventName(): string {\n return 'expo-file-system.downloadProgress';\n }\n\n protected getCallback(): FileSystemNetworkTaskProgressCallback | undefined {\n return this.callback;\n }\n\n /**\n * Download the contents at a remote URI to a file in the app's file system.\n * @return Returns a Promise that resolves to `FileSystemDownloadResult` object, or to `undefined` when task was cancelled.\n */\n async downloadAsync(): Promise {\n if (!ExponentFileSystem.downloadResumableStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumableStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n return await ExponentFileSystem.downloadResumableStartAsync(\n this.url,\n this._fileUri,\n this.uuid,\n this.options,\n this.resumeData\n );\n }\n\n /**\n * Pause the current download operation. `resumeData` is added to the `DownloadResumable` object after a successful pause operation.\n * Returns an object that can be saved with `AsyncStorage` for future retrieval (the same object that is returned from calling `FileSystem.DownloadResumable.savable()`).\n * @return Returns a Promise that resolves to `DownloadPauseState` object.\n */\n async pauseAsync(): Promise {\n if (!ExponentFileSystem.downloadResumablePauseAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumablePauseAsync');\n }\n\n if (this.isTaskCancelled()) {\n return {\n fileUri: this._fileUri,\n options: this.options,\n url: this.url,\n };\n }\n\n const pauseResult = await ExponentFileSystem.downloadResumablePauseAsync(this.uuid);\n this.removeSubscription();\n if (pauseResult) {\n this.resumeData = pauseResult.resumeData;\n return this.savable();\n } else {\n throw new Error('Unable to generate a savable pause state');\n }\n }\n\n /**\n * Resume a paused download operation.\n * @return Returns a Promise that resolves to `FileSystemDownloadResult` object, or to `undefined` when task was cancelled.\n */\n async resumeAsync(): Promise {\n if (!ExponentFileSystem.downloadResumableStartAsync) {\n throw new UnavailabilityError('expo-file-system', 'downloadResumableStartAsync');\n }\n\n if (this.isTaskCancelled()) {\n return;\n }\n\n this.addSubscription();\n return await ExponentFileSystem.downloadResumableStartAsync(\n this.url,\n this.fileUri,\n this.uuid,\n this.options,\n this.resumeData\n );\n }\n\n /**\n * Method to get the object which can be saved with `AsyncStorage` for future retrieval.\n * @returns Returns object in shape of `DownloadPauseState` type.\n */\n savable(): DownloadPauseState {\n return {\n url: this.url,\n fileUri: this.fileUri,\n options: this.options,\n resumeData: this.resumeData,\n };\n }\n}\n\nconst baseReadAsStringAsync = readAsStringAsync;\nconst baseWriteAsStringAsync = writeAsStringAsync;\nconst baseDeleteAsync = deleteAsync;\nconst baseMoveAsync = moveAsync;\nconst baseCopyAsync = copyAsync;\n\n/**\n * The `StorageAccessFramework` is a namespace inside of the `expo-file-system` module, which encapsulates all functions which can be used with [SAF URIs](#saf-uri).\n * You can read more about SAF in the [Android documentation](https://developer.android.com/guide/topics/providers/document-provider).\n *\n * @example\n * # Basic Usage\n *\n * ```ts\n * import { StorageAccessFramework } from 'expo-file-system';\n *\n * // Requests permissions for external directory\n * const permissions = await StorageAccessFramework.requestDirectoryPermissionsAsync();\n *\n * if (permissions.granted) {\n * // Gets SAF URI from response\n * const uri = permissions.directoryUri;\n *\n * // Gets all files inside of selected directory\n * const files = await StorageAccessFramework.readDirectoryAsync(uri);\n * alert(`Files inside ${uri}:\\n\\n${JSON.stringify(files)}`);\n * }\n * ```\n *\n * # Migrating an album\n *\n * ```ts\n * import * as MediaLibrary from 'expo-media-library';\n * import * as FileSystem from 'expo-file-system';\n * const { StorageAccessFramework } = FileSystem;\n *\n * async function migrateAlbum(albumName: string) {\n * // Gets SAF URI to the album\n * const albumUri = StorageAccessFramework.getUriForDirectoryInRoot(albumName);\n *\n * // Requests permissions\n * const permissions = await StorageAccessFramework.requestDirectoryPermissionsAsync(albumUri);\n * if (!permissions.granted) {\n * return;\n * }\n *\n * const permittedUri = permissions.directoryUri;\n * // Checks if users selected the correct folder\n * if (!permittedUri.includes(albumName)) {\n * return;\n * }\n *\n * const mediaLibraryPermissions = await MediaLibrary.requestPermissionsAsync();\n * if (!mediaLibraryPermissions.granted) {\n * return;\n * }\n *\n * // Moves files from external storage to internal storage\n * await StorageAccessFramework.moveAsync({\n * from: permittedUri,\n * to: FileSystem.documentDirectory!,\n * });\n *\n * const outputDir = FileSystem.documentDirectory! + albumName;\n * const migratedFiles = await FileSystem.readDirectoryAsync(outputDir);\n *\n * // Creates assets from local files\n * const [newAlbumCreator, ...assets] = await Promise.all(\n * migratedFiles.map>(\n * async fileName => await MediaLibrary.createAssetAsync(outputDir + '/' + fileName)\n * )\n * );\n *\n * // Album was empty\n * if (!newAlbumCreator) {\n * return;\n * }\n *\n * // Creates a new album in the scoped directory\n * const newAlbum = await MediaLibrary.createAlbumAsync(albumName, newAlbumCreator, false);\n * if (assets.length) {\n * await MediaLibrary.addAssetsToAlbumAsync(assets, newAlbum, false);\n * }\n * }\n * ```\n * @platform Android\n */\nexport namespace StorageAccessFramework {\n /**\n * Gets a [SAF URI](#saf-uri) pointing to a folder in the Android root directory. You can use this function to get URI for\n * `StorageAccessFramework.requestDirectoryPermissionsAsync()` when you trying to migrate an album. In that case, the name of the album is the folder name.\n * @param folderName The name of the folder which is located in the Android root directory.\n * @return Returns a [SAF URI](#saf-uri) to a folder.\n */\n export function getUriForDirectoryInRoot(folderName: string) {\n return `content://com.android.externalstorage.documents/tree/primary:${folderName}/document/primary:${folderName}`;\n }\n\n /**\n * Allows users to select a specific directory, granting your app access to all of the files and sub-directories within that directory.\n * @param initialFileUrl The [SAF URI](#saf-uri) of the directory that the file picker should display when it first loads.\n * If URI is incorrect or points to a non-existing folder, it's ignored.\n * @platform android 11+\n * @return Returns a Promise that resolves to `FileSystemRequestDirectoryPermissionsResult` object.\n */\n export async function requestDirectoryPermissionsAsync(\n initialFileUrl: string | null = null\n ): Promise {\n if (!ExponentFileSystem.requestDirectoryPermissionsAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.requestDirectoryPermissionsAsync'\n );\n }\n\n return await ExponentFileSystem.requestDirectoryPermissionsAsync(initialFileUrl);\n }\n\n /**\n * Enumerate the contents of a directory.\n * @param dirUri [SAF](#saf-uri) URI to the directory.\n * @return A Promise that resolves to an array of strings, each containing the full [SAF URI](#saf-uri) of a file or directory contained in the directory at `fileUri`.\n */\n export async function readDirectoryAsync(dirUri: string): Promise {\n if (!ExponentFileSystem.readSAFDirectoryAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.readDirectoryAsync'\n );\n }\n return await ExponentFileSystem.readSAFDirectoryAsync(dirUri);\n }\n\n /**\n * Creates a new empty directory.\n * @param parentUri The [SAF](#saf-uri) URI to the parent directory.\n * @param dirName The name of new directory.\n * @return A Promise that resolves to a [SAF URI](#saf-uri) to the created directory.\n */\n export async function makeDirectoryAsync(parentUri: string, dirName: string): Promise {\n if (!ExponentFileSystem.makeSAFDirectoryAsync) {\n throw new UnavailabilityError(\n 'expo-file-system',\n 'StorageAccessFramework.makeDirectoryAsync'\n );\n }\n return await ExponentFileSystem.makeSAFDirectoryAsync(parentUri, dirName);\n }\n\n /**\n * Creates a new empty file.\n * @param parentUri The [SAF](#saf-uri) URI to the parent directory.\n * @param fileName The name of new file **without the extension**.\n * @param mimeType The MIME type of new file.\n * @return A Promise that resolves to a [SAF URI](#saf-uri) to the created file.\n */\n export async function createFileAsync(\n parentUri: string,\n fileName: string,\n mimeType: string\n ): Promise {\n if (!ExponentFileSystem.createSAFFileAsync) {\n throw new UnavailabilityError('expo-file-system', 'StorageAccessFramework.createFileAsync');\n }\n return await ExponentFileSystem.createSAFFileAsync(parentUri, fileName, mimeType);\n }\n\n /**\n * Alias for [`writeAsStringAsync`](#filesystemwriteasstringasyncfileuri-contents-options) method.\n */\n export const writeAsStringAsync = baseWriteAsStringAsync;\n /**\n * Alias for [`readAsStringAsync`](#filesystemreadasstringasyncfileuri-options) method.\n */\n export const readAsStringAsync = baseReadAsStringAsync;\n /**\n * Alias for [`deleteAsync`](#filesystemdeleteasyncfileuri-options) method.\n */\n export const deleteAsync = baseDeleteAsync;\n /**\n * Alias for [`moveAsync`](#filesystemmoveasyncoptions) method.\n */\n export const moveAsync = baseMoveAsync;\n /**\n * Alias for [`copyAsync`](#filesystemcopyasyncoptions) method.\n */\n export const copyAsync = baseCopyAsync;\n}\n"]} \ No newline at end of file diff --git a/packages/expo-file-system/src/FileSystem.ts b/packages/expo-file-system/src/FileSystem.ts index af2bda8f496857..5367dce6dacf4e 100644 --- a/packages/expo-file-system/src/FileSystem.ts +++ b/packages/expo-file-system/src/FileSystem.ts @@ -1,6 +1,5 @@ -import { EventEmitter, Subscription, UnavailabilityError } from 'expo-modules-core'; +import { EventEmitter, Subscription, UnavailabilityError, uuidv4 } from 'expo-modules-core'; import { Platform } from 'react-native'; -import { v4 as uuidv4 } from 'uuid'; import ExponentFileSystem from './ExponentFileSystem'; import { diff --git a/packages/expo-modules-core/CHANGELOG.md b/packages/expo-modules-core/CHANGELOG.md index 741027089d8da1..3117c2f1bc7ebe 100644 --- a/packages/expo-modules-core/CHANGELOG.md +++ b/packages/expo-modules-core/CHANGELOG.md @@ -13,6 +13,7 @@ ### 💡 Others - Changed Objective-C names for `ExpoReactDelegate` and `ExpoReactDelegateHandler` to fix issues with versioning in Expo Go. ([#23229](https://github.com/expo/expo/pull/23229) by [@tsapeta](https://github.com/tsapeta)) +- Fork `uuid@3.4.0` and move into `expo-modules-core`. Remove the original dependency. ([#23249](https://github.com/expo/expo/pull/23249) by [@alanhughes](https://github.com/alanjhughes)) ## 1.5.3 — 2023-06-24 diff --git a/packages/expo-modules-core/build/index.d.ts b/packages/expo-modules-core/build/index.d.ts index 48c1da4086c2c0..af62140c75ab7f 100644 --- a/packages/expo-modules-core/build/index.d.ts +++ b/packages/expo-modules-core/build/index.d.ts @@ -9,6 +9,7 @@ import { CodedError } from './errors/CodedError'; import { UnavailabilityError } from './errors/UnavailabilityError'; import './sweet/setUpErrorManager.fx'; export { default as deprecate } from './deprecate'; +export { uuidv4, uuidv5 } from './uuid'; export { DeviceEventEmitter, EventEmitter, NativeModulesProxy, ProxyNativeModule, Platform, Subscription, SyntheticPlatformEmitter, requireNativeViewManager, CodedError, UnavailabilityError, }; export * from './requireNativeModule'; export * from './TypedArrays.types'; diff --git a/packages/expo-modules-core/build/index.d.ts.map b/packages/expo-modules-core/build/index.d.ts.map index eca78cc0f90696..a439f6ef2bf159 100644 --- a/packages/expo-modules-core/build/index.d.ts.map +++ b/packages/expo-modules-core/build/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,wBAAwB,EACxB,wBAAwB,EAExB,UAAU,EACV,mBAAmB,GACpB,CAAC;AAEF,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,qBAAqB,iDAAqB,CAAC;AAExD,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,wBAAwB,EACxB,wBAAwB,EAExB,UAAU,EACV,mBAAmB,GACpB,CAAC;AAEF,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,qBAAqB,iDAAqB,CAAC;AAExD,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"} \ No newline at end of file diff --git a/packages/expo-modules-core/build/index.js b/packages/expo-modules-core/build/index.js index 3fd2ebc3a1da1b..655c41e9cc7725 100644 --- a/packages/expo-modules-core/build/index.js +++ b/packages/expo-modules-core/build/index.js @@ -8,6 +8,7 @@ import { CodedError } from './errors/CodedError'; import { UnavailabilityError } from './errors/UnavailabilityError'; import './sweet/setUpErrorManager.fx'; export { default as deprecate } from './deprecate'; +export { uuidv4, uuidv5 } from './uuid'; export { DeviceEventEmitter, EventEmitter, NativeModulesProxy, Platform, SyntheticPlatformEmitter, requireNativeViewManager, // Errors CodedError, UnavailabilityError, }; diff --git a/packages/expo-modules-core/build/index.js.map b/packages/expo-modules-core/build/index.js.map index 67f0df40338868..e8f5382b59e943 100644 --- a/packages/expo-modules-core/build/index.js.map +++ b/packages/expo-modules-core/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAElB,QAAQ,EAER,wBAAwB,EACxB,wBAAwB;AACxB,SAAS;AACT,UAAU,EACV,mBAAmB,GACpB,CAAC;AAEF,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC","sourcesContent":["import { DeviceEventEmitter } from 'react-native';\n\nimport { EventEmitter, Subscription } from './EventEmitter';\nimport NativeModulesProxy from './NativeModulesProxy';\nimport { ProxyNativeModule } from './NativeModulesProxy.types';\nimport { requireNativeViewManager } from './NativeViewManagerAdapter';\nimport Platform from './Platform';\nimport SyntheticPlatformEmitter from './SyntheticPlatformEmitter';\nimport { CodedError } from './errors/CodedError';\nimport { UnavailabilityError } from './errors/UnavailabilityError';\n\nimport './sweet/setUpErrorManager.fx';\n\nexport { default as deprecate } from './deprecate';\n\nexport {\n DeviceEventEmitter,\n EventEmitter,\n NativeModulesProxy,\n ProxyNativeModule,\n Platform,\n Subscription,\n SyntheticPlatformEmitter,\n requireNativeViewManager,\n // Errors\n CodedError,\n UnavailabilityError,\n};\n\nexport * from './requireNativeModule';\nexport * from './TypedArrays.types';\n\n/**\n * @deprecated renamed to `DeviceEventEmitter`\n */\nexport const RCTDeviceEventEmitter = DeviceEventEmitter;\n\nexport * from './PermissionsInterface';\nexport * from './PermissionsHook';\n"]} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAElB,QAAQ,EAER,wBAAwB,EACxB,wBAAwB;AACxB,SAAS;AACT,UAAU,EACV,mBAAmB,GACpB,CAAC;AAEF,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC","sourcesContent":["import { DeviceEventEmitter } from 'react-native';\n\nimport { EventEmitter, Subscription } from './EventEmitter';\nimport NativeModulesProxy from './NativeModulesProxy';\nimport { ProxyNativeModule } from './NativeModulesProxy.types';\nimport { requireNativeViewManager } from './NativeViewManagerAdapter';\nimport Platform from './Platform';\nimport SyntheticPlatformEmitter from './SyntheticPlatformEmitter';\nimport { CodedError } from './errors/CodedError';\nimport { UnavailabilityError } from './errors/UnavailabilityError';\n\nimport './sweet/setUpErrorManager.fx';\n\nexport { default as deprecate } from './deprecate';\n\nexport { uuidv4, uuidv5 } from './uuid';\n\nexport {\n DeviceEventEmitter,\n EventEmitter,\n NativeModulesProxy,\n ProxyNativeModule,\n Platform,\n Subscription,\n SyntheticPlatformEmitter,\n requireNativeViewManager,\n // Errors\n CodedError,\n UnavailabilityError,\n};\n\nexport * from './requireNativeModule';\nexport * from './TypedArrays.types';\n\n/**\n * @deprecated renamed to `DeviceEventEmitter`\n */\nexport const RCTDeviceEventEmitter = DeviceEventEmitter;\n\nexport * from './PermissionsInterface';\nexport * from './PermissionsHook';\n"]} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/index.d.ts b/packages/expo-modules-core/build/uuid/index.d.ts new file mode 100644 index 00000000000000..0e7012180aac70 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/index.d.ts @@ -0,0 +1,3 @@ +export * from './v4'; +export { default as uuidv5 } from './v5'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/index.d.ts.map b/packages/expo-modules-core/build/uuid/index.d.ts.map new file mode 100644 index 00000000000000..c84da5afd59d5c --- /dev/null +++ b/packages/expo-modules-core/build/uuid/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/uuid/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC"} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/index.js b/packages/expo-modules-core/build/uuid/index.js new file mode 100644 index 00000000000000..00fa72f280827d --- /dev/null +++ b/packages/expo-modules-core/build/uuid/index.js @@ -0,0 +1,3 @@ +export * from './v4'; +export { default as uuidv5 } from './v5'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/index.js.map b/packages/expo-modules-core/build/uuid/index.js.map new file mode 100644 index 00000000000000..3895aa431e746c --- /dev/null +++ b/packages/expo-modules-core/build/uuid/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/uuid/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC","sourcesContent":["export * from './v4';\nexport { default as uuidv5 } from './v5';\n"]} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/bytesToUuid.d.ts b/packages/expo-modules-core/build/uuid/lib/bytesToUuid.d.ts new file mode 100644 index 00000000000000..5c752bb70416cb --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/bytesToUuid.d.ts @@ -0,0 +1,3 @@ +declare function bytesToUuid(buf: number[], offset?: number): string; +export default bytesToUuid; +//# sourceMappingURL=bytesToUuid.d.ts.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/bytesToUuid.d.ts.map b/packages/expo-modules-core/build/uuid/lib/bytesToUuid.d.ts.map new file mode 100644 index 00000000000000..31ae0621ec83fc --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/bytesToUuid.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bytesToUuid.d.ts","sourceRoot":"","sources":["../../../src/uuid/lib/bytesToUuid.ts"],"names":[],"mappings":"AASA,iBAAS,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,UA0BlD;AAED,eAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/bytesToUuid.js b/packages/expo-modules-core/build/uuid/lib/bytesToUuid.js new file mode 100644 index 00000000000000..d2998c214a2875 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/bytesToUuid.js @@ -0,0 +1,37 @@ +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +const byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex[i] = (i + 0x100).toString(16).substr(1); +} +function bytesToUuid(buf, offset) { + let i = offset || 0; + const bth = byteToHex; + // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 + return [ + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + '-', + bth[buf[i++]], + bth[buf[i++]], + '-', + bth[buf[i++]], + bth[buf[i++]], + '-', + bth[buf[i++]], + bth[buf[i++]], + '-', + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + ].join(''); +} +export default bytesToUuid; +//# sourceMappingURL=bytesToUuid.js.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/bytesToUuid.js.map b/packages/expo-modules-core/build/uuid/lib/bytesToUuid.js.map new file mode 100644 index 00000000000000..f7a76238248618 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/bytesToUuid.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bytesToUuid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AAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;KACd,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACb,CAAC;AAED,eAAe,WAAW,CAAC","sourcesContent":["/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex: string[] = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf: number[], offset?: number) {\n let i = offset || 0;\n const bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return [\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n ].join('');\n}\n\nexport default bytesToUuid;\n"]} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/rng.d.ts b/packages/expo-modules-core/build/uuid/lib/rng.d.ts new file mode 100644 index 00000000000000..d64c3623d65850 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/rng.d.ts @@ -0,0 +1,3 @@ +declare let exportedFunction: () => number[] | Uint8Array; +export default exportedFunction; +//# sourceMappingURL=rng.d.ts.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/rng.d.ts.map b/packages/expo-modules-core/build/uuid/lib/rng.d.ts.map new file mode 100644 index 00000000000000..30f6af4aa2dfe6 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/rng.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"rng.d.ts","sourceRoot":"","sources":["../../../src/uuid/lib/rng.ts"],"names":[],"mappings":"AAcA,QAAA,IAAI,gBAAgB,EAAE,MAAM,MAAM,EAAE,GAAG,UAAU,CAAC;AA2BlD,eAAe,gBAAgB,CAAC"} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/rng.js b/packages/expo-modules-core/build/uuid/lib/rng.js new file mode 100644 index 00000000000000..72d388297d4981 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/rng.js @@ -0,0 +1,35 @@ +// @ts-ignore +let msCrypto; +if (typeof window != 'undefined') { + msCrypto = window.crypto; +} +const getRandomValues = (typeof crypto != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) || + (typeof msCrypto != 'undefined' && + typeof window.crypto.getRandomValues == 'function' && + msCrypto.getRandomValues.bind(msCrypto)); +let exportedFunction; +if (getRandomValues) { + // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto + const rnds8 = new Uint8Array(16); // eslint-disable-line no-undef + exportedFunction = function whatwgRNG() { + getRandomValues(rnds8); + return rnds8; + }; +} +else { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + const rnds = new Array(16); + exportedFunction = function mathRNG() { + for (let i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) + r = Math.random() * 0x100000000; + rnds[i] = (r >>> ((i & 0x03) << 3)) & 0xff; + } + return rnds; + }; +} +export default exportedFunction; +//# sourceMappingURL=rng.js.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/rng.js.map b/packages/expo-modules-core/build/uuid/lib/rng.js.map new file mode 100644 index 00000000000000..23f3e8c9d88ff7 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/rng.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rng.js","sourceRoot":"","sources":["../../../src/uuid/lib/rng.ts"],"names":[],"mappings":"AAAA,aAAa;AAEb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gB,CAAC","sourcesContent":["// @ts-ignore\n\nlet msCrypto;\n\nif (typeof window != 'undefined') {\n msCrypto = window.crypto;\n}\n\nconst getRandomValues =\n (typeof crypto != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof msCrypto != 'undefined' &&\n typeof window.crypto.getRandomValues == 'function' &&\n msCrypto.getRandomValues.bind(msCrypto));\n\nlet exportedFunction: () => number[] | Uint8Array;\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n const rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n exportedFunction = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n const rnds: number[] = new Array(16);\n\n exportedFunction = function mathRNG() {\n for (let i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = (r >>> ((i & 0x03) << 3)) & 0xff;\n }\n\n return rnds;\n };\n}\n\nexport default exportedFunction;\n"]} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/sha1.d.ts b/packages/expo-modules-core/build/uuid/lib/sha1.d.ts new file mode 100644 index 00000000000000..1db372a445f5ee --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/sha1.d.ts @@ -0,0 +1,3 @@ +declare function sha1(bytes: number[] | string): number[]; +export default sha1; +//# sourceMappingURL=sha1.d.ts.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/sha1.d.ts.map b/packages/expo-modules-core/build/uuid/lib/sha1.d.ts.map new file mode 100644 index 00000000000000..7f12e07fe43348 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/sha1.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha1.d.ts","sourceRoot":"","sources":["../../../src/uuid/lib/sha1.ts"],"names":[],"mappings":"AAuBA,iBAAS,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,YAoFrC;AAED,eAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/sha1.js b/packages/expo-modules-core/build/uuid/lib/sha1.js new file mode 100644 index 00000000000000..ba9e79c47819f5 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/sha1.js @@ -0,0 +1,98 @@ +// Adapted from Chris Veness' SHA1 code at +// http://www.movable-type.co.uk/scripts/sha1.html +'use strict'; +function f(s, x, y, z) { + switch (s) { + case 0: + return (x & y) ^ (~x & z); + case 1: + return x ^ y ^ z; + case 2: + return (x & y) ^ (x & z) ^ (y & z); + case 3: + return x ^ y ^ z; + default: + return 0; + } +} +function ROTL(x, n) { + return (x << n) | (x >>> (32 - n)); +} +function sha1(bytes) { + const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + if (typeof bytes == 'string') { + const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + bytes = new Array(msg.length); + for (let i = 0; i < msg.length; i++) + bytes[i] = msg.charCodeAt(i); + } + bytes.push(0x80); + const l = bytes.length / 4 + 2; + const N = Math.ceil(l / 16); + const M = new Array(N); + for (let i = 0; i < N; i++) { + M[i] = new Array(16); + for (let j = 0; j < 16; j++) { + M[i][j] = + (bytes[i * 64 + j * 4] << 24) | + (bytes[i * 64 + j * 4 + 1] << 16) | + (bytes[i * 64 + j * 4 + 2] << 8) | + bytes[i * 64 + j * 4 + 3]; + } + } + M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff; + for (let i = 0; i < N; i++) { + const W = new Array(80); + for (let t = 0; t < 16; t++) + W[t] = M[i][t]; + for (let t = 16; t < 80; t++) { + W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + let a = H[0]; + let b = H[1]; + let c = H[2]; + let d = H[3]; + let e = H[4]; + for (let t = 0; t < 80; t++) { + const s = Math.floor(t / 20); + const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + H[0] = (H[0] + a) >>> 0; + H[1] = (H[1] + b) >>> 0; + H[2] = (H[2] + c) >>> 0; + H[3] = (H[3] + d) >>> 0; + H[4] = (H[4] + e) >>> 0; + } + return [ + (H[0] >> 24) & 0xff, + (H[0] >> 16) & 0xff, + (H[0] >> 8) & 0xff, + H[0] & 0xff, + (H[1] >> 24) & 0xff, + (H[1] >> 16) & 0xff, + (H[1] >> 8) & 0xff, + H[1] & 0xff, + (H[2] >> 24) & 0xff, + (H[2] >> 16) & 0xff, + (H[2] >> 8) & 0xff, + H[2] & 0xff, + (H[3] >> 24) & 0xff, + (H[3] >> 16) & 0xff, + (H[3] >> 8) & 0xff, + H[3] & 0xff, + (H[4] >> 24) & 0xff, + (H[4] >> 16) & 0xff, + (H[4] >> 8) & 0xff, + H[4] & 0xff, + ]; +} +export default sha1; +//# sourceMappingURL=sha1.js.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/sha1.js.map b/packages/expo-modules-core/build/uuid/lib/sha1.js.map new file mode 100644 index 00000000000000..ce67d983c91544 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/sha1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha1.js","sourceRoot":"","sources":["../../../src/uuid/lib/sha1.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,kDAAkD;AAClD,YAAY,CAAC;AAEb,SAAS,CAAC,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACnD,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC;YACJ,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,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AAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI;QAClB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;QACX,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI;QAClB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;QACX,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI;QAClB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;QACX,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI;QAClB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;KACZ,CAAC;AACJ,CAAC;AAED,eAAe,IAAI,CAAC","sourcesContent":["// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\n'use strict';\n\nfunction f(s: number, x: number, y: number, z: number) {\n switch (s) {\n case 0:\n return (x & y) ^ (~x & z);\n case 1:\n return x ^ y ^ z;\n case 2:\n return (x & y) ^ (x & z) ^ (y & z);\n case 3:\n return x ^ y ^ z;\n default:\n return 0;\n }\n}\n\nfunction ROTL(x: number, n: number) {\n return (x << n) | (x >>> (32 - n));\n}\n\nfunction sha1(bytes: number[] | string) {\n const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes == 'string') {\n const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n bytes = new Array(msg.length);\n for (let i = 0; i < msg.length; i++) bytes[i] = msg.charCodeAt(i);\n }\n\n bytes.push(0x80);\n\n const l = bytes.length / 4 + 2;\n const N = Math.ceil(l / 16);\n const M = new Array(N);\n\n for (let i = 0; i < N; i++) {\n M[i] = new Array(16);\n for (let j = 0; j < 16; j++) {\n M[i][j] =\n (bytes[i * 64 + j * 4] << 24) |\n (bytes[i * 64 + j * 4 + 1] << 16) |\n (bytes[i * 64 + j * 4 + 2] << 8) |\n bytes[i * 64 + j * 4 + 3];\n }\n }\n\n M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff;\n\n for (let i = 0; i < N; i++) {\n const W = new Array(80);\n\n for (let t = 0; t < 16; t++) W[t] = M[i][t];\n for (let t = 16; t < 80; t++) {\n W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n let a = H[0];\n let b = H[1];\n let c = H[2];\n let d = H[3];\n let e = H[4];\n\n for (let t = 0; t < 80; t++) {\n const s = Math.floor(t / 20);\n const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = (H[0] + a) >>> 0;\n H[1] = (H[1] + b) >>> 0;\n H[2] = (H[2] + c) >>> 0;\n H[3] = (H[3] + d) >>> 0;\n H[4] = (H[4] + e) >>> 0;\n }\n\n return [\n (H[0] >> 24) & 0xff,\n (H[0] >> 16) & 0xff,\n (H[0] >> 8) & 0xff,\n H[0] & 0xff,\n (H[1] >> 24) & 0xff,\n (H[1] >> 16) & 0xff,\n (H[1] >> 8) & 0xff,\n H[1] & 0xff,\n (H[2] >> 24) & 0xff,\n (H[2] >> 16) & 0xff,\n (H[2] >> 8) & 0xff,\n H[2] & 0xff,\n (H[3] >> 24) & 0xff,\n (H[3] >> 16) & 0xff,\n (H[3] >> 8) & 0xff,\n H[3] & 0xff,\n (H[4] >> 24) & 0xff,\n (H[4] >> 16) & 0xff,\n (H[4] >> 8) & 0xff,\n H[4] & 0xff,\n ];\n}\n\nexport default sha1;\n"]} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/v35.d.ts b/packages/expo-modules-core/build/uuid/lib/v35.d.ts new file mode 100644 index 00000000000000..ecbb8fe64b5d3a --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/v35.d.ts @@ -0,0 +1,7 @@ +export default function (name: string, version: number, hashfunc: (bytes: number[] | string) => number[]): { + (value: number[] | string, namespace: number[] | string, buf?: number[], offset?: number): string; + name: string; + DNS: string; + URL: string; +}; +//# sourceMappingURL=v35.d.ts.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/v35.d.ts.map b/packages/expo-modules-core/build/uuid/lib/v35.d.ts.map new file mode 100644 index 00000000000000..9637fd3b020725 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/v35.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"v35.d.ts","sourceRoot":"","sources":["../../../src/uuid/lib/v35.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,OAAO,WACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,MAAM,EAAE;YAGvC,MAAM,EAAE,GAAG,MAAM,aACb,MAAM,EAAE,GAAG,MAAM,QACtB,MAAM,EAAE,WACL,MAAM,GACd,MAAM;;;;EAkCV"} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/v35.js b/packages/expo-modules-core/build/uuid/lib/v35.js new file mode 100644 index 00000000000000..3af2aae9c632d8 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/v35.js @@ -0,0 +1,51 @@ +import bytesToUuid from './bytesToUuid'; +function uuidToBytes(uuid) { + // Note: We assume we're being passed a valid uuid string + const bytes = []; + uuid.replace(/[a-fA-F0-9]{2}/g, (hex) => { + bytes.push(parseInt(hex, 16)); + return ''; + }); + return bytes; +} +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + const bytes = new Array(str.length); + for (let i = 0; i < str.length; i++) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} +export default function (name, version, hashfunc) { + const generateUUID = function (value, namespace, buf, offset) { + const off = (buf && offset) || 0; + if (typeof value == 'string') + value = stringToBytes(value); + if (typeof namespace == 'string') + namespace = uuidToBytes(namespace); + if (!Array.isArray(value)) + throw TypeError('value must be an array of bytes'); + if (!Array.isArray(namespace) || namespace.length !== 16) + throw TypeError('namespace must be uuid string or an Array of 16 byte values'); + // Per 4.3 + const bytes = hashfunc(namespace.concat(value)); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + if (buf) { + for (let idx = 0; idx < 16; ++idx) { + buf[off + idx] = bytes[idx]; + } + } + return bytesToUuid(bytes); + }; + // Function#name is not settable on some platforms (#270) + try { + generateUUID.name = name; + } + catch { } + // Pre-defined namespaces, per Appendix C + generateUUID.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; + generateUUID.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; + return generateUUID; +} +//# sourceMappingURL=v35.js.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/lib/v35.js.map b/packages/expo-modules-core/build/uuid/lib/v35.js.map new file mode 100644 index 00000000000000..ab04b29643992d --- /dev/null +++ b/packages/expo-modules-core/build/uuid/lib/v35.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v35.js","sourceRoot":"","sources":["../../../src/uuid/lib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,iCAAiC,CAAC,CAAC;QAC9E,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,EAAE;YACtD,MAAM,SAAS,CAAC,6DAA6D,CAAC,CAAC;QAEjF,UAAU;QACV,MAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAChD,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC;QACvC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;QAEpC,IAAI,GAAG,EAAE;YACP,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE;gBACjC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;aAC7B;SACF;QAED,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,yDAAyD;IACzD,IAAI;QACF,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC;KAC1B;IAAC,MAAM,GAAE;IAEV,yCAAyC;IACzC,YAAY,CAAC,GAAG,GAAG,sCAAsC,CAAC;IAC1D,YAAY,CAAC,GAAG,GAAG,sCAAsC,CAAC;IAE1D,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import bytesToUuid from './bytesToUuid';\n\nfunction uuidToBytes(uuid: string) {\n // Note: We assume we're being passed a valid uuid string\n const bytes: number[] = [];\n uuid.replace(/[a-fA-F0-9]{2}/g, (hex: string) => {\n bytes.push(parseInt(hex, 16));\n return '';\n });\n\n return bytes;\n}\n\nfunction stringToBytes(str: string) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n const bytes: number[] = new Array(str.length);\n for (let i = 0; i < str.length; i++) {\n bytes[i] = str.charCodeAt(i);\n }\n return bytes;\n}\n\nexport default function (\n name: string,\n version: number,\n hashfunc: (bytes: number[] | string) => number[]\n) {\n const generateUUID = function (\n value: number[] | string,\n namespace: number[] | string,\n buf?: number[],\n offset?: number\n ): string {\n const off = (buf && offset) || 0;\n\n if (typeof value == 'string') value = stringToBytes(value);\n if (typeof namespace == 'string') namespace = uuidToBytes(namespace);\n\n if (!Array.isArray(value)) throw TypeError('value must be an array of bytes');\n if (!Array.isArray(namespace) || namespace.length !== 16)\n throw TypeError('namespace must be uuid string or an Array of 16 byte values');\n\n // Per 4.3\n const bytes = hashfunc(namespace.concat(value));\n bytes[6] = (bytes[6] & 0x0f) | version;\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n if (buf) {\n for (let idx = 0; idx < 16; ++idx) {\n buf[off + idx] = bytes[idx];\n }\n }\n\n return bytesToUuid(bytes);\n };\n\n // Function#name is not settable on some platforms (#270)\n try {\n generateUUID.name = name;\n } catch {}\n\n // Pre-defined namespaces, per Appendix C\n generateUUID.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\n generateUUID.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\n\n return generateUUID;\n}\n"]} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/types/uuid.types.d.ts b/packages/expo-modules-core/build/uuid/types/uuid.types.d.ts new file mode 100644 index 00000000000000..525ee48f8ab850 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/types/uuid.types.d.ts @@ -0,0 +1,11 @@ +export type OutputBuffer = ArrayLike; +export type InputBuffer = ArrayLike; +export type V4Options = { + random: InputBuffer; +} | { + rng(): InputBuffer; +} | string; +export type v4String = (options?: V4Options) => string; +export type v4Buffer = (options: V4Options | null | undefined, buffer: T, offset?: number) => T; +export type v4 = v4Buffer & v4String; +//# sourceMappingURL=uuid.types.d.ts.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/types/uuid.types.d.ts.map b/packages/expo-modules-core/build/uuid/types/uuid.types.d.ts.map new file mode 100644 index 00000000000000..32fa03d2e6a32e --- /dev/null +++ b/packages/expo-modules-core/build/uuid/types/uuid.types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"uuid.types.d.ts","sourceRoot":"","sources":["../../../src/uuid/types/uuid.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,GAAG,IAAI,WAAW,CAAA;CAAE,GAAG,MAAM,CAAC;AAElF,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,EAAE,SAAS,KAAK,MAAM,CAAC;AACvD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,SAAS,YAAY,EAC5C,OAAO,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,EACrC,MAAM,EAAE,CAAC,EACT,MAAM,CAAC,EAAE,MAAM,KACZ,CAAC,CAAC;AACP,MAAM,MAAM,EAAE,GAAG,QAAQ,GAAG,QAAQ,CAAC"} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/types/uuid.types.js b/packages/expo-modules-core/build/uuid/types/uuid.types.js new file mode 100644 index 00000000000000..f81cebc7c10d2c --- /dev/null +++ b/packages/expo-modules-core/build/uuid/types/uuid.types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=uuid.types.js.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/types/uuid.types.js.map b/packages/expo-modules-core/build/uuid/types/uuid.types.js.map new file mode 100644 index 00000000000000..da0b80c2ab9287 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/types/uuid.types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uuid.types.js","sourceRoot":"","sources":["../../../src/uuid/types/uuid.types.ts"],"names":[],"mappings":"","sourcesContent":["export type OutputBuffer = ArrayLike;\nexport type InputBuffer = ArrayLike;\n\nexport type V4Options = { random: InputBuffer } | { rng(): InputBuffer } | string;\n\nexport type v4String = (options?: V4Options) => string;\nexport type v4Buffer = (\n options: V4Options | null | undefined,\n buffer: T,\n offset?: number\n) => T;\nexport type v4 = v4Buffer & v4String;\n"]} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/v4.d.ts b/packages/expo-modules-core/build/uuid/v4.d.ts new file mode 100644 index 00000000000000..9cd3319653786c --- /dev/null +++ b/packages/expo-modules-core/build/uuid/v4.d.ts @@ -0,0 +1,6 @@ +import { V4Options } from './types/uuid.types'; +/** + * DO NOT USE this function in security-sensitive contexts. + */ +export declare function uuidv4(options?: V4Options): string; +//# sourceMappingURL=v4.d.ts.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/v4.d.ts.map b/packages/expo-modules-core/build/uuid/v4.d.ts.map new file mode 100644 index 00000000000000..a6f9f369c93a44 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/v4.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"v4.d.ts","sourceRoot":"","sources":["../../src/uuid/v4.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;GAEG;AACH,wBAAgB,MAAM,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/v4.js b/packages/expo-modules-core/build/uuid/v4.js new file mode 100644 index 00000000000000..a01abbbb7d2efd --- /dev/null +++ b/packages/expo-modules-core/build/uuid/v4.js @@ -0,0 +1,29 @@ +import bytesToUuid from './lib/bytesToUuid'; +import rng from './lib/rng'; +export function uuidv4(options, buf, offset) { + const i = (buf && offset) || 0; + let buffer = null; + if (typeof options == 'string') { + buffer = options === 'binary' ? new Array(16) : null; + options = undefined; + } + options = options || undefined; + let rnds = []; + if (options && 'random' in options) { + rnds = options.random; + } + else if (options && 'rng' in options) { + rnds = (options.rng || rng)(); + } + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + // Copy bytes to buffer, if provided + if (buffer) { + for (let ii = 0; ii < 16; ++ii) { + buffer[i + ii] = rnds[ii]; + } + } + return buffer || bytesToUuid(rnds); +} +//# sourceMappingURL=v4.js.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/v4.js.map b/packages/expo-modules-core/build/uuid/v4.js.map new file mode 100644 index 00000000000000..035592a0d9c69b --- /dev/null +++ b/packages/expo-modules-core/build/uuid/v4.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v4.js","sourceRoot":"","sources":["../../src/uuid/v4.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,GAAG,MAAM,WAAW,CAAC;AAO5B,MAAM,UAAU,MAAM,CACpB,OAAqC,EACrC,GAAO,EACP,MAAe;IAEf,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IAE/B,IAAI,MAAM,GAAoB,IAAI,CAAC;IAEnC,IAAI,OAAO,OAAO,IAAI,QAAQ,EAAE;QAC9B,MAAM,GAAG,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrD,OAAO,GAAG,SAAS,CAAC;KACrB;IAED,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC;IAE/B,IAAI,IAAI,GAAa,EAAE,CAAC;IACxB,IAAI,OAAO,IAAI,QAAQ,IAAI,OAAO,EAAE;QAClC,IAAI,GAAG,OAAO,CAAC,MAAkB,CAAC;KACnC;SAAM,IAAI,OAAO,IAAI,KAAK,IAAI,OAAO,EAAE;QACtC,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,EAAc,CAAC;KAC3C;IAED,gEAAgE;IAChE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAClC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAElC,oCAAoC;IACpC,IAAI,MAAM,EAAE;QACV,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE;YAC9B,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;SAC3B;KACF;IAED,OAAO,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import bytesToUuid from './lib/bytesToUuid';\nimport rng from './lib/rng';\nimport { OutputBuffer, V4Options } from './types/uuid.types';\n\n/**\n * DO NOT USE this function in security-sensitive contexts.\n */\nexport function uuidv4(options?: V4Options): string;\nexport function uuidv4(\n options: V4Options | null | undefined,\n buf?: T,\n offset?: number\n) {\n const i = (buf && offset) || 0;\n\n let buffer: number[] | null = null;\n\n if (typeof options == 'string') {\n buffer = options === 'binary' ? new Array(16) : null;\n options = undefined;\n }\n\n options = options || undefined;\n\n let rnds: number[] = [];\n if (options && 'random' in options) {\n rnds = options.random as number[];\n } else if (options && 'rng' in options) {\n rnds = (options.rng || rng)() as number[];\n }\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buffer) {\n for (let ii = 0; ii < 16; ++ii) {\n buffer[i + ii] = rnds[ii];\n }\n }\n\n return buffer || bytesToUuid(rnds);\n}\n"]} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/v5.d.ts b/packages/expo-modules-core/build/uuid/v5.d.ts new file mode 100644 index 00000000000000..7ef1909317d7e1 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/v5.d.ts @@ -0,0 +1,11 @@ +/** + * DO NOT USE this function in security-sensitive contexts. + */ +declare const _default: { + (value: string | number[], namespace: string | number[], buf?: number[] | undefined, offset?: number | undefined): string; + name: string; + DNS: string; + URL: string; +}; +export default _default; +//# sourceMappingURL=v5.d.ts.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/v5.d.ts.map b/packages/expo-modules-core/build/uuid/v5.d.ts.map new file mode 100644 index 00000000000000..6548871dce4ac5 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/v5.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"v5.d.ts","sourceRoot":"","sources":["../../src/uuid/v5.ts"],"names":[],"mappings":"AAGA;;GAEG;;;;;;;AACH,wBAAqC"} \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/v5.js b/packages/expo-modules-core/build/uuid/v5.js new file mode 100644 index 00000000000000..9eaafc709acf1a --- /dev/null +++ b/packages/expo-modules-core/build/uuid/v5.js @@ -0,0 +1,7 @@ +import sha1 from './lib/sha1'; +import v35 from './lib/v35'; +/** + * DO NOT USE this function in security-sensitive contexts. + */ +export default v35('v5', 0x50, sha1); +//# sourceMappingURL=v5.js.map \ No newline at end of file diff --git a/packages/expo-modules-core/build/uuid/v5.js.map b/packages/expo-modules-core/build/uuid/v5.js.map new file mode 100644 index 00000000000000..a3dabeb69ccef0 --- /dev/null +++ b/packages/expo-modules-core/build/uuid/v5.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v5.js","sourceRoot":"","sources":["../../src/uuid/v5.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,GAAG,MAAM,WAAW,CAAC;AAE5B;;GAEG;AACH,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC","sourcesContent":["import sha1 from './lib/sha1';\nimport v35 from './lib/v35';\n\n/**\n * DO NOT USE this function in security-sensitive contexts.\n */\nexport default v35('v5', 0x50, sha1);\n"]} \ No newline at end of file diff --git a/packages/expo-modules-core/src/index.ts b/packages/expo-modules-core/src/index.ts index 85a06c0418133e..1b11f03be14f3a 100644 --- a/packages/expo-modules-core/src/index.ts +++ b/packages/expo-modules-core/src/index.ts @@ -13,6 +13,8 @@ import './sweet/setUpErrorManager.fx'; export { default as deprecate } from './deprecate'; +export { uuidv4, uuidv5 } from './uuid'; + export { DeviceEventEmitter, EventEmitter, diff --git a/packages/expo-modules-core/src/uuid/index.ts b/packages/expo-modules-core/src/uuid/index.ts new file mode 100644 index 00000000000000..5b51f8f625d29c --- /dev/null +++ b/packages/expo-modules-core/src/uuid/index.ts @@ -0,0 +1,2 @@ +export * from './v4'; +export { default as uuidv5 } from './v5'; diff --git a/packages/expo-modules-core/src/uuid/lib/bytesToUuid.ts b/packages/expo-modules-core/src/uuid/lib/bytesToUuid.ts new file mode 100644 index 00000000000000..ca59c6cb9c3946 --- /dev/null +++ b/packages/expo-modules-core/src/uuid/lib/bytesToUuid.ts @@ -0,0 +1,38 @@ +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +const byteToHex: string[] = []; +for (let i = 0; i < 256; ++i) { + byteToHex[i] = (i + 0x100).toString(16).substr(1); +} + +function bytesToUuid(buf: number[], offset?: number) { + let i = offset || 0; + const bth = byteToHex; + // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 + return [ + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + '-', + bth[buf[i++]], + bth[buf[i++]], + '-', + bth[buf[i++]], + bth[buf[i++]], + '-', + bth[buf[i++]], + bth[buf[i++]], + '-', + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + bth[buf[i++]], + ].join(''); +} + +export default bytesToUuid; diff --git a/packages/expo-modules-core/src/uuid/lib/rng.ts b/packages/expo-modules-core/src/uuid/lib/rng.ts new file mode 100644 index 00000000000000..a10a76acd00aa2 --- /dev/null +++ b/packages/expo-modules-core/src/uuid/lib/rng.ts @@ -0,0 +1,42 @@ +// @ts-ignore + +let msCrypto; + +if (typeof window != 'undefined') { + msCrypto = window.crypto; +} + +const getRandomValues = + (typeof crypto != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) || + (typeof msCrypto != 'undefined' && + typeof window.crypto.getRandomValues == 'function' && + msCrypto.getRandomValues.bind(msCrypto)); + +let exportedFunction: () => number[] | Uint8Array; + +if (getRandomValues) { + // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto + const rnds8 = new Uint8Array(16); // eslint-disable-line no-undef + + exportedFunction = function whatwgRNG() { + getRandomValues(rnds8); + return rnds8; + }; +} else { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + const rnds: number[] = new Array(16); + + exportedFunction = function mathRNG() { + for (let i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) r = Math.random() * 0x100000000; + rnds[i] = (r >>> ((i & 0x03) << 3)) & 0xff; + } + + return rnds; + }; +} + +export default exportedFunction; diff --git a/packages/expo-modules-core/src/uuid/lib/sha1.ts b/packages/expo-modules-core/src/uuid/lib/sha1.ts new file mode 100644 index 00000000000000..ebb42d91c4bc7b --- /dev/null +++ b/packages/expo-modules-core/src/uuid/lib/sha1.ts @@ -0,0 +1,110 @@ +// Adapted from Chris Veness' SHA1 code at +// http://www.movable-type.co.uk/scripts/sha1.html +'use strict'; + +function f(s: number, x: number, y: number, z: number) { + switch (s) { + case 0: + return (x & y) ^ (~x & z); + case 1: + return x ^ y ^ z; + case 2: + return (x & y) ^ (x & z) ^ (y & z); + case 3: + return x ^ y ^ z; + default: + return 0; + } +} + +function ROTL(x: number, n: number) { + return (x << n) | (x >>> (32 - n)); +} + +function sha1(bytes: number[] | string) { + const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + + if (typeof bytes == 'string') { + const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + bytes = new Array(msg.length); + for (let i = 0; i < msg.length; i++) bytes[i] = msg.charCodeAt(i); + } + + bytes.push(0x80); + + const l = bytes.length / 4 + 2; + const N = Math.ceil(l / 16); + const M = new Array(N); + + for (let i = 0; i < N; i++) { + M[i] = new Array(16); + for (let j = 0; j < 16; j++) { + M[i][j] = + (bytes[i * 64 + j * 4] << 24) | + (bytes[i * 64 + j * 4 + 1] << 16) | + (bytes[i * 64 + j * 4 + 2] << 8) | + bytes[i * 64 + j * 4 + 3]; + } + } + + M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff; + + for (let i = 0; i < N; i++) { + const W = new Array(80); + + for (let t = 0; t < 16; t++) W[t] = M[i][t]; + for (let t = 16; t < 80; t++) { + W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + + let a = H[0]; + let b = H[1]; + let c = H[2]; + let d = H[3]; + let e = H[4]; + + for (let t = 0; t < 80; t++) { + const s = Math.floor(t / 20); + const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + + H[0] = (H[0] + a) >>> 0; + H[1] = (H[1] + b) >>> 0; + H[2] = (H[2] + c) >>> 0; + H[3] = (H[3] + d) >>> 0; + H[4] = (H[4] + e) >>> 0; + } + + return [ + (H[0] >> 24) & 0xff, + (H[0] >> 16) & 0xff, + (H[0] >> 8) & 0xff, + H[0] & 0xff, + (H[1] >> 24) & 0xff, + (H[1] >> 16) & 0xff, + (H[1] >> 8) & 0xff, + H[1] & 0xff, + (H[2] >> 24) & 0xff, + (H[2] >> 16) & 0xff, + (H[2] >> 8) & 0xff, + H[2] & 0xff, + (H[3] >> 24) & 0xff, + (H[3] >> 16) & 0xff, + (H[3] >> 8) & 0xff, + H[3] & 0xff, + (H[4] >> 24) & 0xff, + (H[4] >> 16) & 0xff, + (H[4] >> 8) & 0xff, + H[4] & 0xff, + ]; +} + +export default sha1; diff --git a/packages/expo-modules-core/src/uuid/lib/v35.ts b/packages/expo-modules-core/src/uuid/lib/v35.ts new file mode 100644 index 00000000000000..35a77644c2488c --- /dev/null +++ b/packages/expo-modules-core/src/uuid/lib/v35.ts @@ -0,0 +1,67 @@ +import bytesToUuid from './bytesToUuid'; + +function uuidToBytes(uuid: string) { + // Note: We assume we're being passed a valid uuid string + const bytes: number[] = []; + uuid.replace(/[a-fA-F0-9]{2}/g, (hex: string) => { + bytes.push(parseInt(hex, 16)); + return ''; + }); + + return bytes; +} + +function stringToBytes(str: string) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + const bytes: number[] = new Array(str.length); + for (let i = 0; i < str.length; i++) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} + +export default function ( + name: string, + version: number, + hashfunc: (bytes: number[] | string) => number[] +) { + const generateUUID = function ( + value: number[] | string, + namespace: number[] | string, + buf?: number[], + offset?: number + ): string { + const off = (buf && offset) || 0; + + if (typeof value == 'string') value = stringToBytes(value); + if (typeof namespace == 'string') namespace = uuidToBytes(namespace); + + if (!Array.isArray(value)) throw TypeError('value must be an array of bytes'); + if (!Array.isArray(namespace) || namespace.length !== 16) + throw TypeError('namespace must be uuid string or an Array of 16 byte values'); + + // Per 4.3 + const bytes = hashfunc(namespace.concat(value)); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + + if (buf) { + for (let idx = 0; idx < 16; ++idx) { + buf[off + idx] = bytes[idx]; + } + } + + return bytesToUuid(bytes); + }; + + // Function#name is not settable on some platforms (#270) + try { + generateUUID.name = name; + } catch {} + + // Pre-defined namespaces, per Appendix C + generateUUID.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; + generateUUID.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; + + return generateUUID; +} diff --git a/packages/expo-modules-core/src/uuid/types/uuid.types.ts b/packages/expo-modules-core/src/uuid/types/uuid.types.ts new file mode 100755 index 00000000000000..82285286e0f2fb --- /dev/null +++ b/packages/expo-modules-core/src/uuid/types/uuid.types.ts @@ -0,0 +1,12 @@ +export type OutputBuffer = ArrayLike; +export type InputBuffer = ArrayLike; + +export type V4Options = { random: InputBuffer } | { rng(): InputBuffer } | string; + +export type v4String = (options?: V4Options) => string; +export type v4Buffer = ( + options: V4Options | null | undefined, + buffer: T, + offset?: number +) => T; +export type v4 = v4Buffer & v4String; diff --git a/packages/expo-modules-core/src/uuid/v4.ts b/packages/expo-modules-core/src/uuid/v4.ts new file mode 100644 index 00000000000000..5831d5b83b51f1 --- /dev/null +++ b/packages/expo-modules-core/src/uuid/v4.ts @@ -0,0 +1,44 @@ +import bytesToUuid from './lib/bytesToUuid'; +import rng from './lib/rng'; +import { OutputBuffer, V4Options } from './types/uuid.types'; + +/** + * DO NOT USE this function in security-sensitive contexts. + */ +export function uuidv4(options?: V4Options): string; +export function uuidv4( + options: V4Options | null | undefined, + buf?: T, + offset?: number +) { + const i = (buf && offset) || 0; + + let buffer: number[] | null = null; + + if (typeof options == 'string') { + buffer = options === 'binary' ? new Array(16) : null; + options = undefined; + } + + options = options || undefined; + + let rnds: number[] = []; + if (options && 'random' in options) { + rnds = options.random as number[]; + } else if (options && 'rng' in options) { + rnds = (options.rng || rng)() as number[]; + } + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buffer) { + for (let ii = 0; ii < 16; ++ii) { + buffer[i + ii] = rnds[ii]; + } + } + + return buffer || bytesToUuid(rnds); +} diff --git a/packages/expo-modules-core/src/uuid/v5.ts b/packages/expo-modules-core/src/uuid/v5.ts new file mode 100644 index 00000000000000..18ab743f3851cf --- /dev/null +++ b/packages/expo-modules-core/src/uuid/v5.ts @@ -0,0 +1,7 @@ +import sha1 from './lib/sha1'; +import v35 from './lib/v35'; + +/** + * DO NOT USE this function in security-sensitive contexts. + */ +export default v35('v5', 0x50, sha1); diff --git a/packages/expo-notifications/CHANGELOG.md b/packages/expo-notifications/CHANGELOG.md index ccea4d230143cc..ee023e08930530 100644 --- a/packages/expo-notifications/CHANGELOG.md +++ b/packages/expo-notifications/CHANGELOG.md @@ -10,6 +10,8 @@ ### 💡 Others +- Fork `uuid@3.4.0` and move into `expo-modules-core`. Remove the original dependency. ([#23249](https://github.com/expo/expo/pull/23249) by [@alanhughes](https://github.com/alanjhughes)) + ## 0.20.1 — 2023-06-24 _This version does not introduce any user-facing changes._ @@ -256,9 +258,11 @@ _This version does not introduce any user-facing changes._ - Changed class responsible for handling Firebase events from `FirebaseMessagingService` to `.service.NotificationsService` on Android. ([#10558](https://github.com/expo/expo/pull/10558) by [@sjchmiela](https://github.com/sjchmiela)) > Note that this change most probably will not affect you — it only affects projects that override `FirebaseMessagingService` to implement some custom handling logic. + - Changed how you can override ways in which a notification is reinterpreted from a [`StatusBarNotification`](https://developer.android.com/reference/android/service/notification/StatusBarNotification) and in which a [`Notification`](https://developer.android.com/reference/android/app/Notification.html?hl=en) is built from defining an `expo.modules.notifications#NotificationsScoper` meta-data value in `AndroidManifest.xml` to implementing a `BroadcastReceiver` subclassing `NotificationsService` delegating those responsibilities to your custom `PresentationDelegate` instance. ([#10558](https://github.com/expo/expo/pull/10558) by [@sjchmiela](https://github.com/sjchmiela)) > Note that this change most probably will not affect you — it only affects projects that override those methods to implement some custom handling logic. + - Removed `removeAllNotificationListeners` method. You can (and should) still remove listeners using `remove` method on `Subscription` objects returned by `addNotification…Listener`. ([#10883](https://github.com/expo/expo/pull/10883) by [@sjchmiela](https://github.com/sjchmiela)) - Fixed device identifier being used to fetch Expo push token being backed up on Android which resulted in multiple devices having the same `deviceId` (and eventually, Expo push token). ([#11005](https://github.com/expo/expo/pull/11005) by [@sjchmiela](https://github.com/sjchmiela)) - Fixed device identifier used when fetching Expo push token being different than `Constants.installationId` in managed workflow apps which resulted in different Expo push tokens returned for the same experience across old and new Expo API and the device push token not being automatically updated on Expo push servers which lead to Expo push tokens corresponding to outdated Firebase tokens. ([#11005](https://github.com/expo/expo/pull/11005) by [@sjchmiela](https://github.com/sjchmiela)) diff --git a/packages/expo-notifications/build/ServerRegistrationModule.web.d.ts.map b/packages/expo-notifications/build/ServerRegistrationModule.web.d.ts.map index dbe53087785c2e..4ecc542476d32e 100644 --- a/packages/expo-notifications/build/ServerRegistrationModule.web.d.ts.map +++ b/packages/expo-notifications/build/ServerRegistrationModule.web.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ServerRegistrationModule.web.d.ts","sourceRoot":"","sources":["../src/ServerRegistrationModule.web.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;;AAW5E,wBAoC8B"} \ No newline at end of file +{"version":3,"file":"ServerRegistrationModule.web.d.ts","sourceRoot":"","sources":["../src/ServerRegistrationModule.web.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;;AAW5E,wBAoC8B"} \ No newline at end of file diff --git a/packages/expo-notifications/build/ServerRegistrationModule.web.js b/packages/expo-notifications/build/ServerRegistrationModule.web.js index 5c9feb1d55b25d..79a982953d59d3 100644 --- a/packages/expo-notifications/build/ServerRegistrationModule.web.js +++ b/packages/expo-notifications/build/ServerRegistrationModule.web.js @@ -1,5 +1,4 @@ -import { CodedError } from 'expo-modules-core'; -import { v4 as uuidv4 } from 'uuid'; +import { CodedError, uuidv4 } from 'expo-modules-core'; const INSTALLATION_ID_KEY = 'EXPO_NOTIFICATIONS_INSTALLATION_ID'; const REGISTRATION_INFO_KEY = 'EXPO_NOTIFICATIONS_REGISTRATION_INFO'; // Lazy fallback installationId per session initializer diff --git a/packages/expo-notifications/build/ServerRegistrationModule.web.js.map b/packages/expo-notifications/build/ServerRegistrationModule.web.js.map index f67ee26588834c..133fc218ec827e 100644 --- a/packages/expo-notifications/build/ServerRegistrationModule.web.js.map +++ b/packages/expo-notifications/build/ServerRegistrationModule.web.js.map @@ -1 +1 @@ -{"version":3,"file":"ServerRegistrationModule.web.js","sourceRoot":"","sources":["../src/ServerRegistrationModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAIpC,MAAM,mBAAmB,GAAG,oCAAoC,CAAC;AACjE,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAErE,uDAAuD;AACvD,IAAI,yBAAyB,GAAG,GAAG,EAAE;IACnC,MAAM,qBAAqB,GAAG,MAAM,EAAE,CAAC;IACvC,yBAAyB,GAAG,GAAG,EAAE,CAAC,qBAAqB,CAAC;AAC1D,CAAC,CAAC;AAEF,eAAe;IACb,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACjC,IAAI,cAAc,CAAC;QAEnB,IAAI;YACF,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;YAC3D,IAAI,CAAC,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;gBACzD,cAAc,GAAG,MAAM,EAAE,CAAC;gBAC1B,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;aAC3D;SACF;QAAC,MAAM;YACN,cAAc,GAAG,yBAAyB,EAAE,CAAC;SAC9C;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACnC,OAAO,YAAY,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrD,CAAC;IACD,wBAAwB,EAAE,KAAK,EAAE,gBAA+B,EAAE,EAAE;QAClE,IAAI;YACF,IAAI,gBAAgB,EAAE;gBACpB,YAAY,CAAC,OAAO,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAC;aAC/D;iBAAM;gBACL,YAAY,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;aAChD;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,UAAU,CAClB,iCAAiC,EACjC,2EAA2E,KAAK,EAAE,CACnF,CAAC;SACH;IACH,CAAC;IACD,uBAAuB;IACvB,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;IACrB,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;CACE,CAAC","sourcesContent":["import { CodedError } from 'expo-modules-core';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { ServerRegistrationModule } from './ServerRegistrationModule.types';\n\nconst INSTALLATION_ID_KEY = 'EXPO_NOTIFICATIONS_INSTALLATION_ID';\nconst REGISTRATION_INFO_KEY = 'EXPO_NOTIFICATIONS_REGISTRATION_INFO';\n\n// Lazy fallback installationId per session initializer\nlet getFallbackInstallationId = () => {\n const sessionInstallationId = uuidv4();\n getFallbackInstallationId = () => sessionInstallationId;\n};\n\nexport default {\n getInstallationIdAsync: async () => {\n let installationId;\n\n try {\n installationId = localStorage.getItem(INSTALLATION_ID_KEY);\n if (!installationId || typeof installationId !== 'string') {\n installationId = uuidv4();\n localStorage.setItem(INSTALLATION_ID_KEY, installationId);\n }\n } catch {\n installationId = getFallbackInstallationId();\n }\n\n return installationId;\n },\n getRegistrationInfoAsync: async () => {\n return localStorage.getItem(REGISTRATION_INFO_KEY);\n },\n setRegistrationInfoAsync: async (registrationInfo: string | null) => {\n try {\n if (registrationInfo) {\n localStorage.setItem(REGISTRATION_INFO_KEY, registrationInfo);\n } else {\n localStorage.removeItem(REGISTRATION_INFO_KEY);\n }\n } catch (error) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_STORAGE_ERROR',\n `Could not modify localStorage to persist auto-registration information: ${error}`\n );\n }\n },\n // mock implementations\n addListener: () => {},\n removeListeners: () => {},\n} as ServerRegistrationModule;\n"]} \ No newline at end of file +{"version":3,"file":"ServerRegistrationModule.web.js","sourceRoot":"","sources":["../src/ServerRegistrationModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIvD,MAAM,mBAAmB,GAAG,oCAAoC,CAAC;AACjE,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAErE,uDAAuD;AACvD,IAAI,yBAAyB,GAAG,GAAG,EAAE;IACnC,MAAM,qBAAqB,GAAG,MAAM,EAAE,CAAC;IACvC,yBAAyB,GAAG,GAAG,EAAE,CAAC,qBAAqB,CAAC;AAC1D,CAAC,CAAC;AAEF,eAAe;IACb,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACjC,IAAI,cAAc,CAAC;QAEnB,IAAI;YACF,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;YAC3D,IAAI,CAAC,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;gBACzD,cAAc,GAAG,MAAM,EAAE,CAAC;gBAC1B,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;aAC3D;SACF;QAAC,MAAM;YACN,cAAc,GAAG,yBAAyB,EAAE,CAAC;SAC9C;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACnC,OAAO,YAAY,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrD,CAAC;IACD,wBAAwB,EAAE,KAAK,EAAE,gBAA+B,EAAE,EAAE;QAClE,IAAI;YACF,IAAI,gBAAgB,EAAE;gBACpB,YAAY,CAAC,OAAO,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAC;aAC/D;iBAAM;gBACL,YAAY,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;aAChD;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,UAAU,CAClB,iCAAiC,EACjC,2EAA2E,KAAK,EAAE,CACnF,CAAC;SACH;IACH,CAAC;IACD,uBAAuB;IACvB,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;IACrB,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;CACE,CAAC","sourcesContent":["import { CodedError, uuidv4 } from 'expo-modules-core';\n\nimport { ServerRegistrationModule } from './ServerRegistrationModule.types';\n\nconst INSTALLATION_ID_KEY = 'EXPO_NOTIFICATIONS_INSTALLATION_ID';\nconst REGISTRATION_INFO_KEY = 'EXPO_NOTIFICATIONS_REGISTRATION_INFO';\n\n// Lazy fallback installationId per session initializer\nlet getFallbackInstallationId = () => {\n const sessionInstallationId = uuidv4();\n getFallbackInstallationId = () => sessionInstallationId;\n};\n\nexport default {\n getInstallationIdAsync: async () => {\n let installationId;\n\n try {\n installationId = localStorage.getItem(INSTALLATION_ID_KEY);\n if (!installationId || typeof installationId !== 'string') {\n installationId = uuidv4();\n localStorage.setItem(INSTALLATION_ID_KEY, installationId);\n }\n } catch {\n installationId = getFallbackInstallationId();\n }\n\n return installationId;\n },\n getRegistrationInfoAsync: async () => {\n return localStorage.getItem(REGISTRATION_INFO_KEY);\n },\n setRegistrationInfoAsync: async (registrationInfo: string | null) => {\n try {\n if (registrationInfo) {\n localStorage.setItem(REGISTRATION_INFO_KEY, registrationInfo);\n } else {\n localStorage.removeItem(REGISTRATION_INFO_KEY);\n }\n } catch (error) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_STORAGE_ERROR',\n `Could not modify localStorage to persist auto-registration information: ${error}`\n );\n }\n },\n // mock implementations\n addListener: () => {},\n removeListeners: () => {},\n} as ServerRegistrationModule;\n"]} \ No newline at end of file diff --git a/packages/expo-notifications/build/presentNotificationAsync.d.ts.map b/packages/expo-notifications/build/presentNotificationAsync.d.ts.map index bee67e416dfe7d..2b81e259679203 100644 --- a/packages/expo-notifications/build/presentNotificationAsync.d.ts.map +++ b/packages/expo-notifications/build/presentNotificationAsync.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"presentNotificationAsync.d.ts","sourceRoot":"","sources":["../src/presentNotificationAsync.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAIjE;;;;;;;GAOG;AACH,wBAA8B,wBAAwB,CACpD,OAAO,EAAE,wBAAwB,EACjC,UAAU,GAAE,MAAiB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAajB"} \ No newline at end of file +{"version":3,"file":"presentNotificationAsync.d.ts","sourceRoot":"","sources":["../src/presentNotificationAsync.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAIjE;;;;;;;GAOG;AACH,wBAA8B,wBAAwB,CACpD,OAAO,EAAE,wBAAwB,EACjC,UAAU,GAAE,MAAiB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAajB"} \ No newline at end of file diff --git a/packages/expo-notifications/build/presentNotificationAsync.js b/packages/expo-notifications/build/presentNotificationAsync.js index 3822fecd84ec65..fbc7f66d85d19d 100644 --- a/packages/expo-notifications/build/presentNotificationAsync.js +++ b/packages/expo-notifications/build/presentNotificationAsync.js @@ -1,5 +1,4 @@ -import { UnavailabilityError } from 'expo-modules-core'; -import { v4 as uuidv4 } from 'uuid'; +import { UnavailabilityError, uuidv4 } from 'expo-modules-core'; import NotificationPresenter from './NotificationPresenterModule'; let warningMessageShown = false; /** diff --git a/packages/expo-notifications/build/presentNotificationAsync.js.map b/packages/expo-notifications/build/presentNotificationAsync.js.map index 143197666739f9..acfd81be25dd8b 100644 --- a/packages/expo-notifications/build/presentNotificationAsync.js.map +++ b/packages/expo-notifications/build/presentNotificationAsync.js.map @@ -1 +1 @@ -{"version":3,"file":"presentNotificationAsync.js","sourceRoot":"","sources":["../src/presentNotificationAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAGlE,IAAI,mBAAmB,GAAG,KAAK,CAAC;AAEhC;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,wBAAwB,CACpD,OAAiC,EACjC,aAAqB,MAAM,EAAE;IAE7B,IAAI,OAAO,IAAI,CAAC,mBAAmB,EAAE;QACnC,OAAO,CAAC,IAAI,CACV,qMAAqM,CACtM,CAAC;QACF,mBAAmB,GAAG,IAAI,CAAC;KAC5B;IAED,IAAI,CAAC,qBAAqB,CAAC,wBAAwB,EAAE;QACnD,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,0BAA0B,CAAC,CAAC;KAC5E;IAED,OAAO,MAAM,qBAAqB,CAAC,wBAAwB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACnF,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport NotificationPresenter from './NotificationPresenterModule';\nimport { NotificationContentInput } from './Notifications.types';\n\nlet warningMessageShown = false;\n\n/**\n * Schedules a notification for immediate trigger.\n * @param content An object representing the notification content.\n * @param identifier\n * @return It returns a Promise resolving with the notification's identifier once the notification is successfully scheduled for immediate display.\n * @header schedule\n * @deprecated This method has been deprecated in favor of using an explicit `NotificationHandler` and the [`scheduleNotificationAsync`](#notificationsschedulenotificationasyncrequest) method. More information can be found in our [FYI document](https://expo.fyi/presenting-notifications-deprecated).\n */\nexport default async function presentNotificationAsync(\n content: NotificationContentInput,\n identifier: string = uuidv4()\n): Promise {\n if (__DEV__ && !warningMessageShown) {\n console.warn(\n '`presentNotificationAsync` has been deprecated in favor of using `scheduleNotificationAsync` + an explicit notification handler. Read more at https://expo.fyi/presenting-notifications-deprecated.'\n );\n warningMessageShown = true;\n }\n\n if (!NotificationPresenter.presentNotificationAsync) {\n throw new UnavailabilityError('Notifications', 'presentNotificationAsync');\n }\n\n return await NotificationPresenter.presentNotificationAsync(identifier, content);\n}\n"]} \ No newline at end of file +{"version":3,"file":"presentNotificationAsync.js","sourceRoot":"","sources":["../src/presentNotificationAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAGlE,IAAI,mBAAmB,GAAG,KAAK,CAAC;AAEhC;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,wBAAwB,CACpD,OAAiC,EACjC,aAAqB,MAAM,EAAE;IAE7B,IAAI,OAAO,IAAI,CAAC,mBAAmB,EAAE;QACnC,OAAO,CAAC,IAAI,CACV,qMAAqM,CACtM,CAAC;QACF,mBAAmB,GAAG,IAAI,CAAC;KAC5B;IAED,IAAI,CAAC,qBAAqB,CAAC,wBAAwB,EAAE;QACnD,MAAM,IAAI,mBAAmB,CAAC,eAAe,EAAE,0BAA0B,CAAC,CAAC;KAC5E;IAED,OAAO,MAAM,qBAAqB,CAAC,wBAAwB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACnF,CAAC","sourcesContent":["import { UnavailabilityError, uuidv4 } from 'expo-modules-core';\n\nimport NotificationPresenter from './NotificationPresenterModule';\nimport { NotificationContentInput } from './Notifications.types';\n\nlet warningMessageShown = false;\n\n/**\n * Schedules a notification for immediate trigger.\n * @param content An object representing the notification content.\n * @param identifier\n * @return It returns a Promise resolving with the notification's identifier once the notification is successfully scheduled for immediate display.\n * @header schedule\n * @deprecated This method has been deprecated in favor of using an explicit `NotificationHandler` and the [`scheduleNotificationAsync`](#notificationsschedulenotificationasyncrequest) method. More information can be found in our [FYI document](https://expo.fyi/presenting-notifications-deprecated).\n */\nexport default async function presentNotificationAsync(\n content: NotificationContentInput,\n identifier: string = uuidv4()\n): Promise {\n if (__DEV__ && !warningMessageShown) {\n console.warn(\n '`presentNotificationAsync` has been deprecated in favor of using `scheduleNotificationAsync` + an explicit notification handler. Read more at https://expo.fyi/presenting-notifications-deprecated.'\n );\n warningMessageShown = true;\n }\n\n if (!NotificationPresenter.presentNotificationAsync) {\n throw new UnavailabilityError('Notifications', 'presentNotificationAsync');\n }\n\n return await NotificationPresenter.presentNotificationAsync(identifier, content);\n}\n"]} \ No newline at end of file diff --git a/packages/expo-notifications/build/scheduleNotificationAsync.d.ts.map b/packages/expo-notifications/build/scheduleNotificationAsync.d.ts.map index 2c056764f2c867..004b82016b7d8e 100644 --- a/packages/expo-notifications/build/scheduleNotificationAsync.d.ts.map +++ b/packages/expo-notifications/build/scheduleNotificationAsync.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"scheduleNotificationAsync.d.ts","sourceRoot":"","sources":["../src/scheduleNotificationAsync.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,IAAI,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC3G,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EASzB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAA8B,yBAAyB,CACrD,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,CAUjB;AAoBD,wBAAgB,YAAY,CAC1B,iBAAiB,EAAE,wBAAwB,GAC1C,8BAA8B,CA4DhC"} \ No newline at end of file +{"version":3,"file":"scheduleNotificationAsync.d.ts","sourceRoot":"","sources":["../src/scheduleNotificationAsync.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,IAAI,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC3G,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EASzB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAA8B,yBAAyB,CACrD,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,CAUjB;AAoBD,wBAAgB,YAAY,CAC1B,iBAAiB,EAAE,wBAAwB,GAC1C,8BAA8B,CA4DhC"} \ No newline at end of file diff --git a/packages/expo-notifications/build/scheduleNotificationAsync.js b/packages/expo-notifications/build/scheduleNotificationAsync.js index 7c38600fa7fcb6..cd79a25958454c 100644 --- a/packages/expo-notifications/build/scheduleNotificationAsync.js +++ b/packages/expo-notifications/build/scheduleNotificationAsync.js @@ -1,5 +1,4 @@ -import { Platform, UnavailabilityError } from 'expo-modules-core'; -import { v4 as uuidv4 } from 'uuid'; +import { Platform, UnavailabilityError, uuidv4 } from 'expo-modules-core'; import NotificationScheduler from './NotificationScheduler'; /** * Schedules a notification to be triggered in the future. diff --git a/packages/expo-notifications/build/scheduleNotificationAsync.js.map b/packages/expo-notifications/build/scheduleNotificationAsync.js.map index a56023a87e9fc2..43b30d361f81f0 100644 --- a/packages/expo-notifications/build/scheduleNotificationAsync.js.map +++ b/packages/expo-notifications/build/scheduleNotificationAsync.js.map @@ -1 +1 @@ -{"version":3,"file":"scheduleNotificationAsync.js","sourceRoot":"","sources":["../src/scheduleNotificationAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAe5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH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;iBACH;gBACD,MAAM;aACP;YACD,KAAK,SAAS,CAAC,CAAC;gBACd,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC;gBACnC,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE;oBAC9B,MAAM,IAAI,UAAU,CAClB,6DAA6D,OAAO,EAAE,CACvE,CAAC;iBACH;gBACD,MAAM;aACP;YACD,KAAK,MAAM,CAAC,CAAC;gBACX,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC;gBAChC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,EAAE,EAAE;oBACzB,MAAM,IAAI,UAAU,CAAC,2DAA2D,IAAI,EAAE,CAAC,CAAC;iBACzF;gBACD,MAAM;aACP;YACD,KAAK,QAAQ,CAAC,CAAC;gBACb,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,CAAC;gBAClC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,EAAE,EAAE;oBAC7B,MAAM,IAAI,UAAU,CAClB,6DAA6D,MAAM,EAAE,CACtE,CAAC;iBACH;gBACD,MAAM;aACP;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,QAAgB,CAAC,EAAE,IAAa;IACnD,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;AACxD,CAAC","sourcesContent":["import { Platform, UnavailabilityError } from 'expo-modules-core';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport NotificationScheduler from './NotificationScheduler';\nimport { NotificationTriggerInput as NativeNotificationTriggerInput } from './NotificationScheduler.types';\nimport {\n NotificationRequestInput,\n NotificationTriggerInput,\n DailyTriggerInput,\n WeeklyTriggerInput,\n YearlyTriggerInput,\n CalendarTriggerInput,\n TimeIntervalTriggerInput,\n DateTriggerInput,\n ChannelAwareTriggerInput,\n SchedulableNotificationTriggerInput,\n} from './Notifications.types';\n\n/**\n * Schedules a notification to be triggered in the future.\n * > **Note:** Please note that this does not mean that the notification will be presented when it is triggered.\n * For the notification to be presented you have to set a notification handler with [`setNotificationHandler`](#notificationssetnotificationhandlerhandler)\n * that will return an appropriate notification behavior. For more information see the example below.\n * @param request An object describing the notification to be triggered.\n * @return Returns a Promise resolving to a string which is a notification identifier you can later use to cancel the notification or to identify an incoming notification.\n * @example\n * # Schedule the notification that will trigger once, in one minute from now\n * ```ts\n * import * as Notifications from 'expo-notifications';\n *\n * Notifications.scheduleNotificationAsync({\n * content: {\n * title: \"Time's up!\",\n * body: 'Change sides!',\n * },\n * trigger: {\n * seconds: 60,\n * },\n * });\n * ```\n *\n * # Schedule the notification that will trigger repeatedly, every 20 minutes\n * ```ts\n * import * as Notifications from 'expo-notifications';\n *\n * Notifications.scheduleNotificationAsync({\n * content: {\n * title: 'Remember to drink water!',\n * },\n * trigger: {\n * seconds: 60 * 20,\n * repeats: true,\n * },\n * });\n * ```\n *\n * # Schedule the notification that will trigger once, at the beginning of next hour\n * ```ts\n * import * as Notifications from 'expo-notifications';\n *\n * const trigger = new Date(Date.now() + 60 * 60 * 1000);\n * trigger.setMinutes(0);\n * trigger.setSeconds(0);\n *\n * Notifications.scheduleNotificationAsync({\n * content: {\n * title: 'Happy new hour!',\n * },\n * trigger,\n * });\n * ```\n * @header schedule\n */\nexport default async function scheduleNotificationAsync(\n request: NotificationRequestInput\n): Promise {\n if (!NotificationScheduler.scheduleNotificationAsync) {\n throw new UnavailabilityError('Notifications', 'scheduleNotificationAsync');\n }\n\n return await NotificationScheduler.scheduleNotificationAsync(\n request.identifier ?? uuidv4(),\n request.content,\n parseTrigger(request.trigger)\n );\n}\n\ntype ValidTriggerDateComponents = 'month' | 'day' | 'weekday' | 'hour' | 'minute';\n\nconst DAILY_TRIGGER_EXPECTED_DATE_COMPONENTS: readonly ValidTriggerDateComponents[] = [\n 'hour',\n 'minute',\n];\nconst WEEKLY_TRIGGER_EXPECTED_DATE_COMPONENTS: readonly ValidTriggerDateComponents[] = [\n 'weekday',\n 'hour',\n 'minute',\n];\nconst YEARLY_TRIGGER_EXPECTED_DATE_COMPONENTS: readonly ValidTriggerDateComponents[] = [\n 'day',\n 'month',\n 'hour',\n 'minute',\n];\n\nexport function parseTrigger(\n userFacingTrigger: NotificationTriggerInput\n): NativeNotificationTriggerInput {\n if (userFacingTrigger === null) {\n return null;\n }\n\n if (userFacingTrigger === undefined) {\n throw new TypeError(\n 'Encountered an `undefined` notification trigger. If you want to trigger the notification immediately, pass in an explicit `null` value.'\n );\n }\n\n if (isDateTrigger(userFacingTrigger)) {\n return parseDateTrigger(userFacingTrigger);\n } else if (isDailyTriggerInput(userFacingTrigger)) {\n validateDateComponentsInTrigger(userFacingTrigger, DAILY_TRIGGER_EXPECTED_DATE_COMPONENTS);\n return {\n type: 'daily',\n channelId: userFacingTrigger.channelId,\n hour: userFacingTrigger.hour,\n minute: userFacingTrigger.minute,\n };\n } else if (isWeeklyTriggerInput(userFacingTrigger)) {\n validateDateComponentsInTrigger(userFacingTrigger, WEEKLY_TRIGGER_EXPECTED_DATE_COMPONENTS);\n return {\n type: 'weekly',\n channelId: userFacingTrigger.channelId,\n weekday: userFacingTrigger.weekday,\n hour: userFacingTrigger.hour,\n minute: userFacingTrigger.minute,\n };\n } else if (isYearlyTriggerInput(userFacingTrigger)) {\n validateDateComponentsInTrigger(userFacingTrigger, YEARLY_TRIGGER_EXPECTED_DATE_COMPONENTS);\n return {\n type: 'yearly',\n channelId: userFacingTrigger.channelId,\n day: userFacingTrigger.day,\n month: userFacingTrigger.month,\n hour: userFacingTrigger.hour,\n minute: userFacingTrigger.minute,\n };\n } else if (isSecondsPropertyMisusedInCalendarTriggerInput(userFacingTrigger)) {\n throw new TypeError(\n 'Could not have inferred the notification trigger type: if you want to use a time interval trigger, pass in only `seconds` with or without `repeats` property; if you want to use calendar-based trigger, pass in `second`.'\n );\n } else if ('seconds' in userFacingTrigger) {\n return {\n type: 'timeInterval',\n channelId: userFacingTrigger.channelId,\n seconds: userFacingTrigger.seconds,\n repeats: userFacingTrigger.repeats ?? false,\n };\n } else if (isCalendarTrigger(userFacingTrigger)) {\n const { repeats, ...calendarTrigger } = userFacingTrigger;\n return { type: 'calendar', value: calendarTrigger, repeats };\n } else {\n return Platform.select({\n default: null, // There's no notion of channels on platforms other than Android.\n android: { type: 'channel', channelId: userFacingTrigger.channelId },\n });\n }\n}\n\nfunction isCalendarTrigger(\n trigger: CalendarTriggerInput | ChannelAwareTriggerInput\n): trigger is CalendarTriggerInput {\n const { channelId, ...triggerWithoutChannelId } = trigger;\n return Object.keys(triggerWithoutChannelId).length > 0;\n}\n\nfunction isDateTrigger(\n trigger:\n | DateTriggerInput\n | WeeklyTriggerInput\n | DailyTriggerInput\n | CalendarTriggerInput\n | TimeIntervalTriggerInput\n): trigger is DateTriggerInput {\n return (\n trigger instanceof Date ||\n typeof trigger === 'number' ||\n (typeof trigger === 'object' && 'date' in trigger)\n );\n}\n\nfunction parseDateTrigger(trigger: DateTriggerInput): NativeNotificationTriggerInput {\n if (trigger instanceof Date || typeof trigger === 'number') {\n return { type: 'date', timestamp: toTimestamp(trigger) };\n }\n return { type: 'date', timestamp: toTimestamp(trigger.date), channelId: trigger.channelId };\n}\n\nfunction toTimestamp(date: number | Date) {\n if (date instanceof Date) {\n return date.getTime();\n }\n return date;\n}\n\nfunction isDailyTriggerInput(\n trigger: SchedulableNotificationTriggerInput\n): trigger is DailyTriggerInput {\n if (typeof trigger !== 'object') return false;\n const { channelId, ...triggerWithoutChannelId } = trigger as DailyTriggerInput;\n return (\n Object.keys(triggerWithoutChannelId).length ===\n DAILY_TRIGGER_EXPECTED_DATE_COMPONENTS.length + 1 &&\n DAILY_TRIGGER_EXPECTED_DATE_COMPONENTS.every(\n (component) => component in triggerWithoutChannelId\n ) &&\n 'repeats' in triggerWithoutChannelId &&\n triggerWithoutChannelId.repeats === true\n );\n}\n\nfunction isWeeklyTriggerInput(\n trigger: SchedulableNotificationTriggerInput\n): trigger is WeeklyTriggerInput {\n if (typeof trigger !== 'object') return false;\n const { channelId, ...triggerWithoutChannelId } = trigger as WeeklyTriggerInput;\n return (\n Object.keys(triggerWithoutChannelId).length ===\n WEEKLY_TRIGGER_EXPECTED_DATE_COMPONENTS.length + 1 &&\n WEEKLY_TRIGGER_EXPECTED_DATE_COMPONENTS.every(\n (component) => component in triggerWithoutChannelId\n ) &&\n 'repeats' in triggerWithoutChannelId &&\n triggerWithoutChannelId.repeats === true\n );\n}\n\nfunction isYearlyTriggerInput(\n trigger: SchedulableNotificationTriggerInput\n): trigger is YearlyTriggerInput {\n if (typeof trigger !== 'object') return false;\n const { channelId, ...triggerWithoutChannelId } = trigger as YearlyTriggerInput;\n return (\n Object.keys(triggerWithoutChannelId).length ===\n YEARLY_TRIGGER_EXPECTED_DATE_COMPONENTS.length + 1 &&\n YEARLY_TRIGGER_EXPECTED_DATE_COMPONENTS.every(\n (component) => component in triggerWithoutChannelId\n ) &&\n 'repeats' in triggerWithoutChannelId &&\n triggerWithoutChannelId.repeats === true\n );\n}\n\nfunction isSecondsPropertyMisusedInCalendarTriggerInput(\n trigger: TimeIntervalTriggerInput | CalendarTriggerInput\n) {\n const { channelId, ...triggerWithoutChannelId } = trigger;\n return (\n // eg. { seconds: ..., repeats: ..., hour: ... }\n ('seconds' in triggerWithoutChannelId &&\n 'repeats' in triggerWithoutChannelId &&\n Object.keys(triggerWithoutChannelId).length > 2) ||\n // eg. { seconds: ..., hour: ... }\n ('seconds' in triggerWithoutChannelId &&\n !('repeats' in triggerWithoutChannelId) &&\n Object.keys(triggerWithoutChannelId).length > 1)\n );\n}\n\nfunction validateDateComponentsInTrigger(\n trigger: NonNullable,\n components: readonly ValidTriggerDateComponents[]\n) {\n const anyTriggerType = trigger as any;\n components.forEach((component) => {\n if (!(component in anyTriggerType)) {\n throw new TypeError(`The ${component} parameter needs to be present`);\n }\n if (typeof anyTriggerType[component] !== 'number') {\n throw new TypeError(`The ${component} parameter should be a number`);\n }\n switch (component) {\n case 'month': {\n const { month } = anyTriggerType;\n if (month < 0 || month > 11) {\n throw new RangeError(`The month parameter needs to be between 0 and 11. Found: ${month}`);\n }\n break;\n }\n case 'day': {\n const { day, month } = anyTriggerType;\n const daysInGivenMonth = daysInMonth(month);\n if (day < 1 || day > daysInGivenMonth) {\n throw new RangeError(\n `The day parameter for month ${month} must be between 1 and ${daysInGivenMonth}. Found: ${day}`\n );\n }\n break;\n }\n case 'weekday': {\n const { weekday } = anyTriggerType;\n if (weekday < 1 || weekday > 7) {\n throw new RangeError(\n `The weekday parameter needs to be between 1 and 7. Found: ${weekday}`\n );\n }\n break;\n }\n case 'hour': {\n const { hour } = anyTriggerType;\n if (hour < 0 || hour > 23) {\n throw new RangeError(`The hour parameter needs to be between 0 and 23. Found: ${hour}`);\n }\n break;\n }\n case 'minute': {\n const { minute } = anyTriggerType;\n if (minute < 0 || minute > 59) {\n throw new RangeError(\n `The minute parameter needs to be between 0 and 59. Found: ${minute}`\n );\n }\n break;\n }\n }\n });\n}\n\n/**\n * Determines the number of days in the given month (or January if omitted).\n * If year is specified, it will include leap year logic, else it will always assume a leap year\n */\nfunction daysInMonth(month: number = 0, year?: number) {\n return new Date(year ?? 2000, month + 1, 0).getDate();\n}\n"]} \ No newline at end of file +{"version":3,"file":"scheduleNotificationAsync.js","sourceRoot":"","sources":["../src/scheduleNotificationAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE1E,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAe5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,yBAAyB,CACrD,OAAiC;IAEjC,IAAI,CAAC,qBAAqB,CAAC,yBAAyB,EAAE;QACpD,MAAM,IAAI,m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CAAC,IAAI,OAAO,GAAG,CAAC,EAAE;oBAC9B,MAAM,IAAI,UAAU,CAClB,6DAA6D,OAAO,EAAE,CACvE,CAAC;iBACH;gBACD,MAAM;aACP;YACD,KAAK,MAAM,CAAC,CAAC;gBACX,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC;gBAChC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,EAAE,EAAE;oBACzB,MAAM,IAAI,UAAU,CAAC,2DAA2D,IAAI,EAAE,CAAC,CAAC;iBACzF;gBACD,MAAM;aACP;YACD,KAAK,QAAQ,CAAC,CAAC;gBACb,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,CAAC;gBAClC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,EAAE,EAAE;oBAC7B,MAAM,IAAI,UAAU,CAClB,6DAA6D,MAAM,EAAE,CACtE,CAAC;iBACH;gBACD,MAAM;aACP;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,QAAgB,CAAC,EAAE,IAAa;IACnD,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;AACxD,CAAC","sourcesContent":["import { Platform, UnavailabilityError, uuidv4 } from 'expo-modules-core';\n\nimport NotificationScheduler from './NotificationScheduler';\nimport { NotificationTriggerInput as NativeNotificationTriggerInput } from './NotificationScheduler.types';\nimport {\n NotificationRequestInput,\n NotificationTriggerInput,\n DailyTriggerInput,\n WeeklyTriggerInput,\n YearlyTriggerInput,\n CalendarTriggerInput,\n TimeIntervalTriggerInput,\n DateTriggerInput,\n ChannelAwareTriggerInput,\n SchedulableNotificationTriggerInput,\n} from './Notifications.types';\n\n/**\n * Schedules a notification to be triggered in the future.\n * > **Note:** Please note that this does not mean that the notification will be presented when it is triggered.\n * For the notification to be presented you have to set a notification handler with [`setNotificationHandler`](#notificationssetnotificationhandlerhandler)\n * that will return an appropriate notification behavior. For more information see the example below.\n * @param request An object describing the notification to be triggered.\n * @return Returns a Promise resolving to a string which is a notification identifier you can later use to cancel the notification or to identify an incoming notification.\n * @example\n * # Schedule the notification that will trigger once, in one minute from now\n * ```ts\n * import * as Notifications from 'expo-notifications';\n *\n * Notifications.scheduleNotificationAsync({\n * content: {\n * title: \"Time's up!\",\n * body: 'Change sides!',\n * },\n * trigger: {\n * seconds: 60,\n * },\n * });\n * ```\n *\n * # Schedule the notification that will trigger repeatedly, every 20 minutes\n * ```ts\n * import * as Notifications from 'expo-notifications';\n *\n * Notifications.scheduleNotificationAsync({\n * content: {\n * title: 'Remember to drink water!',\n * },\n * trigger: {\n * seconds: 60 * 20,\n * repeats: true,\n * },\n * });\n * ```\n *\n * # Schedule the notification that will trigger once, at the beginning of next hour\n * ```ts\n * import * as Notifications from 'expo-notifications';\n *\n * const trigger = new Date(Date.now() + 60 * 60 * 1000);\n * trigger.setMinutes(0);\n * trigger.setSeconds(0);\n *\n * Notifications.scheduleNotificationAsync({\n * content: {\n * title: 'Happy new hour!',\n * },\n * trigger,\n * });\n * ```\n * @header schedule\n */\nexport default async function scheduleNotificationAsync(\n request: NotificationRequestInput\n): Promise {\n if (!NotificationScheduler.scheduleNotificationAsync) {\n throw new UnavailabilityError('Notifications', 'scheduleNotificationAsync');\n }\n\n return await NotificationScheduler.scheduleNotificationAsync(\n request.identifier ?? uuidv4(),\n request.content,\n parseTrigger(request.trigger)\n );\n}\n\ntype ValidTriggerDateComponents = 'month' | 'day' | 'weekday' | 'hour' | 'minute';\n\nconst DAILY_TRIGGER_EXPECTED_DATE_COMPONENTS: readonly ValidTriggerDateComponents[] = [\n 'hour',\n 'minute',\n];\nconst WEEKLY_TRIGGER_EXPECTED_DATE_COMPONENTS: readonly ValidTriggerDateComponents[] = [\n 'weekday',\n 'hour',\n 'minute',\n];\nconst YEARLY_TRIGGER_EXPECTED_DATE_COMPONENTS: readonly ValidTriggerDateComponents[] = [\n 'day',\n 'month',\n 'hour',\n 'minute',\n];\n\nexport function parseTrigger(\n userFacingTrigger: NotificationTriggerInput\n): NativeNotificationTriggerInput {\n if (userFacingTrigger === null) {\n return null;\n }\n\n if (userFacingTrigger === undefined) {\n throw new TypeError(\n 'Encountered an `undefined` notification trigger. If you want to trigger the notification immediately, pass in an explicit `null` value.'\n );\n }\n\n if (isDateTrigger(userFacingTrigger)) {\n return parseDateTrigger(userFacingTrigger);\n } else if (isDailyTriggerInput(userFacingTrigger)) {\n validateDateComponentsInTrigger(userFacingTrigger, DAILY_TRIGGER_EXPECTED_DATE_COMPONENTS);\n return {\n type: 'daily',\n channelId: userFacingTrigger.channelId,\n hour: userFacingTrigger.hour,\n minute: userFacingTrigger.minute,\n };\n } else if (isWeeklyTriggerInput(userFacingTrigger)) {\n validateDateComponentsInTrigger(userFacingTrigger, WEEKLY_TRIGGER_EXPECTED_DATE_COMPONENTS);\n return {\n type: 'weekly',\n channelId: userFacingTrigger.channelId,\n weekday: userFacingTrigger.weekday,\n hour: userFacingTrigger.hour,\n minute: userFacingTrigger.minute,\n };\n } else if (isYearlyTriggerInput(userFacingTrigger)) {\n validateDateComponentsInTrigger(userFacingTrigger, YEARLY_TRIGGER_EXPECTED_DATE_COMPONENTS);\n return {\n type: 'yearly',\n channelId: userFacingTrigger.channelId,\n day: userFacingTrigger.day,\n month: userFacingTrigger.month,\n hour: userFacingTrigger.hour,\n minute: userFacingTrigger.minute,\n };\n } else if (isSecondsPropertyMisusedInCalendarTriggerInput(userFacingTrigger)) {\n throw new TypeError(\n 'Could not have inferred the notification trigger type: if you want to use a time interval trigger, pass in only `seconds` with or without `repeats` property; if you want to use calendar-based trigger, pass in `second`.'\n );\n } else if ('seconds' in userFacingTrigger) {\n return {\n type: 'timeInterval',\n channelId: userFacingTrigger.channelId,\n seconds: userFacingTrigger.seconds,\n repeats: userFacingTrigger.repeats ?? false,\n };\n } else if (isCalendarTrigger(userFacingTrigger)) {\n const { repeats, ...calendarTrigger } = userFacingTrigger;\n return { type: 'calendar', value: calendarTrigger, repeats };\n } else {\n return Platform.select({\n default: null, // There's no notion of channels on platforms other than Android.\n android: { type: 'channel', channelId: userFacingTrigger.channelId },\n });\n }\n}\n\nfunction isCalendarTrigger(\n trigger: CalendarTriggerInput | ChannelAwareTriggerInput\n): trigger is CalendarTriggerInput {\n const { channelId, ...triggerWithoutChannelId } = trigger;\n return Object.keys(triggerWithoutChannelId).length > 0;\n}\n\nfunction isDateTrigger(\n trigger:\n | DateTriggerInput\n | WeeklyTriggerInput\n | DailyTriggerInput\n | CalendarTriggerInput\n | TimeIntervalTriggerInput\n): trigger is DateTriggerInput {\n return (\n trigger instanceof Date ||\n typeof trigger === 'number' ||\n (typeof trigger === 'object' && 'date' in trigger)\n );\n}\n\nfunction parseDateTrigger(trigger: DateTriggerInput): NativeNotificationTriggerInput {\n if (trigger instanceof Date || typeof trigger === 'number') {\n return { type: 'date', timestamp: toTimestamp(trigger) };\n }\n return { type: 'date', timestamp: toTimestamp(trigger.date), channelId: trigger.channelId };\n}\n\nfunction toTimestamp(date: number | Date) {\n if (date instanceof Date) {\n return date.getTime();\n }\n return date;\n}\n\nfunction isDailyTriggerInput(\n trigger: SchedulableNotificationTriggerInput\n): trigger is DailyTriggerInput {\n if (typeof trigger !== 'object') return false;\n const { channelId, ...triggerWithoutChannelId } = trigger as DailyTriggerInput;\n return (\n Object.keys(triggerWithoutChannelId).length ===\n DAILY_TRIGGER_EXPECTED_DATE_COMPONENTS.length + 1 &&\n DAILY_TRIGGER_EXPECTED_DATE_COMPONENTS.every(\n (component) => component in triggerWithoutChannelId\n ) &&\n 'repeats' in triggerWithoutChannelId &&\n triggerWithoutChannelId.repeats === true\n );\n}\n\nfunction isWeeklyTriggerInput(\n trigger: SchedulableNotificationTriggerInput\n): trigger is WeeklyTriggerInput {\n if (typeof trigger !== 'object') return false;\n const { channelId, ...triggerWithoutChannelId } = trigger as WeeklyTriggerInput;\n return (\n Object.keys(triggerWithoutChannelId).length ===\n WEEKLY_TRIGGER_EXPECTED_DATE_COMPONENTS.length + 1 &&\n WEEKLY_TRIGGER_EXPECTED_DATE_COMPONENTS.every(\n (component) => component in triggerWithoutChannelId\n ) &&\n 'repeats' in triggerWithoutChannelId &&\n triggerWithoutChannelId.repeats === true\n );\n}\n\nfunction isYearlyTriggerInput(\n trigger: SchedulableNotificationTriggerInput\n): trigger is YearlyTriggerInput {\n if (typeof trigger !== 'object') return false;\n const { channelId, ...triggerWithoutChannelId } = trigger as YearlyTriggerInput;\n return (\n Object.keys(triggerWithoutChannelId).length ===\n YEARLY_TRIGGER_EXPECTED_DATE_COMPONENTS.length + 1 &&\n YEARLY_TRIGGER_EXPECTED_DATE_COMPONENTS.every(\n (component) => component in triggerWithoutChannelId\n ) &&\n 'repeats' in triggerWithoutChannelId &&\n triggerWithoutChannelId.repeats === true\n );\n}\n\nfunction isSecondsPropertyMisusedInCalendarTriggerInput(\n trigger: TimeIntervalTriggerInput | CalendarTriggerInput\n) {\n const { channelId, ...triggerWithoutChannelId } = trigger;\n return (\n // eg. { seconds: ..., repeats: ..., hour: ... }\n ('seconds' in triggerWithoutChannelId &&\n 'repeats' in triggerWithoutChannelId &&\n Object.keys(triggerWithoutChannelId).length > 2) ||\n // eg. { seconds: ..., hour: ... }\n ('seconds' in triggerWithoutChannelId &&\n !('repeats' in triggerWithoutChannelId) &&\n Object.keys(triggerWithoutChannelId).length > 1)\n );\n}\n\nfunction validateDateComponentsInTrigger(\n trigger: NonNullable,\n components: readonly ValidTriggerDateComponents[]\n) {\n const anyTriggerType = trigger as any;\n components.forEach((component) => {\n if (!(component in anyTriggerType)) {\n throw new TypeError(`The ${component} parameter needs to be present`);\n }\n if (typeof anyTriggerType[component] !== 'number') {\n throw new TypeError(`The ${component} parameter should be a number`);\n }\n switch (component) {\n case 'month': {\n const { month } = anyTriggerType;\n if (month < 0 || month > 11) {\n throw new RangeError(`The month parameter needs to be between 0 and 11. Found: ${month}`);\n }\n break;\n }\n case 'day': {\n const { day, month } = anyTriggerType;\n const daysInGivenMonth = daysInMonth(month);\n if (day < 1 || day > daysInGivenMonth) {\n throw new RangeError(\n `The day parameter for month ${month} must be between 1 and ${daysInGivenMonth}. Found: ${day}`\n );\n }\n break;\n }\n case 'weekday': {\n const { weekday } = anyTriggerType;\n if (weekday < 1 || weekday > 7) {\n throw new RangeError(\n `The weekday parameter needs to be between 1 and 7. Found: ${weekday}`\n );\n }\n break;\n }\n case 'hour': {\n const { hour } = anyTriggerType;\n if (hour < 0 || hour > 23) {\n throw new RangeError(`The hour parameter needs to be between 0 and 23. Found: ${hour}`);\n }\n break;\n }\n case 'minute': {\n const { minute } = anyTriggerType;\n if (minute < 0 || minute > 59) {\n throw new RangeError(\n `The minute parameter needs to be between 0 and 59. Found: ${minute}`\n );\n }\n break;\n }\n }\n });\n}\n\n/**\n * Determines the number of days in the given month (or January if omitted).\n * If year is specified, it will include leap year logic, else it will always assume a leap year\n */\nfunction daysInMonth(month: number = 0, year?: number) {\n return new Date(year ?? 2000, month + 1, 0).getDate();\n}\n"]} \ No newline at end of file diff --git a/packages/expo-notifications/src/ServerRegistrationModule.web.ts b/packages/expo-notifications/src/ServerRegistrationModule.web.ts index 63b5a7e46f1a21..55a3f789e3c230 100644 --- a/packages/expo-notifications/src/ServerRegistrationModule.web.ts +++ b/packages/expo-notifications/src/ServerRegistrationModule.web.ts @@ -1,5 +1,4 @@ -import { CodedError } from 'expo-modules-core'; -import { v4 as uuidv4 } from 'uuid'; +import { CodedError, uuidv4 } from 'expo-modules-core'; import { ServerRegistrationModule } from './ServerRegistrationModule.types'; diff --git a/packages/expo-notifications/src/presentNotificationAsync.ts b/packages/expo-notifications/src/presentNotificationAsync.ts index 6d7fb1bd5af1f3..cac92f2942dd4d 100644 --- a/packages/expo-notifications/src/presentNotificationAsync.ts +++ b/packages/expo-notifications/src/presentNotificationAsync.ts @@ -1,5 +1,4 @@ -import { UnavailabilityError } from 'expo-modules-core'; -import { v4 as uuidv4 } from 'uuid'; +import { UnavailabilityError, uuidv4 } from 'expo-modules-core'; import NotificationPresenter from './NotificationPresenterModule'; import { NotificationContentInput } from './Notifications.types'; diff --git a/packages/expo-notifications/src/scheduleNotificationAsync.ts b/packages/expo-notifications/src/scheduleNotificationAsync.ts index 4297cfcea1a30b..f55d6037f20bc3 100644 --- a/packages/expo-notifications/src/scheduleNotificationAsync.ts +++ b/packages/expo-notifications/src/scheduleNotificationAsync.ts @@ -1,5 +1,4 @@ -import { Platform, UnavailabilityError } from 'expo-modules-core'; -import { v4 as uuidv4 } from 'uuid'; +import { Platform, UnavailabilityError, uuidv4 } from 'expo-modules-core'; import NotificationScheduler from './NotificationScheduler'; import { NotificationTriggerInput as NativeNotificationTriggerInput } from './NotificationScheduler.types'; diff --git a/packages/expo/CHANGELOG.md b/packages/expo/CHANGELOG.md index 456f95356a2d55..7c0f6b92283853 100644 --- a/packages/expo/CHANGELOG.md +++ b/packages/expo/CHANGELOG.md @@ -10,6 +10,8 @@ ### 💡 Others +- Fork `uuid@3.4.0` and move into `expo-modules-core`. Remove the original dependency. ([#23249](https://github.com/expo/expo/pull/23249) by [@alanhughes](https://github.com/alanjhughes)) + ## 49.0.0-beta.4 - 2023-07-02 ### 🐛 Bug fixes diff --git a/packages/expo/build/environment/getInstallationIdAsync.d.ts.map b/packages/expo/build/environment/getInstallationIdAsync.d.ts.map index ba60c5f5ad5c6f..02d6cff7ef9e3b 100644 --- a/packages/expo/build/environment/getInstallationIdAsync.d.ts.map +++ b/packages/expo/build/environment/getInstallationIdAsync.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"getInstallationIdAsync.d.ts","sourceRoot":"","sources":["../../src/environment/getInstallationIdAsync.ts"],"names":[],"mappings":"AAMA,wBAA8B,sBAAsB,oBAmBnD"} \ No newline at end of file +{"version":3,"file":"getInstallationIdAsync.d.ts","sourceRoot":"","sources":["../../src/environment/getInstallationIdAsync.ts"],"names":[],"mappings":"AAMA,wBAA8B,sBAAsB,oBAoBnD"} \ No newline at end of file diff --git a/packages/expo/build/environment/getInstallationIdAsync.js b/packages/expo/build/environment/getInstallationIdAsync.js index 75366e465ed2d0..881dcfe8f047fa 100644 --- a/packages/expo/build/environment/getInstallationIdAsync.js +++ b/packages/expo/build/environment/getInstallationIdAsync.js @@ -1,7 +1,7 @@ import * as Application from 'expo-application'; -import uuidv5 from 'uuid/v5'; +import { uuidv5 } from 'expo-modules-core'; let installationId; -const UUID_NAMESPACE = '29cc8a0d-747c-5f85-9ff9-f2f16636d963'; // uuidv5(0, "expo") +const UUID_NAMESPACE = '29cc8a0d-747c-5f85-9ff9-f2f16636d963'; export default async function getInstallationIdAsync() { if (installationId) { return installationId; diff --git a/packages/expo/build/environment/getInstallationIdAsync.js.map b/packages/expo/build/environment/getInstallationIdAsync.js.map index 21cecc0df05a59..e0a2d484f73391 100644 --- a/packages/expo/build/environment/getInstallationIdAsync.js.map +++ b/packages/expo/build/environment/getInstallationIdAsync.js.map @@ -1 +1 @@ -{"version":3,"file":"getInstallationIdAsync.js","sourceRoot":"","sources":["../../src/environment/getInstallationIdAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,MAAM,MAAM,SAAS,CAAC;AAE7B,IAAI,cAA6B,CAAC;AAClC,MAAM,cAAc,GAAG,sCAAsC,CAAC,CAAC,oBAAoB;AAEnF,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,sBAAsB;IAClD,IAAI,cAAc,EAAE;QAClB,OAAO,cAAc,CAAC;KACvB;IAED,MAAM,mBAAmB,GAAG,MAAM,WAAW,CAAC,sBAAsB,EAAE,CAAC;IACvE,MAAM,gBAAgB,GAAG,WAAW,CAAC,aAAc,CAAC;IAEpD,yEAAyE;IACzE,yEAAyE;IACzE,QAAQ;IACR,IAAI,mBAAmB,EAAE;QACvB,cAAc,GAAG,MAAM,CAAC,GAAG,gBAAgB,IAAI,mBAAmB,EAAE,EAAE,cAAc,CAAC,CAAC;KACvF;SAAM;QACL,MAAM,gBAAgB,GAAG,MAAM,WAAW,CAAC,wBAAwB,EAAE,CAAC;QACtE,cAAc,GAAG,MAAM,CAAC,GAAG,gBAAgB,IAAI,gBAAgB,CAAC,OAAO,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;KAC9F;IAED,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import * as Application from 'expo-application';\nimport uuidv5 from 'uuid/v5';\n\nlet installationId: string | null;\nconst UUID_NAMESPACE = '29cc8a0d-747c-5f85-9ff9-f2f16636d963'; // uuidv5(0, \"expo\")\n\nexport default async function getInstallationIdAsync() {\n if (installationId) {\n return installationId;\n }\n\n const identifierForVendor = await Application.getIosIdForVendorAsync();\n const bundleIdentifier = Application.applicationId!;\n\n // It's unlikely identifierForVendor will be null (it returns null if the\n // device has been restarted but not yet unlocked), but let's handle this\n // case.\n if (identifierForVendor) {\n installationId = uuidv5(`${bundleIdentifier}-${identifierForVendor}`, UUID_NAMESPACE);\n } else {\n const installationTime = await Application.getInstallationTimeAsync();\n installationId = uuidv5(`${bundleIdentifier}-${installationTime.getTime()}`, UUID_NAMESPACE);\n }\n\n return installationId;\n}\n"]} \ No newline at end of file +{"version":3,"file":"getInstallationIdAsync.js","sourceRoot":"","sources":["../../src/environment/getInstallationIdAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,IAAI,cAA6B,CAAC;AAClC,MAAM,cAAc,GAAG,sCAAsC,CAAC;AAE9D,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,sBAAsB;IAClD,IAAI,cAAc,EAAE;QAClB,OAAO,cAAc,CAAC;KACvB;IAED,MAAM,mBAAmB,GAAG,MAAM,WAAW,CAAC,sBAAsB,EAAE,CAAC;IACvE,MAAM,gBAAgB,GAAG,WAAW,CAAC,aAAc,CAAC;IAEpD,yEAAyE;IACzE,yEAAyE;IACzE,QAAQ;IAER,IAAI,mBAAmB,EAAE;QACvB,cAAc,GAAG,MAAM,CAAC,GAAG,gBAAgB,IAAI,mBAAmB,EAAE,EAAE,cAAc,CAAC,CAAC;KACvF;SAAM;QACL,MAAM,gBAAgB,GAAG,MAAM,WAAW,CAAC,wBAAwB,EAAE,CAAC;QACtE,cAAc,GAAG,MAAM,CAAC,GAAG,gBAAgB,IAAI,gBAAgB,CAAC,OAAO,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;KAC9F;IAED,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import * as Application from 'expo-application';\nimport { uuidv5 } from 'expo-modules-core';\n\nlet installationId: string | null;\nconst UUID_NAMESPACE = '29cc8a0d-747c-5f85-9ff9-f2f16636d963';\n\nexport default async function getInstallationIdAsync() {\n if (installationId) {\n return installationId;\n }\n\n const identifierForVendor = await Application.getIosIdForVendorAsync();\n const bundleIdentifier = Application.applicationId!;\n\n // It's unlikely identifierForVendor will be null (it returns null if the\n // device has been restarted but not yet unlocked), but let's handle this\n // case.\n\n if (identifierForVendor) {\n installationId = uuidv5(`${bundleIdentifier}-${identifierForVendor}`, UUID_NAMESPACE);\n } else {\n const installationTime = await Application.getInstallationTimeAsync();\n installationId = uuidv5(`${bundleIdentifier}-${installationTime.getTime()}`, UUID_NAMESPACE);\n }\n\n return installationId;\n}\n"]} \ No newline at end of file diff --git a/packages/expo/build/environment/getInstallationIdAsync.web.js b/packages/expo/build/environment/getInstallationIdAsync.web.js index 690de83ed639db..c08fd0c428c9ab 100644 --- a/packages/expo/build/environment/getInstallationIdAsync.web.js +++ b/packages/expo/build/environment/getInstallationIdAsync.web.js @@ -1,4 +1,4 @@ -import { v4 as uuidv4 } from 'uuid'; +import { uuidv4 } from 'expo-modules-core'; const INSTALLATION_ID_KEY = 'installationId'; let installationId = null; export default async function getInstallationIdAsync() { diff --git a/packages/expo/build/environment/getInstallationIdAsync.web.js.map b/packages/expo/build/environment/getInstallationIdAsync.web.js.map index c189bfd3f06587..a44a51b6aa47b0 100644 --- a/packages/expo/build/environment/getInstallationIdAsync.web.js.map +++ b/packages/expo/build/environment/getInstallationIdAsync.web.js.map @@ -1 +1 @@ -{"version":3,"file":"getInstallationIdAsync.web.js","sourceRoot":"","sources":["../../src/environment/getInstallationIdAsync.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAE7C,IAAI,cAAc,GAAkB,IAAI,CAAC;AAEzC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,sBAAsB;IAClD,uBAAuB;IACvB,IAAI,cAAc,EAAE;QAClB,OAAO,cAAc,CAAC;KACvB;IAED,IAAI;QACF,gDAAgD;QAChD,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAC3D,IAAI,cAAc,EAAE;YAClB,OAAO,cAAc,CAAC;SACvB;KACF;IAAC,MAAM;QACN,wDAAwD;QACxD,0BAA0B;KAC3B;IAED,8CAA8C;IAC9C,cAAc,GAAG,MAAM,EAAE,CAAC;IAC1B,+CAA+C;IAC/C,IAAI;QACF,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;KAC3D;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,yEAAyE,EAAE,KAAK,CAAC,CAAC;KACjG;IAED,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import { v4 as uuidv4 } from 'uuid';\n\nconst INSTALLATION_ID_KEY = 'installationId';\n\nlet installationId: string | null = null;\n\nexport default async function getInstallationIdAsync() {\n // Already cached value\n if (installationId) {\n return installationId;\n }\n\n try {\n // No cached value, fetch from persisted storage\n installationId = localStorage.getItem(INSTALLATION_ID_KEY);\n if (installationId) {\n return installationId;\n }\n } catch {\n // If we weren't able to fetch one (for whatever reason)\n // let's create a new one.\n }\n\n // No persisted value, set the cached value...\n installationId = uuidv4();\n // ...and try to persist it. Ignore the errors.\n try {\n localStorage.setItem(INSTALLATION_ID_KEY, installationId);\n } catch (error) {\n console.debug('Could not save installation ID in persisted storage, it will get reset.', error);\n }\n\n return installationId;\n}\n"]} \ No newline at end of file +{"version":3,"file":"getInstallationIdAsync.web.js","sourceRoot":"","sources":["../../src/environment/getInstallationIdAsync.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAE7C,IAAI,cAAc,GAAkB,IAAI,CAAC;AAEzC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,sBAAsB;IAClD,uBAAuB;IACvB,IAAI,cAAc,EAAE;QAClB,OAAO,cAAc,CAAC;KACvB;IAED,IAAI;QACF,gDAAgD;QAChD,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAC3D,IAAI,cAAc,EAAE;YAClB,OAAO,cAAc,CAAC;SACvB;KACF;IAAC,MAAM;QACN,wDAAwD;QACxD,0BAA0B;KAC3B;IAED,8CAA8C;IAC9C,cAAc,GAAG,MAAM,EAAY,CAAC;IACpC,+CAA+C;IAC/C,IAAI;QACF,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;KAC3D;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,yEAAyE,EAAE,KAAK,CAAC,CAAC;KACjG;IAED,OAAO,cAAc,CAAC;AACxB,CAAC","sourcesContent":["import { uuidv4 } from 'expo-modules-core';\n\nconst INSTALLATION_ID_KEY = 'installationId';\n\nlet installationId: string | null = null;\n\nexport default async function getInstallationIdAsync() {\n // Already cached value\n if (installationId) {\n return installationId;\n }\n\n try {\n // No cached value, fetch from persisted storage\n installationId = localStorage.getItem(INSTALLATION_ID_KEY);\n if (installationId) {\n return installationId;\n }\n } catch {\n // If we weren't able to fetch one (for whatever reason)\n // let's create a new one.\n }\n\n // No persisted value, set the cached value...\n installationId = uuidv4() as string;\n // ...and try to persist it. Ignore the errors.\n try {\n localStorage.setItem(INSTALLATION_ID_KEY, installationId);\n } catch (error) {\n console.debug('Could not save installation ID in persisted storage, it will get reset.', error);\n }\n\n return installationId;\n}\n"]} \ No newline at end of file diff --git a/packages/expo/build/logs/RemoteLogging.d.ts.map b/packages/expo/build/logs/RemoteLogging.d.ts.map index 7c07701a946f75..4ba331ff2c8487 100644 --- a/packages/expo/build/logs/RemoteLogging.d.ts.map +++ b/packages/expo/build/logs/RemoteLogging.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"RemoteLogging.d.ts","sourceRoot":"","sources":["../../src/logs/RemoteLogging.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAO5D,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAU3D,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC;AAC5C,MAAM,MAAM,YAAY,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,KAAK,sBAAsB,GAAG,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAE,KAAK,IAAI,CAAC;AAWrF,iBAAe,qBAAqB,CAClC,KAAK,EAAE,QAAQ,EACf,gBAAgB,EAAE,cAAc,EAChC,IAAI,EAAE,OAAO,EAAE,GACd,OAAO,CAAC,IAAI,CAAC,CAgCf;AAiED,iBAAS,yBAAyB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,iBAAiB,CAEtF;;;;;AAQD,wBAGE;AAEF;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAqB3D"} \ No newline at end of file +{"version":3,"file":"RemoteLogging.d.ts","sourceRoot":"","sources":["../../src/logs/RemoteLogging.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAM5D,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAU3D,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC;AAC5C,MAAM,MAAM,YAAY,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,KAAK,sBAAsB,GAAG,CAAC,KAAK,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAE,KAAK,IAAI,CAAC;AAWrF,iBAAe,qBAAqB,CAClC,KAAK,EAAE,QAAQ,EACf,gBAAgB,EAAE,cAAc,EAChC,IAAI,EAAE,OAAO,EAAE,GACd,OAAO,CAAC,IAAI,CAAC,CAgCf;AAiED,iBAAS,yBAAyB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,iBAAiB,CAEtF;;;;;AAQD,wBAGE;AAEF;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAqB3D"} \ No newline at end of file diff --git a/packages/expo/build/logs/RemoteLogging.js b/packages/expo/build/logs/RemoteLogging.js index c3ff6569f97879..0c66e1cf5c0f66 100644 --- a/packages/expo/build/logs/RemoteLogging.js +++ b/packages/expo/build/logs/RemoteLogging.js @@ -1,8 +1,7 @@ import Constants from 'expo-constants'; -import { Platform } from 'expo-modules-core'; +import { Platform, uuidv4 } from 'expo-modules-core'; import { EventEmitter } from 'fbemitter'; import invariant from 'invariant'; -import { v4 as uuidv4 } from 'uuid'; import getInstallationIdAsync from '../environment/getInstallationIdAsync'; import LogSerialization from './LogSerialization'; const _sessionId = uuidv4(); diff --git a/packages/expo/build/logs/RemoteLogging.js.map b/packages/expo/build/logs/RemoteLogging.js.map index b2dab93b49b428..4a2f25457e2a05 100644 --- a/packages/expo/build/logs/RemoteLogging.js.map +++ b/packages/expo/build/logs/RemoteLogging.js.map @@ -1 +1 @@ -{"version":3,"file":"RemoteLogging.js","sourceRoot":"","sources":["../../src/logs/RemoteLogging.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAqB,MAAM,WAAW,CAAC;AAC5D,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAuBlD,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC;AAC5B,MAAM,SAAS,GAAe,EAAE,CAAC;AACjC,MAAM,sBAAsB,GAAG,IAAI,YAAY,EAAE,CAAC;AAElD,IAAI,WAAW,GAAG,CAAC,CAAC;AACpB,IAAI,cAAc,GAAG,KAAK,CAAC;AAC3B,IAAI,kBAAkB,GAAyB,IAAI,CAAC;AACpD,IAAI,kBAAkB,GAAwB,IAAI,CAAC;AAEnD,KAAK,UAAU,qBAAqB,CAClC,KAAe,EACf,gBAAgC,EAChC,IAAe;IAEf,IAAI,qBAAqB,CAAC,IAAI,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AC,IAAI,CAAC,OAAO,EAAE;YACnC,KAAK,EAAE,IAAI,KAAK,CAAC,iDAAiD,CAAC;YACnE,QAAQ;SACT,CAAC,CAAC;KACJ;AACH,CAAC;AAED,SAAS,yBAAyB,CAAC,QAAgC;IACjE,OAAO,sBAAsB,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAe;IAC5C,wDAAwD;IACxD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC7F,CAAC;AAED,eAAe;IACb,qBAAqB;IACrB,yBAAyB;CAC1B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,2BAA2B;IACzC,IAAI,kBAAkB,EAAE;QACtB,OAAO,kBAAkB,CAAC;KAC3B;IAED,IAAI,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;QACxC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;KAC1B;IAED,kBAAkB,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3C,kBAAkB,GAAG,GAAG,EAAE;YACxB,SAAS,CAAC,CAAC,cAAc,EAAE,wCAAwC,CAAC,CAAC;YACrE,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,uCAAuC,CAAC,CAAC;YAEtE,kBAAkB,GAAG,IAAI,CAAC;YAC1B,kBAAkB,GAAG,IAAI,CAAC;YAE1B,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,kBAAkB,CAAC;AAC5B,CAAC","sourcesContent":["import Constants from 'expo-constants';\nimport { Platform } from 'expo-modules-core';\nimport { EventEmitter, EventSubscription } from 'fbemitter';\nimport invariant from 'invariant';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport getInstallationIdAsync from '../environment/getInstallationIdAsync';\nimport LogSerialization from './LogSerialization';\n\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error';\n\ntype LogEntry = {\n count: number;\n level: LogLevel;\n body: LogData[];\n includesStack: boolean;\n groupDepth?: number;\n} & LogEntryFields;\n\nexport type LogEntryFields = {\n shouldHide?: boolean;\n groupDepth?: number;\n groupCollapsed?: boolean;\n};\n\nexport type LogData = string | LogErrorData;\nexport type LogErrorData = { message: string; stack: string };\n\ntype TransportErrorListener = (event: { error: Error; response?: Response }) => void;\n\nconst _sessionId = uuidv4();\nconst _logQueue: LogEntry[] = [];\nconst _transportEventEmitter = new EventEmitter();\n\nlet _logCounter = 0;\nlet _isSendingLogs = false;\nlet _completionPromise: Promise | null = null;\nlet _resolveCompletion: (() => void) | null = null;\n\nasync function enqueueRemoteLogAsync(\n level: LogLevel,\n additionalFields: LogEntryFields,\n data: unknown[]\n): Promise {\n if (_isReactNativeWarning(data)) {\n // Remove the stack trace from the warning message since we'll capture our own\n if (data.length === 0) {\n throw new Error(`Warnings must include log arguments`);\n }\n const warning = data[0];\n if (typeof warning !== 'string') {\n throw new TypeError(`The log argument for a warning must be a string`);\n }\n const lines = warning.split('\\n');\n if (lines.length > 1 && /^\\s+in /.test(lines[1])) {\n data[0] = lines[0];\n }\n }\n\n const { body, includesStack } = await LogSerialization.serializeLogDataAsync(data, level);\n\n _logQueue.push({\n count: _logCounter++,\n level,\n body,\n includesStack,\n ...additionalFields,\n });\n\n // Send the logs asynchronously (system errors are emitted with transport error events) and throw an uncaught error\n _sendRemoteLogsAsync().catch((error) => {\n setImmediate(() => {\n throw error;\n });\n });\n}\n\nasync function _sendRemoteLogsAsync(): Promise {\n if (_isSendingLogs || !_logQueue.length) {\n return;\n }\n\n // Our current transport policy is to send all of the pending log messages in one batch. If we opt\n // for another policy (ex: throttling) this is where to to implement it.\n const batch = _logQueue.splice(0);\n\n const logUrl = Constants.expoGoConfig?.logUrl;\n if (typeof logUrl !== 'string') {\n throw new Error('The Expo project manifest must specify `logUrl`');\n }\n\n _isSendingLogs = true;\n try {\n await _sendNextLogBatchAsync(batch, logUrl);\n } finally {\n _isSendingLogs = false;\n }\n\n if (_logQueue.length) {\n return _sendRemoteLogsAsync();\n } else if (_resolveCompletion) {\n _resolveCompletion();\n }\n}\n\nasync function _sendNextLogBatchAsync(batch: LogEntry[], logUrl: string): Promise {\n let response;\n\n const headers = {\n 'Content-Type': 'application/json',\n Connection: 'keep-alive',\n 'Proxy-Connection': 'keep-alive',\n Accept: 'application/json',\n 'Device-Id': await getInstallationIdAsync(),\n 'Session-Id': _sessionId,\n 'Expo-Platform': Platform.OS,\n };\n if (Constants.deviceName) {\n headers['Device-Name'] = Constants.deviceName;\n }\n try {\n response = await fetch(logUrl, {\n method: 'POST',\n headers,\n body: JSON.stringify(batch),\n });\n } catch (error) {\n _transportEventEmitter.emit('error', { error });\n return;\n }\n\n const success = response.status >= 200 && response.status < 300;\n if (!success) {\n _transportEventEmitter.emit('error', {\n error: new Error(`An HTTP error occurred when sending remote logs`),\n response,\n });\n }\n}\n\nfunction addTransportErrorListener(listener: TransportErrorListener): EventSubscription {\n return _transportEventEmitter.addListener('error', listener);\n}\n\nfunction _isReactNativeWarning(data: unknown[]): boolean {\n // NOTE: RN does the same thing internally for YellowBox\n const message = data[0];\n return data.length === 1 && typeof message === 'string' && message.startsWith('Warning: ');\n}\n\nexport default {\n enqueueRemoteLogAsync,\n addTransportErrorListener,\n};\n\n/**\n * Returns a promise that resolves when all entries in the log queue have been sent. This method is\n * intended for testing only.\n */\nexport function __waitForEmptyLogQueueAsync(): Promise {\n if (_completionPromise) {\n return _completionPromise;\n }\n\n if (!_isSendingLogs && !_logQueue.length) {\n return Promise.resolve();\n }\n\n _completionPromise = new Promise((resolve) => {\n _resolveCompletion = () => {\n invariant(!_isSendingLogs, `Must not be sending logs at completion`);\n invariant(!_logQueue.length, `Log queue must be empty at completion`);\n\n _completionPromise = null;\n _resolveCompletion = null;\n\n resolve();\n };\n });\n return _completionPromise;\n}\n"]} \ No newline at end of file +{"version":3,"file":"RemoteLogging.js","sourceRoot":"","sources":["../../src/logs/RemoteLogging.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAqB,MAAM,WAAW,CAAC;AAC5D,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAuBlD,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC;AAC5B,MAAM,SAAS,GAAe,EAAE,CAAC;AACjC,MAAM,sBAAsB,GAAG,IAAI,YAAY,EAAE,CAAC;AAElD,IAAI,WAAW,GAAG,CAAC,CAAC;AACpB,IAAI,cAAc,GAAG,KAAK,CAAC;AAC3B,IAAI,kBAAkB,GAAyB,IAAI,CAAC;AACpD,IAAI,kBAAkB,GAAwB,IAAI,CAAC;AAEnD,KAAK,UAAU,qBAAqB,CAClC,KAAe,EACf,gBAAgC,EAChC,IAAe;IAEf,IAAI,qBAAqB,CAAC,IAAI,CAAC,EAAE;QAC/B,8EAA8E;QAC9E,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;SACxD;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,MAAM,IAAI,SAAS,CAAC,iDAAiD,CAAC,CAAC;SACxE;QACD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC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AO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC7F,CAAC;AAED,eAAe;IACb,qBAAqB;IACrB,yBAAyB;CAC1B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,2BAA2B;IACzC,IAAI,kBAAkB,EAAE;QACtB,OAAO,kBAAkB,CAAC;KAC3B;IAED,IAAI,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;QACxC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;KAC1B;IAED,kBAAkB,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3C,kBAAkB,GAAG,GAAG,EAAE;YACxB,SAAS,CAAC,CAAC,cAAc,EAAE,wCAAwC,CAAC,CAAC;YACrE,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,uCAAuC,CAAC,CAAC;YAEtE,kBAAkB,GAAG,IAAI,CAAC;YAC1B,kBAAkB,GAAG,IAAI,CAAC;YAE1B,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,kBAAkB,CAAC;AAC5B,CAAC","sourcesContent":["import Constants from 'expo-constants';\nimport { Platform, uuidv4 } from 'expo-modules-core';\nimport { EventEmitter, EventSubscription } from 'fbemitter';\nimport invariant from 'invariant';\n\nimport getInstallationIdAsync from '../environment/getInstallationIdAsync';\nimport LogSerialization from './LogSerialization';\n\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error';\n\ntype LogEntry = {\n count: number;\n level: LogLevel;\n body: LogData[];\n includesStack: boolean;\n groupDepth?: number;\n} & LogEntryFields;\n\nexport type LogEntryFields = {\n shouldHide?: boolean;\n groupDepth?: number;\n groupCollapsed?: boolean;\n};\n\nexport type LogData = string | LogErrorData;\nexport type LogErrorData = { message: string; stack: string };\n\ntype TransportErrorListener = (event: { error: Error; response?: Response }) => void;\n\nconst _sessionId = uuidv4();\nconst _logQueue: LogEntry[] = [];\nconst _transportEventEmitter = new EventEmitter();\n\nlet _logCounter = 0;\nlet _isSendingLogs = false;\nlet _completionPromise: Promise | null = null;\nlet _resolveCompletion: (() => void) | null = null;\n\nasync function enqueueRemoteLogAsync(\n level: LogLevel,\n additionalFields: LogEntryFields,\n data: unknown[]\n): Promise {\n if (_isReactNativeWarning(data)) {\n // Remove the stack trace from the warning message since we'll capture our own\n if (data.length === 0) {\n throw new Error(`Warnings must include log arguments`);\n }\n const warning = data[0];\n if (typeof warning !== 'string') {\n throw new TypeError(`The log argument for a warning must be a string`);\n }\n const lines = warning.split('\\n');\n if (lines.length > 1 && /^\\s+in /.test(lines[1])) {\n data[0] = lines[0];\n }\n }\n\n const { body, includesStack } = await LogSerialization.serializeLogDataAsync(data, level);\n\n _logQueue.push({\n count: _logCounter++,\n level,\n body,\n includesStack,\n ...additionalFields,\n });\n\n // Send the logs asynchronously (system errors are emitted with transport error events) and throw an uncaught error\n _sendRemoteLogsAsync().catch((error) => {\n setImmediate(() => {\n throw error;\n });\n });\n}\n\nasync function _sendRemoteLogsAsync(): Promise {\n if (_isSendingLogs || !_logQueue.length) {\n return;\n }\n\n // Our current transport policy is to send all of the pending log messages in one batch. If we opt\n // for another policy (ex: throttling) this is where to to implement it.\n const batch = _logQueue.splice(0);\n\n const logUrl = Constants.expoGoConfig?.logUrl;\n if (typeof logUrl !== 'string') {\n throw new Error('The Expo project manifest must specify `logUrl`');\n }\n\n _isSendingLogs = true;\n try {\n await _sendNextLogBatchAsync(batch, logUrl);\n } finally {\n _isSendingLogs = false;\n }\n\n if (_logQueue.length) {\n return _sendRemoteLogsAsync();\n } else if (_resolveCompletion) {\n _resolveCompletion();\n }\n}\n\nasync function _sendNextLogBatchAsync(batch: LogEntry[], logUrl: string): Promise {\n let response;\n\n const headers = {\n 'Content-Type': 'application/json',\n Connection: 'keep-alive',\n 'Proxy-Connection': 'keep-alive',\n Accept: 'application/json',\n 'Device-Id': await getInstallationIdAsync(),\n 'Session-Id': _sessionId,\n 'Expo-Platform': Platform.OS,\n };\n if (Constants.deviceName) {\n headers['Device-Name'] = Constants.deviceName;\n }\n try {\n response = await fetch(logUrl, {\n method: 'POST',\n headers,\n body: JSON.stringify(batch),\n });\n } catch (error) {\n _transportEventEmitter.emit('error', { error });\n return;\n }\n\n const success = response.status >= 200 && response.status < 300;\n if (!success) {\n _transportEventEmitter.emit('error', {\n error: new Error(`An HTTP error occurred when sending remote logs`),\n response,\n });\n }\n}\n\nfunction addTransportErrorListener(listener: TransportErrorListener): EventSubscription {\n return _transportEventEmitter.addListener('error', listener);\n}\n\nfunction _isReactNativeWarning(data: unknown[]): boolean {\n // NOTE: RN does the same thing internally for YellowBox\n const message = data[0];\n return data.length === 1 && typeof message === 'string' && message.startsWith('Warning: ');\n}\n\nexport default {\n enqueueRemoteLogAsync,\n addTransportErrorListener,\n};\n\n/**\n * Returns a promise that resolves when all entries in the log queue have been sent. This method is\n * intended for testing only.\n */\nexport function __waitForEmptyLogQueueAsync(): Promise {\n if (_completionPromise) {\n return _completionPromise;\n }\n\n if (!_isSendingLogs && !_logQueue.length) {\n return Promise.resolve();\n }\n\n _completionPromise = new Promise((resolve) => {\n _resolveCompletion = () => {\n invariant(!_isSendingLogs, `Must not be sending logs at completion`);\n invariant(!_logQueue.length, `Log queue must be empty at completion`);\n\n _completionPromise = null;\n _resolveCompletion = null;\n\n resolve();\n };\n });\n return _completionPromise;\n}\n"]} \ No newline at end of file diff --git a/packages/expo/package.json b/packages/expo/package.json index d7a0f0de764df9..41e819a9bd8988 100644 --- a/packages/expo/package.json +++ b/packages/expo/package.json @@ -59,9 +59,9 @@ "dependencies": { "@babel/runtime": "^7.20.0", "@expo/cli": "0.10.4", - "@expo/vector-icons": "^13.0.0", - "@expo/config-plugins": "7.2.2", "@expo/config": "8.1.1", + "@expo/config-plugins": "7.2.2", + "@expo/vector-icons": "^13.0.0", "babel-preset-expo": "~9.5.0", "expo-application": "~5.3.0", "expo-asset": "~8.10.1", @@ -75,15 +75,13 @@ "invariant": "^2.2.4", "md5-file": "^3.2.3", "node-fetch": "^2.6.7", - "pretty-format": "^26.5.2", - "uuid": "^3.4.0" + "pretty-format": "^26.5.2" }, "devDependencies": { "@types/fbemitter": "^2.0.32", "@types/invariant": "^2.2.33", "@types/react": "~18.0.14", "@types/react-test-renderer": "^18.0.0", - "@types/uuid": "^3.4.7", "expo-module-scripts": "^3.0.10", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/packages/expo/src/environment/getInstallationIdAsync.ts b/packages/expo/src/environment/getInstallationIdAsync.ts index 9d2d4a40919862..da027b679f11a6 100644 --- a/packages/expo/src/environment/getInstallationIdAsync.ts +++ b/packages/expo/src/environment/getInstallationIdAsync.ts @@ -1,8 +1,8 @@ import * as Application from 'expo-application'; -import uuidv5 from 'uuid/v5'; +import { uuidv5 } from 'expo-modules-core'; let installationId: string | null; -const UUID_NAMESPACE = '29cc8a0d-747c-5f85-9ff9-f2f16636d963'; // uuidv5(0, "expo") +const UUID_NAMESPACE = '29cc8a0d-747c-5f85-9ff9-f2f16636d963'; export default async function getInstallationIdAsync() { if (installationId) { @@ -15,6 +15,7 @@ export default async function getInstallationIdAsync() { // It's unlikely identifierForVendor will be null (it returns null if the // device has been restarted but not yet unlocked), but let's handle this // case. + if (identifierForVendor) { installationId = uuidv5(`${bundleIdentifier}-${identifierForVendor}`, UUID_NAMESPACE); } else { diff --git a/packages/expo/src/environment/getInstallationIdAsync.web.ts b/packages/expo/src/environment/getInstallationIdAsync.web.ts index 9bcb74ce58fa72..4b7622a519654c 100644 --- a/packages/expo/src/environment/getInstallationIdAsync.web.ts +++ b/packages/expo/src/environment/getInstallationIdAsync.web.ts @@ -1,4 +1,4 @@ -import { v4 as uuidv4 } from 'uuid'; +import { uuidv4 } from 'expo-modules-core'; const INSTALLATION_ID_KEY = 'installationId'; @@ -22,7 +22,7 @@ export default async function getInstallationIdAsync() { } // No persisted value, set the cached value... - installationId = uuidv4(); + installationId = uuidv4() as string; // ...and try to persist it. Ignore the errors. try { localStorage.setItem(INSTALLATION_ID_KEY, installationId); diff --git a/packages/expo/src/logs/RemoteLogging.ts b/packages/expo/src/logs/RemoteLogging.ts index 5d5f6134567459..3ca652bdae4da7 100644 --- a/packages/expo/src/logs/RemoteLogging.ts +++ b/packages/expo/src/logs/RemoteLogging.ts @@ -1,8 +1,7 @@ import Constants from 'expo-constants'; -import { Platform } from 'expo-modules-core'; +import { Platform, uuidv4 } from 'expo-modules-core'; import { EventEmitter, EventSubscription } from 'fbemitter'; import invariant from 'invariant'; -import { v4 as uuidv4 } from 'uuid'; import getInstallationIdAsync from '../environment/getInstallationIdAsync'; import LogSerialization from './LogSerialization'; diff --git a/packages/expo/src/logs/__tests__/RemoteLogging-test.native.ts b/packages/expo/src/logs/__tests__/RemoteLogging-test.native.ts index 9e6fa725e0dff3..20798c542c9cab 100644 --- a/packages/expo/src/logs/__tests__/RemoteLogging-test.native.ts +++ b/packages/expo/src/logs/__tests__/RemoteLogging-test.native.ts @@ -1,11 +1,11 @@ import LogSerialization from '../LogSerialization'; import RemoteLogging, { __waitForEmptyLogQueueAsync } from '../RemoteLogging'; -jest.mock('uuid', () => { - const originalModule = jest.requireActual('uuid'); +jest.mock('expo-modules-core', () => { + const originalModule = jest.requireActual('expo-modules-core'); return { ...originalModule, - v4: () => 'c0d50576-7ddc-4196-8b1d-01c2d1786631', + uuidv4: () => 'c0d50576-7ddc-4196-8b1d-01c2d1786631', }; }); diff --git a/tools/package.json b/tools/package.json index b3ec3261a9155b..3dd291c8d6acf3 100644 --- a/tools/package.json +++ b/tools/package.json @@ -73,6 +73,7 @@ "strip-ansi": "^6.0.0", "terminal-link": "^2.1.1", "typedoc": "^0.23.24", + "uuid": "^9.0.0", "xcode": "^3.0.1" }, "devDependencies": { @@ -91,6 +92,7 @@ "@types/node": "^16.18.11", "@types/node-fetch": "^2.6.2", "@types/semver": "^7.5.0", + "@types/uuid": "^9.0.2", "eslint": "^8.29.0", "eslint-config-universe": "^11.1.1", "eslint-plugin-lodash": "^7.4.0", diff --git a/tools/yarn.lock b/tools/yarn.lock index f8cee005d66ae0..9dad7f32d637a9 100644 --- a/tools/yarn.lock +++ b/tools/yarn.lock @@ -2344,6 +2344,11 @@ dependencies: source-map "^0.6.1" +"@types/uuid@^9.0.2": + version "9.0.2" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.2.tgz#ede1d1b1e451548d44919dc226253e32a6952c4b" + integrity sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ== + "@types/webpack-sources@*": version "1.4.0" resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-1.4.0.tgz#e58f1f05f87d39a5c64cf85705bdbdbb94d4d57e" @@ -12712,6 +12717,11 @@ uuid@^8.0.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31" integrity sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg== +uuid@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" + integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== + valid-url@~1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200"