@takeal/cusfront-sdk 0.3.18 → 0.3.20
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 +12 -0
- package/README.md +23 -1
- package/dist/index.cjs +26 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/cards.cjs +25 -0
- package/dist/resources/cards.cjs.map +1 -1
- package/dist/resources/cards.d.cts +67 -1
- package/dist/resources/cards.d.ts +67 -1
- package/dist/resources/cards.js +25 -0
- package/dist/resources/cards.js.map +1 -1
- package/dist/telegram.cjs +26 -1
- package/dist/telegram.cjs.map +1 -1
- package/dist/telegram.js +26 -1
- package/dist/telegram.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ export { ChangePasswordInput, ExchangeTelegramInput, JwtIssued, LinkTelegramInpu
|
|
|
5
5
|
import { DepositsResource } from './resources/deposits.cjs';
|
|
6
6
|
export { CreateDepositRefundInput, CreateQuoteInput, Deposit, DepositMethod, DepositStatus, FundingQuote, InitiateDepositInput, Refund } from './resources/deposits.cjs';
|
|
7
7
|
import { CardsResource } from './resources/cards.cjs';
|
|
8
|
-
export { Card, CardBalance, CardDesignRef, CardProduct, CardProductPrice, CardStatus, CardType, CreateCardInput, RevealCardInput, RevealedCard, UpdateCardInput } from './resources/cards.cjs';
|
|
8
|
+
export { Card, CardBalance, CardDesignRef, CardProduct, CardProductPrice, CardStatus, CardTopUp, CardType, CreateCardInput, RevealCardInput, RevealedCard, TopUpInput, TopUpResult, TopUpTerms, UpdateCardInput } from './resources/cards.cjs';
|
|
9
9
|
import { BalanceResource } from './resources/balance.cjs';
|
|
10
10
|
export { Balance } from './resources/balance.cjs';
|
|
11
11
|
import { BrandingResource } from './resources/branding.cjs';
|
|
@@ -119,7 +119,7 @@ declare function isNetworkError(e: unknown): e is NetworkError;
|
|
|
119
119
|
* `define`. `src/version.test.ts` checks it matches `package.json`, so a
|
|
120
120
|
* release bump that forgets this file fails the test run.
|
|
121
121
|
*/
|
|
122
|
-
declare const SDK_VERSION = "0.3.
|
|
122
|
+
declare const SDK_VERSION = "0.3.20";
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* `@takeal/cusfront-sdk` — typed client for the Takeal end-user API.
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { ChangePasswordInput, ExchangeTelegramInput, JwtIssued, LinkTelegramInpu
|
|
|
5
5
|
import { DepositsResource } from './resources/deposits.js';
|
|
6
6
|
export { CreateDepositRefundInput, CreateQuoteInput, Deposit, DepositMethod, DepositStatus, FundingQuote, InitiateDepositInput, Refund } from './resources/deposits.js';
|
|
7
7
|
import { CardsResource } from './resources/cards.js';
|
|
8
|
-
export { Card, CardBalance, CardDesignRef, CardProduct, CardProductPrice, CardStatus, CardType, CreateCardInput, RevealCardInput, RevealedCard, UpdateCardInput } from './resources/cards.js';
|
|
8
|
+
export { Card, CardBalance, CardDesignRef, CardProduct, CardProductPrice, CardStatus, CardTopUp, CardType, CreateCardInput, RevealCardInput, RevealedCard, TopUpInput, TopUpResult, TopUpTerms, UpdateCardInput } from './resources/cards.js';
|
|
9
9
|
import { BalanceResource } from './resources/balance.js';
|
|
10
10
|
export { Balance } from './resources/balance.js';
|
|
11
11
|
import { BrandingResource } from './resources/branding.js';
|
|
@@ -119,7 +119,7 @@ declare function isNetworkError(e: unknown): e is NetworkError;
|
|
|
119
119
|
* `define`. `src/version.test.ts` checks it matches `package.json`, so a
|
|
120
120
|
* release bump that forgets this file fails the test run.
|
|
121
121
|
*/
|
|
122
|
-
declare const SDK_VERSION = "0.3.
|
|
122
|
+
declare const SDK_VERSION = "0.3.20";
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* `@takeal/cusfront-sdk` — typed client for the Takeal end-user API.
|
package/dist/index.js
CHANGED
|
@@ -380,6 +380,31 @@ var CardsResource = class {
|
|
|
380
380
|
`/me/cards/${encodeURIComponent(id)}/balance?${q}`
|
|
381
381
|
);
|
|
382
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* What a top-up of this card can be right now: whether it is possible, the
|
|
385
|
+
* currency, the wallet balance, and the product's floor and cap for one
|
|
386
|
+
* top-up. Read it before drawing the form. 404 if the card isn't the caller's.
|
|
387
|
+
*/
|
|
388
|
+
async topUpTerms(id) {
|
|
389
|
+
return this.http.get(`/me/cards/${encodeURIComponent(id)}/topup`);
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Move money from the wallet onto the caller's own card. The wallet is
|
|
393
|
+
* debited first, then the card's provider loads the card; if the provider
|
|
394
|
+
* refuses, the money is back on the wallet and the error says so. Resolves
|
|
395
|
+
* to the card, its new balance and the wallet balance, so no second call
|
|
396
|
+
* is needed. Errors carry a sentence the user can read: 400 outside the
|
|
397
|
+
* floor or cap · 402 not enough in the wallet · 404 not the caller's card ·
|
|
398
|
+
* 409 card frozen, closed or still being issued · 501 provider can't top
|
|
399
|
+
* up · 502/503 provider declined or unreachable (wallet untouched).
|
|
400
|
+
*/
|
|
401
|
+
async topUp(id, input) {
|
|
402
|
+
const { idempotencyKey, amount } = input;
|
|
403
|
+
return this.http.post(`/me/cards/${encodeURIComponent(id)}/topup`, {
|
|
404
|
+
body: { amount },
|
|
405
|
+
idempotencyKey
|
|
406
|
+
});
|
|
407
|
+
}
|
|
383
408
|
/**
|
|
384
409
|
* Freeze the caller's own card. Reversible via {@link unfreeze}. The optional
|
|
385
410
|
* `reason` is recorded on the audit trail. Resolves to the updated card.
|
|
@@ -762,7 +787,7 @@ var DevicesResource = class {
|
|
|
762
787
|
};
|
|
763
788
|
|
|
764
789
|
// src/version.ts
|
|
765
|
-
var SDK_VERSION = "0.3.
|
|
790
|
+
var SDK_VERSION = "0.3.20";
|
|
766
791
|
|
|
767
792
|
// src/client-platform.ts
|
|
768
793
|
var CLIENT_HEADER = "X-Takeal-Client";
|