@layers/amba-core 4.0.3 → 4.0.5

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]
@@ -794,6 +899,19 @@ export class AmbaCoreWasm {
794
899
  const ret = wasm.ambacorewasm_linkEmailOtp(this.__wbg_ptr, ptr0, len0, ptr1, len1);
795
900
  return takeObject(ret);
796
901
  }
902
+ /**
903
+ * @param {string} email
904
+ * @param {string} password
905
+ * @returns {Promise<any>}
906
+ */
907
+ linkEmailPassword(email, password) {
908
+ const ptr0 = passStringToWasm0(email, wasm.__wbindgen_export, wasm.__wbindgen_export2);
909
+ const len0 = WASM_VECTOR_LEN;
910
+ const ptr1 = passStringToWasm0(password, wasm.__wbindgen_export, wasm.__wbindgen_export2);
911
+ const len1 = WASM_VECTOR_LEN;
912
+ const ret = wasm.ambacorewasm_linkEmailPassword(this.__wbg_ptr, ptr0, len0, ptr1, len1);
913
+ return takeObject(ret);
914
+ }
797
915
  /**
798
916
  * @param {string} phone
799
917
  * @param {string} code
@@ -941,6 +1059,23 @@ export class AmbaCoreWasm {
941
1059
  const ret = wasm.ambacorewasm_moderationReportUser(this.__wbg_ptr, ptr0, len0);
942
1060
  return takeObject(ret);
943
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
+ }
944
1079
  /**
945
1080
  * @returns {Promise<any>}
946
1081
  */
@@ -1615,7 +1750,7 @@ export function __wbg_new_typed_c072c4ce9a2a0cdf(arg0, arg1) {
1615
1750
  const a = state0.a;
1616
1751
  state0.a = 0;
1617
1752
  try {
1618
- return __wasm_bindgen_func_elem_3030_134(a, state0.b, arg0, arg1);
1753
+ return __wasm_bindgen_func_elem_3247_144(a, state0.b, arg0, arg1);
1619
1754
  } finally {
1620
1755
  state0.a = a;
1621
1756
  }
@@ -1686,13 +1821,13 @@ export function __wbg_then_bd927500e8905df2(arg0, arg1, arg2) {
1686
1821
  return addHeapObject(ret);
1687
1822
  }
1688
1823
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
1689
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref, Externref], shim_idx: 771, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1690
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3030);
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);
1691
1826
  return addHeapObject(ret);
1692
1827
  }
1693
1828
  export function __wbindgen_cast_0000000000000002(arg0, arg1) {
1694
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 760, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1695
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3011);
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);
1696
1831
  return addHeapObject(ret);
1697
1832
  }
1698
1833
  export function __wbindgen_cast_0000000000000003(arg0) {
@@ -1722,14 +1857,14 @@ export function __wbindgen_object_clone_ref(arg0) {
1722
1857
  export function __wbindgen_object_drop_ref(arg0) {
1723
1858
  takeObject(arg0);
1724
1859
  }
1725
- function __wasm_bindgen_func_elem_3030(arg0, arg1, arg2, arg3) {
1726
- wasm.__wasm_bindgen_func_elem_3030(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));
1727
1862
  }
1728
1863
 
1729
- function __wasm_bindgen_func_elem_3011(arg0, arg1, arg2) {
1864
+ function __wasm_bindgen_func_elem_3228(arg0, arg1, arg2) {
1730
1865
  try {
1731
1866
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1732
- wasm.__wasm_bindgen_func_elem_3011(retptr, arg0, arg1, addHeapObject(arg2));
1867
+ wasm.__wasm_bindgen_func_elem_3228(retptr, arg0, arg1, addHeapObject(arg2));
1733
1868
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1734
1869
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1735
1870
  if (r1) {
@@ -1740,8 +1875,8 @@ function __wasm_bindgen_func_elem_3011(arg0, arg1, arg2) {
1740
1875
  }
1741
1876
  }
1742
1877
 
1743
- function __wasm_bindgen_func_elem_3030_134(arg0, arg1, arg2, arg3) {
1744
- wasm.__wasm_bindgen_func_elem_3030_134(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));
1745
1880
  }
1746
1881
 
1747
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;
@@ -67,6 +74,7 @@ export const ambacorewasm_leaguesCohort: (a: number) => number;
67
74
  export const ambacorewasm_leaguesMe: (a: number) => number;
68
75
  export const ambacorewasm_linkAccount: (a: number, b: number, c: number, d: number, e: number) => number;
69
76
  export const ambacorewasm_linkEmailOtp: (a: number, b: number, c: number, d: number, e: number) => number;
77
+ export const ambacorewasm_linkEmailPassword: (a: number, b: number, c: number, d: number, e: number) => number;
70
78
  export const ambacorewasm_linkSmsOtp: (a: number, b: number, c: number, d: number, e: number) => number;
71
79
  export const ambacorewasm_me: (a: number) => number;
72
80
  export const ambacorewasm_messagingAddParticipant: (a: number, b: number, c: number, d: number, e: number) => number;
@@ -79,6 +87,8 @@ export const ambacorewasm_messagingSendMessage: (a: number, b: number, c: number
79
87
  export const ambacorewasm_moderationGetReportStatus: (a: number, b: number, c: number) => number;
80
88
  export const ambacorewasm_moderationReportContent: (a: number, b: number, c: number) => number;
81
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;
82
92
  export const ambacorewasm_onboardingComplete: (a: number) => number;
83
93
  export const ambacorewasm_onboardingGetStatus: (a: number) => number;
84
94
  export const ambacorewasm_onboardingNextStep: (a: number, b: number, c: number) => number;
@@ -134,9 +144,9 @@ export const ambacorewasm_verifySmsOtp: (a: number, b: number, c: number, d: num
134
144
  export const ambacorewasm_xpClaim: (a: number, b: number, c: number) => number;
135
145
  export const ambacorewasm_xpGetBalance: (a: number) => number;
136
146
  export const ambacorewasm_xpGetHistory: (a: number, b: number) => number;
137
- export const __wasm_bindgen_func_elem_3030: (a: number, b: number, c: number, d: number) => void;
138
- export const __wasm_bindgen_func_elem_3011: (a: number, b: number, c: number, d: number) => void;
139
- export const __wasm_bindgen_func_elem_3030_134: (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;
140
150
  export const __wbindgen_export: (a: number, b: number) => number;
141
151
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
142
152
  export const __wbindgen_export3: (a: number) => void;