@configdirector/nuxt-sdk 0.6.0 → 0.7.0
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.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/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/nitro/plugin.d.mts +1 -1
- package/dist/runtime/nitro/plugin.d.ts +1 -1
- package/dist/runtime/nitro/plugin.mjs +3 -3
- package/dist/runtime/plugin.client.mjs +7 -2
- package/dist/runtime/server/composables/useConfigDirectorClient.d.mts +1 -1
- package/dist/runtime/server/composables/useConfigDirectorClient.d.ts +1 -1
- package/dist/runtime/{types-DGQ1B6mZ.d.mts → types-BDwzL0dp.d.mts} +1 -1
- package/dist/runtime/{types-D9IS8RoC.d.mts → types-BkRZRTVv.d.mts} +1 -1
- package/dist/runtime/{types-BWxsGnk2.d.mts → types-f2z6DgES.d.mts} +8 -0
- package/package.json +3 -3
package/dist/module.json
CHANGED
|
@@ -1271,10 +1271,10 @@ var ServerTelemetryEventCollector = class extends TelemetryEventCollector {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
evaluatedConfig(payload) {
|
|
1273
1273
|
if (!this.collectEvents) return;
|
|
1274
|
-
if (payload.context?.id) this.contexts.set(payload.context.id, payload.context);
|
|
1274
|
+
if (payload.context?.id && !payload.context.anonymous) this.contexts.set(payload.context.id, payload.context);
|
|
1275
1275
|
const event = {
|
|
1276
1276
|
...payload.evaluation,
|
|
1277
|
-
contextId: payload.context?.id
|
|
1277
|
+
contextId: payload.context?.anonymous ? void 0 : payload.context?.id
|
|
1278
1278
|
};
|
|
1279
1279
|
this.evaluationEventQueue.push(this.sanitizeEvaluatedConfigEvent(event));
|
|
1280
1280
|
}
|
|
@@ -1552,7 +1552,7 @@ var plugin_default = defineNitroPlugin((nitroApp) => {
|
|
|
1552
1552
|
const { serverSdkKey, baseUrl } = runtimeConfig.configdirector;
|
|
1553
1553
|
const client = new DefaultConfigDirectorClient(serverSdkKey, {
|
|
1554
1554
|
sdkName: "nuxt-sdk",
|
|
1555
|
-
sdkVersion: "0.
|
|
1555
|
+
sdkVersion: "0.7.0"
|
|
1556
1556
|
}, {
|
|
1557
1557
|
logger,
|
|
1558
1558
|
...baseUrl ? { connection: { url: baseUrl } } : {}
|
|
@@ -407,7 +407,8 @@ var StreamingTransport = class {
|
|
|
407
407
|
body: JSON.stringify({
|
|
408
408
|
givenContext: context,
|
|
409
409
|
metaContext: this.options.metaContext,
|
|
410
|
-
clientSdkKey: this.options.clientSdkKey
|
|
410
|
+
clientSdkKey: this.options.clientSdkKey,
|
|
411
|
+
instanceId: this.options.instanceId
|
|
411
412
|
}),
|
|
412
413
|
onMessage: ({ data }) => {
|
|
413
414
|
this.dispatchMessage(data);
|
|
@@ -764,6 +765,7 @@ var PollingTransport = class extends AbstractPollingTransport {
|
|
|
764
765
|
givenContext: context,
|
|
765
766
|
metaContext: this.options.metaContext,
|
|
766
767
|
clientSdkKey: this.options.clientSdkKey,
|
|
768
|
+
instanceId: this.options.instanceId,
|
|
767
769
|
lastUpdateTimestamp: this.lastUpdateTimestamp
|
|
768
770
|
})
|
|
769
771
|
}, this.logger);
|
|
@@ -824,7 +826,9 @@ var DefaultConfigDirectorClient = class {
|
|
|
824
826
|
readyResolve;
|
|
825
827
|
currentContext;
|
|
826
828
|
connectionMode;
|
|
829
|
+
instanceId;
|
|
827
830
|
constructor(telemetryClient, clientSdkKey, sdkOptions, clientOptions, internalClientOptions) {
|
|
831
|
+
this.instanceId = crypto.randomUUID();
|
|
828
832
|
this.logger = clientOptions?.logger ?? createDefaultLogger$1();
|
|
829
833
|
this.timeout = clientOptions?.connection?.timeout ?? 3e3;
|
|
830
834
|
const urlFactory = internalClientOptions?.urlFactory ?? defaultUrlFactory;
|
|
@@ -833,6 +837,7 @@ var DefaultConfigDirectorClient = class {
|
|
|
833
837
|
const transportConstructor = this.getTransportConstructor(this.connectionMode);
|
|
834
838
|
this.telemetryClient = telemetryClient;
|
|
835
839
|
this.transport = new transportConstructor({
|
|
840
|
+
instanceId: this.instanceId,
|
|
836
841
|
clientSdkKey,
|
|
837
842
|
baseUrl,
|
|
838
843
|
resolveUrl: urlFactory,
|
|
@@ -1212,7 +1217,7 @@ var plugin_client_default = defineNuxtPlugin((nuxtApp) => {
|
|
|
1212
1217
|
const { clientSdkKey, appName, appVersion, baseUrl } = runtimeConfig.public.configdirector;
|
|
1213
1218
|
const client = createBrowserClient(clientSdkKey, {
|
|
1214
1219
|
sdkName: "nuxt-sdk",
|
|
1215
|
-
sdkVersion: "0.
|
|
1220
|
+
sdkVersion: "0.7.0"
|
|
1216
1221
|
}, {
|
|
1217
1222
|
metadata: {
|
|
1218
1223
|
appName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ConfigDirectorClient } from "../../types-
|
|
1
|
+
import { t as ConfigDirectorClient } from "../../types-BDwzL0dp.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/runtime/server/composables/useConfigDirectorClient.d.ts
|
|
4
4
|
declare const useConfigDirectorClient: () => ConfigDirectorClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ConfigDirectorClient } from "../../types-
|
|
1
|
+
import { t as ConfigDirectorClient } from "../../types-BDwzL0dp.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/runtime/server/composables/useConfigDirectorClient.d.ts
|
|
4
4
|
declare const useConfigDirectorClient: () => ConfigDirectorClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as ConfigState, r as ConfigValueType, t as ConfigDirectorContext } from "./types-
|
|
1
|
+
import { n as ConfigState, r as ConfigValueType, t as ConfigDirectorContext } from "./types-f2z6DgES.mjs";
|
|
2
2
|
|
|
3
3
|
//#region ../js-server-sdk/src/types.d.ts
|
|
4
4
|
type ClientEvents = {
|
|
@@ -37,6 +37,14 @@ type ConfigDirectorContext = {
|
|
|
37
37
|
traits?: {
|
|
38
38
|
[key: string]: unknown;
|
|
39
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* Whether or not to treat the context as anonymous during evaluation. When `true`, the
|
|
42
|
+
* context values will be used for targeting rules evaluation but the context will not be
|
|
43
|
+
* persisted and will not appear in the dashboard.
|
|
44
|
+
*
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
anonymous?: boolean;
|
|
40
48
|
};
|
|
41
49
|
//#endregion
|
|
42
50
|
export { ConfigState as n, ConfigValueType as r, ConfigDirectorContext as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configdirector/nuxt-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Nuxt SDK for ConfigDirector. ConfigDirector is a remote configuration and feature flag service.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ConfigDirector",
|
|
@@ -63,13 +63,13 @@
|
|
|
63
63
|
"@types/node": "latest",
|
|
64
64
|
"changelogen": "^0.6.2",
|
|
65
65
|
"eslint": "^10.2.1",
|
|
66
|
-
"nuxt": "^4.4.
|
|
66
|
+
"nuxt": "^4.4.8",
|
|
67
67
|
"playwright": "^1.60.0",
|
|
68
68
|
"rimraf": "^6.1.3",
|
|
69
69
|
"tsdown": "^0.21.7",
|
|
70
70
|
"tslib": "^2.8.1",
|
|
71
71
|
"typescript": "~6.0.3",
|
|
72
|
-
"vite": "^8.0.
|
|
72
|
+
"vite": "^8.0.16",
|
|
73
73
|
"vitest": "^4.1.8",
|
|
74
74
|
"vue-tsc": "^3.2.7"
|
|
75
75
|
}
|