@metamask-previews/remote-feature-flag-controller 6.1.0-preview-3866c0ff1 → 6.1.0-preview-e3275932a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +0 -1
  2. package/dist/client-config-api-service/abstract-client-config-api-service.cjs +3 -0
  3. package/dist/client-config-api-service/abstract-client-config-api-service.cjs.map +1 -0
  4. package/dist/client-config-api-service/{abstract-client-config-api-service.d.ts → abstract-client-config-api-service.d.cts} +3 -3
  5. package/dist/client-config-api-service/abstract-client-config-api-service.d.cts.map +1 -0
  6. package/dist/client-config-api-service/abstract-client-config-api-service.d.mts +17 -0
  7. package/dist/client-config-api-service/abstract-client-config-api-service.d.mts.map +1 -0
  8. package/dist/client-config-api-service/abstract-client-config-api-service.mjs +2 -0
  9. package/dist/client-config-api-service/abstract-client-config-api-service.mjs.map +1 -0
  10. package/dist/client-config-api-service/client-config-api-service.cjs +94 -0
  11. package/dist/client-config-api-service/client-config-api-service.cjs.map +1 -0
  12. package/dist/client-config-api-service/{client-config-api-service.d.ts → client-config-api-service.d.cts} +5 -5
  13. package/dist/client-config-api-service/client-config-api-service.d.cts.map +1 -0
  14. package/dist/client-config-api-service/client-config-api-service.d.mts +108 -0
  15. package/dist/client-config-api-service/client-config-api-service.d.mts.map +1 -0
  16. package/dist/client-config-api-service/client-config-api-service.mjs +90 -0
  17. package/dist/client-config-api-service/client-config-api-service.mjs.map +1 -0
  18. package/dist/constants.cjs +8 -0
  19. package/dist/constants.cjs.map +1 -0
  20. package/dist/{constants.d.ts → constants.d.cts} +1 -1
  21. package/dist/constants.d.cts.map +1 -0
  22. package/dist/constants.d.mts +5 -0
  23. package/dist/constants.d.mts.map +1 -0
  24. package/dist/{constants.js → constants.mjs} +1 -1
  25. package/dist/constants.mjs.map +1 -0
  26. package/dist/index.cjs +15 -0
  27. package/dist/index.cjs.map +1 -0
  28. package/dist/index.d.cts +8 -0
  29. package/dist/index.d.cts.map +1 -0
  30. package/dist/index.d.mts +8 -0
  31. package/dist/index.d.mts.map +1 -0
  32. package/dist/index.mjs +5 -0
  33. package/dist/index.mjs.map +1 -0
  34. package/dist/remote-feature-flag-controller-method-action-types.cjs +7 -0
  35. package/dist/remote-feature-flag-controller-method-action-types.cjs.map +1 -0
  36. package/dist/{remote-feature-flag-controller-method-action-types.d.ts → remote-feature-flag-controller-method-action-types.d.cts} +2 -2
  37. package/dist/remote-feature-flag-controller-method-action-types.d.cts.map +1 -0
  38. package/dist/remote-feature-flag-controller-method-action-types.d.mts +62 -0
  39. package/dist/remote-feature-flag-controller-method-action-types.d.mts.map +1 -0
  40. package/dist/{remote-feature-flag-controller-method-action-types.js → remote-feature-flag-controller-method-action-types.mjs} +1 -1
  41. package/dist/remote-feature-flag-controller-method-action-types.mjs.map +1 -0
  42. package/dist/remote-feature-flag-controller-types.cjs +32 -0
  43. package/dist/remote-feature-flag-controller-types.cjs.map +1 -0
  44. package/dist/{remote-feature-flag-controller-types.d.ts → remote-feature-flag-controller-types.d.cts} +2 -2
  45. package/dist/remote-feature-flag-controller-types.d.cts.map +1 -0
  46. package/dist/remote-feature-flag-controller-types.d.mts +64 -0
  47. package/dist/remote-feature-flag-controller-types.d.mts.map +1 -0
  48. package/dist/{remote-feature-flag-controller-types.js → remote-feature-flag-controller-types.mjs} +1 -1
  49. package/dist/remote-feature-flag-controller-types.mjs.map +1 -0
  50. package/dist/remote-feature-flag-controller.cjs +436 -0
  51. package/dist/remote-feature-flag-controller.cjs.map +1 -0
  52. package/dist/{remote-feature-flag-controller.d.ts → remote-feature-flag-controller.d.cts} +8 -8
  53. package/dist/remote-feature-flag-controller.d.cts.map +1 -0
  54. package/dist/remote-feature-flag-controller.d.mts +113 -0
  55. package/dist/remote-feature-flag-controller.d.mts.map +1 -0
  56. package/dist/remote-feature-flag-controller.mjs +431 -0
  57. package/dist/remote-feature-flag-controller.mjs.map +1 -0
  58. package/dist/utils/user-segmentation-utils.cjs +107 -0
  59. package/dist/utils/user-segmentation-utils.cjs.map +1 -0
  60. package/dist/utils/{user-segmentation-utils.d.ts → user-segmentation-utils.d.cts} +3 -3
  61. package/dist/utils/user-segmentation-utils.d.cts.map +1 -0
  62. package/dist/utils/user-segmentation-utils.d.mts +34 -0
  63. package/dist/utils/user-segmentation-utils.d.mts.map +1 -0
  64. package/dist/utils/{user-segmentation-utils.js → user-segmentation-utils.mjs} +5 -5
  65. package/dist/utils/user-segmentation-utils.mjs.map +1 -0
  66. package/dist/utils/version.cjs +78 -0
  67. package/dist/utils/version.cjs.map +1 -0
  68. package/dist/utils/{version.d.ts → version.d.cts} +4 -4
  69. package/dist/utils/version.d.cts.map +1 -0
  70. package/dist/utils/version.d.mts +26 -0
  71. package/dist/utils/version.d.mts.map +1 -0
  72. package/dist/utils/{version.js → version.mjs} +2 -2
  73. package/dist/utils/version.mjs.map +1 -0
  74. package/package.json +16 -12
  75. package/dist/client-config-api-service/abstract-client-config-api-service.d.ts.map +0 -1
  76. package/dist/client-config-api-service/abstract-client-config-api-service.js +0 -2
  77. package/dist/client-config-api-service/abstract-client-config-api-service.js.map +0 -1
  78. package/dist/client-config-api-service/client-config-api-service.d.ts.map +0 -1
  79. package/dist/client-config-api-service/client-config-api-service.js +0 -86
  80. package/dist/client-config-api-service/client-config-api-service.js.map +0 -1
  81. package/dist/constants.d.ts.map +0 -1
  82. package/dist/constants.js.map +0 -1
  83. package/dist/index.d.ts +0 -8
  84. package/dist/index.d.ts.map +0 -1
  85. package/dist/index.js +0 -5
  86. package/dist/index.js.map +0 -1
  87. package/dist/remote-feature-flag-controller-method-action-types.d.ts.map +0 -1
  88. package/dist/remote-feature-flag-controller-method-action-types.js.map +0 -1
  89. package/dist/remote-feature-flag-controller-types.d.ts.map +0 -1
  90. package/dist/remote-feature-flag-controller-types.js.map +0 -1
  91. package/dist/remote-feature-flag-controller.d.ts.map +0 -1
  92. package/dist/remote-feature-flag-controller.js +0 -453
  93. package/dist/remote-feature-flag-controller.js.map +0 -1
  94. package/dist/utils/user-segmentation-utils.d.ts.map +0 -1
  95. package/dist/utils/user-segmentation-utils.js.map +0 -1
  96. package/dist/utils/version.d.ts.map +0 -1
  97. package/dist/utils/version.js.map +0 -1
