@metamask-previews/analytics-data-regulation-controller 0.0.0-preview-52f4a2ca

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 (68) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/LICENSE +20 -0
  3. package/README.md +15 -0
  4. package/dist/AnalyticsDataRegulationController-method-action-types.cjs +7 -0
  5. package/dist/AnalyticsDataRegulationController-method-action-types.cjs.map +1 -0
  6. package/dist/AnalyticsDataRegulationController-method-action-types.d.cts +44 -0
  7. package/dist/AnalyticsDataRegulationController-method-action-types.d.cts.map +1 -0
  8. package/dist/AnalyticsDataRegulationController-method-action-types.d.mts +44 -0
  9. package/dist/AnalyticsDataRegulationController-method-action-types.d.mts.map +1 -0
  10. package/dist/AnalyticsDataRegulationController-method-action-types.mjs +6 -0
  11. package/dist/AnalyticsDataRegulationController-method-action-types.mjs.map +1 -0
  12. package/dist/AnalyticsDataRegulationController.cjs +176 -0
  13. package/dist/AnalyticsDataRegulationController.cjs.map +1 -0
  14. package/dist/AnalyticsDataRegulationController.d.cts +147 -0
  15. package/dist/AnalyticsDataRegulationController.d.cts.map +1 -0
  16. package/dist/AnalyticsDataRegulationController.d.mts +147 -0
  17. package/dist/AnalyticsDataRegulationController.d.mts.map +1 -0
  18. package/dist/AnalyticsDataRegulationController.mjs +171 -0
  19. package/dist/AnalyticsDataRegulationController.mjs.map +1 -0
  20. package/dist/AnalyticsDataRegulationService-method-action-types.cjs +7 -0
  21. package/dist/AnalyticsDataRegulationService-method-action-types.cjs.map +1 -0
  22. package/dist/AnalyticsDataRegulationService-method-action-types.d.cts +32 -0
  23. package/dist/AnalyticsDataRegulationService-method-action-types.d.cts.map +1 -0
  24. package/dist/AnalyticsDataRegulationService-method-action-types.d.mts +32 -0
  25. package/dist/AnalyticsDataRegulationService-method-action-types.d.mts.map +1 -0
  26. package/dist/AnalyticsDataRegulationService-method-action-types.mjs +6 -0
  27. package/dist/AnalyticsDataRegulationService-method-action-types.mjs.map +1 -0
  28. package/dist/AnalyticsDataRegulationService.cjs +247 -0
  29. package/dist/AnalyticsDataRegulationService.cjs.map +1 -0
  30. package/dist/AnalyticsDataRegulationService.d.cts +172 -0
  31. package/dist/AnalyticsDataRegulationService.d.cts.map +1 -0
  32. package/dist/AnalyticsDataRegulationService.d.mts +172 -0
  33. package/dist/AnalyticsDataRegulationService.d.mts.map +1 -0
  34. package/dist/AnalyticsDataRegulationService.mjs +243 -0
  35. package/dist/AnalyticsDataRegulationService.mjs.map +1 -0
  36. package/dist/index.cjs +14 -0
  37. package/dist/index.cjs.map +1 -0
  38. package/dist/index.d.cts +11 -0
  39. package/dist/index.d.cts.map +1 -0
  40. package/dist/index.d.mts +11 -0
  41. package/dist/index.d.mts.map +1 -0
  42. package/dist/index.mjs +5 -0
  43. package/dist/index.mjs.map +1 -0
  44. package/dist/logger.cjs +7 -0
  45. package/dist/logger.cjs.map +1 -0
  46. package/dist/logger.d.cts +3 -0
  47. package/dist/logger.d.cts.map +1 -0
  48. package/dist/logger.d.mts +3 -0
  49. package/dist/logger.d.mts.map +1 -0
  50. package/dist/logger.mjs +4 -0
  51. package/dist/logger.mjs.map +1 -0
  52. package/dist/selectors.cjs +34 -0
  53. package/dist/selectors.cjs.map +1 -0
  54. package/dist/selectors.d.cts +11 -0
  55. package/dist/selectors.d.cts.map +1 -0
  56. package/dist/selectors.d.mts +11 -0
  57. package/dist/selectors.d.mts.map +1 -0
  58. package/dist/selectors.mjs +31 -0
  59. package/dist/selectors.mjs.map +1 -0
  60. package/dist/types.cjs +25 -0
  61. package/dist/types.cjs.map +1 -0
  62. package/dist/types.d.cts +46 -0
  63. package/dist/types.d.cts.map +1 -0
  64. package/dist/types.d.mts +46 -0
  65. package/dist/types.d.mts.map +1 -0
  66. package/dist/types.mjs +22 -0
  67. package/dist/types.mjs.map +1 -0
  68. package/package.json +76 -0
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Status values for data deletion requests from Segment API.
3
+ * Values match Segment API response values exactly.
4
+ */
5
+ export declare const DATA_DELETE_STATUSES: {
6
+ readonly Failed: "FAILED";
7
+ readonly Finished: "FINISHED";
8
+ readonly Initialized: "INITIALIZED";
9
+ readonly Invalid: "INVALID";
10
+ readonly NotSupported: "NOT_SUPPORTED";
11
+ readonly PartialSuccess: "PARTIAL_SUCCESS";
12
+ readonly Running: "RUNNING";
13
+ readonly Unknown: "UNKNOWN";
14
+ };
15
+ /**
16
+ * Type union for data deletion status values.
17
+ */
18
+ export type DataDeleteStatus = (typeof DATA_DELETE_STATUSES)[keyof typeof DATA_DELETE_STATUSES];
19
+ /**
20
+ * Response status for deletion regulation operations.
21
+ */
22
+ export declare const DATA_DELETE_RESPONSE_STATUSES: {
23
+ readonly Success: "ok";
24
+ readonly Failure: "error";
25
+ };
26
+ /**
27
+ * Type union for data deletion response status values.
28
+ */
29
+ export type DataDeleteResponseStatus = (typeof DATA_DELETE_RESPONSE_STATUSES)[keyof typeof DATA_DELETE_RESPONSE_STATUSES];
30
+ /**
31
+ * Response from creating a data deletion task.
32
+ * The service throws errors on failure, so this type only represents the Success case.
33
+ */
34
+ export type DeleteRegulationResponse = {
35
+ status: typeof DATA_DELETE_RESPONSE_STATUSES.Success;
36
+ regulateId: string;
37
+ };
38
+ /**
39
+ * Status information for a data deletion request.
40
+ */
41
+ export type DeleteRegulationStatus = {
42
+ deletionRequestTimestamp?: number;
43
+ hasCollectedDataSinceDeletionRequest: boolean;
44
+ dataDeletionRequestStatus: DataDeleteStatus;
45
+ };
46
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;CASvB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;CAGhC,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,OAAO,6BAA6B,CAAC,CAAC;AAErF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,OAAO,6BAA6B,CAAC,OAAO,CAAC;IACrD,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,oCAAoC,EAAE,OAAO,CAAC;IAC9C,yBAAyB,EAAE,gBAAgB,CAAC;CAC7C,CAAC"}
package/dist/types.mjs ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Status values for data deletion requests from Segment API.
3
+ * Values match Segment API response values exactly.
4
+ */
5
+ export const DATA_DELETE_STATUSES = {
6
+ Failed: 'FAILED',
7
+ Finished: 'FINISHED',
8
+ Initialized: 'INITIALIZED',
9
+ Invalid: 'INVALID',
10
+ NotSupported: 'NOT_SUPPORTED',
11
+ PartialSuccess: 'PARTIAL_SUCCESS',
12
+ Running: 'RUNNING',
13
+ Unknown: 'UNKNOWN',
14
+ };
15
+ /**
16
+ * Response status for deletion regulation operations.
17
+ */
18
+ export const DATA_DELETE_RESPONSE_STATUSES = {
19
+ Success: 'ok',
20
+ Failure: 'error',
21
+ };
22
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,eAAe;IAC7B,cAAc,EAAE,iBAAiB;IACjC,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACV,CAAC;AAQX;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,OAAO;CACR,CAAC","sourcesContent":["/**\n * Status values for data deletion requests from Segment API.\n * Values match Segment API response values exactly.\n */\nexport const DATA_DELETE_STATUSES = {\n Failed: 'FAILED',\n Finished: 'FINISHED',\n Initialized: 'INITIALIZED',\n Invalid: 'INVALID',\n NotSupported: 'NOT_SUPPORTED',\n PartialSuccess: 'PARTIAL_SUCCESS',\n Running: 'RUNNING',\n Unknown: 'UNKNOWN',\n} as const;\n\n/**\n * Type union for data deletion status values.\n */\nexport type DataDeleteStatus =\n (typeof DATA_DELETE_STATUSES)[keyof typeof DATA_DELETE_STATUSES];\n\n/**\n * Response status for deletion regulation operations.\n */\nexport const DATA_DELETE_RESPONSE_STATUSES = {\n Success: 'ok',\n Failure: 'error',\n} as const;\n\n/**\n * Type union for data deletion response status values.\n */\nexport type DataDeleteResponseStatus =\n (typeof DATA_DELETE_RESPONSE_STATUSES)[keyof typeof DATA_DELETE_RESPONSE_STATUSES];\n\n/**\n * Response from creating a data deletion task.\n * The service throws errors on failure, so this type only represents the Success case.\n */\nexport type DeleteRegulationResponse = {\n status: typeof DATA_DELETE_RESPONSE_STATUSES.Success;\n regulateId: string; // Using exact API field name from Segment API response\n};\n\n/**\n * Status information for a data deletion request.\n */\nexport type DeleteRegulationStatus = {\n deletionRequestTimestamp?: number;\n hasCollectedDataSinceDeletionRequest: boolean;\n dataDeletionRequestStatus: DataDeleteStatus;\n};\n"]}
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@metamask-previews/analytics-data-regulation-controller",
3
+ "version": "0.0.0-preview-52f4a2ca",
4
+ "description": "Controller for managing analytics privacy and GDPR/CCPA data deletion functionality",
5
+ "keywords": [
6
+ "MetaMask",
7
+ "Ethereum"
8
+ ],
9
+ "homepage": "https://github.com/MetaMask/core/tree/main/packages/analytics-data-regulation-controller#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/MetaMask/core/issues"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/MetaMask/core.git"
16
+ },
17
+ "license": "MIT",
18
+ "sideEffects": false,
19
+ "exports": {
20
+ ".": {
21
+ "import": {
22
+ "types": "./dist/index.d.mts",
23
+ "default": "./dist/index.mjs"
24
+ },
25
+ "require": {
26
+ "types": "./dist/index.d.cts",
27
+ "default": "./dist/index.cjs"
28
+ }
29
+ },
30
+ "./package.json": "./package.json"
31
+ },
32
+ "main": "./dist/index.cjs",
33
+ "types": "./dist/index.d.cts",
34
+ "files": [
35
+ "dist/"
36
+ ],
37
+ "scripts": {
38
+ "build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
39
+ "build:all": "ts-bridge --project tsconfig.build.json --verbose --clean",
40
+ "build:docs": "typedoc",
41
+ "changelog:update": "../../scripts/update-changelog.sh @metamask/analytics-data-regulation-controller",
42
+ "changelog:validate": "../../scripts/validate-changelog.sh @metamask/analytics-data-regulation-controller",
43
+ "publish:preview": "yarn npm publish --tag preview",
44
+ "since-latest-release": "../../scripts/since-latest-release.sh",
45
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
46
+ "test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
47
+ "test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
48
+ "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
49
+ },
50
+ "dependencies": {
51
+ "@metamask/base-controller": "^9.0.0",
52
+ "@metamask/controller-utils": "^11.18.0",
53
+ "@metamask/messenger": "^0.3.0",
54
+ "@metamask/utils": "^11.9.0"
55
+ },
56
+ "devDependencies": {
57
+ "@metamask/auto-changelog": "^3.4.4",
58
+ "@ts-bridge/cli": "^0.6.4",
59
+ "@types/jest": "^27.4.1",
60
+ "deepmerge": "^4.2.2",
61
+ "jest": "^27.5.1",
62
+ "nock": "^13.3.1",
63
+ "sinon": "^9.2.4",
64
+ "ts-jest": "^27.1.4",
65
+ "typedoc": "^0.24.8",
66
+ "typedoc-plugin-missing-exports": "^2.0.0",
67
+ "typescript": "~5.3.3"
68
+ },
69
+ "engines": {
70
+ "node": "^18.18 || >=20"
71
+ },
72
+ "publishConfig": {
73
+ "access": "public",
74
+ "registry": "https://registry.npmjs.org/"
75
+ }
76
+ }