woodsportal-client-sdk 4.0.7-dev.0 → 4.0.7-dev.10

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 (60) hide show
  1. package/dist/adapters/angular/index.js +6 -6
  2. package/dist/adapters/react/index.js +6 -6
  3. package/dist/adapters/vue/index.js +6 -6
  4. package/dist/auth-interceptor-policy-CKXBTGBT.js +5 -0
  5. package/dist/{auth-interceptor-policy-BSY5KIIA.js.map → auth-interceptor-policy-CKXBTGBT.js.map} +1 -1
  6. package/dist/auth-utils-LT4JXJER.js +5 -0
  7. package/dist/{auth-utils-XIHNYE63.js.map → auth-utils-LT4JXJER.js.map} +1 -1
  8. package/dist/{chunk-ADOV2R3A.js → chunk-5NONTYJA.js} +237 -11
  9. package/dist/chunk-5NONTYJA.js.map +1 -0
  10. package/dist/{chunk-YOT5RW3R.js → chunk-6XIX6R4X.js} +8 -5
  11. package/dist/chunk-6XIX6R4X.js.map +1 -0
  12. package/dist/{chunk-7OGXVANB.js → chunk-AR6QQMVD.js} +4 -4
  13. package/dist/{chunk-7OGXVANB.js.map → chunk-AR6QQMVD.js.map} +1 -1
  14. package/dist/{chunk-OF5OLEE5.js → chunk-DKWFLCSO.js} +3 -3
  15. package/dist/{chunk-OF5OLEE5.js.map → chunk-DKWFLCSO.js.map} +1 -1
  16. package/dist/{chunk-U66LWTVC.js → chunk-JKB2SWUN.js} +62 -10
  17. package/dist/chunk-JKB2SWUN.js.map +1 -0
  18. package/dist/{chunk-4IKGBHFJ.js → chunk-JVM47MG5.js} +82 -31
  19. package/dist/chunk-JVM47MG5.js.map +1 -0
  20. package/dist/{chunk-WNBF6FKG.js → chunk-PQQSIYD3.js} +19 -8
  21. package/dist/chunk-PQQSIYD3.js.map +1 -0
  22. package/dist/{chunk-DZC3DJUO.js → chunk-PRGN3FF6.js} +13 -4
  23. package/dist/chunk-PRGN3FF6.js.map +1 -0
  24. package/dist/{chunk-GVXA7OKY.js → chunk-QIM5H7OG.js} +23 -6
  25. package/dist/chunk-QIM5H7OG.js.map +1 -0
  26. package/dist/{chunk-6ROV3EE2.js → chunk-UDAPRD7Z.js} +16 -5
  27. package/dist/chunk-UDAPRD7Z.js.map +1 -0
  28. package/dist/{chunk-J33YFZCS.js → chunk-XIKYPNO5.js} +8 -7
  29. package/dist/chunk-XIKYPNO5.js.map +1 -0
  30. package/dist/cross-tab-session-WEIUJDZN.js +9 -0
  31. package/dist/{cross-tab-session-OJKWJSNT.js.map → cross-tab-session-WEIUJDZN.js.map} +1 -1
  32. package/dist/entries/auth.d.ts +5 -2
  33. package/dist/entries/auth.js +8 -8
  34. package/dist/entries/auth.js.map +1 -1
  35. package/dist/entries/crm.d.ts +2 -2
  36. package/dist/entries/crm.js +9 -7
  37. package/dist/entries/crm.js.map +1 -1
  38. package/dist/{http-errors-_XPPqJ_a.d.ts → http-errors-CCCQECil.d.ts} +21 -2
  39. package/dist/index.d.ts +18 -4
  40. package/dist/index.js +15 -13
  41. package/dist/index.js.map +1 -1
  42. package/dist/{cache-purge-Ca4idzyy.d.ts → pipeline-ui-DbEzI_v1.d.ts} +13 -1
  43. package/dist/storage-migration-2NVJ3GNQ.js +4 -0
  44. package/dist/{storage-migration-OCOML7VA.js.map → storage-migration-2NVJ3GNQ.js.map} +1 -1
  45. package/package.json +1 -1
  46. package/dist/auth-interceptor-policy-BSY5KIIA.js +0 -5
  47. package/dist/auth-utils-XIHNYE63.js +0 -5
  48. package/dist/chunk-4IKGBHFJ.js.map +0 -1
  49. package/dist/chunk-6ROV3EE2.js.map +0 -1
  50. package/dist/chunk-ADOV2R3A.js.map +0 -1
  51. package/dist/chunk-DZC3DJUO.js.map +0 -1
  52. package/dist/chunk-GVXA7OKY.js.map +0 -1
  53. package/dist/chunk-J33YFZCS.js.map +0 -1
  54. package/dist/chunk-U66LWTVC.js.map +0 -1
  55. package/dist/chunk-WNBF6FKG.js.map +0 -1
  56. package/dist/chunk-YOT5RW3R.js.map +0 -1
  57. package/dist/cross-tab-session-OJKWJSNT.js +0 -9
  58. package/dist/refresh-lock-UW5RRRTD.js +0 -72
  59. package/dist/refresh-lock-UW5RRRTD.js.map +0 -1
  60. package/dist/storage-migration-OCOML7VA.js +0 -4
