tempest-react-sdk 0.84.0 → 0.86.0
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/bin/create-tempest-app.mjs +10 -1
- package/dist/auth/create-tempest-auth.cjs +1 -1
- package/dist/auth/create-tempest-auth.cjs.map +1 -1
- package/dist/auth/create-tempest-auth.js +258 -187
- package/dist/auth/create-tempest-auth.js.map +1 -1
- package/dist/components/Markdown/Markdown.cjs +1 -1
- package/dist/components/Markdown/Markdown.cjs.map +1 -1
- package/dist/components/Markdown/Markdown.js +29 -28
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/Markdown/markdown-parse.cjs +6 -5
- package/dist/components/Markdown/markdown-parse.cjs.map +1 -1
- package/dist/components/Markdown/markdown-parse.js +195 -160
- package/dist/components/Markdown/markdown-parse.js.map +1 -1
- package/dist/payments/PixCheckout.cjs +1 -1
- package/dist/payments/PixCheckout.cjs.map +1 -1
- package/dist/payments/PixCheckout.js +1 -1
- package/dist/payments/PixCheckout.js.map +1 -1
- package/dist/payments/mercado-pago.cjs.map +1 -1
- package/dist/payments/mercado-pago.js.map +1 -1
- package/dist/payments/outcome.cjs +1 -1
- package/dist/payments/outcome.cjs.map +1 -1
- package/dist/payments/outcome.js +8 -5
- package/dist/payments/outcome.js.map +1 -1
- package/dist/payments/use-mercado-pago-card.cjs +1 -1
- package/dist/payments/use-mercado-pago-card.cjs.map +1 -1
- package/dist/payments/use-mercado-pago-card.js +69 -61
- package/dist/payments/use-mercado-pago-card.js.map +1 -1
- package/dist/payments/use-pix-charge.cjs +1 -1
- package/dist/payments/use-pix-charge.cjs.map +1 -1
- package/dist/payments/use-pix-charge.js +36 -28
- package/dist/payments/use-pix-charge.js.map +1 -1
- package/dist/query/offline-persistence.cjs +1 -1
- package/dist/query/offline-persistence.cjs.map +1 -1
- package/dist/query/offline-persistence.js +100 -54
- package/dist/query/offline-persistence.js.map +1 -1
- package/dist/tempest-react-sdk.d.ts +245 -15
- package/package.json +7 -1
- package/template/package.json +6 -1
|
@@ -5725,8 +5725,10 @@ export declare interface CreateStorePersistOptions<T> {
|
|
|
5725
5725
|
* mints and every rotation keeps — not by comparing users, which took two
|
|
5726
5726
|
* sign-ins whose user had not loaded yet for the same account (#544). Two tabs
|
|
5727
5727
|
* never redeem the same refresh token at once: the redemption runs under an
|
|
5728
|
-
* origin-wide Web Lock when the browser has one
|
|
5729
|
-
*
|
|
5728
|
+
* origin-wide Web Lock when the browser has one, and a redemption installed as
|
|
5729
|
+
* a sign-in — `restore()`, an account switch — holds a second one until it is
|
|
5730
|
+
* installed, so no tab presents the token it spent meanwhile (#594).
|
|
5731
|
+
* `storage: "session"` is per tab and behaves as before.
|
|
5730
5732
|
*
|
|
5731
5733
|
* Refreshes are collapsed per rotation, not just per overlap: a `401` whose
|
|
5732
5734
|
* request left with a token that has since been replaced in the same session
|
|
@@ -7381,7 +7383,10 @@ export declare function describeAppError(error: unknown, context?: Record<string
|
|
|
7381
7383
|
* The **status** decides the outcome; `status_detail` only refines the sentence.
|
|
7382
7384
|
* That ordering is the point: `waiting_capture` arrives as `authorized` and
|
|
7383
7385
|
* reads as "reserved, not charged", never as paid, and a detail this table does
|
|
7384
|
-
* not know falls back to the status's generic text instead of guessing
|
|
7386
|
+
* not know falls back to the status's generic text instead of guessing — and
|
|
7387
|
+
* "know" means an own key of the table, so a status or detail named after an
|
|
7388
|
+
* `Object.prototype` member (`toString`, `constructor`, `__proto__`) reads as
|
|
7389
|
+
* `unknown` / unknown detail instead of a half-empty outcome. A
|
|
7385
7390
|
* decline reason only refines a `failed` charge, and a pending reason only a
|
|
7386
7391
|
* charge that is not `failed`, so a detail that contradicts its status cannot
|
|
7387
7392
|
* put "recusado" and "reservado" on the same screen.
|
|
@@ -10996,6 +11001,12 @@ export { LoaderFunctionArgs }
|
|
|
10996
11001
|
* forgotten instead of cached — the next call tries again, which is what a
|
|
10997
11002
|
* payer on a flaky connection needs — and the dead tag is removed.
|
|
10998
11003
|
*
|
|
11004
|
+
* Trust: an existing `window.MercadoPago` is used as is, and `src` is not
|
|
11005
|
+
* checked. Neither is a boundary the page can enforce — whoever can define that
|
|
11006
|
+
* global already runs script here, and an unversioned script has no integrity
|
|
11007
|
+
* hash to pin — so the control is the page's CSP `script-src`, restricted to
|
|
11008
|
+
* `https://sdk.mercadopago.com` or the proxy `src` points at.
|
|
11009
|
+
*
|
|
10999
11010
|
* @param options - Script URL and target document.
|
|
11000
11011
|
* @returns The `MercadoPago` constructor.
|
|
11001
11012
|
* @throws {Error} When the script fails to load, or loads without defining
|
|
@@ -11009,7 +11020,12 @@ export declare function loadMercadoPago(options?: LoadMercadoPagoOptions): Promi
|
|
|
11009
11020
|
|
|
11010
11021
|
/** Options for {@link loadMercadoPago}. */
|
|
11011
11022
|
export declare interface LoadMercadoPagoOptions {
|
|
11012
|
-
/**
|
|
11023
|
+
/**
|
|
11024
|
+
* Script URL. Default {@link MERCADO_PAGO_SCRIPT_URL}; override only for a
|
|
11025
|
+
* proxy you control that serves the **identical** MercadoPago.js — SAQ A
|
|
11026
|
+
* depends on the fields coming from the processor unaltered. Not checked:
|
|
11027
|
+
* the script is unversioned, so there is no stable integrity hash to pin.
|
|
11028
|
+
*/
|
|
11013
11029
|
src?: string;
|
|
11014
11030
|
/** Document to inject into. Default the global `document`. */
|
|
11015
11031
|
document?: Document;
|
|
@@ -11541,6 +11557,24 @@ export declare interface MercadoPagoCardContainers {
|
|
|
11541
11557
|
/** Lifecycle of the Secure Fields. */
|
|
11542
11558
|
export declare type MercadoPagoCardStatus = "loading" | "ready" | "error";
|
|
11543
11559
|
|
|
11560
|
+
/**
|
|
11561
|
+
* What `fields.createCardToken` resolves with — the subset this module reads.
|
|
11562
|
+
*
|
|
11563
|
+
* The Secure Fields iframe posts the card to `POST /v1/card_tokens` and answers
|
|
11564
|
+
* with that endpoint's JSON as is (read from the iframe served by
|
|
11565
|
+
* `secure-fields.mercadopago.com` on 2026-11-14), so the shape is the card token
|
|
11566
|
+
* resource: `CardTokenResponse` in Mercado Pago's own Node SDK (`mercadopago`
|
|
11567
|
+
* 3.6.2), where every field is optional. `first_six_digits` is the BIN of the
|
|
11568
|
+
* card that was actually tokenized, which is how {@link useMercadoPagoCard}
|
|
11569
|
+
* binds the token to the brand it quoted.
|
|
11570
|
+
*/
|
|
11571
|
+
export declare interface MercadoPagoCardToken {
|
|
11572
|
+
/** Single-use token id. */
|
|
11573
|
+
id: string;
|
|
11574
|
+
/** First six digits of the tokenized card. */
|
|
11575
|
+
first_six_digits?: string;
|
|
11576
|
+
}
|
|
11577
|
+
|
|
11544
11578
|
/** Non-card data the token is bound to. */
|
|
11545
11579
|
export declare interface MercadoPagoCardTokenData {
|
|
11546
11580
|
cardholderName: string;
|
|
@@ -11594,9 +11628,7 @@ export declare interface MercadoPagoInstallmentsEntry {
|
|
|
11594
11628
|
export declare interface MercadoPagoLike {
|
|
11595
11629
|
fields: {
|
|
11596
11630
|
create(type: MercadoPagoFieldType, options?: MercadoPagoFieldOptions): MercadoPagoFieldLike;
|
|
11597
|
-
createCardToken(data: MercadoPagoCardTokenData): Promise<
|
|
11598
|
-
id: string;
|
|
11599
|
-
}>;
|
|
11631
|
+
createCardToken(data: MercadoPagoCardTokenData): Promise<MercadoPagoCardToken>;
|
|
11600
11632
|
};
|
|
11601
11633
|
getInstallments(params: {
|
|
11602
11634
|
amount: string;
|
|
@@ -12461,6 +12493,15 @@ export declare interface OfflineQueryClearOptions {
|
|
|
12461
12493
|
* Default `false`: the client belongs to the app, which may want to keep
|
|
12462
12494
|
* public queries (a catalog, feature flags) across sessions and drop only
|
|
12463
12495
|
* the user-scoped keys with `removeQueries`.
|
|
12496
|
+
*
|
|
12497
|
+
* With `auth`, only the reset lets a new handle on the same client persist
|
|
12498
|
+
* the next session. Without it the client still holds the ended session's
|
|
12499
|
+
* responses, so `clear()` marks the client's session record ended and
|
|
12500
|
+
* every handle on it deletes its row instead of writing, until the client
|
|
12501
|
+
* is reset or a handle is created on it with empty caches. Before 0.85.0,
|
|
12502
|
+
* `clear()` dropped that record, and the handle created at login stamped
|
|
12503
|
+
* the previous account's responses with the new one (security audit
|
|
12504
|
+
* run-13, C1).
|
|
12464
12505
|
*/
|
|
12465
12506
|
resetClient?: boolean;
|
|
12466
12507
|
}
|
|
@@ -12471,15 +12512,23 @@ export declare interface OfflineQueryPersistence {
|
|
|
12471
12512
|
* Load the persisted snapshot into the `QueryClient`. Call once on boot,
|
|
12472
12513
|
* before rendering queries, so cached data is available offline. A no-op
|
|
12473
12514
|
* once {@link OfflineQueryPersistence.clear} has been called, and — with
|
|
12474
|
-
* `getPrincipal` — for a snapshot written under another principal
|
|
12515
|
+
* `getPrincipal` — for a snapshot written under another principal or while
|
|
12516
|
+
* `isPrincipalKnown` returns `false`; call it again once it is known.
|
|
12475
12517
|
*/
|
|
12476
12518
|
restore: () => Promise<void>;
|
|
12477
12519
|
/**
|
|
12478
12520
|
* Write the current cache snapshot immediately (bypassing the throttle). A
|
|
12479
|
-
* no-op once {@link OfflineQueryPersistence.clear} has been called
|
|
12521
|
+
* no-op once {@link OfflineQueryPersistence.clear} has been called, and,
|
|
12522
|
+
* with `auth`, once {@link OfflineQueryPersistence.unsubscribe} has.
|
|
12480
12523
|
*/
|
|
12481
12524
|
flush: () => Promise<void>;
|
|
12482
|
-
/**
|
|
12525
|
+
/**
|
|
12526
|
+
* Stop persisting and drop the pending write. Idempotent.
|
|
12527
|
+
*
|
|
12528
|
+
* With `auth`, a later `flush()` writes nothing: the handle no longer sees
|
|
12529
|
+
* sessions installed and ended, so it cannot tell whose responses the
|
|
12530
|
+
* cache holds (security audit run-13, N3).
|
|
12531
|
+
*/
|
|
12483
12532
|
unsubscribe: () => void;
|
|
12484
12533
|
/**
|
|
12485
12534
|
* End the persisted session (e.g. on logout) and delete the snapshot.
|
|
@@ -12510,6 +12559,15 @@ export declare interface OfflineQueryPersistence {
|
|
|
12510
12559
|
* user-scoped keys with `removeQueries`. Because persistence is already
|
|
12511
12560
|
* off, that manual call can come before or after this one.
|
|
12512
12561
|
*
|
|
12562
|
+
* With `auth`, the reset decides whether the next session persists on the
|
|
12563
|
+
* same client. With it, the client's session record is dropped after
|
|
12564
|
+
* `queryClient.clear()`, and a handle created at login persists the new
|
|
12565
|
+
* account. Without it, the client still holds this session's responses,
|
|
12566
|
+
* so the record is marked ended — never dropped — and every handle on the
|
|
12567
|
+
* client, a new one or one on another `key`, deletes its row instead of
|
|
12568
|
+
* writing until the client is reset or a handle is created on it with
|
|
12569
|
+
* empty caches (security audit run-13, C1).
|
|
12570
|
+
*
|
|
12513
12571
|
* Idempotent and safe to call concurrently; every call deletes the row
|
|
12514
12572
|
* again.
|
|
12515
12573
|
*
|
|
@@ -12565,8 +12623,121 @@ export declare interface OfflineQueryPersistenceOptions {
|
|
|
12565
12623
|
* Read synchronously. A non-string, non-number value (the `Promise` of an
|
|
12566
12624
|
* `async` getter) or a getter that throws reads as nobody. Omit it to restore
|
|
12567
12625
|
* every snapshot, as before 0.82.0.
|
|
12626
|
+
*
|
|
12627
|
+
* `null` and `undefined` both mean **nobody is signed in** — the same
|
|
12628
|
+
* contract as every other `getPrincipal` in the SDK, so `() => user?.id`
|
|
12629
|
+
* keeps working. "Not known yet" (a cookie session before `/me` answers) is
|
|
12630
|
+
* a different state, and this getter cannot express it: pass
|
|
12631
|
+
* {@link OfflineQueryPersistenceOptions.isPrincipalKnown} for it. Without
|
|
12632
|
+
* that, a write that runs before `/me` stamps the signed-in user's
|
|
12633
|
+
* responses as anonymous, and a logged-out boot hydrates them (#590).
|
|
12634
|
+
*
|
|
12635
|
+
* A handle that hydrated an anonymous snapshot deletes it, instead of
|
|
12636
|
+
* writing, once someone signs in on it: the anonymous row may hold a
|
|
12637
|
+
* previous account's responses written before its principal was known, and
|
|
12638
|
+
* stamping them with the account now signed in is what handed them to it
|
|
12639
|
+
* (#590). To keep persisting, end it with `clear({ resetClient: true })`
|
|
12640
|
+
* and create a new handle: the in-memory client still holds what the
|
|
12641
|
+
* deleted row held, and a new handle on it would stamp that with the
|
|
12642
|
+
* account signed in. With {@link OfflineQueryPersistenceOptions.auth} a new
|
|
12643
|
+
* handle on such a client keeps deleting until the client is reset; with
|
|
12644
|
+
* `getPrincipal` alone, resetting it is up to the app.
|
|
12568
12645
|
*/
|
|
12569
12646
|
getPrincipal?: () => string | number | null | undefined;
|
|
12647
|
+
/**
|
|
12648
|
+
* Whether `getPrincipal` already reflects the real session. Only read with
|
|
12649
|
+
* `getPrincipal`; omitted, the principal is always known, as before.
|
|
12650
|
+
*
|
|
12651
|
+
* For an app that learns who is signed in only after a round trip — a
|
|
12652
|
+
* cookie session resolved by `/me`, a token restored asynchronously —
|
|
12653
|
+
* return `false` until that answer arrives, whatever it is. While it is
|
|
12654
|
+
* `false`:
|
|
12655
|
+
*
|
|
12656
|
+
* - a write does not run and is re-armed for the next throttle window, so
|
|
12657
|
+
* the responses already in the cache are stamped with the real owner, not
|
|
12658
|
+
* as anonymous;
|
|
12659
|
+
* - a cache change does not bind the handle;
|
|
12660
|
+
* - `restore()` hydrates nothing — call it again once the principal is
|
|
12661
|
+
* known.
|
|
12662
|
+
*
|
|
12663
|
+
* Without it, `null` before `/me` reads as "nobody": a session that ends
|
|
12664
|
+
* (tab closed) inside the first throttle window leaves the signed-in user's
|
|
12665
|
+
* responses stamped anonymous, for the next logged-out boot to hydrate
|
|
12666
|
+
* (#590).
|
|
12667
|
+
*
|
|
12668
|
+
* Read synchronously; a throw reads as not known, so it fails closed.
|
|
12669
|
+
*
|
|
12670
|
+
* With {@link OfflineQueryPersistenceOptions.auth} there is no need for
|
|
12671
|
+
* it; when both are given, both must say known.
|
|
12672
|
+
*/
|
|
12673
|
+
isPrincipalKnown?: () => boolean;
|
|
12674
|
+
/**
|
|
12675
|
+
* The auth preset whose session owns the cache — pass what
|
|
12676
|
+
* `createTempestAuth` returned. The safe wiring for an app built on it:
|
|
12677
|
+
*
|
|
12678
|
+
* - the principal is `auth.sessionKey()` unless
|
|
12679
|
+
* {@link OfflineQueryPersistenceOptions.getPrincipal} is given, so the
|
|
12680
|
+
* cache belongs to one sign-in and survives reloads and token rotations
|
|
12681
|
+
* of it; a new sign-in of the same account starts cold;
|
|
12682
|
+
* - the principal is known only while `auth.isSessionKnown()` says the
|
|
12683
|
+
* session is settled — not while a `login()`, `restore()` or the boot
|
|
12684
|
+
* `refresh()` is still deciding it — and, with a `getPrincipal` of your
|
|
12685
|
+
* own, only once it names someone whenever a session is installed (a
|
|
12686
|
+
* user id read from a profile that has not loaded yet is not "nobody");
|
|
12687
|
+
* - every session installed while the `QueryClient`'s cache lives is
|
|
12688
|
+
* recorded — the preset notifies each install, and every cache change,
|
|
12689
|
+
* write and restore reads `sessionKey()` too — not only the one a cache
|
|
12690
|
+
* change happens to see. Once a second session, or nobody after one,
|
|
12691
|
+
* was installed — a sign-out in another tab, a `logout()` without
|
|
12692
|
+
* `clear()`, a second `login()` on top —, every write deletes the row
|
|
12693
|
+
* and `restore()` hydrates nothing: the cache may hold the ended
|
|
12694
|
+
* session's responses, including one the api client replayed with the
|
|
12695
|
+
* bearer of a `login()` or boot `refresh()` that started after the
|
|
12696
|
+
* request left with no token and ended before it landed (security audit
|
|
12697
|
+
* run-12, C1). Nobody followed by a session is not an end, and a
|
|
12698
|
+
* token rotation keeps the key;
|
|
12699
|
+
* - that record belongs to the `QueryClient`, not to the handle, so a new
|
|
12700
|
+
* handle on the same client keeps deleting. Only a reset drops it:
|
|
12701
|
+
* `clear({ resetClient: true })`, after which nothing of the ended
|
|
12702
|
+
* session stays in memory, or creating a handle on a client with empty
|
|
12703
|
+
* caches. `clear()` without `resetClient` leaves the client as it is,
|
|
12704
|
+
* so it marks the record ended instead: no handle on that client
|
|
12705
|
+
* persists until it is reset (security audit run-13, C1);
|
|
12706
|
+
* - a handle only records sessions while it observes them: after
|
|
12707
|
+
* `unsubscribe()` its `flush()` writes nothing, and a handle created on
|
|
12708
|
+
* a client that already holds responses cannot know which session
|
|
12709
|
+
* fetched them — create it before the first query, at boot;
|
|
12710
|
+
* A session that is not this preset (an object of your own) is only
|
|
12711
|
+
* read on cache changes, writes and restores, so a session installed
|
|
12712
|
+
* and ended between two of them goes unseen;
|
|
12713
|
+
* - a `sessionKey()` that throws reads as not known, so nothing is written.
|
|
12714
|
+
*
|
|
12715
|
+
* It does not call `clear()` on session end by itself: `clear()` ends the
|
|
12716
|
+
* handle, and the row is already deleted on the next write. Keep calling
|
|
12717
|
+
* `clear()` on logout, which also stops persisting at once.
|
|
12718
|
+
*
|
|
12719
|
+
* Before it, a cookie app had to wire `isPrincipalKnown` by hand, and the
|
|
12720
|
+
* doc saying so was the only guard: without it, a tab closed before `/me`
|
|
12721
|
+
* answered left the signed-in account's responses stamped anonymous for
|
|
12722
|
+
* the next signed-out boot to hydrate (#596). Call `restore()` after the
|
|
12723
|
+
* boot `auth.refresh()` settles; called before, it hydrates only what
|
|
12724
|
+
* nobody owns.
|
|
12725
|
+
*/
|
|
12726
|
+
auth?: OfflineQuerySession;
|
|
12727
|
+
}
|
|
12728
|
+
|
|
12729
|
+
/**
|
|
12730
|
+
* The session a {@link persistQueryClientOffline} handle follows — what
|
|
12731
|
+
* `createTempestAuth` returns satisfies it, so pass the preset as is.
|
|
12732
|
+
*
|
|
12733
|
+
* Structural on purpose: the query module does not import the auth preset,
|
|
12734
|
+
* so an app that persists its cache without it pays nothing for it.
|
|
12735
|
+
*/
|
|
12736
|
+
export declare interface OfflineQuerySession {
|
|
12737
|
+
/** The key of the session signed in now, or `null` when nobody is. */
|
|
12738
|
+
sessionKey: () => string | null;
|
|
12739
|
+
/** Whether that session is settled, see `TempestAuth.isSessionKnown`. */
|
|
12740
|
+
isSessionKnown: () => boolean;
|
|
12570
12741
|
}
|
|
12571
12742
|
|
|
12572
12743
|
/** Maps each table name to the record type it stores. */
|
|
@@ -13922,6 +14093,11 @@ export declare interface PixCharge {
|
|
|
13922
14093
|
* copia-e-cola line is always next to it: a QR cannot be scanned by the phone
|
|
13923
14094
|
* that is showing it, which is where a mobile checkout puts it.
|
|
13924
14095
|
*
|
|
14096
|
+
* A status this version does not know renders as `unknown` ("verificando"). Known
|
|
14097
|
+
* means an own key of the state table, so a status named after an
|
|
14098
|
+
* `Object.prototype` member (`toString`, `constructor`) is unknown too, instead
|
|
14099
|
+
* of an empty state block.
|
|
14100
|
+
*
|
|
13925
14101
|
* When the countdown reaches zero while the backend still says `pending`, the
|
|
13926
14102
|
* screen hides the QR and says it is **confirming** — not "expired". A payment
|
|
13927
14103
|
* sent in the last second can still settle, and only the backend knows.
|
|
@@ -17829,7 +18005,12 @@ export declare interface TempestAuth<TUser, TCredentials> {
|
|
|
17829
18005
|
* have happened outside `login()`.
|
|
17830
18006
|
*
|
|
17831
18007
|
* @throws {SessionSupersededError} When the session ended or changed while
|
|
17832
|
-
* the refresh was in flight; its tokens were discarded.
|
|
18008
|
+
* the refresh was in flight; its tokens were discarded. That includes a
|
|
18009
|
+
* `logout()` or `login()` landing after the redemption of another
|
|
18010
|
+
* account and before the switch: it wins over the switch (#591). And a
|
|
18011
|
+
* `login()` still in flight when the redemption brought another account:
|
|
18012
|
+
* the explicit sign-in wins, the switch is discarded and, in body mode,
|
|
18013
|
+
* its refresh token revoked (#595).
|
|
17833
18014
|
*/
|
|
17834
18015
|
refresh: () => Promise<void>;
|
|
17835
18016
|
/**
|
|
@@ -17850,9 +18031,20 @@ export declare interface TempestAuth<TUser, TCredentials> {
|
|
|
17850
18031
|
* session — and the callback uses this. Called where no sign-in happened,
|
|
17851
18032
|
* it costs a needless switch: an upload bound to the session starts over.
|
|
17852
18033
|
*
|
|
18034
|
+
* Two tabs restoring together redeem once (#594). The redemption holds an
|
|
18035
|
+
* origin-wide sign-in lock until the session it brought is installed, so a
|
|
18036
|
+
* tab that calls `restore()` meanwhile waits for it and adopts that
|
|
18037
|
+
* session — its own, if any, ends with `onSessionEnd` `"switch"` and
|
|
18038
|
+
* `elsewhere: true` — and a `refresh()` that waited behind it follows the
|
|
18039
|
+
* new session instead of redeeming the refresh token it spent. Until
|
|
18040
|
+
* 0.84.0 the waiting tab redeemed again: a spent token, which a backend
|
|
18041
|
+
* with reuse detection answers by revoking the whole family, or none at
|
|
18042
|
+
* all, since the restoring tab's teardown had already cleared it.
|
|
18043
|
+
*
|
|
17853
18044
|
* @returns The user of the new session, or null.
|
|
17854
18045
|
* @throws {SessionSupersededError} When a `logout()` or `login()` moved
|
|
17855
|
-
* the session while it was in flight; the new tokens are discarded.
|
|
18046
|
+
* the session while it was in flight; the new tokens are discarded. Also
|
|
18047
|
+
* when the other tab's sign-in it waited for left no session to adopt.
|
|
17856
18048
|
*/
|
|
17857
18049
|
restore: () => Promise<TUser | null>;
|
|
17858
18050
|
/** The current access token, or null. */
|
|
@@ -17884,6 +18076,29 @@ export declare interface TempestAuth<TUser, TCredentials> {
|
|
|
17884
18076
|
* a redemption kept the previous account's key.
|
|
17885
18077
|
*/
|
|
17886
18078
|
sessionKey: () => string | null;
|
|
18079
|
+
/**
|
|
18080
|
+
* Whether the session this preset holds is settled — `false` while it is
|
|
18081
|
+
* still being decided (#596).
|
|
18082
|
+
*
|
|
18083
|
+
* It is `false` while a `login()`, a `restore()` or an account switch is
|
|
18084
|
+
* in flight (their user load included), and while a `refresh()` runs with
|
|
18085
|
+
* no token installed — the boot restore from a refresh cookie. It is
|
|
18086
|
+
* `true` otherwise, signed in or signed out: a signed-out answer is then
|
|
18087
|
+
* the real one, not "the restore has not answered yet".
|
|
18088
|
+
*
|
|
18089
|
+
* What it is for: a store that persists per-account data across boots
|
|
18090
|
+
* must not stamp it while the account is unknown. A cookie app reads
|
|
18091
|
+
* nobody signed in until its restore answers, and the persisted query
|
|
18092
|
+
* cache used to stamp the signed-in account's responses as anonymous in
|
|
18093
|
+
* that window, for the next signed-out boot to hydrate.
|
|
18094
|
+
* `persistQueryClientOffline({ auth })` reads it on its own.
|
|
18095
|
+
*
|
|
18096
|
+
* It says nothing about the user profile: a session restored by
|
|
18097
|
+
* `refresh()` installs a token and a `sessionKey()` without loading the
|
|
18098
|
+
* user. A principal read from the user is known only once that user is
|
|
18099
|
+
* there, which `persistQueryClientOffline` also checks.
|
|
18100
|
+
*/
|
|
18101
|
+
isSessionKnown: () => boolean;
|
|
17887
18102
|
/**
|
|
17888
18103
|
* Stop following the other tabs: removes the `storage` listener this
|
|
17889
18104
|
* preset adds to `window`. Idempotent.
|
|
@@ -20564,7 +20779,16 @@ export declare function useMediaQuery(query: string): boolean;
|
|
|
20564
20779
|
* The containers must be in the DOM when the hook's effect runs — render the
|
|
20565
20780
|
* three empty elements in the same component. The fields are created once per
|
|
20566
20781
|
* `publicKey`; changing the containers, locale or loader afterwards does not
|
|
20567
|
-
* remount them.
|
|
20782
|
+
* remount them. A new `publicKey` remounts empty fields and forgets the previous
|
|
20783
|
+
* BIN, brand and quote with them.
|
|
20784
|
+
*
|
|
20785
|
+
* `tokenize` binds the token to the quote: Mercado Pago's token carries
|
|
20786
|
+
* `first_six_digits`, and a token whose digits are not the quoted BIN is
|
|
20787
|
+
* refused. `binChange` is debounced inside the iframe, so a payer who swaps the
|
|
20788
|
+
* card number and submits at once would otherwise send the new card with the
|
|
20789
|
+
* old card's brand and installments. A token response without
|
|
20790
|
+
* `first_six_digits` is not refused — there is nothing to compare — and the
|
|
20791
|
+
* backend and Mercado Pago still validate the brand on the charge.
|
|
20568
20792
|
*
|
|
20569
20793
|
* @tempest-limits empty-catch — `unmount()` throws when MercadoPago.js already
|
|
20570
20794
|
* tore the iframe down (a container removed by React first). The cleanup has
|
|
@@ -20626,7 +20850,10 @@ export declare interface UseMercadoPagoCardResult {
|
|
|
20626
20850
|
* Ask Mercado Pago for a card token. Throws when the fields are not ready,
|
|
20627
20851
|
* the BIN has not been identified, or `installments` is not one of the
|
|
20628
20852
|
* offered options — each of which would otherwise surface later as an
|
|
20629
|
-
* opaque `400` from the backend.
|
|
20853
|
+
* opaque `400` from the backend. Also throws, after the token is created,
|
|
20854
|
+
* when the token's `first_six_digits` is not the BIN the brand and
|
|
20855
|
+
* installments were quoted for: the payer changed the card number after the
|
|
20856
|
+
* quote, and charging it would send one card with another card's brand.
|
|
20630
20857
|
*/
|
|
20631
20858
|
tokenize: (input: CardTokenizeInput) => Promise<CardTokenResult>;
|
|
20632
20859
|
}
|
|
@@ -21278,7 +21505,10 @@ export declare interface UsePasskeySignInResult<TResult> extends PasskeyCapabili
|
|
|
21278
21505
|
* A failed read keeps the last good charge and is exposed as `error`; the poll
|
|
21279
21506
|
* goes on, because a dropped request is not a payment state.
|
|
21280
21507
|
*
|
|
21281
|
-
*
|
|
21508
|
+
* An update for another `provider` or `provider_charge_id` is ignored, and a
|
|
21509
|
+
* `paid` charge only moves on to `refunded` or `charged_back` — a late
|
|
21510
|
+
* `expired` never replaces it. Passing a charge with a different `provider` or
|
|
21511
|
+
* `provider_charge_id` restarts the follow.
|
|
21282
21512
|
*
|
|
21283
21513
|
* @param initial - The charge as created.
|
|
21284
21514
|
* @param options - `refresh`, `subscribe` and the poll period.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tempest-react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.0",
|
|
4
4
|
"description": "SDK público da Tempest com componentes, hooks e integrações para projetos React.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -249,6 +249,12 @@
|
|
|
249
249
|
"node": ">=22.12"
|
|
250
250
|
},
|
|
251
251
|
"overrides": {
|
|
252
|
+
"@microsoft/api-extractor": {
|
|
253
|
+
"minimatch": "^11.0.1"
|
|
254
|
+
},
|
|
255
|
+
"@typescript-eslint/typescript-estree": {
|
|
256
|
+
"minimatch": "^11.0.1"
|
|
257
|
+
},
|
|
252
258
|
"rolldown": "1.2.14"
|
|
253
259
|
}
|
|
254
260
|
}
|
package/template/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@types/react": "^19.2.17",
|
|
25
25
|
"@types/react-dom": "^19.2.3",
|
|
26
26
|
"@vitejs/plugin-react": "^6.0.4",
|
|
27
|
-
"eslint": "^10.
|
|
27
|
+
"eslint": "^10.15.0",
|
|
28
28
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
29
29
|
"eslint-plugin-react-refresh": "^0.5.3",
|
|
30
30
|
"eslint-plugin-simple-import-sort": "^14.0.0",
|
|
@@ -34,5 +34,10 @@
|
|
|
34
34
|
"typescript": "~6.0.3",
|
|
35
35
|
"typescript-eslint": "^8.65.0",
|
|
36
36
|
"vite": "^8.3.3"
|
|
37
|
+
},
|
|
38
|
+
"overrides": {
|
|
39
|
+
"@typescript-eslint/typescript-estree": {
|
|
40
|
+
"minimatch": "^11.0.1"
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
43
|
}
|