@oxy.so/services 11.10.0 → 11.12.0

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 (153) hide show
  1. package/lib/commonjs/assets/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
  2. package/lib/commonjs/assets/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
  3. package/lib/commonjs/assets/assets/fonts/icons/manifest.json +5 -4
  4. package/lib/commonjs/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
  5. package/lib/commonjs/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
  6. package/lib/commonjs/assets/fonts/icons/manifest.json +5 -4
  7. package/lib/commonjs/index.js +17 -0
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/ui/appAssertion/AppAssertionContext.js +79 -0
  10. package/lib/commonjs/ui/appAssertion/AppAssertionContext.js.map +1 -0
  11. package/lib/commonjs/ui/appAssertion/appAssertionManager.js +309 -0
  12. package/lib/commonjs/ui/appAssertion/appAssertionManager.js.map +1 -0
  13. package/lib/commonjs/ui/appAssertion/appIntegrityPlatform.js +18 -0
  14. package/lib/commonjs/ui/appAssertion/appIntegrityPlatform.js.map +1 -0
  15. package/lib/commonjs/ui/appAssertion/appIntegrityPlatform.native.js +30 -0
  16. package/lib/commonjs/ui/appAssertion/appIntegrityPlatform.native.js.map +1 -0
  17. package/lib/commonjs/ui/appAssertion/appIntegrityTypes.js +6 -0
  18. package/lib/commonjs/ui/appAssertion/appIntegrityTypes.js.map +1 -0
  19. package/lib/commonjs/ui/components/fileManagement/FileAppAccessSection.js +121 -0
  20. package/lib/commonjs/ui/components/fileManagement/FileAppAccessSection.js.map +1 -0
  21. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +6 -2
  22. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  23. package/lib/commonjs/ui/context/OxyContext.js +10 -1
  24. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  25. package/lib/commonjs/ui/hooks/mutations/mutationKeys.js +4 -0
  26. package/lib/commonjs/ui/hooks/mutations/mutationKeys.js.map +1 -1
  27. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +49 -1
  28. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  29. package/lib/commonjs/ui/hooks/queries/queryKeys.js +6 -1
  30. package/lib/commonjs/ui/hooks/queries/queryKeys.js.map +1 -1
  31. package/lib/commonjs/ui/hooks/queries/useFileQueries.js +35 -1
  32. package/lib/commonjs/ui/hooks/queries/useFileQueries.js.map +1 -1
  33. package/lib/commonjs/ui/icons/subsetGlyphMaps.js +1 -0
  34. package/lib/commonjs/ui/icons/subsetGlyphMaps.js.map +1 -1
  35. package/lib/commonjs/ui/index.js +7 -0
  36. package/lib/commonjs/ui/index.js.map +1 -1
  37. package/lib/module/assets/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
  38. package/lib/module/assets/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
  39. package/lib/module/assets/assets/fonts/icons/manifest.json +5 -4
  40. package/lib/module/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
  41. package/lib/module/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
  42. package/lib/module/assets/fonts/icons/manifest.json +5 -4
  43. package/lib/module/index.js +4 -0
  44. package/lib/module/index.js.map +1 -1
  45. package/lib/module/ui/appAssertion/AppAssertionContext.js +72 -0
  46. package/lib/module/ui/appAssertion/AppAssertionContext.js.map +1 -0
  47. package/lib/module/ui/appAssertion/appAssertionManager.js +304 -0
  48. package/lib/module/ui/appAssertion/appAssertionManager.js.map +1 -0
  49. package/lib/module/ui/appAssertion/appIntegrityPlatform.js +14 -0
  50. package/lib/module/ui/appAssertion/appIntegrityPlatform.js.map +1 -0
  51. package/lib/module/ui/appAssertion/appIntegrityPlatform.native.js +26 -0
  52. package/lib/module/ui/appAssertion/appIntegrityPlatform.native.js.map +1 -0
  53. package/lib/module/ui/appAssertion/appIntegrityTypes.js +4 -0
  54. package/lib/module/ui/appAssertion/appIntegrityTypes.js.map +1 -0
  55. package/lib/module/ui/components/fileManagement/FileAppAccessSection.js +116 -0
  56. package/lib/module/ui/components/fileManagement/FileAppAccessSection.js.map +1 -0
  57. package/lib/module/ui/components/fileManagement/FileDetailsModal.js +6 -2
  58. package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  59. package/lib/module/ui/context/OxyContext.js +10 -1
  60. package/lib/module/ui/context/OxyContext.js.map +1 -1
  61. package/lib/module/ui/hooks/mutations/mutationKeys.js +4 -0
  62. package/lib/module/ui/hooks/mutations/mutationKeys.js.map +1 -1
  63. package/lib/module/ui/hooks/mutations/useAccountMutations.js +47 -0
  64. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  65. package/lib/module/ui/hooks/queries/queryKeys.js +6 -1
  66. package/lib/module/ui/hooks/queries/queryKeys.js.map +1 -1
  67. package/lib/module/ui/hooks/queries/useFileQueries.js +33 -1
  68. package/lib/module/ui/hooks/queries/useFileQueries.js.map +1 -1
  69. package/lib/module/ui/icons/subsetGlyphMaps.js +1 -0
  70. package/lib/module/ui/icons/subsetGlyphMaps.js.map +1 -1
  71. package/lib/module/ui/index.js +1 -0
  72. package/lib/module/ui/index.js.map +1 -1
  73. package/lib/typescript/commonjs/index.d.ts +3 -0
  74. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/ui/appAssertion/AppAssertionContext.d.ts +41 -0
  76. package/lib/typescript/commonjs/ui/appAssertion/AppAssertionContext.d.ts.map +1 -0
  77. package/lib/typescript/commonjs/ui/appAssertion/appAssertionManager.d.ts +92 -0
  78. package/lib/typescript/commonjs/ui/appAssertion/appAssertionManager.d.ts.map +1 -0
  79. package/lib/typescript/commonjs/ui/appAssertion/appIntegrityPlatform.d.ts +9 -0
  80. package/lib/typescript/commonjs/ui/appAssertion/appIntegrityPlatform.d.ts.map +1 -0
  81. package/lib/typescript/commonjs/ui/appAssertion/appIntegrityPlatform.native.d.ts +3 -0
  82. package/lib/typescript/commonjs/ui/appAssertion/appIntegrityPlatform.native.d.ts.map +1 -0
  83. package/lib/typescript/commonjs/ui/appAssertion/appIntegrityTypes.d.ts +22 -0
  84. package/lib/typescript/commonjs/ui/appAssertion/appIntegrityTypes.d.ts.map +1 -0
  85. package/lib/typescript/commonjs/ui/components/fileManagement/FileAppAccessSection.d.ts +15 -0
  86. package/lib/typescript/commonjs/ui/components/fileManagement/FileAppAccessSection.d.ts.map +1 -0
  87. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +2 -1
  88. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  89. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/ui/hooks/mutations/mutationKeys.d.ts +3 -0
  91. package/lib/typescript/commonjs/ui/hooks/mutations/mutationKeys.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +13 -1
  93. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts +5 -0
  95. package/lib/typescript/commonjs/ui/hooks/queries/queryKeys.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/ui/hooks/queries/useFileQueries.d.ts +11 -1
  97. package/lib/typescript/commonjs/ui/hooks/queries/useFileQueries.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/ui/icons/MaterialCommunityIcons.d.ts +1 -1
  99. package/lib/typescript/commonjs/ui/icons/MaterialCommunityIcons.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/ui/icons/subsetGlyphMaps.d.ts +1 -0
  101. package/lib/typescript/commonjs/ui/icons/subsetGlyphMaps.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/ui/index.d.ts +2 -0
  103. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  104. package/lib/typescript/module/index.d.ts +3 -0
  105. package/lib/typescript/module/index.d.ts.map +1 -1
  106. package/lib/typescript/module/ui/appAssertion/AppAssertionContext.d.ts +41 -0
  107. package/lib/typescript/module/ui/appAssertion/AppAssertionContext.d.ts.map +1 -0
  108. package/lib/typescript/module/ui/appAssertion/appAssertionManager.d.ts +92 -0
  109. package/lib/typescript/module/ui/appAssertion/appAssertionManager.d.ts.map +1 -0
  110. package/lib/typescript/module/ui/appAssertion/appIntegrityPlatform.d.ts +9 -0
  111. package/lib/typescript/module/ui/appAssertion/appIntegrityPlatform.d.ts.map +1 -0
  112. package/lib/typescript/module/ui/appAssertion/appIntegrityPlatform.native.d.ts +3 -0
  113. package/lib/typescript/module/ui/appAssertion/appIntegrityPlatform.native.d.ts.map +1 -0
  114. package/lib/typescript/module/ui/appAssertion/appIntegrityTypes.d.ts +22 -0
  115. package/lib/typescript/module/ui/appAssertion/appIntegrityTypes.d.ts.map +1 -0
  116. package/lib/typescript/module/ui/components/fileManagement/FileAppAccessSection.d.ts +15 -0
  117. package/lib/typescript/module/ui/components/fileManagement/FileAppAccessSection.d.ts.map +1 -0
  118. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +2 -1
  119. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  120. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  121. package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts +3 -0
  122. package/lib/typescript/module/ui/hooks/mutations/mutationKeys.d.ts.map +1 -1
  123. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +13 -1
  124. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  125. package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts +5 -0
  126. package/lib/typescript/module/ui/hooks/queries/queryKeys.d.ts.map +1 -1
  127. package/lib/typescript/module/ui/hooks/queries/useFileQueries.d.ts +11 -1
  128. package/lib/typescript/module/ui/hooks/queries/useFileQueries.d.ts.map +1 -1
  129. package/lib/typescript/module/ui/icons/MaterialCommunityIcons.d.ts +1 -1
  130. package/lib/typescript/module/ui/icons/MaterialCommunityIcons.d.ts.map +1 -1
  131. package/lib/typescript/module/ui/icons/subsetGlyphMaps.d.ts +1 -0
  132. package/lib/typescript/module/ui/icons/subsetGlyphMaps.d.ts.map +1 -1
  133. package/lib/typescript/module/ui/index.d.ts +2 -0
  134. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  135. package/package.json +7 -5
  136. package/src/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
  137. package/src/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
  138. package/src/assets/fonts/icons/manifest.json +5 -4
  139. package/src/index.ts +12 -0
  140. package/src/ui/appAssertion/AppAssertionContext.tsx +109 -0
  141. package/src/ui/appAssertion/appAssertionManager.ts +363 -0
  142. package/src/ui/appAssertion/appIntegrityPlatform.native.ts +27 -0
  143. package/src/ui/appAssertion/appIntegrityPlatform.ts +12 -0
  144. package/src/ui/appAssertion/appIntegrityTypes.ts +23 -0
  145. package/src/ui/components/fileManagement/FileAppAccessSection.tsx +111 -0
  146. package/src/ui/components/fileManagement/FileDetailsModal.tsx +5 -1
  147. package/src/ui/context/OxyContext.tsx +13 -1
  148. package/src/ui/hooks/mutations/mutationKeys.ts +5 -0
  149. package/src/ui/hooks/mutations/useAccountMutations.ts +33 -0
  150. package/src/ui/hooks/queries/queryKeys.ts +5 -0
  151. package/src/ui/hooks/queries/useFileQueries.ts +44 -2
  152. package/src/ui/icons/subsetGlyphMaps.ts +1 -0
  153. package/src/ui/index.ts +2 -0
