@vercel/flags-core 1.1.0 → 1.2.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.
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
 
10
- var _chunkZLGLABMGcjs = require('./chunk-ZLGLABMG.cjs');
10
+ var _chunkZLFORGNBcjs = require('./chunk-ZLFORGNB.cjs');
11
11
 
12
12
 
13
13
 
@@ -18,5 +18,5 @@ var _chunkZLGLABMGcjs = require('./chunk-ZLGLABMG.cjs');
18
18
 
19
19
 
20
20
 
21
- exports.Controller = _chunkZLGLABMGcjs.Controller; exports.FallbackEntryNotFoundError = _chunkZLGLABMGcjs.FallbackEntryNotFoundError; exports.FallbackNotFoundError = _chunkZLGLABMGcjs.FallbackNotFoundError; exports.FlagNetworkDataSource = _chunkZLGLABMGcjs.Controller; exports.Reason = _chunkZLGLABMGcjs.ResolutionReason; exports.createClient = _chunkZLGLABMGcjs.createClient; exports.evaluate = _chunkZLGLABMGcjs.evaluate; exports.flagsClient = _chunkZLGLABMGcjs.flagsClient; exports.resetDefaultFlagsClient = _chunkZLGLABMGcjs.resetDefaultFlagsClient;
21
+ exports.Controller = _chunkZLFORGNBcjs.Controller; exports.FallbackEntryNotFoundError = _chunkZLFORGNBcjs.FallbackEntryNotFoundError; exports.FallbackNotFoundError = _chunkZLFORGNBcjs.FallbackNotFoundError; exports.FlagNetworkDataSource = _chunkZLFORGNBcjs.Controller; exports.Reason = _chunkZLFORGNBcjs.ResolutionReason; exports.createClient = _chunkZLFORGNBcjs.createClient; exports.evaluate = _chunkZLFORGNBcjs.evaluate; exports.flagsClient = _chunkZLFORGNBcjs.flagsClient; exports.resetDefaultFlagsClient = _chunkZLFORGNBcjs.resetDefaultFlagsClient;
22
22
  //# sourceMappingURL=index.default.cjs.map
@@ -1,5 +1,5 @@
1
- import { D as DatafileInput, S as StreamOptions, P as PollingOptions, C as ControllerInterface, a as Datafile, B as BundledDefinitions, E as EvaluationParams, b as EvaluationResult, F as FlagsClient } from './types-DtnecWgl.cjs';
2
- export { c as Packed, R as Reason } from './types-DtnecWgl.cjs';
1
+ import { D as DatafileInput, S as StreamOptions, P as PollingOptions, C as ControllerInterface, a as Datafile, B as BundledDefinitions, E as EvaluationParams, b as EvaluationResult, F as FlagsClient } from './types-DjnMEGd6.cjs';
2
+ export { c as Packed, R as Reason } from './types-DjnMEGd6.cjs';
3
3
 
4
4
  /**
5
5
  * Configuration options for Controller
@@ -239,6 +239,6 @@ resetDefaultFlagsClient: () => void;
239
239
  declare const /**
240
240
  * Create a flags client based on an SDK Key
241
241
  */
242
- createClient: (sdkKeyOrConnectionString: string, options?: CreateClientOptions) => FlagsClient;
242
+ createClient: <Entities = Record<string, unknown>>(sdkKeyOrConnectionString: string, options?: CreateClientOptions) => FlagsClient<Entities>;
243
243
 
244
244
  export { BundledDefinitions, Controller, type ControllerOptions, type CreateClientOptions, Datafile, DatafileInput, EvaluationParams, EvaluationResult, FallbackEntryNotFoundError, FallbackNotFoundError, Controller as FlagNetworkDataSource, type ControllerOptions as FlagNetworkDataSourceOptions, FlagsClient, PollingOptions, StreamOptions, createClient, evaluate, flagsClient, resetDefaultFlagsClient };
