@vercel/flags-core 1.2.1 → 1.4.0-63fbe35-20260401181433

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.
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class;
2
2
 
3
3
 
4
- var _chunkOVHTANPTcjs = require('./chunk-OVHTANPT.cjs');
4
+ var _chunkWKJKSLD3cjs = require('./chunk-WKJKSLD3.cjs');
5
5
 
6
6
  // src/openfeature.make.ts
7
7
 
@@ -150,7 +150,7 @@ function make(createClient2, defaultFlagsClient) {
150
150
  }
151
151
 
152
152
  // src/openfeature.default.ts
153
- var VercelProvider = make(_chunkOVHTANPTcjs.createClient, _chunkOVHTANPTcjs.flagsClient);
153
+ var VercelProvider = make(_chunkWKJKSLD3cjs.createClient, _chunkWKJKSLD3cjs.flagsClient);
154
154
 
155
155
 
156
156
  exports.VercelProvider = VercelProvider;
@@ -1,4 +1,4 @@
1
- import { F as FlagsClient } from './types-CWK2gBCr.cjs';
1
+ import { F as FlagsClient } from './types-b4-JWa-Z.cjs';
2
2
  import * as _openfeature_server_sdk from '@openfeature/server-sdk';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as FlagsClient } from './types-CWK2gBCr.js';
1
+ import { F as FlagsClient } from './types-b4-JWa-Z.js';
2
2
  import * as _openfeature_server_sdk from '@openfeature/server-sdk';
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createClient,
3
3
  flagsClient
4
- } from "./chunk-Z62BONOI.js";
4
+ } from "./chunk-T6BGVQQT.js";
5
5
 
6
6
  // src/openfeature.make.ts
7
7
  import {
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class;
2
2
 
3
3
 
4
- var _chunkRVVI2JITcjs = require('./chunk-RVVI2JIT.cjs');
4
+ var _chunkPYADFLD4cjs = require('./chunk-PYADFLD4.cjs');
5
5
 
6
6
  // src/openfeature.make.ts
7
7
 
@@ -150,7 +150,7 @@ function make(createClient2, defaultFlagsClient) {
150
150
  }
151
151
 
152
152
  // src/openfeature.next-js.ts
153
- var VercelProvider = make(_chunkRVVI2JITcjs.createClient, _chunkRVVI2JITcjs.flagsClient);
153
+ var VercelProvider = make(_chunkPYADFLD4cjs.createClient, _chunkPYADFLD4cjs.flagsClient);
154
154
 
155
155
 
156
156
  exports.VercelProvider = VercelProvider;
@@ -1,4 +1,4 @@
1
- import { F as FlagsClient } from './types-CWK2gBCr.cjs';
1
+ import { F as FlagsClient } from './types-b4-JWa-Z.cjs';
2
2
  import * as _openfeature_server_sdk from '@openfeature/server-sdk';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as FlagsClient } from './types-CWK2gBCr.js';
1
+ import { F as FlagsClient } from './types-b4-JWa-Z.js';
2
2
  import * as _openfeature_server_sdk from '@openfeature/server-sdk';
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createClient,
3
3
  flagsClient
4
- } from "./chunk-M2F32RZX.js";
4
+ } from "./chunk-D3NMZBRA.js";
5
5
 
6
6
  // src/openfeature.make.ts
