@metamask/profile-sync-controller 29.0.0 → 31.0.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 (537) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/dist/controllers/authentication/{AuthenticationController-method-action-types.d.mts → AuthenticationController-method-action-types.d.ts} +2 -2
  3. package/dist/controllers/authentication/AuthenticationController-method-action-types.d.ts.map +1 -0
  4. package/dist/controllers/authentication/{AuthenticationController-method-action-types.mjs → AuthenticationController-method-action-types.js} +1 -1
  5. package/dist/controllers/authentication/AuthenticationController-method-action-types.js.map +1 -0
  6. package/dist/controllers/authentication/{AuthenticationController.d.mts → AuthenticationController.d.ts} +30 -12
  7. package/dist/controllers/authentication/AuthenticationController.d.ts.map +1 -0
  8. package/dist/controllers/authentication/AuthenticationController.js +656 -0
  9. package/dist/controllers/authentication/AuthenticationController.js.map +1 -0
  10. package/dist/controllers/authentication/{index.d.cts → index.d.ts} +5 -5
  11. package/dist/controllers/authentication/index.d.ts.map +1 -0
  12. package/dist/controllers/authentication/index.js +6 -0
  13. package/dist/controllers/authentication/index.js.map +1 -0
  14. package/dist/controllers/authentication/mocks/index.d.ts +2 -0
  15. package/dist/controllers/authentication/mocks/index.d.ts.map +1 -0
  16. package/dist/controllers/authentication/mocks/index.js +2 -0
  17. package/dist/controllers/authentication/mocks/index.js.map +1 -0
  18. package/dist/controllers/authentication/mocks/{mockResponses.d.cts → mockResponses.d.ts} +12 -1
  19. package/dist/controllers/authentication/mocks/{mockResponses.d.cts.map → mockResponses.d.ts.map} +1 -1
  20. package/dist/controllers/authentication/mocks/{mockResponses.mjs → mockResponses.js} +10 -2
  21. package/dist/controllers/authentication/mocks/mockResponses.js.map +1 -0
  22. package/dist/controllers/index.d.ts +3 -0
  23. package/dist/controllers/index.d.ts.map +1 -0
  24. package/dist/controllers/index.js +3 -0
  25. package/dist/controllers/index.js.map +1 -0
  26. package/dist/controllers/user-storage/{UserStorageController-method-action-types.d.mts → UserStorageController-method-action-types.d.ts} +2 -2
  27. package/dist/controllers/user-storage/UserStorageController-method-action-types.d.ts.map +1 -0
  28. package/dist/controllers/user-storage/{UserStorageController-method-action-types.mjs → UserStorageController-method-action-types.js} +1 -1
  29. package/dist/controllers/user-storage/UserStorageController-method-action-types.js.map +1 -0
  30. package/dist/controllers/user-storage/{UserStorageController.d.cts → UserStorageController.d.ts} +15 -16
  31. package/dist/controllers/user-storage/UserStorageController.d.ts.map +1 -0
  32. package/dist/controllers/user-storage/UserStorageController.js +429 -0
  33. package/dist/controllers/user-storage/UserStorageController.js.map +1 -0
  34. package/dist/controllers/user-storage/constants.d.ts +15 -0
  35. package/dist/controllers/user-storage/constants.d.ts.map +1 -0
  36. package/dist/controllers/user-storage/{constants.mjs → constants.js} +1 -1
  37. package/dist/controllers/user-storage/constants.js.map +1 -0
  38. package/dist/controllers/user-storage/contact-syncing/{constants.d.cts → constants.d.ts} +1 -1
  39. package/dist/controllers/user-storage/contact-syncing/constants.d.ts.map +1 -0
  40. package/dist/controllers/user-storage/contact-syncing/{constants.mjs → constants.js} +1 -1
  41. package/dist/controllers/user-storage/contact-syncing/constants.js.map +1 -0
  42. package/dist/controllers/user-storage/contact-syncing/{controller-integration.d.cts → controller-integration.d.ts} +3 -3
  43. package/dist/controllers/user-storage/contact-syncing/controller-integration.d.ts.map +1 -0
  44. package/dist/controllers/user-storage/contact-syncing/{controller-integration.mjs → controller-integration.js} +6 -6
  45. package/dist/controllers/user-storage/contact-syncing/controller-integration.js.map +1 -0
  46. package/dist/controllers/user-storage/contact-syncing/{setup-subscriptions.d.cts → setup-subscriptions.d.ts} +2 -2
  47. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.d.ts.map +1 -0
  48. package/dist/controllers/user-storage/contact-syncing/{setup-subscriptions.mjs → setup-subscriptions.js} +4 -4
  49. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.js.map +1 -0
  50. package/dist/controllers/user-storage/contact-syncing/{sync-utils.d.cts → sync-utils.d.ts} +2 -2
  51. package/dist/controllers/user-storage/contact-syncing/sync-utils.d.ts.map +1 -0
  52. package/dist/controllers/user-storage/contact-syncing/{sync-utils.mjs → sync-utils.js} +1 -1
  53. package/dist/controllers/user-storage/contact-syncing/sync-utils.js.map +1 -0
  54. package/dist/controllers/user-storage/contact-syncing/{types.d.cts → types.d.ts} +6 -6
  55. package/dist/controllers/user-storage/contact-syncing/types.d.ts.map +1 -0
  56. package/dist/controllers/user-storage/contact-syncing/types.js +2 -0
  57. package/dist/controllers/user-storage/contact-syncing/types.js.map +1 -0
  58. package/dist/controllers/user-storage/contact-syncing/{utils.d.cts → utils.d.ts} +3 -3
  59. package/dist/controllers/user-storage/contact-syncing/utils.d.ts.map +1 -0
  60. package/dist/controllers/user-storage/contact-syncing/{utils.mjs → utils.js} +2 -2
  61. package/dist/controllers/user-storage/contact-syncing/utils.js.map +1 -0
  62. package/dist/controllers/user-storage/{index.d.cts → index.d.ts} +8 -8
  63. package/dist/controllers/user-storage/index.d.ts.map +1 -0
  64. package/dist/controllers/user-storage/index.js +9 -0
  65. package/dist/controllers/user-storage/index.js.map +1 -0
  66. package/dist/controllers/user-storage/mocks/index.d.ts +3 -0
  67. package/dist/controllers/user-storage/mocks/index.d.ts.map +1 -0
  68. package/dist/controllers/user-storage/mocks/index.js +3 -0
  69. package/dist/controllers/user-storage/mocks/index.js.map +1 -0
  70. package/dist/controllers/user-storage/mocks/{mockResponses.d.mts → mockResponses.d.ts} +3 -3
  71. package/dist/controllers/user-storage/mocks/mockResponses.d.ts.map +1 -0
  72. package/dist/controllers/user-storage/mocks/{mockResponses.mjs → mockResponses.js} +4 -4
  73. package/dist/controllers/user-storage/mocks/mockResponses.js.map +1 -0
  74. package/dist/controllers/user-storage/mocks/{mockStorage.d.cts → mockStorage.d.ts} +1 -1
  75. package/dist/controllers/user-storage/mocks/mockStorage.d.ts.map +1 -0
  76. package/dist/controllers/user-storage/mocks/{mockStorage.mjs → mockStorage.js} +3 -3
  77. package/dist/controllers/user-storage/mocks/mockStorage.js.map +1 -0
  78. package/dist/controllers/user-storage/{types.d.cts → types.d.ts} +3 -3
  79. package/dist/controllers/user-storage/types.d.ts.map +1 -0
  80. package/dist/controllers/user-storage/types.js +2 -0
  81. package/dist/controllers/user-storage/types.js.map +1 -0
  82. package/dist/controllers/user-storage/{utils.d.cts → utils.d.ts} +1 -1
  83. package/dist/controllers/user-storage/utils.d.ts.map +1 -0
  84. package/dist/controllers/user-storage/{utils.mjs → utils.js} +1 -1
  85. package/dist/controllers/user-storage/utils.js.map +1 -0
  86. package/dist/index.d.ts +4 -0
  87. package/dist/index.d.ts.map +1 -0
  88. package/dist/index.js +4 -0
  89. package/dist/index.js.map +1 -0
  90. package/dist/sdk/authentication-jwt-bearer/{flow-siwe.d.cts → flow-siwe.d.ts} +2 -2
  91. package/dist/sdk/authentication-jwt-bearer/flow-siwe.d.ts.map +1 -0
  92. package/dist/sdk/authentication-jwt-bearer/flow-siwe.js +99 -0
  93. package/dist/sdk/authentication-jwt-bearer/flow-siwe.js.map +1 -0
  94. package/dist/sdk/authentication-jwt-bearer/{flow-srp.d.mts → flow-srp.d.ts} +6 -5
  95. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.ts.map +1 -0
  96. package/dist/sdk/authentication-jwt-bearer/flow-srp.js +258 -0
  97. package/dist/sdk/authentication-jwt-bearer/flow-srp.js.map +1 -0
  98. package/dist/sdk/authentication-jwt-bearer/{services.d.mts → services.d.ts} +20 -5
  99. package/dist/sdk/authentication-jwt-bearer/services.d.ts.map +1 -0
  100. package/dist/sdk/authentication-jwt-bearer/{services.mjs → services.js} +47 -6
  101. package/dist/sdk/authentication-jwt-bearer/services.js.map +1 -0
  102. package/dist/sdk/authentication-jwt-bearer/{types.d.cts → types.d.ts} +22 -3
  103. package/dist/sdk/authentication-jwt-bearer/types.d.ts.map +1 -0
  104. package/dist/sdk/authentication-jwt-bearer/{types.mjs → types.js} +1 -1
  105. package/dist/sdk/authentication-jwt-bearer/types.js.map +1 -0
  106. package/dist/sdk/authentication-jwt-bearer/utils/{identifier.d.cts → identifier.d.ts} +2 -2
  107. package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.ts.map +1 -0
  108. package/dist/sdk/authentication-jwt-bearer/utils/{identifier.mjs → identifier.js} +2 -2
  109. package/dist/sdk/authentication-jwt-bearer/utils/identifier.js.map +1 -0
  110. package/dist/sdk/authentication-jwt-bearer/utils/{time.d.cts → time.d.ts} +1 -1
  111. package/dist/sdk/authentication-jwt-bearer/utils/time.d.ts.map +1 -0
  112. package/dist/sdk/authentication-jwt-bearer/utils/{time.mjs → time.js} +1 -1
  113. package/dist/sdk/authentication-jwt-bearer/utils/time.js.map +1 -0
  114. package/dist/sdk/{authentication.d.cts → authentication.d.ts} +10 -9
  115. package/dist/sdk/authentication.d.ts.map +1 -0
  116. package/dist/sdk/authentication.js +104 -0
  117. package/dist/sdk/authentication.js.map +1 -0
  118. package/dist/sdk/{constants.d.cts → constants.d.ts} +2 -1
  119. package/dist/sdk/constants.d.ts.map +1 -0
  120. package/dist/sdk/{constants.mjs → constants.js} +2 -1
  121. package/dist/sdk/constants.js.map +1 -0
  122. package/dist/sdk/{errors.d.mts → errors.d.ts} +10 -1
  123. package/dist/sdk/errors.d.ts.map +1 -0
  124. package/dist/sdk/{errors.mjs → errors.js} +16 -3
  125. package/dist/sdk/errors.js.map +1 -0
  126. package/dist/sdk/index.d.ts +8 -0
  127. package/dist/sdk/index.d.ts.map +1 -0
  128. package/dist/sdk/index.js +8 -0
  129. package/dist/sdk/index.js.map +1 -0
  130. package/dist/sdk/mocks/{auth.d.cts → auth.d.ts} +13 -2
  131. package/dist/sdk/mocks/auth.d.ts.map +1 -0
  132. package/dist/sdk/mocks/{auth.mjs → auth.js} +14 -3
  133. package/dist/sdk/mocks/auth.js.map +1 -0
  134. package/dist/sdk/mocks/{userstorage.d.cts → userstorage.d.ts} +1 -1
  135. package/dist/sdk/mocks/userstorage.d.ts.map +1 -0
  136. package/dist/sdk/mocks/{userstorage.mjs → userstorage.js} +5 -5
  137. package/dist/sdk/mocks/userstorage.js.map +1 -0
  138. package/dist/sdk/{user-storage.d.mts → user-storage.d.ts} +5 -5
  139. package/dist/sdk/user-storage.d.ts.map +1 -0
  140. package/dist/sdk/user-storage.js +364 -0
  141. package/dist/sdk/user-storage.js.map +1 -0
  142. package/dist/sdk/utils/{eip-6963-metamask-provider.d.cts → eip-6963-metamask-provider.d.ts} +2 -2
  143. package/dist/sdk/utils/eip-6963-metamask-provider.d.ts.map +1 -0
  144. package/dist/sdk/utils/{eip-6963-metamask-provider.mjs → eip-6963-metamask-provider.js} +1 -1
  145. package/dist/sdk/utils/eip-6963-metamask-provider.js.map +1 -0
  146. package/dist/sdk/utils/{messaging-signing-snap-requests.d.mts → messaging-signing-snap-requests.d.ts} +2 -2
  147. package/dist/sdk/utils/messaging-signing-snap-requests.d.ts.map +1 -0
  148. package/dist/sdk/utils/{messaging-signing-snap-requests.mjs → messaging-signing-snap-requests.js} +1 -1
  149. package/dist/sdk/utils/messaging-signing-snap-requests.js.map +1 -0
  150. package/dist/sdk/utils/{validate-login-response.d.mts → validate-login-response.d.ts} +2 -2
  151. package/dist/sdk/utils/validate-login-response.d.ts.map +1 -0
  152. package/dist/sdk/utils/{validate-login-response.mjs → validate-login-response.js} +1 -1
  153. package/dist/sdk/utils/validate-login-response.js.map +1 -0
  154. package/dist/sdk/utils/{validate-pair-response.d.cts → validate-pair-response.d.ts} +1 -1
  155. package/dist/sdk/utils/validate-pair-response.d.ts.map +1 -0
  156. package/dist/sdk/utils/{validate-pair-response.mjs → validate-pair-response.js} +1 -1
  157. package/dist/sdk/utils/validate-pair-response.js.map +1 -0
  158. package/dist/shared/encryption/{cache.d.cts → cache.d.ts} +1 -1
  159. package/dist/shared/encryption/cache.d.ts.map +1 -0
  160. package/dist/shared/encryption/{cache.mjs → cache.js} +4 -4
  161. package/dist/shared/encryption/cache.js.map +1 -0
  162. package/dist/shared/encryption/{constants.d.cts → constants.d.ts} +2 -2
  163. package/dist/shared/encryption/constants.d.ts.map +1 -0
  164. package/dist/shared/encryption/{constants.mjs → constants.js} +1 -1
  165. package/dist/shared/encryption/constants.js.map +1 -0
  166. package/dist/shared/encryption/{encryption.d.cts → encryption.d.ts} +3 -3
  167. package/dist/shared/encryption/encryption.d.ts.map +1 -0
  168. package/dist/shared/encryption/encryption.js +202 -0
  169. package/dist/shared/encryption/encryption.js.map +1 -0
  170. package/dist/shared/encryption/index.d.ts +5 -0
  171. package/dist/shared/encryption/index.d.ts.map +1 -0
  172. package/dist/shared/encryption/index.js +5 -0
  173. package/dist/shared/encryption/index.js.map +1 -0
  174. package/dist/shared/encryption/{utils.d.cts → utils.d.ts} +3 -3
  175. package/dist/shared/encryption/utils.d.ts.map +1 -0
  176. package/dist/shared/encryption/{utils.mjs → utils.js} +1 -1
  177. package/dist/shared/encryption/utils.js.map +1 -0
  178. package/dist/shared/{env.d.mts → env.d.ts} +1 -1
  179. package/dist/shared/env.d.ts.map +1 -0
  180. package/dist/shared/{env.mjs → env.js} +1 -1
  181. package/dist/shared/env.js.map +1 -0
  182. package/dist/shared/{storage-schema.d.mts → storage-schema.d.ts} +1 -1
  183. package/dist/shared/storage-schema.d.ts.map +1 -0
  184. package/dist/shared/{storage-schema.mjs → storage-schema.js} +2 -2
  185. package/dist/shared/storage-schema.js.map +1 -0
  186. package/dist/shared/types/{encryption.d.cts → encryption.d.ts} +1 -1
  187. package/dist/shared/types/encryption.d.ts.map +1 -0
  188. package/dist/shared/types/encryption.js +2 -0
  189. package/dist/shared/types/encryption.js.map +1 -0
  190. package/dist/shared/types/{services.d.cts → services.d.ts} +2 -2
  191. package/dist/shared/types/services.d.ts.map +1 -0
  192. package/dist/shared/types/services.js +2 -0
  193. package/dist/shared/types/services.js.map +1 -0
  194. package/dist/shared/utils/entropy-source.d.ts +22 -0
  195. package/dist/shared/utils/entropy-source.d.ts.map +1 -0
  196. package/dist/shared/utils/entropy-source.js +32 -0
  197. package/dist/shared/utils/entropy-source.js.map +1 -0
  198. package/dist/shared/utils/{event-queue.d.cts → event-queue.d.ts} +1 -1
  199. package/dist/shared/utils/event-queue.d.ts.map +1 -0
  200. package/dist/shared/utils/{event-queue.mjs → event-queue.js} +2 -4
  201. package/dist/shared/utils/event-queue.js.map +1 -0
  202. package/dist/shared/utils/hd-keyring-seed.d.ts +27 -0
  203. package/dist/shared/utils/hd-keyring-seed.d.ts.map +1 -0
  204. package/dist/shared/utils/hd-keyring-seed.js +45 -0
  205. package/dist/shared/utils/hd-keyring-seed.js.map +1 -0
  206. package/dist/shared/utils/message-signing.d.ts +73 -0
  207. package/dist/shared/utils/message-signing.d.ts.map +1 -0
  208. package/dist/shared/utils/message-signing.js +140 -0
  209. package/dist/shared/utils/message-signing.js.map +1 -0
  210. package/package.json +35 -69
  211. package/dist/controllers/authentication/AuthenticationController-method-action-types.cjs +0 -7
  212. package/dist/controllers/authentication/AuthenticationController-method-action-types.cjs.map +0 -1
  213. package/dist/controllers/authentication/AuthenticationController-method-action-types.d.cts +0 -102
  214. package/dist/controllers/authentication/AuthenticationController-method-action-types.d.cts.map +0 -1
  215. package/dist/controllers/authentication/AuthenticationController-method-action-types.d.mts.map +0 -1
  216. package/dist/controllers/authentication/AuthenticationController-method-action-types.mjs.map +0 -1
  217. package/dist/controllers/authentication/AuthenticationController.cjs +0 -501
  218. package/dist/controllers/authentication/AuthenticationController.cjs.map +0 -1
  219. package/dist/controllers/authentication/AuthenticationController.d.cts +0 -131
  220. package/dist/controllers/authentication/AuthenticationController.d.cts.map +0 -1
  221. package/dist/controllers/authentication/AuthenticationController.d.mts.map +0 -1
  222. package/dist/controllers/authentication/AuthenticationController.mjs +0 -497
  223. package/dist/controllers/authentication/AuthenticationController.mjs.map +0 -1
  224. package/dist/controllers/authentication/auth-snap-requests.cjs +0 -60
  225. package/dist/controllers/authentication/auth-snap-requests.cjs.map +0 -1
  226. package/dist/controllers/authentication/auth-snap-requests.d.cts +0 -27
  227. package/dist/controllers/authentication/auth-snap-requests.d.cts.map +0 -1
  228. package/dist/controllers/authentication/auth-snap-requests.d.mts +0 -27
  229. package/dist/controllers/authentication/auth-snap-requests.d.mts.map +0 -1
  230. package/dist/controllers/authentication/auth-snap-requests.mjs +0 -54
  231. package/dist/controllers/authentication/auth-snap-requests.mjs.map +0 -1
  232. package/dist/controllers/authentication/index.cjs +0 -35
  233. package/dist/controllers/authentication/index.cjs.map +0 -1
  234. package/dist/controllers/authentication/index.d.cts.map +0 -1
  235. package/dist/controllers/authentication/index.d.mts +0 -7
  236. package/dist/controllers/authentication/index.d.mts.map +0 -1
  237. package/dist/controllers/authentication/index.mjs +0 -6
  238. package/dist/controllers/authentication/index.mjs.map +0 -1
  239. package/dist/controllers/authentication/mocks/index.cjs +0 -18
  240. package/dist/controllers/authentication/mocks/index.cjs.map +0 -1
  241. package/dist/controllers/authentication/mocks/index.d.cts +0 -2
  242. package/dist/controllers/authentication/mocks/index.d.cts.map +0 -1
  243. package/dist/controllers/authentication/mocks/index.d.mts +0 -2
  244. package/dist/controllers/authentication/mocks/index.d.mts.map +0 -1
  245. package/dist/controllers/authentication/mocks/index.mjs +0 -2
  246. package/dist/controllers/authentication/mocks/index.mjs.map +0 -1
  247. package/dist/controllers/authentication/mocks/mockResponses.cjs +0 -126
  248. package/dist/controllers/authentication/mocks/mockResponses.cjs.map +0 -1
  249. package/dist/controllers/authentication/mocks/mockResponses.d.mts +0 -58
  250. package/dist/controllers/authentication/mocks/mockResponses.d.mts.map +0 -1
  251. package/dist/controllers/authentication/mocks/mockResponses.mjs.map +0 -1
  252. package/dist/controllers/index.cjs +0 -29
  253. package/dist/controllers/index.cjs.map +0 -1
  254. package/dist/controllers/index.d.cts +0 -3
  255. package/dist/controllers/index.d.cts.map +0 -1
  256. package/dist/controllers/index.d.mts +0 -3
  257. package/dist/controllers/index.d.mts.map +0 -1
  258. package/dist/controllers/index.mjs +0 -3
  259. package/dist/controllers/index.mjs.map +0 -1
  260. package/dist/controllers/user-storage/UserStorageController-method-action-types.cjs +0 -7
  261. package/dist/controllers/user-storage/UserStorageController-method-action-types.cjs.map +0 -1
  262. package/dist/controllers/user-storage/UserStorageController-method-action-types.d.cts +0 -137
  263. package/dist/controllers/user-storage/UserStorageController-method-action-types.d.cts.map +0 -1
  264. package/dist/controllers/user-storage/UserStorageController-method-action-types.d.mts.map +0 -1
  265. package/dist/controllers/user-storage/UserStorageController-method-action-types.mjs.map +0 -1
  266. package/dist/controllers/user-storage/UserStorageController.cjs +0 -413
  267. package/dist/controllers/user-storage/UserStorageController.cjs.map +0 -1
  268. package/dist/controllers/user-storage/UserStorageController.d.cts.map +0 -1
  269. package/dist/controllers/user-storage/UserStorageController.d.mts +0 -183
  270. package/dist/controllers/user-storage/UserStorageController.d.mts.map +0 -1
  271. package/dist/controllers/user-storage/UserStorageController.mjs +0 -409
  272. package/dist/controllers/user-storage/UserStorageController.mjs.map +0 -1
  273. package/dist/controllers/user-storage/constants.cjs +0 -19
  274. package/dist/controllers/user-storage/constants.cjs.map +0 -1
  275. package/dist/controllers/user-storage/constants.d.cts +0 -15
  276. package/dist/controllers/user-storage/constants.d.cts.map +0 -1
  277. package/dist/controllers/user-storage/constants.d.mts +0 -15
  278. package/dist/controllers/user-storage/constants.d.mts.map +0 -1
  279. package/dist/controllers/user-storage/constants.mjs.map +0 -1
  280. package/dist/controllers/user-storage/contact-syncing/constants.cjs +0 -12
  281. package/dist/controllers/user-storage/contact-syncing/constants.cjs.map +0 -1
  282. package/dist/controllers/user-storage/contact-syncing/constants.d.cts.map +0 -1
  283. package/dist/controllers/user-storage/contact-syncing/constants.d.mts +0 -9
  284. package/dist/controllers/user-storage/contact-syncing/constants.d.mts.map +0 -1
  285. package/dist/controllers/user-storage/contact-syncing/constants.mjs.map +0 -1
  286. package/dist/controllers/user-storage/contact-syncing/controller-integration.cjs +0 -346
  287. package/dist/controllers/user-storage/contact-syncing/controller-integration.cjs.map +0 -1
  288. package/dist/controllers/user-storage/contact-syncing/controller-integration.d.cts.map +0 -1
  289. package/dist/controllers/user-storage/contact-syncing/controller-integration.d.mts +0 -47
  290. package/dist/controllers/user-storage/contact-syncing/controller-integration.d.mts.map +0 -1
  291. package/dist/controllers/user-storage/contact-syncing/controller-integration.mjs.map +0 -1
  292. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.cjs +0 -50
  293. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.cjs.map +0 -1
  294. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.d.cts.map +0 -1
  295. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.d.mts +0 -8
  296. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.d.mts.map +0 -1
  297. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.mjs.map +0 -1
  298. package/dist/controllers/user-storage/contact-syncing/sync-utils.cjs +0 -23
  299. package/dist/controllers/user-storage/contact-syncing/sync-utils.cjs.map +0 -1
  300. package/dist/controllers/user-storage/contact-syncing/sync-utils.d.cts.map +0 -1
  301. package/dist/controllers/user-storage/contact-syncing/sync-utils.d.mts +0 -9
  302. package/dist/controllers/user-storage/contact-syncing/sync-utils.d.mts.map +0 -1
  303. package/dist/controllers/user-storage/contact-syncing/sync-utils.mjs.map +0 -1
  304. package/dist/controllers/user-storage/contact-syncing/types.cjs +0 -3
  305. package/dist/controllers/user-storage/contact-syncing/types.cjs.map +0 -1
  306. package/dist/controllers/user-storage/contact-syncing/types.d.cts.map +0 -1
  307. package/dist/controllers/user-storage/contact-syncing/types.d.mts +0 -37
  308. package/dist/controllers/user-storage/contact-syncing/types.d.mts.map +0 -1
  309. package/dist/controllers/user-storage/contact-syncing/types.mjs +0 -2
  310. package/dist/controllers/user-storage/contact-syncing/types.mjs.map +0 -1
  311. package/dist/controllers/user-storage/contact-syncing/utils.cjs +0 -64
  312. package/dist/controllers/user-storage/contact-syncing/utils.cjs.map +0 -1
  313. package/dist/controllers/user-storage/contact-syncing/utils.d.cts.map +0 -1
  314. package/dist/controllers/user-storage/contact-syncing/utils.d.mts +0 -36
  315. package/dist/controllers/user-storage/contact-syncing/utils.d.mts.map +0 -1
  316. package/dist/controllers/user-storage/contact-syncing/utils.mjs.map +0 -1
  317. package/dist/controllers/user-storage/index.cjs +0 -38
  318. package/dist/controllers/user-storage/index.cjs.map +0 -1
  319. package/dist/controllers/user-storage/index.d.cts.map +0 -1
  320. package/dist/controllers/user-storage/index.d.mts +0 -10
  321. package/dist/controllers/user-storage/index.d.mts.map +0 -1
  322. package/dist/controllers/user-storage/index.mjs +0 -9
  323. package/dist/controllers/user-storage/index.mjs.map +0 -1
  324. package/dist/controllers/user-storage/mocks/index.cjs +0 -19
  325. package/dist/controllers/user-storage/mocks/index.cjs.map +0 -1
  326. package/dist/controllers/user-storage/mocks/index.d.cts +0 -3
  327. package/dist/controllers/user-storage/mocks/index.d.cts.map +0 -1
  328. package/dist/controllers/user-storage/mocks/index.d.mts +0 -3
  329. package/dist/controllers/user-storage/mocks/index.d.mts.map +0 -1
  330. package/dist/controllers/user-storage/mocks/index.mjs +0 -3
  331. package/dist/controllers/user-storage/mocks/index.mjs.map +0 -1
  332. package/dist/controllers/user-storage/mocks/mockResponses.cjs +0 -113
  333. package/dist/controllers/user-storage/mocks/mockResponses.cjs.map +0 -1
  334. package/dist/controllers/user-storage/mocks/mockResponses.d.cts +0 -66
  335. package/dist/controllers/user-storage/mocks/mockResponses.d.cts.map +0 -1
  336. package/dist/controllers/user-storage/mocks/mockResponses.d.mts.map +0 -1
  337. package/dist/controllers/user-storage/mocks/mockResponses.mjs.map +0 -1
  338. package/dist/controllers/user-storage/mocks/mockStorage.cjs +0 -36
  339. package/dist/controllers/user-storage/mocks/mockStorage.cjs.map +0 -1
  340. package/dist/controllers/user-storage/mocks/mockStorage.d.cts.map +0 -1
  341. package/dist/controllers/user-storage/mocks/mockStorage.d.mts +0 -5
  342. package/dist/controllers/user-storage/mocks/mockStorage.d.mts.map +0 -1
  343. package/dist/controllers/user-storage/mocks/mockStorage.mjs.map +0 -1
  344. package/dist/controllers/user-storage/types.cjs +0 -3
  345. package/dist/controllers/user-storage/types.cjs.map +0 -1
  346. package/dist/controllers/user-storage/types.d.cts.map +0 -1
  347. package/dist/controllers/user-storage/types.d.mts +0 -23
  348. package/dist/controllers/user-storage/types.d.mts.map +0 -1
  349. package/dist/controllers/user-storage/types.mjs +0 -2
  350. package/dist/controllers/user-storage/types.mjs.map +0 -1
  351. package/dist/controllers/user-storage/utils.cjs +0 -32
  352. package/dist/controllers/user-storage/utils.cjs.map +0 -1
  353. package/dist/controllers/user-storage/utils.d.cts.map +0 -1
  354. package/dist/controllers/user-storage/utils.d.mts +0 -19
  355. package/dist/controllers/user-storage/utils.d.mts.map +0 -1
  356. package/dist/controllers/user-storage/utils.mjs.map +0 -1
  357. package/dist/index.cjs +0 -30
  358. package/dist/index.cjs.map +0 -1
  359. package/dist/index.d.cts +0 -4
  360. package/dist/index.d.cts.map +0 -1
  361. package/dist/index.d.mts +0 -4
  362. package/dist/index.d.mts.map +0 -1
  363. package/dist/index.mjs +0 -4
  364. package/dist/index.mjs.map +0 -1
  365. package/dist/sdk/authentication-jwt-bearer/flow-siwe.cjs +0 -114
  366. package/dist/sdk/authentication-jwt-bearer/flow-siwe.cjs.map +0 -1
  367. package/dist/sdk/authentication-jwt-bearer/flow-siwe.d.cts.map +0 -1
  368. package/dist/sdk/authentication-jwt-bearer/flow-siwe.d.mts +0 -25
  369. package/dist/sdk/authentication-jwt-bearer/flow-siwe.d.mts.map +0 -1
  370. package/dist/sdk/authentication-jwt-bearer/flow-siwe.mjs +0 -110
  371. package/dist/sdk/authentication-jwt-bearer/flow-siwe.mjs.map +0 -1
  372. package/dist/sdk/authentication-jwt-bearer/flow-srp.cjs +0 -290
  373. package/dist/sdk/authentication-jwt-bearer/flow-srp.cjs.map +0 -1
  374. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.cts +0 -44
  375. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.cts.map +0 -1
  376. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.mts.map +0 -1
  377. package/dist/sdk/authentication-jwt-bearer/flow-srp.mjs +0 -263
  378. package/dist/sdk/authentication-jwt-bearer/flow-srp.mjs.map +0 -1
  379. package/dist/sdk/authentication-jwt-bearer/services.cjs +0 -400
  380. package/dist/sdk/authentication-jwt-bearer/services.cjs.map +0 -1
  381. package/dist/sdk/authentication-jwt-bearer/services.d.cts +0 -105
  382. package/dist/sdk/authentication-jwt-bearer/services.d.cts.map +0 -1
  383. package/dist/sdk/authentication-jwt-bearer/services.d.mts.map +0 -1
  384. package/dist/sdk/authentication-jwt-bearer/services.mjs.map +0 -1
  385. package/dist/sdk/authentication-jwt-bearer/types.cjs +0 -12
  386. package/dist/sdk/authentication-jwt-bearer/types.cjs.map +0 -1
  387. package/dist/sdk/authentication-jwt-bearer/types.d.cts.map +0 -1
  388. package/dist/sdk/authentication-jwt-bearer/types.d.mts +0 -114
  389. package/dist/sdk/authentication-jwt-bearer/types.d.mts.map +0 -1
  390. package/dist/sdk/authentication-jwt-bearer/types.mjs.map +0 -1
  391. package/dist/sdk/authentication-jwt-bearer/utils/identifier.cjs +0 -27
  392. package/dist/sdk/authentication-jwt-bearer/utils/identifier.cjs.map +0 -1
  393. package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.cts.map +0 -1
  394. package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.mts +0 -13
  395. package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.mts.map +0 -1
  396. package/dist/sdk/authentication-jwt-bearer/utils/identifier.mjs.map +0 -1
  397. package/dist/sdk/authentication-jwt-bearer/utils/time.cjs +0 -17
  398. package/dist/sdk/authentication-jwt-bearer/utils/time.cjs.map +0 -1
  399. package/dist/sdk/authentication-jwt-bearer/utils/time.d.cts.map +0 -1
  400. package/dist/sdk/authentication-jwt-bearer/utils/time.d.mts +0 -8
  401. package/dist/sdk/authentication-jwt-bearer/utils/time.d.mts.map +0 -1
  402. package/dist/sdk/authentication-jwt-bearer/utils/time.mjs.map +0 -1
  403. package/dist/sdk/authentication.cjs +0 -132
  404. package/dist/sdk/authentication.cjs.map +0 -1
  405. package/dist/sdk/authentication.d.cts.map +0 -1
  406. package/dist/sdk/authentication.d.mts +0 -38
  407. package/dist/sdk/authentication.d.mts.map +0 -1
  408. package/dist/sdk/authentication.mjs +0 -112
  409. package/dist/sdk/authentication.mjs.map +0 -1
  410. package/dist/sdk/constants.cjs +0 -7
  411. package/dist/sdk/constants.cjs.map +0 -1
  412. package/dist/sdk/constants.d.cts.map +0 -1
  413. package/dist/sdk/constants.d.mts +0 -4
  414. package/dist/sdk/constants.d.mts.map +0 -1
  415. package/dist/sdk/constants.mjs.map +0 -1
  416. package/dist/sdk/errors.cjs +0 -76
  417. package/dist/sdk/errors.cjs.map +0 -1
  418. package/dist/sdk/errors.d.cts +0 -34
  419. package/dist/sdk/errors.d.cts.map +0 -1
  420. package/dist/sdk/errors.d.mts.map +0 -1
  421. package/dist/sdk/errors.mjs.map +0 -1
  422. package/dist/sdk/index.cjs +0 -24
  423. package/dist/sdk/index.cjs.map +0 -1
  424. package/dist/sdk/index.d.cts +0 -8
  425. package/dist/sdk/index.d.cts.map +0 -1
  426. package/dist/sdk/index.d.mts +0 -8
  427. package/dist/sdk/index.d.mts.map +0 -1
  428. package/dist/sdk/index.mjs +0 -8
  429. package/dist/sdk/index.mjs.map +0 -1
  430. package/dist/sdk/mocks/auth.cjs +0 -82
  431. package/dist/sdk/mocks/auth.cjs.map +0 -1
  432. package/dist/sdk/mocks/auth.d.cts.map +0 -1
  433. package/dist/sdk/mocks/auth.d.mts +0 -69
  434. package/dist/sdk/mocks/auth.d.mts.map +0 -1
  435. package/dist/sdk/mocks/auth.mjs.map +0 -1
  436. package/dist/sdk/mocks/userstorage.cjs +0 -43
  437. package/dist/sdk/mocks/userstorage.cjs.map +0 -1
  438. package/dist/sdk/mocks/userstorage.d.cts.map +0 -1
  439. package/dist/sdk/mocks/userstorage.d.mts +0 -10
  440. package/dist/sdk/mocks/userstorage.d.mts.map +0 -1
  441. package/dist/sdk/mocks/userstorage.mjs.map +0 -1
  442. package/dist/sdk/user-storage.cjs +0 -386
  443. package/dist/sdk/user-storage.cjs.map +0 -1
  444. package/dist/sdk/user-storage.d.cts +0 -47
  445. package/dist/sdk/user-storage.d.cts.map +0 -1
  446. package/dist/sdk/user-storage.d.mts.map +0 -1
  447. package/dist/sdk/user-storage.mjs +0 -358
  448. package/dist/sdk/user-storage.mjs.map +0 -1
  449. package/dist/sdk/utils/eip-6963-metamask-provider.cjs +0 -70
  450. package/dist/sdk/utils/eip-6963-metamask-provider.cjs.map +0 -1
  451. package/dist/sdk/utils/eip-6963-metamask-provider.d.cts.map +0 -1
  452. package/dist/sdk/utils/eip-6963-metamask-provider.d.mts +0 -25
  453. package/dist/sdk/utils/eip-6963-metamask-provider.d.mts.map +0 -1
  454. package/dist/sdk/utils/eip-6963-metamask-provider.mjs.map +0 -1
  455. package/dist/sdk/utils/messaging-signing-snap-requests.cjs +0 -96
  456. package/dist/sdk/utils/messaging-signing-snap-requests.cjs.map +0 -1
  457. package/dist/sdk/utils/messaging-signing-snap-requests.d.cts +0 -41
  458. package/dist/sdk/utils/messaging-signing-snap-requests.d.cts.map +0 -1
  459. package/dist/sdk/utils/messaging-signing-snap-requests.d.mts.map +0 -1
  460. package/dist/sdk/utils/messaging-signing-snap-requests.mjs.map +0 -1
  461. package/dist/sdk/utils/validate-login-response.cjs +0 -49
  462. package/dist/sdk/utils/validate-login-response.cjs.map +0 -1
  463. package/dist/sdk/utils/validate-login-response.d.cts +0 -14
  464. package/dist/sdk/utils/validate-login-response.d.cts.map +0 -1
  465. package/dist/sdk/utils/validate-login-response.d.mts.map +0 -1
  466. package/dist/sdk/utils/validate-login-response.mjs.map +0 -1
  467. package/dist/sdk/utils/validate-pair-response.cjs +0 -29
  468. package/dist/sdk/utils/validate-pair-response.cjs.map +0 -1
  469. package/dist/sdk/utils/validate-pair-response.d.cts.map +0 -1
  470. package/dist/sdk/utils/validate-pair-response.d.mts +0 -26
  471. package/dist/sdk/utils/validate-pair-response.d.mts.map +0 -1
  472. package/dist/sdk/utils/validate-pair-response.mjs.map +0 -1
  473. package/dist/shared/encryption/cache.cjs +0 -77
  474. package/dist/shared/encryption/cache.cjs.map +0 -1
  475. package/dist/shared/encryption/cache.d.cts.map +0 -1
  476. package/dist/shared/encryption/cache.d.mts +0 -32
  477. package/dist/shared/encryption/cache.d.mts.map +0 -1
  478. package/dist/shared/encryption/cache.mjs.map +0 -1
  479. package/dist/shared/encryption/constants.cjs +0 -17
  480. package/dist/shared/encryption/constants.cjs.map +0 -1
  481. package/dist/shared/encryption/constants.d.cts.map +0 -1
  482. package/dist/shared/encryption/constants.d.mts +0 -9
  483. package/dist/shared/encryption/constants.d.mts.map +0 -1
  484. package/dist/shared/encryption/constants.mjs.map +0 -1
  485. package/dist/shared/encryption/encryption.cjs +0 -209
  486. package/dist/shared/encryption/encryption.cjs.map +0 -1
  487. package/dist/shared/encryption/encryption.d.cts.map +0 -1
  488. package/dist/shared/encryption/encryption.d.mts +0 -30
  489. package/dist/shared/encryption/encryption.d.mts.map +0 -1
  490. package/dist/shared/encryption/encryption.mjs +0 -205
  491. package/dist/shared/encryption/encryption.mjs.map +0 -1
  492. package/dist/shared/encryption/index.cjs +0 -25
  493. package/dist/shared/encryption/index.cjs.map +0 -1
  494. package/dist/shared/encryption/index.d.cts +0 -5
  495. package/dist/shared/encryption/index.d.cts.map +0 -1
  496. package/dist/shared/encryption/index.d.mts +0 -5
  497. package/dist/shared/encryption/index.d.mts.map +0 -1
  498. package/dist/shared/encryption/index.mjs +0 -5
  499. package/dist/shared/encryption/index.mjs.map +0 -1
  500. package/dist/shared/encryption/utils.cjs +0 -21
  501. package/dist/shared/encryption/utils.cjs.map +0 -1
  502. package/dist/shared/encryption/utils.d.cts.map +0 -1
  503. package/dist/shared/encryption/utils.d.mts +0 -5
  504. package/dist/shared/encryption/utils.d.mts.map +0 -1
  505. package/dist/shared/encryption/utils.mjs.map +0 -1
  506. package/dist/shared/env.cjs +0 -85
  507. package/dist/shared/env.cjs.map +0 -1
  508. package/dist/shared/env.d.cts +0 -34
  509. package/dist/shared/env.d.cts.map +0 -1
  510. package/dist/shared/env.d.mts.map +0 -1
  511. package/dist/shared/env.mjs.map +0 -1
  512. package/dist/shared/storage-schema.cjs +0 -42
  513. package/dist/shared/storage-schema.cjs.map +0 -1
  514. package/dist/shared/storage-schema.d.cts +0 -34
  515. package/dist/shared/storage-schema.d.cts.map +0 -1
  516. package/dist/shared/storage-schema.d.mts.map +0 -1
  517. package/dist/shared/storage-schema.mjs.map +0 -1
  518. package/dist/shared/types/encryption.cjs +0 -3
  519. package/dist/shared/types/encryption.cjs.map +0 -1
  520. package/dist/shared/types/encryption.d.cts.map +0 -1
  521. package/dist/shared/types/encryption.d.mts +0 -2
  522. package/dist/shared/types/encryption.d.mts.map +0 -1
  523. package/dist/shared/types/encryption.mjs +0 -2
  524. package/dist/shared/types/encryption.mjs.map +0 -1
  525. package/dist/shared/types/services.cjs +0 -3
  526. package/dist/shared/types/services.cjs.map +0 -1
  527. package/dist/shared/types/services.d.cts.map +0 -1
  528. package/dist/shared/types/services.d.mts +0 -17
  529. package/dist/shared/types/services.d.mts.map +0 -1
  530. package/dist/shared/types/services.mjs +0 -2
  531. package/dist/shared/types/services.mjs.map +0 -1
  532. package/dist/shared/utils/event-queue.cjs +0 -24
  533. package/dist/shared/utils/event-queue.cjs.map +0 -1
  534. package/dist/shared/utils/event-queue.d.cts.map +0 -1
  535. package/dist/shared/utils/event-queue.d.mts +0 -6
  536. package/dist/shared/utils/event-queue.d.mts.map +0 -1
  537. package/dist/shared/utils/event-queue.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/index.ts"],"names":[],"mappings":"AAAA,oCAAmC;AACnC,kCAAiC","sourcesContent":["export * from './mockResponses.js';\nexport * from './mockStorage.js';\n"]}
