@takeal/cusfront-sdk 0.6.0 → 0.6.1

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +166 -1
  3. package/dist/{cards-Ba1wZttb.d.ts → cards-CF3-He2x.d.ts} +144 -20
  4. package/dist/{cards-B_aNY35J.d.cts → cards-qfHz6xZY.d.cts} +144 -20
  5. package/dist/{deposits-DScyT_D9.d.ts → deposits-B2LBe2k1.d.ts} +71 -8
  6. package/dist/{deposits-BEc8U80M.d.cts → deposits-ZjT_btgi.d.cts} +71 -8
  7. package/dist/index.cjs +36 -9
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +6 -6
  10. package/dist/index.d.ts +6 -6
  11. package/dist/index.js +36 -9
  12. package/dist/index.js.map +1 -1
  13. package/dist/react/index.d.cts +2 -2
  14. package/dist/react/index.d.ts +2 -2
  15. package/dist/resources/cards.cjs +30 -6
  16. package/dist/resources/cards.cjs.map +1 -1
  17. package/dist/resources/cards.d.cts +1 -1
  18. package/dist/resources/cards.d.ts +1 -1
  19. package/dist/resources/cards.js +30 -6
  20. package/dist/resources/cards.js.map +1 -1
  21. package/dist/resources/deposits.cjs +4 -1
  22. package/dist/resources/deposits.cjs.map +1 -1
  23. package/dist/resources/deposits.d.cts +2 -2
  24. package/dist/resources/deposits.d.ts +2 -2
  25. package/dist/resources/deposits.js +4 -1
  26. package/dist/resources/deposits.js.map +1 -1
  27. package/dist/resources/funding-options.cjs.map +1 -1
  28. package/dist/resources/funding-options.d.cts +2 -2
  29. package/dist/resources/funding-options.d.ts +2 -2
  30. package/dist/resources/funding-options.js.map +1 -1
  31. package/dist/telegram.cjs +36 -9
  32. package/dist/telegram.cjs.map +1 -1
  33. package/dist/telegram.d.cts +2 -2
  34. package/dist/telegram.d.ts +2 -2
  35. package/dist/telegram.js +36 -9
  36. package/dist/telegram.js.map +1 -1
  37. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  import { CusfrontClient, CreateClientOptions } from './index.cjs';
2
2
  import { JwtIssued, TelegramUnknown } from './resources/auth.cjs';
3
3
  import './http-DeANAoTs.cjs';
4
- import './deposits-BEc8U80M.cjs';
5
- import './cards-B_aNY35J.cjs';
4
+ import './deposits-ZjT_btgi.cjs';
5
+ import './cards-qfHz6xZY.cjs';
6
6
  import './resources/balance.cjs';
7
7
  import './resources/bonus.cjs';
8
8
  import './resources/codes.cjs';
@@ -1,8 +1,8 @@
1
1
  import { CusfrontClient, CreateClientOptions } from './index.js';
2
2
  import { JwtIssued, TelegramUnknown } from './resources/auth.js';
3
3
  import './http-DeANAoTs.js';
4
- import './deposits-DScyT_D9.js';
5
- import './cards-Ba1wZttb.js';
4
+ import './deposits-B2LBe2k1.js';
5
+ import './cards-CF3-He2x.js';
6
6
  import './resources/balance.js';
7
7
  import './resources/bonus.js';
8
8
  import './resources/codes.js';
package/dist/telegram.js CHANGED
@@ -471,9 +471,11 @@ var CardsResource = class {
471
471
  });
472
472
  }
473
473
  /**
474
- * Freeze the caller's own card. Reversible via {@link unfreeze}. The optional
475
- * `reason` is recorded on the audit trail. Resolves to the updated card.
476
- * 404 if the card isn't the caller's; 501 if the issuer can't freeze.
474
+ * Freeze the caller's own card. Reversible via {@link unfreeze} while
475
+ * `status_source` is `holder` or `operator`. The optional `reason` is
476
+ * recorded on the audit trail. Resolves to the updated card. 404 if the
477
+ * card isn't the caller's; 409 `card_locked` when support holds it; 501 if
478
+ * the issuer can't freeze.
477
479
  */