@@ -1,5 +1,5 @@
1
- import { D as DatafileInput, S as StreamOptions, P as PollingOptions, C as ControllerInterface, a as Datafile, B as BundledDefinitions, E as EvaluationParams, b as EvaluationResult, F as FlagsClient } from './types-DtnecWgl.js';
2
- export { c as Packed, R as Reason } from './types-DtnecWgl.js';
1
+ import { D as DatafileInput, S as StreamOptions, P as PollingOptions, C as ControllerInterface, a as Datafile, B as BundledDefinitions, E as EvaluationParams, b as EvaluationResult, F as FlagsClient } from './types-DjnMEGd6.js';
2
+ export { c as Packed, R as Reason } from './types-DjnMEGd6.js';
3
3
 
4
4
  /**
5
5
  * Configuration options for Controller
@@ -239,6 +239,6 @@ resetDefaultFlagsClient: () => void;
239
239
  declare const /**
240
240
  * Create a flags client based on an SDK Key
241
241
  */
242
- createClient: (sdkKeyOrConnectionString: string, options?: CreateClientOptions) => FlagsClient;
242
+ createClient: <Entities = Record<string, unknown>>(sdkKeyOrConnectionString: string, options?: CreateClientOptions) => FlagsClient<Entities>;
243
243
 
244
244
  export { BundledDefinitions, Controller, type ControllerOptions, type CreateClientOptions, Datafile, DatafileInput, EvaluationParams, EvaluationResult, FallbackEntryNotFoundError, FallbackNotFoundError, Controller as FlagNetworkDataSource, type ControllerOptions as FlagNetworkDataSourceOptions, FlagsClient, PollingOptions, StreamOptions, createClient, evaluate, flagsClient, resetDefaultFlagsClient };
