peachsim 0.1.1716 → 0.1.1738

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.
Files changed (282) hide show
  1. package/README.md +21 -3
  2. package/cli/app-bundle-resources.ts +2 -1
  3. package/cli/app-fonts.ts +4 -4
  4. package/cli/app-splash.ts +4 -4
  5. package/cli/app-stubs.ts +17 -0
  6. package/cli/command-registry.ts +1 -0
  7. package/cli/commands/control.ts +83 -822
  8. package/cli/commands/coverage-swift.ts +112 -4
  9. package/cli/commands/daemon.ts +8 -0
  10. package/cli/commands/detox.ts +3 -0
  11. package/cli/commands/doctor.ts +19 -2
  12. package/cli/commands/inspect/actions.ts +74 -14
  13. package/cli/commands/inspect/core.ts +5 -1
  14. package/cli/commands/inspect/settling.ts +5 -2
  15. package/cli/commands/inspect/wait-ready.ts +6 -0
  16. package/cli/commands/inspect.ts +48 -45
  17. package/cli/commands/kotlin.ts +12 -2
  18. package/cli/commands/package.ts +760 -0
  19. package/cli/commands/serve.ts +6 -0
  20. package/cli/commands/shell-url.ts +838 -0
  21. package/cli/commands/swift.ts +42 -102
  22. package/cli/commands/test.ts +20 -0
  23. package/cli/commands/upload.ts +1 -1
  24. package/cli/device-option.ts +1 -1
  25. package/cli/main.ts +13 -1
  26. package/cli/native-input.ts +199 -0
  27. package/cli/outbound-endpoints.ts +26 -1
  28. package/cli/packaged-app-launcher.ts +95 -0
  29. package/cli/scene-video.ts +36 -12
  30. package/detox/index.ts +196 -24
  31. package/dist-lib/agent-daemon-client.cjs +1 -1
  32. package/dist-lib/agent-events.cjs +1 -1
  33. package/dist-lib/attached-projects.cjs +5 -2
  34. package/dist-lib/auth/shared-session.cjs +5 -2
  35. package/dist-lib/backend-origin.cjs +1 -1
  36. package/dist-lib/beta.cjs +1 -1
  37. package/dist-lib/beta.mjs +1 -1
  38. package/dist-lib/bridge-constants.cjs +1 -1
  39. package/dist-lib/bridge-contract-input.cjs +1 -1
  40. package/dist-lib/bridge-contract-input.mjs +1 -1
  41. package/dist-lib/bridge-contract.cjs +1 -1
  42. package/dist-lib/bridge-contract.mjs +1 -1
  43. package/dist-lib/bundle-channel.cjs +39889 -31873
  44. package/dist-lib/capture-contract.cjs +1 -1
  45. package/dist-lib/capture-contract.mjs +1 -1
  46. package/dist-lib/cloud-contract.cjs +1 -1
  47. package/dist-lib/cloud-contract.mjs +1 -1
  48. package/dist-lib/cloud-test-args.cjs +1 -1
  49. package/dist-lib/cloud-test-args.mjs +1 -1
  50. package/dist-lib/cloud.cjs +1 -1
  51. package/dist-lib/cloud.mjs +1 -1
  52. package/dist-lib/config.cjs +1 -1
  53. package/dist-lib/config.mjs +1 -1
  54. package/dist-lib/detox/index.cjs +195 -63
  55. package/dist-lib/dev-bundle-resolution.cjs +14 -13
  56. package/dist-lib/expo-swift-bundle.cjs +18507 -11835
  57. package/dist-lib/expo-swift-metadata.cjs +4 -1
  58. package/dist-lib/expo-swift-metadata.mjs +3 -1
  59. package/dist-lib/home-paths.cjs +27 -3
  60. package/dist-lib/host/bridge-host.cjs +28373 -24090
  61. package/dist-lib/host/fetch-proxy-handler.cjs +235 -225
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +915 -399
  67. package/dist-lib/jump-to-source-babel.cjs +1 -1
  68. package/dist-lib/jump-to-source-native.cjs +1 -1
  69. package/dist-lib/kotlin-host.cjs +335 -47
  70. package/dist-lib/menu.cjs +13 -1
  71. package/dist-lib/menu.mjs +13 -1
  72. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  73. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  74. package/dist-lib/metro-production-bundle.cjs +1 -1
  75. package/dist-lib/metro-production-bundle.mjs +1 -1
  76. package/dist-lib/metro.cjs +918 -411
  77. package/dist-lib/native-app-identity-project.cjs +703 -283
  78. package/dist-lib/native-app-identity-project.mjs +500 -87
  79. package/dist-lib/native-app-identity.cjs +13 -2
  80. package/dist-lib/native-app-identity.mjs +13 -2
  81. package/dist-lib/native-firebase-metadata.cjs +1 -1
  82. package/dist-lib/native-firebase-metadata.mjs +1 -1
  83. package/dist-lib/plist.cjs +1 -1
  84. package/dist-lib/plist.mjs +1 -1
  85. package/dist-lib/profiles.cjs +5 -2
  86. package/dist-lib/public-brand.cjs +1 -1
  87. package/dist-lib/public-origins-lib-esm.json +28 -23
  88. package/dist-lib/public-origins-lib.json +418 -224
  89. package/dist-lib/react-native-host-modules.cjs +35 -2
  90. package/dist-lib/react-native-host-modules.mjs +35 -2
  91. package/dist-lib/reap-browser.cjs +12 -4
  92. package/dist-lib/scripts/dev-server-scanner.cjs +15 -8
  93. package/dist-lib/sdk.cjs +17 -7
  94. package/dist-lib/sdk.mjs +16 -7
  95. package/dist-lib/skills.cjs +44825 -29141
  96. package/dist-lib/swift-compile.cjs +616 -400
  97. package/dist-lib/swift-compile.mjs +528 -315
  98. package/dist-lib/swift-package.cjs +1 -1
  99. package/dist-lib/swift-package.mjs +1 -1
  100. package/dist-lib/swift-submit.cjs +2 -2
  101. package/dist-lib/swift-submit.mjs +2 -2
  102. package/dist-lib/swift-toolchain.cjs +105 -17
  103. package/dist-lib/swift.cjs +1 -1
  104. package/dist-lib/vite-swift.cjs +4660 -2252
  105. package/dist-lib/vite.cjs +248 -234
  106. package/dist-lib/worklet-executable.cjs +1 -1
  107. package/dist-lib/worklet-executable.mjs +1 -1
  108. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +17 -8
  109. package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
  110. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +7 -4
  111. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +9 -6
  112. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +0 -5
  113. package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +11 -1
  114. package/dist-types/packages/peach-engine/src/engine/node.d.ts +5 -12
  115. package/dist-types/packages/peach-engine/src/engine/render-damage.d.ts +2 -2
  116. package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +5 -0
  117. package/dist-types/packages/peach-engine/src/engine/text-paragraph.d.ts +1 -0
  118. package/dist-types/packages/peach-engine/src/engine/types.d.ts +3 -0
  119. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +2 -0
  120. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +9 -0
  121. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
  122. package/dist-types/packages/peach-engine/src/render-worker/native-ui-commandContract.d.ts +1 -1
  123. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +7 -2
  124. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +5 -0
  125. package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +1 -1
  126. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +36 -2
  127. package/dist-types/packages/peach-engine/src/shell-events.d.ts +1 -0
  128. package/dist-types/packages/peach-globals/src/audioBridgeContract.d.ts +5 -0
  129. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  130. package/dist-types/packages/peach-globals/src/keyboardBridgeContract.d.ts +11 -0
  131. package/dist-types/packages/peach-globals/src/shellBridgeContract.d.ts +1 -0
  132. package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +9 -2
  133. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  134. package/kotlin/README.md +3 -0
  135. package/kotlin/sdk.tar.gz +0 -0
  136. package/package.json +1 -1
  137. package/runtime-companion.json +1 -1
  138. package/scripts/dev-server-scanner.ts +12 -25
  139. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccount.h +55 -0
  140. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountCredential.h +35 -0
  141. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountStore.h +94 -0
  142. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountType.h +53 -0
  143. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACError.h +37 -0
  144. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/Accounts.h +13 -0
  145. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/AccountsDefines.h +13 -0
  146. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Modules/module.modulemap +5 -0
  147. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASFoundation.h +52 -0
  148. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSession.h +128 -0
  149. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSessionCallback.h +35 -0
  150. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/AuthenticationServices.h +3 -0
  151. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Modules/module.modulemap +5 -0
  152. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h +724 -0
  153. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +4 -0
  154. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h +27 -0
  155. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap +5 -0
  156. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h +1301 -0
  157. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +3 -1
  158. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +21 -50
  159. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +6 -6
  160. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +58 -3
  161. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +711 -46
  162. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +12 -0
  163. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h +23 -0
  164. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +7 -9
  165. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIOrientation.h +14 -0
  166. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h +12 -0
  167. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIView.h +14 -0
  168. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h +12 -0
  169. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h +16 -0
  170. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h +2 -0
  171. package/sdk/ios/usr/include/ConditionalMacros.h +619 -0
  172. package/sdk/ios/usr/include/module.modulemap +1 -0
  173. package/sdk/ios/usr/include/objc/objc-sync.h +59 -0
  174. package/sdk/ios/usr/include/os/signpost.h +414 -0
  175. package/sdk/ios/usr/include/os.modulemap +10 -0
  176. package/sdk/ios/usr/include/sys/cdefs.h +5 -0
  177. package/sdk/ios/usr/include/sys/ioccom.h +99 -0
  178. package/sdk/ios/usr/include/sys/syslog.h +236 -0
  179. package/sdk/ios/usr/include/syslog.h +24 -0
  180. package/sdk/ios/wasm/include/errno.h +4 -20
  181. package/sdk/ios/wasm/include/fcntl.h +4 -2
  182. package/sdk/ios/wasm/include/pthread.h +3 -0
  183. package/sdk/ios/wasm/include/setjmp.h +57 -0
  184. package/sdk/ios/wasm/include/stdio.h +24 -0
  185. package/sdk/ios/wasm/include/stdlib.h +32 -7
  186. package/sdk/ios/wasm/include/sys/file.h +7 -0
  187. package/sdk/ios/wasm/include/sys/ioctl.h +6 -0
  188. package/sdk/ios/wasm/include/sys/resource.h +2 -2
  189. package/sdk/ios/wasm/include/sys/syscall.h +9 -0
  190. package/sdk/ios/wasm/include/sys/time.h +10 -0
  191. package/sdk/ios/wasm/include/unistd.h +12 -3
  192. package/sdk/native-hashes.json +4 -3
  193. package/skills/contrast/SKILL.md +2 -1
  194. package/skills/peach-debug/SKILL.md +0 -1
  195. package/skills/peach-perf/SKILL.md +0 -1
  196. package/skills/peach-setup/SKILL.md +0 -1
  197. package/skills/peach-test/SKILL.md +7 -4
  198. package/skills/peach-visual/SKILL.md +0 -1
  199. package/src/admitted-mac-build.ts +3 -0
  200. package/src/android-app-identity.ts +18 -0
  201. package/src/android-autolinking.ts +1 -0
  202. package/src/android-bridge-packages.ts +279 -0
  203. package/src/android-root-module.ts +9 -9
  204. package/src/appPackageContract.ts +83 -0
  205. package/src/bridge-contract.ts +50 -0
  206. package/src/bundle-channel.mjs +41 -6
  207. package/src/cli-runtime.ts +9 -5
  208. package/src/dev-bundle-resolution.ts +7 -27
  209. package/src/dom-source-reference.ts +15 -0
  210. package/src/expo-discovery-cache.ts +134 -26
  211. package/src/expo-kotlin-host.ts +97 -26
  212. package/src/expo-manifest-body.ts +33 -0
  213. package/src/expo-native-workspace.ts +158 -38
  214. package/src/expo-swift-host.ts +350 -75
  215. package/src/expo-swift-ready.ts +5 -1
  216. package/src/expoKotlinContract.ts +12 -2
  217. package/src/expoSwiftContract.ts +10 -0
  218. package/src/generated/swift-c-predefines.json +1 -1
  219. package/src/home-paths.ts +41 -2
  220. package/src/host/app-package-handler.ts +47 -0
  221. package/src/host/bridge-host.ts +8 -0
  222. package/src/host/fetch-proxy-handler.ts +10 -0
  223. package/src/host/staged-host-files.ts +18 -0
  224. package/src/index.ts +3 -0
  225. package/src/kotlin-host.ts +225 -48
  226. package/src/kotlin-instance-source.ts +126 -0
  227. package/src/kotlinSdkContract.ts +2 -1
  228. package/src/menu.ts +14 -0
  229. package/src/native-app-identity-project.ts +7 -2
  230. package/src/native-app-identity.ts +11 -0
  231. package/src/native-firebase-config.ts +24 -1
  232. package/src/native-prebuilt.ts +154 -0
  233. package/src/nitro-adapter.lock.json +270 -270
  234. package/src/nitro-adapter.ts +56 -50
  235. package/src/nitro-bundle.ts +92 -74
  236. package/src/nitro-compile.ts +45 -14
  237. package/src/nitro-dependencies.ts +63 -46
  238. package/src/nitro-source.ts +64 -26
  239. package/src/nitroAdapterContract.ts +146 -98
  240. package/src/nitroContract.ts +71 -21
  241. package/src/react-native-bridge-modules.ts +70 -42
  242. package/src/react-native-host-modules.ts +34 -1
  243. package/src/reactNativeConfigurationContract.ts +14 -0
  244. package/src/reap-browser.ts +15 -3
  245. package/src/sdk.ts +5 -0
  246. package/src/settingsContract.ts +38 -1
  247. package/src/sim-client.ts +4 -1
  248. package/src/storageSnapshotContract.ts +32 -81
  249. package/src/swift-compile.ts +268 -89
  250. package/src/swift-coverage/indexdump.ts +22 -6
  251. package/src/swift-coverage/indexing.ts +4 -4
  252. package/src/swift-coverage/provenance.ts +1 -0
  253. package/src/swift-coverage/sdk.ts +104 -20
  254. package/src/swift-coverage/types.ts +34 -0
  255. package/src/swift-coverage/xcode-asset-symbols.ts +922 -0
  256. package/src/swift-coverage/xcode-assets.ts +89 -131
  257. package/src/swift-coverage/xcode.ts +10 -2
  258. package/src/swift-cxx-reachable.ts +2 -1
  259. package/src/swift-distribution.lock.json +20 -16
  260. package/src/swift-host.ts +98 -22
  261. package/src/swift-icu.ts +1 -1
  262. package/src/swift-link-roots.ts +118 -0
  263. package/src/swift-objc-compile.ts +144 -22
  264. package/src/swift-objc-import.ts +6 -0
  265. package/src/swift-objc-standin.ts +2 -14
  266. package/src/swift-package-manifest.ts +14 -6
  267. package/src/swift-packages.ts +75 -11
  268. package/src/swift-pdf-raster.ts +1 -0
  269. package/src/swift-root-lock.ts +17 -1
  270. package/src/swift-source-pods.ts +2 -10
  271. package/src/swift-standin-emit.ts +597 -57
  272. package/src/swift-standins.ts +599 -56
  273. package/src/swift-submit.ts +7 -1
  274. package/src/swift-toolchain.ts +140 -17
  275. package/src/turbo-bundle.ts +81 -0
  276. package/src/turbo-codegen-intake.ts +91 -0
  277. package/src/turbo-compile.ts +120 -0
  278. package/src/turbo-runtime.lock.json +69 -0
  279. package/src/turbo-source.ts +754 -0
  280. package/src/vite-plugin-one.ts +17 -12
  281. package/src/vite-plugin.ts +28 -15
  282. package/src/xcode-project.ts +223 -22