@@ -0,0 +1,62 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ import type { RemoteFeatureFlagController } from "./remote-feature-flag-controller.mjs";
6
+ /**
7
+ * Retrieves the remote feature flags, fetching from the API if necessary.
8
+ * Uses caching to prevent redundant API calls and handles concurrent fetches.
9
+ *
10
+ * @param force - When `true`, fetch even if the cache has not expired.
11
+ * Defaults to `false`. Has no effect when the controller is disabled.
12
+ * @returns A promise that resolves to the current set of feature flags.
13
+ */
14
+ export type RemoteFeatureFlagControllerUpdateRemoteFeatureFlagsAction = {
15
+ type: `RemoteFeatureFlagController:updateRemoteFeatureFlags`;
16
+ handler: RemoteFeatureFlagController['updateRemoteFeatureFlags'];
17
+ };
18
+ /**
19
+ * Enables the controller, allowing it to make network requests.
20
+ */
21
+ export type RemoteFeatureFlagControllerEnableAction = {
22
+ type: `RemoteFeatureFlagController:enable`;
23
+ handler: RemoteFeatureFlagController['enable'];
24
+ };
25
+ /**
26
+ * Disables the controller, preventing it from making network requests.
27
+ */
28
+ export type RemoteFeatureFlagControllerDisableAction = {
29
+ type: `RemoteFeatureFlagController:disable`;
30
+ handler: RemoteFeatureFlagController['disable'];
31
+ };
32
+ /**
33
+ * Sets a local override for a specific feature flag.
34
+ *
35
+ * @param flagName - The name of the feature flag to override.
36
+ * @param value - The override value for the feature flag.
37
+ */
38
+ export type RemoteFeatureFlagControllerSetFlagOverrideAction = {
39
+ type: `RemoteFeatureFlagController:setFlagOverride`;
40
+ handler: RemoteFeatureFlagController['setFlagOverride'];
41
+ };
42
+ /**
43
+ * Clears the local override for a specific feature flag.
44
+ *
45
+ * @param flagName - The name of the feature flag to clear.
46
+ */
47
+ export type RemoteFeatureFlagControllerRemoveFlagOverrideAction = {
48
+ type: `RemoteFeatureFlagController:removeFlagOverride`;
49
+ handler: RemoteFeatureFlagController['removeFlagOverride'];
50
+ };
51
+ /**
52
+ * Clears all local feature flag overrides.
53
+ */
54
+ export type RemoteFeatureFlagControllerClearAllFlagOverridesAction = {
55
+ type: `RemoteFeatureFlagController:clearAllFlagOverrides`;
56
+ handler: RemoteFeatureFlagController['clearAllFlagOverrides'];
57
+ };
58
+ /**
59
+ * Union of all RemoteFeatureFlagController action types.
60
+ */
61
+ export type RemoteFeatureFlagControllerMethodActions = RemoteFeatureFlagControllerUpdateRemoteFeatureFlagsAction | RemoteFeatureFlagControllerEnableAction | RemoteFeatureFlagControllerDisableAction | RemoteFeatureFlagControllerSetFlagOverrideAction | RemoteFeatureFlagControllerRemoveFlagOverrideAction | RemoteFeatureFlagControllerClearAllFlagOverridesAction;
62
+ //# sourceMappingURL=remote-feature-flag-controller-method-action-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-feature-flag-controller-method-action-types.d.mts","sourceRoot":"","sources":["../src/remote-feature-flag-controller-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,6CAA4C;AAEvF;;;;;;;GAOG;AACH,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,2BAA2B,CAAC,0BAA0B,CAAC,CAAC;CAClE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uCAAuC,GAAG;IACpD,IAAI,EAAE,oCAAoC,CAAC;IAC3C,OAAO,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;CAChD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,2BAA2B,CAAC,iBAAiB,CAAC,CAAC;CACzD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mDAAmD,GAAG;IAChE,IAAI,EAAE,gDAAgD,CAAC;IACvD,OAAO,EAAE,2BAA2B,CAAC,oBAAoB,CAAC,CAAC;CAC5D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sDAAsD,GAAG;IACnE,IAAI,EAAE,mDAAmD,CAAC;IAC1D,OAAO,EAAE,2BAA2B,CAAC,uBAAuB,CAAC,CAAC;CAC/D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wCAAwC,GAChD,yDAAyD,GACzD,uCAAuC,GACvC,wCAAwC,GACxC,gDAAgD,GAChD,mDAAmD,GACnD,sDAAsD,CAAC"}
@@ -3,4 +3,4 @@
3
3
  * Do not edit manually.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=remote-feature-flag-controller-method-action-types.js.map
