@takeal/cusfront-sdk 0.3.18 → 0.5.0

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 (121) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/README.md +430 -9
  3. package/dist/analytics.cjs +417 -0
  4. package/dist/analytics.cjs.map +1 -0
  5. package/dist/analytics.d.cts +129 -0
  6. package/dist/analytics.d.ts +129 -0
  7. package/dist/analytics.js +403 -0
  8. package/dist/analytics.js.map +1 -0
  9. package/dist/cards-B_aNY35J.d.cts +514 -0
  10. package/dist/cards-Ba1wZttb.d.ts +514 -0
  11. package/dist/deposits-BEc8U80M.d.cts +310 -0
  12. package/dist/deposits-DScyT_D9.d.ts +310 -0
  13. package/dist/{devices-DP_hxwmW.d.ts → devices-B_YveTl9.d.ts} +1 -1
  14. package/dist/{devices-C3JHi2Hi.d.cts → devices-a5Z45Mx_.d.cts} +1 -1
  15. package/dist/{http-B-OQwMYn.d.cts → http-DeANAoTs.d.cts} +11 -3
  16. package/dist/{http-B-OQwMYn.d.ts → http-DeANAoTs.d.ts} +11 -3
  17. package/dist/index.cjs +964 -77
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +101 -13
  20. package/dist/index.d.ts +101 -13
  21. package/dist/index.js +949 -78
  22. package/dist/index.js.map +1 -1
  23. package/dist/react/index.d.cts +12 -5
  24. package/dist/react/index.d.ts +12 -5
  25. package/dist/resources/attribution.cjs +82 -0
  26. package/dist/resources/attribution.cjs.map +1 -0
  27. package/dist/resources/attribution.d.cts +100 -0
  28. package/dist/resources/attribution.d.ts +100 -0
  29. package/dist/resources/attribution.js +78 -0
  30. package/dist/resources/attribution.js.map +1 -0
  31. package/dist/resources/auth.cjs +81 -15
  32. package/dist/resources/auth.cjs.map +1 -1
  33. package/dist/resources/auth.d.cts +53 -6
  34. package/dist/resources/auth.d.ts +53 -6
  35. package/dist/resources/auth.js +81 -15
  36. package/dist/resources/auth.js.map +1 -1
  37. package/dist/resources/balance.d.cts +1 -1
  38. package/dist/resources/balance.d.ts +1 -1
  39. package/dist/resources/blog.cjs.map +1 -1
  40. package/dist/resources/blog.d.cts +8 -1
  41. package/dist/resources/blog.d.ts +8 -1
  42. package/dist/resources/blog.js.map +1 -1
  43. package/dist/resources/bonus.cjs +28 -0
  44. package/dist/resources/bonus.cjs.map +1 -0
  45. package/dist/resources/bonus.d.cts +121 -0
  46. package/dist/resources/bonus.d.ts +121 -0
  47. package/dist/resources/bonus.js +26 -0
  48. package/dist/resources/bonus.js.map +1 -0
  49. package/dist/resources/branding.d.cts +1 -1
  50. package/dist/resources/branding.d.ts +1 -1
  51. package/dist/resources/cards.cjs +73 -10
  52. package/dist/resources/cards.cjs.map +1 -1
  53. package/dist/resources/cards.d.cts +2 -281
  54. package/dist/resources/cards.d.ts +2 -281
  55. package/dist/resources/cards.js +73 -11
  56. package/dist/resources/cards.js.map +1 -1
  57. package/dist/resources/codes.cjs +20 -0
  58. package/dist/resources/codes.cjs.map +1 -0
  59. package/dist/resources/codes.d.cts +100 -0
  60. package/dist/resources/codes.d.ts +100 -0
  61. package/dist/resources/codes.js +18 -0
  62. package/dist/resources/codes.js.map +1 -0
  63. package/dist/resources/deposits.cjs +28 -3
  64. package/dist/resources/deposits.cjs.map +1 -1
  65. package/dist/resources/deposits.d.cts +3 -176
  66. package/dist/resources/deposits.d.ts +3 -176
  67. package/dist/resources/deposits.js +28 -3
  68. package/dist/resources/deposits.js.map +1 -1
  69. package/dist/resources/devices.d.cts +2 -2
  70. package/dist/resources/devices.d.ts +2 -2
  71. package/dist/resources/documents.cjs +64 -0
  72. package/dist/resources/documents.cjs.map +1 -0
  73. package/dist/resources/documents.d.cts +212 -0
  74. package/dist/resources/documents.d.ts +212 -0
  75. package/dist/resources/documents.js +62 -0
  76. package/dist/resources/documents.js.map +1 -0
  77. package/dist/resources/funding-options.cjs +16 -0
  78. package/dist/resources/funding-options.cjs.map +1 -0
  79. package/dist/resources/funding-options.d.cts +3 -0
  80. package/dist/resources/funding-options.d.ts +3 -0
  81. package/dist/resources/funding-options.js +14 -0
  82. package/dist/resources/funding-options.js.map +1 -0
  83. package/dist/resources/history.cjs +31 -0
  84. package/dist/resources/history.cjs.map +1 -0
  85. package/dist/resources/history.d.cts +95 -0
  86. package/dist/resources/history.d.ts +95 -0
  87. package/dist/resources/history.js +29 -0
  88. package/dist/resources/history.js.map +1 -0
  89. package/dist/resources/me.d.cts +3 -1
  90. package/dist/resources/me.d.ts +3 -1
  91. package/dist/resources/notifications.d.cts +1 -1
  92. package/dist/resources/notifications.d.ts +1 -1
  93. package/dist/resources/push.d.cts +1 -1
  94. package/dist/resources/push.d.ts +1 -1
  95. package/dist/resources/referral.cjs +16 -0
  96. package/dist/resources/referral.cjs.map +1 -0
  97. package/dist/resources/referral.d.cts +58 -0
  98. package/dist/resources/referral.d.ts +58 -0
  99. package/dist/resources/referral.js +14 -0
  100. package/dist/resources/referral.js.map +1 -0
  101. package/dist/resources/sessions.d.cts +1 -1
  102. package/dist/resources/sessions.d.ts +1 -1
  103. package/dist/resources/subscription.cjs +24 -0
  104. package/dist/resources/subscription.cjs.map +1 -0
  105. package/dist/resources/subscription.d.cts +48 -0
  106. package/dist/resources/subscription.d.ts +48 -0
  107. package/dist/resources/subscription.js +22 -0
  108. package/dist/resources/subscription.js.map +1 -0
  109. package/dist/resources/subscriptions.d.cts +1 -1
  110. package/dist/resources/subscriptions.d.ts +1 -1
  111. package/dist/resources/wallet.d.cts +1 -1
  112. package/dist/resources/wallet.d.ts +1 -1
  113. package/dist/telegram.cjs +499 -77
  114. package/dist/telegram.cjs.map +1 -1
  115. package/dist/telegram.d.cts +12 -5
  116. package/dist/telegram.d.ts +12 -5
  117. package/dist/telegram.js +499 -77
  118. package/dist/telegram.js.map +1 -1
  119. package/package.json +46 -1
  120. package/dist/customer-CoxPwe5o.d.cts +0 -32
  121. package/dist/customer-CoxPwe5o.d.ts +0 -32