@@ -63,6 +63,7 @@ export interface SootSimMainShellBridge {
63
63
  toggleLock?(): MaybeAsync<unknown>;
64
64
  setTopOverlay?(overlay: 'none' | 'notification-center' | 'control-center'): MaybeAsync<unknown>;
65
65
  getState?(): MaybeAsync<Record<string, unknown> | null>;
66
+ callTestBridge?(method: string, ...args: unknown[]): MaybeAsync<unknown>;
66
67
  postNativeUIRequest?(request: unknown): MaybeAsync<unknown>;
67
68
  onNativeUIEvent?(cb: (event: unknown) => void): () => void;
68
69
  }
@@ -51,6 +51,9 @@ export interface SootSimInspectPointOptions {
51
51
  excludeTestId?: string;
52
52
  excludeTestIds?: string[];
53
53
  }
54
+ export interface SootSimTapTargetOptions {
55
+ includeUnreachable?: boolean;
56
+ }
54
57
  export interface SootSimListInspectableOptions {
55
58
  excludeTestIds?: string[];
56
59
  }
@@ -72,6 +75,10 @@ export interface SootSimRequestCounts {
72
75
  total: number;
73
76
  failed: number;
74
77
  inFlight: number;
78
+ imageLoads: {
79
+ total: number;
80
+ inFlight: number;
81
+ };
75
82
  }
