@configdirector/nuxt-sdk 1.13.0 → 1.13.2

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 CHANGED
@@ -188,11 +188,12 @@ interface ConfigDirectorPublicRuntimeConfig {
188
188
  */
189
189
  clientSdkKey?: string;
190
190
  /**
191
- * Your app's name. This value can be used in ConfigDirector targeting rules.
191
+ * Your app's name. Both the browser and the server send it, so ConfigDirector targeting rules can use it.
192
192
  */
193
193
  appName?: string;
194
194
  /**
195
- * Your app's version. This value can be used in ConfigDirector targeting rules.
195
+ * Your app's version. Both the browser and the server send it, so ConfigDirector targeting rules can
196
+ * use it.
196
197
  *
197
198
  * This can be a semver value or an arbitrary string (like a commit hash).
198
199
  */
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.0.0"
6
6
  },
7
- "version": "1.13.0"
7
+ "version": "1.13.2"
8
8
  }
@@ -8467,6 +8467,7 @@ var plugin_default = defineNitroPlugin((nitroApp) => {
8467
8467
  const runtimeConfig = useRuntimeConfig();
8468
8468
  const logger = createDefaultLogger(runtimeConfig.configdirector?.logLevel);
8469
8469
  const { serverSdkKey, baseUrl, connection } = runtimeConfig.configdirector;
8470
+ const { appName, appVersion } = runtimeConfig.public.configdirector;
8470
8471
  const connectionMode = connection?.mode || "streaming";
8471
8472
  if (connectionMode !== "offline" && !serverSdkKey) {
8472
8473
  const message = "The ConfigDirector serverSdkKey must be configured for the plugin to initialize. You can provide it in nuxt.config.ts under 'runtimeConfig.configdirector.serverSdkKey' or as a runtime environment variable named NUXT_CONFIGDIRECTOR_SERVER_SDK_KEY";
@@ -8476,9 +8477,13 @@ var plugin_default = defineNitroPlugin((nitroApp) => {
8476
8477
  logger.debug("Initializing ConfigDirector Nitro plugin");
8477
8478
  const client = new DefaultConfigDirectorClient(serverSdkKey || void 0, {
8478
8479
  sdkName: "nuxt-sdk",
8479
- sdkVersion: "1.13.0"
8480
+ sdkVersion: "1.13.2"
8480
8481
  }, {
8481
8482
  logger,
8483
+ metadata: {
8484
+ appName,
8485
+ appVersion
8486
+ },
8482
8487
  connection: {
8483
8488
  url: baseUrl || void 0,
8484
8489
  mode: connectionMode,
@@ -1143,8 +1143,8 @@ var PollingTransport = class extends AbstractPollingTransport {
1143
1143
  this.pollingIntervalSeconds = options.pollingInterval ?? 60;
1144
1144
  }
1145
1145
  async connect(context, timeout) {
1146
- const generation = ++this.connectionGeneration;
1147
- this.clearPollingInterval();
1146
+ this.endCurrentConnection();
1147
+ const generation = this.connectionGeneration;
1148
1148
  const clientSession = await this.options.clientSession;
1149
1149
  if (generation !== this.connectionGeneration) return this;
1150
1150
  try {
@@ -1159,9 +1159,14 @@ var PollingTransport = class extends AbstractPollingTransport {
1159
1159
  return this;
1160
1160
  }
1161
1161
  close() {
1162
- this.connectionGeneration++;
1162
+ this.endCurrentConnection();
1163
1163
  super.close();
1164
1164
  }
1165
+ endCurrentConnection() {
1166
+ this.connectionGeneration++;
1167
+ this.clearPollingInterval();
1168
+ this.lastUpdateTimestamp = void 0;
1169
+ }
1165
1170
  async fetchConfigs(context, timeout, clientSession) {
1166
1171
  if (this.fatalError) {
1167
1172
  this.logger.warn("[PollingTransport] There was a prior unrecoverable error. Ignoring attempt to reconnect.");
@@ -2381,7 +2386,7 @@ const buildClient = async (configdirector, logger) => {
2381
2386
  return {
2382
2387
  client: createBrowserClient(configdirector?.clientSdkKey || void 0, {
2383
2388
  sdkName: "nuxt-sdk",
2384
- sdkVersion: "1.13.0"
2389
+ sdkVersion: "1.13.2"
2385
2390
  }, {
2386
2391
  metadata: {
2387
2392
  appName: configdirector?.appName,
package/dist/testing.mjs CHANGED
@@ -1140,8 +1140,8 @@ var PollingTransport = class extends AbstractPollingTransport {
1140
1140
  this.pollingIntervalSeconds = options.pollingInterval ?? 60;
1141
1141
  }
1142
1142
  async connect(context, timeout) {
1143
- const generation = ++this.connectionGeneration;
1144
- this.clearPollingInterval();
1143
+ this.endCurrentConnection();
1144
+ const generation = this.connectionGeneration;
1145
1145
  const clientSession = await this.options.clientSession;
1146
1146
  if (generation !== this.connectionGeneration) return this;
1147
1147
  try {
@@ -1156,9 +1156,14 @@ var PollingTransport = class extends AbstractPollingTransport {
1156
1156
  return this;
1157
1157
  }
1158
1158
  close() {
1159
- this.connectionGeneration++;
1159
+ this.endCurrentConnection();
1160
1160
  super.close();
1161
1161
  }
1162
+ endCurrentConnection() {
1163
+ this.connectionGeneration++;
1164
+ this.clearPollingInterval();
1165
+ this.lastUpdateTimestamp = void 0;
1166
+ }
1162
1167
  async fetchConfigs(context, timeout, clientSession) {
1163
1168
  if (this.fatalError) {
1164
1169
  this.logger.warn("[PollingTransport] There was a prior unrecoverable error. Ignoring attempt to reconnect.");
@@ -2154,7 +2159,7 @@ const installTestClient = (testClient) => {
2154
2159
  const createTestClient = (options) => {
2155
2160
  return createTestClient$1({
2156
2161
  sdkName: "nuxt-sdk",
2157
- sdkVersion: "1.13.0"
2162
+ sdkVersion: "1.13.2"
2158
2163
  }, options);
2159
2164
  };
2160
2165
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configdirector/nuxt-sdk",
3
- "version": "1.13.0",
3
+ "version": "1.13.2",
4
4
  "description": "Nuxt SDK for ConfigDirector. ConfigDirector is a remote configuration and feature flag service.",
5
5
  "license": "MIT",
6
6
  "author": "ConfigDirector",