@oxyhq/core 5.5.0 → 6.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 +6 -3
- 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 +47 -44
- package/dist/cjs/mixins/OxyServices.accounts.js +6 -13
- package/dist/cjs/mixins/OxyServices.auth.js +66 -201
- package/dist/cjs/mixins/OxyServices.authorizedApps.js +38 -0
- package/dist/cjs/mixins/OxyServices.deviceBoot.js +119 -0
- package/dist/cjs/mixins/index.js +13 -17
- 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/utils/accountUtils.js +1 -55
- package/dist/cjs/utils/authWebUrl.js +6 -15
- package/dist/cjs/utils/fapiAutoDetect.js +16 -64
- package/dist/cjs/utils/platform.js +19 -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 +6 -3
- 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 +28 -18
- package/dist/esm/mixins/OxyServices.accounts.js +6 -13
- package/dist/esm/mixins/OxyServices.auth.js +66 -201
- package/dist/esm/mixins/OxyServices.authorizedApps.js +35 -0
- package/dist/esm/mixins/OxyServices.deviceBoot.js +116 -0
- package/dist/esm/mixins/index.js +13 -17
- 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/utils/accountUtils.js +0 -53
- package/dist/esm/utils/authWebUrl.js +6 -14
- package/dist/esm/utils/fapiAutoDetect.js +16 -63
- package/dist/esm/utils/platform.js +18 -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 +13 -0
- 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 +15 -21
- package/dist/types/mixins/OxyServices.accounts.d.ts +0 -2
- 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.redirect.d.ts → OxyServices.authorizedApps.d.ts} +35 -33
- 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 +6 -9
- package/dist/types/models/interfaces.d.ts +0 -67
- package/dist/types/session/SessionClient.d.ts +25 -0
- package/dist/types/session/authStateStore.d.ts +119 -0
- package/dist/types/session/refresh.d.ts +93 -0
- package/dist/types/utils/accountUtils.d.ts +0 -14
- package/dist/types/utils/authWebUrl.d.ts +6 -12
- package/dist/types/utils/fapiAutoDetect.d.ts +15 -38
- package/dist/types/utils/platform.d.ts +14 -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 +19 -3
- 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 +74 -65
- package/src/mixins/OxyServices.accounts.ts +6 -13
- package/src/mixins/OxyServices.auth.ts +78 -253
- package/src/mixins/OxyServices.authorizedApps.ts +75 -0
- 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__/authorizedApps.test.ts +63 -0
- package/src/mixins/__tests__/passwordSignIn.test.ts +91 -0
- package/src/mixins/index.ts +16 -22
- package/src/models/interfaces.ts +0 -79
- package/src/session/SessionClient.ts +52 -1
- 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/utils/__tests__/authWebUrl.test.ts +5 -29
- package/src/utils/__tests__/fapiAutoDetect.test.ts +5 -126
- package/src/utils/__tests__/validationUtils.test.ts +30 -0
- package/src/utils/accountUtils.ts +0 -62
- package/src/utils/authWebUrl.ts +6 -15
- package/src/utils/fapiAutoDetect.ts +16 -60
- package/src/utils/platform.ts +21 -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/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/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.silent.d.ts +0 -132
- package/dist/types/mixins/OxyServices.sso.d.ts +0 -138
- 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__/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/ssoEstablish.ts +0 -174
- package/src/utils/ssoReturn.ts +0 -389
|
@@ -1,48 +1,52 @@
|
|
|
1
|
-
import type { OxyServicesBase } from '../OxyServices.base';
|
|
2
|
-
import type { SessionLoginResponse } from '../models/session';
|
|
3
|
-
export interface RedirectAuthOptions {
|
|
4
|
-
redirectUri?: string;
|
|
5
|
-
mode?: 'login' | 'signup';
|
|
6
|
-
preserveUrl?: boolean;
|
|
7
|
-
}
|
|
8
1
|
/**
|
|
9
|
-
*
|
|
2
|
+
* Authorized-apps mixin — the "Connected apps" management surface that survived
|
|
3
|
+
* the FedCM removal.
|
|
10
4
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
5
|
+
* These two methods read/revoke the user's LEGACY FedCM authorization grants
|
|
6
|
+
* (`GET`/`DELETE /fedcm/me/authorized-apps`). They are the last live consumers
|
|
7
|
+
* of that endpoint (services' `ConnectedAppsScreen` via `useAccountQueries` /
|
|
8
|
+
* `useAccountMutations`) and stay until the AppGrant migration retires the
|
|
9
|
+
* FedCM grant store. All FedCM SIGN-IN machinery was deleted with
|
|
10
|
+
* `OxyServices.fedcm.ts`; this is management-only, so it has no dependency on
|
|
11
|
+
* the credential/nonce pipeline.
|
|
12
|
+
*/
|
|
13
|
+
import type { OxyServicesBase } from '../OxyServices.base';
|
|
14
|
+
/**
|
|
15
|
+
* Public summary of an RP application the user has authorized — mirrors the
|
|
16
|
+
* `AuthorizedAppSummary` shape returned by `GET /fedcm/me/authorized-apps`.
|
|
15
17
|
*/
|
|
16
|
-
export
|
|
18
|
+
export interface AuthorizedApp {
|
|
19
|
+
/** Normalised RP origin. */
|
|
20
|
+
origin: string;
|
|
21
|
+
/** Friendly display name. */
|
|
22
|
+
name: string;
|
|
23
|
+
/** Optional human-readable description. */
|
|
24
|
+
description?: string;
|
|
25
|
+
/** ISO-8601 timestamp of when the user first authorized this RP. */
|
|
26
|
+
firstGrantedAt: string;
|
|
27
|
+
/** ISO-8601 timestamp of the most recent FedCM exchange for this user+RP. */
|
|
28
|
+
lastUsedAt: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function OxyServicesAuthorizedAppsMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
17
31
|
new (...args: any[]): {
|
|
18
32
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* localStorage. The caller's provider must run `consumeSsoReturn` on startup
|
|
23
|
-
* to complete the code exchange and commit the session.
|
|
33
|
+
* List the authenticated user's authorized RP apps — the intersection of the
|
|
34
|
+
* user's FedCM grants and the currently-approved RP catalog. Powers the
|
|
35
|
+
* "Connected apps" management UI. Requires a real user session.
|
|
24
36
|
*/
|
|
25
|
-
|
|
26
|
-
signUpWithRedirect(options?: RedirectAuthOptions): void;
|
|
37
|
+
listAuthorizedApps(): Promise<AuthorizedApp[]>;
|
|
27
38
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
39
|
+
* Revoke the authenticated user's authorization for a specific RP origin.
|
|
40
|
+
* The corresponding cache entry is invalidated so a subsequent
|
|
41
|
+
* `listAuthorizedApps()` sees fresh data.
|
|
31
42
|
*/
|
|
32
|
-
|
|
33
|
-
restoreSession(): boolean;
|
|
34
|
-
clearStoredSession(): void;
|
|
35
|
-
getStoredSessionId(): string | null;
|
|
36
|
-
generateState(): string;
|
|
37
|
-
generateNonce(): string;
|
|
38
|
-
cleanAuthCallbackUrl(url: URL): void;
|
|
43
|
+
revokeAuthorizedApp(origin: string): Promise<void>;
|
|
39
44
|
httpService: import("../HttpService").HttpService;
|
|
40
45
|
cloudURL: string;
|
|
41
46
|
config: import("../OxyServices.base").OxyConfig;
|
|
42
47
|
__resetTokensForTests(): void;
|
|
43
48
|
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
44
49
|
getBaseURL(): string;
|
|
45
|
-
getSessionBaseUrl(): string;
|
|
46
50
|
getClient(): import("../HttpService").HttpService;
|
|
47
51
|
createLinkedClient(config: import("../OxyServices.base").OxyConfig): import("..").LinkedHttpClient;
|
|
48
52
|
getMetrics(): {
|
|
@@ -71,7 +75,6 @@ export declare function OxyServicesRedirectAuthMixin<T extends typeof OxyService
|
|
|
71
75
|
getCurrentUserId(): string | null;
|
|
72
76
|
hasValidToken(): boolean;
|
|
73
77
|
getAccessToken(): string | null;
|
|
74
|
-
establishDeviceRefreshSlot(): Promise<number | null>;
|
|
75
78
|
getAccessTokenExpiry(): number | null;
|
|
76
79
|
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
77
80
|
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
@@ -89,4 +92,3 @@ export declare function OxyServicesRedirectAuthMixin<T extends typeof OxyService
|
|
|
89
92
|
}>;
|
|
90
93
|
};
|
|
91
94
|
} & T;
|
|
92
|
-
export { OxyServicesRedirectAuthMixin as RedirectAuthMixin };
|
|
@@ -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,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { OxyServicesBase } from '../OxyServices.base';
|
|
8
8
|
import { OxyServicesAuthMixin } from './OxyServices.auth';
|
|
9
|
-
import {
|
|
10
|
-
import { OxyServicesSilentAuthMixin } from './OxyServices.silent';
|
|
11
|
-
import { OxyServicesRedirectAuthMixin } from './OxyServices.redirect';
|
|
12
|
-
import { OxyServicesSsoMixin } from './OxyServices.sso';
|
|
9
|
+
import { OxyServicesAuthorizedAppsMixin } from './OxyServices.authorizedApps';
|
|
13
10
|
import { OxyServicesUserMixin } from './OxyServices.user';
|
|
14
11
|
import { OxyServicesIdentityMixin } from './OxyServices.identity';
|
|
15
12
|
import { OxyServicesPrivacyMixin } from './OxyServices.privacy';
|
|
@@ -31,6 +28,7 @@ import { OxyServicesAppDataMixin } from './OxyServices.appData';
|
|
|
31
28
|
import { OxyServicesCivicMixin } from './OxyServices.civic';
|
|
32
29
|
import { OxyServicesNodesMixin } from './OxyServices.nodes';
|
|
33
30
|
import { OxyServicesLinksMixin } from './OxyServices.links';
|
|
31
|
+
import { OxyServicesDeviceBootMixin } from './OxyServices.deviceBoot';
|
|
34
32
|
/**
|
|
35
33
|
* Instance shape of every mixin in the pipeline, intersected. The runtime
|
|
36
34
|
* `composeOxyServices()` produces a class whose instances expose all of
|
|
@@ -40,7 +38,7 @@ import { OxyServicesLinksMixin } from './OxyServices.links';
|
|
|
40
38
|
* If you add a new mixin to `MIXIN_PIPELINE`, add it here too so its methods
|
|
41
39
|
* are visible without a cast.
|
|
42
40
|
*/
|
|
43
|
-
type AllMixinInstances = InstanceType<ReturnType<typeof OxyServicesAuthMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof
|
|
41
|
+
type AllMixinInstances = InstanceType<ReturnType<typeof OxyServicesAuthMixin<typeof OxyServicesBase>>> & InstanceType<ReturnType<typeof OxyServicesAuthorizedAppsMixin<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
42
|
/**
|
|
45
43
|
* Constructor type for the fully composed mixin pipeline. Each mixin returns
|
|
46
44
|
* a new constructor that augments its input; reducing across the pipeline
|
|
@@ -59,10 +57,9 @@ type MixinFunction = (Base: new (...args: unknown[]) => OxyServicesBase) => new
|
|
|
59
57
|
*
|
|
60
58
|
* Order matters for dependencies:
|
|
61
59
|
* 1. Base auth mixin first (required by all others)
|
|
62
|
-
* 2.
|
|
63
|
-
* 3.
|
|
64
|
-
* 4.
|
|
65
|
-
* 5. Utility mixin last (augments all)
|
|
60
|
+
* 2. User mixin (requires auth)
|
|
61
|
+
* 3. Feature mixins (can depend on user)
|
|
62
|
+
* 4. Utility mixin last (augments all)
|
|
66
63
|
*
|
|
67
64
|
* To add a new mixin: insert it at the appropriate position in this array.
|
|
68
65
|
*/
|
|
@@ -2,20 +2,6 @@ import type { UserNameResponse } from '@oxyhq/contracts';
|
|
|
2
2
|
export interface OxyConfig {
|
|
3
3
|
baseURL: string;
|
|
4
4
|
cloudURL?: string;
|
|
5
|
-
/**
|
|
6
|
-
* Base URL the SDK's first-party session/refresh calls target.
|
|
7
|
-
*
|
|
8
|
-
* Per the 2026 session architecture (docs/SESSION-ARCHITECTURE.md), every app
|
|
9
|
-
* keeps its OWN first-party session on its OWN domain. For non-`oxy.so` apps
|
|
10
|
-
* this is the app's own same-site backend (e.g. `https://api.mention.earth`),
|
|
11
|
-
* whose session bridge forwards the user's refresh credential to
|
|
12
|
-
* `api.oxy.so`. For `*.oxy.so` apps this is omitted and falls back to
|
|
13
|
-
* `baseURL` (`https://api.oxy.so`), so their behavior is unchanged.
|
|
14
|
-
*
|
|
15
|
-
* Resolve via {@link OxyServices.getSessionBaseUrl}; when unset it returns
|
|
16
|
-
* `baseURL`. This is purely additive — no refresh/auth logic reads it yet.
|
|
17
|
-
*/
|
|
18
|
-
sessionBaseUrl?: string;
|
|
19
5
|
authWebUrl?: string;
|
|
20
6
|
authRedirectUri?: string;
|
|
21
7
|
/**
|
|
@@ -110,7 +96,6 @@ export interface User {
|
|
|
110
96
|
phone?: string;
|
|
111
97
|
address?: string;
|
|
112
98
|
birthday?: string;
|
|
113
|
-
location?: string;
|
|
114
99
|
website?: string;
|
|
115
100
|
createdAt?: string;
|
|
116
101
|
updatedAt?: string;
|
|
@@ -584,55 +569,3 @@ export interface UpdateDeviceNameResponse {
|
|
|
584
569
|
message: string;
|
|
585
570
|
deviceName: string;
|
|
586
571
|
}
|
|
587
|
-
/**
|
|
588
|
-
* Minimal user shape included in a `RefreshAllAccount` entry. The server
|
|
589
|
-
* projects a small whitelist (`username name avatar email color`) so the
|
|
590
|
-
* client can render the account chooser without an extra `/users/me` round
|
|
591
|
-
* trip per account.
|
|
592
|
-
*
|
|
593
|
-
* `avatar` and `color` are `string | null` because they are stored as nullable
|
|
594
|
-
* fields in the user document.
|
|
595
|
-
*/
|
|
596
|
-
export interface RefreshAllAccountUser {
|
|
597
|
-
id: string;
|
|
598
|
-
username: string;
|
|
599
|
-
/**
|
|
600
|
-
* Structured human name as emitted by `formatUserResponse` (the canonical
|
|
601
|
-
* {@link UserNameResponse} `{ first?, last?, full? }` subdocument), NOT a bare
|
|
602
|
-
* string. The server projects `name` verbatim from the user document. The
|
|
603
|
-
* single source of truth is `@oxyhq/contracts`.
|
|
604
|
-
*/
|
|
605
|
-
name: UserNameResponse;
|
|
606
|
-
avatar?: string | null;
|
|
607
|
-
email?: string;
|
|
608
|
-
color?: string | null;
|
|
609
|
-
}
|
|
610
|
-
/**
|
|
611
|
-
* One rotated account entry returned by `POST /auth/refresh-all`. `authuser` is
|
|
612
|
-
* the device-local slot index (0..N-1) the cookie was bound to.
|
|
613
|
-
*/
|
|
614
|
-
export interface RefreshAllAccount {
|
|
615
|
-
authuser: number;
|
|
616
|
-
accessToken: string;
|
|
617
|
-
expiresAt: string;
|
|
618
|
-
sessionId: string;
|
|
619
|
-
user: RefreshAllAccountUser | null;
|
|
620
|
-
}
|
|
621
|
-
/**
|
|
622
|
-
* Wire shape of `POST /auth/refresh-all`. Always 200 with a (possibly empty)
|
|
623
|
-
* accounts array — 401 means "no accounts signed in on this device" and is
|
|
624
|
-
* normalised to `{ accounts: [] }` at the SDK layer.
|
|
625
|
-
*/
|
|
626
|
-
export interface RefreshAllResponse {
|
|
627
|
-
accounts: RefreshAllAccount[];
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* Wire shape of `POST /auth/refresh` (single-slot refresh, optionally targeting
|
|
631
|
-
* a specific `?authuser=N` slot). The server always includes the numeric slot in
|
|
632
|
-
* the response.
|
|
633
|
-
*/
|
|
634
|
-
export interface RefreshCookieResponse {
|
|
635
|
-
accessToken: string;
|
|
636
|
-
expiresAt: string;
|
|
637
|
-
authuser: number;
|
|
638
|
-
}
|