@takeal/cusfront-sdk 0.6.1 → 0.6.3

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 (55) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +87 -0
  3. package/dist/{cards-CF3-He2x.d.ts → cards-BrqeBqLV.d.ts} +442 -1
  4. package/dist/{cards-qfHz6xZY.d.cts → cards-ofoGRU9v.d.cts} +442 -1
  5. package/dist/index.cjs +329 -205
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +14 -8
  8. package/dist/index.d.ts +14 -8
  9. package/dist/index.js +329 -205
  10. package/dist/index.js.map +1 -1
  11. package/dist/react/index.d.cts +3 -2
  12. package/dist/react/index.d.ts +3 -2
  13. package/dist/resources/auth.cjs +48 -5
  14. package/dist/resources/auth.cjs.map +1 -1
  15. package/dist/resources/auth.d.cts +53 -7
  16. package/dist/resources/auth.d.ts +53 -7
  17. package/dist/resources/auth.js +48 -5
  18. package/dist/resources/auth.js.map +1 -1
  19. package/dist/resources/cards.cjs +36 -0
  20. package/dist/resources/cards.cjs.map +1 -1
  21. package/dist/resources/cards.d.cts +2 -1
  22. package/dist/resources/cards.d.ts +2 -1
  23. package/dist/resources/cards.js +36 -1
  24. package/dist/resources/cards.js.map +1 -1
  25. package/dist/resources/consents.cjs +91 -0
  26. package/dist/resources/consents.cjs.map +1 -0
  27. package/dist/resources/consents.d.cts +83 -0
  28. package/dist/resources/consents.d.ts +83 -0
  29. package/dist/resources/consents.js +89 -0
  30. package/dist/resources/consents.js.map +1 -0
  31. package/dist/resources/deposits.cjs +2 -0
  32. package/dist/resources/deposits.cjs.map +1 -1
  33. package/dist/resources/deposits.d.cts +2 -2
  34. package/dist/resources/deposits.d.ts +2 -2
  35. package/dist/resources/deposits.js +2 -0
  36. package/dist/resources/deposits.js.map +1 -1
  37. package/dist/resources/funding-options.d.cts +2 -2
  38. package/dist/resources/funding-options.d.ts +2 -2
  39. package/dist/resources/me.d.cts +2 -0
  40. package/dist/resources/me.d.ts +2 -0
  41. package/dist/resources/receipts.cjs +22 -0
  42. package/dist/resources/receipts.cjs.map +1 -0
  43. package/dist/resources/receipts.d.cts +51 -0
  44. package/dist/resources/receipts.d.ts +51 -0
  45. package/dist/resources/receipts.js +20 -0
  46. package/dist/resources/receipts.js.map +1 -0
  47. package/dist/telegram.cjs +367 -205
  48. package/dist/telegram.cjs.map +1 -1
  49. package/dist/telegram.d.cts +3 -2
  50. package/dist/telegram.d.ts +3 -2
  51. package/dist/telegram.js +367 -205
  52. package/dist/telegram.js.map +1 -1
  53. package/package.json +11 -1
  54. package/dist/deposits-B2LBe2k1.d.ts +0 -373
  55. package/dist/deposits-ZjT_btgi.d.cts +0 -373
@@ -1,7 +1,9 @@
1
1
  import { H as HttpClient } from '../http-DeANAoTs.cjs';
2
2
  import { User } from './auth.cjs';
3
+ import './consents.cjs';
3
4
  import './attribution.cjs';
4
5
  import './codes.cjs';
6
+ import '../cards-ofoGRU9v.cjs';
5
7
 
