@takeal/cusfront-sdk 0.6.0 → 0.6.1
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 +39 -0
- package/README.md +166 -1
- package/dist/{cards-Ba1wZttb.d.ts → cards-CF3-He2x.d.ts} +144 -20
- package/dist/{cards-B_aNY35J.d.cts → cards-qfHz6xZY.d.cts} +144 -20
- package/dist/{deposits-DScyT_D9.d.ts → deposits-B2LBe2k1.d.ts} +71 -8
- package/dist/{deposits-BEc8U80M.d.cts → deposits-ZjT_btgi.d.cts} +71 -8
- package/dist/index.cjs +36 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +36 -9
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.cts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/resources/cards.cjs +30 -6
- package/dist/resources/cards.cjs.map +1 -1
- package/dist/resources/cards.d.cts +1 -1
- package/dist/resources/cards.d.ts +1 -1
- package/dist/resources/cards.js +30 -6
- package/dist/resources/cards.js.map +1 -1
- package/dist/resources/deposits.cjs +4 -1
- package/dist/resources/deposits.cjs.map +1 -1
- package/dist/resources/deposits.d.cts +2 -2
- package/dist/resources/deposits.d.ts +2 -2
- package/dist/resources/deposits.js +4 -1
- package/dist/resources/deposits.js.map +1 -1
- package/dist/resources/funding-options.cjs.map +1 -1
- package/dist/resources/funding-options.d.cts +2 -2
- package/dist/resources/funding-options.d.ts +2 -2
- package/dist/resources/funding-options.js.map +1 -1
- package/dist/telegram.cjs +36 -9
- package/dist/telegram.cjs.map +1 -1
- package/dist/telegram.d.cts +2 -2
- package/dist/telegram.d.ts +2 -2
- package/dist/telegram.js +36 -9
- package/dist/telegram.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,10 +2,10 @@ import { T as TokenStore, F as FetchLike } from './http-DeANAoTs.cjs';
|
|
|
2
2
|
export { d as defaultBrowserStore, i as inMemoryStore } from './http-DeANAoTs.cjs';
|
|
3
3
|
import { AuthResource } from './resources/auth.cjs';
|
|
4
4
|
export { ChangePasswordInput, ExchangeTelegramInput, JwtIssued, LinkTelegramInput, LoginInput, LoginResponse, OtpSentResponse, RegisterInput, Session, TelegramLink, TelegramUnknown, TotpRequired, TotpSetupComplete, TotpSetupRequired, User } from './resources/auth.cjs';
|
|
5
|
-
import { a as DepositsResource, F as FundingOptionsResource } from './deposits-
|
|
6
|
-
export { C as CardLoadStatus, b as CreateDepositRefundInput, c as CreateQuoteInput, D as Deposit, d as DepositMethod, e as DepositStatus, f as DepositTarget, g as
|
|
7
|
-
import { b as CardsResource } from './cards-
|
|
8
|
-
export { A as Address, B as BillingAddress, a as Card, c as CardBalance, d as CardDesignRef, C as CardProduct,
|
|
5
|
+
import { a as DepositsResource, F as FundingOptionsResource } from './deposits-ZjT_btgi.cjs';
|
|
6
|
+
export { C as CardLoadStatus, b as CreateDepositRefundInput, c as CreateQuoteInput, D as Deposit, d as DepositMethod, e as DepositStatus, f as DepositTarget, g as FeeKind, h as FunderMode, i as FundingOption, j as FundingQuote, I as InitiateDepositInput, k as IssueCardInput, M as MethodTerms, R as Refund } from './deposits-ZjT_btgi.cjs';
|
|
7
|
+
import { b as CardsResource } from './cards-qfHz6xZY.cjs';
|
|
8
|
+
export { A as Address, B as BillingAddress, a as Card, c as CardBalance, d as CardDesignRef, e as CardForm, C as CardProduct, f as CardProductPrice, g as CardStatus, h as CardStatusSource, i as CardTopUp, j as CardTopUpStatus, k as CardTransfer, l as CardType, m as Cardholder, n as CloseBlockedReason, o as CreateCardInput, p as CustomerInfo, I as IssuanceBonus, R as RevealCardInput, q as RevealedCard, S as SetPinInput, T as TopUpInput, r as TopUpResult, s as TopUpTerms, t as TransferInput, u as TransferResult, U as UpdateCardInput } from './cards-qfHz6xZY.cjs';
|
|
9
9
|
import { BalanceResource } from './resources/balance.cjs';
|
|
10
10
|
export { Balance } from './resources/balance.cjs';
|
|
11
11
|
import { BonusResource } from './resources/bonus.cjs';
|
|
@@ -71,7 +71,7 @@ interface BrandConfig {
|
|
|
71
71
|
* Which platform versions this SDK works with, as a semver range:
|
|
72
72
|
* comparators separated by ", ". Keep this the only definition.
|
|
73
73
|
*/
|
|
74
|
-
declare const SUPPORTED_MEISTER = ">=0.
|
|
74
|
+
declare const SUPPORTED_MEISTER = ">=0.6.4, <0.7.0";
|
|
75
75
|
/** What `client.ready()` returns. */
|
|
76
76
|
interface ReadyInfo {
|
|
77
77
|
/** `true` when the platform reported a version inside `supportedMeister`. */
|
|
@@ -177,7 +177,7 @@ declare function isNetworkError(e: unknown): e is NetworkError;
|
|
|
177
177
|
* `define`. `src/version.test.ts` checks it matches `package.json`, so a
|
|
178
178
|
* release bump that forgets this file fails the test run.
|
|
179
179
|
*/
|
|
180
|
-
declare const SDK_VERSION = "0.6.
|
|
180
|
+
declare const SDK_VERSION = "0.6.1";
|
|
181
181
|
|
|
182
182
|
/**
|
|
183
183
|
* `@takeal/cusfront-sdk` — typed client for the Takeal end-user API.
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { T as TokenStore, F as FetchLike } from './http-DeANAoTs.js';
|
|
|
2
2
|
export { d as defaultBrowserStore, i as inMemoryStore } from './http-DeANAoTs.js';
|
|
3
3
|
import { AuthResource } from './resources/auth.js';
|
|
4
4
|
export { ChangePasswordInput, ExchangeTelegramInput, JwtIssued, LinkTelegramInput, LoginInput, LoginResponse, OtpSentResponse, RegisterInput, Session, TelegramLink, TelegramUnknown, TotpRequired, TotpSetupComplete, TotpSetupRequired, User } from './resources/auth.js';
|
|
5
|
-
import { a as DepositsResource, F as FundingOptionsResource } from './deposits-
|
|
6
|
-
export { C as CardLoadStatus, b as CreateDepositRefundInput, c as CreateQuoteInput, D as Deposit, d as DepositMethod, e as DepositStatus, f as DepositTarget, g as
|
|
7
|
-
import { b as CardsResource } from './cards-
|
|
8
|
-
export { A as Address, B as BillingAddress, a as Card, c as CardBalance, d as CardDesignRef, C as CardProduct,
|
|
5
|
+
import { a as DepositsResource, F as FundingOptionsResource } from './deposits-B2LBe2k1.js';
|
|
6
|
+
export { C as CardLoadStatus, b as CreateDepositRefundInput, c as CreateQuoteInput, D as Deposit, d as DepositMethod, e as DepositStatus, f as DepositTarget, g as FeeKind, h as FunderMode, i as FundingOption, j as FundingQuote, I as InitiateDepositInput, k as IssueCardInput, M as MethodTerms, R as Refund } from './deposits-B2LBe2k1.js';
|
|
7
|
+
import { b as CardsResource } from './cards-CF3-He2x.js';
|
|
8
|
+
export { A as Address, B as BillingAddress, a as Card, c as CardBalance, d as CardDesignRef, e as CardForm, C as CardProduct, f as CardProductPrice, g as CardStatus, h as CardStatusSource, i as CardTopUp, j as CardTopUpStatus, k as CardTransfer, l as CardType, m as Cardholder, n as CloseBlockedReason, o as CreateCardInput, p as CustomerInfo, I as IssuanceBonus, R as RevealCardInput, q as RevealedCard, S as SetPinInput, T as TopUpInput, r as TopUpResult, s as TopUpTerms, t as TransferInput, u as TransferResult, U as UpdateCardInput } from './cards-CF3-He2x.js';
|
|
9
9
|
import { BalanceResource } from './resources/balance.js';
|
|
10
10
|
export { Balance } from './resources/balance.js';
|
|
11
11
|
import { BonusResource } from './resources/bonus.js';
|
|
@@ -71,7 +71,7 @@ interface BrandConfig {
|
|
|
71
71
|
* Which platform versions this SDK works with, as a semver range:
|
|
72
72
|
* comparators separated by ", ". Keep this the only definition.
|
|
73
73
|
*/
|
|
74
|
-
declare const SUPPORTED_MEISTER = ">=0.
|
|
74
|
+
declare const SUPPORTED_MEISTER = ">=0.6.4, <0.7.0";
|
|
75
75
|
/** What `client.ready()` returns. */
|
|
76
76
|
interface ReadyInfo {
|
|
77
77
|
/** `true` when the platform reported a version inside `supportedMeister`. */
|
|
@@ -177,7 +177,7 @@ declare function isNetworkError(e: unknown): e is NetworkError;
|
|
|
177
177
|
* `define`. `src/version.test.ts` checks it matches `package.json`, so a
|
|
178
178
|
* release bump that forgets this file fails the test run.
|
|
179
179
|
*/
|
|
180
|
-
declare const SDK_VERSION = "0.6.
|
|
180
|
+
declare const SDK_VERSION = "0.6.1";
|
|
181
181
|
|
|
182
182
|
/**
|
|
183
183
|
* `@takeal/cusfront-sdk` — typed client for the Takeal end-user API.
|
package/dist/index.js
CHANGED
|
@@ -474,9 +474,11 @@ var CardsResource = class {
|
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
476
|
/**
|
|
477
|
-
* Freeze the caller's own card. Reversible via {@link unfreeze}
|
|
478
|
-
* `
|
|
479
|
-
*
|
|
477
|
+
* Freeze the caller's own card. Reversible via {@link unfreeze} while
|
|
478
|
+
* `status_source` is `holder` or `operator`. The optional `reason` is
|
|
479
|
+
* recorded on the audit trail. Resolves to the updated card. 404 if the
|
|
480
|
+
* card isn't the caller's; 409 `card_locked` when support holds it; 501 if
|
|
481
|
+
* the issuer can't freeze.
|
|
480
482
|
*/
|
|
481
483
|
async freeze(id, reason) {
|
|
482
484
|
return this.http.post(`/me/cards/${encodeURIComponent(id)}/freeze`, { body: { reason } });
|
|
@@ -491,16 +493,38 @@ var CardsResource = class {
|
|
|
491
493
|
* keep the result in volatile memory only, never write it to
|
|
492
494
|
* localStorage / logs, and clear it within `expires_in_seconds`.
|
|
493
495
|
*
|
|
494
|
-
*
|
|
495
|
-
*
|
|
496
|
+
* The result is the numbers, or `reveal_url` with empty `pan` and `cvv`
|
|
497
|
+
* when the issuer shows them on a page of its own: open that page in a
|
|
498
|
+
* frame right away, it is short-lived.
|
|
499
|
+
*
|
|
500
|
+
* 403 not your card · 409 `card_locked` · 429 rate-limited · 501 connector
|
|
501
|
+
* has no sensitive-data endpoint · 503 `provider_unavailable`.
|
|
496
502
|
*/
|
|
497
503
|
async reveal(id, _input) {
|
|
498
504
|
return this.http.post(`/me/cards/${encodeURIComponent(id)}/reveal`);
|
|
499
505
|
}
|
|
500
|
-
/**
|
|
506
|
+
/**
|
|
507
|
+
* Unfreeze a previously-frozen card. Idempotent on an already-active card.
|
|
508
|
+
* A card the issuer froze (`status_source: "provider"`) is not the
|
|
509
|
+
* holder's to unfreeze: the API answers 409 `card_locked`, so hide the
|
|
510
|
+
* button and say the freeze is lifted through the issuer's support.
|
|
511
|
+
*/
|
|
501
512
|
async unfreeze(id) {
|
|
502
513
|
return this.http.post(`/me/cards/${encodeURIComponent(id)}/unfreeze`, { body: {} });
|
|
503
514
|
}
|
|
515
|
+
/**
|
|
516
|
+
* Set the PIN of the caller's own physical card. The session is enough; the
|
|
517
|
+
* call is rate-limited like {@link reveal} and the PIN is kept nowhere.
|
|
518
|
+
* Resolves to the card; the user also gets a notification that the PIN
|
|
519
|
+
* was set. 400 not four to six digits or the card is not active · 403 not
|
|
520
|
+
* your card · 409 `card_locked`, or `provider_refused` when the issuer did
|
|
521
|
+
* not take it · 429 too many attempts · 501 a virtual card has no PIN.
|
|
522
|
+
*/
|
|
523
|
+
async setPin(id, input) {
|
|
524
|
+
return this.http.post(`/me/cards/${encodeURIComponent(id)}/pin`, {
|
|
525
|
+
body: { pin: input.pin }
|
|
526
|
+
});
|
|
527
|
+
}
|
|
504
528
|
/**
|
|
505
529
|
* Terminate the caller's own card. **One-way** — a terminated card cannot be
|
|
506
530
|
* reactivated. The optional `reason` is audited. Idempotent on an
|
|
@@ -530,7 +554,10 @@ var DepositsResource = class {
|
|
|
530
554
|
* API answers 400 `no_quote_needed`).
|
|
531
555
|
*/
|
|
532
556
|
async quote(input) {
|
|
533
|
-
|
|
557
|
+
const { connectorSlug, ...rest } = input;
|
|
558
|
+
const body = { ...rest };
|
|
559
|
+
if (connectorSlug !== void 0) body["connector_slug"] = connectorSlug;
|
|
560
|
+
return this.http.post("/me/deposits/quotes", { body });
|
|
534
561
|
}
|
|
535
562
|
async initiate(input) {
|
|
536
563
|
const { idempotencyKey, issue_card, ...rest } = input;
|
|
@@ -1145,7 +1172,7 @@ var FundingOptionsResource = class {
|
|
|
1145
1172
|
};
|
|
1146
1173
|
|
|
1147
1174
|
// src/version.ts
|
|
1148
|
-
var SDK_VERSION = "0.6.
|
|
1175
|
+
var SDK_VERSION = "0.6.1";
|
|
1149
1176
|
|
|
1150
1177
|
// src/client-platform.ts
|
|
1151
1178
|
var CLIENT_HEADER = "X-Takeal-Client";
|
|
@@ -1220,7 +1247,7 @@ function isAbsolute(url) {
|
|
|
1220
1247
|
}
|
|
1221
1248
|
|
|
1222
1249
|
// src/compat.ts
|
|
1223
|
-
var SUPPORTED_MEISTER = ">=0.
|
|
1250
|
+
var SUPPORTED_MEISTER = ">=0.6.4, <0.7.0";
|
|
1224
1251
|
var SEMVER = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
1225
1252
|
function parse(v) {
|
|
1226
1253
|
const m = SEMVER.exec(v.trim());
|