@takeal/cusfront-sdk 0.6.2 → 0.6.4

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 (41) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +70 -1
  3. package/dist/{cards-DzhPVA9N.d.ts → cards-BrqeBqLV.d.ts} +432 -1
  4. package/dist/{cards-DU2DdhYO.d.cts → cards-ofoGRU9v.d.cts} +432 -1
  5. package/dist/index.cjs +280 -205
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +5 -7
  8. package/dist/index.d.ts +5 -7
  9. package/dist/index.js +280 -205
  10. package/dist/index.js.map +1 -1
  11. package/dist/react/index.d.cts +1 -2
  12. package/dist/react/index.d.ts +1 -2
  13. package/dist/resources/auth.cjs +62 -1
  14. package/dist/resources/auth.cjs.map +1 -1
  15. package/dist/resources/auth.d.cts +88 -4
  16. package/dist/resources/auth.d.ts +88 -4
  17. package/dist/resources/auth.js +62 -1
  18. package/dist/resources/auth.js.map +1 -1
  19. package/dist/resources/cards.cjs +34 -0
  20. package/dist/resources/cards.cjs.map +1 -1
  21. package/dist/resources/cards.d.cts +1 -1
  22. package/dist/resources/cards.d.ts +1 -1
  23. package/dist/resources/cards.js +34 -1
  24. package/dist/resources/cards.js.map +1 -1
  25. package/dist/resources/deposits.cjs.map +1 -1
  26. package/dist/resources/deposits.d.cts +1 -2
  27. package/dist/resources/deposits.d.ts +1 -2
  28. package/dist/resources/deposits.js.map +1 -1
  29. package/dist/resources/funding-options.d.cts +1 -2
  30. package/dist/resources/funding-options.d.ts +1 -2
  31. package/dist/resources/me.d.cts +1 -0
  32. package/dist/resources/me.d.ts +1 -0
  33. package/dist/telegram.cjs +280 -205
  34. package/dist/telegram.cjs.map +1 -1
  35. package/dist/telegram.d.cts +1 -2
  36. package/dist/telegram.d.ts +1 -2
  37. package/dist/telegram.js +280 -205
  38. package/dist/telegram.js.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/deposits-BEkNeE-v.d.cts +0 -373
  41. package/dist/deposits-Dt6A76MB.d.ts +0 -373
package/dist/telegram.cjs CHANGED
@@ -134,6 +134,241 @@ async function parseResponse(resp) {
134
134
  return body;
135
135
  }
136
136
 
