@metamask-previews/profile-sync-controller 20.0.0-preview-988fbb56 → 20.0.0-preview-afb9460
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 +2 -2
- package/dist/controllers/user-storage/UserStorageController.cjs +4 -16
- package/dist/controllers/user-storage/UserStorageController.cjs.map +1 -1
- package/dist/controllers/user-storage/UserStorageController.d.cts +10 -13
- package/dist/controllers/user-storage/UserStorageController.d.cts.map +1 -1
- package/dist/controllers/user-storage/UserStorageController.d.mts +10 -13
- package/dist/controllers/user-storage/UserStorageController.d.mts.map +1 -1
- package/dist/controllers/user-storage/UserStorageController.mjs +4 -16
- package/dist/controllers/user-storage/UserStorageController.mjs.map +1 -1
- package/dist/controllers/user-storage/account-syncing/controller-integration.cjs +166 -185
- package/dist/controllers/user-storage/account-syncing/controller-integration.cjs.map +1 -1
- package/dist/controllers/user-storage/account-syncing/controller-integration.d.cts +0 -3
- package/dist/controllers/user-storage/account-syncing/controller-integration.d.cts.map +1 -1
- package/dist/controllers/user-storage/account-syncing/controller-integration.d.mts +0 -3
- package/dist/controllers/user-storage/account-syncing/controller-integration.d.mts.map +1 -1
- package/dist/controllers/user-storage/account-syncing/controller-integration.mjs +166 -185
- package/dist/controllers/user-storage/account-syncing/controller-integration.mjs.map +1 -1
- package/dist/controllers/user-storage/account-syncing/types.cjs.map +1 -1
- package/dist/controllers/user-storage/account-syncing/types.d.cts +0 -2
- package/dist/controllers/user-storage/account-syncing/types.d.cts.map +1 -1
- package/dist/controllers/user-storage/account-syncing/types.d.mts +0 -2
- package/dist/controllers/user-storage/account-syncing/types.d.mts.map +1 -1
- package/dist/controllers/user-storage/account-syncing/types.mjs.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/controller-integration.cjs +162 -224
- package/dist/controllers/user-storage/contact-syncing/controller-integration.cjs.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/controller-integration.d.cts +0 -3
- package/dist/controllers/user-storage/contact-syncing/controller-integration.d.cts.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/controller-integration.d.mts +0 -3
- package/dist/controllers/user-storage/contact-syncing/controller-integration.d.mts.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/controller-integration.mjs +162 -224
- package/dist/controllers/user-storage/contact-syncing/controller-integration.mjs.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/types.cjs.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/types.d.cts +0 -2
- package/dist/controllers/user-storage/contact-syncing/types.d.cts.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/types.d.mts +0 -2
- package/dist/controllers/user-storage/contact-syncing/types.d.mts.map +1 -1
- package/dist/controllers/user-storage/contact-syncing/types.mjs.map +1 -1
- package/dist/controllers/user-storage/index.cjs +1 -1
- package/dist/controllers/user-storage/index.cjs.map +1 -1
- package/dist/controllers/user-storage/index.d.cts +1 -1
- package/dist/controllers/user-storage/index.d.cts.map +1 -1
- package/dist/controllers/user-storage/index.d.mts +1 -1
- package/dist/controllers/user-storage/index.d.mts.map +1 -1
- package/dist/controllers/user-storage/index.mjs +1 -1
- package/dist/controllers/user-storage/index.mjs.map +1 -1
- package/dist/controllers/user-storage/mocks/mockResponses.cjs +1 -1
- package/dist/controllers/user-storage/mocks/mockResponses.cjs.map +1 -1
- package/dist/controllers/user-storage/mocks/mockResponses.d.cts +9 -9
- package/dist/controllers/user-storage/mocks/mockResponses.d.cts.map +1 -1
- package/dist/controllers/user-storage/mocks/mockResponses.d.mts +9 -9
- package/dist/controllers/user-storage/mocks/mockResponses.d.mts.map +1 -1
- package/dist/controllers/user-storage/mocks/mockResponses.mjs +1 -1
- package/dist/controllers/user-storage/mocks/mockResponses.mjs.map +1 -1
- package/dist/controllers/user-storage/types.cjs.map +1 -1
- package/dist/controllers/user-storage/types.d.cts +3 -3
- package/dist/controllers/user-storage/types.d.cts.map +1 -1
- package/dist/controllers/user-storage/types.d.mts +3 -3
- package/dist/controllers/user-storage/types.d.mts.map +1 -1
- package/dist/controllers/user-storage/types.mjs.map +1 -1
- package/dist/sdk/user-storage.cjs +3 -9
- package/dist/sdk/user-storage.cjs.map +1 -1
- package/dist/sdk/user-storage.d.cts +0 -1
- package/dist/sdk/user-storage.d.cts.map +1 -1
- package/dist/sdk/user-storage.d.mts +0 -1
- package/dist/sdk/user-storage.d.mts.map +1 -1
- package/dist/sdk/user-storage.mjs +3 -9
- package/dist/sdk/user-storage.mjs.map +1 -1
- package/dist/shared/storage-schema.cjs +9 -31
- package/dist/shared/storage-schema.cjs.map +1 -1
- package/dist/shared/storage-schema.d.cts +11 -42
- package/dist/shared/storage-schema.d.cts.map +1 -1
- package/dist/shared/storage-schema.d.mts +11 -42
- package/dist/shared/storage-schema.d.mts.map +1 -1
- package/dist/shared/storage-schema.mjs +8 -30
- package/dist/shared/storage-schema.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/controllers/user-storage/constants/index.cjs +0 -18
- package/dist/controllers/user-storage/constants/index.cjs.map +0 -1
- package/dist/controllers/user-storage/constants/index.d.cts +0 -2
- package/dist/controllers/user-storage/constants/index.d.cts.map +0 -1
- package/dist/controllers/user-storage/constants/index.d.mts +0 -2
- package/dist/controllers/user-storage/constants/index.d.mts.map +0 -1
- package/dist/controllers/user-storage/constants/index.mjs +0 -2
- package/dist/controllers/user-storage/constants/index.mjs.map +0 -1
- package/dist/controllers/user-storage/constants/traces.cjs +0 -17
- package/dist/controllers/user-storage/constants/traces.cjs.map +0 -1
- package/dist/controllers/user-storage/constants/traces.d.cts +0 -12
- package/dist/controllers/user-storage/constants/traces.d.cts.map +0 -1
- package/dist/controllers/user-storage/constants/traces.d.mts +0 -12
- package/dist/controllers/user-storage/constants/traces.d.mts.map +0 -1
- package/dist/controllers/user-storage/constants/traces.mjs +0 -14
- package/dist/controllers/user-storage/constants/traces.mjs.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { TraceCallback } from "@metamask/controller-utils";
|
|
2
1
|
import type { Hex } from "@metamask/utils";
|
|
3
2
|
import type { USER_STORAGE_VERSION_KEY, USER_STORAGE_VERSION } from "./constants.cjs";
|
|
4
3
|
import type { UserStorageControllerMessenger } from "../UserStorageController.cjs";
|
|
@@ -32,6 +31,5 @@ export type UserStorageContactEntry = {
|
|
|
32
31
|
export type ContactSyncingOptions = {
|
|
33
32
|
getUserStorageControllerInstance: () => UserStorageController;
|
|
34
33
|
getMessenger: () => UserStorageControllerMessenger;
|
|
35
|
-
trace?: TraceCallback;
|
|
36
34
|
};
|
|
37
35
|
//# sourceMappingURL=types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/contact-syncing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/contact-syncing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAE3C,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,wBAAoB;AACrB,OAAO,KAAK,EAAE,8BAA8B,EAAE,qCAAiC;AAC/E,OAAO,KAAK,qBAAqB,qCAAiC;AAElE,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;OAGG;IACH,CAAC,wBAAwB,CAAC,EAAE,OAAO,oBAAoB,CAAC;IACxD,qCAAqC;IACrC,CAAC,EAAE,MAAM,CAAC;IACV,kCAAkC;IAClC,CAAC,EAAE,MAAM,CAAC;IACV,qCAAqC;IACrC,CAAC,EAAE,GAAG,CAAC;IACP,6CAA6C;IAC7C,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,mDAAmD;IACnD,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,sDAAsD;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;IAC9D,YAAY,EAAE,MAAM,8BAA8B,CAAC;CACpD,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { TraceCallback } from "@metamask/controller-utils";
|
|
2
1
|
import type { Hex } from "@metamask/utils";
|
|
3
2
|
import type { USER_STORAGE_VERSION_KEY, USER_STORAGE_VERSION } from "./constants.mjs";
|
|
4
3
|
import type { UserStorageControllerMessenger } from "../UserStorageController.mjs";
|
|
@@ -32,6 +31,5 @@ export type UserStorageContactEntry = {
|
|
|
32
31
|
export type ContactSyncingOptions = {
|
|
33
32
|
getUserStorageControllerInstance: () => UserStorageController;
|
|
34
33
|
getMessenger: () => UserStorageControllerMessenger;
|
|
35
|
-
trace?: TraceCallback;
|
|
36
34
|
};
|
|
37
35
|
//# sourceMappingURL=types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/contact-syncing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/contact-syncing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,wBAAwB;AAE3C,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACrB,wBAAoB;AACrB,OAAO,KAAK,EAAE,8BAA8B,EAAE,qCAAiC;AAC/E,OAAO,KAAK,qBAAqB,qCAAiC;AAElE,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;OAGG;IACH,CAAC,wBAAwB,CAAC,EAAE,OAAO,oBAAoB,CAAC;IACxD,qCAAqC;IACrC,CAAC,EAAE,MAAM,CAAC;IACV,kCAAkC;IAClC,CAAC,EAAE,MAAM,CAAC;IACV,qCAAqC;IACrC,CAAC,EAAE,GAAG,CAAC;IACP,6CAA6C;IAC7C,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,mDAAmD;IACnD,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,sDAAsD;IACtD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;IAC9D,YAAY,EAAE,MAAM,8BAA8B,CAAC;CACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../../src/controllers/user-storage/contact-syncing/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../../src/controllers/user-storage/contact-syncing/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Hex } from '@metamask/utils';\n\nimport type {\n USER_STORAGE_VERSION_KEY,\n USER_STORAGE_VERSION,\n} from './constants';\nimport type { UserStorageControllerMessenger } from '../UserStorageController';\nimport type UserStorageController from '../UserStorageController';\n\nexport type UserStorageContactEntry = {\n /**\n * The Version 'v' of the User Storage.\n * NOTE - will allow us to support upgrade/downgrades in the future\n */\n [USER_STORAGE_VERSION_KEY]: typeof USER_STORAGE_VERSION;\n /** the address 'a' of the contact */\n a: string;\n /** the name 'n' of the contact */\n n: string;\n /** the chainId 'c' of the contact */\n c: Hex;\n /** the memo 'm' of the contact (optional) */\n m?: string;\n /** the addressType 't' of the contact (optional) */\n t?: string;\n /** the isEns flag 'e' of the contact (optional) */\n e?: boolean;\n /** the lastUpdatedAt timestamp 'lu' of the contact */\n lu?: number;\n /** the deletedAt timestamp 'dt' of the contact (optional) */\n dt?: number;\n};\n\n/**\n * Options for contact syncing operations\n */\nexport type ContactSyncingOptions = {\n getUserStorageControllerInstance: () => UserStorageController;\n getMessenger: () => UserStorageControllerMessenger;\n};\n"]}
|
|
@@ -36,7 +36,7 @@ const UserStorageController = UserStorageController_1.default;
|
|
|
36
36
|
exports.default = UserStorageController;
|
|
37
37
|
__exportStar(require("./UserStorageController.cjs"), exports);
|
|
38
38
|
exports.Mocks = __importStar(require("./mocks/index.cjs"));
|
|
39
|
-
__exportStar(require("./constants
|
|
39
|
+
__exportStar(require("./constants.cjs"), exports);
|
|
40
40
|
__exportStar(require("../../shared/encryption/index.cjs"), exports);
|
|
41
41
|
__exportStar(require("../../shared/storage-schema.cjs"), exports);
|
|
42
42
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wFAAiD;AAGxC,qBAHF,+BAAU,CAGE;AADnB,MAAM,qBAAqB,GAAG,+BAAU,CAAC;AAEzC,kBAAe,qBAAqB,CAAC;AACrC,8DAAwC;AACxC,2DAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wFAAiD;AAGxC,qBAHF,+BAAU,CAGE;AADnB,MAAM,qBAAqB,GAAG,+BAAU,CAAC;AAEzC,kBAAe,qBAAqB,CAAC;AACrC,8DAAwC;AACxC,2DAAiC;AACjC,kDAA4B;AAC5B,oEAAwC;AACxC,kEAA4C","sourcesContent":["import Controller from './UserStorageController';\n\nconst UserStorageController = Controller;\nexport { Controller };\nexport default UserStorageController;\nexport * from './UserStorageController';\nexport * as Mocks from './mocks';\nexport * from './constants';\nexport * from '../../shared/encryption';\nexport * from '../../shared/storage-schema';\n"]}
|
|
@@ -4,7 +4,7 @@ export { Controller };
|
|
|
4
4
|
export default UserStorageController;
|
|
5
5
|
export * from "./UserStorageController.cjs";
|
|
6
6
|
export * as Mocks from "./mocks/index.cjs";
|
|
7
|
-
export * from "./constants
|
|
7
|
+
export * from "./constants.cjs";
|
|
8
8
|
export * from "../../shared/encryption/index.cjs";
|
|
9
9
|
export * from "../../shared/storage-schema.cjs";
|
|
10
10
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/controllers/user-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,oCAAgC;AAEjD,QAAA,MAAM,qBAAqB,mBAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,eAAe,qBAAqB,CAAC;AACrC,4CAAwC;AACxC,OAAO,KAAK,KAAK,0BAAgB;AACjC,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/controllers/user-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,oCAAgC;AAEjD,QAAA,MAAM,qBAAqB,mBAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,eAAe,qBAAqB,CAAC;AACrC,4CAAwC;AACxC,OAAO,KAAK,KAAK,0BAAgB;AACjC,gCAA4B;AAC5B,kDAAwC;AACxC,gDAA4C"}
|
|
@@ -4,7 +4,7 @@ export { Controller };
|
|
|
4
4
|
export default UserStorageController;
|
|
5
5
|
export * from "./UserStorageController.mjs";
|
|
6
6
|
export * as Mocks from "./mocks/index.mjs";
|
|
7
|
-
export * from "./constants
|
|
7
|
+
export * from "./constants.mjs";
|
|
8
8
|
export * from "../../shared/encryption/index.mjs";
|
|
9
9
|
export * from "../../shared/storage-schema.mjs";
|
|
10
10
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/controllers/user-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,oCAAgC;AAEjD,QAAA,MAAM,qBAAqB,mBAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,eAAe,qBAAqB,CAAC;AACrC,4CAAwC;AACxC,OAAO,KAAK,KAAK,0BAAgB;AACjC,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/controllers/user-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,oCAAgC;AAEjD,QAAA,MAAM,qBAAqB,mBAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,eAAe,qBAAqB,CAAC;AACrC,4CAAwC;AACxC,OAAO,KAAK,KAAK,0BAAgB;AACjC,gCAA4B;AAC5B,kDAAwC;AACxC,gDAA4C"}
|
|
@@ -4,7 +4,7 @@ export { Controller };
|
|
|
4
4
|
export default UserStorageController;
|
|
5
5
|
export * from "./UserStorageController.mjs";
|
|
6
6
|
export * as Mocks from "./mocks/index.mjs";
|
|
7
|
-
export * from "./constants
|
|
7
|
+
export * from "./constants.mjs";
|
|
8
8
|
export * from "../../shared/encryption/index.mjs";
|
|
9
9
|
export * from "../../shared/storage-schema.mjs";
|
|
10
10
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,oCAAgC;AAEjD,MAAM,qBAAqB,GAAG,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,eAAe,qBAAqB,CAAC;AACrC,4CAAwC;AACxC,OAAO,KAAK,KAAK,0BAAgB;AACjC,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,oCAAgC;AAEjD,MAAM,qBAAqB,GAAG,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,eAAe,qBAAqB,CAAC;AACrC,4CAAwC;AACxC,OAAO,KAAK,KAAK,0BAAgB;AACjC,gCAA4B;AAC5B,kDAAwC;AACxC,gDAA4C","sourcesContent":["import Controller from './UserStorageController';\n\nconst UserStorageController = Controller;\nexport { Controller };\nexport default UserStorageController;\nexport * from './UserStorageController';\nexport * as Mocks from './mocks';\nexport * from './constants';\nexport * from '../../shared/encryption';\nexport * from '../../shared/storage-schema';\n"]}
|
|
@@ -86,7 +86,7 @@ const getMockUserStorageBatchPutResponse = (path = storage_schema_1.USER_STORAGE
|
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
exports.getMockUserStorageBatchPutResponse = getMockUserStorageBatchPutResponse;
|
|
89
|
-
const getMockUserStorageBatchDeleteResponse = (path =
|
|
89
|
+
const getMockUserStorageBatchDeleteResponse = (path = storage_schema_1.USER_STORAGE_FEATURE_NAMES.notifications) => {
|
|
90
90
|
return {
|
|
91
91
|
url: (0, exports.getMockUserStorageEndpoint)(path),
|
|
92
92
|
requestMethod: 'PUT',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockResponses.cjs","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockResponses.ts"],"names":[],"mappings":";;;AAAA,mDAIuB;AACvB,gDAA+C;AAK/C,uEAGwC;AAYjC,MAAM,0BAA0B,GAAG,CACxC,
|
|
1
|
+
{"version":3,"file":"mockResponses.cjs","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockResponses.ts"],"names":[],"mappings":";;;AAAA,mDAIuB;AACvB,gDAA+C;AAK/C,uEAGwC;AAYjC,MAAM,0BAA0B,GAAG,CACxC,IAEyC,EACzC,EAAE;IACF,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAChC,OAAO,G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a,EAAE,QAAQ;QACvB,QAAQ,EAAE,IAAI;KACQ,CAAC;AAC3B,CAAC,CAAC;AARW,QAAA,8CAA8C,kDAQzD","sourcesContent":["import {\n MOCK_ENCRYPTED_STORAGE_DATA,\n MOCK_STORAGE_DATA,\n MOCK_STORAGE_KEY,\n} from './mockStorage';\nimport { Env, getEnvUrls } from '../../../sdk';\nimport type {\n UserStorageGenericPathWithFeatureAndKey,\n UserStorageGenericPathWithFeatureOnly,\n} from '../../../shared/storage-schema';\nimport {\n createEntryPath,\n USER_STORAGE_FEATURE_NAMES,\n} from '../../../shared/storage-schema';\nimport type {\n GetUserStorageAllFeatureEntriesResponse,\n GetUserStorageResponse,\n} from '../types';\n\ntype MockResponse = {\n url: string;\n requestMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';\n response: unknown;\n};\n\nexport const getMockUserStorageEndpoint = (\n path:\n | UserStorageGenericPathWithFeatureAndKey\n | UserStorageGenericPathWithFeatureOnly,\n) => {\n if (path.split('.').length === 1) {\n return `${getEnvUrls(Env.PRD).userStorageApiUrl}/api/v1/userstorage/${path}`;\n }\n\n return `${getEnvUrls(Env.PRD).userStorageApiUrl}/api/v1/userstorage/${createEntryPath(\n path as UserStorageGenericPathWithFeatureAndKey,\n MOCK_STORAGE_KEY,\n )}`;\n};\n\n/**\n * Creates a mock GET user-storage response\n *\n * @param data - data to encrypt\n * @returns a realistic GET Response Body\n */\nexport async function createMockGetStorageResponse(\n data?: string,\n): Promise<GetUserStorageResponse> {\n return {\n HashedKey: 'HASHED_KEY',\n Data: await MOCK_ENCRYPTED_STORAGE_DATA(data),\n };\n}\n\n/**\n * Creates a mock GET ALL user-storage response\n *\n * @param dataArr - array of data to encrypt\n * @returns a realistic GET ALL Response Body\n */\nexport async function createMockAllFeatureEntriesResponse(\n dataArr: string[] = [MOCK_STORAGE_DATA],\n): Promise<GetUserStorageAllFeatureEntriesResponse> {\n const decryptedData = [];\n\n for (const data of dataArr) {\n decryptedData.push({\n HashedKey: 'HASHED_KEY',\n Data: await MOCK_ENCRYPTED_STORAGE_DATA(data),\n });\n }\n\n return decryptedData;\n}\n\n/**\n * Creates a mock user-storage api GET request\n *\n * @param path - path of the GET Url\n * @returns mock GET API request. Can be used by e2e or unit mock servers\n */\nexport async function getMockUserStorageGetResponse(\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'GET',\n response: await createMockGetStorageResponse(),\n } satisfies MockResponse;\n}\n\n/**\n * Creates a mock user-storage api GET ALL request\n *\n * @param path - path of the GET url\n * @param dataArr - data to encrypt\n * @returns mock GET ALL API request. Can be used by e2e or unit mock servers\n */\nexport async function getMockUserStorageAllFeatureEntriesResponse(\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n dataArr?: string[],\n) {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'GET',\n response: await createMockAllFeatureEntriesResponse(dataArr),\n } satisfies MockResponse;\n}\n\nexport const getMockUserStoragePutResponse = (\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockUserStorageBatchPutResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockUserStorageBatchDeleteResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const deleteMockUserStorageResponse = (\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'DELETE',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const deleteMockUserStorageAllFeatureEntriesResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'DELETE',\n response: null,\n } satisfies MockResponse;\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UserStorageGenericPathWithFeatureAndKey, UserStorageGenericPathWithFeatureOnly } from "../../../shared/storage-schema.cjs";
|
|
2
2
|
import type { GetUserStorageAllFeatureEntriesResponse, GetUserStorageResponse } from "../types.cjs";
|
|
3
|
-
export declare const getMockUserStorageEndpoint: (path:
|
|
3
|
+
export declare const getMockUserStorageEndpoint: (path: UserStorageGenericPathWithFeatureAndKey | UserStorageGenericPathWithFeatureOnly) => string;
|
|
4
4
|
/**
|
|
5
5
|
* Creates a mock GET user-storage response
|
|
6
6
|
*
|
|
@@ -21,7 +21,7 @@ export declare function createMockAllFeatureEntriesResponse(dataArr?: string[]):
|
|
|
21
21
|
* @param path - path of the GET Url
|
|
22
22
|
* @returns mock GET API request. Can be used by e2e or unit mock servers
|
|
23
23
|
*/
|
|
24
|
-
export declare function getMockUserStorageGetResponse(path?:
|
|
24
|
+
export declare function getMockUserStorageGetResponse(path?: UserStorageGenericPathWithFeatureAndKey): Promise<{
|
|
25
25
|
url: string;
|
|
26
26
|
requestMethod: "GET";
|
|
27
27
|
response: GetUserStorageResponse;
|
|
@@ -33,32 +33,32 @@ export declare function getMockUserStorageGetResponse(path?: UserStoragePathWith
|
|
|
33
33
|
* @param dataArr - data to encrypt
|
|
34
34
|
* @returns mock GET ALL API request. Can be used by e2e or unit mock servers
|
|
35
35
|
*/
|
|
36
|
-
export declare function getMockUserStorageAllFeatureEntriesResponse(path?:
|
|
36
|
+
export declare function getMockUserStorageAllFeatureEntriesResponse(path?: UserStorageGenericPathWithFeatureOnly, dataArr?: string[]): Promise<{
|
|
37
37
|
url: string;
|
|
38
38
|
requestMethod: "GET";
|
|
39
39
|
response: GetUserStorageAllFeatureEntriesResponse;
|
|
40
40
|
}>;
|
|
41
|
-
export declare const getMockUserStoragePutResponse: (path?:
|
|
41
|
+
export declare const getMockUserStoragePutResponse: (path?: UserStorageGenericPathWithFeatureAndKey) => {
|
|
42
42
|
url: string;
|
|
43
43
|
requestMethod: "PUT";
|
|
44
44
|
response: null;
|
|
45
45
|
};
|
|
46
|
-
export declare const getMockUserStorageBatchPutResponse: (path?:
|
|
46
|
+
export declare const getMockUserStorageBatchPutResponse: (path?: UserStorageGenericPathWithFeatureOnly) => {
|
|
47
47
|
url: string;
|
|
48
48
|
requestMethod: "PUT";
|
|
49
49
|
response: null;
|
|
50
50
|
};
|
|
51
|
-
export declare const getMockUserStorageBatchDeleteResponse: (path?:
|
|
51
|
+
export declare const getMockUserStorageBatchDeleteResponse: (path?: UserStorageGenericPathWithFeatureOnly) => {
|
|
52
52
|
url: string;
|
|
53
53
|
requestMethod: "PUT";
|
|
54
54
|
response: null;
|
|
55
55
|
};
|
|
56
|
-
export declare const deleteMockUserStorageResponse: (path?:
|
|
56
|
+
export declare const deleteMockUserStorageResponse: (path?: UserStorageGenericPathWithFeatureAndKey) => {
|
|
57
57
|
url: string;
|
|
58
58
|
requestMethod: "DELETE";
|
|
59
59
|
response: null;
|
|
60
60
|
};
|
|
61
|
-
export declare const deleteMockUserStorageAllFeatureEntriesResponse: (path?:
|
|
61
|
+
export declare const deleteMockUserStorageAllFeatureEntriesResponse: (path?: UserStorageGenericPathWithFeatureOnly) => {
|
|
62
62
|
url: string;
|
|
63
63
|
requestMethod: "DELETE";
|
|
64
64
|
response: null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockResponses.d.cts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockResponses.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"mockResponses.d.cts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockResponses.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,uCAAuC,EACvC,qCAAqC,EACtC,2CAAuC;AAKxC,OAAO,KAAK,EACV,uCAAuC,EACvC,sBAAsB,EACvB,qBAAiB;AAQlB,eAAO,MAAM,0BAA0B,SAEjC,uCAAuC,GACvC,qCAAqC,WAU1C,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,sBAAsB,CAAC,CAKjC;AAED;;;;;GAKG;AACH,wBAAsB,mCAAmC,CACvD,OAAO,GAAE,MAAM,EAAwB,GACtC,OAAO,CAAC,uCAAuC,CAAC,CAWlD;AAED;;;;;GAKG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,GAAE,uCAA6G;;;;GAOpH;AAED;;;;;;GAMG;AACH,wBAAsB,2CAA2C,CAC/D,IAAI,GAAE,qCAAgF,EACtF,OAAO,CAAC,EAAE,MAAM,EAAE;;;;GAOnB;AAED,eAAO,MAAM,6BAA6B,UAClC,uCAAuC;;;;CAO9C,CAAC;AAEF,eAAO,MAAM,kCAAkC,UACvC,qCAAqC;;;;CAO5C,CAAC;AAEF,eAAO,MAAM,qCAAqC,UAC1C,qCAAqC;;;;CAO5C,CAAC;AAEF,eAAO,MAAM,6BAA6B,UAClC,uCAAuC;;;;CAO9C,CAAC;AAEF,eAAO,MAAM,8CAA8C,UACnD,qCAAqC;;;;CAO5C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UserStorageGenericPathWithFeatureAndKey, UserStorageGenericPathWithFeatureOnly } from "../../../shared/storage-schema.mjs";
|
|
2
2
|
import type { GetUserStorageAllFeatureEntriesResponse, GetUserStorageResponse } from "../types.mjs";
|
|
3
|
-
export declare const getMockUserStorageEndpoint: (path:
|
|
3
|
+
export declare const getMockUserStorageEndpoint: (path: UserStorageGenericPathWithFeatureAndKey | UserStorageGenericPathWithFeatureOnly) => string;
|
|
4
4
|
/**
|
|
5
5
|
* Creates a mock GET user-storage response
|
|
6
6
|
*
|
|
@@ -21,7 +21,7 @@ export declare function createMockAllFeatureEntriesResponse(dataArr?: string[]):
|
|
|
21
21
|
* @param path - path of the GET Url
|
|
22
22
|
* @returns mock GET API request. Can be used by e2e or unit mock servers
|
|
23
23
|
*/
|
|
24
|
-
export declare function getMockUserStorageGetResponse(path?:
|
|
24
|
+
export declare function getMockUserStorageGetResponse(path?: UserStorageGenericPathWithFeatureAndKey): Promise<{
|
|
25
25
|
url: string;
|
|
26
26
|
requestMethod: "GET";
|
|
27
27
|
response: GetUserStorageResponse;
|
|
@@ -33,32 +33,32 @@ export declare function getMockUserStorageGetResponse(path?: UserStoragePathWith
|
|
|
33
33
|
* @param dataArr - data to encrypt
|
|
34
34
|
* @returns mock GET ALL API request. Can be used by e2e or unit mock servers
|
|
35
35
|
*/
|
|
36
|
-
export declare function getMockUserStorageAllFeatureEntriesResponse(path?:
|
|
36
|
+
export declare function getMockUserStorageAllFeatureEntriesResponse(path?: UserStorageGenericPathWithFeatureOnly, dataArr?: string[]): Promise<{
|
|
37
37
|
url: string;
|
|
38
38
|
requestMethod: "GET";
|
|
39
39
|
response: GetUserStorageAllFeatureEntriesResponse;
|
|
40
40
|
}>;
|
|
41
|
-
export declare const getMockUserStoragePutResponse: (path?:
|
|
41
|
+
export declare const getMockUserStoragePutResponse: (path?: UserStorageGenericPathWithFeatureAndKey) => {
|
|
42
42
|
url: string;
|
|
43
43
|
requestMethod: "PUT";
|
|
44
44
|
response: null;
|
|
45
45
|
};
|
|
46
|
-
export declare const getMockUserStorageBatchPutResponse: (path?:
|
|
46
|
+
export declare const getMockUserStorageBatchPutResponse: (path?: UserStorageGenericPathWithFeatureOnly) => {
|
|
47
47
|
url: string;
|
|
48
48
|
requestMethod: "PUT";
|
|
49
49
|
response: null;
|
|
50
50
|
};
|
|
51
|
-
export declare const getMockUserStorageBatchDeleteResponse: (path?:
|
|
51
|
+
export declare const getMockUserStorageBatchDeleteResponse: (path?: UserStorageGenericPathWithFeatureOnly) => {
|
|
52
52
|
url: string;
|
|
53
53
|
requestMethod: "PUT";
|
|
54
54
|
response: null;
|
|
55
55
|
};
|
|
56
|
-
export declare const deleteMockUserStorageResponse: (path?:
|
|
56
|
+
export declare const deleteMockUserStorageResponse: (path?: UserStorageGenericPathWithFeatureAndKey) => {
|
|
57
57
|
url: string;
|
|
58
58
|
requestMethod: "DELETE";
|
|
59
59
|
response: null;
|
|
60
60
|
};
|
|
61
|
-
export declare const deleteMockUserStorageAllFeatureEntriesResponse: (path?:
|
|
61
|
+
export declare const deleteMockUserStorageAllFeatureEntriesResponse: (path?: UserStorageGenericPathWithFeatureOnly) => {
|
|
62
62
|
url: string;
|
|
63
63
|
requestMethod: "DELETE";
|
|
64
64
|
response: null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockResponses.d.mts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockResponses.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"mockResponses.d.mts","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockResponses.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,uCAAuC,EACvC,qCAAqC,EACtC,2CAAuC;AAKxC,OAAO,KAAK,EACV,uCAAuC,EACvC,sBAAsB,EACvB,qBAAiB;AAQlB,eAAO,MAAM,0BAA0B,SAEjC,uCAAuC,GACvC,qCAAqC,WAU1C,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,sBAAsB,CAAC,CAKjC;AAED;;;;;GAKG;AACH,wBAAsB,mCAAmC,CACvD,OAAO,GAAE,MAAM,EAAwB,GACtC,OAAO,CAAC,uCAAuC,CAAC,CAWlD;AAED;;;;;GAKG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,GAAE,uCAA6G;;;;GAOpH;AAED;;;;;;GAMG;AACH,wBAAsB,2CAA2C,CAC/D,IAAI,GAAE,qCAAgF,EACtF,OAAO,CAAC,EAAE,MAAM,EAAE;;;;GAOnB;AAED,eAAO,MAAM,6BAA6B,UAClC,uCAAuC;;;;CAO9C,CAAC;AAEF,eAAO,MAAM,kCAAkC,UACvC,qCAAqC;;;;CAO5C,CAAC;AAEF,eAAO,MAAM,qCAAqC,UAC1C,qCAAqC;;;;CAO5C,CAAC;AAEF,eAAO,MAAM,6BAA6B,UAClC,uCAAuC;;;;CAO9C,CAAC;AAEF,eAAO,MAAM,8CAA8C,UACnD,qCAAqC;;;;CAO5C,CAAC"}
|
|
@@ -76,7 +76,7 @@ export const getMockUserStorageBatchPutResponse = (path = USER_STORAGE_FEATURE_N
|
|
|
76
76
|
response: null,
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
|
-
export const getMockUserStorageBatchDeleteResponse = (path =
|
|
79
|
+
export const getMockUserStorageBatchDeleteResponse = (path = USER_STORAGE_FEATURE_NAMES.notifications) => {
|
|
80
80
|
return {
|
|
81
81
|
url: getMockUserStorageEndpoint(path),
|
|
82
82
|
requestMethod: 'PUT',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockResponses.mjs","sourceRoot":"","sources":["../../../../src/controllers/user-storage/mocks/mockResponses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,gBAAgB,EACjB,0BAAsB;AACvB,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,+BAAqB;AAK/C,OAAO,EACL,eAAe,EACf,0BAA0B,EAC3B,2CAAuC;AAYxC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,
|
|
1
|
+
{"version":3,"file":"mockResponses.mjs","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AC;QACrC,aAAa,EAAE,QAAQ;QACvB,QAAQ,EAAE,IAAI;KACQ,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8CAA8C,GAAG,CAC5D,OAA8C,0BAA0B,CAAC,aAAa,EACtF,EAAE;IACF,OAAO;QACL,GAAG,EAAE,0BAA0B,CAAC,IAAI,CAAC;QACrC,aAAa,EAAE,QAAQ;QACvB,QAAQ,EAAE,IAAI;KACQ,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import {\n MOCK_ENCRYPTED_STORAGE_DATA,\n MOCK_STORAGE_DATA,\n MOCK_STORAGE_KEY,\n} from './mockStorage';\nimport { Env, getEnvUrls } from '../../../sdk';\nimport type {\n UserStorageGenericPathWithFeatureAndKey,\n UserStorageGenericPathWithFeatureOnly,\n} from '../../../shared/storage-schema';\nimport {\n createEntryPath,\n USER_STORAGE_FEATURE_NAMES,\n} from '../../../shared/storage-schema';\nimport type {\n GetUserStorageAllFeatureEntriesResponse,\n GetUserStorageResponse,\n} from '../types';\n\ntype MockResponse = {\n url: string;\n requestMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';\n response: unknown;\n};\n\nexport const getMockUserStorageEndpoint = (\n path:\n | UserStorageGenericPathWithFeatureAndKey\n | UserStorageGenericPathWithFeatureOnly,\n) => {\n if (path.split('.').length === 1) {\n return `${getEnvUrls(Env.PRD).userStorageApiUrl}/api/v1/userstorage/${path}`;\n }\n\n return `${getEnvUrls(Env.PRD).userStorageApiUrl}/api/v1/userstorage/${createEntryPath(\n path as UserStorageGenericPathWithFeatureAndKey,\n MOCK_STORAGE_KEY,\n )}`;\n};\n\n/**\n * Creates a mock GET user-storage response\n *\n * @param data - data to encrypt\n * @returns a realistic GET Response Body\n */\nexport async function createMockGetStorageResponse(\n data?: string,\n): Promise<GetUserStorageResponse> {\n return {\n HashedKey: 'HASHED_KEY',\n Data: await MOCK_ENCRYPTED_STORAGE_DATA(data),\n };\n}\n\n/**\n * Creates a mock GET ALL user-storage response\n *\n * @param dataArr - array of data to encrypt\n * @returns a realistic GET ALL Response Body\n */\nexport async function createMockAllFeatureEntriesResponse(\n dataArr: string[] = [MOCK_STORAGE_DATA],\n): Promise<GetUserStorageAllFeatureEntriesResponse> {\n const decryptedData = [];\n\n for (const data of dataArr) {\n decryptedData.push({\n HashedKey: 'HASHED_KEY',\n Data: await MOCK_ENCRYPTED_STORAGE_DATA(data),\n });\n }\n\n return decryptedData;\n}\n\n/**\n * Creates a mock user-storage api GET request\n *\n * @param path - path of the GET Url\n * @returns mock GET API request. Can be used by e2e or unit mock servers\n */\nexport async function getMockUserStorageGetResponse(\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'GET',\n response: await createMockGetStorageResponse(),\n } satisfies MockResponse;\n}\n\n/**\n * Creates a mock user-storage api GET ALL request\n *\n * @param path - path of the GET url\n * @param dataArr - data to encrypt\n * @returns mock GET ALL API request. Can be used by e2e or unit mock servers\n */\nexport async function getMockUserStorageAllFeatureEntriesResponse(\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n dataArr?: string[],\n) {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'GET',\n response: await createMockAllFeatureEntriesResponse(dataArr),\n } satisfies MockResponse;\n}\n\nexport const getMockUserStoragePutResponse = (\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockUserStorageBatchPutResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockUserStorageBatchDeleteResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'PUT',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const deleteMockUserStorageResponse = (\n path: UserStorageGenericPathWithFeatureAndKey = `${USER_STORAGE_FEATURE_NAMES.notifications}.notification_settings`,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'DELETE',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const deleteMockUserStorageAllFeatureEntriesResponse = (\n path: UserStorageGenericPathWithFeatureOnly = USER_STORAGE_FEATURE_NAMES.notifications,\n) => {\n return {\n url: getMockUserStorageEndpoint(path),\n requestMethod: 'DELETE',\n response: null,\n } satisfies MockResponse;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n UserStorageGenericPathWithFeatureAndKey,\n UserStorageGenericPathWithFeatureOnly,\n} from '../../shared/storage-schema';\nimport type { NativeScrypt } from '../../shared/types/encryption';\n\nexport type UserStorageBaseOptions = {\n bearerToken: string;\n storageKey: string;\n nativeScryptCrypto?: NativeScrypt;\n};\n\nexport type UserStorageOptions = UserStorageBaseOptions & {\n path: UserStorageGenericPathWithFeatureAndKey;\n};\n\nexport type UserStorageAllFeatureEntriesOptions = UserStorageBaseOptions & {\n path: UserStorageGenericPathWithFeatureOnly;\n};\n\nexport type UserStorageBatchUpsertOptions = UserStorageAllFeatureEntriesOptions;\n\nexport type GetUserStorageResponse = {\n HashedKey: string;\n Data: string;\n};\n\nexport type GetUserStorageAllFeatureEntriesResponse = {\n HashedKey: string;\n Data: string;\n}[];\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UserStorageGenericPathWithFeatureAndKey, UserStorageGenericPathWithFeatureOnly } from "../../shared/storage-schema.cjs";
|
|
2
2
|
import type { NativeScrypt } from "../../shared/types/encryption.cjs";
|
|
3
3
|
export type UserStorageBaseOptions = {
|
|
4
4
|
bearerToken: string;
|
|
@@ -6,10 +6,10 @@ export type UserStorageBaseOptions = {
|
|
|
6
6
|
nativeScryptCrypto?: NativeScrypt;
|
|
7
7
|
};
|
|
8
8
|
export type UserStorageOptions = UserStorageBaseOptions & {
|
|
9
|
-
path:
|
|
9
|
+
path: UserStorageGenericPathWithFeatureAndKey;
|
|
10
10
|
};
|
|
11
11
|
export type UserStorageAllFeatureEntriesOptions = UserStorageBaseOptions & {
|
|
12
|
-
path:
|
|
12
|
+
path: UserStorageGenericPathWithFeatureOnly;
|
|
13
13
|
};
|
|
14
14
|
export type UserStorageBatchUpsertOptions = UserStorageAllFeatureEntriesOptions;
|
|
15
15
|
export type GetUserStorageResponse = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uCAAuC,EACvC,qCAAqC,EACtC,wCAAoC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,0CAAsC;AAElE,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,YAAY,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG;IACxD,IAAI,EAAE,uCAAuC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,sBAAsB,GAAG;IACzE,IAAI,EAAE,qCAAqC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,mCAAmC,CAAC;AAEhF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UserStorageGenericPathWithFeatureAndKey, UserStorageGenericPathWithFeatureOnly } from "../../shared/storage-schema.mjs";
|
|
2
2
|
import type { NativeScrypt } from "../../shared/types/encryption.mjs";
|
|
3
3
|
export type UserStorageBaseOptions = {
|
|
4
4
|
bearerToken: string;
|
|
@@ -6,10 +6,10 @@ export type UserStorageBaseOptions = {
|
|
|
6
6
|
nativeScryptCrypto?: NativeScrypt;
|
|
7
7
|
};
|
|
8
8
|
export type UserStorageOptions = UserStorageBaseOptions & {
|
|
9
|
-
path:
|
|
9
|
+
path: UserStorageGenericPathWithFeatureAndKey;
|
|
10
10
|
};
|
|
11
11
|
export type UserStorageAllFeatureEntriesOptions = UserStorageBaseOptions & {
|
|
12
|
-
path:
|
|
12
|
+
path: UserStorageGenericPathWithFeatureOnly;
|
|
13
13
|
};
|
|
14
14
|
export type UserStorageBatchUpsertOptions = UserStorageAllFeatureEntriesOptions;
|
|
15
15
|
export type GetUserStorageResponse = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uCAAuC,EACvC,qCAAqC,EACtC,wCAAoC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,0CAAsC;AAElE,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,YAAY,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GAAG;IACxD,IAAI,EAAE,uCAAuC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,sBAAsB,GAAG;IACzE,IAAI,EAAE,qCAAqC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,mCAAmC,CAAC;AAEhF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/controllers/user-storage/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n UserStorageGenericPathWithFeatureAndKey,\n UserStorageGenericPathWithFeatureOnly,\n} from '../../shared/storage-schema';\nimport type { NativeScrypt } from '../../shared/types/encryption';\n\nexport type UserStorageBaseOptions = {\n bearerToken: string;\n storageKey: string;\n nativeScryptCrypto?: NativeScrypt;\n};\n\nexport type UserStorageOptions = UserStorageBaseOptions & {\n path: UserStorageGenericPathWithFeatureAndKey;\n};\n\nexport type UserStorageAllFeatureEntriesOptions = UserStorageBaseOptions & {\n path: UserStorageGenericPathWithFeatureOnly;\n};\n\nexport type UserStorageBatchUpsertOptions = UserStorageAllFeatureEntriesOptions;\n\nexport type GetUserStorageResponse = {\n HashedKey: string;\n Data: string;\n};\n\nexport type GetUserStorageAllFeatureEntriesResponse = {\n HashedKey: string;\n Data: string;\n}[];\n"]}
|
|
@@ -85,9 +85,7 @@ _UserStorage_instances = new WeakSet(), _UserStorage_upsertUserStorage = async f
|
|
|
85
85
|
const headers = await __classPrivateFieldGet(this, _UserStorage_instances, "m", _UserStorage_getAuthorizationHeader).call(this, entropySourceId);
|
|
86
86
|
const storageKey = await this.getStorageKey(entropySourceId);
|
|
87
87
|
const encryptedData = await encryption_1.default.encryptString(data, storageKey, options?.nativeScryptCrypto);
|
|
88
|
-
const encryptedPath = (0, storage_schema_1.createEntryPath)(path, storageKey
|
|
89
|
-
validateAgainstSchema: Boolean(options?.validateAgainstSchema),
|
|
90
|
-
});
|
|
88
|
+
const encryptedPath = (0, storage_schema_1.createEntryPath)(path, storageKey);
|
|
91
89
|
const url = new URL((0, exports.STORAGE_URL)(this.env, encryptedPath));
|
|
92
90
|
const response = await fetch(url.toString(), {
|
|
93
91
|
method: 'PUT',
|
|
@@ -178,9 +176,7 @@ _UserStorage_instances = new WeakSet(), _UserStorage_upsertUserStorage = async f
|
|
|
178
176
|
try {
|
|
179
177
|
const headers = await __classPrivateFieldGet(this, _UserStorage_instances, "m", _UserStorage_getAuthorizationHeader).call(this, entropySourceId);
|
|
180
178
|
const storageKey = await this.getStorageKey(entropySourceId);
|
|
181
|
-
const encryptedPath = (0, storage_schema_1.createEntryPath)(path, storageKey
|
|
182
|
-
validateAgainstSchema: Boolean(options?.validateAgainstSchema),
|
|
183
|
-
});
|
|
179
|
+
const encryptedPath = (0, storage_schema_1.createEntryPath)(path, storageKey);
|
|
184
180
|
const url = new URL((0, exports.STORAGE_URL)(this.env, encryptedPath));
|
|
185
181
|
const response = await fetch(url.toString(), {
|
|
186
182
|
headers: {
|
|
@@ -274,9 +270,7 @@ _UserStorage_instances = new WeakSet(), _UserStorage_upsertUserStorage = async f
|
|
|
274
270
|
try {
|
|
275
271
|
const headers = await __classPrivateFieldGet(this, _UserStorage_instances, "m", _UserStorage_getAuthorizationHeader).call(this, entropySourceId);
|
|
276
272
|
const storageKey = await this.getStorageKey(entropySourceId);
|
|
277
|
-
const encryptedPath = (0, storage_schema_1.createEntryPath)(path, storageKey
|
|
278
|
-
validateAgainstSchema: Boolean(options?.validateAgainstSchema),
|
|
279
|
-
});
|
|
273
|
+
const encryptedPath = (0, storage_schema_1.createEntryPath)(path, storageKey);
|
|
280
274
|
const url = new URL((0, exports.STORAGE_URL)(this.env, encryptedPath));
|
|
281
275
|
const response = await fetch(url.toString(), {
|
|
282
276
|
method: 'DELETE',
|