6
+ //# sourceMappingURL=remote-feature-flag-controller-method-action-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-feature-flag-controller-method-action-types.mjs","sourceRoot":"","sources":["../src/remote-feature-flag-controller-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { RemoteFeatureFlagController } from './remote-feature-flag-controller.js';\n\n/**\n * Retrieves the remote feature flags, fetching from the API if necessary.\n * Uses caching to prevent redundant API calls and handles concurrent fetches.\n *\n * @param force - When `true`, fetch even if the cache has not expired.\n * Defaults to `false`. Has no effect when the controller is disabled.\n * @returns A promise that resolves to the current set of feature flags.\n */\nexport type RemoteFeatureFlagControllerUpdateRemoteFeatureFlagsAction = {\n type: `RemoteFeatureFlagController:updateRemoteFeatureFlags`;\n handler: RemoteFeatureFlagController['updateRemoteFeatureFlags'];\n};\n\n/**\n * Enables the controller, allowing it to make network requests.\n */\nexport type RemoteFeatureFlagControllerEnableAction = {\n type: `RemoteFeatureFlagController:enable`;\n handler: RemoteFeatureFlagController['enable'];\n};\n\n/**\n * Disables the controller, preventing it from making network requests.\n */\nexport type RemoteFeatureFlagControllerDisableAction = {\n type: `RemoteFeatureFlagController:disable`;\n handler: RemoteFeatureFlagController['disable'];\n};\n\n/**\n * Sets a local override for a specific feature flag.\n *\n * @param flagName - The name of the feature flag to override.\n * @param value - The override value for the feature flag.\n */\nexport type RemoteFeatureFlagControllerSetFlagOverrideAction = {\n type: `RemoteFeatureFlagController:setFlagOverride`;\n handler: RemoteFeatureFlagController['setFlagOverride'];\n};\n\n/**\n * Clears the local override for a specific feature flag.\n *\n * @param flagName - The name of the feature flag to clear.\n */\nexport type RemoteFeatureFlagControllerRemoveFlagOverrideAction = {\n type: `RemoteFeatureFlagController:removeFlagOverride`;\n handler: RemoteFeatureFlagController['removeFlagOverride'];\n};\n\n/**\n * Clears all local feature flag overrides.\n */\nexport type RemoteFeatureFlagControllerClearAllFlagOverridesAction = {\n type: `RemoteFeatureFlagController:clearAllFlagOverrides`;\n handler: RemoteFeatureFlagController['clearAllFlagOverrides'];\n};\n\n/**\n * Union of all RemoteFeatureFlagController action types.\n */\nexport type RemoteFeatureFlagControllerMethodActions =\n | RemoteFeatureFlagControllerUpdateRemoteFeatureFlagsAction\n | RemoteFeatureFlagControllerEnableAction\n | RemoteFeatureFlagControllerDisableAction\n | RemoteFeatureFlagControllerSetFlagOverrideAction\n | RemoteFeatureFlagControllerRemoveFlagOverrideAction\n | RemoteFeatureFlagControllerClearAllFlagOverridesAction;\n"]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThresholdVersion = exports.EnvironmentType = exports.DistributionType = exports.ClientType = void 0;
4
+ // Define accepted values for client, distribution, and environment
5
+ var ClientType;
6
+ (function (ClientType) {
7
+ ClientType["Extension"] = "extension";
8
+ ClientType["Mobile"] = "mobile";
9
+ })(ClientType || (exports.ClientType = ClientType = {}));
10
+ var DistributionType;
11
+ (function (DistributionType) {
12
+ DistributionType["Main"] = "main";
13
+ DistributionType["Flask"] = "flask";
14
+ /**
15
+ * @deprecated Use DistributionType Main with EnvironmentType Beta instead
16
+ */
17
+ DistributionType["Beta"] = "beta";
18
+ })(DistributionType || (exports.DistributionType = DistributionType = {}));
19
+ var EnvironmentType;
20
+ (function (EnvironmentType) {
21
+ EnvironmentType["Production"] = "prod";
22
+ EnvironmentType["ReleaseCandidate"] = "rc";
23
+ EnvironmentType["Development"] = "dev";
24
+ EnvironmentType["Beta"] = "beta";
25
+ EnvironmentType["Test"] = "test";
26
+ EnvironmentType["Exp"] = "exp";
27
+ })(EnvironmentType || (exports.EnvironmentType = EnvironmentType = {}));
28
+ var ThresholdVersion;
29
+ (function (ThresholdVersion) {
30
+ ThresholdVersion[ThresholdVersion["DirectValue"] = 2] = "DirectValue";
31
+ })(ThresholdVersion || (exports.ThresholdVersion = ThresholdVersion = {}));
32
+ //# sourceMappingURL=remote-feature-flag-controller-types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-feature-flag-controller-types.cjs","sourceRoot":"","sources":["../src/remote-feature-flag-controller-types.ts"],"names":[],"mappings":";;;AAEA,mEAAmE;AACnE,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;AACnB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,mCAAe,CAAA;IACf;;OAEG;IACH,iCAAa,CAAA;AACf,CAAC,EAPW,gBAAgB,gCAAhB,gBAAgB,QAO3B;AAED,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;IACvB,sCAAmB,CAAA;IACnB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,8BAAW,CAAA;AACb,CAAC,EAPW,eAAe,+BAAf,eAAe,QAO1B;AAiBD,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,qEAAe,CAAA;AACjB,CAAC,EAFW,gBAAgB,gCAAhB,gBAAgB,QAE3B","sourcesContent":["import type { Json, SemVerVersion } from '@metamask/utils';\n\n// Define accepted values for client, distribution, and environment\nexport enum ClientType {\n Extension = 'extension',\n Mobile = 'mobile',\n}\n\nexport enum DistributionType {\n Main = 'main',\n Flask = 'flask',\n /**\n * @deprecated Use DistributionType Main with EnvironmentType Beta instead\n */\n Beta = 'beta',\n}\n\nexport enum EnvironmentType {\n Production = 'prod',\n ReleaseCandidate = 'rc',\n Development = 'dev',\n Beta = 'beta',\n Test = 'test',\n Exp = 'exp',\n}\n\n/** Type representing a feature flag with multiple version entries */\nexport type MultiVersionFeatureFlagValue = {\n versions: Record<SemVerVersion, Json>;\n};\n\n/** Type representing the feature flags collection */\nexport type FeatureFlags = {\n [key: string]: Json;\n};\n\nexport type FeatureFlagScope = {\n type: string;\n value: number;\n};\n\nexport enum ThresholdVersion {\n DirectValue = 2,\n}\n\nexport type FeatureFlagScopeValue = {\n name: string;\n /**\n * Optional label for direct-value threshold entries. This replaces `name` in\n * v2 configurations and is not emitted in processed controller state.\n */\n thresholdName?: string;\n /**\n * Selects the threshold entry output shape. Unrecognized versions fall back\n * to the legacy `{ name, value }` wrapper for backwards compatibility.\n */\n thresholdVersion?: ThresholdVersion;\n scope: FeatureFlagScope;\n value: Json;\n /**\n * Optional list of MetaMetrics IDs to explicitly target. When the current\n * user's MetaMetrics ID matches any entry in this list, this threshold group\n * is selected immediately, bypassing hash-based rollout. Intended for QA and\n * Product Manager testing only, not general-purpose segmentation.\n */\n metaMetricsIds?: string[];\n};\n\nexport type ApiDataResponse = FeatureFlags[];\n\nexport type ServiceResponse = {\n remoteFeatureFlags: FeatureFlags;\n cacheTimestamp: number | null;\n};\n"]}
@@ -1,4 +1,4 @@
1
- import type { Json, SemVerVersion } from '@metamask/utils';
1
+ import type { Json, SemVerVersion } from "@metamask/utils";
2
2
  export declare enum ClientType {
3
3
  Extension = "extension",
4
4
  Mobile = "mobile"
@@ -61,4 +61,4 @@ export type ServiceResponse = {
61
61
  remoteFeatureFlags: FeatureFlags;
62
62
  cacheTimestamp: number | null;
63
63
  };
64
- //# sourceMappingURL=remote-feature-flag-controller-types.d.ts.map
64
+ //# sourceMappingURL=remote-feature-flag-controller-types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-feature-flag-controller-types.d.cts","sourceRoot":"","sources":["../src/remote-feature-flag-controller-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAG3D,oBAAY,UAAU;IACpB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAED,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,KAAK,UAAU;IACf;;OAEG;IACH,IAAI,SAAS;CACd;AAED,oBAAY,eAAe;IACzB,UAAU,SAAS;IACnB,gBAAgB,OAAO;IACvB,WAAW,QAAQ;IACnB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,qEAAqE;AACrE,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;CACvC,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,gBAAgB;IAC1B,WAAW,IAAI;CAChB;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,IAAI,CAAC;IACZ;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,EAAE,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,EAAE,YAAY,CAAC;IACjC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC"}
@@ -0,0 +1,64 @@
1
+ import type { Json, SemVerVersion } from "@metamask/utils";
2
+ export declare enum ClientType {
3
+ Extension = "extension",
4
+ Mobile = "mobile"
5
+ }
6
+ export declare enum DistributionType {
7
+ Main = "main",
8
+ Flask = "flask",
9
+ /**
10
+ * @deprecated Use DistributionType Main with EnvironmentType Beta instead
11
+ */
12
+ Beta = "beta"
13
+ }
14
+ export declare enum EnvironmentType {
15
+ Production = "prod",
16
+ ReleaseCandidate = "rc",
17
+ Development = "dev",
18
+ Beta = "beta",
19
+ Test = "test",
20
+ Exp = "exp"
21
+ }
22
+ /** Type representing a feature flag with multiple version entries */
23
+ export type MultiVersionFeatureFlagValue = {
24
+ versions: Record<SemVerVersion, Json>;
25
+ };
26
+ /** Type representing the feature flags collection */
27
+ export type FeatureFlags = {
28
+ [key: string]: Json;
29
+ };
30
+ export type FeatureFlagScope = {
31
+ type: string;
32
+ value: number;
33
+ };
34
+ export declare enum ThresholdVersion {
35
+ DirectValue = 2
36
+ }
37
+ export type FeatureFlagScopeValue = {
38
+ name: string;
39
+ /**
40
+ * Optional label for direct-value threshold entries. This replaces `name` in
41
+ * v2 configurations and is not emitted in processed controller state.
42
+ */
43
+ thresholdName?: string;
44
+ /**
45
+ * Selects the threshold entry output shape. Unrecognized versions fall back
46
+ * to the legacy `{ name, value }` wrapper for backwards compatibility.
47
+ */
48
+ thresholdVersion?: ThresholdVersion;
49
+ scope: FeatureFlagScope;
50
+ value: Json;
51
+ /**
52
+ * Optional list of MetaMetrics IDs to explicitly target. When the current
53
+ * user's MetaMetrics ID matches any entry in this list, this threshold group
54
+ * is selected immediately, bypassing hash-based rollout. Intended for QA and
55
+ * Product Manager testing only, not general-purpose segmentation.
56
+ */
57
+ metaMetricsIds?: string[];
58
+ };
59
+ export type ApiDataResponse = FeatureFlags[];
60
+ export type ServiceResponse = {
61
+ remoteFeatureFlags: FeatureFlags;
62
+ cacheTimestamp: number | null;
63
+ };
64
+ //# sourceMappingURL=remote-feature-flag-controller-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-feature-flag-controller-types.d.mts","sourceRoot":"","sources":["../src/remote-feature-flag-controller-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,wBAAwB;AAG3D,oBAAY,UAAU;IACpB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAED,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,KAAK,UAAU;IACf;;OAEG;IACH,IAAI,SAAS;CACd;AAED,oBAAY,eAAe;IACzB,UAAU,SAAS;IACnB,gBAAgB,OAAO;IACvB,WAAW,QAAQ;IACnB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,qEAAqE;AACrE,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;CACvC,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,gBAAgB;IAC1B,WAAW,IAAI;CAChB;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,IAAI,CAAC;IACZ;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,EAAE,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,EAAE,YAAY,CAAC;IACjC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC"}
@@ -26,4 +26,4 @@ export var ThresholdVersion;
26
26
  (function (ThresholdVersion) {
27
27
  ThresholdVersion[ThresholdVersion["DirectValue"] = 2] = "DirectValue";
28
28
  })(ThresholdVersion || (ThresholdVersion = {}));
29
- //# sourceMappingURL=remote-feature-flag-controller-types.js.map
29
+ //# sourceMappingURL=remote-feature-flag-controller-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-feature-flag-controller-types.mjs","sourceRoot":"","sources":["../src/remote-feature-flag-controller-types.ts"],"names":[],"mappings":"AAEA,mEAAmE;AACnE,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;AACnB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,MAAM,CAAN,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,mCAAe,CAAA;IACf;;OAEG;IACH,iCAAa,CAAA;AACf,CAAC,EAPW,gBAAgB,KAAhB,gBAAgB,QAO3B;AAED,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;IACvB,sCAAmB,CAAA;IACnB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,8BAAW,CAAA;AACb,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AAiBD,MAAM,CAAN,IAAY,gBAEX;AAFD,WAAY,gBAAgB;IAC1B,qEAAe,CAAA;AACjB,CAAC,EAFW,gBAAgB,KAAhB,gBAAgB,QAE3B","sourcesContent":["import type { Json, SemVerVersion } from '@metamask/utils';\n\n// Define accepted values for client, distribution, and environment\nexport enum ClientType {\n Extension = 'extension',\n Mobile = 'mobile',\n}\n\nexport enum DistributionType {\n Main = 'main',\n Flask = 'flask',\n /**\n * @deprecated Use DistributionType Main with EnvironmentType Beta instead\n */\n Beta = 'beta',\n}\n\nexport enum EnvironmentType {\n Production = 'prod',\n ReleaseCandidate = 'rc',\n Development = 'dev',\n Beta = 'beta',\n Test = 'test',\n Exp = 'exp',\n}\n\n/** Type representing a feature flag with multiple version entries */\nexport type MultiVersionFeatureFlagValue = {\n versions: Record<SemVerVersion, Json>;\n};\n\n/** Type representing the feature flags collection */\nexport type FeatureFlags = {\n [key: string]: Json;\n};\n\nexport type FeatureFlagScope = {\n type: string;\n value: number;\n};\n\nexport enum ThresholdVersion {\n DirectValue = 2,\n}\n\nexport type FeatureFlagScopeValue = {\n name: string;\n /**\n * Optional label for direct-value threshold entries. This replaces `name` in\n * v2 configurations and is not emitted in processed controller state.\n */\n thresholdName?: string;\n /**\n * Selects the threshold entry output shape. Unrecognized versions fall back\n * to the legacy `{ name, value }` wrapper for backwards compatibility.\n */\n thresholdVersion?: ThresholdVersion;\n scope: FeatureFlagScope;\n value: Json;\n /**\n * Optional list of MetaMetrics IDs to explicitly target. When the current\n * user's MetaMetrics ID matches any entry in this list, this threshold group\n * is selected immediately, bypassing hash-based rollout. Intended for QA and\n * Product Manager testing only, not general-purpose segmentation.\n */\n metaMetricsIds?: string[];\n};\n\nexport type ApiDataResponse = FeatureFlags[];\n\nexport type ServiceResponse = {\n remoteFeatureFlags: FeatureFlags;\n cacheTimestamp: number | null;\n};\n"]}