6
8
  /**
7
9
  * Me resource — `client.me.*`.
@@ -1,7 +1,9 @@
1
1
  import { H as HttpClient } from '../http-DeANAoTs.js';
2
2
  import { User } from './auth.js';
3
+ import './consents.js';
3
4
  import './attribution.js';
4
5
  import './codes.js';
6
+ import '../cards-BrqeBqLV.js';
5
7
 
6
8
  /**
7
9
  * Me resource — `client.me.*`.
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ // src/resources/receipts.ts
4
+ var ReceiptsResource = class {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ async list(params = {}) {
9
+ const q = new URLSearchParams();
10
+ if (params.refId !== void 0) q.set("ref_id", params.refId);
11
+ if (params.limit !== void 0) q.set("limit", String(params.limit));
12
+ const qs = q.toString();
13
+ return this.http.get(`/me/receipts${qs ? `?${qs}` : ""}`);
14
+ }
15
+ async get(id) {
16
+ return this.http.get(`/me/receipts/${encodeURIComponent(id)}`);
17
+ }
18
+ };
19
+
20
+ exports.ReceiptsResource = ReceiptsResource;
21
+ //# sourceMappingURL=receipts.cjs.map
22
+ //# sourceMappingURL=receipts.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/resources/receipts.ts"],"names":[],"mappings":";;;AA+CO,IAAM,mBAAN,MAAuB;AAAA,EAC5B,YAA6B,IAAA,EAAkB;AAAlB,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAAA,EAAmB;AAAA,EAEhD,MAAM,IAAA,CAAK,MAAA,GAA6B,EAAC,EAAuB;AAC9D,IAAA,MAAM,CAAA,GAAI,IAAI,eAAA,EAAgB;AAC9B,IAAA,IAAI,OAAO,KAAA,KAAU,MAAA,IAAa,GAAA,CAAI,QAAA,EAAU,OAAO,KAAK,CAAA;AAC5D,IAAA,IAAI,MAAA,CAAO,UAAU,MAAA,EAAW,CAAA,CAAE,IAAI,OAAA,EAAS,MAAA,CAAO,MAAA,CAAO,KAAK,CAAC,CAAA;AACnE,IAAA,MAAM,EAAA,GAAK,EAAE,QAAA,EAAS;AACtB,IAAA,OAAO,IAAA,CAAK,KAAK,GAAA,CAAe,CAAA,YAAA,EAAe,KAAK,CAAA,CAAA,EAAI,EAAE,CAAA,CAAA,GAAK,EAAE,CAAA,CAAE,CAAA;AAAA,EACrE;AAAA,EAEA,MAAM,IAAI,EAAA,EAA8B;AACtC,IAAA,OAAO,KAAK,IAAA,CAAK,GAAA,CAAa,gBAAgB,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAE,CAAA;AAAA,EACxE;AACF","file":"receipts.cjs","sourcesContent":["import type { HttpClient } from \"../http.js\";\n\n/**\n * Receipts resource — `client.receipts.*`: one numbered receipt for every\n * payment: a wallet top-up, a card top-up and a card's issue price.\n *\n * ```ts\n * const all = await client.receipts.list();\n * const [forDeposit] = await client.receipts.list({ refId: deposit.id });\n * const one = await client.receipts.get(id);\n * ```\n *\n * A receipt appears within a minute of the payment going through and is\n * mailed to the user at the same time. The rate on it is the one the money\n * was credited at; the platform's margin is not shown.\n */\n\nexport type ReceiptKind = \"wallet_deposit\" | \"card_topup\" | \"card_issue\" | (string & {});\n\nexport interface Receipt {\n id: string;\n /** Shown as `R-000123`. */\n number: string;\n kind: ReceiptKind;\n /** The deposit, card top-up or card the payment was for. */\n ref_id: string;\n paid_at: string;\n /** Decimal string. */\n paid_amount: string;\n paid_currency: string;\n /** `card`, `sbp`, `crypto`, `bank_transfer` or `wallet`. */\n method: string;\n credited_amount: string | null;\n credited_currency: string | null;\n /** What one unit of `credited_currency` cost in `paid_currency`; only when they differ. */\n rate: string | null;\n card_id: string | null;\n card_last4: string | null;\n}\n\nexport interface ListReceiptsParams {\n /** Only the receipt of this deposit, card top-up or card. */\n refId?: string;\n /** Newest first; default 50, at most 200. */\n limit?: number;\n}\n\nexport class ReceiptsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(params: ListReceiptsParams = {}): Promise<Receipt[]> {\n const q = new URLSearchParams();\n if (params.refId !== undefined) q.set(\"ref_id\", params.refId);\n if (params.limit !== undefined) q.set(\"limit\", String(params.limit));\n const qs = q.toString();\n return this.http.get<Receipt[]>(`/me/receipts${qs ? `?${qs}` : \"\"}`);\n }\n\n async get(id: string): Promise<Receipt> {\n return this.http.get<Receipt>(`/me/receipts/${encodeURIComponent(id)}`);\n }\n}\n"]}
@@ -0,0 +1,51 @@
1
+ import { H as HttpClient } from '../http-DeANAoTs.cjs';
2
+
3
+ /**
4
+ * Receipts resource — `client.receipts.*`: one numbered receipt for every
5
+ * payment: a wallet top-up, a card top-up and a card's issue price.
6
+ *
7
+ * ```ts
8
+ * const all = await client.receipts.list();
9
+ * const [forDeposit] = await client.receipts.list({ refId: deposit.id });
10
+ * const one = await client.receipts.get(id);
11
+ * ```
12
+ *
13
+ * A receipt appears within a minute of the payment going through and is
14
+ * mailed to the user at the same time. The rate on it is the one the money
15
+ * was credited at; the platform's margin is not shown.
16
+ */
17
+ type ReceiptKind = "wallet_deposit" | "card_topup" | "card_issue" | (string & {});
18
+ interface Receipt {
19
+ id: string;
20
+ /** Shown as `R-000123`. */
21
+ number: string;
22
+ kind: ReceiptKind;
23
+ /** The deposit, card top-up or card the payment was for. */
24
+ ref_id: string;
25
+ paid_at: string;
26
+ /** Decimal string. */
27
+ paid_amount: string;
28
+ paid_currency: string;
29
+ /** `card`, `sbp`, `crypto`, `bank_transfer` or `wallet`. */
30
+ method: string;
31
+ credited_amount: string | null;
32
+ credited_currency: string | null;
33
+ /** What one unit of `credited_currency` cost in `paid_currency`; only when they differ. */
34
+ rate: string | null;
35
+ card_id: string | null;
36
+ card_last4: string | null;
37
+ }
38
+ interface ListReceiptsParams {
39
+ /** Only the receipt of this deposit, card top-up or card. */
40
+ refId?: string;
41
+ /** Newest first; default 50, at most 200. */
42
+ limit?: number;
43
+ }
44
+ declare class ReceiptsResource {
45
+ private readonly http;
46
+ constructor(http: HttpClient);
47
+ list(params?: ListReceiptsParams): Promise<Receipt[]>;
48
+ get(id: string): Promise<Receipt>;
49
+ }
50
+
51
+ export { type ListReceiptsParams, type Receipt, type ReceiptKind, ReceiptsResource };
@@ -0,0 +1,51 @@
1
+ import { H as HttpClient } from '../http-DeANAoTs.js';
2
+
3
+ /**
4
+ * Receipts resource — `client.receipts.*`: one numbered receipt for every
5
+ * payment: a wallet top-up, a card top-up and a card's issue price.
6
+ *
7
+ * ```ts
8
+ * const all = await client.receipts.list();
9
+ * const [forDeposit] = await client.receipts.list({ refId: deposit.id });
10
+ * const one = await client.receipts.get(id);
11
+ * ```
12
+ *
13
+ * A receipt appears within a minute of the payment going through and is
14
+ * mailed to the user at the same time. The rate on it is the one the money
15
+ * was credited at; the platform's margin is not shown.
16
+ */
17
+ type ReceiptKind = "wallet_deposit" | "card_topup" | "card_issue" | (string & {});
18
+ interface Receipt {
19
+ id: string;
20
+ /** Shown as `R-000123`. */
21
+ number: string;
22
+ kind: ReceiptKind;
23
+ /** The deposit, card top-up or card the payment was for. */
24
+ ref_id: string;
25
+ paid_at: string;
26
+ /** Decimal string. */
27
+ paid_amount: string;
28
+ paid_currency: string;
29
+ /** `card`, `sbp`, `crypto`, `bank_transfer` or `wallet`. */
30
+ method: string;
31
+ credited_amount: string | null;
32
+ credited_currency: string | null;
33
+ /** What one unit of `credited_currency` cost in `paid_currency`; only when they differ. */
34
+ rate: string | null;
35
+ card_id: string | null;
36
+ card_last4: string | null;
37
+ }
38
+ interface ListReceiptsParams {
39
+ /** Only the receipt of this deposit, card top-up or card. */
40
+ refId?: string;
41
+ /** Newest first; default 50, at most 200. */
42
+ limit?: number;
43
+ }
44
+ declare class ReceiptsResource {
45
+ private readonly http;
46
+ constructor(http: HttpClient);
47
+ list(params?: ListReceiptsParams): Promise<Receipt[]>;
48
+ get(id: string): Promise<Receipt>;
49
+ }
50
+
51
+ export { type ListReceiptsParams, type Receipt, type ReceiptKind, ReceiptsResource };
@@ -0,0 +1,20 @@
1
+ // src/resources/receipts.ts
2
+ var ReceiptsResource = class {
3
+ constructor(http) {
4
+ this.http = http;
5
+ }
6
+ async list(params = {}) {
7
+ const q = new URLSearchParams();
8
+ if (params.refId !== void 0) q.set("ref_id", params.refId);
9
+ if (params.limit !== void 0) q.set("limit", String(params.limit));
10
+ const qs = q.toString();
11
+ return this.http.get(`/me/receipts${qs ? `?${qs}` : ""}`);
12
+ }
13
+ async get(id) {
14
+ return this.http.get(`/me/receipts/${encodeURIComponent(id)}`);
15
+ }
16
+ };
17
+
18
+ export { ReceiptsResource };
19
+ //# sourceMappingURL=receipts.js.map
20
+ //# sourceMappingURL=receipts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/resources/receipts.ts"],"names":[],"mappings":";AA+CO,IAAM,mBAAN,MAAuB;AAAA,EAC5B,YAA6B,IAAA,EAAkB;AAAlB,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAAA,EAAmB;AAAA,EAEhD,MAAM,IAAA,CAAK,MAAA,GAA6B,EAAC,EAAuB;AAC9D,IAAA,MAAM,CAAA,GAAI,IAAI,eAAA,EAAgB;AAC9B,IAAA,IAAI,OAAO,KAAA,KAAU,MAAA,IAAa,GAAA,CAAI,QAAA,EAAU,OAAO,KAAK,CAAA;AAC5D,IAAA,IAAI,MAAA,CAAO,UAAU,MAAA,EAAW,CAAA,CAAE,IAAI,OAAA,EAAS,MAAA,CAAO,MAAA,CAAO,KAAK,CAAC,CAAA;AACnE,IAAA,MAAM,EAAA,GAAK,EAAE,QAAA,EAAS;AACtB,IAAA,OAAO,IAAA,CAAK,KAAK,GAAA,CAAe,CAAA,YAAA,EAAe,KAAK,CAAA,CAAA,EAAI,EAAE,CAAA,CAAA,GAAK,EAAE,CAAA,CAAE,CAAA;AAAA,EACrE;AAAA,EAEA,MAAM,IAAI,EAAA,EAA8B;AACtC,IAAA,OAAO,KAAK,IAAA,CAAK,GAAA,CAAa,gBAAgB,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAE,CAAA;AAAA,EACxE;AACF","file":"receipts.js","sourcesContent":["import type { HttpClient } from \"../http.js\";\n\n/**\n * Receipts resource — `client.receipts.*`: one numbered receipt for every\n * payment: a wallet top-up, a card top-up and a card's issue price.\n *\n * ```ts\n * const all = await client.receipts.list();\n * const [forDeposit] = await client.receipts.list({ refId: deposit.id });\n * const one = await client.receipts.get(id);\n * ```\n *\n * A receipt appears within a minute of the payment going through and is\n * mailed to the user at the same time. The rate on it is the one the money\n * was credited at; the platform's margin is not shown.\n */\n\nexport type ReceiptKind = \"wallet_deposit\" | \"card_topup\" | \"card_issue\" | (string & {});\n\nexport interface Receipt {\n id: string;\n /** Shown as `R-000123`. */\n number: string;\n kind: ReceiptKind;\n /** The deposit, card top-up or card the payment was for. */\n ref_id: string;\n paid_at: string;\n /** Decimal string. */\n paid_amount: string;\n paid_currency: string;\n /** `card`, `sbp`, `crypto`, `bank_transfer` or `wallet`. */\n method: string;\n credited_amount: string | null;\n credited_currency: string | null;\n /** What one unit of `credited_currency` cost in `paid_currency`; only when they differ. */\n rate: string | null;\n card_id: string | null;\n card_last4: string | null;\n}\n\nexport interface ListReceiptsParams {\n /** Only the receipt of this deposit, card top-up or card. */\n refId?: string;\n /** Newest first; default 50, at most 200. */\n limit?: number;\n}\n\nexport class ReceiptsResource {\n constructor(private readonly http: HttpClient) {}\n\n async list(params: ListReceiptsParams = {}): Promise<Receipt[]> {\n const q = new URLSearchParams();\n if (params.refId !== undefined) q.set(\"ref_id\", params.refId);\n if (params.limit !== undefined) q.set(\"limit\", String(params.limit));\n const qs = q.toString();\n return this.http.get<Receipt[]>(`/me/receipts${qs ? `?${qs}` : \"\"}`);\n }\n\n async get(id: string): Promise<Receipt> {\n return this.http.get<Receipt>(`/me/receipts/${encodeURIComponent(id)}`);\n }\n}\n"]}