woodsportal-client-sdk 4.0.4-dev.12 → 4.0.4-dev.14

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.
Files changed (40) hide show
  1. package/dist/adapters/angular/index.js +4 -4
  2. package/dist/adapters/react/index.js +4 -4
  3. package/dist/adapters/vue/index.js +4 -4
  4. package/dist/auth-error-codes-D7CXVBEN.js +3 -0
  5. package/dist/auth-error-codes-D7CXVBEN.js.map +1 -0
  6. package/dist/auth-interceptor-policy-F7JIJWSQ.js +4 -0
  7. package/dist/auth-interceptor-policy-F7JIJWSQ.js.map +1 -0
  8. package/dist/auth-utils-VTD5TFYE.js +3 -0
  9. package/dist/{auth-utils-MNMC2QGX.js.map → auth-utils-VTD5TFYE.js.map} +1 -1
  10. package/dist/{chunk-PWTYQHOQ.js → chunk-6ZF2RQJP.js} +3 -3
  11. package/dist/{chunk-PWTYQHOQ.js.map → chunk-6ZF2RQJP.js.map} +1 -1
  12. package/dist/chunk-COHBSTHF.js +82 -0
  13. package/dist/chunk-COHBSTHF.js.map +1 -0
  14. package/dist/{chunk-CLU2QKG4.js → chunk-GDMFRKAK.js} +201 -35
  15. package/dist/chunk-GDMFRKAK.js.map +1 -0
  16. package/dist/chunk-MFIGS74G.js +140 -0
  17. package/dist/chunk-MFIGS74G.js.map +1 -0
  18. package/dist/{chunk-Y3KEQ6U4.js → chunk-MOJFF6SQ.js} +4 -4
  19. package/dist/{chunk-Y3KEQ6U4.js.map → chunk-MOJFF6SQ.js.map} +1 -1
  20. package/dist/{chunk-S6GUJPAF.js → chunk-OGOPT4QY.js} +120 -7
  21. package/dist/chunk-OGOPT4QY.js.map +1 -0
  22. package/dist/{chunk-QB4JJ564.js → chunk-Q2ZUUOPY.js} +5 -5
  23. package/dist/{chunk-QB4JJ564.js.map → chunk-Q2ZUUOPY.js.map} +1 -1
  24. package/dist/{chunk-QPSCMK4W.js → chunk-TVUBMDXX.js} +74 -13
  25. package/dist/chunk-TVUBMDXX.js.map +1 -0
  26. package/dist/{chunk-S5NYXGLE.js → chunk-ZNXVTTIX.js} +3 -3
  27. package/dist/{chunk-S5NYXGLE.js.map → chunk-ZNXVTTIX.js.map} +1 -1
  28. package/dist/entries/auth.d.ts +11 -3
  29. package/dist/entries/auth.js +7 -4
  30. package/dist/entries/auth.js.map +1 -1
  31. package/dist/entries/crm.js +5 -5
  32. package/dist/{http-errors-DqdtoJ1y.d.ts → http-errors-D8bdo9vF.d.ts} +169 -7
  33. package/dist/index.d.ts +16 -3
  34. package/dist/index.js +11 -8
  35. package/dist/index.js.map +1 -1
  36. package/package.json +1 -1
  37. package/dist/auth-utils-MNMC2QGX.js +0 -3
  38. package/dist/chunk-CLU2QKG4.js.map +0 -1
  39. package/dist/chunk-QPSCMK4W.js.map +0 -1
  40. package/dist/chunk-S6GUJPAF.js.map +0 -1
@@ -218,12 +218,92 @@ interface RevokeSecuritySessionPayload {
218
218
  refreshToken?: string;
219
219
  }
220
220
 
