@spotify-confidence/openfeature-server-provider-local 0.9.1 → 0.10.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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.10.0](https://github.com/spotify/confidence-resolver/compare/openfeature-provider-js-v0.9.1...openfeature-provider-js-v0.10.0) (2026-03-06)
4
+
5
+
6
+ ### Features
7
+
8
+ * metrics in telemetry data ([#266](https://github.com/spotify/confidence-resolver/issues/266)) ([965eff6](https://github.com/spotify/confidence-resolver/commit/965eff60b6c0377336e6e86624a78f6f3a859f73))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **js:** increase state fetch stall timeout to 1s ([#293](https://github.com/spotify/confidence-resolver/issues/293)) ([f95da45](https://github.com/spotify/confidence-resolver/commit/f95da455ef338b3e43604f4a2d76d008c9e63496))
14
+
15
+
16
+ ### Dependencies
17
+
18
+ * The following workspace dependencies were updated
19
+ * dependencies
20
+ * rust-guest bumped from 0.1.17 to 0.1.18
21
+
3
22
  ## [0.9.1](https://github.com/spotify/confidence-resolver/compare/openfeature-provider-js-v0.9.0...openfeature-provider-js-v0.9.1) (2026-02-20)
4
23
 
5
24
 
Binary file
@@ -80,6 +80,8 @@ declare enum ResolveReason {
80
80
  RESOLVE_REASON_ERROR = 6,
81
81
  /** RESOLVE_REASON_UNRECOGNIZED_TARGETING_RULE - The flag could not be resolved because a targeting rule was not recognized */
82
82
  RESOLVE_REASON_UNRECOGNIZED_TARGETING_RULE = 7,
83
+ /** RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED - The flag could not be resolved because a rule is using materialization */
84
+ RESOLVE_REASON_MATERIALIZATION_NOT_SUPPORTED = 8,
83
85
  UNRECOGNIZED = -1,
84
86
  }
85
87
  declare enum SdkId {
@@ -233,45 +235,51 @@ interface MessageFns$3<T> {
233
235
  fromPartial<I extends Exact$3<DeepPartial$3<T>, I>>(object: I): T;
234
236
  }
235
237
  //#endregion
236
- //#region src/proto/confidence/flags/resolver/v1/internal_api.d.ts
237
- interface VariantReadOp {
238
- unit: string;
239
- materialization: string;
240
- rule: string;
238
+ //#region src/proto/confidence/wasm/wasm_api.d.ts
239
+ interface ResolveProcessRequest {
240
+ /** Materialization reads will "suspend" the resolve */
241
+ deferredMaterializations?: ResolveFlagsRequest | undefined;
242
+ /** Materializations will be read from a statically provided set */
243
+ staticMaterializations?: ResolveProcessRequest_StaticMaterializations | undefined;
244
+ /** No materialization support, reads will error the flag. */
245
+ withoutMaterializations?: ResolveFlagsRequest | undefined;
246
+ /** Resume a previously suspended resolve with requested materializations */
247
+ resume?: ResolveProcessRequest_Resume | undefined;
248
+ }
249
+ interface ResolveProcessRequest_StaticMaterializations {
250
+ resolveRequest?: ResolveFlagsRequest | undefined;
251
+ materializations: MaterializationRecord[];
241
252
  }
242
- interface InclusionReadOp {
243
- unit: string;
244
- materialization: string;
253
+ interface ResolveProcessRequest_Resume {
254
+ materializations: MaterializationRecord[];
255
+ state: Uint8Array;
245
256
  }
246
- interface ReadOp$1 {
247
- variantReadOp?: VariantReadOp | undefined;
248
- inclusionReadOp?: InclusionReadOp | undefined;
257
+ interface ResolveProcessResponse {
258
+ resolved?: ResolveProcessResponse_Resolved | undefined;
259
+ suspended?: ResolveProcessResponse_Suspended | undefined;
249
260
  }
250
- interface ReadOperationsRequest {
251
- ops: ReadOp$1[];
261
+ interface ResolveProcessResponse_Resolved {
262
+ response?: ResolveFlagsResponse | undefined;
263
+ materializationsToWrite: MaterializationRecord[];
252
264
  }
253
- interface VariantData {
265
+ interface ResolveProcessResponse_Suspended {
266
+ materializationsToRead: MaterializationRecord[];
267
+ state: Uint8Array;
268
+ }
269
+ /** This message is used both as a query and a result when reading materializations. */
270
+ interface MaterializationRecord {
254
271
  unit: string;
255
272
  materialization: string;
256
273
  rule: string;
257
274
  variant: string;
258
275
  }
259
- interface InclusionData {
260
- unit: string;
261
- materialization: string;
262
- isIncluded: boolean;
263
- }
264
- interface ReadResult {
265
- variantResult?: VariantData | undefined;
266
- inclusionResult?: InclusionData | undefined;
267
- }
268
- declare const VariantReadOp: MessageFns$2<VariantReadOp>;
269
- declare const InclusionReadOp: MessageFns$2<InclusionReadOp>;
270
- declare const ReadOp$1: MessageFns$2<ReadOp$1>;
271
- declare const ReadOperationsRequest: MessageFns$2<ReadOperationsRequest>;
272
- declare const VariantData: MessageFns$2<VariantData>;
273
- declare const InclusionData: MessageFns$2<InclusionData>;
274
- declare const ReadResult: MessageFns$2<ReadResult>;
276
+ declare const ResolveProcessRequest: MessageFns$2<ResolveProcessRequest>;
277
+ declare const ResolveProcessRequest_StaticMaterializations: MessageFns$2<ResolveProcessRequest_StaticMaterializations>;
278
+ declare const ResolveProcessRequest_Resume: MessageFns$2<ResolveProcessRequest_Resume>;
279
+ declare const ResolveProcessResponse: MessageFns$2<ResolveProcessResponse>;
280
+ declare const ResolveProcessResponse_Resolved: MessageFns$2<ResolveProcessResponse_Resolved>;
281
+ declare const ResolveProcessResponse_Suspended: MessageFns$2<ResolveProcessResponse_Suspended>;
282
+ declare const MaterializationRecord: MessageFns$2<MaterializationRecord>;
275
283
  type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
276
284
  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>;
277
285
  type KeysOfUnion$2<T> = T extends T ? keyof T : never;
@@ -285,32 +293,12 @@ interface MessageFns$2<T> {
285
293
  fromPartial<I extends Exact$2<DeepPartial$2<T>, I>>(object: I): T;
286
294
  }
287
295
  //#endregion
288
- //#region src/proto/confidence/wasm/wasm_api.d.ts
289
- /** Request for resolving flags with sticky (materialized) assignments */
290
- interface ResolveWithStickyRequest {
291
- /** The standard resolve request */
292
- resolveRequest?: ResolveFlagsRequest | undefined;
293
- /** if a materialization info is missing, we want tor return to the caller immediately */
294
- failFastOnSticky: boolean;
295
- /** if we should support sticky or completely skip the flag if they had sticky rules */
296
- notProcessSticky: boolean;
297
- /** Context about the materialization required for the resolve */
298
- materializations: ReadResult[];
299
- }
300
- /** Response from resolving with sticky assignments */
301
- interface ResolveWithStickyResponse {
302
- success?: ResolveWithStickyResponse_Success | undefined;
303
- readOpsRequest?: ReadOperationsRequest | undefined;
304
- }
305
- /** Successful resolution with materialization updates */
306
- interface ResolveWithStickyResponse_Success {
307
- response?: ResolveFlagsResponse | undefined;
308
- /** New assignments that should be stored */
309
- materializationUpdates: VariantData[];
296
+ //#region src/proto/confidence/wasm/messages.d.ts
297
+ interface SetResolverStateRequest {
298
+ state: Uint8Array;
299
+ accountId: string;
310
300
  }
311
- declare const ResolveWithStickyRequest: MessageFns$1<ResolveWithStickyRequest>;
312
- declare const ResolveWithStickyResponse: MessageFns$1<ResolveWithStickyResponse>;
313
- declare const ResolveWithStickyResponse_Success: MessageFns$1<ResolveWithStickyResponse_Success>;
301
+ declare const SetResolverStateRequest: MessageFns$1<SetResolverStateRequest>;
314
302
  type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
315
303
  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>;
316
304
  type KeysOfUnion$1<T> = T extends T ? keyof T : never;
@@ -324,12 +312,34 @@ interface MessageFns$1<T> {
324
312
  fromPartial<I extends Exact$1<DeepPartial$1<T>, I>>(object: I): T;
325
313
  }
326
314
  //#endregion
327
- //#region src/proto/confidence/wasm/messages.d.ts
328
- interface SetResolverStateRequest {
329
- state: Uint8Array;
330
- accountId: string;
315
+ //#region src/LocalResolver.d.ts
316
+ interface LocalResolver {
317
+ resolveProcess(request: ResolveProcessRequest): ResolveProcessResponse;
318
+ setResolverState(request: SetResolverStateRequest): void;
319
+ flushLogs(): Uint8Array;
320
+ flushAssigned(): Uint8Array;
321
+ applyFlags(request: ApplyFlagsRequest): void;
322
+ }
323
+ //#endregion
324
+ //#region src/proto/confidence/flags/resolver/v1/internal_api.d.ts
325
+ interface VariantData {
326
+ unit: string;
327
+ materialization: string;
328
+ rule: string;
329
+ variant: string;
330
+ }
331
+ interface InclusionData {
332
+ unit: string;
333
+ materialization: string;
334
+ isIncluded: boolean;
335
+ }
336
+ interface ReadResult {
337
+ variantResult?: VariantData | undefined;
338
+ inclusionResult?: InclusionData | undefined;
331
339
  }
332
- declare const SetResolverStateRequest: MessageFns<SetResolverStateRequest>;
340
+ declare const VariantData: MessageFns<VariantData>;
341
+ declare const InclusionData: MessageFns<InclusionData>;
342
+ declare const ReadResult: MessageFns<ReadResult>;
333
343
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
334
344
  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>;
335
345
  type KeysOfUnion<T> = T extends T ? keyof T : never;
@@ -343,15 +353,6 @@ interface MessageFns<T> {
343
353
  fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
344
354
  }
345
355
  //#endregion
346
- //#region src/LocalResolver.d.ts
347
- interface LocalResolver {
348
- resolveWithSticky(request: ResolveWithStickyRequest): ResolveWithStickyResponse;
349
- setResolverState(request: SetResolverStateRequest): void;
350
- flushLogs(): Uint8Array;
351
- flushAssigned(): Uint8Array;
352
- applyFlags(request: ApplyFlagsRequest): void;
353
- }
354
- //#endregion
355
356
  //#region src/materialization.d.ts
356
357
  declare namespace MaterializationStore {
357
358
  namespace ReadOp {
@@ -465,7 +466,7 @@ interface ProviderOptions {
465
466
  initializeTimeout?: number;
466
467
  /** Interval in milliseconds between state polling updates. Defaults to 30000ms. */
467
468
  stateUpdateInterval?: number;
468
- /** Interval in milliseconds between log flushes. Defaults to 10000ms. */
469
+ /** Interval in milliseconds between log flushes. Defaults to 15000ms. */
469
470
  flushInterval?: number;
470
471
  fetch?: typeof fetch;
471
472
  materializationStore?: MaterializationStore | "CONFIDENCE_REMOTE_STORE";
@@ -493,7 +494,8 @@ declare class ConfidenceServerProviderLocal implements Provider {
493
494
  onClose(): Promise<void>;
494
495
  resolve(context: EvaluationContext, flagNames: string[], apply?: boolean): Promise<FlagBundle$1>;
495
496
  evaluate<T extends JsonValue>(flagKey: string, defaultValue: T, context: EvaluationContext): Promise<ResolutionDetails<T>>;
496
- private resolveWithSticky;
497
+ private resolveProcess;
498
+ private handleMaterializationWrites;
497
499
  updateState(signal?: AbortSignal): Promise<void>;
498
500
  flush(signal?: AbortSignal): Promise<void>;
499
501
  private flushAssigned;