woodsportal-client-sdk 4.0.4-dev.2 → 4.0.4-dev.20

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 (49) hide show
  1. package/README.md +2 -0
  2. package/dist/adapters/angular/index.d.ts +2 -1
  3. package/dist/adapters/angular/index.js +4 -4
  4. package/dist/adapters/react/index.d.ts +2 -1
  5. package/dist/adapters/react/index.js +4 -4
  6. package/dist/adapters/vue/index.d.ts +2 -1
  7. package/dist/adapters/vue/index.js +4 -4
  8. package/dist/auth-error-codes-D7CXVBEN.js +3 -0
  9. package/dist/auth-error-codes-D7CXVBEN.js.map +1 -0
  10. package/dist/auth-interceptor-policy-F7JIJWSQ.js +4 -0
  11. package/dist/auth-interceptor-policy-F7JIJWSQ.js.map +1 -0
  12. package/dist/auth-utils-VTD5TFYE.js +3 -0
  13. package/dist/{auth-utils-MNMC2QGX.js.map → auth-utils-VTD5TFYE.js.map} +1 -1
  14. package/dist/{cache-purge-G5WkHckd.d.ts → cache-purge-Ca4idzyy.d.ts} +1 -1
  15. package/dist/{chunk-D7XKR2O7.js → chunk-BWZAX23E.js} +11 -10
  16. package/dist/chunk-BWZAX23E.js.map +1 -0
  17. package/dist/chunk-COHBSTHF.js +82 -0
  18. package/dist/chunk-COHBSTHF.js.map +1 -0
  19. package/dist/{chunk-YEUFUGGT.js → chunk-GLATNYVU.js} +159 -46
  20. package/dist/chunk-GLATNYVU.js.map +1 -0
  21. package/dist/{chunk-GO35W5PN.js → chunk-IUVL2E7K.js} +175 -17
  22. package/dist/chunk-IUVL2E7K.js.map +1 -0
  23. package/dist/{chunk-FDZNMZS4.js → chunk-LSRSCZBI.js} +507 -166
  24. package/dist/chunk-LSRSCZBI.js.map +1 -0
  25. package/dist/{chunk-VEJKNXUE.js → chunk-LYPJXG74.js} +4 -4
  26. package/dist/{chunk-VEJKNXUE.js.map → chunk-LYPJXG74.js.map} +1 -1
  27. package/dist/chunk-MFIGS74G.js +140 -0
  28. package/dist/chunk-MFIGS74G.js.map +1 -0
  29. package/dist/{chunk-6KKVGCXG.js → chunk-ND7HCTXC.js} +3 -3
  30. package/dist/{chunk-6KKVGCXG.js.map → chunk-ND7HCTXC.js.map} +1 -1
  31. package/dist/{chunk-QPSCMK4W.js → chunk-TVUBMDXX.js} +74 -13
  32. package/dist/chunk-TVUBMDXX.js.map +1 -0
  33. package/dist/entries/auth.d.ts +17 -4
  34. package/dist/entries/auth.js +7 -4
  35. package/dist/entries/auth.js.map +1 -1
  36. package/dist/entries/crm.d.ts +4 -3
  37. package/dist/entries/crm.js +5 -5
  38. package/dist/{http-errors-hlKcIsXD.d.ts → http-errors-B41BMjip.d.ts} +252 -15
  39. package/dist/{index-CCwMopD8.d.ts → index-Bh9eY8sA.d.ts} +5 -1
  40. package/dist/index.d.ts +36 -10
  41. package/dist/index.js +11 -8
  42. package/dist/index.js.map +1 -1
  43. package/package.json +4 -3
  44. package/dist/auth-utils-MNMC2QGX.js +0 -3
  45. package/dist/chunk-D7XKR2O7.js.map +0 -1
  46. package/dist/chunk-FDZNMZS4.js.map +0 -1
  47. package/dist/chunk-GO35W5PN.js.map +0 -1
  48. package/dist/chunk-QPSCMK4W.js.map +0 -1
  49. package/dist/chunk-YEUFUGGT.js.map +0 -1
@@ -1,12 +1,13 @@
1
1
  import { InternalAxiosRequestConfig } from 'axios';
