@layers/amba-core 4.0.4 → 4.0.6

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.
@@ -231,6 +231,22 @@ export class AmbaCoreWasm {
231
231
  const ret = wasm.ambacorewasm_collectionsDelete(this.__wbg_ptr, ptr0, len0, ptr1, len1);
232
232
  return takeObject(ret);
233
233
  }
234
+ /**
235
+ * Bulk soft-delete rows matching `filter_json` (a JSON-encoded
236
+ * [`Filter`](crate::collections::Filter) tree). Returns
237
+ * `{data: {deleted: N}}`.
238
+ * @param {string} collection
239
+ * @param {string} filter_json
240
+ * @returns {Promise<any>}
241
+ */
242
+ collectionsDeleteWhere(collection, filter_json) {
243
+ const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_export, wasm.__wbindgen_export2);
244
+ const len0 = WASM_VECTOR_LEN;
245
+ const ptr1 = passStringToWasm0(filter_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
246
+ const len1 = WASM_VECTOR_LEN;
247
+ const ret = wasm.ambacorewasm_collectionsDeleteWhere(this.__wbg_ptr, ptr0, len0, ptr1, len1);
248
+ return takeObject(ret);
249
+ }
234
250
  /**
235
251
  * @param {string} collection
236
252
  * @param {string} options_json
@@ -285,6 +301,35 @@ export class AmbaCoreWasm {
285
301
  const ret = wasm.ambacorewasm_collectionsInsert(this.__wbg_ptr, ptr0, len0, ptr1, len1);
286
302
  return takeObject(ret);
287
303
  }
304
+ /**
305
+ * Restore a previously soft-deleted row by id. Returns the restored row.
306
+ * @param {string} collection
307
+ * @param {string} id
308
+ * @returns {Promise<any>}
309
+ */
310
+ collectionsRestore(collection, id) {
311
+ const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_export, wasm.__wbindgen_export2);
312
+ const len0 = WASM_VECTOR_LEN;
313
+ const ptr1 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
314
+ const len1 = WASM_VECTOR_LEN;
315
+ const ret = wasm.ambacorewasm_collectionsRestore(this.__wbg_ptr, ptr0, len0, ptr1, len1);
316
+ return takeObject(ret);
317
+ }
318
+ /**
319
+ * Run an ordered batch of writes as ONE atomic transaction.
320
+ * `operations_json` is a JSON-encoded array of wire-shaped op objects
321
+ * (`[{collection, op, id?, row?, set?, where?, expected?, on_conflict?,
322
+ * conflict_target?}]`). Resolves to the per-op results array; rejects with
323
+ * the server's structured error (naming the failing op index) on rollback.
324
+ * @param {string} operations_json
325
+ * @returns {Promise<any>}
326
+ */
327
+ collectionsTransaction(operations_json) {
328
+ const ptr0 = passStringToWasm0(operations_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
329
+ const len0 = WASM_VECTOR_LEN;
330
+ const ret = wasm.ambacorewasm_collectionsTransaction(this.__wbg_ptr, ptr0, len0);
331
+ return takeObject(ret);
332
+ }
288
333
  /**
289
334
  * @param {string} collection
290
335
  * @param {string} id
@@ -301,6 +346,26 @@ export class AmbaCoreWasm {
301
346
  const ret = wasm.ambacorewasm_collectionsUpdate(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
302
347
  return takeObject(ret);
303
348
  }
349
+ /**
350
+ * Upsert a row. `options_json` is `{on_conflict, conflict_target}` —
351
+ * `on_conflict` is `"ignore"` or `"update"`, `conflict_target` is the
352
+ * array of unique-index columns to arbitrate on. Returns the resolved
353
+ * row.
354
+ * @param {string} collection
355
+ * @param {string} row_json
356
+ * @param {string} options_json
357
+ * @returns {Promise<any>}
358
+ */
359
+ collectionsUpsert(collection, row_json, options_json) {
360
+ const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_export, wasm.__wbindgen_export2);
361
+ const len0 = WASM_VECTOR_LEN;
362
+ const ptr1 = passStringToWasm0(row_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
363
+ const len1 = WASM_VECTOR_LEN;
364
+ const ptr2 = passStringToWasm0(options_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
365
+ const len2 = WASM_VECTOR_LEN;
366
+ const ret = wasm.ambacorewasm_collectionsUpsert(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
367
+ return takeObject(ret);
368
+ }
304
369
  /**
305
370
  * @returns {Promise<any>}
306
371
  */
@@ -331,6 +396,21 @@ export class AmbaCoreWasm {
331
396
  const ret = wasm.ambacorewasm_contentGetItem(this.__wbg_ptr, ptr0, len0);
332
397
  return takeObject(ret);
333
398
  }
399
+ /**
400
+ * Localized variant of `contentGetItem`: `language` is an optional
401
+ * BCP-47 tag forwarded as `?language=`. See `contentGetTodayLocalized`.
402
+ * @param {string} id
403
+ * @param {string | null} [language]
404
+ * @returns {Promise<any>}
405
+ */
406
+ contentGetItemLocalized(id, language) {
407
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
408
+ const len0 = WASM_VECTOR_LEN;
409
+ var ptr1 = isLikeNone(language) ? 0 : passStringToWasm0(language, wasm.__wbindgen_export, wasm.__wbindgen_export2);
410
+ var len1 = WASM_VECTOR_LEN;
411
+ const ret = wasm.ambacorewasm_contentGetItemLocalized(this.__wbg_ptr, ptr0, len0, ptr1, len1);
412
+ return takeObject(ret);
413
+ }
334
414
  /**
335
415
  * `channel` is optional; `limit` caps results per page; `cursor` is
336
416
  * the server-issued opaque pagination token. Mirror the TS wrapper
@@ -360,6 +440,24 @@ export class AmbaCoreWasm {
360
440
  const ret = wasm.ambacorewasm_contentGetToday(this.__wbg_ptr, ptr0, len0);
361
441
  return takeObject(ret);
362
442
  }
443
+ /**
444
+ * Localized variant of `contentGetToday`: `language` is an optional
445
+ * BCP-47 tag (e.g. `"es-419"`). When present it is forwarded as
446
+ * `?language=`; the server returns the translated title/body when a
447
+ * translation exists, falling back to the base item otherwise. Passing
448
+ * `undefined`/`null` is identical to `contentGetToday`.
449
+ * @param {string | null} [channel]
450
+ * @param {string | null} [language]
451
+ * @returns {Promise<any>}
452
+ */
453
+ contentGetTodayLocalized(channel, language) {
454
+ var ptr0 = isLikeNone(channel) ? 0 : passStringToWasm0(channel, wasm.__wbindgen_export, wasm.__wbindgen_export2);
455
+ var len0 = WASM_VECTOR_LEN;
456
+ var ptr1 = isLikeNone(language) ? 0 : passStringToWasm0(language, wasm.__wbindgen_export, wasm.__wbindgen_export2);
457
+ var len1 = WASM_VECTOR_LEN;
458
+ const ret = wasm.ambacorewasm_contentGetTodayLocalized(this.__wbg_ptr, ptr0, len0, ptr1, len1);
459
+ return takeObject(ret);
460
+ }
363
461
  /**
364
462
  * @param {string} id
365
463
  * @param {string} state_json
@@ -441,6 +539,13 @@ export class AmbaCoreWasm {
441
539
  const ret = wasm.ambacorewasm_entitlementsList(this.__wbg_ptr);
442
540
  return takeObject(ret);
443
541
  }
542
+ /**
543
+ * @returns {Promise<any>}
544
+ */
545
+ entitlementsRestore() {
546
+ const ret = wasm.ambacorewasm_entitlementsRestore(this.__wbg_ptr);
547
+ return takeObject(ret);
548
+ }
444
549
  /**
445
550
  * @param {string | null} [feed]
446
551
  * @param {string | null} [cursor]
@@ -954,6 +1059,23 @@ export class AmbaCoreWasm {
954
1059
  const ret = wasm.ambacorewasm_moderationReportUser(this.__wbg_ptr, ptr0, len0);
955
1060
  return takeObject(ret);
956
1061
  }
1062
+ /**
1063
+ * @param {string} offering_id
1064
+ * @returns {Promise<any>}
1065
+ */
1066
+ offeringsGet(offering_id) {
1067
+ const ptr0 = passStringToWasm0(offering_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1068
+ const len0 = WASM_VECTOR_LEN;
1069
+ const ret = wasm.ambacorewasm_offeringsGet(this.__wbg_ptr, ptr0, len0);
1070
+ return takeObject(ret);
1071
+ }
1072
+ /**
1073
+ * @returns {Promise<any>}
1074
+ */
1075
+ offeringsList() {
1076
+ const ret = wasm.ambacorewasm_offeringsList(this.__wbg_ptr);
1077
+ return takeObject(ret);
1078
+ }
957
1079
  /**
958
1080
  * @returns {Promise<any>}
959
1081
  */
@@ -1628,7 +1750,7 @@ export function __wbg_new_typed_c072c4ce9a2a0cdf(arg0, arg1) {
1628
1750
  const a = state0.a;
1629
1751
  state0.a = 0;
1630
1752
  try {
1631
- return __wasm_bindgen_func_elem_3036_135(a, state0.b, arg0, arg1);
1753
+ return __wasm_bindgen_func_elem_3247_144(a, state0.b, arg0, arg1);
1632
1754
  } finally {
1633
1755
  state0.a = a;
1634
1756
  }
@@ -1699,13 +1821,13 @@ export function __wbg_then_bd927500e8905df2(arg0, arg1, arg2) {
1699
1821
  return addHeapObject(ret);
1700
1822
  }
1701
1823
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
1702
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref, Externref], shim_idx: 774, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1703
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3036);
1824
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref, Externref], shim_idx: 829, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1825
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3247);
1704
1826
  return addHeapObject(ret);
1705
1827
  }
