@takeal/cusfront-sdk 0.6.6 → 0.6.8

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 (53) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +37 -0
  3. package/dist/{cards-DwmzjKDC.d.ts → cards-BgY00UpU.d.ts} +17 -0
  4. package/dist/{cards-BiXmrz7h.d.cts → cards-DGz4Rqu1.d.cts} +17 -0
  5. package/dist/index.cjs +63 -2
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +10 -6
  8. package/dist/index.d.ts +10 -6
  9. package/dist/index.js +63 -2
  10. package/dist/index.js.map +1 -1
  11. package/dist/react/index.d.cts +2 -1
  12. package/dist/react/index.d.ts +2 -1
  13. package/dist/resources/auth.cjs.map +1 -1
  14. package/dist/resources/auth.d.cts +2 -1
  15. package/dist/resources/auth.d.ts +2 -1
  16. package/dist/resources/auth.js.map +1 -1
  17. package/dist/resources/cards.cjs +16 -0
  18. package/dist/resources/cards.cjs.map +1 -1
  19. package/dist/resources/cards.d.cts +2 -1
  20. package/dist/resources/cards.d.ts +2 -1
  21. package/dist/resources/cards.js +16 -0
  22. package/dist/resources/cards.js.map +1 -1
  23. package/dist/resources/claims.cjs +40 -0
  24. package/dist/resources/claims.cjs.map +1 -0
  25. package/dist/resources/claims.d.cts +114 -0
  26. package/dist/resources/claims.d.ts +114 -0
  27. package/dist/resources/claims.js +38 -0
  28. package/dist/resources/claims.js.map +1 -0
  29. package/dist/resources/deposits.cjs.map +1 -1
  30. package/dist/resources/deposits.d.cts +2 -1
  31. package/dist/resources/deposits.d.ts +2 -1
  32. package/dist/resources/deposits.js.map +1 -1
  33. package/dist/resources/funding-options.d.cts +2 -1
  34. package/dist/resources/funding-options.d.ts +2 -1
  35. package/dist/resources/me.d.cts +2 -1
  36. package/dist/resources/me.d.ts +2 -1
  37. package/dist/resources/subscription.cjs +9 -0
  38. package/dist/resources/subscription.cjs.map +1 -1
  39. package/dist/resources/subscription.d.cts +19 -2
  40. package/dist/resources/subscription.d.ts +19 -2
  41. package/dist/resources/subscription.js +9 -0
  42. package/dist/resources/subscription.js.map +1 -1
  43. package/dist/resources/support.cjs.map +1 -1
  44. package/dist/resources/support.d.cts +8 -3
  45. package/dist/resources/support.d.ts +8 -3
  46. package/dist/resources/support.js.map +1 -1
  47. package/dist/telegram.cjs +63 -2
  48. package/dist/telegram.cjs.map +1 -1
  49. package/dist/telegram.d.cts +2 -1
  50. package/dist/telegram.d.ts +2 -1
  51. package/dist/telegram.js +63 -2
  52. package/dist/telegram.js.map +1 -1
  53. package/package.json +6 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,42 @@ 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.6.8] — 2026-10-27
8
+
9
+ Works with platform (TKL) 0.6.13 up to, not including, 1.0.0: `SUPPORTED_MEISTER` is
10
+ `>=0.6.13, <1.0.0`, so the SDK keeps working with platform 0.7.0.
11
+
12
+ ## [0.6.7] — 2026-10-27
13
+
14
+ Needs platform (TKL) 0.6.13 or newer: `SUPPORTED_MEISTER` is `>=0.6.13, <0.7.0`.
15
+
16
+ ### Added
17
+
18
+ - `subscription.cancel()`: the person cancels their subscription in one
19
+ step. What they paid for the current period comes back to the balance
20
+ for the days not used; the answer says how much. Needs the platform's
21
+ next release.
22
+ - `cards.reportLost(id, { kind, details })`: the user reports a card lost
23
+ or stolen, at any time. The report is recorded with the server's time,
24
+ which decides who pays for operations someone else made, and the card is
25
+ frozen at its issuer; only support can unfreeze it. Resolves to a
26
+ `Claim`. When the issuer can't be reached, `card_freeze` is `"pending"`
27
+ and the report counts all the same. Needs the platform's next release.
28
+ - `claims`: dispute a card operation or complain with `create({ kind,
29
+ description, cardId, transactionId })`, and follow every claim, lost and
30
+ stolen cards included, with `list()` and `get(id)`: a `number` such as
31
+ `C-000123`, a `status` (`open`, `in_review`, `resolved`, `rejected`) and
32
+ support's answer in `resolution`. Needs the platform's next release.
33
+
34
+ ### Changed
35
+
36
+ - `support`: a message the person wrote in Telegram keeps its formatting.
37
+ Its `html` now carries it (bold, italic, code, links with their
38
+ addresses), and `text` the plain words. An answer sent to the person's
39
+ Telegram is `queued` until all of it got there and `failed` if it could
40
+ not; it used to be `delivered` at once. Needs the platform's next
41
+ release.
42
+
7
43
  ## [0.6.6] — 2026-10-23