137
+ // src/resources/cards.ts
138
+ function cardRequestBody(input) {
139
+ const {
140
+ productId,
141
+ name,
142
+ designId,
143
+ useBonus,
144
+ bonusAmount,
145
+ promoCode,
146
+ consentChannel,
147
+ initial_amount: _ignored,
148
+ ...rest
149
+ } = input;
150
+ const body = { ...rest };
151
+ if (productId !== void 0) body["product_id"] = productId;
152
+ if (name !== void 0) body["name"] = name;
153
+ if (designId !== void 0) body["design_id"] = designId;
154
+ if (useBonus !== void 0) body["use_bonus"] = useBonus;
155
+ if (bonusAmount !== void 0) body["bonus_amount"] = bonusAmount;
156
+ if (promoCode !== void 0) body["promo_code"] = promoCode;
157
+ if (consentChannel !== void 0) body["consent_channel"] = consentChannel;
158
+ return body;
159
+ }
160
+ function cardOrderBody(input) {
161
+ const body = {
162
+ product_id: input.productId,
163
+ method: input.method
164
+ };
165
+ if (input.designId !== void 0) body["design_id"] = input.designId;
166
+ if (input.name !== void 0) body["name"] = input.name;
167
+ if (input.funderSlug !== void 0) body["funder_slug"] = input.funderSlug;
168
+ if (input.currency !== void 0) body["currency"] = input.currency;
169
+ if (input.extraLoad !== void 0) body["extra_load"] = input.extraLoad;
170
+ if (input.promoCode !== void 0) body["promo_code"] = input.promoCode;
171
+ if (input.useBonus !== void 0) body["use_bonus"] = input.useBonus;
172
+ if (input.consents !== void 0) body["consents"] = input.consents;
173
+ if (input.consentChannel !== void 0) body["consent_channel"] = input.consentChannel;
174
+ if (input.metadata !== void 0) body["metadata"] = input.metadata;
175
+ return body;
176
+ }
177
+ var CardsResource = class {
178
+ constructor(http) {
179
+ this.http = http;
180
+ }
181
+ /**
182
+ * Issue a card backed by the user's wallet balance. Resolves to the new
183
+ * `Card`. On a ledger failure after provider creation, the Takeal API rolls the row
184
+ * to `failed` (never an orphaned active card); inspect `status` /
185
+ * `failure_reason` on the result.
186
+ */
187
+ async create(input) {
188
+ const { idempotencyKey, ...card } = input;
189
+ return this.http.post("/me/cards", {
190
+ body: cardRequestBody(card),
191
+ idempotencyKey
192
+ });
193
+ }
194
+ /**
195
+ * Buy a card in one step: the API prices the product in the payment's
196
+ * currency, locks the rate and opens the top-up that issues the card.
197
+ * Send the user to `order.deposit.redirect_url`; the card shows as
198
+ * `pending_payment` until the payment is confirmed. The same
199
+ * `idempotencyKey` returns the same order.
200
+ * Errors: 400 `unknown_product` / `method_not_available` / a limit of the
201
+ * way of paying, 503 no funding connector or no exchange rate.
202
+ */
203
+ async order(input) {
204
+ const { idempotencyKey, ...order } = input;
205
+ return this.http.post("/me/card-orders", {
206
+ body: cardOrderBody(order),
207
+ idempotencyKey
208
+ });
209
+ }
210
+ /**
211
+ * The cards the caller can order, in the order the storefront shows them
212
+ * (`is_default` marks the one issued when none is chosen). Each item
213
+ * carries its product card (name, tagline, benefits, tile picture),
214
+ * artwork, and the issuance price after the caller's subscription
215
+ * discount, in the caller's wallet currency. Pass an item's `id` as
216
+ * `productId` to {@link create}.
217
+ */
218
+ async listProducts() {
219
+ return this.http.get("/me/card-products");
220
+ }
221
+ /** One product from the catalog. 404 when unknown, disabled or hidden. */
222
+ async getProduct(id) {
223
+ return this.http.get(`/me/card-products/${encodeURIComponent(id)}`);
224
+ }
225
+ /**
226
+ * The public catalog: the same products, order and default as
227
+ * {@link listProducts}, but readable before sign-in, for a landing page or
228
+ * the cabinet's first screen. Prices are list prices (`discount_bps` is
229
+ * always 0); once the user is signed in, {@link listProducts} shows what
230
+ * they pay. The API lets caches keep this response for a minute.
231
+ */
232
+ async catalog() {
233
+ return this.http.get("/card-products");
234
+ }
235
+ /**
236
+ * Rename the caller's own card or change its design. Resolves to the
237
+ * updated card. 404 if the card isn't the caller's; 400 `invalid_name` /
238
+ * `design_not_allowed` on a bad value.
239
+ */
240
+ async update(id, input) {
241
+ const body = {};
242
+ if (input.name !== void 0) body["name"] = input.name;
243
+ if (input.designId !== void 0) body["design_id"] = input.designId;
244
+ return this.http.patch(`/me/cards/${encodeURIComponent(id)}`, {
245
+ body
246
+ });
247
+ }
248
+ /** Fetch one card by id. */
249
+ async get(id) {
250
+ return this.http.get(`/me/cards/${encodeURIComponent(id)}`);
251
+ }
252
+ /** List the caller's cards, most recent first. */
253
+ async list() {
254
+ return this.http.get("/me/cards");
255
+ }
256
+ /**
257
+ * Remaining balance of a prepaid card. `currency` is required by the Takeal API and
258
+ * forwarded as a query param.
259
+ */
260
+ async balance(id, currency) {
261
+ const q = new URLSearchParams({ currency }).toString();
262
+ return this.http.get(`/me/cards/${encodeURIComponent(id)}/balance?${q}`);
263
+ }
264
+ /**
265
+ * What a top-up of this card can be right now: whether it is possible, the
266
+ * currency, the wallet balance, and the product's floor and cap for one
267
+ * top-up. Read it before drawing the form. 404 if the card isn't the caller's.
268
+ */
269
+ async topUpTerms(id) {
270
+ return this.http.get(`/me/cards/${encodeURIComponent(id)}/topup`);
271
+ }
272
+ /**
273
+ * Move money from the wallet onto the caller's own card. The wallet is
274
+ * debited first, then the card's provider loads the card; if the provider
275
+ * refuses, the money is back on the wallet and the error says so. Resolves
276
+ * to the card, its new balance and the wallet balance, so no second call
277
+ * is needed. Errors carry a sentence the user can read: 400 outside the
278
+ * floor or cap · 402 not enough in the wallet · 404 not the caller's card ·
279
+ * 409 card frozen, closed or still being issued · 501 provider can't top
280
+ * up · 502/503 provider declined or unreachable (wallet untouched).
281
+ */
282
+ async topUp(id, input) {
283
+ const { idempotencyKey, amount } = input;
284
+ return this.http.post(`/me/cards/${encodeURIComponent(id)}/topup`, {
285
+ body: { amount },
286
+ idempotencyKey
287
+ });
288
+ }
289
+ /**
290
+ * Move money from one of the caller's cards to another. Both must be
291
+ * theirs, active, in the same currency and of the same kind. The money
292
+ * travels through the wallet one leg at a time: when the second leg does
293
+ * not go through, the call still resolves, `transfer.status` is
294
+ * `on_wallet` and the money is on the wallet — never between two cards.
295
+ * Errors carry a sentence the user can read: 400 the same card twice,
296
+ * different currencies or different kinds · 402 the card holds less than
297
+ * that · 404 one of the cards isn't theirs · 409 a card is frozen, closed
298
+ * or still being issued, or the key was reused with a different body ·
299
+ * 501/502/503 the provider cannot or will not move it.
300
+ */
301
+ async transfer(fromCardId, input) {
302
+ const { toCardId, amount, idempotencyKey } = input;
303
+ return this.http.post(`/me/cards/${encodeURIComponent(fromCardId)}/transfer`, {
304
+ body: { to_card_id: toCardId, amount },
305
+ idempotencyKey
306
+ });
307
+ }
308
+ /**
309
+ * Freeze the caller's own card. Reversible via {@link unfreeze} while
310
+ * `status_source` is `holder` or `operator`. The optional `reason` is
311
+ * recorded on the audit trail. Resolves to the updated card. 404 if the
312
+ * card isn't the caller's; 409 `card_locked` when support holds it; 501 if
313
+ * the issuer can't freeze.
314
+ */
315
+ async freeze(id, reason) {
316
+ return this.http.post(`/me/cards/${encodeURIComponent(id)}/freeze`, { body: { reason } });
317
+ }
318
+ /**
319
+ * Reveal the FULL PAN + CVV for the caller's own card. The signed-in
320
+ * session is all the API asks for; the call is rate-limited and audited
321
+ * server-side. The Takeal API never persists this data and marks the
322
+ * response no-store; the SDK returns it verbatim and holds nothing.
323
+ *
324
+ * **Consumer security duties** (the SDK can't enforce these for you):
325
+ * keep the result in volatile memory only, never write it to
326
+ * localStorage / logs, and clear it within `expires_in_seconds`.
327
+ *
328
+ * The result is the numbers, or `reveal_url` with empty `pan` and `cvv`
329
+ * when the issuer shows them on a page of its own: open that page in a
330
+ * frame right away, it is short-lived.
331
+ *
332
+ * 403 not your card · 409 `card_locked` · 429 rate-limited · 501 connector
333
+ * has no sensitive-data endpoint · 503 `provider_unavailable`.
334
+ */
335
+ async reveal(id, _input) {
336
+ return this.http.post(`/me/cards/${encodeURIComponent(id)}/reveal`);
337
+ }
338
+ /**
339
+ * Unfreeze a previously-frozen card. Idempotent on an already-active card.
340
+ * A card the issuer froze (`status_source: "provider"`) is not the
341
+ * holder's to unfreeze: the API answers 409 `card_locked`, so hide the
342
+ * button and say the freeze is lifted through the issuer's support.
343
+ */
344
+ async unfreeze(id) {
345
+ return this.http.post(`/me/cards/${encodeURIComponent(id)}/unfreeze`, { body: {} });
346
+ }
347
+ /**
348
+ * Set the PIN of the caller's own physical card. The session is enough; the
349
+ * call is rate-limited like {@link reveal} and the PIN is kept nowhere.
350
+ * Resolves to the card; the user also gets a notification that the PIN
351
+ * was set. 400 not four to six digits or the card is not active · 403 not
352
+ * your card · 409 `card_locked`, or `provider_refused` when the issuer did
353
+ * not take it · 429 too many attempts · 501 a virtual card has no PIN.
354
+ */
355
+ async setPin(id, input) {
356
+ return this.http.post(`/me/cards/${encodeURIComponent(id)}/pin`, {
357
+ body: { pin: input.pin }
358
+ });
359
+ }
360
+ /**
361
+ * Terminate the caller's own card. **One-way** — a terminated card cannot be
362
+ * reactivated. The optional `reason` is audited. Idempotent on an
363
+ * already-terminated card.
364
+ */
365
+ async terminate(id, reason) {
366
+ return this.http.post(`/me/cards/${encodeURIComponent(id)}/terminate`, {
367
+ body: { reason }
368
+ });
369
+ }
370
+ };
371
+
137
372
  // src/resources/auth.ts
