@fleetless/sdk 4.2.0-next.1 → 4.3.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/CHANGELOG.md +18 -1
- package/dist/index.cjs +1139 -414
- package/dist/index.d.cts +223 -27
- package/dist/index.d.ts +223 -27
- package/dist/index.js +1139 -414
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -282,6 +282,7 @@ declare const jobRun: z.ZodObject<{
|
|
|
282
282
|
}>;
|
|
283
283
|
id: z.ZodUUID;
|
|
284
284
|
label: z.ZodString;
|
|
285
|
+
name: z.ZodNullable<z.ZodString>;
|
|
285
286
|
}, z.core.$strip>;
|
|
286
287
|
seq: z.ZodNumber;
|
|
287
288
|
progress: z.ZodNullable<z.ZodNumber>;
|
|
@@ -323,6 +324,7 @@ declare const jobRunListResponse: z.ZodObject<{
|
|
|
323
324
|
}>;
|
|
324
325
|
id: z.ZodUUID;
|
|
325
326
|
label: z.ZodString;
|
|
327
|
+
name: z.ZodNullable<z.ZodString>;
|
|
326
328
|
}, z.core.$strip>;
|
|
327
329
|
seq: z.ZodNumber;
|
|
328
330
|
progress: z.ZodNullable<z.ZodNumber>;
|
|
@@ -531,10 +533,11 @@ declare const clientOidcErrorCode: z.ZodEnum<{
|
|
|
531
533
|
}>;
|
|
532
534
|
type ClientOidcErrorCode = z.infer<typeof clientOidcErrorCode>;
|
|
533
535
|
/**
|
|
534
|
-
* **A pending MCP authorization, as the app's own consent screen reads it
|
|
535
|
-
*
|
|
536
|
-
* app
|
|
537
|
-
*
|
|
536
|
+
* **A pending MCP authorization, as the app's own consent screen reads it.**
|
|
537
|
+
* `authorize` redirects to the app's `mcp_login_url` with an interaction id,
|
|
538
|
+
* the app authenticates the user with its normal UI, shows this, and approves
|
|
539
|
+
* or denies through the API. An app with no `mcp_login_url` gets the hosted
|
|
540
|
+
* MCP sign-in instead, which reads and decides the same interaction.
|
|
538
541
|
*
|
|
539
542
|
* `client_name_verified` is `z.literal(false)`, and that is the whole point of
|
|
540
543
|
* the field. The name comes from an **unauthenticated** dynamic registration —
|
|
@@ -624,6 +627,7 @@ declare const clientIdentity: z.ZodObject<{
|
|
|
624
627
|
app_id: z.ZodNullable<z.ZodUUID>;
|
|
625
628
|
role_id: z.ZodNullable<z.ZodUUID>;
|
|
626
629
|
email: z.ZodNullable<z.ZodEmail>;
|
|
630
|
+
two_factor_enabled: z.ZodNullable<z.ZodBoolean>;
|
|
627
631
|
}, z.core.$strip>;
|
|
628
632
|
type ClientIdentity = z.infer<typeof clientIdentity>;
|
|
629
633
|
|
|
@@ -850,7 +854,7 @@ type CancelRejectedDetails = z.infer<typeof cancelRejectedDetails>;
|
|
|
850
854
|
* list is the shared vocabulary, not a closed set, so a new refusal never
|
|
851
855
|
* needs a contracts release before it can be reported honestly.
|
|
852
856
|
*/
|
|
853
|
-
declare const ERROR_CODES: readonly ["not_found", "validation_error", "bad_request", "unknown_datapoint", "invalid_token", "protocol_mismatch", "bridge_too_old", "invalid_frame", "duplicate_slug", "reserved_slug", "unknown_slug", "unknown_field_path", "unknown_type", "unknown_topic", "invalid_rate", "invalid_range", "config_conflict", "no_data", "robot_offline", "bridge_timeout", "unauthorized", "forbidden", "invalid_credentials", "token_expired", "token_revoked", "email_taken", "identifier_taken", "weak_password", "account_blocked", "busy", "parameter_invalid", "cancel_rejected", "job_lost", "job_unknown_to_bridge", "action_server_lost", "action_failed", "goal_rejected", "goal_send_failed", "result_failed", "goal_uncontrollable", "bridge_disconnected", "config_changed", "publisher_busy", "unknown_command", "not_subscribable", "camera_offline", "no_snapshot_yet", "live_unavailable", "wrong_kind", "not_recorded", "not_aggregatable", "quota_exceeded", "credential_in_use", "goal_timeout", "robot_in_use", "robot_deletion_partial", "job_queue_full", "invalid_uuid", "rate_limited", "tier_required", "token_spent", "service_timeout", "asset_missing", "dynamic_registration_disabled", "client_limit_reached", "idp_unavailable", "mcp_disabled", "tool_not_available", "capability_required", "last_owner", "target_state_conflict", "signup_closed", "draft_not_a_document", "internal_error", "not_cancellable", "unsupported_media_type", "wrong_browser", "invalid_yaml", "unstorable_yaml", "registration_closed", "domain_not_allowed", "email_unverified", "origin_not_allowed", "template_invalid", "provider_disabled", "provider_misconfigured", "invalid_redirect_uri", "interaction_expired"];
|
|
857
|
+
declare const ERROR_CODES: readonly ["not_found", "validation_error", "bad_request", "unknown_datapoint", "invalid_token", "protocol_mismatch", "bridge_too_old", "invalid_frame", "duplicate_slug", "reserved_slug", "unknown_slug", "unknown_field_path", "unknown_type", "unknown_topic", "invalid_rate", "invalid_range", "config_conflict", "no_data", "robot_offline", "bridge_timeout", "unauthorized", "forbidden", "invalid_credentials", "token_expired", "token_revoked", "email_taken", "identifier_taken", "weak_password", "account_blocked", "busy", "parameter_invalid", "cancel_rejected", "job_lost", "job_unknown_to_bridge", "action_server_lost", "action_failed", "goal_rejected", "goal_send_failed", "result_failed", "goal_uncontrollable", "bridge_disconnected", "config_changed", "publisher_busy", "unknown_command", "not_subscribable", "camera_offline", "no_snapshot_yet", "live_unavailable", "wrong_kind", "not_recorded", "not_aggregatable", "quota_exceeded", "credential_in_use", "goal_timeout", "robot_in_use", "robot_deletion_partial", "job_queue_full", "invalid_uuid", "rate_limited", "tier_required", "token_spent", "service_timeout", "asset_missing", "dynamic_registration_disabled", "client_limit_reached", "idp_unavailable", "mcp_disabled", "tool_not_available", "capability_required", "last_owner", "role_name_taken", "role_in_use", "last_role", "target_state_conflict", "signup_closed", "draft_not_a_document", "internal_error", "not_cancellable", "unsupported_media_type", "wrong_browser", "invalid_yaml", "unstorable_yaml", "registration_closed", "domain_not_allowed", "email_unverified", "origin_not_allowed", "template_invalid", "provider_disabled", "provider_misconfigured", "invalid_redirect_uri", "interaction_expired", "invalid_code", "method_not_allowed"];
|
|
854
858
|
type ErrorCode = (typeof ERROR_CODES)[number];
|
|
855
859
|
|
|
856
860
|
/**
|
|
@@ -1577,8 +1581,15 @@ declare class InMemoryTokenStore implements TokenStore {
|
|
|
1577
1581
|
interface RegisterOptions {
|
|
1578
1582
|
/** The address the verification mail goes to. Nothing works until that link is spent. */
|
|
1579
1583
|
email: string;
|
|
1580
|
-
/**
|
|
1581
|
-
|
|
1584
|
+
/**
|
|
1585
|
+
* At least 12 characters — `clientRegisterRequest` refuses less with a
|
|
1586
|
+
* `validation_error`. **Optional, and omitted from the request entirely**
|
|
1587
|
+
* when you do not pass it: an app whose `sign_in_methods` is email-code
|
|
1588
|
+
* only has no password to set, and sending the key at all (even as
|
|
1589
|
+
* `undefined`) would be a `422` against the strict schema — same reason as
|
|
1590
|
+
* `displayName` below.
|
|
1591
|
+
*/
|
|
1592
|
+
password?: string;
|
|
1582
1593
|
/**
|
|
1583
1594
|
* What the app should call this person. Optional, and **omitted from the
|
|
1584
1595
|
* request entirely** when you do not pass it — `clientRegisterRequest` is a
|
|
@@ -1591,11 +1602,105 @@ interface RegisterOptions {
|
|
|
1591
1602
|
interface AcceptInvitationOptions {
|
|
1592
1603
|
/** The `token` from the invitation link the developer's app was linked to. */
|
|
1593
1604
|
token: string;
|
|
1594
|
-
/**
|
|
1595
|
-
|
|
1605
|
+
/**
|
|
1606
|
+
* At least 12 characters. The invitation fixes the role; this call fixes
|
|
1607
|
+
* the credential. **Optional, and omitted from the request entirely** when
|
|
1608
|
+
* you do not pass it — same email-code-only reason as `RegisterOptions.password`.
|
|
1609
|
+
*/
|
|
1610
|
+
password?: string;
|
|
1596
1611
|
/** Optional, and omitted from the request entirely when absent — same strict-schema reason as `RegisterOptions.displayName`. */
|
|
1597
1612
|
displayName?: string;
|
|
1598
1613
|
}
|
|
1614
|
+
/**
|
|
1615
|
+
* `verifyTwoFactor()`'s input — the `challenge` a sign-in step answered with
|
|
1616
|
+
* `two_factor_required`, plus exactly one of the authenticator's current
|
|
1617
|
+
* code or a recovery code. Sending both, or neither, is a `400
|
|
1618
|
+
* validation_error` the cloud answers (`clientTwoFactorVerifyRequest` is a
|
|
1619
|
+
* strict schema with both fields optional) — this SDK does not duplicate
|
|
1620
|
+
* that check client-side, it only serializes whichever one the caller gave.
|
|
1621
|
+
*/
|
|
1622
|
+
interface VerifyTwoFactorOptions {
|
|
1623
|
+
/** The handle a sign-in step (`login`, `verifyLoginCode`, …) answered. Five minutes, five wrong codes. */
|
|
1624
|
+
challenge: string;
|
|
1625
|
+
/** The authenticator's current six digits. Accepted at most once — the same code sent twice signs in exactly once. */
|
|
1626
|
+
code?: string;
|
|
1627
|
+
/** One of the ten recovery codes, spent by its use. Use this instead of `code` when the authenticator itself is unavailable. */
|
|
1628
|
+
recoveryCode?: string;
|
|
1629
|
+
}
|
|
1630
|
+
/**
|
|
1631
|
+
* `beginTwoFactorSetup()`'s input. **Two ways in, decided by what is
|
|
1632
|
+
* passed**: a `challenge` from a `two_factor_setup_required` sign-in step
|
|
1633
|
+
* (no session exists yet, so the challenge itself is the credential), or
|
|
1634
|
+
* nothing at all — from the app's own account settings, where the caller's
|
|
1635
|
+
* *current session* is the credential instead. Passing neither a challenge
|
|
1636
|
+
* nor holding a session is `401 unauthorized` from the cloud, not a
|
|
1637
|
+
* client-side refusal: this SDK has no way to tell "forgot to pass a
|
|
1638
|
+
* challenge" apart from "forgot to sign in first" without asking the server.
|
|
1639
|
+
*/
|
|
1640
|
+
interface BeginTwoFactorSetupOptions {
|
|
1641
|
+
challenge?: string;
|
|
1642
|
+
}
|
|
1643
|
+
/** What `beginTwoFactorSetup()` resolves with — not yet in use until `confirmTwoFactorSetup` accepts a code from it. */
|
|
1644
|
+
interface TwoFactorSetup {
|
|
1645
|
+
/** The shared secret, for a manual "enter this key" fallback. */
|
|
1646
|
+
secret: string;
|
|
1647
|
+
/** The full `otpauth://` URI, for rendering as a QR code. */
|
|
1648
|
+
otpauthUrl: string;
|
|
1649
|
+
}
|
|
1650
|
+
/** `confirmTwoFactorSetup()`'s input — same two ways in as `beginTwoFactorSetup`, plus the code from the new authenticator. */
|
|
1651
|
+
interface ConfirmTwoFactorSetupOptions {
|
|
1652
|
+
/** A code from the authenticator `beginTwoFactorSetup` just started. A mismatch is `invalid_code`. */
|
|
1653
|
+
code: string;
|
|
1654
|
+
/** The same challenge `beginTwoFactorSetup` was given, during a sign-in. Omit it when setting up from account settings instead. */
|
|
1655
|
+
challenge?: string;
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* What `confirmTwoFactorSetup()` resolves with: the ten recovery codes,
|
|
1659
|
+
* shown this once — any earlier set is void. The session itself is not
|
|
1660
|
+
* here; it is saved to the token store the same way every other sign-in
|
|
1661
|
+
* step saves one, not handed back for the caller to do that itself.
|
|
1662
|
+
*/
|
|
1663
|
+
interface TwoFactorSetupConfirmation {
|
|
1664
|
+
recoveryCodes: string[];
|
|
1665
|
+
}
|
|
1666
|
+
/**
|
|
1667
|
+
* What every sign-in step (`login`, `verifyEmail`, `confirmPasswordReset`,
|
|
1668
|
+
* `acceptInvitation`, `verifyLoginCode`) resolves with — the session may not be ready yet.
|
|
1669
|
+
*
|
|
1670
|
+
* `'signed_in'` means exactly that: the session was stored, same as these
|
|
1671
|
+
* calls always did. The other two mean the cloud is still waiting on a
|
|
1672
|
+
* second factor — no session exists yet, nothing was stored, and `challenge`
|
|
1673
|
+
* is a short-lived handle (five minutes) for the next call:
|
|
1674
|
+
* `'two_factor_required'` when the person already has an authenticator
|
|
1675
|
+
* (`POST /api/client/two-factor/verify`), `'two_factor_setup_required'` when
|
|
1676
|
+
* the app requires one and the person has none yet
|
|
1677
|
+
* (`POST /api/client/two-factor/setup` then `…/setup/confirm`). An app
|
|
1678
|
+
* without two-factor on at all never sees either — every sign-in step
|
|
1679
|
+
* resolves `{ status: 'signed_in' }`.
|
|
1680
|
+
*/
|
|
1681
|
+
type SignInResult = {
|
|
1682
|
+
status: 'signed_in';
|
|
1683
|
+
} | {
|
|
1684
|
+
status: 'two_factor_required';
|
|
1685
|
+
challenge: string;
|
|
1686
|
+
} | {
|
|
1687
|
+
status: 'two_factor_setup_required';
|
|
1688
|
+
challenge: string;
|
|
1689
|
+
};
|
|
1690
|
+
/**
|
|
1691
|
+
* Which credential-based ways in the app's login screen should draw, as
|
|
1692
|
+
* `signInMethods()` answers it: a password field, a "mail me a code" link, or
|
|
1693
|
+
* both. Federated buttons are `listProviders()`'s own answer, not this one —
|
|
1694
|
+
* the two routes share one response on the wire (`GET /api/client/providers`)
|
|
1695
|
+
* but ask different questions, so the SDK answers them separately rather than
|
|
1696
|
+
* handing every caller a shape with fields it did not ask about.
|
|
1697
|
+
*/
|
|
1698
|
+
interface SignInMethods {
|
|
1699
|
+
/** Whether `login(email, password)` is on for this app. */
|
|
1700
|
+
password: boolean;
|
|
1701
|
+
/** Whether `requestLoginCode`/`verifyLoginCode` is on for this app. */
|
|
1702
|
+
emailCode: boolean;
|
|
1703
|
+
}
|
|
1599
1704
|
/** One sign-in button on the app's own login screen, as `listProviders()` lists it. */
|
|
1600
1705
|
interface ProviderButton {
|
|
1601
1706
|
/** What `beginOidcLogin` addresses this provider by. */
|
|
@@ -1699,10 +1804,10 @@ interface McpInteractionDecision {
|
|
|
1699
1804
|
*
|
|
1700
1805
|
* **A client built with a `serverKey` refuses everything that needs an app
|
|
1701
1806
|
* user's own session** with `invalid_option`, before any request. `me()`,
|
|
1702
|
-
* `listProviders()`, `
|
|
1703
|
-
* work on one: the first is what a server key
|
|
1704
|
-
*
|
|
1705
|
-
* no network.
|
|
1807
|
+
* `listProviders()`, `signInMethods()`, `mcpInteraction()` and
|
|
1808
|
+
* `oidcErrorFromCallback()` still work on one: the first is what a server key
|
|
1809
|
+
* is *for*, the next three are public reads the cloud answers without any
|
|
1810
|
+
* credential at all, and the last touches no network.
|
|
1706
1811
|
*/
|
|
1707
1812
|
interface AuthApi {
|
|
1708
1813
|
/**
|
|
@@ -1726,26 +1831,48 @@ interface AuthApi {
|
|
|
1726
1831
|
*/
|
|
1727
1832
|
register(input: RegisterOptions): Promise<void>;
|
|
1728
1833
|
/**
|
|
1729
|
-
* Spends a verification token and **stores the session it answers with
|
|
1730
|
-
* the person is not asked to log in
|
|
1731
|
-
* the mail
|
|
1834
|
+
* Spends a verification token and **stores the session it answers with**
|
|
1835
|
+
* when the sign-in is complete, so the person is not asked to log in
|
|
1836
|
+
* immediately after proving they can read the mail — see `SignInResult`
|
|
1837
|
+
* for the second-factor case, where nothing is stored yet.
|
|
1732
1838
|
*
|
|
1733
1839
|
* `token_spent` covers unknown, expired and already-used alike — one code,
|
|
1734
1840
|
* because the remedy is one thing: ask for a fresh link with
|
|
1735
1841
|
* `resendVerification`. An app rendering this refusal should offer that.
|
|
1736
1842
|
*/
|
|
1737
|
-
verifyEmail(token: string): Promise<
|
|
1843
|
+
verifyEmail(token: string): Promise<SignInResult>;
|
|
1738
1844
|
/** Asks for the verification mail again. Resolves on `202` for every policy-allowed request, existing address or not — same reason as `register`. */
|
|
1739
1845
|
resendVerification(email: string): Promise<void>;
|
|
1740
1846
|
/**
|
|
1741
1847
|
* Exchanges email + password, and the client's configured app identifier, for
|
|
1742
|
-
* a session
|
|
1848
|
+
* a session — or a second-factor challenge, see `SignInResult`.
|
|
1743
1849
|
*
|
|
1744
1850
|
* `invalid_credentials` is answered identically for a wrong password, a
|
|
1745
1851
|
* blocked account and one still waiting to verify. Do not try to tell them
|
|
1746
1852
|
* apart — there is nothing in the answer that does, deliberately.
|
|
1747
1853
|
*/
|
|
1748
|
-
login(email: string, password: string): Promise<
|
|
1854
|
+
login(email: string, password: string): Promise<SignInResult>;
|
|
1855
|
+
/**
|
|
1856
|
+
* Mails a six-digit sign-in code to `email`, valid ten minutes — the
|
|
1857
|
+
* password-free alternative to `login`. Resolves on the route's `202` for
|
|
1858
|
+
* every policy-allowed request, whether or not the address names an
|
|
1859
|
+
* account, same discipline as `register`/`resendVerification`/
|
|
1860
|
+
* `requestPasswordReset`: this is no enumeration oracle either. A fresh
|
|
1861
|
+
* request expires the previous code for the same address.
|
|
1862
|
+
*/
|
|
1863
|
+
requestLoginCode(email: string): Promise<void>;
|
|
1864
|
+
/**
|
|
1865
|
+
* Spends a mailed sign-in code for a session — or a second-factor
|
|
1866
|
+
* challenge, see `SignInResult`, exactly like `login`.
|
|
1867
|
+
*
|
|
1868
|
+
* A wrong code is `invalid_code`, carrying `details.attempts_left`; five
|
|
1869
|
+
* wrong attempts, or the tenth minute, spend the code the same way a
|
|
1870
|
+
* correct one would, and the recovery is the same either way: call
|
|
1871
|
+
* `requestLoginCode` again. A pending-verification account that spends a
|
|
1872
|
+
* code is activated — reading the mail at that address is the proof
|
|
1873
|
+
* verification asks for.
|
|
1874
|
+
*/
|
|
1875
|
+
verifyLoginCode(email: string, code: string): Promise<SignInResult>;
|
|
1749
1876
|
/**
|
|
1750
1877
|
* Ends the session: revokes the whole refresh-token family server-side (a
|
|
1751
1878
|
* stolen refresh token stops working immediately), closes this client's live
|
|
@@ -1770,7 +1897,17 @@ interface AuthApi {
|
|
|
1770
1897
|
* which Fleetless never did better than it.
|
|
1771
1898
|
*/
|
|
1772
1899
|
logout(): Promise<void>;
|
|
1773
|
-
/**
|
|
1900
|
+
/**
|
|
1901
|
+
* Who the caller turned out to be, without decoding a token client-side —
|
|
1902
|
+
* which is how apps end up trusting claims nobody verified.
|
|
1903
|
+
*
|
|
1904
|
+
* Throws the SDK's own `no_session` **before any request is sent** when
|
|
1905
|
+
* nothing is stored — which is exactly the state a sign-in step leaves a
|
|
1906
|
+
* caller in while a second factor is still pending (see `SignInResult`):
|
|
1907
|
+
* there is no session yet to ask the cloud about, so this fails the same
|
|
1908
|
+
* way "never logged in" does, rather than round-tripping to a route that
|
|
1909
|
+
* would just answer `unauthorized` for having no bearer at all.
|
|
1910
|
+
*/
|
|
1774
1911
|
me(): Promise<ClientIdentity>;
|
|
1775
1912
|
/**
|
|
1776
1913
|
* Changes the current app user's password.
|
|
@@ -1792,21 +1929,68 @@ interface AuthApi {
|
|
|
1792
1929
|
requestPasswordReset(email: string): Promise<void>;
|
|
1793
1930
|
/**
|
|
1794
1931
|
* Spends a reset token, sets the new password and **stores the session it
|
|
1795
|
-
* answers with
|
|
1796
|
-
*
|
|
1797
|
-
* holding a session.
|
|
1932
|
+
* answers with** when the sign-in is complete (see `SignInResult`). Every
|
|
1933
|
+
* refresh family of that user is revoked first — a forgotten password is
|
|
1934
|
+
* one of the two states where somebody else may be holding a session.
|
|
1798
1935
|
*/
|
|
1799
|
-
confirmPasswordReset(token: string, newPassword: string): Promise<
|
|
1936
|
+
confirmPasswordReset(token: string, newPassword: string): Promise<SignInResult>;
|
|
1800
1937
|
/**
|
|
1801
1938
|
* Accepts an app invitation: creates the account (or activates one invited
|
|
1802
1939
|
* before it existed) with the role the invitation fixed, and **stores the
|
|
1803
|
-
* session
|
|
1940
|
+
* session** when the sign-in is complete (see `SignInResult`).
|
|
1804
1941
|
*
|
|
1805
1942
|
* An invitation always bypasses the app's domain whitelist — a developer
|
|
1806
1943
|
* inviting somebody by hand has already made the decision the whitelist
|
|
1807
1944
|
* automates.
|
|
1808
1945
|
*/
|
|
1809
|
-
acceptInvitation(input: AcceptInvitationOptions): Promise<
|
|
1946
|
+
acceptInvitation(input: AcceptInvitationOptions): Promise<SignInResult>;
|
|
1947
|
+
/**
|
|
1948
|
+
* Answers a `two_factor_required` challenge and **saves the session
|
|
1949
|
+
* unconditionally** — unlike `login`/`verifyEmail`/`confirmPasswordReset`/
|
|
1950
|
+
* `acceptInvitation`/`verifyLoginCode`, this call's answer is never a
|
|
1951
|
+
* `SignInResult` union: the second factor is the last step, so the cloud
|
|
1952
|
+
* has nothing left to ask for and always answers tokens.
|
|
1953
|
+
*
|
|
1954
|
+
* A wrong code or recovery code is `invalid_code`, carrying
|
|
1955
|
+
* `details.attempts_left`; five wrong attempts, or the challenge's own
|
|
1956
|
+
* five minutes, spend it the same way a correct answer would — the
|
|
1957
|
+
* sign-in has to start over from `login`/`requestLoginCode`/etc.
|
|
1958
|
+
*/
|
|
1959
|
+
verifyTwoFactor(input: VerifyTwoFactorOptions): Promise<void>;
|
|
1960
|
+
/**
|
|
1961
|
+
* Starts an authenticator setup and hands back its secret and `otpauth://`
|
|
1962
|
+
* URL for rendering a QR code. **Two ways in**: pass the `challenge` a
|
|
1963
|
+
* `two_factor_setup_required` sign-in step answered, when the app requires
|
|
1964
|
+
* a second factor and this person has none yet — no session exists at
|
|
1965
|
+
* that point, so the challenge is the credential; or pass nothing at all,
|
|
1966
|
+
* from the app's own account settings, where the *current session* is the
|
|
1967
|
+
* credential instead. The secret is not in use until
|
|
1968
|
+
* `confirmTwoFactorSetup` accepts a code from it — calling this twice
|
|
1969
|
+
* replaces the pending secret, and an account that already has an
|
|
1970
|
+
* authenticator keeps it until the new one is confirmed.
|
|
1971
|
+
*/
|
|
1972
|
+
beginTwoFactorSetup(input?: BeginTwoFactorSetupOptions): Promise<TwoFactorSetup>;
|
|
1973
|
+
/**
|
|
1974
|
+
* Confirms the authenticator `beginTwoFactorSetup` just started, with a
|
|
1975
|
+
* code from it, and **saves the session it answers** — same two ways in
|
|
1976
|
+
* as `beginTwoFactorSetup` (a sign-in `challenge`, or the current
|
|
1977
|
+
* session). On success the authenticator is on and ten recovery codes
|
|
1978
|
+
* come back, shown this once; any earlier set is void. A code that does
|
|
1979
|
+
* not match the pending secret is `invalid_code`.
|
|
1980
|
+
*
|
|
1981
|
+
* From account settings, every other session of the account ends and this
|
|
1982
|
+
* call's own session is replaced with the fresh one it answers — the same
|
|
1983
|
+
* discipline `changePassword` already keeps.
|
|
1984
|
+
*/
|
|
1985
|
+
confirmTwoFactorSetup(input: ConfirmTwoFactorSetupOptions): Promise<TwoFactorSetupConfirmation>;
|
|
1986
|
+
/**
|
|
1987
|
+
* Turns the signed-in app user's authenticator off — the account's own
|
|
1988
|
+
* door, not the developer's support one (`DELETE
|
|
1989
|
+
* /api/apps/:id/users/:userId/two-factor`, management-side). A current
|
|
1990
|
+
* code proves the person still holds the authenticator before it and
|
|
1991
|
+
* every recovery code are removed; a stolen session alone cannot do this.
|
|
1992
|
+
*/
|
|
1993
|
+
disableTwoFactor(code: string): Promise<void>;
|
|
1810
1994
|
/**
|
|
1811
1995
|
* The app's **enabled** sign-in providers, for drawing the buttons on your
|
|
1812
1996
|
* own login screen. A disabled provider is not a button that refuses; it is a
|
|
@@ -1818,6 +2002,18 @@ interface AuthApi {
|
|
|
1818
2002
|
* is configured.
|
|
1819
2003
|
*/
|
|
1820
2004
|
listProviders(): Promise<ProviderButton[]>;
|
|
2005
|
+
/**
|
|
2006
|
+
* Which credential-based sign-in methods this app has on, for drawing a
|
|
2007
|
+
* password field, a "get a code by email" link, or both, on your own login
|
|
2008
|
+
* screen — the other half of what the login screen needs, the federated
|
|
2009
|
+
* buttons being `listProviders()`'s own answer.
|
|
2010
|
+
*
|
|
2011
|
+
* Public and unauthenticated, same route as `listProviders()`
|
|
2012
|
+
* (`GET /api/client/providers`) — each call is its own request, picking a
|
|
2013
|
+
* different field out of the same response; call both if your login
|
|
2014
|
+
* screen needs both.
|
|
2015
|
+
*/
|
|
2016
|
+
signInMethods(): Promise<SignInMethods>;
|
|
1821
2017
|
/**
|
|
1822
2018
|
* Builds the URL that starts a federated sign-in, with a fresh `state` and a
|
|
1823
2019
|
* fresh PKCE verifier. **Makes no network call and does not navigate** —
|
|
@@ -2515,4 +2711,4 @@ interface FleetlessClient {
|
|
|
2515
2711
|
*/
|
|
2516
2712
|
declare function createClient(options: FleetlessClientOptions): FleetlessClient;
|
|
2517
2713
|
|
|
2518
|
-
export { type AcceptInvitationOptions, type ActionsApi, type Asset, type AssetBytes, type AssetListResponse, type AssetsApi, type AuthApi, type BeginOidcLoginOptions, type BusyDetails, CANCEL_RETURN_CODES, type CameraDescriptor, type CameraLiveSession, type CameraSnapshot, type CameraSnapshotMeta, type CamerasApi, type CancelRejectedDetails, type CancelReturnCode, type ClientIdentity, type ClientMcpInteraction, type ClientOidcErrorCode, type ClientRobotListItem, type CompleteOidcLoginOptions, type CreateMeshLoaderOptions, type CredentialSource, type DatapointEvent, type DatapointSubscription, type DatapointSubscriptionHandlers, type DatapointValue, type DatapointsApi, type FleetlessClient, type FleetlessClientConfig, type FleetlessClientOptions, FleetlessError, type FleetlessErrorCode, type FleetlessErrorOptions, type HistoryAggregation, type HistoryBucketsResponse, type HistoryOptions, type HistorySamplesResponse, InMemoryTokenStore, type InvokeOptions, type Job, type JobEvent, type JobHistoryOptions, type JobOrigin, type JobRun, type JobRunListResponse, type JobState, type JobSubscription, type JobSubscriptionHandlers, type JobsApi, type McpCapabilities, type McpConsentGrant, type McpExposure, type McpInteractionDecision, type McpRobotDatasheet, type MeshLoaderDelegate, type OidcLoginRequest, type ParameterInvalidDetails, type ParameterViolation, type PrepareUrdfSceneOptions, type ProviderButton, type PublishersApi, type RateLimitDetails, type RegisterOptions, type RobotsApi, SDK_ERROR_CODES, type SdkErrorCode, type SendCommandOptions, type ServicesApi, type StoredSession, type TokenStore, type UrdfCompleteness, type UrdfSceneManager, type UrdfSceneResources, cancelRejectedDetails, createClient, parameterInvalidDetails };
|
|
2714
|
+
export { type AcceptInvitationOptions, type ActionsApi, type Asset, type AssetBytes, type AssetListResponse, type AssetsApi, type AuthApi, type BeginOidcLoginOptions, type BeginTwoFactorSetupOptions, type BusyDetails, CANCEL_RETURN_CODES, type CameraDescriptor, type CameraLiveSession, type CameraSnapshot, type CameraSnapshotMeta, type CamerasApi, type CancelRejectedDetails, type CancelReturnCode, type ClientIdentity, type ClientMcpInteraction, type ClientOidcErrorCode, type ClientRobotListItem, type CompleteOidcLoginOptions, type ConfirmTwoFactorSetupOptions, type CreateMeshLoaderOptions, type CredentialSource, type DatapointEvent, type DatapointSubscription, type DatapointSubscriptionHandlers, type DatapointValue, type DatapointsApi, type FleetlessClient, type FleetlessClientConfig, type FleetlessClientOptions, FleetlessError, type FleetlessErrorCode, type FleetlessErrorOptions, type HistoryAggregation, type HistoryBucketsResponse, type HistoryOptions, type HistorySamplesResponse, InMemoryTokenStore, type InvokeOptions, type Job, type JobEvent, type JobHistoryOptions, type JobOrigin, type JobRun, type JobRunListResponse, type JobState, type JobSubscription, type JobSubscriptionHandlers, type JobsApi, type McpCapabilities, type McpConsentGrant, type McpExposure, type McpInteractionDecision, type McpRobotDatasheet, type MeshLoaderDelegate, type OidcLoginRequest, type ParameterInvalidDetails, type ParameterViolation, type PrepareUrdfSceneOptions, type ProviderButton, type PublishersApi, type RateLimitDetails, type RegisterOptions, type RobotsApi, SDK_ERROR_CODES, type SdkErrorCode, type SendCommandOptions, type ServicesApi, type SignInMethods, type SignInResult, type StoredSession, type TokenStore, type TwoFactorSetup, type TwoFactorSetupConfirmation, type UrdfCompleteness, type UrdfSceneManager, type UrdfSceneResources, type VerifyTwoFactorOptions, cancelRejectedDetails, createClient, parameterInvalidDetails };
|