8
44
 
9
45
  ### Added
package/README.md CHANGED
@@ -712,6 +712,43 @@ Only the last four digits come back (`payout_details.masked`). 409 codes of
712
712
  `topup_in_progress`, `card_closing`, `no_balance` (the card holds nothing:
713
713
  `cards.terminate()` it), `provider_refused`.
714
714
 
715
+ ## A lost or stolen card, disputes and complaints
716
+
717
+ The user can report a card lost or stolen at any time. The report is
718
+ recorded first, with the server's time: that time decides who pays for
719
+ operations someone else made with the card, so show it. Then the card is
720
+ frozen at its issuer, and from then on only support can unfreeze it
721
+ (`cards.unfreeze()` answers 409 `card_locked`).
722
+
723
+ ```ts
724
+ const claim = await client.cards.reportLost(cardId, { kind: "stolen", details: "Taken with my bag" });
725
+ // claim.number: "C-000123", to quote to support
726
+ // claim.reported_at: when the report counts from
727
+ // claim.card_freeze: "frozen", or "pending" when the issuer couldn't be reached;
728
+ // the report counts all the same and support freezes the card by hand
729
+ ```
730
+
731
+ Reporting the same card again while its report is open returns that claim.
732
+ 409 `card_not_open`: the card is closed or was never issued.
733
+
734
+ A card operation the user doesn't agree with, or anything else, is a claim
735
+ too. Name the operation as `client.history` does (`txn_<id>`); its card is
736
+ found from it.
737
+
738
+ ```ts
739
+ await client.claims.create({
740
+ kind: "dispute", // or "complaint"
741
+ transactionId: entry.id,
742
+ description: "I didn't make this payment and don't know the shop.",
743
+ });
744
+ const { items, total } = await client.claims.list(); // newest first, every kind
745
+ const one = await client.claims.get(claimId);
746
+ // status: "open" → "in_review" → "resolved" | "rejected", with support's answer in `resolution`
747
+ ```
748
+
749
+ The user is notified when a claim comes in and each time its status
750
+ changes. 409 `too_many_claims`: 20 claims are waiting for an answer already.
751
+
715
752
  ## Promo and referral codes
716
753
 
717
754
  A code goes with the operation it is for. At sign-up an unknown or expired
@@ -1,3 +1,4 @@
1
+ import { Claim } from './resources/claims.js';
1
2
  import { ConsentKind, ConsentChannel } from './resources/consents.js';
2
3
  import { H as HttpClient } from './http-CL97TjMO.js';
3
4
 
