@takeal/cusfront-sdk 0.8.1 → 0.8.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.
- package/CHANGELOG.md +37 -0
- package/README.md +25 -0
- package/dist/index.cjs +31 -3
- 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 +31 -3
- package/dist/index.js.map +1 -1
- package/dist/resources/auth.cjs +30 -2
- package/dist/resources/auth.cjs.map +1 -1
- package/dist/resources/auth.d.cts +46 -3
- package/dist/resources/auth.d.ts +46 -3
- package/dist/resources/auth.js +30 -2
- package/dist/resources/auth.js.map +1 -1
- package/dist/telegram.cjs +31 -3
- package/dist/telegram.cjs.map +1 -1
- package/dist/telegram.js +31 -3
- package/dist/telegram.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { T as TokenStore, F as FetchLike } from './http-CL97TjMO.cjs';
|
|
2
2
|
export { d as defaultBrowserStore, i as inMemoryStore } from './http-CL97TjMO.cjs';
|
|
3
3
|
import { AuthResource } from './resources/auth.cjs';
|
|
4
|
-
export { ChangePasswordInput, EmailChangeRequested, EmailCodeSent, EmailCodeSession, ExchangeTelegramInput, JwtIssued, LinkTelegramInput, LoginInput, LoginResponse, OtpSentResponse, RegisterInput, RequestEmailCodeInput, Session, TelegramLink, TelegramUnknown, TotpRequired, TotpSetupComplete, TotpSetupRequired, User, VerifyEmailCodeInput } from './resources/auth.cjs';
|
|
4
|
+
export { ChangePasswordInput, ConfirmPasswordSetupInput, EmailChangeRequested, EmailCodeSent, EmailCodeSession, ExchangeTelegramInput, JwtIssued, LinkTelegramInput, LoginInput, LoginResponse, OtpSentResponse, PasswordSetupRequested, RegisterInput, RequestEmailCodeInput, Session, TelegramLink, TelegramUnknown, TotpRequired, TotpSetupComplete, TotpSetupRequired, User, VerifyEmailCodeInput } from './resources/auth.cjs';
|
|
5
5
|
import { b as DepositsResource, F as FundingOptionsResource, c as CardsResource } from './cards-BPu8Ill7.cjs';
|
|
6
6
|
export { A as Address, B as BillingAddress, a as Card, d as CardBalance, e as CardDesignRef, f as CardForm, g as CardInTransit, h as CardLoadStatus, i as CardOrder, j as CardOrderError, k as CardOrderInput, l as CardOrderQuote, m as CardOrderQuoteInput, C as CardProduct, n as CardProductPrice, o as CardStatus, p as CardStatusSource, q as CardTariff, r as CardTopUp, s as CardTopUpStatus, t as CardTransfer, u as CardType, v as Cardholder, w as CloseBlockedReason, x as CreateCardInput, y as CreateDepositRefundInput, z as CreateQuoteInput, E as CustomerInfo, D as Deposit, G as DepositMethod, H as DepositStatus, I as DepositTarget, J as FeeKind, K as FunderMode, L as FundingOption, M as FundingQuote, N as InitiateDepositInput, O as IssuanceBonus, P as IssueCardInput, Q as MethodTerms, R as PromoCodeQuote, S as PromoCodeStatus, T as Refund, U as RevealCardInput, V as RevealState, W as RevealedCard, X as SetPinInput, Y as TopUpInput, Z as TopUpResult, _ as TopUpTerms, $ as TransferInput, a0 as TransferResult, a1 as UpdateCardInput, a2 as priceChangedQuote, a3 as revealState } from './cards-BPu8Ill7.cjs';
|
|
7
7
|
import { BalanceResource } from './resources/balance.cjs';
|
|
@@ -187,7 +187,7 @@ declare function isNetworkError(e: unknown): e is NetworkError;
|
|
|
187
187
|
* `define`. `src/version.test.ts` checks it matches `package.json`, so a
|
|
188
188
|
* release bump that forgets this file fails the test run.
|
|
189
189
|
*/
|
|
190
|
-
declare const SDK_VERSION = "0.8.
|
|
190
|
+
declare const SDK_VERSION = "0.8.3";
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* `@takeal/cusfront-sdk` — typed client for the Takeal end-user API.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { T as TokenStore, F as FetchLike } from './http-CL97TjMO.js';
|
|
2
2
|
export { d as defaultBrowserStore, i as inMemoryStore } from './http-CL97TjMO.js';
|
|
3
3
|
import { AuthResource } from './resources/auth.js';
|
|
4
|
-
export { ChangePasswordInput, EmailChangeRequested, EmailCodeSent, EmailCodeSession, ExchangeTelegramInput, JwtIssued, LinkTelegramInput, LoginInput, LoginResponse, OtpSentResponse, RegisterInput, RequestEmailCodeInput, Session, TelegramLink, TelegramUnknown, TotpRequired, TotpSetupComplete, TotpSetupRequired, User, VerifyEmailCodeInput } from './resources/auth.js';
|
|
4
|
+
export { ChangePasswordInput, ConfirmPasswordSetupInput, EmailChangeRequested, EmailCodeSent, EmailCodeSession, ExchangeTelegramInput, JwtIssued, LinkTelegramInput, LoginInput, LoginResponse, OtpSentResponse, PasswordSetupRequested, RegisterInput, RequestEmailCodeInput, Session, TelegramLink, TelegramUnknown, TotpRequired, TotpSetupComplete, TotpSetupRequired, User, VerifyEmailCodeInput } from './resources/auth.js';
|
|
5
5
|
import { b as DepositsResource, F as FundingOptionsResource, c as CardsResource } from './cards-DP1fJc_c.js';
|
|
6
6
|
export { A as Address, B as BillingAddress, a as Card, d as CardBalance, e as CardDesignRef, f as CardForm, g as CardInTransit, h as CardLoadStatus, i as CardOrder, j as CardOrderError, k as CardOrderInput, l as CardOrderQuote, m as CardOrderQuoteInput, C as CardProduct, n as CardProductPrice, o as CardStatus, p as CardStatusSource, q as CardTariff, r as CardTopUp, s as CardTopUpStatus, t as CardTransfer, u as CardType, v as Cardholder, w as CloseBlockedReason, x as CreateCardInput, y as CreateDepositRefundInput, z as CreateQuoteInput, E as CustomerInfo, D as Deposit, G as DepositMethod, H as DepositStatus, I as DepositTarget, J as FeeKind, K as FunderMode, L as FundingOption, M as FundingQuote, N as InitiateDepositInput, O as IssuanceBonus, P as IssueCardInput, Q as MethodTerms, R as PromoCodeQuote, S as PromoCodeStatus, T as Refund, U as RevealCardInput, V as RevealState, W as RevealedCard, X as SetPinInput, Y as TopUpInput, Z as TopUpResult, _ as TopUpTerms, $ as TransferInput, a0 as TransferResult, a1 as UpdateCardInput, a2 as priceChangedQuote, a3 as revealState } from './cards-DP1fJc_c.js';
|
|
7
7
|
import { BalanceResource } from './resources/balance.js';
|
|
@@ -187,7 +187,7 @@ declare function isNetworkError(e: unknown): e is NetworkError;
|
|
|
187
187
|
* `define`. `src/version.test.ts` checks it matches `package.json`, so a
|
|
188
188
|
* release bump that forgets this file fails the test run.
|
|
189
189
|
*/
|
|
190
|
-
declare const SDK_VERSION = "0.8.
|
|
190
|
+
declare const SDK_VERSION = "0.8.3";
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* `@takeal/cusfront-sdk` — typed client for the Takeal end-user API.
|
package/dist/index.js
CHANGED
|
@@ -806,13 +806,41 @@ var AuthResource = class {
|
|
|
806
806
|
}
|
|
807
807
|
/** Change the signed-in user's password. Every other session of the
|
|
808
808
|
* account is signed out; this one stays valid.
|
|
809
|
-
* Errors: 400 when the new password fails the policy,
|
|
810
|
-
*
|
|
809
|
+
* Errors: 400 `weak_password` when the new password fails the policy,
|
|
810
|
+
* 400 `no_password` when the account has none yet (use
|
|
811
|
+
* {@link requestPasswordSetup}), 401 when the current one is wrong. */
|
|
811
812
|
async changePassword(input) {
|
|
812
813
|
return this.http.post("/auth/password", {
|
|
813
814
|
body: input
|
|
814
815
|
});
|
|
815
816
|
}
|
|
817
|
+
/** Step one of setting the first password of an account that has none
|
|
818
|
+
* (`user.has_password === false`, e.g. made by signing in with an e-mail
|
|
819
|
+
* code): a six-digit code goes to the account's address and works for 5
|
|
820
|
+
* minutes. Nothing changes yet.
|
|
821
|
+
* Errors: 409 `password_exists` (use {@link changePassword}),
|
|
822
|
+
* `email_required` (a Telegram account with no address yet: attach one
|
|
823
|
+
* with {@link requestEmailChange} first), `email_not_proven` (sign in
|
|
824
|
+
* with an e-mail code first); 429 `too_many_requests` (five codes an
|
|
825
|
+
* hour); 503 `delivery_failed`. Platform 0.8.2 and newer. */
|
|
826
|
+
async requestPasswordSetup() {
|
|
827
|
+
return this.http.post("/auth/password/setup", {});
|
|
828
|
+
}
|
|
829
|
+
/** Step two: the code from the e-mail and the new password set the
|
|
830
|
+
* account's first password. Every other session of the account is signed
|
|
831
|
+
* out; this one stays valid, and signing in with a code keeps working.
|
|
832
|
+
* Errors: 400 `weak_password` (the code is not used up, fix the password
|
|
833
|
+
* and send again), 401 `invalid_code` (after five wrong codes ask for a
|
|
834
|
+
* new one), 409 `password_exists`. */
|
|
835
|
+
async confirmPasswordSetup(input) {
|
|
836
|
+
return this.http.post("/auth/password/setup/confirm", {
|
|
837
|
+
body: {
|
|
838
|
+
challenge_id: input.challengeId,
|
|
839
|
+
code: input.code,
|
|
840
|
+
new_password: input.newPassword
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
}
|
|
816
844
|
/** Swap the 2FA method mid-flow. Resolves to `otp_sent` for
|
|
817
845
|
* telegram/email; for TOTP it short-circuits back to the challenge. */
|
|
818
846
|
async switchMethod(input) {
|
|
@@ -1751,7 +1779,7 @@ var FundingOptionsResource = class {
|
|
|
1751
1779
|
};
|
|
1752
1780
|
|
|
1753
1781
|
// src/version.ts
|
|
1754
|
-
var SDK_VERSION = "0.8.
|
|
1782
|
+
var SDK_VERSION = "0.8.3";
|
|
1755
1783
|
|
|
1756
1784
|
// src/client-platform.ts
|
|
1757
1785
|
var CLIENT_HEADER = "X-Takeal-Client";
|