@@ -6,7 +6,7 @@
6
6
  "fontFamily": "OxyServicesIonicons",
7
7
  "file": "src/assets/fonts/icons/OxyServicesIonicons.ttf",
8
8
  "bytes": 43160,
9
- "sha256": "c062679623ae08f1fb0231729c1f9efae97044e35ffe51f7c0544f866cb2f959",
9
+ "sha256": "d96ec296f01cc237bf8e087401879aeef569c82871f40e4447d63bc8a9eaab3e",
10
10
  "names": [
11
11
  "add",
12
12
  "add-circle-outline",
@@ -152,8 +152,8 @@
152
152
  "materialCommunityIcons": {
153
153
  "fontFamily": "OxyServicesMaterialCommunityIcons",
154
154
  "file": "src/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf",
155
- "bytes": 29224,
156
- "sha256": "c7fdc975626c395ee2b1d0c462ae8dab6f800935bb64739d2d07ea4a30da51d0",
155
+ "bytes": 29292,
156
+ "sha256": "a3bef5c42424d459860676f20d7f1e9aaea4f7295aba3d5361ca2195d8f1d59c",
157
157
  "names": [
158
158
  "account",
159
159
  "account-circle",
@@ -337,6 +337,7 @@
337
337
  "trophy",
338
338
  "trophy-outline",
339
339
  "update",
340
+ "upload",
340
341
  "video-outline",
341
342
  "volume-off",
342
343
  "wallet",
@@ -352,5 +353,5 @@
352
353
  }
353
354
  },
354
355
  "glyphMapsFile": "src/ui/icons/subsetGlyphMaps.ts",
355
- "glyphMapsSha256": "1f2e6005461383abb6c5443981341e8ae716110eb6de6590f8a3caa4cfe614b0"
356
+ "glyphMapsSha256": "b0a3d21006a83bf10deac1c8e5bb1a4dacac3c0afe9d445ed856f766f49b6c01"
356
357
  }