7
7
  import {
@@ -190,7 +190,12 @@ type EvaluationResult<T> = {
190
190
  type FlagKey = string;
191
191
  type EnvironmentKey = string;
192
192
  type SegmentId = string;
193
- type Value = string | number | boolean;
193
+ /**
194
+ * The value of a feature flag variant
195
+ */
196
+ type Value = string | number | boolean | null | {
197
+ [key: string]: Value;
198
+ } | Value[];
194
199
  declare enum ResolutionReason {
195
200
  PAUSED = "paused",
196
201
  TARGET_MATCH = "target_match",
@@ -398,6 +403,44 @@ declare namespace Packed {
398
403
  */
399
404
  defaultVariant: VariantIndex;
400
405
  };
406
+ type ProgressiveRolloutStep = {
407
+ /**
408
+ * Start of the rollout window in epoch milliseconds (inclusive).
409
+ */
410
+ startMs: number;
411
+ /**
412
+ * End of the rollout window in epoch milliseconds (exclusive).
413
+ */
414
+ endMs: number;
415
+ /**
416
+ * Rollout percentage for this window (0..100, decimals allowed).
417
+ */
418
+ percentage: number;
419
+ };
420
+ type ProgressiveRolloutOutcome = {
421
+ type: 'progressive-rollout';
422
+ /**
423
+ * Based on which attribute the traffic should be split.
424
+ */
425
+ base: EntityAccessor;
426
+ /**
427
+ * This variant will be used when the hash falls within the rollout bucket.
428
+ */
429
+ targetVariant: VariantIndex;
430
+ /**
431
+ * This variant will be used when the hash falls outside the rollout bucket,
432
+ * or when the base attribute does not exist.
433
+ */
434
+ defaultVariant: VariantIndex;
435
+ /**
436
+ * Absolute rollout windows in epoch milliseconds.
437
+ *
438
+ * The active window is selected using startMs <= now < endMs.
439
+ * Overlapping windows resolve to the latest startMs.
440
+ * Outside active windows, the latest already-started step is held.
441
+ */
442
+ schedule: ProgressiveRolloutStep[];
443
+ };
401
444
  type SegmentAllOutcome = 1;
402
445
  type SegmentSplitOutcome = {
403
446
  type: 'split';
@@ -413,7 +456,7 @@ declare namespace Packed {
413
456
  passPromille: number;
414
457
  };
415
458
  type SegmentOutcome = SegmentAllOutcome | SegmentSplitOutcome;
416
- type Outcome = VariantIndex | SplitOutcome;
459
+ type Outcome = VariantIndex | SplitOutcome | ProgressiveRolloutOutcome;
417
460
  type EntityAccessor = (string | number)[];
418
461
  type SegmentAccessor = 'segment';
419
462
  /**
@@ -524,4 +567,4 @@ declare namespace Packed {
524
567
  };
525
568
  }
526
569
 
527
- export { type BundledDefinitions as B, type ControllerInterface as C, type DatafileInput as D, type EvaluationParams as E, type FlagsClient as F, type PollingOptions as P, ResolutionReason as R, type StreamOptions as S, type Datafile as a, type EvaluationResult as b, Packed as c };
570
+ export { type BundledDefinitions as B, type ControllerInterface as C, type DatafileInput as D, type EvaluationParams as E, type FlagsClient as F, type PollingOptions as P, ResolutionReason as R, type StreamOptions as S, type Value as V, type Datafile as a, type EvaluationResult as b, Packed as c };
@@ -190,7 +190,12 @@ type EvaluationResult<T> = {
190
190
  type FlagKey = string;
191
191
  type EnvironmentKey = string;
192
192
  type SegmentId = string;
193
- type Value = string | number | boolean;
193
+ /**
194
+ * The value of a feature flag variant
195
+ */
196
+ type Value = string | number | boolean | null | {
197
+ [key: string]: Value;
198
+ } | Value[];
194
199
  declare enum ResolutionReason {
195
200
  PAUSED = "paused",
196
201
  TARGET_MATCH = "target_match",
@@ -398,6 +403,44 @@ declare namespace Packed {
398
403
  */
399
404
  defaultVariant: VariantIndex;
400
405
  };
406
+ type ProgressiveRolloutStep = {
407
+ /**
408
+ * Start of the rollout window in epoch milliseconds (inclusive).
409
+ */
410
+ startMs: number;
411
+ /**
412
+ * End of the rollout window in epoch milliseconds (exclusive).
413
+ */
414
+ endMs: number;
415
+ /**
416
+ * Rollout percentage for this window (0..100, decimals allowed).
417
+ */
418
+ percentage: number;
419
+ };
420
+ type ProgressiveRolloutOutcome = {
421
+ type: 'progressive-rollout';
422
+ /**
423
+ * Based on which attribute the traffic should be split.
424
+ */
425
+ base: EntityAccessor;
426
+ /**
427
+ * This variant will be used when the hash falls within the rollout bucket.
428
+ */
429
+ targetVariant: VariantIndex;
430
+ /**
431
+ * This variant will be used when the hash falls outside the rollout bucket,
432
+ * or when the base attribute does not exist.
433
+ */
434
+ defaultVariant: VariantIndex;
435
+ /**
436
+ * Absolute rollout windows in epoch milliseconds.
437
+ *
438
+ * The active window is selected using startMs <= now < endMs.
439
+ * Overlapping windows resolve to the latest startMs.
440
+ * Outside active windows, the latest already-started step is held.
441
+ */
442
+ schedule: ProgressiveRolloutStep[];
443
+ };
401
444
  type SegmentAllOutcome = 1;
402
445
  type SegmentSplitOutcome = {
403
446
  type: 'split';
@@ -413,7 +456,7 @@ declare namespace Packed {
413
456
  passPromille: number;
414
457
  };
415
458
  type SegmentOutcome = SegmentAllOutcome | SegmentSplitOutcome;
416
- type Outcome = VariantIndex | SplitOutcome;
459
+ type Outcome = VariantIndex | SplitOutcome | ProgressiveRolloutOutcome;
417
460
  type EntityAccessor = (string | number)[];
418
461
  type SegmentAccessor = 'segment';
419
462
  /**
@@ -524,4 +567,4 @@ declare namespace Packed {
524
567
  };
525
568
  }
526
569
 
527
- export { type BundledDefinitions as B, type ControllerInterface as C, type DatafileInput as D, type EvaluationParams as E, type FlagsClient as F, type PollingOptions as P, ResolutionReason as R, type StreamOptions as S, type Datafile as a, type EvaluationResult as b, Packed as c };
570
+ export { type BundledDefinitions as B, type ControllerInterface as C, type DatafileInput as D, type EvaluationParams as E, type FlagsClient as F, type PollingOptions as P, ResolutionReason as R, type StreamOptions as S, type Value as V, type Datafile as a, type EvaluationResult as b, Packed as c };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/flags-core",
3
- "version": "1.2.1",
3
+ "version": "1.4.0-63fbe35-20260401181433",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",