76
83
  export interface SootSimTestBridge {
77
84
  resolveViewTags?(tags: readonly number[]): MaybeAsync<Record<number, {
@@ -91,8 +98,8 @@ export interface SootSimTestBridge {
91
98
  findByText(text: string): MaybeAsync<SootSimNodeInfo | null>;
92
99
  findByTextOrLabel(text: string): MaybeAsync<SootSimNodeInfo | null>;
93
100
  queryMatchingNodes(matcher: SootSimTargetMatcher): MaybeAsync<SootSimNodeInfo[]>;
94
- observeTapTarget(matcher: SootSimTargetMatcher): MaybeAsync<SootSimTargetObservation | null>;
95
- resolveTapTarget(nodeId: number): MaybeAsync<SootSimTapTargetInfo | null>;
101
+ observeTapTarget(matcher: SootSimTargetMatcher, opts?: SootSimTapTargetOptions): MaybeAsync<SootSimTargetObservation | null>;
102
+ resolveTapTarget(nodeId: number, opts?: SootSimTapTargetOptions): MaybeAsync<SootSimTapTargetInfo | null>;
96
103
  verifyTapTargetAt(x: number, y: number, target: SootSimReplayTarget, nativeWindowRoot?: number): MaybeAsync<SootSimTapTargetVerification>;
97
104
  debugByText(text: string): MaybeAsync<SootSimDebugNodeInfo[] | null>;
98
105
  debugByTestId(testId: string): MaybeAsync<SootSimDebugNodeInfo[] | null>;
@@ -53,6 +53,7 @@ export interface BottomTabBarItem {
53
53
  disabled?: boolean;
54
54
  testID?: string;
55
55
  accessibilityLabel?: string;
56
+ accessibilityHint?: string;
56
57
  icon?: string;
57
58
  iconName?: string;
58
59
  selectedIconName?: string;
package/kotlin/README.md CHANGED
@@ -31,6 +31,9 @@ traffic in `scripts/debug/peach-swift-lazy-network.sh`.
31
31
  - `ExpoSources/`: the expo-modules-core Kotlin DSL port and `PeachExpoRuntime`
32
32
  that local Expo Android modules compile against. Owner spec:
33
33
  [`specs/peach-kotlin-expo-modules.md`](../../../specs/peach-kotlin-expo-modules.md).
34
+ - `BridgeSources/`: React Native's legacy bridge classes, `PeachBridgeRuntime` and the Android,
35
+ androidx and Play services types an app's own `ReactPackage` Kotlin imports. Owner spec:
36
+ [`specs/peach-kotlin/bridge-modules.md`](../../../specs/peach-kotlin/bridge-modules.md).
34
37
  - `CompilerSources/`: the native member compiler plugin and JVM service
35
38
  registration. Release producers compile it to `plugin.jar`; clients load that
36
39
  jar without compiling or receiving plugin source. `ToolSources/` builds
package/kotlin/sdk.tar.gz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.1716",
3
+ "version": "0.1.1738",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1 +1 @@
1
- {"abi":1,"sha256":"a0dede25c849ecabd639fbb0a0c4edd8e62a34bf12090932dba19832f2369659","file":"node/cli-a0dede25c849ecabd639fbb0a0c4edd8e62a34bf12090932dba19832f2369659.cjs"}
1
+ {"abi":1,"sha256":"65f18da220835917c493afae338016e2e9c092419e67b12eb3fb00e389637557","file":"node/cli-65f18da220835917c493afae338016e2e9c092419e67b12eb3fb00e389637557.cjs"}
@@ -25,7 +25,7 @@ import {
25
25
  } from '../src/backend-origin.ts'
26
26
  import { applyPeachConfigToUrl } from '../src/config.ts'
27
27
  import { fetchDevManifest } from '../src/dev-bundle-resolution'
28
- import { parseExpoManifestBody } from '../src/expo-manifest-body'
28
+ import { parseExpoManifestBody, readExpoManifestFields } from '../src/expo-manifest-body'
29
29
  import {
30
30
  KOTLIN_DISCOVERY_PATH,
31
31
  KOTLIN_GUEST_PATH,
@@ -971,9 +971,9 @@ function applyManifest(
971
971
  if (!manifestRes) return result
972
972
  try {
973
973
  const manifest = parseExpoManifestBody(manifestRes.body)
974
- const client = manifest?.extra?.expoClient || manifest?.extra || {}
974
+ const { launchUrl: manifestLaunchUrl, client } = readExpoManifestFields(manifest)
975
975
  const root = client._internal?.projectRoot
976
- if (manifest?.launchAsset || client.name)
976
+ if (manifestLaunchUrl || client.name)
977
977
  result.manifestProjectRoot =
978
978
  typeof root === 'string' && root.length > 0 ? root : null
979
979
  if (client.name) result.projectName = client.name
@@ -985,14 +985,12 @@ function applyManifest(
985
985
  // (hardcoded by @expo/cli — see metroOptions.ts). keep its path and query
986
986
  // so metro shares the iOS bundle cache. when both hosts are loopback, keep
987
987
  // the host that answered discovery so address-family drift stays reachable.
988
- const rawLaunchUrl = manifest?.launchAsset?.url
989
- const launchUrl =
990
- typeof rawLaunchUrl === 'string'
991
- ? alignLoopbackBundleUrlWithProbe(
992
- rawLaunchUrl,
993
- buildLoopbackProbeBaseUrl('http:', manifestRes.hostname, result.port),
994
- )
995
- : undefined
988
+ const launchUrl = manifestLaunchUrl
989
+ ? alignLoopbackBundleUrlWithProbe(
990
+ manifestLaunchUrl,
991
+ buildLoopbackProbeBaseUrl('http:', manifestRes.hostname, result.port),
992
+ )
993
+ : undefined
996
994
  if (launchUrl && !result.patched && !isDirectOneBundleUrl(result.bundleUrl)) {
997
995
  result.bundleUrl = withRuntimeConfig(result.port, launchUrl, result.cwd)
998
996
  }
@@ -1234,20 +1232,9 @@ export async function probePort(
1234
1232
  // burns its web build. a packager is the metro status body, other than one
1235
1233
  // whose manifest names a One entry, which `/__server-scan` still identifies; a
1236
1234
  // spa fallback answers 200 html to every path and never matches the status body.
1237
- const manifestParsed = manifestRes
1238
- ? (safeParseManifest(manifestRes.body) as {
1239
- launchAsset?: { url?: unknown }
1240
- extra?: { expoClient?: { name?: unknown }; name?: unknown }
1241
- } | null)
1242
- : null
1243
- const manifestLaunchUrl =
1244
- typeof manifestParsed?.launchAsset?.url === 'string'
1245
- ? manifestParsed.launchAsset.url
1246
- : null
1247
- const manifestClient =
1248
- (manifestParsed?.extra?.expoClient as { name?: unknown } | undefined) ||
1249
- (manifestParsed?.extra as { name?: unknown } | undefined) ||
1250
- {}
1235
+ const manifestParsed = manifestRes ? safeParseManifest(manifestRes.body) : null
1236
+ const { launchUrl: manifestLaunchUrl, client: manifestClient } =
1237
+ readExpoManifestFields(manifestParsed)
1251
1238
  // `manifestRes === null` means the probe got NO answer — it timed out or the
1252
1239
  // connection failed. that is not the same fact as a server that answered and
1253
1240
  // turned out to have no manifest, and only the second one licenses the
@@ -0,0 +1,55 @@
1
+ //
2
+ // ACAccount.h
3
+ // Accounts
4
+ //
5
+ // Copyright (c) 2011-2012 Apple Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <Accounts/AccountsDefines.h>
10
+
11
+ @class ACAccountType, ACAccountCredential;
12
+
13
+ // The ACAccount class represents an account stored on the system.
14
+ // Accounts are created not bound to any store. Once an account is saved it belongs
15
+ // to the store it was saved into.
16
+
17
+
18
+ API_DEPRECATED("Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead", ios(6.0, 15.0), macos(10.8, 12.0))
19
+
20
+ @interface ACAccount : NSObject
21
+
22
+ // Creates a new account object with a specified account type.
23
+ - (instancetype)initWithAccountType:(ACAccountType *)type NS_DESIGNATED_INITIALIZER;
24
+
25
+ // This identifier can be used to look up the account using [ACAccountStore accountWithIdentifier:].
26
+ @property (readonly, weak, NS_NONATOMIC_IOSONLY) NSString *identifier;
27
+
28
+ // Accounts are stored with a particular account type. All available accounts of a particular type
29
+ // can be looked up using [ACAccountStore accountsWithAccountType:]. When creating new accounts
30
+ // this property is required.
31
+ @property (strong, NS_NONATOMIC_IOSONLY) ACAccountType *accountType;
32
+
33
+ // A human readable description of the account.
34
+ // This property is only available to applications that have been granted access to the account by the user.
35
+ @property (copy, NS_NONATOMIC_IOSONLY) NSString *accountDescription;
36
+
37
+ // The username for the account. This property can be set and saved during account creation. The username is
38
+ // only available to applications that have been granted access to the account by the user.
39
+ @property (copy, NS_NONATOMIC_IOSONLY) NSString *username;
40
+
41
+ // For accounts that support it (currently only Facebook accounts), you can get the user's full name for display
42
+ // purposes without having to talk to the network.
43
+ @property (readonly, NS_NONATOMIC_IOSONLY) NSString *userFullName API_AVAILABLE(ios(7.0)) API_UNAVAILABLE(macos);
44
+
45
+ // The credential for the account. This property can be set and saved during account creation. It is
46
+ // inaccessible once the account has been saved.
47
+ //
48
+ // Unless an error occurs in loading, calling account.credential will always return a non-nil ACAccountCredential object,
49
+ // which will have 0 to n credential items set on it. Setting this property to nil will not unset any credential items saved
50
+ // to this account's credential. See ACAccountCredential.h for details on setting, getting, and clearing credential items.
51
+ //
52
+ // WARNING: Backed by a synchronous xpc call to accountsd, not appropriate to call on a UI Application's main thread
53
+ @property (strong, NS_NONATOMIC_IOSONLY) ACAccountCredential *credential;
54
+
55
+ @end
@@ -0,0 +1,35 @@
1
+ //
2
+ // ACAccountCredential.h
3
+ // Accounts
4
+ //
5
+ // Copyright (c) 2011-2012 Apple Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <Accounts/AccountsDefines.h>
10
+
11
+ // An existing credential may be provided when creating an account.
12
+ // For example, to create a system Twitter account using an existing OAuth token/secret pair:
13
+ //
14
+ // 1. Create the new account instance.
15
+ // 2. Set the account type.
16
+ // 3. Create an ACAccountCredential using your existing OAuth token/secret and set the account's credential property.
17
+ // 4. Save the account.
18
+ //
19
+ // The account will be validated and saved as a system account.
20
+
21
+
22
+ API_DEPRECATED("Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead", ios(6.0, 15.0), macos(10.8, 12.0))
23
+
24
+ @interface ACAccountCredential : NSObject
25
+
26
+ - (instancetype)initWithOAuthToken:(NSString *)token tokenSecret:(NSString *)secret;
27
+
28
+ - (instancetype)initWithOAuth2Token:(NSString *)token
29
+ refreshToken:(NSString *)refreshToken
30
+ expiryDate:(NSDate *)expiryDate;
31
+
32
+ // This property is only valid for OAuth2 credentials
33
+ @property (copy, nonatomic) NSString *oauthToken;
34
+
35
+ @end
@@ -0,0 +1,94 @@
1
+ //
2
+ // ACAccountStore.h
3
+ // Accounts
4
+ //
5
+ // Copyright (c) 2011-2012 Apple Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <Accounts/AccountsDefines.h>
10
+
11
+ typedef NS_ENUM(NSInteger, ACAccountCredentialRenewResult) {
12
+ ACAccountCredentialRenewResultRenewed, // A new credential was obtained and is now associated with the account.
13
+ ACAccountCredentialRenewResultRejected, // Renewal failed because of a user-initiated action.
14
+ ACAccountCredentialRenewResultFailed, // A non-user-initiated cancel of the prompt.
15
+ };
16
+
17
+ typedef void(^ACAccountStoreSaveCompletionHandler)(BOOL success, NSError *error);
18
+ typedef void(^ACAccountStoreRemoveCompletionHandler)(BOOL success, NSError *error);
19
+ typedef void(^ACAccountStoreRequestAccessCompletionHandler)(BOOL granted, NSError *error);
20
+ typedef void(^ACAccountStoreCredentialRenewalHandler)(ACAccountCredentialRenewResult renewResult, NSError *error);
21
+
22
+ @class ACAccount, ACAccountType;
23
+
24
+ // The ACAccountStore class provides an interface for accessing and manipulating
25
+ // accounts. You must create an ACAccountStore object to retrieve, add and delete
26
+ // accounts from the Accounts database.
27
+ //
28
+ // IMPORTANT NOTE: You MUST keep the account store around for as long as you have
29
+ // any objects fetched from that store if you expect other 'sub-fetches' to work,
30
+ // most notably being fetching credentials. If you really just want to open the
31
+ // store to grab credentials, just be sure to grab the credential object and then
32
+ // you can release the owning account and store, e.g.
33
+ //
34
+ // WARNING: All synchronous methods on ACAccountStore invoke xpc methods
35
+ // on accountsd. They are not appropriate to call on a UI Application's main thread.
36
+
37
+
38
+ API_DEPRECATED("Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead", ios(6.0, 15.0), macos(10.8, 12.0))
39
+
40
+ @interface ACAccountStore : NSObject
41
+
42
+ // An array of all the accounts in an account database
43
+ // WARNING: Synchronous, not appropriate to call on a UI Application's main thread
44
+ @property (readonly, weak, NS_NONATOMIC_IOSONLY) NSArray *accounts;
45
+
46
+ // Returns the account matching the given account identifier
47
+ // WARNING: Synchronous, not appropriate to call on a UI Application's main thread
48
+ - (ACAccount *)accountWithIdentifier:(NSString *)identifier;
49
+
50
+ // Returns the account type object matching the account type identifier. See
51
+ // ACAccountType.h for well known account type identifiers
52
+ // WARNING: Synchronous, not appropriate to call on a UI Application's main thread
53
+ - (ACAccountType *)accountTypeWithAccountTypeIdentifier:(NSString *)typeIdentifier;
54
+
55
+ // Returns the accounts matching a given account type.
56
+ // WARNING: Synchronous, not appropriate to call on a UI Application's main thread
57
+ - (NSArray *)accountsWithAccountType:(ACAccountType *)accountType;
58
+
59
+ // Saves the account to the account database. If the account is unauthenticated and the associated account
60
+ // type supports authentication, the system will attempt to authenticate with the credentials provided.
61
+ // Assuming a successful authentication, the account will be saved to the account store. The completion handler
62
+ // for this method is called on an arbitrary queue.
63
+ - (void)saveAccount:(ACAccount *)account withCompletionHandler:(ACAccountStoreSaveCompletionHandler)completionHandler;
64
+
65
+ // DEPRECATED: Please use requestAccessToAccountsWithType:options:completion: instead.
66
+ - (void)requestAccessToAccountsWithType:(ACAccountType *)accountType withCompletionHandler:(ACAccountStoreRequestAccessCompletionHandler)handler API_DEPRECATED_WITH_REPLACEMENT("-requestAccessToAccountsWithType:options:completion:", ios(5.0, 6.0)) API_UNAVAILABLE(macos);
67
+
68
+ // Obtains permission, if necessary, from the user to access protected properties, and utilize accounts
69
+ // of a particular type in protected operations, for example OAuth signing. The completion handler for
70
+ // this method is called on an arbitrary queue.
71
+ // Certain account types (such as Facebook) require an options dictionary. A list of the required keys
72
+ // appears in ACAccountType.h. This method will throw an NSInvalidArgumentException if the options
73
+ // dictionary is not provided for such account types. Conversely, if the account type does not require
74
+ // an options dictionary, the options parameter must be nil.
75
+ - (void)requestAccessToAccountsWithType:(ACAccountType *)accountType options:(NSDictionary *)options completion:(ACAccountStoreRequestAccessCompletionHandler)completion;
76
+
77
+ // Call this if you discover that an ACAccount's credential is no longer valid.
78
+ // For Twitter and Sina Weibo accounts, this method will prompt the user to go to Settings to re-enter their password.
79
+ // For Facebook accounts, if your access token became invalid due to regular expiration, this method will obtain a new one.
80
+ // However, if the user has deauthorized your app, this renewal request will return ACAccountCredentialRenewResultRejected.
81
+ - (void)renewCredentialsForAccount:(ACAccount *)account completion:(ACAccountStoreCredentialRenewalHandler)completionHandler;
82
+
83
+ // Removes an account from the account store. The completion handler for this method is called on an arbitrary queue.
84
+ // This call will fail if you don't have sufficient rights to remove the account in question.
85
+ - (void)removeAccount:(ACAccount *)account withCompletionHandler:(ACAccountStoreRemoveCompletionHandler)completionHandler;
86
+
87
+ @end
88
+
89
+ // Notification name sent out when the database is changed by an external process, another account store
90
+ // in the same process or by calling saveAccount: or removeAccount: on a store you are managing.
91
+ // You may need to deal with accounts being removed by an external process while you are using them.
92
+ // Note: ensure when you add an observer for this notification, you do so specifying this object specifically.
93
+ // Otherwise, you will receive n notifications, one per active ACAccountStore instance in your process.
94
+ ACCOUNTS_EXTERN NSString * const ACAccountStoreDidChangeNotification API_DEPRECATED("Public notification deprecated. Internal clients, see private header for replacement", ios(5.0, 14.0), macos(10.8, 11.0), tvos(5.0, 14.0), watchos(1.0, 6.0));
@@ -0,0 +1,53 @@
1
+ //
2
+ // ACAccountType.h
3
+ // Accounts
4
+ //
5
+ // Copyright (c) 2011-2012 Apple Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <Accounts/AccountsDefines.h>
10
+
11
+ // The identifiers for supported system account types are listed here:
12
+ ACCOUNTS_EXTERN NSString * const ACAccountTypeIdentifierTwitter API_DEPRECATED("Use Twitter SDK instead", ios(5.0, 11.0), macos(10.8, 10.13));
13
+ ACCOUNTS_EXTERN NSString * const ACAccountTypeIdentifierFacebook API_DEPRECATED("Use Facebook SDK instead", ios(6.0, 11.0), macos(10.8, 10.13));
14
+ ACCOUNTS_EXTERN NSString * const ACAccountTypeIdentifierSinaWeibo API_DEPRECATED("Use Sina Weibo SDK instead", ios(6.0, 11.0), macos(10.8, 10.13));
15
+ ACCOUNTS_EXTERN NSString * const ACAccountTypeIdentifierTencentWeibo API_DEPRECATED("Use Tencent Weibo SDK instead", ios(7.0, 11.0), macos(10.9, 10.13));
16
+ ACCOUNTS_EXTERN NSString * const ACAccountTypeIdentifierLinkedIn API_DEPRECATED("Use LinkedIn SDK instead", macos(10.9, 10.13)) API_UNAVAILABLE(ios);
17
+
18
+ // Options dictionary keys for Facebook access, for use with [ACAccountStore requestAccessToAccountsWithType:options:completion:]
19
+ ACCOUNTS_EXTERN NSString * const ACFacebookAppIdKey API_DEPRECATED("Use Facebook SDK instead", ios(6.0, 11.0), macos(10.8, 10.13)); // Your Facebook App ID, as it appears on the Facebook website.
20
+ ACCOUNTS_EXTERN NSString * const ACFacebookPermissionsKey API_DEPRECATED("Use Facebook SDK instead", ios(6.0, 11.0), macos(10.8, 10.13)); // An array of of the permissions you're requesting.
21
+ ACCOUNTS_EXTERN NSString * const ACFacebookAudienceKey API_DEPRECATED("Use Facebook SDK instead", ios(6.0, 11.0), macos(10.8, 10.13)); // Only required when posting permissions are requested.
22
+
23
+ // Options dictionary values for Facebook access, for use with [ACAccountStore requestAccessToAccountsWithType:options:completion:]
24
+ ACCOUNTS_EXTERN NSString * const ACFacebookAudienceEveryone API_DEPRECATED("Use Facebook SDK instead", ios(6.0, 11.0), macos(10.8, 10.13)); // Posts from your app are visible to everyone.
25
+ ACCOUNTS_EXTERN NSString * const ACFacebookAudienceFriends API_DEPRECATED("Use Facebook SDK instead", ios(6.0, 11.0), macos(10.8, 10.13)); // Posts are visible only to friends.
26
+ ACCOUNTS_EXTERN NSString * const ACFacebookAudienceOnlyMe API_DEPRECATED("Use Facebook SDK instead", ios(6.0, 11.0), macos(10.8, 10.13)); // Posts are visible to the user only.
27
+
28
+ // Options dictionary keys for LinkedIn access, for use with [ACAccountStore requestAccessToAccountsWithType:options:completion:]
29
+ ACCOUNTS_EXTERN NSString * const ACLinkedInAppIdKey API_DEPRECATED("Use LinkedIn SDK instead", macos(10.9, 10.13)) API_UNAVAILABLE(ios); // Your LinkedIn App ID (or API Key), as it appears on the LinkedIn website.
30
+ ACCOUNTS_EXTERN NSString * const ACLinkedInPermissionsKey API_DEPRECATED("Use LinkedIn SDK instead", macos(10.9, 10.13)) API_UNAVAILABLE(ios); // An array of of the LinkedIn permissions you're requesting.
31
+
32
+ ACCOUNTS_EXTERN NSString * const ACTencentWeiboAppIdKey API_DEPRECATED("Use Tencent Weibo SDK instead", ios(7.0, 11.0), macos(10.9, 10.13)); // Tencent App ID
33
+
34
+ // Each account has an associated account type, containing information relevant to all the accounts of that type.
35
+ // ACAccountType objects are obtained by using the [ACAccountStore accountTypeWithIdentifier:] method
36
+ // or accessing the accountType property for a particular account object. They may also be used to find
37
+ // all the accounts of a particular type using [ACAccountStore accountsWithAccountType:]
38
+
39
+
40
+ API_DEPRECATED("Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead", ios(6.0, 15.0), macos(10.8, 12.0))
41
+
42
+ @interface ACAccountType : NSObject
43
+
44
+ // A human readable description of the account type.
45
+ @property (readonly, nonatomic) NSString *accountTypeDescription;
46
+
47
+ // A unique identifier for the account type. Well known system account type identifiers are listed above.
48
+ @property (readonly, nonatomic) NSString *identifier;
49
+
50
+ // A boolean indicating whether the user has granted access to accounts of this type for your application.
51
+ @property (readonly, nonatomic) BOOL accessGranted;
52
+
53
+ @end
@@ -0,0 +1,37 @@
1
+ //
2
+ // ACError.h
3
+ // Accounts
4
+ //
5
+ // Copyright (c) 2011-2012 Apple Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <Accounts/AccountsDefines.h>
10
+
11
+ ACCOUNTS_EXTERN NSString * const ACErrorDomain API_AVAILABLE(ios(5.0), macos(10.8));
12
+
13
+ typedef enum ACErrorCode {
14
+ ACErrorUnknown = 1,
15
+ ACErrorAccountMissingRequiredProperty = 2, // Account wasn't saved because it is missing a required property.
16
+ ACErrorAccountAuthenticationFailed = 3, // Account wasn't saved because authentication of the supplied credential failed.
17
+ ACErrorAccountTypeInvalid = 4, // Account wasn't saved because the account type is invalid.
18
+ ACErrorAccountAlreadyExists = 5, // Account wasn't added because it already exists.
19
+ ACErrorAccountNotFound = 6, // Account wasn't deleted because it could not be found.
20
+ ACErrorPermissionDenied = 7, // The operation didn't complete because the user denied permission.
21
+ ACErrorAccessInfoInvalid = 8, // The client's access info dictionary has incorrect or missing values.
22
+ ACErrorClientPermissionDenied = 9, // Your client does not have access to the requested data.
23
+ ACErrorAccessDeniedByProtectionPolicy = 10, // Due to the current protection policy in effect, we couldn't fetch a credential
24
+ ACErrorCredentialNotFound = 11, // Yo, I tried to find your credential, but it must have run off!
25
+ ACErrorFetchCredentialFailed = 12, // Something bad happened on the way to the keychain
26
+ ACErrorStoreCredentialFailed = 13, // Unable to store credential
27
+ ACErrorRemoveCredentialFailed = 14, // Unable to remove credential
28
+ ACErrorUpdatingNonexistentAccount = 15, // Account save failed because the account being updated has been removed.
29
+ ACErrorInvalidClientBundleID = 16, // The client making the request does not have a valid bundle ID.
30
+ ACErrorDeniedByPlugin = 17, // A plugin prevented the expected action to occur.
31
+ ACErrorCoreDataSaveFailed = 18, // Something broke below us when we tried to the CoreData store.
32
+ ACErrorFailedSerializingAccountInfo = 19,
33
+ ACErrorInvalidCommand = 20,
34
+ ACErrorMissingTransportMessageID = 21,
35
+ ACErrorCredentialItemNotFound = 22, // Credential item wasn't saved because it could not be found.
36
+ ACErrorCredentialItemNotExpired = 23, // Credential item wasn't removed because it has not yet expired.
37
+ } ACErrorCode;
@@ -0,0 +1,13 @@
1
+ //
2
+ // Accounts.h
3
+ // Accounts
4
+ //
5
+ // Copyright (c) 2011-2012 Apple Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Accounts/AccountsDefines.h>
9
+ #import <Accounts/ACAccount.h>
10
+ #import <Accounts/ACAccountType.h>
11
+ #import <Accounts/ACAccountCredential.h>
12
+ #import <Accounts/ACAccountStore.h>
13
+ #import <Accounts/ACError.h>
@@ -0,0 +1,13 @@
1
+ //
2
+ // AccountsDefines.h
3
+ // Accounts
4
+ //
5
+ // Copyright (c) 2011-2012 Apple Inc. All rights reserved.
6
+ //
7
+
8
+
9
+ #ifdef __cplusplus
10
+ #define ACCOUNTS_EXTERN extern "C" __attribute__((visibility ("default")))
11
+ #else
12
+ #define ACCOUNTS_EXTERN extern __attribute__((visibility ("default")))
13
+ #endif
@@ -0,0 +1,5 @@
1
+ framework module Accounts {
2
+ umbrella header "Accounts.h"
3
+ export *
4
+ module * { export * }
5
+ }
@@ -0,0 +1,52 @@
1
+ //
2
+ // ASFoundation.h
3
+ // AuthenticationServices Framework
4
+ //
5
+ // Copyright © 2018 Apple Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+
10
+ #ifdef __cplusplus
11
+ #define AS_EXTERN extern "C" __attribute__((visibility ("default")))
12
+ #else
13
+ #define AS_EXTERN extern __attribute__((visibility ("default")))
14
+ #endif
15
+
16
+ #ifdef NS_HEADER_AUDIT_BEGIN
17
+ #define AS_HEADER_AUDIT_BEGIN NS_HEADER_AUDIT_BEGIN
18
+ #define AS_HEADER_AUDIT_END NS_HEADER_AUDIT_END
19
+ #else
20
+ #define AS_HEADER_AUDIT_BEGIN(...) NS_ASSUME_NONNULL_BEGIN
21
+ #define AS_HEADER_AUDIT_END(...) NS_ASSUME_NONNULL_END
22
+ #endif
23
+
24
+ #ifdef NS_SWIFT_SENDABLE
25
+ #define AS_SWIFT_SENDABLE NS_SWIFT_SENDABLE
26
+ #else
27
+ #define AS_SWIFT_SENDABLE
28
+ #endif
29
+
30
+ #ifdef __AS_INTERNAL_AVAILABILITY
31
+ #define AS_API_AVAILABLE(...)
32
+ #else
33
+ #define AS_API_AVAILABLE API_AVAILABLE
34
+ #endif
35
+
36
+ #if __has_include(<UIKit/UIKit.h>)
37
+ #import <UIKit/UIKit.h>
38
+ #if __has_include(<UIKit/UIWindow.h>)
39
+ typedef UIWindow * ASPresentationAnchor API_UNAVAILABLE(watchos);
40
+ #endif
41
+ #if __has_include(<UIKit/UIViewController.h>) && !defined(ASViewController)
42
+ typedef UIViewController ASViewController API_UNAVAILABLE(watchos);
43
+ #endif
44
+ typedef UIImage ASImage API_UNAVAILABLE(watchos);
45
+ #elif __has_include(<AppKit/AppKit.h>)
46
+ #import <AppKit/AppKit.h>
47
+ typedef NSWindow * ASPresentationAnchor;
48
+ #if !defined(ASViewController)
49
+ typedef NSViewController ASViewController;
50
+ typedef NSImage ASImage;
51
+ #endif
52
+ #endif
@@ -0,0 +1,128 @@
1
+ //
2
+ // ASWebAuthenticationSession.h
3
+ // AuthenticationServices Framework
4
+ //
5
+ // Copyright © 2018 Apple Inc. All rights reserved.
6
+ //
7
+
8
+ #import <AuthenticationServices/ASFoundation.h>
9
+ #import <Foundation/Foundation.h>
10
+
11
+ @class ASWebAuthenticationSessionCallback;
12
+
13
+ NS_ASSUME_NONNULL_BEGIN
14
+
15
+ @protocol ASWebAuthenticationPresentationContextProviding;
16
+
17
+ AS_EXTERN API_AVAILABLE(ios(12.0), macCatalyst(13.0), macos(10.15), watchos(6.2), tvos(16.0))
18
+ NSErrorDomain const ASWebAuthenticationSessionErrorDomain;
19
+
20
+ /*! @enum ASWebAuthenticationSessionErrorCode
21
+ @abstract Error code of the NSError object passed in by ASWebAuthenticationSessionCompletionHandler.
22
+ @constant ASWebAuthenticationSessionErrorCodeCanceledLogin The user has canceled login by cancelling the
23
+ alert asking for permission to log in to this app, or by dismissing the view controller for loading the
24
+ authentication webpage.
25
+ @constant ASWebAuthenticationSessionErrorCodePresentationContextNotProvided A valid presentationContextProvider
26
+ was not found when -start was called. Ensure this property was not nil when -start was called.
27
+ @constant ASWebAuthenticationSessionErrorCodePresentationContextInvalid The presentation context returned
28
+ was not elligible to show the authentication UI. For iOS, validate that the UIWindow is in a foreground scene.
29
+ */
30
+ typedef NS_ERROR_ENUM(ASWebAuthenticationSessionErrorDomain, ASWebAuthenticationSessionErrorCode) {
31
+ ASWebAuthenticationSessionErrorCodeCanceledLogin = 1,
32
+ ASWebAuthenticationSessionErrorCodePresentationContextNotProvided API_AVAILABLE(ios(13.0), macos(10.15)) API_UNAVAILABLE(watchos, tvos) = 2,
33
+ ASWebAuthenticationSessionErrorCodePresentationContextInvalid API_AVAILABLE(ios(13.0), macos(10.15)) API_UNAVAILABLE(watchos, tvos) = 3,
34
+ } API_AVAILABLE(ios(12.0), macCatalyst(13.0), macos(10.15), watchos(6.2), tvos(16.0));
35
+
36
+ typedef void (^ASWebAuthenticationSessionCompletionHandler)(NSURL *_Nullable callbackURL, NSError *_Nullable error) NS_SWIFT_NAME(ASWebAuthenticationSession.CompletionHandler);
37
+
38
+ /*!
39
+ @class ASWebAuthenticationSession
40
+ An ASWebAuthenticationSession object can be used to authenticate a user with a web service, even if the web service is run
41
+ by a third party. ASWebAuthenticationSession puts the user in control of whether they want to use their existing logged-in
42
+ session from Safari. The app provides a URL that points to the authentication webpage. The page will be loaded in a secure
43
+ view controller. From the webpage, the user can authenticate herself and grant access to the app.
44
+ On completion, the service will send a callback URL with an authentication token, and this URL will be passed to the app by
45
+ ASWebAuthenticationSessionCompletionHandler.
46
+
47
+ The callback URL usually has a custom URL scheme. For the app to receive the callback URL, it needs to either register the
48
+ custom URL scheme in its Info.plist, or set the scheme to callbackURLScheme argument in the initializer.
49
+
50
+ If the user has already logged into the web service in Safari or other apps via ASWebAuthenticationSession, it is possible to
51
+ share the existing login information. An alert will be presented to get the user's consent for sharing their existing login
52
+ information. If the user cancels the alert, the session will be canceled, and the completion handler will be called with
53
+ the error code ASWebAuthenticationSessionErrorCodeCanceledLogin.
54
+
55
+ If the user taps Cancel when showing the login webpage for the web service, the session will be canceled, and the completion
56
+ handler will be called with the error code ASWebAuthenticationSessionErrorCodeCanceledLogin.
57
+
58
+ The app can cancel the session by calling -[ASWebAuthenticationSession cancel]. This will also dismiss the view controller that
59
+ is showing the web service's login page.
60
+ */
61
+ AS_EXTERN API_AVAILABLE(ios(12.0), macCatalyst(13.0), macos(10.15), watchos(6.2), tvos(16.0))
62
+ @interface ASWebAuthenticationSession : NSObject
63
+
64
+ /*! @abstract Returns an ASWebAuthenticationSession object.
65
+ @param URL the initial URL pointing to the authentication webpage. Only supports URLs with http:// or https:// schemes.
66
+ @param callbackURLScheme the custom URL scheme that the app expects in the callback URL.
67
+ @param completionHandler the completion handler which is called when the session is completed successfully or canceled by user.
68
+ */
69
+ - (instancetype)initWithURL:(NSURL *)URL callbackURLScheme:(nullable NSString *)callbackURLScheme completionHandler:(ASWebAuthenticationSessionCompletionHandler)completionHandler API_DEPRECATED("Use initWithURL:callback:completionHandler: instead", ios(12.0, API_TO_BE_DEPRECATED), macCatalyst(13.0, API_TO_BE_DEPRECATED), macos(10.15, API_TO_BE_DEPRECATED), watchos(6.2, API_TO_BE_DEPRECATED), tvos(16.0, API_TO_BE_DEPRECATED));
70
+
71
+ - (instancetype)initWithURL:(NSURL *)URL callback:(ASWebAuthenticationSessionCallback *)callback completionHandler:(ASWebAuthenticationSessionCompletionHandler)completionHandler API_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4), visionos(1.1));
72
+
73
+ /*! @abstract Provides context to target where in an application's UI the authorization view should be shown. A provider
74
+ must be set prior to calling -start, otherwise the authorization view cannot be displayed. If deploying to iOS prior to
75
+ 13.0, the desired window is inferred by the application's key window.
76
+ */
77
+ @property (nonatomic, weak) id <ASWebAuthenticationPresentationContextProviding> presentationContextProvider API_AVAILABLE(ios(13.0), macos(10.15)) API_UNAVAILABLE(watchos, tvos);
78
+
79
+ /*! @abstract Indicates whether this session should ask the browser for an ephemeral session.
80
+ @discussion Ephemeral web browser sessions do not not share cookies or other browsing data with a user's normal browser session.
81
+ This value is NO by default. Setting this property after calling -[ASWebAuthenticationSession start] has no effect.
82
+ */
83
+ @property (nonatomic) BOOL prefersEphemeralWebBrowserSession API_AVAILABLE(ios(13.0), macos(10.15), watchos(6.2)) API_UNAVAILABLE(tvos);
84
+
85
+ /// Any additional header fields to be set when loading the initial URL.
86
+ /// All header field names must start with the "X-" prefix.
87
+ @property (nonatomic, nullable) NSDictionary<NSString *, NSString *> *additionalHeaderFields API_AVAILABLE(ios(17.4), macos(14.4), tvos(17.4), watchos(10.4), visionos(1.1));
88
+
89
+ /*! @abstract Returns whether the session can be successfully started. This property returns the same value as calling -start,
90
+ but without the side effect of actually starting the session.
91
+ */
92
+ @property (nonatomic, readonly) BOOL canStart API_AVAILABLE(ios(13.4), macos(10.15.4), watchos(6.2));
93
+
94
+ /*! @abstract Starts the ASWebAuthenticationSession instance after it is instantiated.
95
+ @discussion start can only be called once for an ASWebAuthenticationSession instance. This also means calling start on a
96
+ canceled session will fail.
97
+ @result Returns YES if the session starts successfully.
98
+ */
99
+ - (BOOL)start;
100
+
101
+ /*! @abstract Cancel an ASWebAuthenticationSession. If the view controller is already presented to load the webpage for
102
+ authentication, it will be dismissed. Calling cancel on an already canceled session will have no effect.
103
+ */
104
+ - (void)cancel API_UNAVAILABLE(tvos);
105
+
106
+ + (instancetype)new NS_UNAVAILABLE;
107
+ - (instancetype)init NS_UNAVAILABLE;
108
+
109
+ @end
110
+
111
+ /*! @abstract Provides context to target where in an application's UI the authorization view should be shown.
112
+ */
113
+ API_AVAILABLE(ios(13.0), macos(10.15)) API_UNAVAILABLE(tvos, watchos)
114
+ NS_SWIFT_UI_ACTOR
115
+ @protocol ASWebAuthenticationPresentationContextProviding <NSObject>
116
+
117
+ #if !TARGET_OS_WATCH
118
+ /*! @abstract Return the ASPresentationAnchor in the closest proximity to where a user interacted with your app to trigger
119
+ authentication. If starting an ASWebAuthenticationSession on first launch, use the application's main window.
120
+ @param session The session requesting a presentation anchor.
121
+ @result The ASPresentationAnchor most closely associated with the UI used to trigger authentication.
122
+ */
123
+ - (ASPresentationAnchor)presentationAnchorForWebAuthenticationSession:(ASWebAuthenticationSession *)session;
124
+ #endif
125
+
126
+ @end
127
+
128
+ NS_ASSUME_NONNULL_END