woodsportal-client-sdk 4.0.4-dev.9 → 4.0.7-dev.1
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-LU2L5NJM.js +5 -0
- package/dist/auth-interceptor-policy-LU2L5NJM.js.map +1 -0
- package/dist/auth-utils-Z5P6SMLJ.js +5 -0
- package/dist/{auth-utils-MNMC2QGX.js.map → auth-utils-Z5P6SMLJ.js.map} +1 -1
- package/dist/chunk-55MIERLJ.js +3 -0
- package/dist/chunk-55MIERLJ.js.map +1 -0
- package/dist/chunk-6YOL5LPB.js +163 -0
- package/dist/chunk-6YOL5LPB.js.map +1 -0
- package/dist/chunk-B2OVKOJU.js +633 -0
- package/dist/chunk-B2OVKOJU.js.map +1 -0
- package/dist/chunk-BKT4MFQM.js +161 -0
- package/dist/chunk-BKT4MFQM.js.map +1 -0
- package/dist/{chunk-7Q6HRCUA.js → chunk-BURJ2NUL.js} +3 -3
- package/dist/{chunk-7Q6HRCUA.js.map → chunk-BURJ2NUL.js.map} +1 -1
- package/dist/chunk-COHBSTHF.js +82 -0
- package/dist/chunk-COHBSTHF.js.map +1 -0
- package/dist/{chunk-2TG7X2ML.js → chunk-FJAOCLB4.js} +12 -11
- package/dist/chunk-FJAOCLB4.js.map +1 -0
- package/dist/chunk-GUYIJ4ZE.js +165 -0
- package/dist/chunk-GUYIJ4ZE.js.map +1 -0
- package/dist/{chunk-VCYJAVD3.js → chunk-HAXXPW65.js} +167 -13
- package/dist/chunk-HAXXPW65.js.map +1 -0
- package/dist/{chunk-IBKBTIT6.js → chunk-OFPD644E.js} +6 -6
- package/dist/{chunk-IBKBTIT6.js.map → chunk-OFPD644E.js.map} +1 -1
- package/dist/{chunk-ZEJGWZK3.js → chunk-PFOSN7EB.js} +1242 -1269
- package/dist/chunk-PFOSN7EB.js.map +1 -0
- package/dist/{chunk-4AMFPSO2.js → chunk-WNE4LSVH.js} +465 -258
- package/dist/chunk-WNE4LSVH.js.map +1 -0
- package/dist/chunk-YNOZWRK3.js +306 -0
- package/dist/chunk-YNOZWRK3.js.map +1 -0
- package/dist/cross-tab-session-TUFJ6KU7.js +9 -0
- package/dist/cross-tab-session-TUFJ6KU7.js.map +1 -0
- package/dist/entries/auth.d.ts +17 -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-Bwhj6cfB.d.ts} +192 -9
- package/dist/index.d.ts +141 -3
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/dist/refresh-lock-JQVP4YOS.js +72 -0
- package/dist/refresh-lock-JQVP4YOS.js.map +1 -0
- package/dist/storage-migration-BY2QL6YD.js +4 -0
- package/dist/storage-migration-BY2QL6YD.js.map +1 -0
- package/package.json +11 -9
- package/dist/auth-utils-MNMC2QGX.js +0 -3
- package/dist/chunk-2TG7X2ML.js.map +0 -1
- package/dist/chunk-4AMFPSO2.js.map +0 -1
- package/dist/chunk-QPSCMK4W.js +0 -237
- package/dist/chunk-QPSCMK4W.js.map +0 -1
- package/dist/chunk-VCYJAVD3.js.map +0 -1
- package/dist/chunk-ZEJGWZK3.js.map +0 -1
|
@@ -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,26 @@ 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 hydrateSessionRefreshState(): void;
|
|
388
|
+
declare function clearSessionRefreshExhaustedState(): void;
|
|
389
|
+
declare function clearAccessToken(): void;
|
|
390
|
+
declare function resetSessionAuthState(): void;
|
|
391
|
+
declare function didLastRefreshFail(): boolean;
|
|
392
|
+
declare function isSessionRefreshExhausted(): boolean;
|
|
393
|
+
declare function isExpiresAccessToken(): boolean;
|
|
394
|
+
declare function isRefreshInFlight(): boolean;
|
|
395
|
+
type RefreshSessionOptions = {
|
|
396
|
+
force?: boolean;
|
|
397
|
+
};
|
|
398
|
+
declare function refreshSession(options?: RefreshSessionOptions): Promise<void>;
|
|
399
|
+
declare function isAuthenticateApp(): boolean;
|
|
400
|
+
declare function isAuthenticated(): boolean;
|
|
401
|
+
declare function isAccessTokenExpired(): boolean;
|
|
402
|
+
declare function hasRefreshSession(): boolean;
|
|
403
|
+
declare function hasValidAccessToken(): boolean;
|
|
404
|
+
|
|
286
405
|
declare function getRefreshToken(): string | null;
|
|
287
406
|
|
|
288
407
|
declare function getSsoDetails(options?: MutationOptions<any, any>): {
|
|
@@ -525,6 +644,11 @@ declare function clientSession(options?: MutationOptions<LoginResponseData, any>
|
|
|
525
644
|
clientSession: (payload?: ClientSessionPayload | undefined) => Promise<LoginResponseData>;
|
|
526
645
|
isLoading: () => boolean;
|
|
527
646
|
};
|
|
647
|
+
declare function register(options?: MutationOptions<any, any>): {
|
|
648
|
+
mutate: (payload?: any) => Promise<any>;
|
|
649
|
+
register: (payload?: any) => Promise<any>;
|
|
650
|
+
isLoading: () => boolean;
|
|
651
|
+
};
|
|
528
652
|
declare function verifyEmail(options?: MutationOptions<any, any>): {
|
|
529
653
|
mutate: (payload?: VerifyEmailPayload | undefined) => Promise<any>;
|
|
530
654
|
verifyEmail: (payload?: VerifyEmailPayload | undefined) => Promise<any>;
|
|
@@ -566,10 +690,69 @@ declare function resendEmail(options?: MutationOptions<any, any>): {
|
|
|
566
690
|
isLoading: () => boolean;
|
|
567
691
|
};
|
|
568
692
|
|
|
693
|
+
type SessionContractInput = {
|
|
694
|
+
hasAccessToken: () => boolean;
|
|
695
|
+
isAccessTokenExpired: () => boolean;
|
|
696
|
+
hasRefreshSession: () => boolean;
|
|
697
|
+
isMfaPending?: () => boolean;
|
|
698
|
+
};
|
|
699
|
+
declare function hasValidAccess(input: SessionContractInput): boolean;
|
|
700
|
+
declare function isFullyAuthenticated(input: SessionContractInput): boolean;
|
|
701
|
+
declare function isMfaPendingSession(input: SessionContractInput): boolean;
|
|
702
|
+
declare function hasAuthenticatedAccess(input: SessionContractInput): boolean;
|
|
703
|
+
|
|
704
|
+
type VisibilityRefreshOptions = {
|
|
705
|
+
shouldRefresh: () => boolean;
|
|
706
|
+
refresh: () => Promise<void>;
|
|
707
|
+
intervalMs?: number;
|
|
708
|
+
};
|
|
709
|
+
declare function startVisibilityRefreshScheduler(options: VisibilityRefreshOptions): () => void;
|
|
710
|
+
declare function stopVisibilityRefreshScheduler(): void;
|
|
711
|
+
|
|
712
|
+
type MfaBootRecoveryResult = 'pending' | 'orphan_cleared' | 'stale_token_cleared' | 'none';
|
|
713
|
+
type MfaBootRecoveryInput = {
|
|
714
|
+
hasMfaContext: () => boolean;
|
|
715
|
+
hasAccessToken: () => boolean;
|
|
716
|
+
hasRefreshToken: () => boolean;
|
|
717
|
+
clearMfaOrphan: () => void;
|
|
718
|
+
clearStaleAccessToken: () => void;
|
|
719
|
+
};
|
|
720
|
+
declare function recoverMfaGateOnBoot(input: MfaBootRecoveryInput): MfaBootRecoveryResult;
|
|
721
|
+
|
|
722
|
+
type AuthRouteAction = {
|
|
723
|
+
kind: 'allow';
|
|
724
|
+
} | {
|
|
725
|
+
kind: 'show_loader';
|
|
726
|
+
} | {
|
|
727
|
+
kind: 'redirect_login';
|
|
728
|
+
returnUrl?: string;
|
|
729
|
+
} | {
|
|
730
|
+
kind: 'redirect_mfa';
|
|
731
|
+
} | {
|
|
732
|
+
kind: 'redirect_funnel';
|
|
733
|
+
step: 'email_verify' | 'hub_select' | 'portal_select';
|
|
734
|
+
};
|
|
735
|
+
type AuthFunnelState = {
|
|
736
|
+
emailVerified?: boolean;
|
|
737
|
+
hubId?: number | string | null;
|
|
738
|
+
portalId?: number | string | null;
|
|
739
|
+
};
|
|
740
|
+
type ResolveAuthRouteActionInput = {
|
|
741
|
+
pathname: string;
|
|
742
|
+
isPublicAuthRoute: (pathname: string) => boolean;
|
|
743
|
+
session: SessionContractInput;
|
|
744
|
+
funnel?: AuthFunnelState;
|
|
745
|
+
mfaRoute: string;
|
|
746
|
+
previewMode?: boolean;
|
|
747
|
+
sessionRestoring?: boolean;
|
|
748
|
+
sessionRefreshExhausted?: boolean;
|
|
749
|
+
};
|
|
750
|
+
declare function resolveAuthRouteAction(input: ResolveAuthRouteActionInput): AuthRouteAction;
|
|
751
|
+
|
|
569
752
|
type HttpErrorKind = 'service_unavailable' | 'network' | 'timeout' | 'auth' | 'client' | 'server' | 'unknown';
|
|
570
753
|
declare const SERVICE_UNAVAILABLE_MESSAGE = "Service temporarily unavailable. Please try again in a few minutes.";
|
|
571
754
|
declare function classifyHttpError(error: unknown): HttpErrorKind;
|
|
572
755
|
declare function isServiceUnavailableError(error: unknown): boolean;
|
|
573
756
|
declare function getHttpErrorMessage(error: unknown): string;
|
|
574
757
|
|
|
575
|
-
export {
|
|
758
|
+
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, getFormErrors 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, clearSessionRefreshExhaustedState as a9, type AuthErrorAction as aA, AuthErrorCode as aB, type AuthErrorCodeValue as aC, type AuthFunnelState as aD, type AuthInterceptorPolicyConfig as aE, type AuthPolicyRoutes as aF, type AuthRouteAction as aG, type HttpClientConfig as aH, type HttpErrorKind as aI, type LogLevel as aJ, type LoginHistoryRow as aK, type LoginResponseData as aL, type MfaBootRecoveryResult as aM, type MfaEnrollmentStatus as aN, type MfaMethod as aO, type MfaMethodOption as aP, type MfaPortalScopeContext as aQ, type PaginationResponse as aR, SERVICE_UNAVAILABLE_MESSAGE as aS, type SecurityOverview as aT, type StorageKeyConfig as aU, type StoredAuthError as aV, type UnauthorizedPageCopy as aW, type WoodsportalRequestConfig as aX, classifyHttpError as aY, configureStorageKeys as aZ, getFieldErrors as a_, hydrateSessionRefreshState as aa, type SessionContractInput as ab, type LoggerConfig as ac, type TwoFaVerificationRequest as ad, type MfaOtpSendRequest as ae, type MfaPendingPasskeyOptionsRequest as af, type MfaPendingPasskeyVerifyRequest as ag, type MfaStatusQuery as ah, type MfaPreferenceRequest as ai, type PhoneVerifyStartRequest as aj, type PhoneVerifyConfirmRequest as ak, type TotpEnrollVerifyRequest as al, type TotpDisableRequest as am, type PhoneUnverifyRequest as an, type BackupCodesRegenerateRequest as ao, type MfaBackupCodesResponse as ap, type MfaOptOutRequest as aq, type WebAuthnVerifyRequest as ar, type PasskeyLoginOptionsRequest as as, type PasskeyLoginVerifyRequest as at, type SecurityOverviewQuery as au, type SecurityLoginActivityQuery as av, type SecuritySessionsQuery as aw, type RevokeSecuritySessionPayload as ax, type ActiveSession as ay, type ApiErrorPayload as az, registerExistingUser as b, getHttpErrorMessage as b0, getStorageKeys as b1, getUnauthorizedPageCopy as b2, hasAuthenticatedAccess as b3, hasValidAccess as b4, initializeHttpClient as b5, isFullyAuthenticated as b6, isMfaPendingSession as b7, isOptionalAuthFailureUrl as b8, isServiceUnavailableError as b9, isSessionProbeUrl as ba, parseApiErrorPayload as bb, persistAuthError as bc, readPersistedAuthError as bd, recoverMfaGateOnBoot as be, resetStorageKeysForTests as bf, resolveAuthErrorAction as bg, resolveAuthRouteAction as bh, setSessionLifecycleListener as bi, startVisibilityRefreshScheduler as bj, stopVisibilityRefreshScheduler as bk, type EditorPreviewMockHandler as bl, type EditorPreviewMockResult as bm, type LoginBootstrapMfaPolicy as bn, type LoginBootstrapPortal as bo, type LoginBootstrapResponse as bp, type LoginBootstrapSsoProvider as bq, setEditorPreviewMockHandler as br, 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,114 @@
|
|
|
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 clearSessionRefreshExhaustedState, aa as hydrateSessionRefreshState, ab as SessionContractInput, ac as LoggerConfig, ad as TwoFaVerificationRequest, ae as MfaOtpSendRequest, af as MfaPendingPasskeyOptionsRequest, ag as MfaPendingPasskeyVerifyRequest, ah as MfaStatusQuery, ai as MfaPreferenceRequest, aj as PhoneVerifyStartRequest, ak as PhoneVerifyConfirmRequest, al as TotpEnrollVerifyRequest, am as TotpDisableRequest, an as PhoneUnverifyRequest, ao as BackupCodesRegenerateRequest, ap as MfaBackupCodesResponse, aq as MfaOptOutRequest, ar as WebAuthnVerifyRequest, as as PasskeyLoginOptionsRequest, at as PasskeyLoginVerifyRequest, au as SecurityOverviewQuery, av as SecurityLoginActivityQuery, aw as SecuritySessionsQuery, ax as RevokeSecuritySessionPayload } from './http-errors-Bwhj6cfB.js';
|
|
5
|
+
export { ay as ActiveSession, az as ApiErrorPayload, aA as AuthErrorAction, aB as AuthErrorCode, aC as AuthErrorCodeValue, aD as AuthFunnelState, aE as AuthInterceptorPolicyConfig, aF as AuthPolicyRoutes, aG as AuthRouteAction, aH as HttpClientConfig, aI as HttpErrorKind, aJ as LogLevel, aK as LoginHistoryRow, aL as LoginResponseData, aM as MfaBootRecoveryResult, aN as MfaEnrollmentStatus, aO as MfaMethod, aP as MfaMethodOption, aQ as MfaPortalScopeContext, aR as PaginationResponse, aS as SERVICE_UNAVAILABLE_MESSAGE, aT as SecurityOverview, aU as StorageKeyConfig, aV as StoredAuthError, aW as UnauthorizedPageCopy, aX as WoodsportalRequestConfig, aY as classifyHttpError, aZ as configureStorageKeys, a_ as getFieldErrors, a$ as getFormErrors, b0 as getHttpErrorMessage, b1 as getStorageKeys, b2 as getUnauthorizedPageCopy, b3 as hasAuthenticatedAccess, b4 as hasValidAccess, b5 as initializeHttpClient, b6 as isFullyAuthenticated, b7 as isMfaPendingSession, b8 as isOptionalAuthFailureUrl, b9 as isServiceUnavailableError, ba as isSessionProbeUrl, bb as parseApiErrorPayload, bc as persistAuthError, bd as readPersistedAuthError, be as recoverMfaGateOnBoot, bf as resetStorageKeysForTests, bg as resolveAuthErrorAction, bh as resolveAuthRouteAction, bi as setSessionLifecycleListener, bj as startVisibilityRefreshScheduler, bk as stopVisibilityRefreshScheduler } from './http-errors-Bwhj6cfB.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 refreshExhausted: "wp.c.auth.refreshExhausted";
|
|
22
|
+
readonly rev: "wp.c.auth.rev";
|
|
23
|
+
readonly refreshLock: "wp.c.auth.refreshLock";
|
|
24
|
+
readonly iframeRtPrefix: "wp.c.auth.rt.";
|
|
25
|
+
};
|
|
26
|
+
readonly ui: {
|
|
27
|
+
readonly pag: "wp.c.ui.pag";
|
|
28
|
+
readonly menu: "wp.c.ui.menu";
|
|
29
|
+
readonly assoc: "wp.c.ui.assoc";
|
|
30
|
+
};
|
|
31
|
+
readonly login: {
|
|
32
|
+
readonly email: "wp.c.login.email";
|
|
33
|
+
readonly force: "wp.c.login.force";
|
|
34
|
+
readonly passkey: "wp.c.login.passkey";
|
|
35
|
+
readonly done: "wp.c.login.done";
|
|
36
|
+
};
|
|
37
|
+
readonly mfa: {
|
|
38
|
+
readonly methods: "wp.c.mfa.methods";
|
|
39
|
+
readonly default: "wp.c.mfa.default";
|
|
40
|
+
readonly otp: "wp.c.mfa.otp";
|
|
41
|
+
readonly scope: "wp.c.mfa.scope";
|
|
42
|
+
readonly portalId: "wp.c.mfa.portalId";
|
|
43
|
+
readonly portalName: "wp.c.mfa.portalName";
|
|
44
|
+
readonly portalUrl: "wp.c.mfa.portalUrl";
|
|
45
|
+
readonly enrolled: "wp.c.mfa.enrolled";
|
|
46
|
+
readonly emailOk: "wp.c.mfa.emailOk";
|
|
47
|
+
readonly phoneOk: "wp.c.mfa.phoneOk";
|
|
48
|
+
};
|
|
49
|
+
readonly sso: {
|
|
50
|
+
readonly cb: "wp.c.sso.cb";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly a: {
|
|
54
|
+
readonly auth: {
|
|
55
|
+
readonly login: "wp.a.auth.login";
|
|
56
|
+
readonly emailOk: "wp.a.auth.emailOk";
|
|
57
|
+
readonly mfa: "wp.a.auth.mfa";
|
|
58
|
+
readonly portalId: "wp.a.auth.portalId";
|
|
59
|
+
readonly portal: "wp.a.auth.portal";
|
|
60
|
+
readonly accT: "wp.a.auth.accT";
|
|
61
|
+
readonly sesT: "wp.a.auth.sesT";
|
|
62
|
+
readonly err: "wp.a.auth.err";
|
|
63
|
+
readonly noBoot: "wp.a.auth.noBoot";
|
|
64
|
+
readonly refreshLock: "wp.a.auth.refreshLock";
|
|
65
|
+
readonly rev: "wp.a.auth.rev";
|
|
66
|
+
};
|
|
67
|
+
readonly hub: {
|
|
68
|
+
readonly id: "wp.a.hub.id";
|
|
69
|
+
readonly acct: "wp.a.hub.acct";
|
|
70
|
+
readonly cfg: "wp.a.hub.cfg";
|
|
71
|
+
};
|
|
72
|
+
readonly sync: {
|
|
73
|
+
readonly create: "wp.a.sync.create";
|
|
74
|
+
readonly state: "wp.a.sync.state";
|
|
75
|
+
readonly jobId: "wp.a.sync.jobId";
|
|
76
|
+
readonly jobType: "wp.a.sync.jobType";
|
|
77
|
+
};
|
|
78
|
+
readonly ui: {
|
|
79
|
+
readonly loading: "wp.a.ui.loading";
|
|
80
|
+
readonly intTabPrefix: "wp.a.ui.intTab.";
|
|
81
|
+
};
|
|
82
|
+
readonly mfa: {
|
|
83
|
+
readonly methods: "wp.a.mfa.methods";
|
|
84
|
+
readonly default: "wp.a.mfa.default";
|
|
85
|
+
readonly otp: "wp.a.mfa.otp";
|
|
86
|
+
readonly scope: "wp.a.mfa.scope";
|
|
87
|
+
readonly portalId: "wp.a.mfa.portalId";
|
|
88
|
+
readonly portalName: "wp.a.mfa.portalName";
|
|
89
|
+
readonly portalUrl: "wp.a.mfa.portalUrl";
|
|
90
|
+
readonly enrolled: "wp.a.mfa.enrolled";
|
|
91
|
+
readonly emailOk: "wp.a.mfa.emailOk";
|
|
92
|
+
readonly phoneOk: "wp.a.mfa.phoneOk";
|
|
93
|
+
};
|
|
94
|
+
readonly sso: {
|
|
95
|
+
readonly cbPrefix: "wp.a.sso.cb.";
|
|
96
|
+
};
|
|
97
|
+
readonly bill: {
|
|
98
|
+
readonly result: "wp.a.bill.result";
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
readonly d: {
|
|
102
|
+
readonly log: "wp.d.log";
|
|
103
|
+
readonly cfg: {
|
|
104
|
+
readonly theme: "wp.d.cfg.theme";
|
|
105
|
+
readonly side: "wp.d.cfg.side";
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
declare function wpClientIframeRefreshKey(hubId: string | number): string;
|
|
110
|
+
declare function wpClientIframeRefreshExpKey(hubId: string | number): string;
|
|
111
|
+
|
|
10
112
|
declare const api: {
|
|
11
113
|
auth: {
|
|
12
114
|
preLogin: typeof preLogin;
|
|
@@ -14,6 +116,7 @@ declare const api: {
|
|
|
14
116
|
clientSession: typeof clientSession;
|
|
15
117
|
handoff: typeof handoff;
|
|
16
118
|
logout: typeof logout;
|
|
119
|
+
register: typeof register;
|
|
17
120
|
verifyEmail: typeof verifyEmail;
|
|
18
121
|
registerExistingUser: typeof registerExistingUser;
|
|
19
122
|
forgetPassword: typeof forgetPassword;
|
|
@@ -65,6 +168,7 @@ declare const api: {
|
|
|
65
168
|
};
|
|
66
169
|
session: {
|
|
67
170
|
getRefreshToken: typeof getRefreshToken;
|
|
171
|
+
refreshSession: typeof refreshSession;
|
|
68
172
|
refreshAccessToken: typeof getAuthRefreshToken;
|
|
69
173
|
getAccessToken: typeof getAccessToken;
|
|
70
174
|
clearAccessToken: typeof clearAccessToken;
|
|
@@ -73,6 +177,18 @@ declare const api: {
|
|
|
73
177
|
isAccessTokenExpired: typeof isAccessTokenExpired;
|
|
74
178
|
isExpiresAccessToken: typeof isExpiresAccessToken;
|
|
75
179
|
isCookieExpired: (key: string) => boolean;
|
|
180
|
+
hasRefreshSession: typeof hasRefreshSession;
|
|
181
|
+
hasValidAccessToken: typeof hasValidAccessToken;
|
|
182
|
+
didLastRefreshFail: typeof didLastRefreshFail;
|
|
183
|
+
isSessionRefreshExhausted: typeof isSessionRefreshExhausted;
|
|
184
|
+
isRefreshInFlight: typeof isRefreshInFlight;
|
|
185
|
+
resetSessionAuthState: typeof resetSessionAuthState;
|
|
186
|
+
clearSessionRefreshExhaustedState: typeof clearSessionRefreshExhaustedState;
|
|
187
|
+
hydrateSessionRefreshState: typeof hydrateSessionRefreshState;
|
|
188
|
+
contract: () => SessionContractInput;
|
|
189
|
+
isFullyAuthenticated: () => boolean;
|
|
190
|
+
hasAuthenticatedAccess: () => boolean;
|
|
191
|
+
hasValidAccess: () => boolean;
|
|
76
192
|
};
|
|
77
193
|
};
|
|
78
194
|
crm: {
|
|
@@ -313,6 +429,11 @@ declare const Client: {
|
|
|
313
429
|
login: (data: LoginPayload) => Promise<unknown>;
|
|
314
430
|
verifyOtp: (data: TwoFaVerificationRequest) => Promise<unknown>;
|
|
315
431
|
verifyEmail: (data: VerifyEmailPayload) => Promise<unknown>;
|
|
432
|
+
register: (data: {
|
|
433
|
+
name: string;
|
|
434
|
+
email: string;
|
|
435
|
+
password: string;
|
|
436
|
+
}) => Promise<unknown>;
|
|
316
437
|
resetPasswordVerifyToken: (data: ResetPasswordVerifyTokenPayload) => Promise<unknown>;
|
|
317
438
|
resetPassword: (data: ResetPasswordPayload) => Promise<unknown>;
|
|
318
439
|
forgetPassword: (data: ForgetPasswordPayload) => Promise<unknown>;
|
|
@@ -356,6 +477,22 @@ declare const setConfig: {
|
|
|
356
477
|
setDevPortalId(portalId: string): void;
|
|
357
478
|
};
|
|
358
479
|
|
|
480
|
+
declare function migrateLegacyStorageKeys(): void;
|
|
481
|
+
declare function getClientAuthCookieNamesToClear(): string[];
|
|
482
|
+
declare function clearClientSessionStorageKeys(): void;
|
|
483
|
+
declare function clearClientIframeRefreshLocalKeys(): void;
|
|
484
|
+
declare function clearStaleIframeRefreshForOtherHubs(activeHubId: string | number | undefined): void;
|
|
485
|
+
|
|
486
|
+
declare const clearClientAuthCookies: () => void;
|
|
487
|
+
|
|
488
|
+
declare function resetSessionStores(): void;
|
|
489
|
+
declare function clearClientSdkSession(): void;
|
|
490
|
+
|
|
491
|
+
declare function signalSessionChanged(kind?: 'rev' | 'login'): void;
|
|
492
|
+
type SessionSyncListener = (kind: 'rev' | 'login') => void;
|
|
493
|
+
declare function installCrossTabSessionListener(onChange?: SessionSyncListener): () => void;
|
|
494
|
+
declare function applyCrossTabSessionRevocation(): void;
|
|
495
|
+
|
|
359
496
|
declare const store: {
|
|
360
497
|
storage: {
|
|
361
498
|
set: (key: string, value: unknown) => void;
|
|
@@ -427,6 +564,7 @@ declare const store: {
|
|
|
427
564
|
modifiedObjectsData(results: any): void;
|
|
428
565
|
clearTablePrependData(): void;
|
|
429
566
|
setTablePrependData(response: any, props?: any): Promise<void>;
|
|
567
|
+
updateTablePrependData(response: any, payload?: any): any;
|
|
430
568
|
};
|
|
431
569
|
};
|
|
432
570
|
user: {
|
|
@@ -482,4 +620,4 @@ declare const store: {
|
|
|
482
620
|
};
|
|
483
621
|
};
|
|
484
622
|
|
|
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 };
|
|
623
|
+
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-6YOL5LPB.js';
|
|
2
|
+
import { authApi } from './chunk-HAXXPW65.js';
|
|
3
|
+
export { hasAuthenticatedAccess, hasValidAccess, isFullyAuthenticated, isMfaPendingSession, recoverMfaGateOnBoot, resolveAuthRouteAction } from './chunk-HAXXPW65.js';
|
|
4
|
+
export { isOptionalAuthFailureUrl, isSessionProbeUrl, persistAuthError, readPersistedAuthError, resolveAuthErrorAction } from './chunk-GUYIJ4ZE.js';
|
|
5
|
+
import { crmApi } from './chunk-FJAOCLB4.js';
|
|
6
|
+
import './chunk-55MIERLJ.js';
|
|
7
|
+
import { navigationApi } from './chunk-WNE4LSVH.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-WNE4LSVH.js';
|
|
9
|
+
import './chunk-BURJ2NUL.js';
|
|
10
|
+
import { actions8, syncStore, actions5, emailStore, actions4, noteStore, actions6, userStore, actions2, tableStore, tableUiActions, tableUiStore } from './chunk-PFOSN7EB.js';
|
|
11
|
+
import { storage } from './chunk-B2OVKOJU.js';
|
|
12
|
+
export { configureLogger, config as hubContext, setConfig as setHubContext, setSessionLifecycleListener } from './chunk-B2OVKOJU.js';
|
|
13
|
+
export { AuthErrorCode, getUnauthorizedPageCopy, parseApiErrorPayload } from './chunk-COHBSTHF.js';
|
|
14
|
+
export { clearClientAuthCookies, clearClientIframeRefreshLocalKeys, clearClientSessionStorageKeys, clearStaleIframeRefreshForOtherHubs, configureStorageKeys, getClientAuthCookieNamesToClear, getStorageKeys, migrateLegacyStorageKeys, resetStorageKeysForTests } from './chunk-YNOZWRK3.js';
|
|
15
|
+
export { WP_STORAGE_KEYS, WP_UI_THEME, wpClientIframeRefreshExpKey, wpClientIframeRefreshKey } from './chunk-BKT4MFQM.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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main/api/compose-api.ts","../src/main/core/utils/datetime.ts","../src/main/index.ts"],"names":["actions"],"mappings":"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","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":"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","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"]}
|