@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.
- package/CHANGELOG.md +34 -0
- package/dist/{chunk-UYFYFLI7.js → chunk-THLVTOIL.js} +18 -8
- package/dist/chunk-THLVTOIL.js.map +1 -0
- package/dist/{chunk-J33BA25D.js → chunk-TWOPHLLW.js} +18 -8
- package/dist/chunk-TWOPHLLW.js.map +1 -0
- package/dist/{chunk-LBP3OTYA.cjs → chunk-WN6NH2JT.cjs} +41 -31
- package/dist/chunk-WN6NH2JT.cjs.map +1 -0
- package/dist/{chunk-ZLGLABMG.cjs → chunk-ZLFORGNB.cjs} +41 -31
- package/dist/chunk-ZLFORGNB.cjs.map +1 -0
- package/dist/index.default.cjs +2 -2
- package/dist/index.default.d.cts +3 -3
- package/dist/index.default.d.ts +3 -3
- package/dist/index.default.js +1 -1
- package/dist/index.next-js.cjs +2 -2
- package/dist/index.next-js.d.cts +3 -3
- package/dist/index.next-js.d.ts +3 -3
- package/dist/index.next-js.js +1 -1
- package/dist/openfeature.default.cjs +2 -2
- package/dist/openfeature.default.d.cts +1 -1
- package/dist/openfeature.default.d.ts +1 -1
- package/dist/openfeature.default.js +1 -1
- package/dist/openfeature.next-js.cjs +2 -2
- package/dist/openfeature.next-js.d.cts +1 -1
- package/dist/openfeature.next-js.d.ts +1 -1
- package/dist/openfeature.next-js.js +1 -1
- package/dist/{types-DtnecWgl.d.cts → types-DjnMEGd6.d.cts} +2 -2
- package/dist/{types-DtnecWgl.d.ts → types-DjnMEGd6.d.ts} +2 -2
- package/package.json +4 -6
- package/dist/chunk-J33BA25D.js.map +0 -1
- package/dist/chunk-LBP3OTYA.cjs.map +0 -1
- package/dist/chunk-UYFYFLI7.js.map +0 -1
- package/dist/chunk-ZLGLABMG.cjs.map +0 -1
package/dist/index.default.cjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
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 =
|
|
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
|
package/dist/index.default.d.cts
CHANGED
|
@@ -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-
|
|
2
|
-
export { c as Packed, R as Reason } from './types-
|
|
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 };
|
package/dist/index.default.d.ts
CHANGED
|
@@ -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-
|
|
2
|
-
export { c as Packed, R as Reason } from './types-
|
|
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 };
|
package/dist/index.default.js
CHANGED
package/dist/index.next-js.cjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
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 =
|
|
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
|
package/dist/index.next-js.d.cts
CHANGED
|
@@ -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-
|
|
2
|
-
export { c as Packed, R as Reason } from './types-
|
|
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 };
|
package/dist/index.next-js.d.ts
CHANGED
|
@@ -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-
|
|
2
|
-
export { c as Packed, R as Reason } from './types-
|
|
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 };
|
package/dist/index.next-js.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class;
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
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(
|
|
153
|
+
var VercelProvider = make(_chunkZLFORGNBcjs.createClient, _chunkZLFORGNBcjs.flagsClient);
|
|
154
154
|
|
|
155
155
|
|
|
156
156
|
exports.VercelProvider = VercelProvider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); var _class;
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
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(
|
|
153
|
+
var VercelProvider = make(_chunkWN6NH2JTcjs.createClient, _chunkWN6NH2JTcjs.flagsClient);
|
|
154
154
|
|
|
155
155
|
|
|
156
156
|
exports.VercelProvider = VercelProvider;
|
|
@@ -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 =
|
|
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 =
|
|
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.
|
|
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
|
|
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": {
|