woodsportal-client-sdk 4.1.2-dev.0 → 4.1.2-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/angular/index.js +3 -3
- package/dist/adapters/native/index.js +4 -4
- package/dist/adapters/react/index.js +4 -4
- package/dist/adapters/vue/index.js +3 -3
- package/dist/{chunk-WJBWIUQM.js → chunk-3VH52USP.js} +4 -4
- package/dist/{chunk-WJBWIUQM.js.map → chunk-3VH52USP.js.map} +1 -1
- package/dist/{chunk-XQAVHI2F.js → chunk-7XZSJGCX.js} +3 -3
- package/dist/{chunk-XQAVHI2F.js.map → chunk-7XZSJGCX.js.map} +1 -1
- package/dist/{chunk-JZ5BNYYH.js → chunk-NJIMZXP4.js} +5 -5
- package/dist/{chunk-JZ5BNYYH.js.map → chunk-NJIMZXP4.js.map} +1 -1
- package/dist/{chunk-JWEA5HWX.js → chunk-T553DXBI.js} +4 -4
- package/dist/{chunk-JWEA5HWX.js.map → chunk-T553DXBI.js.map} +1 -1
- package/dist/{chunk-YGSPLKDC.js → chunk-UFQW7TDL.js} +4 -4
- package/dist/{chunk-YGSPLKDC.js.map → chunk-UFQW7TDL.js.map} +1 -1
- package/dist/{chunk-JEQNFCQP.js → chunk-USEVXBRI.js} +91 -22
- package/dist/chunk-USEVXBRI.js.map +1 -0
- package/dist/{chunk-ZZCYSW32.js → chunk-X6NNUGP7.js} +3 -3
- package/dist/chunk-X6NNUGP7.js.map +1 -0
- package/dist/{chunk-F43GSZXK.js → chunk-YKA26CVL.js} +3 -3
- package/dist/{chunk-F43GSZXK.js.map → chunk-YKA26CVL.js.map} +1 -1
- package/dist/{cache-purge-CokkqLSk.d.ts → crmCacheRefresh-B9sAQzI7.d.ts} +31 -1
- package/dist/{cross-tab-session-VAOXHEZL.js → cross-tab-session-VJBW7BK6.js} +5 -5
- package/dist/{cross-tab-session-VAOXHEZL.js.map → cross-tab-session-VJBW7BK6.js.map} +1 -1
- package/dist/entries/auth.js +4 -4
- package/dist/entries/crm.d.ts +2 -2
- package/dist/entries/crm.js +7 -6
- package/dist/entries/crm.js.map +1 -1
- package/dist/index.d.ts +25 -47
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-JEQNFCQP.js.map +0 -1
- package/dist/chunk-ZZCYSW32.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as TableUiState, T as TableState, U as UserState, N as NoteState, E as EmailState, S as SyncState } from './use-sync-B4xio81b.js';
|
|
2
2
|
import { M as MutationOptions, P as PreLoginPayload, L as LoginPayload, V as VerifyEmailPayload, a as ResetPasswordVerifyTokenPayload, R as ResetPasswordPayload, F as ForgetPasswordPayload, b as ForgetPasswordOtpVerifyPayload, C as ChangePasswordPayload } from './index-CWYPrDBp.js';
|
|
3
3
|
export { c as Config } from './index-CWYPrDBp.js';
|
|
4
|
-
import { l as list, a as list$1, b as list$2, e as existingList, c as addExistingList, s as sideBarList, f as form, o as objectFormOptions, d as details, u as update, g as create, h as createExisting, r as removeExisting, i as list$3, j as create$1, k as update$1, m as list$4, n as create$2, p as update$2, q as list$5, t as details$1, v as download, w as addFolder, x as addFile, y as imageUpload, z as attachmentUpload, A as purge, B as purgeStatus
|
|
5
|
-
export { C as CachePurgeDomain,
|
|
4
|
+
import { H as CachePurgeTarget, G as CachePurgeRequest, E as CachePurgeListQuery, I as CachePurgeView, J as CreateCachePurgeJobOptions, O as PurgeResult, l as list, a as list$1, b as list$2, e as existingList, c as addExistingList, s as sideBarList, f as form, o as objectFormOptions, d as details, u as update, g as create, h as createExisting, r as removeExisting, i as list$3, j as create$1, k as update$1, m as list$4, n as create$2, p as update$2, q as list$5, t as details$1, v as download, w as addFolder, x as addFile, y as imageUpload, z as attachmentUpload, A as purge, B as purgeStatus } from './crmCacheRefresh-B9sAQzI7.js';
|
|
5
|
+
export { C as AssociationCachePurgeOptions, D as CachePurgeDomain, F as CachePurgeMode, K as CrmCachePurgeOptions, L as HUBSPOT_DEALS_OBJECT_TYPE_ID, M as HUBSPOT_TICKETS_OBJECT_TYPE_ID, P as PIPELINE_BOARD_OBJECT_TYPE_IDS, N as PIPELINE_REQUIRED_MANAGED_OBJECT_TYPE_IDS, Q as isPipelineBoardObjectType, R as isPipelineBoardObjectTypeId, S as purgeCrmAssociationCaches, _ as purgeCrmCombined, T as purgeCrmDetailAndListAfterCrmWrite, U as purgeCrmListCache, V as purgeCrmListCacheAfterCrmWrite, W as purgeCrmObjectDataCache, $ as purgeCrmRecordCache, X as purgeEngagementCaches, a0 as purgeEngagementCachesAfterCrmWrite, Y as shouldShowPipelineSelector, Z as supportsBoardView } from './crmCacheRefresh-B9sAQzI7.js';
|
|
6
6
|
import { aO as ResolvedApiErrorDisplay, bt as ApiContentVariant, bu as ApiErrorSeverity, aN as ResolveApiErrorDisplayOptions, 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 verifyForgotPasswordOtp, e as resetPassword, g as resetPasswordVerifyToken, i as verifyEmailResend, j as resendEmail, s as signInLinkSend, k as signInLinkVerify, m as signInLinkValidateToken, n as changePassword, o as me, q as profile, t as profileUpdate, u as verifyOtp, w as sendMfaOtp, x as pendingPasskeyOptions, y as pendingPasskeyVerify, z as getMfaStatus, A as setMfaPreferences, B as startPhoneVerify, C as confirmPhoneVerify, D as totpEnrollStart, E as totpEnrollVerify, F as totpDisable, G as phoneUnverify, H as backupCodesRegenerate, I as mfaOptOut, J as webauthnRegisterOptions, K as webauthnRegisterVerify, L as webauthnAuthOptions, M as webauthnAuthVerify, N as listWebauthnCredentials, O as deleteWebauthnCredential, P as passkeyLoginOptions, Q as passkeyLoginVerify, R as getSecurityOverview, S as getSecurityLoginActivity, T as getSecuritySessions, U as revokeSecuritySession, V as revokeOtherSecuritySessions, W as getLoginBootstrap, X as getSsoDetails, Y as generateSsoUrl, Z as ssoCallback, _ as getRefreshToken, $ as refreshSession, a0 as getAuthRefreshToken, a1 as getAccessToken, a2 as setAccessToken, a3 as clearAccessToken, a4 as isAuthenticated, a5 as isAuthenticateApp, a6 as isAccessTokenExpired, a7 as isExpiresAccessToken, a8 as hasRefreshSession, a9 as hasValidAccessToken, aa as didLastRefreshFail, ab as isSessionRefreshExhausted, ac as isRefreshInFlight, ad as resetSessionAuthState, ae as clearSessionRefreshExhaustedState, af as hydrateSessionRefreshState, ag as SessionContractInput, aw as HttpClientConfig, bv as LoggerConfig, aU as TwoFaVerificationRequest, bw as MfaOtpSendRequest, bx as MfaPendingPasskeyOptionsRequest, by as MfaPendingPasskeyVerifyRequest, bz as MfaStatusQuery, bA as MfaPreferenceRequest, bB as PhoneVerifyStartRequest, bC as PhoneVerifyConfirmRequest, bD as TotpEnrollVerifyRequest, bE as TotpDisableRequest, bF as PhoneUnverifyRequest, bG as BackupCodesRegenerateRequest, bH as MfaBackupCodesResponse, bI as MfaOptOutRequest, bJ as WebAuthnVerifyRequest, bK as PasskeyLoginOptionsRequest, bL as PasskeyLoginVerifyRequest, bM as SecurityOverviewQuery, bN as SecurityLoginActivityQuery, bO as SecuritySessionsQuery, bP as RevokeSecuritySessionPayload } from './route-guard-contract-C6Gbvr5x.js';
|
|
7
7
|
export { ah as API_ERROR_CATEGORY_FALLBACK, ai as API_ERROR_DISPLAY_CONFIG, aj as ActiveSession, ak as ApiErrorDisplayConfig, al as ApiErrorPayload, am as ApiErrorVariant, an as AuthErrorAction, ao as AuthErrorCode, ap as AuthErrorCodeValue, aq as AuthFunnelState, ar as AuthInterceptorPolicyConfig, as as AuthPolicyRoutes, at as AuthRouteAction, ax as HttpErrorKind, ay as HydrateMfaPendingAccessTokenInput, bQ as LogLevel, bR as LogMeta, aD as LoginHistoryRow, aE as LoginResponseData, aF as MfaBootRecoveryResult, aG as MfaEnrollmentStatus, aH as MfaMethod, aI as MfaMethodOption, aJ as MfaPendingAccessToken, aK as MfaPortalScopeContext, aL as MfaStorageLane, aM as PaginationResponse, aP as SERVICE_UNAVAILABLE_MESSAGE, aQ as SecurityOverview, aR as SessionRefreshDeferredError, aS as SessionRefreshFailedError, bS as StorageKeyConfig, aT as StoredAuthError, aV as UnauthorizedPageCopy, aW as WOODSPORTAL_API_ACTIVE_ERROR_CODES, aX as WoodsportalRequestConfig, aY as buildErrorDescription, aZ as classifyHttpError, a_ as clearMfaPendingAccessToken, bT as configureStorageKeys, a$ as getApiErrorFromUnknown, b0 as getFieldErrors, b1 as getFormErrors, b2 as getHttpErrorMessage, bU as getStorageKeys, b3 as getUnauthorizedPageCopy, b4 as hasAuthenticatedAccess, b5 as hasValidAccess, b6 as hydrateMfaPendingAccessToken, b7 as initializeHttpClient, b8 as isFullyAuthenticated, b9 as isMfaPendingAccessSession, ba as isMfaPendingSession, bb as isOptionalAuthFailureUrl, bc as isServiceUnavailableError, bd as isSessionProbeUrl, be as isSessionRefreshDeferredError, bf as isSessionRefreshFailedError, bg as parseApiErrorPayload, bh as persistAuthError, bi as readMfaPendingAccessToken, bj as readPersistedAuthError, bk as recoverMfaGateOnBoot, bV as resetStorageKeysForTests, bl as resolveApiErrorDisplay, bm as resolveAuthErrorAction, bn as resolveAuthRouteAction, bp as setSessionLifecycleListener, bq as startVisibilityRefreshScheduler, br as stopVisibilityRefreshScheduler, bs as storeMfaPendingAccessToken } from './route-guard-contract-C6Gbvr5x.js';
|
|
8
8
|
import 'axios';
|
|
@@ -134,6 +134,28 @@ type ResolvedApiContentState = ResolvedApiErrorDisplay & {
|
|
|
134
134
|
declare function resolveApiContentState(error: unknown, options?: ResolveApiErrorDisplayOptions): ResolvedApiContentState;
|
|
135
135
|
declare function isExpectedApiError(error: unknown): boolean;
|
|
136
136
|
|
|
137
|
+
declare function buildCrmListPurgeTarget(objectTypeId: string, listQuery?: CachePurgeListQuery, recordIds?: string[]): CachePurgeTarget;
|
|
138
|
+
declare function buildCrmSinglePurgeTarget(objectTypeId: string, recordIds: string[], listQuery?: CachePurgeListQuery): CachePurgeTarget;
|
|
139
|
+
declare function buildEngagementPurgeTarget(objectTypeId: string, recordIds: string[], views: Extract<CachePurgeView, 'notes' | 'emails' | 'files'>[], options?: {
|
|
140
|
+
fileIds?: string[];
|
|
141
|
+
listQuery?: CachePurgeListQuery;
|
|
142
|
+
engagementItemIds?: string[];
|
|
143
|
+
}): CachePurgeTarget;
|
|
144
|
+
declare function buildUserSessionPurgeTarget(): CachePurgeTarget;
|
|
145
|
+
declare function buildPortalConfigPurgeTarget(objectTypeIds: string[]): CachePurgeTarget;
|
|
146
|
+
declare function mergePurgeTargets(...targets: CachePurgeTarget[]): CachePurgeTarget[];
|
|
147
|
+
declare function buildCachePurgeRequest(targets: CachePurgeTarget[], options?: {
|
|
148
|
+
mode?: 'soft' | 'hard';
|
|
149
|
+
warm?: boolean;
|
|
150
|
+
includeContactAccess?: boolean;
|
|
151
|
+
includeShortOnHard?: boolean;
|
|
152
|
+
confirmPortalWide?: boolean;
|
|
153
|
+
postCrmWrite?: boolean;
|
|
154
|
+
warmListDelayMs?: number;
|
|
155
|
+
}): CachePurgeRequest;
|
|
156
|
+
|
|
157
|
+
declare function createCachePurgeJob(request: CachePurgeRequest, options?: CreateCachePurgeJobOptions): Promise<PurgeResult>;
|
|
158
|
+
|
|
137
159
|
declare function getPreferences(options?: MutationOptions<NotificationPreference, any>): {
|
|
138
160
|
mutate: (payload?: void | undefined) => Promise<NotificationPreference>;
|
|
139
161
|
getPreferences: (payload?: void | undefined) => Promise<NotificationPreference>;
|
|
@@ -348,50 +370,6 @@ type HubSpotActivityDateTimeParts = {
|
|
|
348
370
|
declare function formatHubSpotActivityDateTimeParts(timestamp: unknown, timeZone?: string): HubSpotActivityDateTimeParts | null;
|
|
349
371
|
declare function formatHubSpotActivityDateTime(timestamp: unknown, timeZone?: string): string;
|
|
350
372
|
|
|
351
|
-
declare function buildCrmListPurgeTarget(objectTypeId: string, listQuery?: CachePurgeListQuery, recordIds?: string[]): CachePurgeTarget;
|
|
352
|
-
declare function buildCrmSinglePurgeTarget(objectTypeId: string, recordIds: string[], listQuery?: CachePurgeListQuery): CachePurgeTarget;
|
|
353
|
-
declare function buildEngagementPurgeTarget(objectTypeId: string, recordIds: string[], views: Extract<CachePurgeView, 'notes' | 'emails' | 'files'>[], options?: {
|
|
354
|
-
fileIds?: string[];
|
|
355
|
-
listQuery?: CachePurgeListQuery;
|
|
356
|
-
engagementItemIds?: string[];
|
|
357
|
-
}): CachePurgeTarget;
|
|
358
|
-
declare function buildUserSessionPurgeTarget(): CachePurgeTarget;
|
|
359
|
-
declare function buildPortalConfigPurgeTarget(objectTypeIds: string[]): CachePurgeTarget;
|
|
360
|
-
declare function mergePurgeTargets(...targets: CachePurgeTarget[]): CachePurgeTarget[];
|
|
361
|
-
declare function buildCachePurgeRequest(targets: CachePurgeTarget[], options?: {
|
|
362
|
-
mode?: 'soft' | 'hard';
|
|
363
|
-
warm?: boolean;
|
|
364
|
-
includeContactAccess?: boolean;
|
|
365
|
-
includeShortOnHard?: boolean;
|
|
366
|
-
confirmPortalWide?: boolean;
|
|
367
|
-
postCrmWrite?: boolean;
|
|
368
|
-
warmListDelayMs?: number;
|
|
369
|
-
}): CachePurgeRequest;
|
|
370
|
-
|
|
371
|
-
declare function createCachePurgeJob(request: CachePurgeRequest, options?: CreateCachePurgeJobOptions): Promise<PurgeResult>;
|
|
372
|
-
|
|
373
|
-
declare function purgeCrmObjectDataCache(options: CrmCachePurgeOptions): Promise<boolean>;
|
|
374
|
-
declare function purgeCrmListCacheAfterCrmWrite(options: CrmCachePurgeOptions): Promise<PurgeResult>;
|
|
375
|
-
declare function purgeCrmDetailAndListAfterCrmWrite(options: CrmCachePurgeOptions & {
|
|
376
|
-
recordIds: string[];
|
|
377
|
-
}): Promise<PurgeResult>;
|
|
378
|
-
declare function purgeCrmListCache(options: CrmCachePurgeOptions): Promise<PurgeResult>;
|
|
379
|
-
declare function purgeCrmRecordCache(options: CrmCachePurgeOptions & {
|
|
380
|
-
recordIds: string[];
|
|
381
|
-
}): Promise<PurgeResult>;
|
|
382
|
-
declare function purgeEngagementCaches(options: CrmCachePurgeOptions & {
|
|
383
|
-
recordIds: string[];
|
|
384
|
-
views: ('notes' | 'emails' | 'files')[];
|
|
385
|
-
}): Promise<PurgeResult>;
|
|
386
|
-
declare function purgeEngagementCachesAfterCrmWrite(options: CrmCachePurgeOptions & {
|
|
387
|
-
recordIds: string[];
|
|
388
|
-
views: ('notes' | 'emails')[];
|
|
389
|
-
engagementItemIds?: string[];
|
|
390
|
-
}): Promise<PurgeResult>;
|
|
391
|
-
declare function purgeCrmCombined(options: CrmCachePurgeOptions & {
|
|
392
|
-
targets: CachePurgeTarget[];
|
|
393
|
-
}): Promise<PurgeResult>;
|
|
394
|
-
|
|
395
373
|
declare function extractHubspotRecordIdFromWriteResponse(response: unknown): string | undefined;
|
|
396
374
|
|
|
397
375
|
declare function extractEngagementItemIdFromWriteResponse(response: unknown): string | undefined;
|
|
@@ -716,4 +694,4 @@ declare const store: {
|
|
|
716
694
|
};
|
|
717
695
|
};
|
|
718
696
|
|
|
719
|
-
export { ApiContentVariant, ApiErrorSeverity, CachePurgeListQuery, CachePurgeRequest, CachePurgeTarget, CachePurgeView, ChangePasswordPayload, Client, CreateCachePurgeJobOptions,
|
|
697
|
+
export { ApiContentVariant, ApiErrorSeverity, CachePurgeListQuery, CachePurgeRequest, CachePurgeTarget, CachePurgeView, ChangePasswordPayload, Client, CreateCachePurgeJobOptions, DEFAULT_HUBSPOT_TIMEZONE, ForgetPasswordPayload, HttpClientConfig, type HubSpotActivityDateTimeParts, LoggerConfig, LoginPayload, type MobileClientConfig, MutationOptions, PreLoginPayload, PurgeResult, ResetPasswordPayload, ResetPasswordVerifyTokenPayload, ResolveApiErrorDisplayOptions, type ResolvedApiContentState, ResolvedApiErrorDisplay, SessionContractInput, type SessionStorageAdapter, TwoFaVerificationRequest, VerifyEmailPayload, WP_STORAGE_KEYS, WP_UI_THEME, WP_UI_TIME_FORMAT, WP_UI_TIME_ZONE, api, applyContractApiDate, applyCrossTabSessionRevocation, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, clearClientAuthCookies, clearClientIframeRefreshLocalKeys, clearClientSdkSession, clearClientSessionStorageKeys, clearStaleIframeRefreshForOtherHubs, configureLogger, createCachePurgeJob, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, formatGmtOffset, formatHubSpotActivityDateTime, formatHubSpotActivityDateTimeParts, getClientAuthCookieNamesToClear, getClientType, getConfiguredContractApiDate, getCurrentTimeZone, config as hubContext, initializeMobileClient, installCrossTabSessionListener, isExpectedApiError, mergePurgeTargets, migrateLegacyStorageKeys, normalizeToTimestamp, resetSessionStores, resolveApiContentState, resolveCrmListPurgeQuery, setConfig as setHubContext, signalSessionChanged, store, toCachePurgeListQuery, wpClientIframeRefreshExpKey, wpClientIframeRefreshKey };
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { applyCrossTabSessionRevocation, clearClientSdkSession, installCrossTabSessionListener, resetSessionStores, signalSessionChanged } from './chunk-
|
|
2
|
-
import { authApi } from './chunk-
|
|
3
|
-
export { API_ERROR_CATEGORY_FALLBACK, API_ERROR_DISPLAY_CONFIG, WOODSPORTAL_API_ACTIVE_ERROR_CODES, buildErrorDescription, getApiErrorFromUnknown, hasAuthenticatedAccess, hasValidAccess, isExpectedApiError, isFullyAuthenticated, isMfaPendingSession, recoverMfaGateOnBoot, resolveApiContentState, resolveApiErrorDisplay, resolveAuthRouteAction } from './chunk-
|
|
1
|
+
export { applyCrossTabSessionRevocation, clearClientSdkSession, installCrossTabSessionListener, resetSessionStores, signalSessionChanged } from './chunk-T553DXBI.js';
|
|
2
|
+
import { authApi } from './chunk-UFQW7TDL.js';
|
|
3
|
+
export { API_ERROR_CATEGORY_FALLBACK, API_ERROR_DISPLAY_CONFIG, WOODSPORTAL_API_ACTIVE_ERROR_CODES, buildErrorDescription, getApiErrorFromUnknown, hasAuthenticatedAccess, hasValidAccess, isExpectedApiError, isFullyAuthenticated, isMfaPendingSession, recoverMfaGateOnBoot, resolveApiContentState, resolveApiErrorDisplay, resolveAuthRouteAction } from './chunk-UFQW7TDL.js';
|
|
4
4
|
export { isOptionalAuthFailureUrl, isSessionProbeUrl, persistAuthError, readPersistedAuthError, resolveAuthErrorAction } from './chunk-JRT5XSVY.js';
|
|
5
|
-
import { crmApi } from './chunk-
|
|
6
|
-
export { isPipelineBoardObjectType, shouldShowPipelineSelector, supportsBoardView } from './chunk-
|
|
5
|
+
import { crmApi } from './chunk-NJIMZXP4.js';
|
|
6
|
+
export { isPipelineBoardObjectType, shouldShowPipelineSelector, supportsBoardView } from './chunk-NJIMZXP4.js';
|
|
7
7
|
import './chunk-55MIERLJ.js';
|
|
8
|
-
import { navigationApi, HttpClient, API_ENDPOINTS, generateApiUrl, createMutation, initializeHttpClient } from './chunk-
|
|
9
|
-
export { Client, applyContractApiDate, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, createCachePurgeJob, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, getConfiguredContractApiDate, getFieldErrors, getFormErrors, initializeHttpClient, mergePurgeTargets, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, startVisibilityRefreshScheduler, stopVisibilityRefreshScheduler, toCachePurgeListQuery } from './chunk-
|
|
10
|
-
import './chunk-
|
|
11
|
-
import { actions8, syncStore, actions5, emailStore, actions4, noteStore, actions6, userStore, actions2, tableStore, tableUiActions, tableUiStore, hydrateUserStoreFromSession } from './chunk-
|
|
12
|
-
export { HUBSPOT_DEALS_OBJECT_TYPE_ID, HUBSPOT_TICKETS_OBJECT_TYPE_ID, PIPELINE_BOARD_OBJECT_TYPE_IDS, PIPELINE_REQUIRED_MANAGED_OBJECT_TYPE_IDS, isPipelineBoardObjectTypeId } from './chunk-
|
|
8
|
+
import { navigationApi, HttpClient, API_ENDPOINTS, generateApiUrl, createMutation, initializeHttpClient } from './chunk-USEVXBRI.js';
|
|
9
|
+
export { Client, applyContractApiDate, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, createCachePurgeJob, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, getConfiguredContractApiDate, getFieldErrors, getFormErrors, initializeHttpClient, mergePurgeTargets, purgeCrmAssociationCaches, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, startVisibilityRefreshScheduler, stopVisibilityRefreshScheduler, toCachePurgeListQuery } from './chunk-USEVXBRI.js';
|
|
10
|
+
import './chunk-YKA26CVL.js';
|
|
11
|
+
import { actions8, syncStore, actions5, emailStore, actions4, noteStore, actions6, userStore, actions2, tableStore, tableUiActions, tableUiStore, hydrateUserStoreFromSession } from './chunk-X6NNUGP7.js';
|
|
12
|
+
export { HUBSPOT_DEALS_OBJECT_TYPE_ID, HUBSPOT_TICKETS_OBJECT_TYPE_ID, PIPELINE_BOARD_OBJECT_TYPE_IDS, PIPELINE_REQUIRED_MANAGED_OBJECT_TYPE_IDS, isPipelineBoardObjectTypeId } from './chunk-X6NNUGP7.js';
|
|
13
13
|
import { storage, hydrateSessionRefreshState, hydrateMfaPendingAccessToken, storAccessToken } from './chunk-JVJMM4SZ.js';
|
|
14
14
|
export { SERVICE_UNAVAILABLE_MESSAGE, SessionRefreshDeferredError, SessionRefreshFailedError, classifyHttpError, clearMfaPendingAccessToken, configureLogger, getHttpErrorMessage, config as hubContext, hydrateMfaPendingAccessToken, isMfaPendingAccessSession, isServiceUnavailableError, isSessionRefreshDeferredError, isSessionRefreshFailedError, readMfaPendingAccessToken, setConfig as setHubContext, setSessionLifecycleListener, storeMfaPendingAccessToken } from './chunk-JVJMM4SZ.js';
|
|
15
15
|
import { setClientType } from './chunk-32ERSTFY.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main/features/accounts/client/accounts-client.ts","../src/main/api/nested-accounts-api.ts","../src/main/features/mobile/client/mobile-navigation-client.ts","../src/main/api/nested-mobile-api.ts","../src/main/features/notifications/client/notification-preferences-client.ts","../src/main/features/notifications/api/preferences.ts","../src/main/api/nested-notifications-api.ts","../src/main/api/compose-api.ts","../src/main/core/utils/datetime.ts","../src/main/core/http/mobile-client-config.ts","../src/main/index.ts"],"names":["storage","actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEO,IAAM,cAAA,GAAiB;AAAA,EAC1B,YAAA,EAAc,MAAM,UAAA,CAAW,GAAA,CAAI,cAAc,QAAQ,CAAA;AAAA,EACzD,WAAA,EAAa,CAAC,KAAA,KAAkB,UAAA,CAAW,IAAI,aAAA,CAAc,OAAA,EAAS,EAAE,KAAA,EAAO;AACnF,CAAA;;;ACFO,IAAM,WAAA,GAAc;AAAA,EACvB,cAAc,cAAA,CAAe,YAAA;AAAA,EAC7B,aAAa,cAAA,CAAe;AAChC,CAAA;;;ACJO,IAAM,sBAAA,GAAyB;AAAA,EAClC,aAAA,EAAe,MAAM,UAAA,CAAW,GAAA,CAAI,cAAA,CAAe,EAAE,KAAA,EAAO,aAAA,CAAc,iBAAA,EAAmB,CAAC,CAAA;AAAA,EAC9F,YAAA,EAAc,MAAM,UAAA,CAAW,GAAA,CAAI,cAAA,CAAe,EAAE,KAAA,EAAO,aAAA,CAAc,iBAAA,E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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 { API_ENDPOINTS, HttpClient } from '../../../core/http/client-context'\n\nexport const accountsClient = {\n listHubspots: () => HttpClient.get(API_ENDPOINTS.HUBSPOTS),\n listPortals: (hubId: number) => HttpClient.get(API_ENDPOINTS.PORTALS, { hubId })\n}\n","import { accountsClient } from '../features/accounts/client/accounts-client'\n\n/** Client account listing (hubspots / portals) for mobile and multi-account flows. */\nexport const accountsApi = {\n listHubspots: accountsClient.listHubspots,\n listPortals: accountsClient.listPortals\n}\n","import { generateApiUrl, API_ENDPOINTS, HttpClient } from '../../../core/http/client-context'\n\nexport const mobileNavigationClient = {\n getNavigation: () => HttpClient.get(generateApiUrl({ route: API_ENDPOINTS.MOBILE_NAVIGATION })),\n getAppConfig: () => HttpClient.get(generateApiUrl({ route: API_ENDPOINTS.MOBILE_APP_CONFIG })),\n putNavigation: (payload: unknown) => HttpClient.put(generateApiUrl({ route: API_ENDPOINTS.MOBILE_NAVIGATION }), payload),\n importFromWebMenu: (payload: unknown) => HttpClient.post(generateApiUrl({ route: API_ENDPOINTS.MOBILE_NAVIGATION_IMPORT_WEB_MENU }), payload)\n}\n","import { mobileNavigationClient } from '../features/mobile/client/mobile-navigation-client'\n\n/** Mobile-specific API surface (navigation config, etc.). */\nexport const mobileApi = {\n getNavigation: mobileNavigationClient.getNavigation,\n getAppConfig: mobileNavigationClient.getAppConfig,\n putNavigation: mobileNavigationClient.putNavigation,\n importFromWebMenu: mobileNavigationClient.importFromWebMenu\n}\n","import { generateApiUrl, API_ENDPOINTS, HttpClient } from '../../../core/http/client-context'\nimport type { NotificationPreference } from '../../../core/types/notification'\n\nexport const notificationPreferencesClient = {\n getPreferences: () =>\n HttpClient.get<NotificationPreference>(generateApiUrl({ route: API_ENDPOINTS.NOTIFICATION_PREFERENCES })),\n updatePreferences: (payload: NotificationPreference) =>\n HttpClient.put<NotificationPreference>(\n generateApiUrl({ route: API_ENDPOINTS.NOTIFICATION_PREFERENCES }),\n payload\n )\n}\n","import { createMutation } from '../../../core/mutation/createMutation'\nimport type { MutationOptions } from '../../../core/types'\nimport type { NotificationPreference } from '../../../core/types/notification'\nimport { notificationPreferencesClient } from '../client/notification-preferences-client'\n\n/**\n * Load the signed-in portal user's email notification preferences.\n *\n * **API:** `GET /api/{hubId}/{portalId}/notification-preferences`\n * **Auth:** Bearer portal client JWT (`PROFILE_READ`).\n * **Defaults:** both flags `true` until the user saves.\n */\nexport function getPreferences(options?: MutationOptions<NotificationPreference, any>) {\n const { mutate, isLoading } = createMutation<void, NotificationPreference>(\n async () => (await notificationPreferencesClient.getPreferences()) as NotificationPreference,\n options\n )\n\n return { mutate, getPreferences: mutate, isLoading }\n}\n\n/**\n * Upsert email notification preferences for the signed-in portal user.\n *\n * **API:** `PUT /api/{hubId}/{portalId}/notification-preferences`\n * **Auth:** Bearer portal client JWT (`PROFILE_WRITE`).\n * **Body:** `{ emailProductAnnouncements, emailJobErrors }` (both required booleans).\n */\nexport function updatePreferences(options?: MutationOptions<NotificationPreference, any>) {\n const { mutate, isLoading } = createMutation<NotificationPreference, NotificationPreference>(\n async (payload?: NotificationPreference) =>\n (await notificationPreferencesClient.updatePreferences(payload!)) as NotificationPreference,\n options\n )\n\n return { mutate, updatePreferences: mutate, isLoading }\n}\n","import { getPreferences, updatePreferences } from '../features/notifications/api/preferences'\n\n/** Portal client notification preferences (email product announcements / job errors). */\nexport const notificationsApi = {\n getPreferences,\n updatePreferences\n}\n","import { authApi } from './nested-auth-api'\nimport { crmApi } from './nested-crm-api'\nimport { navigationApi } from './navigation-api'\nimport { accountsApi } from './nested-accounts-api'\nimport { mobileApi } from './nested-mobile-api'\nimport { notificationsApi } from './nested-notifications-api'\n\n/** Public API — nested domains only (SDK 4.0). */\nexport const api = {\n auth: authApi,\n crm: crmApi,\n navigation: navigationApi,\n accounts: accountsApi,\n mobile: mobileApi,\n notifications: notificationsApi\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","import type { SessionStorageAdapter } from '../storage/session-storage-adapter'\nimport { registerSessionStorageAdapter } from '../storage/session-storage-registry'\nimport { setClientType } from './client-type'\nimport { initializeHttpClient, type HttpClientConfig } from './http-client'\nimport { hydrateSessionRefreshState } from './token-store'\nimport { hydrateMfaPendingAccessToken } from '../auth/mfa-pending-token-storage'\nimport { storAccessToken } from './token-store'\nimport { hydrateUserStoreFromSession } from '../../state/crm/use-user'\n\nexport type MobileClientConfig = HttpClientConfig & {\n storage: SessionStorageAdapter\n}\n\n/**\n * Configure the SDK for native/mobile hosts: pluggable storage, client type `mobile`,\n * and `X-Client-Type: mobile` on all HTTP requests.\n */\nexport function initializeMobileClient({ storage, ...httpConfig }: MobileClientConfig): void {\n registerSessionStorageAdapter(storage)\n setClientType('mobile')\n hydrateSessionRefreshState()\n void hydrateMfaPendingAccessToken({\n lane: 'c',\n setAccessToken: (token, expiresIn) => {\n storAccessToken(token, expiresIn)\n }\n })\n hydrateUserStoreFromSession()\n initializeHttpClient({\n ...httpConfig,\n headers: {\n 'X-Client-Type': 'mobile',\n ...httpConfig.headers\n }\n })\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 { initializeMobileClient } from './core/http/mobile-client-config'\nexport type { MobileClientConfig } from './core/http/mobile-client-config'\nexport type { SessionStorageAdapter } from './core/storage/session-storage-adapter'\nexport { getClientType } from './core/http/client-type'\n\n/** Shared auth contract (client + admin consistency). */\nexport {\n AuthErrorCode,\n parseApiErrorPayload,\n getUnauthorizedPageCopy,\n resolveAuthErrorAction,\n isOptionalAuthFailureUrl,\n isSessionProbeUrl,\n persistAuthError,\n readPersistedAuthError,\n hasValidAccess,\n isFullyAuthenticated,\n isMfaPendingSession,\n hasAuthenticatedAccess,\n recoverMfaGateOnBoot,\n startVisibilityRefreshScheduler,\n stopVisibilityRefreshScheduler,\n resolveAuthRouteAction,\n storeMfaPendingAccessToken,\n readMfaPendingAccessToken,\n clearMfaPendingAccessToken,\n hydrateMfaPendingAccessToken,\n isMfaPendingAccessSession\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 MfaStorageLane,\n MfaPendingAccessToken,\n HydrateMfaPendingAccessTokenInput\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'\nexport {\n SessionRefreshDeferredError,\n SessionRefreshFailedError,\n isSessionRefreshDeferredError,\n isSessionRefreshFailedError\n} from './core/http/session-refresh-errors'\n\nexport {\n API_ERROR_DISPLAY_CONFIG,\n API_ERROR_CATEGORY_FALLBACK,\n WOODSPORTAL_API_ACTIVE_ERROR_CODES,\n buildErrorDescription,\n getApiErrorFromUnknown,\n resolveApiErrorDisplay,\n resolveApiContentState,\n isExpectedApiError\n} from './core/errors/index.js'\nexport type {\n ApiErrorVariant,\n ApiContentVariant,\n ApiErrorSeverity,\n ApiErrorDisplayConfig,\n ResolvedApiErrorDisplay,\n ResolvedApiContentState,\n ResolveApiErrorDisplayOptions\n} from './core/errors/index.js'\n\nexport { configureLogger } from './core/logging/logger'\nexport type { LogLevel, LogMeta, 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'\nexport {\n applyContractApiDate,\n getConfiguredContractApiDate,\n} from './core/utils/generateApiUrl'\n\nexport { WP_STORAGE_KEYS, WP_UI_THEME, WP_UI_TIME_ZONE, WP_UI_TIME_FORMAT, wpClientIframeRefreshKey, wpClientIframeRefreshExpKey } from './core/utils/wp-storage-keys'\nexport {\n migrateLegacyStorageKeys,\n getClientAuthCookieNamesToClear,\n clearClientSessionStorageKeys,\n clearClientIframeRefreshLocalKeys,\n clearStaleIframeRefreshForOtherHubs\n} from './core/utils/storage-migration'\nexport { clearClientAuthCookies } from './core/utils/cookie'\nexport { clearClientSdkSession, resetSessionStores } from './core/http/session-teardown'\nexport { setSessionLifecycleListener } from './core/http/token-store'\nexport { signalSessionChanged, installCrossTabSessionListener, applyCrossTabSessionRevocation } from './core/http/cross-tab-session'\nexport { configureStorageKeys, getStorageKeys, resetStorageKeysForTests } from './core/utils/storage-keys'\n\nexport {\n HUBSPOT_DEALS_OBJECT_TYPE_ID,\n HUBSPOT_TICKETS_OBJECT_TYPE_ID,\n PIPELINE_REQUIRED_MANAGED_OBJECT_TYPE_IDS,\n PIPELINE_BOARD_OBJECT_TYPE_IDS,\n isPipelineBoardObjectTypeId\n} from './core/constants/hubspot-object-type-ids'\nexport { isPipelineBoardObjectType, supportsBoardView, shouldShowPipelineSelector } from './core/constants/pipeline-ui'\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/features/accounts/client/accounts-client.ts","../src/main/api/nested-accounts-api.ts","../src/main/features/mobile/client/mobile-navigation-client.ts","../src/main/api/nested-mobile-api.ts","../src/main/features/notifications/client/notification-preferences-client.ts","../src/main/features/notifications/api/preferences.ts","../src/main/api/nested-notifications-api.ts","../src/main/api/compose-api.ts","../src/main/core/utils/datetime.ts","../src/main/core/http/mobile-client-config.ts","../src/main/index.ts"],"names":["storage","actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEO,IAAM,cAAA,GAAiB;AAAA,EAC1B,YAAA,EAAc,MAAM,UAAA,CAAW,GAAA,CAAI,cAAc,QAAQ,CAAA;AAAA,EACzD,WAAA,EAAa,CAAC,KAAA,KAAkB,UAAA,CAAW,IAAI,aAAA,CAAc,OAAA,EAAS,EAAE,KAAA,EAAO;AACnF,CAAA;;;ACFO,IAAM,WAAA,GAAc;AAAA,EACvB,cAAc,cAAA,CAAe,YAAA;AAAA,EAC7B,aAAa,cAAA,CAAe;AAChC,CAAA;;;ACJO,IAAM,sBAAA,GAAyB;AAAA,EAClC,aAAA,EAAe,MAAM,UAAA,CAAW,GAAA,CAAI,cAAA,CAAe,EAAE,KAAA,EAAO,aAAA,CAAc,iBAAA,EAAmB,CAAC,CAAA;AAAA,EAC9F,YAAA,EAAc,M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AAO,UAAA,WAAYC,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 { API_ENDPOINTS, HttpClient } from '../../../core/http/client-context'\n\nexport const accountsClient = {\n listHubspots: () => HttpClient.get(API_ENDPOINTS.HUBSPOTS),\n listPortals: (hubId: number) => HttpClient.get(API_ENDPOINTS.PORTALS, { hubId })\n}\n","import { accountsClient } from '../features/accounts/client/accounts-client'\n\n/** Client account listing (hubspots / portals) for mobile and multi-account flows. */\nexport const accountsApi = {\n listHubspots: accountsClient.listHubspots,\n listPortals: accountsClient.listPortals\n}\n","import { generateApiUrl, API_ENDPOINTS, HttpClient } from '../../../core/http/client-context'\n\nexport const mobileNavigationClient = {\n getNavigation: () => HttpClient.get(generateApiUrl({ route: API_ENDPOINTS.MOBILE_NAVIGATION })),\n getAppConfig: () => HttpClient.get(generateApiUrl({ route: API_ENDPOINTS.MOBILE_APP_CONFIG })),\n putNavigation: (payload: unknown) => HttpClient.put(generateApiUrl({ route: API_ENDPOINTS.MOBILE_NAVIGATION }), payload),\n importFromWebMenu: (payload: unknown) => HttpClient.post(generateApiUrl({ route: API_ENDPOINTS.MOBILE_NAVIGATION_IMPORT_WEB_MENU }), payload)\n}\n","import { mobileNavigationClient } from '../features/mobile/client/mobile-navigation-client'\n\n/** Mobile-specific API surface (navigation config, etc.). */\nexport const mobileApi = {\n getNavigation: mobileNavigationClient.getNavigation,\n getAppConfig: mobileNavigationClient.getAppConfig,\n putNavigation: mobileNavigationClient.putNavigation,\n importFromWebMenu: mobileNavigationClient.importFromWebMenu\n}\n","import { generateApiUrl, API_ENDPOINTS, HttpClient } from '../../../core/http/client-context'\nimport type { NotificationPreference } from '../../../core/types/notification'\n\nexport const notificationPreferencesClient = {\n getPreferences: () =>\n HttpClient.get<NotificationPreference>(generateApiUrl({ route: API_ENDPOINTS.NOTIFICATION_PREFERENCES })),\n updatePreferences: (payload: NotificationPreference) =>\n HttpClient.put<NotificationPreference>(\n generateApiUrl({ route: API_ENDPOINTS.NOTIFICATION_PREFERENCES }),\n payload\n )\n}\n","import { createMutation } from '../../../core/mutation/createMutation'\nimport type { MutationOptions } from '../../../core/types'\nimport type { NotificationPreference } from '../../../core/types/notification'\nimport { notificationPreferencesClient } from '../client/notification-preferences-client'\n\n/**\n * Load the signed-in portal user's email notification preferences.\n *\n * **API:** `GET /api/{hubId}/{portalId}/notification-preferences`\n * **Auth:** Bearer portal client JWT (`PROFILE_READ`).\n * **Defaults:** both flags `true` until the user saves.\n */\nexport function getPreferences(options?: MutationOptions<NotificationPreference, any>) {\n const { mutate, isLoading } = createMutation<void, NotificationPreference>(\n async () => (await notificationPreferencesClient.getPreferences()) as NotificationPreference,\n options\n )\n\n return { mutate, getPreferences: mutate, isLoading }\n}\n\n/**\n * Upsert email notification preferences for the signed-in portal user.\n *\n * **API:** `PUT /api/{hubId}/{portalId}/notification-preferences`\n * **Auth:** Bearer portal client JWT (`PROFILE_WRITE`).\n * **Body:** `{ emailProductAnnouncements, emailJobErrors }` (both required booleans).\n */\nexport function updatePreferences(options?: MutationOptions<NotificationPreference, any>) {\n const { mutate, isLoading } = createMutation<NotificationPreference, NotificationPreference>(\n async (payload?: NotificationPreference) =>\n (await notificationPreferencesClient.updatePreferences(payload!)) as NotificationPreference,\n options\n )\n\n return { mutate, updatePreferences: mutate, isLoading }\n}\n","import { getPreferences, updatePreferences } from '../features/notifications/api/preferences'\n\n/** Portal client notification preferences (email product announcements / job errors). */\nexport const notificationsApi = {\n getPreferences,\n updatePreferences\n}\n","import { authApi } from './nested-auth-api'\nimport { crmApi } from './nested-crm-api'\nimport { navigationApi } from './navigation-api'\nimport { accountsApi } from './nested-accounts-api'\nimport { mobileApi } from './nested-mobile-api'\nimport { notificationsApi } from './nested-notifications-api'\n\n/** Public API — nested domains only (SDK 4.0). */\nexport const api = {\n auth: authApi,\n crm: crmApi,\n navigation: navigationApi,\n accounts: accountsApi,\n mobile: mobileApi,\n notifications: notificationsApi\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","import type { SessionStorageAdapter } from '../storage/session-storage-adapter'\nimport { registerSessionStorageAdapter } from '../storage/session-storage-registry'\nimport { setClientType } from './client-type'\nimport { initializeHttpClient, type HttpClientConfig } from './http-client'\nimport { hydrateSessionRefreshState } from './token-store'\nimport { hydrateMfaPendingAccessToken } from '../auth/mfa-pending-token-storage'\nimport { storAccessToken } from './token-store'\nimport { hydrateUserStoreFromSession } from '../../state/crm/use-user'\n\nexport type MobileClientConfig = HttpClientConfig & {\n storage: SessionStorageAdapter\n}\n\n/**\n * Configure the SDK for native/mobile hosts: pluggable storage, client type `mobile`,\n * and `X-Client-Type: mobile` on all HTTP requests.\n */\nexport function initializeMobileClient({ storage, ...httpConfig }: MobileClientConfig): void {\n registerSessionStorageAdapter(storage)\n setClientType('mobile')\n hydrateSessionRefreshState()\n void hydrateMfaPendingAccessToken({\n lane: 'c',\n setAccessToken: (token, expiresIn) => {\n storAccessToken(token, expiresIn)\n }\n })\n hydrateUserStoreFromSession()\n initializeHttpClient({\n ...httpConfig,\n headers: {\n 'X-Client-Type': 'mobile',\n ...httpConfig.headers\n }\n })\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 purgeCrmAssociationCaches,\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, AssociationCachePurgeOptions } 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 { initializeMobileClient } from './core/http/mobile-client-config'\nexport type { MobileClientConfig } from './core/http/mobile-client-config'\nexport type { SessionStorageAdapter } from './core/storage/session-storage-adapter'\nexport { getClientType } from './core/http/client-type'\n\n/** Shared auth contract (client + admin consistency). */\nexport {\n AuthErrorCode,\n parseApiErrorPayload,\n getUnauthorizedPageCopy,\n resolveAuthErrorAction,\n isOptionalAuthFailureUrl,\n isSessionProbeUrl,\n persistAuthError,\n readPersistedAuthError,\n hasValidAccess,\n isFullyAuthenticated,\n isMfaPendingSession,\n hasAuthenticatedAccess,\n recoverMfaGateOnBoot,\n startVisibilityRefreshScheduler,\n stopVisibilityRefreshScheduler,\n resolveAuthRouteAction,\n storeMfaPendingAccessToken,\n readMfaPendingAccessToken,\n clearMfaPendingAccessToken,\n hydrateMfaPendingAccessToken,\n isMfaPendingAccessSession\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 MfaStorageLane,\n MfaPendingAccessToken,\n HydrateMfaPendingAccessTokenInput\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'\nexport {\n SessionRefreshDeferredError,\n SessionRefreshFailedError,\n isSessionRefreshDeferredError,\n isSessionRefreshFailedError\n} from './core/http/session-refresh-errors'\n\nexport {\n API_ERROR_DISPLAY_CONFIG,\n API_ERROR_CATEGORY_FALLBACK,\n WOODSPORTAL_API_ACTIVE_ERROR_CODES,\n buildErrorDescription,\n getApiErrorFromUnknown,\n resolveApiErrorDisplay,\n resolveApiContentState,\n isExpectedApiError\n} from './core/errors/index.js'\nexport type {\n ApiErrorVariant,\n ApiContentVariant,\n ApiErrorSeverity,\n ApiErrorDisplayConfig,\n ResolvedApiErrorDisplay,\n ResolvedApiContentState,\n ResolveApiErrorDisplayOptions\n} from './core/errors/index.js'\n\nexport { configureLogger } from './core/logging/logger'\nexport type { LogLevel, LogMeta, 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'\nexport {\n applyContractApiDate,\n getConfiguredContractApiDate,\n} from './core/utils/generateApiUrl'\n\nexport { WP_STORAGE_KEYS, WP_UI_THEME, WP_UI_TIME_ZONE, WP_UI_TIME_FORMAT, wpClientIframeRefreshKey, wpClientIframeRefreshExpKey } from './core/utils/wp-storage-keys'\nexport {\n migrateLegacyStorageKeys,\n getClientAuthCookieNamesToClear,\n clearClientSessionStorageKeys,\n clearClientIframeRefreshLocalKeys,\n clearStaleIframeRefreshForOtherHubs\n} from './core/utils/storage-migration'\nexport { clearClientAuthCookies } from './core/utils/cookie'\nexport { clearClientSdkSession, resetSessionStores } from './core/http/session-teardown'\nexport { setSessionLifecycleListener } from './core/http/token-store'\nexport { signalSessionChanged, installCrossTabSessionListener, applyCrossTabSessionRevocation } from './core/http/cross-tab-session'\nexport { configureStorageKeys, getStorageKeys, resetStorageKeysForTests } from './core/utils/storage-keys'\n\nexport {\n HUBSPOT_DEALS_OBJECT_TYPE_ID,\n HUBSPOT_TICKETS_OBJECT_TYPE_ID,\n PIPELINE_REQUIRED_MANAGED_OBJECT_TYPE_IDS,\n PIPELINE_BOARD_OBJECT_TYPE_IDS,\n isPipelineBoardObjectTypeId\n} from './core/constants/hubspot-object-type-ids'\nexport { isPipelineBoardObjectType, supportsBoardView, shouldShowPipelineSelector } from './core/constants/pipeline-ui'\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.1.2-dev.
|
|
3
|
+
"version": "4.1.2-dev.2",
|
|
4
4
|
"packageManager": "pnpm@10.12.1",
|
|
5
5
|
"description": "Official TypeScript/JavaScript SDK for WoodsPortal API - Authentication, user management, pipelines, and more",
|
|
6
6
|
"type": "module",
|