@@ -6,7 +6,7 @@
6
6
  "fontFamily": "OxyServicesIonicons",
7
7
  "file": "src/assets/fonts/icons/OxyServicesIonicons.ttf",
8
8
  "bytes": 43160,
9
- "sha256": "c062679623ae08f1fb0231729c1f9efae97044e35ffe51f7c0544f866cb2f959",
9
+ "sha256": "d96ec296f01cc237bf8e087401879aeef569c82871f40e4447d63bc8a9eaab3e",
10
10
  "names": [
11
11
  "add",
12
12
  "add-circle-outline",
@@ -152,8 +152,8 @@
152
152
  "materialCommunityIcons": {
153
153
  "fontFamily": "OxyServicesMaterialCommunityIcons",
154
154
  "file": "src/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf",
155
- "bytes": 29224,
156
- "sha256": "c7fdc975626c395ee2b1d0c462ae8dab6f800935bb64739d2d07ea4a30da51d0",
155
+ "bytes": 29292,
156
+ "sha256": "a3bef5c42424d459860676f20d7f1e9aaea4f7295aba3d5361ca2195d8f1d59c",
157
157
  "names": [
158
158
  "account",
159
159
  "account-circle",
@@ -337,6 +337,7 @@
337
337
  "trophy",
338
338
  "trophy-outline",
339
339
  "update",
340
+ "upload",
340
341
  "video-outline",
341
342
  "volume-off",
342
343
  "wallet",
@@ -352,5 +353,5 @@
352
353
  }
353
354
  },
354
355
  "glyphMapsFile": "src/ui/icons/subsetGlyphMaps.ts",
355
- "glyphMapsSha256": "1f2e6005461383abb6c5443981341e8ae716110eb6de6590f8a3caa4cfe614b0"
356
+ "glyphMapsSha256": "b0a3d21006a83bf10deac1c8e5bb1a4dacac3c0afe9d445ed856f766f49b6c01"
356
357
  }
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "AccountInvitationAcceptance", {
9
9
  return _AccountInvitationAcceptance.AccountInvitationAcceptance;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "AppAssertionProviderMissingError", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _AppAssertionContext.AppAssertionProviderMissingError;
16
+ }
17
+ });
12
18
  Object.defineProperty(exports, "CLEARABLE_USER_FIELDS", {
13
19
  enumerable: true,
14
20
  get: function () {
@@ -447,6 +453,12 @@ Object.defineProperty(exports, "useActiveAccount", {
447
453
  return _index.useActiveAccount;
448
454
  }
449
455
  });
456
+ Object.defineProperty(exports, "useAppAssertion", {
457
+ enumerable: true,
458
+ get: function () {
459
+ return _AppAssertionContext.useAppAssertion;
460
+ }
461
+ });
450
462
  Object.defineProperty(exports, "useAsset", {
451
463
  enumerable: true,
452
464
  get: function () {
@@ -879,6 +891,7 @@ var _OxyProvider = _interopRequireDefault(require("./ui/components/OxyProvider.j
879
891
  var _OxyContext = require("./ui/context/OxyContext.js");
880
892
  var _index = require("./ui/runtime/index.js");
881
893
  var _useAuth = require("./ui/hooks/useAuth.js");
894
+ var _AppAssertionContext = require("./ui/appAssertion/AppAssertionContext.js");
882
895
  var _productAnalytics = require("./ui/analytics/productAnalytics.js");
883
896
  var _identityBinding = require("./ui/session/identityBinding.js");
884
897
  var _authStore = require("./ui/stores/authStore.js");
@@ -979,6 +992,10 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
979
992
  // selector, so — unlike `useOxy()`, whose value is rebuilt by any of its fifty
980
993
  // members moving — a locale change or a dialog opening does not re-render them.
981
994
 
995
+ // This app's Oxy-signed assertion of which app it is (ADR 0045), obtained and
996
+ // refreshed by the provider; attach `getAppAssertionHeaders()` to a request
997
+ // for a service that needs to know the app.
998
+
982
999
  // Thrown by `switchToAccount` / `switchSession` while `OxyProvider` runs with
983
1000
  // `sessionMode="identity"` — an identity-bound app authenticates as the owner of
984
1001
  // the local identity key and cannot switch accounts.
@@ -1 +1 @@
1
- {"version":3,"names":["_core","require","_reactNative","_OxyProvider","_interopRequireDefault","_OxyContext","_index","_useAuth","_productAnalytics","_identityBinding","_authStore","_assetStore","_useAssets","_useFileDownloadUrl","_useFollow","_useStorage","_useAccountQueries","_useServicesQueries","_useSecurityQueries","_useAuthMethods","_usePaymentQueries","_useAccountMutations","_useServicesMutations","_mutationFactory","_mutationKeys","_queryKeys","_userCache","_useMutationStatus","_useOnlineStatus","_useOxyEvent","_errorHandlers","_useFileFiltering","_OxySignInButton","_oauthPopup","_OxyAuthPrompt","_OxyOAuthCallback","_OxyConsentScreen","_RequireOxyAuth","_FollowButton","_FollowTargetButton","_followRules","_useFollowTarget","_followTargetStore","_PeableButton","_OxyPayButton","_LogoIcon","_LogoText","_ProfileButton","_OxySignInPanel","_OxySignUpPanel","_OxyAccountPicker","_OxyDeleteAccountPanel","_OxyLinkCommonsPanel","_OxyPasswordPanel","_OxyAuthenticatorPanel","_OxyAuthScreen","_OxySignInRequestSurface","_useDeviceSwitcher","_bottomSheetManager","_useSurfaceHeader","_SurfaceHeaderAction","_accountDialogManager","_usePersonalPlans","_AccountInvitationAcceptance","_DisplayCurrencySelector","_useDisplayCurrency","_useDisplayPrice","e","__esModule","default","setPlatformOS","Platform","OS"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAIA,IAAAG,mBAAa,EAACC,qBAAQ,CAACC,EAAgB,CAAC;;AAExC;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAqBA;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAOA;AACA;AACA;;AAgCA;;AAeA;AACA;AACA;;AA2BA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;;AAMA;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AA6BA;AACA;AACA;AACA;AACA;;AAGA;;AASA;;AAoCA;;AAEA;;AAKA;AACA;AACA;;AAKA;AACA;AACA;;AAOA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","_reactNative","_OxyProvider","_interopRequireDefault","_OxyContext","_index","_useAuth","_AppAssertionContext","_productAnalytics","_identityBinding","_authStore","_assetStore","_useAssets","_useFileDownloadUrl","_useFollow","_useStorage","_useAccountQueries","_useServicesQueries","_useSecurityQueries","_useAuthMethods","_usePaymentQueries","_useAccountMutations","_useServicesMutations","_mutationFactory","_mutationKeys","_queryKeys","_userCache","_useMutationStatus","_useOnlineStatus","_useOxyEvent","_errorHandlers","_useFileFiltering","_OxySignInButton","_oauthPopup","_OxyAuthPrompt","_OxyOAuthCallback","_OxyConsentScreen","_RequireOxyAuth","_FollowButton","_FollowTargetButton","_followRules","_useFollowTarget","_followTargetStore","_PeableButton","_OxyPayButton","_LogoIcon","_LogoText","_ProfileButton","_OxySignInPanel","_OxySignUpPanel","_OxyAccountPicker","_OxyDeleteAccountPanel","_OxyLinkCommonsPanel","_OxyPasswordPanel","_OxyAuthenticatorPanel","_OxyAuthScreen","_OxySignInRequestSurface","_useDeviceSwitcher","_bottomSheetManager","_useSurfaceHeader","_SurfaceHeaderAction","_accountDialogManager","_usePersonalPlans","_AccountInvitationAcceptance","_DisplayCurrencySelector","_useDisplayCurrency","_useDisplayPrice","e","__esModule","default","setPlatformOS","Platform","OS"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAAA+D,4BAAA,GAAA/D,OAAA;AAEA,IAAAgE,wBAAA,GAAAhE,OAAA;AACA,IAAAiE,mBAAA,GAAAjE,OAAA;AACA,IAAAkE,gBAAA,GAAAlE,OAAA;AAA6D,SAAAG,uBAAAgE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvd7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAIA,IAAAG,mBAAa,EAACC,qBAAQ,CAACC,EAAgB,CAAC;;AAExC;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAaA;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAOA;AACA;AACA;;AAgCA;;AAeA;AACA;AACA;;AA2BA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;;AAMA;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AA6BA;AACA;AACA;AACA;AACA;;AAGA;;AASA;;AAoCA;;AAEA;;AAKA;AACA;AACA;;AAKA;AACA;AACA;;AAOA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AppAssertionProvider = AppAssertionProvider;
7
+ exports.AppAssertionProviderMissingError = void 0;
8
+ exports.useAppAssertion = useAppAssertion;
9
+ var _react = require("react");
10
+ var _appIntegrityPlatform = require("./appIntegrityPlatform");
11
+ var _appAssertionManager = require("./appAssertionManager.js");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ /**
14
+ * `useAppAssertion()` (ADR 0045): this app's Oxy-signed assertion of which app
15
+ * it is, for the signed-in session.
16
+ *
17
+ * `OxyProvider` mounts {@link AppAssertionProvider} itself and the manager
18
+ * obtains and refreshes the assertion on its own; an app never handles the
19
+ * proof. Something that calls a service which needs to know the app (Alia's
20
+ * SDK, for an agent confined to its application) attaches
21
+ * `await getAppAssertionHeaders()` to the request.
22
+ */
23
+
24
+ const AppAssertionContext = /*#__PURE__*/(0, _react.createContext)(null);
25
+ function AppAssertionProvider({
26
+ children,
27
+ oxyServices,
28
+ clientId,
29
+ userId,
30
+ sessionId,
31
+ storage,
32
+ storageKeyPrefix,
33
+ integrity = _appIntegrityPlatform.appIntegrityPlatform
34
+ }) {
35
+ // Read only when an iOS install needs its App Attest key id, never in render.
36
+ const storageRef = (0, _react.useRef)(storage);
37
+ (0, _react.useEffect)(() => {
38
+ storageRef.current = storage;
39
+ }, [storage]);
40
+ const manager = (0, _react.useMemo)(() => new _appAssertionManager.AppAssertionManager({
41
+ oxyServices,
42
+ clientId,
43
+ integrity,
44
+ storage: () => storageRef.current,
45
+ storageKeyPrefix
46
+ }), [oxyServices, clientId, integrity, storageKeyPrefix]);
47
+ (0, _react.useEffect)(() => {
48
+ manager.setSession(userId && sessionId ? {
49
+ userId,
50
+ sessionId
51
+ } : null);
52
+ }, [manager, userId, sessionId]);
53
+ (0, _react.useEffect)(() => () => manager.dispose(), [manager]);
54
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(AppAssertionContext.Provider, {
55
+ value: manager,
56
+ children: children
57
+ });
58
+ }
59
+ class AppAssertionProviderMissingError extends Error {
60
+ code = 'oxy_provider_missing';
61
+ constructor() {
62
+ super('useAppAssertion() was called outside <OxyProvider>.');
63
+ this.name = 'AppAssertionProviderMissingError';
64
+ }
65
+ }
66
+
67
+ /** This app's assertion of which app it is, kept current for the signed-in session. */
68
+ exports.AppAssertionProviderMissingError = AppAssertionProviderMissingError;
69
+ function useAppAssertion() {
70
+ const manager = (0, _react.useContext)(AppAssertionContext);
71
+ if (!manager) throw new AppAssertionProviderMissingError();
72
+ const snapshot = (0, _react.useSyncExternalStore)(manager.subscribe, manager.getSnapshot, manager.getSnapshot);
73
+ return {
74
+ ...snapshot,
75
+ getAppAssertion: manager.getAppAssertion,
76
+ getAppAssertionHeaders: manager.getAppAssertionHeaders
77
+ };
78
+ }
79
+ //# sourceMappingURL=AppAssertionContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_appIntegrityPlatform","_appAssertionManager","_jsxRuntime","AppAssertionContext","createContext","AppAssertionProvider","children","oxyServices","clientId","userId","sessionId","storage","storageKeyPrefix","integrity","appIntegrityPlatform","storageRef","useRef","useEffect","current","manager","useMemo","AppAssertionManager","setSession","dispose","jsx","Provider","value","AppAssertionProviderMissingError","Error","code","constructor","name","exports","useAppAssertion","useContext","snapshot","useSyncExternalStore","subscribe","getSnapshot","getAppAssertion","getAppAssertionHeaders"],"sourceRoot":"../../../../src","sources":["ui/appAssertion/AppAssertionContext.tsx"],"mappings":";;;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAUA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AAAuF,IAAAG,WAAA,GAAAH,OAAA;AAvBvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiBA,MAAMI,mBAAmB,gBAAG,IAAAC,oBAAa,EAA6B,IAAI,CAAC;AAepE,SAASC,oBAAoBA,CAAC;EACnCC,QAAQ;EACRC,WAAW;EACXC,QAAQ;EACRC,MAAM;EACNC,SAAS;EACTC,OAAO;EACPC,gBAAgB;EAChBC,SAAS,GAAGC;AACa,CAAC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AACgB,OAAO,EAAE,MAAM,IAAIQ,gCAAgC,CAAC,CAAC;EAC1D,MAAMQ,QAAQ,GAAG,IAAAC,2BAAoB,EACnCjB,OAAO,CAACkB,SAAS,EACjBlB,OAAO,CAACmB,WAAW,EACnBnB,OAAO,CAACmB,WACV,CAAC;EACD,OAAO;IACL,GAAGH,QAAQ;IACXI,eAAe,EAAEpB,OAAO,CAACoB,eAAe;IACxCC,sBAAsB,EAAErB,OAAO,CAACqB;EAClC,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,309 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AppAssertionManager = void 0;
7
+ var _client = require("@oxy.so/contracts/client");
8
+ /**
9
+ * The app's assertion of which app it is (ADR 0045), obtained and refreshed for
10
+ * the signed-in session without any app code.
11
+ *
12
+ * One manager per `OxyProvider`. For the active session it resolves the app's
13
+ * application id from its registered `clientId`, proves the app by platform —
14
+ * the browser's `Origin` on the web, Play Integrity on Android, App Attest on
15
+ * iOS — trades the proof for an Oxy-signed `OXY-APP+JWT`, and refreshes it a
16
+ * minute before it expires. A session change drops the assertion at once: an
17
+ * assertion names exactly one person and one session.
18
+ *
19
+ * Outcomes are values, never thrown: `ready`, `unsupported` (this build cannot
20
+ * prove itself: no `clientId`, no native module, App Attest unavailable) or
21
+ * `unavailable` (Oxy refused or could not be reached). A refusal that will not
22
+ * change for this session (an unregistered origin or platform) is not retried
23
+ * until the session changes; anything else is retried with a backoff.
24
+ */
25
+
26
+ /** Refresh this long before expiry. */
27
+ const REFRESH_BEFORE_MS = 60_000;
28
+ /** `getAppAssertion()` fetches anew when less than this is left. */
29
+ const MIN_REMAINING_MS = 30_000;
30
+ const RETRY_FIRST_MS = 30_000;
31
+ const RETRY_MAX_MS = 15 * 60_000;
32
+
33
+ /** Refusals that will not change for this session. */
34
+ const PERMANENT_REFUSALS = new Set(['application_unavailable', 'session_other_application', 'platform_not_registered', 'origin_not_registered', 'integrity_unconfigured']);
35
+ const IDLE = {
36
+ status: 'idle',
37
+ assertion: null,
38
+ applicationId: null,
39
+ platform: null,
40
+ expiresAt: null,
41
+ error: null
42
+ };
43
+ class Unsupported extends Error {
44
+ constructor(reason) {
45
+ super(reason);
46
+ this.reason = reason;
47
+ }
48
+ }
49
+ function errorCode(error) {
50
+ if (error instanceof Unsupported) return error.reason;
51
+ const code = error?.code;
52
+ return typeof code === 'string' && code.length > 0 ? code : 'request_failed';
53
+ }
54
+ class AppAssertionManager {
55
+ snapshot = IDLE;
56
+ listeners = new Set();
57
+ session = null;
58
+ /** Bumped on every session change; a result for an older generation is dropped. */
59
+ generation = 0;
60
+ inflight = null;
61
+ timer = null;
62
+ retryMs = RETRY_FIRST_MS;
63
+ retryAt = 0;
64
+ applicationId = null;
65
+ preparedProject = null;
66
+ constructor(options) {
67
+ this.options = options;
68
+ this.now = options.now ?? Date.now;
69
+ this.setTimer = options.setTimer ?? ((run, ms) => setTimeout(run, ms));
70
+ this.clearTimer = options.clearTimer ?? (timer => clearTimeout(timer));
71
+ }
72
+ subscribe = listener => {
73
+ this.listeners.add(listener);
74
+ return () => {
75
+ this.listeners.delete(listener);
76
+ };
77
+ };
78
+ getSnapshot = () => this.snapshot;
79
+
80
+ /**
81
+ * A current assertion for the active session, obtaining one when there is
82
+ * none or it is about to expire; `null` when this app cannot have one now.
83
+ */
84
+ getAppAssertion = async () => {
85
+ const current = this.snapshot;
86
+ if (current.status === 'ready' && current.assertion && current.expiresAt !== null && current.expiresAt - this.now() > MIN_REMAINING_MS) {
87
+ return current.assertion;
88
+ }
89
+ if (!this.session || current.status === 'unsupported') return null;
90
+ if (current.status === 'unavailable' && this.now() < this.retryAt) return null;
91
+ return this.refresh();
92
+ };
93
+
94
+ /**
95
+ * `{ 'X-Oxy-App-Assertion': <assertion> }` for a request to a service that
96
+ * needs to know the app (Alia), or `{}` when there is none.
97
+ */
98
+ getAppAssertionHeaders = async () => {
99
+ const assertion = await this.getAppAssertion();
100
+ return assertion ? {
101
+ [_client.OXY_APP_ASSERTION_HEADER]: assertion
102
+ } : {};
103
+ };
104
+
105
+ /** Follow the active session; `null` when signed out or not yet able to call Oxy. */
106
+ setSession(session) {
107
+ const same = session?.userId === this.session?.userId && session?.sessionId === this.session?.sessionId;
108
+ if (same) return;
109
+ this.session = session;
110
+ this.generation += 1;
111
+ this.inflight = null;
112
+ this.retryMs = RETRY_FIRST_MS;
113
+ this.retryAt = 0;
114
+ this.cancelTimer();
115
+ this.publish(IDLE);
116
+ if (session) void this.refresh();
117
+ }
118
+
119
+ /** Stop all work. A later `setSession` starts again. */
120
+ dispose() {
121
+ this.session = null;
122
+ this.generation += 1;
123
+ this.inflight = null;
124
+ this.cancelTimer();
125
+ }
126
+ refresh() {
127
+ if (this.inflight) return this.inflight;
128
+ const generation = this.generation;
129
+ const run = this.obtain().then(answer => {
130
+ if (generation !== this.generation) return null;
131
+ const expiresAt = Date.parse(answer.expiresAt);
132
+ this.retryMs = RETRY_FIRST_MS;
133
+ this.publish({
134
+ status: 'ready',
135
+ assertion: answer.assertion,
136
+ applicationId: answer.applicationId,
137
+ platform: answer.platform,
138
+ expiresAt,
139
+ error: null
140
+ });
141
+ this.schedule(Math.max(expiresAt - this.now() - REFRESH_BEFORE_MS, MIN_REMAINING_MS));
142
+ return answer.assertion;
143
+ }).catch(error => {
144
+ if (generation !== this.generation) return null;
145
+ const code = errorCode(error);
146
+ const unsupported = error instanceof Unsupported;
147
+ const current = this.snapshot;
148
+ if (!unsupported && !PERMANENT_REFUSALS.has(code) && current.status === 'ready' && current.expiresAt !== null && current.expiresAt - this.now() > MIN_REMAINING_MS) {
149
+ // The assertion in hand is still good: keep it, and try again soon.
150
+ this.schedule(Math.min(RETRY_FIRST_MS, current.expiresAt - this.now() - MIN_REMAINING_MS));
151
+ return current.assertion;
152
+ }
153
+ this.publish({
154
+ ...IDLE,
155
+ status: unsupported ? 'unsupported' : 'unavailable',
156
+ platform: this.options.integrity.platform,
157
+ error: code
158
+ });
159
+ if (!unsupported) {
160
+ if (PERMANENT_REFUSALS.has(code)) {
161
+ this.retryAt = Number.POSITIVE_INFINITY;
162
+ } else {
163
+ this.retryAt = this.now() + this.retryMs;
164
+ this.schedule(this.retryMs);
165
+ this.retryMs = Math.min(this.retryMs * 2, RETRY_MAX_MS);
166
+ }
167
+ }
168
+ return null;
169
+ }).finally(() => {
170
+ if (this.inflight === run) this.inflight = null;
171
+ });
172
+ this.inflight = run;
173
+ if (this.snapshot.status !== 'ready') this.publish({
174
+ ...this.snapshot,
175
+ status: 'pending'
176
+ });
177
+ return run;
178
+ }
179
+ async obtain() {
180
+ const applicationId = await this.resolveApplicationId();
181
+ const {
182
+ platform
183
+ } = this.options.integrity;
184
+ const assertions = this.options.oxyServices.apps.assertions;
185
+ if (platform === 'web') return assertions.create({
186
+ applicationId,
187
+ platform: 'web'
188
+ });
189
+ const integrity = await this.options.integrity.loadIntegrity();
190
+ if (!integrity) throw new Unsupported('integrity_module_unavailable');
191
+ if (platform === 'android') return this.proveAndroid(applicationId, integrity);
192
+ if (!integrity.isSupported) throw new Unsupported('app_attest_unsupported');
193
+ return this.proveIos(applicationId, integrity);
194
+ }
195
+ resolveApplicationId() {
196
+ const clientId = this.options.clientId;
197
+ if (!clientId) return Promise.reject(new Unsupported('client_id_missing'));
198
+ if (this.applicationId?.clientId !== clientId) {
199
+ const id = this.options.oxyServices.apps.getPublic(clientId).then(app => app.id);
200
+ id.catch(() => {
201
+ if (this.applicationId?.id === id) this.applicationId = null;
202
+ });
203
+ this.applicationId = {
204
+ clientId,
205
+ id
206
+ };
207
+ }
208
+ return this.applicationId.id;
209
+ }
210
+ async proveAndroid(applicationId, integrity) {
211
+ const assertions = this.options.oxyServices.apps.assertions;
212
+ const challenge = await assertions.challenge({
213
+ applicationId,
214
+ platform: 'android'
215
+ });
216
+ if (!challenge.cloudProjectNumber) throw new Unsupported('integrity_unconfigured');
217
+ try {
218
+ if (this.preparedProject !== challenge.cloudProjectNumber) {
219
+ await integrity.prepareIntegrityTokenProviderAsync(challenge.cloudProjectNumber);
220
+ this.preparedProject = challenge.cloudProjectNumber;
221
+ }
222
+ const integrityToken = await integrity.requestIntegrityCheckAsync(challenge.requestHash);
223
+ return await assertions.create({
224
+ applicationId,
225
+ platform: 'android',
226
+ proof: {
227
+ challenge: challenge.challenge,
228
+ integrityToken
229
+ }
230
+ });
231
+ } catch (error) {
232
+ // A provider Google invalidated is prepared again on the next attempt.
233
+ this.preparedProject = null;
234
+ throw error;
235
+ }
236
+ }
237
+ async proveIos(applicationId, integrity) {
238
+ const keyName = `${this.options.storageKeyPrefix}_app_attest_key_${applicationId}`;
239
+ const storage = this.options.storage();
240
+ const assertOnce = async keyId => {
241
+ const assertions = this.options.oxyServices.apps.assertions;
242
+ const challenge = await assertions.challenge({
243
+ applicationId,
244
+ platform: 'ios',
245
+ purpose: 'assertion'
246
+ });
247
+ const assertion = await integrity.generateAssertionAsync(keyId, challenge.requestHash);
248
+ return assertions.create({
249
+ applicationId,
250
+ platform: 'ios',
251
+ proof: {
252
+ challenge: challenge.challenge,
253
+ keyId,
254
+ assertion
255
+ }
256
+ });
257
+ };
258
+ const stored = await storage?.getItem(keyName).catch(() => null);
259
+ if (stored) {
260
+ try {
261
+ return await assertOnce(stored);
262
+ } catch (error) {
263
+ // Oxy no longer knows the key (swept, or never registered): attest a new one.
264
+ if (errorCode(error) !== 'attest_key_unknown') throw error;
265
+ await storage?.removeItem(keyName).catch(() => undefined);
266
+ }
267
+ }
268
+ const keyId = await this.attestKey(applicationId, integrity);
269
+ await storage?.setItem(keyName, keyId).catch(() => undefined);
270
+ return assertOnce(keyId);
271
+ }
272
+ async attestKey(applicationId, integrity) {
273
+ const assertions = this.options.oxyServices.apps.assertions;
274
+ const keyId = await integrity.generateKeyAsync();
275
+ const challenge = await assertions.challenge({
276
+ applicationId,
277
+ platform: 'ios',
278
+ purpose: 'attest_key'
279
+ });
280
+ const attestation = await integrity.attestKeyAsync(keyId, challenge.requestHash);
281
+ await assertions.registerAttestKey({
282
+ applicationId,
283
+ keyId,
284
+ challenge: challenge.challenge,
285
+ attestation
286
+ });
287
+ return keyId;
288
+ }
289
+ schedule(ms) {
290
+ this.cancelTimer();
291
+ const generation = this.generation;
292
+ this.timer = this.setTimer(() => {
293
+ this.timer = null;
294
+ if (generation === this.generation && this.session) void this.refresh();
295
+ }, ms);
296
+ }
297
+ cancelTimer() {
298
+ if (this.timer !== null) {
299
+ this.clearTimer(this.timer);
300
+ this.timer = null;
301
+ }
302
+ }
303
+ publish(next) {
304
+ this.snapshot = next;
305
+ for (const listener of this.listeners) listener();
306
+ }
307
+ }
308
+ exports.AppAssertionManager = AppAssertionManager;
309
+ //# sourceMappingURL=appAssertionManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_client","require","REFRESH_BEFORE_MS","MIN_REMAINING_MS","RETRY_FIRST_MS","RETRY_MAX_MS","PERMANENT_REFUSALS","Set","IDLE","status","assertion","applicationId","platform","expiresAt","error","Unsupported","Error","constructor","reason","errorCode","code","length","AppAssertionManager","snapshot","listeners","session","generation","inflight","timer","retryMs","retryAt","preparedProject","options","now","Date","setTimer","run","ms","setTimeout","clearTimer","clearTimeout","subscribe","listener","add","delete","getSnapshot","getAppAssertion","current","refresh","getAppAssertionHeaders","OXY_APP_ASSERTION_HEADER","setSession","same","userId","sessionId","cancelTimer","publish","dispose","obtain","then","answer","parse","schedule","Math","max","catch","unsupported","has","min","integrity","Number","POSITIVE_INFINITY","finally","resolveApplicationId","assertions","oxyServices","apps","create","loadIntegrity","proveAndroid","isSupported","proveIos","clientId","Promise","reject","id","getPublic","app","challenge","cloudProjectNumber","prepareIntegrityTokenProviderAsync","integrityToken","requestIntegrityCheckAsync","requestHash","proof","keyName","storageKeyPrefix","storage","assertOnce","keyId","purpose","generateAssertionAsync","stored","getItem","removeItem","undefined","attestKey","setItem","generateKeyAsync","attestation","attestKeyAsync","registerAttestKey","next","exports"],"sourceRoot":"../../../../src","sources":["ui/appAssertion/app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;MAC3B,IAAI,CAACA,KAAK,GAAG,IAAI;IACnB;EACF;EAEQ4B,OAAOA,CAACwD,IAA0B,EAAQ;IAChD,IAAI,CAACzF,QAAQ,GAAGyF,IAAI;IACpB,KAAK,MAAMtE,QAAQ,IAAI,IAAI,CAAClB,SAAS,EAAEkB,QAAQ,CAAC,CAAC;EACnD;AACF;AAACuE,OAAA,CAAA3F,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.appIntegrityPlatform = void 0;
7
+ /**
8
+ * Web: the app proves itself with the browser's `Origin`, which Oxy reads from
9
+ * the request itself (ADR 0045). Nothing to load.
10
+ *
11
+ * Native builds resolve `appIntegrityPlatform.native.ts` instead.
12
+ */
13
+
14
+ const appIntegrityPlatform = exports.appIntegrityPlatform = {
15
+ platform: 'web',
16
+ loadIntegrity: async () => null
17
+ };
18
+ //# sourceMappingURL=appIntegrityPlatform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["appIntegrityPlatform","exports","platform","loadIntegrity"],"sourceRoot":"../../../../src","sources":["ui/appAssertion/appIntegrityPlatform.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAGO,MAAMA,oBAA0C,GAAAC,OAAA,CAAAD,oBAAA,GAAG;EACxDE,QAAQ,EAAE,KAAK;EACfC,aAAa,EAAE,MAAAA,CAAA,KAAY;AAC7B,CAAC","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.appIntegrityPlatform = void 0;
7
+ var _reactNative = require("react-native");
8
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } /**
9
+ * iOS and Android: the app proves itself with App Attest or Play Integrity
10
+ * through `@expo/app-integrity` (ADR 0045).
11
+ *
12
+ * The module is loaded lazily, and its `import()` is a direct statement of a
13
+ * `try` block — the shape Metro marks OPTIONAL — so an app bundle that lacks
14
+ * the package, or a binary built before it was added (an over-the-air update
15
+ * of the JavaScript alone), still boots: `requireNativeModule` throws inside
16
+ * the import, and the app simply has no assertion.
17
+ */
18
+ async function loadIntegrity() {
19
+ try {
20
+ const integrity = await Promise.resolve().then(() => _interopRequireWildcard(require('@expo/app-integrity')));
21
+ return integrity;
22
+ } catch {
23
+ return null;
24
+ }
25
+ }
26
+ const appIntegrityPlatform = exports.appIntegrityPlatform = {
27
+ platform: _reactNative.Platform.OS === 'ios' ? 'ios' : _reactNative.Platform.OS === 'android' ? 'android' : 'web',
28
+ loadIntegrity: _reactNative.Platform.OS === 'ios' || _reactNative.Platform.OS === 'android' ? loadIntegrity : async () => null
29
+ };
30
+ //# sourceMappingURL=appIntegrityPlatform.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","loadIntegrity","integrity","Promise","resolve","then","appIntegrityPlatform","exports","platform","Platform","OS"],"sourceRoot":"../../../../src","sources":["ui/appAssertion/appIntegrityPlatform.native.ts"],"mappings":";;;;;;AAUA,IAAAA,YAAA,GAAAC,OAAA;AAAwC,SAAAC,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,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AAG,KAAK,GAAGD,qBAAQ,CAACC,EAAE,KAAK,SAAS,GAAG,SAAS,GAAG,KAAK;EACvFT,aAAa,EACXQ,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAID,qBAAQ,CAACC,EAAE,KAAK,SAAS,GAAGT,aAAa,GAAG,YAAY;AACrF,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=appIntegrityTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["ui/appAssertion/appIntegrityTypes.ts"],"mappings":"","ignoreList":[]}