478
480
  async freeze(id, reason) {
479
481
  return this.http.post(`/me/cards/${encodeURIComponent(id)}/freeze`, { body: { reason } });
@@ -488,16 +490,38 @@ var CardsResource = class {
488
490
  * keep the result in volatile memory only, never write it to
489
491
  * localStorage / logs, and clear it within `expires_in_seconds`.
490
492
  *
491
- * 401 bad re-auth · 403 not your card · 429 rate-limited · 501 connector
492
- * has no sensitive-data endpoint · 503 provider error.
493
+ * The result is the numbers, or `reveal_url` with empty `pan` and `cvv`
494
+ * when the issuer shows them on a page of its own: open that page in a
495
+ * frame right away, it is short-lived.
496
+ *
497
+ * 403 not your card · 409 `card_locked` · 429 rate-limited · 501 connector
498
+ * has no sensitive-data endpoint · 503 `provider_unavailable`.
493
499
  */
494
500
  async reveal(id, _input) {
495
501
  return this.http.post(`/me/cards/${encodeURIComponent(id)}/reveal`);
496
502
  }
497
- /** Unfreeze a previously-frozen card. Idempotent on an already-active card. */
503
+ /**
504
+ * Unfreeze a previously-frozen card. Idempotent on an already-active card.
505
+ * A card the issuer froze (`status_source: "provider"`) is not the
506
+ * holder's to unfreeze: the API answers 409 `card_locked`, so hide the
507
+ * button and say the freeze is lifted through the issuer's support.
508
+ */
498
509
  async unfreeze(id) {
499
510
  return this.http.post(`/me/cards/${encodeURIComponent(id)}/unfreeze`, { body: {} });
500
511
  }
512
+ /**
513
+ * Set the PIN of the caller's own physical card. The session is enough; the
514
+ * call is rate-limited like {@link reveal} and the PIN is kept nowhere.
515
+ * Resolves to the card; the user also gets a notification that the PIN
516
+ * was set. 400 not four to six digits or the card is not active · 403 not
517
+ * your card · 409 `card_locked`, or `provider_refused` when the issuer did
518
+ * not take it · 429 too many attempts · 501 a virtual card has no PIN.
519
+ */
520
+ async setPin(id, input) {
521
+ return this.http.post(`/me/cards/${encodeURIComponent(id)}/pin`, {
522
+ body: { pin: input.pin }
523
+ });
524
+ }
501
525
  /**
502
526
  * Terminate the caller's own card. **One-way** — a terminated card cannot be
503
527
  * reactivated. The optional `reason` is audited. Idempotent on an
@@ -527,7 +551,10 @@ var DepositsResource = class {
527
551
  * API answers 400 `no_quote_needed`).
528
552
  */
529
553
  async quote(input) {
530
- return this.http.post("/me/deposits/quotes", { body: input });
554
+ const { connectorSlug, ...rest } = input;
555
+ const body = { ...rest };
556
+ if (connectorSlug !== void 0) body["connector_slug"] = connectorSlug;
557
+ return this.http.post("/me/deposits/quotes", { body });
531
558
  }
532
559
  async initiate(input) {
533
560
  const { idempotencyKey, issue_card, ...rest } = input;
@@ -1087,7 +1114,7 @@ var FundingOptionsResource = class {
1087
1114
  };
1088
1115
 
1089
1116
  // src/version.ts
1090
- var SDK_VERSION = "0.6.0";
1117
+ var SDK_VERSION = "0.6.1";
1091
1118
 
1092
1119
  // src/client-platform.ts
1093
1120
  var CLIENT_HEADER = "X-Takeal-Client";
@@ -1162,7 +1189,7 @@ function isAbsolute(url) {
1162
1189
  }
1163
1190
 
1164
1191
  // src/compat.ts
1165
- var SUPPORTED_MEISTER = ">=0.5.0, <0.7.0";
1192
+ var SUPPORTED_MEISTER = ">=0.6.4, <0.7.0";
1166
1193
  var SEMVER = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
1167
1194
  function parse(v) {
1168
1195
  const m = SEMVER.exec(v.trim());