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.
Files changed (33) hide show
  1. package/dist/adapters/angular/index.js +3 -3
  2. package/dist/adapters/native/index.js +4 -4
  3. package/dist/adapters/react/index.js +4 -4
  4. package/dist/adapters/vue/index.js +3 -3
  5. package/dist/{chunk-WJBWIUQM.js → chunk-3VH52USP.js} +4 -4
  6. package/dist/{chunk-WJBWIUQM.js.map → chunk-3VH52USP.js.map} +1 -1
  7. package/dist/{chunk-XQAVHI2F.js → chunk-7XZSJGCX.js} +3 -3
  8. package/dist/{chunk-XQAVHI2F.js.map → chunk-7XZSJGCX.js.map} +1 -1
  9. package/dist/{chunk-JZ5BNYYH.js → chunk-NJIMZXP4.js} +5 -5
  10. package/dist/{chunk-JZ5BNYYH.js.map → chunk-NJIMZXP4.js.map} +1 -1
  11. package/dist/{chunk-JWEA5HWX.js → chunk-T553DXBI.js} +4 -4
  12. package/dist/{chunk-JWEA5HWX.js.map → chunk-T553DXBI.js.map} +1 -1
  13. package/dist/{chunk-YGSPLKDC.js → chunk-UFQW7TDL.js} +4 -4
  14. package/dist/{chunk-YGSPLKDC.js.map → chunk-UFQW7TDL.js.map} +1 -1
  15. package/dist/{chunk-JEQNFCQP.js → chunk-USEVXBRI.js} +91 -22
  16. package/dist/chunk-USEVXBRI.js.map +1 -0
  17. package/dist/{chunk-ZZCYSW32.js → chunk-X6NNUGP7.js} +3 -3
  18. package/dist/chunk-X6NNUGP7.js.map +1 -0
  19. package/dist/{chunk-F43GSZXK.js → chunk-YKA26CVL.js} +3 -3
  20. package/dist/{chunk-F43GSZXK.js.map → chunk-YKA26CVL.js.map} +1 -1
  21. package/dist/{cache-purge-CokkqLSk.d.ts → crmCacheRefresh-B9sAQzI7.d.ts} +31 -1
  22. package/dist/{cross-tab-session-VAOXHEZL.js → cross-tab-session-VJBW7BK6.js} +5 -5
  23. package/dist/{cross-tab-session-VAOXHEZL.js.map → cross-tab-session-VJBW7BK6.js.map} +1 -1
  24. package/dist/entries/auth.js +4 -4
  25. package/dist/entries/crm.d.ts +2 -2
  26. package/dist/entries/crm.js +7 -6
  27. package/dist/entries/crm.js.map +1 -1
  28. package/dist/index.d.ts +25 -47
  29. package/dist/index.js +10 -10
  30. package/dist/index.js.map +1 -1
  31. package/package.json +1 -1
  32. package/dist/chunk-JEQNFCQP.js.map +0 -1
  33. package/dist/chunk-ZZCYSW32.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { getParamDetails, getRouteDetails, updateLink, getParam, decodeToBase64, generatePath, getPath, getRouteMenu, tableUiActions, ticketHubspotObjectTypeId, makePreviewParams, tableStore, actions2, userStore, isPipelineBoardObjectTypeId, tableUiStore, fileStore, actions7, emailStore, actions5, noteStore, actions4, resetAllStore, breadcrumbStage, isMessingParentLastItem, isMessingParent, generateUrl } from './chunk-ZZCYSW32.js';
1
+ import { getParamDetails, getRouteDetails, updateLink, getParam, decodeToBase64, generatePath, getPath, getRouteMenu, tableUiActions, ticketHubspotObjectTypeId, makePreviewParams, tableStore, actions2, userStore, isPipelineBoardObjectTypeId, tableUiStore, fileStore, actions7, emailStore, actions5, noteStore, actions4, resetAllStore, breadcrumbStage, isMessingParentLastItem, isMessingParent, generateUrl } from './chunk-X6NNUGP7.js';
2
2
  import { getRuntimeHttpClientApiDate, config, configureLogger, setIframeStorageMode, setRefreshBufferSeconds, setRefreshCallback, hydrateSessionRefreshState, logger, isHttpTracingEnabled, getAccessToken, sanitizeAxiosErrorData, classifyRefreshHttpError, shouldLogoutAfterRefreshFailure, setRefreshToken, storAccessToken, classifyRefreshResponseWithoutToken, storage, HUBSPOT_DATA, setRuntimeHttpClientHubContext, isServiceUnavailableError, refreshSession, ensureValidRefresh, HUB_ID, DEV_PORTAL_ID, PORTAL_ID, DEV_API_URL, isAccessTokenExpired } from './chunk-JVJMM4SZ.js';