@@ -7,7 +7,7 @@ import {
7
7
  evaluate,
8
8
  flagsClient,
9
9
  resetDefaultFlagsClient
10
- } from "./chunk-J33BA25D.js";
10
+ } from "./chunk-TWOPHLLW.js";
11
11
  export {
12
12
  Controller,
13
13
  FallbackEntryNotFoundError,
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
 
10
- var _chunkLBP3OTYAcjs = require('./chunk-LBP3OTYA.cjs');
10
+ var _chunkWN6NH2JTcjs = require('./chunk-WN6NH2JT.cjs');
11
11
 
12
12
 
13
13
 
@@ -18,5 +18,5 @@ var _chunkLBP3OTYAcjs = require('./chunk-LBP3OTYA.cjs');
18
18
 
19
19
 
20
20
 
21
- exports.Controller = _chunkLBP3OTYAcjs.Controller; exports.FallbackEntryNotFoundError = _chunkLBP3OTYAcjs.FallbackEntryNotFoundError; exports.FallbackNotFoundError = _chunkLBP3OTYAcjs.FallbackNotFoundError; exports.FlagNetworkDataSource = _chunkLBP3OTYAcjs.Controller; exports.Reason = _chunkLBP3OTYAcjs.ResolutionReason; exports.createClient = _chunkLBP3OTYAcjs.createClient; exports.evaluate = _chunkLBP3OTYAcjs.evaluate; exports.flagsClient = _chunkLBP3OTYAcjs.flagsClient; exports.resetDefaultFlagsClient = _chunkLBP3OTYAcjs.resetDefaultFlagsClient;
21
+ exports.Controller = _chunkWN6NH2JTcjs.Controller; exports.FallbackEntryNotFoundError = _chunkWN6NH2JTcjs.FallbackEntryNotFoundError; exports.FallbackNotFoundError = _chunkWN6NH2JTcjs.FallbackNotFoundError; exports.FlagNetworkDataSource = _chunkWN6NH2JTcjs.Controller; exports.Reason = _chunkWN6NH2JTcjs.ResolutionReason; exports.createClient = _chunkWN6NH2JTcjs.createClient; exports.evaluate = _chunkWN6NH2JTcjs.evaluate; exports.flagsClient = _chunkWN6NH2JTcjs.flagsClient; exports.resetDefaultFlagsClient = _chunkWN6NH2JTcjs.resetDefaultFlagsClient;
22
22
  //# sourceMappingURL=index.next-js.cjs.map
@@ -1,5 +1,5 @@
1
- import { D as DatafileInput, S as StreamOptions, P as PollingOptions, C as ControllerInterface, a as Datafile, B as BundledDefinitions, E as EvaluationParams, b as EvaluationResult, F as FlagsClient } from './types-DtnecWgl.cjs';
2
- export { c as Packed, R as Reason } from './types-DtnecWgl.cjs';
1
+ import { D as DatafileInput, S as StreamOptions, P as PollingOptions, C as ControllerInterface, a as Datafile, B as BundledDefinitions, E as EvaluationParams, b as EvaluationResult, F as FlagsClient } from './types-DjnMEGd6.cjs';
2
+ export { c as Packed, R as Reason } from './types-DjnMEGd6.cjs';
3
3
 
4
4
  /**
5
5
  * Configuration options for Controller
@@ -226,6 +226,6 @@ _visited?: Set<string>): EvaluationResult<T>;
226
226
 
227
227
  declare const flagsClient: FlagsClient;
228
228
  declare const resetDefaultFlagsClient: () => void;
229
- declare const createClient: (sdkKeyOrConnectionString: string, options?: CreateClientOptions) => FlagsClient;
229
+ declare const createClient: <Entities = Record<string, unknown>>(sdkKeyOrConnectionString: string, options?: CreateClientOptions) => FlagsClient<Entities>;
230
230
 
231
231
  export { BundledDefinitions, Controller, type ControllerOptions, type CreateClientOptions, Datafile, DatafileInput, EvaluationParams, EvaluationResult, FallbackEntryNotFoundError, FallbackNotFoundError, Controller as FlagNetworkDataSource, type ControllerOptions as FlagNetworkDataSourceOptions, FlagsClient, PollingOptions, StreamOptions, createClient, evaluate, flagsClient, resetDefaultFlagsClient };
@@ -1,5 +1,5 @@
1
- import { D as DatafileInput, S as StreamOptions, P as PollingOptions, C as ControllerInterface, a as Datafile, B as BundledDefinitions, E as EvaluationParams, b as EvaluationResult, F as FlagsClient } from './types-DtnecWgl.js';
2
- export { c as Packed, R as Reason } from './types-DtnecWgl.js';
1
+ import { D as DatafileInput, S as StreamOptions, P as PollingOptions, C as ControllerInterface, a as Datafile, B as BundledDefinitions, E as EvaluationParams, b as EvaluationResult, F as FlagsClient } from './types-DjnMEGd6.js';
2
+ export { c as Packed, R as Reason } from './types-DjnMEGd6.js';
3
3
 
4
4
  /**
5
5
  * Configuration options for Controller
@@ -226,6 +226,6 @@ _visited?: Set<string>): EvaluationResult<T>;
226
226
 
227
227
  declare const flagsClient: FlagsClient;
228
228
  declare const resetDefaultFlagsClient: () => void;
229
- declare const createClient: (sdkKeyOrConnectionString: string, options?: CreateClientOptions) => FlagsClient;
229
+ declare const createClient: <Entities = Record<string, unknown>>(sdkKeyOrConnectionString: string, options?: CreateClientOptions) => FlagsClient<Entities>;
230
230
 
231
231
  export { BundledDefinitions, Controller, type ControllerOptions, type CreateClientOptions, Datafile, DatafileInput, EvaluationParams, EvaluationResult, FallbackEntryNotFoundError, FallbackNotFoundError, Controller as FlagNetworkDataSource, type ControllerOptions as FlagNetworkDataSourceOptions, FlagsClient, PollingOptions, StreamOptions, createClient, evaluate, flagsClient, resetDefaultFlagsClient };
@@ -7,7 +7,7 @@ import {
7
7
  evaluate,
8
8
  flagsClient,
9
9
  resetDefaultFlagsClient
10
- } from "./chunk-UYFYFLI7.js";
10
+ } from "./chunk-THLVTOIL.js";
11
11
  export {
12
12
  Controller,
13
13
  FallbackEntryNotFoundError,
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class;
2
2
 
3
3
 
4
- var _chunkZLGLABMGcjs = require('./chunk-ZLGLABMG.cjs');
4
+ var _chunkZLFORGNBcjs = require('./chunk-ZLFORGNB.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(_chunkZLGLABMGcjs.createClient, _chunkZLGLABMGcjs.flagsClient);
153
+ var VercelProvider = make(_chunkZLFORGNBcjs.createClient, _chunkZLFORGNBcjs.flagsClient);
154
154
 
155
155
 
156
156
  exports.VercelProvider = VercelProvider;
@@ -1,4 +1,4 @@
1
- import { F as FlagsClient } from './types-DtnecWgl.cjs';
1
+ import { F as FlagsClient } from './types-DjnMEGd6.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-DtnecWgl.js';
1
+ import { F as FlagsClient } from './types-DjnMEGd6.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-J33BA25D.js";
4
+ } from "./chunk-TWOPHLLW.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 _chunkLBP3OTYAcjs = require('./chunk-LBP3OTYA.cjs');
4
+ var _chunkWN6NH2JTcjs = require('./chunk-WN6NH2JT.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(_chunkLBP3OTYAcjs.createClient, _chunkLBP3OTYAcjs.flagsClient);
153
+ var VercelProvider = make(_chunkWN6NH2JTcjs.createClient, _chunkWN6NH2JTcjs.flagsClient);
154
154
 
155
155
 
156
156
  exports.VercelProvider = VercelProvider;
@@ -1,4 +1,4 @@
1
- import { F as FlagsClient } from './types-DtnecWgl.cjs';
1
+ import { F as FlagsClient } from './types-DjnMEGd6.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-DtnecWgl.js';
1
+ import { F as FlagsClient } from './types-DjnMEGd6.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-UYFYFLI7.js";
4
+ } from "./chunk-THLVTOIL.js";
5
5
 
6
6
  // src/openfeature.make.ts
7
7
  import {
@@ -95,7 +95,7 @@ interface ControllerInterface {
95
95
  /**
96
96
  * A client for Vercel Flags
97
97
  */
98
- type FlagsClient = {
98
+ type FlagsClient<Entities = Record<string, unknown>> = {
99
99
  /**
100
100
  * Origin information for this client (provider and sdkKey)
101
101
  */
@@ -113,7 +113,7 @@ type FlagsClient = {
113
113
  * @param entities
114
114
  * @returns
115
115
  */
116
- evaluate: <T = Value, E = Record<string, unknown>>(flagKey: string, defaultValue?: T, entities?: E) => Promise<EvaluationResult<T>>;
116
+ evaluate: <T = Value, E extends Entities = Entities>(flagKey: string, defaultValue?: T, entities?: E) => Promise<EvaluationResult<T>>;
117
117
  /**
118
118
  * Retrieve the latest datafile during startup, and set up subscriptions if needed.
119
119
  */
@@ -95,7 +95,7 @@ interface ControllerInterface {
95
95
  /**
96
96
  * A client for Vercel Flags
97
97
  */
98
- type FlagsClient = {
98
+ type FlagsClient<Entities = Record<string, unknown>> = {
99
99
  /**
100
100
  * Origin information for this client (provider and sdkKey)
101
101
  */
@@ -113,7 +113,7 @@ type FlagsClient = {
113
113
  * @param entities
114
114
  * @returns
115
115
  */
116
- evaluate: <T = Value, E = Record<string, unknown>>(flagKey: string, defaultValue?: T, entities?: E) => Promise<EvaluationResult<T>>;
116
+ evaluate: <T = Value, E extends Entities = Entities>(flagKey: string, defaultValue?: T, entities?: E) => Promise<EvaluationResult<T>>;
117
117
  /**
118
118
  * Retrieve the latest datafile during startup, and set up subscriptions if needed.
119
119
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/flags-core",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -55,23 +55,21 @@
55
55
  "CHANGELOG.md"
56
56
  ],
57
57
  "dependencies": {
58
- "@vercel/functions": "^3.3.6",
58
+ "@vercel/functions": "^3.4.3",
59
59
  "jose": "5.2.1",
60
60
  "js-xxhash": "4.0.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@arethetypeswrong/cli": "0.18.2",
64
64
  "@types/node": "20.11.17",
65
- "next": "16.1.6",
65
+ "next": "^16.1.6",
66
66
  "tsup": "8.5.1",
67
67
  "typescript": "5.6.3",
68
68
  "vite": "6.4.1",
69
- "vitest": "2.1.9",
70
- "flags": "4.0.3"
69
+ "vitest": "2.1.9"
71
70
  },
72
71
  "peerDependencies": {
73
72
  "@openfeature/server-sdk": "1.18.0",
74
- "flags": "*",
75
73
  "next": "*"
76
74
  },
77
75
  "peerDependenciesMeta": {