@@ -1,7 +1,7 @@
1
- import { getParamDetails, getRouteDetails, updateLink, getParam, decodeToBase64, generatePath, getPath, getRouteMenu, tableUiActions, ticketHubspotObjectTypeId, tableStore, actions2, userStore, fileStore, actions7, emailStore, actions5, noteStore, actions4, tableUiStore, resetAllStore, breadcrumbStage, isMessingParentLastItem, isMessingParent, generateUrl } from './chunk-U66LWTVC.js';
2
- import { configureLogger, setIframeStorageMode, setRefreshBufferSeconds, config, setRefreshCallback, isHttpTracingEnabled, logger, getAccessToken, sanitizeAxiosErrorData, setRefreshToken, storAccessToken, storage, HUBSPOT_DATA, setRuntimeHttpClientHubContext, refreshSession, ensureValidRefresh, HUB_ID, DEV_PORTAL_ID, DEV_API_URL, isAccessTokenExpired } from './chunk-ADOV2R3A.js';
1
+ import { getParamDetails, getRouteDetails, updateLink, getParam, decodeToBase64, generatePath, getPath, getRouteMenu, tableUiActions, ticketHubspotObjectTypeId, tableStore, makePreviewParams, actions2, userStore, isPipelineBoardObjectTypeId, fileStore, actions7, emailStore, actions5, noteStore, actions4, tableUiStore, resetAllStore, breadcrumbStage, isMessingParentLastItem, isMessingParent, generateUrl } from './chunk-JKB2SWUN.js';
2
+ import { configureLogger, setIframeStorageMode, setRefreshBufferSeconds, config, setRefreshCallback, hydrateSessionRefreshState, isHttpTracingEnabled, logger, getAccessToken, sanitizeAxiosErrorData, setRefreshToken, storAccessToken, storage, HUBSPOT_DATA, setRuntimeHttpClientHubContext, refreshSession, ensureValidRefresh, HUB_ID, DEV_PORTAL_ID, DEV_API_URL, isAccessTokenExpired } from './chunk-5NONTYJA.js';
3
3
  import { AuthErrorCode } from './chunk-COHBSTHF.js';
4
- import { configureStorageKeys } from './chunk-YOT5RW3R.js';
4
+ import { configureStorageKeys } from './chunk-6XIX6R4X.js';
5
5
  import axios2 from 'axios';
6
6
 
7
7
  // src/main/core/http/visibility-refresh-scheduler.ts
@@ -358,7 +358,7 @@ async function handleAuthHttpError(error, axiosInstanceRef) {
358
358
  return Promise.reject(error);
359
359
  }
360
360
  const { parseApiErrorPayload } = await import('./auth-error-codes-D7CXVBEN.js');
361
- const { persistAuthError, resolveAuthErrorAction } = await import('./auth-interceptor-policy-BSY5KIIA.js');
361
+ const { persistAuthError, resolveAuthErrorAction } = await import('./auth-interceptor-policy-CKXBTGBT.js');
362
362
  const reqConfig = error.config;
363
363
  const payload = parseApiErrorPayload(error.response.data);