138
373
  function withRemember(input) {
139
374
  const { remember, ...rest } = input;
@@ -232,8 +467,50 @@ var AuthResource = class {
232
467
  * Errors: 400 `validation` / `currency_not_allowed` / `consents_required`
233
468
  * / `unknown_consent`, 409 email taken. */
234
469
  async register(input) {
470
+ const { cardOrder, ...rest } = input;
471
+ const body = withRemember(rest);
472
+ if (cardOrder !== void 0) body["card_order"] = cardOrderBody(cardOrder);
235
473
  const resp = await this.http.post("/auth/register", {
236
- body: withRemember(input),
474
+ body,
475
+ skipAuth: true
476
+ });
477
+ await this.keep(resp);
478
+ return resp;
479
+ }
480
+ /** Step one of signing in without a password: a six-digit code goes to
481
+ * the address. It works for an address with an account and for a new one
482
+ * alike, and the answer doesn't say which. The code works for 10 minutes;
483
+ * another can be asked for after `resend_at` and replaces it.
484
+ * Errors: 400 `validation` (not an address), 429 `resend_too_soon` /
485
+ * `too_many_requests` (the message says when to try again), 503
486
+ * `delivery_failed`. */
487
+ async requestEmailCode(input) {
488
+ const body = { email: input.email };
489
+ if (input.locale !== void 0) body["locale"] = input.locale;
490
+ return this.http.post("/auth/email-code", { body, skipAuth: true });
491
+ }
492
+ /** Step two: the code signs in to the account with that address, or
493
+ * creates one (no password) when there is none; `account_created` says
494
+ * which. The JWT is stored. With `cardOrder`, the card is ordered for
495
+ * that account in the same call.
496
+ * Errors: 401 `invalid_code` (wrong, expired or used; after five checks a
497
+ * new code is needed), 400 `consents_required` for a new account, 403
498
+ * `user_disabled` / `second_factor_required` (operator accounts sign in
499
+ * with a password and their authenticator). */
500
+ async verifyEmailCode(input) {
501
+ const body = {
502
+ challenge_id: input.challengeId,
503
+ code: input.code
504
+ };
505
+ if (input.remember) body["remember_me"] = true;
506
+ if (input.walletCurrency !== void 0) body["wallet_currency"] = input.walletCurrency;
507
+ if (input.attribution !== void 0) body["attribution"] = input.attribution;
508
+ if (input.promoCode !== void 0) body["promo_code"] = input.promoCode;
509
+ if (input.consents !== void 0) body["consents"] = input.consents;
510
+ if (input.consentChannel !== void 0) body["consent_channel"] = input.consentChannel;
511
+ if (input.cardOrder !== void 0) body["card_order"] = cardOrderBody(input.cardOrder);
512
+ const resp = await this.http.post("/auth/email-code/verify", {
513
+ body,
237
514
  skipAuth: true
238
515
  });
239
516
  await this.keep(resp);
@@ -357,208 +634,6 @@ var AuthResource = class {
357
634
  }
358
635
  };
359
636
 
360
- // src/resources/cards.ts
361
- function cardRequestBody(input) {
362
- const {
363
- productId,
364
- name,
365
- designId,
366
- useBonus,
367
- bonusAmount,
368
- promoCode,
369
- consentChannel,
370
- initial_amount: _ignored,
371
- ...rest
372
- } = input;
373
- const body = { ...rest };
374
- if (productId !== void 0) body["product_id"] = productId;
375
- if (name !== void 0) body["name"] = name;
376
- if (designId !== void 0) body["design_id"] = designId;
377
- if (useBonus !== void 0) body["use_bonus"] = useBonus;
378
- if (bonusAmount !== void 0) body["bonus_amount"] = bonusAmount;
379
- if (promoCode !== void 0) body["promo_code"] = promoCode;
380
- if (consentChannel !== void 0) body["consent_channel"] = consentChannel;
381
- return body;
382
- }
383
- var CardsResource = class {
384
- constructor(http) {
385
- this.http = http;
386
- }
387
- /**
388
- * Issue a card backed by the user's wallet balance. Resolves to the new
389
- * `Card`. On a ledger failure after provider creation, the Takeal API rolls the row
390
- * to `failed` (never an orphaned active card); inspect `status` /
391
- * `failure_reason` on the result.
392
- */
393
- async create(input) {
394
- const { idempotencyKey, ...card } = input;
395
- return this.http.post("/me/cards", {
396
- body: cardRequestBody(card),
397
- idempotencyKey
398
- });
399
- }
400
- /**
401
- * The cards the caller can order, in the order the storefront shows them
402
- * (`is_default` marks the one issued when none is chosen). Each item
403
- * carries its product card (name, tagline, benefits, tile picture),
404
- * artwork, and the issuance price after the caller's subscription
405
- * discount, in the caller's wallet currency. Pass an item's `id` as
406
- * `productId` to {@link create}.
407
- */
408
- async listProducts() {
409
- return this.http.get("/me/card-products");
410
- }
411
- /** One product from the catalog. 404 when unknown, disabled or hidden. */
412
- async getProduct(id) {
413
- return this.http.get(`/me/card-products/${encodeURIComponent(id)}`);
414
- }
415
- /**
416
- * The public catalog: the same products, order and default as
417
- * {@link listProducts}, but readable before sign-in, for a landing page or
418
- * the cabinet's first screen. Prices are list prices (`discount_bps` is
419
- * always 0); once the user is signed in, {@link listProducts} shows what
420
- * they pay. The API lets caches keep this response for a minute.
421
- */
422
- async catalog() {
423
- return this.http.get("/card-products");
424
- }
425
- /**
426
- * Rename the caller's own card or change its design. Resolves to the
427
- * updated card. 404 if the card isn't the caller's; 400 `invalid_name` /
428
- * `design_not_allowed` on a bad value.
429
- */
430
- async update(id, input) {
431
- const body = {};
432
- if (input.name !== void 0) body["name"] = input.name;
433
- if (input.designId !== void 0) body["design_id"] = input.designId;
434
- return this.http.patch(`/me/cards/${encodeURIComponent(id)}`, {
435
- body
436
- });
437
- }
438
- /** Fetch one card by id. */
439
- async get(id) {
440
- return this.http.get(`/me/cards/${encodeURIComponent(id)}`);
441
- }
442
- /** List the caller's cards, most recent first. */
443
- async list() {
444
- return this.http.get("/me/cards");
445
- }
446
- /**
447
- * Remaining balance of a prepaid card. `currency` is required by the Takeal API and
448
- * forwarded as a query param.
449
- */
450
- async balance(id, currency) {
451
- const q = new URLSearchParams({ currency }).toString();
452
- return this.http.get(`/me/cards/${encodeURIComponent(id)}/balance?${q}`);
453
- }
454
- /**
455
- * What a top-up of this card can be right now: whether it is possible, the
456
- * currency, the wallet balance, and the product's floor and cap for one
457
- * top-up. Read it before drawing the form. 404 if the card isn't the caller's.
458
- */
459
- async topUpTerms(id) {
460
- return this.http.get(`/me/cards/${encodeURIComponent(id)}/topup`);
461
- }
462
- /**
463
- * Move money from the wallet onto the caller's own card. The wallet is
464
- * debited first, then the card's provider loads the card; if the provider
465
- * refuses, the money is back on the wallet and the error says so. Resolves
466
- * to the card, its new balance and the wallet balance, so no second call
467
- * is needed. Errors carry a sentence the user can read: 400 outside the
468
- * floor or cap · 402 not enough in the wallet · 404 not the caller's card ·
469
- * 409 card frozen, closed or still being issued · 501 provider can't top
470
- * up · 502/503 provider declined or unreachable (wallet untouched).
471
- */
472
- async topUp(id, input) {
473
- const { idempotencyKey, amount } = input;
474
- return this.http.post(`/me/cards/${encodeURIComponent(id)}/topup`, {
475
- body: { amount },
476
- idempotencyKey
477
- });
478
- }
479
- /**
480
- * Move money from one of the caller's cards to another. Both must be
481
- * theirs, active, in the same currency and of the same kind. The money
482
- * travels through the wallet one leg at a time: when the second leg does
483
- * not go through, the call still resolves, `transfer.status` is
484
- * `on_wallet` and the money is on the wallet — never between two cards.
485
- * Errors carry a sentence the user can read: 400 the same card twice,
486
- * different currencies or different kinds · 402 the card holds less than
487
- * that · 404 one of the cards isn't theirs · 409 a card is frozen, closed
488
- * or still being issued, or the key was reused with a different body ·
489
- * 501/502/503 the provider cannot or will not move it.
490
- */
491
- async transfer(fromCardId, input) {
492
- const { toCardId, amount, idempotencyKey } = input;
493
- return this.http.post(`/me/cards/${encodeURIComponent(fromCardId)}/transfer`, {
494
- body: { to_card_id: toCardId, amount },
495
- idempotencyKey
496
- });
497
- }
498
- /**
499
- * Freeze the caller's own card. Reversible via {@link unfreeze} while
500
- * `status_source` is `holder` or `operator`. The optional `reason` is
501
- * recorded on the audit trail. Resolves to the updated card. 404 if the
502
- * card isn't the caller's; 409 `card_locked` when support holds it; 501 if
503
- * the issuer can't freeze.
504
- */
505
- async freeze(id, reason) {
506
- return this.http.post(`/me/cards/${encodeURIComponent(id)}/freeze`, { body: { reason } });
507
- }
508
- /**
509
- * Reveal the FULL PAN + CVV for the caller's own card. The signed-in
510
- * session is all the API asks for; the call is rate-limited and audited
511
- * server-side. The Takeal API never persists this data and marks the
512
- * response no-store; the SDK returns it verbatim and holds nothing.
513
- *
514
- * **Consumer security duties** (the SDK can't enforce these for you):
515
- * keep the result in volatile memory only, never write it to
516
- * localStorage / logs, and clear it within `expires_in_seconds`.
517
- *
518
- * The result is the numbers, or `reveal_url` with empty `pan` and `cvv`
519
- * when the issuer shows them on a page of its own: open that page in a
520
- * frame right away, it is short-lived.
521
- *
522
- * 403 not your card · 409 `card_locked` · 429 rate-limited · 501 connector
523
- * has no sensitive-data endpoint · 503 `provider_unavailable`.
524
- */
525
- async reveal(id, _input) {
526
- return this.http.post(`/me/cards/${encodeURIComponent(id)}/reveal`);
527
- }
528
- /**
529
- * Unfreeze a previously-frozen card. Idempotent on an already-active card.
530
- * A card the issuer froze (`status_source: "provider"`) is not the
531
- * holder's to unfreeze: the API answers 409 `card_locked`, so hide the
532
- * button and say the freeze is lifted through the issuer's support.
533
- */
534
- async unfreeze(id) {
535
- return this.http.post(`/me/cards/${encodeURIComponent(id)}/unfreeze`, { body: {} });
536
- }
537
- /**
538
- * Set the PIN of the caller's own physical card. The session is enough; the
539
- * call is rate-limited like {@link reveal} and the PIN is kept nowhere.
540
- * Resolves to the card; the user also gets a notification that the PIN
541
- * was set. 400 not four to six digits or the card is not active · 403 not
542
- * your card · 409 `card_locked`, or `provider_refused` when the issuer did
543
- * not take it · 429 too many attempts · 501 a virtual card has no PIN.
544
- */
545
- async setPin(id, input) {
546
- return this.http.post(`/me/cards/${encodeURIComponent(id)}/pin`, {
547
- body: { pin: input.pin }
548
- });
549
- }
550
- /**
551
- * Terminate the caller's own card. **One-way** — a terminated card cannot be
552
- * reactivated. The optional `reason` is audited. Idempotent on an
553
- * already-terminated card.
554
- */
555
- async terminate(id, reason) {
556
- return this.http.post(`/me/cards/${encodeURIComponent(id)}/terminate`, {
557
- body: { reason }
558
- });
559
- }
560
- };
561
-
562
637
  // src/resources/deposits.ts
563
638
  var DepositsResource = class {
564
639
  constructor(http) {
@@ -1240,7 +1315,7 @@ var FundingOptionsResource = class {
1240
1315
  };
1241
1316
 
1242
1317
  // src/version.ts
1243
- var SDK_VERSION = "0.6.2";
1318
+ var SDK_VERSION = "0.6.4";
1244
1319
 
1245
1320
  // src/client-platform.ts
1246
1321
  var CLIENT_HEADER = "X-Takeal-Client";
@@ -1315,7 +1390,7 @@ function isAbsolute(url) {
1315
1390
  }
1316
1391
 
1317
1392
  // src/compat.ts
1318
- var SUPPORTED_MEISTER = ">=0.6.7, <0.7.0";
1393
+ var SUPPORTED_MEISTER = ">=0.6.9, <0.7.0";
1319
1394
  var SEMVER = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
1320
1395
  function parse(v) {
1321
1396
  const m = SEMVER.exec(v.trim());