@datadog/openfeature-node-server 2.4.0 → 2.6.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/README.md +45 -0
- package/cjs/configuration/fetch-rules-configuration.d.ts +34 -0
- package/cjs/configuration/fetch-rules-configuration.d.ts.map +1 -0
- package/cjs/configuration/fetch-rules-configuration.js +180 -0
- package/cjs/configuration/fetch-rules-configuration.js.map +1 -0
- package/cjs/index.js +1 -1
- package/cjs/provider.d.ts +2 -2
- package/cjs/provider.d.ts.map +1 -1
- package/cjs/provider.js +21 -9
- package/cjs/provider.js.map +1 -1
- package/cjs/rules-based.d.ts +4 -0
- package/cjs/rules-based.d.ts.map +1 -0
- package/cjs/rules-based.js +23 -0
- package/cjs/rules-based.js.map +1 -0
- package/esm/configuration/fetch-rules-configuration.d.ts +34 -0
- package/esm/configuration/fetch-rules-configuration.d.ts.map +1 -0
- package/esm/configuration/fetch-rules-configuration.js +175 -0
- package/esm/configuration/fetch-rules-configuration.js.map +1 -0
- package/esm/index.js +1 -1
- package/esm/provider.d.ts +2 -2
- package/esm/provider.d.ts.map +1 -1
- package/esm/provider.js +22 -10
- package/esm/provider.js.map +1 -1
- package/esm/rules-based.d.ts +4 -0
- package/esm/rules-based.d.ts.map +1 -0
- package/esm/rules-based.js +3 -0
- package/esm/rules-based.js.map +1 -0
- package/index.d.ts +152 -168
- package/package.json +25 -5
- package/rules-based.d.ts +959 -0
package/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Channel } from 'node:diagnostics_channel';
|
|
2
2
|
|
|
3
|
+
type Metadata = Record<string, string>;
|
|
4
|
+
type Paradigm = "server" | "client";
|
|
3
5
|
type PrimitiveValue = null | boolean | string | number;
|
|
4
6
|
type JsonObject = {
|
|
5
7
|
[key: string]: JsonValue;
|
|
@@ -17,155 +19,8 @@ type EvaluationContext = {
|
|
|
17
19
|
*/
|
|
18
20
|
targetingKey?: string;
|
|
19
21
|
} & Record<string, EvaluationContextValue>;
|
|
20
|
-
type FlagValue = boolean | string | number | JsonValue;
|
|
21
|
-
interface ExposureEvent {
|
|
22
|
-
allocation: {
|
|
23
|
-
key: string;
|
|
24
|
-
};
|
|
25
|
-
flag: {
|
|
26
|
-
key: string;
|
|
27
|
-
};
|
|
28
|
-
variant: {
|
|
29
|
-
key: string;
|
|
30
|
-
};
|
|
31
|
-
serial_id?: number;
|
|
32
|
-
subject: {
|
|
33
|
-
id: string;
|
|
34
|
-
attributes: EvaluationContext;
|
|
35
|
-
};
|
|
36
|
-
service?: string;
|
|
37
|
-
rum?: {
|
|
38
|
-
application?: {
|
|
39
|
-
id?: string;
|
|
40
|
-
};
|
|
41
|
-
view?: {
|
|
42
|
-
url?: string;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
declare enum OperatorType {
|
|
47
|
-
MATCHES = "MATCHES",
|
|
48
|
-
NOT_MATCHES = "NOT_MATCHES",
|
|
49
|
-
GTE = "GTE",
|
|
50
|
-
GT = "GT",
|
|
51
|
-
LTE = "LTE",
|
|
52
|
-
LT = "LT",
|
|
53
|
-
ONE_OF = "ONE_OF",
|
|
54
|
-
NOT_ONE_OF = "NOT_ONE_OF",
|
|
55
|
-
IS_NULL = "IS_NULL",
|
|
56
|
-
SEMVER_EQ = "SEMVER_EQ",
|
|
57
|
-
SEMVER_NEQ = "SEMVER_NEQ",
|
|
58
|
-
SEMVER_LT = "SEMVER_LT",
|
|
59
|
-
SEMVER_LTE = "SEMVER_LTE",
|
|
60
|
-
SEMVER_GT = "SEMVER_GT",
|
|
61
|
-
SEMVER_GTE = "SEMVER_GTE"
|
|
62
|
-
}
|
|
63
|
-
type NumericOperator = OperatorType.GTE | OperatorType.GT | OperatorType.LTE | OperatorType.LT;
|
|
64
|
-
type SemVerOperator = OperatorType.SEMVER_EQ | OperatorType.SEMVER_NEQ | OperatorType.SEMVER_GTE | OperatorType.SEMVER_GT | OperatorType.SEMVER_LTE | OperatorType.SEMVER_LT;
|
|
65
|
-
type MatchesCondition = {
|
|
66
|
-
operator: OperatorType.MATCHES;
|
|
67
|
-
attribute: string;
|
|
68
|
-
value: string;
|
|
69
|
-
};
|
|
70
|
-
type NotMatchesCondition = {
|
|
71
|
-
operator: OperatorType.NOT_MATCHES;
|
|
72
|
-
attribute: string;
|
|
73
|
-
value: string;
|
|
74
|
-
};
|
|
75
|
-
type OneOfCondition = {
|
|
76
|
-
operator: OperatorType.ONE_OF;
|
|
77
|
-
attribute: string;
|
|
78
|
-
value: string[];
|
|
79
|
-
};
|
|
80
|
-
type NotOneOfCondition = {
|
|
81
|
-
operator: OperatorType.NOT_ONE_OF;
|
|
82
|
-
attribute: string;
|
|
83
|
-
value: string[];
|
|
84
|
-
};
|
|
85
|
-
type NumericCondition = {
|
|
86
|
-
operator: NumericOperator;
|
|
87
|
-
attribute: string;
|
|
88
|
-
value: number;
|
|
89
|
-
};
|
|
90
|
-
type NullCondition = {
|
|
91
|
-
operator: OperatorType.IS_NULL;
|
|
92
|
-
attribute: string;
|
|
93
|
-
value: boolean;
|
|
94
|
-
};
|
|
95
|
-
type SemVerCondition = {
|
|
96
|
-
operator: SemVerOperator;
|
|
97
|
-
attribute: string;
|
|
98
|
-
value: string;
|
|
99
|
-
};
|
|
100
|
-
type Condition = MatchesCondition | NotMatchesCondition | OneOfCondition | NotOneOfCondition | NumericCondition | NullCondition | SemVerCondition;
|
|
101
|
-
interface Rule {
|
|
102
|
-
conditions: Condition[];
|
|
103
|
-
}
|
|
104
|
-
type VariantType = "BOOLEAN" | "INTEGER" | "NUMERIC" | "STRING" | "JSON";
|
|
105
|
-
interface VariantConfiguration {
|
|
106
|
-
key: string;
|
|
107
|
-
value: FlagValue;
|
|
108
|
-
}
|
|
109
|
-
interface ShardRange {
|
|
110
|
-
start: number;
|
|
111
|
-
end: number;
|
|
112
|
-
}
|
|
113
|
-
interface Shard {
|
|
114
|
-
salt: string;
|
|
115
|
-
ranges: ShardRange[];
|
|
116
|
-
totalShards: number;
|
|
117
|
-
}
|
|
118
|
-
interface Split {
|
|
119
|
-
variationKey: string;
|
|
120
|
-
shards: Shard[];
|
|
121
|
-
extraLogging?: Record<string, string>;
|
|
122
|
-
serialId?: number;
|
|
123
|
-
}
|
|
124
|
-
interface Allocation {
|
|
125
|
-
key: string;
|
|
126
|
-
rules?: Rule[];
|
|
127
|
-
startAt?: Date;
|
|
128
|
-
endAt?: Date;
|
|
129
|
-
splits: Split[];
|
|
130
|
-
doLog?: boolean;
|
|
131
|
-
}
|
|
132
|
-
interface Flag {
|
|
133
|
-
key: string;
|
|
134
|
-
enabled: boolean;
|
|
135
|
-
variationType: VariantType;
|
|
136
|
-
variations: Record<string, VariantConfiguration>;
|
|
137
|
-
allocations: Allocation[];
|
|
138
|
-
}
|
|
139
|
-
export interface UniversalFlagConfigurationV1 {
|
|
140
|
-
createdAt: string;
|
|
141
|
-
format: string;
|
|
142
|
-
observeFullEvaluationData?: boolean;
|
|
143
|
-
environment: {
|
|
144
|
-
name: string;
|
|
145
|
-
};
|
|
146
|
-
flags: Record<string, Flag>;
|
|
147
|
-
}
|
|
148
|
-
type Metadata = Record<string, string>;
|
|
149
|
-
type Paradigm = "server" | "client";
|
|
150
|
-
type PrimitiveValue$1 = null | boolean | string | number;
|
|
151
|
-
type JsonObject$1 = {
|
|
152
|
-
[key: string]: JsonValue$1;
|
|
153
|
-
};
|
|
154
|
-
type JsonArray$1 = JsonValue$1[];
|
|
155
|
-
type JsonValue$1 = PrimitiveValue$1 | JsonObject$1 | JsonArray$1;
|
|
156
|
-
type EvaluationContextValue$1 = PrimitiveValue$1 | Date | {
|
|
157
|
-
[key: string]: EvaluationContextValue$1;
|
|
158
|
-
} | EvaluationContextValue$1[];
|
|
159
|
-
type EvaluationContext$1 = {
|
|
160
|
-
/**
|
|
161
|
-
* A string uniquely identifying the subject (end-user, or client service) of a flag evaluation.
|
|
162
|
-
* Providers may require this field for fractional flag evaluation, rules, or overrides targeting specific users.
|
|
163
|
-
* Such providers may behave unpredictably if a targeting key is not specified at flag resolution.
|
|
164
|
-
*/
|
|
165
|
-
targetingKey?: string;
|
|
166
|
-
} & Record<string, EvaluationContextValue$1>;
|
|
167
22
|
type FlagValueType = "boolean" | "string" | "number" | "object";
|
|
168
|
-
type FlagValue
|
|
23
|
+
type FlagValue = boolean | string | number | JsonValue;
|
|
169
24
|
type ResolutionReason = keyof typeof StandardResolutionReasons | (string & Record<never, never>);
|
|
170
25
|
type FlagMetadata = Record<string, string | number | boolean>;
|
|
171
26
|
type ResolutionDetails<U> = {
|
|
@@ -176,7 +31,7 @@ type ResolutionDetails<U> = {
|
|
|
176
31
|
errorCode?: ErrorCode;
|
|
177
32
|
errorMessage?: string;
|
|
178
33
|
};
|
|
179
|
-
type EvaluationDetails<T extends FlagValue
|
|
34
|
+
type EvaluationDetails<T extends FlagValue> = {
|
|
180
35
|
flagKey: string;
|
|
181
36
|
flagMetadata: Readonly<FlagMetadata>;
|
|
182
37
|
} & ResolutionDetails<T>;
|
|
@@ -362,7 +217,7 @@ interface ProviderEventEmitter<E extends AnyProviderEvent, AdditionalContext ext
|
|
|
362
217
|
removeAllHandlers(eventType?: AnyProviderEvent): void;
|
|
363
218
|
getHandlers(eventType: AnyProviderEvent): EventHandler[];
|
|
364
219
|
}
|
|
365
|
-
type TrackingEventValue = PrimitiveValue
|
|
220
|
+
type TrackingEventValue = PrimitiveValue | Date | {
|
|
366
221
|
[key: string]: TrackingEventValue;
|
|
367
222
|
} | TrackingEventValue[];
|
|
368
223
|
type TrackingEventDetails = {
|
|
@@ -454,14 +309,14 @@ interface CommonProvider<S extends ClientProviderStatus | ServerProviderStatus>
|
|
|
454
309
|
* Use this function to perform any context-dependent setup within the provider.
|
|
455
310
|
* @param context
|
|
456
311
|
*/
|
|
457
|
-
initialize?(context?: EvaluationContext
|
|
312
|
+
initialize?(context?: EvaluationContext): Promise<void>;
|
|
458
313
|
/**
|
|
459
314
|
* Track a user action or application state, usually representing a business objective or outcome.
|
|
460
315
|
* @param trackingEventName
|
|
461
316
|
* @param context
|
|
462
317
|
* @param trackingEventDetails
|
|
463
318
|
*/
|
|
464
|
-
track?(trackingEventName: string, context: EvaluationContext
|
|
319
|
+
track?(trackingEventName: string, context: EvaluationContext, trackingEventDetails: TrackingEventDetails): void;
|
|
465
320
|
}
|
|
466
321
|
interface ClientMetadata {
|
|
467
322
|
/**
|
|
@@ -521,20 +376,20 @@ interface HookData<TData = Record<string, unknown>> {
|
|
|
521
376
|
clear(): void;
|
|
522
377
|
}
|
|
523
378
|
type HookHints = Readonly<Record<string, unknown>>;
|
|
524
|
-
interface HookContext<T extends FlagValue
|
|
379
|
+
interface HookContext<T extends FlagValue = FlagValue, TData = Record<string, unknown>> {
|
|
525
380
|
readonly flagKey: string;
|
|
526
381
|
readonly defaultValue: T;
|
|
527
382
|
readonly flagValueType: FlagValueType;
|
|
528
|
-
readonly context: Readonly<EvaluationContext
|
|
383
|
+
readonly context: Readonly<EvaluationContext>;
|
|
529
384
|
readonly clientMetadata: ClientMetadata;
|
|
530
385
|
readonly providerMetadata: ProviderMetadata;
|
|
531
386
|
readonly logger: Logger;
|
|
532
387
|
readonly hookData: HookData<TData>;
|
|
533
388
|
}
|
|
534
|
-
interface BeforeHookContext<T extends FlagValue
|
|
535
|
-
context: EvaluationContext
|
|
389
|
+
interface BeforeHookContext<T extends FlagValue = FlagValue, TData = Record<string, unknown>> extends HookContext<T, TData> {
|
|
390
|
+
context: EvaluationContext;
|
|
536
391
|
}
|
|
537
|
-
interface BaseHook<T extends FlagValue
|
|
392
|
+
interface BaseHook<T extends FlagValue = FlagValue, TData = Record<string, unknown>, BeforeHookReturn = unknown, HooksReturn = unknown> {
|
|
538
393
|
/**
|
|
539
394
|
* Runs before flag values are resolved from the provider.
|
|
540
395
|
* If an EvaluationContext is returned, it will be merged with the pre-existing EvaluationContext.
|
|
@@ -564,7 +419,136 @@ interface BaseHook<T extends FlagValue$1 = FlagValue$1, TData = Record<string, u
|
|
|
564
419
|
*/
|
|
565
420
|
finally?(hookContext: Readonly<HookContext<T, TData>>, evaluationDetails: EvaluationDetails<T>, hookHints?: HookHints): HooksReturn;
|
|
566
421
|
}
|
|
567
|
-
|
|
422
|
+
declare enum OperatorType {
|
|
423
|
+
MATCHES = "MATCHES",
|
|
424
|
+
NOT_MATCHES = "NOT_MATCHES",
|
|
425
|
+
GTE = "GTE",
|
|
426
|
+
GT = "GT",
|
|
427
|
+
LTE = "LTE",
|
|
428
|
+
LT = "LT",
|
|
429
|
+
ONE_OF = "ONE_OF",
|
|
430
|
+
NOT_ONE_OF = "NOT_ONE_OF",
|
|
431
|
+
IS_NULL = "IS_NULL",
|
|
432
|
+
SEMVER_EQ = "SEMVER_EQ",
|
|
433
|
+
SEMVER_NEQ = "SEMVER_NEQ",
|
|
434
|
+
SEMVER_LT = "SEMVER_LT",
|
|
435
|
+
SEMVER_LTE = "SEMVER_LTE",
|
|
436
|
+
SEMVER_GT = "SEMVER_GT",
|
|
437
|
+
SEMVER_GTE = "SEMVER_GTE"
|
|
438
|
+
}
|
|
439
|
+
type NumericOperator = OperatorType.GTE | OperatorType.GT | OperatorType.LTE | OperatorType.LT;
|
|
440
|
+
type SemVerOperator = OperatorType.SEMVER_EQ | OperatorType.SEMVER_NEQ | OperatorType.SEMVER_GTE | OperatorType.SEMVER_GT | OperatorType.SEMVER_LTE | OperatorType.SEMVER_LT;
|
|
441
|
+
type MatchesCondition = {
|
|
442
|
+
operator: OperatorType.MATCHES;
|
|
443
|
+
attribute: string;
|
|
444
|
+
value: string;
|
|
445
|
+
};
|
|
446
|
+
type NotMatchesCondition = {
|
|
447
|
+
operator: OperatorType.NOT_MATCHES;
|
|
448
|
+
attribute: string;
|
|
449
|
+
value: string;
|
|
450
|
+
};
|
|
451
|
+
type OneOfCondition = {
|
|
452
|
+
operator: OperatorType.ONE_OF;
|
|
453
|
+
attribute: string;
|
|
454
|
+
value: string[];
|
|
455
|
+
};
|
|
456
|
+
type NotOneOfCondition = {
|
|
457
|
+
operator: OperatorType.NOT_ONE_OF;
|
|
458
|
+
attribute: string;
|
|
459
|
+
value: string[];
|
|
460
|
+
};
|
|
461
|
+
type NumericCondition = {
|
|
462
|
+
operator: NumericOperator;
|
|
463
|
+
attribute: string;
|
|
464
|
+
value: number;
|
|
465
|
+
};
|
|
466
|
+
type NullCondition = {
|
|
467
|
+
operator: OperatorType.IS_NULL;
|
|
468
|
+
attribute: string;
|
|
469
|
+
value: boolean;
|
|
470
|
+
};
|
|
471
|
+
type SemVerCondition = {
|
|
472
|
+
operator: SemVerOperator;
|
|
473
|
+
attribute: string;
|
|
474
|
+
value: string;
|
|
475
|
+
};
|
|
476
|
+
type Condition = MatchesCondition | NotMatchesCondition | OneOfCondition | NotOneOfCondition | NumericCondition | NullCondition | SemVerCondition;
|
|
477
|
+
interface Rule {
|
|
478
|
+
conditions: Condition[];
|
|
479
|
+
}
|
|
480
|
+
type VariantType = "BOOLEAN" | "INTEGER" | "NUMERIC" | "STRING" | "JSON";
|
|
481
|
+
interface VariantConfiguration {
|
|
482
|
+
key: string;
|
|
483
|
+
value: FlagValue;
|
|
484
|
+
}
|
|
485
|
+
interface ShardRange {
|
|
486
|
+
start: number;
|
|
487
|
+
end: number;
|
|
488
|
+
}
|
|
489
|
+
interface Shard {
|
|
490
|
+
salt: string;
|
|
491
|
+
ranges: ShardRange[];
|
|
492
|
+
totalShards: number;
|
|
493
|
+
}
|
|
494
|
+
interface Split {
|
|
495
|
+
variationKey: string;
|
|
496
|
+
shards: Shard[];
|
|
497
|
+
extraLogging?: Record<string, string>;
|
|
498
|
+
serialId?: number;
|
|
499
|
+
}
|
|
500
|
+
interface Allocation {
|
|
501
|
+
key: string;
|
|
502
|
+
rules?: Rule[];
|
|
503
|
+
startAt?: Date;
|
|
504
|
+
endAt?: Date;
|
|
505
|
+
randomizationActivatedAt?: string;
|
|
506
|
+
splits: Split[];
|
|
507
|
+
/** Required by the UFC JSON schema; the producer always supplies an explicit boolean. */
|
|
508
|
+
doLog: boolean;
|
|
509
|
+
}
|
|
510
|
+
interface Flag {
|
|
511
|
+
key: string;
|
|
512
|
+
enabled: boolean;
|
|
513
|
+
variationType: VariantType;
|
|
514
|
+
variations: Record<string, VariantConfiguration>;
|
|
515
|
+
allocations: Allocation[];
|
|
516
|
+
}
|
|
517
|
+
export interface UniversalFlagConfigurationV1 {
|
|
518
|
+
createdAt: string;
|
|
519
|
+
format: string;
|
|
520
|
+
observeFullEvaluationData?: boolean;
|
|
521
|
+
environment: {
|
|
522
|
+
name: string;
|
|
523
|
+
};
|
|
524
|
+
flags: Record<string, Flag>;
|
|
525
|
+
}
|
|
526
|
+
interface ExposureEvent {
|
|
527
|
+
allocation: {
|
|
528
|
+
key: string;
|
|
529
|
+
};
|
|
530
|
+
flag: {
|
|
531
|
+
key: string;
|
|
532
|
+
};
|
|
533
|
+
variant: {
|
|
534
|
+
key: string;
|
|
535
|
+
};
|
|
536
|
+
serial_id?: number;
|
|
537
|
+
subject: {
|
|
538
|
+
id: string;
|
|
539
|
+
attributes: EvaluationContext;
|
|
540
|
+
};
|
|
541
|
+
service?: string;
|
|
542
|
+
rum?: {
|
|
543
|
+
application?: {
|
|
544
|
+
id?: string;
|
|
545
|
+
};
|
|
546
|
+
view?: {
|
|
547
|
+
url?: string;
|
|
548
|
+
};
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
type Hook<TData = Record<string, unknown>> = BaseHook<FlagValue, TData, Promise<EvaluationContext | void> | EvaluationContext | void, Promise<void> | void>;
|
|
568
552
|
interface Provider extends CommonProvider<ServerProviderStatus> {
|
|
569
553
|
/**
|
|
570
554
|
* A provider hook exposes a mechanism for provider authors to register hooks
|
|
@@ -576,19 +560,19 @@ interface Provider extends CommonProvider<ServerProviderStatus> {
|
|
|
576
560
|
/**
|
|
577
561
|
* Resolve a boolean flag and its evaluation details.
|
|
578
562
|
*/
|
|
579
|
-
resolveBooleanEvaluation(flagKey: string, defaultValue: boolean, context: EvaluationContext
|
|
563
|
+
resolveBooleanEvaluation(flagKey: string, defaultValue: boolean, context: EvaluationContext, logger: Logger): Promise<ResolutionDetails<boolean>>;
|
|
580
564
|
/**
|
|
581
565
|
* Resolve a string flag and its evaluation details.
|
|
582
566
|
*/
|
|
583
|
-
resolveStringEvaluation(flagKey: string, defaultValue: string, context: EvaluationContext
|
|
567
|
+
resolveStringEvaluation(flagKey: string, defaultValue: string, context: EvaluationContext, logger: Logger): Promise<ResolutionDetails<string>>;
|
|
584
568
|
/**
|
|
585
569
|
* Resolve a numeric flag and its evaluation details.
|
|
586
570
|
*/
|
|
587
|
-
resolveNumberEvaluation(flagKey: string, defaultValue: number, context: EvaluationContext
|
|
571
|
+
resolveNumberEvaluation(flagKey: string, defaultValue: number, context: EvaluationContext, logger: Logger): Promise<ResolutionDetails<number>>;
|
|
588
572
|
/**
|
|
589
573
|
* Resolve and parse an object flag and its evaluation details.
|
|
590
574
|
*/
|
|
591
|
-
resolveObjectEvaluation<T extends JsonValue
|
|
575
|
+
resolveObjectEvaluation<T extends JsonValue>(flagKey: string, defaultValue: T, context: EvaluationContext, logger: Logger): Promise<ResolutionDetails<T>>;
|
|
592
576
|
}
|
|
593
577
|
export interface DatadogNodeServerProviderOptions {
|
|
594
578
|
/**
|
|
@@ -617,9 +601,9 @@ export declare class DatadogNodeServerProvider implements Provider {
|
|
|
617
601
|
*/
|
|
618
602
|
getConfiguration(): UniversalFlagConfigurationV1 | undefined;
|
|
619
603
|
/**
|
|
620
|
-
* Used by dd-source-js
|
|
604
|
+
* Used by dd-source-js. Pass null or undefined to withdraw the configuration.
|
|
621
605
|
*/
|
|
622
|
-
setConfiguration(configuration: UniversalFlagConfigurationV1): void;
|
|
606
|
+
setConfiguration(configuration: UniversalFlagConfigurationV1 | null | undefined): void;
|
|
623
607
|
/**
|
|
624
608
|
* Used by dd-source-js
|
|
625
609
|
*/
|
|
@@ -634,10 +618,10 @@ export declare class DatadogNodeServerProvider implements Provider {
|
|
|
634
618
|
* See setConfiguration and setError for more details.
|
|
635
619
|
*/
|
|
636
620
|
initialize(): Promise<void>;
|
|
637
|
-
resolveBooleanEvaluation(flagKey: string, defaultValue: boolean, context: EvaluationContext
|
|
638
|
-
resolveStringEvaluation(flagKey: string, defaultValue: string, context: EvaluationContext
|
|
639
|
-
resolveNumberEvaluation(flagKey: string, defaultValue: number, context: EvaluationContext
|
|
640
|
-
resolveObjectEvaluation<T extends JsonValue
|
|
621
|
+
resolveBooleanEvaluation(flagKey: string, defaultValue: boolean, context: EvaluationContext, _logger: Logger): Promise<ResolutionDetails<boolean>>;
|
|
622
|
+
resolveStringEvaluation(flagKey: string, defaultValue: string, context: EvaluationContext, _logger: Logger): Promise<ResolutionDetails<string>>;
|
|
623
|
+
resolveNumberEvaluation(flagKey: string, defaultValue: number, context: EvaluationContext, _logger: Logger): Promise<ResolutionDetails<number>>;
|
|
624
|
+
resolveObjectEvaluation<T extends JsonValue>(flagKey: string, defaultValue: T, context: EvaluationContext, _logger: Logger): Promise<ResolutionDetails<T>>;
|
|
641
625
|
private handleExposure;
|
|
642
626
|
}
|
|
643
627
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/openfeature-node-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Node.js server bindings for OpenFeature (wraps @datadog/flagging-core)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/DataDog/openfeature-js-client#readme",
|
|
@@ -15,6 +15,26 @@
|
|
|
15
15
|
"main": "cjs/index.js",
|
|
16
16
|
"module": "esm/index.js",
|
|
17
17
|
"types": "index.d.ts",
|
|
18
|
+
"typesVersions": {
|
|
19
|
+
"*": {
|
|
20
|
+
"rules-based": [
|
|
21
|
+
"rules-based.d.ts"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./index.d.ts",
|
|
28
|
+
"module": "./esm/index.js",
|
|
29
|
+
"default": "./cjs/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./rules-based": {
|
|
32
|
+
"types": "./rules-based.d.ts",
|
|
33
|
+
"module": "./esm/rules-based.js",
|
|
34
|
+
"default": "./cjs/rules-based.js"
|
|
35
|
+
},
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
18
38
|
"sideEffects": false,
|
|
19
39
|
"files": [
|
|
20
40
|
"cjs/",
|
|
@@ -30,15 +50,15 @@
|
|
|
30
50
|
"build": "run-p build:cjs build:esm && yarn build:types",
|
|
31
51
|
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json && yarn replace-build-env cjs",
|
|
32
52
|
"build:esm": "rm -rf esm && tsc -p tsconfig.esm.json && yarn replace-build-env esm",
|
|
33
|
-
"//build:types": "Bundles
|
|
34
|
-
"build:types": "
|
|
53
|
+
"//build:types": "Bundles self-contained declarations for each entrypoint, required for SSI where dd-trace's node_modules can't reach the customer's @openfeature/server-sdk. See https://github.com/DataDog/dd-trace-js/pull/9570",
|
|
54
|
+
"build:types": "node scripts/build-types.js",
|
|
35
55
|
"replace-build-env": "node ../../scripts/build/replace-build-env.js",
|
|
36
|
-
"clean": "rm -rf dist cjs esm index.d.ts",
|
|
56
|
+
"clean": "rm -rf dist cjs esm index.d.ts rules-based.d.ts",
|
|
37
57
|
"test": "jest --passWithNoTests",
|
|
38
58
|
"typecheck": "tsc --noEmit"
|
|
39
59
|
},
|
|
40
60
|
"dependencies": {
|
|
41
|
-
"@datadog/flagging-core": "3.
|
|
61
|
+
"@datadog/flagging-core": "3.3.0"
|
|
42
62
|
},
|
|
43
63
|
"devDependencies": {
|
|
44
64
|
"@openfeature/core": "1.11.0",
|