364
364
  const action = resolveAuthErrorAction({
@@ -373,6 +373,9 @@ async function handleAuthHttpError(error, axiosInstanceRef) {
373
373
  return Promise.reject(error);
374
374
  }
375
375
  if (action.kind === "refresh_retry") {
376
+ if (isRefreshCallbackInFlight()) {
377
+ return Promise.reject(error);
378
+ }
376
379
  try {
377
380
  await refreshSession({ force: true });
378
381
  } catch {
@@ -437,10 +440,10 @@ function initializeHttpClient(clientConfig) {
437
440
  if (clientConfig.storageKeys != null) {
438
441
  configureStorageKeys(clientConfig.storageKeys);
439
442
  }
440
- void import('./storage-migration-OCOML7VA.js').then(({ migrateLegacyStorageKeys }) => {
443
+ void import('./storage-migration-2NVJ3GNQ.js').then(({ migrateLegacyStorageKeys }) => {
441
444
  migrateLegacyStorageKeys();
442
445
  });
443
- void import('./cross-tab-session-OJKWJSNT.js').then(({ installCrossTabSessionListener }) => {
446
+ void import('./cross-tab-session-WEIUJDZN.js').then(({ installCrossTabSessionListener }) => {
444
447
  installCrossTabSessionListener();
445
448
  });
446
449
  setIframeStorageMode(clientConfig.storageMode === "iframe");
@@ -464,6 +467,7 @@ function initializeHttpClient(clientConfig) {
464
467
  }
465
468
  });
466
469
  setRefreshCallback(getAuthRefreshToken);
470
+ hydrateSessionRefreshState();
467
471
  axiosInstance.interceptors.request.use(async (requestConfig) => {
468
472
  const previewMock = await resolveEditorPreviewMock(requestConfig);
469
473
  if (previewMock) {
@@ -635,6 +639,10 @@ async function postRefreshCookie(headers) {
635
639
  skipGlobalAuthRedirect: true
636
640
  });
637
641
  }
642
+ var refreshCallbackInFlight = false;
643
+ function isRefreshCallbackInFlight() {
644
+ return refreshCallbackInFlight;
645
+ }
638
646
  function clearSessionAfterRefreshFailure() {
639
647
  if (isEditorPreviewMockActive()) {
640
648
  return;
@@ -645,6 +653,7 @@ function clearSessionAfterRefreshFailure() {
645
653
  void config3.onLogout?.();
646
654
  }
647
655
  async function getAuthRefreshToken(refreshToken) {
656
+ refreshCallbackInFlight = true;
648
657
  try {
649
658
  const headers = {};
650
659
  if (config.devPortalId) {
@@ -675,7 +684,10 @@ async function getAuthRefreshToken(refreshToken) {
675
684
  route: API_ENDPOINTS.AUTH_REFRESH,
676
685
  queryParams: { hubId: config.hubId }
677
686
  });
678
- response = await getAxiosInstance().post(apiUrl, { refreshToken }, { headers });
687
+ response = await getAxiosInstance().post(apiUrl, { refreshToken }, {
688
+ headers,
689
+ skipGlobalAuthRedirect: true
690
+ });
679
691
  }
680
692
  const maybeData = response?.data?.data || response?.data;
681
693
  const tokenData = maybeData?.tokenData || maybeData || {};
@@ -704,6 +716,8 @@ async function getAuthRefreshToken(refreshToken) {
704
716
  logger.error("auth", error, { operation: "token refresh" });
705
717
  clearSessionAfterRefreshFailure();
706
718
  return { token: null, success: false };
719
+ } finally {
720
+ refreshCallbackInFlight = false;
707
721
  }
708
722
  }
709
723
 
@@ -1187,18 +1201,11 @@ function applyBoardPaginationToParams(param, tableParams) {
1187
1201
  }
1188
1202
  return param;
1189
1203
  }
1190
- function finalizeBoardListQueryParams(param, context) {
1204
+ function finalizeBoardListQueryParams(param, _context) {
1191
1205
  const { stageId, nextPage, view, selectedPipeline } = tableUiStore.getState();
1192
- const payload = context?.payload;
1193
1206
  if (view) {
1194
1207
  param.view = view;
1195
1208
  }
1196
- const ticketPipelineContext = payload?.isHome && payload?.hubspotObjectTypeId === "0-5" || payload?.componentName === "object" && payload?.hubspotObjectTypeId === "0-5";
1197
- if (ticketPipelineContext && !param?.isPrimaryCompany) {
1198
- param.parentObjectTypeId = "0-1";
1199
- } else if (ticketPipelineContext && param?.isPrimaryCompany) {
1200
- param.parentObjectTypeId = "0-2";
1201
- }
1202
1209
  if (selectedPipeline !== void 0 && selectedPipeline !== null && selectedPipeline !== "") {
1203
1210
  param.filterValue = selectedPipeline;
1204
1211
  }
@@ -1337,6 +1344,20 @@ function expandListPurgeQueriesForCrmWrite(base) {
1337
1344
  }
1338
1345
  return expanded;
1339
1346
  }
1347
+ function applyFilterValueFromPipelineState(query) {
1348
+ if (query.filterValue) {
1349
+ return query;
1350
+ }
1351
+ const { filterPropertyName, filterOperator } = query;
1352
+ if (!filterPropertyName || !filterOperator) {
1353
+ return query;
1354
+ }
1355
+ const selectedPipeline = tableUiStore.getState().selectedPipeline;
1356
+ if (!selectedPipeline) {
1357
+ return query;
1358
+ }
1359
+ return { ...query, filterValue: selectedPipeline };
1360
+ }
1340
1361
  function resolveCrmListPurgeQuery(options) {
1341
1362
  let raw;
1342
1363
  if (options.componentName === "sidebarTable" && options.hubspotObjectTypeId) {
@@ -1347,14 +1368,15 @@ function resolveCrmListPurgeQuery(options) {
1347
1368
  if (!hasPurgeFilterContext(raw)) {
1348
1369
  raw = mergeLiveTableUiState(raw);
1349
1370
  }
1350
- const base = toCachePurgeListQuery(raw ?? void 0);
1371
+ let base = applyFilterValueFromPipelineState(toCachePurgeListQuery(raw ?? void 0));
1351
1372
  if (!options.writeContext || Object.keys(options.writeContext).length === 0) {
1352
1373
  return base;
1353
1374
  }
1354
- return {
1375
+ base = {
1355
1376
  ...base,
1356
1377
  ...options.writeContext
1357
1378
  };
1379
+ return applyFilterValueFromPipelineState(base);
1358
1380
  }
1359
1381
 
1360
1382
  // src/main/core/utils/cache/crmCacheRefresh.ts
@@ -1409,7 +1431,9 @@ async function purgeCrmListCache(options) {
1409
1431
  });
1410
1432
  return createCachePurgeJob(request, {
1411
1433
  idempotencyKey: options.idempotencyKey,
1412
- waitForWarm: options.waitForWarm
1434
+ waitForWarm: options.waitForWarm,
1435
+ pollTimeoutMs: options.pollTimeoutMs,
1436
+ pollIntervalMs: options.pollIntervalMs
1413
1437
  });
1414
1438
  }
1415
1439
  async function purgeCrmRecordCache(options) {
@@ -1430,7 +1454,9 @@ async function purgeCrmRecordCache(options) {
1430
1454
  });
1431
1455
  return createCachePurgeJob(request, {
1432
1456
  idempotencyKey: options.idempotencyKey,
1433
- waitForWarm: options.waitForWarm
1457
+ waitForWarm: options.waitForWarm,
1458
+ pollTimeoutMs: options.pollTimeoutMs,
1459
+ pollIntervalMs: options.pollIntervalMs
1434
1460
  });
1435
1461
  }
1436
1462
  async function purgeEngagementCaches(options) {
@@ -1464,7 +1490,9 @@ async function purgeEngagementCachesInternal(options) {
1464
1490
  });
1465
1491
  return createCachePurgeJob(request, {
1466
1492
  idempotencyKey: options.idempotencyKey,
1467
- waitForWarm: options.waitForWarm
1493
+ waitForWarm: options.waitForWarm,
1494
+ pollTimeoutMs: options.pollTimeoutMs,
1495
+ pollIntervalMs: options.pollIntervalMs
1468
1496
  });
1469
1497
  }
1470
1498
  async function purgeCrmCombined(options) {
@@ -1476,7 +1504,9 @@ async function purgeCrmCombined(options) {
1476
1504
  });
1477
1505
  return createCachePurgeJob(request, {
1478
1506
  idempotencyKey: options.idempotencyKey,
1479
- waitForWarm: options.waitForWarm
1507
+ waitForWarm: options.waitForWarm,
1508
+ pollTimeoutMs: options.pollTimeoutMs,
1509
+ pollIntervalMs: options.pollIntervalMs
1480
1510
  });
1481
1511
  }
1482
1512
 
@@ -1597,7 +1627,9 @@ var triggerPostWriteListPurge = (props) => {
1597
1627
  purgeCrmListCacheAfterCrmWrite({
1598
1628
  objectTypeId: String(objectTypeId),
1599
1629
  listQuery,
1600
- recordIds
1630
+ recordIds,
1631
+ waitForWarm: true,
1632
+ pollTimeoutMs: 45e3
1601
1633
  });
1602
1634
  };
1603
1635
  var mergeRecordWriteBody = (payload, paramsObject, options) => {
@@ -1752,7 +1784,7 @@ var crmClient = {
1752
1784
  param.filterValue = mSelectedPipeline;
1753
1785
  } else if (payload?.specPipeLine && payload?.pipeLineId) {
1754
1786
  param.filterValue = payload?.pipeLineId;
1755
- } else if (payload?.hubspotObjectTypeId != "0-3" || payload?.hubspotObjectTypeId != "0-5") {
1787
+ } else if (!isPipelineBoardObjectTypeId(payload?.hubspotObjectTypeId)) {
1756
1788
  param.filterValue = "";
1757
1789
  }
1758
1790
  const fParams = getLinkParams();
@@ -1794,7 +1826,7 @@ var crmClient = {
1794
1826
  param.parentObjectTypeId = parentObjectTypeId;
1795
1827
  }
1796
1828
  param.parentAccessLabel = parentAccessLabel;
1797
- finalizeBoardListQueryParams(param, { payload});
1829
+ finalizeBoardListQueryParams(param);
1798
1830
  setObjectsQueryParams(param);
1799
1831
  param.cache = payload?.cache;
1800
1832
  const apiUrl = generateApiUrl({ route: API_ENDPOINTS.OBJECTS, params, queryParams: param });
@@ -1891,19 +1923,38 @@ var crmClient = {
1891
1923
  return response;
1892
1924
  },
1893
1925
  details: (props = null) => {
1894
- const { paramsObject: urlParam, parentAccessLabel } = getParamDetails2("", true);
1926
+ const isDdetails = props?.queryParams?.preview ? false : true;
1927
+ const { paramsObject: urlParam, parentAccessLabel } = getParamDetails2("", isDdetails);
1895
1928
  const hubspotObjectTypeId = ticketHubspotObjectTypeId();
1929
+ const previewParams = makePreviewParams(props);
1930
+ let objectId = null;
1931
+ if (props?.queryParams?.preview) {
1932
+ objectId = previewParams?.params?.objectId;
1933
+ } else {
1934
+ objectId = props?.params?.objectId;
1935
+ }
1896
1936
  const params = {
1897
- // hubId: config.hubId,
1898
- // portalId: portalId,
1899
- objectId: props?.params?.objectId,
1937
+ objectId,
1900
1938
  id: props?.params?.id
1901
1939
  };
1902
- const queryParams = {
1940
+ let queryParams = {
1903
1941
  parentAccessLabel,
1904
1942
  ...props?.queryParams,
1905
1943
  ...urlParam
1906
1944
  };
1945
+ if (props?.queryParams?.preview) {
1946
+ queryParams = {
1947
+ parentAccessLabel,
1948
+ ...props?.queryParams,
1949
+ ...previewParams?.queryParams
1950
+ };
1951
+ } else {
1952
+ queryParams = {
1953
+ parentAccessLabel,
1954
+ ...props?.queryParams,
1955
+ ...urlParam
1956
+ };
1957
+ }
1907
1958
  if (hubspotObjectTypeId) queryParams.parentObjectTypeId = hubspotObjectTypeId;
1908
1959
  const apiUrl = generateApiUrl({ route: API_ENDPOINTS.OBJECTS_DETAILS, params, queryParams });
1909
1960
  return HttpClient.get(apiUrl);
@@ -2403,5 +2454,5 @@ function createMutation(mutationFn, options) {
2403
2454
  }
2404
2455
 
2405
2456
  export { Client, SERVICE_UNAVAILABLE_MESSAGE, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, classifyHttpError, createCachePurgeJob, createMutation, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, getAuthRefreshToken, getFieldErrors, getFormErrors, getHttpErrorMessage, initializeHttpClient, isServiceUnavailableError, mergePurgeTargets, navigationApi, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, resolveListTableParams, setEditorPreviewMockHandler, startVisibilityRefreshScheduler, stopVisibilityRefreshScheduler, toCachePurgeListQuery };
2406
- //# sourceMappingURL=chunk-4IKGBHFJ.js.map
2407
- //# sourceMappingURL=chunk-4IKGBHFJ.js.map
2457
+ //# sourceMappingURL=chunk-JVM47MG5.js.map
2458
+ //# sourceMappingURL=chunk-JVM47MG5.js.map