@flipt-io/flipt-client-js 0.4.1 → 0.5.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 +24 -0
- package/dist/browser/index.cjs +117 -62
- package/dist/browser/index.mjs +117 -62
- package/dist/flipt_engine_wasm_js_bg.wasm +0 -0
- package/dist/node/index.cjs +125 -63
- package/dist/node/index.mjs +125 -63
- package/dist/slim/index.cjs +116 -61
- package/dist/slim/index.mjs +116 -61
- package/dist/types/core/base.d.ts +4 -0
- package/dist/types/core/snapshot.d.ts +13 -0
- package/dist/types/core/snapshot.test.d.ts +1 -0
- package/dist/types/core/types.d.ts +6 -0
- package/package.json +2 -2
package/dist/slim/index.mjs
CHANGED
|
@@ -44,6 +44,27 @@ class Engine {
|
|
|
44
44
|
}
|
|
45
45
|
return takeFromExternrefTable0(ret[0]);
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* @returns {string}
|
|
49
|
+
*/
|
|
50
|
+
get_snapshot() {
|
|
51
|
+
let deferred2_0;
|
|
52
|
+
let deferred2_1;
|
|
53
|
+
try {
|
|
54
|
+
const ret = wasm.engine_get_snapshot(this.__wbg_ptr);
|
|
55
|
+
var ptr1 = ret[0];
|
|
56
|
+
var len1 = ret[1];
|
|
57
|
+
if (ret[3]) {
|
|
58
|
+
ptr1 = 0; len1 = 0;
|
|
59
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
60
|
+
}
|
|
61
|
+
deferred2_0 = ptr1;
|
|
62
|
+
deferred2_1 = len1;
|
|
63
|
+
return getStringFromWasm0(ptr1, len1);
|
|
64
|
+
} finally {
|
|
65
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
47
68
|
/**
|
|
48
69
|
* @returns {any}
|
|
49
70
|
*/
|
|
@@ -61,10 +82,21 @@ class Engine {
|
|
|
61
82
|
const ptr0 = passStringToWasm0(namespace, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
62
83
|
const len0 = WASM_VECTOR_LEN;
|
|
63
84
|
const ret = wasm.engine_new(ptr0, len0);
|
|
64
|
-
this.__wbg_ptr = ret
|
|
85
|
+
this.__wbg_ptr = ret;
|
|
65
86
|
EngineFinalization.register(this, this.__wbg_ptr, this);
|
|
66
87
|
return this;
|
|
67
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* @param {string} snapshot_b64
|
|
91
|
+
*/
|
|
92
|
+
seed_snapshot(snapshot_b64) {
|
|
93
|
+
const ptr0 = passStringToWasm0(snapshot_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
94
|
+
const len0 = WASM_VECTOR_LEN;
|
|
95
|
+
const ret = wasm.engine_seed_snapshot(this.__wbg_ptr, ptr0, len0);
|
|
96
|
+
if (ret[1]) {
|
|
97
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
68
100
|
/**
|
|
69
101
|
* @param {any} data
|
|
70
102
|
*/
|
|
@@ -76,11 +108,10 @@ class Engine {
|
|
|
76
108
|
}
|
|
77
109
|
}
|
|
78
110
|
if (Symbol.dispose) Engine.prototype[Symbol.dispose] = Engine.prototype.free;
|
|
79
|
-
|
|
80
111
|
function __wbg_get_imports() {
|
|
81
112
|
const import0 = {
|
|
82
113
|
__proto__: null,
|
|
83
|
-
|
|
114
|
+
__wbg_Error_fdd633d4bb5dd76a: function(arg0, arg1) {
|
|
84
115
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
85
116
|
return ret;
|
|
86
117
|
},
|
|
@@ -91,50 +122,50 @@ function __wbg_get_imports() {
|
|
|
91
122
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
92
123
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
93
124
|
},
|
|
94
|
-
|
|
125
|
+
__wbg___wbindgen_boolean_get_edaed31a367ce1bd: function(arg0) {
|
|
95
126
|
const v = arg0;
|
|
96
127
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
97
128
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
98
129
|
},
|
|
99
|
-
|
|
130
|
+
__wbg___wbindgen_debug_string_8a447059637473e2: function(arg0, arg1) {
|
|
100
131
|
const ret = debugString(arg1);
|
|
101
132
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
102
133
|
const len1 = WASM_VECTOR_LEN;
|
|
103
134
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
104
135
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
105
136
|
},
|
|
106
|
-
|
|
137
|
+
__wbg___wbindgen_in_4990f46af709e33c: function(arg0, arg1) {
|
|
107
138
|
const ret = arg0 in arg1;
|
|
108
139
|
return ret;
|
|
109
140
|
},
|
|
110
|
-
|
|
141
|
+
__wbg___wbindgen_is_function_acc5528be2b923f2: function(arg0) {
|
|
111
142
|
const ret = typeof(arg0) === 'function';
|
|
112
143
|
return ret;
|
|
113
144
|
},
|
|
114
|
-
|
|
145
|
+
__wbg___wbindgen_is_object_0beba4a1980d3eea: function(arg0) {
|
|
115
146
|
const val = arg0;
|
|
116
147
|
const ret = typeof(val) === 'object' && val !== null;
|
|
117
148
|
return ret;
|
|
118
149
|
},
|
|
119
|
-
|
|
150
|
+
__wbg___wbindgen_is_string_1fca8072260dd261: function(arg0) {
|
|
120
151
|
const ret = typeof(arg0) === 'string';
|
|
121
152
|
return ret;
|
|
122
153
|
},
|
|
123
|
-
|
|
154
|
+
__wbg___wbindgen_is_undefined_721f8decd50c87a3: function(arg0) {
|
|
124
155
|
const ret = arg0 === undefined;
|
|
125
156
|
return ret;
|
|
126
157
|
},
|
|
127
|
-
|
|
158
|
+
__wbg___wbindgen_jsval_loose_eq_4b9aba9e5b3c4582: function(arg0, arg1) {
|
|
128
159
|
const ret = arg0 == arg1;
|
|
129
160
|
return ret;
|
|
130
161
|
},
|
|
131
|
-
|
|
162
|
+
__wbg___wbindgen_number_get_1cc01dd708740256: function(arg0, arg1) {
|
|
132
163
|
const obj = arg1;
|
|
133
164
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
134
165
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
135
166
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
136
167
|
},
|
|
137
|
-
|
|
168
|
+
__wbg___wbindgen_string_get_71bb4348194e31f0: function(arg0, arg1) {
|
|
138
169
|
const obj = arg1;
|
|
139
170
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
140
171
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -142,18 +173,18 @@ function __wbg_get_imports() {
|
|
|
142
173
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
143
174
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
144
175
|
},
|
|
145
|
-
|
|
176
|
+
__wbg___wbindgen_throw_ea4887a5f8f9a9db: function(arg0, arg1) {
|
|
146
177
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
147
178
|
},
|
|
148
|
-
|
|
179
|
+
__wbg_call_8e98ed2f3c86c4b5: function() { return handleError(function (arg0, arg1) {
|
|
149
180
|
const ret = arg0.call(arg1);
|
|
150
181
|
return ret;
|
|
151
182
|
}, arguments); },
|
|
152
|
-
|
|
183
|
+
__wbg_done_b62d4a7d2286852a: function(arg0) {
|
|
153
184
|
const ret = arg0.done;
|
|
154
185
|
return ret;
|
|
155
186
|
},
|
|
156
|
-
|
|
187
|
+
__wbg_entries_c261c3fa1f281256: function(arg0) {
|
|
157
188
|
const ret = Object.entries(arg0);
|
|
158
189
|
return ret;
|
|
159
190
|
},
|
|
@@ -168,19 +199,19 @@ function __wbg_get_imports() {
|
|
|
168
199
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
169
200
|
}
|
|
170
201
|
},
|
|
171
|
-
|
|
202
|
+
__wbg_getTime_7a770f8a2ec8d634: function(arg0) {
|
|
172
203
|
const ret = arg0.getTime();
|
|
173
204
|
return ret;
|
|
174
205
|
},
|
|
175
|
-
|
|
206
|
+
__wbg_get_197a3fe98f169e38: function(arg0, arg1) {
|
|
176
207
|
const ret = arg0[arg1 >>> 0];
|
|
177
208
|
return ret;
|
|
178
209
|
},
|
|
179
|
-
|
|
210
|
+
__wbg_get_9a29be2cb383ed9a: function() { return handleError(function (arg0, arg1) {
|
|
180
211
|
const ret = Reflect.get(arg0, arg1);
|
|
181
212
|
return ret;
|
|
182
213
|
}, arguments); },
|
|
183
|
-
|
|
214
|
+
__wbg_get_unchecked_54a4374c38e08460: function(arg0, arg1) {
|
|
184
215
|
const ret = arg0[arg1 >>> 0];
|
|
185
216
|
return ret;
|
|
186
217
|
},
|
|
@@ -188,7 +219,7 @@ function __wbg_get_imports() {
|
|
|
188
219
|
const ret = arg0[arg1];
|
|
189
220
|
return ret;
|
|
190
221
|
},
|
|
191
|
-
|
|
222
|
+
__wbg_instanceof_ArrayBuffer_2a7bb09fee70c2da: function(arg0) {
|
|
192
223
|
let result;
|
|
193
224
|
try {
|
|
194
225
|
result = arg0 instanceof ArrayBuffer;
|
|
@@ -198,7 +229,7 @@ function __wbg_get_imports() {
|
|
|
198
229
|
const ret = result;
|
|
199
230
|
return ret;
|
|
200
231
|
},
|
|
201
|
-
|
|
232
|
+
__wbg_instanceof_Uint8Array_f080092dc70f5d58: function(arg0) {
|
|
202
233
|
let result;
|
|
203
234
|
try {
|
|
204
235
|
result = arg0 instanceof Uint8Array;
|
|
@@ -208,50 +239,50 @@ function __wbg_get_imports() {
|
|
|
208
239
|
const ret = result;
|
|
209
240
|
return ret;
|
|
210
241
|
},
|
|
211
|
-
|
|
242
|
+
__wbg_isArray_145a34fd0a38d37b: function(arg0) {
|
|
212
243
|
const ret = Array.isArray(arg0);
|
|
213
244
|
return ret;
|
|
214
245
|
},
|
|
215
|
-
|
|
246
|
+
__wbg_iterator_cc47ba25a2be735a: function() {
|
|
216
247
|
const ret = Symbol.iterator;
|
|
217
248
|
return ret;
|
|
218
249
|
},
|
|
219
|
-
|
|
250
|
+
__wbg_length_589238bdcf171f0e: function(arg0) {
|
|
220
251
|
const ret = arg0.length;
|
|
221
252
|
return ret;
|
|
222
253
|
},
|
|
223
|
-
|
|
254
|
+
__wbg_length_c6054974c0a6cdb9: function(arg0) {
|
|
224
255
|
const ret = arg0.length;
|
|
225
256
|
return ret;
|
|
226
257
|
},
|
|
227
|
-
|
|
258
|
+
__wbg_new_0_1b32bedde98fef4b: function() {
|
|
228
259
|
const ret = new Date();
|
|
229
260
|
return ret;
|
|
230
261
|
},
|
|
231
|
-
__wbg_new_1d96678aaacca32e: function(arg0) {
|
|
232
|
-
const ret = new Uint8Array(arg0);
|
|
233
|
-
return ret;
|
|
234
|
-
},
|
|
235
262
|
__wbg_new_227d7c05414eb861: function() {
|
|
236
263
|
const ret = new Error();
|
|
237
264
|
return ret;
|
|
238
265
|
},
|
|
239
|
-
|
|
240
|
-
const ret = new
|
|
266
|
+
__wbg_new_2e117a478906f062: function() {
|
|
267
|
+
const ret = new Object();
|
|
241
268
|
return ret;
|
|
242
269
|
},
|
|
243
|
-
|
|
244
|
-
const ret = new
|
|
270
|
+
__wbg_new_36e147a8ced3c6e0: function() {
|
|
271
|
+
const ret = new Array();
|
|
245
272
|
return ret;
|
|
246
273
|
},
|
|
247
|
-
|
|
248
|
-
const ret = arg0
|
|
274
|
+
__wbg_new_81880fb5002cb255: function(arg0) {
|
|
275
|
+
const ret = new Uint8Array(arg0);
|
|
249
276
|
return ret;
|
|
250
277
|
},
|
|
251
|
-
|
|
278
|
+
__wbg_next_0c4066e251d2eff9: function() { return handleError(function (arg0) {
|
|
252
279
|
const ret = arg0.next();
|
|
253
280
|
return ret;
|
|
254
281
|
}, arguments); },
|
|
282
|
+
__wbg_next_402fa10b59ab20c3: function(arg0) {
|
|
283
|
+
const ret = arg0.next;
|
|
284
|
+
return ret;
|
|
285
|
+
},
|
|
255
286
|
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
256
287
|
const ret = arg0.now();
|
|
257
288
|
return ret;
|
|
@@ -260,15 +291,15 @@ function __wbg_get_imports() {
|
|
|
260
291
|
const ret = arg0.performance;
|
|
261
292
|
return ret;
|
|
262
293
|
},
|
|
263
|
-
|
|
294
|
+
__wbg_prototypesetcall_d721637c7ca66eb8: function(arg0, arg1, arg2) {
|
|
264
295
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
265
296
|
},
|
|
266
|
-
__wbg_set_4702dfa37c77f492: function(arg0, arg1, arg2) {
|
|
267
|
-
arg0[arg1 >>> 0] = arg2;
|
|
268
|
-
},
|
|
269
297
|
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
270
298
|
arg0[arg1] = arg2;
|
|
271
299
|
},
|
|
300
|
+
__wbg_set_dc601f4a69da0bc2: function(arg0, arg1, arg2) {
|
|
301
|
+
arg0[arg1 >>> 0] = arg2;
|
|
302
|
+
},
|
|
272
303
|
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
273
304
|
const ret = arg1.stack;
|
|
274
305
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -276,23 +307,23 @@ function __wbg_get_imports() {
|
|
|
276
307
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
277
308
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
278
309
|
},
|
|
279
|
-
|
|
280
|
-
const ret = typeof
|
|
310
|
+
__wbg_static_accessor_GLOBAL_THIS_2fee5048bcca5938: function() {
|
|
311
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
281
312
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
282
313
|
},
|
|
283
|
-
|
|
284
|
-
const ret = typeof
|
|
314
|
+
__wbg_static_accessor_GLOBAL_ce44e66a4935da8c: function() {
|
|
315
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
285
316
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
286
317
|
},
|
|
287
|
-
|
|
318
|
+
__wbg_static_accessor_SELF_44f6e0cb5e67cdad: function() {
|
|
288
319
|
const ret = typeof self === 'undefined' ? null : self;
|
|
289
320
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
290
321
|
},
|
|
291
|
-
|
|
322
|
+
__wbg_static_accessor_WINDOW_168f178805d978fe: function() {
|
|
292
323
|
const ret = typeof window === 'undefined' ? null : window;
|
|
293
324
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
294
325
|
},
|
|
295
|
-
|
|
326
|
+
__wbg_value_49f783bb59765962: function(arg0) {
|
|
296
327
|
const ret = arg0.value;
|
|
297
328
|
return ret;
|
|
298
329
|
},
|
|
@@ -324,7 +355,7 @@ function __wbg_get_imports() {
|
|
|
324
355
|
|
|
325
356
|
const EngineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
326
357
|
? { register: () => {}, unregister: () => {} }
|
|
327
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_engine_free(ptr
|
|
358
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_engine_free(ptr, 1));
|
|
328
359
|
|
|
329
360
|
function addToExternrefTable0(obj) {
|
|
330
361
|
const idx = wasm.__externref_table_alloc();
|
|
@@ -411,8 +442,7 @@ function getDataViewMemory0() {
|
|
|
411
442
|
}
|
|
412
443
|
|
|
413
444
|
function getStringFromWasm0(ptr, len) {
|
|
414
|
-
|
|
415
|
-
return decodeText(ptr, len);
|
|
445
|
+
return decodeText(ptr >>> 0, len);
|
|
416
446
|
}
|
|
417
447
|
|
|
418
448
|
let cachedUint8ArrayMemory0 = null;
|
|
@@ -649,6 +679,12 @@ class BaseFliptClient {
|
|
|
649
679
|
this.etag = etag;
|
|
650
680
|
}
|
|
651
681
|
}
|
|
682
|
+
/**
|
|
683
|
+
* Returns a base64-encoded snapshot of the current flag state.
|
|
684
|
+
*/
|
|
685
|
+
getSnapshot() {
|
|
686
|
+
return this.engine.get_snapshot();
|
|
687
|
+
}
|
|
652
688
|
/**
|
|
653
689
|
* Refresh the flags snapshot
|
|
654
690
|
* @returns true if snapshot changed
|
|
@@ -829,6 +865,26 @@ class BaseFliptClient {
|
|
|
829
865
|
}
|
|
830
866
|
}
|
|
831
867
|
|
|
868
|
+
async function initializeSnapshot({ engine, snapshot, errorStrategy, fetcher, storeEtag }) {
|
|
869
|
+
if (snapshot) {
|
|
870
|
+
engine.seed_snapshot(snapshot);
|
|
871
|
+
}
|
|
872
|
+
try {
|
|
873
|
+
const resp = await fetcher();
|
|
874
|
+
if (!resp.ok) {
|
|
875
|
+
throw new Error(`Failed to fetch data: ${resp.statusText}`);
|
|
876
|
+
}
|
|
877
|
+
const data = await resp.json();
|
|
878
|
+
engine.snapshot(data);
|
|
879
|
+
storeEtag(resp);
|
|
880
|
+
}
|
|
881
|
+
catch (error) {
|
|
882
|
+
if (!snapshot || errorStrategy !== ErrorStrategy.Fallback) {
|
|
883
|
+
throw error;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
832
888
|
class FliptClient extends BaseFliptClient {
|
|
833
889
|
/**
|
|
834
890
|
* Initialize the client
|
|
@@ -883,17 +939,16 @@ class FliptClient extends BaseFliptClient {
|
|
|
883
939
|
if (!fetcher) {
|
|
884
940
|
throw new Error('Failed to initialize fetcher');
|
|
885
941
|
}
|
|
886
|
-
// handle case if they pass in a custom fetcher that doesn't throw on non-2xx status codes
|
|
887
|
-
const resp = await fetcher();
|
|
888
|
-
if (!resp.ok) {
|
|
889
|
-
throw new Error(`Failed to fetch data: ${resp.statusText}`);
|
|
890
|
-
}
|
|
891
|
-
const data = await resp.json();
|
|
892
942
|
const engine = new Engine(namespace);
|
|
893
|
-
engine.snapshot(data);
|
|
894
943
|
// Create client instance
|
|
895
944
|
const client = new FliptClient(engine, fetcher);
|
|
896
|
-
|
|
945
|
+
await initializeSnapshot({
|
|
946
|
+
engine,
|
|
947
|
+
snapshot: options.snapshot,
|
|
948
|
+
errorStrategy: options.errorStrategy,
|
|
949
|
+
fetcher,
|
|
950
|
+
storeEtag: (resp) => client.storeEtag(resp)
|
|
951
|
+
});
|
|
897
952
|
client.errorStrategy = options.errorStrategy;
|
|
898
953
|
client.hook = options.hook;
|
|
899
954
|
return client;
|
|
@@ -11,6 +11,10 @@ export declare abstract class BaseFliptClient {
|
|
|
11
11
|
* Store etag from response for next requests
|
|
12
12
|
*/
|
|
13
13
|
protected storeEtag(resp: Response): void;
|
|
14
|
+
/**
|
|
15
|
+
* Returns a base64-encoded snapshot of the current flag state.
|
|
16
|
+
*/
|
|
17
|
+
getSnapshot(): string;
|
|
14
18
|
/**
|
|
15
19
|
* Refresh the flags snapshot
|
|
16
20
|
* @returns true if snapshot changed
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ErrorStrategy, Response } from './types';
|
|
2
|
+
type SnapshotEngine = {
|
|
3
|
+
seed_snapshot(snapshot: string): void;
|
|
4
|
+
snapshot(data: unknown): void;
|
|
5
|
+
};
|
|
6
|
+
export declare function initializeSnapshot({ engine, snapshot, errorStrategy, fetcher, storeEtag }: {
|
|
7
|
+
engine: SnapshotEngine;
|
|
8
|
+
snapshot?: string;
|
|
9
|
+
errorStrategy?: ErrorStrategy;
|
|
10
|
+
fetcher: () => Promise<Response>;
|
|
11
|
+
storeEtag: (resp: Response) => void;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -118,6 +118,12 @@ export interface ClientOptions {
|
|
|
118
118
|
* @see {@link https://docs.flipt.io/guides/user/using-references}
|
|
119
119
|
*/
|
|
120
120
|
reference?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Base64-encoded snapshot returned by getSnapshot(). When provided with
|
|
123
|
+
* ErrorStrategy.Fallback, the client can initialize offline and refresh when
|
|
124
|
+
* Flipt becomes reachable again.
|
|
125
|
+
*/
|
|
126
|
+
snapshot?: string;
|
|
121
127
|
/**
|
|
122
128
|
* The fetcher to use when fetching flag state. If not provided, the client will default to a fetch function.
|
|
123
129
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flipt-io/flipt-client-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Flipt Client Evaluation SDK for Web and Node.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/node/index.cjs",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"ts-jest": "^29.0.3",
|
|
106
106
|
"tslib": "^2.6.2",
|
|
107
107
|
"typescript": "^5.4.3",
|
|
108
|
-
"undici": "^
|
|
108
|
+
"undici": "^8.0.2"
|
|
109
109
|
},
|
|
110
110
|
"engines": {
|
|
111
111
|
"node": ">=14"
|