@metamask/profile-sync-controller 32.2.0 → 32.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/README.md +5 -1
  3. package/dist/controllers/authentication/AuthenticationController.d.ts.map +1 -1
  4. package/dist/controllers/authentication/AuthenticationController.js +34 -3
  5. package/dist/controllers/authentication/AuthenticationController.js.map +1 -1
  6. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.ts +5 -2
  7. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.ts.map +1 -1
  8. package/dist/sdk/authentication-jwt-bearer/flow-srp.js +4 -2
  9. package/dist/sdk/authentication-jwt-bearer/flow-srp.js.map +1 -1
  10. package/dist/sdk/authentication-jwt-bearer/mfa/schemas.d.ts +2 -0
  11. package/dist/sdk/authentication-jwt-bearer/mfa/schemas.d.ts.map +1 -1
  12. package/dist/sdk/authentication-jwt-bearer/mfa/schemas.js +1 -0
  13. package/dist/sdk/authentication-jwt-bearer/mfa/schemas.js.map +1 -1
  14. package/dist/sdk/authentication-jwt-bearer/mfa/services.d.ts.map +1 -1
  15. package/dist/sdk/authentication-jwt-bearer/mfa/services.js +16 -11
  16. package/dist/sdk/authentication-jwt-bearer/mfa/services.js.map +1 -1
  17. package/dist/sdk/authentication-jwt-bearer/mfa/types.d.ts +1 -1
  18. package/dist/sdk/authentication-jwt-bearer/mfa/types.d.ts.map +1 -1
  19. package/dist/sdk/authentication-jwt-bearer/mfa/types.js.map +1 -1
  20. package/dist/sdk/authentication-jwt-bearer/services.d.ts +4 -5
  21. package/dist/sdk/authentication-jwt-bearer/services.d.ts.map +1 -1
  22. package/dist/sdk/authentication-jwt-bearer/services.js +7 -4
  23. package/dist/sdk/authentication-jwt-bearer/services.js.map +1 -1
  24. package/dist/sdk/authentication-jwt-bearer/types.d.ts +9 -0
  25. package/dist/sdk/authentication-jwt-bearer/types.d.ts.map +1 -1
  26. package/dist/sdk/authentication-jwt-bearer/types.js.map +1 -1
  27. package/dist/sdk/authentication.d.ts +3 -2
  28. package/dist/sdk/authentication.d.ts.map +1 -1
  29. package/dist/sdk/authentication.js +1 -1
  30. package/dist/sdk/authentication.js.map +1 -1
  31. package/dist/sdk/constants.d.ts +1 -0
  32. package/dist/sdk/constants.d.ts.map +1 -1
  33. package/dist/sdk/constants.js +1 -0
  34. package/dist/sdk/constants.js.map +1 -1
  35. package/dist/sdk/errors.d.ts +16 -1
  36. package/dist/sdk/errors.d.ts.map +1 -1
  37. package/dist/sdk/errors.js +18 -0
  38. package/dist/sdk/errors.js.map +1 -1
  39. package/dist/sdk/utils/validate-pair-response.d.ts +4 -0
  40. package/dist/sdk/utils/validate-pair-response.d.ts.map +1 -1
  41. package/dist/sdk/utils/validate-pair-response.js.map +1 -1
  42. package/package.json +10 -10
@@ -11,6 +11,10 @@ export type RawPairResponse = {
11
11
  profile_id: string;
12
12
  identifier_id: string;
13
13
  metametrics_id?: string;
14
+ paired_identifier_ids?: {
15
+ id: string;
16
+ type: string;
17
+ }[];
14
18
  };
15
19
  profile_aliases?: RawProfileAlias[];
16
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"validate-pair-response.d.ts","sourceRoot":"","sources":["../../../src/sdk/utils/validate-pair-response.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;CACrC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,KAAK,IAAI,eAAe,CAwBlC"}
1
+ {"version":3,"file":"validate-pair-response.d.ts","sourceRoot":"","sources":["../../../src/sdk/utils/validate-pair-response.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,qBAAqB,CAAC,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KACxD,CAAC;IACF,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;CACrC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,KAAK,IAAI,eAAe,CAwBlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"validate-pair-response.js","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
+ {"version":3,"file":"validate-pair-response.js","sourceRoot":"","sources":["../../../src/sdk/utils/validate-pair-response.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAkBzD;;;;;;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 paired_identifier_ids?: { id: string; type: 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/profile-sync-controller",
3
- "version": "32.2.0",
3
+ "version": "32.3.1",
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",
@@ -77,7 +77,7 @@
77
77
  "@metamask/base-controller": "^10.0.0",
78
78
  "@metamask/controller-utils": "^13.0.0",
79
79
  "@metamask/key-tree": "^10.1.1",
80
- "@metamask/keyring-controller": "^28.0.0",
80
+ "@metamask/keyring-controller": "^28.1.0",
81
81
  "@metamask/messenger": "^3.0.0",
82
82
  "@metamask/seedless-onboarding-controller": "^11.0.0",
83
83
  "@metamask/superstruct": "^3.4.1",
@@ -86,13 +86,13 @@
86
86
  "@noble/curves": "^1.9.2",
87
87
  "@noble/hashes": "^1.8.0",
88
88
  "@signinwithethereum/siwe": "^4.2.1",
89
- "immer": "^9.0.6",
89
+ "immer": "^9.0.21",
90
90
  "loglevel": "^1.8.1"
91
91
  },
92
92
  "devDependencies": {
93
- "@lavamoat/allow-scripts": "^3.0.4",
93
+ "@lavamoat/allow-scripts": "^3.4.3",
94
94
  "@lavamoat/preinstall-always-fail": "^2.1.0",
95
- "@metamask/auto-changelog": "^6.1.0",
95
+ "@metamask/auto-changelog": "^6.2.1",
96
96
  "@metamask/eth-hd-keyring": "^15.0.0",
97
97
  "@metamask/keyring-api": "^24.0.0",
98
98
  "@metamask/keyring-internal-api": "^12.0.0",
@@ -101,13 +101,13 @@
101
101
  "@types/jest": "^30.0.0",
102
102
  "@typescript/native": "npm:typescript@^7.0.2",
103
103
  "deepmerge": "^4.2.2",
104
- "ethers": "^6.12.0",
104
+ "ethers": "^6.17.0",
105
105
  "jest": "^30.4.2",
106
106
  "jest-environment-jsdom": "^30.4.1",
107
- "nock": "^13.3.1",
108
- "rimraf": "^5.0.5",
109
- "ts-jest": "^29.4.11",
110
- "tsx": "^4.20.5",
107
+ "nock": "^13.5.6",
108
+ "rimraf": "^6.1.3",
109
+ "ts-jest": "^29.4.12",
110
+ "tsx": "^4.23.13",
111
111
  "typedoc": "^0.25.13",
112
112
  "typedoc-plugin-missing-exports": "^2.0.0",
113
113
  "typescript": "npm:@typescript/typescript6@^6.0.2",