@expo/cli 0.22.25 → 0.22.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bin/cli +91 -93
- package/build/bin/cli.map +1 -1
- package/build/metro-require/require.js +52 -53
- package/build/src/api/endpoint.js +2 -6
- package/build/src/api/endpoint.js.map +1 -1
- package/build/src/api/getExpoGoIntermediateCertificate.js +3 -5
- package/build/src/api/getExpoGoIntermediateCertificate.js.map +1 -1
- package/build/src/api/getExpoSchema.js +12 -16
- package/build/src/api/getExpoSchema.js.map +1 -1
- package/build/src/api/getNativeModuleVersions.js +4 -6
- package/build/src/api/getNativeModuleVersions.js.map +1 -1
- package/build/src/api/getProjectDevelopmentCertificate.js +3 -5
- package/build/src/api/getProjectDevelopmentCertificate.js.map +1 -1
- package/build/src/api/getVersions.js +5 -7
- package/build/src/api/getVersions.js.map +1 -1
- package/build/src/api/graphql/client.js +26 -32
- package/build/src/api/graphql/client.js.map +1 -1
- package/build/src/api/graphql/queries/AppQuery.js +4 -6
- package/build/src/api/graphql/queries/AppQuery.js.map +1 -1
- package/build/src/api/graphql/queries/UserQuery.js +3 -5
- package/build/src/api/graphql/queries/UserQuery.js.map +1 -1
- package/build/src/api/graphql/types/App.js +1 -3
- package/build/src/api/graphql/types/App.js.map +1 -1
- package/build/src/api/rest/cache/FileSystemResponseCache.js +8 -10
- package/build/src/api/rest/cache/FileSystemResponseCache.js.map +1 -1
- package/build/src/api/rest/cache/ResponseCache.js +12 -20
- package/build/src/api/rest/cache/ResponseCache.js.map +1 -1
- package/build/src/api/rest/cache/wrapFetchWithCache.js +11 -13
- package/build/src/api/rest/cache/wrapFetchWithCache.js.map +1 -1
- package/build/src/api/rest/client.js +35 -53
- package/build/src/api/rest/client.js.map +1 -1
- package/build/src/api/rest/client.types.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithBaseUrl.js +3 -5
- package/build/src/api/rest/wrapFetchWithBaseUrl.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithOffline.js +3 -5
- package/build/src/api/rest/wrapFetchWithOffline.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithProgress.js +7 -11
- package/build/src/api/rest/wrapFetchWithProgress.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithProxy.js +3 -5
- package/build/src/api/rest/wrapFetchWithProxy.js.map +1 -1
- package/build/src/api/rest/wrapFetchWithUserAgent.js +6 -8
- package/build/src/api/rest/wrapFetchWithUserAgent.js.map +1 -1
- package/build/src/api/settings.js +5 -7
- package/build/src/api/settings.js.map +1 -1
- package/build/src/api/updateDevelopmentSession.js +17 -23
- package/build/src/api/updateDevelopmentSession.js.map +1 -1
- package/build/src/api/user/UserSettings.js +21 -39
- package/build/src/api/user/UserSettings.js.map +1 -1
- package/build/src/api/user/actions.js +21 -27
- package/build/src/api/user/actions.js.map +1 -1
- package/build/src/api/user/expoSsoLauncher.js +26 -30
- package/build/src/api/user/expoSsoLauncher.js.map +1 -1
- package/build/src/api/user/otp.js +29 -35
- package/build/src/api/user/otp.js.map +1 -1
- package/build/src/api/user/user.js +30 -44
- package/build/src/api/user/user.js.map +1 -1
- package/build/src/config/configAsync.js +23 -29
- package/build/src/config/configAsync.js.map +1 -1
- package/build/src/config/index.js +21 -25
- package/build/src/config/index.js.map +1 -1
- package/build/src/customize/customizeAsync.js +6 -8
- package/build/src/customize/customizeAsync.js.map +1 -1
- package/build/src/customize/generate.js +16 -20
- package/build/src/customize/generate.js.map +1 -1
- package/build/src/customize/index.js +12 -14
- package/build/src/customize/index.js.map +1 -1
- package/build/src/customize/resolveOptions.js +2 -4
- package/build/src/customize/resolveOptions.js.map +1 -1
- package/build/src/customize/templates.js +54 -58
- package/build/src/customize/templates.js.map +1 -1
- package/build/src/customize/typescript.js +7 -11
- package/build/src/customize/typescript.js.map +1 -1
- package/build/src/export/createMetadataJson.js +9 -11
- package/build/src/export/createMetadataJson.js.map +1 -1
- package/build/src/export/embed/exportEager.js +6 -8
- package/build/src/export/embed/exportEager.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +61 -71
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/exportServer.js +55 -57
- package/build/src/export/embed/exportServer.js.map +1 -1
- package/build/src/export/embed/index.js +40 -44
- package/build/src/export/embed/index.js.map +1 -1
- package/build/src/export/embed/resolveOptions.js +36 -44
- package/build/src/export/embed/resolveOptions.js.map +1 -1
- package/build/src/export/embed/xcodeCompilerLogger.js +27 -39
- package/build/src/export/embed/xcodeCompilerLogger.js.map +1 -1
- package/build/src/export/exportApp.js +63 -67
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportAssets.js +27 -35
- package/build/src/export/exportAssets.js.map +1 -1
- package/build/src/export/exportAsync.js +9 -13
- package/build/src/export/exportAsync.js.map +1 -1
- package/build/src/export/exportDomComponents.js +45 -53
- package/build/src/export/exportDomComponents.js.map +1 -1
- package/build/src/export/exportHermes.js +63 -85
- package/build/src/export/exportHermes.js.map +1 -1
- package/build/src/export/exportStaticAsync.js +62 -72
- package/build/src/export/exportStaticAsync.js.map +1 -1
- package/build/src/export/favicon.js +27 -33
- package/build/src/export/favicon.js.map +1 -1
- package/build/src/export/getPublicExpoManifest.js +5 -7
- package/build/src/export/getPublicExpoManifest.js.map +1 -1
- package/build/src/export/getResolvedLocales.js +9 -11
- package/build/src/export/getResolvedLocales.js.map +1 -1
- package/build/src/export/html.js +6 -10
- package/build/src/export/html.js.map +1 -1
- package/build/src/export/index.js +28 -32
- package/build/src/export/index.js.map +1 -1
- package/build/src/export/metroAssetLocalPath.js +30 -36
- package/build/src/export/metroAssetLocalPath.js.map +1 -1
- package/build/src/export/persistMetroAssets.js +34 -42
- package/build/src/export/persistMetroAssets.js.map +1 -1
- package/build/src/export/publicFolder.js +6 -10
- package/build/src/export/publicFolder.js.map +1 -1
- package/build/src/export/resolveOptions.js +24 -28
- package/build/src/export/resolveOptions.js.map +1 -1
- package/build/src/export/saveAssets.js +46 -50
- package/build/src/export/saveAssets.js.map +1 -1
- package/build/src/export/web/exportWebAsync.js +11 -13
- package/build/src/export/web/exportWebAsync.js.map +1 -1
- package/build/src/export/web/index.js +15 -19
- package/build/src/export/web/index.js.map +1 -1
- package/build/src/export/web/resolveOptions.js +3 -5
- package/build/src/export/web/resolveOptions.js.map +1 -1
- package/build/src/export/writeContents.js +2 -4
- package/build/src/export/writeContents.js.map +1 -1
- package/build/src/graphql/generated.js +274 -400
- package/build/src/graphql/generated.js.map +1 -1
- package/build/src/install/applyPlugins.js +7 -11
- package/build/src/install/applyPlugins.js.map +1 -1
- package/build/src/install/checkPackages.js +22 -26
- package/build/src/install/checkPackages.js.map +1 -1
- package/build/src/install/fixPackages.js +12 -16
- package/build/src/install/fixPackages.js.map +1 -1
- package/build/src/install/index.js +16 -18
- package/build/src/install/index.js.map +1 -1
- package/build/src/install/installAsync.js +26 -32
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/installExpoPackage.js +18 -22
- package/build/src/install/installExpoPackage.js.map +1 -1
- package/build/src/install/resolveOptions.js +19 -21
- package/build/src/install/resolveOptions.js.map +1 -1
- package/build/src/install/utils/autoAddConfigPlugins.js +14 -18
- package/build/src/install/utils/autoAddConfigPlugins.js.map +1 -1
- package/build/src/install/utils/checkPackagesCompatibility.js +11 -13
- package/build/src/install/utils/checkPackagesCompatibility.js.map +1 -1
- package/build/src/lint/ESlintPrerequisite.js +44 -50
- package/build/src/lint/ESlintPrerequisite.js.map +1 -1
- package/build/src/lint/index.js +8 -12
- package/build/src/lint/index.js.map +1 -1
- package/build/src/lint/lintAsync.js +8 -10
- package/build/src/lint/lintAsync.js.map +1 -1
- package/build/src/log.js +16 -36
- package/build/src/log.js.map +1 -1
- package/build/src/login/index.js +20 -24
- package/build/src/login/index.js.map +1 -1
- package/build/src/logout/index.js +7 -11
- package/build/src/logout/index.js.map +1 -1
- package/build/src/prebuild/clearNativeFolder.js +26 -38
- package/build/src/prebuild/clearNativeFolder.js.map +1 -1
- package/build/src/prebuild/configureProjectAsync.js +14 -18
- package/build/src/prebuild/configureProjectAsync.js.map +1 -1
- package/build/src/prebuild/copyTemplateFiles.js +13 -17
- package/build/src/prebuild/copyTemplateFiles.js.map +1 -1
- package/build/src/prebuild/ensureConfigAsync.js +4 -6
- package/build/src/prebuild/ensureConfigAsync.js.map +1 -1
- package/build/src/prebuild/index.js +32 -36
- package/build/src/prebuild/index.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +25 -29
- package/build/src/prebuild/prebuildAsync.js.map +1 -1
- package/build/src/prebuild/renameTemplateAppName.js +40 -46
- package/build/src/prebuild/renameTemplateAppName.js.map +1 -1
- package/build/src/prebuild/resolveOptions.js +52 -66
- package/build/src/prebuild/resolveOptions.js.map +1 -1
- package/build/src/prebuild/resolveTemplate.js +32 -36
- package/build/src/prebuild/resolveTemplate.js.map +1 -1
- package/build/src/prebuild/updateFromTemplate.js +13 -19
- package/build/src/prebuild/updateFromTemplate.js.map +1 -1
- package/build/src/prebuild/updatePackageJson.js +39 -53
- package/build/src/prebuild/updatePackageJson.js.map +1 -1
- package/build/src/prebuild/validateTemplatePlatforms.js +8 -12
- package/build/src/prebuild/validateTemplatePlatforms.js.map +1 -1
- package/build/src/register/index.js +7 -11
- package/build/src/register/index.js.map +1 -1
- package/build/src/register/registerAsync.js +3 -5
- package/build/src/register/registerAsync.js.map +1 -1
- package/build/src/run/android/index.js +32 -36
- package/build/src/run/android/index.js.map +1 -1
- package/build/src/run/android/resolveDevice.js +8 -10
- package/build/src/run/android/resolveDevice.js.map +1 -1
- package/build/src/run/android/resolveGradlePropsAsync.js +16 -18
- package/build/src/run/android/resolveGradlePropsAsync.js.map +1 -1
- package/build/src/run/android/resolveInstallApkName.js +15 -17
- package/build/src/run/android/resolveInstallApkName.js.map +1 -1
- package/build/src/run/android/resolveLaunchProps.js +10 -12
- package/build/src/run/android/resolveLaunchProps.js.map +1 -1
- package/build/src/run/android/resolveOptions.js +2 -4
- package/build/src/run/android/resolveOptions.js.map +1 -1
- package/build/src/run/android/runAndroidAsync.js +21 -23
- package/build/src/run/android/runAndroidAsync.js.map +1 -1
- package/build/src/run/ensureNativeProject.js +5 -7
- package/build/src/run/ensureNativeProject.js.map +1 -1
- package/build/src/run/hints.js +7 -13
- package/build/src/run/hints.js.map +1 -1
- package/build/src/run/index.js +23 -27
- package/build/src/run/index.js.map +1 -1
- package/build/src/run/ios/XcodeBuild.js +56 -74
- package/build/src/run/ios/XcodeBuild.js.map +1 -1
- package/build/src/run/ios/XcodeBuild.types.js.map +1 -1
- package/build/src/run/ios/appleDevice/AppleDevice.js +63 -69
- package/build/src/run/ios/appleDevice/AppleDevice.js.map +1 -1
- package/build/src/run/ios/appleDevice/ClientManager.js +26 -29
- package/build/src/run/ios/appleDevice/ClientManager.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/AFCClient.js +25 -28
- package/build/src/run/ios/appleDevice/client/AFCClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/DebugserverClient.js +26 -29
- package/build/src/run/ios/appleDevice/client/DebugserverClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js +21 -22
- package/build/src/run/ios/appleDevice/client/InstallationProxyClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js +29 -32
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js +24 -28
- package/build/src/run/ios/appleDevice/client/MobileImageMounterClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/ServiceClient.js +4 -7
- package/build/src/run/ios/appleDevice/client/ServiceClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js +27 -28
- package/build/src/run/ios/appleDevice/client/UsbmuxdClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/installOnDeviceAsync.js +17 -23
- package/build/src/run/ios/appleDevice/installOnDeviceAsync.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js +132 -146
- package/build/src/run/ios/appleDevice/protocol/AFCProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js +21 -29
- package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js +21 -29
- package/build/src/run/ios/appleDevice/protocol/GDBProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js +22 -34
- package/build/src/run/ios/appleDevice/protocol/LockdownProtocol.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/UsbmuxProtocol.js +17 -27
- package/build/src/run/ios/appleDevice/protocol/UsbmuxProtocol.js.map +1 -1
- package/build/src/run/ios/codeSigning/Security.js +39 -53
- package/build/src/run/ios/codeSigning/Security.js.map +1 -1
- package/build/src/run/ios/codeSigning/configureCodeSigning.js +9 -13
- package/build/src/run/ios/codeSigning/configureCodeSigning.js.map +1 -1
- package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js +19 -27
- package/build/src/run/ios/codeSigning/resolveCertificateSigningIdentity.js.map +1 -1
- package/build/src/run/ios/codeSigning/settings.js +5 -9
- package/build/src/run/ios/codeSigning/settings.js.map +1 -1
- package/build/src/run/ios/codeSigning/simulatorCodeSigning.js +12 -14
- package/build/src/run/ios/codeSigning/simulatorCodeSigning.js.map +1 -1
- package/build/src/run/ios/codeSigning/xcodeCodeSigning.js +21 -27
- package/build/src/run/ios/codeSigning/xcodeCodeSigning.js.map +1 -1
- package/build/src/run/ios/index.js +36 -40
- package/build/src/run/ios/index.js.map +1 -1
- package/build/src/run/ios/launchApp.js +17 -23
- package/build/src/run/ios/launchApp.js.map +1 -1
- package/build/src/run/ios/options/appleDestinations.js +36 -38
- package/build/src/run/ios/options/appleDestinations.js.map +1 -1
- package/build/src/run/ios/options/promptDevice.js +16 -20
- package/build/src/run/ios/options/promptDevice.js.map +1 -1
- package/build/src/run/ios/options/resolveDevice.js +24 -30
- package/build/src/run/ios/options/resolveDevice.js.map +1 -1
- package/build/src/run/ios/options/resolveNativeScheme.js +23 -31
- package/build/src/run/ios/options/resolveNativeScheme.js.map +1 -1
- package/build/src/run/ios/options/resolveOptions.js +5 -7
- package/build/src/run/ios/options/resolveOptions.js.map +1 -1
- package/build/src/run/ios/options/resolveXcodeProject.js +5 -7
- package/build/src/run/ios/options/resolveXcodeProject.js.map +1 -1
- package/build/src/run/ios/runIosAsync.js +44 -48
- package/build/src/run/ios/runIosAsync.js.map +1 -1
- package/build/src/run/ios/validateExternalBinary.js +22 -24
- package/build/src/run/ios/validateExternalBinary.js.map +1 -1
- package/build/src/run/resolveBundlerProps.js +2 -4
- package/build/src/run/resolveBundlerProps.js.map +1 -1
- package/build/src/run/startBundler.js +12 -16
- package/build/src/run/startBundler.js.map +1 -1
- package/build/src/serve/index.js +16 -20
- package/build/src/serve/index.js.map +1 -1
- package/build/src/serve/serveAsync.js +32 -36
- package/build/src/serve/serveAsync.js.map +1 -1
- package/build/src/start/detectDevClient.js +9 -13
- package/build/src/start/detectDevClient.js.map +1 -1
- package/build/src/start/doctor/Prerequisite.js +7 -12
- package/build/src/start/doctor/Prerequisite.js.map +1 -1
- package/build/src/start/doctor/SecurityBinPrerequisite.js +11 -13
- package/build/src/start/doctor/SecurityBinPrerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js +19 -23
- package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/XcodeDeveloperDiskImagePrerequisite.js +19 -23
- package/build/src/start/doctor/apple/XcodeDeveloperDiskImagePrerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/XcodePrerequisite.js +45 -51
- package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
- package/build/src/start/doctor/apple/XcrunPrerequisite.js +16 -18
- package/build/src/start/doctor/apple/XcrunPrerequisite.js.map +1 -1
- package/build/src/start/doctor/dependencies/bundledNativeModules.js +19 -23
- package/build/src/start/doctor/dependencies/bundledNativeModules.js.map +1 -1
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +25 -31
- package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
- package/build/src/start/doctor/dependencies/getMissingPackages.js +17 -25
- package/build/src/start/doctor/dependencies/getMissingPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/getVersionedPackages.js +32 -40
- package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/resolvePackages.js +26 -32
- package/build/src/start/doctor/dependencies/resolvePackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +31 -41
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
- package/build/src/start/doctor/ngrok/ExternalModule.js +29 -34
- package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
- package/build/src/start/doctor/ngrok/NgrokResolver.js +8 -12
- package/build/src/start/doctor/ngrok/NgrokResolver.js.map +1 -1
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js +28 -32
- package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js.map +1 -1
- package/build/src/start/doctor/typescript/updateTSConfig.js +17 -23
- package/build/src/start/doctor/typescript/updateTSConfig.js.map +1 -1
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js +27 -33
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js.map +1 -1
- package/build/src/start/index.js +42 -46
- package/build/src/start/index.js.map +1 -1
- package/build/src/start/interface/KeyPressHandler.js +14 -18
- package/build/src/start/interface/KeyPressHandler.js.map +1 -1
- package/build/src/start/interface/commandsTable.js +80 -94
- package/build/src/start/interface/commandsTable.js.map +1 -1
- package/build/src/start/interface/interactiveActions.js +40 -44
- package/build/src/start/interface/interactiveActions.js.map +1 -1
- package/build/src/start/interface/startInterface.js +61 -65
- package/build/src/start/interface/startInterface.js.map +1 -1
- package/build/src/start/platforms/AppIdResolver.js +4 -6
- package/build/src/start/platforms/AppIdResolver.js.map +1 -1
- package/build/src/start/platforms/DeviceManager.js +6 -10
- package/build/src/start/platforms/DeviceManager.js.map +1 -1
- package/build/src/start/platforms/ExpoGoInstaller.js +20 -25
- package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -1
- package/build/src/start/platforms/PlatformManager.js +15 -17
- package/build/src/start/platforms/PlatformManager.js.map +1 -1
- package/build/src/start/platforms/android/ADBServer.js +35 -39
- package/build/src/start/platforms/android/ADBServer.js.map +1 -1
- package/build/src/start/platforms/android/AndroidAppIdResolver.js +16 -18
- package/build/src/start/platforms/android/AndroidAppIdResolver.js.map +1 -1
- package/build/src/start/platforms/android/AndroidDeviceManager.js +20 -24
- package/build/src/start/platforms/android/AndroidDeviceManager.js.map +1 -1
- package/build/src/start/platforms/android/AndroidPlatformManager.js +17 -17
- package/build/src/start/platforms/android/AndroidPlatformManager.js.map +1 -1
- package/build/src/start/platforms/android/AndroidSdk.js +9 -11
- package/build/src/start/platforms/android/AndroidSdk.js.map +1 -1
- package/build/src/start/platforms/android/activateWindow.js +22 -26
- package/build/src/start/platforms/android/activateWindow.js.map +1 -1
- package/build/src/start/platforms/android/adb.js +83 -121
- package/build/src/start/platforms/android/adb.js.map +1 -1
- package/build/src/start/platforms/android/adbReverse.js +12 -20
- package/build/src/start/platforms/android/adbReverse.js.map +1 -1
- package/build/src/start/platforms/android/emulator.js +26 -36
- package/build/src/start/platforms/android/emulator.js.map +1 -1
- package/build/src/start/platforms/android/getDevices.js +5 -7
- package/build/src/start/platforms/android/getDevices.js.map +1 -1
- package/build/src/start/platforms/android/gradle.js +28 -36
- package/build/src/start/platforms/android/gradle.js.map +1 -1
- package/build/src/start/platforms/android/promptAndroidDevice.js +15 -19
- package/build/src/start/platforms/android/promptAndroidDevice.js.map +1 -1
- package/build/src/start/platforms/ios/AppleAppIdResolver.js +19 -21
- package/build/src/start/platforms/ios/AppleAppIdResolver.js.map +1 -1
- package/build/src/start/platforms/ios/AppleDeviceManager.js +31 -37
- package/build/src/start/platforms/ios/AppleDeviceManager.js.map +1 -1
- package/build/src/start/platforms/ios/ApplePlatformManager.js +12 -12
- package/build/src/start/platforms/ios/ApplePlatformManager.js.map +1 -1
- package/build/src/start/platforms/ios/assertSystemRequirements.js +7 -9
- package/build/src/start/platforms/ios/assertSystemRequirements.js.map +1 -1
- package/build/src/start/platforms/ios/devicectl.js +73 -87
- package/build/src/start/platforms/ios/devicectl.js.map +1 -1
- package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js +18 -22
- package/build/src/start/platforms/ios/ensureSimulatorAppRunning.js.map +1 -1
- package/build/src/start/platforms/ios/getBestSimulator.js +19 -29
- package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -1
- package/build/src/start/platforms/ios/promptAppleDevice.js +10 -14
- package/build/src/start/platforms/ios/promptAppleDevice.js.map +1 -1
- package/build/src/start/platforms/ios/simctl.js +74 -102
- package/build/src/start/platforms/ios/simctl.js.map +1 -1
- package/build/src/start/platforms/ios/simctlLogging.js +52 -57
- package/build/src/start/platforms/ios/simctlLogging.js.map +1 -1
- package/build/src/start/platforms/ios/xcrun.js +18 -22
- package/build/src/start/platforms/ios/xcrun.js.map +1 -1
- package/build/src/start/project/devices.js +9 -19
- package/build/src/start/project/devices.js.map +1 -1
- package/build/src/start/project/dotExpo.js +11 -15
- package/build/src/start/project/dotExpo.js.map +1 -1
- package/build/src/start/project/settings.js +2 -4
- package/build/src/start/project/settings.js.map +1 -1
- package/build/src/start/resolveOptions.js +40 -48
- package/build/src/start/resolveOptions.js.map +1 -1
- package/build/src/start/server/AsyncNgrok.js +51 -55
- package/build/src/start/server/AsyncNgrok.js.map +1 -1
- package/build/src/start/server/AsyncWsTunnel.js +36 -40
- package/build/src/start/server/AsyncWsTunnel.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +79 -81
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/DevServerManager.js +38 -42
- package/build/src/start/server/DevServerManager.js.map +1 -1
- package/build/src/start/server/DevToolsPluginManager.js +14 -18
- package/build/src/start/server/DevToolsPluginManager.js.map +1 -1
- package/build/src/start/server/DevelopmentSession.js +14 -18
- package/build/src/start/server/DevelopmentSession.js.map +1 -1
- package/build/src/start/server/ReactDevToolsProxy.js +10 -16
- package/build/src/start/server/ReactDevToolsProxy.js.map +1 -1
- package/build/src/start/server/UrlCreator.js +33 -36
- package/build/src/start/server/UrlCreator.js.map +1 -1
- package/build/src/start/server/getStaticRenderFunctions.js +21 -29
- package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
- package/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js +4 -6
- package/build/src/start/server/metro/DevToolsPluginWebsocketEndpoint.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +271 -269
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/MetroTerminalReporter.js +56 -63
- package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/TerminalReporter.js +33 -39
- package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
- package/build/src/start/server/metro/TerminalReporter.types.js.map +1 -1
- package/build/src/start/server/metro/createExpoMetroResolver.js +40 -46
- package/build/src/start/server/metro/createExpoMetroResolver.js.map +1 -1
- package/build/src/start/server/metro/createJResolver.js +28 -32
- package/build/src/start/server/metro/createJResolver.js.map +1 -1
- package/build/src/start/server/metro/createServerComponentsMiddleware.js +92 -96
- package/build/src/start/server/metro/createServerComponentsMiddleware.js.map +1 -1
- package/build/src/start/server/metro/createServerRouteMiddleware.js +30 -32
- package/build/src/start/server/metro/createServerRouteMiddleware.js.map +1 -1
- package/build/src/start/server/metro/debugging/AtlasPrerequisite.js +11 -13
- package/build/src/start/server/metro/debugging/AtlasPrerequisite.js.map +1 -1
- package/build/src/start/server/metro/debugging/MessageHandler.js +1 -3
- package/build/src/start/server/metro/debugging/MessageHandler.js.map +1 -1
- package/build/src/start/server/metro/debugging/attachAtlas.js +22 -26
- package/build/src/start/server/metro/debugging/attachAtlas.js.map +1 -1
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js +17 -19
- package/build/src/start/server/metro/debugging/createDebugMiddleware.js.map +1 -1
- package/build/src/start/server/metro/debugging/createHandlersFactory.js +31 -25
- package/build/src/start/server/metro/debugging/createHandlersFactory.js.map +1 -1
- package/build/src/start/server/metro/debugging/getDebuggerType.js +4 -6
- package/build/src/start/server/metro/debugging/getDebuggerType.js.map +1 -1
- package/build/src/start/server/metro/debugging/messageHandlers/NetworkResponse.js +8 -14
- package/build/src/start/server/metro/debugging/messageHandlers/NetworkResponse.js.map +1 -1
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeDebuggerGetPossibleBreakpoints.js +5 -7
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeDebuggerGetPossibleBreakpoints.js.map +1 -1
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeDebuggerSetBreakpointByUrl.js +6 -8
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeDebuggerSetBreakpointByUrl.js.map +1 -1
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeRuntimeCallFunctionOn.js +5 -7
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeRuntimeCallFunctionOn.js.map +1 -1
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeRuntimeEvaluate.js +12 -14
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeRuntimeEvaluate.js.map +1 -1
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeRuntimeGetProperties.js +10 -14
- package/build/src/start/server/metro/debugging/messageHandlers/VscodeRuntimeGetProperties.js.map +1 -1
- package/build/src/start/server/metro/debugging/pageIsSupported.js +4 -6
- package/build/src/start/server/metro/debugging/pageIsSupported.js.map +1 -1
- package/build/src/start/server/metro/debugging/types.js.map +1 -1
- package/build/src/start/server/metro/dev-server/createEventSocket.js +16 -18
- package/build/src/start/server/metro/dev-server/createEventSocket.js.map +1 -1
- package/build/src/start/server/metro/dev-server/createMessageSocket.js +21 -23
- package/build/src/start/server/metro/dev-server/createMessageSocket.js.map +1 -1
- package/build/src/start/server/metro/dev-server/createMetroMiddleware.js +21 -23
- package/build/src/start/server/metro/dev-server/createMetroMiddleware.js.map +1 -1
- package/build/src/start/server/metro/dev-server/utils/createSocketBroadcaster.js +2 -4
- package/build/src/start/server/metro/dev-server/utils/createSocketBroadcaster.js.map +1 -1
- package/build/src/start/server/metro/dev-server/utils/createSocketMap.js +2 -4
- package/build/src/start/server/metro/dev-server/utils/createSocketMap.js.map +1 -1
- package/build/src/start/server/metro/dev-server/utils/socketMessages.js +4 -8
- package/build/src/start/server/metro/dev-server/utils/socketMessages.js.map +1 -1
- package/build/src/start/server/metro/externals.js +25 -33
- package/build/src/start/server/metro/externals.js.map +1 -1
- package/build/src/start/server/metro/fetchRouterManifest.js +12 -16
- package/build/src/start/server/metro/fetchRouterManifest.js.map +1 -1
- package/build/src/start/server/metro/formatFileCandidates.js +9 -11
- package/build/src/start/server/metro/formatFileCandidates.js.map +1 -1
- package/build/src/start/server/metro/getCssModulesFromBundler.js +18 -22
- package/build/src/start/server/metro/getCssModulesFromBundler.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +79 -85
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/log-box/LogBoxLog.js +36 -40
- package/build/src/start/server/metro/log-box/LogBoxLog.js.map +1 -1
- package/build/src/start/server/metro/log-box/LogBoxSymbolication.js +14 -20
- package/build/src/start/server/metro/log-box/LogBoxSymbolication.js.map +1 -1
- package/build/src/start/server/metro/log-box/formatProjectFilePath.js +6 -10
- package/build/src/start/server/metro/log-box/formatProjectFilePath.js.map +1 -1
- package/build/src/start/server/metro/metroErrorInterface.js +78 -88
- package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
- package/build/src/start/server/metro/metroErrors.js +4 -8
- package/build/src/start/server/metro/metroErrors.js.map +1 -1
- package/build/src/start/server/metro/metroPrivateServer.js +7 -9
- package/build/src/start/server/metro/metroPrivateServer.js.map +1 -1
- package/build/src/start/server/metro/metroVirtualModules.js +8 -10
- package/build/src/start/server/metro/metroVirtualModules.js.map +1 -1
- package/build/src/start/server/metro/metroWatchTypeScriptFiles.js +22 -24
- package/build/src/start/server/metro/metroWatchTypeScriptFiles.js.map +1 -1
- package/build/src/start/server/metro/router.js +32 -48
- package/build/src/start/server/metro/router.js.map +1 -1
- package/build/src/start/server/metro/runServer-fork.js +22 -24
- package/build/src/start/server/metro/runServer-fork.js.map +1 -1
- package/build/src/start/server/metro/serializeHtml.js +22 -24
- package/build/src/start/server/metro/serializeHtml.js.map +1 -1
- package/build/src/start/server/metro/symbolicate.js.map +1 -1
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js +29 -35
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +139 -149
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/metro/withMetroResolvers.js +39 -49
- package/build/src/start/server/metro/withMetroResolvers.js.map +1 -1
- package/build/src/start/server/middleware/ContextModuleSourceMapsMiddleware.js +6 -8
- package/build/src/start/server/middleware/ContextModuleSourceMapsMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/CorsMiddleware.js +15 -17
- package/build/src/start/server/middleware/CorsMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/CreateFileMiddleware.js +31 -32
- package/build/src/start/server/middleware/CreateFileMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js +19 -22
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/DomComponentsMiddleware.js +27 -33
- package/build/src/start/server/middleware/DomComponentsMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +60 -64
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ExpoMiddleware.js +9 -15
- package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/FaviconMiddleware.js +14 -15
- package/build/src/start/server/middleware/FaviconMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/HistoryFallbackMiddleware.js +2 -4
- package/build/src/start/server/middleware/HistoryFallbackMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js +31 -34
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +56 -64
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ReactDevToolsPageMiddleware.js +19 -23
- package/build/src/start/server/middleware/ReactDevToolsPageMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js +19 -20
- package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ServeStaticMiddleware.js +9 -11
- package/build/src/start/server/middleware/ServeStaticMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/createBuiltinAPIRequestHandler.js +11 -17
- package/build/src/start/server/middleware/createBuiltinAPIRequestHandler.js.map +1 -1
- package/build/src/start/server/middleware/inspector/CdpClient.js +10 -12
- package/build/src/start/server/middleware/inspector/CdpClient.js.map +1 -1
- package/build/src/start/server/middleware/inspector/JsInspector.js +27 -35
- package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js +19 -21
- package/build/src/start/server/middleware/inspector/createJsInspectorMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/inspector/middlwareMutations.js +2 -6
- package/build/src/start/server/middleware/inspector/middlwareMutations.js.map +1 -1
- package/build/src/start/server/middleware/metroOptions.js +96 -120
- package/build/src/start/server/middleware/metroOptions.js.map +1 -1
- package/build/src/start/server/middleware/mutations.js +3 -7
- package/build/src/start/server/middleware/mutations.js.map +1 -1
- package/build/src/start/server/middleware/resolveAssets.js +18 -26
- package/build/src/start/server/middleware/resolveAssets.js.map +1 -1
- package/build/src/start/server/middleware/resolvePlatform.js +15 -23
- package/build/src/start/server/middleware/resolvePlatform.js.map +1 -1
- package/build/src/start/server/middleware/resolveRuntimeVersionWithExpoUpdatesAsync.js +9 -11
- package/build/src/start/server/middleware/resolveRuntimeVersionWithExpoUpdatesAsync.js.map +1 -1
- package/build/src/start/server/middleware/server.types.js.map +1 -1
- package/build/src/start/server/openPlatforms.js +8 -10
- package/build/src/start/server/openPlatforms.js.map +1 -1
- package/build/src/start/server/platformBundlers.js +11 -13
- package/build/src/start/server/platformBundlers.js.map +1 -1
- package/build/src/start/server/serverLogLikeMetro.js +50 -58
- package/build/src/start/server/serverLogLikeMetro.js.map +1 -1
- package/build/src/start/server/type-generation/expo-env.js +7 -11
- package/build/src/start/server/type-generation/expo-env.js.map +1 -1
- package/build/src/start/server/type-generation/routes.js +54 -76
- package/build/src/start/server/type-generation/routes.js.map +1 -1
- package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js +19 -21
- package/build/src/start/server/type-generation/startTypescriptTypeGeneration.js.map +1 -1
- package/build/src/start/server/type-generation/tsconfig.js +28 -36
- package/build/src/start/server/type-generation/tsconfig.js.map +1 -1
- package/build/src/start/server/webTemplate.js +24 -28
- package/build/src/start/server/webTemplate.js.map +1 -1
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js +46 -52
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
- package/build/src/start/server/webpack/compile.js +11 -15
- package/build/src/start/server/webpack/compile.js.map +1 -1
- package/build/src/start/server/webpack/formatWebpackMessages.js +26 -28
- package/build/src/start/server/webpack/formatWebpackMessages.js.map +1 -1
- package/build/src/start/server/webpack/resolveFromProject.js +12 -18
- package/build/src/start/server/webpack/resolveFromProject.js.map +1 -1
- package/build/src/start/server/webpack/tls.js +12 -18
- package/build/src/start/server/webpack/tls.js.map +1 -1
- package/build/src/start/startAsync.js +27 -31
- package/build/src/start/startAsync.js.map +1 -1
- package/build/src/utils/FileNotifier.js +17 -20
- package/build/src/utils/FileNotifier.js.map +1 -1
- package/build/src/utils/ansi.js +5 -7
- package/build/src/utils/ansi.js.map +1 -1
- package/build/src/utils/args.js +14 -24
- package/build/src/utils/args.js.map +1 -1
- package/build/src/utils/array.js +6 -18
- package/build/src/utils/array.js.map +1 -1
- package/build/src/utils/cocoapods.js +46 -54
- package/build/src/utils/cocoapods.js.map +1 -1
- package/build/src/utils/codesigning.js +68 -78
- package/build/src/utils/codesigning.js.map +1 -1
- package/build/src/utils/createFileTransform.js +12 -16
- package/build/src/utils/createFileTransform.js.map +1 -1
- package/build/src/utils/createTempPath.js +13 -17
- package/build/src/utils/createTempPath.js.map +1 -1
- package/build/src/utils/delay.js +6 -12
- package/build/src/utils/delay.js.map +1 -1
- package/build/src/utils/dir.js +28 -46
- package/build/src/utils/dir.js.map +1 -1
- package/build/src/utils/downloadAppAsync.js +8 -10
- package/build/src/utils/downloadAppAsync.js.map +1 -1
- package/build/src/utils/downloadExpoGoAsync.js +21 -25
- package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
- package/build/src/utils/editor.js +35 -41
- package/build/src/utils/editor.js.map +1 -1
- package/build/src/utils/env.js +59 -63
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/errors.js +30 -37
- package/build/src/utils/errors.js.map +1 -1
- package/build/src/utils/exit.js +31 -35
- package/build/src/utils/exit.js.map +1 -1
- package/build/src/utils/expoUpdatesCli.js +22 -32
- package/build/src/utils/expoUpdatesCli.js.map +1 -1
- package/build/src/utils/fetch.js +4 -8
- package/build/src/utils/fetch.js.map +1 -1
- package/build/src/utils/filePath.js +6 -10
- package/build/src/utils/filePath.js.map +1 -1
- package/build/src/utils/findUp.js +9 -13
- package/build/src/utils/findUp.js.map +1 -1
- package/build/src/utils/fn.js +2 -6
- package/build/src/utils/fn.js.map +1 -1
- package/build/src/utils/getOrPromptApplicationId.js +26 -32
- package/build/src/utils/getOrPromptApplicationId.js.map +1 -1
- package/build/src/utils/getRunningProcess.js +21 -29
- package/build/src/utils/getRunningProcess.js.map +1 -1
- package/build/src/utils/git.js +20 -26
- package/build/src/utils/git.js.map +1 -1
- package/build/src/utils/glob.js +4 -8
- package/build/src/utils/glob.js.map +1 -1
- package/build/src/utils/interactive.js +1 -3
- package/build/src/utils/interactive.js.map +1 -1
- package/build/src/utils/ip.js +19 -21
- package/build/src/utils/ip.js.map +1 -1
- package/build/src/utils/isModuleSymlinked.js +9 -11
- package/build/src/utils/isModuleSymlinked.js.map +1 -1
- package/build/src/utils/jsonSchemaDeref.js +18 -20
- package/build/src/utils/jsonSchemaDeref.js.map +1 -1
- package/build/src/utils/link.js +13 -17
- package/build/src/utils/link.js.map +1 -1
- package/build/src/utils/mergeGitIgnorePaths.js +28 -46
- package/build/src/utils/mergeGitIgnorePaths.js.map +1 -1
- package/build/src/utils/modifyConfigAsync.js +10 -16
- package/build/src/utils/modifyConfigAsync.js.map +1 -1
- package/build/src/utils/modifyConfigPlugins.js +6 -10
- package/build/src/utils/modifyConfigPlugins.js.map +1 -1
- package/build/src/utils/nodeEnv.js +6 -12
- package/build/src/utils/nodeEnv.js.map +1 -1
- package/build/src/utils/nodeModules.js +8 -10
- package/build/src/utils/nodeModules.js.map +1 -1
- package/build/src/utils/npm.js +36 -50
- package/build/src/utils/npm.js.map +1 -1
- package/build/src/utils/obj.js +5 -11
- package/build/src/utils/obj.js.map +1 -1
- package/build/src/utils/open.js +8 -10
- package/build/src/utils/open.js.map +1 -1
- package/build/src/utils/ora.js +7 -13
- package/build/src/utils/ora.js.map +1 -1
- package/build/src/utils/plist.js +15 -21
- package/build/src/utils/plist.js.map +1 -1
- package/build/src/utils/port.js +33 -43
- package/build/src/utils/port.js.map +1 -1
- package/build/src/utils/profile.js +7 -11
- package/build/src/utils/profile.js.map +1 -1
- package/build/src/utils/progress.js +5 -11
- package/build/src/utils/progress.js.map +1 -1
- package/build/src/utils/prompts.js +29 -47
- package/build/src/utils/prompts.js.map +1 -1
- package/build/src/utils/resolveArgs.js +24 -36
- package/build/src/utils/resolveArgs.js.map +1 -1
- package/build/src/utils/scheme.js +32 -40
- package/build/src/utils/scheme.js.map +1 -1
- package/build/src/utils/stream.js +3 -5
- package/build/src/utils/stream.js.map +1 -1
- package/build/src/utils/strings.js +4 -6
- package/build/src/utils/strings.js.map +1 -1
- package/build/src/utils/tar.js +15 -19
- package/build/src/utils/tar.js.map +1 -1
- package/build/src/utils/telemetry/Telemetry.js +27 -29
- package/build/src/utils/telemetry/Telemetry.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js +13 -15
- package/build/src/utils/telemetry/clients/FetchClient.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchDetachedClient.js +22 -26
- package/build/src/utils/telemetry/clients/FetchDetachedClient.js.map +1 -1
- package/build/src/utils/telemetry/clients/RudderClient.js +8 -10
- package/build/src/utils/telemetry/clients/RudderClient.js.map +1 -1
- package/build/src/utils/telemetry/clients/RudderDetachedClient.js +22 -26
- package/build/src/utils/telemetry/clients/RudderDetachedClient.js.map +1 -1
- package/build/src/utils/telemetry/clients/flushFetchDetached.js +10 -10
- package/build/src/utils/telemetry/clients/flushFetchDetached.js.map +1 -1
- package/build/src/utils/telemetry/clients/flushRudderDetached.js +10 -10
- package/build/src/utils/telemetry/clients/flushRudderDetached.js.map +1 -1
- package/build/src/utils/telemetry/events.js +2 -4
- package/build/src/utils/telemetry/events.js.map +1 -1
- package/build/src/utils/telemetry/flushDetached.js.map +1 -1
- package/build/src/utils/telemetry/index.js +29 -25
- package/build/src/utils/telemetry/index.js.map +1 -1
- package/build/src/utils/telemetry/types.js.map +1 -1
- package/build/src/utils/telemetry/utils/constants.js +4 -8
- package/build/src/utils/telemetry/utils/constants.js.map +1 -1
- package/build/src/utils/telemetry/utils/context.js +14 -18
- package/build/src/utils/telemetry/utils/context.js.map +1 -1
- package/build/src/utils/template.js +4 -6
- package/build/src/utils/template.js.map +1 -1
- package/build/src/utils/terminal.js +2 -4
- package/build/src/utils/terminal.js.map +1 -1
- package/build/src/utils/tsconfig/evaluateTsConfig.js +17 -21
- package/build/src/utils/tsconfig/evaluateTsConfig.js.map +1 -1
- package/build/src/utils/tsconfig/loadTsConfigPaths.js +14 -18
- package/build/src/utils/tsconfig/loadTsConfigPaths.js.map +1 -1
- package/build/src/utils/tsconfig/matchTsConfigPathAlias.js +5 -7
- package/build/src/utils/tsconfig/matchTsConfigPathAlias.js.map +1 -1
- package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js +12 -14
- package/build/src/utils/tsconfig/resolveWithTsConfigPaths.js.map +1 -1
- package/build/src/utils/url.js +13 -23
- package/build/src/utils/url.js.map +1 -1
- package/build/src/utils/validateApplicationId.js +86 -108
- package/build/src/utils/validateApplicationId.js.map +1 -1
- package/build/src/utils/variadic.js +16 -22
- package/build/src/utils/variadic.js.map +1 -1
- package/build/src/whoami/index.js +7 -11
- package/build/src/whoami/index.js.map +1 -1
- package/build/src/whoami/whoamiAsync.js +7 -11
- package/build/src/whoami/whoamiAsync.js.map +1 -1
- package/package.json +3 -3
|
@@ -4,23 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "getVersionsAsync", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get:
|
|
8
|
-
return getVersionsAsync;
|
|
9
|
-
}
|
|
7
|
+
get: ()=>getVersionsAsync
|
|
10
8
|
});
|
|
11
9
|
const _client = require("./rest/client");
|
|
12
10
|
const _errors = require("../utils/errors");
|
|
13
|
-
async function getVersionsAsync({ skipCache
|
|
11
|
+
async function getVersionsAsync({ skipCache } = {}) {
|
|
14
12
|
// Reconstruct the cached fetch since caching could be disabled.
|
|
15
13
|
const fetchAsync = (0, _client.createCachedFetch)({
|
|
16
14
|
skipCache,
|
|
17
|
-
cacheDirectory:
|
|
15
|
+
cacheDirectory: "versions-cache",
|
|
18
16
|
// We'll use a 5 minute cache to ensure we stay relatively up to date.
|
|
19
17
|
ttl: 1000 * 60 * 5
|
|
20
18
|
});
|
|
21
|
-
const results = await fetchAsync(
|
|
19
|
+
const results = await fetchAsync("versions/latest");
|
|
22
20
|
if (!results.ok) {
|
|
23
|
-
throw new _errors.CommandError(
|
|
21
|
+
throw new _errors.CommandError("API", `Unexpected response when fetching version info from Expo servers: ${results.statusText}.`);
|
|
24
22
|
}
|
|
25
23
|
const json = await results.json();
|
|
26
24
|
return (0, _client.getResponseDataOrThrow)(json);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/getVersions.ts"],"sourcesContent":["import { createCachedFetch, getResponseDataOrThrow } from './rest/client';\nimport { CommandError } from '../utils/errors';\n\n/** Represents version info for a particular SDK. */\nexport type SDKVersion = {\n /** @example \"2.16.1\" */\n iosVersion?: string;\n /** @example \"https://dpq5q02fu5f55.cloudfront.net/Exponent-2.17.4.tar.gz\" */\n iosClientUrl?: string;\n /** @example \"https://dev.to/expo/expo-sdk-38-is-now-available-5aa0\" */\n releaseNoteUrl?: string;\n /** @example \"2.17.4\" */\n iosClientVersion?: string;\n /** @example \"https://d1ahtucjixef4r.cloudfront.net/Exponent-2.16.1.apk\" */\n androidClientUrl?: string;\n /** @example \"2.16.1\" */\n androidClientVersion?: string;\n /** @example { \"typescript\": \"~3.9.5\" } */\n relatedPackages?: Record<string, string>;\n\n facebookReactNativeVersion: string;\n\n facebookReactVersion?: string;\n\n expoVersion?: string;\n\n beta?: boolean;\n};\n\nexport type SDKVersions = Record<string, SDKVersion>;\n\nexport type Versions = {\n androidUrl: string;\n androidVersion: string;\n iosUrl: string;\n iosVersion: string;\n sdkVersions: SDKVersions;\n};\n\n/** Get versions from remote endpoint. */\nexport async function getVersionsAsync({\n skipCache,\n}: { skipCache?: boolean } = {}): Promise<Versions> {\n // Reconstruct the cached fetch since caching could be disabled.\n const fetchAsync = createCachedFetch({\n skipCache,\n cacheDirectory: 'versions-cache',\n // We'll use a 5 minute cache to ensure we stay relatively up to date.\n ttl: 1000 * 60 * 5,\n });\n\n const results = await fetchAsync('versions/latest');\n if (!results.ok) {\n throw new CommandError(\n 'API',\n `Unexpected response when fetching version info from Expo servers: ${results.statusText}.`\n );\n }\n\n const json = await results.json();\n return getResponseDataOrThrow<Versions>(json);\n}\n"],"names":["getVersionsAsync","skipCache","fetchAsync","createCachedFetch","cacheDirectory","ttl","results","ok","CommandError","statusText","json","getResponseDataOrThrow"],"mappings":";;;;+BAwCsBA
|
|
1
|
+
{"version":3,"sources":["../../../src/api/getVersions.ts"],"sourcesContent":["import { createCachedFetch, getResponseDataOrThrow } from './rest/client';\nimport { CommandError } from '../utils/errors';\n\n/** Represents version info for a particular SDK. */\nexport type SDKVersion = {\n /** @example \"2.16.1\" */\n iosVersion?: string;\n /** @example \"https://dpq5q02fu5f55.cloudfront.net/Exponent-2.17.4.tar.gz\" */\n iosClientUrl?: string;\n /** @example \"https://dev.to/expo/expo-sdk-38-is-now-available-5aa0\" */\n releaseNoteUrl?: string;\n /** @example \"2.17.4\" */\n iosClientVersion?: string;\n /** @example \"https://d1ahtucjixef4r.cloudfront.net/Exponent-2.16.1.apk\" */\n androidClientUrl?: string;\n /** @example \"2.16.1\" */\n androidClientVersion?: string;\n /** @example { \"typescript\": \"~3.9.5\" } */\n relatedPackages?: Record<string, string>;\n\n facebookReactNativeVersion: string;\n\n facebookReactVersion?: string;\n\n expoVersion?: string;\n\n beta?: boolean;\n};\n\nexport type SDKVersions = Record<string, SDKVersion>;\n\nexport type Versions = {\n androidUrl: string;\n androidVersion: string;\n iosUrl: string;\n iosVersion: string;\n sdkVersions: SDKVersions;\n};\n\n/** Get versions from remote endpoint. */\nexport async function getVersionsAsync({\n skipCache,\n}: { skipCache?: boolean } = {}): Promise<Versions> {\n // Reconstruct the cached fetch since caching could be disabled.\n const fetchAsync = createCachedFetch({\n skipCache,\n cacheDirectory: 'versions-cache',\n // We'll use a 5 minute cache to ensure we stay relatively up to date.\n ttl: 1000 * 60 * 5,\n });\n\n const results = await fetchAsync('versions/latest');\n if (!results.ok) {\n throw new CommandError(\n 'API',\n `Unexpected response when fetching version info from Expo servers: ${results.statusText}.`\n );\n }\n\n const json = await results.json();\n return getResponseDataOrThrow<Versions>(json);\n}\n"],"names":["getVersionsAsync","skipCache","fetchAsync","createCachedFetch","cacheDirectory","ttl","results","ok","CommandError","statusText","json","getResponseDataOrThrow"],"mappings":"AAAA;;;;+BAwCsBA,kBAAgB;;aAAhBA,gBAAgB;;wBAxCoB,eAAe;wBAC5C,iBAAiB;AAuCvC,eAAeA,gBAAgB,CAAC,EACrCC,SAAS,CAAA,EACe,GAAG,EAAE,EAAqB;IAClD,gEAAgE;IAChE,MAAMC,UAAU,GAAGC,IAAAA,OAAiB,kBAAA,EAAC;QACnCF,SAAS;QACTG,cAAc,EAAE,gBAAgB;QAChC,sEAAsE;QACtEC,GAAG,EAAE,IAAI,GAAG,EAAE,GAAG,CAAC;KACnB,CAAC,AAAC;IAEH,MAAMC,OAAO,GAAG,MAAMJ,UAAU,CAAC,iBAAiB,CAAC,AAAC;IACpD,IAAI,CAACI,OAAO,CAACC,EAAE,EAAE;QACf,MAAM,IAAIC,OAAY,aAAA,CACpB,KAAK,EACL,CAAC,kEAAkE,EAAEF,OAAO,CAACG,UAAU,CAAC,CAAC,CAAC,CAC3F,CAAC;IACJ,CAAC;IAED,MAAMC,IAAI,GAAG,MAAMJ,OAAO,CAACI,IAAI,EAAE,AAAC;IAClC,OAAOC,IAAAA,OAAsB,uBAAA,EAAWD,IAAI,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -9,15 +9,9 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
graphqlClient: function() {
|
|
16
|
-
return graphqlClient;
|
|
17
|
-
},
|
|
18
|
-
withErrorHandlingAsync: function() {
|
|
19
|
-
return withErrorHandlingAsync;
|
|
20
|
-
}
|
|
12
|
+
graphqlClient: ()=>graphqlClient,
|
|
13
|
+
withErrorHandlingAsync: ()=>withErrorHandlingAsync,
|
|
14
|
+
GraphqlError: ()=>_core().CombinedError
|
|
21
15
|
});
|
|
22
16
|
function _core() {
|
|
23
17
|
const data = require("@urql/core");
|
|
@@ -26,20 +20,20 @@ function _core() {
|
|
|
26
20
|
};
|
|
27
21
|
return data;
|
|
28
22
|
}
|
|
29
|
-
function
|
|
23
|
+
function _exchangeRetry() {
|
|
30
24
|
const data = require("@urql/exchange-retry");
|
|
31
|
-
|
|
25
|
+
_exchangeRetry = function() {
|
|
32
26
|
return data;
|
|
33
27
|
};
|
|
34
28
|
return data;
|
|
35
29
|
}
|
|
36
|
-
const _log = /*#__PURE__*/
|
|
30
|
+
const _log = /*#__PURE__*/ _interopRequireWildcard(require("../../log"));
|
|
37
31
|
const _fetch = require("../../utils/fetch");
|
|
38
32
|
const _endpoint = require("../endpoint");
|
|
39
33
|
const _wrapFetchWithOffline = require("../rest/wrapFetchWithOffline");
|
|
40
34
|
const _wrapFetchWithProxy = require("../rest/wrapFetchWithProxy");
|
|
41
35
|
const _wrapFetchWithUserAgent = require("../rest/wrapFetchWithUserAgent");
|
|
42
|
-
const
|
|
36
|
+
const _userSettings = require("../user/UserSettings");
|
|
43
37
|
function _getRequireWildcardCache(nodeInterop) {
|
|
44
38
|
if (typeof WeakMap !== "function") return null;
|
|
45
39
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -48,7 +42,7 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
48
42
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
49
43
|
})(nodeInterop);
|
|
50
44
|
}
|
|
51
|
-
function
|
|
45
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
52
46
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
53
47
|
return obj;
|
|
54
48
|
}
|
|
@@ -61,9 +55,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
61
55
|
if (cache && cache.has(obj)) {
|
|
62
56
|
return cache.get(obj);
|
|
63
57
|
}
|
|
64
|
-
var newObj = {
|
|
65
|
-
__proto__: null
|
|
66
|
-
};
|
|
58
|
+
var newObj = {};
|
|
67
59
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
68
60
|
for(var key in obj){
|
|
69
61
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -82,23 +74,25 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
82
74
|
return newObj;
|
|
83
75
|
}
|
|
84
76
|
const graphqlClient = (0, _core().createClient)({
|
|
85
|
-
url: (0, _endpoint.getExpoApiBaseUrl)() +
|
|
77
|
+
url: (0, _endpoint.getExpoApiBaseUrl)() + "/graphql",
|
|
86
78
|
exchanges: [
|
|
87
79
|
_core().cacheExchange,
|
|
88
|
-
(0,
|
|
80
|
+
(0, _exchangeRetry().retryExchange)({
|
|
89
81
|
maxDelayMs: 4000,
|
|
90
|
-
retryIf: (err)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
82
|
+
retryIf: (err)=>{
|
|
83
|
+
return !!(err && (err.networkError || err.graphQLErrors.some((e)=>{
|
|
84
|
+
var ref;
|
|
85
|
+
return e == null ? void 0 : (ref = e.extensions) == null ? void 0 : ref.isTransient;
|
|
86
|
+
})));
|
|
87
|
+
}
|
|
94
88
|
}),
|
|
95
|
-
_core().fetchExchange
|
|
89
|
+
_core().fetchExchange,
|
|
96
90
|
],
|
|
97
91
|
// @ts-ignore Type 'typeof fetch' is not assignable to type '(input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>'.
|
|
98
92
|
fetch: (0, _wrapFetchWithOffline.wrapFetchWithOffline)((0, _wrapFetchWithProxy.wrapFetchWithProxy)((0, _wrapFetchWithUserAgent.wrapFetchWithUserAgent)(_fetch.fetch))),
|
|
99
93
|
fetchOptions: ()=>{
|
|
100
|
-
var
|
|
101
|
-
const token = (0,
|
|
94
|
+
var ref;
|
|
95
|
+
const token = (0, _userSettings.getAccessToken)();
|
|
102
96
|
if (token) {
|
|
103
97
|
return {
|
|
104
98
|
headers: {
|
|
@@ -106,11 +100,11 @@ const graphqlClient = (0, _core().createClient)({
|
|
|
106
100
|
}
|
|
107
101
|
};
|
|
108
102
|
}
|
|
109
|
-
const sessionSecret = (
|
|
103
|
+
const sessionSecret = (ref = (0, _userSettings.getSession)()) == null ? void 0 : ref.sessionSecret;
|
|
110
104
|
if (sessionSecret) {
|
|
111
105
|
return {
|
|
112
106
|
headers: {
|
|
113
|
-
|
|
107
|
+
"expo-session": sessionSecret
|
|
114
108
|
}
|
|
115
109
|
};
|
|
116
110
|
}
|
|
@@ -118,11 +112,11 @@ const graphqlClient = (0, _core().createClient)({
|
|
|
118
112
|
}
|
|
119
113
|
});
|
|
120
114
|
async function withErrorHandlingAsync(promise) {
|
|
121
|
-
const { data, error
|
|
115
|
+
const { data , error } = await promise;
|
|
122
116
|
if (error) {
|
|
123
117
|
if (error.graphQLErrors.some((e)=>{
|
|
124
|
-
var
|
|
125
|
-
return e == null ? void 0 : (
|
|
118
|
+
var ref;
|
|
119
|
+
return e == null ? void 0 : (ref = e.extensions) == null ? void 0 : ref.isTransient;
|
|
126
120
|
})) {
|
|
127
121
|
_log.error(`We've encountered a transient error, please try again shortly.`);
|
|
128
122
|
}
|
|
@@ -131,7 +125,7 @@ async function withErrorHandlingAsync(promise) {
|
|
|
131
125
|
// Check for a malformed response. This only checks the root query's existence. It doesn't affect
|
|
132
126
|
// returning responses with an empty result set.
|
|
133
127
|
if (!data) {
|
|
134
|
-
throw new Error(
|
|
128
|
+
throw new Error("Returned query result data is null!");
|
|
135
129
|
}
|
|
136
130
|
return data;
|
|
137
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/api/graphql/client.ts"],"sourcesContent":["import {\n cacheExchange,\n Client,\n CombinedError as GraphqlError,\n AnyVariables,\n DocumentInput,\n createClient as createUrqlClient,\n fetchExchange,\n OperationContext,\n OperationResult,\n OperationResultSource,\n} from '@urql/core';\nimport { retryExchange } from '@urql/exchange-retry';\n\nimport * as Log from '../../log';\nimport { fetch } from '../../utils/fetch';\nimport { getExpoApiBaseUrl } from '../endpoint';\nimport { wrapFetchWithOffline } from '../rest/wrapFetchWithOffline';\nimport { wrapFetchWithProxy } from '../rest/wrapFetchWithProxy';\nimport { wrapFetchWithUserAgent } from '../rest/wrapFetchWithUserAgent';\nimport { getAccessToken, getSession } from '../user/UserSettings';\n\ntype AccessTokenHeaders = {\n authorization: string;\n};\n\ntype SessionHeaders = {\n 'expo-session': string;\n};\n\nexport const graphqlClient = createUrqlClient({\n url: getExpoApiBaseUrl() + '/graphql',\n exchanges: [\n cacheExchange,\n retryExchange({\n maxDelayMs: 4000,\n retryIf: (err) =>\n !!(err && (err.networkError || err.graphQLErrors.some((e) => e?.extensions?.isTransient))),\n }),\n fetchExchange,\n ],\n // @ts-ignore Type 'typeof fetch' is not assignable to type '(input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>'.\n fetch: wrapFetchWithOffline(wrapFetchWithProxy(wrapFetchWithUserAgent(fetch))),\n fetchOptions: (): { headers?: AccessTokenHeaders | SessionHeaders } => {\n const token = getAccessToken();\n if (token) {\n return {\n headers: {\n authorization: `Bearer ${token}`,\n },\n };\n }\n const sessionSecret = getSession()?.sessionSecret;\n if (sessionSecret) {\n return {\n headers: {\n 'expo-session': sessionSecret,\n },\n };\n }\n return {};\n },\n}) as StricterClient;\n\n/* Please specify additionalTypenames in your Graphql queries */\nexport interface StricterClient extends Client {\n query<Data = any, Variables extends AnyVariables = AnyVariables>(\n query: DocumentInput<Data, Variables>,\n variables: Variables,\n context: Partial<OperationContext> & { additionalTypenames: string[] }\n ): OperationResultSource<OperationResult<Data, Variables>>;\n}\n\nexport async function withErrorHandlingAsync<T>(promise: Promise<OperationResult<T>>): Promise<T> {\n const { data, error } = await promise;\n\n if (error) {\n if (error.graphQLErrors.some((e) => e?.extensions?.isTransient)) {\n Log.error(`We've encountered a transient error, please try again shortly.`);\n }\n throw error;\n }\n\n // Check for a malformed response. This only checks the root query's existence. It doesn't affect\n // returning responses with an empty result set.\n if (!data) {\n throw new Error('Returned query result data is null!');\n }\n\n return data;\n}\n\nexport { GraphqlError };\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../../src/api/graphql/client.ts"],"sourcesContent":["import {\n cacheExchange,\n Client,\n CombinedError as GraphqlError,\n AnyVariables,\n DocumentInput,\n createClient as createUrqlClient,\n fetchExchange,\n OperationContext,\n OperationResult,\n OperationResultSource,\n} from '@urql/core';\nimport { retryExchange } from '@urql/exchange-retry';\n\nimport * as Log from '../../log';\nimport { fetch } from '../../utils/fetch';\nimport { getExpoApiBaseUrl } from '../endpoint';\nimport { wrapFetchWithOffline } from '../rest/wrapFetchWithOffline';\nimport { wrapFetchWithProxy } from '../rest/wrapFetchWithProxy';\nimport { wrapFetchWithUserAgent } from '../rest/wrapFetchWithUserAgent';\nimport { getAccessToken, getSession } from '../user/UserSettings';\n\ntype AccessTokenHeaders = {\n authorization: string;\n};\n\ntype SessionHeaders = {\n 'expo-session': string;\n};\n\nexport const graphqlClient = createUrqlClient({\n url: getExpoApiBaseUrl() + '/graphql',\n exchanges: [\n cacheExchange,\n retryExchange({\n maxDelayMs: 4000,\n retryIf: (err) =>\n !!(err && (err.networkError || err.graphQLErrors.some((e) => e?.extensions?.isTransient))),\n }),\n fetchExchange,\n ],\n // @ts-ignore Type 'typeof fetch' is not assignable to type '(input: RequestInfo, init?: RequestInit | undefined) => Promise<Response>'.\n fetch: wrapFetchWithOffline(wrapFetchWithProxy(wrapFetchWithUserAgent(fetch))),\n fetchOptions: (): { headers?: AccessTokenHeaders | SessionHeaders } => {\n const token = getAccessToken();\n if (token) {\n return {\n headers: {\n authorization: `Bearer ${token}`,\n },\n };\n }\n const sessionSecret = getSession()?.sessionSecret;\n if (sessionSecret) {\n return {\n headers: {\n 'expo-session': sessionSecret,\n },\n };\n }\n return {};\n },\n}) as StricterClient;\n\n/* Please specify additionalTypenames in your Graphql queries */\nexport interface StricterClient extends Client {\n query<Data = any, Variables extends AnyVariables = AnyVariables>(\n query: DocumentInput<Data, Variables>,\n variables: Variables,\n context: Partial<OperationContext> & { additionalTypenames: string[] }\n ): OperationResultSource<OperationResult<Data, Variables>>;\n}\n\nexport async function withErrorHandlingAsync<T>(promise: Promise<OperationResult<T>>): Promise<T> {\n const { data, error } = await promise;\n\n if (error) {\n if (error.graphQLErrors.some((e) => e?.extensions?.isTransient)) {\n Log.error(`We've encountered a transient error, please try again shortly.`);\n }\n throw error;\n }\n\n // Check for a malformed response. This only checks the root query's existence. It doesn't affect\n // returning responses with an empty result set.\n if (!data) {\n throw new Error('Returned query result data is null!');\n }\n\n return data;\n}\n\nexport { GraphqlError };\n"],"names":["graphqlClient","withErrorHandlingAsync","GraphqlError","createUrqlClient","url","getExpoApiBaseUrl","exchanges","cacheExchange","retryExchange","maxDelayMs","retryIf","err","networkError","graphQLErrors","some","e","extensions","isTransient","fetchExchange","fetch","wrapFetchWithOffline","wrapFetchWithProxy","wrapFetchWithUserAgent","fetchOptions","getSession","token","getAccessToken","headers","authorization","sessionSecret","promise","data","error","Log","Error"],"mappings":"AAAA;;;;;;;;;;;IA8BaA,aAAa,MAAbA,aAAa;IA2CJC,sBAAsB,MAAtBA,sBAAsB;IAmBnCC,YAAY,MAAZA,KAAY,EAAA,cAAA;;;yBAjFd,YAAY;;;;;;;yBACW,sBAAsB;;;;;;2DAE/B,WAAW;uBACV,mBAAmB;0BACP,aAAa;sCACV,8BAA8B;oCAChC,4BAA4B;wCACxB,gCAAgC;8BAC5B,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAU1D,MAAMF,aAAa,GAAGG,IAAAA,KAAgB,EAAA,aAAA,EAAC;IAC5CC,GAAG,EAAEC,IAAAA,SAAiB,kBAAA,GAAE,GAAG,UAAU;IACrCC,SAAS,EAAE;QACTC,KAAa,EAAA,cAAA;QACbC,IAAAA,cAAa,EAAA,cAAA,EAAC;YACZC,UAAU,EAAE,IAAI;YAChBC,OAAO,EAAE,CAACC,GAAG;gBACX,OAAA,CAAC,CAAC,CAACA,GAAG,IAAI,CAACA,GAAG,CAACC,YAAY,IAAID,GAAG,CAACE,aAAa,CAACC,IAAI,CAAC,CAACC,CAAC;wBAAKA,GAAa;oBAAbA,OAAAA,CAAC,QAAY,GAAbA,KAAAA,CAAa,GAAbA,CAAAA,GAAa,GAAbA,CAAC,CAAEC,UAAU,SAAA,GAAbD,KAAAA,CAAa,GAAbA,GAAa,CAAEE,WAAW,AAAb,CAAa;iBAAA,CAAC,CAAC,CAAC,CAAA;aAAA;SAC7F,CAAC;QACFC,KAAa,EAAA,cAAA;KACd;IACD,wIAAwI;IACxIC,KAAK,EAAEC,IAAAA,qBAAoB,qBAAA,EAACC,IAAAA,mBAAkB,mBAAA,EAACC,IAAAA,uBAAsB,uBAAA,EAACH,MAAK,MAAA,CAAC,CAAC,CAAC;IAC9EI,YAAY,EAAE,IAAyD;YAS/CC,GAAY;QARlC,MAAMC,KAAK,GAAGC,IAAAA,aAAc,eAAA,GAAE,AAAC;QAC/B,IAAID,KAAK,EAAE;YACT,OAAO;gBACLE,OAAO,EAAE;oBACPC,aAAa,EAAE,CAAC,OAAO,EAAEH,KAAK,CAAC,CAAC;iBACjC;aACF,CAAC;QACJ,CAAC;QACD,MAAMI,aAAa,GAAGL,CAAAA,GAAY,GAAZA,IAAAA,aAAU,WAAA,GAAE,SAAe,GAA3BA,KAAAA,CAA2B,GAA3BA,GAAY,CAAEK,aAAa,AAAC;QAClD,IAAIA,aAAa,EAAE;YACjB,OAAO;gBACLF,OAAO,EAAE;oBACP,cAAc,EAAEE,aAAa;iBAC9B;aACF,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAC,AAAkB,AAAC;AAWd,eAAe5B,sBAAsB,CAAI6B,OAAoC,EAAc;IAChG,MAAM,EAAEC,IAAI,CAAA,EAAEC,KAAK,CAAA,EAAE,GAAG,MAAMF,OAAO,AAAC;IAEtC,IAAIE,KAAK,EAAE;QACT,IAAIA,KAAK,CAACnB,aAAa,CAACC,IAAI,CAAC,CAACC,CAAC;gBAAKA,GAAa;YAAbA,OAAAA,CAAC,QAAY,GAAbA,KAAAA,CAAa,GAAbA,CAAAA,GAAa,GAAbA,CAAC,CAAEC,UAAU,SAAA,GAAbD,KAAAA,CAAa,GAAbA,GAAa,CAAEE,WAAW,AAAb,CAAa;SAAA,CAAC,EAAE;YAC/DgB,IAAG,CAACD,KAAK,CAAC,CAAC,8DAA8D,CAAC,CAAC,CAAC;QAC9E,CAAC;QACD,MAAMA,KAAK,CAAC;IACd,CAAC;IAED,iGAAiG;IACjG,gDAAgD;IAChD,IAAI,CAACD,IAAI,EAAE;QACT,MAAM,IAAIG,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAED,OAAOH,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "AppQuery", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get:
|
|
8
|
-
return AppQuery;
|
|
9
|
-
}
|
|
7
|
+
get: ()=>AppQuery
|
|
10
8
|
});
|
|
11
9
|
function _core() {
|
|
12
10
|
const data = require("@urql/core");
|
|
@@ -16,7 +14,7 @@ function _core() {
|
|
|
16
14
|
return data;
|
|
17
15
|
}
|
|
18
16
|
const _client = require("../client");
|
|
19
|
-
const
|
|
17
|
+
const _app = require("../types/App");
|
|
20
18
|
const AppQuery = {
|
|
21
19
|
async byIdAsync (projectId) {
|
|
22
20
|
const data = await (0, _client.withErrorHandlingAsync)(_client.graphqlClient.query((0, _core().gql)`
|
|
@@ -29,12 +27,12 @@ const AppQuery = {
|
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
${
|
|
30
|
+
${_app.AppFragmentNode}
|
|
33
31
|
`, {
|
|
34
32
|
appId: projectId
|
|
35
33
|
}, {
|
|
36
34
|
additionalTypenames: [
|
|
37
|
-
|
|
35
|
+
"App"
|
|
38
36
|
]
|
|
39
37
|
}).toPromise());
|
|
40
38
|
return data.app.byId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/api/graphql/queries/AppQuery.ts"],"sourcesContent":["import { gql } from '@urql/core';\n\nimport { AppByIdQuery } from '../../../graphql/generated';\nimport { graphqlClient, withErrorHandlingAsync } from '../client';\nimport { AppFragmentNode } from '../types/App';\n\nexport const AppQuery = {\n async byIdAsync(projectId: string): Promise<AppByIdQuery['app']['byId']> {\n const data = await withErrorHandlingAsync(\n graphqlClient\n .query<AppByIdQuery>(\n gql`\n query AppByIdQuery($appId: String!) {\n app {\n byId(appId: $appId) {\n id\n ...AppFragment\n }\n }\n }\n\n ${AppFragmentNode}\n `,\n { appId: projectId },\n {\n additionalTypenames: ['App'],\n }\n )\n .toPromise()\n );\n return data.app.byId;\n },\n};\n"],"names":["AppQuery","byIdAsync","projectId","data","withErrorHandlingAsync","graphqlClient","query","gql","AppFragmentNode","appId","additionalTypenames","toPromise","app","byId"],"mappings":";;;;+BAMaA;;;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/api/graphql/queries/AppQuery.ts"],"sourcesContent":["import { gql } from '@urql/core';\n\nimport { AppByIdQuery } from '../../../graphql/generated';\nimport { graphqlClient, withErrorHandlingAsync } from '../client';\nimport { AppFragmentNode } from '../types/App';\n\nexport const AppQuery = {\n async byIdAsync(projectId: string): Promise<AppByIdQuery['app']['byId']> {\n const data = await withErrorHandlingAsync(\n graphqlClient\n .query<AppByIdQuery>(\n gql`\n query AppByIdQuery($appId: String!) {\n app {\n byId(appId: $appId) {\n id\n ...AppFragment\n }\n }\n }\n\n ${AppFragmentNode}\n `,\n { appId: projectId },\n {\n additionalTypenames: ['App'],\n }\n )\n .toPromise()\n );\n return data.app.byId;\n },\n};\n"],"names":["AppQuery","byIdAsync","projectId","data","withErrorHandlingAsync","graphqlClient","query","gql","AppFragmentNode","appId","additionalTypenames","toPromise","app","byId"],"mappings":"AAAA;;;;+BAMaA,UAAQ;;aAARA,QAAQ;;;yBAND,YAAY;;;;;;wBAGsB,WAAW;qBACjC,cAAc;AAEvC,MAAMA,QAAQ,GAAG;IACtB,MAAMC,SAAS,EAACC,SAAiB,EAAwC;QACvE,MAAMC,IAAI,GAAG,MAAMC,IAAAA,OAAsB,uBAAA,EACvCC,OAAa,cAAA,CACVC,KAAK,CACJC,IAAAA,KAAG,EAAA,IAAA,CAAA,CAAC;;;;;;;;;;YAUF,EAAEC,IAAe,gBAAA,CAAC;UACpB,CAAC,EACD;YAAEC,KAAK,EAAEP,SAAS;SAAE,EACpB;YACEQ,mBAAmB,EAAE;gBAAC,KAAK;aAAC;SAC7B,CACF,CACAC,SAAS,EAAE,CACf,AAAC;QACF,OAAOR,IAAI,CAACS,GAAG,CAACC,IAAI,CAAC;IACvB,CAAC;CACF,AAAC"}
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "UserQuery", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get:
|
|
8
|
-
return UserQuery;
|
|
9
|
-
}
|
|
7
|
+
get: ()=>UserQuery
|
|
10
8
|
});
|
|
11
9
|
function _core() {
|
|
12
10
|
const data = require("@urql/core");
|
|
@@ -45,8 +43,8 @@ const UserQuery = {
|
|
|
45
43
|
}
|
|
46
44
|
`, /* variables */ undefined, {
|
|
47
45
|
additionalTypenames: [
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
"User",
|
|
47
|
+
"SSOUser"
|
|
50
48
|
]
|
|
51
49
|
}).toPromise());
|
|
52
50
|
return data.meActor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/api/graphql/queries/UserQuery.ts"],"sourcesContent":["import { gql } from '@urql/core';\n\nimport { CurrentUserQuery } from '../../../graphql/generated';\nimport { graphqlClient, withErrorHandlingAsync } from '../client';\n\nexport const UserQuery = {\n async currentUserAsync(): Promise<CurrentUserQuery['meActor']> {\n const data = await withErrorHandlingAsync(\n graphqlClient\n .query<CurrentUserQuery>(\n gql`\n query CurrentUser {\n meActor {\n __typename\n id\n ... on UserActor {\n primaryAccount {\n id\n }\n username\n }\n ... on Robot {\n firstName\n }\n accounts {\n id\n users {\n actor {\n id\n }\n permissions\n }\n }\n }\n }\n `,\n /* variables */ undefined,\n {\n additionalTypenames: ['User', 'SSOUser'],\n }\n )\n .toPromise()\n );\n\n return data.meActor;\n },\n};\n"],"names":["UserQuery","currentUserAsync","data","withErrorHandlingAsync","graphqlClient","query","gql","undefined","additionalTypenames","toPromise","meActor"],"mappings":";;;;+BAKaA;;;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/api/graphql/queries/UserQuery.ts"],"sourcesContent":["import { gql } from '@urql/core';\n\nimport { CurrentUserQuery } from '../../../graphql/generated';\nimport { graphqlClient, withErrorHandlingAsync } from '../client';\n\nexport const UserQuery = {\n async currentUserAsync(): Promise<CurrentUserQuery['meActor']> {\n const data = await withErrorHandlingAsync(\n graphqlClient\n .query<CurrentUserQuery>(\n gql`\n query CurrentUser {\n meActor {\n __typename\n id\n ... on UserActor {\n primaryAccount {\n id\n }\n username\n }\n ... on Robot {\n firstName\n }\n accounts {\n id\n users {\n actor {\n id\n }\n permissions\n }\n }\n }\n }\n `,\n /* variables */ undefined,\n {\n additionalTypenames: ['User', 'SSOUser'],\n }\n )\n .toPromise()\n );\n\n return data.meActor;\n },\n};\n"],"names":["UserQuery","currentUserAsync","data","withErrorHandlingAsync","graphqlClient","query","gql","undefined","additionalTypenames","toPromise","meActor"],"mappings":"AAAA;;;;+BAKaA,WAAS;;aAATA,SAAS;;;yBALF,YAAY;;;;;;wBAGsB,WAAW;AAE1D,MAAMA,SAAS,GAAG;IACvB,MAAMC,gBAAgB,IAAyC;QAC7D,MAAMC,IAAI,GAAG,MAAMC,IAAAA,OAAsB,uBAAA,EACvCC,OAAa,cAAA,CACVC,KAAK,CACJC,IAAAA,KAAG,EAAA,IAAA,CAAA,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;UAyBJ,CAAC,EACD,aAAa,GAAGC,SAAS,EACzB;YACEC,mBAAmB,EAAE;gBAAC,MAAM;gBAAE,SAAS;aAAC;SACzC,CACF,CACAC,SAAS,EAAE,CACf,AAAC;QAEF,OAAOP,IAAI,CAACQ,OAAO,CAAC;IACtB,CAAC;CACF,AAAC"}
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "AppFragmentNode", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get:
|
|
8
|
-
return AppFragmentNode;
|
|
9
|
-
}
|
|
7
|
+
get: ()=>AppFragmentNode
|
|
10
8
|
});
|
|
11
9
|
function _core() {
|
|
12
10
|
const data = require("@urql/core");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/api/graphql/types/App.ts"],"sourcesContent":["import { TypedDocumentNode, gql } from '@urql/core';\n\nexport const AppFragmentNode: TypedDocumentNode = gql`\n fragment AppFragment on App {\n id\n scopeKey\n ownerAccount {\n id\n }\n }\n`;\n"],"names":["AppFragmentNode","gql"],"mappings":";;;;+BAEaA;;;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/api/graphql/types/App.ts"],"sourcesContent":["import { TypedDocumentNode, gql } from '@urql/core';\n\nexport const AppFragmentNode: TypedDocumentNode = gql`\n fragment AppFragment on App {\n id\n scopeKey\n ownerAccount {\n id\n }\n }\n`;\n"],"names":["AppFragmentNode","gql"],"mappings":"AAAA;;;;+BAEaA,iBAAe;;aAAfA,eAAe;;;yBAFW,YAAY;;;;;;AAE5C,MAAMA,eAAe,GAAsBC,IAAAA,KAAG,EAAA,IAAA,CAAA,CAAC;;;;;;;;AAQtD,CAAC,AAAC"}
|
|
@@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "FileSystemResponseCache", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get:
|
|
8
|
-
return FileSystemResponseCache;
|
|
9
|
-
}
|
|
7
|
+
get: ()=>FileSystemResponseCache
|
|
10
8
|
});
|
|
11
9
|
function _cacache() {
|
|
12
|
-
const data = /*#__PURE__*/
|
|
10
|
+
const data = /*#__PURE__*/ _interopRequireDefault(require("cacache"));
|
|
13
11
|
_cacache = function() {
|
|
14
12
|
return data;
|
|
15
13
|
};
|
|
@@ -22,7 +20,7 @@ function _stream() {
|
|
|
22
20
|
};
|
|
23
21
|
return data;
|
|
24
22
|
}
|
|
25
|
-
function
|
|
23
|
+
function _interopRequireDefault(obj) {
|
|
26
24
|
return obj && obj.__esModule ? obj : {
|
|
27
25
|
default: obj
|
|
28
26
|
};
|
|
@@ -42,7 +40,7 @@ class FileSystemResponseCache {
|
|
|
42
40
|
const responseInfoBuffer = await _cacache().default.get.byDigest(this.cacheDirectory, responseInfoMeta.integrity);
|
|
43
41
|
const responseInfo = JSON.parse(responseInfoBuffer.toString());
|
|
44
42
|
// Remove cache-specific data from the response info
|
|
45
|
-
const { empty, expiration, bodyIntegrity
|
|
43
|
+
const { empty , expiration , bodyIntegrity } = responseInfo;
|
|
46
44
|
delete responseInfo.empty;
|
|
47
45
|
delete responseInfo.expiration;
|
|
48
46
|
delete responseInfo.bodyIntegrity;
|
|
@@ -65,16 +63,16 @@ class FileSystemResponseCache {
|
|
|
65
63
|
...response.info
|
|
66
64
|
};
|
|
67
65
|
// Add expiration time if the "time to live" is set
|
|
68
|
-
if (typeof this.timeToLive ===
|
|
66
|
+
if (typeof this.timeToLive === "number") {
|
|
69
67
|
responseInfo.expiration = Date.now() + this.timeToLive;
|
|
70
68
|
}
|
|
71
69
|
try {
|
|
72
70
|
// Store the response body as stream, and calculate the stream integrity
|
|
73
71
|
responseInfo.bodyIntegrity = await new Promise((fulfill, reject)=>{
|
|
74
|
-
_stream().Readable.fromWeb(response.body).pipe(_cacache().default.put.stream(this.cacheDirectory, responseBodyKey)).on(
|
|
72
|
+
_stream().Readable.fromWeb(response.body).pipe(_cacache().default.put.stream(this.cacheDirectory, responseBodyKey)).on("integrity", (integrity)=>fulfill(integrity)).once("error", reject);
|
|
75
73
|
});
|
|
76
74
|
} catch (error) {
|
|
77
|
-
if (error.code !==
|
|
75
|
+
if (error.code !== "ENODATA") {
|
|
78
76
|
throw error;
|
|
79
77
|
}
|
|
80
78
|
// Mark the response as empty
|
|
@@ -89,7 +87,7 @@ class FileSystemResponseCache {
|
|
|
89
87
|
/** Remove the response from caching */ async remove(cacheKey) {
|
|
90
88
|
await Promise.all([
|
|
91
89
|
_cacache().default.rm.entry(this.cacheDirectory, getResponseBodyKey(cacheKey)),
|
|
92
|
-
_cacache().default.rm.entry(this.cacheDirectory, getResponseBodyKey(cacheKey))
|
|
90
|
+
_cacache().default.rm.entry(this.cacheDirectory, getResponseBodyKey(cacheKey)),
|
|
93
91
|
]);
|
|
94
92
|
}
|
|
95
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/api/rest/cache/FileSystemResponseCache.ts"],"sourcesContent":["import cacache from 'cacache';\nimport { Readable } from 'stream';\n\nimport type { ResponseCache, ResponseCacheEntry } from './ResponseCache';\n\ntype FileSystemResponseCacheInfo = ResponseCacheEntry['info'] & {\n /** Stream integrity used to validate the local body response */\n bodyIntegrity?: string;\n /** If there is no response body */\n empty?: boolean;\n /** The expiration time, in seconds, when the response should be invalidated */\n expiration?: number;\n};\n\nexport class FileSystemResponseCache implements ResponseCache {\n /** The absolute path to the directory used to store responses */\n private cacheDirectory: string;\n /** Optional auto-expiration for all stored response */\n private timeToLive?: number;\n\n constructor(options: { cacheDirectory: string; ttl?: number }) {\n this.cacheDirectory = options.cacheDirectory;\n this.timeToLive = options.ttl;\n }\n\n /** Retrieve the cache response, if any */\n async get(cacheKey: string): Promise<ResponseCacheEntry | undefined> {\n const responseInfoKey = getResponseInfoKey(cacheKey);\n const responseInfoMeta = await cacache.get.info(this.cacheDirectory, responseInfoKey);\n\n // Abort if the response info is not found\n if (!responseInfoMeta) {\n return undefined;\n }\n\n const responseInfoBuffer = await cacache.get.byDigest(\n this.cacheDirectory,\n responseInfoMeta.integrity\n );\n const responseInfo: FileSystemResponseCacheInfo = JSON.parse(responseInfoBuffer.toString());\n\n // Remove cache-specific data from the response info\n const { empty, expiration, bodyIntegrity } = responseInfo;\n delete responseInfo.empty;\n delete responseInfo.expiration;\n delete responseInfo.bodyIntegrity;\n\n // Invalidate the response if it has expired, or there is no known body integrity\n if (!bodyIntegrity || (expiration && expiration < Date.now())) {\n return undefined;\n }\n\n // Create a read-stream for the response body\n const responseBody = empty\n ? Readable.from(Buffer.alloc(0))\n : Readable.from(cacache.get.stream.byDigest(this.cacheDirectory, bodyIntegrity));\n\n return {\n body: Readable.toWeb(responseBody),\n info: responseInfo,\n };\n }\n\n /** Store the response for caching */\n async set(\n cacheKey: string,\n response: ResponseCacheEntry\n ): Promise<ResponseCacheEntry | undefined> {\n const responseBodyKey = getResponseBodyKey(cacheKey);\n const responseInfoKey = getResponseInfoKey(cacheKey);\n\n // Create a copy of the response info, to add cache-specific data\n const responseInfo: FileSystemResponseCacheInfo = { ...response.info };\n\n // Add expiration time if the \"time to live\" is set\n if (typeof this.timeToLive === 'number') {\n responseInfo.expiration = Date.now() + this.timeToLive;\n }\n\n try {\n // Store the response body as stream, and calculate the stream integrity\n responseInfo.bodyIntegrity = await new Promise((fulfill, reject) => {\n Readable.fromWeb(response.body)\n .pipe(cacache.put.stream(this.cacheDirectory, responseBodyKey))\n .on('integrity', (integrity) => fulfill(integrity))\n .once('error', reject);\n });\n } catch (error: any) {\n if (error.code !== 'ENODATA') {\n throw error;\n }\n\n // Mark the response as empty\n responseInfo.empty = true;\n responseInfo.bodyIntegrity = undefined;\n }\n\n // Store the response info\n const responseInfoBuffer = Buffer.from(JSON.stringify(responseInfo));\n await cacache.put(this.cacheDirectory, responseInfoKey, responseInfoBuffer);\n\n return await this.get(cacheKey);\n }\n\n /** Remove the response from caching */\n async remove(cacheKey: string): Promise<void> {\n await Promise.all([\n cacache.rm.entry(this.cacheDirectory, getResponseBodyKey(cacheKey)),\n cacache.rm.entry(this.cacheDirectory, getResponseBodyKey(cacheKey)),\n ]);\n }\n}\n\nfunction getResponseBodyKey(cacheKey: string) {\n return `${cacheKey}UndiciBody`;\n}\n\nfunction getResponseInfoKey(cacheKey: string) {\n return `${cacheKey}UndiciInfo`;\n}\n"],"names":["FileSystemResponseCache","constructor","options","cacheDirectory","timeToLive","ttl","get","cacheKey","responseInfoKey","getResponseInfoKey","responseInfoMeta","cacache","info","undefined","responseInfoBuffer","byDigest","integrity","responseInfo","JSON","parse","toString","empty","expiration","bodyIntegrity","Date","now","responseBody","Readable","from","Buffer","alloc","stream","body","toWeb","set","response","responseBodyKey","getResponseBodyKey","Promise","fulfill","reject","fromWeb","pipe","put","on","once","error","code","stringify","remove","all","rm","entry"],"mappings":";;;;+BAcaA;;;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/api/rest/cache/FileSystemResponseCache.ts"],"sourcesContent":["import cacache from 'cacache';\nimport { Readable } from 'stream';\n\nimport type { ResponseCache, ResponseCacheEntry } from './ResponseCache';\n\ntype FileSystemResponseCacheInfo = ResponseCacheEntry['info'] & {\n /** Stream integrity used to validate the local body response */\n bodyIntegrity?: string;\n /** If there is no response body */\n empty?: boolean;\n /** The expiration time, in seconds, when the response should be invalidated */\n expiration?: number;\n};\n\nexport class FileSystemResponseCache implements ResponseCache {\n /** The absolute path to the directory used to store responses */\n private cacheDirectory: string;\n /** Optional auto-expiration for all stored response */\n private timeToLive?: number;\n\n constructor(options: { cacheDirectory: string; ttl?: number }) {\n this.cacheDirectory = options.cacheDirectory;\n this.timeToLive = options.ttl;\n }\n\n /** Retrieve the cache response, if any */\n async get(cacheKey: string): Promise<ResponseCacheEntry | undefined> {\n const responseInfoKey = getResponseInfoKey(cacheKey);\n const responseInfoMeta = await cacache.get.info(this.cacheDirectory, responseInfoKey);\n\n // Abort if the response info is not found\n if (!responseInfoMeta) {\n return undefined;\n }\n\n const responseInfoBuffer = await cacache.get.byDigest(\n this.cacheDirectory,\n responseInfoMeta.integrity\n );\n const responseInfo: FileSystemResponseCacheInfo = JSON.parse(responseInfoBuffer.toString());\n\n // Remove cache-specific data from the response info\n const { empty, expiration, bodyIntegrity } = responseInfo;\n delete responseInfo.empty;\n delete responseInfo.expiration;\n delete responseInfo.bodyIntegrity;\n\n // Invalidate the response if it has expired, or there is no known body integrity\n if (!bodyIntegrity || (expiration && expiration < Date.now())) {\n return undefined;\n }\n\n // Create a read-stream for the response body\n const responseBody = empty\n ? Readable.from(Buffer.alloc(0))\n : Readable.from(cacache.get.stream.byDigest(this.cacheDirectory, bodyIntegrity));\n\n return {\n body: Readable.toWeb(responseBody),\n info: responseInfo,\n };\n }\n\n /** Store the response for caching */\n async set(\n cacheKey: string,\n response: ResponseCacheEntry\n ): Promise<ResponseCacheEntry | undefined> {\n const responseBodyKey = getResponseBodyKey(cacheKey);\n const responseInfoKey = getResponseInfoKey(cacheKey);\n\n // Create a copy of the response info, to add cache-specific data\n const responseInfo: FileSystemResponseCacheInfo = { ...response.info };\n\n // Add expiration time if the \"time to live\" is set\n if (typeof this.timeToLive === 'number') {\n responseInfo.expiration = Date.now() + this.timeToLive;\n }\n\n try {\n // Store the response body as stream, and calculate the stream integrity\n responseInfo.bodyIntegrity = await new Promise((fulfill, reject) => {\n Readable.fromWeb(response.body)\n .pipe(cacache.put.stream(this.cacheDirectory, responseBodyKey))\n .on('integrity', (integrity) => fulfill(integrity))\n .once('error', reject);\n });\n } catch (error: any) {\n if (error.code !== 'ENODATA') {\n throw error;\n }\n\n // Mark the response as empty\n responseInfo.empty = true;\n responseInfo.bodyIntegrity = undefined;\n }\n\n // Store the response info\n const responseInfoBuffer = Buffer.from(JSON.stringify(responseInfo));\n await cacache.put(this.cacheDirectory, responseInfoKey, responseInfoBuffer);\n\n return await this.get(cacheKey);\n }\n\n /** Remove the response from caching */\n async remove(cacheKey: string): Promise<void> {\n await Promise.all([\n cacache.rm.entry(this.cacheDirectory, getResponseBodyKey(cacheKey)),\n cacache.rm.entry(this.cacheDirectory, getResponseBodyKey(cacheKey)),\n ]);\n }\n}\n\nfunction getResponseBodyKey(cacheKey: string) {\n return `${cacheKey}UndiciBody`;\n}\n\nfunction getResponseInfoKey(cacheKey: string) {\n return `${cacheKey}UndiciInfo`;\n}\n"],"names":["FileSystemResponseCache","constructor","options","cacheDirectory","timeToLive","ttl","get","cacheKey","responseInfoKey","getResponseInfoKey","responseInfoMeta","cacache","info","undefined","responseInfoBuffer","byDigest","integrity","responseInfo","JSON","parse","toString","empty","expiration","bodyIntegrity","Date","now","responseBody","Readable","from","Buffer","alloc","stream","body","toWeb","set","response","responseBodyKey","getResponseBodyKey","Promise","fulfill","reject","fromWeb","pipe","put","on","once","error","code","stringify","remove","all","rm","entry"],"mappings":"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"}
|
|
@@ -9,21 +9,13 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return getRequestCacheKey;
|
|
17
|
-
},
|
|
18
|
-
getRequestInfoCacheData: function() {
|
|
19
|
-
return getRequestInfoCacheData;
|
|
20
|
-
},
|
|
21
|
-
getResponseInfo: function() {
|
|
22
|
-
return getResponseInfo;
|
|
23
|
-
}
|
|
12
|
+
getResponseInfo: ()=>getResponseInfo,
|
|
13
|
+
getRequestCacheKey: ()=>getRequestCacheKey,
|
|
14
|
+
getRequestInfoCacheData: ()=>getRequestInfoCacheData,
|
|
15
|
+
getRequestBodyCacheData: ()=>getRequestBodyCacheData
|
|
24
16
|
});
|
|
25
17
|
function _crypto() {
|
|
26
|
-
const data = /*#__PURE__*/
|
|
18
|
+
const data = /*#__PURE__*/ _interopRequireDefault(require("crypto"));
|
|
27
19
|
_crypto = function() {
|
|
28
20
|
return data;
|
|
29
21
|
};
|
|
@@ -36,7 +28,7 @@ function _fs() {
|
|
|
36
28
|
};
|
|
37
29
|
return data;
|
|
38
30
|
}
|
|
39
|
-
function
|
|
31
|
+
function _interopRequireDefault(obj) {
|
|
40
32
|
return obj && obj.__esModule ? obj : {
|
|
41
33
|
default: obj
|
|
42
34
|
};
|
|
@@ -55,14 +47,14 @@ function getRequestCacheKey(info, init) {
|
|
|
55
47
|
const initKeyData = {
|
|
56
48
|
body: (init == null ? void 0 : init.body) ? getRequestBodyCacheData(init.body) : undefined
|
|
57
49
|
};
|
|
58
|
-
return _crypto().default.createHash(
|
|
50
|
+
return _crypto().default.createHash("md5").update(JSON.stringify([
|
|
59
51
|
infoKeyData,
|
|
60
52
|
initKeyData,
|
|
61
53
|
GLOBAL_CACHE_VERSION
|
|
62
|
-
])).digest(
|
|
54
|
+
])).digest("hex");
|
|
63
55
|
}
|
|
64
56
|
function getRequestInfoCacheData(info) {
|
|
65
|
-
if (typeof info ===
|
|
57
|
+
if (typeof info === "string") {
|
|
66
58
|
return {
|
|
67
59
|
url: info
|
|
68
60
|
};
|
|
@@ -86,13 +78,13 @@ function getRequestInfoCacheData(info) {
|
|
|
86
78
|
url: info.url.toString()
|
|
87
79
|
};
|
|
88
80
|
}
|
|
89
|
-
throw new Error(
|
|
81
|
+
throw new Error("Unsupported request info type for caching: " + typeof info);
|
|
90
82
|
}
|
|
91
83
|
function getRequestBodyCacheData(body) {
|
|
92
84
|
if (!body) {
|
|
93
85
|
return body;
|
|
94
86
|
}
|
|
95
|
-
if (typeof body ===
|
|
87
|
+
if (typeof body === "string") {
|
|
96
88
|
return body;
|
|
97
89
|
}
|
|
98
90
|
if (body instanceof URLSearchParams) {
|
|
@@ -102,7 +94,7 @@ function getRequestBodyCacheData(body) {
|
|
|
102
94
|
if (body instanceof _fs().ReadStream) {
|
|
103
95
|
return body.path;
|
|
104
96
|
}
|
|
105
|
-
if (body.toString && body.toString() ===
|
|
97
|
+
if (body.toString && body.toString() === "[object FormData]") {
|
|
106
98
|
return new URLSearchParams(body).toString();
|
|
107
99
|
}
|
|
108
100
|
if (body instanceof Buffer) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/api/rest/cache/ResponseCache.ts"],"sourcesContent":["import crypto from 'crypto';\nimport { ReadStream } from 'fs';\nimport type { Response, RequestInfo, RequestInit } from 'undici';\n\nconst GLOBAL_CACHE_VERSION = 4;\n\nexport type ResponseCacheEntry = {\n body: import('stream/web').ReadableStream;\n info: ReturnType<typeof getResponseInfo>;\n};\n\nexport interface ResponseCache {\n /** Load the response info from cache, if any */\n get(cacheKey: string): Promise<ResponseCacheEntry | undefined>;\n /** Store the response info to cache, and return the cached info */\n set(cacheKey: string, response: ResponseCacheEntry): Promise<ResponseCacheEntry | undefined>;\n /** Remove a response entry from the cache */\n remove(cacheKey: string): Promise<void>;\n}\n\nexport function getResponseInfo(response: Response) {\n return {\n url: response.url,\n status: response.status,\n statusText: response.statusText,\n headers: Object.fromEntries(response.headers.entries()),\n };\n}\n\nexport function getRequestCacheKey(info: RequestInfo, init?: RequestInit) {\n const infoKeyData = getRequestInfoCacheData(info);\n const initKeyData = { body: init?.body ? getRequestBodyCacheData(init.body) : undefined };\n\n return crypto\n .createHash('md5')\n .update(JSON.stringify([infoKeyData, initKeyData, GLOBAL_CACHE_VERSION]))\n .digest('hex');\n}\n\n/** @internal Exposed for testing */\nexport function getRequestInfoCacheData(info: RequestInfo) {\n if (typeof info === 'string') {\n return { url: info };\n }\n\n if (info instanceof URL) {\n return { url: info.toString() };\n }\n\n if (info instanceof Request) {\n return {\n // cache: req.cache,\n credentials: info.credentials.toString(),\n destination: info.destination.toString(),\n headers: Object.fromEntries(info.headers.entries()),\n integrity: info.integrity,\n method: info.method,\n redirect: info.redirect,\n referrer: info.referrer,\n referrerPolicy: info.referrerPolicy,\n url: info.url.toString(),\n // body: // TODO\n };\n }\n\n throw new Error('Unsupported request info type for caching: ' + typeof info);\n}\n\n/** @internal Exposed for testing */\nexport function getRequestBodyCacheData(body: RequestInit['body']) {\n if (!body) {\n return body;\n }\n\n if (typeof body === 'string') {\n return body;\n }\n\n if (body instanceof URLSearchParams) {\n return body.toString();\n }\n\n // Supported for legacy purposes because node-fetch uses fs.readStream\n if (body instanceof ReadStream) {\n return body.path;\n }\n\n if (body.toString && body.toString() === '[object FormData]') {\n return new URLSearchParams(body as any).toString();\n }\n\n if (body instanceof Buffer) {\n return body.toString();\n }\n\n throw new Error(`Unsupported request body type for caching: ${typeof body}`);\n}\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../../../src/api/rest/cache/ResponseCache.ts"],"sourcesContent":["import crypto from 'crypto';\nimport { ReadStream } from 'fs';\nimport type { Response, RequestInfo, RequestInit } from 'undici';\n\nconst GLOBAL_CACHE_VERSION = 4;\n\nexport type ResponseCacheEntry = {\n body: import('stream/web').ReadableStream;\n info: ReturnType<typeof getResponseInfo>;\n};\n\nexport interface ResponseCache {\n /** Load the response info from cache, if any */\n get(cacheKey: string): Promise<ResponseCacheEntry | undefined>;\n /** Store the response info to cache, and return the cached info */\n set(cacheKey: string, response: ResponseCacheEntry): Promise<ResponseCacheEntry | undefined>;\n /** Remove a response entry from the cache */\n remove(cacheKey: string): Promise<void>;\n}\n\nexport function getResponseInfo(response: Response) {\n return {\n url: response.url,\n status: response.status,\n statusText: response.statusText,\n headers: Object.fromEntries(response.headers.entries()),\n };\n}\n\nexport function getRequestCacheKey(info: RequestInfo, init?: RequestInit) {\n const infoKeyData = getRequestInfoCacheData(info);\n const initKeyData = { body: init?.body ? getRequestBodyCacheData(init.body) : undefined };\n\n return crypto\n .createHash('md5')\n .update(JSON.stringify([infoKeyData, initKeyData, GLOBAL_CACHE_VERSION]))\n .digest('hex');\n}\n\n/** @internal Exposed for testing */\nexport function getRequestInfoCacheData(info: RequestInfo) {\n if (typeof info === 'string') {\n return { url: info };\n }\n\n if (info instanceof URL) {\n return { url: info.toString() };\n }\n\n if (info instanceof Request) {\n return {\n // cache: req.cache,\n credentials: info.credentials.toString(),\n destination: info.destination.toString(),\n headers: Object.fromEntries(info.headers.entries()),\n integrity: info.integrity,\n method: info.method,\n redirect: info.redirect,\n referrer: info.referrer,\n referrerPolicy: info.referrerPolicy,\n url: info.url.toString(),\n // body: // TODO\n };\n }\n\n throw new Error('Unsupported request info type for caching: ' + typeof info);\n}\n\n/** @internal Exposed for testing */\nexport function getRequestBodyCacheData(body: RequestInit['body']) {\n if (!body) {\n return body;\n }\n\n if (typeof body === 'string') {\n return body;\n }\n\n if (body instanceof URLSearchParams) {\n return body.toString();\n }\n\n // Supported for legacy purposes because node-fetch uses fs.readStream\n if (body instanceof ReadStream) {\n return body.path;\n }\n\n if (body.toString && body.toString() === '[object FormData]') {\n return new URLSearchParams(body as any).toString();\n }\n\n if (body instanceof Buffer) {\n return body.toString();\n }\n\n throw new Error(`Unsupported request body type for caching: ${typeof body}`);\n}\n"],"names":["getResponseInfo","getRequestCacheKey","getRequestInfoCacheData","getRequestBodyCacheData","GLOBAL_CACHE_VERSION","response","url","status","statusText","headers","Object","fromEntries","entries","info","init","infoKeyData","initKeyData","body","undefined","crypto","createHash","update","JSON","stringify","digest","URL","toString","Request","credentials","destination","integrity","method","redirect","referrer","referrerPolicy","Error","URLSearchParams","ReadStream","path","Buffer"],"mappings":"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"}
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "wrapFetchWithCache", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get:
|
|
8
|
-
return wrapFetchWithCache;
|
|
9
|
-
}
|
|
7
|
+
get: ()=>wrapFetchWithCache
|
|
10
8
|
});
|
|
11
9
|
function _undici() {
|
|
12
10
|
const data = require("undici");
|
|
@@ -15,11 +13,11 @@ function _undici() {
|
|
|
15
13
|
};
|
|
16
14
|
return data;
|
|
17
15
|
}
|
|
18
|
-
const
|
|
19
|
-
const debug = require(
|
|
16
|
+
const _responseCache = require("./ResponseCache");
|
|
17
|
+
const debug = require("debug")("expo:undici-cache");
|
|
20
18
|
function wrapFetchWithCache(fetch, cache) {
|
|
21
19
|
return async function cachedFetch(url, init) {
|
|
22
|
-
const cacheKey = (0,
|
|
20
|
+
const cacheKey = (0, _responseCache.getRequestCacheKey)(url, init);
|
|
23
21
|
const cachedResponse = await cache.get(cacheKey);
|
|
24
22
|
if (cachedResponse) {
|
|
25
23
|
return new (_undici()).Response(cachedResponse.body, cachedResponse.info);
|
|
@@ -27,9 +25,9 @@ function wrapFetchWithCache(fetch, cache) {
|
|
|
27
25
|
await lock(cacheKey);
|
|
28
26
|
try {
|
|
29
27
|
// Retry loading from cache, in case it was stored during the lock
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
32
|
-
return new (_undici()).Response(
|
|
28
|
+
let cachedResponse1 = await cache.get(cacheKey);
|
|
29
|
+
if (cachedResponse1) {
|
|
30
|
+
return new (_undici()).Response(cachedResponse1.body, cachedResponse1.info);
|
|
33
31
|
}
|
|
34
32
|
// Execute the fetch request
|
|
35
33
|
const response = await fetch(url, init);
|
|
@@ -37,18 +35,18 @@ function wrapFetchWithCache(fetch, cache) {
|
|
|
37
35
|
return response;
|
|
38
36
|
}
|
|
39
37
|
// Cache the response
|
|
40
|
-
|
|
38
|
+
cachedResponse1 = await cache.set(cacheKey, {
|
|
41
39
|
body: response.body,
|
|
42
|
-
info: (0,
|
|
40
|
+
info: (0, _responseCache.getResponseInfo)(response)
|
|
43
41
|
});
|
|
44
42
|
// Warn through debug logs that caching failed
|
|
45
|
-
if (!
|
|
43
|
+
if (!cachedResponse1) {
|
|
46
44
|
debug(`Failed to cache response for: ${url}`);
|
|
47
45
|
await cache.remove(cacheKey);
|
|
48
46
|
return response;
|
|
49
47
|
}
|
|
50
48
|
// Return the cached response
|
|
51
|
-
return new (_undici()).Response(
|
|
49
|
+
return new (_undici()).Response(cachedResponse1.body, cachedResponse1.info);
|
|
52
50
|
} finally{
|
|
53
51
|
unlock(cacheKey);
|
|
54
52
|
}
|