1706
1828
  export function __wbindgen_cast_0000000000000002(arg0, arg1) {
1707
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 763, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1708
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3017);
1829
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 818, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1830
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3228);
1709
1831
  return addHeapObject(ret);
1710
1832
  }
1711
1833
  export function __wbindgen_cast_0000000000000003(arg0) {
@@ -1735,14 +1857,14 @@ export function __wbindgen_object_clone_ref(arg0) {
1735
1857
  export function __wbindgen_object_drop_ref(arg0) {
1736
1858
  takeObject(arg0);
1737
1859
  }
1738
- function __wasm_bindgen_func_elem_3036(arg0, arg1, arg2, arg3) {
1739
- wasm.__wasm_bindgen_func_elem_3036(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1860
+ function __wasm_bindgen_func_elem_3247(arg0, arg1, arg2, arg3) {
1861
+ wasm.__wasm_bindgen_func_elem_3247(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1740
1862
  }
1741
1863
 
1742
- function __wasm_bindgen_func_elem_3017(arg0, arg1, arg2) {
1864
+ function __wasm_bindgen_func_elem_3228(arg0, arg1, arg2) {
1743
1865
  try {
1744
1866
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1745
- wasm.__wasm_bindgen_func_elem_3017(retptr, arg0, arg1, addHeapObject(arg2));
1867
+ wasm.__wasm_bindgen_func_elem_3228(retptr, arg0, arg1, addHeapObject(arg2));
1746
1868
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1747
1869
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1748
1870
  if (r1) {
@@ -1753,8 +1875,8 @@ function __wasm_bindgen_func_elem_3017(arg0, arg1, arg2) {
1753
1875
  }
1754
1876
  }
1755
1877
 
1756
- function __wasm_bindgen_func_elem_3036_135(arg0, arg1, arg2, arg3) {
1757
- wasm.__wasm_bindgen_func_elem_3036_135(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1878
+ function __wasm_bindgen_func_elem_3247_144(arg0, arg1, arg2, arg3) {
1879
+ wasm.__wasm_bindgen_func_elem_3247_144(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1758
1880
  }
1759
1881
 
1760
1882
  const AmbaCoreWasmFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -15,16 +15,22 @@ export const ambacorewasm_challengesGetActive: (a: number) => number;
15
15
  export const ambacorewasm_challengesGetProgress: (a: number, b: number, c: number) => number;
16
16
  export const ambacorewasm_collectionsCount: (a: number, b: number, c: number, d: number, e: number) => number;
17
17
  export const ambacorewasm_collectionsDelete: (a: number, b: number, c: number, d: number, e: number) => number;
18
+ export const ambacorewasm_collectionsDeleteWhere: (a: number, b: number, c: number, d: number, e: number) => number;
18
19
  export const ambacorewasm_collectionsFind: (a: number, b: number, c: number, d: number, e: number) => number;
19
20
  export const ambacorewasm_collectionsFindNearest: (a: number, b: number, c: number, d: number, e: number) => number;
20
21
  export const ambacorewasm_collectionsFindOne: (a: number, b: number, c: number, d: number, e: number) => number;
21
22
  export const ambacorewasm_collectionsInsert: (a: number, b: number, c: number, d: number, e: number) => number;
23
+ export const ambacorewasm_collectionsRestore: (a: number, b: number, c: number, d: number, e: number) => number;
24
+ export const ambacorewasm_collectionsTransaction: (a: number, b: number, c: number) => number;
22
25
  export const ambacorewasm_collectionsUpdate: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
26
+ export const ambacorewasm_collectionsUpsert: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
23
27
  export const ambacorewasm_configFetch: (a: number) => number;
24
28
  export const ambacorewasm_contentCreateItem: (a: number, b: number, c: number, d: number, e: number) => number;
25
29
  export const ambacorewasm_contentGetItem: (a: number, b: number, c: number) => number;
30
+ export const ambacorewasm_contentGetItemLocalized: (a: number, b: number, c: number, d: number, e: number) => number;
26
31
  export const ambacorewasm_contentGetLibrary: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
27
32
  export const ambacorewasm_contentGetToday: (a: number, b: number, c: number) => number;
33
+ export const ambacorewasm_contentGetTodayLocalized: (a: number, b: number, c: number, d: number, e: number) => number;
28
34
  export const ambacorewasm_contentUpdateItem: (a: number, b: number, c: number, d: number, e: number) => number;
29
35
  export const ambacorewasm_currenciesGetBalance: (a: number) => number;
30
36
  export const ambacorewasm_currenciesGetTransactions: (a: number, b: number, c: number) => number;
@@ -34,6 +40,7 @@ export const ambacorewasm_deepLinksGet: (a: number, b: number, c: number) => num
34
40
  export const ambacorewasm_diagnosticsPing: (a: number) => number;
35
41
  export const ambacorewasm_entitlementsHas: (a: number, b: number, c: number) => number;
36
42
  export const ambacorewasm_entitlementsList: (a: number) => number;
43
+ export const ambacorewasm_entitlementsRestore: (a: number) => number;
37
44
  export const ambacorewasm_feedsGetActivity: (a: number, b: number, c: number, d: number, e: number) => number;
38
45
  export const ambacorewasm_flagsFetch: (a: number) => number;
39
46
  export const ambacorewasm_flagsGet: (a: number, b: number, c: number) => number;
@@ -80,6 +87,8 @@ export const ambacorewasm_messagingSendMessage: (a: number, b: number, c: number
80
87
  export const ambacorewasm_moderationGetReportStatus: (a: number, b: number, c: number) => number;
81
88
  export const ambacorewasm_moderationReportContent: (a: number, b: number, c: number) => number;
82
89
  export const ambacorewasm_moderationReportUser: (a: number, b: number, c: number) => number;
90
+ export const ambacorewasm_offeringsGet: (a: number, b: number, c: number) => number;
91
+ export const ambacorewasm_offeringsList: (a: number) => number;
83
92
  export const ambacorewasm_onboardingComplete: (a: number) => number;
84
93
  export const ambacorewasm_onboardingGetStatus: (a: number) => number;
85
94
  export const ambacorewasm_onboardingNextStep: (a: number, b: number, c: number) => number;
@@ -135,9 +144,9 @@ export const ambacorewasm_verifySmsOtp: (a: number, b: number, c: number, d: num
135
144
  export const ambacorewasm_xpClaim: (a: number, b: number, c: number) => number;
136
145
  export const ambacorewasm_xpGetBalance: (a: number) => number;
137
146
  export const ambacorewasm_xpGetHistory: (a: number, b: number) => number;
138
- export const __wasm_bindgen_func_elem_3036: (a: number, b: number, c: number, d: number) => void;
139
- export const __wasm_bindgen_func_elem_3017: (a: number, b: number, c: number, d: number) => void;
140
- export const __wasm_bindgen_func_elem_3036_135: (a: number, b: number, c: number, d: number) => void;
147
+ export const __wasm_bindgen_func_elem_3247: (a: number, b: number, c: number, d: number) => void;
148
+ export const __wasm_bindgen_func_elem_3228: (a: number, b: number, c: number, d: number) => void;
149
+ export const __wasm_bindgen_func_elem_3247_144: (a: number, b: number, c: number, d: number) => void;
141
150
  export const __wbindgen_export: (a: number, b: number) => number;
142
151
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
143
152
  export const __wbindgen_export3: (a: number) => void;