@spotify-confidence/openfeature-server-provider-local 0.1.1 → 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.
@@ -1,7 +1,61 @@
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/api.d.ts
4
+ //#region src/proto/confidence/flags/resolver/v1/types.d.ts
5
+
6
+ declare enum SdkId {
7
+ SDK_ID_UNSPECIFIED = 0,
8
+ SDK_ID_JAVA_PROVIDER = 1,
9
+ SDK_ID_KOTLIN_PROVIDER = 2,
10
+ SDK_ID_SWIFT_PROVIDER = 3,
11
+ SDK_ID_JS_WEB_PROVIDER = 4,
12
+ SDK_ID_JS_SERVER_PROVIDER = 5,
13
+ SDK_ID_PYTHON_PROVIDER = 6,
14
+ SDK_ID_GO_PROVIDER = 7,
15
+ SDK_ID_RUBY_PROVIDER = 8,
16
+ SDK_ID_RUST_PROVIDER = 9,
17
+ SDK_ID_JAVA_CONFIDENCE = 10,
18
+ SDK_ID_KOTLIN_CONFIDENCE = 11,
19
+ SDK_ID_SWIFT_CONFIDENCE = 12,
20
+ SDK_ID_JS_CONFIDENCE = 13,
21
+ SDK_ID_PYTHON_CONFIDENCE = 14,
22
+ SDK_ID_GO_CONFIDENCE = 15,
23
+ SDK_ID_RUST_CONFIDENCE = 16,
24
+ SDK_ID_FLUTTER_IOS_CONFIDENCE = 17,
25
+ SDK_ID_FLUTTER_ANDROID_CONFIDENCE = 18,
26
+ SDK_ID_DOTNET_CONFIDENCE = 19,
27
+ SDK_ID_GO_LOCAL_PROVIDER = 20,
28
+ SDK_ID_JAVA_LOCAL_PROVIDER = 21,
29
+ SDK_ID_JS_LOCAL_SERVER_PROVIDER = 22,
30
+ UNRECOGNIZED = -1,
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
5
59
  declare enum ResolveReason {
6
60
  /** RESOLVE_REASON_UNSPECIFIED - Unspecified enum. */
7
61
  RESOLVE_REASON_UNSPECIFIED = 0,
@@ -24,6 +78,8 @@ declare enum ResolveReason {
24
78
  RESOLVE_REASON_ERROR = 6,
25
79
  UNRECOGNIZED = -1,
26
80
  }
81
+ //#endregion
82
+ //#region src/proto/resolver/api.d.ts
27
83
  interface ResolveFlagsRequest {
28
84
  /**
29
85
  * If non-empty, the specific flags are resolved, otherwise all flags
@@ -50,6 +106,8 @@ interface ResolveFlagsRequest {
50
106
  * `apply` should likely be set to false.
51
107
  */
52
108
  apply: boolean;
109
+ /** Information about the SDK used to initiate the request. */
110
+ sdk?: Sdk | undefined;
53
111
  }
54
112
  interface ResolveFlagsResponse {
55
113
  /**
@@ -80,10 +138,6 @@ interface ResolvedFlag {
80
138
  /** The reason to why the flag could be resolved or not. */
81
139
  reason: ResolveReason;
82
140
  }
83
- interface SetResolverStateRequest {
84
- state: Uint8Array;
85
- accountId: string;
86
- }
87
141
  /** Request for resolving flags with sticky (materialized) assignments */
88
142
  interface ResolveWithStickyRequest {
89
143
  /** The standard resolve request */
@@ -143,18 +197,36 @@ interface ResolveWithStickyResponse_MaterializationUpdate {
143
197
  rule: string;
144
198
  variant: string;
145
199
  }
146
- declare const ResolveFlagsRequest: MessageFns<ResolveFlagsRequest>;
147
- declare const ResolveFlagsResponse: MessageFns<ResolveFlagsResponse>;
148
- declare const ResolvedFlag: MessageFns<ResolvedFlag>;
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
+ }
149
229
  declare const SetResolverStateRequest: MessageFns<SetResolverStateRequest>;
150
- declare const ResolveWithStickyRequest: MessageFns<ResolveWithStickyRequest>;
151
- declare const MaterializationMap: MessageFns<MaterializationMap>;
152
- declare const MaterializationInfo: MessageFns<MaterializationInfo>;
153
- declare const ResolveWithStickyResponse: MessageFns<ResolveWithStickyResponse>;
154
- declare const ResolveWithStickyResponse_Success: MessageFns<ResolveWithStickyResponse_Success>;
155
- declare const ResolveWithStickyResponse_MissingMaterializations: MessageFns<ResolveWithStickyResponse_MissingMaterializations>;
156
- declare const ResolveWithStickyResponse_MissingMaterializationItem: MessageFns<ResolveWithStickyResponse_MissingMaterializationItem>;
157
- declare const ResolveWithStickyResponse_MaterializationUpdate: MessageFns<ResolveWithStickyResponse_MaterializationUpdate>;
158
230
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
159
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>;
160
232
  type KeysOfUnion<T> = T extends T ? keyof T : never;
@@ -178,8 +250,6 @@ interface LocalResolver {
178
250
  //#region src/ConfidenceServerProviderLocal.d.ts
179
251
  interface ProviderOptions {
180
252
  flagClientSecret: string;
181
- apiClientId: string;
182
- apiClientSecret: string;
183
253
  initializeTimeout?: number;
184
254
  flushInterval?: number;
185
255
  fetch?: typeof fetch;
@@ -216,8 +286,6 @@ declare class ConfidenceServerProviderLocal implements Provider {
216
286
  private extractValue;
217
287
  updateState(signal?: AbortSignal): Promise<void>;
218
288
  flush(signal?: AbortSignal): Promise<void>;
219
- private fetchResolveStateUri;
220
- private fetchToken;
221
289
  private static convertReason;
222
290
  private static convertEvaluationContext;
223
291
  /** Resolves with an evaluation of a Boolean flag */