@takeal/cusfront-sdk 0.3.20 → 0.6.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.
- package/CHANGELOG.md +137 -2
- package/README.md +407 -8
- package/dist/analytics.cjs +438 -0
- package/dist/analytics.cjs.map +1 -0
- package/dist/analytics.d.cts +129 -0
- package/dist/analytics.d.ts +129 -0
- package/dist/analytics.js +424 -0
- package/dist/analytics.js.map +1 -0
- package/dist/cards-B_aNY35J.d.cts +514 -0
- package/dist/cards-Ba1wZttb.d.ts +514 -0
- package/dist/deposits-BEc8U80M.d.cts +310 -0
- package/dist/deposits-DScyT_D9.d.ts +310 -0
- package/dist/{devices-DP_hxwmW.d.ts → devices-B_YveTl9.d.ts} +1 -1
- package/dist/{devices-C3JHi2Hi.d.cts → devices-a5Z45Mx_.d.cts} +1 -1
- package/dist/{http-B-OQwMYn.d.cts → http-DeANAoTs.d.cts} +11 -3
- package/dist/{http-B-OQwMYn.d.ts → http-DeANAoTs.d.ts} +11 -3
- package/dist/index.cjs +978 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +101 -13
- package/dist/index.d.ts +101 -13
- package/dist/index.js +963 -102
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +2 -8
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +12 -5
- package/dist/react/index.d.ts +12 -5
- package/dist/react/index.js +2 -8
- package/dist/react/index.js.map +1 -1
- package/dist/resources/attribution.cjs +82 -0
- package/dist/resources/attribution.cjs.map +1 -0
- package/dist/resources/attribution.d.cts +100 -0
- package/dist/resources/attribution.d.ts +100 -0
- package/dist/resources/attribution.js +78 -0
- package/dist/resources/attribution.js.map +1 -0
- package/dist/resources/auth.cjs +81 -15
- package/dist/resources/auth.cjs.map +1 -1
- package/dist/resources/auth.d.cts +53 -6
- package/dist/resources/auth.d.ts +53 -6
- package/dist/resources/auth.js +81 -15
- package/dist/resources/auth.js.map +1 -1
- package/dist/resources/balance.d.cts +1 -1
- package/dist/resources/balance.d.ts +1 -1
- package/dist/resources/blog.cjs.map +1 -1
- package/dist/resources/blog.d.cts +8 -1
- package/dist/resources/blog.d.ts +8 -1
- package/dist/resources/blog.js.map +1 -1
- package/dist/resources/bonus.cjs +28 -0
- package/dist/resources/bonus.cjs.map +1 -0
- package/dist/resources/bonus.d.cts +121 -0
- package/dist/resources/bonus.d.ts +121 -0
- package/dist/resources/bonus.js +26 -0
- package/dist/resources/bonus.js.map +1 -0
- package/dist/resources/branding.d.cts +1 -1
- package/dist/resources/branding.d.ts +1 -1
- package/dist/resources/cards.cjs +55 -28
- package/dist/resources/cards.cjs.map +1 -1
- package/dist/resources/cards.d.cts +2 -347
- package/dist/resources/cards.d.ts +2 -347
- package/dist/resources/cards.js +55 -29
- package/dist/resources/cards.js.map +1 -1
- package/dist/resources/codes.cjs +20 -0
- package/dist/resources/codes.cjs.map +1 -0
- package/dist/resources/codes.d.cts +100 -0
- package/dist/resources/codes.d.ts +100 -0
- package/dist/resources/codes.js +18 -0
- package/dist/resources/codes.js.map +1 -0
- package/dist/resources/deposits.cjs +32 -7
- package/dist/resources/deposits.cjs.map +1 -1
- package/dist/resources/deposits.d.cts +3 -176
- package/dist/resources/deposits.d.ts +3 -176
- package/dist/resources/deposits.js +32 -7
- package/dist/resources/deposits.js.map +1 -1
- package/dist/resources/devices.cjs +3 -1
- package/dist/resources/devices.cjs.map +1 -1
- package/dist/resources/devices.d.cts +2 -2
- package/dist/resources/devices.d.ts +2 -2
- package/dist/resources/devices.js +3 -1
- package/dist/resources/devices.js.map +1 -1
- package/dist/resources/documents.cjs +66 -0
- package/dist/resources/documents.cjs.map +1 -0
- package/dist/resources/documents.d.cts +212 -0
- package/dist/resources/documents.d.ts +212 -0
- package/dist/resources/documents.js +64 -0
- package/dist/resources/documents.js.map +1 -0
- package/dist/resources/funding-options.cjs +16 -0
- package/dist/resources/funding-options.cjs.map +1 -0
- package/dist/resources/funding-options.d.cts +3 -0
- package/dist/resources/funding-options.d.ts +3 -0
- package/dist/resources/funding-options.js +14 -0
- package/dist/resources/funding-options.js.map +1 -0
- package/dist/resources/history.cjs +33 -0
- package/dist/resources/history.cjs.map +1 -0
- package/dist/resources/history.d.cts +95 -0
- package/dist/resources/history.d.ts +95 -0
- package/dist/resources/history.js +31 -0
- package/dist/resources/history.js.map +1 -0
- package/dist/resources/me.d.cts +3 -1
- package/dist/resources/me.d.ts +3 -1
- package/dist/resources/notifications.d.cts +1 -1
- package/dist/resources/notifications.d.ts +1 -1
- package/dist/resources/push.cjs +3 -1
- package/dist/resources/push.cjs.map +1 -1
- package/dist/resources/push.d.cts +1 -1
- package/dist/resources/push.d.ts +1 -1
- package/dist/resources/push.js +3 -1
- package/dist/resources/push.js.map +1 -1
- package/dist/resources/referral.cjs +16 -0
- package/dist/resources/referral.cjs.map +1 -0
- package/dist/resources/referral.d.cts +58 -0
- package/dist/resources/referral.d.ts +58 -0
- package/dist/resources/referral.js +14 -0
- package/dist/resources/referral.js.map +1 -0
- package/dist/resources/sessions.d.cts +1 -1
- package/dist/resources/sessions.d.ts +1 -1
- package/dist/resources/subscription.cjs +24 -0
- package/dist/resources/subscription.cjs.map +1 -0
- package/dist/resources/subscription.d.cts +48 -0
- package/dist/resources/subscription.d.ts +48 -0
- package/dist/resources/subscription.js +22 -0
- package/dist/resources/subscription.js.map +1 -0
- package/dist/resources/subscriptions.d.cts +1 -1
- package/dist/resources/subscriptions.d.ts +1 -1
- package/dist/resources/wallet.d.cts +1 -1
- package/dist/resources/wallet.d.ts +1 -1
- package/dist/telegram.cjs +495 -111
- package/dist/telegram.cjs.map +1 -1
- package/dist/telegram.d.cts +12 -5
- package/dist/telegram.d.ts +12 -5
- package/dist/telegram.js +495 -111
- package/dist/telegram.js.map +1 -1
- package/package.json +57 -5
- package/dist/customer-CoxPwe5o.d.cts +0 -32
- package/dist/customer-CoxPwe5o.d.ts +0 -32
|
@@ -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"]}
|