@takeal/cusfront-sdk 0.3.12 → 0.3.20

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/dist/telegram.js CHANGED
@@ -336,6 +336,16 @@ var CardsResource = class {
336
336
  `/me/card-products/${encodeURIComponent(id)}`
337
337
  );
338
338
  }
339
+ /**
340
+ * The public catalog: the same products, order and default as
341
+ * {@link listProducts}, but readable before sign-in, for a landing page or
342
+ * the cabinet's first screen. Prices are list prices (`discount_bps` is
343
+ * always 0); once the user is signed in, {@link listProducts} shows what
344
+ * they pay. The API lets caches keep this response for a minute.
345
+ */
346
+ async catalog() {
347
+ return this.http.get("/card-products");
348
+ }
339
349
  /**
340
350
  * Rename the caller's own card or change its design. Resolves to the
341
351
  * updated card. 404 if the card isn't the caller's; 400 `invalid_name` /
@@ -367,6 +377,31 @@ var CardsResource = class {
367
377
  `/me/cards/${encodeURIComponent(id)}/balance?${q}`
368
378
  );
369
379
  }
380
+ /**
381
+ * What a top-up of this card can be right now: whether it is possible, the
382
+ * currency, the wallet balance, and the product's floor and cap for one
383
+ * top-up. Read it before drawing the form. 404 if the card isn't the caller's.
384
+ */
385
+ async topUpTerms(id) {
386
+ return this.http.get(`/me/cards/${encodeURIComponent(id)}/topup`);
387
+ }
388
+ /**
389
+ * Move money from the wallet onto the caller's own card. The wallet is
390
+ * debited first, then the card's provider loads the card; if the provider
391
+ * refuses, the money is back on the wallet and the error says so. Resolves
392
+ * to the card, its new balance and the wallet balance, so no second call
393
+ * is needed. Errors carry a sentence the user can read: 400 outside the
394
+ * floor or cap · 402 not enough in the wallet · 404 not the caller's card ·
395
+ * 409 card frozen, closed or still being issued · 501 provider can't top
396
+ * up · 502/503 provider declined or unreachable (wallet untouched).
397
+ */
398
+ async topUp(id, input) {
399
+ const { idempotencyKey, amount } = input;
400
+ return this.http.post(`/me/cards/${encodeURIComponent(id)}/topup`, {
401
+ body: { amount },
402
+ idempotencyKey
403
+ });
404
+ }
370
405
  /**
371
406
  * Freeze the caller's own card. Reversible via {@link unfreeze}. The optional
372
407
  * `reason` is recorded on the audit trail. Resolves to the updated card.
@@ -746,7 +781,7 @@ var DevicesResource = class {
746
781
  };
747
782
 
748
783
  // src/version.ts
749
- var SDK_VERSION = "0.3.12";
784
+ var SDK_VERSION = "0.3.20";
750
785
 
751
786
  // src/client-platform.ts
752
787
  var CLIENT_HEADER = "X-Takeal-Client";