woodsportal-client-sdk 4.0.4-dev.8 → 4.0.7-dev.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/adapters/angular/index.d.ts +1 -0
- package/dist/adapters/angular/index.js +6 -4
- package/dist/adapters/angular/index.js.map +1 -1
- package/dist/adapters/react/index.d.ts +1 -0
- package/dist/adapters/react/index.js +6 -4
- package/dist/adapters/react/index.js.map +1 -1
- package/dist/adapters/vue/index.d.ts +1 -0
- package/dist/adapters/vue/index.js +6 -4
- package/dist/adapters/vue/index.js.map +1 -1
- package/dist/auth-error-codes-D7CXVBEN.js +3 -0
- package/dist/auth-error-codes-D7CXVBEN.js.map +1 -0
- package/dist/auth-interceptor-policy-BSY5KIIA.js +5 -0
- package/dist/auth-interceptor-policy-BSY5KIIA.js.map +1 -0
- package/dist/auth-utils-XIHNYE63.js +5 -0
- package/dist/{auth-utils-MNMC2QGX.js.map → auth-utils-XIHNYE63.js.map} +1 -1
- package/dist/{chunk-6IRXCBBP.js → chunk-4IKGBHFJ.js} +454 -258
- package/dist/chunk-4IKGBHFJ.js.map +1 -0
- package/dist/chunk-55MIERLJ.js +3 -0
- package/dist/chunk-55MIERLJ.js.map +1 -0
- package/dist/chunk-6ROV3EE2.js +160 -0
- package/dist/chunk-6ROV3EE2.js.map +1 -0
- package/dist/{chunk-IBKBTIT6.js → chunk-7OGXVANB.js} +6 -6
- package/dist/{chunk-IBKBTIT6.js.map → chunk-7OGXVANB.js.map} +1 -1
- package/dist/chunk-ADOV2R3A.js +571 -0
- package/dist/chunk-ADOV2R3A.js.map +1 -0
- package/dist/chunk-COHBSTHF.js +82 -0
- package/dist/chunk-COHBSTHF.js.map +1 -0
- package/dist/chunk-DZC3DJUO.js +156 -0
- package/dist/chunk-DZC3DJUO.js.map +1 -0
- package/dist/{chunk-LCHJO5TU.js → chunk-GVXA7OKY.js} +14 -13
- package/dist/chunk-GVXA7OKY.js.map +1 -0
- package/dist/chunk-J33YFZCS.js +162 -0
- package/dist/chunk-J33YFZCS.js.map +1 -0
- package/dist/{chunk-7Q6HRCUA.js → chunk-OF5OLEE5.js} +3 -3
- package/dist/{chunk-7Q6HRCUA.js.map → chunk-OF5OLEE5.js.map} +1 -1
- package/dist/{chunk-ZEJGWZK3.js → chunk-U66LWTVC.js} +1242 -1269
- package/dist/chunk-U66LWTVC.js.map +1 -0
- package/dist/{chunk-EVRUWZUS.js → chunk-WNBF6FKG.js} +165 -13
- package/dist/chunk-WNBF6FKG.js.map +1 -0
- package/dist/chunk-YOT5RW3R.js +306 -0
- package/dist/chunk-YOT5RW3R.js.map +1 -0
- package/dist/cross-tab-session-OJKWJSNT.js +9 -0
- package/dist/cross-tab-session-OJKWJSNT.js.map +1 -0
- package/dist/entries/auth.d.ts +15 -3
- package/dist/entries/auth.js +9 -4
- package/dist/entries/auth.js.map +1 -1
- package/dist/entries/crm.d.ts +1 -0
- package/dist/entries/crm.js +10 -6
- package/dist/entries/crm.js.map +1 -1
- package/dist/{http-errors-DqdtoJ1y.d.ts → http-errors-_XPPqJ_a.d.ts} +190 -9
- package/dist/index.d.ts +138 -3
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/dist/refresh-lock-UW5RRRTD.js +72 -0
- package/dist/refresh-lock-UW5RRRTD.js.map +1 -0
- package/dist/storage-migration-OCOML7VA.js +4 -0
- package/dist/storage-migration-OCOML7VA.js.map +1 -0
- package/package.json +11 -9
- package/dist/auth-utils-MNMC2QGX.js +0 -3
- package/dist/chunk-6IRXCBBP.js.map +0 -1
- package/dist/chunk-EVRUWZUS.js.map +0 -1
- package/dist/chunk-LCHJO5TU.js.map +0 -1
- package/dist/chunk-QPSCMK4W.js +0 -237
- package/dist/chunk-QPSCMK4W.js.map +0 -1
- package/dist/chunk-ZEJGWZK3.js.map +0 -1
package/dist/entries/crm.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { crmApi } from '../chunk-
|
|
2
|
-
import
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import
|
|
5
|
-
import '../chunk-
|
|
1
|
+
import { crmApi } from '../chunk-GVXA7OKY.js';
|
|
2
|
+
import '../chunk-55MIERLJ.js';
|
|
3
|
+
import { navigationApi } from '../chunk-4IKGBHFJ.js';
|
|
4
|
+
import '../chunk-OF5OLEE5.js';
|
|
5
|
+
import { actions8, syncStore, actions5, emailStore, actions4, noteStore, actions6, userStore, actions2, tableStore, tableUiActions, tableUiStore } from '../chunk-U66LWTVC.js';
|
|
6
|
+
import { storage } from '../chunk-ADOV2R3A.js';
|
|
7
|
+
import '../chunk-COHBSTHF.js';
|
|
8
|
+
import '../chunk-YOT5RW3R.js';
|
|
9
|
+
import '../chunk-6ROV3EE2.js';
|
|
6
10
|
|
|
7
11
|
// src/main/entries/crm.ts
|
|
8
12
|
var api = {
|
|
@@ -13,7 +17,7 @@ var store = {
|
|
|
13
17
|
storage,
|
|
14
18
|
tableUi: { store: tableUiStore, actions: tableUiActions },
|
|
15
19
|
table: { store: tableStore, actions: actions2 },
|
|
16
|
-
user: { store: userStore, actions:
|
|
20
|
+
user: { store: userStore, actions: actions6 },
|
|
17
21
|
note: { store: noteStore, actions: actions4 },
|
|
18
22
|
email: { store: emailStore, actions: actions5 },
|
|
19
23
|
sync: { store: syncStore, actions: actions8 }
|
package/dist/entries/crm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/main/entries/crm.ts"],"names":["actions"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/main/entries/crm.ts"],"names":["actions"],"mappings":";;;;;;;;;;;AAqBO,IAAM,GAAA,GAAM;AAAA,EACf,GAAA,EAAK,MAAA;AAAA,EACL,UAAA,EAAY;AAChB;AAEO,IAAM,KAAA,GAAQ;AAAA,EACjB,OAAA;AAAA,EACA,OAAA,EAAS,EAAE,KAAA,EAAO,YAAA,EAAc,SAAS,cAAA,EAAe;AAAA,EACxD,KAAA,EAAO,EAAE,KAAA,EAAO,UAAA,WAAYA,QAAA,EAAsB;AAAA,EAClD,IAAA,EAAM,EAAE,KAAA,EAAO,SAAA,EAAW,SAASA,QAAAA,EAAY;AAAA,EAC/C,IAAA,EAAM,EAAE,KAAA,EAAO,SAAA,EAAW,SAASA,QAAAA,EAAY;AAAA,EAC/C,KAAA,EAAO,EAAE,KAAA,EAAO,UAAA,EAAY,SAASA,QAAAA,EAAa;AAAA,EAClD,IAAA,EAAM,EAAE,KAAA,EAAO,SAAA,EAAW,SAASA,QAAAA;AACvC","file":"crm.js","sourcesContent":["/**\n * CRM subpath export — pipelines, objects, notes, emails, files, cache purge, navigation, state.\n */\nimport { crmApi } from '../api/nested-crm-api'\nimport { navigationApi } from '../api/navigation-api'\nimport {\n tableStore,\n tableActions,\n tableUiStore,\n tableUiActions,\n userStore,\n userActions,\n noteStore,\n noteActions,\n emailStore,\n emailActions,\n syncStore,\n syncActions\n} from '../state'\nimport { storage } from '../core/utils/localStorage'\n\nexport const api = {\n crm: crmApi,\n navigation: navigationApi\n}\n\nexport const store = {\n storage,\n tableUi: { store: tableUiStore, actions: tableUiActions },\n table: { store: tableStore, actions: tableActions },\n user: { store: userStore, actions: userActions },\n note: { store: noteStore, actions: noteActions },\n email: { store: emailStore, actions: emailActions },\n sync: { store: syncStore, actions: syncActions }\n}\n\nexport type { CrmCachePurgeOptions } from '../core/types/cache-purge'\nexport type {\n CachePurgeRequest,\n CachePurgeTarget,\n CachePurgeListQuery,\n CachePurgeView,\n CachePurgeDomain,\n CachePurgeMode,\n PurgeResult,\n CreateCachePurgeJobOptions\n} from '../core/types/cache-purge'\n"]}
|
|
@@ -3,7 +3,7 @@ import { M as MutationOptions, P as PreLoginPayload, C as ChangePasswordPayload,
|
|
|
3
3
|
|
|
4
4
|
type MfaMethod = 'EMAIL_OTP' | 'SMS_OTP' | 'TOTP' | 'BACKUP_CODE' | 'PASSKEY' | 'PASSKEY_PRIMARY';
|
|
5
5
|
type MfaMethodStatus = 'READY' | 'NOT_ENROLLED';
|
|
6
|
-
type MfaMethodNotReadyReason = 'PHONE_NOT_VERIFIED' | 'NOT_ENROLLED' | 'POLICY_BLOCKED' | string;
|
|
6
|
+
type MfaMethodNotReadyReason = 'PHONE_NOT_VERIFIED' | 'NOT_ENROLLED' | 'POLICY_BLOCKED' | 'SMS_DISABLED' | string;
|
|
7
7
|
interface MfaMethodOption {
|
|
8
8
|
method: MfaMethod;
|
|
9
9
|
status: MfaMethodStatus;
|
|
@@ -66,6 +66,7 @@ interface MfaEnrollmentStatus extends MfaPortalScopeContext {
|
|
|
66
66
|
defaultMethod?: MfaMethod;
|
|
67
67
|
preferredMethod?: MfaMethod;
|
|
68
68
|
methods?: MfaMethodOption[];
|
|
69
|
+
platformSmsEnabled?: boolean;
|
|
69
70
|
}
|
|
70
71
|
interface MfaPreferenceRequest {
|
|
71
72
|
defaultMethod: MfaMethod;
|
|
@@ -88,6 +89,7 @@ interface LoginBootstrapMfaPolicy {
|
|
|
88
89
|
mfaConfigured?: boolean;
|
|
89
90
|
mfaEnforcementEnabled?: boolean;
|
|
90
91
|
mfaAllowedMethods?: MfaMethod[];
|
|
92
|
+
platformSmsEnabled?: boolean;
|
|
91
93
|
}
|
|
92
94
|
interface LoginBootstrapSsoProvider {
|
|
93
95
|
portalIntegrationConfigId?: number;
|
|
@@ -159,6 +161,7 @@ interface SecurityOverview {
|
|
|
159
161
|
phoneVerified?: boolean;
|
|
160
162
|
passkeyCount?: number;
|
|
161
163
|
unusedBackupCodes?: number;
|
|
164
|
+
platformSmsEnabled?: boolean;
|
|
162
165
|
}
|
|
163
166
|
interface LoginHistoryRow {
|
|
164
167
|
loginHistoryId?: number;
|
|
@@ -218,12 +221,95 @@ interface RevokeSecuritySessionPayload {
|
|
|
218
221
|
refreshToken?: string;
|
|
219
222
|
}
|
|
220
223
|
|
|
221
|
-
declare
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
declare const AuthErrorCode: {
|
|
225
|
+
readonly AUTHENTICATION_FAILED: "AUTHENTICATION_FAILED";
|
|
226
|
+
readonly TOKEN_INVALID: "AUTH_TOKEN_INVALID";
|
|
227
|
+
readonly TOKEN_EXPIRED: "AUTH_TOKEN_EXPIRED";
|
|
228
|
+
readonly ACCOUNT_LOCKED: "AUTH_ACCOUNT_LOCKED";
|
|
229
|
+
readonly ACCOUNT_DISABLED: "AUTH_ACCOUNT_DISABLED";
|
|
230
|
+
readonly LOGIN_FAILED: "LOGIN_FAILED";
|
|
231
|
+
readonly INVALID_CREDENTIALS: "AUTH_INVALID_CREDENTIALS";
|
|
232
|
+
readonly TWO_FACTOR_REQUIRED: "AUTH_2FA_REQUIRED";
|
|
233
|
+
readonly EMAIL_NOT_VERIFIED: "AUTH_EMAIL_NOT_VERIFIED";
|
|
234
|
+
readonly ACCESS_DENIED: "ACCESS_DENIED";
|
|
235
|
+
readonly ACCESS_FORBIDDEN: "ACCESS_FORBIDDEN";
|
|
236
|
+
readonly ACCESS_UNAUTHORIZED: "ACCESS_UNAUTHORIZED";
|
|
237
|
+
readonly MISSING_REFRESH_TOKEN: "MISSING_REFRESH_TOKEN";
|
|
238
|
+
readonly MISSING_HEADERS: "MISSING_HEADERS";
|
|
239
|
+
readonly OAUTH_PROCESSING_ERROR: "OAUTH_PROCESSING_ERROR";
|
|
240
|
+
readonly HUBSPOT_REAUTH_REQUIRED: "HUBSPOT_REAUTH_REQUIRED";
|
|
241
|
+
readonly PORTAL_INACTIVE: "PORTAL_INACTIVE";
|
|
242
|
+
readonly AMBIGUOUS_HUB_ID: "AMBIGUOUS_HUB_ID";
|
|
243
|
+
readonly COMMERCIAL_ACCESS_EXPIRED: "COMMERCIAL_ACCESS_EXPIRED";
|
|
244
|
+
};
|
|
245
|
+
type AuthErrorCodeValue = (typeof AuthErrorCode)[keyof typeof AuthErrorCode];
|
|
246
|
+
type ApiErrorPayload = {
|
|
247
|
+
errorCode?: string;
|
|
248
|
+
errorMessage?: string;
|
|
249
|
+
detailedMessage?: string;
|
|
250
|
+
correlationId?: string;
|
|
251
|
+
statusCode?: number;
|
|
252
|
+
category?: string;
|
|
253
|
+
};
|
|
254
|
+
type StoredAuthError = ApiErrorPayload & {
|
|
255
|
+
ts?: number;
|
|
256
|
+
};
|
|
257
|
+
declare function parseApiErrorPayload(data: unknown): ApiErrorPayload;
|
|
258
|
+
type UnauthorizedPageCopy = {
|
|
259
|
+
title: string;
|
|
260
|
+
message: string;
|
|
261
|
+
buttonLabel: string;
|
|
262
|
+
clearSessionOnMount: boolean;
|
|
263
|
+
};
|
|
264
|
+
declare function getUnauthorizedPageCopy(errorCode?: string, fallbackMessage?: string): UnauthorizedPageCopy;
|
|
265
|
+
|
|
266
|
+
type WoodsportalRequestConfig = {
|
|
267
|
+
__isRetryRequest?: boolean;
|
|
268
|
+
skipGlobalAuthRedirect?: boolean;
|
|
269
|
+
url?: string;
|
|
270
|
+
};
|
|
271
|
+
type AuthErrorAction = {
|
|
272
|
+
kind: 'refresh_retry';
|
|
273
|
+
} | {
|
|
274
|
+
kind: 'reject';
|
|
275
|
+
} | {
|
|
276
|
+
kind: 'redirect';
|
|
277
|
+
route: string;
|
|
278
|
+
clearSession: boolean;
|
|
279
|
+
} | {
|
|
280
|
+
kind: 'logout';
|
|
281
|
+
route: string;
|
|
282
|
+
clearSession: boolean;
|
|
283
|
+
};
|
|
284
|
+
type AuthPolicyRoutes = {
|
|
285
|
+
unauthorized: string;
|
|
286
|
+
login: string;
|
|
287
|
+
twoFa: string;
|
|
288
|
+
resendEmail: string;
|
|
289
|
+
accountSelect: string;
|
|
290
|
+
};
|
|
291
|
+
type AuthInterceptorPolicyConfig = {
|
|
292
|
+
routes: AuthPolicyRoutes;
|
|
293
|
+
optionalAuthFailurePaths?: string[];
|
|
294
|
+
sessionProbePaths?: string[];
|
|
295
|
+
includeAdminMfaSecurityPrefixes?: boolean;
|
|
296
|
+
};
|
|
297
|
+
declare function isOptionalAuthFailureUrl(url: string | undefined, config: AuthInterceptorPolicyConfig): boolean;
|
|
298
|
+
declare function isSessionProbeUrl(url: string | undefined, config: AuthInterceptorPolicyConfig): boolean;
|
|
299
|
+
declare function persistAuthError(payload: ApiErrorPayload): ApiErrorPayload & {
|
|
300
|
+
ts: number;
|
|
301
|
+
};
|
|
302
|
+
declare function readPersistedAuthError(): (ApiErrorPayload & {
|
|
303
|
+
ts: number;
|
|
304
|
+
}) | null;
|
|
305
|
+
declare function resolveAuthErrorAction(input: {
|
|
306
|
+
status: number;
|
|
307
|
+
errorCode?: string;
|
|
308
|
+
url?: string;
|
|
309
|
+
skipGlobalAuthRedirect?: boolean;
|
|
310
|
+
isRetryRequest?: boolean;
|
|
311
|
+
policy: AuthInterceptorPolicyConfig;
|
|
312
|
+
}): AuthErrorAction;
|
|
227
313
|
|
|
228
314
|
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
229
315
|
type LogMeta = Record<string, unknown>;
|
|
@@ -247,7 +333,14 @@ interface StorageKeyConfig {
|
|
|
247
333
|
portal?: string;
|
|
248
334
|
subscriptionType?: string;
|
|
249
335
|
authUser?: string;
|
|
250
|
-
|
|
336
|
+
pagination?: string;
|
|
337
|
+
routeMenu?: string;
|
|
338
|
+
associationView?: string;
|
|
339
|
+
emailVerified?: string;
|
|
340
|
+
}
|
|
341
|
+
declare function configureStorageKeys(overrides?: StorageKeyConfig): void;
|
|
342
|
+
declare function resetStorageKeysForTests(): void;
|
|
343
|
+
declare function getStorageKeys(): Readonly<Required<StorageKeyConfig>>;
|
|
251
344
|
|
|
252
345
|
type EditorPreviewMockResult = {
|
|
253
346
|
data: unknown;
|
|
@@ -265,7 +358,13 @@ interface HttpClientConfig {
|
|
|
265
358
|
routes?: {
|
|
266
359
|
unauthorized?: string;
|
|
267
360
|
login?: string;
|
|
361
|
+
twoFa?: string;
|
|
362
|
+
resendEmail?: string;
|
|
363
|
+
accountSelect?: string;
|
|
268
364
|
};
|
|
365
|
+
refreshBufferSeconds?: number;
|
|
366
|
+
authPolicy?: Partial<AuthInterceptorPolicyConfig>;
|
|
367
|
+
useCookieRefresh?: boolean;
|
|
269
368
|
hubId?: string;
|
|
270
369
|
devPortalId?: string;
|
|
271
370
|
onLogout?: () => void | Promise<void>;
|
|
@@ -283,6 +382,24 @@ declare function getAuthRefreshToken(refreshToken: string | null): Promise<{
|
|
|
283
382
|
success: boolean;
|
|
284
383
|
}>;
|
|
285
384
|
|
|
385
|
+
declare function getAccessToken(): string | null;
|
|
386
|
+
declare function setSessionLifecycleListener(listener: (() => void) | null): void;
|
|
387
|
+
declare function clearAccessToken(): void;
|
|
388
|
+
declare function resetSessionAuthState(): void;
|
|
389
|
+
declare function didLastRefreshFail(): boolean;
|
|
390
|
+
declare function isSessionRefreshExhausted(): boolean;
|
|
391
|
+
declare function isExpiresAccessToken(): boolean;
|
|
392
|
+
declare function isRefreshInFlight(): boolean;
|
|
393
|
+
type RefreshSessionOptions = {
|
|
394
|
+
force?: boolean;
|
|
395
|
+
};
|
|
396
|
+
declare function refreshSession(options?: RefreshSessionOptions): Promise<void>;
|
|
397
|
+
declare function isAuthenticateApp(): boolean;
|
|
398
|
+
declare function isAuthenticated(): boolean;
|
|
399
|
+
declare function isAccessTokenExpired(): boolean;
|
|
400
|
+
declare function hasRefreshSession(): boolean;
|
|
401
|
+
declare function hasValidAccessToken(): boolean;
|
|
402
|
+
|
|
286
403
|
declare function getRefreshToken(): string | null;
|
|
287
404
|
|
|
288
405
|
declare function getSsoDetails(options?: MutationOptions<any, any>): {
|
|
@@ -525,6 +642,11 @@ declare function clientSession(options?: MutationOptions<LoginResponseData, any>
|
|
|
525
642
|
clientSession: (payload?: ClientSessionPayload | undefined) => Promise<LoginResponseData>;
|
|
526
643
|
isLoading: () => boolean;
|
|
527
644
|
};
|
|
645
|
+
declare function register(options?: MutationOptions<any, any>): {
|
|
646
|
+
mutate: (payload?: any) => Promise<any>;
|
|
647
|
+
register: (payload?: any) => Promise<any>;
|
|
648
|
+
isLoading: () => boolean;
|
|
649
|
+
};
|
|
528
650
|
declare function verifyEmail(options?: MutationOptions<any, any>): {
|
|
529
651
|
mutate: (payload?: VerifyEmailPayload | undefined) => Promise<any>;
|
|
530
652
|
verifyEmail: (payload?: VerifyEmailPayload | undefined) => Promise<any>;
|
|
@@ -566,10 +688,69 @@ declare function resendEmail(options?: MutationOptions<any, any>): {
|
|
|
566
688
|
isLoading: () => boolean;
|
|
567
689
|
};
|
|
568
690
|
|
|
691
|
+
type SessionContractInput = {
|
|
692
|
+
hasAccessToken: () => boolean;
|
|
693
|
+
isAccessTokenExpired: () => boolean;
|
|
694
|
+
hasRefreshSession: () => boolean;
|
|
695
|
+
isMfaPending?: () => boolean;
|
|
696
|
+
};
|
|
697
|
+
declare function hasValidAccess(input: SessionContractInput): boolean;
|
|
698
|
+
declare function isFullyAuthenticated(input: SessionContractInput): boolean;
|
|
699
|
+
declare function isMfaPendingSession(input: SessionContractInput): boolean;
|
|
700
|
+
declare function hasAuthenticatedAccess(input: SessionContractInput): boolean;
|
|
701
|
+
|
|
702
|
+
type VisibilityRefreshOptions = {
|
|
703
|
+
shouldRefresh: () => boolean;
|
|
704
|
+
refresh: () => Promise<void>;
|
|
705
|
+
intervalMs?: number;
|
|
706
|
+
};
|
|
707
|
+
declare function startVisibilityRefreshScheduler(options: VisibilityRefreshOptions): () => void;
|
|
708
|
+
declare function stopVisibilityRefreshScheduler(): void;
|
|
709
|
+
|
|
710
|
+
type MfaBootRecoveryResult = 'pending' | 'orphan_cleared' | 'stale_token_cleared' | 'none';
|
|
711
|
+
type MfaBootRecoveryInput = {
|
|
712
|
+
hasMfaContext: () => boolean;
|
|
713
|
+
hasAccessToken: () => boolean;
|
|
714
|
+
hasRefreshToken: () => boolean;
|
|
715
|
+
clearMfaOrphan: () => void;
|
|
716
|
+
clearStaleAccessToken: () => void;
|
|
717
|
+
};
|
|
718
|
+
declare function recoverMfaGateOnBoot(input: MfaBootRecoveryInput): MfaBootRecoveryResult;
|
|
719
|
+
|
|
720
|
+
type AuthRouteAction = {
|
|
721
|
+
kind: 'allow';
|
|
722
|
+
} | {
|
|
723
|
+
kind: 'show_loader';
|
|
724
|
+
} | {
|
|
725
|
+
kind: 'redirect_login';
|
|
726
|
+
returnUrl?: string;
|
|
727
|
+
} | {
|
|
728
|
+
kind: 'redirect_mfa';
|
|
729
|
+
} | {
|
|
730
|
+
kind: 'redirect_funnel';
|
|
731
|
+
step: 'email_verify' | 'hub_select' | 'portal_select';
|
|
732
|
+
};
|
|
733
|
+
type AuthFunnelState = {
|
|
734
|
+
emailVerified?: boolean;
|
|
735
|
+
hubId?: number | string | null;
|
|
736
|
+
portalId?: number | string | null;
|
|
737
|
+
};
|
|
738
|
+
type ResolveAuthRouteActionInput = {
|
|
739
|
+
pathname: string;
|
|
740
|
+
isPublicAuthRoute: (pathname: string) => boolean;
|
|
741
|
+
session: SessionContractInput;
|
|
742
|
+
funnel?: AuthFunnelState;
|
|
743
|
+
mfaRoute: string;
|
|
744
|
+
previewMode?: boolean;
|
|
745
|
+
sessionRestoring?: boolean;
|
|
746
|
+
sessionRefreshExhausted?: boolean;
|
|
747
|
+
};
|
|
748
|
+
declare function resolveAuthRouteAction(input: ResolveAuthRouteActionInput): AuthRouteAction;
|
|
749
|
+
|
|
569
750
|
type HttpErrorKind = 'service_unavailable' | 'network' | 'timeout' | 'auth' | 'client' | 'server' | 'unknown';
|
|
570
751
|
declare const SERVICE_UNAVAILABLE_MESSAGE = "Service temporarily unavailable. Please try again in a few minutes.";
|
|
571
752
|
declare function classifyHttpError(error: unknown): HttpErrorKind;
|
|
572
753
|
declare function isServiceUnavailableError(error: unknown): boolean;
|
|
573
754
|
declare function getHttpErrorMessage(error: unknown): string;
|
|
574
755
|
|
|
575
|
-
export {
|
|
756
|
+
export { isAuthenticated as $, totpEnrollVerify as A, totpDisable as B, phoneUnverify as C, backupCodesRegenerate as D, mfaOptOut as E, webauthnRegisterOptions as F, webauthnRegisterVerify as G, webauthnAuthOptions as H, webauthnAuthVerify as I, listWebauthnCredentials as J, deleteWebauthnCredential as K, passkeyLoginOptions as L, passkeyLoginVerify as M, getSecurityOverview as N, getSecurityLoginActivity as O, getSecuritySessions as P, revokeSecuritySession as Q, revokeOtherSecuritySessions as R, getLoginBootstrap as S, getSsoDetails as T, generateSsoUrl as U, ssoCallback as V, getRefreshToken as W, refreshSession as X, getAuthRefreshToken as Y, getAccessToken as Z, clearAccessToken as _, logout as a, getStorageKeys as a$, isAuthenticateApp as a0, isAccessTokenExpired as a1, isExpiresAccessToken as a2, hasRefreshSession as a3, hasValidAccessToken as a4, didLastRefreshFail as a5, isSessionRefreshExhausted as a6, isRefreshInFlight as a7, resetSessionAuthState as a8, type SessionContractInput as a9, type AuthErrorCodeValue as aA, type AuthFunnelState as aB, type AuthInterceptorPolicyConfig as aC, type AuthPolicyRoutes as aD, type AuthRouteAction as aE, type HttpClientConfig as aF, type HttpErrorKind as aG, type LogLevel as aH, type LoginHistoryRow as aI, type LoginResponseData as aJ, type MfaBootRecoveryResult as aK, type MfaEnrollmentStatus as aL, type MfaMethod as aM, type MfaMethodOption as aN, type MfaPortalScopeContext as aO, type PaginationResponse as aP, SERVICE_UNAVAILABLE_MESSAGE as aQ, type SecurityOverview as aR, type StorageKeyConfig as aS, type StoredAuthError as aT, type UnauthorizedPageCopy as aU, type WoodsportalRequestConfig as aV, classifyHttpError as aW, configureStorageKeys as aX, getFieldErrors as aY, getFormErrors as aZ, getHttpErrorMessage as a_, type LoggerConfig as aa, type TwoFaVerificationRequest as ab, type MfaOtpSendRequest as ac, type MfaPendingPasskeyOptionsRequest as ad, type MfaPendingPasskeyVerifyRequest as ae, type MfaStatusQuery as af, type MfaPreferenceRequest as ag, type PhoneVerifyStartRequest as ah, type PhoneVerifyConfirmRequest as ai, type TotpEnrollVerifyRequest as aj, type TotpDisableRequest as ak, type PhoneUnverifyRequest as al, type BackupCodesRegenerateRequest as am, type MfaBackupCodesResponse as an, type MfaOptOutRequest as ao, type WebAuthnVerifyRequest as ap, type PasskeyLoginOptionsRequest as aq, type PasskeyLoginVerifyRequest as ar, type SecurityOverviewQuery as as, type SecurityLoginActivityQuery as at, type SecuritySessionsQuery as au, type RevokeSecuritySessionPayload as av, type ActiveSession as aw, type ApiErrorPayload as ax, type AuthErrorAction as ay, AuthErrorCode as az, registerExistingUser as b, getUnauthorizedPageCopy as b0, hasAuthenticatedAccess as b1, hasValidAccess as b2, initializeHttpClient as b3, isFullyAuthenticated as b4, isMfaPendingSession as b5, isOptionalAuthFailureUrl as b6, isServiceUnavailableError as b7, isSessionProbeUrl as b8, parseApiErrorPayload as b9, persistAuthError as ba, readPersistedAuthError as bb, recoverMfaGateOnBoot as bc, resetStorageKeysForTests as bd, resolveAuthErrorAction as be, resolveAuthRouteAction as bf, setSessionLifecycleListener as bg, startVisibilityRefreshScheduler as bh, stopVisibilityRefreshScheduler as bi, type EditorPreviewMockHandler as bj, type EditorPreviewMockResult as bk, type LoginBootstrapMfaPolicy as bl, type LoginBootstrapPortal as bm, type LoginBootstrapResponse as bn, type LoginBootstrapSsoProvider as bo, setEditorPreviewMockHandler as bp, clientSession as c, resetPassword as d, resetPasswordVerifyToken as e, forgetPassword as f, verifyEmailResend as g, handoff as h, resendEmail as i, changePassword as j, profile as k, login as l, me as m, profileUpdate as n, verifyOtp as o, preLogin as p, pendingPasskeyOptions as q, register as r, sendMfaOtp as s, pendingPasskeyVerify as t, getMfaStatus as u, verifyEmail as v, setMfaPreferences as w, startPhoneVerify as x, confirmPhoneVerify as y, totpEnrollStart as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,113 @@
|
|
|
1
1
|
import { T as TableUiState, a as TableState, U as UserState, N as NoteState, E as EmailState, S as SyncState } from './use-sync-DpazhM4d.js';
|
|
2
2
|
import { l as list, a as list$1, b as list$2, s as sideBarList, f as form, o as objectFormOptions, d as details, u as update, c as create, e as createExisting, r as removeExisting, g as list$3, h as create$1, i as update$1, j as list$4, k as create$2, m as update$2, n as list$5, p as details$1, q as download, t as addFolder, v as addFile, w as imageUpload, x as attachmentUpload, y as purge, z as purgeStatus, C as CachePurgeTarget, A as CachePurgeRequest, B as CachePurgeListQuery, D as CachePurgeView, E as CreateCachePurgeJobOptions, P as PurgeResult, F as CrmCachePurgeOptions } from './cache-purge-Ca4idzyy.js';
|
|
3
3
|
export { G as CachePurgeDomain, H as CachePurgeMode } from './cache-purge-Ca4idzyy.js';
|
|
4
|
-
import { p as preLogin, l as login, c as clientSession, h as handoff, a as logout, v as verifyEmail,
|
|
5
|
-
export {
|
|
4
|
+
import { p as preLogin, l as login, c as clientSession, h as handoff, a as logout, r as register, v as verifyEmail, b as registerExistingUser, f as forgetPassword, d as resetPassword, e as resetPasswordVerifyToken, g as verifyEmailResend, i as resendEmail, j as changePassword, m as me, k as profile, n as profileUpdate, o as verifyOtp, s as sendMfaOtp, q as pendingPasskeyOptions, t as pendingPasskeyVerify, u as getMfaStatus, w as setMfaPreferences, x as startPhoneVerify, y as confirmPhoneVerify, z as totpEnrollStart, A as totpEnrollVerify, B as totpDisable, C as phoneUnverify, D as backupCodesRegenerate, E as mfaOptOut, F as webauthnRegisterOptions, G as webauthnRegisterVerify, H as webauthnAuthOptions, I as webauthnAuthVerify, J as listWebauthnCredentials, K as deleteWebauthnCredential, L as passkeyLoginOptions, M as passkeyLoginVerify, N as getSecurityOverview, O as getSecurityLoginActivity, P as getSecuritySessions, Q as revokeSecuritySession, R as revokeOtherSecuritySessions, S as getLoginBootstrap, T as getSsoDetails, U as generateSsoUrl, V as ssoCallback, W as getRefreshToken, X as refreshSession, Y as getAuthRefreshToken, Z as getAccessToken, _ as clearAccessToken, $ as isAuthenticated, a0 as isAuthenticateApp, a1 as isAccessTokenExpired, a2 as isExpiresAccessToken, a3 as hasRefreshSession, a4 as hasValidAccessToken, a5 as didLastRefreshFail, a6 as isSessionRefreshExhausted, a7 as isRefreshInFlight, a8 as resetSessionAuthState, a9 as SessionContractInput, aa as LoggerConfig, ab as TwoFaVerificationRequest, ac as MfaOtpSendRequest, ad as MfaPendingPasskeyOptionsRequest, ae as MfaPendingPasskeyVerifyRequest, af as MfaStatusQuery, ag as MfaPreferenceRequest, ah as PhoneVerifyStartRequest, ai as PhoneVerifyConfirmRequest, aj as TotpEnrollVerifyRequest, ak as TotpDisableRequest, al as PhoneUnverifyRequest, am as BackupCodesRegenerateRequest, an as MfaBackupCodesResponse, ao as MfaOptOutRequest, ap as WebAuthnVerifyRequest, aq as PasskeyLoginOptionsRequest, ar as PasskeyLoginVerifyRequest, as as SecurityOverviewQuery, at as SecurityLoginActivityQuery, au as SecuritySessionsQuery, av as RevokeSecuritySessionPayload } from './http-errors-_XPPqJ_a.js';
|
|
5
|
+
export { aw as ActiveSession, ax as ApiErrorPayload, ay as AuthErrorAction, az as AuthErrorCode, aA as AuthErrorCodeValue, aB as AuthFunnelState, aC as AuthInterceptorPolicyConfig, aD as AuthPolicyRoutes, aE as AuthRouteAction, aF as HttpClientConfig, aG as HttpErrorKind, aH as LogLevel, aI as LoginHistoryRow, aJ as LoginResponseData, aK as MfaBootRecoveryResult, aL as MfaEnrollmentStatus, aM as MfaMethod, aN as MfaMethodOption, aO as MfaPortalScopeContext, aP as PaginationResponse, aQ as SERVICE_UNAVAILABLE_MESSAGE, aR as SecurityOverview, aS as StorageKeyConfig, aT as StoredAuthError, aU as UnauthorizedPageCopy, aV as WoodsportalRequestConfig, aW as classifyHttpError, aX as configureStorageKeys, aY as getFieldErrors, aZ as getFormErrors, a_ as getHttpErrorMessage, a$ as getStorageKeys, b0 as getUnauthorizedPageCopy, b1 as hasAuthenticatedAccess, b2 as hasValidAccess, b3 as initializeHttpClient, b4 as isFullyAuthenticated, b5 as isMfaPendingSession, b6 as isOptionalAuthFailureUrl, b7 as isServiceUnavailableError, b8 as isSessionProbeUrl, b9 as parseApiErrorPayload, ba as persistAuthError, bb as readPersistedAuthError, bc as recoverMfaGateOnBoot, bd as resetStorageKeysForTests, be as resolveAuthErrorAction, bf as resolveAuthRouteAction, bg as setSessionLifecycleListener, bh as startVisibilityRefreshScheduler, bi as stopVisibilityRefreshScheduler } from './http-errors-_XPPqJ_a.js';
|
|
6
6
|
import { P as PreLoginPayload, L as LoginPayload, V as VerifyEmailPayload, R as ResetPasswordVerifyTokenPayload, a as ResetPasswordPayload, F as ForgetPasswordPayload, C as ChangePasswordPayload } from './index-Bh9eY8sA.js';
|
|
7
7
|
export { b as Config, M as MutationOptions } from './index-Bh9eY8sA.js';
|
|
8
8
|
import 'axios';
|
|
9
9
|
|
|
10
|
+
declare const WP_UI_THEME = "wp.ui.theme";
|
|
11
|
+
declare const WP_STORAGE_KEYS: {
|
|
12
|
+
readonly c: {
|
|
13
|
+
readonly hub: "wp.c.hub";
|
|
14
|
+
readonly auth: {
|
|
15
|
+
readonly login: "wp.c.auth.login";
|
|
16
|
+
readonly refresh: "wp.c.auth.refresh";
|
|
17
|
+
readonly portal: "wp.c.auth.portal";
|
|
18
|
+
readonly sub: "wp.c.auth.sub";
|
|
19
|
+
readonly emailOk: "wp.c.auth.emailOk";
|
|
20
|
+
readonly err: "wp.c.auth.err";
|
|
21
|
+
readonly rev: "wp.c.auth.rev";
|
|
22
|
+
readonly refreshLock: "wp.c.auth.refreshLock";
|
|
23
|
+
readonly iframeRtPrefix: "wp.c.auth.rt.";
|
|
24
|
+
};
|
|
25
|
+
readonly ui: {
|
|
26
|
+
readonly pag: "wp.c.ui.pag";
|
|
27
|
+
readonly menu: "wp.c.ui.menu";
|
|
28
|
+
readonly assoc: "wp.c.ui.assoc";
|
|
29
|
+
};
|
|
30
|
+
readonly login: {
|
|
31
|
+
readonly email: "wp.c.login.email";
|
|
32
|
+
readonly force: "wp.c.login.force";
|
|
33
|
+
readonly passkey: "wp.c.login.passkey";
|
|
34
|
+
readonly done: "wp.c.login.done";
|
|
35
|
+
};
|
|
36
|
+
readonly mfa: {
|
|
37
|
+
readonly methods: "wp.c.mfa.methods";
|
|
38
|
+
readonly default: "wp.c.mfa.default";
|
|
39
|
+
readonly otp: "wp.c.mfa.otp";
|
|
40
|
+
readonly scope: "wp.c.mfa.scope";
|
|
41
|
+
readonly portalId: "wp.c.mfa.portalId";
|
|
42
|
+
readonly portalName: "wp.c.mfa.portalName";
|
|
43
|
+
readonly portalUrl: "wp.c.mfa.portalUrl";
|
|
44
|
+
readonly enrolled: "wp.c.mfa.enrolled";
|
|
45
|
+
readonly emailOk: "wp.c.mfa.emailOk";
|
|
46
|
+
readonly phoneOk: "wp.c.mfa.phoneOk";
|
|
47
|
+
};
|
|
48
|
+
readonly sso: {
|
|
49
|
+
readonly cb: "wp.c.sso.cb";
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
readonly a: {
|
|
53
|
+
readonly auth: {
|
|
54
|
+
readonly login: "wp.a.auth.login";
|
|
55
|
+
readonly emailOk: "wp.a.auth.emailOk";
|
|
56
|
+
readonly mfa: "wp.a.auth.mfa";
|
|
57
|
+
readonly portalId: "wp.a.auth.portalId";
|
|
58
|
+
readonly portal: "wp.a.auth.portal";
|
|
59
|
+
readonly accT: "wp.a.auth.accT";
|
|
60
|
+
readonly sesT: "wp.a.auth.sesT";
|
|
61
|
+
readonly err: "wp.a.auth.err";
|
|
62
|
+
readonly noBoot: "wp.a.auth.noBoot";
|
|
63
|
+
readonly refreshLock: "wp.a.auth.refreshLock";
|
|
64
|
+
readonly rev: "wp.a.auth.rev";
|
|
65
|
+
};
|
|
66
|
+
readonly hub: {
|
|
67
|
+
readonly id: "wp.a.hub.id";
|
|
68
|
+
readonly acct: "wp.a.hub.acct";
|
|
69
|
+
readonly cfg: "wp.a.hub.cfg";
|
|
70
|
+
};
|
|
71
|
+
readonly sync: {
|
|
72
|
+
readonly create: "wp.a.sync.create";
|
|
73
|
+
readonly state: "wp.a.sync.state";
|
|
74
|
+
readonly jobId: "wp.a.sync.jobId";
|
|
75
|
+
readonly jobType: "wp.a.sync.jobType";
|
|
76
|
+
};
|
|
77
|
+
readonly ui: {
|
|
78
|
+
readonly loading: "wp.a.ui.loading";
|
|
79
|
+
readonly intTabPrefix: "wp.a.ui.intTab.";
|
|
80
|
+
};
|
|
81
|
+
readonly mfa: {
|
|
82
|
+
readonly methods: "wp.a.mfa.methods";
|
|
83
|
+
readonly default: "wp.a.mfa.default";
|
|
84
|
+
readonly otp: "wp.a.mfa.otp";
|
|
85
|
+
readonly scope: "wp.a.mfa.scope";
|
|
86
|
+
readonly portalId: "wp.a.mfa.portalId";
|
|
87
|
+
readonly portalName: "wp.a.mfa.portalName";
|
|
88
|
+
readonly portalUrl: "wp.a.mfa.portalUrl";
|
|
89
|
+
readonly enrolled: "wp.a.mfa.enrolled";
|
|
90
|
+
readonly emailOk: "wp.a.mfa.emailOk";
|
|
91
|
+
readonly phoneOk: "wp.a.mfa.phoneOk";
|
|
92
|
+
};
|
|
93
|
+
readonly sso: {
|
|
94
|
+
readonly cbPrefix: "wp.a.sso.cb.";
|
|
95
|
+
};
|
|
96
|
+
readonly bill: {
|
|
97
|
+
readonly result: "wp.a.bill.result";
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
readonly d: {
|
|
101
|
+
readonly log: "wp.d.log";
|
|
102
|
+
readonly cfg: {
|
|
103
|
+
readonly theme: "wp.d.cfg.theme";
|
|
104
|
+
readonly side: "wp.d.cfg.side";
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
declare function wpClientIframeRefreshKey(hubId: string | number): string;
|
|
109
|
+
declare function wpClientIframeRefreshExpKey(hubId: string | number): string;
|
|
110
|
+
|
|
10
111
|
declare const api: {
|
|
11
112
|
auth: {
|
|
12
113
|
preLogin: typeof preLogin;
|
|
@@ -14,6 +115,7 @@ declare const api: {
|
|
|
14
115
|
clientSession: typeof clientSession;
|
|
15
116
|
handoff: typeof handoff;
|
|
16
117
|
logout: typeof logout;
|
|
118
|
+
register: typeof register;
|
|
17
119
|
verifyEmail: typeof verifyEmail;
|
|
18
120
|
registerExistingUser: typeof registerExistingUser;
|
|
19
121
|
forgetPassword: typeof forgetPassword;
|
|
@@ -65,6 +167,7 @@ declare const api: {
|
|
|
65
167
|
};
|
|
66
168
|
session: {
|
|
67
169
|
getRefreshToken: typeof getRefreshToken;
|
|
170
|
+
refreshSession: typeof refreshSession;
|
|
68
171
|
refreshAccessToken: typeof getAuthRefreshToken;
|
|
69
172
|
getAccessToken: typeof getAccessToken;
|
|
70
173
|
clearAccessToken: typeof clearAccessToken;
|
|
@@ -73,6 +176,16 @@ declare const api: {
|
|
|
73
176
|
isAccessTokenExpired: typeof isAccessTokenExpired;
|
|
74
177
|
isExpiresAccessToken: typeof isExpiresAccessToken;
|
|
75
178
|
isCookieExpired: (key: string) => boolean;
|
|
179
|
+
hasRefreshSession: typeof hasRefreshSession;
|
|
180
|
+
hasValidAccessToken: typeof hasValidAccessToken;
|
|
181
|
+
didLastRefreshFail: typeof didLastRefreshFail;
|
|
182
|
+
isSessionRefreshExhausted: typeof isSessionRefreshExhausted;
|
|
183
|
+
isRefreshInFlight: typeof isRefreshInFlight;
|
|
184
|
+
resetSessionAuthState: typeof resetSessionAuthState;
|
|
185
|
+
contract: () => SessionContractInput;
|
|
186
|
+
isFullyAuthenticated: () => boolean;
|
|
187
|
+
hasAuthenticatedAccess: () => boolean;
|
|
188
|
+
hasValidAccess: () => boolean;
|
|
76
189
|
};
|
|
77
190
|
};
|
|
78
191
|
crm: {
|
|
@@ -313,6 +426,11 @@ declare const Client: {
|
|
|
313
426
|
login: (data: LoginPayload) => Promise<unknown>;
|
|
314
427
|
verifyOtp: (data: TwoFaVerificationRequest) => Promise<unknown>;
|
|
315
428
|
verifyEmail: (data: VerifyEmailPayload) => Promise<unknown>;
|
|
429
|
+
register: (data: {
|
|
430
|
+
name: string;
|
|
431
|
+
email: string;
|
|
432
|
+
password: string;
|
|
433
|
+
}) => Promise<unknown>;
|
|
316
434
|
resetPasswordVerifyToken: (data: ResetPasswordVerifyTokenPayload) => Promise<unknown>;
|
|
317
435
|
resetPassword: (data: ResetPasswordPayload) => Promise<unknown>;
|
|
318
436
|
forgetPassword: (data: ForgetPasswordPayload) => Promise<unknown>;
|
|
@@ -356,6 +474,22 @@ declare const setConfig: {
|
|
|
356
474
|
setDevPortalId(portalId: string): void;
|
|
357
475
|
};
|
|
358
476
|
|
|
477
|
+
declare function migrateLegacyStorageKeys(): void;
|
|
478
|
+
declare function getClientAuthCookieNamesToClear(): string[];
|
|
479
|
+
declare function clearClientSessionStorageKeys(): void;
|
|
480
|
+
declare function clearClientIframeRefreshLocalKeys(): void;
|
|
481
|
+
declare function clearStaleIframeRefreshForOtherHubs(activeHubId: string | number | undefined): void;
|
|
482
|
+
|
|
483
|
+
declare const clearClientAuthCookies: () => void;
|
|
484
|
+
|
|
485
|
+
declare function resetSessionStores(): void;
|
|
486
|
+
declare function clearClientSdkSession(): void;
|
|
487
|
+
|
|
488
|
+
declare function signalSessionChanged(kind?: 'rev' | 'login'): void;
|
|
489
|
+
type SessionSyncListener = (kind: 'rev' | 'login') => void;
|
|
490
|
+
declare function installCrossTabSessionListener(onChange?: SessionSyncListener): () => void;
|
|
491
|
+
declare function applyCrossTabSessionRevocation(): void;
|
|
492
|
+
|
|
359
493
|
declare const store: {
|
|
360
494
|
storage: {
|
|
361
495
|
set: (key: string, value: unknown) => void;
|
|
@@ -427,6 +561,7 @@ declare const store: {
|
|
|
427
561
|
modifiedObjectsData(results: any): void;
|
|
428
562
|
clearTablePrependData(): void;
|
|
429
563
|
setTablePrependData(response: any, props?: any): Promise<void>;
|
|
564
|
+
updateTablePrependData(response: any, payload?: any): any;
|
|
430
565
|
};
|
|
431
566
|
};
|
|
432
567
|
user: {
|
|
@@ -482,4 +617,4 @@ declare const store: {
|
|
|
482
617
|
};
|
|
483
618
|
};
|
|
484
619
|
|
|
485
|
-
export { CachePurgeListQuery, CachePurgeRequest, CachePurgeTarget, CachePurgeView, ChangePasswordPayload, Client, CreateCachePurgeJobOptions, CrmCachePurgeOptions, DEFAULT_HUBSPOT_TIMEZONE, ForgetPasswordPayload, type HubSpotActivityDateTimeParts, LoggerConfig, LoginPayload, PreLoginPayload, PurgeResult, ResetPasswordPayload, ResetPasswordVerifyTokenPayload, TwoFaVerificationRequest, VerifyEmailPayload, api, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, configureLogger, createCachePurgeJob, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, formatGmtOffset, formatHubSpotActivityDateTime, formatHubSpotActivityDateTimeParts, getCurrentTimeZone, config as hubContext, mergePurgeTargets, normalizeToTimestamp, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, setConfig as setHubContext, store, toCachePurgeListQuery };
|
|
620
|
+
export { CachePurgeListQuery, CachePurgeRequest, CachePurgeTarget, CachePurgeView, ChangePasswordPayload, Client, CreateCachePurgeJobOptions, CrmCachePurgeOptions, DEFAULT_HUBSPOT_TIMEZONE, ForgetPasswordPayload, type HubSpotActivityDateTimeParts, LoggerConfig, LoginPayload, PreLoginPayload, PurgeResult, ResetPasswordPayload, ResetPasswordVerifyTokenPayload, SessionContractInput, TwoFaVerificationRequest, VerifyEmailPayload, WP_STORAGE_KEYS, WP_UI_THEME, api, applyCrossTabSessionRevocation, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, clearClientAuthCookies, clearClientIframeRefreshLocalKeys, clearClientSdkSession, clearClientSessionStorageKeys, clearStaleIframeRefreshForOtherHubs, configureLogger, createCachePurgeJob, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, formatGmtOffset, formatHubSpotActivityDateTime, formatHubSpotActivityDateTimeParts, getClientAuthCookieNamesToClear, getCurrentTimeZone, config as hubContext, installCrossTabSessionListener, mergePurgeTargets, migrateLegacyStorageKeys, normalizeToTimestamp, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resetSessionStores, resolveCrmListPurgeQuery, setConfig as setHubContext, signalSessionChanged, store, toCachePurgeListQuery, wpClientIframeRefreshExpKey, wpClientIframeRefreshKey };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
import './chunk-
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export { applyCrossTabSessionRevocation, clearClientSdkSession, installCrossTabSessionListener, resetSessionStores, signalSessionChanged } from './chunk-J33YFZCS.js';
|
|
2
|
+
import { authApi } from './chunk-WNBF6FKG.js';
|
|
3
|
+
export { hasAuthenticatedAccess, hasValidAccess, isFullyAuthenticated, isMfaPendingSession, recoverMfaGateOnBoot, resolveAuthRouteAction } from './chunk-WNBF6FKG.js';
|
|
4
|
+
export { isOptionalAuthFailureUrl, isSessionProbeUrl, persistAuthError, readPersistedAuthError, resolveAuthErrorAction } from './chunk-DZC3DJUO.js';
|
|
5
|
+
import { crmApi } from './chunk-GVXA7OKY.js';
|
|
6
|
+
import './chunk-55MIERLJ.js';
|
|
7
|
+
import { navigationApi } from './chunk-4IKGBHFJ.js';
|
|
8
|
+
export { Client, SERVICE_UNAVAILABLE_MESSAGE, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, classifyHttpError, createCachePurgeJob, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, getFieldErrors, getFormErrors, getHttpErrorMessage, initializeHttpClient, isServiceUnavailableError, mergePurgeTargets, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, startVisibilityRefreshScheduler, stopVisibilityRefreshScheduler, toCachePurgeListQuery } from './chunk-4IKGBHFJ.js';
|
|
9
|
+
import './chunk-OF5OLEE5.js';
|
|
10
|
+
import { actions8, syncStore, actions5, emailStore, actions4, noteStore, actions6, userStore, actions2, tableStore, tableUiActions, tableUiStore } from './chunk-U66LWTVC.js';
|
|
11
|
+
import { storage } from './chunk-ADOV2R3A.js';
|
|
12
|
+
export { configureLogger, config as hubContext, setConfig as setHubContext, setSessionLifecycleListener } from './chunk-ADOV2R3A.js';
|
|
13
|
+
export { AuthErrorCode, getUnauthorizedPageCopy, parseApiErrorPayload } from './chunk-COHBSTHF.js';
|
|
14
|
+
export { clearClientAuthCookies, clearClientIframeRefreshLocalKeys, clearClientSessionStorageKeys, clearStaleIframeRefreshForOtherHubs, configureStorageKeys, getClientAuthCookieNamesToClear, getStorageKeys, migrateLegacyStorageKeys, resetStorageKeysForTests } from './chunk-YOT5RW3R.js';
|
|
15
|
+
export { WP_STORAGE_KEYS, WP_UI_THEME, wpClientIframeRefreshExpKey, wpClientIframeRefreshKey } from './chunk-6ROV3EE2.js';
|
|
9
16
|
|
|
10
17
|
// src/main/api/compose-api.ts
|
|
11
18
|
var api = {
|
|
@@ -79,7 +86,7 @@ var store = {
|
|
|
79
86
|
storage,
|
|
80
87
|
tableUi: { store: tableUiStore, actions: tableUiActions },
|
|
81
88
|
table: { store: tableStore, actions: actions2 },
|
|
82
|
-
user: { store: userStore, actions:
|
|
89
|
+
user: { store: userStore, actions: actions6 },
|
|
83
90
|
note: { store: noteStore, actions: actions4 },
|
|
84
91
|
email: { store: emailStore, actions: actions5 },
|
|
85
92
|
sync: { store: syncStore, actions: actions8 }
|
package/dist/index.js.map
CHAN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AA,IACA,SAAA,EAAW,GAAG,QAAQ,CAAA,IAAA,EAAO,QAAQ,CAAA,CAAA,EAAI,SAAS,GAAG,IAAA;AAAK,GAC9D;AACJ;AAKO,SAAS,6BAAA,CAA8B,SAAA,EAAoB,QAAA,GAAmB,kBAAA,EAAmB,EAAW;AAC/G,EAAA,OAAO,kCAAA,CAAmC,SAAA,EAAW,QAAQ,CAAA,EAAG,SAAA,IAAa,EAAA;AACjF;;;ACKO,IAAM,KAAA,GAAQ;AAAA,EACjB,OAAA;AAAA,EACA,OAAA,EAAS,EAAE,KAAA,EAAO,YAAA,EAAc,SAAS,cAAA,EAAe;AAAA,EACxD,KAAA,EAAO,EAAE,KAAA,EAAO,UAAA,WAAYA,QAAA,EAAsB;AAAA,EAClD,IAAA,EAAM,EAAE,KAAA,EAAO,SAAA,EAAW,SAASA,QAAAA,EAAY;AAAA,EAC/C,IAAA,EAAM,EAAE,KAAA,EAAO,SAAA,EAAW,SAASA,QAAAA,EAAY;AAAA,EAC/C,KAAA,EAAO,EAAE,KAAA,EAAO,UAAA,EAAY,SAASA,QAAAA,EAAa;AAAA,EAClD,IAAA,EAAM,EAAE,KAAA,EAAO,SAAA,EAAW,SAASA,QAAAA;AACvC","file":"index.js","sourcesContent":["import { authApi } from './nested-auth-api'\nimport { crmApi } from './nested-crm-api'\nimport { navigationApi } from './navigation-api'\n\n/** Public API — nested domains only (SDK 4.0). */\nexport const api = {\n auth: authApi,\n crm: crmApi,\n navigation: navigationApi\n}\n","/** HubSpot portal default; override when portal timezone is available from config. */\nexport const DEFAULT_HUBSPOT_TIMEZONE = 'Asia/Kolkata'\n\n/**\n * Detect the runtime/browser IANA timezone (e.g. `Asia/Kolkata`).\n * Falls back to the WoodsPortal default timezone when unavailable.\n */\nexport function getCurrentTimeZone(): string {\n try {\n return Intl.DateTimeFormat().resolvedOptions().timeZone || DEFAULT_HUBSPOT_TIMEZONE\n } catch {\n return DEFAULT_HUBSPOT_TIMEZONE\n }\n}\n\n/**\n * Coerce HubSpot-style timestamps (ms string/number) to epoch milliseconds.\n */\nexport function normalizeToTimestamp(value: unknown): number | null {\n if (value == null || value === '') return null\n\n if (typeof value === 'number') {\n return value > 100_000_000_000 ? value : null\n }\n\n if (typeof value === 'string' && /^\\d+$/.test(value)) {\n const n = Number(value)\n return n > 100_000_000_000 ? n : null\n }\n\n if (typeof value === 'string' || value instanceof Date) {\n const date = new Date(value)\n return Number.isNaN(date.getTime()) ? null : date.getTime()\n }\n\n return null\n}\n\n/**\n * GMT offset label aligned with HubSpot activity timeline (e.g. `GMT+5:30`).\n */\nexport function formatGmtOffset(timeZone: string = getCurrentTimeZone(), date: Date = new Date()): string {\n const raw = new Intl.DateTimeFormat('en-US', {\n timeZone,\n timeZoneName: 'longOffset'\n })\n .formatToParts(date)\n .find((part) => part.type === 'timeZoneName')?.value\n\n if (!raw) return ''\n\n // Intl may emit GMT+05:30; HubSpot uses GMT+5:30.\n return raw.replace(/GMT([+-])0(\\d)(?=:)/, 'GMT$1$2')\n}\n\nexport type HubSpotActivityDateTimeParts = {\n date: string\n time: string\n gmtOffset: string\n /** Full HubSpot-style label, e.g. `May 27, 2026 at 11:31 PM GMT+5:30`. */\n formatted: string\n}\n\n/**\n * Format a HubSpot epoch-ms timestamp like the CRM activity timeline.\n */\nexport function formatHubSpotActivityDateTimeParts(timestamp: unknown, timeZone: string = getCurrentTimeZone()): HubSpotActivityDateTimeParts | null {\n const ms = normalizeToTimestamp(timestamp)\n if (ms == null) return null\n\n const date = new Date(ms)\n const datePart = new Intl.DateTimeFormat('en-US', {\n timeZone,\n month: 'long',\n day: 'numeric',\n year: 'numeric'\n }).format(date)\n const timePart = new Intl.DateTimeFormat('en-US', {\n timeZone,\n hour: 'numeric',\n minute: '2-digit',\n hour12: true\n }).format(date)\n const gmtOffset = formatGmtOffset(timeZone, date)\n\n return {\n date: datePart,\n time: timePart,\n gmtOffset,\n formatted: `${datePart} at ${timePart} ${gmtOffset}`.trim()\n }\n}\n\n/**\n * @returns HubSpot activity string, e.g. `May 27, 2026 at 11:31 PM GMT+5:30`, or empty string.\n */\nexport function formatHubSpotActivityDateTime(timestamp: unknown, timeZone: string = getCurrentTimeZone()): string {\n return formatHubSpotActivityDateTimeParts(timestamp, timeZone)?.formatted ?? ''\n}\n","/**\n * WoodsPortal client SDK — public entry module.\n *\n * Configure HTTP once with {@link initializeHttpClient} in production, then use\n * {@link api}, {@link store}, and {@link api.navigation}.\n */\nimport { api } from './api/compose-api'\nimport {\n tableStore,\n tableActions,\n tableUiStore,\n tableUiActions,\n userStore,\n userActions,\n noteStore,\n noteActions,\n emailStore,\n emailActions,\n syncStore,\n syncActions\n} from './state'\nimport { storage } from './core/utils/localStorage'\n\nexport {\n DEFAULT_HUBSPOT_TIMEZONE,\n getCurrentTimeZone,\n formatGmtOffset,\n formatHubSpotActivityDateTime,\n formatHubSpotActivityDateTimeParts,\n normalizeToTimestamp\n} from './core/utils/datetime'\nexport type { HubSpotActivityDateTimeParts } from './core/utils/datetime'\nexport {\n purgeCrmObjectDataCache,\n purgeCrmListCache,\n purgeCrmListCacheAfterCrmWrite,\n purgeCrmDetailAndListAfterCrmWrite,\n purgeCrmRecordCache,\n purgeEngagementCaches,\n purgeEngagementCachesAfterCrmWrite,\n purgeCrmCombined,\n buildCachePurgeRequest,\n buildCrmListPurgeTarget,\n buildCrmSinglePurgeTarget,\n buildEngagementPurgeTarget,\n buildPortalConfigPurgeTarget,\n buildUserSessionPurgeTarget,\n mergePurgeTargets,\n createCachePurgeJob,\n extractHubspotRecordIdFromWriteResponse,\n extractEngagementItemIdFromWriteResponse,\n resolveCrmListPurgeQuery,\n toCachePurgeListQuery\n} from './core/utils/cache'\nexport type { CrmCachePurgeOptions } from './core/types/cache-purge'\nexport type {\n CachePurgeRequest,\n CachePurgeTarget,\n CachePurgeListQuery,\n CachePurgeView,\n CachePurgeDomain,\n CachePurgeMode,\n PurgeResult,\n CreateCachePurgeJobOptions\n} from './core/types/cache-purge'\n\n/** Axios setup, error helpers, and {@link HttpClientConfig}. */\nexport { initializeHttpClient, getFormErrors, getFieldErrors } from './core/http/http-client'\nexport type { HttpClientConfig, StorageKeyConfig } from './core/http/http-client'\nexport { classifyHttpError, getHttpErrorMessage, isServiceUnavailableError, SERVICE_UNAVAILABLE_MESSAGE } from './core/http/http-errors'\nexport type { HttpErrorKind } from './core/http/http-errors'\n\nexport { configureLogger } from './core/logging/logger'\nexport type { LogLevel, LoggerConfig } from './core/logging/logger-types'\n\nexport { Client } from './core/http/client-assembler'\nexport { config as hubContext, setConfig as setHubContext } from './core/utils/hub-context'\n\nexport type {\n Config,\n MutationOptions,\n PreLoginPayload,\n LoginPayload,\n VerifyEmailPayload,\n ResetPasswordVerifyTokenPayload,\n ResetPasswordPayload,\n ForgetPasswordPayload,\n ChangePasswordPayload,\n MfaMethod,\n MfaMethodOption,\n MfaPortalScopeContext,\n LoginResponseData,\n TwoFaVerificationRequest,\n MfaEnrollmentStatus,\n SecurityOverview,\n LoginHistoryRow,\n ActiveSession,\n PaginationResponse\n} from './core/types'\n\nexport { api }\n\n/** Storage helpers and CRM stores. */\nexport const store = {\n storage,\n tableUi: { store: tableUiStore, actions: tableUiActions },\n table: { store: tableStore, actions: tableActions },\n user: { store: userStore, actions: userActions },\n note: { store: noteStore, actions: noteActions },\n email: { store: emailStore, actions: emailActions },\n sync: { store: syncStore, actions: syncActions }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/main/api/compose-api.ts","../src/main/core/utils/datetime.ts","../src/main/index.ts"],"names":["actions"],"mappings":";;;;;;;;;;;;;;;;;AAKO,IAAM,GAAA,GAAM;AAAA,EACf,IAAA,EAAM,OAAA;AAAA,EACN,GAAA,EAAK,MAAA;AAAA,EACL,UAAA,EAAY;AAChB;;;ACRO,IAAM,wBAAA,GAA2B;AAMjC,SAAS,kBAAA,GAA6B;AACzC,EAAA,IAAI;AACA,IAAA,OAAO,IAAA,CAAK,cAAA,EAAe,CAAE,eAAA,GAAkB,QAAA,IAAY,wBAA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AAe;AAAA,EACxD,KAAA,EAAO,EAAE,KAAA,EAAO,UAAA,WAAYA,QAAA,EAAsB;AAAA,EAClD,IAAA,EAAM,EAAE,KAAA,EAAO,SAAA,EAAW,SAASA,QAAAA,EAAY;AAAA,EAC/C,IAAA,EAAM,EAAE,KAAA,EAAO,SAAA,EAAW,SAASA,QAAAA,EAAY;AAAA,EAC/C,KAAA,EAAO,EAAE,KAAA,EAAO,UAAA,EAAY,SAASA,QAAAA,EAAa;AAAA,EAClD,IAAA,EAAM,EAAE,KAAA,EAAO,SAAA,EAAW,SAASA,QAAAA;AACvC","file":"index.js","sourcesContent":["import { authApi } from './nested-auth-api'\nimport { crmApi } from './nested-crm-api'\nimport { navigationApi } from './navigation-api'\n\n/** Public API — nested domains only (SDK 4.0). */\nexport const api = {\n auth: authApi,\n crm: crmApi,\n navigation: navigationApi\n}\n","/** HubSpot portal default; override when portal timezone is available from config. */\nexport const DEFAULT_HUBSPOT_TIMEZONE = 'Asia/Kolkata'\n\n/**\n * Detect the runtime/browser IANA timezone (e.g. `Asia/Kolkata`).\n * Falls back to the WoodsPortal default timezone when unavailable.\n */\nexport function getCurrentTimeZone(): string {\n try {\n return Intl.DateTimeFormat().resolvedOptions().timeZone || DEFAULT_HUBSPOT_TIMEZONE\n } catch {\n return DEFAULT_HUBSPOT_TIMEZONE\n }\n}\n\n/**\n * Coerce HubSpot-style timestamps (ms string/number) to epoch milliseconds.\n */\nexport function normalizeToTimestamp(value: unknown): number | null {\n if (value == null || value === '') return null\n\n if (typeof value === 'number') {\n return value > 100_000_000_000 ? value : null\n }\n\n if (typeof value === 'string' && /^\\d+$/.test(value)) {\n const n = Number(value)\n return n > 100_000_000_000 ? n : null\n }\n\n if (typeof value === 'string' || value instanceof Date) {\n const date = new Date(value)\n return Number.isNaN(date.getTime()) ? null : date.getTime()\n }\n\n return null\n}\n\n/**\n * GMT offset label aligned with HubSpot activity timeline (e.g. `GMT+5:30`).\n */\nexport function formatGmtOffset(timeZone: string = getCurrentTimeZone(), date: Date = new Date()): string {\n const raw = new Intl.DateTimeFormat('en-US', {\n timeZone,\n timeZoneName: 'longOffset'\n })\n .formatToParts(date)\n .find((part) => part.type === 'timeZoneName')?.value\n\n if (!raw) return ''\n\n // Intl may emit GMT+05:30; HubSpot uses GMT+5:30.\n return raw.replace(/GMT([+-])0(\\d)(?=:)/, 'GMT$1$2')\n}\n\nexport type HubSpotActivityDateTimeParts = {\n date: string\n time: string\n gmtOffset: string\n /** Full HubSpot-style label, e.g. `May 27, 2026 at 11:31 PM GMT+5:30`. */\n formatted: string\n}\n\n/**\n * Format a HubSpot epoch-ms timestamp like the CRM activity timeline.\n */\nexport function formatHubSpotActivityDateTimeParts(timestamp: unknown, timeZone: string = getCurrentTimeZone()): HubSpotActivityDateTimeParts | null {\n const ms = normalizeToTimestamp(timestamp)\n if (ms == null) return null\n\n const date = new Date(ms)\n const datePart = new Intl.DateTimeFormat('en-US', {\n timeZone,\n month: 'long',\n day: 'numeric',\n year: 'numeric'\n }).format(date)\n const timePart = new Intl.DateTimeFormat('en-US', {\n timeZone,\n hour: 'numeric',\n minute: '2-digit',\n hour12: true\n }).format(date)\n const gmtOffset = formatGmtOffset(timeZone, date)\n\n return {\n date: datePart,\n time: timePart,\n gmtOffset,\n formatted: `${datePart} at ${timePart} ${gmtOffset}`.trim()\n }\n}\n\n/**\n * @returns HubSpot activity string, e.g. `May 27, 2026 at 11:31 PM GMT+5:30`, or empty string.\n */\nexport function formatHubSpotActivityDateTime(timestamp: unknown, timeZone: string = getCurrentTimeZone()): string {\n return formatHubSpotActivityDateTimeParts(timestamp, timeZone)?.formatted ?? ''\n}\n","/**\n * WoodsPortal client SDK — public entry module.\n *\n * Configure HTTP once with {@link initializeHttpClient} in production, then use\n * {@link api}, {@link store}, and {@link api.navigation}.\n */\nimport { api } from './api/compose-api'\nimport {\n tableStore,\n tableActions,\n tableUiStore,\n tableUiActions,\n userStore,\n userActions,\n noteStore,\n noteActions,\n emailStore,\n emailActions,\n syncStore,\n syncActions\n} from './state'\nimport { storage } from './core/utils/localStorage'\n\nexport {\n DEFAULT_HUBSPOT_TIMEZONE,\n getCurrentTimeZone,\n formatGmtOffset,\n formatHubSpotActivityDateTime,\n formatHubSpotActivityDateTimeParts,\n normalizeToTimestamp\n} from './core/utils/datetime'\nexport type { HubSpotActivityDateTimeParts } from './core/utils/datetime'\nexport {\n purgeCrmObjectDataCache,\n purgeCrmListCache,\n purgeCrmListCacheAfterCrmWrite,\n purgeCrmDetailAndListAfterCrmWrite,\n purgeCrmRecordCache,\n purgeEngagementCaches,\n purgeEngagementCachesAfterCrmWrite,\n purgeCrmCombined,\n buildCachePurgeRequest,\n buildCrmListPurgeTarget,\n buildCrmSinglePurgeTarget,\n buildEngagementPurgeTarget,\n buildPortalConfigPurgeTarget,\n buildUserSessionPurgeTarget,\n mergePurgeTargets,\n createCachePurgeJob,\n extractHubspotRecordIdFromWriteResponse,\n extractEngagementItemIdFromWriteResponse,\n resolveCrmListPurgeQuery,\n toCachePurgeListQuery\n} from './core/utils/cache'\nexport type { CrmCachePurgeOptions } from './core/types/cache-purge'\nexport type {\n CachePurgeRequest,\n CachePurgeTarget,\n CachePurgeListQuery,\n CachePurgeView,\n CachePurgeDomain,\n CachePurgeMode,\n PurgeResult,\n CreateCachePurgeJobOptions\n} from './core/types/cache-purge'\n\n/** Axios setup, error helpers, and {@link HttpClientConfig}. */\nexport { initializeHttpClient, getFormErrors, getFieldErrors } from './core/http/http-client'\nexport type { HttpClientConfig, StorageKeyConfig } from './core/http/http-client'\n\n/** Shared auth contract (client + admin consistency). */\nexport {\n AuthErrorCode,\n parseApiErrorPayload,\n getUnauthorizedPageCopy,\n resolveAuthErrorAction,\n isOptionalAuthFailureUrl,\n isSessionProbeUrl,\n persistAuthError,\n readPersistedAuthError,\n hasValidAccess,\n isFullyAuthenticated,\n isMfaPendingSession,\n hasAuthenticatedAccess,\n recoverMfaGateOnBoot,\n startVisibilityRefreshScheduler,\n stopVisibilityRefreshScheduler,\n resolveAuthRouteAction\n} from './core/auth/index.js'\nexport type {\n ApiErrorPayload,\n StoredAuthError,\n AuthErrorCodeValue,\n UnauthorizedPageCopy,\n AuthErrorAction,\n AuthPolicyRoutes,\n AuthInterceptorPolicyConfig,\n WoodsportalRequestConfig,\n SessionContractInput,\n MfaBootRecoveryResult,\n AuthRouteAction,\n AuthFunnelState\n} from './core/auth/index.js'\nexport { classifyHttpError, getHttpErrorMessage, isServiceUnavailableError, SERVICE_UNAVAILABLE_MESSAGE } from './core/http/http-errors'\nexport type { HttpErrorKind } from './core/http/http-errors'\n\nexport { configureLogger } from './core/logging/logger'\nexport type { LogLevel, LoggerConfig } from './core/logging/logger-types'\n\nexport { Client } from './core/http/client-assembler'\nexport { config as hubContext, setConfig as setHubContext } from './core/utils/hub-context'\n\nexport { WP_STORAGE_KEYS, WP_UI_THEME, wpClientIframeRefreshKey, wpClientIframeRefreshExpKey } from './core/utils/wp-storage-keys'\nexport {\n migrateLegacyStorageKeys,\n getClientAuthCookieNamesToClear,\n clearClientSessionStorageKeys,\n clearClientIframeRefreshLocalKeys,\n clearStaleIframeRefreshForOtherHubs\n} from './core/utils/storage-migration'\nexport { clearClientAuthCookies } from './core/utils/cookie'\nexport { clearClientSdkSession, resetSessionStores } from './core/http/session-teardown'\nexport { setSessionLifecycleListener } from './core/http/token-store'\nexport { signalSessionChanged, installCrossTabSessionListener, applyCrossTabSessionRevocation } from './core/http/cross-tab-session'\nexport { configureStorageKeys, getStorageKeys, resetStorageKeysForTests } from './core/utils/storage-keys'\n\nexport type {\n Config,\n MutationOptions,\n PreLoginPayload,\n LoginPayload,\n VerifyEmailPayload,\n ResetPasswordVerifyTokenPayload,\n ResetPasswordPayload,\n ForgetPasswordPayload,\n ChangePasswordPayload,\n MfaMethod,\n MfaMethodOption,\n MfaPortalScopeContext,\n LoginResponseData,\n TwoFaVerificationRequest,\n MfaEnrollmentStatus,\n SecurityOverview,\n LoginHistoryRow,\n ActiveSession,\n PaginationResponse\n} from './core/types'\n\nexport { api }\n\n/** Storage helpers and CRM stores. */\nexport const store = {\n storage,\n tableUi: { store: tableUiStore, actions: tableUiActions },\n table: { store: tableStore, actions: tableActions },\n user: { store: userStore, actions: userActions },\n note: { store: noteStore, actions: noteActions },\n email: { store: emailStore, actions: emailActions },\n sync: { store: syncStore, actions: syncActions }\n}\n"]}
|