3
3
  import { getClientType, configureStorageKeys } from './chunk-32ERSTFY.js';
4
4
  import { AuthErrorCode } from './chunk-COHBSTHF.js';
@@ -517,7 +517,7 @@ function initializeHttpClient(clientConfig) {
517
517
  migrateLegacyStorageKeys();
518
518
  }).catch(() => {
519
519
  });
520
- void import('./cross-tab-session-VAOXHEZL.js').then(({ installCrossTabSessionListener }) => {
520
+ void import('./cross-tab-session-VJBW7BK6.js').then(({ installCrossTabSessionListener }) => {
521
521
  installCrossTabSessionListener();
522
522
  }).catch(() => {
523
523
  });
@@ -1666,6 +1666,49 @@ async function purgeEngagementCachesInternal(options) {
1666
1666
  pollIntervalMs: options.pollIntervalMs
1667
1667
  });
1668
1668
  }
1669
+ async function purgeCrmAssociationCaches(options) {
1670
+ const parentObjectTypeId = options.parentObjectTypeId?.trim();
1671
+ const parentRecordId = options.parentRecordId?.trim();
1672
+ if (!parentObjectTypeId || !parentRecordId) {
1673
+ return {
1674
+ ok: false,
1675
+ errorCode: "VALIDATION",
1676
+ message: "parentObjectTypeId and parentRecordId are required"
1677
+ };
1678
+ }
1679
+ const childIds = [
1680
+ ...options.childObjectTypeIds ?? [],
1681
+ ...options.objectTypeId ? [options.objectTypeId] : []
1682
+ ].map((id) => String(id).trim()).filter((id, index, all) => id.length > 0 && all.indexOf(id) === index);
1683
+ const parentListQuery = {
1684
+ ...options.listQuery ?? { page: 1, limit: 10, view: "LIST" },
1685
+ parentObjectTypeId,
1686
+ parentObjectRecordId: parentRecordId
1687
+ };
1688
+ const listTargets = childIds.flatMap(
1689
+ (childId) => options.postCrmWrite ? buildPostWriteListPurgeTargets(childId, parentListQuery, options.recordIds) : [buildCrmListPurgeTarget(childId, parentListQuery, options.recordIds)]
1690
+ );
1691
+ const singleTarget = buildCrmSinglePurgeTarget(parentObjectTypeId, [parentRecordId], parentListQuery);
1692
+ const engagementViews = options.engagementViews?.filter(Boolean) ?? [];
1693
+ const engagementTargets = engagementViews.length > 0 ? [
1694
+ buildEngagementPurgeTarget(parentObjectTypeId, [parentRecordId], engagementViews, {
1695
+ listQuery: parentListQuery,
1696
+ fileIds: options.fileIds,
1697
+ engagementItemIds: options.engagementItemIds
1698
+ })
1699
+ ] : [];
1700
+ if (listTargets.length === 0 && engagementTargets.length === 0) {
1701
+ return purgeCrmCombined({
1702
+ ...options,
1703
+ targets: [singleTarget]
1704
+ });
1705
+ }
1706
+ return purgeCrmCombined({
1707
+ ...options,
1708
+ objectTypeId: childIds[0] ?? parentObjectTypeId,
1709
+ targets: mergePurgeTargets(...listTargets, singleTarget, ...engagementTargets)
1710
+ });
1711
+ }
1669
1712
  async function purgeCrmCombined(options) {
1670
1713
  const request = buildCachePurgeRequest(options.targets, {
1671
1714
  mode: options.mode,
@@ -1781,7 +1824,7 @@ var recordWriteContext = (paramsObject) => {
1781
1824
  });
1782
1825
  return Object.keys(context).length > 0 ? context : void 0;
1783
1826
  };
1784
- var triggerPostWriteListPurge = (props) => {
1827
+ var triggerPostWriteListPurge = async (props) => {
1785
1828
  const objectTypeId = props.hubspotObjectTypeId;
1786
1829
  if (!objectTypeId) {
1787
1830
  return;
@@ -1790,22 +1833,40 @@ var triggerPostWriteListPurge = (props) => {
1790
1833
  return;
1791
1834
  }
1792
1835
  const { queryParams, multiObjectsQueryParams } = tableStore.getState();
1836
+ const writeContext = recordWriteContext(props.paramsObject);
1793
1837
  const listQuery = resolveCrmListPurgeQuery({
1794
1838
  componentName: props.componentName,
1795
1839
  hubspotObjectTypeId: objectTypeId,
1796
1840
  tableQueryParams: queryParams,
1797
1841
  multiObjectsQueryParams,
1798
- writeContext: recordWriteContext(props.paramsObject)
1842
+ writeContext
1799
1843
  });
1800
1844
  const recordIds = props.recordId ? [String(props.recordId)] : void 0;
1801
- void purgeCrmListCacheAfterCrmWrite({
1802
- objectTypeId: String(objectTypeId),
1803
- listQuery,
1804
- recordIds,
1805
- waitForWarm: true,
1806
- pollTimeoutMs: 45e3
1807
- }).catch(() => {
1808
- });
1845
+ const parentObjectTypeId = writeContext?.parentObjectTypeId;
1846
+ const parentRecordId = writeContext?.parentObjectRecordId;
1847
+ try {
1848
+ if (parentObjectTypeId && parentRecordId) {
1849
+ await purgeCrmAssociationCaches({
1850
+ objectTypeId: String(objectTypeId),
1851
+ parentObjectTypeId,
1852
+ parentRecordId,
1853
+ listQuery,
1854
+ recordIds,
1855
+ postCrmWrite: true,
1856
+ waitForWarm: true,
1857
+ pollTimeoutMs: 45e3
1858
+ });
1859
+ return;
1860
+ }
1861
+ await purgeCrmListCacheAfterCrmWrite({
1862
+ objectTypeId: String(objectTypeId),
1863
+ listQuery,
1864
+ recordIds,
1865
+ waitForWarm: true,
1866
+ pollTimeoutMs: 45e3
1867
+ });
1868
+ } catch {
1869
+ }
1809
1870
  };
1810
1871
  var mergeRecordWriteBody = (payload, paramsObject, options) => {
1811
1872
  const base = { ...payload || {} };
@@ -2097,13 +2158,21 @@ var crmClient = {
2097
2158
  });
2098
2159
  const apiUrl = generateApiUrl({ route: API_ENDPOINTS.RECORDS_CREATE, params, queryParams });
2099
2160
  const response = await HttpClient.post(apiUrl, body);
2100
- if (props?.componentName !== "sidebarAssociation") {
2101
- triggerPostWriteListPurge({
2102
- hubspotObjectTypeId: props?.params?.hubspotObjectTypeId,
2103
- componentName: props?.componentName,
2104
- paramsObject,
2105
- recordId: extractHubspotRecordIdFromWriteResponse(response)
2106
- });
2161
+ const writeParams = {
2162
+ ...paramsObject,
2163
+ ...props?.queryParams && typeof props.queryParams === "object" ? props.queryParams : {},
2164
+ ...props?.params && typeof props.params === "object" ? props.params : {}
2165
+ };
2166
+ const purgeArgs = {
2167
+ hubspotObjectTypeId: props?.params?.hubspotObjectTypeId,
2168
+ componentName: props?.componentName,
2169
+ paramsObject: writeParams,
2170
+ recordId: extractHubspotRecordIdFromWriteResponse(response)
2171
+ };
2172
+ if (props?.componentName === "sidebarAssociation") {
2173
+ await triggerPostWriteListPurge(purgeArgs);
2174
+ } else {
2175
+ void triggerPostWriteListPurge(purgeArgs);
2107
2176
  }
2108
2177
  return response;
2109
2178
  },
@@ -2662,6 +2731,6 @@ function createMutation(mutationFn, options) {
2662
2731
  };
2663
2732
  }
2664
2733
 
2665
- export { API_ENDPOINTS, Client, HttpClient, applyContractApiDate, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, createCachePurgeJob, createMutation, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, generateApiUrl, getAuthRefreshToken, getConfiguredContractApiDate, getFieldErrors, getFormErrors, initializeHttpClient, mergePurgeTargets, navigationApi, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, resolveListTableParams, setEditorPreviewMockHandler, startVisibilityRefreshScheduler, stopVisibilityRefreshScheduler, toCachePurgeListQuery };
2666
- //# sourceMappingURL=chunk-JEQNFCQP.js.map
2667
- //# sourceMappingURL=chunk-JEQNFCQP.js.map
2734
+ export { API_ENDPOINTS, Client, HttpClient, applyContractApiDate, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, createCachePurgeJob, createMutation, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, generateApiUrl, getAuthRefreshToken, getConfiguredContractApiDate, getFieldErrors, getFormErrors, initializeHttpClient, mergePurgeTargets, navigationApi, purgeCrmAssociationCaches, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, resolveListTableParams, setEditorPreviewMockHandler, startVisibilityRefreshScheduler, stopVisibilityRefreshScheduler, toCachePurgeListQuery };
2735
+ //# sourceMappingURL=chunk-USEVXBRI.js.map
2736
+ //# sourceMappingURL=chunk-USEVXBRI.js.map