@flipt-io/flipt-client-js 0.3.0 → 0.4.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.
@@ -93,26 +93,6 @@ function getDataViewMemory0() {
93
93
  return cachedDataViewMemory0;
94
94
  }
95
95
 
96
- function addToExternrefTable0(obj) {
97
- const idx = wasm.__externref_table_alloc();
98
- wasm.__wbindgen_export_4.set(idx, obj);
99
- return idx;
100
- }
101
-
102
- function handleError(f, args) {
103
- try {
104
- return f.apply(this, args);
105
- } catch (e) {
106
- const idx = addToExternrefTable0(e);
107
- wasm.__wbindgen_exn_store(idx);
108
- }
109
- }
110
-
111
- function getArrayU8FromWasm0(ptr, len) {
112
- ptr = ptr >>> 0;
113
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
114
- }
115
-
116
96
  function isLikeNone(x) {
117
97
  return x === undefined || x === null;
118
98
  }
@@ -182,8 +162,28 @@ function debugString(val) {
182
162
  return className;
183
163
  }
184
164
 
165
+ function addToExternrefTable0(obj) {
166
+ const idx = wasm.__externref_table_alloc();
167
+ wasm.__wbindgen_externrefs.set(idx, obj);
168
+ return idx;
169
+ }
170
+
171
+ function handleError(f, args) {
172
+ try {
173
+ return f.apply(this, args);
174
+ } catch (e) {
175
+ const idx = addToExternrefTable0(e);
176
+ wasm.__wbindgen_exn_store(idx);
177
+ }
178
+ }
179
+
180
+ function getArrayU8FromWasm0(ptr, len) {
181
+ ptr = ptr >>> 0;
182
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
183
+ }
184
+
185
185
  function takeFromExternrefTable0(idx) {
186
- const value = wasm.__wbindgen_export_4.get(idx);
186
+ const value = wasm.__wbindgen_externrefs.get(idx);
187
187
  wasm.__externref_table_dealloc(idx);
188
188
  return value;
189
189
  }
@@ -309,7 +309,7 @@ async function __wbg_load(module, imports) {
309
309
  function __wbg_get_imports() {
310
310
  const imports = {};
311
311
  imports.wbg = {};
312
- imports.wbg.__wbg_Error_e17e777aac105295 = function(arg0, arg1) {
312
+ imports.wbg.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
313
313
  const ret = Error(getStringFromWasm0(arg0, arg1));
314
314
  return ret;
315
315
  };
@@ -320,15 +320,69 @@ function __wbg_get_imports() {
320
320
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
321
321
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
322
322
  };
323
- imports.wbg.__wbg_call_13410aac570ffff7 = function() { return handleError(function (arg0, arg1) {
323
+ imports.wbg.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
324
+ const v = arg0;
325
+ const ret = typeof(v) === 'boolean' ? v : undefined;
326
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
327
+ };
328
+ imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
329
+ const ret = debugString(arg1);
330
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
331
+ const len1 = WASM_VECTOR_LEN;
332
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
333
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
334
+ };
335
+ imports.wbg.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
336
+ const ret = arg0 in arg1;
337
+ return ret;
338
+ };
339
+ imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
340
+ const ret = typeof(arg0) === 'function';
341
+ return ret;
342
+ };
343
+ imports.wbg.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
344
+ const val = arg0;
345
+ const ret = typeof(val) === 'object' && val !== null;
346
+ return ret;
347
+ };
348
+ imports.wbg.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
349
+ const ret = typeof(arg0) === 'string';
350
+ return ret;
351
+ };
352
+ imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
353
+ const ret = arg0 === undefined;
354
+ return ret;
355
+ };
356
+ imports.wbg.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
357
+ const ret = arg0 == arg1;
358
+ return ret;
359
+ };
360
+ imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
361
+ const obj = arg1;
362
+ const ret = typeof(obj) === 'number' ? obj : undefined;
363
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
364
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
365
+ };
366
+ imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
367
+ const obj = arg1;
368
+ const ret = typeof(obj) === 'string' ? obj : undefined;
369
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
370
+ var len1 = WASM_VECTOR_LEN;
371
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
372
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
373
+ };
374
+ imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
375
+ throw new Error(getStringFromWasm0(arg0, arg1));
376
+ };
377
+ imports.wbg.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
324
378
  const ret = arg0.call(arg1);