@@ -1,5 +1,7 @@
1
- import { H as HttpClient } from '../http-B-OQwMYn.js';
1
+ import { H as HttpClient } from '../http-DeANAoTs.js';
2
2
  import { User } from './auth.js';
3
+ import './attribution.js';
4
+ import './codes.js';
3
5
 
4
6
  /**
5
7
  * Me resource — `client.me.*`.
@@ -1,4 +1,4 @@
1
- import { H as HttpClient } from '../http-B-OQwMYn.cjs';
1
+ import { H as HttpClient } from '../http-DeANAoTs.cjs';
2
2
 
3
3
  /**
4
4
  * Notifications resource — `client.notifications.*`.
@@ -1,4 +1,4 @@
1
- import { H as HttpClient } from '../http-B-OQwMYn.js';
1
+ import { H as HttpClient } from '../http-DeANAoTs.js';
2
2
 
3
3
  /**
4
4
  * Notifications resource — `client.notifications.*`.
@@ -1,4 +1,4 @@
1
- import { H as HttpClient } from '../http-B-OQwMYn.cjs';
1
+ import { H as HttpClient } from '../http-DeANAoTs.cjs';
2
2
 
3
3
  /**
4
4
  * Push resource — `client.push.*`.
@@ -1,4 +1,4 @@
1
- import { H as HttpClient } from '../http-B-OQwMYn.js';
1
+ import { H as HttpClient } from '../http-DeANAoTs.js';
2
2
 
3
3
  /**
4
4
  * Push resource — `client.push.*`.
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ // src/resources/referral.ts
4
+ var ReferralResource = class {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ /** The user's referral code, link, invited friends and rewards. */
9
+ async get(opts = {}) {
10
+ return this.http.get("/me/referral", { signal: opts.signal });
11
+ }
12
+ };
13
+
14
+ exports.ReferralResource = ReferralResource;
15
+ //# sourceMappingURL=referral.cjs.map
16
+ //# sourceMappingURL=referral.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/resources/referral.ts"],"names":[],"mappings":";;;AAoDO,IAAM,mBAAN,MAAuB;AAAA,EAC5B,YAA6B,IAAA,EAAkB;AAAlB,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAAA,EAAmB;AAAA;AAAA,EAGhD,MAAM,GAAA,CAAI,IAAA,GAAiC,EAAC,EAAsB;AAChE,IAAA,OAAO,IAAA,CAAK,KAAK,GAAA,CAAc,cAAA,EAAgB,EAAE,MAAA,EAAQ,IAAA,CAAK,QAAQ,CAAA;AAAA,EACxE;AACF","file":"referral.cjs","sourcesContent":["import type { HttpClient } from \"../http.js\";\n\n/**\n * Referral resource — `client.referral.*`.\n *\n * For the people allowed to invite: their referral code, the link to\n * share, the people who signed up with it (no names or contacts, only\n * when they joined and how far they got) and what each reward was for.\n * Referral codes are given by invitation, so `code` is `null` for most\n * users. Rewards are bonuses, a discount on our services, not money.\n *\n * Mirrors `GET /me/referral`.\n */\n\n/** Someone the user invited, without anything that identifies them. */\nexport interface InvitedFriend {\n joined_at: string;\n /** Bonuses they brought so far, decimal string. */\n rewarded: string;\n has_card: boolean;\n has_topped_up: boolean;\n}\n\n/** One reward. */\nexport interface ReferralReward {\n id: string;\n /** `signup`, `card_issuance`, `first_deposit` or `deposit`. */\n event: \"signup\" | \"card_issuance\" | \"first_deposit\" | \"deposit\" | (string & {});\n /** The friend's operation a percent was taken of. */\n basis_amount: string | null;\n basis_currency: string | null;\n /** Bonuses, decimal string. */\n units: string;\n /** Always `bonus`. */\n payout_kind: string;\n /** `pending` until the bonuses are on the account. */\n status: \"pending\" | \"credited\" | (string & {});\n created_at: string;\n}\n\nexport interface Referral {\n code: string | null;\n /** The invitation link, or `null` when the deployment has none: share the code then. */\n link: string | null;\n invited_count: number;\n /** The latest invited, newest first. */\n invited: InvitedFriend[];\n /** Bonuses earned in total, decimal string. */\n total_rewarded: string;\n rewards: ReferralReward[];\n}\n\nexport class ReferralResource {\n constructor(private readonly http: HttpClient) {}\n\n /** The user's referral code, link, invited friends and rewards. */\n async get(opts: { signal?: AbortSignal } = {}): Promise<Referral> {\n return this.http.get<Referral>(\"/me/referral\", { signal: opts.signal });\n }\n}\n"]}
@@ -0,0 +1,58 @@
1
+ import { H as HttpClient } from '../http-DeANAoTs.cjs';
2
+
3
+ /**
4
+ * Referral resource — `client.referral.*`.
5
+ *
6
+ * For the people allowed to invite: their referral code, the link to
7
+ * share, the people who signed up with it (no names or contacts, only
8
+ * when they joined and how far they got) and what each reward was for.
9
+ * Referral codes are given by invitation, so `code` is `null` for most
10
+ * users. Rewards are bonuses, a discount on our services, not money.
11
+ *
12
+ * Mirrors `GET /me/referral`.
13
+ */
14
+ /** Someone the user invited, without anything that identifies them. */
15
+ interface InvitedFriend {
16
+ joined_at: string;
17
+ /** Bonuses they brought so far, decimal string. */
18
+ rewarded: string;
19
+ has_card: boolean;
20
+ has_topped_up: boolean;
21
+ }
22
+ /** One reward. */
23
+ interface ReferralReward {
24
+ id: string;
25
+ /** `signup`, `card_issuance`, `first_deposit` or `deposit`. */
26
+ event: "signup" | "card_issuance" | "first_deposit" | "deposit" | (string & {});
27
+ /** The friend's operation a percent was taken of. */
28
+ basis_amount: string | null;
29
+ basis_currency: string | null;
30
+ /** Bonuses, decimal string. */
31
+ units: string;
32
+ /** Always `bonus`. */
33
+ payout_kind: string;
34
+ /** `pending` until the bonuses are on the account. */
35
+ status: "pending" | "credited" | (string & {});
36
+ created_at: string;
37
+ }
38
+ interface Referral {
39
+ code: string | null;
40
+ /** The invitation link, or `null` when the deployment has none: share the code then. */
41
+ link: string | null;
42
+ invited_count: number;
43
+ /** The latest invited, newest first. */
44
+ invited: InvitedFriend[];
45
+ /** Bonuses earned in total, decimal string. */
46
+ total_rewarded: string;
47
+ rewards: ReferralReward[];
48
+ }
49
+ declare class ReferralResource {
50
+ private readonly http;
51
+ constructor(http: HttpClient);
52
+ /** The user's referral code, link, invited friends and rewards. */
53
+ get(opts?: {
54
+ signal?: AbortSignal;
55
+ }): Promise<Referral>;
56
+ }
57
+
58
+ export { type InvitedFriend, type Referral, ReferralResource, type ReferralReward };
@@ -0,0 +1,58 @@
1
+ import { H as HttpClient } from '../http-DeANAoTs.js';
2
+
3
+ /**
4
+ * Referral resource — `client.referral.*`.
5
+ *
6
+ * For the people allowed to invite: their referral code, the link to
7
+ * share, the people who signed up with it (no names or contacts, only
8
+ * when they joined and how far they got) and what each reward was for.
9
+ * Referral codes are given by invitation, so `code` is `null` for most
10
+ * users. Rewards are bonuses, a discount on our services, not money.
11
+ *
12
+ * Mirrors `GET /me/referral`.
13
+ */
14
+ /** Someone the user invited, without anything that identifies them. */
15
+ interface InvitedFriend {
16
+ joined_at: string;
17
+ /** Bonuses they brought so far, decimal string. */
18
+ rewarded: string;
19
+ has_card: boolean;
20
+ has_topped_up: boolean;
21
+ }
22
+ /** One reward. */
23
+ interface ReferralReward {
24
+ id: string;
25
+ /** `signup`, `card_issuance`, `first_deposit` or `deposit`. */
26
+ event: "signup" | "card_issuance" | "first_deposit" | "deposit" | (string & {});
27
+ /** The friend's operation a percent was taken of. */
28
+ basis_amount: string | null;
29
+ basis_currency: string | null;
30
+ /** Bonuses, decimal string. */
31
+ units: string;
32
+ /** Always `bonus`. */
33
+ payout_kind: string;
34
+ /** `pending` until the bonuses are on the account. */
35
+ status: "pending" | "credited" | (string & {});
36
+ created_at: string;
37
+ }
38
+ interface Referral {
39
+ code: string | null;
40
+ /** The invitation link, or `null` when the deployment has none: share the code then. */
41
+ link: string | null;
42
+ invited_count: number;
43
+ /** The latest invited, newest first. */
44
+ invited: InvitedFriend[];
45
+ /** Bonuses earned in total, decimal string. */
46
+ total_rewarded: string;
47
+ rewards: ReferralReward[];
48
+ }
49
+ declare class ReferralResource {
50
+ private readonly http;
51
+ constructor(http: HttpClient);
52
+ /** The user's referral code, link, invited friends and rewards. */
53
+ get(opts?: {
54
+ signal?: AbortSignal;
55
+ }): Promise<Referral>;
56
+ }
57
+
58
+ export { type InvitedFriend, type Referral, ReferralResource, type ReferralReward };
@@ -0,0 +1,14 @@
1
+ // src/resources/referral.ts
2
+ var ReferralResource = class {
3
+ constructor(http) {
4
+ this.http = http;
5
+ }
6
+ /** The user's referral code, link, invited friends and rewards. */
7
+ async get(opts = {}) {
8
+ return this.http.get("/me/referral", { signal: opts.signal });
9
+ }
10
+ };
11
+
12
+ export { ReferralResource };
13
+ //# sourceMappingURL=referral.js.map
14
+ //# sourceMappingURL=referral.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/resources/referral.ts"],"names":[],"mappings":";AAoDO,IAAM,mBAAN,MAAuB;AAAA,EAC5B,YAA6B,IAAA,EAAkB;AAAlB,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAAA,EAAmB;AAAA;AAAA,EAGhD,MAAM,GAAA,CAAI,IAAA,GAAiC,EAAC,EAAsB;AAChE,IAAA,OAAO,IAAA,CAAK,KAAK,GAAA,CAAc,cAAA,EAAgB,EAAE,MAAA,EAAQ,IAAA,CAAK,QAAQ,CAAA;AAAA,EACxE;AACF","file":"referral.js","sourcesContent":["import type { HttpClient } from \"../http.js\";\n\n/**\n * Referral resource — `client.referral.*`.\n *\n * For the people allowed to invite: their referral code, the link to\n * share, the people who signed up with it (no names or contacts, only\n * when they joined and how far they got) and what each reward was for.\n * Referral codes are given by invitation, so `code` is `null` for most\n * users. Rewards are bonuses, a discount on our services, not money.\n *\n * Mirrors `GET /me/referral`.\n */\n\n/** Someone the user invited, without anything that identifies them. */\nexport interface InvitedFriend {\n joined_at: string;\n /** Bonuses they brought so far, decimal string. */\n rewarded: string;\n has_card: boolean;\n has_topped_up: boolean;\n}\n\n/** One reward. */\nexport interface ReferralReward {\n id: string;\n /** `signup`, `card_issuance`, `first_deposit` or `deposit`. */\n event: \"signup\" | \"card_issuance\" | \"first_deposit\" | \"deposit\" | (string & {});\n /** The friend's operation a percent was taken of. */\n basis_amount: string | null;\n basis_currency: string | null;\n /** Bonuses, decimal string. */\n units: string;\n /** Always `bonus`. */\n payout_kind: string;\n /** `pending` until the bonuses are on the account. */\n status: \"pending\" | \"credited\" | (string & {});\n created_at: string;\n}\n\nexport interface Referral {\n code: string | null;\n /** The invitation link, or `null` when the deployment has none: share the code then. */\n link: string | null;\n invited_count: number;\n /** The latest invited, newest first. */\n invited: InvitedFriend[];\n /** Bonuses earned in total, decimal string. */\n total_rewarded: string;\n rewards: ReferralReward[];\n}\n\nexport class ReferralResource {\n constructor(private readonly http: HttpClient) {}\n\n /** The user's referral code, link, invited friends and rewards. */\n async get(opts: { signal?: AbortSignal } = {}): Promise<Referral> {\n return this.http.get<Referral>(\"/me/referral\", { signal: opts.signal });\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { H as HttpClient } from '../http-B-OQwMYn.cjs';
1
+ import { H as HttpClient } from '../http-DeANAoTs.cjs';
2
2
 
