@spotify-confidence/openfeature-server-provider-local 0.10.0 → 0.10.1
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 +14 -0
- package/dist/confidence_resolver.wasm +0 -0
- package/dist/index.fetch.d.ts +1 -0
- package/dist/index.fetch.js +18 -4
- package/dist/index.inlined.d.ts +1 -0
- package/dist/index.inlined.js +19 -5
- package/dist/index.node.d.ts +1 -0
- package/dist/index.node.js +18 -4
- package/package.json +1 -1
package/dist/index.node.d.ts
CHANGED
|
@@ -297,6 +297,7 @@ interface MessageFns$2<T> {
|
|
|
297
297
|
interface SetResolverStateRequest {
|
|
298
298
|
state: Uint8Array;
|
|
299
299
|
accountId: string;
|
|
300
|
+
sdk?: Sdk | undefined;
|
|
300
301
|
}
|
|
301
302
|
declare const SetResolverStateRequest: MessageFns$1<SetResolverStateRequest>;
|
|
302
303
|
type Builtin$1 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
package/dist/index.node.js
CHANGED
|
@@ -1413,7 +1413,7 @@ function isObject(value) {
|
|
|
1413
1413
|
function isSet$3(value) {
|
|
1414
1414
|
return value !== null && value !== void 0;
|
|
1415
1415
|
}
|
|
1416
|
-
const VERSION = "0.10.
|
|
1416
|
+
const VERSION = "0.10.1";
|
|
1417
1417
|
const NOOP_LOG_FN = Object.assign(() => {}, { enabled: false });
|
|
1418
1418
|
const debugBackend = loadDebug();
|
|
1419
1419
|
const logger$2 = new class LoggerImpl {
|
|
@@ -2395,13 +2395,15 @@ const Void = {
|
|
|
2395
2395
|
function createBaseSetResolverStateRequest() {
|
|
2396
2396
|
return {
|
|
2397
2397
|
state: new Uint8Array(0),
|
|
2398
|
-
accountId: ""
|
|
2398
|
+
accountId: "",
|
|
2399
|
+
sdk: void 0
|
|
2399
2400
|
};
|
|
2400
2401
|
}
|
|
2401
2402
|
const SetResolverStateRequest = {
|
|
2402
2403
|
encode(message, writer = new BinaryWriter()) {
|
|
2403
2404
|
if (message.state.length !== 0) writer.uint32(10).bytes(message.state);
|
|
2404
2405
|
if (message.accountId !== "") writer.uint32(18).string(message.accountId);
|
|
2406
|
+
if (message.sdk !== void 0) Sdk.encode(message.sdk, writer.uint32(26).fork()).join();
|
|
2405
2407
|
return writer;
|
|
2406
2408
|
},
|
|
2407
2409
|
decode(input, length) {
|
|
@@ -2419,6 +2421,10 @@ const SetResolverStateRequest = {
|
|
|
2419
2421
|
if (tag !== 18) break;
|
|
2420
2422
|
message.accountId = reader.string();
|
|
2421
2423
|
continue;
|
|
2424
|
+
case 3:
|
|
2425
|
+
if (tag !== 26) break;
|
|
2426
|
+
message.sdk = Sdk.decode(reader, reader.uint32());
|
|
2427
|
+
continue;
|
|
2422
2428
|
}
|
|
2423
2429
|
if ((tag & 7) === 4 || tag === 0) break;
|
|
2424
2430
|
reader.skip(tag & 7);
|
|
@@ -2428,13 +2434,15 @@ const SetResolverStateRequest = {
|
|
|
2428
2434
|
fromJSON(object) {
|
|
2429
2435
|
return {
|
|
2430
2436
|
state: isSet$1(object.state) ? bytesFromBase64$2(object.state) : new Uint8Array(0),
|
|
2431
|
-
accountId: isSet$1(object.accountId) ? globalThis.String(object.accountId) : ""
|
|
2437
|
+
accountId: isSet$1(object.accountId) ? globalThis.String(object.accountId) : "",
|
|
2438
|
+
sdk: isSet$1(object.sdk) ? Sdk.fromJSON(object.sdk) : void 0
|
|
2432
2439
|
};
|
|
2433
2440
|
},
|
|
2434
2441
|
toJSON(message) {
|
|
2435
2442
|
const obj = {};
|
|
2436
2443
|
if (message.state.length !== 0) obj.state = base64FromBytes$2(message.state);
|
|
2437
2444
|
if (message.accountId !== "") obj.accountId = message.accountId;
|
|
2445
|
+
if (message.sdk !== void 0) obj.sdk = Sdk.toJSON(message.sdk);
|
|
2438
2446
|
return obj;
|
|
2439
2447
|
},
|
|
2440
2448
|
create(base) {
|
|
@@ -2444,6 +2452,7 @@ const SetResolverStateRequest = {
|
|
|
2444
2452
|
const message = createBaseSetResolverStateRequest();
|
|
2445
2453
|
message.state = object.state ?? new Uint8Array(0);
|
|
2446
2454
|
message.accountId = object.accountId ?? "";
|
|
2455
|
+
message.sdk = object.sdk !== void 0 && object.sdk !== null ? Sdk.fromPartial(object.sdk) : void 0;
|
|
2447
2456
|
return message;
|
|
2448
2457
|
}
|
|
2449
2458
|
};
|
|
@@ -2816,7 +2825,12 @@ var ConfidenceServerProviderLocal = class ConfidenceServerProviderLocal {
|
|
|
2816
2825
|
if (!resp.ok) throw new Error(`Failed to fetch state: ${resp.status} ${resp.statusText}`);
|
|
2817
2826
|
this.stateEtag = resp.headers.get("etag");
|
|
2818
2827
|
const bytes = new Uint8Array(await resp.arrayBuffer());
|
|
2819
|
-
|
|
2828
|
+
const stateRequest = SetResolverStateRequest.decode(bytes);
|
|
2829
|
+
stateRequest.sdk = {
|
|
2830
|
+
id: SdkId.SDK_ID_JS_LOCAL_SERVER_PROVIDER,
|
|
2831
|
+
version: VERSION
|
|
2832
|
+
};
|
|
2833
|
+
this.resolver.setResolverState(stateRequest);
|
|
2820
2834
|
}
|
|
2821
2835
|
async flush(signal) {
|
|
2822
2836
|
const writeFlagLogRequest = this.resolver.flushLogs();
|