325
379
  return ret;
326
380
  }, arguments) };
327
- imports.wbg.__wbg_done_75ed0ee6dd243d9d = function(arg0) {
381
+ imports.wbg.__wbg_done_2042aa2670fb1db1 = function(arg0) {
328
382
  const ret = arg0.done;
329
383
  return ret;
330
384
  };
331
- imports.wbg.__wbg_entries_2be2f15bd5554996 = function(arg0) {
385
+ imports.wbg.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
332
386
  const ret = Object.entries(arg0);
333
387
  return ret;
334
388
  };
@@ -343,23 +397,23 @@ function __wbg_get_imports() {
343
397
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
344
398
  }
345
399
  };
346
- imports.wbg.__wbg_getTime_6bb3f64e0f18f817 = function(arg0) {
400
+ imports.wbg.__wbg_getTime_14776bfb48a1bff9 = function(arg0) {
347
401
  const ret = arg0.getTime();
348
402
  return ret;
349
403
  };
350
- imports.wbg.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
404
+ imports.wbg.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
351
405
  const ret = arg0[arg1 >>> 0];
352
406
  return ret;
353
407
  };
354
- imports.wbg.__wbg_get_458e874b43b18b25 = function() { return handleError(function (arg0, arg1) {
408
+ imports.wbg.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) {
355
409
  const ret = Reflect.get(arg0, arg1);
356
410
  return ret;
357
411
  }, arguments) };
358
- imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
412
+ imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
359
413
  const ret = arg0[arg1];
360
414
  return ret;
361
415
  };