2
- import { M as MutationOptions, P as PreLoginPayload, C as ChangePasswordPayload, L as LoginPayload, V as VerifyEmailPayload, F as ForgetPasswordPayload, a as ResetPasswordPayload, R as ResetPasswordVerifyTokenPayload } from './index-CCwMopD8.js';
2
+ import { M as MutationOptions, P as PreLoginPayload, C as ChangePasswordPayload, L as LoginPayload, V as VerifyEmailPayload, F as ForgetPasswordPayload, a as ResetPasswordPayload, R as ResetPasswordVerifyTokenPayload } from './index-Bh9eY8sA.js';
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;
10
+ destination?: string;
10
11
  destinationMasked?: string;
11
12
  reason?: MfaMethodNotReadyReason;
12
13
  }
@@ -30,6 +31,7 @@ interface LoginResponseData extends MfaPortalScopeContext {
30
31
  loggedInDetails?: Record<string, unknown>;
31
32
  twoFactorRequired?: boolean;
32
33
  otpDelivery?: string;
34
+ otpDestination?: string;
33
35
  otpDestinationMasked?: string;
34
36
  mfaMethods?: MfaMethodOption[];
35
37
  defaultMethod?: MfaMethod;
@@ -64,6 +66,7 @@ interface MfaEnrollmentStatus extends MfaPortalScopeContext {
64
66
  defaultMethod?: MfaMethod;
65
67
  preferredMethod?: MfaMethod;
66
68
  methods?: MfaMethodOption[];
69
+ platformSmsEnabled?: boolean;
67
70
  }
68
71
  interface MfaPreferenceRequest {
69
72
  defaultMethod: MfaMethod;
@@ -75,6 +78,32 @@ interface PhoneVerifyConfirmRequest {
75
78
  phone: string;
76
79
  code: string;
77
80
  }
81
+ interface LoginBootstrapPortal {
82
+ portalId?: number;
83
+ label?: string;
84
+ name?: string;
85
+ portalUrl?: string;
86
+ }
87
+ interface LoginBootstrapMfaPolicy {
88
+ mfaRequired?: boolean;
89
+ mfaConfigured?: boolean;
90
+ mfaEnforcementEnabled?: boolean;
91
+ mfaAllowedMethods?: MfaMethod[];
92
+ platformSmsEnabled?: boolean;
93
+ }
94
+ interface LoginBootstrapSsoProvider {
95
+ portalIntegrationConfigId?: number;
96
+ activeStatus?: boolean;
97
+ integrationName?: string;
98
+ integrationSlug?: string;
99
+ logo?: string;
100
+ buttonText?: string;
101
+ }
102
+ interface LoginBootstrapResponse {
103
+ portal?: LoginBootstrapPortal;
104
+ mfaPolicy?: LoginBootstrapMfaPolicy;
105
+ ssoProviders?: LoginBootstrapSsoProvider[];
106
+ }
78
107
  interface TotpEnrollVerifyRequest {
79
108
  code: string;
80
109
  portalId?: string | number;
@@ -83,6 +112,19 @@ interface TotpEnrollVerifyRequest {
83
112
  interface TotpDisableRequest {
84
113
  password: string;
85
114
  }
115
+ interface PhoneUnverifyRequest {
116
+ password: string;
117
+ }
118
+ interface BackupCodesRegenerateRequest {
119
+ password: string;
120
+ totpCode: string;
121
+ }
122
+ interface MfaOptOutRequest {
123
+ password: string;
124
+ }
125
+ interface MfaBackupCodesResponse {
126
+ backupCodes?: string[];
127
+ }
86
128
  interface WebAuthnVerifyRequest {
87
129
  challengeId: string;
88
130
  credential: Record<string, unknown>;
@@ -119,6 +161,7 @@ interface SecurityOverview {
119
161
  phoneVerified?: boolean;
120
162
  passkeyCount?: number;
121
163
  unusedBackupCodes?: number;
164
+ platformSmsEnabled?: boolean;
122
165
  }
123
166
  interface LoginHistoryRow {
124
167
  loginHistoryId?: number;
@@ -148,6 +191,7 @@ interface ActiveSession {
148
191
  current?: boolean;
149
192
  deviceType?: string;
150
193
  userAgent?: string;
194
+ ipAddress?: string;
151
195
  ipAddressMasked?: string;
152
196
  countryCode?: string;
153
197
  lastActiveAt?: string;
@@ -177,12 +221,92 @@ interface RevokeSecuritySessionPayload {
177
221
  refreshToken?: string;
178
222
  }
179
223
 
180
- declare function getAccessToken(): string | null;
181
- declare function clearAccessToken(): void;
182
- declare function isExpiresAccessToken(): boolean;
183
- declare function isAuthenticateApp(): boolean;
184
- declare function isAuthenticated(): boolean;
185
- declare function isAccessTokenExpired(): boolean;
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 resolveAuthErrorAction(input: {
303
+ status: number;
304
+ errorCode?: string;
305
+ url?: string;
306
+ skipGlobalAuthRedirect?: boolean;
307
+ isRetryRequest?: boolean;
308
+ policy: AuthInterceptorPolicyConfig;
309
+ }): AuthErrorAction;
186
310
 
187
311
  type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
188
312
  type LogMeta = Record<string, unknown>;
@@ -224,7 +348,13 @@ interface HttpClientConfig {
224
348
  routes?: {
225
349
  unauthorized?: string;
226
350
  login?: string;
351
+ twoFa?: string;
352
+ resendEmail?: string;
353
+ accountSelect?: string;
227
354
  };
355
+ refreshBufferSeconds?: number;
356
+ authPolicy?: Partial<AuthInterceptorPolicyConfig>;
357
+ useCookieRefresh?: boolean;
228
358
  hubId?: string;
229
359
  devPortalId?: string;
230
360
  onLogout?: () => void | Promise<void>;
@@ -242,6 +372,19 @@ declare function getAuthRefreshToken(refreshToken: string | null): Promise<{
242
372
  success: boolean;
243
373
  }>;
244
374
 
375
+ declare function getAccessToken(): string | null;
376
+ declare function clearAccessToken(): void;
377
+ declare function isExpiresAccessToken(): boolean;
378
+ type RefreshSessionOptions = {
379
+ force?: boolean;
380
+ };
381
+ declare function refreshSession(options?: RefreshSessionOptions): Promise<void>;
382
+ declare function isAuthenticateApp(): boolean;
383
+ declare function isAuthenticated(): boolean;
384
+ declare function isAccessTokenExpired(): boolean;
385
+ declare function hasRefreshSession(): boolean;
386
+ declare function hasValidAccessToken(): boolean;
387
+
245
388
  declare function getRefreshToken(): string | null;
246
389
 
247
390
  declare function getSsoDetails(options?: MutationOptions<any, any>): {
@@ -263,6 +406,21 @@ declare function ssoCallback(options?: MutationOptions<any, any>): {
263
406
  isLoading: () => boolean;
264
407
  };
265
408
 
409
+ declare function getLoginBootstrap(options?: MutationOptions<any, {
410
+ hubId?: number;
411
+ portalId?: number;
412
+ } | void>): {
413
+ mutate: (payload?: {
414
+ hubId?: number;
415
+ portalId?: number;
416
+ } | undefined) => Promise<any>;
417
+ getLoginBootstrap: (payload?: {
418
+ hubId?: number;
419
+ portalId?: number;
420
+ } | undefined) => Promise<any>;
421
+ isLoading: () => boolean;
422
+ };
423
+
266
424
  declare function getSecurityOverview(options?: MutationOptions<any, any>): {
267
425
  mutate: (payload?: SecurityOverviewQuery | undefined) => Promise<any>;
268
426
  getOverview: (payload?: SecurityOverviewQuery | undefined) => Promise<any>;
@@ -334,13 +492,13 @@ declare function setMfaPreferences(options?: MutationOptions<any, any>): {
334
492
  isLoading: () => boolean;
335
493
  };
336
494
  declare function startPhoneVerify(options?: MutationOptions<any, any>): {
337
- mutate: (payload?: PhoneVerifyStartRequest | undefined) => Promise<any>;
338
- startPhoneVerify: (payload?: PhoneVerifyStartRequest | undefined) => Promise<any>;
495
+ mutate: (payload?: (PhoneVerifyStartRequest & MfaStatusQuery) | undefined) => Promise<any>;
496
+ startPhoneVerify: (payload?: (PhoneVerifyStartRequest & MfaStatusQuery) | undefined) => Promise<any>;
339
497
  isLoading: () => boolean;
340
498
  };
341
499
  declare function confirmPhoneVerify(options?: MutationOptions<any, any>): {
342
- mutate: (payload?: PhoneVerifyConfirmRequest | undefined) => Promise<any>;
343
- confirmPhoneVerify: (payload?: PhoneVerifyConfirmRequest | undefined) => Promise<any>;
500
+ mutate: (payload?: (PhoneVerifyConfirmRequest & MfaStatusQuery) | undefined) => Promise<any>;
501
+ confirmPhoneVerify: (payload?: (PhoneVerifyConfirmRequest & MfaStatusQuery) | undefined) => Promise<any>;
344
502
  isLoading: () => boolean;
345
503
  };
346
504
  declare function totpEnrollStart(options?: MutationOptions<any, any>): {
@@ -354,8 +512,24 @@ declare function totpEnrollVerify(options?: MutationOptions<any, any>): {
354
512
  isLoading: () => boolean;
355
513
  };
356
514
  declare function totpDisable(options?: MutationOptions<any, any>): {
357
- mutate: (payload?: TotpDisableRequest | undefined) => Promise<any>;
358
- totpDisable: (payload?: TotpDisableRequest | undefined) => Promise<any>;
515
+ mutate: (payload?: (TotpDisableRequest & MfaStatusQuery) | undefined) => Promise<any>;
516
+ totpDisable: (payload?: (TotpDisableRequest & MfaStatusQuery) | undefined) => Promise<any>;
517
+ isLoading: () => boolean;
518
+ };
519
+ declare function phoneUnverify(options?: MutationOptions<any, any>): {
520
+ mutate: (payload?: (PhoneUnverifyRequest & MfaStatusQuery) | undefined) => Promise<any>;
521
+ phoneUnverify: (payload?: (PhoneUnverifyRequest & MfaStatusQuery) | undefined) => Promise<any>;
522
+ isLoading: () => boolean;
523
+ };
524
+ declare function backupCodesRegenerate(options?: MutationOptions<MfaBackupCodesResponse, any>): {
525
+ mutate: (payload?: (BackupCodesRegenerateRequest & MfaStatusQuery) | undefined) => Promise<MfaBackupCodesResponse>;
526
+ backupCodesRegenerate: (payload?: (BackupCodesRegenerateRequest & MfaStatusQuery) | undefined) => Promise<MfaBackupCodesResponse>;
527
+ isLoading: () => boolean;
528
+ };
529
+ declare function mfaOptOut(options?: MutationOptions<any, any>): {
530
+ mutate: (payload?: (MfaOptOutRequest & MfaStatusQuery) | undefined) => Promise<any>;
531
+ optOut: (payload?: (MfaOptOutRequest & MfaStatusQuery) | undefined) => Promise<any>;
532
+ mfaOptOut: (payload?: (MfaOptOutRequest & MfaStatusQuery) | undefined) => Promise<any>;
359
533
  isLoading: () => boolean;
360
534
  };
361
535
  declare function webauthnRegisterOptions(options?: MutationOptions<any, any>): {
@@ -453,6 +627,11 @@ declare function clientSession(options?: MutationOptions<LoginResponseData, any>
453
627
  clientSession: (payload?: ClientSessionPayload | undefined) => Promise<LoginResponseData>;
454
628
  isLoading: () => boolean;
455
629
  };
630
+ declare function register(options?: MutationOptions<any, any>): {
631
+ mutate: (payload?: any) => Promise<any>;
632
+ register: (payload?: any) => Promise<any>;
633
+ isLoading: () => boolean;
634
+ };
456
635
  declare function verifyEmail(options?: MutationOptions<any, any>): {
457
636
  mutate: (payload?: VerifyEmailPayload | undefined) => Promise<any>;
458
637
  verifyEmail: (payload?: VerifyEmailPayload | undefined) => Promise<any>;
@@ -494,10 +673,68 @@ declare function resendEmail(options?: MutationOptions<any, any>): {
494
673
  isLoading: () => boolean;
495
674
  };
496
675
 
676
+ type SessionContractInput = {
677
+ hasAccessToken: () => boolean;
678
+ isAccessTokenExpired: () => boolean;
679
+ hasRefreshSession: () => boolean;
680
+ isMfaPending?: () => boolean;
681
+ };
682
+ declare function hasValidAccess(input: SessionContractInput): boolean;
683
+ declare function isFullyAuthenticated(input: SessionContractInput): boolean;
684
+ declare function isMfaPendingSession(input: SessionContractInput): boolean;
685
+ declare function hasAuthenticatedAccess(input: SessionContractInput): boolean;
686
+
687
+ type VisibilityRefreshOptions = {
688
+ shouldRefresh: () => boolean;
689
+ refresh: () => Promise<void>;
690
+ intervalMs?: number;
691
+ };
692
+ declare function startVisibilityRefreshScheduler(options: VisibilityRefreshOptions): () => void;
693
+ declare function stopVisibilityRefreshScheduler(): void;
694
+
695
+ type MfaBootRecoveryResult = 'pending' | 'orphan_cleared' | 'stale_token_cleared' | 'none';
696
+ type MfaBootRecoveryInput = {
697
+ hasMfaContext: () => boolean;
698
+ hasAccessToken: () => boolean;
699
+ hasRefreshToken: () => boolean;
700
+ clearMfaOrphan: () => void;
701
+ clearStaleAccessToken: () => void;
702
+ };
703
+ declare function recoverMfaGateOnBoot(input: MfaBootRecoveryInput): MfaBootRecoveryResult;
704
+
705
+ type AuthRouteAction = {
706
+ kind: 'allow';
707
+ } | {
708
+ kind: 'show_loader';
709
+ } | {
710
+ kind: 'redirect_login';
711
+ returnUrl?: string;
712
+ } | {
713
+ kind: 'redirect_mfa';
714
+ } | {
715
+ kind: 'redirect_funnel';
716
+ step: 'email_verify' | 'hub_select' | 'portal_select';
717
+ };
718
+ type AuthFunnelState = {
719
+ emailVerified?: boolean;
720
+ hubId?: number | string | null;
721
+ portalId?: number | string | null;
722
+ };
723
+ type ResolveAuthRouteActionInput = {
724
+ pathname: string;
725
+ isPublicAuthRoute: (pathname: string) => boolean;
726
+ session: SessionContractInput;
727
+ funnel?: AuthFunnelState;
728
+ mfaRoute: string;
729
+ previewMode?: boolean;
730
+ sessionRestoring?: boolean;
731
+ };
732
+ declare function resolveAuthRouteAction(input: ResolveAuthRouteActionInput): AuthRouteAction;
733
+
497
734
  type HttpErrorKind = 'service_unavailable' | 'network' | 'timeout' | 'auth' | 'client' | 'server' | 'unknown';
498
735
  declare const SERVICE_UNAVAILABLE_MESSAGE = "Service temporarily unavailable. Please try again in a few minutes.";
499
736
  declare function classifyHttpError(error: unknown): HttpErrorKind;
500
737
  declare function isServiceUnavailableError(error: unknown): boolean;
501
738
  declare function getHttpErrorMessage(error: unknown): string;
502
739
 
503
- export { type MfaOtpSendRequest as $, totpDisable as A, webauthnRegisterOptions as B, webauthnRegisterVerify as C, webauthnAuthOptions as D, webauthnAuthVerify as E, listWebauthnCredentials as F, deleteWebauthnCredential as G, passkeyLoginOptions as H, passkeyLoginVerify as I, getSecurityOverview as J, getSecurityLoginActivity as K, getSecuritySessions as L, revokeSecuritySession as M, revokeOtherSecuritySessions as N, getSsoDetails as O, generateSsoUrl as P, ssoCallback as Q, getRefreshToken as R, getAuthRefreshToken as S, getAccessToken as T, clearAccessToken as U, isAuthenticated as V, isAuthenticateApp as W, isAccessTokenExpired as X, isExpiresAccessToken as Y, type LoggerConfig as Z, type TwoFaVerificationRequest as _, logout as a, type MfaPendingPasskeyOptionsRequest as a0, type MfaPendingPasskeyVerifyRequest as a1, type MfaStatusQuery as a2, type MfaPreferenceRequest as a3, type PhoneVerifyStartRequest as a4, type PhoneVerifyConfirmRequest as a5, type TotpEnrollVerifyRequest as a6, type TotpDisableRequest as a7, type WebAuthnVerifyRequest as a8, type PasskeyLoginOptionsRequest as a9, type EditorPreviewMockResult as aA, setEditorPreviewMockHandler as aB, type PasskeyLoginVerifyRequest as aa, type SecurityOverviewQuery as ab, type SecurityLoginActivityQuery as ac, type SecuritySessionsQuery as ad, type RevokeSecuritySessionPayload as ae, type ActiveSession as af, type HttpClientConfig as ag, type HttpErrorKind as ah, type LogLevel as ai, type LoginHistoryRow as aj, type LoginResponseData as ak, type MfaEnrollmentStatus as al, type MfaMethod as am, type MfaMethodOption as an, type MfaPortalScopeContext as ao, type PaginationResponse as ap, SERVICE_UNAVAILABLE_MESSAGE as aq, type SecurityOverview as ar, type StorageKeyConfig as as, classifyHttpError as at, getFieldErrors as au, getFormErrors as av, getHttpErrorMessage as aw, initializeHttpClient as ax, isServiceUnavailableError as ay, type EditorPreviewMockHandler 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 };
740
+ 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 };
@@ -10,11 +10,15 @@ interface MutationOptions<TSuccess, TError = unknown> {
10
10
  onLoadingChange?: (loading: boolean) => void;
11
11
  }
12
12
  interface PreLoginPayload {
13
- username: string;
13
+ username?: string;
14
+ email?: string;
15
+ hubId?: number;
16
+ portalId?: number;
14
17
  }
15
18
  interface LoginPayload {
16
19
  username: string;
17
20
  password: string;
21
+ rememberMe?: boolean;
18
22
  }
19
23
  interface VerifyEmailPayload {
20
24
  token: string;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
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
- 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-G5WkHckd.js';
3
- export { G as CachePurgeDomain, H as CachePurgeMode } from './cache-purge-G5WkHckd.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 webauthnRegisterOptions, C as webauthnRegisterVerify, D as webauthnAuthOptions, E as webauthnAuthVerify, F as listWebauthnCredentials, G as deleteWebauthnCredential, H as passkeyLoginOptions, I as passkeyLoginVerify, J as getSecurityOverview, K as getSecurityLoginActivity, L as getSecuritySessions, M as revokeSecuritySession, N as revokeOtherSecuritySessions, O as getSsoDetails, P as generateSsoUrl, Q as ssoCallback, R as getRefreshToken, S as getAuthRefreshToken, T as getAccessToken, U as clearAccessToken, V as isAuthenticated, W as isAuthenticateApp, X as isAccessTokenExpired, Y as isExpiresAccessToken, Z as LoggerConfig, _ as TwoFaVerificationRequest, $ as MfaOtpSendRequest, a0 as MfaPendingPasskeyOptionsRequest, a1 as MfaPendingPasskeyVerifyRequest, a2 as MfaStatusQuery, a3 as MfaPreferenceRequest, a4 as PhoneVerifyStartRequest, a5 as PhoneVerifyConfirmRequest, a6 as TotpEnrollVerifyRequest, a7 as TotpDisableRequest, a8 as WebAuthnVerifyRequest, a9 as PasskeyLoginOptionsRequest, aa as PasskeyLoginVerifyRequest, ab as SecurityOverviewQuery, ac as SecurityLoginActivityQuery, ad as SecuritySessionsQuery, ae as RevokeSecuritySessionPayload } from './http-errors-hlKcIsXD.js';
5
- export { af as ActiveSession, ag as HttpClientConfig, ah as HttpErrorKind, ai as LogLevel, aj as LoginHistoryRow, ak as LoginResponseData, al as MfaEnrollmentStatus, am as MfaMethod, an as MfaMethodOption, ao as MfaPortalScopeContext, ap as PaginationResponse, aq as SERVICE_UNAVAILABLE_MESSAGE, ar as SecurityOverview, as as StorageKeyConfig, at as classifyHttpError, au as getFieldErrors, av as getFormErrors, aw as getHttpErrorMessage, ax as initializeHttpClient, ay as isServiceUnavailableError } from './http-errors-hlKcIsXD.js';
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-CCwMopD8.js';
7
- export { b as Config, M as MutationOptions } from './index-CCwMopD8.js';
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
+ 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, 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-B41BMjip.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-B41BMjip.js';
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
+ export { b as Config, M as MutationOptions } from './index-Bh9eY8sA.js';
8
8
  import 'axios';
9
9
 
10
10
  declare const api: {
@@ -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;
@@ -37,6 +38,10 @@ declare const api: {
37
38
  totpEnrollStart: typeof totpEnrollStart;
38
39
  totpEnrollVerify: typeof totpEnrollVerify;
39
40
  totpDisable: typeof totpDisable;
41
+ phoneUnverify: typeof phoneUnverify;
42
+ backupCodesRegenerate: typeof backupCodesRegenerate;
43
+ optOut: typeof mfaOptOut;
44
+ mfaOptOut: typeof mfaOptOut;
40
45
  webauthnRegisterOptions: typeof webauthnRegisterOptions;
41
46
  webauthnRegisterVerify: typeof webauthnRegisterVerify;
42
47
  webauthnAuthOptions: typeof webauthnAuthOptions;
@@ -53,6 +58,7 @@ declare const api: {
53
58
  revokeSession: typeof revokeSecuritySession;
54
59
  revokeOtherSessions: typeof revokeOtherSecuritySessions;
55
60
  };
61
+ loginBootstrap: typeof getLoginBootstrap;
56
62
  sso: {
57
63
  getDetails: typeof getSsoDetails;
58
64
  generateUrl: typeof generateSsoUrl;
@@ -60,6 +66,7 @@ declare const api: {
60
66
  };
61
67
  session: {
62
68
  getRefreshToken: typeof getRefreshToken;
69
+ refreshSession: typeof refreshSession;
63
70
  refreshAccessToken: typeof getAuthRefreshToken;
64
71
  getAccessToken: typeof getAccessToken;
65
72
  clearAccessToken: typeof clearAccessToken;
@@ -68,6 +75,12 @@ declare const api: {
68
75
  isAccessTokenExpired: typeof isAccessTokenExpired;
69
76
  isExpiresAccessToken: typeof isExpiresAccessToken;
70
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;
71
84
  };
72
85
  };
73
86
  crm: {
@@ -241,11 +254,14 @@ declare const Client: {
241
254
  pendingPasskeyVerify: (data: MfaPendingPasskeyVerifyRequest) => Promise<unknown>;
242
255
  getStatus: (query?: MfaStatusQuery) => Promise<unknown>;
243
256
  setPreferences: (data: MfaPreferenceRequest, query?: MfaStatusQuery) => Promise<unknown>;
244
- startPhoneVerify: (data: PhoneVerifyStartRequest) => Promise<unknown>;
245
- confirmPhoneVerify: (data: PhoneVerifyConfirmRequest) => Promise<unknown>;
257
+ startPhoneVerify: (data: PhoneVerifyStartRequest, query?: MfaStatusQuery) => Promise<unknown>;
258
+ confirmPhoneVerify: (data: PhoneVerifyConfirmRequest, query?: MfaStatusQuery) => Promise<unknown>;
246
259
  totpEnrollStart: (query?: MfaStatusQuery) => Promise<unknown>;
247
260
  totpEnrollVerify: (data: TotpEnrollVerifyRequest) => Promise<unknown>;
248
- totpDisable: (data: TotpDisableRequest) => Promise<unknown>;
261
+ totpDisable: (data: TotpDisableRequest, query?: MfaStatusQuery) => Promise<unknown>;
262
+ phoneUnverify: (data: PhoneUnverifyRequest, query?: MfaStatusQuery) => Promise<unknown>;
263
+ backupCodesRegenerate: (data: BackupCodesRegenerateRequest, query?: MfaStatusQuery) => Promise<MfaBackupCodesResponse>;
264
+ optOut: (data: MfaOptOutRequest, query?: MfaStatusQuery) => Promise<unknown>;
249
265
  webauthnRegisterOptions: (query?: MfaStatusQuery) => Promise<unknown>;
250
266
  webauthnRegisterVerify: (data: WebAuthnVerifyRequest) => Promise<unknown>;
251
267
  webauthnAuthOptions: (query?: MfaStatusQuery) => Promise<unknown>;
@@ -305,6 +321,11 @@ declare const Client: {
305
321
  login: (data: LoginPayload) => Promise<unknown>;
306
322
  verifyOtp: (data: TwoFaVerificationRequest) => Promise<unknown>;
307
323
  verifyEmail: (data: VerifyEmailPayload) => Promise<unknown>;
324
+ register: (data: {
325
+ name: string;
326
+ email: string;
327
+ password: string;
328
+ }) => Promise<unknown>;
308
329
  resetPasswordVerifyToken: (data: ResetPasswordVerifyTokenPayload) => Promise<unknown>;
309
330
  resetPassword: (data: ResetPasswordPayload) => Promise<unknown>;
310
331
  forgetPassword: (data: ForgetPasswordPayload) => Promise<unknown>;
@@ -320,6 +341,10 @@ declare const Client: {
320
341
  code: string;
321
342
  hubId: number;
322
343
  }) => Promise<unknown>;
344
+ getLoginBootstrap: (payload?: {
345
+ hubId?: number;
346
+ portalId?: number;
347
+ }) => Promise<unknown>;
323
348
  };
324
349
  sso: {
325
350
  getSsoDetails: () => Promise<unknown>;
@@ -415,6 +440,7 @@ declare const store: {
415
440
  modifiedObjectsData(results: any): void;
416
441
  clearTablePrependData(): void;
417
442
  setTablePrependData(response: any, props?: any): Promise<void>;
443
+ updateTablePrependData(response: any, payload?: any): any;
418
444
  };
419
445
  };
420
446
  user: {
@@ -470,4 +496,4 @@ declare const store: {
470
496
  };
471
497
  };
472
498
 
473
- 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 };
499
+ 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-GO35W5PN.js';
2
- import { crmApi } from './chunk-D7XKR2O7.js';
3
- import { navigationApi, storage } from './chunk-FDZNMZS4.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-FDZNMZS4.js';
5
- import './chunk-6KKVGCXG.js';
6
- import { actions8, syncStore, actions5, emailStore, actions4, noteStore, actions7, userStore, actions2, tableStore, tableUiActions, tableUiStore } from './chunk-YEUFUGGT.js';
7
- export { configureLogger } from './chunk-YEUFUGGT.js';
8
- import './chunk-QPSCMK4W.js';
1
+ import { authApi } from './chunk-IUVL2E7K.js';
2
+ export { hasAuthenticatedAccess, hasValidAccess, isFullyAuthenticated, isMfaPendingSession, recoverMfaGateOnBoot, resolveAuthRouteAction } from './chunk-IUVL2E7K.js';
3
+ export { isOptionalAuthFailureUrl, isSessionProbeUrl, persistAuthError, resolveAuthErrorAction } from './chunk-MFIGS74G.js';
4
+ import { crmApi } from './chunk-BWZAX23E.js';
5
+ import { navigationApi, storage } from './chunk-LSRSCZBI.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-LSRSCZBI.js';
7
+ import './chunk-ND7HCTXC.js';
8
+ import { actions8, syncStore, actions5, emailStore, actions4, noteStore, actions7, userStore, actions2, tableStore, tableUiActions, tableUiStore } from './chunk-GLATNYVU.js';
9
+ export { configureLogger } from './chunk-GLATNYVU.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":"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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 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.2",
3
+ "version": "4.0.4-dev.20",
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",
@@ -45,8 +45,9 @@
45
45
  "registry": "https://registry.npmjs.org/"
46
46
  },
47
47
  "scripts": {
48
- "dev": "npm run dev:watch",
49
- "dev:watch": "node scripts/dev-watch.mjs",
48
+ "local": "node scripts/dev-watch.mjs",
49
+ "dev": "npm run local",
50
+ "dev:watch": "npm run local",
50
51
  "start": "nodemon --watch src/main --ext ts --exec tsx src/main/index.ts",
51
52
  "clean": "rimraf dist",
52
53
  "build": "npm run clean && tsup",
@@ -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