3
3
  /**
4
4
  * Sessions resource — `client.sessions.*`.
@@ -1,4 +1,4 @@
1
- import { H as HttpClient } from '../http-B-OQwMYn.js';
1
+ import { H as HttpClient } from '../http-DeANAoTs.js';
2
2
 
3
3
  /**
4
4
  * Sessions resource — `client.sessions.*`.
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ // src/resources/subscription.ts
4
+ var SubscriptionResource = class {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ /** The user's subscription, or `null` when there is none. */
9
+ async get(opts = {}) {
10
+ return this.http.get("/me/subscription", { signal: opts.signal });
11
+ }
12
+ /**
13
+ * Charge the monthly fee with a promo code, as long as the code allows.
14
+ * `null` removes it. A code that can't be used on the fee fails with 400
15
+ * `promo_code_*`; no paid subscription running → 404.
16
+ */
17
+ async setPromoCode(code) {
18
+ return this.http.put("/me/subscription/promo-code", { body: { code } });
19
+ }
20
+ };
21
+
22
+ exports.SubscriptionResource = SubscriptionResource;
23
+ //# sourceMappingURL=subscription.cjs.map
24
+ //# sourceMappingURL=subscription.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/resources/subscription.ts"],"names":[],"mappings":";;;AAkCO,IAAM,uBAAN,MAA2B;AAAA,EAChC,YAA6B,IAAA,EAAkB;AAAlB,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAAA,EAAmB;AAAA;AAAA,EAGhD,MAAM,GAAA,CAAI,IAAA,GAAiC,EAAC,EAAqC;AAC/E,IAAA,OAAO,IAAA,CAAK,KAAK,GAAA,CAA6B,kBAAA,EAAoB,EAAE,MAAA,EAAQ,IAAA,CAAK,QAAQ,CAAA;AAAA,EAC3F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,aAAa,IAAA,EAAgD;AACjE,IAAA,OAAO,IAAA,CAAK,KAAK,GAAA,CAAsB,6BAAA,EAA+B,EAAE,IAAA,EAAM,EAAE,IAAA,EAAK,EAAG,CAAA;AAAA,EAC1F;AACF","file":"subscription.cjs","sourcesContent":["import type { HttpClient } from \"../http.js\";\n\n/**\n * Subscription resource — `client.subscription.*`.\n *\n * The user's own paid tier or gift: the discounts it gives and, for a\n * gift, when it ends. Not to be confused with `client.subscriptions`, which\n * is about announcement channels.\n *\n * Mirrors `GET /me/subscription` and `PUT /me/subscription/promo-code`.\n */\n\nexport interface UserSubscription {\n id: string;\n tier_id: string;\n tier_name: string;\n /** `active`, `tryout`, `grace`, `cancelled` or `expired`. */\n status: string;\n /** `billing` (charged monthly) or `gift` (never charged). */\n kind: \"billing\" | \"gift\" | (string & {});\n /** For a gift: when it ends; `null` = no end date. */\n gift_until: string | null;\n monthly_fee: string;\n currency: string;\n /** Discount on card prices, basis points. */\n issuance_discount_bps: number;\n /** Discount on the top-up commission, basis points. */\n funding_discount_bps: number;\n started_at: string;\n current_period_end: string | null;\n /** The promo code the monthly fee is charged with, if any. */\n promo_code_id: string | null;\n}\n\nexport class SubscriptionResource {\n constructor(private readonly http: HttpClient) {}\n\n /** The user's subscription, or `null` when there is none. */\n async get(opts: { signal?: AbortSignal } = {}): Promise<UserSubscription | null> {\n return this.http.get<UserSubscription | null>(\"/me/subscription\", { signal: opts.signal });\n }\n\n /**\n * Charge the monthly fee with a promo code, as long as the code allows.\n * `null` removes it. A code that can't be used on the fee fails with 400\n * `promo_code_*`; no paid subscription running → 404.\n */\n async setPromoCode(code: string | null): Promise<UserSubscription> {\n return this.http.put<UserSubscription>(\"/me/subscription/promo-code\", { body: { code } });\n }\n}\n"]}
@@ -0,0 +1,48 @@
1
+ import { H as HttpClient } from '../http-DeANAoTs.cjs';
2
+
3
+ /**
4
+ * Subscription resource — `client.subscription.*`.
5
+ *
6
+ * The user's own paid tier or gift: the discounts it gives and, for a
7
+ * gift, when it ends. Not to be confused with `client.subscriptions`, which
8
+ * is about announcement channels.
9
+ *
10
+ * Mirrors `GET /me/subscription` and `PUT /me/subscription/promo-code`.
11
+ */
12
+ interface UserSubscription {
13
+ id: string;
14
+ tier_id: string;
15
+ tier_name: string;
16
+ /** `active`, `tryout`, `grace`, `cancelled` or `expired`. */
17
+ status: string;
18
+ /** `billing` (charged monthly) or `gift` (never charged). */
19
+ kind: "billing" | "gift" | (string & {});
20
+ /** For a gift: when it ends; `null` = no end date. */
21
+ gift_until: string | null;
22
+ monthly_fee: string;
23
+ currency: string;
24
+ /** Discount on card prices, basis points. */
25
+ issuance_discount_bps: number;
26
+ /** Discount on the top-up commission, basis points. */
27
+ funding_discount_bps: number;
28
+ started_at: string;
29
+ current_period_end: string | null;
30
+ /** The promo code the monthly fee is charged with, if any. */
31
+ promo_code_id: string | null;
32
+ }
33
+ declare class SubscriptionResource {
34
+ private readonly http;
35
+ constructor(http: HttpClient);
36
+ /** The user's subscription, or `null` when there is none. */
37
+ get(opts?: {
38
+ signal?: AbortSignal;
39
+ }): Promise<UserSubscription | null>;
40
+ /**
41
+ * Charge the monthly fee with a promo code, as long as the code allows.
42
+ * `null` removes it. A code that can't be used on the fee fails with 400
43
+ * `promo_code_*`; no paid subscription running → 404.
44
+ */
45
+ setPromoCode(code: string | null): Promise<UserSubscription>;
46
+ }
47
+
48
+ export { SubscriptionResource, type UserSubscription };
@@ -0,0 +1,48 @@
1
+ import { H as HttpClient } from '../http-DeANAoTs.js';
2
+
3
+ /**
4
+ * Subscription resource — `client.subscription.*`.
5
+ *
6
+ * The user's own paid tier or gift: the discounts it gives and, for a
7
+ * gift, when it ends. Not to be confused with `client.subscriptions`, which
8
+ * is about announcement channels.
9
+ *
10
+ * Mirrors `GET /me/subscription` and `PUT /me/subscription/promo-code`.
11
+ */
12
+ interface UserSubscription {
13
+ id: string;
14
+ tier_id: string;
15
+ tier_name: string;
16
+ /** `active`, `tryout`, `grace`, `cancelled` or `expired`. */
17
+ status: string;
18
+ /** `billing` (charged monthly) or `gift` (never charged). */
19
+ kind: "billing" | "gift" | (string & {});
20
+ /** For a gift: when it ends; `null` = no end date. */
21
+ gift_until: string | null;
22
+ monthly_fee: string;
23
+ currency: string;
24
+ /** Discount on card prices, basis points. */
25
+ issuance_discount_bps: number;
26
+ /** Discount on the top-up commission, basis points. */
27
+ funding_discount_bps: number;
28
+ started_at: string;
29
+ current_period_end: string | null;
30
+ /** The promo code the monthly fee is charged with, if any. */
31
+ promo_code_id: string | null;
32
+ }
33
+ declare class SubscriptionResource {
34
+ private readonly http;
35
+ constructor(http: HttpClient);
36
+ /** The user's subscription, or `null` when there is none. */
37
+ get(opts?: {
38
+ signal?: AbortSignal;
39
+ }): Promise<UserSubscription | null>;
40
+ /**
41
+ * Charge the monthly fee with a promo code, as long as the code allows.
42
+ * `null` removes it. A code that can't be used on the fee fails with 400
43
+ * `promo_code_*`; no paid subscription running → 404.
44
+ */
45
+ setPromoCode(code: string | null): Promise<UserSubscription>;
46
+ }
47
+
48
+ export { SubscriptionResource, type UserSubscription };
@@ -0,0 +1,22 @@
1
+ // src/resources/subscription.ts
2
+ var SubscriptionResource = class {
3
+ constructor(http) {
4
+ this.http = http;
5
+ }
6
+ /** The user's subscription, or `null` when there is none. */
7
+ async get(opts = {}) {
8
+ return this.http.get("/me/subscription", { signal: opts.signal });
9
+ }
10
+ /**
11
+ * Charge the monthly fee with a promo code, as long as the code allows.
12
+ * `null` removes it. A code that can't be used on the fee fails with 400
13
+ * `promo_code_*`; no paid subscription running → 404.
14
+ */
15
+ async setPromoCode(code) {
16
+ return this.http.put("/me/subscription/promo-code", { body: { code } });
17
+ }
18
+ };
19
+
20
+ export { SubscriptionResource };
21
+ //# sourceMappingURL=subscription.js.map
22
+ //# sourceMappingURL=subscription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/resources/subscription.ts"],"names":[],"mappings":";AAkCO,IAAM,uBAAN,MAA2B;AAAA,EAChC,YAA6B,IAAA,EAAkB;AAAlB,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAAA,EAAmB;AAAA;AAAA,EAGhD,MAAM,GAAA,CAAI,IAAA,GAAiC,EAAC,EAAqC;AAC/E,IAAA,OAAO,IAAA,CAAK,KAAK,GAAA,CAA6B,kBAAA,EAAoB,EAAE,MAAA,EAAQ,IAAA,CAAK,QAAQ,CAAA;AAAA,EAC3F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,aAAa,IAAA,EAAgD;AACjE,IAAA,OAAO,IAAA,CAAK,KAAK,GAAA,CAAsB,6BAAA,EAA+B,EAAE,IAAA,EAAM,EAAE,IAAA,EAAK,EAAG,CAAA;AAAA,EAC1F;AACF","file":"subscription.js","sourcesContent":["import type { HttpClient } from \"../http.js\";\n\n/**\n * Subscription resource — `client.subscription.*`.\n *\n * The user's own paid tier or gift: the discounts it gives and, for a\n * gift, when it ends. Not to be confused with `client.subscriptions`, which\n * is about announcement channels.\n *\n * Mirrors `GET /me/subscription` and `PUT /me/subscription/promo-code`.\n */\n\nexport interface UserSubscription {\n id: string;\n tier_id: string;\n tier_name: string;\n /** `active`, `tryout`, `grace`, `cancelled` or `expired`. */\n status: string;\n /** `billing` (charged monthly) or `gift` (never charged). */\n kind: \"billing\" | \"gift\" | (string & {});\n /** For a gift: when it ends; `null` = no end date. */\n gift_until: string | null;\n monthly_fee: string;\n currency: string;\n /** Discount on card prices, basis points. */\n issuance_discount_bps: number;\n /** Discount on the top-up commission, basis points. */\n funding_discount_bps: number;\n started_at: string;\n current_period_end: string | null;\n /** The promo code the monthly fee is charged with, if any. */\n promo_code_id: string | null;\n}\n\nexport class SubscriptionResource {\n constructor(private readonly http: HttpClient) {}\n\n /** The user's subscription, or `null` when there is none. */\n async get(opts: { signal?: AbortSignal } = {}): Promise<UserSubscription | null> {\n return this.http.get<UserSubscription | null>(\"/me/subscription\", { signal: opts.signal });\n }\n\n /**\n * Charge the monthly fee with a promo code, as long as the code allows.\n * `null` removes it. A code that can't be used on the fee fails with 400\n * `promo_code_*`; no paid subscription running → 404.\n */\n async setPromoCode(code: string | null): Promise<UserSubscription> {\n return this.http.put<UserSubscription>(\"/me/subscription/promo-code\", { body: { code } });\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { H as HttpClient } from '../http-B-OQwMYn.cjs';
1
+ import { H as HttpClient } from '../http-DeANAoTs.cjs';
2
2
 
3
3
  /**
4
4
  * Subscriptions resource — `client.subscriptions.*`.
@@ -1,4 +1,4 @@
1
- import { H as HttpClient } from '../http-B-OQwMYn.js';
1
+ import { H as HttpClient } from '../http-DeANAoTs.js';
2
2
 
3
3
  /**
4
4
  * Subscriptions resource — `client.subscriptions.*`.
@@ -1,4 +1,4 @@
1
- import { H as HttpClient } from '../http-B-OQwMYn.cjs';
1
+ import { H as HttpClient } from '../http-DeANAoTs.cjs';
2
2
 
3
3
  /**
4
4
  * Wallet resource — `client.wallet.*`.
@@ -1,4 +1,4 @@
1
- import { H as HttpClient } from '../http-B-OQwMYn.js';
1
+ import { H as HttpClient } from '../http-DeANAoTs.js';
2
2
 
3
3
  /**
4
4
  * Wallet resource — `client.wallet.*`.