@takeal/cusfront-sdk 0.3.7 → 0.3.18

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/CHANGELOG.md CHANGED
@@ -4,6 +4,38 @@ All notable changes to `@takeal/cusfront-sdk` are documented here. The format
4
4
  follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project
5
5
  adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.3.18] — 2026-09-20
8
+
9
+ Checked against platform `v0.3.18` (API `0.3.18`).
10
+
11
+ ### Added
12
+
13
+ - `client.cards.catalog()`: the card catalog without a session
14
+ (`GET /card-products`), for a landing page or the cabinet before sign-in.
15
+ Same shape as `listProducts()`, list prices, cacheable for a minute.
16
+
17
+ ### Changed
18
+
19
+ - `InitiateDepositInput.metadata` documents the two cross-connector keys:
20
+ `return_url` for the post-3DS return, and `mock_scenario` on test
21
+ deployments (`happy`, `pending`, `redirect`, `fail`). The `redirect`
22
+ scenario now lands on a hosted page that approves or declines and comes
23
+ back to `return_url`, so the whole redirect path can be built against the
24
+ mock.
25
+
26
+ ## [0.3.12] — 2026-09-16
27
+
28
+ Checked against platform `v0.3.12`.
29
+
30
+ ### Changed
31
+
32
+ - `client.cards.reveal(id)` takes no re-auth: the signed-in session is enough
33
+ (the API stopped asking for the password and the TOTP code). The old
34
+ `RevealCardInput` argument is still accepted and ignored; it is deprecated
35
+ and goes away in the next major.
36
+ - `Card` no longer carries `connector_slug` and `provider_reference`: the API
37
+ keeps those for operators. `product` and `design` say what a holder needs.
38
+
7
39
  ## [0.3.7] — 2026-09-16
8
40
 
9
41
  Checked against platform `v0.3.7` (API `0.3.6`, nothing in the end-user
package/README.md CHANGED
@@ -67,6 +67,8 @@ walks it from the list to the issued card:
67
67
  ```ts
68
68
  // 1. The catalog: what the user can order, default product first.
69
69
  const products = await client.cards.listProducts();
70
+ // Before sign-in (a landing page), the same list at list prices:
71
+ // const products = await client.cards.catalog();
70
72
 
71
73
  for (const p of products) {
72
74
  // Artwork: `image_url` is absolute for uploaded designs and a path
@@ -502,10 +504,10 @@ Algorithm: HMAC-SHA256, header `X-Takeal-Signature: sha256=<hex>`, signed over
502
504
  the raw body bytes (no timestamp). Comparison is constant-time.
503
505
 
504
506
  > **Card details:** `client.cards.reveal()` returns the full card number and
505
- > CVV. It asks for the user's password again (and a TOTP code if they have one
506
- > enrolled), and the API rate-limits and logs every call. The rest of
507
- > `client.cards` is listProducts, getProduct, create, get, list, update,
508
- > balance, freeze, unfreeze and terminate.
507
+ > CVV to the signed-in user; no password or code is asked again, and the API
508
+ > rate-limits and logs every call. The rest of
509
+ > `client.cards` is catalog, listProducts, getProduct, create, get, list,
510
+ > update, balance, freeze, unfreeze and terminate.
509
511
 
510
512
  ## React hooks (`@takeal/cusfront-sdk/react`)
511
513
 
package/dist/index.cjs CHANGED
@@ -341,6 +341,16 @@ var CardsResource = class {
341
341
  `/me/card-products/${encodeURIComponent(id)}`
342
342
  );
343
343
  }
344
+ /**
345
+ * The public catalog: the same products, order and default as
346
+ * {@link listProducts}, but readable before sign-in, for a landing page or
347
+ * the cabinet's first screen. Prices are list prices (`discount_bps` is
348
+ * always 0); once the user is signed in, {@link listProducts} shows what
349
+ * they pay. The API lets caches keep this response for a minute.
350
+ */
351
+ async catalog() {
352
+ return this.http.get("/card-products");
353
+ }
344
354
  /**
345
355
  * Rename the caller's own card or change its design. Resolves to the
346
356
  * updated card. 404 if the card isn't the caller's; 400 `invalid_name` /
@@ -384,8 +394,8 @@ var CardsResource = class {
384
394
  );
385
395
  }
386
396
  /**
387
- * Reveal the FULL PAN + CVV for the caller's own card. Re-auth gated
388
- * (password, + TOTP when the user has it enrolled) and rate-limited
397
+ * Reveal the FULL PAN + CVV for the caller's own card. The signed-in
398
+ * session is all the API asks for; the call is rate-limited and audited
389
399
  * server-side. The Takeal API never persists this data and marks the
390
400
  * response no-store; the SDK returns it verbatim and holds nothing.
391
401
  *
@@ -396,11 +406,8 @@ var CardsResource = class {
396
406
  * 401 bad re-auth · 403 not your card · 429 rate-limited · 501 connector
397
407
  * has no sensitive-data endpoint · 503 provider error.
398
408
  */
399
- async reveal(id, input) {
400
- return this.http.post(
401
- `/me/cards/${encodeURIComponent(id)}/reveal`,
402
- { body: { password: input.password, totp_code: input.totpCode } }
403
- );
409
+ async reveal(id, _input) {
410
+ return this.http.post(`/me/cards/${encodeURIComponent(id)}/reveal`);
404
411
  }
405
412
  /** Unfreeze a previously-frozen card. Idempotent on an already-active card. */
406
413
  async unfreeze(id) {
@@ -757,7 +764,7 @@ var DevicesResource = class {
757
764
  };
758
765
 
759
766
  // src/version.ts
760
- var SDK_VERSION = "0.3.7";
767
+ var SDK_VERSION = "0.3.18";
761
768
 
762
769
  // src/client-platform.ts
763
770
  var CLIENT_HEADER = "X-Takeal-Client";