@metamask-previews/profile-sync-controller 19.0.0-preview-ee33e55 → 19.0.0-preview-f9a5dd05
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 -5
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/shared/metametrics.cjs +107 -0
- package/dist/shared/metametrics.cjs.map +1 -0
- package/dist/shared/metametrics.d.cts +106 -0
- package/dist/shared/metametrics.d.cts.map +1 -0
- package/dist/shared/metametrics.d.mts +106 -0
- package/dist/shared/metametrics.d.mts.map +1 -0
- package/dist/shared/metametrics.mjs +103 -0
- package/dist/shared/metametrics.mjs.map +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -7,12 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
###
|
|
10
|
+
### Added
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
- Bump `@metamask/snaps-utils` from `^9.4.0` to `^10.1.0` ([#6035](https://github.com/MetaMask/core/pull/6035))
|
|
14
|
-
- Bump `@metamask/snaps-controllers` from `^12.3.1` to `^13.1.1` ([#6035](https://github.com/MetaMask/core/pull/6035))
|
|
15
|
-
- Bump peer dependency `@metamask/snaps-controllers` from `^12.0.0` to `^13.0.0` ([#6035](https://github.com/MetaMask/core/pull/6035))
|
|
12
|
+
- Add MetaMetrics event library to standardize event properties across clients ([#6044](https://github.com/MetaMask/core/pull/6044))
|
|
16
13
|
|
|
17
14
|
## [19.0.0]
|
|
18
15
|
|
package/dist/index.cjs
CHANGED
|
@@ -23,8 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.UserStorageController = exports.AuthenticationController = exports.SDK = void 0;
|
|
26
|
+
exports.MetaMetrics = exports.UserStorageController = exports.AuthenticationController = exports.SDK = void 0;
|
|
27
27
|
exports.SDK = __importStar(require("./sdk/index.cjs"));
|
|
28
28
|
exports.AuthenticationController = __importStar(require("./controllers/authentication/index.cjs"));
|
|
29
29
|
exports.UserStorageController = __importStar(require("./controllers/user-storage/index.cjs"));
|
|
30
|
+
exports.MetaMetrics = __importStar(require("./shared/metametrics.cjs"));
|
|
30
31
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA6B;AAC7B,mGAAyE;AACzE,8FAAoE","sourcesContent":["export * as SDK from './sdk';\nexport * as AuthenticationController from './controllers/authentication';\nexport * as UserStorageController from './controllers/user-storage';\n"]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA6B;AAC7B,mGAAyE;AACzE,8FAAoE;AACpE,wEAAoD","sourcesContent":["export * as SDK from './sdk';\nexport * as AuthenticationController from './controllers/authentication';\nexport * as UserStorageController from './controllers/user-storage';\nexport * as MetaMetrics from './shared/metametrics';\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as SDK from "./sdk/index.cjs";
|
|
2
2
|
export * as AuthenticationController from "./controllers/authentication/index.cjs";
|
|
3
3
|
export * as UserStorageController from "./controllers/user-storage/index.cjs";
|
|
4
|
+
export * as MetaMetrics from "./shared/metametrics.cjs";
|
|
4
5
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAc;AAC7B,OAAO,KAAK,wBAAwB,+CAAqC;AACzE,OAAO,KAAK,qBAAqB,6CAAmC"}
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAc;AAC7B,OAAO,KAAK,wBAAwB,+CAAqC;AACzE,OAAO,KAAK,qBAAqB,6CAAmC;AACpE,OAAO,KAAK,WAAW,iCAA6B"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as SDK from "./sdk/index.mjs";
|
|
2
2
|
export * as AuthenticationController from "./controllers/authentication/index.mjs";
|
|
3
3
|
export * as UserStorageController from "./controllers/user-storage/index.mjs";
|
|
4
|
+
export * as MetaMetrics from "./shared/metametrics.mjs";
|
|
4
5
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAc;AAC7B,OAAO,KAAK,wBAAwB,+CAAqC;AACzE,OAAO,KAAK,qBAAqB,6CAAmC"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAc;AAC7B,OAAO,KAAK,wBAAwB,+CAAqC;AACzE,OAAO,KAAK,qBAAqB,6CAAmC;AACpE,OAAO,KAAK,WAAW,iCAA6B"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as SDK from "./sdk/index.mjs";
|
|
2
2
|
export * as AuthenticationController from "./controllers/authentication/index.mjs";
|
|
3
3
|
export * as UserStorageController from "./controllers/user-storage/index.mjs";
|
|
4
|
+
export * as MetaMetrics from "./shared/metametrics.mjs";
|
|
4
5
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAc;AAC7B,OAAO,KAAK,wBAAwB,+CAAqC;AACzE,OAAO,KAAK,qBAAqB,6CAAmC","sourcesContent":["export * as SDK from './sdk';\nexport * as AuthenticationController from './controllers/authentication';\nexport * as UserStorageController from './controllers/user-storage';\n"]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,wBAAc;AAC7B,OAAO,KAAK,wBAAwB,+CAAqC;AACzE,OAAO,KAAK,qBAAqB,6CAAmC;AACpE,OAAO,KAAK,WAAW,iCAA6B","sourcesContent":["export * as SDK from './sdk';\nexport * as AuthenticationController from './controllers/authentication';\nexport * as UserStorageController from './controllers/user-storage';\nexport * as MetaMetrics from './shared/metametrics';\n"]}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MetaMetrics event constants for profile-sync-controller
|
|
4
|
+
*
|
|
5
|
+
* This library provides standardized constants for MetaMetrics events
|
|
6
|
+
* to avoid magic strings and ensure consistency across clients.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.BackupAndSyncEventProperties = exports.createBackupAndSyncEventProperties = exports.BackupAndSyncActions = exports.BackupAndSyncFeatureNames = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Feature names used in profile-sync-controller MetaMetrics events
|
|
12
|
+
*/
|
|
13
|
+
exports.BackupAndSyncFeatureNames = {
|
|
14
|
+
/**
|
|
15
|
+
* The main backup and sync feature
|
|
16
|
+
*/
|
|
17
|
+
BACKUP_AND_SYNC: 'Backup And Sync',
|
|
18
|
+
/**
|
|
19
|
+
* Account syncing functionality
|
|
20
|
+
*/
|
|
21
|
+
ACCOUNT_SYNCING: 'Account Syncing',
|
|
22
|
+
/**
|
|
23
|
+
* Contact syncing functionality
|
|
24
|
+
*/
|
|
25
|
+
CONTACT_SYNCING: 'Contact Syncing',
|
|
26
|
+
/**
|
|
27
|
+
* Network syncing functionality
|
|
28
|
+
*/
|
|
29
|
+
NETWORK_SYNCING: 'Network Syncing',
|
|
30
|
+
/**
|
|
31
|
+
* Authentication functionality
|
|
32
|
+
*/
|
|
33
|
+
AUTHENTICATION: 'Authentication',
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Actions used in profile-sync-controller MetaMetrics events
|
|
37
|
+
*/
|
|
38
|
+
exports.BackupAndSyncActions = {
|
|
39
|
+
// Account syncing actions
|
|
40
|
+
ACCOUNTS_SYNC_ADDED: 'Accounts Sync Added',
|
|
41
|
+
ACCOUNTS_SYNC_NAME_UPDATED: 'Accounts Sync Name Updated',
|
|
42
|
+
ACCOUNTS_SYNC_ERRONEOUS_SITUATION: 'Accounts Sync Erroneous Situation',
|
|
43
|
+
// Contact syncing actions
|
|
44
|
+
CONTACTS_SYNC_CONTACT_UPDATED: 'Contacts Sync Contact Updated',
|
|
45
|
+
CONTACTS_SYNC_CONTACT_DELETED: 'Contacts Sync Contact Deleted',
|
|
46
|
+
CONTACTS_SYNC_ERRONEOUS_SITUATION: 'Contacts Sync Erroneous Situation',
|
|
47
|
+
// Network syncing actions
|
|
48
|
+
NETWORK_SYNC_ADDED: 'Network Sync Added',
|
|
49
|
+
NETWORK_SYNC_UPDATED: 'Network Sync Updated',
|
|
50
|
+
NETWORK_SYNC_REMOVED: 'Network Sync Removed',
|
|
51
|
+
// Authentication actions
|
|
52
|
+
SIGN_IN: 'Sign In',
|
|
53
|
+
SIGN_OUT: 'Sign Out',
|
|
54
|
+
AUTHENTICATION_FAILED: 'Authentication Failed',
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Helper function to create standardized MetaMetrics event properties
|
|
58
|
+
* for profile-sync-controller events
|
|
59
|
+
*
|
|
60
|
+
* @param featureName - The feature name to use in the event properties
|
|
61
|
+
* @param action - The action to use in the event properties
|
|
62
|
+
* @param additionalProperties - Optional additional properties to include
|
|
63
|
+
* @returns An object containing the standardized event properties
|
|
64
|
+
*/
|
|
65
|
+
const createBackupAndSyncEventProperties = (featureName, action, additionalProperties) => ({
|
|
66
|
+
feature_name: featureName,
|
|
67
|
+
action,
|
|
68
|
+
...additionalProperties,
|
|
69
|
+
});
|
|
70
|
+
exports.createBackupAndSyncEventProperties = createBackupAndSyncEventProperties;
|
|
71
|
+
/**
|
|
72
|
+
* Pre-defined event property sets for common profile-sync-controller events
|
|
73
|
+
*/
|
|
74
|
+
exports.BackupAndSyncEventProperties = {
|
|
75
|
+
// Account syncing events
|
|
76
|
+
ACCOUNT_ADDED: (profileId) => ({
|
|
77
|
+
profile_id: profileId,
|
|
78
|
+
}),
|
|
79
|
+
ACCOUNT_NAME_UPDATED: (profileId) => ({
|
|
80
|
+
profile_id: profileId,
|
|
81
|
+
}),
|
|
82
|
+
ACCOUNT_SYNC_ERROR: (profileId, situationMessage) => ({
|
|
83
|
+
profile_id: profileId,
|
|
84
|
+
situation_message: situationMessage,
|
|
85
|
+
}),
|
|
86
|
+
// Contact syncing events
|
|
87
|
+
CONTACT_UPDATED: (profileId) => (0, exports.createBackupAndSyncEventProperties)(exports.BackupAndSyncFeatureNames.BACKUP_AND_SYNC, exports.BackupAndSyncActions.CONTACTS_SYNC_CONTACT_UPDATED, { profile_id: profileId }),
|
|
88
|
+
CONTACT_DELETED: (profileId) => (0, exports.createBackupAndSyncEventProperties)(exports.BackupAndSyncFeatureNames.BACKUP_AND_SYNC, exports.BackupAndSyncActions.CONTACTS_SYNC_CONTACT_DELETED, { profile_id: profileId }),
|
|
89
|
+
CONTACT_SYNC_ERROR: (profileId, situationMessage) => (0, exports.createBackupAndSyncEventProperties)(exports.BackupAndSyncFeatureNames.BACKUP_AND_SYNC, exports.BackupAndSyncActions.CONTACTS_SYNC_ERRONEOUS_SITUATION, {
|
|
90
|
+
profile_id: profileId,
|
|
91
|
+
additional_description: situationMessage,
|
|
92
|
+
}),
|
|
93
|
+
// Network syncing events
|
|
94
|
+
NETWORK_ADDED: (profileId, chainId) => ({
|
|
95
|
+
profile_id: profileId,
|
|
96
|
+
chain_id: chainId,
|
|
97
|
+
}),
|
|
98
|
+
NETWORK_UPDATED: (profileId, chainId) => ({
|
|
99
|
+
profile_id: profileId,
|
|
100
|
+
chain_id: chainId,
|
|
101
|
+
}),
|
|
102
|
+
NETWORK_REMOVED: (profileId, chainId) => ({
|
|
103
|
+
profile_id: profileId,
|
|
104
|
+
chain_id: chainId,
|
|
105
|
+
}),
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=metametrics.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metametrics.cjs","sourceRoot":"","sources":["../../src/shared/metametrics.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH;;GAEG;AACU,QAAA,yBAAyB,GAAG;IACvC;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAClC;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAClC;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAClC;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAClC;;OAEG;IACH,cAAc,EAAE,gBAAgB;CACxB,CAAC;AAEX;;GAEG;AACU,QAAA,oBAAoB,GAAG;IAClC,0BAA0B;IAC1B,mBAAmB,EAAE,qBAAqB;IAC1C,0BAA0B,EAAE,4BAA4B;IACxD,iCAAiC,EAAE,mCAAmC;IAEtE,0BAA0B;IAC1B,6BAA6B,EAAE,+BAA+B;IAC9D,6BAA6B,EAAE,+BAA+B;IAC9D,iCAAiC,EAAE,mCAAmC;IAEtE,0BAA0B;IAC1B,kBAAkB,EAAE,oBAAoB;IACxC,oBAAoB,EAAE,sBAAsB;IAC5C,oBAAoB,EAAE,sBAAsB;IAE5C,yBAAyB;IACzB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,qBAAqB,EAAE,uBAAuB;CACtC,CAAC;AAUX;;;;;;;;GAQG;AACI,MAAM,kCAAkC,GAAG,CAChD,WAAqC,EACrC,MAA2B,EAC3B,oBAA8C,EAC9C,EAAE,CAAC,CAAC;IACJ,YAAY,EAAE,WAAW;IACzB,MAAM;IACN,GAAG,oBAAoB;CACxB,CAAC,CAAC;AARU,QAAA,kCAAkC,sCAQ5C;AAEH;;GAEG;AACU,QAAA,4BAA4B,GAAG;IAC1C,yBAAyB;IACzB,aAAa,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC;QACrC,UAAU,EAAE,SAAS;KACtB,CAAC;IACF,oBAAoB,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC;QAC5C,UAAU,EAAE,SAAS;KACtB,CAAC;IACF,kBAAkB,EAAE,CAAC,SAAiB,EAAE,gBAAwB,EAAE,EAAE,CAAC,CAAC;QACpE,UAAU,EAAE,SAAS;QACrB,iBAAiB,EAAE,gBAAgB;KACpC,CAAC;IAEF,yBAAyB;IACzB,eAAe,EAAE,CAAC,SAAiB,EAAE,EAAE,CACrC,IAAA,0CAAkC,EAChC,iCAAyB,CAAC,eAAe,EACzC,4BAAoB,CAAC,6BAA6B,EAClD,EAAE,UAAU,EAAE,SAAS,EAAE,CAC1B;IACH,eAAe,EAAE,CAAC,SAAiB,EAAE,EAAE,CACrC,IAAA,0CAAkC,EAChC,iCAAyB,CAAC,eAAe,EACzC,4BAAoB,CAAC,6BAA6B,EAClD,EAAE,UAAU,EAAE,SAAS,EAAE,CAC1B;IACH,kBAAkB,EAAE,CAAC,SAAiB,EAAE,gBAAwB,EAAE,EAAE,CAClE,IAAA,0CAAkC,EAChC,iCAAyB,CAAC,eAAe,EACzC,4BAAoB,CAAC,iCAAiC,EACtD;QACE,UAAU,EAAE,SAAS;QACrB,sBAAsB,EAAE,gBAAgB;KACzC,CACF;IAEH,yBAAyB;IACzB,aAAa,EAAE,CAAC,SAAiB,EAAE,OAAe,EAAE,EAAE,CAAC,CAAC;QACtD,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,OAAO;KAClB,CAAC;IACF,eAAe,EAAE,CAAC,SAAiB,EAAE,OAAe,EAAE,EAAE,CAAC,CAAC;QACxD,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,OAAO;KAClB,CAAC;IACF,eAAe,EAAE,CAAC,SAAiB,EAAE,OAAe,EAAE,EAAE,CAAC,CAAC;QACxD,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,OAAO;KAClB,CAAC;CACM,CAAC","sourcesContent":["/**\n * MetaMetrics event constants for profile-sync-controller\n *\n * This library provides standardized constants for MetaMetrics events\n * to avoid magic strings and ensure consistency across clients.\n */\n\n/**\n * Feature names used in profile-sync-controller MetaMetrics events\n */\nexport const BackupAndSyncFeatureNames = {\n /**\n * The main backup and sync feature\n */\n BACKUP_AND_SYNC: 'Backup And Sync',\n /**\n * Account syncing functionality\n */\n ACCOUNT_SYNCING: 'Account Syncing',\n /**\n * Contact syncing functionality\n */\n CONTACT_SYNCING: 'Contact Syncing',\n /**\n * Network syncing functionality\n */\n NETWORK_SYNCING: 'Network Syncing',\n /**\n * Authentication functionality\n */\n AUTHENTICATION: 'Authentication',\n} as const;\n\n/**\n * Actions used in profile-sync-controller MetaMetrics events\n */\nexport const BackupAndSyncActions = {\n // Account syncing actions\n ACCOUNTS_SYNC_ADDED: 'Accounts Sync Added',\n ACCOUNTS_SYNC_NAME_UPDATED: 'Accounts Sync Name Updated',\n ACCOUNTS_SYNC_ERRONEOUS_SITUATION: 'Accounts Sync Erroneous Situation',\n\n // Contact syncing actions\n CONTACTS_SYNC_CONTACT_UPDATED: 'Contacts Sync Contact Updated',\n CONTACTS_SYNC_CONTACT_DELETED: 'Contacts Sync Contact Deleted',\n CONTACTS_SYNC_ERRONEOUS_SITUATION: 'Contacts Sync Erroneous Situation',\n\n // Network syncing actions\n NETWORK_SYNC_ADDED: 'Network Sync Added',\n NETWORK_SYNC_UPDATED: 'Network Sync Updated',\n NETWORK_SYNC_REMOVED: 'Network Sync Removed',\n\n // Authentication actions\n SIGN_IN: 'Sign In',\n SIGN_OUT: 'Sign Out',\n AUTHENTICATION_FAILED: 'Authentication Failed',\n} as const;\n\n/**\n * Type definitions for the constants to ensure type safety\n */\nexport type BackupAndSyncFeatureName =\n (typeof BackupAndSyncFeatureNames)[keyof typeof BackupAndSyncFeatureNames];\nexport type BackupAndSyncAction =\n (typeof BackupAndSyncActions)[keyof typeof BackupAndSyncActions];\n\n/**\n * Helper function to create standardized MetaMetrics event properties\n * for profile-sync-controller events\n *\n * @param featureName - The feature name to use in the event properties\n * @param action - The action to use in the event properties\n * @param additionalProperties - Optional additional properties to include\n * @returns An object containing the standardized event properties\n */\nexport const createBackupAndSyncEventProperties = (\n featureName: BackupAndSyncFeatureName,\n action: BackupAndSyncAction,\n additionalProperties?: Record<string, unknown>,\n) => ({\n feature_name: featureName,\n action,\n ...additionalProperties,\n});\n\n/**\n * Pre-defined event property sets for common profile-sync-controller events\n */\nexport const BackupAndSyncEventProperties = {\n // Account syncing events\n ACCOUNT_ADDED: (profileId: string) => ({\n profile_id: profileId,\n }),\n ACCOUNT_NAME_UPDATED: (profileId: string) => ({\n profile_id: profileId,\n }),\n ACCOUNT_SYNC_ERROR: (profileId: string, situationMessage: string) => ({\n profile_id: profileId,\n situation_message: situationMessage,\n }),\n\n // Contact syncing events\n CONTACT_UPDATED: (profileId: string) =>\n createBackupAndSyncEventProperties(\n BackupAndSyncFeatureNames.BACKUP_AND_SYNC,\n BackupAndSyncActions.CONTACTS_SYNC_CONTACT_UPDATED,\n { profile_id: profileId },\n ),\n CONTACT_DELETED: (profileId: string) =>\n createBackupAndSyncEventProperties(\n BackupAndSyncFeatureNames.BACKUP_AND_SYNC,\n BackupAndSyncActions.CONTACTS_SYNC_CONTACT_DELETED,\n { profile_id: profileId },\n ),\n CONTACT_SYNC_ERROR: (profileId: string, situationMessage: string) =>\n createBackupAndSyncEventProperties(\n BackupAndSyncFeatureNames.BACKUP_AND_SYNC,\n BackupAndSyncActions.CONTACTS_SYNC_ERRONEOUS_SITUATION,\n {\n profile_id: profileId,\n additional_description: situationMessage,\n },\n ),\n\n // Network syncing events\n NETWORK_ADDED: (profileId: string, chainId: string) => ({\n profile_id: profileId,\n chain_id: chainId,\n }),\n NETWORK_UPDATED: (profileId: string, chainId: string) => ({\n profile_id: profileId,\n chain_id: chainId,\n }),\n NETWORK_REMOVED: (profileId: string, chainId: string) => ({\n profile_id: profileId,\n chain_id: chainId,\n }),\n} as const;\n"]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MetaMetrics event constants for profile-sync-controller
|
|
3
|
+
*
|
|
4
|
+
* This library provides standardized constants for MetaMetrics events
|
|
5
|
+
* to avoid magic strings and ensure consistency across clients.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Feature names used in profile-sync-controller MetaMetrics events
|
|
9
|
+
*/
|
|
10
|
+
export declare const BackupAndSyncFeatureNames: {
|
|
11
|
+
/**
|
|
12
|
+
* The main backup and sync feature
|
|
13
|
+
*/
|
|
14
|
+
readonly BACKUP_AND_SYNC: "Backup And Sync";
|
|
15
|
+
/**
|
|
16
|
+
* Account syncing functionality
|
|
17
|
+
*/
|
|
18
|
+
readonly ACCOUNT_SYNCING: "Account Syncing";
|
|
19
|
+
/**
|
|
20
|
+
* Contact syncing functionality
|
|
21
|
+
*/
|
|
22
|
+
readonly CONTACT_SYNCING: "Contact Syncing";
|
|
23
|
+
/**
|
|
24
|
+
* Network syncing functionality
|
|
25
|
+
*/
|
|
26
|
+
readonly NETWORK_SYNCING: "Network Syncing";
|
|
27
|
+
/**
|
|
28
|
+
* Authentication functionality
|
|
29
|
+
*/
|
|
30
|
+
readonly AUTHENTICATION: "Authentication";
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Actions used in profile-sync-controller MetaMetrics events
|
|
34
|
+
*/
|
|
35
|
+
export declare const BackupAndSyncActions: {
|
|
36
|
+
readonly ACCOUNTS_SYNC_ADDED: "Accounts Sync Added";
|
|
37
|
+
readonly ACCOUNTS_SYNC_NAME_UPDATED: "Accounts Sync Name Updated";
|
|
38
|
+
readonly ACCOUNTS_SYNC_ERRONEOUS_SITUATION: "Accounts Sync Erroneous Situation";
|
|
39
|
+
readonly CONTACTS_SYNC_CONTACT_UPDATED: "Contacts Sync Contact Updated";
|
|
40
|
+
readonly CONTACTS_SYNC_CONTACT_DELETED: "Contacts Sync Contact Deleted";
|
|
41
|
+
readonly CONTACTS_SYNC_ERRONEOUS_SITUATION: "Contacts Sync Erroneous Situation";
|
|
42
|
+
readonly NETWORK_SYNC_ADDED: "Network Sync Added";
|
|
43
|
+
readonly NETWORK_SYNC_UPDATED: "Network Sync Updated";
|
|
44
|
+
readonly NETWORK_SYNC_REMOVED: "Network Sync Removed";
|
|
45
|
+
readonly SIGN_IN: "Sign In";
|
|
46
|
+
readonly SIGN_OUT: "Sign Out";
|
|
47
|
+
readonly AUTHENTICATION_FAILED: "Authentication Failed";
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Type definitions for the constants to ensure type safety
|
|
51
|
+
*/
|
|
52
|
+
export type BackupAndSyncFeatureName = (typeof BackupAndSyncFeatureNames)[keyof typeof BackupAndSyncFeatureNames];
|
|
53
|
+
export type BackupAndSyncAction = (typeof BackupAndSyncActions)[keyof typeof BackupAndSyncActions];
|
|
54
|
+
/**
|
|
55
|
+
* Helper function to create standardized MetaMetrics event properties
|
|
56
|
+
* for profile-sync-controller events
|
|
57
|
+
*
|
|
58
|
+
* @param featureName - The feature name to use in the event properties
|
|
59
|
+
* @param action - The action to use in the event properties
|
|
60
|
+
* @param additionalProperties - Optional additional properties to include
|
|
61
|
+
* @returns An object containing the standardized event properties
|
|
62
|
+
*/
|
|
63
|
+
export declare const createBackupAndSyncEventProperties: (featureName: BackupAndSyncFeatureName, action: BackupAndSyncAction, additionalProperties?: Record<string, unknown>) => {
|
|
64
|
+
feature_name: BackupAndSyncFeatureName;
|
|
65
|
+
action: BackupAndSyncAction;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Pre-defined event property sets for common profile-sync-controller events
|
|
69
|
+
*/
|
|
70
|
+
export declare const BackupAndSyncEventProperties: {
|
|
71
|
+
readonly ACCOUNT_ADDED: (profileId: string) => {
|
|
72
|
+
profile_id: string;
|
|
73
|
+
};
|
|
74
|
+
readonly ACCOUNT_NAME_UPDATED: (profileId: string) => {
|
|
75
|
+
profile_id: string;
|
|
76
|
+
};
|
|
77
|
+
readonly ACCOUNT_SYNC_ERROR: (profileId: string, situationMessage: string) => {
|
|
78
|
+
profile_id: string;
|
|
79
|
+
situation_message: string;
|
|
80
|
+
};
|
|
81
|
+
readonly CONTACT_UPDATED: (profileId: string) => {
|
|
82
|
+
feature_name: BackupAndSyncFeatureName;
|
|
83
|
+
action: BackupAndSyncAction;
|
|
84
|
+
};
|
|
85
|
+
readonly CONTACT_DELETED: (profileId: string) => {
|
|
86
|
+
feature_name: BackupAndSyncFeatureName;
|
|
87
|
+
action: BackupAndSyncAction;
|
|
88
|
+
};
|
|
89
|
+
readonly CONTACT_SYNC_ERROR: (profileId: string, situationMessage: string) => {
|
|
90
|
+
feature_name: BackupAndSyncFeatureName;
|
|
91
|
+
action: BackupAndSyncAction;
|
|
92
|
+
};
|
|
93
|
+
readonly NETWORK_ADDED: (profileId: string, chainId: string) => {
|
|
94
|
+
profile_id: string;
|
|
95
|
+
chain_id: string;
|
|
96
|
+
};
|
|
97
|
+
readonly NETWORK_UPDATED: (profileId: string, chainId: string) => {
|
|
98
|
+
profile_id: string;
|
|
99
|
+
chain_id: string;
|
|
100
|
+
};
|
|
101
|
+
readonly NETWORK_REMOVED: (profileId: string, chainId: string) => {
|
|
102
|
+
profile_id: string;
|
|
103
|
+
chain_id: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=metametrics.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metametrics.d.cts","sourceRoot":"","sources":["../../src/shared/metametrics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB;IACpC;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;CAoBvB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEnE;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC,gBAChC,wBAAwB,UAC7B,mBAAmB,yBACJ,OAAO,MAAM,EAAE,OAAO,CAAC;;;CAK9C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,4BAA4B;wCAEZ,MAAM;;;+CAGC,MAAM;;;6CAGR,MAAM,oBAAoB,MAAM;;;;0CAMnC,MAAM;;;;0CAMN,MAAM;;;;6CAMH,MAAM,oBAAoB,MAAM;;;;wCAWrC,MAAM,WAAW,MAAM;;;;0CAIrB,MAAM,WAAW,MAAM;;;;0CAIvB,MAAM,WAAW,MAAM;;;;CAI5C,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MetaMetrics event constants for profile-sync-controller
|
|
3
|
+
*
|
|
4
|
+
* This library provides standardized constants for MetaMetrics events
|
|
5
|
+
* to avoid magic strings and ensure consistency across clients.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Feature names used in profile-sync-controller MetaMetrics events
|
|
9
|
+
*/
|
|
10
|
+
export declare const BackupAndSyncFeatureNames: {
|
|
11
|
+
/**
|
|
12
|
+
* The main backup and sync feature
|
|
13
|
+
*/
|
|
14
|
+
readonly BACKUP_AND_SYNC: "Backup And Sync";
|
|
15
|
+
/**
|
|
16
|
+
* Account syncing functionality
|
|
17
|
+
*/
|
|
18
|
+
readonly ACCOUNT_SYNCING: "Account Syncing";
|
|
19
|
+
/**
|
|
20
|
+
* Contact syncing functionality
|
|
21
|
+
*/
|
|
22
|
+
readonly CONTACT_SYNCING: "Contact Syncing";
|
|
23
|
+
/**
|
|
24
|
+
* Network syncing functionality
|
|
25
|
+
*/
|
|
26
|
+
readonly NETWORK_SYNCING: "Network Syncing";
|
|
27
|
+
/**
|
|
28
|
+
* Authentication functionality
|
|
29
|
+
*/
|
|
30
|
+
readonly AUTHENTICATION: "Authentication";
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Actions used in profile-sync-controller MetaMetrics events
|
|
34
|
+
*/
|
|
35
|
+
export declare const BackupAndSyncActions: {
|
|
36
|
+
readonly ACCOUNTS_SYNC_ADDED: "Accounts Sync Added";
|
|
37
|
+
readonly ACCOUNTS_SYNC_NAME_UPDATED: "Accounts Sync Name Updated";
|
|
38
|
+
readonly ACCOUNTS_SYNC_ERRONEOUS_SITUATION: "Accounts Sync Erroneous Situation";
|
|
39
|
+
readonly CONTACTS_SYNC_CONTACT_UPDATED: "Contacts Sync Contact Updated";
|
|
40
|
+
readonly CONTACTS_SYNC_CONTACT_DELETED: "Contacts Sync Contact Deleted";
|
|
41
|
+
readonly CONTACTS_SYNC_ERRONEOUS_SITUATION: "Contacts Sync Erroneous Situation";
|
|
42
|
+
readonly NETWORK_SYNC_ADDED: "Network Sync Added";
|
|
43
|
+
readonly NETWORK_SYNC_UPDATED: "Network Sync Updated";
|
|
44
|
+
readonly NETWORK_SYNC_REMOVED: "Network Sync Removed";
|
|
45
|
+
readonly SIGN_IN: "Sign In";
|
|
46
|
+
readonly SIGN_OUT: "Sign Out";
|
|
47
|
+
readonly AUTHENTICATION_FAILED: "Authentication Failed";
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Type definitions for the constants to ensure type safety
|
|
51
|
+
*/
|
|
52
|
+
export type BackupAndSyncFeatureName = (typeof BackupAndSyncFeatureNames)[keyof typeof BackupAndSyncFeatureNames];
|
|
53
|
+
export type BackupAndSyncAction = (typeof BackupAndSyncActions)[keyof typeof BackupAndSyncActions];
|
|
54
|
+
/**
|
|
55
|
+
* Helper function to create standardized MetaMetrics event properties
|
|
56
|
+
* for profile-sync-controller events
|
|
57
|
+
*
|
|
58
|
+
* @param featureName - The feature name to use in the event properties
|
|
59
|
+
* @param action - The action to use in the event properties
|
|
60
|
+
* @param additionalProperties - Optional additional properties to include
|
|
61
|
+
* @returns An object containing the standardized event properties
|
|
62
|
+
*/
|
|
63
|
+
export declare const createBackupAndSyncEventProperties: (featureName: BackupAndSyncFeatureName, action: BackupAndSyncAction, additionalProperties?: Record<string, unknown>) => {
|
|
64
|
+
feature_name: BackupAndSyncFeatureName;
|
|
65
|
+
action: BackupAndSyncAction;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Pre-defined event property sets for common profile-sync-controller events
|
|
69
|
+
*/
|
|
70
|
+
export declare const BackupAndSyncEventProperties: {
|
|
71
|
+
readonly ACCOUNT_ADDED: (profileId: string) => {
|
|
72
|
+
profile_id: string;
|
|
73
|
+
};
|
|
74
|
+
readonly ACCOUNT_NAME_UPDATED: (profileId: string) => {
|
|
75
|
+
profile_id: string;
|
|
76
|
+
};
|
|
77
|
+
readonly ACCOUNT_SYNC_ERROR: (profileId: string, situationMessage: string) => {
|
|
78
|
+
profile_id: string;
|
|
79
|
+
situation_message: string;
|
|
80
|
+
};
|
|
81
|
+
readonly CONTACT_UPDATED: (profileId: string) => {
|
|
82
|
+
feature_name: BackupAndSyncFeatureName;
|
|
83
|
+
action: BackupAndSyncAction;
|
|
84
|
+
};
|
|
85
|
+
readonly CONTACT_DELETED: (profileId: string) => {
|
|
86
|
+
feature_name: BackupAndSyncFeatureName;
|
|
87
|
+
action: BackupAndSyncAction;
|
|
88
|
+
};
|
|
89
|
+
readonly CONTACT_SYNC_ERROR: (profileId: string, situationMessage: string) => {
|
|
90
|
+
feature_name: BackupAndSyncFeatureName;
|
|
91
|
+
action: BackupAndSyncAction;
|
|
92
|
+
};
|
|
93
|
+
readonly NETWORK_ADDED: (profileId: string, chainId: string) => {
|
|
94
|
+
profile_id: string;
|
|
95
|
+
chain_id: string;
|
|
96
|
+
};
|
|
97
|
+
readonly NETWORK_UPDATED: (profileId: string, chainId: string) => {
|
|
98
|
+
profile_id: string;
|
|
99
|
+
chain_id: string;
|
|
100
|
+
};
|
|
101
|
+
readonly NETWORK_REMOVED: (profileId: string, chainId: string) => {
|
|
102
|
+
profile_id: string;
|
|
103
|
+
chain_id: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=metametrics.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metametrics.d.mts","sourceRoot":"","sources":["../../src/shared/metametrics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB;IACpC;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEK,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;CAoBvB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEnE;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC,gBAChC,wBAAwB,UAC7B,mBAAmB,yBACJ,OAAO,MAAM,EAAE,OAAO,CAAC;;;CAK9C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,4BAA4B;wCAEZ,MAAM;;;+CAGC,MAAM;;;6CAGR,MAAM,oBAAoB,MAAM;;;;0CAMnC,MAAM;;;;0CAMN,MAAM;;;;6CAMH,MAAM,oBAAoB,MAAM;;;;wCAWrC,MAAM,WAAW,MAAM;;;;0CAIrB,MAAM,WAAW,MAAM;;;;0CAIvB,MAAM,WAAW,MAAM;;;;CAI5C,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MetaMetrics event constants for profile-sync-controller
|
|
3
|
+
*
|
|
4
|
+
* This library provides standardized constants for MetaMetrics events
|
|
5
|
+
* to avoid magic strings and ensure consistency across clients.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Feature names used in profile-sync-controller MetaMetrics events
|
|
9
|
+
*/
|
|
10
|
+
export const BackupAndSyncFeatureNames = {
|
|
11
|
+
/**
|
|
12
|
+
* The main backup and sync feature
|
|
13
|
+
*/
|
|
14
|
+
BACKUP_AND_SYNC: 'Backup And Sync',
|
|
15
|
+
/**
|
|
16
|
+
* Account syncing functionality
|
|
17
|
+
*/
|
|
18
|
+
ACCOUNT_SYNCING: 'Account Syncing',
|
|
19
|
+
/**
|
|
20
|
+
* Contact syncing functionality
|
|
21
|
+
*/
|
|
22
|
+
CONTACT_SYNCING: 'Contact Syncing',
|
|
23
|
+
/**
|
|
24
|
+
* Network syncing functionality
|
|
25
|
+
*/
|
|
26
|
+
NETWORK_SYNCING: 'Network Syncing',
|
|
27
|
+
/**
|
|
28
|
+
* Authentication functionality
|
|
29
|
+
*/
|
|
30
|
+
AUTHENTICATION: 'Authentication',
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Actions used in profile-sync-controller MetaMetrics events
|
|
34
|
+
*/
|
|
35
|
+
export const BackupAndSyncActions = {
|
|
36
|
+
// Account syncing actions
|
|
37
|
+
ACCOUNTS_SYNC_ADDED: 'Accounts Sync Added',
|
|
38
|
+
ACCOUNTS_SYNC_NAME_UPDATED: 'Accounts Sync Name Updated',
|
|
39
|
+
ACCOUNTS_SYNC_ERRONEOUS_SITUATION: 'Accounts Sync Erroneous Situation',
|
|
40
|
+
// Contact syncing actions
|
|
41
|
+
CONTACTS_SYNC_CONTACT_UPDATED: 'Contacts Sync Contact Updated',
|
|
42
|
+
CONTACTS_SYNC_CONTACT_DELETED: 'Contacts Sync Contact Deleted',
|
|
43
|
+
CONTACTS_SYNC_ERRONEOUS_SITUATION: 'Contacts Sync Erroneous Situation',
|
|
44
|
+
// Network syncing actions
|
|
45
|
+
NETWORK_SYNC_ADDED: 'Network Sync Added',
|
|
46
|
+
NETWORK_SYNC_UPDATED: 'Network Sync Updated',
|
|
47
|
+
NETWORK_SYNC_REMOVED: 'Network Sync Removed',
|
|
48
|
+
// Authentication actions
|
|
49
|
+
SIGN_IN: 'Sign In',
|
|
50
|
+
SIGN_OUT: 'Sign Out',
|
|
51
|
+
AUTHENTICATION_FAILED: 'Authentication Failed',
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Helper function to create standardized MetaMetrics event properties
|
|
55
|
+
* for profile-sync-controller events
|
|
56
|
+
*
|
|
57
|
+
* @param featureName - The feature name to use in the event properties
|
|
58
|
+
* @param action - The action to use in the event properties
|
|
59
|
+
* @param additionalProperties - Optional additional properties to include
|
|
60
|
+
* @returns An object containing the standardized event properties
|
|
61
|
+
*/
|
|
62
|
+
export const createBackupAndSyncEventProperties = (featureName, action, additionalProperties) => ({
|
|
63
|
+
feature_name: featureName,
|
|
64
|
+
action,
|
|
65
|
+
...additionalProperties,
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Pre-defined event property sets for common profile-sync-controller events
|
|
69
|
+
*/
|
|
70
|
+
export const BackupAndSyncEventProperties = {
|
|
71
|
+
// Account syncing events
|
|
72
|
+
ACCOUNT_ADDED: (profileId) => ({
|
|
73
|
+
profile_id: profileId,
|
|
74
|
+
}),
|
|
75
|
+
ACCOUNT_NAME_UPDATED: (profileId) => ({
|
|
76
|
+
profile_id: profileId,
|
|
77
|
+
}),
|
|
78
|
+
ACCOUNT_SYNC_ERROR: (profileId, situationMessage) => ({
|
|
79
|
+
profile_id: profileId,
|
|
80
|
+
situation_message: situationMessage,
|
|
81
|
+
}),
|
|
82
|
+
// Contact syncing events
|
|
83
|
+
CONTACT_UPDATED: (profileId) => createBackupAndSyncEventProperties(BackupAndSyncFeatureNames.BACKUP_AND_SYNC, BackupAndSyncActions.CONTACTS_SYNC_CONTACT_UPDATED, { profile_id: profileId }),
|
|
84
|
+
CONTACT_DELETED: (profileId) => createBackupAndSyncEventProperties(BackupAndSyncFeatureNames.BACKUP_AND_SYNC, BackupAndSyncActions.CONTACTS_SYNC_CONTACT_DELETED, { profile_id: profileId }),
|
|
85
|
+
CONTACT_SYNC_ERROR: (profileId, situationMessage) => createBackupAndSyncEventProperties(BackupAndSyncFeatureNames.BACKUP_AND_SYNC, BackupAndSyncActions.CONTACTS_SYNC_ERRONEOUS_SITUATION, {
|
|
86
|
+
profile_id: profileId,
|
|
87
|
+
additional_description: situationMessage,
|
|
88
|
+
}),
|
|
89
|
+
// Network syncing events
|
|
90
|
+
NETWORK_ADDED: (profileId, chainId) => ({
|
|
91
|
+
profile_id: profileId,
|
|
92
|
+
chain_id: chainId,
|
|
93
|
+
}),
|
|
94
|
+
NETWORK_UPDATED: (profileId, chainId) => ({
|
|
95
|
+
profile_id: profileId,
|
|
96
|
+
chain_id: chainId,
|
|
97
|
+
}),
|
|
98
|
+
NETWORK_REMOVED: (profileId, chainId) => ({
|
|
99
|
+
profile_id: profileId,
|
|
100
|
+
chain_id: chainId,
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=metametrics.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metametrics.mjs","sourceRoot":"","sources":["../../src/shared/metametrics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAClC;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAClC;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAClC;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAClC;;OAEG;IACH,cAAc,EAAE,gBAAgB;CACxB,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,0BAA0B;IAC1B,mBAAmB,EAAE,qBAAqB;IAC1C,0BAA0B,EAAE,4BAA4B;IACxD,iCAAiC,EAAE,mCAAmC;IAEtE,0BAA0B;IAC1B,6BAA6B,EAAE,+BAA+B;IAC9D,6BAA6B,EAAE,+BAA+B;IAC9D,iCAAiC,EAAE,mCAAmC;IAEtE,0BAA0B;IAC1B,kBAAkB,EAAE,oBAAoB;IACxC,oBAAoB,EAAE,sBAAsB;IAC5C,oBAAoB,EAAE,sBAAsB;IAE5C,yBAAyB;IACzB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,qBAAqB,EAAE,uBAAuB;CACtC,CAAC;AAUX;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAChD,WAAqC,EACrC,MAA2B,EAC3B,oBAA8C,EAC9C,EAAE,CAAC,CAAC;IACJ,YAAY,EAAE,WAAW;IACzB,MAAM;IACN,GAAG,oBAAoB;CACxB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,yBAAyB;IACzB,aAAa,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC;QACrC,UAAU,EAAE,SAAS;KACtB,CAAC;IACF,oBAAoB,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC;QAC5C,UAAU,EAAE,SAAS;KACtB,CAAC;IACF,kBAAkB,EAAE,CAAC,SAAiB,EAAE,gBAAwB,EAAE,EAAE,CAAC,CAAC;QACpE,UAAU,EAAE,SAAS;QACrB,iBAAiB,EAAE,gBAAgB;KACpC,CAAC;IAEF,yBAAyB;IACzB,eAAe,EAAE,CAAC,SAAiB,EAAE,EAAE,CACrC,kCAAkC,CAChC,yBAAyB,CAAC,eAAe,EACzC,oBAAoB,CAAC,6BAA6B,EAClD,EAAE,UAAU,EAAE,SAAS,EAAE,CAC1B;IACH,eAAe,EAAE,CAAC,SAAiB,EAAE,EAAE,CACrC,kCAAkC,CAChC,yBAAyB,CAAC,eAAe,EACzC,oBAAoB,CAAC,6BAA6B,EAClD,EAAE,UAAU,EAAE,SAAS,EAAE,CAC1B;IACH,kBAAkB,EAAE,CAAC,SAAiB,EAAE,gBAAwB,EAAE,EAAE,CAClE,kCAAkC,CAChC,yBAAyB,CAAC,eAAe,EACzC,oBAAoB,CAAC,iCAAiC,EACtD;QACE,UAAU,EAAE,SAAS;QACrB,sBAAsB,EAAE,gBAAgB;KACzC,CACF;IAEH,yBAAyB;IACzB,aAAa,EAAE,CAAC,SAAiB,EAAE,OAAe,EAAE,EAAE,CAAC,CAAC;QACtD,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,OAAO;KAClB,CAAC;IACF,eAAe,EAAE,CAAC,SAAiB,EAAE,OAAe,EAAE,EAAE,CAAC,CAAC;QACxD,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,OAAO;KAClB,CAAC;IACF,eAAe,EAAE,CAAC,SAAiB,EAAE,OAAe,EAAE,EAAE,CAAC,CAAC;QACxD,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,OAAO;KAClB,CAAC;CACM,CAAC","sourcesContent":["/**\n * MetaMetrics event constants for profile-sync-controller\n *\n * This library provides standardized constants for MetaMetrics events\n * to avoid magic strings and ensure consistency across clients.\n */\n\n/**\n * Feature names used in profile-sync-controller MetaMetrics events\n */\nexport const BackupAndSyncFeatureNames = {\n /**\n * The main backup and sync feature\n */\n BACKUP_AND_SYNC: 'Backup And Sync',\n /**\n * Account syncing functionality\n */\n ACCOUNT_SYNCING: 'Account Syncing',\n /**\n * Contact syncing functionality\n */\n CONTACT_SYNCING: 'Contact Syncing',\n /**\n * Network syncing functionality\n */\n NETWORK_SYNCING: 'Network Syncing',\n /**\n * Authentication functionality\n */\n AUTHENTICATION: 'Authentication',\n} as const;\n\n/**\n * Actions used in profile-sync-controller MetaMetrics events\n */\nexport const BackupAndSyncActions = {\n // Account syncing actions\n ACCOUNTS_SYNC_ADDED: 'Accounts Sync Added',\n ACCOUNTS_SYNC_NAME_UPDATED: 'Accounts Sync Name Updated',\n ACCOUNTS_SYNC_ERRONEOUS_SITUATION: 'Accounts Sync Erroneous Situation',\n\n // Contact syncing actions\n CONTACTS_SYNC_CONTACT_UPDATED: 'Contacts Sync Contact Updated',\n CONTACTS_SYNC_CONTACT_DELETED: 'Contacts Sync Contact Deleted',\n CONTACTS_SYNC_ERRONEOUS_SITUATION: 'Contacts Sync Erroneous Situation',\n\n // Network syncing actions\n NETWORK_SYNC_ADDED: 'Network Sync Added',\n NETWORK_SYNC_UPDATED: 'Network Sync Updated',\n NETWORK_SYNC_REMOVED: 'Network Sync Removed',\n\n // Authentication actions\n SIGN_IN: 'Sign In',\n SIGN_OUT: 'Sign Out',\n AUTHENTICATION_FAILED: 'Authentication Failed',\n} as const;\n\n/**\n * Type definitions for the constants to ensure type safety\n */\nexport type BackupAndSyncFeatureName =\n (typeof BackupAndSyncFeatureNames)[keyof typeof BackupAndSyncFeatureNames];\nexport type BackupAndSyncAction =\n (typeof BackupAndSyncActions)[keyof typeof BackupAndSyncActions];\n\n/**\n * Helper function to create standardized MetaMetrics event properties\n * for profile-sync-controller events\n *\n * @param featureName - The feature name to use in the event properties\n * @param action - The action to use in the event properties\n * @param additionalProperties - Optional additional properties to include\n * @returns An object containing the standardized event properties\n */\nexport const createBackupAndSyncEventProperties = (\n featureName: BackupAndSyncFeatureName,\n action: BackupAndSyncAction,\n additionalProperties?: Record<string, unknown>,\n) => ({\n feature_name: featureName,\n action,\n ...additionalProperties,\n});\n\n/**\n * Pre-defined event property sets for common profile-sync-controller events\n */\nexport const BackupAndSyncEventProperties = {\n // Account syncing events\n ACCOUNT_ADDED: (profileId: string) => ({\n profile_id: profileId,\n }),\n ACCOUNT_NAME_UPDATED: (profileId: string) => ({\n profile_id: profileId,\n }),\n ACCOUNT_SYNC_ERROR: (profileId: string, situationMessage: string) => ({\n profile_id: profileId,\n situation_message: situationMessage,\n }),\n\n // Contact syncing events\n CONTACT_UPDATED: (profileId: string) =>\n createBackupAndSyncEventProperties(\n BackupAndSyncFeatureNames.BACKUP_AND_SYNC,\n BackupAndSyncActions.CONTACTS_SYNC_CONTACT_UPDATED,\n { profile_id: profileId },\n ),\n CONTACT_DELETED: (profileId: string) =>\n createBackupAndSyncEventProperties(\n BackupAndSyncFeatureNames.BACKUP_AND_SYNC,\n BackupAndSyncActions.CONTACTS_SYNC_CONTACT_DELETED,\n { profile_id: profileId },\n ),\n CONTACT_SYNC_ERROR: (profileId: string, situationMessage: string) =>\n createBackupAndSyncEventProperties(\n BackupAndSyncFeatureNames.BACKUP_AND_SYNC,\n BackupAndSyncActions.CONTACTS_SYNC_ERRONEOUS_SITUATION,\n {\n profile_id: profileId,\n additional_description: situationMessage,\n },\n ),\n\n // Network syncing events\n NETWORK_ADDED: (profileId: string, chainId: string) => ({\n profile_id: profileId,\n chain_id: chainId,\n }),\n NETWORK_UPDATED: (profileId: string, chainId: string) => ({\n profile_id: profileId,\n chain_id: chainId,\n }),\n NETWORK_REMOVED: (profileId: string, chainId: string) => ({\n profile_id: profileId,\n chain_id: chainId,\n }),\n} as const;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/profile-sync-controller",
|
|
3
|
-
"version": "19.0.0-preview-
|
|
3
|
+
"version": "19.0.0-preview-f9a5dd05",
|
|
4
4
|
"description": "The profile sync helps developers synchronize data across multiple clients and devices in a privacy-preserving way. All data saved in the user storage database is encrypted client-side to preserve privacy. The user storage provides a modular design, giving developers the flexibility to construct and manage their storage spaces in a way that best suits their needs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
103
|
"@metamask/base-controller": "^8.0.1",
|
|
104
|
-
"@metamask/snaps-sdk": "^
|
|
105
|
-
"@metamask/snaps-utils": "^
|
|
104
|
+
"@metamask/snaps-sdk": "^7.1.0",
|
|
105
|
+
"@metamask/snaps-utils": "^9.4.0",
|
|
106
106
|
"@noble/ciphers": "^0.5.2",
|
|
107
107
|
"@noble/hashes": "^1.4.0",
|
|
108
108
|
"immer": "^9.0.6",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"@metamask/keyring-internal-api": "^6.2.0",
|
|
120
120
|
"@metamask/network-controller": "^24.0.0",
|
|
121
121
|
"@metamask/providers": "^22.1.0",
|
|
122
|
-
"@metamask/snaps-controllers": "^
|
|
122
|
+
"@metamask/snaps-controllers": "^12.3.1",
|
|
123
123
|
"@types/jest": "^27.4.1",
|
|
124
124
|
"deepmerge": "^4.2.2",
|
|
125
125
|
"ethers": "^6.12.0",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"@metamask/keyring-controller": "^22.0.0",
|
|
138
138
|
"@metamask/network-controller": "^24.0.0",
|
|
139
139
|
"@metamask/providers": "^22.0.0",
|
|
140
|
-
"@metamask/snaps-controllers": "^
|
|
140
|
+
"@metamask/snaps-controllers": "^12.0.0",
|
|
141
141
|
"webextension-polyfill": "^0.10.0 || ^0.11.0 || ^0.12.0"
|
|
142
142
|
},
|
|
143
143
|
"engines": {
|