362
- imports.wbg.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd = function(arg0) {
416
+ imports.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
363
417
  let result;
364
418
  try {
365
419
  result = arg0 instanceof ArrayBuffer;
@@ -369,7 +423,7 @@ function __wbg_get_imports() {
369
423
  const ret = result;
370
424
  return ret;
371
425
  };
372
- imports.wbg.__wbg_instanceof_Uint8Array_9a8378d955933db7 = function(arg0) {
426
+ imports.wbg.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
373
427
  let result;
374
428
  try {
375
429
  result = arg0 instanceof Uint8Array;
@@ -379,35 +433,31 @@ function __wbg_get_imports() {
379
433
  const ret = result;
380
434
  return ret;
381
435
  };
382
- imports.wbg.__wbg_isArray_030cce220591fb41 = function(arg0) {
436
+ imports.wbg.__wbg_isArray_96e0af9891d0945d = function(arg0) {
383
437
  const ret = Array.isArray(arg0);
384
438
  return ret;
385
439
  };
386
- imports.wbg.__wbg_iterator_f370b34483c71a1c = function() {
440
+ imports.wbg.__wbg_iterator_e5822695327a3c39 = function() {
387
441
  const ret = Symbol.iterator;
388
442
  return ret;
389
443
  };
390
- imports.wbg.__wbg_length_186546c51cd61acd = function(arg0) {
444
+ imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
391
445
  const ret = arg0.length;
392
446
  return ret;
393
447
  };
394
- imports.wbg.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
448
+ imports.wbg.__wbg_length_cdd215e10d9dd507 = function(arg0) {
395
449
  const ret = arg0.length;
396
450
  return ret;
397
451
  };
398
- imports.wbg.__wbg_new0_b0a0a38c201e6df5 = function() {
452
+ imports.wbg.__wbg_new_0_f9740686d739025c = function() {
399
453
  const ret = new Date();
400
454
  return ret;
401
455
  };
402
- imports.wbg.__wbg_new_19c25a3f2fa63a02 = function() {
456
+ imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
403
457
  const ret = new Object();
404
458
  return ret;
405
459
  };
406
- imports.wbg.__wbg_new_1f3a344cf3123716 = function() {
407
- const ret = new Array();
408
- return ret;
409
- };
410
- imports.wbg.__wbg_new_638ebfaedbf32a5e = function(arg0) {
460
+ imports.wbg.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
411
461
  const ret = new Uint8Array(arg0);
412
462
  return ret;
413
463
  };
@@ -415,18 +465,22 @@ function __wbg_get_imports() {
415
465
  const ret = new Error();
416
466
  return ret;
417
467
  };
418
- imports.wbg.__wbg_newnoargs_254190557c45b4ec = function(arg0, arg1) {
419
- const ret = new Function(getStringFromWasm0(arg0, arg1));
468
+ imports.wbg.__wbg_new_e17d9f43105b08be = function() {
469
+ const ret = new Array();
420
470
  return ret;
421
471
  };
422
- imports.wbg.__wbg_next_5b3530e612fde77d = function(arg0) {
423
- const ret = arg0.next;
472
+ imports.wbg.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) {
473
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
424
474
  return ret;
425
475
  };
426
- imports.wbg.__wbg_next_692e82279131b03c = function() { return handleError(function (arg0) {
476
+ imports.wbg.__wbg_next_020810e0ae8ebcb0 = function() { return handleError(function (arg0) {
427
477
  const ret = arg0.next();
428
478
  return ret;
429
479
  }, arguments) };
480
+ imports.wbg.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
481
+ const ret = arg0.next;
482
+ return ret;
483
+ };
430
484
  imports.wbg.__wbg_now_2c95c9de01293173 = function(arg0) {
431
485
  const ret = arg0.now();
432
486
  return ret;
@@ -435,13 +489,13 @@ function __wbg_get_imports() {
435
489
  const ret = arg0.performance;
436
490
  return ret;
437
491
  };
438
- imports.wbg.__wbg_prototypesetcall_3d4a26c1ed734349 = function(arg0, arg1, arg2) {
492
+ imports.wbg.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
439
493
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
440
494
  };
441
495
  imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
442
496
  arg0[arg1] = arg2;
443
497
  };
444
- imports.wbg.__wbg_set_90f6c0f7bd8c0415 = function(arg0, arg1, arg2) {
498
+ imports.wbg.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
445
499
  arg0[arg1 >>> 0] = arg2;
446
500
  };
447
501
  imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
@@ -451,80 +505,26 @@ function __wbg_get_imports() {
451
505
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
452
506
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
453
507
  };
454
- imports.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12 = function() {
508
+ imports.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e = function() {
455
509
  const ret = typeof global === 'undefined' ? null : global;
456
510
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
457
511
  };
458
- imports.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184 = function() {
512
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac = function() {
459
513
  const ret = typeof globalThis === 'undefined' ? null : globalThis;
460
514
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
461
515
  };
462
- imports.wbg.__wbg_static_accessor_SELF_995b214ae681ff99 = function() {
516
+ imports.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b = function() {
463
517
  const ret = typeof self === 'undefined' ? null : self;
464
518
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
465
519
  };
466
- imports.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea = function() {
520
+ imports.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2 = function() {
467
521
  const ret = typeof window === 'undefined' ? null : window;
468
522
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
469
523
  };
470
- imports.wbg.__wbg_value_dd9372230531eade = function(arg0) {
524
+ imports.wbg.__wbg_value_692627309814bb8c = function(arg0) {
471
525
  const ret = arg0.value;
472
526
  return ret;
473
527
  };
474
- imports.wbg.__wbg_wbindgenbooleanget_3fe6f642c7d97746 = function(arg0) {
475
- const v = arg0;
476
- const ret = typeof(v) === 'boolean' ? v : undefined;
477
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
478
- };
479
- imports.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d = function(arg0, arg1) {
480
- const ret = debugString(arg1);
481
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
482
- const len1 = WASM_VECTOR_LEN;
483
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
484
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
485
- };
486
- imports.wbg.__wbg_wbindgenin_d7a1ee10933d2d55 = function(arg0, arg1) {
487
- const ret = arg0 in arg1;
488
- return ret;
489
- };
490
- imports.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74 = function(arg0) {
491
- const ret = typeof(arg0) === 'function';
492
- return ret;
493
- };
494
- imports.wbg.__wbg_wbindgenisobject_307a53c6bd97fbf8 = function(arg0) {
495
- const val = arg0;
496
- const ret = typeof(val) === 'object' && val !== null;
497
- return ret;
498
- };
499
- imports.wbg.__wbg_wbindgenisstring_d4fa939789f003b0 = function(arg0) {
500
- const ret = typeof(arg0) === 'string';
501
- return ret;
502
- };
503
- imports.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5 = function(arg0) {
504
- const ret = arg0 === undefined;
505
- return ret;
506
- };
507
- imports.wbg.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1 = function(arg0, arg1) {
508
- const ret = arg0 == arg1;
509
- return ret;
510
- };
511
- imports.wbg.__wbg_wbindgennumberget_f74b4c7525ac05cb = function(arg0, arg1) {
512
- const obj = arg1;
513
- const ret = typeof(obj) === 'number' ? obj : undefined;
514
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
515
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
516
- };
517
- imports.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f = function(arg0, arg1) {
518
- const obj = arg1;
519
- const ret = typeof(obj) === 'string' ? obj : undefined;
520
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
521
- var len1 = WASM_VECTOR_LEN;
522
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
523
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
524
- };
525
- imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
526
- throw new Error(getStringFromWasm0(arg0, arg1));
527
- };
528
528
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
529
529
  // Cast intrinsic for `Ref(String) -> Externref`.
530
530
  const ret = getStringFromWasm0(arg0, arg1);
@@ -536,7 +536,7 @@ function __wbg_get_imports() {
536
536
  return ret;
537
537
  };
538
538
  imports.wbg.__wbindgen_init_externref_table = function() {
539
- const table = wasm.__wbindgen_export_4;
539
+ const table = wasm.__wbindgen_externrefs;
540
540
  const offset = table.grow(4);
541
541
  table.set(0, undefined);
542
542
  table.set(offset + 0, undefined);
@@ -1,4 +1,6 @@
1
1
  export * from './core/types';
2
+ export type { Flag, ClientOptions, EvaluationRequest, VariantEvaluationResponse, BooleanEvaluationResponse, BatchEvaluationResponse, ErrorEvaluationResponse, EvaluationResponse, VariantResult, BooleanResult, BatchResult, ListFlagsResult, Result, ClientTokenAuthentication, JWTAuthentication, AuthenticationStrategy, IFetcher, IFetcherOptions, Hook, Response } from './core/types';
3
+ export { ErrorStrategy, ClientOptionsFactory } from './core/types';
2
4
  export { BaseFliptClient } from './core/base';
3
5
  import { FliptClient as NodeImpl } from './node';
4
6
  import { FliptClient as BrowserImpl } from './browser';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Re-export all types for users who prefer explicit type imports.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * import type { Flag, ClientOptions } from '@flipt-io/flipt-client-js/types';
7
+ * ```
8
+ */
9
+ export type { Flag, ClientOptions, EvaluationRequest, VariantEvaluationResponse, BooleanEvaluationResponse, BatchEvaluationResponse, ErrorEvaluationResponse, EvaluationResponse, VariantResult, BooleanResult, BatchResult, ListFlagsResult, Result, Response, ClientTokenAuthentication, JWTAuthentication, AuthenticationStrategy, IFetcher, IFetcherOptions, Hook } from './core/types';
10
+ export { ErrorStrategy, ClientOptionsFactory } from './core/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flipt-io/flipt-client-js",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Flipt Client Evaluation SDK for Web and Node.js",
5
5
  "type": "module",
6
6
  "main": "./dist/node/index.cjs",
@@ -26,6 +26,11 @@
26
26
  "require": "./dist/slim/index.cjs"
27
27
  }
28
28
  },
29
+ "./types": {
30
+ "types": "./dist/types/types.d.ts",
31
+ "import": "./dist/types/types.d.ts",
32
+ "require": "./dist/types/types.d.ts"
33
+ },
29
34
  "./node": {
30
35
  "types": "./dist/types/index.d.ts",
31
36
  "import": "./dist/node/index.mjs",
@@ -51,6 +56,9 @@
51
56
  "*": [
52
57
  "./dist/types/index.d.ts"
53
58
  ],
59
+ "types": [
60
+ "./dist/types/types.d.ts"
61
+ ],
54
62
  "node": [
55
63
  "./dist/types/index.d.ts"
56
64
  ],