@@ -444,6 +445,7 @@ declare class DepositsResource {
444
445
  * GET /me/cards/{id}/balance → balance (prepaid remaining)
445
446
  * POST /me/cards/{id}/freeze → freeze
446
447
  * POST /me/cards/{id}/unfreeze → unfreeze
448
+ * POST /me/cards/{id}/report-lost → reportLost (lost or stolen: frozen at once)
447
449
  * POST /me/cards/{id}/transfer → transfer (to another of their cards)
448
450
  * POST /me/cards/{id}/terminate → terminate (one-way)
449
451
  * POST /me/cards/{id}/reveal → reveal (the numbers, or a provider page)
@@ -1171,6 +1173,21 @@ declare class CardsResource {
1171
1173
  * button and say the freeze is lifted through the issuer's support.
1172
1174
  */
1173
1175
  unfreeze(id: string): Promise<Card>;
1176
+ /**
1177
+ * Report the card lost or stolen. Works at any time, on an active or a
1178
+ * frozen card. The report is recorded first with the server's time, which
1179
+ * decides who pays for operations someone else made; then the card is
1180
+ * frozen at its issuer and only support can unfreeze it. Resolves to the
1181
+ * claim (`client.claims`): show its `number` and `reported_at`. When the
1182
+ * issuer can't be reached, `card_freeze` is `"pending"`: the report still
1183
+ * counts and support freezes the card by hand. Reporting again while the
1184
+ * report is open returns the same claim. 404 / 403 not the user's card ·
1185
+ * 409 `card_not_open`: the card is closed or was never issued.
1186
+ */
1187
+ reportLost(id: string, input: {
1188
+ kind: "lost" | "stolen";
1189
+ details?: string;
1190
+ }): Promise<Claim>;
1174
1191
  /**
1175
1192
  * Set the PIN of the caller's own physical card. The session is enough; the
1176
1193
  * call is rate-limited like {@link reveal} and the PIN is kept nowhere.
@@ -1,3 +1,4 @@
1
+ import { Claim } from './resources/claims.cjs';
1
2
  import { ConsentKind, ConsentChannel } from './resources/consents.cjs';
2
3
  import { H as HttpClient } from './http-CL97TjMO.cjs';
3
4
 
@@ -444,6 +445,7 @@ declare class DepositsResource {
444
445
  * GET /me/cards/{id}/balance → balance (prepaid remaining)
445
446
  * POST /me/cards/{id}/freeze → freeze
446
447
  * POST /me/cards/{id}/unfreeze → unfreeze
448
+ * POST /me/cards/{id}/report-lost → reportLost (lost or stolen: frozen at once)
447
449
  * POST /me/cards/{id}/transfer → transfer (to another of their cards)
448
450
  * POST /me/cards/{id}/terminate → terminate (one-way)
449
451
  * POST /me/cards/{id}/reveal → reveal (the numbers, or a provider page)
@@ -1171,6 +1173,21 @@ declare class CardsResource {
1171
1173
  * button and say the freeze is lifted through the issuer's support.
1172
1174
  */
1173
1175
  unfreeze(id: string): Promise<Card>;
1176
+ /**
1177
+ * Report the card lost or stolen. Works at any time, on an active or a
1178
+ * frozen card. The report is recorded first with the server's time, which
1179
+ * decides who pays for operations someone else made; then the card is
1180
+ * frozen at its issuer and only support can unfreeze it. Resolves to the
1181
+ * claim (`client.claims`): show its `number` and `reported_at`. When the
1182
+ * issuer can't be reached, `card_freeze` is `"pending"`: the report still
1183
+ * counts and support freezes the card by hand. Reporting again while the
1184
+ * report is open returns the same claim. 404 / 403 not the user's card ·
1185
+ * 409 `card_not_open`: the card is closed or was never issued.
1186
+ */
1187
+ reportLost(id: string, input: {
1188
+ kind: "lost" | "stolen";
1189
+ details?: string;
1190
+ }): Promise<Claim>;
1174
1191
  /**
1175
1192
  * Set the PIN of the caller's own physical card. The session is enough; the
1176
1193
  * call is rate-limited like {@link reveal} and the PIN is kept nowhere.
package/dist/index.cjs CHANGED
@@ -361,6 +361,22 @@ var CardsResource = class {
361
361
  async unfreeze(id) {
362
362
  return this.http.post(`/me/cards/${encodeURIComponent(id)}/unfreeze`, { body: {} });
363
363
  }
364
+ /**
365
+ * Report the card lost or stolen. Works at any time, on an active or a
366
+ * frozen card. The report is recorded first with the server's time, which
367
+ * decides who pays for operations someone else made; then the card is
368
+ * frozen at its issuer and only support can unfreeze it. Resolves to the
369
+ * claim (`client.claims`): show its `number` and `reported_at`. When the
370
+ * issuer can't be reached, `card_freeze` is `"pending"`: the report still
371
+ * counts and support freezes the card by hand. Reporting again while the
372
+ * report is open returns the same claim. 404 / 403 not the user's card ·
373
+ * 409 `card_not_open`: the card is closed or was never issued.
374
+ */
375
+ async reportLost(id, input) {
376
+ return this.http.post(`/me/cards/${encodeURIComponent(id)}/report-lost`, {
377
+ body: { kind: input.kind, details: input.details }
378
+ });
379
+ }
364
380
  /**
365
381
  * Set the PIN of the caller's own physical card. The session is enough; the
366
382
  * call is rate-limited like {@link reveal} and the PIN is kept nowhere.
@@ -813,6 +829,41 @@ var CloseRequestsResource = class {
813
829
  }
814
830
  };
815
831
 
832
+ // src/resources/claims.ts
833
+ var ClaimsResource = class {
834
+ constructor(http) {
835
+ this.http = http;
836
+ }
837
+ /**
838
+ * Dispute a card operation, or complain. 400 `validation`: a description
839
+ * that is too short or too long, an operation that isn't on the user's
840
+ * cards, or a lost or stolen card (use `cards.reportLost()`) · 404 no
841
+ * such card · 409 `too_many_claims`: 20 claims are waiting for an answer.
842
+ */
843
+ async create(input) {
844
+ return this.http.post("/me/claims", {
845
+ body: {
846
+ kind: input.kind,
847
+ description: input.description,
848
+ card_id: input.cardId,
849
+ transaction_id: input.transactionId
850
+ }
851
+ });
852
+ }
853
+ /** The user's claims, lost and stolen cards included, newest first. */
854
+ async list(opts = {}) {
855
+ const qs = new URLSearchParams();
856
+ if (opts.limit != null) qs.set("limit", String(opts.limit));
857
+ if (opts.offset != null) qs.set("offset", String(opts.offset));
858
+ const q = qs.toString();
859
+ return this.http.get(`/me/claims${q ? `?${q}` : ""}`, { signal: opts.signal });
860
+ }
861
+ /** One claim. 404 when it isn't the user's. */
862
+ async get(id, opts = {}) {
863
+ return this.http.get(`/me/claims/${encodeURIComponent(id)}`, { signal: opts.signal });
864
+ }
865
+ };
866
+
816
867
  // src/resources/codes.ts
817
868
  var CodesResource = class {
818
869
  constructor(http) {
@@ -856,6 +907,15 @@ var SubscriptionResource = class {
856
907
  async setPromoCode(code) {
857
908
  return this.http.put("/me/subscription/promo-code", { body: { code } });
858
909
  }
910
+ /**
911
+ * Cancel the subscription now, in one step. What was paid for the current
912
+ * period comes back to the balance for the days not used. No subscription
913
+ * running → 404; 503 `refund_unavailable` when the refund can't be made
914
+ * right now (the subscription keeps running; try again).
915
+ */
916
+ async cancel() {
917
+ return this.http.post("/me/subscription/cancel", {});
918
+ }
859
919
  };
860
920
 
861
921
  // src/resources/branding.ts
@@ -1515,7 +1575,7 @@ var FundingOptionsResource = class {
1515
1575
  };
1516
1576
 
1517
1577
  // src/version.ts
1518
- var SDK_VERSION = "0.6.6";
1578
+ var SDK_VERSION = "0.6.8";
1519
1579
 
1520
1580
  // src/client-platform.ts
1521
1581
  var CLIENT_HEADER = "X-Takeal-Client";
@@ -1590,7 +1650,7 @@ function isAbsolute(url) {
1590
1650
  }
1591
1651
 
1592
1652
  // src/compat.ts
1593
- var SUPPORTED_MEISTER = ">=0.6.12, <0.7.0";
1653
+ var SUPPORTED_MEISTER = ">=0.6.13, <1.0.0";
1594
1654
  var SEMVER = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
1595
1655
  function parse(v) {
1596
1656
  const m = SEMVER.exec(v.trim());
@@ -2105,6 +2165,7 @@ function createClient(opts) {
2105
2165
  bonus: new BonusResource(http),
2106
2166
  debt: new DebtResource(http),
2107
2167
  closeRequests: new CloseRequestsResource(http),
2168
+ claims: new ClaimsResource(http),
2108
2169
  codes: new CodesResource(http),
2109
2170
  referral: new ReferralResource(http),
2110
2171
  subscription: new SubscriptionResource(http),