221
- declare function getAccessToken(): string | null;
222
- declare function clearAccessToken(): void;
223
- declare function isExpiresAccessToken(): boolean;
224
- declare function isAuthenticateApp(): boolean;
225
- declare function isAuthenticated(): boolean;
226
- declare function isAccessTokenExpired(): boolean;
221
+ declare const AuthErrorCode: {
222
+ readonly AUTHENTICATION_FAILED: "AUTHENTICATION_FAILED";
223
+ readonly TOKEN_INVALID: "AUTH_TOKEN_INVALID";
224
+ readonly TOKEN_EXPIRED: "AUTH_TOKEN_EXPIRED";
225
+ readonly ACCOUNT_LOCKED: "AUTH_ACCOUNT_LOCKED";
226
+ readonly ACCOUNT_DISABLED: "AUTH_ACCOUNT_DISABLED";
227
+ readonly LOGIN_FAILED: "LOGIN_FAILED";
228
+ readonly INVALID_CREDENTIALS: "AUTH_INVALID_CREDENTIALS";
229
+ readonly TWO_FACTOR_REQUIRED: "AUTH_2FA_REQUIRED";
230
+ readonly EMAIL_NOT_VERIFIED: "AUTH_EMAIL_NOT_VERIFIED";
231
+ readonly ACCESS_DENIED: "ACCESS_DENIED";
232
+ readonly ACCESS_FORBIDDEN: "ACCESS_FORBIDDEN";
233
+ readonly ACCESS_UNAUTHORIZED: "ACCESS_UNAUTHORIZED";
234
+ readonly MISSING_REFRESH_TOKEN: "MISSING_REFRESH_TOKEN";
235
+ readonly MISSING_HEADERS: "MISSING_HEADERS";
236
+ readonly OAUTH_PROCESSING_ERROR: "OAUTH_PROCESSING_ERROR";
237
+ readonly HUBSPOT_REAUTH_REQUIRED: "HUBSPOT_REAUTH_REQUIRED";
238
+ readonly PORTAL_INACTIVE: "PORTAL_INACTIVE";
239
+ readonly AMBIGUOUS_HUB_ID: "AMBIGUOUS_HUB_ID";
240
+ readonly COMMERCIAL_ACCESS_EXPIRED: "COMMERCIAL_ACCESS_EXPIRED";
241
+ };
242
+ type AuthErrorCodeValue = (typeof AuthErrorCode)[keyof typeof AuthErrorCode];
243
+ type ApiErrorPayload = {
244
+ errorCode?: string;
245
+ errorMessage?: string;
246
+ detailedMessage?: string;
247
+ correlationId?: string;
248
+ statusCode?: number;
249
+ category?: string;
250
+ };
251
+ type StoredAuthError = ApiErrorPayload & {
252
+ ts?: number;
253
+ };
254
+ declare function parseApiErrorPayload(data: unknown): ApiErrorPayload;
255
+ type UnauthorizedPageCopy = {
256
+ title: string;
257
+ message: string;
258
+ buttonLabel: string;
259
+ clearSessionOnMount: boolean;
260
+ };
261
+ declare function getUnauthorizedPageCopy(errorCode?: string, fallbackMessage?: string): UnauthorizedPageCopy;
262
+
263
+ type WoodsportalRequestConfig = {
264
+ __isRetryRequest?: boolean;
265
+ skipGlobalAuthRedirect?: boolean;
266
+ url?: string;
267
+ };
268
+ type AuthErrorAction = {
269
+ kind: 'refresh_retry';
270
+ } | {
271
+ kind: 'reject';
272
+ } | {
273
+ kind: 'redirect';
274
+ route: string;
275
+ clearSession: boolean;
276
+ } | {
277
+ kind: 'logout';
278
+ route: string;
279
+ clearSession: boolean;
280
+ };
281
+ type AuthPolicyRoutes = {
282
+ unauthorized: string;
283
+ login: string;
284
+ twoFa: string;
285
+ resendEmail: string;
286
+ accountSelect: string;
287
+ };
288
+ type AuthInterceptorPolicyConfig = {
289
+ routes: AuthPolicyRoutes;
290
+ optionalAuthFailurePaths?: string[];
291
+ sessionProbePaths?: string[];
292
+ includeAdminMfaSecurityPrefixes?: boolean;
293
+ };
294
+ declare function isOptionalAuthFailureUrl(url: string | undefined, config: AuthInterceptorPolicyConfig): boolean;
295
+ declare function isSessionProbeUrl(url: string | undefined, config: AuthInterceptorPolicyConfig): boolean;
296
+ declare function persistAuthError(payload: ApiErrorPayload): ApiErrorPayload & {
297
+ ts: number;
298
+ };
299
+ declare function resolveAuthErrorAction(input: {
300
+ status: number;
301
+ errorCode?: string;
302
+ url?: string;
303
+ skipGlobalAuthRedirect?: boolean;
304
+ isRetryRequest?: boolean;
305
+ policy: AuthInterceptorPolicyConfig;
306
+ }): AuthErrorAction;
227
307
 
228
308
  type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
229
309
  type LogMeta = Record<string, unknown>;
