@spotify-confidence/openfeature-server-provider-local 0.2.0 → 0.3.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 +18 -0
- package/README.md +80 -58
- package/dist/confidence_resolver.wasm +0 -0
- package/dist/index.browser.d.ts +60 -26
- package/dist/index.browser.js +168 -759
- package/dist/index.node.d.ts +60 -26
- package/dist/index.node.js +168 -759
- package/dist/messages-Bw39oRlC.js +524 -0
- package/dist/messages-CvypvyG4.js +2 -0
- package/package.json +2 -2
package/dist/index.node.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
import { EvaluationContext, JsonValue, Provider, ProviderMetadata, ProviderStatus, ResolutionDetails } from "@openfeature/server-sdk";
|
|
3
3
|
|
|
4
|
-
//#region src/proto/
|
|
4
|
+
//#region src/proto/confidence/flags/resolver/v1/types.d.ts
|
|
5
|
+
|
|
5
6
|
declare enum SdkId {
|
|
6
7
|
SDK_ID_UNSPECIFIED = 0,
|
|
7
8
|
SDK_ID_JAVA_PROVIDER = 1,
|
|
@@ -28,6 +29,33 @@ declare enum SdkId {
|
|
|
28
29
|
SDK_ID_JS_LOCAL_SERVER_PROVIDER = 22,
|
|
29
30
|
UNRECOGNIZED = -1,
|
|
30
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* (-- api-linter: core::0123::resource-annotation=disabled
|
|
34
|
+
* aip.dev/not-precedent: SDKs are not internal Confidence resources. --)
|
|
35
|
+
*/
|
|
36
|
+
interface Sdk {
|
|
37
|
+
/** Name of a Confidence SDKs. */
|
|
38
|
+
id?: SdkId | undefined;
|
|
39
|
+
/** Custom name for non-Confidence SDKs. */
|
|
40
|
+
customId?: string | undefined;
|
|
41
|
+
/** Version of the SDK. */
|
|
42
|
+
version: string;
|
|
43
|
+
}
|
|
44
|
+
declare const Sdk: MessageFns$2<Sdk>;
|
|
45
|
+
type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
46
|
+
type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {} ? { [K in keyof T]?: DeepPartial$2<T[K]> } : Partial<T>;
|
|
47
|
+
type KeysOfUnion$2<T> = T extends T ? keyof T : never;
|
|
48
|
+
type Exact$2<P, I extends P> = P extends Builtin$2 ? P : P & { [K in keyof P]: Exact$2<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion$2<P>>]: never };
|
|
49
|
+
interface MessageFns$2<T> {
|
|
50
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
51
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
52
|
+
fromJSON(object: any): T;
|
|
53
|
+
toJSON(message: T): unknown;
|
|
54
|
+
create<I extends Exact$2<DeepPartial$2<T>, I>>(base?: I): T;
|
|
55
|
+
fromPartial<I extends Exact$2<DeepPartial$2<T>, I>>(object: I): T;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/proto/types.d.ts
|
|
31
59
|
declare enum ResolveReason {
|
|
32
60
|
/** RESOLVE_REASON_UNSPECIFIED - Unspecified enum. */
|
|
33
61
|
RESOLVE_REASON_UNSPECIFIED = 0,
|
|
@@ -50,11 +78,8 @@ declare enum ResolveReason {
|
|
|
50
78
|
RESOLVE_REASON_ERROR = 6,
|
|
51
79
|
UNRECOGNIZED = -1,
|
|
52
80
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
customId?: string | undefined;
|
|
56
|
-
version: string;
|
|
57
|
-
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/proto/resolver/api.d.ts
|
|
58
83
|
interface ResolveFlagsRequest {
|
|
59
84
|
/**
|
|
60
85
|
* If non-empty, the specific flags are resolved, otherwise all flags
|
|
@@ -113,10 +138,6 @@ interface ResolvedFlag {
|
|
|
113
138
|
/** The reason to why the flag could be resolved or not. */
|
|
114
139
|
reason: ResolveReason;
|
|
115
140
|
}
|
|
116
|
-
interface SetResolverStateRequest {
|
|
117
|
-
state: Uint8Array;
|
|
118
|
-
accountId: string;
|
|
119
|
-
}
|
|
120
141
|
/** Request for resolving flags with sticky (materialized) assignments */
|
|
121
142
|
interface ResolveWithStickyRequest {
|
|
122
143
|
/** The standard resolve request */
|
|
@@ -176,19 +197,36 @@ interface ResolveWithStickyResponse_MaterializationUpdate {
|
|
|
176
197
|
rule: string;
|
|
177
198
|
variant: string;
|
|
178
199
|
}
|
|
179
|
-
declare const
|
|
180
|
-
declare const
|
|
181
|
-
declare const
|
|
182
|
-
declare const
|
|
200
|
+
declare const ResolveFlagsRequest: MessageFns$1<ResolveFlagsRequest>;
|
|
201
|
+
declare const ResolveFlagsResponse: MessageFns$1<ResolveFlagsResponse>;
|
|
202
|
+
declare const ResolvedFlag: MessageFns$1<ResolvedFlag>;
|
|
203
|
+
declare const ResolveWithStickyRequest: MessageFns$1<ResolveWithStickyRequest>;
|
|
204
|
+
declare const MaterializationMap: MessageFns$1<MaterializationMap>;
|
|
205
|
+
declare const MaterializationInfo: MessageFns$1<MaterializationInfo>;
|
|
206
|
+
declare const ResolveWithStickyResponse: MessageFns$1<ResolveWithStickyResponse>;
|
|
207
|
+
declare const ResolveWithStickyResponse_Success: MessageFns$1<ResolveWithStickyResponse_Success>;
|
|
208
|
+
declare const ResolveWithStickyResponse_MissingMaterializations: MessageFns$1<ResolveWithStickyResponse_MissingMaterializations>;
|
|
209
|
+
declare const ResolveWithStickyResponse_MissingMaterializationItem: MessageFns$1<ResolveWithStickyResponse_MissingMaterializationItem>;
|
|
210
|
+
declare const ResolveWithStickyResponse_MaterializationUpdate: MessageFns$1<ResolveWithStickyResponse_MaterializationUpdate>;
|
|
211
|
+
type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
212
|
+
type DeepPartial$1<T> = T extends Builtin$1 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$1<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$1<U>> : T extends {} ? { [K in keyof T]?: DeepPartial$1<T[K]> } : Partial<T>;
|
|
213
|
+
type KeysOfUnion$1<T> = T extends T ? keyof T : never;
|
|
214
|
+
type Exact$1<P, I extends P> = P extends Builtin$1 ? P : P & { [K in keyof P]: Exact$1<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion$1<P>>]: never };
|
|
215
|
+
interface MessageFns$1<T> {
|
|
216
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
217
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
218
|
+
fromJSON(object: any): T;
|
|
219
|
+
toJSON(message: T): unknown;
|
|
220
|
+
create<I extends Exact$1<DeepPartial$1<T>, I>>(base?: I): T;
|
|
221
|
+
fromPartial<I extends Exact$1<DeepPartial$1<T>, I>>(object: I): T;
|
|
222
|
+
}
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/proto/messages.d.ts
|
|
225
|
+
interface SetResolverStateRequest {
|
|
226
|
+
state: Uint8Array;
|
|
227
|
+
accountId: string;
|
|
228
|
+
}
|
|
183
229
|
declare const SetResolverStateRequest: MessageFns<SetResolverStateRequest>;
|
|
184
|
-
declare const ResolveWithStickyRequest: MessageFns<ResolveWithStickyRequest>;
|
|
185
|
-
declare const MaterializationMap: MessageFns<MaterializationMap>;
|
|
186
|
-
declare const MaterializationInfo: MessageFns<MaterializationInfo>;
|
|
187
|
-
declare const ResolveWithStickyResponse: MessageFns<ResolveWithStickyResponse>;
|
|
188
|
-
declare const ResolveWithStickyResponse_Success: MessageFns<ResolveWithStickyResponse_Success>;
|
|
189
|
-
declare const ResolveWithStickyResponse_MissingMaterializations: MessageFns<ResolveWithStickyResponse_MissingMaterializations>;
|
|
190
|
-
declare const ResolveWithStickyResponse_MissingMaterializationItem: MessageFns<ResolveWithStickyResponse_MissingMaterializationItem>;
|
|
191
|
-
declare const ResolveWithStickyResponse_MaterializationUpdate: MessageFns<ResolveWithStickyResponse_MaterializationUpdate>;
|
|
192
230
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
193
231
|
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> } : Partial<T>;
|
|
194
232
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
@@ -212,8 +250,6 @@ interface LocalResolver {
|
|
|
212
250
|
//#region src/ConfidenceServerProviderLocal.d.ts
|
|
213
251
|
interface ProviderOptions {
|
|
214
252
|
flagClientSecret: string;
|
|
215
|
-
apiClientId: string;
|
|
216
|
-
apiClientSecret: string;
|
|
217
253
|
initializeTimeout?: number;
|
|
218
254
|
flushInterval?: number;
|
|
219
255
|
fetch?: typeof fetch;
|
|
@@ -250,8 +286,6 @@ declare class ConfidenceServerProviderLocal implements Provider {
|
|
|
250
286
|
private extractValue;
|
|
251
287
|
updateState(signal?: AbortSignal): Promise<void>;
|
|
252
288
|
flush(signal?: AbortSignal): Promise<void>;
|
|
253
|
-
private fetchResolveStateUri;
|
|
254
|
-
private fetchToken;
|
|
255
289
|
private static convertReason;
|
|
256
290
|
private static convertEvaluationContext;
|
|
257
291
|
/** Resolves with an evaluation of a Boolean flag */
|