@configdirector/nuxt-sdk 1.13.2 → 1.14.1
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/dist/module.d.mts +43 -4
- package/dist/module.json +1 -1
- package/dist/runtime/app/composables/useConfigDirectorClient.d.mts +1 -1
- package/dist/runtime/app/composables/useConfigDirectorClient.d.ts +1 -1
- package/dist/runtime/app/composables/useConfigDirectorClientHooks.d.mts +1 -1
- package/dist/runtime/app/composables/useConfigDirectorClientHooks.d.ts +1 -1
- package/dist/runtime/app/composables/useConfigDirectorContext.d.mts +1 -1
- package/dist/runtime/app/composables/useConfigDirectorContext.d.ts +1 -1
- package/dist/runtime/app/composables/useConfigDirectorValue.d.mts +1 -1
- package/dist/runtime/app/composables/useConfigDirectorValue.d.ts +1 -1
- package/dist/runtime/{native-values-CfhP0yLS.d.mts → native-values-Cq3SCmEH.d.mts} +49 -4
- package/dist/runtime/nitro/offline-values.d.mts +1 -1
- package/dist/runtime/nitro/offline-values.d.ts +1 -1
- package/dist/runtime/nitro/plugin.d.mts +9 -2
- package/dist/runtime/nitro/plugin.d.ts +9 -2
- package/dist/runtime/nitro/plugin.mjs +319 -82
- package/dist/runtime/plugin.client.mjs +191 -3
- package/dist/runtime/plugin.server.mjs +3 -0
- package/dist/runtime/server/composables/useConfigDirectorServerClient.d.mts +1 -1
- package/dist/runtime/server/composables/useConfigDirectorServerClient.d.ts +1 -1
- package/dist/runtime/server/composables/useConfigDirectorServerHooks.d.mts +1 -1
- package/dist/runtime/server/composables/useConfigDirectorServerHooks.d.ts +1 -1
- package/dist/runtime/{types-BvqduMQP.d.mts → types-BNw2c3C0.d.mts} +17 -3
- package/dist/runtime/{types-qDEc6g8R.d.mts → types-CYquNKWW.d.mts} +18 -3
- package/dist/testing.d.mts +78 -7
- package/dist/testing.mjs +158 -5
- package/package.json +2 -2
package/dist/module.d.mts
CHANGED
|
@@ -8,24 +8,63 @@ type ConfigEnumLikeType = {
|
|
|
8
8
|
type ConfigValueType = string | number | boolean | object | ConfigEnumLikeType;
|
|
9
9
|
/**
|
|
10
10
|
* Why an evaluation returned the value it did. `found-match` returns a value from ConfigDirector,
|
|
11
|
-
* and `cached` a value kept on the device while a client SDK waits for live values.
|
|
11
|
+
* and `cached` a value kept on the device while a client SDK waits for live values.
|
|
12
|
+
* `rollout-skipped-no-identifier` returns the default targeting rule value: a server SDK skipped a
|
|
13
|
+
* percentage rollout because the context has no `id` to place it in a share. `value-missing`
|
|
12
14
|
* returns the in-code default value because the config has no value. Every other reason returns the
|
|
13
15
|
* in-code default value because of an error: the config does not exist (`config-state-missing`), no
|
|
14
16
|
* values have arrived yet (`client-not-ready`), or the value cannot be read as the type of the in-code
|
|
15
17
|
* default value.
|
|
16
18
|
*/
|
|
17
|
-
type EvaluationReason = "found-match" | "config-state-missing" | "client-not-ready" | "type-mismatch" | "value-missing" | "invalid-number" | "invalid-json" | "invalid-boolean" | "cached";
|
|
19
|
+
type EvaluationReason = "found-match" | "rollout-skipped-no-identifier" | "config-state-missing" | "client-not-ready" | "type-mismatch" | "value-missing" | "invalid-number" | "invalid-json" | "invalid-boolean" | "cached";
|
|
20
|
+
/**
|
|
21
|
+
* One of the values a config can serve, such as the control or a treatment of an experiment.
|
|
22
|
+
*/
|
|
23
|
+
type Variation = {
|
|
24
|
+
/** The ID ConfigDirector assigned to the variation, which stays the same when it is renamed. */id: string; /** The variation's name, when it has one. */
|
|
25
|
+
name?: string;
|
|
26
|
+
};
|
|
18
27
|
/**
|
|
19
28
|
* One evaluation of a config: the value it returned, why, and the context it was evaluated for.
|
|
20
29
|
*/
|
|
21
30
|
type ConfigEvaluation<T extends ConfigValueType = ConfigValueType> = {
|
|
22
31
|
/** The config key that was evaluated. */key: string; /** The value returned, which is the in-code default value when {@link isDefaultValue} is `true`. */
|
|
23
32
|
value: T; /** The ID ConfigDirector assigned to the value returned, when ConfigDirector sent one with it. */
|
|
24
|
-
valueId?: string;
|
|
33
|
+
valueId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The variation that was served. It is `undefined` when the config has no variations or the
|
|
36
|
+
* in-code default value is returned.
|
|
37
|
+
*/
|
|
38
|
+
variation?: Variation; /** Whether the evaluation returned the in-code default value. */
|
|
25
39
|
isDefaultValue: boolean; /** Why the evaluation returned this value. */
|
|
26
40
|
reason: EvaluationReason; /** The context the config was evaluated for, if any. */
|
|
27
41
|
context?: ConfigDirectorContext;
|
|
28
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* A value in the details of a tracked event: a string, a number, a boolean, or an array or object
|
|
45
|
+
* of such values.
|
|
46
|
+
*/
|
|
47
|
+
type TrackedEventDetailValue = string | number | boolean | TrackedEventDetailValue[] | {
|
|
48
|
+
[key: string]: TrackedEventDetailValue;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Details of a tracked event, such as the plan a customer chose. Details with more than 20
|
|
52
|
+
* top-level keys, or larger than 1 KB as JSON, are left out and the event is still reported.
|
|
53
|
+
*/
|
|
54
|
+
type TrackedEventDetails = {
|
|
55
|
+
[key: string]: TrackedEventDetailValue;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* What a tracked event carries besides its name.
|
|
59
|
+
*/
|
|
60
|
+
type TrackOptions = {
|
|
61
|
+
/**
|
|
62
|
+
* A number the event measures, such as an amount of money, a count or a duration. A value that
|
|
63
|
+
* is not a finite number is left out and the event is still reported.
|
|
64
|
+
*/
|
|
65
|
+
value?: number; /** Details of the event. */
|
|
66
|
+
details?: TrackedEventDetails;
|
|
67
|
+
};
|
|
29
68
|
/**
|
|
30
69
|
* The context to be sent to ConfigDirector: the user or other entity, such as a device or an
|
|
31
70
|
* organization, that configs are evaluated for. This context will be used for targeting rules
|
|
@@ -294,4 +333,4 @@ interface ModuleOptions {
|
|
|
294
333
|
}
|
|
295
334
|
declare const _default: _$_nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
296
335
|
//#endregion
|
|
297
|
-
export { type ConfigEvaluation, type EvaluationReason, ModuleOptions, type OfflineValue, type OfflineValues, _default as default };
|
|
336
|
+
export { type ConfigEvaluation, type EvaluationReason, ModuleOptions, type OfflineValue, type OfflineValues, type TrackOptions, type TrackedEventDetailValue, type TrackedEventDetails, type Variation, _default as default };
|
package/dist/module.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ClientHooks } from "../../types-
|
|
1
|
+
import { t as ClientHooks } from "../../types-BNw2c3C0.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/runtime/app/composables/useConfigDirectorClientHooks.d.ts
|
|
4
4
|
declare const useConfigDirectorClientHooks: (hooks: ClientHooks) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ClientHooks } from "../../types-
|
|
1
|
+
import { t as ClientHooks } from "../../types-BNw2c3C0.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/runtime/app/composables/useConfigDirectorClientHooks.d.ts
|
|
4
4
|
declare const useConfigDirectorClientHooks: (hooks: ClientHooks) => void;
|
|
@@ -11,27 +11,72 @@ type ConfigState = {
|
|
|
11
11
|
type: ConfigType;
|
|
12
12
|
value: string | undefined | null;
|
|
13
13
|
valueId?: string | undefined | null;
|
|
14
|
+
variation?: {
|
|
15
|
+
id: string;
|
|
16
|
+
name?: string | undefined | null;
|
|
17
|
+
} | undefined | null;
|
|
18
|
+
ruleId?: string | undefined | null;
|
|
19
|
+
shareId?: string | undefined | null;
|
|
14
20
|
};
|
|
15
21
|
/**
|
|
16
22
|
* Why an evaluation returned the value it did. `found-match` returns a value from ConfigDirector,
|
|
17
|
-
* and `cached` a value kept on the device while a client SDK waits for live values.
|
|
23
|
+
* and `cached` a value kept on the device while a client SDK waits for live values.
|
|
24
|
+
* `rollout-skipped-no-identifier` returns the default targeting rule value: a server SDK skipped a
|
|
25
|
+
* percentage rollout because the context has no `id` to place it in a share. `value-missing`
|
|
18
26
|
* returns the in-code default value because the config has no value. Every other reason returns the
|
|
19
27
|
* in-code default value because of an error: the config does not exist (`config-state-missing`), no
|
|
20
28
|
* values have arrived yet (`client-not-ready`), or the value cannot be read as the type of the in-code
|
|
21
29
|
* default value.
|
|
22
30
|
*/
|
|
23
|
-
type EvaluationReason = "found-match" | "config-state-missing" | "client-not-ready" | "type-mismatch" | "value-missing" | "invalid-number" | "invalid-json" | "invalid-boolean" | "cached";
|
|
31
|
+
type EvaluationReason = "found-match" | "rollout-skipped-no-identifier" | "config-state-missing" | "client-not-ready" | "type-mismatch" | "value-missing" | "invalid-number" | "invalid-json" | "invalid-boolean" | "cached";
|
|
32
|
+
/**
|
|
33
|
+
* One of the values a config can serve, such as the control or a treatment of an experiment.
|
|
34
|
+
*/
|
|
35
|
+
type Variation = {
|
|
36
|
+
/** The ID ConfigDirector assigned to the variation, which stays the same when it is renamed. */id: string; /** The variation's name, when it has one. */
|
|
37
|
+
name?: string;
|
|
38
|
+
};
|
|
24
39
|
/**
|
|
25
40
|
* One evaluation of a config: the value it returned, why, and the context it was evaluated for.
|
|
26
41
|
*/
|
|
27
42
|
type ConfigEvaluation<T extends ConfigValueType = ConfigValueType> = {
|
|
28
43
|
/** The config key that was evaluated. */key: string; /** The value returned, which is the in-code default value when {@link isDefaultValue} is `true`. */
|
|
29
44
|
value: T; /** The ID ConfigDirector assigned to the value returned, when ConfigDirector sent one with it. */
|
|
30
|
-
valueId?: string;
|
|
45
|
+
valueId?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The variation that was served. It is `undefined` when the config has no variations or the
|
|
48
|
+
* in-code default value is returned.
|
|
49
|
+
*/
|
|
50
|
+
variation?: Variation; /** Whether the evaluation returned the in-code default value. */
|
|
31
51
|
isDefaultValue: boolean; /** Why the evaluation returned this value. */
|
|
32
52
|
reason: EvaluationReason; /** The context the config was evaluated for, if any. */
|
|
33
53
|
context?: ConfigDirectorContext;
|
|
34
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* A value in the details of a tracked event: a string, a number, a boolean, or an array or object
|
|
57
|
+
* of such values.
|
|
58
|
+
*/
|
|
59
|
+
type TrackedEventDetailValue = string | number | boolean | TrackedEventDetailValue[] | {
|
|
60
|
+
[key: string]: TrackedEventDetailValue;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Details of a tracked event, such as the plan a customer chose. Details with more than 20
|
|
64
|
+
* top-level keys, or larger than 1 KB as JSON, are left out and the event is still reported.
|
|
65
|
+
*/
|
|
66
|
+
type TrackedEventDetails = {
|
|
67
|
+
[key: string]: TrackedEventDetailValue;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* What a tracked event carries besides its name.
|
|
71
|
+
*/
|
|
72
|
+
type TrackOptions = {
|
|
73
|
+
/**
|
|
74
|
+
* A number the event measures, such as an amount of money, a count or a duration. A value that
|
|
75
|
+
* is not a finite number is left out and the event is still reported.
|
|
76
|
+
*/
|
|
77
|
+
value?: number; /** Details of the event. */
|
|
78
|
+
details?: TrackedEventDetails;
|
|
79
|
+
};
|
|
35
80
|
/**
|
|
36
81
|
* The context to be sent to ConfigDirector: the user or other entity, such as a device or an
|
|
37
82
|
* organization, that configs are evaluated for. This context will be used for targeting rules
|
|
@@ -93,4 +138,4 @@ type NativeValue = boolean | number | string | NativeJsonValue[] | {
|
|
|
93
138
|
};
|
|
94
139
|
type NativeValues = Record<string, NativeValue>;
|
|
95
140
|
//#endregion
|
|
96
|
-
export { ConfigValueType as a, ConfigState as i, ConfigDirectorContext as n, ConnectionMode as o, ConfigEvaluation as r, NativeValues as t };
|
|
141
|
+
export { ConfigValueType as a, ConfigState as i, ConfigDirectorContext as n, ConnectionMode as o, ConfigEvaluation as r, TrackOptions as s, NativeValues as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as ConnectionMode } from "../native-values-
|
|
2
|
-
import { n as ConfigDirectorClient } from "../types-
|
|
1
|
+
import { o as ConnectionMode } from "../native-values-Cq3SCmEH.mjs";
|
|
2
|
+
import { n as ConfigDirectorClient } from "../types-CYquNKWW.mjs";
|
|
3
3
|
import * as _$nitropack from "nitropack";
|
|
4
4
|
|
|
5
5
|
//#region src/runtime/nitro/plugin.d.ts
|
|
@@ -11,5 +11,12 @@ declare module "nitropack" {
|
|
|
11
11
|
configDirectorInitialization: Promise<void>;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
declare module "nitropack/types" {
|
|
15
|
+
interface NitroApp {
|
|
16
|
+
configDirectorClient: ConfigDirectorClient;
|
|
17
|
+
configDirectorConnectionMode: ConnectionMode;
|
|
18
|
+
configDirectorInitialization: Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
14
21
|
//#endregion
|
|
15
22
|
export { _default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as ConnectionMode } from "../native-values-
|
|
2
|
-
import { n as ConfigDirectorClient } from "../types-
|
|
1
|
+
import { o as ConnectionMode } from "../native-values-Cq3SCmEH.mjs";
|
|
2
|
+
import { n as ConfigDirectorClient } from "../types-CYquNKWW.mjs";
|
|
3
3
|
import * as _$nitropack from "nitropack";
|
|
4
4
|
|
|
5
5
|
//#region src/runtime/nitro/plugin.d.ts
|
|
@@ -11,5 +11,12 @@ declare module "nitropack" {
|
|
|
11
11
|
configDirectorInitialization: Promise<void>;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
declare module "nitropack/types" {
|
|
15
|
+
interface NitroApp {
|
|
16
|
+
configDirectorClient: ConfigDirectorClient;
|
|
17
|
+
configDirectorConnectionMode: ConnectionMode;
|
|
18
|
+
configDirectorInitialization: Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
14
21
|
//#endregion
|
|
15
22
|
export { _default as default };
|