@oxyhq/core 5.5.0 → 7.0.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/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/HttpService.js +7 -4
- package/dist/cjs/OxyServices.base.js +7 -102
- package/dist/cjs/boot/coldBootV2.js +350 -0
- package/dist/cjs/boot/deviceBootReturn.js +152 -0
- package/dist/cjs/crypto/keyManager.js +95 -0
- package/dist/cjs/i18n/locales/en-US.json +13 -1
- package/dist/cjs/i18n/locales/es-ES.json +13 -1
- package/dist/cjs/i18n/locales/locales/en-US.json +13 -1
- package/dist/cjs/i18n/locales/locales/es-ES.json +13 -1
- package/dist/cjs/index.js +54 -45
- package/dist/cjs/mixins/OxyServices.accounts.js +13 -26
- package/dist/cjs/mixins/OxyServices.auth.js +66 -201
- package/dist/cjs/mixins/OxyServices.deviceBoot.js +119 -0
- package/dist/cjs/mixins/index.js +8 -17
- package/dist/cjs/server/index.js +2 -2
- package/dist/cjs/session/SessionClient.js +40 -1
- package/dist/cjs/session/authStateStore.js +284 -0
- package/dist/cjs/session/refresh.js +264 -0
- package/dist/cjs/shared/utils/debugUtils.js +3 -3
- package/dist/cjs/utils/accountUtils.js +1 -55
- package/dist/cjs/utils/authWebUrl.js +10 -39
- package/dist/cjs/utils/coldBoot.js +10 -8
- package/dist/cjs/utils/platform.js +19 -0
- package/dist/cjs/utils/registrableApex.js +49 -0
- package/dist/cjs/utils/ssoBounce.js +15 -362
- package/dist/cjs/utils/validationUtils.js +57 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/HttpService.js +7 -4
- package/dist/esm/OxyServices.base.js +7 -102
- package/dist/esm/boot/coldBootV2.js +344 -0
- package/dist/esm/boot/deviceBootReturn.js +146 -0
- package/dist/esm/crypto/keyManager.js +95 -0
- package/dist/esm/i18n/locales/en-US.json +13 -1
- package/dist/esm/i18n/locales/es-ES.json +13 -1
- package/dist/esm/i18n/locales/locales/en-US.json +13 -1
- package/dist/esm/i18n/locales/locales/es-ES.json +13 -1
- package/dist/esm/index.js +34 -17
- package/dist/esm/mixins/OxyServices.accounts.js +13 -26
- package/dist/esm/mixins/OxyServices.auth.js +66 -201
- package/dist/esm/mixins/OxyServices.deviceBoot.js +116 -0
- package/dist/esm/mixins/index.js +8 -17
- package/dist/esm/server/index.js +1 -1
- package/dist/esm/session/SessionClient.js +40 -1
- package/dist/esm/session/authStateStore.js +278 -0
- package/dist/esm/session/refresh.js +257 -0
- package/dist/esm/shared/utils/debugUtils.js +3 -3
- package/dist/esm/utils/accountUtils.js +0 -53
- package/dist/esm/utils/authWebUrl.js +9 -37
- package/dist/esm/utils/coldBoot.js +10 -8
- package/dist/esm/utils/platform.js +18 -0
- package/dist/esm/utils/registrableApex.js +46 -0
- package/dist/esm/utils/ssoBounce.js +14 -345
- package/dist/esm/utils/validationUtils.js +56 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/HttpService.d.ts +14 -1
- package/dist/types/OxyServices.base.d.ts +0 -52
- package/dist/types/OxyServices.d.ts +0 -25
- package/dist/types/boot/coldBootV2.d.ts +76 -0
- package/dist/types/boot/deviceBootReturn.d.ts +83 -0
- package/dist/types/crypto/keyManager.d.ts +21 -0
- package/dist/types/index.d.ts +14 -21
- package/dist/types/mixins/OxyServices.accounts.d.ts +24 -29
- package/dist/types/mixins/OxyServices.analytics.d.ts +0 -2
- package/dist/types/mixins/OxyServices.appData.d.ts +0 -2
- package/dist/types/mixins/OxyServices.assets.d.ts +0 -2
- package/dist/types/mixins/OxyServices.auth.d.ts +35 -77
- package/dist/types/mixins/OxyServices.civic.d.ts +0 -2
- package/dist/types/mixins/OxyServices.connectedApps.d.ts +0 -2
- package/dist/types/mixins/OxyServices.contacts.d.ts +0 -2
- package/dist/types/mixins/OxyServices.deviceBoot.d.ts +110 -0
- package/dist/types/mixins/OxyServices.devices.d.ts +0 -2
- package/dist/types/mixins/OxyServices.features.d.ts +0 -2
- package/dist/types/mixins/OxyServices.identity.d.ts +0 -2
- package/dist/types/mixins/OxyServices.language.d.ts +0 -2
- package/dist/types/mixins/OxyServices.links.d.ts +0 -2
- package/dist/types/mixins/OxyServices.location.d.ts +0 -2
- package/dist/types/mixins/OxyServices.nodes.d.ts +0 -2
- package/dist/types/mixins/OxyServices.payment.d.ts +0 -2
- package/dist/types/mixins/OxyServices.privacy.d.ts +0 -2
- package/dist/types/mixins/OxyServices.reputation.d.ts +0 -2
- package/dist/types/mixins/OxyServices.security.d.ts +0 -2
- package/dist/types/mixins/OxyServices.topics.d.ts +0 -2
- package/dist/types/mixins/OxyServices.user.d.ts +0 -2
- package/dist/types/mixins/OxyServices.utility.d.ts +0 -2
- package/dist/types/mixins/index.d.ts +5 -9
- package/dist/types/models/interfaces.d.ts +0 -67
- package/dist/types/models/session.d.ts +4 -5
- package/dist/types/server/index.d.ts +1 -1
- package/dist/types/session/SessionClient.d.ts +26 -1
- package/dist/types/session/authStateStore.d.ts +119 -0
- package/dist/types/session/refresh.d.ts +93 -0
- package/dist/types/shared/utils/debugUtils.d.ts +3 -3
- package/dist/types/utils/accountUtils.d.ts +2 -17
- package/dist/types/utils/authWebUrl.d.ts +9 -35
- package/dist/types/utils/coldBoot.d.ts +17 -14
- package/dist/types/utils/platform.d.ts +14 -0
- package/dist/types/utils/registrableApex.d.ts +31 -0
- package/dist/types/utils/ssoBounce.d.ts +14 -280
- package/dist/types/utils/validationUtils.d.ts +15 -0
- package/package.json +2 -2
- package/src/HttpService.ts +20 -4
- package/src/OxyServices.base.ts +7 -112
- package/src/OxyServices.ts +0 -38
- package/src/boot/__tests__/coldBootV2.test.ts +317 -0
- package/src/boot/__tests__/deviceBootReturn.test.ts +158 -0
- package/src/boot/coldBootV2.ts +426 -0
- package/src/boot/deviceBootReturn.ts +195 -0
- package/src/crypto/__tests__/sharedDeviceToken.test.ts +24 -0
- package/src/crypto/keyManager.ts +101 -0
- package/src/i18n/locales/en-US.json +13 -1
- package/src/i18n/locales/es-ES.json +13 -1
- package/src/index.ts +75 -65
- package/src/mixins/OxyServices.accounts.ts +27 -39
- package/src/mixins/OxyServices.auth.ts +78 -253
- package/src/mixins/OxyServices.deviceBoot.ts +146 -0
- package/src/mixins/__tests__/OxyServices.deviceBoot.test.ts +107 -0
- package/src/mixins/__tests__/accounts.test.ts +17 -44
- package/src/mixins/__tests__/passwordSignIn.test.ts +91 -0
- package/src/mixins/index.ts +10 -23
- package/src/models/interfaces.ts +0 -79
- package/src/models/session.ts +4 -5
- package/src/server/index.ts +1 -1
- package/src/session/SessionClient.ts +53 -2
- package/src/session/__tests__/SessionClient.additive.test.ts +92 -0
- package/src/session/__tests__/SessionClient.rest.test.ts +25 -0
- package/src/session/__tests__/SessionClient.state.test.ts +18 -5
- package/src/session/__tests__/authStateStore.test.ts +209 -0
- package/src/session/__tests__/refresh.test.ts +256 -0
- package/src/session/authStateStore.ts +335 -0
- package/src/session/refresh.ts +334 -0
- package/src/shared/utils/debugUtils.ts +3 -3
- package/src/utils/__tests__/authWebUrl.test.ts +5 -40
- package/src/utils/__tests__/registrableApex.test.ts +62 -0
- package/src/utils/__tests__/validationUtils.test.ts +30 -0
- package/src/utils/accountUtils.ts +2 -65
- package/src/utils/authWebUrl.ts +9 -39
- package/src/utils/coldBoot.ts +17 -14
- package/src/utils/platform.ts +21 -0
- package/src/utils/registrableApex.ts +45 -0
- package/src/utils/ssoBounce.ts +14 -393
- package/src/utils/validationUtils.ts +62 -0
- package/dist/cjs/AuthManager.js +0 -1110
- package/dist/cjs/AuthManagerTypes.js +0 -13
- package/dist/cjs/CrossDomainAuth.js +0 -206
- package/dist/cjs/mixins/OxyServices.fedcm.js +0 -823
- package/dist/cjs/mixins/OxyServices.redirect.js +0 -95
- package/dist/cjs/mixins/OxyServices.silent.js +0 -204
- package/dist/cjs/mixins/OxyServices.sso.js +0 -208
- package/dist/cjs/utils/fapiAutoDetect.js +0 -99
- package/dist/cjs/utils/ssoEstablish.js +0 -110
- package/dist/cjs/utils/ssoReturn.js +0 -275
- package/dist/esm/AuthManager.js +0 -1105
- package/dist/esm/AuthManagerTypes.js +0 -12
- package/dist/esm/CrossDomainAuth.js +0 -201
- package/dist/esm/mixins/OxyServices.fedcm.js +0 -821
- package/dist/esm/mixins/OxyServices.redirect.js +0 -92
- package/dist/esm/mixins/OxyServices.silent.js +0 -202
- package/dist/esm/mixins/OxyServices.sso.js +0 -204
- package/dist/esm/utils/fapiAutoDetect.js +0 -95
- package/dist/esm/utils/ssoEstablish.js +0 -107
- package/dist/esm/utils/ssoReturn.js +0 -271
- package/dist/types/AuthManager.d.ts +0 -380
- package/dist/types/AuthManagerTypes.d.ts +0 -81
- package/dist/types/CrossDomainAuth.d.ts +0 -164
- package/dist/types/mixins/OxyServices.fedcm.d.ts +0 -331
- package/dist/types/mixins/OxyServices.redirect.d.ts +0 -92
- package/dist/types/mixins/OxyServices.silent.d.ts +0 -132
- package/dist/types/mixins/OxyServices.sso.d.ts +0 -138
- package/dist/types/utils/fapiAutoDetect.d.ts +0 -56
- package/dist/types/utils/ssoEstablish.d.ts +0 -85
- package/dist/types/utils/ssoReturn.d.ts +0 -156
- package/src/AuthManager.ts +0 -1269
- package/src/AuthManagerTypes.ts +0 -86
- package/src/CrossDomainAuth.ts +0 -243
- package/src/__tests__/authManager.cookiePath.test.ts +0 -390
- package/src/__tests__/authManager.security.test.ts +0 -377
- package/src/__tests__/crossDomainAuth.test.ts +0 -116
- package/src/__tests__/establishDeviceRefreshSlot.test.ts +0 -221
- package/src/mixins/OxyServices.fedcm.ts +0 -1026
- package/src/mixins/OxyServices.redirect.ts +0 -122
- package/src/mixins/OxyServices.silent.ts +0 -272
- package/src/mixins/OxyServices.sso.ts +0 -261
- package/src/mixins/__tests__/constructorAuthWebUrl.test.ts +0 -85
- package/src/mixins/__tests__/fedcm.test.ts +0 -667
- package/src/mixins/__tests__/sessionBaseUrl.test.ts +0 -61
- package/src/mixins/__tests__/silent.test.ts +0 -102
- package/src/mixins/__tests__/sso.test.ts +0 -228
- package/src/utils/__tests__/consumeSsoReturn.test.ts +0 -816
- package/src/utils/__tests__/fapiAutoDetect.test.ts +0 -183
- package/src/utils/__tests__/ssoBounce.test.ts +0 -219
- package/src/utils/__tests__/ssoEstablish.test.ts +0 -204
- package/src/utils/__tests__/ssoReturn.test.ts +0 -276
- package/src/utils/fapiAutoDetect.ts +0 -91
- package/src/utils/ssoEstablish.ts +0 -174
- package/src/utils/ssoReturn.ts +0 -389
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Supports password-based login (email/username) and public key challenge-response.
|
|
5
5
|
*/
|
|
6
|
-
import type { User
|
|
6
|
+
import type { User } from '../models/interfaces';
|
|
7
|
+
import type { LoginResult, LoginSessionResult } from '@oxyhq/contracts';
|
|
7
8
|
import type { SessionLoginResponse } from '../models/session';
|
|
8
9
|
import type { OxyServicesBase } from '../OxyServices.base';
|
|
9
10
|
import type { PublicApplication } from './OxyServices.connectedApps';
|
|
@@ -11,25 +12,6 @@ export interface ChallengeResponse {
|
|
|
11
12
|
challenge: string;
|
|
12
13
|
expiresAt: string;
|
|
13
14
|
}
|
|
14
|
-
/**
|
|
15
|
-
* Options for {@link refreshAllSessions}.
|
|
16
|
-
*/
|
|
17
|
-
export interface RefreshAllOptions {
|
|
18
|
-
/**
|
|
19
|
-
* Abort the `POST /auth/refresh-all` request after this many milliseconds and
|
|
20
|
-
* resolve as "no signed-in accounts" (`{ accounts: [] }`) rather than hanging.
|
|
21
|
-
*
|
|
22
|
-
* Why: on a cross-domain RP (e.g. `mention.earth`) the `Domain=oxy.so` refresh
|
|
23
|
-
* cookie never reaches `api.<apex>`, so this request can stall behind a slow
|
|
24
|
-
* or unreachable endpoint with no useful answer coming back. As one step of
|
|
25
|
-
* the ordered cold-boot sequence, a stalled refresh is dead latency in front
|
|
26
|
-
* of the steps that actually hold the answer. A bounded abort lets cold boot
|
|
27
|
-
* fall through quickly. Omit (or pass `0`/negative) to wait indefinitely.
|
|
28
|
-
* The abort is treated identically to a 401 — the
|
|
29
|
-
* "not signed in on this device" path — never an error.
|
|
30
|
-
*/
|
|
31
|
-
timeout?: number;
|
|
32
|
-
}
|
|
33
15
|
export interface RegistrationRequest {
|
|
34
16
|
publicKey: string;
|
|
35
17
|
username: string;
|
|
@@ -419,61 +401,6 @@ export declare function OxyServicesAuthMixin<T extends typeof OxyServicesBase>(B
|
|
|
419
401
|
* @param authorizeCode - The public code being denied.
|
|
420
402
|
*/
|
|
421
403
|
denyCommonsSignIn(authorizeCode: string): Promise<CommonsSignInActionResult>;
|
|
422
|
-
/**
|
|
423
|
-
* Refresh every device-local refresh-cookie slot in a single round trip
|
|
424
|
-
* (Google-style multi-account rebuild).
|
|
425
|
-
*
|
|
426
|
-
* Calls `POST {sessionBaseUrl}/auth/refresh-all` with `credentials: 'include'`
|
|
427
|
-
* and NO bearer. The browser attaches every indexed `oxy_rt_${authuser}`
|
|
428
|
-
* cookie it has; the server rotates each in parallel and returns one entry
|
|
429
|
-
* per VALID account.
|
|
430
|
-
*
|
|
431
|
-
* Failure handling:
|
|
432
|
-
* - 401 → no signed-in accounts on this device → returns `{ accounts: [] }`
|
|
433
|
-
* (NOT an error; this is the cold-boot "not signed in" path).
|
|
434
|
-
* - 404 → endpoint not deployed → returns `{ accounts: [] }`.
|
|
435
|
-
* - Any other non-2xx → throws via `handleError`.
|
|
436
|
-
*
|
|
437
|
-
* The refresh cookie itself never enters JS — only the rotated access
|
|
438
|
-
* tokens do. Each access token still needs to be planted via
|
|
439
|
-
* `setTokens(...)` (or per-account in-memory storage) at the consumer.
|
|
440
|
-
*/
|
|
441
|
-
refreshAllSessions(options?: RefreshAllOptions): Promise<RefreshAllResponse>;
|
|
442
|
-
/**
|
|
443
|
-
* Rotate a single refresh-cookie slot and return the fresh access token.
|
|
444
|
-
*
|
|
445
|
-
* When `authuser` is provided, the server rotates ONLY that slot
|
|
446
|
-
* (`oxy_rt_${authuser}`) — sibling accounts on the same device stay
|
|
447
|
-
* untouched. When omitted, the server picks the lowest indexed slot present.
|
|
448
|
-
* The refresh cookie itself never enters JS.
|
|
449
|
-
*
|
|
450
|
-
* Returns `null` on 401 (no cookie / expired / reused) so the caller can
|
|
451
|
-
* fall through cleanly to the unauthenticated path.
|
|
452
|
-
*/
|
|
453
|
-
refreshTokenViaCookie(opts?: {
|
|
454
|
-
authuser?: number;
|
|
455
|
-
}): Promise<RefreshCookieResponse | null>;
|
|
456
|
-
/**
|
|
457
|
-
* Sign out a single device-local account by its authuser slot index.
|
|
458
|
-
*
|
|
459
|
-
* Revokes that slot's refresh-token family and deactivates its session;
|
|
460
|
-
* sibling indexed slots stay signed in. The browser-side `oxy_rt_${n}`
|
|
461
|
-
* cookie is cleared by the server's `Set-Cookie` response header.
|
|
462
|
-
*/
|
|
463
|
-
logoutSessionByAuthuser(authuser: number): Promise<void>;
|
|
464
|
-
/**
|
|
465
|
-
* Sign out EVERY device-local account on this device by clearing every
|
|
466
|
-
* presented refresh-cookie slot at once. Revokes every family + clears
|
|
467
|
-
* every slot. Always succeeds (idempotent on unknown/garbage tokens).
|
|
468
|
-
*/
|
|
469
|
-
logoutAllSessionsViaCookie(): Promise<void>;
|
|
470
|
-
/**
|
|
471
|
-
* Internal: raw `POST /auth/refresh[?authuser=N]` call returning the
|
|
472
|
-
* minted access token. Returns `null` on 401 / non-2xx.
|
|
473
|
-
*
|
|
474
|
-
* @internal
|
|
475
|
-
*/
|
|
476
|
-
_refreshCookieRaw(authuser?: number): Promise<RefreshCookieResponse | null>;
|
|
477
404
|
/**
|
|
478
405
|
* Internal: decode (without verifying) the `sessionId` claim from a
|
|
479
406
|
* server-signed access token. The server already verified the signature;
|
|
@@ -534,13 +461,45 @@ export declare function OxyServicesAuthMixin<T extends typeof OxyServicesBase>(B
|
|
|
534
461
|
* Convenience helper for email sign-in
|
|
535
462
|
*/
|
|
536
463
|
signInWithEmail(email: string, password: string, deviceName?: string, deviceFingerprint?: any): Promise<SessionLoginResponse>;
|
|
464
|
+
/**
|
|
465
|
+
* Device-first password sign-in. Unlike the legacy {@link signIn} (which
|
|
466
|
+
* assumes a one-step session and is kept intact for existing callers until
|
|
467
|
+
* the F4 cutover), this returns the FULL `POST /auth/login` contract — the
|
|
468
|
+
* discriminated {@link LoginResult}: either a 2FA challenge
|
|
469
|
+
* (`{ twoFactorRequired, loginToken }`) to complete via
|
|
470
|
+
* {@link completeTwoFactorSignIn}, or a session arm.
|
|
471
|
+
*
|
|
472
|
+
* `options.deviceToken` attributes the new session to the caller's existing
|
|
473
|
+
* device set (so an in-app login from a cross-apex, cookie-less web app
|
|
474
|
+
* still joins the same DeviceSession). On the session arm, a returned access
|
|
475
|
+
* token is planted immediately (mirroring {@link verifyChallenge}), so the
|
|
476
|
+
* caller has an authenticated client without a second round-trip.
|
|
477
|
+
*/
|
|
478
|
+
passwordSignIn(identifier: string, password: string, options?: {
|
|
479
|
+
deviceToken?: string;
|
|
480
|
+
deviceName?: string;
|
|
481
|
+
deviceFingerprint?: string;
|
|
482
|
+
}): Promise<LoginResult>;
|
|
483
|
+
/**
|
|
484
|
+
* Complete a 2FA-gated sign-in started by {@link passwordSignIn}. Presents
|
|
485
|
+
* the short-lived `loginToken` with either a TOTP `token` or a `backupCode`
|
|
486
|
+
* to `POST /security/2fa/verify-login`, which must resolve to the session
|
|
487
|
+
* arm of {@link LoginResult} (a second 2FA challenge here is a protocol
|
|
488
|
+
* error). A returned access token is planted immediately.
|
|
489
|
+
*/
|
|
490
|
+
completeTwoFactorSignIn(params: {
|
|
491
|
+
loginToken: string;
|
|
492
|
+
token?: string;
|
|
493
|
+
backupCode?: string;
|
|
494
|
+
deviceToken?: string;
|
|
495
|
+
deviceName?: string;
|
|
496
|
+
}): Promise<LoginSessionResult>;
|
|
537
497
|
httpService: import("../HttpService").HttpService;
|
|
538
498
|
cloudURL: string;
|
|
539
499
|
config: import("../OxyServices.base").OxyConfig;
|
|
540
500
|
__resetTokensForTests(): void;
|
|
541
501
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
542
502
|
getBaseURL(): string;
|
|
543
|
-
getSessionBaseUrl(): string;
|
|
544
503
|
getClient(): import("../HttpService").HttpService;
|
|
545
504
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
546
505
|
getMetrics(): {
|
|
@@ -569,7 +528,6 @@ export declare function OxyServicesAuthMixin<T extends typeof OxyServicesBase>(B
|
|
|
569
528
|
getCurrentUserId(): string | null;
|
|
570
529
|
hasValidToken(): boolean;
|
|
571
530
|
getAccessToken(): string | null;
|
|
572
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
573
531
|
getAccessTokenExpiry(): number | null;
|
|
574
532
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
575
533
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -463,7 +463,6 @@ export declare function OxyServicesCivicMixin<T extends typeof OxyServicesBase>(
|
|
|
463
463
|
__resetTokensForTests(): void;
|
|
464
464
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
465
465
|
getBaseURL(): string;
|
|
466
|
-
getSessionBaseUrl(): string;
|
|
467
466
|
getClient(): import("../HttpService").HttpService;
|
|
468
467
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
469
468
|
getMetrics(): {
|
|
@@ -492,7 +491,6 @@ export declare function OxyServicesCivicMixin<T extends typeof OxyServicesBase>(
|
|
|
492
491
|
getCurrentUserId(): string | null;
|
|
493
492
|
hasValidToken(): boolean;
|
|
494
493
|
getAccessToken(): string | null;
|
|
495
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
496
494
|
getAccessTokenExpiry(): number | null;
|
|
497
495
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
498
496
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -118,7 +118,6 @@ export declare function OxyServicesConnectedAppsMixin<T extends typeof OxyServic
|
|
|
118
118
|
__resetTokensForTests(): void;
|
|
119
119
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
120
120
|
getBaseURL(): string;
|
|
121
|
-
getSessionBaseUrl(): string;
|
|
122
121
|
getClient(): import("../HttpService").HttpService;
|
|
123
122
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
124
123
|
getMetrics(): {
|
|
@@ -147,7 +146,6 @@ export declare function OxyServicesConnectedAppsMixin<T extends typeof OxyServic
|
|
|
147
146
|
getCurrentUserId(): string | null;
|
|
148
147
|
hasValidToken(): boolean;
|
|
149
148
|
getAccessToken(): string | null;
|
|
150
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
151
149
|
getAccessTokenExpiry(): number | null;
|
|
152
150
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
153
151
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -53,7 +53,6 @@ export declare function OxyServicesContactsMixin<T extends typeof OxyServicesBas
|
|
|
53
53
|
__resetTokensForTests(): void;
|
|
54
54
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
55
55
|
getBaseURL(): string;
|
|
56
|
-
getSessionBaseUrl(): string;
|
|
57
56
|
getClient(): import("../HttpService").HttpService;
|
|
58
57
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
59
58
|
getMetrics(): {
|
|
@@ -82,7 +81,6 @@ export declare function OxyServicesContactsMixin<T extends typeof OxyServicesBas
|
|
|
82
81
|
getCurrentUserId(): string | null;
|
|
83
82
|
hasValidToken(): boolean;
|
|
84
83
|
getAccessToken(): string | null;
|
|
85
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
86
84
|
getAccessTokenExpiry(): number | null;
|
|
87
85
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
88
86
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device-first bootstrap mixin (auth centralization, wave 1).
|
|
3
|
+
*
|
|
4
|
+
* The client half of the new device-first session bootstrap: the four network
|
|
5
|
+
* calls the cold boot (`coldBootV2`) and the unified refresh handler
|
|
6
|
+
* (`refresh.ts`) make, plus the URL builder for the cross-apex bootstrap hop.
|
|
7
|
+
* Every response is validated against the `@oxyhq/contracts` `deviceBoot`
|
|
8
|
+
* schemas via `safeParseContract`, so producer (oxy-api) and consumer cannot
|
|
9
|
+
* drift — an unexpected shape throws here rather than silently corrupting the
|
|
10
|
+
* persisted store.
|
|
11
|
+
*
|
|
12
|
+
* These methods are ADDITIVE and carry NO persistence or token-planting side
|
|
13
|
+
* effects of their own (except the bearer-authenticated calls that naturally
|
|
14
|
+
* flow through `HttpService`). The cold boot / refresh handler own persistence
|
|
15
|
+
* and `setTokens`, so the same network primitive can be reused from either
|
|
16
|
+
* without double-planting.
|
|
17
|
+
*/
|
|
18
|
+
import { type AuthTokenBundle, type TokenRefreshResponse, type WebSessionResult } from '@oxyhq/contracts';
|
|
19
|
+
import type { OxyServicesBase } from '../OxyServices.base';
|
|
20
|
+
export declare function OxyServicesDeviceBootMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
21
|
+
new (...args: any[]): {
|
|
22
|
+
/**
|
|
23
|
+
* Exchange a single-use boot `code` (from the `#oxy_boot` return fragment)
|
|
24
|
+
* for a token bundle. Origin-bound + GETDEL-burned server-side.
|
|
25
|
+
*
|
|
26
|
+
* @throws if the response does not match {@link authTokenBundleSchema}.
|
|
27
|
+
*/
|
|
28
|
+
exchangeBootCode(code: string): Promise<AuthTokenBundle>;
|
|
29
|
+
/**
|
|
30
|
+
* Same-site fast path (`*.oxy.so` apps). Reads the first-party `oxy_device`
|
|
31
|
+
* cookie via a credentialed same-origin fetch and either resolves a full
|
|
32
|
+
* session bundle or reports the device is known-but-signed-out. Never
|
|
33
|
+
* redirects.
|
|
34
|
+
*
|
|
35
|
+
* @throws if the response matches neither arm of {@link webSessionResultSchema}.
|
|
36
|
+
*/
|
|
37
|
+
requestWebSession(): Promise<WebSessionResult>;
|
|
38
|
+
/**
|
|
39
|
+
* Rotate the persisted refresh-token family (web + native, one call). The
|
|
40
|
+
* caller (refresh handler / cold boot) plants + persists the rotated pair.
|
|
41
|
+
*
|
|
42
|
+
* @throws if the response does not match {@link tokenRefreshResponseSchema}.
|
|
43
|
+
*/
|
|
44
|
+
refreshWithToken(refreshToken: string): Promise<TokenRefreshResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Issue (or rotate) the native channel's opaque device token. Bearer-gated —
|
|
47
|
+
* the server derives the deviceId from the JWT. Native apps mirror the
|
|
48
|
+
* returned token into the shared keychain via
|
|
49
|
+
* `KeyManager.setSharedDeviceToken`.
|
|
50
|
+
*
|
|
51
|
+
* @throws if the response does not match {@link deviceTokenIssueResponseSchema}.
|
|
52
|
+
*/
|
|
53
|
+
issueNativeDeviceToken(): Promise<string>;
|
|
54
|
+
/**
|
|
55
|
+
* Build the top-level `GET /auth/device/bootstrap` URL for the cross-apex
|
|
56
|
+
* hop. The server validates `return_to` against the trusted-origin lane and
|
|
57
|
+
* echoes `state` back in the return fragment for CSRF verification.
|
|
58
|
+
*/
|
|
59
|
+
buildBootstrapUrl(returnTo: string, state: string): string;
|
|
60
|
+
httpService: import("../HttpService").HttpService;
|
|
61
|
+
cloudURL: string;
|
|
62
|
+
config: import("../OxyServices.base").OxyConfig;
|
|
63
|
+
__resetTokensForTests(): void;
|
|
64
|
+
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
65
|
+
getBaseURL(): string;
|
|
66
|
+
getClient(): import("../HttpService").HttpService;
|
|
67
|
+
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
68
|
+
getMetrics(): {
|
|
69
|
+
totalRequests: number;
|
|
70
|
+
successfulRequests: number;
|
|
71
|
+
failedRequests: number;
|
|
72
|
+
cacheHits: number;
|
|
73
|
+
cacheMisses: number;
|
|
74
|
+
averageResponseTime: number;
|
|
75
|
+
};
|
|
76
|
+
clearCache(): void;
|
|
77
|
+
clearCacheEntry(key: string): void;
|
|
78
|
+
clearCacheByPrefix(prefix: string): number;
|
|
79
|
+
getCacheStats(): {
|
|
80
|
+
size: number;
|
|
81
|
+
hits: number;
|
|
82
|
+
misses: number;
|
|
83
|
+
hitRate: number;
|
|
84
|
+
};
|
|
85
|
+
getCloudURL(): string;
|
|
86
|
+
setTokens(accessToken: string): void;
|
|
87
|
+
clearTokens(): void;
|
|
88
|
+
onTokensChanged(listener: (accessToken: string | null) => void): () => void;
|
|
89
|
+
_cachedUserId: string | null | undefined;
|
|
90
|
+
_cachedAccessToken: string | null;
|
|
91
|
+
getCurrentUserId(): string | null;
|
|
92
|
+
hasValidToken(): boolean;
|
|
93
|
+
getAccessToken(): string | null;
|
|
94
|
+
getAccessTokenExpiry(): number | null;
|
|
95
|
+
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
96
|
+
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
97
|
+
maxRetries?: number;
|
|
98
|
+
retryDelay?: number;
|
|
99
|
+
authTimeoutMs?: number;
|
|
100
|
+
}): Promise<T_1>;
|
|
101
|
+
validate(): Promise<boolean>;
|
|
102
|
+
handleError(error: unknown): Error;
|
|
103
|
+
healthCheck(): Promise<{
|
|
104
|
+
status: string;
|
|
105
|
+
users?: number;
|
|
106
|
+
timestamp?: string;
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
}>;
|
|
109
|
+
};
|
|
110
|
+
} & T;
|
|
@@ -55,7 +55,6 @@ export declare function OxyServicesDevicesMixin<T extends typeof OxyServicesBase
|
|
|
55
55
|
__resetTokensForTests(): void;
|
|
56
56
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
57
57
|
getBaseURL(): string;
|
|
58
|
-
getSessionBaseUrl(): string;
|
|
59
58
|
getClient(): import("../HttpService").HttpService;
|
|
60
59
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
61
60
|
getMetrics(): {
|
|
@@ -84,7 +83,6 @@ export declare function OxyServicesDevicesMixin<T extends typeof OxyServicesBase
|
|
|
84
83
|
getCurrentUserId(): string | null;
|
|
85
84
|
hasValidToken(): boolean;
|
|
86
85
|
getAccessToken(): string | null;
|
|
87
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
88
86
|
getAccessTokenExpiry(): number | null;
|
|
89
87
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
90
88
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -203,7 +203,6 @@ export declare function OxyServicesFeaturesMixin<T extends typeof OxyServicesBas
|
|
|
203
203
|
__resetTokensForTests(): void;
|
|
204
204
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
205
205
|
getBaseURL(): string;
|
|
206
|
-
getSessionBaseUrl(): string;
|
|
207
206
|
getClient(): import("../HttpService").HttpService;
|
|
208
207
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
209
208
|
getMetrics(): {
|
|
@@ -232,7 +231,6 @@ export declare function OxyServicesFeaturesMixin<T extends typeof OxyServicesBas
|
|
|
232
231
|
getCurrentUserId(): string | null;
|
|
233
232
|
hasValidToken(): boolean;
|
|
234
233
|
getAccessToken(): string | null;
|
|
235
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
236
234
|
getAccessTokenExpiry(): number | null;
|
|
237
235
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
238
236
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -205,7 +205,6 @@ export declare function OxyServicesIdentityMixin<T extends typeof OxyServicesBas
|
|
|
205
205
|
__resetTokensForTests(): void;
|
|
206
206
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
207
207
|
getBaseURL(): string;
|
|
208
|
-
getSessionBaseUrl(): string;
|
|
209
208
|
getClient(): import("../HttpService").HttpService;
|
|
210
209
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
211
210
|
getMetrics(): {
|
|
@@ -234,7 +233,6 @@ export declare function OxyServicesIdentityMixin<T extends typeof OxyServicesBas
|
|
|
234
233
|
getCurrentUserId(): string | null;
|
|
235
234
|
hasValidToken(): boolean;
|
|
236
235
|
getAccessToken(): string | null;
|
|
237
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
238
236
|
getAccessTokenExpiry(): number | null;
|
|
239
237
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
240
238
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -40,7 +40,6 @@ export declare function OxyServicesLanguageMixin<T extends typeof OxyServicesBas
|
|
|
40
40
|
__resetTokensForTests(): void;
|
|
41
41
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
42
42
|
getBaseURL(): string;
|
|
43
|
-
getSessionBaseUrl(): string;
|
|
44
43
|
getClient(): import("../HttpService").HttpService;
|
|
45
44
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
46
45
|
getMetrics(): {
|
|
@@ -69,7 +68,6 @@ export declare function OxyServicesLanguageMixin<T extends typeof OxyServicesBas
|
|
|
69
68
|
getCurrentUserId(): string | null;
|
|
70
69
|
hasValidToken(): boolean;
|
|
71
70
|
getAccessToken(): string | null;
|
|
72
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
73
71
|
getAccessTokenExpiry(): number | null;
|
|
74
72
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
75
73
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -57,7 +57,6 @@ export declare function OxyServicesLinksMixin<T extends typeof OxyServicesBase>(
|
|
|
57
57
|
__resetTokensForTests(): void;
|
|
58
58
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
59
59
|
getBaseURL(): string;
|
|
60
|
-
getSessionBaseUrl(): string;
|
|
61
60
|
getClient(): import("../HttpService").HttpService;
|
|
62
61
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
63
62
|
getMetrics(): {
|
|
@@ -86,7 +85,6 @@ export declare function OxyServicesLinksMixin<T extends typeof OxyServicesBase>(
|
|
|
86
85
|
getCurrentUserId(): string | null;
|
|
87
86
|
hasValidToken(): boolean;
|
|
88
87
|
getAccessToken(): string | null;
|
|
89
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
90
88
|
getAccessTokenExpiry(): number | null;
|
|
91
89
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
92
90
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -23,7 +23,6 @@ export declare function OxyServicesLocationMixin<T extends typeof OxyServicesBas
|
|
|
23
23
|
__resetTokensForTests(): void;
|
|
24
24
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
25
25
|
getBaseURL(): string;
|
|
26
|
-
getSessionBaseUrl(): string;
|
|
27
26
|
getClient(): import("../HttpService").HttpService;
|
|
28
27
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
29
28
|
getMetrics(): {
|
|
@@ -52,7 +51,6 @@ export declare function OxyServicesLocationMixin<T extends typeof OxyServicesBas
|
|
|
52
51
|
getCurrentUserId(): string | null;
|
|
53
52
|
hasValidToken(): boolean;
|
|
54
53
|
getAccessToken(): string | null;
|
|
55
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
56
54
|
getAccessTokenExpiry(): number | null;
|
|
57
55
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
58
56
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -151,7 +151,6 @@ export declare function OxyServicesNodesMixin<T extends typeof OxyServicesBase>(
|
|
|
151
151
|
__resetTokensForTests(): void;
|
|
152
152
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
153
153
|
getBaseURL(): string;
|
|
154
|
-
getSessionBaseUrl(): string;
|
|
155
154
|
getClient(): import("../HttpService").HttpService;
|
|
156
155
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
157
156
|
getMetrics(): {
|
|
@@ -180,7 +179,6 @@ export declare function OxyServicesNodesMixin<T extends typeof OxyServicesBase>(
|
|
|
180
179
|
getCurrentUserId(): string | null;
|
|
181
180
|
hasValidToken(): boolean;
|
|
182
181
|
getAccessToken(): string | null;
|
|
183
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
184
182
|
getAccessTokenExpiry(): number | null;
|
|
185
183
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
186
184
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -70,7 +70,6 @@ export declare function OxyServicesPaymentMixin<T extends typeof OxyServicesBase
|
|
|
70
70
|
__resetTokensForTests(): void;
|
|
71
71
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
72
72
|
getBaseURL(): string;
|
|
73
|
-
getSessionBaseUrl(): string;
|
|
74
73
|
getClient(): import("../HttpService").HttpService;
|
|
75
74
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
76
75
|
getMetrics(): {
|
|
@@ -99,7 +98,6 @@ export declare function OxyServicesPaymentMixin<T extends typeof OxyServicesBase
|
|
|
99
98
|
getCurrentUserId(): string | null;
|
|
100
99
|
hasValidToken(): boolean;
|
|
101
100
|
getAccessToken(): string | null;
|
|
102
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
103
101
|
getAccessTokenExpiry(): number | null;
|
|
104
102
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
105
103
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -99,7 +99,6 @@ export declare function OxyServicesPrivacyMixin<T extends typeof OxyServicesBase
|
|
|
99
99
|
__resetTokensForTests(): void;
|
|
100
100
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
101
101
|
getBaseURL(): string;
|
|
102
|
-
getSessionBaseUrl(): string;
|
|
103
102
|
getClient(): import("../HttpService").HttpService;
|
|
104
103
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
105
104
|
getMetrics(): {
|
|
@@ -128,7 +127,6 @@ export declare function OxyServicesPrivacyMixin<T extends typeof OxyServicesBase
|
|
|
128
127
|
getCurrentUserId(): string | null;
|
|
129
128
|
hasValidToken(): boolean;
|
|
130
129
|
getAccessToken(): string | null;
|
|
131
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
132
130
|
getAccessTokenExpiry(): number | null;
|
|
133
131
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
134
132
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -388,7 +388,6 @@ export declare function OxyServicesReputationMixin<T extends typeof OxyServicesB
|
|
|
388
388
|
__resetTokensForTests(): void;
|
|
389
389
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
390
390
|
getBaseURL(): string;
|
|
391
|
-
getSessionBaseUrl(): string;
|
|
392
391
|
getClient(): import("../HttpService").HttpService;
|
|
393
392
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
394
393
|
getMetrics(): {
|
|
@@ -417,7 +416,6 @@ export declare function OxyServicesReputationMixin<T extends typeof OxyServicesB
|
|
|
417
416
|
getCurrentUserId(): string | null;
|
|
418
417
|
hasValidToken(): boolean;
|
|
419
418
|
getAccessToken(): string | null;
|
|
420
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
421
419
|
getAccessTokenExpiry(): number | null;
|
|
422
420
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
423
421
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -37,7 +37,6 @@ export declare function OxyServicesSecurityMixin<T extends typeof OxyServicesBas
|
|
|
37
37
|
__resetTokensForTests(): void;
|
|
38
38
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
39
39
|
getBaseURL(): string;
|
|
40
|
-
getSessionBaseUrl(): string;
|
|
41
40
|
getClient(): import("../HttpService").HttpService;
|
|
42
41
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
43
42
|
getMetrics(): {
|
|
@@ -66,7 +65,6 @@ export declare function OxyServicesSecurityMixin<T extends typeof OxyServicesBas
|
|
|
66
65
|
getCurrentUserId(): string | null;
|
|
67
66
|
hasValidToken(): boolean;
|
|
68
67
|
getAccessToken(): string | null;
|
|
69
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
70
68
|
getAccessTokenExpiry(): number | null;
|
|
71
69
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
72
70
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -63,7 +63,6 @@ export declare function OxyServicesTopicsMixin<T extends typeof OxyServicesBase>
|
|
|
63
63
|
__resetTokensForTests(): void;
|
|
64
64
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
65
65
|
getBaseURL(): string;
|
|
66
|
-
getSessionBaseUrl(): string;
|
|
67
66
|
getClient(): import("../HttpService").HttpService;
|
|
68
67
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
69
68
|
getMetrics(): {
|
|
@@ -92,7 +91,6 @@ export declare function OxyServicesTopicsMixin<T extends typeof OxyServicesBase>
|
|
|
92
91
|
getCurrentUserId(): string | null;
|
|
93
92
|
hasValidToken(): boolean;
|
|
94
93
|
getAccessToken(): string | null;
|
|
95
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
96
94
|
getAccessTokenExpiry(): number | null;
|
|
97
95
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
98
96
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -413,7 +413,6 @@ export declare function OxyServicesUserMixin<T extends typeof OxyServicesBase>(B
|
|
|
413
413
|
__resetTokensForTests(): void;
|
|
414
414
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
415
415
|
getBaseURL(): string;
|
|
416
|
-
getSessionBaseUrl(): string;
|
|
417
416
|
getClient(): import("../HttpService").HttpService;
|
|
418
417
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
419
418
|
getMetrics(): {
|
|
@@ -442,7 +441,6 @@ export declare function OxyServicesUserMixin<T extends typeof OxyServicesBase>(B
|
|
|
442
441
|
getCurrentUserId(): string | null;
|
|
443
442
|
hasValidToken(): boolean;
|
|
444
443
|
getAccessToken(): string | null;
|
|
445
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
446
444
|
getAccessTokenExpiry(): number | null;
|
|
447
445
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
448
446
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -228,7 +228,6 @@ export declare function OxyServicesUtilityMixin<T extends typeof OxyServicesBase
|
|
|
228
228
|
__resetTokensForTests(): void;
|
|
229
229
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
230
230
|
getBaseURL(): string;
|
|
231
|
-
getSessionBaseUrl(): string;
|
|
232
231
|
getClient(): import("../HttpService").HttpService;
|
|
233
232
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
234
233
|
getMetrics(): {
|
|
@@ -257,7 +256,6 @@ export declare function OxyServicesUtilityMixin<T extends typeof OxyServicesBase
|
|
|
257
256
|
getCurrentUserId(): string | null;
|
|
258
257
|
hasValidToken(): boolean;
|
|
259
258
|
getAccessToken(): string | null;
|
|
260
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
261
259
|
getAccessTokenExpiry(): number | null;
|
|
262
260
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
263
261
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { OxyServicesBase } from '../OxyServices.base';
|
|
8
8
|
import { OxyServicesAuthMixin } from './OxyServices.auth';
|
|
9
|
-
import { OxyServicesFedCMMixin } from './OxyServices.fedcm';
|
|
10
|
-
import { OxyServicesSilentAuthMixin } from './OxyServices.silent';
|
|
11
|
-
import { OxyServicesRedirectAuthMixin } from './OxyServices.redirect';
|
|
12
|
-
import { OxyServicesSsoMixin } from './OxyServices.sso';
|
|
13
9
|
import { OxyServicesUserMixin } from './OxyServices.user';
|
|
14
10
|
import { OxyServicesIdentityMixin } from './OxyServices.identity';
|
|
15
11
|
import { OxyServicesPrivacyMixin } from './OxyServices.privacy';
|
|
@@ -31,6 +27,7 @@ import { OxyServicesAppDataMixin } from './OxyServices.appData';
|
|
|
31
27
|
import { OxyServicesCivicMixin } from './OxyServices.civic';
|
|
32
28
|
import { OxyServicesNodesMixin } from './OxyServices.nodes';
|
|
33
29
|
import { OxyServicesLinksMixin } from './OxyServices.links';
|
|
30
|
+
import { OxyServicesDeviceBootMixin } from './OxyServices.deviceBoot';
|
|
34
31
|
/**
|
|
35
32
|
* Instance shape of every mixin in the pipeline, intersected. The runtime
|
|
36
33
|
* `composeOxyServices()` produces a class whose instances expose all of
|
|
@@ -40,7 +37,7 @@ import { OxyServicesLinksMixin } from './OxyServices.links';
|
|
|
40
37
|
* If you add a new mixin to `MIXIN_PIPELINE`, add it here too so its methods
|
|
41
38
|
* are visible without a cast.
|
|
42
39
|
*/
|
|
43
|
-
type AllMixinInstances = InstanceType<ReturnType<typeof OxyServicesAuthMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof
|
|
40
|
+
type AllMixinInstances = InstanceType<ReturnType<typeof OxyServicesAuthMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesUserMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesIdentityMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesPrivacyMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesLanguageMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesPaymentMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesReputationMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesAssetsMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesAccountsMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesConnectedAppsMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesLocationMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesAnalyticsMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesDevicesMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesSecurityMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesFeaturesMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesTopicsMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesContactsMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesAppDataMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesCivicMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesNodesMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesLinksMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesDeviceBootMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesUtilityMixin<typeof OxyServicesBase>>>;
|
|
44
41
|
/**
|
|
45
42
|
* Constructor type for the fully composed mixin pipeline. Each mixin returns
|
|
46
43
|
* a new constructor that augments its input; reducing across the pipeline
|
|
@@ -59,10 +56,9 @@ type MixinFunction = (Base: new (...args: unknown[]) => OxyServicesBase) => new
|
|
|
59
56
|
*
|
|
60
57
|
* Order matters for dependencies:
|
|
61
58
|
* 1. Base auth mixin first (required by all others)
|
|
62
|
-
* 2.
|
|
63
|
-
* 3.
|
|
64
|
-
* 4.
|
|
65
|
-
* 5. Utility mixin last (augments all)
|
|
59
|
+
* 2. User mixin (requires auth)
|
|
60
|
+
* 3. Feature mixins (can depend on user)
|
|
61
|
+
* 4. Utility mixin last (augments all)
|
|
66
62
|
*
|
|
67
63
|
* To add a new mixin: insert it at the appropriate position in this array.
|
|
68
64
|
*/
|