@metamask/profile-sync-controller 26.0.0 → 27.1.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 +34 -1
- package/dist/controllers/authentication/AuthenticationController.cjs.map +1 -1
- package/dist/controllers/authentication/AuthenticationController.d.cts +2 -1
- package/dist/controllers/authentication/AuthenticationController.d.cts.map +1 -1
- package/dist/controllers/authentication/AuthenticationController.d.mts +2 -1
- package/dist/controllers/authentication/AuthenticationController.d.mts.map +1 -1
- package/dist/controllers/authentication/AuthenticationController.mjs.map +1 -1
- package/dist/controllers/user-storage/UserStorageController.cjs.map +1 -1
- package/dist/controllers/user-storage/UserStorageController.d.cts +3 -2
- package/dist/controllers/user-storage/UserStorageController.d.cts.map +1 -1
- package/dist/controllers/user-storage/UserStorageController.d.mts +3 -2
- package/dist/controllers/user-storage/UserStorageController.d.mts.map +1 -1
- package/dist/controllers/user-storage/UserStorageController.mjs.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/controller-integration.cjs +2 -2
- package/dist/controllers/user-storage/contact-syncing/controller-integration.cjs.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/controller-integration.mjs +2 -2
- package/dist/controllers/user-storage/contact-syncing/controller-integration.mjs.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.cjs.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.mjs.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/sync-utils.cjs.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/sync-utils.mjs.map +1 -1
- package/dist/controllers/user-storage/mocks/mockResponses.cjs.map +1 -1
- package/dist/controllers/user-storage/mocks/mockResponses.mjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.cjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/flow-siwe.mjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/flow-srp.cjs +57 -3
- package/dist/sdk/authentication-jwt-bearer/flow-srp.cjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/flow-srp.d.cts +4 -0
- package/dist/sdk/authentication-jwt-bearer/flow-srp.d.cts.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/flow-srp.d.mts +4 -0
- package/dist/sdk/authentication-jwt-bearer/flow-srp.d.mts.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/flow-srp.mjs +35 -4
- package/dist/sdk/authentication-jwt-bearer/flow-srp.mjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/services.cjs +116 -32
- package/dist/sdk/authentication-jwt-bearer/services.cjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/services.d.cts.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/services.d.mts.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/services.mjs +117 -33
- package/dist/sdk/authentication-jwt-bearer/services.mjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/utils/time.cjs +17 -0
- package/dist/sdk/authentication-jwt-bearer/utils/time.cjs.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/utils/time.d.cts +8 -0
- package/dist/sdk/authentication-jwt-bearer/utils/time.d.cts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/utils/time.d.mts +8 -0
- package/dist/sdk/authentication-jwt-bearer/utils/time.d.mts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/utils/time.mjs +13 -0
- package/dist/sdk/authentication-jwt-bearer/utils/time.mjs.map +1 -0
- package/dist/sdk/authentication.cjs.map +1 -1
- package/dist/sdk/authentication.mjs.map +1 -1
- package/dist/sdk/constants.cjs +7 -0
- package/dist/sdk/constants.cjs.map +1 -0
- package/dist/sdk/constants.d.cts +4 -0
- package/dist/sdk/constants.d.cts.map +1 -0
- package/dist/sdk/constants.d.mts +4 -0
- package/dist/sdk/constants.d.mts.map +1 -0
- package/dist/sdk/constants.mjs +4 -0
- package/dist/sdk/constants.mjs.map +1 -0
- package/dist/sdk/errors.cjs +24 -1
- package/dist/sdk/errors.cjs.map +1 -1
- package/dist/sdk/errors.d.cts +12 -0
- package/dist/sdk/errors.d.cts.map +1 -1
- package/dist/sdk/errors.d.mts +12 -0
- package/dist/sdk/errors.d.mts.map +1 -1
- package/dist/sdk/errors.mjs +22 -0
- package/dist/sdk/errors.mjs.map +1 -1
- package/dist/sdk/user-storage.cjs.map +1 -1
- package/dist/sdk/user-storage.mjs.map +1 -1
- package/dist/sdk/utils/eip-6963-metamask-provider.cjs.map +1 -1
- package/dist/sdk/utils/eip-6963-metamask-provider.mjs.map +1 -1
- package/dist/sdk/utils/messaging-signing-snap-requests.cjs.map +1 -1
- package/dist/sdk/utils/messaging-signing-snap-requests.mjs.map +1 -1
- package/dist/sdk/utils/validate-login-response.cjs.map +1 -1
- package/dist/sdk/utils/validate-login-response.mjs.map +1 -1
- package/dist/shared/encryption/cache.cjs.map +1 -1
- package/dist/shared/encryption/cache.mjs.map +1 -1
- package/dist/shared/encryption/encryption.cjs.map +1 -1
- package/dist/shared/encryption/encryption.mjs.map +1 -1
- package/dist/shared/env.cjs.map +1 -1
- package/dist/shared/env.mjs.map +1 -1
- package/dist/shared/storage-schema.cjs.map +1 -1
- package/dist/shared/storage-schema.mjs.map +1 -1
- package/dist/shared/utils/event-queue.cjs.map +1 -1
- package/dist/shared/utils/event-queue.mjs.map +1 -1
- package/package.json +12 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-schema.mjs","sourceRoot":"","sources":["../../src/shared/storage-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,+BAAqB;AAEhD;;;GAGG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,aAAa,EAAE,eAAe;IAC9B,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,aAAa;CAC3B,CAAC;AAcF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,IAA6C,EACZ,EAAE;IACnC,MAAM,SAAS,GAAG,aAAa,CAAC;IAEhC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"storage-schema.mjs","sourceRoot":"","sources":["../../src/shared/storage-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,+BAAqB;AAEhD;;;GAGG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,aAAa,EAAE,eAAe;IAC9B,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,aAAa;CAC3B,CAAC;AAcF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,IAA6C,EACZ,EAAE;IACnC,MAAM,SAAS,GAAG,aAAa,CAAC;IAEhC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEvC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAqC,CAAC;AAC7D,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,IAA6C,EAC7C,UAAkB;IAElB,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,GAAG,UAAU,CAAC,CAAC;IAErD,OAAO,GAAG,OAAO,IAAI,SAAS,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import { createSHA256Hash } from './encryption';\n\n/**\n * The User Storage Endpoint requires a feature name and a namespace key.\n * Any user storage path should be in the form of `feature.key`.\n */\n\n/**\n * Helper object that contains the feature names used in the controllers and SDK.\n * Developers don't need to add new feature names to this object anymore, as the schema enforcement has been deprecated.\n */\nexport const USER_STORAGE_FEATURE_NAMES = {\n notifications: 'notifications',\n accounts: 'accounts_v2',\n addressBook: 'addressBook',\n};\n\nexport type UserStorageGenericFeatureName = string;\nexport type UserStorageGenericFeatureKey = string;\nexport type UserStorageGenericPathWithFeatureAndKey =\n `${UserStorageGenericFeatureName}.${UserStorageGenericFeatureKey}`;\nexport type UserStorageGenericPathWithFeatureOnly =\n UserStorageGenericFeatureName;\n\ntype UserStorageGenericFeatureAndKey = {\n feature: UserStorageGenericFeatureName;\n key: UserStorageGenericFeatureKey;\n};\n\nexport const getFeatureAndKeyFromPath = (\n path: UserStorageGenericPathWithFeatureAndKey,\n): UserStorageGenericFeatureAndKey => {\n const pathRegex = /^\\w+\\.\\w+$/u;\n\n if (!pathRegex.test(path)) {\n throw new Error(\n `user-storage - path is not in the correct format. Correct format: 'feature.key'`,\n );\n }\n\n const [feature, key] = path.split('.');\n\n return { feature, key } as UserStorageGenericFeatureAndKey;\n};\n\n/**\n * Constructs a unique entry path for a user.\n * This can be done due to the uniqueness of the storage key (no users will share the same storage key).\n * The users entry is a unique hash that cannot be reversed.\n *\n * @param path - string in the form of `${feature}.${key}` that matches schema\n * @param storageKey - users storage key\n * @returns path to store entry\n */\nexport function createEntryPath(\n path: UserStorageGenericPathWithFeatureAndKey,\n storageKey: string,\n): string {\n const { feature, key } = getFeatureAndKeyFromPath(path);\n const hashedKey = createSHA256Hash(key + storageKey);\n\n return `${feature}/${hashedKey}`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-queue.cjs","sourceRoot":"","sources":["../../../src/shared/utils/event-queue.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAU;IAAvB;QACE,UAAK,GAA4B,EAAE,CAAC;IAiBtC,CAAC;IAfQ,IAAI,CAAC,QAA6B;QACvC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"event-queue.cjs","sourceRoot":"","sources":["../../../src/shared/utils/event-queue.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAU;IAAvB;QACE,UAAK,GAA4B,EAAE,CAAC;IAiBtC,CAAC;IAfQ,IAAI,CAAC,QAA6B;QACvC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAE5B,IAAI,CAAC;gBACH,MAAM,KAAK,EAAE,CAAC;YAChB,CAAC;oBAAS,CAAC;gBACT,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAlBD,gCAkBC","sourcesContent":["export class EventQueue {\n queue: (() => Promise<void>)[] = [];\n\n public push(callback: () => Promise<void>) {\n this.queue.push(callback);\n }\n\n public async run() {\n while (this.queue.length > 0) {\n const event = this.queue[0];\n\n try {\n await event();\n } finally {\n this.queue = this.queue.filter((e) => e !== event);\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-queue.mjs","sourceRoot":"","sources":["../../../src/shared/utils/event-queue.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,UAAU;IAAvB;QACE,UAAK,GAA4B,EAAE,CAAC;IAiBtC,CAAC;IAfQ,IAAI,CAAC,QAA6B;QACvC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"event-queue.mjs","sourceRoot":"","sources":["../../../src/shared/utils/event-queue.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,UAAU;IAAvB;QACE,UAAK,GAA4B,EAAE,CAAC;IAiBtC,CAAC;IAfQ,IAAI,CAAC,QAA6B;QACvC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAE5B,IAAI,CAAC;gBACH,MAAM,KAAK,EAAE,CAAC;YAChB,CAAC;oBAAS,CAAC;gBACT,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["export class EventQueue {\n queue: (() => Promise<void>)[] = [];\n\n public push(callback: () => Promise<void>) {\n this.queue.push(callback);\n }\n\n public async run() {\n while (this.queue.length > 0) {\n const event = this.queue[0];\n\n try {\n await event();\n } finally {\n this.queue = this.queue.filter((e) => e !== event);\n }\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/profile-sync-controller",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.1.0",
|
|
4
4
|
"description": "The profile sync helps developers synchronize data across multiple clients and devices in a privacy-preserving way. All data saved in the user storage database is encrypted client-side to preserve privacy. The user storage provides a modular design, giving developers the flexibility to construct and manage their storage spaces in a way that best suits their needs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
],
|
|
90
90
|
"scripts": {
|
|
91
91
|
"build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
|
|
92
|
+
"build:all": "ts-bridge --project tsconfig.build.json --verbose --clean",
|
|
92
93
|
"build:docs": "typedoc",
|
|
93
94
|
"changelog:update": "../../scripts/update-changelog.sh @metamask/profile-sync-controller",
|
|
94
95
|
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/profile-sync-controller",
|
|
@@ -100,11 +101,14 @@
|
|
|
100
101
|
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
|
101
102
|
},
|
|
102
103
|
"dependencies": {
|
|
104
|
+
"@metamask/address-book-controller": "^7.0.1",
|
|
103
105
|
"@metamask/base-controller": "^9.0.0",
|
|
106
|
+
"@metamask/keyring-controller": "^25.1.0",
|
|
104
107
|
"@metamask/messenger": "^0.3.0",
|
|
105
|
-
"@metamask/snaps-
|
|
106
|
-
"@metamask/snaps-
|
|
107
|
-
"@metamask/utils": "^11.
|
|
108
|
+
"@metamask/snaps-controllers": "^17.2.0",
|
|
109
|
+
"@metamask/snaps-sdk": "^10.3.0",
|
|
110
|
+
"@metamask/snaps-utils": "^11.7.0",
|
|
111
|
+
"@metamask/utils": "^11.9.0",
|
|
108
112
|
"@noble/ciphers": "^1.3.0",
|
|
109
113
|
"@noble/hashes": "^1.8.0",
|
|
110
114
|
"immer": "^9.0.6",
|
|
@@ -114,30 +118,25 @@
|
|
|
114
118
|
"devDependencies": {
|
|
115
119
|
"@lavamoat/allow-scripts": "^3.0.4",
|
|
116
120
|
"@lavamoat/preinstall-always-fail": "^2.1.0",
|
|
117
|
-
"@metamask/address-book-controller": "^7.0.0",
|
|
118
121
|
"@metamask/auto-changelog": "^3.4.4",
|
|
119
122
|
"@metamask/keyring-api": "^21.0.0",
|
|
120
|
-
"@metamask/keyring-controller": "^24.0.0",
|
|
121
123
|
"@metamask/keyring-internal-api": "^9.0.0",
|
|
122
124
|
"@metamask/providers": "^22.1.0",
|
|
123
|
-
"@
|
|
124
|
-
"@types/jest": "^27.
|
|
125
|
+
"@ts-bridge/cli": "^0.6.4",
|
|
126
|
+
"@types/jest": "^27.5.2",
|
|
125
127
|
"deepmerge": "^4.2.2",
|
|
126
128
|
"ethers": "^6.12.0",
|
|
127
129
|
"jest": "^27.5.1",
|
|
128
130
|
"jest-environment-jsdom": "^27.5.1",
|
|
129
131
|
"nock": "^13.3.1",
|
|
130
|
-
"ts-jest": "^27.1.
|
|
132
|
+
"ts-jest": "^27.1.5",
|
|
131
133
|
"typedoc": "^0.24.8",
|
|
132
134
|
"typedoc-plugin-missing-exports": "^2.0.0",
|
|
133
|
-
"typescript": "~5.
|
|
135
|
+
"typescript": "~5.3.3",
|
|
134
136
|
"webextension-polyfill": "^0.12.0"
|
|
135
137
|
},
|
|
136
138
|
"peerDependencies": {
|
|
137
|
-
"@metamask/address-book-controller": "^7.0.0",
|
|
138
|
-
"@metamask/keyring-controller": "^24.0.0",
|
|
139
139
|
"@metamask/providers": "^22.0.0",
|
|
140
|
-
"@metamask/snaps-controllers": "^14.0.0",
|
|
141
140
|
"webextension-polyfill": "^0.10.0 || ^0.11.0 || ^0.12.0"
|
|
142
141
|
},
|
|
143
142
|
"engines": {
|