@@ -265,7 +345,13 @@ interface HttpClientConfig {
265
345
  routes?: {
266
346
  unauthorized?: string;
267
347
  login?: string;
348
+ twoFa?: string;
349
+ resendEmail?: string;
350
+ accountSelect?: string;
268
351
  };
352
+ refreshBufferSeconds?: number;
353
+ authPolicy?: Partial<AuthInterceptorPolicyConfig>;
354
+ useCookieRefresh?: boolean;
269
355
  hubId?: string;
270
356
  devPortalId?: string;
271
357
  onLogout?: () => void | Promise<void>;
@@ -283,6 +369,19 @@ declare function getAuthRefreshToken(refreshToken: string | null): Promise<{
283
369
  success: boolean;
284
370
  }>;
285
371
 
372
+ declare function getAccessToken(): string | null;
373
+ declare function clearAccessToken(): void;
374
+ declare function isExpiresAccessToken(): boolean;
375
+ type RefreshSessionOptions = {
376
+ force?: boolean;
377
+ };
378
+ declare function refreshSession(options?: RefreshSessionOptions): Promise<void>;
379
+ declare function isAuthenticateApp(): boolean;
380
+ declare function isAuthenticated(): boolean;
381
+ declare function isAccessTokenExpired(): boolean;
382
+ declare function hasRefreshSession(): boolean;
383
+ declare function hasValidAccessToken(): boolean;
384
+
286
385
  declare function getRefreshToken(): string | null;
287
386
 
288
387
  declare function getSsoDetails(options?: MutationOptions<any, any>): {
@@ -525,6 +624,11 @@ declare function clientSession(options?: MutationOptions<LoginResponseData, any>
525
624
  clientSession: (payload?: ClientSessionPayload | undefined) => Promise<LoginResponseData>;
526
625
  isLoading: () => boolean;
527
626
  };
627
+ declare function register(options?: MutationOptions<any, any>): {
628
+ mutate: (payload?: any) => Promise<any>;
629
+ register: (payload?: any) => Promise<any>;
630
+ isLoading: () => boolean;
631
+ };
528
632
  declare function verifyEmail(options?: MutationOptions<any, any>): {
529
633
  mutate: (payload?: VerifyEmailPayload | undefined) => Promise<any>;
530
634
  verifyEmail: (payload?: VerifyEmailPayload | undefined) => Promise<any>;
@@ -566,10 +670,68 @@ declare function resendEmail(options?: MutationOptions<any, any>): {
566
670
  isLoading: () => boolean;
567
671
  };
568
672
 
673
+ type SessionContractInput = {
674
+ hasAccessToken: () => boolean;
675
+ isAccessTokenExpired: () => boolean;
676
+ hasRefreshSession: () => boolean;
677
+ isMfaPending?: () => boolean;
678
+ };
679
+ declare function hasValidAccess(input: SessionContractInput): boolean;
680
+ declare function isFullyAuthenticated(input: SessionContractInput): boolean;
681
+ declare function isMfaPendingSession(input: SessionContractInput): boolean;
682
+ declare function hasAuthenticatedAccess(input: SessionContractInput): boolean;
683
+
684
+ type VisibilityRefreshOptions = {
685
+ shouldRefresh: () => boolean;
686
+ refresh: () => Promise<void>;
687
+ intervalMs?: number;
688
+ };
689
+ declare function startVisibilityRefreshScheduler(options: VisibilityRefreshOptions): () => void;
690
+ declare function stopVisibilityRefreshScheduler(): void;
691
+
692
+ type MfaBootRecoveryResult = 'pending' | 'orphan_cleared' | 'stale_token_cleared' | 'none';
693
+ type MfaBootRecoveryInput = {
694
+ hasMfaContext: () => boolean;
695
+ hasAccessToken: () => boolean;
696
+ hasRefreshToken: () => boolean;
697
+ clearMfaOrphan: () => void;
698
+ clearStaleAccessToken: () => void;
699
+ };
700
+ declare function recoverMfaGateOnBoot(input: MfaBootRecoveryInput): MfaBootRecoveryResult;
701
+
702
+ type AuthRouteAction = {
703
+ kind: 'allow';
704
+ } | {
705
+ kind: 'show_loader';
706
+ } | {
707
+ kind: 'redirect_login';
708
+ returnUrl?: string;
709
+ } | {
710
+ kind: 'redirect_mfa';
711
+ } | {
712
+ kind: 'redirect_funnel';
713
+ step: 'email_verify' | 'hub_select' | 'portal_select';
714
+ };
715
+ type AuthFunnelState = {
716
+ emailVerified?: boolean;
717
+ hubId?: number | string | null;
718
+ portalId?: number | string | null;
719
+ };
720
+ type ResolveAuthRouteActionInput = {
721
+ pathname: string;
722
+ isPublicAuthRoute: (pathname: string) => boolean;
723
+ session: SessionContractInput;
724
+ funnel?: AuthFunnelState;
725
+ mfaRoute: string;
726
+ previewMode?: boolean;
727
+ sessionRestoring?: boolean;
728
+ };
729
+ declare function resolveAuthRouteAction(input: ResolveAuthRouteActionInput): AuthRouteAction;
730
+
569
731
  type HttpErrorKind = 'service_unavailable' | 'network' | 'timeout' | 'auth' | 'client' | 'server' | 'unknown';
570
732
  declare const SERVICE_UNAVAILABLE_MESSAGE = "Service temporarily unavailable. Please try again in a few minutes.";
571
733
  declare function classifyHttpError(error: unknown): HttpErrorKind;
572
734
  declare function isServiceUnavailableError(error: unknown): boolean;
573
735
  declare function getHttpErrorMessage(error: unknown): string;
574
736
 
575
- export { isAccessTokenExpired as $, totpDisable as A, phoneUnverify as B, backupCodesRegenerate as C, mfaOptOut as D, webauthnRegisterOptions as E, webauthnRegisterVerify as F, webauthnAuthOptions as G, webauthnAuthVerify as H, listWebauthnCredentials as I, deleteWebauthnCredential as J, passkeyLoginOptions as K, passkeyLoginVerify as L, getSecurityOverview as M, getSecurityLoginActivity as N, getSecuritySessions as O, revokeSecuritySession as P, revokeOtherSecuritySessions as Q, getLoginBootstrap as R, getSsoDetails as S, generateSsoUrl as T, ssoCallback as U, getRefreshToken as V, getAuthRefreshToken as W, getAccessToken as X, clearAccessToken as Y, isAuthenticated as Z, isAuthenticateApp as _, logout as a, isExpiresAccessToken as a0, type LoggerConfig as a1, type TwoFaVerificationRequest as a2, type MfaOtpSendRequest as a3, type MfaPendingPasskeyOptionsRequest as a4, type MfaPendingPasskeyVerifyRequest as a5, type MfaStatusQuery as a6, type MfaPreferenceRequest as a7, type PhoneVerifyStartRequest as a8, type PhoneVerifyConfirmRequest as a9, type StorageKeyConfig as aA, classifyHttpError as aB, getFieldErrors as aC, getFormErrors as aD, getHttpErrorMessage as aE, initializeHttpClient as aF, isServiceUnavailableError as aG, type EditorPreviewMockHandler as aH, type EditorPreviewMockResult as aI, type LoginBootstrapMfaPolicy as aJ, type LoginBootstrapPortal as aK, type LoginBootstrapResponse as aL, type LoginBootstrapSsoProvider as aM, setEditorPreviewMockHandler as aN, type TotpEnrollVerifyRequest as aa, type TotpDisableRequest as ab, type PhoneUnverifyRequest as ac, type BackupCodesRegenerateRequest as ad, type MfaBackupCodesResponse as ae, type MfaOptOutRequest as af, type WebAuthnVerifyRequest as ag, type PasskeyLoginOptionsRequest as ah, type PasskeyLoginVerifyRequest as ai, type SecurityOverviewQuery as aj, type SecurityLoginActivityQuery as ak, type SecuritySessionsQuery as al, type RevokeSecuritySessionPayload as am, type ActiveSession as an, type HttpClientConfig as ao, type HttpErrorKind as ap, type LogLevel as aq, type LoginHistoryRow as ar, type LoginResponseData as as, type MfaEnrollmentStatus as at, type MfaMethod as au, type MfaMethodOption as av, type MfaPortalScopeContext as aw, type PaginationResponse as ax, SERVICE_UNAVAILABLE_MESSAGE as ay, type SecurityOverview as az, resetPassword as b, clientSession as c, resetPasswordVerifyToken as d, verifyEmailResend as e, forgetPassword as f, resendEmail as g, handoff as h, changePassword as i, profile as j, profileUpdate as k, login as l, me as m, verifyOtp as n, pendingPasskeyOptions as o, preLogin as p, pendingPasskeyVerify as q, registerExistingUser as r, sendMfaOtp as s, getMfaStatus as t, setMfaPreferences as u, verifyEmail as v, startPhoneVerify as w, confirmPhoneVerify as x, totpEnrollStart as y, totpEnrollVerify as z };
737
+ 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, isMfaPendingSession as a$, isAuthenticateApp as a0, isAccessTokenExpired as a1, isExpiresAccessToken as a2, hasRefreshSession as a3, hasValidAccessToken as a4, type SessionContractInput as a5, type LoggerConfig as a6, type TwoFaVerificationRequest as a7, type MfaOtpSendRequest as a8, type MfaPendingPasskeyOptionsRequest as a9, type AuthRouteAction as aA, type HttpClientConfig as aB, type HttpErrorKind as aC, type LogLevel as aD, type LoginHistoryRow as aE, type LoginResponseData as aF, type MfaBootRecoveryResult as aG, type MfaEnrollmentStatus as aH, type MfaMethod as aI, type MfaMethodOption as aJ, type MfaPortalScopeContext as aK, type PaginationResponse as aL, SERVICE_UNAVAILABLE_MESSAGE as aM, type SecurityOverview as aN, type StorageKeyConfig as aO, type StoredAuthError as aP, type UnauthorizedPageCopy as aQ, type WoodsportalRequestConfig as aR, classifyHttpError as aS, getFieldErrors as aT, getFormErrors as aU, getHttpErrorMessage as aV, getUnauthorizedPageCopy as aW, hasAuthenticatedAccess as aX, hasValidAccess as aY, initializeHttpClient as aZ, isFullyAuthenticated as a_, type MfaPendingPasskeyVerifyRequest as aa, type MfaStatusQuery as ab, type MfaPreferenceRequest as ac, type PhoneVerifyStartRequest as ad, type PhoneVerifyConfirmRequest as ae, type TotpEnrollVerifyRequest as af, type TotpDisableRequest as ag, type PhoneUnverifyRequest as ah, type BackupCodesRegenerateRequest as ai, type MfaBackupCodesResponse as aj, type MfaOptOutRequest as ak, type WebAuthnVerifyRequest as al, type PasskeyLoginOptionsRequest as am, type PasskeyLoginVerifyRequest as an, type SecurityOverviewQuery as ao, type SecurityLoginActivityQuery as ap, type SecuritySessionsQuery as aq, type RevokeSecuritySessionPayload as ar, type ActiveSession as as, type ApiErrorPayload as at, type AuthErrorAction as au, AuthErrorCode as av, type AuthErrorCodeValue as aw, type AuthFunnelState as ax, type AuthInterceptorPolicyConfig as ay, type AuthPolicyRoutes as az, registerExistingUser as b, isOptionalAuthFailureUrl as b0, isServiceUnavailableError as b1, isSessionProbeUrl as b2, parseApiErrorPayload as b3, persistAuthError as b4, recoverMfaGateOnBoot as b5, resolveAuthErrorAction as b6, resolveAuthRouteAction as b7, startVisibilityRefreshScheduler as b8, stopVisibilityRefreshScheduler as b9, type EditorPreviewMockHandler as ba, type EditorPreviewMockResult as bb, type LoginBootstrapMfaPolicy as bc, type LoginBootstrapPortal as bd, type LoginBootstrapResponse as be, type LoginBootstrapSsoProvider as bf, setEditorPreviewMockHandler as bg, 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,8 +1,8 @@
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, r as registerExistingUser, f as forgetPassword, b as resetPassword, d as resetPasswordVerifyToken, e as verifyEmailResend, g as resendEmail, i as changePassword, m as me, j as profile, k as profileUpdate, n as verifyOtp, s as sendMfaOtp, o as pendingPasskeyOptions, q as pendingPasskeyVerify, t as getMfaStatus, u as setMfaPreferences, w as startPhoneVerify, x as confirmPhoneVerify, y as totpEnrollStart, z as totpEnrollVerify, A as totpDisable, B as phoneUnverify, C as backupCodesRegenerate, D as mfaOptOut, E as webauthnRegisterOptions, F as webauthnRegisterVerify, G as webauthnAuthOptions, H as webauthnAuthVerify, I as listWebauthnCredentials, J as deleteWebauthnCredential, K as passkeyLoginOptions, L as passkeyLoginVerify, M as getSecurityOverview, N as getSecurityLoginActivity, O as getSecuritySessions, P as revokeSecuritySession, Q as revokeOtherSecuritySessions, R as getLoginBootstrap, S as getSsoDetails, T as generateSsoUrl, U as ssoCallback, V as getRefreshToken, W as getAuthRefreshToken, X as getAccessToken, Y as clearAccessToken, Z as isAuthenticated, _ as isAuthenticateApp, $ as isAccessTokenExpired, a0 as isExpiresAccessToken, a1 as LoggerConfig, a2 as TwoFaVerificationRequest, a3 as MfaOtpSendRequest, a4 as MfaPendingPasskeyOptionsRequest, a5 as MfaPendingPasskeyVerifyRequest, a6 as MfaStatusQuery, a7 as MfaPreferenceRequest, a8 as PhoneVerifyStartRequest, a9 as PhoneVerifyConfirmRequest, aa as TotpEnrollVerifyRequest, ab as TotpDisableRequest, ac as PhoneUnverifyRequest, ad as BackupCodesRegenerateRequest, ae as MfaBackupCodesResponse, af as MfaOptOutRequest, ag as WebAuthnVerifyRequest, ah as PasskeyLoginOptionsRequest, ai as PasskeyLoginVerifyRequest, aj as SecurityOverviewQuery, ak as SecurityLoginActivityQuery, al as SecuritySessionsQuery, am as RevokeSecuritySessionPayload } from './http-errors-DqdtoJ1y.js';
5
- export { an as ActiveSession, ao as HttpClientConfig, ap as HttpErrorKind, aq as LogLevel, ar as LoginHistoryRow, as as LoginResponseData, at as MfaEnrollmentStatus, au as MfaMethod, av as MfaMethodOption, aw as MfaPortalScopeContext, ax as PaginationResponse, ay as SERVICE_UNAVAILABLE_MESSAGE, az as SecurityOverview, aA as StorageKeyConfig, aB as classifyHttpError, aC as getFieldErrors, aD as getFormErrors, aE as getHttpErrorMessage, aF as initializeHttpClient, aG as isServiceUnavailableError } from './http-errors-DqdtoJ1y.js';
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 SessionContractInput, a6 as LoggerConfig, a7 as TwoFaVerificationRequest, a8 as MfaOtpSendRequest, a9 as MfaPendingPasskeyOptionsRequest, aa as MfaPendingPasskeyVerifyRequest, ab as MfaStatusQuery, ac as MfaPreferenceRequest, ad as PhoneVerifyStartRequest, ae as PhoneVerifyConfirmRequest, af as TotpEnrollVerifyRequest, ag as TotpDisableRequest, ah as PhoneUnverifyRequest, ai as BackupCodesRegenerateRequest, aj as MfaBackupCodesResponse, ak as MfaOptOutRequest, al as WebAuthnVerifyRequest, am as PasskeyLoginOptionsRequest, an as PasskeyLoginVerifyRequest, ao as SecurityOverviewQuery, ap as SecurityLoginActivityQuery, aq as SecuritySessionsQuery, ar as RevokeSecuritySessionPayload } from './http-errors-D8bdo9vF.js';
5
+ export { as as ActiveSession, at as ApiErrorPayload, au as AuthErrorAction, av as AuthErrorCode, aw as AuthErrorCodeValue, ax as AuthFunnelState, ay as AuthInterceptorPolicyConfig, az as AuthPolicyRoutes, aA as AuthRouteAction, aB as HttpClientConfig, aC as HttpErrorKind, aD as LogLevel, aE as LoginHistoryRow, aF as LoginResponseData, aG as MfaBootRecoveryResult, aH as MfaEnrollmentStatus, aI as MfaMethod, aJ as MfaMethodOption, aK as MfaPortalScopeContext, aL as PaginationResponse, aM as SERVICE_UNAVAILABLE_MESSAGE, aN as SecurityOverview, aO as StorageKeyConfig, aP as StoredAuthError, aQ as UnauthorizedPageCopy, aR as WoodsportalRequestConfig, aS as classifyHttpError, aT as getFieldErrors, aU as getFormErrors, aV as getHttpErrorMessage, aW as getUnauthorizedPageCopy, aX as hasAuthenticatedAccess, aY as hasValidAccess, aZ as initializeHttpClient, a_ as isFullyAuthenticated, a$ as isMfaPendingSession, b0 as isOptionalAuthFailureUrl, b1 as isServiceUnavailableError, b2 as isSessionProbeUrl, b3 as parseApiErrorPayload, b4 as persistAuthError, b5 as recoverMfaGateOnBoot, b6 as resolveAuthErrorAction, b7 as resolveAuthRouteAction, b8 as startVisibilityRefreshScheduler, b9 as stopVisibilityRefreshScheduler } from './http-errors-D8bdo9vF.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';
@@ -14,6 +14,7 @@ declare const api: {
14
14
  clientSession: typeof clientSession;
15
15
  handoff: typeof handoff;
16
16
  logout: typeof logout;
17
+ register: typeof register;
17
18
  verifyEmail: typeof verifyEmail;
18
19
  registerExistingUser: typeof registerExistingUser;
19
20
  forgetPassword: typeof forgetPassword;
@@ -65,6 +66,7 @@ declare const api: {
65
66
  };
66
67
  session: {
67
68
  getRefreshToken: typeof getRefreshToken;
69
+ refreshSession: typeof refreshSession;
68
70
  refreshAccessToken: typeof getAuthRefreshToken;
69
71
  getAccessToken: typeof getAccessToken;
70
72
  clearAccessToken: typeof clearAccessToken;
@@ -73,6 +75,12 @@ declare const api: {
73
75
  isAccessTokenExpired: typeof isAccessTokenExpired;
74
76
  isExpiresAccessToken: typeof isExpiresAccessToken;
75
77
  isCookieExpired: (key: string) => boolean;
78
+ hasRefreshSession: typeof hasRefreshSession;
79
+ hasValidAccessToken: typeof hasValidAccessToken;
80
+ contract: () => SessionContractInput;
81
+ isFullyAuthenticated: () => boolean;
82
+ hasAuthenticatedAccess: () => boolean;
83
+ hasValidAccess: () => boolean;
76
84
  };
77
85
  };
78
86
  crm: {
@@ -313,6 +321,11 @@ declare const Client: {
313
321
  login: (data: LoginPayload) => Promise<unknown>;
314
322
  verifyOtp: (data: TwoFaVerificationRequest) => Promise<unknown>;
315
323
  verifyEmail: (data: VerifyEmailPayload) => Promise<unknown>;
324
+ register: (data: {
325
+ name: string;
326
+ email: string;
327
+ password: string;
328
+ }) => Promise<unknown>;
316
329
  resetPasswordVerifyToken: (data: ResetPasswordVerifyTokenPayload) => Promise<unknown>;
317
330
  resetPassword: (data: ResetPasswordPayload) => Promise<unknown>;
318
331
  forgetPassword: (data: ForgetPasswordPayload) => Promise<unknown>;
@@ -482,4 +495,4 @@ declare const store: {
482
495
  };
483
496
  };
484
497
 
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 };
498
+ export { CachePurgeListQuery, CachePurgeRequest, CachePurgeTarget, CachePurgeView, ChangePasswordPayload, Client, CreateCachePurgeJobOptions, CrmCachePurgeOptions, DEFAULT_HUBSPOT_TIMEZONE, ForgetPasswordPayload, type HubSpotActivityDateTimeParts, LoggerConfig, LoginPayload, PreLoginPayload, PurgeResult, ResetPasswordPayload, ResetPasswordVerifyTokenPayload, SessionContractInput, 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 };
package/dist/index.js CHANGED
@@ -1,11 +1,14 @@
1
- import { authApi } from './chunk-S6GUJPAF.js';
2
- import { crmApi } from './chunk-QB4JJ564.js';
3
- import { navigationApi, storage } from './chunk-CLU2QKG4.js';
4
- export { Client, SERVICE_UNAVAILABLE_MESSAGE, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, classifyHttpError, createCachePurgeJob, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, getFieldErrors, getFormErrors, getHttpErrorMessage, config as hubContext, initializeHttpClient, isServiceUnavailableError, mergePurgeTargets, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, setConfig as setHubContext, toCachePurgeListQuery } from './chunk-CLU2QKG4.js';
5
- import './chunk-S5NYXGLE.js';
6
- import { actions8, syncStore, actions5, emailStore, actions4, noteStore, actions7, userStore, actions2, tableStore, tableUiActions, tableUiStore } from './chunk-PWTYQHOQ.js';
7
- export { configureLogger } from './chunk-PWTYQHOQ.js';
8
- import './chunk-QPSCMK4W.js';
1
+ import { authApi } from './chunk-OGOPT4QY.js';
2
+ export { hasAuthenticatedAccess, hasValidAccess, isFullyAuthenticated, isMfaPendingSession, recoverMfaGateOnBoot, resolveAuthRouteAction } from './chunk-OGOPT4QY.js';
3
+ export { isOptionalAuthFailureUrl, isSessionProbeUrl, persistAuthError, resolveAuthErrorAction } from './chunk-MFIGS74G.js';
4
+ import { crmApi } from './chunk-Q2ZUUOPY.js';
5
+ import { navigationApi, storage } from './chunk-GDMFRKAK.js';
6
+ export { Client, SERVICE_UNAVAILABLE_MESSAGE, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, classifyHttpError, createCachePurgeJob, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, getFieldErrors, getFormErrors, getHttpErrorMessage, config as hubContext, initializeHttpClient, isServiceUnavailableError, mergePurgeTargets, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, setConfig as setHubContext, startVisibilityRefreshScheduler, stopVisibilityRefreshScheduler, toCachePurgeListQuery } from './chunk-GDMFRKAK.js';
7
+ import './chunk-ZNXVTTIX.js';
8
+ import { actions8, syncStore, actions5, emailStore, actions4, noteStore, actions7, userStore, actions2, tableStore, tableUiActions, tableUiStore } from './chunk-6ZF2RQJP.js';
9
+ export { configureLogger } from './chunk-6ZF2RQJP.js';
10
+ import './chunk-TVUBMDXX.js';
11
+ export { AuthErrorCode, getUnauthorizedPageCopy, parseApiErrorPayload } from './chunk-COHBSTHF.js';
9
12
 
10
13
  // src/main/api/compose-api.ts
11
14
  var api = {
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":";;;;;;;;;;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,wBAAA;AAAA,EAC/D,CAAA,CAAA,MAAQ;AACJ,IAAA,OAAO,wBAAA;AAAA,EACX;AACJ;AAKO,SAAS,qBAAqB,KAAA,EAA+B;AAChE,EAAA,IAAI,KAAA,IAAS,IAAA,IAAQ,KAAA,KAAU,EAAA,EAAI,OAAO,IAAA;AAE1C,EAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC3B,IAAA,OAAO,KAAA,GAAQ,OAAkB,KAAA,GAAQ,IAAA;AAAA,EAC7C;AAEA,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,OAAA,CAAQ,IAAA,CAAK,KAAK,CAAA,EAAG;AAClD,IAAA,MAAM,CAAA,GAAI,OAAO,KAAK,CAAA;AACtB,IAAA,OAAO,CAAA,GAAI,OAAkB,CAAA,GAAI,IAAA;AAAA,EACrC;AAEA,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,YAAiB,IAAA,EAAM;AACpD,IAAA,MAAM,IAAA,GAAO,IAAI,IAAA,CAAK,KAAK,CAAA;AAC3B,IAAA,OAAO,MAAA,CAAO,MAAM,IAAA,CAAK,OAAA,EAAS,CAAA,GAAI,IAAA,GAAO,KAAK,OAAA,EAAQ;AAAA,EAC9D;AAEA,EAAA,OAAO,IAAA;AACX;AAKO,SAAS,gBAAgB,Q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M,QAAA;AAAA,IACN,SAAA;AAAA,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,Q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c,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'\n\n/** Shared auth contract (client + admin consistency). */\nexport {\n AuthErrorCode,\n parseApiErrorPayload,\n getUnauthorizedPageCopy,\n resolveAuthErrorAction,\n isOptionalAuthFailureUrl,\n isSessionProbeUrl,\n persistAuthError,\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 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "woodsportal-client-sdk",
3
- "version": "4.0.4-dev.12",
3
+ "version": "4.0.4-dev.14",
4
4
  "description": "Official TypeScript/JavaScript SDK for WoodsPortal API - Authentication, user management, pipelines, and more",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,3 +0,0 @@
1
- export { getPortal, getProfile, getRefreshToken, getSubscriptionType, setAccessToken, setLoggedInDetails, setPortal, setProfileDetails, setRefreshToken, setSubscriptionType } from './chunk-QPSCMK4W.js';
2
- //# sourceMappingURL=auth-utils-MNMC2QGX.js.map
3
- //# sourceMappingURL=auth-utils-MNMC2QGX.js.map