@takeal/cusfront-sdk 0.6.8 → 0.6.11

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.
@@ -1,7 +1,7 @@
1
1
  import { CusfrontClient, CreateClientOptions } from './index.cjs';
2
2
  import { JwtIssued, TelegramUnknown } from './resources/auth.cjs';
3
3
  import './http-CL97TjMO.cjs';
4
- import './cards-DGz4Rqu1.cjs';
4
+ import './cards-nXmDP0ei.cjs';
5
5
  import './resources/claims.cjs';
6
6
  import './resources/consents.cjs';
7
7
  import './resources/balance.cjs';
@@ -1,7 +1,7 @@
1
1
  import { CusfrontClient, CreateClientOptions } from './index.js';
2
2
  import { JwtIssued, TelegramUnknown } from './resources/auth.js';
3
3
  import './http-CL97TjMO.js';
4
- import './cards-BgY00UpU.js';
4
+ import './cards-CuUdrQ0H.js';
5
5
  import './resources/claims.js';
6
6
  import './resources/consents.js';
7
7
  import './resources/balance.js';
package/dist/telegram.js CHANGED
@@ -182,6 +182,11 @@ function cardOrderBody(input) {
182
182
  if (input.metadata !== void 0) body["metadata"] = input.metadata;
183
183
  return body;
184
184
  }
185
+ function revealState(r) {
186
+ if (r.details_pending) return "pending";
187
+ if (r.reveal_url) return "page";
188
+ return "numbers";
189
+ }
185
190
  var CardsResource = class {
186
191
  constructor(http) {
187
192
  this.http = http;
@@ -337,15 +342,22 @@ var CardsResource = class {
337
342
  * keep the result in volatile memory only, never write it to
338
343
  * localStorage / logs, and clear it within `expires_in_seconds`.
339
344
  *
340
- * The result is the numbers, or `reveal_url` with empty `pan` and `cvv`
341
- * when the issuer shows them on a page of its own: open that page in a
342
- * frame right away, it is short-lived.
345
+ * `state` tells the three answers apart: `numbers`; `page`, with
346
+ * `reveal_url` and empty `pan` and `cvv` when the issuer shows them on a
347
+ * page of its own (open that page in a frame right away, it is
348
+ * short-lived); or `pending` while the card's details are still being
349
+ * prepared, which doesn't count against the limit. A card says the same
350
+ * in {@link Card.details_pending}, so there is no need to call this just
351
+ * to find out.
343
352
  *
344
353
  * 403 not your card · 409 `card_locked` · 429 rate-limited · 501 connector
345
354
  * has no sensitive-data endpoint · 503 `provider_unavailable`.
346
355
  */
347
356
  async reveal(id, _input) {
348
- return this.http.post(`/me/cards/${encodeURIComponent(id)}/reveal`);
357
+ const r = await this.http.post(
358
+ `/me/cards/${encodeURIComponent(id)}/reveal`
359
+ );
360
+ return { ...r, state: revealState(r) };
349
361
  }
350
362
  /**
351
363
  * Unfreeze a previously-frozen card. Idempotent on an already-active card.
@@ -1553,7 +1565,7 @@ var FundingOptionsResource = class {
1553
1565
  };
1554
1566
 
1555
1567
  // src/version.ts
1556
- var SDK_VERSION = "0.6.8";
1568
+ var SDK_VERSION = "0.6.11";
1557
1569
 
1558
1570
  // src/client-platform.ts
1559
1571
  var CLIENT_HEADER = "X-Takeal-Client";
@@ -1628,7 +1640,7 @@ function isAbsolute(url) {
1628
1640
  }
1629
1641
 
1630
1642
  // src/compat.ts
1631
- var SUPPORTED_MEISTER = ">=0.6.13, <1.0.0";
1643
+ var SUPPORTED_MEISTER = ">=0.7.6, <1.0.0";
1632
1644
  var SEMVER = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
1633
1645
  function parse(v) {
1634
1646
  const m = SEMVER.exec(v.trim());