@@ -1,113 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteMockUserStorageAllFeatureEntriesResponse = exports.deleteMockUserStorageResponse = exports.getMockUserStorageBatchDeleteResponse = exports.getMockUserStorageBatchPutResponse = exports.getMockUserStoragePutResponse = exports.getMockUserStorageAllFeatureEntriesResponse = exports.getMockUserStorageGetResponse = exports.createMockAllFeatureEntriesResponse = exports.createMockGetStorageResponse = exports.getMockUserStorageEndpoint = void 0;
4
- const index_js_1 = require("../../../sdk/index.cjs");
5
- const storage_schema_js_1 = require("../../../shared/storage-schema.cjs");
6
- const mockStorage_js_1 = require("./mockStorage.cjs");
7
- const getMockUserStorageEndpoint = (path) => {
8
- if (path.split('.').length === 1) {
9
- return `${(0, index_js_1.getEnvUrls)(index_js_1.Env.PRD).userStorageApiUrl}/api/v1/userstorage/${path}`;
10
- }
11
- return `${(0, index_js_1.getEnvUrls)(index_js_1.Env.PRD).userStorageApiUrl}/api/v1/userstorage/${(0, storage_schema_js_1.createEntryPath)(path, mockStorage_js_1.MOCK_STORAGE_KEY)}`;
12
- };
13
- exports.getMockUserStorageEndpoint = getMockUserStorageEndpoint;
14
- /**
15
- * Creates a mock GET user-storage response
16
- *
17
- * @param data - data to encrypt
18
- * @returns a realistic GET Response Body
19
- */
20
- async function createMockGetStorageResponse(data) {
21
- return {
22
- HashedKey: 'HASHED_KEY',
23
- Data: await (0, mockStorage_js_1.MOCK_ENCRYPTED_STORAGE_DATA)(data),
24
- };
25
- }
26
- exports.createMockGetStorageResponse = createMockGetStorageResponse;
27
- /**
28
- * Creates a mock GET ALL user-storage response
29
- *
30
- * @param dataArr - array of data to encrypt
31
- * @returns a realistic GET ALL Response Body
32
- */
33
- async function createMockAllFeatureEntriesResponse(dataArr = [mockStorage_js_1.MOCK_STORAGE_DATA]) {
34
- const decryptedData = [];
35
- for (const data of dataArr) {
36
- decryptedData.push({
37
- HashedKey: 'HASHED_KEY',
38
- Data: await (0, mockStorage_js_1.MOCK_ENCRYPTED_STORAGE_DATA)(data),
39
- });
40
- }
41
- return decryptedData;
42
- }
43
- exports.createMockAllFeatureEntriesResponse = createMockAllFeatureEntriesResponse;
44
- /**
45
- * Creates a mock user-storage api GET request
46
- *
47
- * @param path - path of the GET Url
48
- * @returns mock GET API request. Can be used by e2e or unit mock servers
49
- */
50
- async function getMockUserStorageGetResponse(path = `${storage_schema_js_1.USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`) {
51
- return {
52
- url: (0, exports.getMockUserStorageEndpoint)(path),
53
- requestMethod: 'GET',
54
- response: await createMockGetStorageResponse(),
55
- };
56
- }
57
- exports.getMockUserStorageGetResponse = getMockUserStorageGetResponse;
58
- /**
59
- * Creates a mock user-storage api GET ALL request
60
- *
61
- * @param path - path of the GET url
62
- * @param dataArr - data to encrypt
63
- * @returns mock GET ALL API request. Can be used by e2e or unit mock servers
64
- */
65
- async function getMockUserStorageAllFeatureEntriesResponse(path = storage_schema_js_1.USER_STORAGE_FEATURE_NAMES.notifications, dataArr) {
66
- return {
67
- url: (0, exports.getMockUserStorageEndpoint)(path),
68
- requestMethod: 'GET',
69
- response: await createMockAllFeatureEntriesResponse(dataArr),
70
- };
71
- }
72
- exports.getMockUserStorageAllFeatureEntriesResponse = getMockUserStorageAllFeatureEntriesResponse;
73
- const getMockUserStoragePutResponse = (path = `${storage_schema_js_1.USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`) => {
74
- return {
75
- url: (0, exports.getMockUserStorageEndpoint)(path),
76
- requestMethod: 'PUT',
77
- response: null,
78
- };
79
- };
80
- exports.getMockUserStoragePutResponse = getMockUserStoragePutResponse;
81
- const getMockUserStorageBatchPutResponse = (path = storage_schema_js_1.USER_STORAGE_FEATURE_NAMES.notifications) => {
82
- return {
83
- url: (0, exports.getMockUserStorageEndpoint)(path),
84
- requestMethod: 'PUT',
85
- response: null,
86
- };
87
- };
88
- exports.getMockUserStorageBatchPutResponse = getMockUserStorageBatchPutResponse;
89
- const getMockUserStorageBatchDeleteResponse = (path = storage_schema_js_1.USER_STORAGE_FEATURE_NAMES.notifications) => {
90
- return {
91
- url: (0, exports.getMockUserStorageEndpoint)(path),
92
- requestMethod: 'PUT',
93
- response: null,
94
- };
95
- };
96
- exports.getMockUserStorageBatchDeleteResponse = getMockUserStorageBatchDeleteResponse;
97
- const deleteMockUserStorageResponse = (path = `${storage_schema_js_1.USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`) => {
98
- return {
99
- url: (0, exports.getMockUserStorageEndpoint)(path),
100
- requestMethod: 'DELETE',
101
- response: null,
102
- };
103
- };
104
- exports.deleteMockUserStorageResponse = deleteMockUserStorageResponse;
105
- const deleteMockUserStorageAllFeatureEntriesResponse = (path = storage_schema_js_1.USER_STORAGE_FEATURE_NAMES.notifications) => {
106
- return {
107
- url: (0, exports.getMockUserStorageEndpoint)(path),
108
- requestMethod: 'DELETE',
109
- response: null,
110
- };
111
- };
112
- exports.deleteMockUserStorageAllFeatureEntriesResponse = deleteMockUserStorageAllFeatureEntriesResponse;
113
- //# sourceMappingURL=mockResponses.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockResponses.cjs","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockResponses.ts"],"names":[],"mappings":"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","sourcesContent":["import { Env, getEnvUrls } from '../../../sdk/index.js';\nimport type {\n UserStorageGenericPathWithFeatureAndKey,\n UserStorageGenericPathWithFeatureOnly,\n} from '../../../shared/storage-schema.js';\nimport {\n createEntryPath,\n USER_STORAGE_FEATURE_NAMES,\n} from '../../../shared/storage-schema.js';\nimport type {\n GetUserStorageAllFeatureEntriesResponse,\n GetUserStorageResponse,\n} from '../types.js';\nimport {\n MOCK_ENCRYPTED_STORAGE_DATA,\n MOCK_STORAGE_DATA,\n MOCK_STORAGE_KEY,\n} from './mockStorage.js';\n\ntype MockResponse = {\n url: string;\n requestMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';\n response: unknown;\n};\n\nexport const getMockUserStorageEndpoint = (\n path:\n | UserStorageGenericPathWithFeatureAndKey\n | UserStorageGenericPathWithFeatureOnly,\n) => {\n if (path.split('.').length === 1) {\n return `${getEnvUrls(Env.PRD).userStorageApiUrl}/api/v1/userstorage/${path}`;\n }\n\n return `${getEnvUrls(Env.PRD).userStorageApiUrl}/api/v1/userstorage/${createEntryPath(\n path as UserStorageGenericPathWithFeatureAndKey,\n MOCK_STORAGE_KEY,\n )}`;\n};\n\n/**\n * Creates a mock GET user-storage response\n *\n * @param data - data to encrypt\n * @returns a realistic GET Response Body\n */\nexport async function createMockGetStorageResponse(\n data?: string,\n): Promise<GetUserStorageResponse> {\n return {\n HashedKey: 'HASHED_KEY',\n Data: await MOCK_ENCRYPTED_STORAGE_DATA(data),\n };\n}\n\n/**\n * Creates a mock GET ALL user-storage response\n *\n * @param dataArr - array of data to encrypt\n * @returns a realistic GET ALL Response Body\n */\nexport async function createMockAllFeatureEntriesResponse(\n dataArr: string[] = [MOCK_STORAGE_DATA],\n): Promise<GetUserStorageAllFeatureEntriesResponse> {\n const decryptedData = [];\n\n for (const data of dataArr) {\n decryptedData.push({\n HashedKey: 'HASHED_KEY',\n Data: await MOCK_ENCRYPTED_STORAGE_DATA(data),\n });\n }\n\n return decryptedData;\n}\n\n/**\n * Creates a mock user-storage api GET request\n *\n * @param path - path of the GET Url\n * @returns mock GET API request. Can be used by e2e or unit mock servers\n */\nexport async function getMockUserStorageGetResponse(\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'GET',\n response: await createMockGetStorageResponse(),\n } satisfies MockResponse;\n}\n\n/**\n * Creates a mock user-storage api GET ALL request\n *\n * @param path - path of the GET url\n * @param dataArr - data to encrypt\n * @returns mock GET ALL API request. Can be used by e2e or unit mock servers\n */\nexport async function getMockUserStorageAllFeatureEntriesResponse(\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n dataArr?: string[],\n) {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'GET',\n response: await createMockAllFeatureEntriesResponse(dataArr),\n } satisfies MockResponse;\n}\n\nexport const getMockUserStoragePutResponse = (\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockUserStorageBatchPutResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockUserStorageBatchDeleteResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const deleteMockUserStorageResponse = (\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'DELETE',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const deleteMockUserStorageAllFeatureEntriesResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'DELETE',\n response: null,\n } satisfies MockResponse;\n};\n"]}
@@ -1,66 +0,0 @@
1
- import type { UserStorageGenericPathWithFeatureAndKey, UserStorageGenericPathWithFeatureOnly } from "../../../shared/storage-schema.cjs";
2
- import type { GetUserStorageAllFeatureEntriesResponse, GetUserStorageResponse } from "../types.cjs";
3
- export declare const getMockUserStorageEndpoint: (path: UserStorageGenericPathWithFeatureAndKey | UserStorageGenericPathWithFeatureOnly) => string;
4
- /**
5
- * Creates a mock GET user-storage response
6
- *
7
- * @param data - data to encrypt
8
- * @returns a realistic GET Response Body
9
- */
10
- export declare function createMockGetStorageResponse(data?: string): Promise<GetUserStorageResponse>;
11
- /**
12
- * Creates a mock GET ALL user-storage response
13
- *
14
- * @param dataArr - array of data to encrypt
15
- * @returns a realistic GET ALL Response Body
16
- */
17
- export declare function createMockAllFeatureEntriesResponse(dataArr?: string[]): Promise<GetUserStorageAllFeatureEntriesResponse>;
18
- /**
19
- * Creates a mock user-storage api GET request
20
- *
21
- * @param path - path of the GET Url
22
- * @returns mock GET API request. Can be used by e2e or unit mock servers
23
- */
24
- export declare function getMockUserStorageGetResponse(path?: UserStorageGenericPathWithFeatureAndKey): Promise<{
25
- url: string;
26
- requestMethod: "GET";
27
- response: GetUserStorageResponse;
28
- }>;
29
- /**
30
- * Creates a mock user-storage api GET ALL request
31
- *
32
- * @param path - path of the GET url
33
- * @param dataArr - data to encrypt
34
- * @returns mock GET ALL API request. Can be used by e2e or unit mock servers
35
- */
36
- export declare function getMockUserStorageAllFeatureEntriesResponse(path?: UserStorageGenericPathWithFeatureOnly, dataArr?: string[]): Promise<{
37
- url: string;
38
- requestMethod: "GET";
39
- response: GetUserStorageAllFeatureEntriesResponse;
40
- }>;
41
- export declare const getMockUserStoragePutResponse: (path?: UserStorageGenericPathWithFeatureAndKey) => {
42
- url: string;
43
- requestMethod: "PUT";
44
- response: null;
45
- };
46
- export declare const getMockUserStorageBatchPutResponse: (path?: UserStorageGenericPathWithFeatureOnly) => {
47
- url: string;
48
- requestMethod: "PUT";
49
- response: null;
50
- };
51
- export declare const getMockUserStorageBatchDeleteResponse: (path?: UserStorageGenericPathWithFeatureOnly) => {
52
- url: string;
53
- requestMethod: "PUT";
54
- response: null;
55
- };
56
- export declare const deleteMockUserStorageResponse: (path?: UserStorageGenericPathWithFeatureAndKey) => {
57
- url: string;
58
- requestMethod: "DELETE";
59
- response: null;
60
- };
61
- export declare const deleteMockUserStorageAllFeatureEntriesResponse: (path?: UserStorageGenericPathWithFeatureOnly) => {
62
- url: string;
63
- requestMethod: "DELETE";
64
- response: null;
65
- };
66
- //# sourceMappingURL=mockResponses.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockResponses.d.cts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockResponses.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,uCAAuC,EACvC,qCAAqC,EACtC,2CAA0C;AAK3C,OAAO,KAAK,EACV,uCAAuC,EACvC,sBAAsB,EACvB,qBAAoB;AAarB,eAAO,MAAM,0BAA0B,SAEjC,uCAAuC,GACvC,qCAAqC,WAU1C,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,sBAAsB,CAAC,CAKjC;AAED;;;;;GAKG;AACH,wBAAsB,mCAAmC,CACvD,OAAO,GAAE,MAAM,EAAwB,GACtC,OAAO,CAAC,uCAAuC,CAAC,CAWlD;AAED;;;;;GAKG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,GAAE,uCAA6G;;;;GAOpH;AAED;;;;;;GAMG;AACH,wBAAsB,2CAA2C,CAC/D,IAAI,GAAE,qCAAgF,EACtF,OAAO,CAAC,EAAE,MAAM,EAAE;;;;GAOnB;AAED,eAAO,MAAM,6BAA6B,UAClC,uCAAuC;;;;CAO9C,CAAC;AAEF,eAAO,MAAM,kCAAkC,UACvC,qCAAqC;;;;CAO5C,CAAC;AAEF,eAAO,MAAM,qCAAqC,UAC1C,qCAAqC;;;;CAO5C,CAAC;AAEF,eAAO,MAAM,6BAA6B,UAClC,uCAAuC;;;;CAO9C,CAAC;AAEF,eAAO,MAAM,8CAA8C,UACnD,qCAAqC;;;;CAO5C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockResponses.d.mts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockResponses.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,uCAAuC,EACvC,qCAAqC,EACtC,2CAA0C;AAK3C,OAAO,KAAK,EACV,uCAAuC,EACvC,sBAAsB,EACvB,qBAAoB;AAarB,eAAO,MAAM,0BAA0B,SAEjC,uCAAuC,GACvC,qCAAqC,WAU1C,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,sBAAsB,CAAC,CAKjC;AAED;;;;;GAKG;AACH,wBAAsB,mCAAmC,CACvD,OAAO,GAAE,MAAM,EAAwB,GACtC,OAAO,CAAC,uCAAuC,CAAC,CAWlD;AAED;;;;;GAKG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,GAAE,uCAA6G;;;;GAOpH;AAED;;;;;;GAMG;AACH,wBAAsB,2CAA2C,CAC/D,IAAI,GAAE,qCAAgF,EACtF,OAAO,CAAC,EAAE,MAAM,EAAE;;;;GAOnB;AAED,eAAO,MAAM,6BAA6B,UAClC,uCAAuC;;;;CAO9C,CAAC;AAEF,eAAO,MAAM,kCAAkC,UACvC,qCAAqC;;;;CAO5C,CAAC;AAEF,eAAO,MAAM,qCAAqC,UAC1C,qCAAqC;;;;CAO5C,CAAC;AAEF,eAAO,MAAM,6BAA6B,UAClC,uCAAuC;;;;CAO9C,CAAC;AAEF,eAAO,MAAM,8CAA8C,UACnD,qCAAqC;;;;CAO5C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockResponses.mjs","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockResponses.ts"],"names":[],"mappings":"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","sourcesContent":["import { Env, getEnvUrls } from '../../../sdk/index.js';\nimport type {\n UserStorageGenericPathWithFeatureAndKey,\n UserStorageGenericPathWithFeatureOnly,\n} from '../../../shared/storage-schema.js';\nimport {\n createEntryPath,\n USER_STORAGE_FEATURE_NAMES,\n} from '../../../shared/storage-schema.js';\nimport type {\n GetUserStorageAllFeatureEntriesResponse,\n GetUserStorageResponse,\n} from '../types.js';\nimport {\n MOCK_ENCRYPTED_STORAGE_DATA,\n MOCK_STORAGE_DATA,\n MOCK_STORAGE_KEY,\n} from './mockStorage.js';\n\ntype MockResponse = {\n url: string;\n requestMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';\n response: unknown;\n};\n\nexport const getMockUserStorageEndpoint = (\n path:\n | UserStorageGenericPathWithFeatureAndKey\n | UserStorageGenericPathWithFeatureOnly,\n) => {\n if (path.split('.').length === 1) {\n return `${getEnvUrls(Env.PRD).userStorageApiUrl}/api/v1/userstorage/${path}`;\n }\n\n return `${getEnvUrls(Env.PRD).userStorageApiUrl}/api/v1/userstorage/${createEntryPath(\n path as UserStorageGenericPathWithFeatureAndKey,\n MOCK_STORAGE_KEY,\n )}`;\n};\n\n/**\n * Creates a mock GET user-storage response\n *\n * @param data - data to encrypt\n * @returns a realistic GET Response Body\n */\nexport async function createMockGetStorageResponse(\n data?: string,\n): Promise<GetUserStorageResponse> {\n return {\n HashedKey: 'HASHED_KEY',\n Data: await MOCK_ENCRYPTED_STORAGE_DATA(data),\n };\n}\n\n/**\n * Creates a mock GET ALL user-storage response\n *\n * @param dataArr - array of data to encrypt\n * @returns a realistic GET ALL Response Body\n */\nexport async function createMockAllFeatureEntriesResponse(\n dataArr: string[] = [MOCK_STORAGE_DATA],\n): Promise<GetUserStorageAllFeatureEntriesResponse> {\n const decryptedData = [];\n\n for (const data of dataArr) {\n decryptedData.push({\n HashedKey: 'HASHED_KEY',\n Data: await MOCK_ENCRYPTED_STORAGE_DATA(data),\n });\n }\n\n return decryptedData;\n}\n\n/**\n * Creates a mock user-storage api GET request\n *\n * @param path - path of the GET Url\n * @returns mock GET API request. Can be used by e2e or unit mock servers\n */\nexport async function getMockUserStorageGetResponse(\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'GET',\n response: await createMockGetStorageResponse(),\n } satisfies MockResponse;\n}\n\n/**\n * Creates a mock user-storage api GET ALL request\n *\n * @param path - path of the GET url\n * @param dataArr - data to encrypt\n * @returns mock GET ALL API request. Can be used by e2e or unit mock servers\n */\nexport async function getMockUserStorageAllFeatureEntriesResponse(\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n dataArr?: string[],\n) {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'GET',\n response: await createMockAllFeatureEntriesResponse(dataArr),\n } satisfies MockResponse;\n}\n\nexport const getMockUserStoragePutResponse = (\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockUserStorageBatchPutResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockUserStorageBatchDeleteResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const deleteMockUserStorageResponse = (\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'DELETE',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const deleteMockUserStorageAllFeatureEntriesResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'DELETE',\n response: null,\n } satisfies MockResponse;\n};\n"]}
@@ -1,36 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.MOCK_ENCRYPTED_STORAGE_DATA = exports.MOCK_STORAGE_DATA = exports.MOCK_STORAGE_KEY = exports.MOCK_STORAGE_KEY_SIGNATURE = void 0;
27
- const index_js_1 = __importStar(require("../../../shared/encryption/index.cjs"));
28
- exports.MOCK_STORAGE_KEY_SIGNATURE = 'mockStorageKey';
29
- exports.MOCK_STORAGE_KEY = (0, index_js_1.createSHA256Hash)(exports.MOCK_STORAGE_KEY_SIGNATURE);
30
- exports.MOCK_STORAGE_DATA = JSON.stringify({ hello: 'world' });
31
- // NOTE - using encryption.encryptString directly in fixtures causes issues on mobile.
32
- // This is because this fixture is getting added in at run time. Will be improved once we support multiple exports
33
- let cachedMockEncryptedData;
34
- const MOCK_ENCRYPTED_STORAGE_DATA = async (data) => (cachedMockEncryptedData ?? (cachedMockEncryptedData = await index_js_1.default.encryptString(data ?? exports.MOCK_STORAGE_DATA, exports.MOCK_STORAGE_KEY)));
35
- exports.MOCK_ENCRYPTED_STORAGE_DATA = MOCK_ENCRYPTED_STORAGE_DATA;
36
- //# sourceMappingURL=mockStorage.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockStorage.cjs","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockStorage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iFAE6C;AAEhC,QAAA,0BAA0B,GAAG,gBAAgB,CAAC;AAC9C,QAAA,gBAAgB,GAAG,IAAA,2BAAgB,EAAC,kCAA0B,CAAC,CAAC;AAChE,QAAA,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AAEpE,sFAAsF;AACtF,kHAAkH;AAClH,IAAI,uBAA+B,CAAC;AAC7B,MAAM,2BAA2B,GAAG,KAAK,EAAE,IAAa,EAAE,EAAE,CACjE,CAAC,uBAAuB,KAAvB,uBAAuB,GAAK,MAAM,kBAAU,CAAC,aAAa,CACzD,IAAI,IAAI,yBAAiB,EACzB,wBAAgB,CACjB,EAAC,CAAC;AAJQ,QAAA,2BAA2B,+BAInC","sourcesContent":["import encryption, {\n createSHA256Hash,\n} from '../../../shared/encryption/index.js';\n\nexport const MOCK_STORAGE_KEY_SIGNATURE = 'mockStorageKey';\nexport const MOCK_STORAGE_KEY = createSHA256Hash(MOCK_STORAGE_KEY_SIGNATURE);\nexport const MOCK_STORAGE_DATA = JSON.stringify({ hello: 'world' });\n\n// NOTE - using encryption.encryptString directly in fixtures causes issues on mobile.\n// This is because this fixture is getting added in at run time. Will be improved once we support multiple exports\nlet cachedMockEncryptedData: string;\nexport const MOCK_ENCRYPTED_STORAGE_DATA = async (data?: string) =>\n (cachedMockEncryptedData ??= await encryption.encryptString(\n data ?? MOCK_STORAGE_DATA,\n MOCK_STORAGE_KEY,\n ));\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockStorage.d.cts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockStorage.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAC3D,eAAO,MAAM,gBAAgB,QAA+C,CAAC;AAC7E,eAAO,MAAM,iBAAiB,QAAqC,CAAC;AAKpE,eAAO,MAAM,2BAA2B,UAAiB,MAAM,oBAI3D,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const MOCK_STORAGE_KEY_SIGNATURE = "mockStorageKey";
2
- export declare const MOCK_STORAGE_KEY: string;
3
- export declare const MOCK_STORAGE_DATA: string;
4
- export declare const MOCK_ENCRYPTED_STORAGE_DATA: (data?: string) => Promise<string>;
5
- //# sourceMappingURL=mockStorage.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockStorage.d.mts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockStorage.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,mBAAmB,CAAC;AAC3D,eAAO,MAAM,gBAAgB,QAA+C,CAAC;AAC7E,eAAO,MAAM,iBAAiB,QAAqC,CAAC;AAKpE,eAAO,MAAM,2BAA2B,UAAiB,MAAM,oBAI3D,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockStorage.mjs","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockStorage.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EACjB,gBAAgB,EACjB,6CAA4C;AAE7C,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAC3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,0BAA0B,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AAEpE,sFAAsF;AACtF,kHAAkH;AAClH,IAAI,uBAA+B,CAAC;AACpC,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,EAAE,IAAa,EAAE,EAAE,CACjE,CAAC,uBAAuB,KAAvB,uBAAuB,GAAK,MAAM,UAAU,CAAC,aAAa,CACzD,IAAI,IAAI,iBAAiB,EACzB,gBAAgB,CACjB,EAAC,CAAC","sourcesContent":["import encryption, {\n createSHA256Hash,\n} from '../../../shared/encryption/index.js';\n\nexport const MOCK_STORAGE_KEY_SIGNATURE = 'mockStorageKey';\nexport const MOCK_STORAGE_KEY = createSHA256Hash(MOCK_STORAGE_KEY_SIGNATURE);\nexport const MOCK_STORAGE_DATA = JSON.stringify({ hello: 'world' });\n\n// NOTE - using encryption.encryptString directly in fixtures causes issues on mobile.\n// This is because this fixture is getting added in at run time. Will be improved once we support multiple exports\nlet cachedMockEncryptedData: string;\nexport const MOCK_ENCRYPTED_STORAGE_DATA = async (data?: string) =>\n (cachedMockEncryptedData ??= await encryption.encryptString(\n data ?? MOCK_STORAGE_DATA,\n MOCK_STORAGE_KEY,\n ));\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n UserStorageGenericPathWithFeatureAndKey,\n UserStorageGenericPathWithFeatureOnly,\n} from '../../shared/storage-schema.js';\nimport type { NativeScrypt } from '../../shared/types/encryption.js';\n\nexport type UserStorageBaseOptions = {\n bearerToken: string;\n storageKey: string;\n nativeScryptCrypto?: NativeScrypt;\n};\n\nexport type UserStorageOptions = UserStorageBaseOptions & {\n path: UserStorageGenericPathWithFeatureAndKey;\n};\n\nexport type UserStorageAllFeatureEntriesOptions = UserStorageBaseOptions & {\n path: UserStorageGenericPathWithFeatureOnly;\n};\n\nexport type UserStorageBatchUpsertOptions = UserStorageAllFeatureEntriesOptions;\n\nexport type GetUserStorageResponse = {\n HashedKey: string;\n Data: string;\n};\n\nexport type GetUserStorageAllFeatureEntriesResponse = {\n HashedKey: string;\n Data: string;\n}[];\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uCAAuC,EACvC,qCAAqC,EACtC,wCAAuC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,0CAAyC;AAErE,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,YAAY,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG;IACxD,IAAI,EAAE,uCAAuC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,sBAAsB,GAAG;IACzE,IAAI,EAAE,qCAAqC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,mCAAmC,CAAC;AAEhF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,EAAE,CAAC"}
@@ -1,23 +0,0 @@
1
- import type { UserStorageGenericPathWithFeatureAndKey, UserStorageGenericPathWithFeatureOnly } from "../../shared/storage-schema.mjs";
2
- import type { NativeScrypt } from "../../shared/types/encryption.mjs";
3
- export type UserStorageBaseOptions = {
4
- bearerToken: string;
5
- storageKey: string;
6
- nativeScryptCrypto?: NativeScrypt;
7
- };
8
- export type UserStorageOptions = UserStorageBaseOptions & {
9
- path: UserStorageGenericPathWithFeatureAndKey;
10
- };
11
- export type UserStorageAllFeatureEntriesOptions = UserStorageBaseOptions & {
12
- path: UserStorageGenericPathWithFeatureOnly;
13
- };
14
- export type UserStorageBatchUpsertOptions = UserStorageAllFeatureEntriesOptions;
15
- export type GetUserStorageResponse = {
16
- HashedKey: string;
17
- Data: string;
18
- };
19
- export type GetUserStorageAllFeatureEntriesResponse = {
20
- HashedKey: string;
21
- Data: string;
22
- }[];
23
- //# sourceMappingURL=types.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uCAAuC,EACvC,qCAAqC,EACtC,wCAAuC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,0CAAyC;AAErE,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,YAAY,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG;IACxD,IAAI,EAAE,uCAAuC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,sBAAsB,GAAG;IACzE,IAAI,EAAE,qCAAqC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,mCAAmC,CAAC;AAEhF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n UserStorageGenericPathWithFeatureAndKey,\n UserStorageGenericPathWithFeatureOnly,\n} from '../../shared/storage-schema.js';\nimport type { NativeScrypt } from '../../shared/types/encryption.js';\n\nexport type UserStorageBaseOptions = {\n bearerToken: string;\n storageKey: string;\n nativeScryptCrypto?: NativeScrypt;\n};\n\nexport type UserStorageOptions = UserStorageBaseOptions & {\n path: UserStorageGenericPathWithFeatureAndKey;\n};\n\nexport type UserStorageAllFeatureEntriesOptions = UserStorageBaseOptions & {\n path: UserStorageGenericPathWithFeatureOnly;\n};\n\nexport type UserStorageBatchUpsertOptions = UserStorageAllFeatureEntriesOptions;\n\nexport type GetUserStorageResponse = {\n HashedKey: string;\n Data: string;\n};\n\nexport type GetUserStorageAllFeatureEntriesResponse = {\n HashedKey: string;\n Data: string;\n}[];\n"]}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setIntersection = exports.setDifference = void 0;
4
- /**
5
- * Returns the difference between 2 sets.
6
- * NOTE - this is temporary until we can support Set().difference method
7
- *
8
- * @param a - First Set
9
- * @param b - Second Set
10
- * @returns The difference between the first and second set.
11
- */
12
- function setDifference(a, b) {
13
- const difference = new Set();
14
- a.forEach((e) => !b.has(e) && difference.add(e));
15
- return difference;
16
- }
17
- exports.setDifference = setDifference;
18
- /**
19
- * Returns the intersection between 2 sets.
20
- * NOTE - this is temporary until we can support Set().intersection method
21
- *
22
- * @param a - First Set
23
- * @param b - Second Set
24
- * @returns The intersection between the first and second set.
25
- */
26
- function setIntersection(a, b) {
27
- const intersection = new Set();
28
- a.forEach((e) => b.has(e) && intersection.add(e));
29
- return intersection;
30
- }
31
- exports.setIntersection = setIntersection;
32
- //# sourceMappingURL=utils.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.cjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/utils.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAQ,CAAa,EAAE,CAAa;IAC/D,MAAM,UAAU,GAAG,IAAI,GAAG,EAAS,CAAC;IACpC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,OAAO,UAAU,CAAC;AACpB,CAAC;AAJD,sCAIC;AAED;;;;;;;GAOG;AACH,SAAgB,eAAe,CAC7B,CAAa,EACb,CAAa;IAEb,MAAM,YAAY,GAAG,IAAI,GAAG,EAAS,CAAC;IACtC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,OAAO,YAAY,CAAC;AACtB,CAAC;AAPD,0CAOC","sourcesContent":["/**\n * Returns the difference between 2 sets.\n * NOTE - this is temporary until we can support Set().difference method\n *\n * @param a - First Set\n * @param b - Second Set\n * @returns The difference between the first and second set.\n */\nexport function setDifference<TItem>(a: Set<TItem>, b: Set<TItem>): Set<TItem> {\n const difference = new Set<TItem>();\n a.forEach((e) => !b.has(e) && difference.add(e));\n return difference;\n}\n\n/**\n * Returns the intersection between 2 sets.\n * NOTE - this is temporary until we can support Set().intersection method\n *\n * @param a - First Set\n * @param b - Second Set\n * @returns The intersection between the first and second set.\n */\nexport function setIntersection<TItem>(\n a: Set<TItem>,\n b: Set<TItem>,\n): Set<TItem> {\n const intersection = new Set<TItem>();\n a.forEach((e) => b.has(e) && intersection.add(e));\n return intersection;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.cts","sourceRoot":"","sources":["../../../src/controllers/user-storage/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAI7E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EACnC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,EACb,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,GACZ,GAAG,CAAC,KAAK,CAAC,CAIZ"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Returns the difference between 2 sets.
3
- * NOTE - this is temporary until we can support Set().difference method
4
- *
5
- * @param a - First Set
6
- * @param b - Second Set
7
- * @returns The difference between the first and second set.
8
- */
9
- export declare function setDifference<TItem>(a: Set<TItem>, b: Set<TItem>): Set<TItem>;
10
- /**
11
- * Returns the intersection between 2 sets.
12
- * NOTE - this is temporary until we can support Set().intersection method
13
- *
14
- * @param a - First Set
15
- * @param b - Second Set
16
- * @returns The intersection between the first and second set.
17
- */
18
- export declare function setIntersection<TItem>(a: Set<TItem>, b: Set<TItem>): Set<TItem>;
19
- //# sourceMappingURL=utils.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.mts","sourceRoot":"","sources":["../../../src/controllers/user-storage/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAI7E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EACnC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,EACb,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,GACZ,GAAG,CAAC,KAAK,CAAC,CAIZ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.mjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAQ,CAAa,EAAE,CAAa;IAC/D,MAAM,UAAU,GAAG,IAAI,GAAG,EAAS,CAAC;IACpC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,CAAa,EACb,CAAa;IAEb,MAAM,YAAY,GAAG,IAAI,GAAG,EAAS,CAAC;IACtC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/**\n * Returns the difference between 2 sets.\n * NOTE - this is temporary until we can support Set().difference method\n *\n * @param a - First Set\n * @param b - Second Set\n * @returns The difference between the first and second set.\n */\nexport function setDifference<TItem>(a: Set<TItem>, b: Set<TItem>): Set<TItem> {\n const difference = new Set<TItem>();\n a.forEach((e) => !b.has(e) && difference.add(e));\n return difference;\n}\n\n/**\n * Returns the intersection between 2 sets.\n * NOTE - this is temporary until we can support Set().intersection method\n *\n * @param a - First Set\n * @param b - Second Set\n * @returns The intersection between the first and second set.\n */\nexport function setIntersection<TItem>(\n a: Set<TItem>,\n b: Set<TItem>,\n): Set<TItem> {\n const intersection = new Set<TItem>();\n a.forEach((e) => b.has(e) && intersection.add(e));\n return intersection;\n}\n"]}
package/dist/index.cjs DELETED
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.UserStorageController = exports.AuthenticationController = exports.SDK = void 0;
27
- exports.SDK = __importStar(require("./sdk/index.cjs"));
28
- exports.AuthenticationController = __importStar(require("./controllers/authentication/index.cjs"));
29
- exports.UserStorageController = __importStar(require("./controllers/user-storage/index.cjs"));
30
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAsC;AACtC,mGAAkF;AAClF,8FAA6E","sourcesContent":["export * as SDK from './sdk/index.js';\nexport * as AuthenticationController from './controllers/authentication/index.js';\nexport * as UserStorageController from './controllers/user-storage/index.js';\n"]}
package/dist/index.d.cts DELETED
@@ -1,4 +0,0 @@
1
- export * as SDK from "./sdk/index.cjs";
2
- export * as AuthenticationController from "./controllers/authentication/index.cjs";
3
- export * as UserStorageController from "./controllers/user-storage/index.cjs";
4
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAuB;AACtC,OAAO,KAAK,wBAAwB,+CAA8C;AAClF,OAAO,KAAK,qBAAqB,6CAA4C"}
package/dist/index.d.mts DELETED
@@ -1,4 +0,0 @@
1
- export * as SDK from "./sdk/index.mjs";
2
- export * as AuthenticationController from "./controllers/authentication/index.mjs";
3
- export * as UserStorageController from "./controllers/user-storage/index.mjs";
4
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAuB;AACtC,OAAO,KAAK,wBAAwB,+CAA8C;AAClF,OAAO,KAAK,qBAAqB,6CAA4C"}
package/dist/index.mjs DELETED
@@ -1,4 +0,0 @@
1
- export * as SDK from "./sdk/index.mjs";
2
- export * as AuthenticationController from "./controllers/authentication/index.mjs";
3
- export * as UserStorageController from "./controllers/user-storage/index.mjs";
4
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAuB;AACtC,OAAO,KAAK,wBAAwB,+CAA8C;AAClF,OAAO,KAAK,qBAAqB,6CAA4C","sourcesContent":["export * as SDK from './sdk/index.js';\nexport * as AuthenticationController from './controllers/authentication/index.js';\nexport * as UserStorageController from './controllers/user-storage/index.js';\n"]}
@@ -1,114 +0,0 @@
1
- "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
- if (kind === "m") throw new TypeError("Private method is not writable");
4
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
- };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
- var _SIWEJwtBearerAuth_instances, _SIWEJwtBearerAuth_config, _SIWEJwtBearerAuth_options, _SIWEJwtBearerAuth_signer, _SIWEJwtBearerAuth_getAuthSession, _SIWEJwtBearerAuth_login, _SIWEJwtBearerAuth_createSiWELoginRawMessage, _SIWEJwtBearerAuth_assertSigner;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.SIWEJwtBearerAuth = void 0;
16
- const siwe_1 = require("siwe");
17
- const errors_js_1 = require("../errors.cjs");
18
- const validate_login_response_js_1 = require("../utils/validate-login-response.cjs");
19
- const services_js_1 = require("./services.cjs");
20
- class SIWEJwtBearerAuth {
21
- constructor(config, options) {
22
- _SIWEJwtBearerAuth_instances.add(this);
23
- _SIWEJwtBearerAuth_config.set(this, void 0);
24
- _SIWEJwtBearerAuth_options.set(this, void 0);
25
- _SIWEJwtBearerAuth_signer.set(this, void 0);
26
- __classPrivateFieldSet(this, _SIWEJwtBearerAuth_config, config, "f");
27
- __classPrivateFieldSet(this, _SIWEJwtBearerAuth_options, options, "f");
28
- }
29
- async getAccessToken() {
30
- const session = await __classPrivateFieldGet(this, _SIWEJwtBearerAuth_instances, "m", _SIWEJwtBearerAuth_getAuthSession).call(this);
31
- if (session) {
32
- return session.token.accessToken;
33
- }
34
- const loginResponse = await __classPrivateFieldGet(this, _SIWEJwtBearerAuth_instances, "m", _SIWEJwtBearerAuth_login).call(this);
35
- return loginResponse.token.accessToken;
36
- }
37
- async getUserProfile() {
38
- const session = await __classPrivateFieldGet(this, _SIWEJwtBearerAuth_instances, "m", _SIWEJwtBearerAuth_getAuthSession).call(this);
39
- if (session) {
40
- return session.profile;
41
- }
42
- const loginResponse = await __classPrivateFieldGet(this, _SIWEJwtBearerAuth_instances, "m", _SIWEJwtBearerAuth_login).call(this);
43
- return loginResponse.profile;
44
- }
45
- async getIdentifier() {
46
- __classPrivateFieldGet(this, _SIWEJwtBearerAuth_instances, "m", _SIWEJwtBearerAuth_assertSigner).call(this, __classPrivateFieldGet(this, _SIWEJwtBearerAuth_signer, "f"));
47
- return __classPrivateFieldGet(this, _SIWEJwtBearerAuth_signer, "f").address;
48
- }
49
- async getUserProfileLineage() {
50
- const accessToken = await this.getAccessToken();
51
- return await (0, services_js_1.getUserProfileLineage)(__classPrivateFieldGet(this, _SIWEJwtBearerAuth_config, "f").env, accessToken);
52
- }
53
- async getCustomerServiceToken() {
54
- const accessToken = await this.getAccessToken();
55
- return await (0, services_js_1.getCustomerServiceToken)(__classPrivateFieldGet(this, _SIWEJwtBearerAuth_config, "f").env, accessToken);
56
- }
57
- async signMessage(message) {
58
- __classPrivateFieldGet(this, _SIWEJwtBearerAuth_instances, "m", _SIWEJwtBearerAuth_assertSigner).call(this, __classPrivateFieldGet(this, _SIWEJwtBearerAuth_signer, "f"));
59
- return await __classPrivateFieldGet(this, _SIWEJwtBearerAuth_signer, "f").signMessage(message);
60
- }
61
- prepare(signer) {
62
- __classPrivateFieldSet(this, _SIWEJwtBearerAuth_signer, signer, "f");
63
- }
64
- }
65
- exports.SIWEJwtBearerAuth = SIWEJwtBearerAuth;
66
- _SIWEJwtBearerAuth_config = new WeakMap(), _SIWEJwtBearerAuth_options = new WeakMap(), _SIWEJwtBearerAuth_signer = new WeakMap(), _SIWEJwtBearerAuth_instances = new WeakSet(), _SIWEJwtBearerAuth_getAuthSession =
67
- // convert expiresIn from seconds to milliseconds and use 90% of expiresIn
68
- async function _SIWEJwtBearerAuth_getAuthSession() {
69
- const auth = await __classPrivateFieldGet(this, _SIWEJwtBearerAuth_options, "f").storage.getLoginResponse();
70
- if (!(0, validate_login_response_js_1.validateLoginResponse)(auth)) {
71
- return null;
72
- }
73
- const currentTime = Date.now();
74
- const sessionAge = currentTime - auth.token.obtainedAt;
75
- const refreshThreshold = auth.token.expiresIn * 1000 * 0.9;
76
- if (sessionAge < refreshThreshold) {
77
- return auth;
78
- }
79
- return null;
80
- }, _SIWEJwtBearerAuth_login = async function _SIWEJwtBearerAuth_login() {
81
- __classPrivateFieldGet(this, _SIWEJwtBearerAuth_instances, "m", _SIWEJwtBearerAuth_assertSigner).call(this, __classPrivateFieldGet(this, _SIWEJwtBearerAuth_signer, "f"));
82
- // Nonce
83
- const address = await this.getIdentifier();
84
- const nonceRes = await (0, services_js_1.getNonce)(address, __classPrivateFieldGet(this, _SIWEJwtBearerAuth_config, "f").env);
85
- const rawMessage = __classPrivateFieldGet(this, _SIWEJwtBearerAuth_instances, "m", _SIWEJwtBearerAuth_createSiWELoginRawMessage).call(this, nonceRes.nonce);
86
- const signature = await this.signMessage(rawMessage);
87
- // Authenticate
88
- const authResponse = await (0, services_js_1.authenticate)(rawMessage, signature, __classPrivateFieldGet(this, _SIWEJwtBearerAuth_config, "f").type, __classPrivateFieldGet(this, _SIWEJwtBearerAuth_config, "f").env);
89
- // Authorize
90
- const tokenResponse = await (0, services_js_1.authorizeOIDC)(authResponse.token, __classPrivateFieldGet(this, _SIWEJwtBearerAuth_config, "f").env, __classPrivateFieldGet(this, _SIWEJwtBearerAuth_config, "f").platform);
91
- // Save
92
- const result = {
93
- profile: authResponse.profile,
94
- token: tokenResponse,
95
- };
96
- await __classPrivateFieldGet(this, _SIWEJwtBearerAuth_options, "f").storage.setLoginResponse(result);
97
- return result;
98
- }, _SIWEJwtBearerAuth_createSiWELoginRawMessage = function _SIWEJwtBearerAuth_createSiWELoginRawMessage(nonce) {
99
- __classPrivateFieldGet(this, _SIWEJwtBearerAuth_instances, "m", _SIWEJwtBearerAuth_assertSigner).call(this, __classPrivateFieldGet(this, _SIWEJwtBearerAuth_signer, "f"));
100
- return new siwe_1.SiweMessage({
101
- domain: __classPrivateFieldGet(this, _SIWEJwtBearerAuth_signer, "f")?.domain,
102
- address: __classPrivateFieldGet(this, _SIWEJwtBearerAuth_signer, "f")?.address,
103
- uri: (0, services_js_1.SIWE_LOGIN_URL)(__classPrivateFieldGet(this, _SIWEJwtBearerAuth_config, "f").env),
104
- version: '1',
105
- chainId: __classPrivateFieldGet(this, _SIWEJwtBearerAuth_signer, "f")?.chainId,
106
- nonce,
107
- issuedAt: new Date().toISOString(),
108
- }).prepareMessage();
109
- }, _SIWEJwtBearerAuth_assertSigner = function _SIWEJwtBearerAuth_assertSigner(signer) {
110
- if (!signer) {
111
- throw new errors_js_1.ValidationError(`you must call 'prepare()' before logging in`);
112
- }
113
- };
114
- //# sourceMappingURL=flow-siwe.cjs.map