@metamask/profile-sync-controller 0.5.0 → 0.7.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.
- package/CHANGELOG.md +51 -1
- package/auth/mocks/package.json +2 -2
- package/auth/package.json +2 -2
- package/dist/controllers/authentication/AuthenticationController.cjs +211 -0
- package/dist/controllers/authentication/AuthenticationController.cjs.map +1 -0
- package/dist/{types/controllers/authentication/AuthenticationController.d.ts → controllers/authentication/AuthenticationController.d.cts} +5 -5
- package/dist/controllers/authentication/AuthenticationController.d.cts.map +1 -0
- package/dist/controllers/authentication/AuthenticationController.d.mts +78 -0
- package/dist/controllers/authentication/AuthenticationController.d.mts.map +1 -0
- package/dist/controllers/authentication/AuthenticationController.mjs +206 -11
- package/dist/controllers/authentication/AuthenticationController.mjs.map +1 -1
- package/dist/controllers/authentication/__fixtures__/index.cjs +18 -0
- package/dist/controllers/authentication/__fixtures__/index.cjs.map +1 -0
- package/dist/controllers/authentication/__fixtures__/index.d.cts +2 -0
- package/dist/controllers/authentication/__fixtures__/index.d.cts.map +1 -0
- package/dist/controllers/authentication/__fixtures__/index.d.mts +2 -0
- package/dist/controllers/authentication/__fixtures__/index.d.mts.map +1 -0
- package/dist/controllers/authentication/__fixtures__/index.mjs +2 -0
- package/dist/controllers/authentication/__fixtures__/index.mjs.map +1 -0
- package/dist/controllers/authentication/__fixtures__/mockResponses.cjs +52 -0
- package/dist/controllers/authentication/__fixtures__/mockResponses.cjs.map +1 -0
- package/dist/{types/controllers/authentication/__fixtures__/mockResponses.d.ts → controllers/authentication/__fixtures__/mockResponses.d.cts} +2 -2
- package/dist/controllers/authentication/__fixtures__/mockResponses.d.cts.map +1 -0
- package/dist/controllers/authentication/__fixtures__/mockResponses.d.mts +23 -0
- package/dist/controllers/authentication/__fixtures__/mockResponses.d.mts.map +1 -0
- package/dist/controllers/authentication/__fixtures__/mockResponses.mjs +46 -0
- package/dist/controllers/authentication/__fixtures__/mockResponses.mjs.map +1 -0
- package/dist/controllers/authentication/__fixtures__/mockServices.cjs +37 -0
- package/dist/controllers/authentication/__fixtures__/mockServices.cjs.map +1 -0
- package/dist/{types/controllers/authentication/__fixtures__/mockServices.d.ts → controllers/authentication/__fixtures__/mockServices.d.cts} +2 -2
- package/dist/controllers/authentication/__fixtures__/mockServices.d.cts.map +1 -0
- package/dist/controllers/authentication/__fixtures__/mockServices.d.mts +10 -0
- package/dist/controllers/authentication/__fixtures__/mockServices.d.mts.map +1 -0
- package/dist/controllers/authentication/__fixtures__/mockServices.mjs +35 -0
- package/dist/controllers/authentication/__fixtures__/mockServices.mjs.map +1 -0
- package/dist/controllers/authentication/auth-snap-requests.cjs +39 -0
- package/dist/controllers/authentication/auth-snap-requests.cjs.map +1 -0
- package/dist/{types/controllers/authentication/auth-snap-requests.d.ts → controllers/authentication/auth-snap-requests.d.cts} +2 -2
- package/dist/controllers/authentication/auth-snap-requests.d.cts.map +1 -0
- package/dist/controllers/authentication/auth-snap-requests.d.mts +17 -0
- package/dist/controllers/authentication/auth-snap-requests.d.mts.map +1 -0
- package/dist/controllers/authentication/auth-snap-requests.mjs +33 -9
- package/dist/controllers/authentication/auth-snap-requests.mjs.map +1 -1
- package/dist/controllers/authentication/index.cjs +39 -0
- package/dist/controllers/authentication/index.cjs.map +1 -0
- package/dist/controllers/authentication/index.d.cts +7 -0
- package/dist/controllers/authentication/index.d.cts.map +1 -0
- package/dist/controllers/authentication/index.d.mts +7 -0
- package/dist/controllers/authentication/index.d.mts.map +1 -0
- package/dist/controllers/authentication/index.mjs +6 -18
- package/dist/controllers/authentication/index.mjs.map +1 -1
- package/dist/controllers/authentication/services.cjs +127 -0
- package/dist/controllers/authentication/services.cjs.map +1 -0
- package/dist/{types/controllers/authentication/services.d.ts → controllers/authentication/services.d.cts} +1 -1
- package/dist/controllers/authentication/services.d.cts.map +1 -0
- package/dist/controllers/authentication/services.d.mts +70 -0
- package/dist/controllers/authentication/services.d.mts.map +1 -0
- package/dist/controllers/authentication/services.mjs +118 -19
- package/dist/controllers/authentication/services.mjs.map +1 -1
- package/dist/controllers/index.cjs +29 -0
- package/dist/controllers/index.cjs.map +1 -0
- package/dist/controllers/index.d.cts +3 -0
- package/dist/controllers/index.d.cts.map +1 -0
- package/dist/controllers/index.d.mts +3 -0
- package/dist/controllers/index.d.mts.map +1 -0
- package/dist/controllers/index.mjs +2 -24
- package/dist/controllers/index.mjs.map +1 -1
- package/dist/controllers/user-storage/UserStorageController.cjs +462 -0
- package/dist/controllers/user-storage/UserStorageController.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/UserStorageController.d.ts → controllers/user-storage/UserStorageController.d.cts} +44 -15
- package/dist/controllers/user-storage/UserStorageController.d.cts.map +1 -0
- package/dist/controllers/user-storage/UserStorageController.d.mts +156 -0
- package/dist/controllers/user-storage/UserStorageController.d.mts.map +1 -0
- package/dist/controllers/user-storage/UserStorageController.mjs +457 -18
- package/dist/controllers/user-storage/UserStorageController.mjs.map +1 -1
- package/dist/controllers/user-storage/__fixtures__/index.cjs +19 -0
- package/dist/controllers/user-storage/__fixtures__/index.cjs.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/index.d.cts +3 -0
- package/dist/controllers/user-storage/__fixtures__/index.d.cts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/index.d.mts +3 -0
- package/dist/controllers/user-storage/__fixtures__/index.d.mts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/index.mjs +3 -0
- package/dist/controllers/user-storage/__fixtures__/index.mjs.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockAccounts.cjs +127 -0
- package/dist/controllers/user-storage/__fixtures__/mockAccounts.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/__fixtures__/mockAccounts.d.ts → controllers/user-storage/__fixtures__/mockAccounts.d.cts} +6 -6
- package/dist/controllers/user-storage/__fixtures__/mockAccounts.d.cts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockAccounts.d.mts +63 -0
- package/dist/controllers/user-storage/__fixtures__/mockAccounts.d.mts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockAccounts.mjs +123 -0
- package/dist/controllers/user-storage/__fixtures__/mockAccounts.mjs.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockResponses.cjs +48 -0
- package/dist/controllers/user-storage/__fixtures__/mockResponses.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/__fixtures__/mockResponses.d.ts → controllers/user-storage/__fixtures__/mockResponses.d.cts} +6 -4
- package/dist/controllers/user-storage/__fixtures__/mockResponses.d.cts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockResponses.d.mts +21 -0
- package/dist/controllers/user-storage/__fixtures__/mockResponses.d.mts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockResponses.mjs +39 -0
- package/dist/controllers/user-storage/__fixtures__/mockResponses.mjs.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockServices.cjs +41 -0
- package/dist/controllers/user-storage/__fixtures__/mockServices.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/__fixtures__/mockServices.d.ts → controllers/user-storage/__fixtures__/mockServices.d.cts} +3 -3
- package/dist/controllers/user-storage/__fixtures__/mockServices.d.cts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockServices.d.mts +11 -0
- package/dist/controllers/user-storage/__fixtures__/mockServices.d.mts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockServices.mjs +39 -0
- package/dist/controllers/user-storage/__fixtures__/mockServices.mjs.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockStorage.cjs +36 -0
- package/dist/controllers/user-storage/__fixtures__/mockStorage.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/__fixtures__/mockStorage.d.ts → controllers/user-storage/__fixtures__/mockStorage.d.cts} +2 -2
- package/dist/controllers/user-storage/__fixtures__/mockStorage.d.cts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockStorage.d.mts +5 -0
- package/dist/controllers/user-storage/__fixtures__/mockStorage.d.mts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/mockStorage.mjs +9 -0
- package/dist/controllers/user-storage/__fixtures__/mockStorage.mjs.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/test-utils.cjs +31 -0
- package/dist/controllers/user-storage/__fixtures__/test-utils.cjs.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/test-utils.d.cts +14 -0
- package/dist/controllers/user-storage/__fixtures__/test-utils.d.cts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/test-utils.d.mts +14 -0
- package/dist/controllers/user-storage/__fixtures__/test-utils.d.mts.map +1 -0
- package/dist/controllers/user-storage/__fixtures__/test-utils.mjs +27 -0
- package/dist/controllers/user-storage/__fixtures__/test-utils.mjs.map +1 -0
- package/dist/controllers/user-storage/accounts/constants.cjs +51 -0
- package/dist/controllers/user-storage/accounts/constants.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/accounts/constants.d.ts → controllers/user-storage/accounts/constants.d.cts} +1 -1
- package/dist/controllers/user-storage/accounts/constants.d.cts.map +1 -0
- package/dist/controllers/user-storage/accounts/constants.d.mts +4 -0
- package/dist/controllers/user-storage/accounts/constants.d.mts.map +1 -0
- package/dist/controllers/user-storage/accounts/constants.mjs +47 -11
- package/dist/controllers/user-storage/accounts/constants.mjs.map +1 -1
- package/dist/controllers/user-storage/accounts/user-storage.cjs +34 -0
- package/dist/controllers/user-storage/accounts/user-storage.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/accounts/user-storage.d.ts → controllers/user-storage/accounts/user-storage.d.cts} +3 -3
- package/dist/controllers/user-storage/accounts/user-storage.d.cts.map +1 -0
- package/dist/controllers/user-storage/accounts/user-storage.d.mts +32 -0
- package/dist/controllers/user-storage/accounts/user-storage.d.mts.map +1 -0
- package/dist/controllers/user-storage/accounts/user-storage.mjs +27 -9
- package/dist/controllers/user-storage/accounts/user-storage.mjs.map +1 -1
- package/dist/controllers/user-storage/encryption/cache.cjs +79 -0
- package/dist/controllers/user-storage/encryption/cache.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/encryption/cache.d.ts → controllers/user-storage/encryption/cache.d.cts} +1 -1
- package/dist/controllers/user-storage/encryption/cache.d.cts.map +1 -0
- package/dist/controllers/user-storage/encryption/cache.d.mts +31 -0
- package/dist/controllers/user-storage/encryption/cache.d.mts.map +1 -0
- package/dist/controllers/user-storage/encryption/cache.mjs +71 -11
- package/dist/controllers/user-storage/encryption/cache.mjs.map +1 -1
- package/dist/controllers/user-storage/encryption/encryption.cjs +151 -0
- package/dist/controllers/user-storage/encryption/encryption.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/encryption/encryption.d.ts → controllers/user-storage/encryption/encryption.d.cts} +2 -2
- package/dist/controllers/user-storage/encryption/encryption.d.cts.map +1 -0
- package/dist/controllers/user-storage/encryption/encryption.d.mts +27 -0
- package/dist/controllers/user-storage/encryption/encryption.d.mts.map +1 -0
- package/dist/controllers/user-storage/encryption/encryption.mjs +145 -10
- package/dist/controllers/user-storage/encryption/encryption.mjs.map +1 -1
- package/dist/controllers/user-storage/encryption/index.cjs +25 -0
- package/dist/controllers/user-storage/encryption/index.cjs.map +1 -0
- package/dist/controllers/user-storage/encryption/index.d.cts +5 -0
- package/dist/controllers/user-storage/encryption/index.d.cts.map +1 -0
- package/dist/controllers/user-storage/encryption/index.d.mts +5 -0
- package/dist/controllers/user-storage/encryption/index.d.mts.map +1 -0
- package/dist/controllers/user-storage/encryption/index.mjs +4 -15
- package/dist/controllers/user-storage/encryption/index.mjs.map +1 -1
- package/dist/controllers/user-storage/encryption/utils.cjs +17 -0
- package/dist/controllers/user-storage/encryption/utils.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/encryption/utils.d.ts → controllers/user-storage/encryption/utils.d.cts} +1 -1
- package/dist/controllers/user-storage/encryption/utils.d.cts.map +1 -0
- package/dist/controllers/user-storage/encryption/utils.d.mts +4 -0
- package/dist/controllers/user-storage/encryption/utils.d.mts.map +1 -0
- package/dist/controllers/user-storage/encryption/utils.mjs +9 -10
- package/dist/controllers/user-storage/encryption/utils.mjs.map +1 -1
- package/dist/controllers/user-storage/index.cjs +40 -0
- package/dist/controllers/user-storage/index.cjs.map +1 -0
- package/dist/controllers/user-storage/index.d.cts +8 -0
- package/dist/controllers/user-storage/index.d.cts.map +1 -0
- package/dist/controllers/user-storage/index.d.mts +8 -0
- package/dist/controllers/user-storage/index.d.mts.map +1 -0
- package/dist/controllers/user-storage/index.mjs +7 -30
- package/dist/controllers/user-storage/index.mjs.map +1 -1
- package/dist/controllers/user-storage/network-syncing/__fixtures__/mockNetwork.cjs +25 -0
- package/dist/controllers/user-storage/network-syncing/__fixtures__/mockNetwork.cjs.map +1 -0
- package/dist/controllers/user-storage/network-syncing/__fixtures__/mockNetwork.d.cts +4 -0
- package/dist/controllers/user-storage/network-syncing/__fixtures__/mockNetwork.d.cts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/__fixtures__/mockNetwork.d.mts +4 -0
- package/dist/controllers/user-storage/network-syncing/__fixtures__/mockNetwork.d.mts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/__fixtures__/mockNetwork.mjs +20 -0
- package/dist/controllers/user-storage/network-syncing/__fixtures__/mockNetwork.mjs.map +1 -0
- package/dist/controllers/user-storage/network-syncing/controller-integration.cjs +65 -0
- package/dist/controllers/user-storage/network-syncing/controller-integration.cjs.map +1 -0
- package/dist/controllers/user-storage/network-syncing/controller-integration.d.cts +13 -0
- package/dist/controllers/user-storage/network-syncing/controller-integration.d.cts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/controller-integration.d.mts +13 -0
- package/dist/controllers/user-storage/network-syncing/controller-integration.d.mts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/controller-integration.mjs +65 -0
- package/dist/controllers/user-storage/network-syncing/controller-integration.mjs.map +1 -0
- package/dist/controllers/user-storage/network-syncing/services.cjs +64 -0
- package/dist/controllers/user-storage/network-syncing/services.cjs.map +1 -0
- package/dist/controllers/user-storage/network-syncing/services.d.cts +21 -0
- package/dist/controllers/user-storage/network-syncing/services.d.cts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/services.d.mts +21 -0
- package/dist/controllers/user-storage/network-syncing/services.d.mts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/services.mjs +58 -0
- package/dist/controllers/user-storage/network-syncing/services.mjs.map +1 -0
- package/dist/controllers/user-storage/network-syncing/sync-all.cjs +171 -0
- package/dist/controllers/user-storage/network-syncing/sync-all.cjs.map +1 -0
- package/dist/controllers/user-storage/network-syncing/sync-all.d.cts +35 -0
- package/dist/controllers/user-storage/network-syncing/sync-all.d.cts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/sync-all.d.mts +35 -0
- package/dist/controllers/user-storage/network-syncing/sync-all.d.mts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/sync-all.mjs +162 -0
- package/dist/controllers/user-storage/network-syncing/sync-all.mjs.map +1 -0
- package/dist/controllers/user-storage/network-syncing/sync-mutations.cjs +28 -0
- package/dist/controllers/user-storage/network-syncing/sync-mutations.cjs.map +1 -0
- package/dist/controllers/user-storage/network-syncing/sync-mutations.d.cts +9 -0
- package/dist/controllers/user-storage/network-syncing/sync-mutations.d.cts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/sync-mutations.d.mts +9 -0
- package/dist/controllers/user-storage/network-syncing/sync-mutations.d.mts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/sync-mutations.mjs +22 -0
- package/dist/controllers/user-storage/network-syncing/sync-mutations.mjs.map +1 -0
- package/dist/controllers/user-storage/network-syncing/types.cjs +16 -0
- package/dist/controllers/user-storage/network-syncing/types.cjs.map +1 -0
- package/dist/controllers/user-storage/network-syncing/types.d.cts +18 -0
- package/dist/controllers/user-storage/network-syncing/types.d.cts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/types.d.mts +18 -0
- package/dist/controllers/user-storage/network-syncing/types.d.mts.map +1 -0
- package/dist/controllers/user-storage/network-syncing/types.mjs +11 -0
- package/dist/controllers/user-storage/network-syncing/types.mjs.map +1 -0
- package/dist/controllers/user-storage/schema.cjs +56 -0
- package/dist/controllers/user-storage/schema.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/schema.d.ts → controllers/user-storage/schema.d.cts} +2 -1
- package/dist/controllers/user-storage/schema.d.cts.map +1 -0
- package/dist/controllers/user-storage/schema.d.mts +38 -0
- package/dist/controllers/user-storage/schema.d.mts.map +1 -0
- package/dist/controllers/user-storage/schema.mjs +48 -16
- package/dist/controllers/user-storage/schema.mjs.map +1 -1
- package/dist/controllers/user-storage/services.cjs +119 -0
- package/dist/controllers/user-storage/services.cjs.map +1 -0
- package/dist/{types/controllers/user-storage/services.d.ts → controllers/user-storage/services.d.cts} +4 -5
- package/dist/controllers/user-storage/services.d.cts.map +1 -0
- package/dist/controllers/user-storage/services.d.mts +48 -0
- package/dist/controllers/user-storage/services.d.mts.map +1 -0
- package/dist/controllers/user-storage/services.mjs +116 -21
- package/dist/controllers/user-storage/services.mjs.map +1 -1
- package/dist/controllers/user-storage/utils.cjs +30 -0
- package/dist/controllers/user-storage/utils.cjs.map +1 -0
- package/dist/controllers/user-storage/utils.d.cts +17 -0
- package/dist/controllers/user-storage/utils.d.cts.map +1 -0
- package/dist/controllers/user-storage/utils.d.mts +17 -0
- package/dist/controllers/user-storage/utils.d.mts.map +1 -0
- package/dist/controllers/user-storage/utils.mjs +25 -0
- package/dist/controllers/user-storage/utils.mjs.map +1 -0
- package/dist/index.cjs +30 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -39
- package/dist/index.mjs.map +1 -1
- package/dist/sdk/__fixtures__/mock-auth.cjs +139 -0
- package/dist/sdk/__fixtures__/mock-auth.cjs.map +1 -0
- package/dist/{types/sdk/__fixtures__/mock-auth.d.ts → sdk/__fixtures__/mock-auth.d.cts} +2 -2
- package/dist/sdk/__fixtures__/mock-auth.d.cts.map +1 -0
- package/dist/sdk/__fixtures__/mock-auth.d.mts +42 -0
- package/dist/sdk/__fixtures__/mock-auth.d.mts.map +1 -0
- package/dist/sdk/__fixtures__/mock-auth.mjs +134 -0
- package/dist/sdk/__fixtures__/mock-auth.mjs.map +1 -0
- package/dist/sdk/__fixtures__/mock-userstorage.cjs +58 -0
- package/dist/sdk/__fixtures__/mock-userstorage.cjs.map +1 -0
- package/dist/{types/sdk/__fixtures__/mock-userstorage.d.ts → sdk/__fixtures__/mock-userstorage.d.cts} +2 -2
- package/dist/sdk/__fixtures__/mock-userstorage.d.cts.map +1 -0
- package/dist/sdk/__fixtures__/mock-userstorage.d.mts +19 -0
- package/dist/sdk/__fixtures__/mock-userstorage.d.mts.map +1 -0
- package/dist/sdk/__fixtures__/mock-userstorage.mjs +54 -0
- package/dist/sdk/__fixtures__/mock-userstorage.mjs.map +1 -0
- package/dist/sdk/__fixtures__/test-utils.cjs +74 -0
- package/dist/sdk/__fixtures__/test-utils.cjs.map +1 -0
- package/dist/{types/sdk/__fixtures__/test-utils.d.ts → sdk/__fixtures__/test-utils.d.cts} +6 -6
- package/dist/sdk/__fixtures__/test-utils.d.cts.map +1 -0
- package/dist/sdk/__fixtures__/test-utils.d.mts +25 -0
- package/dist/sdk/__fixtures__/test-utils.d.mts.map +1 -0
- package/dist/sdk/__fixtures__/test-utils.mjs +69 -0
- package/dist/sdk/__fixtures__/test-utils.mjs.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.cjs +106 -0
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.cjs.map +1 -0
- package/dist/{types/sdk/authentication-jwt-bearer/flow-siwe.d.ts → sdk/authentication-jwt-bearer/flow-siwe.d.cts} +2 -2
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.d.cts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.d.mts +23 -0
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.d.mts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.mjs +101 -11
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.mjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/flow-srp.cjs +125 -0
- package/dist/sdk/authentication-jwt-bearer/flow-srp.cjs.map +1 -0
- package/dist/{types/sdk/authentication-jwt-bearer/flow-srp.d.ts → sdk/authentication-jwt-bearer/flow-srp.d.cts} +4 -2
- package/dist/sdk/authentication-jwt-bearer/flow-srp.d.cts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/flow-srp.d.mts +19 -0
- package/dist/sdk/authentication-jwt-bearer/flow-srp.d.mts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/flow-srp.mjs +119 -13
- package/dist/sdk/authentication-jwt-bearer/flow-srp.mjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/services.cjs +180 -0
- package/dist/sdk/authentication-jwt-bearer/services.cjs.map +1 -0
- package/dist/{types/sdk/authentication-jwt-bearer/services.d.ts → sdk/authentication-jwt-bearer/services.d.cts} +4 -4
- package/dist/sdk/authentication-jwt-bearer/services.d.cts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/services.d.mts +63 -0
- package/dist/sdk/authentication-jwt-bearer/services.d.mts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/services.mjs +166 -25
- package/dist/sdk/authentication-jwt-bearer/services.mjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/types.cjs +12 -0
- package/dist/sdk/authentication-jwt-bearer/types.cjs.map +1 -0
- package/dist/{types/sdk/authentication-jwt-bearer/types.d.ts → sdk/authentication-jwt-bearer/types.d.cts} +2 -2
- package/dist/sdk/authentication-jwt-bearer/types.d.cts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/types.d.mts +67 -0
- package/dist/sdk/authentication-jwt-bearer/types.d.mts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/types.mjs +8 -7
- package/dist/sdk/authentication-jwt-bearer/types.mjs.map +1 -1
- package/dist/sdk/authentication.cjs +124 -0
- package/dist/sdk/authentication.cjs.map +1 -0
- package/dist/{types/sdk/authentication.d.ts → sdk/authentication.d.cts} +7 -7
- package/dist/sdk/authentication.d.cts.map +1 -0
- package/dist/sdk/authentication.d.mts +32 -0
- package/dist/sdk/authentication.d.mts.map +1 -0
- package/dist/sdk/authentication.mjs +102 -24
- package/dist/sdk/authentication.mjs.map +1 -1
- package/dist/sdk/encryption.cjs +23 -0
- package/dist/sdk/encryption.cjs.map +1 -0
- package/dist/sdk/encryption.d.cts +4 -0
- package/dist/sdk/encryption.d.cts.map +1 -0
- package/dist/sdk/encryption.d.mts +4 -0
- package/dist/sdk/encryption.d.mts.map +1 -0
- package/dist/sdk/encryption.mjs +3 -13
- package/dist/sdk/encryption.mjs.map +1 -1
- package/dist/sdk/env.cjs +85 -0
- package/dist/sdk/env.cjs.map +1 -0
- package/dist/{types/sdk/env.d.ts → sdk/env.d.cts} +1 -1
- package/dist/sdk/env.d.cts.map +1 -0
- package/dist/sdk/env.d.mts +34 -0
- package/dist/sdk/env.d.mts.map +1 -0
- package/dist/sdk/env.mjs +78 -12
- package/dist/sdk/env.mjs.map +1 -1
- package/dist/sdk/errors.cjs +53 -0
- package/dist/sdk/errors.cjs.map +1 -0
- package/dist/{types/sdk/errors.d.ts → sdk/errors.d.cts} +1 -1
- package/dist/sdk/errors.d.cts.map +1 -0
- package/dist/sdk/errors.d.mts +22 -0
- package/dist/sdk/errors.d.mts.map +1 -0
- package/dist/sdk/errors.mjs +42 -19
- package/dist/sdk/errors.mjs.map +1 -1
- package/dist/sdk/index.cjs +23 -0
- package/dist/sdk/index.cjs.map +1 -0
- package/dist/sdk/index.d.cts +7 -0
- package/dist/sdk/index.d.cts.map +1 -0
- package/dist/sdk/index.d.mts +7 -0
- package/dist/sdk/index.d.mts.map +1 -0
- package/dist/sdk/index.mjs +6 -78
- package/dist/sdk/index.mjs.map +1 -1
- package/dist/sdk/user-storage.cjs +176 -0
- package/dist/sdk/user-storage.cjs.map +1 -0
- package/dist/{types/sdk/user-storage.d.ts → sdk/user-storage.d.cts} +4 -4
- package/dist/sdk/user-storage.d.cts.map +1 -0
- package/dist/sdk/user-storage.d.mts +27 -0
- package/dist/sdk/user-storage.d.mts.map +1 -0
- package/dist/sdk/user-storage.mjs +146 -16
- package/dist/sdk/user-storage.mjs.map +1 -1
- package/dist/sdk/utils/eip-6963-metamask-provider.cjs +70 -0
- package/dist/sdk/utils/eip-6963-metamask-provider.cjs.map +1 -0
- package/dist/{types/sdk/utils/eip-6963-metamask-provider.d.ts → sdk/utils/eip-6963-metamask-provider.d.cts} +2 -2
- package/dist/sdk/utils/eip-6963-metamask-provider.d.cts.map +1 -0
- package/dist/sdk/utils/eip-6963-metamask-provider.d.mts +25 -0
- package/dist/sdk/utils/eip-6963-metamask-provider.d.mts.map +1 -0
- package/dist/sdk/utils/eip-6963-metamask-provider.mjs +64 -8
- package/dist/sdk/utils/eip-6963-metamask-provider.mjs.map +1 -1
- package/dist/sdk/utils/messaging-signing-snap-requests.cjs +73 -0
- package/dist/sdk/utils/messaging-signing-snap-requests.cjs.map +1 -0
- package/dist/{types/sdk/utils/messaging-signing-snap-requests.d.ts → sdk/utils/messaging-signing-snap-requests.d.cts} +2 -7
- package/dist/sdk/utils/messaging-signing-snap-requests.d.cts.map +1 -0
- package/dist/sdk/utils/messaging-signing-snap-requests.d.mts +35 -0
- package/dist/sdk/utils/messaging-signing-snap-requests.d.mts.map +1 -0
- package/dist/sdk/utils/messaging-signing-snap-requests.mjs +65 -16
- package/dist/sdk/utils/messaging-signing-snap-requests.mjs.map +1 -1
- package/dist/sdk/utils/validate-login-response.cjs +22 -0
- package/dist/sdk/utils/validate-login-response.cjs.map +1 -0
- package/dist/{types/sdk/utils/validate-login-response.d.ts → sdk/utils/validate-login-response.d.cts} +2 -2
- package/dist/sdk/utils/validate-login-response.d.cts.map +1 -0
- package/dist/sdk/utils/validate-login-response.d.mts +10 -0
- package/dist/sdk/utils/validate-login-response.d.mts.map +1 -0
- package/dist/sdk/utils/validate-login-response.mjs +17 -7
- package/dist/sdk/utils/validate-login-response.mjs.map +1 -1
- package/package.json +62 -30
- package/sdk/package.json +9 -0
- package/user-storage/mocks/package.json +2 -2
- package/user-storage/package.json +2 -2
- package/dist/chunk-2CWF7ZTL.mjs +0 -129
- package/dist/chunk-2CWF7ZTL.mjs.map +0 -1
- package/dist/chunk-2VEMA6OE.mjs +0 -47
- package/dist/chunk-2VEMA6OE.mjs.map +0 -1
- package/dist/chunk-4LMFZDL4.js +0 -114
- package/dist/chunk-4LMFZDL4.js.map +0 -1
- package/dist/chunk-4TMLEABQ.js +0 -79
- package/dist/chunk-4TMLEABQ.js.map +0 -1
- package/dist/chunk-5MQUI24U.js +0 -47
- package/dist/chunk-5MQUI24U.js.map +0 -1
- package/dist/chunk-5XSXZTED.mjs +0 -57
- package/dist/chunk-5XSXZTED.mjs.map +0 -1
- package/dist/chunk-6DAK2U35.mjs +0 -11
- package/dist/chunk-6DAK2U35.mjs.map +0 -1
- package/dist/chunk-76NMME23.mjs +0 -114
- package/dist/chunk-76NMME23.mjs.map +0 -1
- package/dist/chunk-76VRE4BI.mjs +0 -18
- package/dist/chunk-76VRE4BI.mjs.map +0 -1
- package/dist/chunk-BKQE7DB5.js +0 -170
- package/dist/chunk-BKQE7DB5.js.map +0 -1
- package/dist/chunk-CAIIVJAO.mjs +0 -11
- package/dist/chunk-CAIIVJAO.mjs.map +0 -1
- package/dist/chunk-COBJUBZE.mjs +0 -170
- package/dist/chunk-COBJUBZE.mjs.map +0 -1
- package/dist/chunk-D4SNJOID.mjs +0 -269
- package/dist/chunk-D4SNJOID.mjs.map +0 -1
- package/dist/chunk-DF24ZX4H.js +0 -76
- package/dist/chunk-DF24ZX4H.js.map +0 -1
- package/dist/chunk-DRB2MN4T.js +0 -16
- package/dist/chunk-DRB2MN4T.js.map +0 -1
- package/dist/chunk-EHZFPUJH.mjs +0 -53
- package/dist/chunk-EHZFPUJH.mjs.map +0 -1
- package/dist/chunk-F6BAOSH2.js +0 -269
- package/dist/chunk-F6BAOSH2.js.map +0 -1
- package/dist/chunk-GQXYWBFK.js +0 -28
- package/dist/chunk-GQXYWBFK.js.map +0 -1
- package/dist/chunk-H25EBXG5.mjs +0 -58
- package/dist/chunk-H25EBXG5.mjs.map +0 -1
- package/dist/chunk-IGY2S5BC.js +0 -36
- package/dist/chunk-IGY2S5BC.js.map +0 -1
- package/dist/chunk-JAQ5TPSZ.js +0 -53
- package/dist/chunk-JAQ5TPSZ.js.map +0 -1
- package/dist/chunk-KHASG4H3.mjs +0 -11
- package/dist/chunk-KHASG4H3.mjs.map +0 -1
- package/dist/chunk-KIVBL6OM.js +0 -129
- package/dist/chunk-KIVBL6OM.js.map +0 -1
- package/dist/chunk-KTCSRECK.mjs +0 -76
- package/dist/chunk-KTCSRECK.mjs.map +0 -1
- package/dist/chunk-LGXQBALM.mjs +0 -106
- package/dist/chunk-LGXQBALM.mjs.map +0 -1
- package/dist/chunk-LLG4D2SC.js +0 -157
- package/dist/chunk-LLG4D2SC.js.map +0 -1
- package/dist/chunk-M7AUA5W7.mjs +0 -79
- package/dist/chunk-M7AUA5W7.mjs.map +0 -1
- package/dist/chunk-MBTBE4P5.js +0 -54
- package/dist/chunk-MBTBE4P5.js.map +0 -1
- package/dist/chunk-MK7ABX2V.mjs +0 -186
- package/dist/chunk-MK7ABX2V.mjs.map +0 -1
- package/dist/chunk-NEBLEB3X.mjs +0 -107
- package/dist/chunk-NEBLEB3X.mjs.map +0 -1
- package/dist/chunk-NIUQ34PY.js +0 -11
- package/dist/chunk-NIUQ34PY.js.map +0 -1
- package/dist/chunk-NMIF3LSX.mjs +0 -29
- package/dist/chunk-NMIF3LSX.mjs.map +0 -1
- package/dist/chunk-OLFO6R7Z.mjs +0 -546
- package/dist/chunk-OLFO6R7Z.mjs.map +0 -1
- package/dist/chunk-PBRUOBEQ.js +0 -11
- package/dist/chunk-PBRUOBEQ.js.map +0 -1
- package/dist/chunk-PCOIRDTO.js +0 -18
- package/dist/chunk-PCOIRDTO.js.map +0 -1
- package/dist/chunk-PQMPSEVJ.js +0 -546
- package/dist/chunk-PQMPSEVJ.js.map +0 -1
- package/dist/chunk-PRYLTXW4.js +0 -92
- package/dist/chunk-PRYLTXW4.js.map +0 -1
- package/dist/chunk-PU7MAIST.mjs +0 -129
- package/dist/chunk-PU7MAIST.mjs.map +0 -1
- package/dist/chunk-QCQU4BQL.js +0 -68
- package/dist/chunk-QCQU4BQL.js.map +0 -1
- package/dist/chunk-QDGLIUUS.mjs +0 -16
- package/dist/chunk-QDGLIUUS.mjs.map +0 -1
- package/dist/chunk-RG4II6WH.js +0 -57
- package/dist/chunk-RG4II6WH.js.map +0 -1
- package/dist/chunk-TFFQFIJV.mjs +0 -54
- package/dist/chunk-TFFQFIJV.mjs.map +0 -1
- package/dist/chunk-TP7SP3AG.mjs +0 -133
- package/dist/chunk-TP7SP3AG.mjs.map +0 -1
- package/dist/chunk-U5UIDVOO.mjs +0 -36
- package/dist/chunk-U5UIDVOO.mjs.map +0 -1
- package/dist/chunk-UAXWZN5J.js +0 -58
- package/dist/chunk-UAXWZN5J.js.map +0 -1
- package/dist/chunk-UEHMUVQQ.js +0 -133
- package/dist/chunk-UEHMUVQQ.js.map +0 -1
- package/dist/chunk-UEWCUBMX.mjs +0 -68
- package/dist/chunk-UEWCUBMX.mjs.map +0 -1
- package/dist/chunk-UHP2Y32K.mjs +0 -92
- package/dist/chunk-UHP2Y32K.mjs.map +0 -1
- package/dist/chunk-UHX7HJAI.js +0 -11
- package/dist/chunk-UHX7HJAI.js.map +0 -1
- package/dist/chunk-UIRAMHNM.js +0 -186
- package/dist/chunk-UIRAMHNM.js.map +0 -1
- package/dist/chunk-VWDRFRJU.js +0 -107
- package/dist/chunk-VWDRFRJU.js.map +0 -1
- package/dist/chunk-Y45XUW33.js +0 -129
- package/dist/chunk-Y45XUW33.js.map +0 -1
- package/dist/chunk-YHGWG3EQ.js +0 -29
- package/dist/chunk-YHGWG3EQ.js.map +0 -1
- package/dist/chunk-YLURF2PF.mjs +0 -157
- package/dist/chunk-YLURF2PF.mjs.map +0 -1
- package/dist/chunk-ZUPTMFEA.mjs +0 -28
- package/dist/chunk-ZUPTMFEA.mjs.map +0 -1
- package/dist/chunk-ZX2KHPXG.js +0 -106
- package/dist/chunk-ZX2KHPXG.js.map +0 -1
- package/dist/controllers/authentication/AuthenticationController.js +0 -13
- package/dist/controllers/authentication/AuthenticationController.js.map +0 -1
- package/dist/controllers/authentication/auth-snap-requests.js +0 -10
- package/dist/controllers/authentication/auth-snap-requests.js.map +0 -1
- package/dist/controllers/authentication/index.js +0 -19
- package/dist/controllers/authentication/index.js.map +0 -1
- package/dist/controllers/authentication/services.js +0 -21
- package/dist/controllers/authentication/services.js.map +0 -1
- package/dist/controllers/index.js +0 -25
- package/dist/controllers/index.js.map +0 -1
- package/dist/controllers/user-storage/UserStorageController.js +0 -20
- package/dist/controllers/user-storage/UserStorageController.js.map +0 -1
- package/dist/controllers/user-storage/accounts/constants.js +0 -12
- package/dist/controllers/user-storage/accounts/constants.js.map +0 -1
- package/dist/controllers/user-storage/accounts/user-storage.js +0 -11
- package/dist/controllers/user-storage/accounts/user-storage.js.map +0 -1
- package/dist/controllers/user-storage/encryption/cache.js +0 -13
- package/dist/controllers/user-storage/encryption/cache.js.map +0 -1
- package/dist/controllers/user-storage/encryption/encryption.js +0 -12
- package/dist/controllers/user-storage/encryption/encryption.js.map +0 -1
- package/dist/controllers/user-storage/encryption/index.js +0 -16
- package/dist/controllers/user-storage/encryption/index.js.map +0 -1
- package/dist/controllers/user-storage/encryption/utils.js +0 -12
- package/dist/controllers/user-storage/encryption/utils.js.map +0 -1
- package/dist/controllers/user-storage/index.js +0 -31
- package/dist/controllers/user-storage/index.js.map +0 -1
- package/dist/controllers/user-storage/schema.js +0 -18
- package/dist/controllers/user-storage/schema.js.map +0 -1
- package/dist/controllers/user-storage/services.js +0 -22
- package/dist/controllers/user-storage/services.js.map +0 -1
- package/dist/index.js +0 -40
- package/dist/index.js.map +0 -1
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.js +0 -13
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.js.map +0 -1
- package/dist/sdk/authentication-jwt-bearer/flow-srp.js +0 -15
- package/dist/sdk/authentication-jwt-bearer/flow-srp.js.map +0 -1
- package/dist/sdk/authentication-jwt-bearer/services.js +0 -27
- package/dist/sdk/authentication-jwt-bearer/services.js.map +0 -1
- package/dist/sdk/authentication-jwt-bearer/types.js +0 -8
- package/dist/sdk/authentication-jwt-bearer/types.js.map +0 -1
- package/dist/sdk/authentication.js +0 -26
- package/dist/sdk/authentication.js.map +0 -1
- package/dist/sdk/encryption.js +0 -14
- package/dist/sdk/encryption.js.map +0 -1
- package/dist/sdk/env.js +0 -14
- package/dist/sdk/env.js.map +0 -1
- package/dist/sdk/errors.js +0 -20
- package/dist/sdk/errors.js.map +0 -1
- package/dist/sdk/index.js +0 -79
- package/dist/sdk/index.js.map +0 -1
- package/dist/sdk/user-storage.js +0 -18
- package/dist/sdk/user-storage.js.map +0 -1
- package/dist/sdk/utils/eip-6963-metamask-provider.js +0 -10
- package/dist/sdk/utils/eip-6963-metamask-provider.js.map +0 -1
- package/dist/sdk/utils/messaging-signing-snap-requests.js +0 -18
- package/dist/sdk/utils/messaging-signing-snap-requests.js.map +0 -1
- package/dist/sdk/utils/validate-login-response.js +0 -8
- package/dist/sdk/utils/validate-login-response.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/controllers/authentication/AuthenticationController.d.ts.map +0 -1
- package/dist/types/controllers/authentication/__fixtures__/index.d.ts +0 -2
- package/dist/types/controllers/authentication/__fixtures__/index.d.ts.map +0 -1
- package/dist/types/controllers/authentication/__fixtures__/mockResponses.d.ts.map +0 -1
- package/dist/types/controllers/authentication/__fixtures__/mockServices.d.ts.map +0 -1
- package/dist/types/controllers/authentication/auth-snap-requests.d.ts.map +0 -1
- package/dist/types/controllers/authentication/index.d.ts +0 -7
- package/dist/types/controllers/authentication/index.d.ts.map +0 -1
- package/dist/types/controllers/authentication/services.d.ts.map +0 -1
- package/dist/types/controllers/index.d.ts +0 -3
- package/dist/types/controllers/index.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/UserStorageController.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/__fixtures__/index.d.ts +0 -3
- package/dist/types/controllers/user-storage/__fixtures__/index.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/__fixtures__/mockAccounts.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/__fixtures__/mockResponses.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/__fixtures__/mockServices.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/__fixtures__/mockStorage.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/accounts/constants.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/accounts/user-storage.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/encryption/cache.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/encryption/encryption.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/encryption/index.d.ts +0 -5
- package/dist/types/controllers/user-storage/encryption/index.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/encryption/utils.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/index.d.ts +0 -8
- package/dist/types/controllers/user-storage/index.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/schema.d.ts.map +0 -1
- package/dist/types/controllers/user-storage/services.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/sdk/__fixtures__/mock-auth.d.ts.map +0 -1
- package/dist/types/sdk/__fixtures__/mock-userstorage.d.ts.map +0 -1
- package/dist/types/sdk/__fixtures__/test-utils.d.ts.map +0 -1
- package/dist/types/sdk/authentication-jwt-bearer/flow-siwe.d.ts.map +0 -1
- package/dist/types/sdk/authentication-jwt-bearer/flow-srp.d.ts.map +0 -1
- package/dist/types/sdk/authentication-jwt-bearer/services.d.ts.map +0 -1
- package/dist/types/sdk/authentication-jwt-bearer/types.d.ts.map +0 -1
- package/dist/types/sdk/authentication.d.ts.map +0 -1
- package/dist/types/sdk/encryption.d.ts +0 -4
- package/dist/types/sdk/encryption.d.ts.map +0 -1
- package/dist/types/sdk/env.d.ts.map +0 -1
- package/dist/types/sdk/errors.d.ts.map +0 -1
- package/dist/types/sdk/index.d.ts +0 -7
- package/dist/types/sdk/index.d.ts.map +0 -1
- package/dist/types/sdk/user-storage.d.ts.map +0 -1
- package/dist/types/sdk/utils/eip-6963-metamask-provider.d.ts.map +0 -1
- package/dist/types/sdk/utils/messaging-signing-snap-requests.d.ts.map +0 -1
- package/dist/types/sdk/utils/validate-login-response.d.ts.map +0 -1
|
@@ -1,22 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import "../../
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import $log from "loglevel";
|
|
8
|
+
const log = $importDefault($log);
|
|
9
|
+
import { Env, getEnvUrls } from "../../sdk/env.mjs";
|
|
10
|
+
import encryption from "./encryption/index.mjs";
|
|
11
|
+
import { createEntryPath } from "./schema.mjs";
|
|
12
|
+
const ENV_URLS = getEnvUrls(Env.PRD);
|
|
13
|
+
export const USER_STORAGE_API = ENV_URLS.userStorageApiUrl;
|
|
14
|
+
export const USER_STORAGE_ENDPOINT = `${USER_STORAGE_API}/api/v1/userstorage`;
|
|
15
|
+
/**
|
|
16
|
+
* User Storage Service - Get Storage Entry.
|
|
17
|
+
*
|
|
18
|
+
* @param opts - User Storage Options
|
|
19
|
+
* @returns The storage entry, or null if fails to find entry
|
|
20
|
+
*/
|
|
21
|
+
export async function getUserStorage(opts) {
|
|
22
|
+
try {
|
|
23
|
+
const { bearerToken, path, storageKey, nativeScryptCrypto } = opts;
|
|
24
|
+
const encryptedPath = createEntryPath(path, storageKey);
|
|
25
|
+
const url = new URL(`${USER_STORAGE_ENDPOINT}/${encryptedPath}`);
|
|
26
|
+
const userStorageResponse = await fetch(url.toString(), {
|
|
27
|
+
headers: {
|
|
28
|
+
'Content-Type': 'application/json',
|
|
29
|
+
Authorization: `Bearer ${bearerToken}`,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
// Acceptable error - since indicates entry does not exist.
|
|
33
|
+
if (userStorageResponse.status === 404) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
if (userStorageResponse.status !== 200) {
|
|
37
|
+
throw new Error('Unable to get User Storage');
|
|
38
|
+
}
|
|
39
|
+
const userStorage = await userStorageResponse.json();
|
|
40
|
+
const encryptedData = userStorage?.Data ?? null;
|
|
41
|
+
if (!encryptedData) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const decryptedData = await encryption.decryptString(encryptedData, opts.storageKey, nativeScryptCrypto);
|
|
45
|
+
return decryptedData;
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
log.error('Failed to get user storage', e);
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* User Storage Service - Get all storage entries for a specific feature.
|
|
54
|
+
*
|
|
55
|
+
* @param opts - User Storage Options
|
|
56
|
+
* @returns The storage entry, or null if fails to find entry
|
|
57
|
+
*/
|
|
58
|
+
export async function getUserStorageAllFeatureEntries(opts) {
|
|
59
|
+
try {
|
|
60
|
+
const { bearerToken, path, nativeScryptCrypto } = opts;
|
|
61
|
+
const url = new URL(`${USER_STORAGE_ENDPOINT}/${path}`);
|
|
62
|
+
const userStorageResponse = await fetch(url.toString(), {
|
|
63
|
+
headers: {
|
|
64
|
+
'Content-Type': 'application/json',
|
|
65
|
+
Authorization: `Bearer ${bearerToken}`,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
// Acceptable error - since indicates feature does not exist.
|
|
69
|
+
if (userStorageResponse.status === 404) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
if (userStorageResponse.status !== 200) {
|
|
73
|
+
throw new Error('Unable to get User Storage');
|
|
74
|
+
}
|
|
75
|
+
const userStorage = await userStorageResponse.json();
|
|
76
|
+
if (!Array.isArray(userStorage)) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
const decryptedData = userStorage?.flatMap((entry) => {
|
|
80
|
+
if (!entry.Data) {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
return encryption.decryptString(entry.Data, opts.storageKey, nativeScryptCrypto);
|
|
84
|
+
});
|
|
85
|
+
return (await Promise.allSettled(decryptedData))
|
|
86
|
+
.map((d) => (d.status === 'fulfilled' ? d.value : undefined))
|
|
87
|
+
.filter((d) => d !== undefined);
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
log.error('Failed to get user storage', e);
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* User Storage Service - Set Storage Entry.
|
|
96
|
+
*
|
|
97
|
+
* @param data - data to store
|
|
98
|
+
* @param opts - storage options
|
|
99
|
+
*/
|
|
100
|
+
export async function upsertUserStorage(data, opts) {
|
|
101
|
+
const { bearerToken, path, storageKey, nativeScryptCrypto } = opts;
|
|
102
|
+
const encryptedData = await encryption.encryptString(data, opts.storageKey, nativeScryptCrypto);
|
|
103
|
+
const encryptedPath = createEntryPath(path, storageKey);
|
|
104
|
+
const url = new URL(`${USER_STORAGE_ENDPOINT}/${encryptedPath}`);
|
|
105
|
+
const res = await fetch(url.toString(), {
|
|
106
|
+
method: 'PUT',
|
|
107
|
+
headers: {
|
|
108
|
+
'Content-Type': 'application/json',
|
|
109
|
+
Authorization: `Bearer ${bearerToken}`,
|
|
110
|
+
},
|
|
111
|
+
body: JSON.stringify({ data: encryptedData }),
|
|
112
|
+
});
|
|
113
|
+
if (!res.ok) {
|
|
114
|
+
throw new Error('user-storage - unable to upsert data');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
22
117
|
//# sourceMappingURL=services.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"services.mjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/services.ts"],"names":[],"mappings":"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","sourcesContent":["import log from 'loglevel';\n\nimport { Env, getEnvUrls } from '../../sdk/env';\nimport encryption from './encryption';\nimport type {\n UserStoragePathWithFeatureAndKey,\n UserStoragePathWithFeatureOnly,\n} from './schema';\nimport { createEntryPath } from './schema';\nimport type { NativeScrypt } from './UserStorageController';\n\nconst ENV_URLS = getEnvUrls(Env.PRD);\n\nexport const USER_STORAGE_API: string = ENV_URLS.userStorageApiUrl;\nexport const USER_STORAGE_ENDPOINT = `${USER_STORAGE_API}/api/v1/userstorage`;\n\n/**\n * This is the Server Response shape for a feature entry.\n */\nexport type GetUserStorageResponse = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HashedKey: string;\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Data: string;\n};\n\nexport type GetUserStorageAllFeatureEntriesResponse = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n HashedKey: string;\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Data: string;\n}[];\n\nexport type UserStorageBaseOptions = {\n bearerToken: string;\n storageKey: string;\n nativeScryptCrypto?: NativeScrypt;\n};\n\nexport type UserStorageOptions = UserStorageBaseOptions & {\n path: UserStoragePathWithFeatureAndKey;\n};\n\nexport type UserStorageAllFeatureEntriesOptions = UserStorageBaseOptions & {\n path: UserStoragePathWithFeatureOnly;\n};\n\n/**\n * User Storage Service - Get Storage Entry.\n *\n * @param opts - User Storage Options\n * @returns The storage entry, or null if fails to find entry\n */\nexport async function getUserStorage(\n opts: UserStorageOptions,\n): Promise<string | null> {\n try {\n const { bearerToken, path, storageKey, nativeScryptCrypto } = opts;\n\n const encryptedPath = createEntryPath(path, storageKey);\n const url = new URL(`${USER_STORAGE_ENDPOINT}/${encryptedPath}`);\n\n const userStorageResponse = await fetch(url.toString(), {\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${bearerToken}`,\n },\n });\n\n // Acceptable error - since indicates entry does not exist.\n if (userStorageResponse.status === 404) {\n return null;\n }\n\n if (userStorageResponse.status !== 200) {\n throw new Error('Unable to get User Storage');\n }\n\n const userStorage: GetUserStorageResponse | null =\n await userStorageResponse.json();\n const encryptedData = userStorage?.Data ?? null;\n\n if (!encryptedData) {\n return null;\n }\n\n const decryptedData = await encryption.decryptString(\n encryptedData,\n opts.storageKey,\n nativeScryptCrypto,\n );\n\n return decryptedData;\n } catch (e) {\n log.error('Failed to get user storage', e);\n return null;\n }\n}\n\n/**\n * User Storage Service - Get all storage entries for a specific feature.\n *\n * @param opts - User Storage Options\n * @returns The storage entry, or null if fails to find entry\n */\nexport async function getUserStorageAllFeatureEntries(\n opts: UserStorageAllFeatureEntriesOptions,\n): Promise<string[] | null> {\n try {\n const { bearerToken, path, nativeScryptCrypto } = opts;\n const url = new URL(`${USER_STORAGE_ENDPOINT}/${path}`);\n\n const userStorageResponse = await fetch(url.toString(), {\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${bearerToken}`,\n },\n });\n\n // Acceptable error - since indicates feature does not exist.\n if (userStorageResponse.status === 404) {\n return null;\n }\n\n if (userStorageResponse.status !== 200) {\n throw new Error('Unable to get User Storage');\n }\n\n const userStorage: GetUserStorageAllFeatureEntriesResponse | null =\n await userStorageResponse.json();\n\n if (!Array.isArray(userStorage)) {\n return null;\n }\n\n const decryptedData = userStorage?.flatMap((entry) => {\n if (!entry.Data) {\n return [];\n }\n\n return encryption.decryptString(\n entry.Data,\n opts.storageKey,\n nativeScryptCrypto,\n );\n });\n\n return (await Promise.allSettled(decryptedData))\n .map((d) => (d.status === 'fulfilled' ? d.value : undefined))\n .filter((d): d is string => d !== undefined);\n } catch (e) {\n log.error('Failed to get user storage', e);\n return null;\n }\n}\n\n/**\n * User Storage Service - Set Storage Entry.\n *\n * @param data - data to store\n * @param opts - storage options\n */\nexport async function upsertUserStorage(\n data: string,\n opts: UserStorageOptions,\n): Promise<void> {\n const { bearerToken, path, storageKey, nativeScryptCrypto } = opts;\n\n const encryptedData = await encryption.encryptString(\n data,\n opts.storageKey,\n nativeScryptCrypto,\n );\n const encryptedPath = createEntryPath(path, storageKey);\n const url = new URL(`${USER_STORAGE_ENDPOINT}/${encryptedPath}`);\n\n const res = await fetch(url.toString(), {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${bearerToken}`,\n },\n body: JSON.stringify({ data: encryptedData }),\n });\n\n if (!res.ok) {\n throw new Error('user-storage - unable to upsert data');\n }\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
* @param a - First Set
|
|
8
|
+
* @param b - Second Set
|
|
9
|
+
* @returns The difference between the first and second set.
|
|
10
|
+
*/
|
|
11
|
+
function setDifference(a, b) {
|
|
12
|
+
const difference = new Set();
|
|
13
|
+
a.forEach((e) => !b.has(e) && difference.add(e));
|
|
14
|
+
return difference;
|
|
15
|
+
}
|
|
16
|
+
exports.setDifference = setDifference;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the intersection between 2 sets.
|
|
19
|
+
* NOTE - this is temporary until we can support Set().intersection method
|
|
20
|
+
* @param a - First Set
|
|
21
|
+
* @param b - Second Set
|
|
22
|
+
* @returns The intersection between the first and second set.
|
|
23
|
+
*/
|
|
24
|
+
function setIntersection(a, b) {
|
|
25
|
+
const intersection = new Set();
|
|
26
|
+
a.forEach((e) => b.has(e) && intersection.add(e));
|
|
27
|
+
return intersection;
|
|
28
|
+
}
|
|
29
|
+
exports.setIntersection = setIntersection;
|
|
30
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.cjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/utils.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;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;;;;;;GAMG;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 * @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 * @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"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the difference between 2 sets.
|
|
3
|
+
* NOTE - this is temporary until we can support Set().difference method
|
|
4
|
+
* @param a - First Set
|
|
5
|
+
* @param b - Second Set
|
|
6
|
+
* @returns The difference between the first and second set.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setDifference<TItem>(a: Set<TItem>, b: Set<TItem>): Set<TItem>;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the intersection between 2 sets.
|
|
11
|
+
* NOTE - this is temporary until we can support Set().intersection method
|
|
12
|
+
* @param a - First Set
|
|
13
|
+
* @param b - Second Set
|
|
14
|
+
* @returns The intersection between the first and second set.
|
|
15
|
+
*/
|
|
16
|
+
export declare function setIntersection<TItem>(a: Set<TItem>, b: Set<TItem>): Set<TItem>;
|
|
17
|
+
//# sourceMappingURL=utils.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.cts","sourceRoot":"","sources":["../../../src/controllers/user-storage/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;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;;;;;;GAMG;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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the difference between 2 sets.
|
|
3
|
+
* NOTE - this is temporary until we can support Set().difference method
|
|
4
|
+
* @param a - First Set
|
|
5
|
+
* @param b - Second Set
|
|
6
|
+
* @returns The difference between the first and second set.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setDifference<TItem>(a: Set<TItem>, b: Set<TItem>): Set<TItem>;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the intersection between 2 sets.
|
|
11
|
+
* NOTE - this is temporary until we can support Set().intersection method
|
|
12
|
+
* @param a - First Set
|
|
13
|
+
* @param b - Second Set
|
|
14
|
+
* @returns The intersection between the first and second set.
|
|
15
|
+
*/
|
|
16
|
+
export declare function setIntersection<TItem>(a: Set<TItem>, b: Set<TItem>): Set<TItem>;
|
|
17
|
+
//# sourceMappingURL=utils.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.mts","sourceRoot":"","sources":["../../../src/controllers/user-storage/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;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;;;;;;GAMG;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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the difference between 2 sets.
|
|
3
|
+
* NOTE - this is temporary until we can support Set().difference method
|
|
4
|
+
* @param a - First Set
|
|
5
|
+
* @param b - Second Set
|
|
6
|
+
* @returns The difference between the first and second set.
|
|
7
|
+
*/
|
|
8
|
+
export function setDifference(a, b) {
|
|
9
|
+
const difference = new Set();
|
|
10
|
+
a.forEach((e) => !b.has(e) && difference.add(e));
|
|
11
|
+
return difference;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Returns the intersection between 2 sets.
|
|
15
|
+
* NOTE - this is temporary until we can support Set().intersection method
|
|
16
|
+
* @param a - First Set
|
|
17
|
+
* @param b - Second Set
|
|
18
|
+
* @returns The intersection between the first and second set.
|
|
19
|
+
*/
|
|
20
|
+
export function setIntersection(a, b) {
|
|
21
|
+
const intersection = new Set();
|
|
22
|
+
a.forEach((e) => b.has(e) && intersection.add(e));
|
|
23
|
+
return intersection;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;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;;;;;;GAMG;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 * @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 * @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
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA6B;AAC7B,mGAAyE;AACzE,8FAAoE","sourcesContent":["export * as SDK from './sdk';\nexport * as AuthenticationController from './controllers/authentication';\nexport * as UserStorageController from './controllers/user-storage';\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAc;AAC7B,OAAO,KAAK,wBAAwB,+CAAqC;AACzE,OAAO,KAAK,qBAAqB,6CAAmC"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAc;AAC7B,OAAO,KAAK,wBAAwB,+CAAqC;AACzE,OAAO,KAAK,qBAAqB,6CAAmC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,40 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import "./chunk-D4SNJOID.mjs";
|
|
5
|
-
import "./chunk-LGXQBALM.mjs";
|
|
6
|
-
import {
|
|
7
|
-
user_storage_exports
|
|
8
|
-
} from "./chunk-NEBLEB3X.mjs";
|
|
9
|
-
import "./chunk-OLFO6R7Z.mjs";
|
|
10
|
-
import "./chunk-ZUPTMFEA.mjs";
|
|
11
|
-
import "./chunk-EHZFPUJH.mjs";
|
|
12
|
-
import "./chunk-NMIF3LSX.mjs";
|
|
13
|
-
import "./chunk-76NMME23.mjs";
|
|
14
|
-
import {
|
|
15
|
-
sdk_exports
|
|
16
|
-
} from "./chunk-M7AUA5W7.mjs";
|
|
17
|
-
import "./chunk-PU7MAIST.mjs";
|
|
18
|
-
import "./chunk-2CWF7ZTL.mjs";
|
|
19
|
-
import "./chunk-TP7SP3AG.mjs";
|
|
20
|
-
import "./chunk-YLURF2PF.mjs";
|
|
21
|
-
import "./chunk-CAIIVJAO.mjs";
|
|
22
|
-
import "./chunk-5XSXZTED.mjs";
|
|
23
|
-
import "./chunk-UEWCUBMX.mjs";
|
|
24
|
-
import "./chunk-QDGLIUUS.mjs";
|
|
25
|
-
import "./chunk-MK7ABX2V.mjs";
|
|
26
|
-
import "./chunk-2VEMA6OE.mjs";
|
|
27
|
-
import "./chunk-KHASG4H3.mjs";
|
|
28
|
-
import "./chunk-6DAK2U35.mjs";
|
|
29
|
-
import "./chunk-COBJUBZE.mjs";
|
|
30
|
-
import "./chunk-H25EBXG5.mjs";
|
|
31
|
-
import "./chunk-76VRE4BI.mjs";
|
|
32
|
-
import "./chunk-KTCSRECK.mjs";
|
|
33
|
-
import "./chunk-TFFQFIJV.mjs";
|
|
34
|
-
import "./chunk-U5UIDVOO.mjs";
|
|
35
|
-
export {
|
|
36
|
-
authentication_exports as AuthenticationController,
|
|
37
|
-
sdk_exports as SDK,
|
|
38
|
-
user_storage_exports as UserStorageController
|
|
39
|
-
};
|
|
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";
|
|
40
4
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAc;AAC7B,OAAO,KAAK,wBAAwB,+CAAqC;AACzE,OAAO,KAAK,qBAAqB,6CAAmC","sourcesContent":["export * as SDK from './sdk';\nexport * as AuthenticationController from './controllers/authentication';\nexport * as UserStorageController from './controllers/user-storage';\n"]}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.arrangeAuthAPIs = exports.handleMockOAuth2Token = exports.handleMockSrpLogin = exports.handleMockPairIdentifiers = exports.handleMockSiweLogin = exports.handleMockNonce = exports.MOCK_OIDC_TOKEN_RESPONSE = exports.MOCK_SRP_LOGIN_RESPONSE = exports.MOCK_ACCESS_JWT = exports.MOCK_JWT = void 0;
|
|
7
|
+
const nock_1 = __importDefault(require("nock"));
|
|
8
|
+
const services_1 = require("../authentication-jwt-bearer/services.cjs");
|
|
9
|
+
const env_1 = require("../env.cjs");
|
|
10
|
+
const MOCK_NONCE_URL = (0, services_1.NONCE_URL)(env_1.Env.DEV);
|
|
11
|
+
const MOCK_SIWE_LOGIN_URL = (0, services_1.SIWE_LOGIN_URL)(env_1.Env.DEV);
|
|
12
|
+
const MOCK_PAIR_IDENTIFIERS_URL = (0, services_1.PAIR_IDENTIFIERS)(env_1.Env.DEV);
|
|
13
|
+
const MOCK_SRP_LOGIN_URL = (0, services_1.SRP_LOGIN_URL)(env_1.Env.DEV);
|
|
14
|
+
const MOCK_OIDC_TOKEN_URL = (0, services_1.OIDC_TOKEN_URL)(env_1.Env.DEV);
|
|
15
|
+
exports.MOCK_JWT = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImIwNzE2N2U2LWJjNWUtNDgyZC1hNjRhLWU1MjQ0MjY2MGU3NyJ9.eyJzdWIiOiI1MzE0ODc5YWM2NDU1OGI3OTQ5ZmI4NWIzMjg2ZjZjNjUwODAzYmFiMTY0Y2QyOWNmMmM3YzdmMjMzMWMwZTRlIiwiaWF0IjoxNzA2MTEzMDYyLCJleHAiOjE3NjkxODUwNjMsImlzcyI6ImF1dGgubWV0YW1hc2suaW8iLCJhdWQiOiJwb3J0Zm9saW8ubWV0YW1hc2suaW8ifQ.E5UL6oABNweS8t5a6IBTqTf7NLOJbrhJSmEcsr7kwLp4bGvcENJzACwnsHDkA6PlzfDV09ZhAGU_F3hlS0j-erbY0k0AFR-GAtyS7E9N02D8RgUDz5oDR65CKmzM8JilgFA8UvruJ6OJGogroaOSOqzRES_s8MjHpP47RJ9lXrUesajsbOudXbuksXWg5QmWip6LLvjwr8UUzcJzNQilyIhiEpo4WdzWM4R3VtTwr4rHnWEvtYnYCov1jmI2w3YQ48y0M-3Y9IOO0ov_vlITRrOnR7Y7fRUGLUFmU5msD8mNWRywjQFLHfJJ1yNP5aJ8TkuCK3sC6kcUH335IVvukQ';
|
|
16
|
+
exports.MOCK_ACCESS_JWT = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
|
|
17
|
+
const MOCK_NONCE_RESPONSE = {
|
|
18
|
+
nonce: 'xGMm9SoihEKeAEfV',
|
|
19
|
+
identifier: '0xd8641601Cb79a94FD872fE42d5b4a067A44a7e88',
|
|
20
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
22
|
+
expires_in: 300,
|
|
23
|
+
};
|
|
24
|
+
const MOCK_SIWE_LOGIN_RESPONSE = {
|
|
25
|
+
token: exports.MOCK_JWT,
|
|
26
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
28
|
+
expires_in: 3600,
|
|
29
|
+
profile: {
|
|
30
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
32
|
+
profile_id: 'fa2bbf82-bd9a-4e6b-aabc-9ca0d0319b6e',
|
|
33
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
35
|
+
metametrics_id: 'de742679-4960-4977-a415-4718b5f8e86c',
|
|
36
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
38
|
+
identifier_id: 'ec9a4e9906836497efad2fd4d4290b34d2c6a2c0d93eb174aa3cd88a133adbaf',
|
|
39
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
41
|
+
identifier_type: 'SIWE',
|
|
42
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
44
|
+
encrypted_storage_key: '2c6a2c0d93eb174aa3cd88a133adbaf',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
exports.MOCK_SRP_LOGIN_RESPONSE = {
|
|
48
|
+
token: exports.MOCK_JWT,
|
|
49
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
51
|
+
expires_in: 3600,
|
|
52
|
+
profile: {
|
|
53
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
55
|
+
profile_id: 'f88227bd-b615-41a3-b0be-467dd781a4ad',
|
|
56
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
58
|
+
metametrics_id: '561ec651-a844-4b36-a451-04d6eac35740',
|
|
59
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
61
|
+
identifier_id: 'da9a9fc7b09edde9cc23cec9b7e11a71fb0ab4d2ddd8af8af905306f3e1456fb',
|
|
62
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
64
|
+
identifier_type: 'SRP',
|
|
65
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
67
|
+
encrypted_storage_key: 'd2ddd8af8af905306f3e1456fb',
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
exports.MOCK_OIDC_TOKEN_RESPONSE = {
|
|
71
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
73
|
+
access_token: exports.MOCK_ACCESS_JWT,
|
|
74
|
+
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
76
|
+
expires_in: 3600,
|
|
77
|
+
};
|
|
78
|
+
const handleMockNonce = (mockReply) => {
|
|
79
|
+
const reply = mockReply ?? { status: 200, body: MOCK_NONCE_RESPONSE };
|
|
80
|
+
const mockNonceEndpoint = (0, nock_1.default)(MOCK_NONCE_URL)
|
|
81
|
+
.persist()
|
|
82
|
+
.get('')
|
|
83
|
+
.query(true)
|
|
84
|
+
.reply(reply.status, reply.body);
|
|
85
|
+
return mockNonceEndpoint;
|
|
86
|
+
};
|
|
87
|
+
exports.handleMockNonce = handleMockNonce;
|
|
88
|
+
const handleMockSiweLogin = (mockReply) => {
|
|
89
|
+
const reply = mockReply ?? { status: 200, body: MOCK_SIWE_LOGIN_RESPONSE };
|
|
90
|
+
const mockLoginEndpoint = (0, nock_1.default)(MOCK_SIWE_LOGIN_URL)
|
|
91
|
+
.persist()
|
|
92
|
+
.post('')
|
|
93
|
+
.reply(reply.status, reply.body);
|
|
94
|
+
return mockLoginEndpoint;
|
|
95
|
+
};
|
|
96
|
+
exports.handleMockSiweLogin = handleMockSiweLogin;
|
|
97
|
+
const handleMockPairIdentifiers = (mockReply) => {
|
|
98
|
+
const reply = mockReply ?? { status: 204 };
|
|
99
|
+
const mockPairIdentifiersEndpoint = (0, nock_1.default)(MOCK_PAIR_IDENTIFIERS_URL)
|
|
100
|
+
.persist()
|
|
101
|
+
.post('')
|
|
102
|
+
.reply(reply.status, reply.body);
|
|
103
|
+
return mockPairIdentifiersEndpoint;
|
|
104
|
+
};
|
|
105
|
+
exports.handleMockPairIdentifiers = handleMockPairIdentifiers;
|
|
106
|
+
const handleMockSrpLogin = (mockReply) => {
|
|
107
|
+
const reply = mockReply ?? { status: 200, body: exports.MOCK_SRP_LOGIN_RESPONSE };
|
|
108
|
+
const mockLoginEndpoint = (0, nock_1.default)(MOCK_SRP_LOGIN_URL)
|
|
109
|
+
.persist()
|
|
110
|
+
.post('')
|
|
111
|
+
.reply(reply.status, reply.body);
|
|
112
|
+
return mockLoginEndpoint;
|
|
113
|
+
};
|
|
114
|
+
exports.handleMockSrpLogin = handleMockSrpLogin;
|
|
115
|
+
const handleMockOAuth2Token = (mockReply) => {
|
|
116
|
+
const reply = mockReply ?? { status: 200, body: exports.MOCK_OIDC_TOKEN_RESPONSE };
|
|
117
|
+
const mockTokenEndpoint = (0, nock_1.default)(MOCK_OIDC_TOKEN_URL)
|
|
118
|
+
.persist()
|
|
119
|
+
.post('')
|
|
120
|
+
.reply(reply.status, reply.body);
|
|
121
|
+
return mockTokenEndpoint;
|
|
122
|
+
};
|
|
123
|
+
exports.handleMockOAuth2Token = handleMockOAuth2Token;
|
|
124
|
+
const arrangeAuthAPIs = (options) => {
|
|
125
|
+
const mockNonceUrl = (0, exports.handleMockNonce)(options?.mockNonceUrl);
|
|
126
|
+
const mockOAuth2TokenUrl = (0, exports.handleMockOAuth2Token)(options?.mockOAuth2TokenUrl);
|
|
127
|
+
const mockSrpLoginUrl = (0, exports.handleMockSrpLogin)(options?.mockSrpLoginUrl);
|
|
128
|
+
const mockSiweLoginUrl = (0, exports.handleMockSiweLogin)(options?.mockSiweLoginUrl);
|
|
129
|
+
const mockPairIdentifiersUrl = (0, exports.handleMockPairIdentifiers)(options?.mockPairIdentifiers);
|
|
130
|
+
return {
|
|
131
|
+
mockNonceUrl,
|
|
132
|
+
mockOAuth2TokenUrl,
|
|
133
|
+
mockSrpLoginUrl,
|
|
134
|
+
mockSiweLoginUrl,
|
|
135
|
+
mockPairIdentifiersUrl,
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
exports.arrangeAuthAPIs = arrangeAuthAPIs;
|
|
139
|
+
//# sourceMappingURL=mock-auth.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-auth.cjs","sourceRoot":"","sources":["../../../src/sdk/__fixtures__/mock-auth.ts"],"names":[],"mappings":"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","sourcesContent":["import nock from 'nock';\n\nimport {\n NONCE_URL,\n SIWE_LOGIN_URL,\n SRP_LOGIN_URL,\n OIDC_TOKEN_URL,\n PAIR_IDENTIFIERS,\n} from '../authentication-jwt-bearer/services';\nimport { Env } from '../env';\n\ntype MockReply = {\n status: nock.StatusCode;\n body?: nock.Body;\n};\n\nconst MOCK_NONCE_URL = NONCE_URL(Env.DEV);\nconst MOCK_SIWE_LOGIN_URL = SIWE_LOGIN_URL(Env.DEV);\nconst MOCK_PAIR_IDENTIFIERS_URL = PAIR_IDENTIFIERS(Env.DEV);\nconst MOCK_SRP_LOGIN_URL = SRP_LOGIN_URL(Env.DEV);\nconst MOCK_OIDC_TOKEN_URL = OIDC_TOKEN_URL(Env.DEV);\n\nexport const MOCK_JWT =\n 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImIwNzE2N2U2LWJjNWUtNDgyZC1hNjRhLWU1MjQ0MjY2MGU3NyJ9.eyJzdWIiOiI1MzE0ODc5YWM2NDU1OGI3OTQ5ZmI4NWIzMjg2ZjZjNjUwODAzYmFiMTY0Y2QyOWNmMmM3YzdmMjMzMWMwZTRlIiwiaWF0IjoxNzA2MTEzMDYyLCJleHAiOjE3NjkxODUwNjMsImlzcyI6ImF1dGgubWV0YW1hc2suaW8iLCJhdWQiOiJwb3J0Zm9saW8ubWV0YW1hc2suaW8ifQ.E5UL6oABNweS8t5a6IBTqTf7NLOJbrhJSmEcsr7kwLp4bGvcENJzACwnsHDkA6PlzfDV09ZhAGU_F3hlS0j-erbY0k0AFR-GAtyS7E9N02D8RgUDz5oDR65CKmzM8JilgFA8UvruJ6OJGogroaOSOqzRES_s8MjHpP47RJ9lXrUesajsbOudXbuksXWg5QmWip6LLvjwr8UUzcJzNQilyIhiEpo4WdzWM4R3VtTwr4rHnWEvtYnYCov1jmI2w3YQ48y0M-3Y9IOO0ov_vlITRrOnR7Y7fRUGLUFmU5msD8mNWRywjQFLHfJJ1yNP5aJ8TkuCK3sC6kcUH335IVvukQ';\n\nexport const MOCK_ACCESS_JWT =\n 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';\n\nconst MOCK_NONCE_RESPONSE = {\n nonce: 'xGMm9SoihEKeAEfV',\n identifier: '0xd8641601Cb79a94FD872fE42d5b4a067A44a7e88',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n expires_in: 300,\n};\n\nconst MOCK_SIWE_LOGIN_RESPONSE = {\n token: MOCK_JWT,\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n expires_in: 3600,\n profile: {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n profile_id: 'fa2bbf82-bd9a-4e6b-aabc-9ca0d0319b6e',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n metametrics_id: 'de742679-4960-4977-a415-4718b5f8e86c',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n identifier_id:\n 'ec9a4e9906836497efad2fd4d4290b34d2c6a2c0d93eb174aa3cd88a133adbaf',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n identifier_type: 'SIWE',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n encrypted_storage_key: '2c6a2c0d93eb174aa3cd88a133adbaf',\n },\n};\n\nexport const MOCK_SRP_LOGIN_RESPONSE = {\n token: MOCK_JWT,\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n expires_in: 3600,\n profile: {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n profile_id: 'f88227bd-b615-41a3-b0be-467dd781a4ad',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n metametrics_id: '561ec651-a844-4b36-a451-04d6eac35740',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n identifier_id:\n 'da9a9fc7b09edde9cc23cec9b7e11a71fb0ab4d2ddd8af8af905306f3e1456fb',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n identifier_type: 'SRP',\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n encrypted_storage_key: 'd2ddd8af8af905306f3e1456fb',\n },\n};\n\nexport const MOCK_OIDC_TOKEN_RESPONSE = {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n access_token: MOCK_ACCESS_JWT,\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n expires_in: 3600,\n};\n\nexport const handleMockNonce = (mockReply?: MockReply) => {\n const reply = mockReply ?? { status: 200, body: MOCK_NONCE_RESPONSE };\n\n const mockNonceEndpoint = nock(MOCK_NONCE_URL)\n .persist()\n .get('')\n .query(true)\n .reply(reply.status, reply.body);\n\n return mockNonceEndpoint;\n};\n\nexport const handleMockSiweLogin = (mockReply?: MockReply) => {\n const reply = mockReply ?? { status: 200, body: MOCK_SIWE_LOGIN_RESPONSE };\n const mockLoginEndpoint = nock(MOCK_SIWE_LOGIN_URL)\n .persist()\n .post('')\n .reply(reply.status, reply.body);\n\n return mockLoginEndpoint;\n};\n\nexport const handleMockPairIdentifiers = (mockReply?: MockReply) => {\n const reply = mockReply ?? { status: 204 };\n const mockPairIdentifiersEndpoint = nock(MOCK_PAIR_IDENTIFIERS_URL)\n .persist()\n .post('')\n .reply(reply.status, reply.body);\n\n return mockPairIdentifiersEndpoint;\n};\n\nexport const handleMockSrpLogin = (mockReply?: MockReply) => {\n const reply = mockReply ?? { status: 200, body: MOCK_SRP_LOGIN_RESPONSE };\n const mockLoginEndpoint = nock(MOCK_SRP_LOGIN_URL)\n .persist()\n .post('')\n .reply(reply.status, reply.body);\n\n return mockLoginEndpoint;\n};\n\nexport const handleMockOAuth2Token = (mockReply?: MockReply) => {\n const reply = mockReply ?? { status: 200, body: MOCK_OIDC_TOKEN_RESPONSE };\n const mockTokenEndpoint = nock(MOCK_OIDC_TOKEN_URL)\n .persist()\n .post('')\n .reply(reply.status, reply.body);\n\n return mockTokenEndpoint;\n};\n\nexport const arrangeAuthAPIs = (options?: {\n mockNonceUrl?: MockReply;\n mockOAuth2TokenUrl?: MockReply;\n mockSrpLoginUrl?: MockReply;\n mockSiweLoginUrl?: MockReply;\n mockPairIdentifiers?: MockReply;\n}) => {\n const mockNonceUrl = handleMockNonce(options?.mockNonceUrl);\n const mockOAuth2TokenUrl = handleMockOAuth2Token(options?.mockOAuth2TokenUrl);\n const mockSrpLoginUrl = handleMockSrpLogin(options?.mockSrpLoginUrl);\n const mockSiweLoginUrl = handleMockSiweLogin(options?.mockSiweLoginUrl);\n const mockPairIdentifiersUrl = handleMockPairIdentifiers(\n options?.mockPairIdentifiers,\n );\n\n return {\n mockNonceUrl,\n mockOAuth2TokenUrl,\n mockSrpLoginUrl,\n mockSiweLoginUrl,\n mockPairIdentifiersUrl,\n };\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import nock from
|
|
1
|
+
import nock from "nock";
|
|
2
2
|
type MockReply = {
|
|
3
3
|
status: nock.StatusCode;
|
|
4
4
|
body?: nock.Body;
|
|
@@ -39,4 +39,4 @@ export declare const arrangeAuthAPIs: (options?: {
|
|
|
39
39
|
mockPairIdentifiersUrl: nock.Scope;
|
|
40
40
|
};
|
|
41
41
|
export {};
|
|
42
|
-
//# sourceMappingURL=mock-auth.d.
|
|
42
|
+
//# sourceMappingURL=mock-auth.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-auth.d.cts","sourceRoot":"","sources":["../../../src/sdk/__fixtures__/mock-auth.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,aAAa;AAWxB,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC;AAQF,eAAO,MAAM,QAAQ,upBACioB,CAAC;AAEvpB,eAAO,MAAM,eAAe,gKACmI,CAAC;AAmChK,eAAO,MAAM,uBAAuB;;;;;;;;;;CAuBnC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;CAOpC,CAAC;AAEF,eAAO,MAAM,eAAe,eAAgB,SAAS,eAUpD,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAAgB,SAAS,eAQxD,CAAC;AAEF,eAAO,MAAM,yBAAyB,eAAgB,SAAS,eAQ9D,CAAC;AAEF,eAAO,MAAM,kBAAkB,eAAgB,SAAS,eAQvD,CAAC;AAEF,eAAO,MAAM,qBAAqB,eAAgB,SAAS,eAQ1D,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc;IACxC,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,mBAAmB,CAAC,EAAE,SAAS,CAAC;CACjC;;;;;;CAgBA,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import nock from "nock";
|
|
2
|
+
type MockReply = {
|
|
3
|
+
status: nock.StatusCode;
|
|
4
|
+
body?: nock.Body;
|
|
5
|
+
};
|
|
6
|
+
export declare const MOCK_JWT = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImIwNzE2N2U2LWJjNWUtNDgyZC1hNjRhLWU1MjQ0MjY2MGU3NyJ9.eyJzdWIiOiI1MzE0ODc5YWM2NDU1OGI3OTQ5ZmI4NWIzMjg2ZjZjNjUwODAzYmFiMTY0Y2QyOWNmMmM3YzdmMjMzMWMwZTRlIiwiaWF0IjoxNzA2MTEzMDYyLCJleHAiOjE3NjkxODUwNjMsImlzcyI6ImF1dGgubWV0YW1hc2suaW8iLCJhdWQiOiJwb3J0Zm9saW8ubWV0YW1hc2suaW8ifQ.E5UL6oABNweS8t5a6IBTqTf7NLOJbrhJSmEcsr7kwLp4bGvcENJzACwnsHDkA6PlzfDV09ZhAGU_F3hlS0j-erbY0k0AFR-GAtyS7E9N02D8RgUDz5oDR65CKmzM8JilgFA8UvruJ6OJGogroaOSOqzRES_s8MjHpP47RJ9lXrUesajsbOudXbuksXWg5QmWip6LLvjwr8UUzcJzNQilyIhiEpo4WdzWM4R3VtTwr4rHnWEvtYnYCov1jmI2w3YQ48y0M-3Y9IOO0ov_vlITRrOnR7Y7fRUGLUFmU5msD8mNWRywjQFLHfJJ1yNP5aJ8TkuCK3sC6kcUH335IVvukQ";
|
|
7
|
+
export declare const MOCK_ACCESS_JWT = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
|
|
8
|
+
export declare const MOCK_SRP_LOGIN_RESPONSE: {
|
|
9
|
+
token: string;
|
|
10
|
+
expires_in: number;
|
|
11
|
+
profile: {
|
|
12
|
+
profile_id: string;
|
|
13
|
+
metametrics_id: string;
|
|
14
|
+
identifier_id: string;
|
|
15
|
+
identifier_type: string;
|
|
16
|
+
encrypted_storage_key: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const MOCK_OIDC_TOKEN_RESPONSE: {
|
|
20
|
+
access_token: string;
|
|
21
|
+
expires_in: number;
|
|
22
|
+
};
|
|
23
|
+
export declare const handleMockNonce: (mockReply?: MockReply) => nock.Scope;
|
|
24
|
+
export declare const handleMockSiweLogin: (mockReply?: MockReply) => nock.Scope;
|
|
25
|
+
export declare const handleMockPairIdentifiers: (mockReply?: MockReply) => nock.Scope;
|
|
26
|
+
export declare const handleMockSrpLogin: (mockReply?: MockReply) => nock.Scope;
|
|
27
|
+
export declare const handleMockOAuth2Token: (mockReply?: MockReply) => nock.Scope;
|
|
28
|
+
export declare const arrangeAuthAPIs: (options?: {
|
|
29
|
+
mockNonceUrl?: MockReply;
|
|
30
|
+
mockOAuth2TokenUrl?: MockReply;
|
|
31
|
+
mockSrpLoginUrl?: MockReply;
|
|
32
|
+
mockSiweLoginUrl?: MockReply;
|
|
33
|
+
mockPairIdentifiers?: MockReply;
|
|
34
|
+
}) => {
|
|
35
|
+
mockNonceUrl: nock.Scope;
|
|
36
|
+
mockOAuth2TokenUrl: nock.Scope;
|
|
37
|
+
mockSrpLoginUrl: nock.Scope;
|
|
38
|
+
mockSiweLoginUrl: nock.Scope;
|
|
39
|
+
mockPairIdentifiersUrl: nock.Scope;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=mock-auth.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-auth.d.mts","sourceRoot":"","sources":["../../../src/sdk/__fixtures__/mock-auth.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,aAAa;AAWxB,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC;AAQF,eAAO,MAAM,QAAQ,upBACioB,CAAC;AAEvpB,eAAO,MAAM,eAAe,gKACmI,CAAC;AAmChK,eAAO,MAAM,uBAAuB;;;;;;;;;;CAuBnC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;CAOpC,CAAC;AAEF,eAAO,MAAM,eAAe,eAAgB,SAAS,eAUpD,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAAgB,SAAS,eAQxD,CAAC;AAEF,eAAO,MAAM,yBAAyB,eAAgB,SAAS,eAQ9D,CAAC;AAEF,eAAO,MAAM,kBAAkB,eAAgB,SAAS,eAQvD,CAAC;AAEF,eAAO,MAAM,qBAAqB,eAAgB,SAAS,eAQ1D,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc;IACxC,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,mBAAmB,CAAC,EAAE,SAAS,CAAC;CACjC;;;;;;CAgBA,CAAC"}
|