@metamask-previews/analytics-privacy-controller 0.0.0-preview-fa81dffb
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 +10 -0
- package/LICENSE +20 -0
- package/README.md +15 -0
- package/dist/AnalyticsPrivacyController-method-action-types.cjs +7 -0
- package/dist/AnalyticsPrivacyController-method-action-types.cjs.map +1 -0
- package/dist/AnalyticsPrivacyController-method-action-types.d.cts +67 -0
- package/dist/AnalyticsPrivacyController-method-action-types.d.cts.map +1 -0
- package/dist/AnalyticsPrivacyController-method-action-types.d.mts +67 -0
- package/dist/AnalyticsPrivacyController-method-action-types.d.mts.map +1 -0
- package/dist/AnalyticsPrivacyController-method-action-types.mjs +6 -0
- package/dist/AnalyticsPrivacyController-method-action-types.mjs.map +1 -0
- package/dist/AnalyticsPrivacyController.cjs +207 -0
- package/dist/AnalyticsPrivacyController.cjs.map +1 -0
- package/dist/AnalyticsPrivacyController.d.cts +152 -0
- package/dist/AnalyticsPrivacyController.d.cts.map +1 -0
- package/dist/AnalyticsPrivacyController.d.mts +152 -0
- package/dist/AnalyticsPrivacyController.d.mts.map +1 -0
- package/dist/AnalyticsPrivacyController.mjs +202 -0
- package/dist/AnalyticsPrivacyController.mjs.map +1 -0
- package/dist/AnalyticsPrivacyLogger.cjs +8 -0
- package/dist/AnalyticsPrivacyLogger.cjs.map +1 -0
- package/dist/AnalyticsPrivacyLogger.d.cts +5 -0
- package/dist/AnalyticsPrivacyLogger.d.cts.map +1 -0
- package/dist/AnalyticsPrivacyLogger.d.mts +5 -0
- package/dist/AnalyticsPrivacyLogger.d.mts.map +1 -0
- package/dist/AnalyticsPrivacyLogger.mjs +5 -0
- package/dist/AnalyticsPrivacyLogger.mjs.map +1 -0
- package/dist/AnalyticsPrivacyService-method-action-types.cjs +7 -0
- package/dist/AnalyticsPrivacyService-method-action-types.cjs.map +1 -0
- package/dist/AnalyticsPrivacyService-method-action-types.d.cts +30 -0
- package/dist/AnalyticsPrivacyService-method-action-types.d.cts.map +1 -0
- package/dist/AnalyticsPrivacyService-method-action-types.d.mts +30 -0
- package/dist/AnalyticsPrivacyService-method-action-types.d.mts.map +1 -0
- package/dist/AnalyticsPrivacyService-method-action-types.mjs +6 -0
- package/dist/AnalyticsPrivacyService-method-action-types.mjs.map +1 -0
- package/dist/AnalyticsPrivacyService.cjs +252 -0
- package/dist/AnalyticsPrivacyService.cjs.map +1 -0
- package/dist/AnalyticsPrivacyService.d.cts +160 -0
- package/dist/AnalyticsPrivacyService.d.cts.map +1 -0
- package/dist/AnalyticsPrivacyService.d.mts +160 -0
- package/dist/AnalyticsPrivacyService.d.mts.map +1 -0
- package/dist/AnalyticsPrivacyService.mjs +248 -0
- package/dist/AnalyticsPrivacyService.mjs.map +1 -0
- package/dist/constants.cjs +19 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +16 -0
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.mts +16 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +16 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/index.cjs +14 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -0
- package/dist/selectors.cjs +34 -0
- package/dist/selectors.cjs.map +1 -0
- package/dist/selectors.d.cts +11 -0
- package/dist/selectors.d.cts.map +1 -0
- package/dist/selectors.d.mts +11 -0
- package/dist/selectors.d.mts.map +1 -0
- package/dist/selectors.mjs +31 -0
- package/dist/selectors.mjs.map +1 -0
- package/dist/types.cjs +27 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +53 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +53 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +24 -0
- package/dist/types.mjs.map +1 -0
- package/package.json +77 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
[Unreleased]: https://github.com/MetaMask/core/
|
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MetaMask
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# `@metamask/analytics-privacy-controller`
|
|
2
|
+
|
|
3
|
+
Controller for managing analytics privacy and GDPR/CCPA data deletion functionality
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
`yarn add @metamask/analytics-privacy-controller`
|
|
8
|
+
|
|
9
|
+
or
|
|
10
|
+
|
|
11
|
+
`npm install @metamask/analytics-privacy-controller`
|
|
12
|
+
|
|
13
|
+
## Contributing
|
|
14
|
+
|
|
15
|
+
This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/core#readme).
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file is auto generated by `scripts/generate-method-action-types.ts`.
|
|
4
|
+
* Do not edit manually.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
//# sourceMappingURL=AnalyticsPrivacyController-method-action-types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsPrivacyController-method-action-types.cjs","sourceRoot":"","sources":["../src/AnalyticsPrivacyController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { AnalyticsPrivacyController } from './AnalyticsPrivacyController';\n\n/**\n * Creates a new delete regulation for the user.\n * This is necessary to respect the GDPR and CCPA regulations.\n *\n * @returns Promise containing the status of the request\n */\nexport type AnalyticsPrivacyControllerCreateDataDeletionTaskAction = {\n type: `AnalyticsPrivacyController:createDataDeletionTask`;\n handler: AnalyticsPrivacyController['createDataDeletionTask'];\n};\n\n/**\n * Check the latest delete regulation status.\n *\n * @returns Promise containing the timestamp, delete status and collected data flag\n */\nexport type AnalyticsPrivacyControllerCheckDataDeleteStatusAction = {\n type: `AnalyticsPrivacyController:checkDataDeleteStatus`;\n handler: AnalyticsPrivacyController['checkDataDeleteStatus'];\n};\n\n/**\n * Get the latest delete regulation request timestamp.\n *\n * @returns The timestamp (in milliseconds since epoch), or undefined\n */\nexport type AnalyticsPrivacyControllerGetDeleteRegulationCreationTimestampAction =\n {\n type: `AnalyticsPrivacyController:getDeleteRegulationCreationTimestamp`;\n handler: AnalyticsPrivacyController['getDeleteRegulationCreationTimestamp'];\n };\n\n/**\n * Get the latest delete regulation request id.\n *\n * @returns The id string, or undefined\n */\nexport type AnalyticsPrivacyControllerGetDeleteRegulationIdAction = {\n type: `AnalyticsPrivacyController:getDeleteRegulationId`;\n handler: AnalyticsPrivacyController['getDeleteRegulationId'];\n};\n\n/**\n * Indicate if events have been recorded since the last deletion request.\n *\n * @returns true if events have been recorded since the last deletion request\n */\nexport type AnalyticsPrivacyControllerIsDataRecordedAction = {\n type: `AnalyticsPrivacyController:isDataRecorded`;\n handler: AnalyticsPrivacyController['isDataRecorded'];\n};\n\n/**\n * Update the data recording flag if needed.\n * This method should be called after tracking events to ensure\n * the data recording flag is properly updated for data deletion workflows.\n *\n * @param saveDataRecording - Whether to save the data recording flag (default: true)\n */\nexport type AnalyticsPrivacyControllerUpdateDataRecordingFlagAction = {\n type: `AnalyticsPrivacyController:updateDataRecordingFlag`;\n handler: AnalyticsPrivacyController['updateDataRecordingFlag'];\n};\n\n/**\n * Union of all AnalyticsPrivacyController action types.\n */\nexport type AnalyticsPrivacyControllerMethodActions =\n | AnalyticsPrivacyControllerCreateDataDeletionTaskAction\n | AnalyticsPrivacyControllerCheckDataDeleteStatusAction\n | AnalyticsPrivacyControllerGetDeleteRegulationCreationTimestampAction\n | AnalyticsPrivacyControllerGetDeleteRegulationIdAction\n | AnalyticsPrivacyControllerIsDataRecordedAction\n | AnalyticsPrivacyControllerUpdateDataRecordingFlagAction;\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated by `scripts/generate-method-action-types.ts`.
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
*/
|
|
5
|
+
import type { AnalyticsPrivacyController } from "./AnalyticsPrivacyController.cjs";
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new delete regulation for the user.
|
|
8
|
+
* This is necessary to respect the GDPR and CCPA regulations.
|
|
9
|
+
*
|
|
10
|
+
* @returns Promise containing the status of the request
|
|
11
|
+
*/
|
|
12
|
+
export type AnalyticsPrivacyControllerCreateDataDeletionTaskAction = {
|
|
13
|
+
type: `AnalyticsPrivacyController:createDataDeletionTask`;
|
|
14
|
+
handler: AnalyticsPrivacyController['createDataDeletionTask'];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Check the latest delete regulation status.
|
|
18
|
+
*
|
|
19
|
+
* @returns Promise containing the timestamp, delete status and collected data flag
|
|
20
|
+
*/
|
|
21
|
+
export type AnalyticsPrivacyControllerCheckDataDeleteStatusAction = {
|
|
22
|
+
type: `AnalyticsPrivacyController:checkDataDeleteStatus`;
|
|
23
|
+
handler: AnalyticsPrivacyController['checkDataDeleteStatus'];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Get the latest delete regulation request timestamp.
|
|
27
|
+
*
|
|
28
|
+
* @returns The timestamp (in milliseconds since epoch), or undefined
|
|
29
|
+
*/
|
|
30
|
+
export type AnalyticsPrivacyControllerGetDeleteRegulationCreationTimestampAction = {
|
|
31
|
+
type: `AnalyticsPrivacyController:getDeleteRegulationCreationTimestamp`;
|
|
32
|
+
handler: AnalyticsPrivacyController['getDeleteRegulationCreationTimestamp'];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Get the latest delete regulation request id.
|
|
36
|
+
*
|
|
37
|
+
* @returns The id string, or undefined
|
|
38
|
+
*/
|
|
39
|
+
export type AnalyticsPrivacyControllerGetDeleteRegulationIdAction = {
|
|
40
|
+
type: `AnalyticsPrivacyController:getDeleteRegulationId`;
|
|
41
|
+
handler: AnalyticsPrivacyController['getDeleteRegulationId'];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Indicate if events have been recorded since the last deletion request.
|
|
45
|
+
*
|
|
46
|
+
* @returns true if events have been recorded since the last deletion request
|
|
47
|
+
*/
|
|
48
|
+
export type AnalyticsPrivacyControllerIsDataRecordedAction = {
|
|
49
|
+
type: `AnalyticsPrivacyController:isDataRecorded`;
|
|
50
|
+
handler: AnalyticsPrivacyController['isDataRecorded'];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Update the data recording flag if needed.
|
|
54
|
+
* This method should be called after tracking events to ensure
|
|
55
|
+
* the data recording flag is properly updated for data deletion workflows.
|
|
56
|
+
*
|
|
57
|
+
* @param saveDataRecording - Whether to save the data recording flag (default: true)
|
|
58
|
+
*/
|
|
59
|
+
export type AnalyticsPrivacyControllerUpdateDataRecordingFlagAction = {
|
|
60
|
+
type: `AnalyticsPrivacyController:updateDataRecordingFlag`;
|
|
61
|
+
handler: AnalyticsPrivacyController['updateDataRecordingFlag'];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Union of all AnalyticsPrivacyController action types.
|
|
65
|
+
*/
|
|
66
|
+
export type AnalyticsPrivacyControllerMethodActions = AnalyticsPrivacyControllerCreateDataDeletionTaskAction | AnalyticsPrivacyControllerCheckDataDeleteStatusAction | AnalyticsPrivacyControllerGetDeleteRegulationCreationTimestampAction | AnalyticsPrivacyControllerGetDeleteRegulationIdAction | AnalyticsPrivacyControllerIsDataRecordedAction | AnalyticsPrivacyControllerUpdateDataRecordingFlagAction;
|
|
67
|
+
//# sourceMappingURL=AnalyticsPrivacyController-method-action-types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsPrivacyController-method-action-types.d.cts","sourceRoot":"","sources":["../src/AnalyticsPrivacyController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,yCAAqC;AAE/E;;;;;GAKG;AACH,MAAM,MAAM,sDAAsD,GAAG;IACnE,IAAI,EAAE,mDAAmD,CAAC;IAC1D,OAAO,EAAE,0BAA0B,CAAC,wBAAwB,CAAC,CAAC;CAC/D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qDAAqD,GAAG;IAClE,IAAI,EAAE,kDAAkD,CAAC;IACzD,OAAO,EAAE,0BAA0B,CAAC,uBAAuB,CAAC,CAAC;CAC9D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,oEAAoE,GAC9E;IACE,IAAI,EAAE,iEAAiE,CAAC;IACxE,OAAO,EAAE,0BAA0B,CAAC,sCAAsC,CAAC,CAAC;CAC7E,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,qDAAqD,GAAG;IAClE,IAAI,EAAE,kDAAkD,CAAC;IACzD,OAAO,EAAE,0BAA0B,CAAC,uBAAuB,CAAC,CAAC;CAC9D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,uDAAuD,GAAG;IACpE,IAAI,EAAE,oDAAoD,CAAC;IAC3D,OAAO,EAAE,0BAA0B,CAAC,yBAAyB,CAAC,CAAC;CAChE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uCAAuC,GAC/C,sDAAsD,GACtD,qDAAqD,GACrD,oEAAoE,GACpE,qDAAqD,GACrD,8CAA8C,GAC9C,uDAAuD,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated by `scripts/generate-method-action-types.ts`.
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
*/
|
|
5
|
+
import type { AnalyticsPrivacyController } from "./AnalyticsPrivacyController.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new delete regulation for the user.
|
|
8
|
+
* This is necessary to respect the GDPR and CCPA regulations.
|
|
9
|
+
*
|
|
10
|
+
* @returns Promise containing the status of the request
|
|
11
|
+
*/
|
|
12
|
+
export type AnalyticsPrivacyControllerCreateDataDeletionTaskAction = {
|
|
13
|
+
type: `AnalyticsPrivacyController:createDataDeletionTask`;
|
|
14
|
+
handler: AnalyticsPrivacyController['createDataDeletionTask'];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Check the latest delete regulation status.
|
|
18
|
+
*
|
|
19
|
+
* @returns Promise containing the timestamp, delete status and collected data flag
|
|
20
|
+
*/
|
|
21
|
+
export type AnalyticsPrivacyControllerCheckDataDeleteStatusAction = {
|
|
22
|
+
type: `AnalyticsPrivacyController:checkDataDeleteStatus`;
|
|
23
|
+
handler: AnalyticsPrivacyController['checkDataDeleteStatus'];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Get the latest delete regulation request timestamp.
|
|
27
|
+
*
|
|
28
|
+
* @returns The timestamp (in milliseconds since epoch), or undefined
|
|
29
|
+
*/
|
|
30
|
+
export type AnalyticsPrivacyControllerGetDeleteRegulationCreationTimestampAction = {
|
|
31
|
+
type: `AnalyticsPrivacyController:getDeleteRegulationCreationTimestamp`;
|
|
32
|
+
handler: AnalyticsPrivacyController['getDeleteRegulationCreationTimestamp'];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Get the latest delete regulation request id.
|
|
36
|
+
*
|
|
37
|
+
* @returns The id string, or undefined
|
|
38
|
+
*/
|
|
39
|
+
export type AnalyticsPrivacyControllerGetDeleteRegulationIdAction = {
|
|
40
|
+
type: `AnalyticsPrivacyController:getDeleteRegulationId`;
|
|
41
|
+
handler: AnalyticsPrivacyController['getDeleteRegulationId'];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Indicate if events have been recorded since the last deletion request.
|
|
45
|
+
*
|
|
46
|
+
* @returns true if events have been recorded since the last deletion request
|
|
47
|
+
*/
|
|
48
|
+
export type AnalyticsPrivacyControllerIsDataRecordedAction = {
|
|
49
|
+
type: `AnalyticsPrivacyController:isDataRecorded`;
|
|
50
|
+
handler: AnalyticsPrivacyController['isDataRecorded'];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Update the data recording flag if needed.
|
|
54
|
+
* This method should be called after tracking events to ensure
|
|
55
|
+
* the data recording flag is properly updated for data deletion workflows.
|
|
56
|
+
*
|
|
57
|
+
* @param saveDataRecording - Whether to save the data recording flag (default: true)
|
|
58
|
+
*/
|
|
59
|
+
export type AnalyticsPrivacyControllerUpdateDataRecordingFlagAction = {
|
|
60
|
+
type: `AnalyticsPrivacyController:updateDataRecordingFlag`;
|
|
61
|
+
handler: AnalyticsPrivacyController['updateDataRecordingFlag'];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Union of all AnalyticsPrivacyController action types.
|
|
65
|
+
*/
|
|
66
|
+
export type AnalyticsPrivacyControllerMethodActions = AnalyticsPrivacyControllerCreateDataDeletionTaskAction | AnalyticsPrivacyControllerCheckDataDeleteStatusAction | AnalyticsPrivacyControllerGetDeleteRegulationCreationTimestampAction | AnalyticsPrivacyControllerGetDeleteRegulationIdAction | AnalyticsPrivacyControllerIsDataRecordedAction | AnalyticsPrivacyControllerUpdateDataRecordingFlagAction;
|
|
67
|
+
//# sourceMappingURL=AnalyticsPrivacyController-method-action-types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsPrivacyController-method-action-types.d.mts","sourceRoot":"","sources":["../src/AnalyticsPrivacyController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,yCAAqC;AAE/E;;;;;GAKG;AACH,MAAM,MAAM,sDAAsD,GAAG;IACnE,IAAI,EAAE,mDAAmD,CAAC;IAC1D,OAAO,EAAE,0BAA0B,CAAC,wBAAwB,CAAC,CAAC;CAC/D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qDAAqD,GAAG;IAClE,IAAI,EAAE,kDAAkD,CAAC;IACzD,OAAO,EAAE,0BAA0B,CAAC,uBAAuB,CAAC,CAAC;CAC9D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,oEAAoE,GAC9E;IACE,IAAI,EAAE,iEAAiE,CAAC;IACxE,OAAO,EAAE,0BAA0B,CAAC,sCAAsC,CAAC,CAAC;CAC7E,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,qDAAqD,GAAG;IAClE,IAAI,EAAE,kDAAkD,CAAC;IACzD,OAAO,EAAE,0BAA0B,CAAC,uBAAuB,CAAC,CAAC;CAC9D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,uDAAuD,GAAG;IACpE,IAAI,EAAE,oDAAoD,CAAC;IAC3D,OAAO,EAAE,0BAA0B,CAAC,yBAAyB,CAAC,CAAC;CAChE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uCAAuC,GAC/C,sDAAsD,GACtD,qDAAqD,GACrD,oEAAoE,GACpE,qDAAqD,GACrD,8CAA8C,GAC9C,uDAAuD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsPrivacyController-method-action-types.mjs","sourceRoot":"","sources":["../src/AnalyticsPrivacyController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { AnalyticsPrivacyController } from './AnalyticsPrivacyController';\n\n/**\n * Creates a new delete regulation for the user.\n * This is necessary to respect the GDPR and CCPA regulations.\n *\n * @returns Promise containing the status of the request\n */\nexport type AnalyticsPrivacyControllerCreateDataDeletionTaskAction = {\n type: `AnalyticsPrivacyController:createDataDeletionTask`;\n handler: AnalyticsPrivacyController['createDataDeletionTask'];\n};\n\n/**\n * Check the latest delete regulation status.\n *\n * @returns Promise containing the timestamp, delete status and collected data flag\n */\nexport type AnalyticsPrivacyControllerCheckDataDeleteStatusAction = {\n type: `AnalyticsPrivacyController:checkDataDeleteStatus`;\n handler: AnalyticsPrivacyController['checkDataDeleteStatus'];\n};\n\n/**\n * Get the latest delete regulation request timestamp.\n *\n * @returns The timestamp (in milliseconds since epoch), or undefined\n */\nexport type AnalyticsPrivacyControllerGetDeleteRegulationCreationTimestampAction =\n {\n type: `AnalyticsPrivacyController:getDeleteRegulationCreationTimestamp`;\n handler: AnalyticsPrivacyController['getDeleteRegulationCreationTimestamp'];\n };\n\n/**\n * Get the latest delete regulation request id.\n *\n * @returns The id string, or undefined\n */\nexport type AnalyticsPrivacyControllerGetDeleteRegulationIdAction = {\n type: `AnalyticsPrivacyController:getDeleteRegulationId`;\n handler: AnalyticsPrivacyController['getDeleteRegulationId'];\n};\n\n/**\n * Indicate if events have been recorded since the last deletion request.\n *\n * @returns true if events have been recorded since the last deletion request\n */\nexport type AnalyticsPrivacyControllerIsDataRecordedAction = {\n type: `AnalyticsPrivacyController:isDataRecorded`;\n handler: AnalyticsPrivacyController['isDataRecorded'];\n};\n\n/**\n * Update the data recording flag if needed.\n * This method should be called after tracking events to ensure\n * the data recording flag is properly updated for data deletion workflows.\n *\n * @param saveDataRecording - Whether to save the data recording flag (default: true)\n */\nexport type AnalyticsPrivacyControllerUpdateDataRecordingFlagAction = {\n type: `AnalyticsPrivacyController:updateDataRecordingFlag`;\n handler: AnalyticsPrivacyController['updateDataRecordingFlag'];\n};\n\n/**\n * Union of all AnalyticsPrivacyController action types.\n */\nexport type AnalyticsPrivacyControllerMethodActions =\n | AnalyticsPrivacyControllerCreateDataDeletionTaskAction\n | AnalyticsPrivacyControllerCheckDataDeleteStatusAction\n | AnalyticsPrivacyControllerGetDeleteRegulationCreationTimestampAction\n | AnalyticsPrivacyControllerGetDeleteRegulationIdAction\n | AnalyticsPrivacyControllerIsDataRecordedAction\n | AnalyticsPrivacyControllerUpdateDataRecordingFlagAction;\n"]}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnalyticsPrivacyController = exports.getDefaultAnalyticsPrivacyControllerState = exports.controllerName = void 0;
|
|
4
|
+
const base_controller_1 = require("@metamask/base-controller");
|
|
5
|
+
const AnalyticsPrivacyLogger_1 = require("./AnalyticsPrivacyLogger.cjs");
|
|
6
|
+
const types_1 = require("./types.cjs");
|
|
7
|
+
// === GENERAL ===
|
|
8
|
+
/**
|
|
9
|
+
* The name of the {@link AnalyticsPrivacyController}, used to namespace the
|
|
10
|
+
* controller's actions and events and to namespace the controller's state data
|
|
11
|
+
* when composed with other controllers.
|
|
12
|
+
*/
|
|
13
|
+
exports.controllerName = 'AnalyticsPrivacyController';
|
|
14
|
+
/**
|
|
15
|
+
* Returns default values for AnalyticsPrivacyController state.
|
|
16
|
+
*
|
|
17
|
+
* @returns Default state
|
|
18
|
+
*/
|
|
19
|
+
function getDefaultAnalyticsPrivacyControllerState() {
|
|
20
|
+
return {
|
|
21
|
+
dataRecorded: false,
|
|
22
|
+
deleteRegulationId: null,
|
|
23
|
+
deleteRegulationTimestamp: null,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.getDefaultAnalyticsPrivacyControllerState = getDefaultAnalyticsPrivacyControllerState;
|
|
27
|
+
/**
|
|
28
|
+
* The metadata for each property in {@link AnalyticsPrivacyControllerState}.
|
|
29
|
+
*/
|
|
30
|
+
const analyticsPrivacyControllerMetadata = {
|
|
31
|
+
dataRecorded: {
|
|
32
|
+
includeInStateLogs: true,
|
|
33
|
+
persist: true,
|
|
34
|
+
includeInDebugSnapshot: true,
|
|
35
|
+
usedInUi: true,
|
|
36
|
+
},
|
|
37
|
+
deleteRegulationId: {
|
|
38
|
+
includeInStateLogs: true,
|
|
39
|
+
persist: true,
|
|
40
|
+
includeInDebugSnapshot: true,
|
|
41
|
+
usedInUi: true,
|
|
42
|
+
},
|
|
43
|
+
deleteRegulationTimestamp: {
|
|
44
|
+
includeInStateLogs: true,
|
|
45
|
+
persist: true,
|
|
46
|
+
includeInDebugSnapshot: true,
|
|
47
|
+
usedInUi: true,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
// === MESSENGER ===
|
|
51
|
+
const MESSENGER_EXPOSED_METHODS = [
|
|
52
|
+
'createDataDeletionTask',
|
|
53
|
+
'checkDataDeleteStatus',
|
|
54
|
+
'getDeleteRegulationCreationTimestamp',
|
|
55
|
+
'getDeleteRegulationId',
|
|
56
|
+
'isDataRecorded',
|
|
57
|
+
'updateDataRecordingFlag',
|
|
58
|
+
];
|
|
59
|
+
/**
|
|
60
|
+
* The AnalyticsPrivacyController manages analytics privacy and GDPR/CCPA data deletion functionality.
|
|
61
|
+
* It communicates with Segment's Regulations API via a proxy to create and monitor data deletion requests.
|
|
62
|
+
*
|
|
63
|
+
* This controller follows the MetaMask controller pattern and integrates with the
|
|
64
|
+
* messenger system to allow other controllers and components to manage data deletion tasks.
|
|
65
|
+
*/
|
|
66
|
+
class AnalyticsPrivacyController extends base_controller_1.BaseController {
|
|
67
|
+
/**
|
|
68
|
+
* Constructs an AnalyticsPrivacyController instance.
|
|
69
|
+
*
|
|
70
|
+
* @param options - Controller options
|
|
71
|
+
* @param options.state - Initial controller state. Use `getDefaultAnalyticsPrivacyControllerState()` for defaults.
|
|
72
|
+
* @param options.messenger - Messenger used to communicate with BaseController
|
|
73
|
+
*/
|
|
74
|
+
constructor({ state = {}, messenger }) {
|
|
75
|
+
const initialState = {
|
|
76
|
+
...getDefaultAnalyticsPrivacyControllerState(),
|
|
77
|
+
...state,
|
|
78
|
+
};
|
|
79
|
+
super({
|
|
80
|
+
name: exports.controllerName,
|
|
81
|
+
metadata: analyticsPrivacyControllerMetadata,
|
|
82
|
+
state: initialState,
|
|
83
|
+
messenger,
|
|
84
|
+
});
|
|
85
|
+
this.messenger.registerMethodActionHandlers(this, MESSENGER_EXPOSED_METHODS);
|
|
86
|
+
(0, AnalyticsPrivacyLogger_1.projectLogger)('AnalyticsPrivacyController initialized', {
|
|
87
|
+
dataRecorded: this.state.dataRecorded,
|
|
88
|
+
hasDeleteRegulationId: Boolean(this.state.deleteRegulationId),
|
|
89
|
+
deleteRegulationTimestamp: this.state.deleteRegulationTimestamp,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Creates a new delete regulation for the user.
|
|
94
|
+
* This is necessary to respect the GDPR and CCPA regulations.
|
|
95
|
+
*
|
|
96
|
+
* @returns Promise containing the status of the request
|
|
97
|
+
*/
|
|
98
|
+
async createDataDeletionTask() {
|
|
99
|
+
try {
|
|
100
|
+
const analyticsControllerState = this.messenger.call('AnalyticsController:getState');
|
|
101
|
+
const { analyticsId } = analyticsControllerState;
|
|
102
|
+
if (!analyticsId || analyticsId.trim() === '') {
|
|
103
|
+
const error = new Error('Analytics ID not found');
|
|
104
|
+
(0, AnalyticsPrivacyLogger_1.projectLogger)('Analytics Deletion Task Error', error);
|
|
105
|
+
return {
|
|
106
|
+
status: types_1.DataDeleteResponseStatus.Failure,
|
|
107
|
+
error: 'Analytics ID not found',
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
const response = await this.messenger.call('AnalyticsPrivacyService:createDataDeletionTask', analyticsId);
|
|
111
|
+
if (response.status === types_1.DataDeleteResponseStatus.Success &&
|
|
112
|
+
response.regulateId &&
|
|
113
|
+
typeof response.regulateId === 'string' &&
|
|
114
|
+
response.regulateId.trim() !== '') {
|
|
115
|
+
const deletionTimestamp = Date.now();
|
|
116
|
+
// Already validated as non-empty string above
|
|
117
|
+
const { regulateId } = response;
|
|
118
|
+
this.update((state) => {
|
|
119
|
+
state.deleteRegulationId = regulateId;
|
|
120
|
+
state.deleteRegulationTimestamp = deletionTimestamp;
|
|
121
|
+
state.dataRecorded = false;
|
|
122
|
+
});
|
|
123
|
+
this.messenger.publish(`${exports.controllerName}:dataDeletionTaskCreated`, response);
|
|
124
|
+
}
|
|
125
|
+
return response;
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
(0, AnalyticsPrivacyLogger_1.projectLogger)('Analytics Deletion Task Error', error);
|
|
129
|
+
const errorMessage = error instanceof Error
|
|
130
|
+
? error.message
|
|
131
|
+
: 'Analytics Deletion Task Error';
|
|
132
|
+
return {
|
|
133
|
+
status: types_1.DataDeleteResponseStatus.Failure,
|
|
134
|
+
error: errorMessage,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Check the latest delete regulation status.
|
|
140
|
+
*
|
|
141
|
+
* @returns Promise containing the timestamp, delete status and collected data flag
|
|
142
|
+
*/
|
|
143
|
+
async checkDataDeleteStatus() {
|
|
144
|
+
const status = {
|
|
145
|
+
deletionRequestTimestamp: undefined,
|
|
146
|
+
dataDeletionRequestStatus: types_1.DataDeleteStatus.Unknown,
|
|
147
|
+
hasCollectedDataSinceDeletionRequest: false,
|
|
148
|
+
};
|
|
149
|
+
if (!this.state.deleteRegulationId) {
|
|
150
|
+
return status;
|
|
151
|
+
}
|
|
152
|
+
try {
|
|
153
|
+
const dataDeletionTaskStatus = await this.messenger.call('AnalyticsPrivacyService:checkDataDeleteStatus', this.state.deleteRegulationId);
|
|
154
|
+
status.dataDeletionRequestStatus =
|
|
155
|
+
dataDeletionTaskStatus.dataDeleteStatus;
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
(0, AnalyticsPrivacyLogger_1.projectLogger)('Error checkDataDeleteStatus', error);
|
|
159
|
+
status.dataDeletionRequestStatus = types_1.DataDeleteStatus.Unknown;
|
|
160
|
+
}
|
|
161
|
+
status.deletionRequestTimestamp =
|
|
162
|
+
this.state.deleteRegulationTimestamp ?? undefined;
|
|
163
|
+
status.hasCollectedDataSinceDeletionRequest = this.state.dataRecorded;
|
|
164
|
+
return status;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get the latest delete regulation request timestamp.
|
|
168
|
+
*
|
|
169
|
+
* @returns The timestamp (in milliseconds since epoch), or undefined
|
|
170
|
+
*/
|
|
171
|
+
getDeleteRegulationCreationTimestamp() {
|
|
172
|
+
return this.state.deleteRegulationTimestamp ?? undefined;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Get the latest delete regulation request id.
|
|
176
|
+
*
|
|
177
|
+
* @returns The id string, or undefined
|
|
178
|
+
*/
|
|
179
|
+
getDeleteRegulationId() {
|
|
180
|
+
return this.state.deleteRegulationId ?? undefined;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Indicate if events have been recorded since the last deletion request.
|
|
184
|
+
*
|
|
185
|
+
* @returns true if events have been recorded since the last deletion request
|
|
186
|
+
*/
|
|
187
|
+
isDataRecorded() {
|
|
188
|
+
return this.state.dataRecorded;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Update the data recording flag if needed.
|
|
192
|
+
* This method should be called after tracking events to ensure
|
|
193
|
+
* the data recording flag is properly updated for data deletion workflows.
|
|
194
|
+
*
|
|
195
|
+
* @param saveDataRecording - Whether to save the data recording flag (default: true)
|
|
196
|
+
*/
|
|
197
|
+
updateDataRecordingFlag(saveDataRecording = true) {
|
|
198
|
+
if (saveDataRecording && !this.state.dataRecorded) {
|
|
199
|
+
this.update((state) => {
|
|
200
|
+
state.dataRecorded = true;
|
|
201
|
+
});
|
|
202
|
+
this.messenger.publish(`${exports.controllerName}:dataRecordingFlagUpdated`, true);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
exports.AnalyticsPrivacyController = AnalyticsPrivacyController;
|
|
207
|
+
//# sourceMappingURL=AnalyticsPrivacyController.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsPrivacyController.cjs","sourceRoot":"","sources":["../src/AnalyticsPrivacyController.ts"],"names":[],"mappings":";;;AAMA,+DAA2D;AAI3D,yEAAgE;AAEhE,uCAAqE;AAMrE,kBAAkB;AAElB;;;;GAIG;AACU,QAAA,cAAc,GAAG,4BAA4B,CAAC;AA0B3D;;;;GAIG;AACH,SAAgB,yCAAyC;IACvD,OAAO;QACL,YAAY,EAAE,KAAK;QACnB,kBAAkB,EAAE,IAAI;QACxB,yBAAyB,EAAE,IAAI;KAChC,CAAC;AACJ,CAAC;AAND,8FAMC;AAED;;GAEG;AACH,MAAM,kCAAkC,GAAG;IACzC,YAAY,EAAE;QACZ,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,IAAI;QACb,sBAAsB,EAAE,IAAI;QAC5B,QAAQ,EAAE,IAAI;KACf;IACD,kBAAkB,EAAE;QAClB,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,IAAI;QACb,sBAAsB,EAAE,IAAI;QAC5B,QAAQ,EAAE,IAAI;KACf;IACD,yBAAyB,EAAE;QACzB,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,IAAI;QACb,sBAAsB,EAAE,IAAI;QAC5B,QAAQ,EAAE,IAAI;KACf;CACuD,CAAC;AAE3D,oBAAoB;AAEpB,MAAM,yBAAyB,GAAG;IAChC,wBAAwB;IACxB,uBAAuB;IACvB,sCAAsC;IACtC,uBAAuB;IACvB,gBAAgB;IAChB,yBAAyB;CACjB,CAAC;AAwFX;;;;;;GAMG;AACH,MAAa,0BAA2B,SAAQ,gCAI/C;IACC;;;;;;OAMG;IACH,YAAY,EAAE,KAAK,GAAG,EAAE,EAAE,SAAS,EAAqC;QACtE,MAAM,YAAY,GAAoC;YACpD,GAAG,yCAAyC,EAAE;YAC9C,GAAG,KAAK;SACT,CAAC;QAEF,KAAK,CAAC;YACJ,IAAI,EAAE,sBAAc;YACpB,QAAQ,EAAE,kCAAkC;YAC5C,KAAK,EAAE,YAA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C;YACf,IAAA,sCAAG,EAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;YAC1C,MAAM,CAAC,yBAAyB,GAAG,wBAAgB,CAAC,OAAO,CAAC;QAC9D,CAAC;QAED,MAAM,CAAC,wBAAwB;YAC7B,IAAI,CAAC,KAAK,CAAC,yBAAyB,IAAI,SAAS,CAAC;QACpD,MAAM,CAAC,oCAAoC,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QAEtE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACH,oCAAoC;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,yBAAyB,IAAI,SAAS,CAAC;IAC3D,CAAC;IAED;;;;OAIG;IACH,qBAAqB;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,IAAI,SAAS,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACH,cAAc;QACZ,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;IACjC,CAAC;IAED;;;;;;OAMG;IACH,uBAAuB,CAAC,oBAA6B,IAAI;QACvD,IAAI,iBAAiB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;YAClD,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;gBACpB,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;YAC5B,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,SAAS,CAAC,OAAO,CACpB,GAAG,sBAAc,2BAA2B,EAC5C,IAAI,CACL,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAtLD,gEAsLC","sourcesContent":["import type { AnalyticsControllerGetStateAction } from '@metamask/analytics-controller';\nimport type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n StateMetadata,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\n\nimport type { AnalyticsPrivacyControllerMethodActions } from './AnalyticsPrivacyController-method-action-types';\nimport { projectLogger as log } from './AnalyticsPrivacyLogger';\nimport type { AnalyticsPrivacyServiceActions } from './AnalyticsPrivacyService';\nimport { DataDeleteResponseStatus, DataDeleteStatus } from './types';\nimport type {\n IDeleteRegulationResponse,\n IDeleteRegulationStatus,\n} from './types';\n\n// === GENERAL ===\n\n/**\n * The name of the {@link AnalyticsPrivacyController}, used to namespace the\n * controller's actions and events and to namespace the controller's state data\n * when composed with other controllers.\n */\nexport const controllerName = 'AnalyticsPrivacyController';\n\n// === STATE ===\n\n/**\n * Describes the shape of the state object for {@link AnalyticsPrivacyController}.\n */\nexport type AnalyticsPrivacyControllerState = {\n /**\n * Indicates if data has been recorded since the last deletion request.\n */\n dataRecorded: boolean;\n\n /**\n * Segment's data deletion regulation ID.\n * The ID returned by the Segment delete API which allows checking the status of the deletion request.\n */\n deleteRegulationId: string | null;\n\n /**\n * Segment's data deletion regulation creation timestamp.\n * The timestamp (in milliseconds since epoch) when the deletion request was created.\n */\n deleteRegulationTimestamp: number | null;\n};\n\n/**\n * Returns default values for AnalyticsPrivacyController state.\n *\n * @returns Default state\n */\nexport function getDefaultAnalyticsPrivacyControllerState(): AnalyticsPrivacyControllerState {\n return {\n dataRecorded: false,\n deleteRegulationId: null,\n deleteRegulationTimestamp: null,\n };\n}\n\n/**\n * The metadata for each property in {@link AnalyticsPrivacyControllerState}.\n */\nconst analyticsPrivacyControllerMetadata = {\n dataRecorded: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n deleteRegulationId: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n deleteRegulationTimestamp: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n} satisfies StateMetadata<AnalyticsPrivacyControllerState>;\n\n// === MESSENGER ===\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'createDataDeletionTask',\n 'checkDataDeleteStatus',\n 'getDeleteRegulationCreationTimestamp',\n 'getDeleteRegulationId',\n 'isDataRecorded',\n 'updateDataRecordingFlag',\n] as const;\n\n/**\n * Returns the state of the {@link AnalyticsPrivacyController}.\n */\nexport type AnalyticsPrivacyControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n AnalyticsPrivacyControllerState\n>;\n\n/**\n * Actions that {@link AnalyticsPrivacyControllerMessenger} exposes to other consumers.\n */\nexport type AnalyticsPrivacyControllerActions =\n | AnalyticsPrivacyControllerGetStateAction\n | AnalyticsPrivacyControllerMethodActions;\n\n/**\n * Actions from other messengers that {@link AnalyticsPrivacyControllerMessenger} calls.\n */\ntype AllowedActions =\n | AnalyticsControllerGetStateAction\n | AnalyticsPrivacyServiceActions;\n\n/**\n * Event emitted when a data deletion task is created.\n */\nexport type DataDeletionTaskCreatedEvent = {\n type: `${typeof controllerName}:dataDeletionTaskCreated`;\n payload: [IDeleteRegulationResponse];\n};\n\n/**\n * Event emitted when the data recording flag is updated.\n */\nexport type DataRecordingFlagUpdatedEvent = {\n type: `${typeof controllerName}:dataRecordingFlagUpdated`;\n payload: [boolean];\n};\n\n/**\n * Event emitted when the state of the {@link AnalyticsPrivacyController} changes.\n */\nexport type AnalyticsPrivacyControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof controllerName,\n AnalyticsPrivacyControllerState\n >;\n\n/**\n * Events that {@link AnalyticsPrivacyControllerMessenger} exposes to other consumers.\n */\nexport type AnalyticsPrivacyControllerEvents =\n | AnalyticsPrivacyControllerStateChangeEvent\n | DataDeletionTaskCreatedEvent\n | DataRecordingFlagUpdatedEvent;\n\n/**\n * Events from other messengers that {@link AnalyticsPrivacyControllerMessenger} subscribes to.\n */\ntype AllowedEvents = never;\n\n/**\n * The messenger restricted to actions and events accessed by\n * {@link AnalyticsPrivacyController}.\n */\nexport type AnalyticsPrivacyControllerMessenger = Messenger<\n typeof controllerName,\n AnalyticsPrivacyControllerActions | AllowedActions,\n AnalyticsPrivacyControllerEvents | AllowedEvents\n>;\n\n// === CONTROLLER DEFINITION ===\n\n/**\n * The options that AnalyticsPrivacyController takes.\n */\nexport type AnalyticsPrivacyControllerOptions = {\n /**\n * Initial controller state.\n */\n state?: Partial<AnalyticsPrivacyControllerState>;\n /**\n * Messenger used to communicate with BaseController and other controllers.\n */\n messenger: AnalyticsPrivacyControllerMessenger;\n};\n\n/**\n * The AnalyticsPrivacyController manages analytics privacy and GDPR/CCPA data deletion functionality.\n * It communicates with Segment's Regulations API via a proxy to create and monitor data deletion requests.\n *\n * This controller follows the MetaMask controller pattern and integrates with the\n * messenger system to allow other controllers and components to manage data deletion tasks.\n */\nexport class AnalyticsPrivacyController extends BaseController<\n typeof controllerName,\n AnalyticsPrivacyControllerState,\n AnalyticsPrivacyControllerMessenger\n> {\n /**\n * Constructs an AnalyticsPrivacyController instance.\n *\n * @param options - Controller options\n * @param options.state - Initial controller state. Use `getDefaultAnalyticsPrivacyControllerState()` for defaults.\n * @param options.messenger - Messenger used to communicate with BaseController\n */\n constructor({ state = {}, messenger }: AnalyticsPrivacyControllerOptions) {\n const initialState: AnalyticsPrivacyControllerState = {\n ...getDefaultAnalyticsPrivacyControllerState(),\n ...state,\n };\n\n super({\n name: controllerName,\n metadata: analyticsPrivacyControllerMetadata,\n state: initialState,\n messenger,\n });\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n\n log('AnalyticsPrivacyController initialized', {\n dataRecorded: this.state.dataRecorded,\n hasDeleteRegulationId: Boolean(this.state.deleteRegulationId),\n deleteRegulationTimestamp: this.state.deleteRegulationTimestamp,\n });\n }\n\n /**\n * Creates a new delete regulation for the user.\n * This is necessary to respect the GDPR and CCPA regulations.\n *\n * @returns Promise containing the status of the request\n */\n async createDataDeletionTask(): Promise<IDeleteRegulationResponse> {\n try {\n const analyticsControllerState = this.messenger.call(\n 'AnalyticsController:getState',\n );\n const { analyticsId } = analyticsControllerState;\n\n if (!analyticsId || analyticsId.trim() === '') {\n const error = new Error('Analytics ID not found');\n log('Analytics Deletion Task Error', error);\n return {\n status: DataDeleteResponseStatus.Failure,\n error: 'Analytics ID not found',\n };\n }\n\n const response = await this.messenger.call(\n 'AnalyticsPrivacyService:createDataDeletionTask',\n analyticsId,\n );\n\n if (\n response.status === DataDeleteResponseStatus.Success &&\n response.regulateId &&\n typeof response.regulateId === 'string' &&\n response.regulateId.trim() !== ''\n ) {\n const deletionTimestamp = Date.now();\n // Already validated as non-empty string above\n const { regulateId } = response;\n\n this.update((state) => {\n state.deleteRegulationId = regulateId;\n state.deleteRegulationTimestamp = deletionTimestamp;\n state.dataRecorded = false;\n });\n\n this.messenger.publish(\n `${controllerName}:dataDeletionTaskCreated`,\n response,\n );\n }\n\n return response;\n } catch (error) {\n log('Analytics Deletion Task Error', error);\n const errorMessage =\n error instanceof Error\n ? error.message\n : 'Analytics Deletion Task Error';\n return {\n status: DataDeleteResponseStatus.Failure,\n error: errorMessage,\n };\n }\n }\n\n /**\n * Check the latest delete regulation status.\n *\n * @returns Promise containing the timestamp, delete status and collected data flag\n */\n async checkDataDeleteStatus(): Promise<IDeleteRegulationStatus> {\n const status: IDeleteRegulationStatus = {\n deletionRequestTimestamp: undefined,\n dataDeletionRequestStatus: DataDeleteStatus.Unknown,\n hasCollectedDataSinceDeletionRequest: false,\n };\n\n if (!this.state.deleteRegulationId) {\n return status;\n }\n\n try {\n const dataDeletionTaskStatus = await this.messenger.call(\n 'AnalyticsPrivacyService:checkDataDeleteStatus',\n this.state.deleteRegulationId,\n );\n\n status.dataDeletionRequestStatus =\n dataDeletionTaskStatus.dataDeleteStatus;\n } catch (error) {\n log('Error checkDataDeleteStatus', error);\n status.dataDeletionRequestStatus = DataDeleteStatus.Unknown;\n }\n\n status.deletionRequestTimestamp =\n this.state.deleteRegulationTimestamp ?? undefined;\n status.hasCollectedDataSinceDeletionRequest = this.state.dataRecorded;\n\n return status;\n }\n\n /**\n * Get the latest delete regulation request timestamp.\n *\n * @returns The timestamp (in milliseconds since epoch), or undefined\n */\n getDeleteRegulationCreationTimestamp(): number | undefined {\n return this.state.deleteRegulationTimestamp ?? undefined;\n }\n\n /**\n * Get the latest delete regulation request id.\n *\n * @returns The id string, or undefined\n */\n getDeleteRegulationId(): string | undefined {\n return this.state.deleteRegulationId ?? undefined;\n }\n\n /**\n * Indicate if events have been recorded since the last deletion request.\n *\n * @returns true if events have been recorded since the last deletion request\n */\n isDataRecorded(): boolean {\n return this.state.dataRecorded;\n }\n\n /**\n * Update the data recording flag if needed.\n * This method should be called after tracking events to ensure\n * the data recording flag is properly updated for data deletion workflows.\n *\n * @param saveDataRecording - Whether to save the data recording flag (default: true)\n */\n updateDataRecordingFlag(saveDataRecording: boolean = true): void {\n if (saveDataRecording && !this.state.dataRecorded) {\n this.update((state) => {\n state.dataRecorded = true;\n });\n\n this.messenger.publish(\n `${controllerName}:dataRecordingFlagUpdated`,\n true,\n );\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { AnalyticsControllerGetStateAction } from "@metamask/analytics-controller";
|
|
2
|
+
import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
|
|
3
|
+
import { BaseController } from "@metamask/base-controller";
|
|
4
|
+
import type { Messenger } from "@metamask/messenger";
|
|
5
|
+
import type { AnalyticsPrivacyControllerMethodActions } from "./AnalyticsPrivacyController-method-action-types.cjs";
|
|
6
|
+
import type { AnalyticsPrivacyServiceActions } from "./AnalyticsPrivacyService.cjs";
|
|
7
|
+
import type { IDeleteRegulationResponse, IDeleteRegulationStatus } from "./types.cjs";
|
|
8
|
+
/**
|
|
9
|
+
* The name of the {@link AnalyticsPrivacyController}, used to namespace the
|
|
10
|
+
* controller's actions and events and to namespace the controller's state data
|
|
11
|
+
* when composed with other controllers.
|
|
12
|
+
*/
|
|
13
|
+
export declare const controllerName = "AnalyticsPrivacyController";
|
|
14
|
+
/**
|
|
15
|
+
* Describes the shape of the state object for {@link AnalyticsPrivacyController}.
|
|
16
|
+
*/
|
|
17
|
+
export type AnalyticsPrivacyControllerState = {
|
|
18
|
+
/**
|
|
19
|
+
* Indicates if data has been recorded since the last deletion request.
|
|
20
|
+
*/
|
|
21
|
+
dataRecorded: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Segment's data deletion regulation ID.
|
|
24
|
+
* The ID returned by the Segment delete API which allows checking the status of the deletion request.
|
|
25
|
+
*/
|
|
26
|
+
deleteRegulationId: string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Segment's data deletion regulation creation timestamp.
|
|
29
|
+
* The timestamp (in milliseconds since epoch) when the deletion request was created.
|
|
30
|
+
*/
|
|
31
|
+
deleteRegulationTimestamp: number | null;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Returns default values for AnalyticsPrivacyController state.
|
|
35
|
+
*
|
|
36
|
+
* @returns Default state
|
|
37
|
+
*/
|
|
38
|
+
export declare function getDefaultAnalyticsPrivacyControllerState(): AnalyticsPrivacyControllerState;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the state of the {@link AnalyticsPrivacyController}.
|
|
41
|
+
*/
|
|
42
|
+
export type AnalyticsPrivacyControllerGetStateAction = ControllerGetStateAction<typeof controllerName, AnalyticsPrivacyControllerState>;
|
|
43
|
+
/**
|
|
44
|
+
* Actions that {@link AnalyticsPrivacyControllerMessenger} exposes to other consumers.
|
|
45
|
+
*/
|
|
46
|
+
export type AnalyticsPrivacyControllerActions = AnalyticsPrivacyControllerGetStateAction | AnalyticsPrivacyControllerMethodActions;
|
|
47
|
+
/**
|
|
48
|
+
* Actions from other messengers that {@link AnalyticsPrivacyControllerMessenger} calls.
|
|
49
|
+
*/
|
|
50
|
+
type AllowedActions = AnalyticsControllerGetStateAction | AnalyticsPrivacyServiceActions;
|
|
51
|
+
/**
|
|
52
|
+
* Event emitted when a data deletion task is created.
|
|
53
|
+
*/
|
|
54
|
+
export type DataDeletionTaskCreatedEvent = {
|
|
55
|
+
type: `${typeof controllerName}:dataDeletionTaskCreated`;
|
|
56
|
+
payload: [IDeleteRegulationResponse];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Event emitted when the data recording flag is updated.
|
|
60
|
+
*/
|
|
61
|
+
export type DataRecordingFlagUpdatedEvent = {
|
|
62
|
+
type: `${typeof controllerName}:dataRecordingFlagUpdated`;
|
|
63
|
+
payload: [boolean];
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Event emitted when the state of the {@link AnalyticsPrivacyController} changes.
|
|
67
|
+
*/
|
|
68
|
+
export type AnalyticsPrivacyControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, AnalyticsPrivacyControllerState>;
|
|
69
|
+
/**
|
|
70
|
+
* Events that {@link AnalyticsPrivacyControllerMessenger} exposes to other consumers.
|
|
71
|
+
*/
|
|
72
|
+
export type AnalyticsPrivacyControllerEvents = AnalyticsPrivacyControllerStateChangeEvent | DataDeletionTaskCreatedEvent | DataRecordingFlagUpdatedEvent;
|
|
73
|
+
/**
|
|
74
|
+
* Events from other messengers that {@link AnalyticsPrivacyControllerMessenger} subscribes to.
|
|
75
|
+
*/
|
|
76
|
+
type AllowedEvents = never;
|
|
77
|
+
/**
|
|
78
|
+
* The messenger restricted to actions and events accessed by
|
|
79
|
+
* {@link AnalyticsPrivacyController}.
|
|
80
|
+
*/
|
|
81
|
+
export type AnalyticsPrivacyControllerMessenger = Messenger<typeof controllerName, AnalyticsPrivacyControllerActions | AllowedActions, AnalyticsPrivacyControllerEvents | AllowedEvents>;
|
|
82
|
+
/**
|
|
83
|
+
* The options that AnalyticsPrivacyController takes.
|
|
84
|
+
*/
|
|
85
|
+
export type AnalyticsPrivacyControllerOptions = {
|
|
86
|
+
/**
|
|
87
|
+
* Initial controller state.
|
|
88
|
+
*/
|
|
89
|
+
state?: Partial<AnalyticsPrivacyControllerState>;
|
|
90
|
+
/**
|
|
91
|
+
* Messenger used to communicate with BaseController and other controllers.
|
|
92
|
+
*/
|
|
93
|
+
messenger: AnalyticsPrivacyControllerMessenger;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* The AnalyticsPrivacyController manages analytics privacy and GDPR/CCPA data deletion functionality.
|
|
97
|
+
* It communicates with Segment's Regulations API via a proxy to create and monitor data deletion requests.
|
|
98
|
+
*
|
|
99
|
+
* This controller follows the MetaMask controller pattern and integrates with the
|
|
100
|
+
* messenger system to allow other controllers and components to manage data deletion tasks.
|
|
101
|
+
*/
|
|
102
|
+
export declare class AnalyticsPrivacyController extends BaseController<typeof controllerName, AnalyticsPrivacyControllerState, AnalyticsPrivacyControllerMessenger> {
|
|
103
|
+
/**
|
|
104
|
+
* Constructs an AnalyticsPrivacyController instance.
|
|
105
|
+
*
|
|
106
|
+
* @param options - Controller options
|
|
107
|
+
* @param options.state - Initial controller state. Use `getDefaultAnalyticsPrivacyControllerState()` for defaults.
|
|
108
|
+
* @param options.messenger - Messenger used to communicate with BaseController
|
|
109
|
+
*/
|
|
110
|
+
constructor({ state, messenger }: AnalyticsPrivacyControllerOptions);
|
|
111
|
+
/**
|
|
112
|
+
* Creates a new delete regulation for the user.
|
|
113
|
+
* This is necessary to respect the GDPR and CCPA regulations.
|
|
114
|
+
*
|
|
115
|
+
* @returns Promise containing the status of the request
|
|
116
|
+
*/
|
|
117
|
+
createDataDeletionTask(): Promise<IDeleteRegulationResponse>;
|
|
118
|
+
/**
|
|
119
|
+
* Check the latest delete regulation status.
|
|
120
|
+
*
|
|
121
|
+
* @returns Promise containing the timestamp, delete status and collected data flag
|
|
122
|
+
*/
|
|
123
|
+
checkDataDeleteStatus(): Promise<IDeleteRegulationStatus>;
|
|
124
|
+
/**
|
|
125
|
+
* Get the latest delete regulation request timestamp.
|
|
126
|
+
*
|
|
127
|
+
* @returns The timestamp (in milliseconds since epoch), or undefined
|
|
128
|
+
*/
|
|
129
|
+
getDeleteRegulationCreationTimestamp(): number | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Get the latest delete regulation request id.
|
|
132
|
+
*
|
|
133
|
+
* @returns The id string, or undefined
|
|
134
|
+
*/
|
|
135
|
+
getDeleteRegulationId(): string | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Indicate if events have been recorded since the last deletion request.
|
|
138
|
+
*
|
|
139
|
+
* @returns true if events have been recorded since the last deletion request
|
|
140
|
+
*/
|
|
141
|
+
isDataRecorded(): boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Update the data recording flag if needed.
|
|
144
|
+
* This method should be called after tracking events to ensure
|
|
145
|
+
* the data recording flag is properly updated for data deletion workflows.
|
|
146
|
+
*
|
|
147
|
+
* @param saveDataRecording - Whether to save the data recording flag (default: true)
|
|
148
|
+
*/
|
|
149
|
+
updateDataRecordingFlag(saveDataRecording?: boolean): void;
|
|
150
|
+
}
|
|
151
|
+
export {};
|
|
152
|
+
//# sourceMappingURL=AnalyticsPrivacyController.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsPrivacyController.d.cts","sourceRoot":"","sources":["../src/AnalyticsPrivacyController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,uCAAuC;AACxF,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AAErD,OAAO,KAAK,EAAE,uCAAuC,EAAE,6DAAyD;AAEhH,OAAO,KAAK,EAAE,8BAA8B,EAAE,sCAAkC;AAEhF,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACxB,oBAAgB;AAIjB;;;;GAIG;AACH,eAAO,MAAM,cAAc,+BAA+B,CAAC;AAI3D;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC;;;OAGG;IACH,yBAAyB,EAAE,MAAM,GAAG,IAAI,CA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