@metamask-previews/profile-sync-controller 28.0.2-preview-45a82ea8e → 28.0.2-preview-d8ff44d
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 +17 -2
- package/dist/controllers/authentication/AuthenticationController-method-action-types.cjs.map +1 -1
- package/dist/controllers/authentication/AuthenticationController-method-action-types.d.cts +36 -6
- package/dist/controllers/authentication/AuthenticationController-method-action-types.d.cts.map +1 -1
- package/dist/controllers/authentication/AuthenticationController-method-action-types.d.mts +36 -6
- package/dist/controllers/authentication/AuthenticationController-method-action-types.d.mts.map +1 -1
- package/dist/controllers/authentication/AuthenticationController-method-action-types.mjs.map +1 -1
- package/dist/controllers/authentication/AuthenticationController.cjs +111 -6
- package/dist/controllers/authentication/AuthenticationController.cjs.map +1 -1
- package/dist/controllers/authentication/AuthenticationController.d.cts +43 -7
- package/dist/controllers/authentication/AuthenticationController.d.cts.map +1 -1
- package/dist/controllers/authentication/AuthenticationController.d.mts +43 -7
- package/dist/controllers/authentication/AuthenticationController.d.mts.map +1 -1
- package/dist/controllers/authentication/AuthenticationController.mjs +111 -6
- package/dist/controllers/authentication/AuthenticationController.mjs.map +1 -1
- package/dist/controllers/authentication/index.cjs.map +1 -1
- package/dist/controllers/authentication/index.d.cts +1 -1
- package/dist/controllers/authentication/index.d.cts.map +1 -1
- package/dist/controllers/authentication/index.d.mts +1 -1
- package/dist/controllers/authentication/index.d.mts.map +1 -1
- package/dist/controllers/authentication/index.mjs.map +1 -1
- package/dist/controllers/authentication/mocks/mockResponses.cjs +10 -1
- package/dist/controllers/authentication/mocks/mockResponses.cjs.map +1 -1
- package/dist/controllers/authentication/mocks/mockResponses.d.cts +17 -32
- package/dist/controllers/authentication/mocks/mockResponses.d.cts.map +1 -1
- package/dist/controllers/authentication/mocks/mockResponses.d.mts +17 -32
- package/dist/controllers/authentication/mocks/mockResponses.d.mts.map +1 -1
- package/dist/controllers/authentication/mocks/mockResponses.mjs +9 -1
- package/dist/controllers/authentication/mocks/mockResponses.mjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/flow-srp.cjs +28 -1
- package/dist/sdk/authentication-jwt-bearer/flow-srp.cjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/flow-srp.d.cts +2 -0
- package/dist/sdk/authentication-jwt-bearer/flow-srp.d.cts.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/flow-srp.d.mts +2 -0
- package/dist/sdk/authentication-jwt-bearer/flow-srp.d.mts.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/flow-srp.mjs +29 -2
- package/dist/sdk/authentication-jwt-bearer/flow-srp.mjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/services.cjs +59 -1
- package/dist/sdk/authentication-jwt-bearer/services.cjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/services.d.cts +17 -1
- package/dist/sdk/authentication-jwt-bearer/services.d.cts.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/services.d.mts +17 -1
- package/dist/sdk/authentication-jwt-bearer/services.d.mts.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/services.mjs +56 -0
- package/dist/sdk/authentication-jwt-bearer/services.mjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/types.cjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/types.d.cts +20 -1
- package/dist/sdk/authentication-jwt-bearer/types.d.cts.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/types.d.mts +20 -1
- package/dist/sdk/authentication-jwt-bearer/types.d.mts.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/types.mjs.map +1 -1
- package/dist/sdk/authentication-jwt-bearer/utils/identifier.cjs +27 -0
- package/dist/sdk/authentication-jwt-bearer/utils/identifier.cjs.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.cts +13 -0
- package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.cts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.mts +13 -0
- package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.mts.map +1 -0
- package/dist/sdk/authentication-jwt-bearer/utils/identifier.mjs +23 -0
- package/dist/sdk/authentication-jwt-bearer/utils/identifier.mjs.map +1 -0
- package/dist/sdk/authentication.cjs +4 -0
- package/dist/sdk/authentication.cjs.map +1 -1
- package/dist/sdk/authentication.d.cts +2 -0
- package/dist/sdk/authentication.d.cts.map +1 -1
- package/dist/sdk/authentication.d.mts +2 -0
- package/dist/sdk/authentication.d.mts.map +1 -1
- package/dist/sdk/authentication.mjs +4 -0
- package/dist/sdk/authentication.mjs.map +1 -1
- package/dist/sdk/mocks/auth.cjs +11 -1
- package/dist/sdk/mocks/auth.cjs.map +1 -1
- package/dist/sdk/mocks/auth.d.cts +10 -0
- package/dist/sdk/mocks/auth.d.cts.map +1 -1
- package/dist/sdk/mocks/auth.d.mts +10 -0
- package/dist/sdk/mocks/auth.d.mts.map +1 -1
- package/dist/sdk/mocks/auth.mjs +11 -1
- package/dist/sdk/mocks/auth.mjs.map +1 -1
- package/dist/sdk/user-storage.cjs +26 -3
- package/dist/sdk/user-storage.cjs.map +1 -1
- package/dist/sdk/user-storage.d.cts +7 -0
- package/dist/sdk/user-storage.d.cts.map +1 -1
- package/dist/sdk/user-storage.d.mts +7 -0
- package/dist/sdk/user-storage.d.mts.map +1 -1
- package/dist/sdk/user-storage.mjs +26 -3
- package/dist/sdk/user-storage.mjs.map +1 -1
- package/dist/sdk/utils/validate-pair-response.cjs +29 -0
- package/dist/sdk/utils/validate-pair-response.cjs.map +1 -0
- package/dist/sdk/utils/validate-pair-response.d.cts +26 -0
- package/dist/sdk/utils/validate-pair-response.d.cts.map +1 -0
- package/dist/sdk/utils/validate-pair-response.d.mts +26 -0
- package/dist/sdk/utils/validate-pair-response.d.mts.map +1 -0
- package/dist/sdk/utils/validate-pair-response.mjs +25 -0
- package/dist/sdk/utils/validate-pair-response.mjs.map +1 -0
- package/dist/shared/types/services.cjs.map +1 -1
- package/dist/shared/types/services.d.cts +7 -0
- package/dist/shared/types/services.d.cts.map +1 -1
- package/dist/shared/types/services.d.mts +7 -0
- package/dist/shared/types/services.d.mts.map +1 -1
- package/dist/shared/types/services.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-pair-response.mjs","sourceRoot":"","sources":["../../../src/sdk/utils/validate-pair-response.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAiBzD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAc;IAEd,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,OAAO,GAAG,KAAgC,CAAC;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,OAA8C,CAAC;IACvE,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CACb,2DAA2D,CAC5D,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,OAAO,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAClE,MAAM,IAAI,KAAK,CACb,8DAA8D,CAC/D,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,OAAO,CAAC,aAAa,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QACxE,MAAM,IAAI,KAAK,CACb,iEAAiE,CAClE,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\n\ntype RawProfileAlias = {\n alias_profile_id: string;\n canonical_profile_id: string;\n identifier_ids: { id: string; type: string }[];\n};\n\nexport type RawPairResponse = {\n profile: {\n profile_id: string;\n identifier_id: string;\n metametrics_id?: string;\n };\n profile_aliases?: RawProfileAlias[];\n};\n\n/**\n * Asserts that the raw API response from the profile pairing endpoint has the\n * expected shape before we attempt to map it into a `PairProfilesResponse`.\n * Throws if the response is malformed.\n *\n * @param input - The raw JSON parsed from the pair endpoint response body.\n */\nexport function validatePairResponse(\n input: unknown,\n): asserts input is RawPairResponse {\n if (!input || typeof input !== 'object') {\n throw new Error('validatePairResponse: input is not an object');\n }\n\n const assumed = input as Record<string, unknown>;\n const profile = assumed.profile as Record<string, unknown> | undefined;\n if (!profile || typeof profile !== 'object') {\n throw new Error(\n 'validatePairResponse: profile is missing or not an object',\n );\n }\n\n if (typeof profile.profile_id !== 'string' || !profile.profile_id) {\n throw new Error(\n 'validatePairResponse: profile.profile_id is missing or empty',\n );\n }\n\n if (typeof profile.identifier_id !== 'string' || !profile.identifier_id) {\n throw new Error(\n 'validatePairResponse: profile.identifier_id is missing or empty',\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.cjs","sourceRoot":"","sources":["../../../src/shared/types/services.ts"],"names":[],"mappings":"","sourcesContent":["import type { Platform } from '../env';\n\nexport type ClientMetaMetrics = {\n metametricsId: string;\n agent: Platform.EXTENSION | Platform.MOBILE;\n};\n\nexport type MetaMetricsAuth = {\n getMetaMetricsId: () =>\n | ClientMetaMetrics['metametricsId']\n | Promise<ClientMetaMetrics['metametricsId']>;\n agent: ClientMetaMetrics['agent'];\n};\n"]}
|
|
1
|
+
{"version":3,"file":"services.cjs","sourceRoot":"","sources":["../../../src/shared/types/services.ts"],"names":[],"mappings":"","sourcesContent":["import type { Platform } from '../env';\n\nexport type ClientMetaMetrics = {\n metametricsId: string;\n agent: Platform.EXTENSION | Platform.MOBILE;\n appVersion: string;\n};\n\nexport type MetaMetricsAuth = {\n getMetaMetricsId: () =>\n | ClientMetaMetrics['metametricsId']\n | Promise<ClientMetaMetrics['metametricsId']>;\n agent: ClientMetaMetrics['agent'];\n /**\n * Optional callback returning the current client app version (e.g. extension\n * or mobile build version). Forwarded as `metametrics.app_version` in the\n * `POST /api/v2/srp/login` payload.\n */\n getAppVersion?: () =>\n | ClientMetaMetrics['appVersion']\n | undefined\n | Promise<ClientMetaMetrics['appVersion'] | undefined>;\n};\n"]}
|
|
@@ -2,9 +2,16 @@ import type { Platform } from "../env.cjs";
|
|
|
2
2
|
export type ClientMetaMetrics = {
|
|
3
3
|
metametricsId: string;
|
|
4
4
|
agent: Platform.EXTENSION | Platform.MOBILE;
|
|
5
|
+
appVersion: string;
|
|
5
6
|
};
|
|
6
7
|
export type MetaMetricsAuth = {
|
|
7
8
|
getMetaMetricsId: () => ClientMetaMetrics['metametricsId'] | Promise<ClientMetaMetrics['metametricsId']>;
|
|
8
9
|
agent: ClientMetaMetrics['agent'];
|
|
10
|
+
/**
|
|
11
|
+
* Optional callback returning the current client app version (e.g. extension
|
|
12
|
+
* or mobile build version). Forwarded as `metametrics.app_version` in the
|
|
13
|
+
* `POST /api/v2/srp/login` payload.
|
|
14
|
+
*/
|
|
15
|
+
getAppVersion?: () => ClientMetaMetrics['appVersion'] | undefined | Promise<ClientMetaMetrics['appVersion'] | undefined>;
|
|
9
16
|
};
|
|
10
17
|
//# sourceMappingURL=services.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.cts","sourceRoot":"","sources":["../../../src/shared/types/services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAe;AAEvC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"services.d.cts","sourceRoot":"","sources":["../../../src/shared/types/services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAe;AAEvC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,gBAAgB,EAAE,MACd,iBAAiB,CAAC,eAAe,CAAC,GAClC,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC,CAAC;IAChD,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAClC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MACZ,iBAAiB,CAAC,YAAY,CAAC,GAC/B,SAAS,GACT,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,CAAC;CAC1D,CAAC"}
|
|
@@ -2,9 +2,16 @@ import type { Platform } from "../env.mjs";
|
|
|
2
2
|
export type ClientMetaMetrics = {
|
|
3
3
|
metametricsId: string;
|
|
4
4
|
agent: Platform.EXTENSION | Platform.MOBILE;
|
|
5
|
+
appVersion: string;
|
|
5
6
|
};
|
|
6
7
|
export type MetaMetricsAuth = {
|
|
7
8
|
getMetaMetricsId: () => ClientMetaMetrics['metametricsId'] | Promise<ClientMetaMetrics['metametricsId']>;
|
|
8
9
|
agent: ClientMetaMetrics['agent'];
|
|
10
|
+
/**
|
|
11
|
+
* Optional callback returning the current client app version (e.g. extension
|
|
12
|
+
* or mobile build version). Forwarded as `metametrics.app_version` in the
|
|
13
|
+
* `POST /api/v2/srp/login` payload.
|
|
14
|
+
*/
|
|
15
|
+
getAppVersion?: () => ClientMetaMetrics['appVersion'] | undefined | Promise<ClientMetaMetrics['appVersion'] | undefined>;
|
|
9
16
|
};
|
|
10
17
|
//# sourceMappingURL=services.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.mts","sourceRoot":"","sources":["../../../src/shared/types/services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAe;AAEvC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"services.d.mts","sourceRoot":"","sources":["../../../src/shared/types/services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAe;AAEvC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,gBAAgB,EAAE,MACd,iBAAiB,CAAC,eAAe,CAAC,GAClC,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC,CAAC;IAChD,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAClC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MACZ,iBAAiB,CAAC,YAAY,CAAC,GAC/B,SAAS,GACT,OAAO,CAAC,iBAAiB,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,CAAC;CAC1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.mjs","sourceRoot":"","sources":["../../../src/shared/types/services.ts"],"names":[],"mappings":"","sourcesContent":["import type { Platform } from '../env';\n\nexport type ClientMetaMetrics = {\n metametricsId: string;\n agent: Platform.EXTENSION | Platform.MOBILE;\n};\n\nexport type MetaMetricsAuth = {\n getMetaMetricsId: () =>\n | ClientMetaMetrics['metametricsId']\n | Promise<ClientMetaMetrics['metametricsId']>;\n agent: ClientMetaMetrics['agent'];\n};\n"]}
|
|
1
|
+
{"version":3,"file":"services.mjs","sourceRoot":"","sources":["../../../src/shared/types/services.ts"],"names":[],"mappings":"","sourcesContent":["import type { Platform } from '../env';\n\nexport type ClientMetaMetrics = {\n metametricsId: string;\n agent: Platform.EXTENSION | Platform.MOBILE;\n appVersion: string;\n};\n\nexport type MetaMetricsAuth = {\n getMetaMetricsId: () =>\n | ClientMetaMetrics['metametricsId']\n | Promise<ClientMetaMetrics['metametricsId']>;\n agent: ClientMetaMetrics['agent'];\n /**\n * Optional callback returning the current client app version (e.g. extension\n * or mobile build version). Forwarded as `metametrics.app_version` in the\n * `POST /api/v2/srp/login` payload.\n */\n getAppVersion?: () =>\n | ClientMetaMetrics['appVersion']\n | undefined\n | Promise<ClientMetaMetrics['appVersion'] | undefined>;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/profile-sync-controller",
|
|
3
|
-
"version": "28.0.2-preview-
|
|
3
|
+
"version": "28.0.2-preview-d8ff44d",
|
|
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
|
"Ethereum",
|
|
@@ -108,8 +108,8 @@
|
|
|
108
108
|
"dependencies": {
|
|
109
109
|
"@metamask/address-book-controller": "^7.1.1",
|
|
110
110
|
"@metamask/base-controller": "^9.1.0",
|
|
111
|
-
"@metamask/keyring-controller": "^25.
|
|
112
|
-
"@metamask/messenger": "^1.
|
|
111
|
+
"@metamask/keyring-controller": "^25.3.0",
|
|
112
|
+
"@metamask/messenger": "^1.2.0",
|
|
113
113
|
"@metamask/snaps-controllers": "^19.0.0",
|
|
114
114
|
"@metamask/snaps-sdk": "^11.0.0",
|
|
115
115
|
"@metamask/snaps-utils": "^12.1.2",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"@lavamoat/preinstall-always-fail": "^2.1.0",
|
|
126
126
|
"@metamask/auto-changelog": "^6.1.0",
|
|
127
127
|
"@metamask/keyring-api": "^23.0.1",
|
|
128
|
-
"@metamask/keyring-internal-api": "^
|
|
128
|
+
"@metamask/keyring-internal-api": "^11.0.0",
|
|
129
129
|
"@metamask/providers": "^22.1.0",
|
|
130
130
|
"@ts-bridge/cli": "^0.6.4",
|
|
131
131
|
"@types/jest": "^29.5.14",
|