woodsportal-client-sdk 1.1.4-dev.60 → 1.1.4-dev.62
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 +2 -2
- package/dist/adapters/react/index.js +2 -2
- package/dist/adapters/vue/index.js +2 -2
- package/dist/{chunk-AZ7K37OU.js → chunk-XFNFPTU6.js} +3 -3
- package/dist/{chunk-AZ7K37OU.js.map → chunk-XFNFPTU6.js.map} +1 -1
- package/dist/{chunk-IVNXDHLP.js → chunk-XWIYW67P.js} +333 -40
- package/dist/chunk-XWIYW67P.js.map +1 -0
- package/dist/index.d.ts +36 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-IVNXDHLP.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bindStoreWithActions } from '../../chunk-Y5MRAAGK.js';
|
|
2
|
-
import { createAdapterHooks } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
2
|
+
import { createAdapterHooks } from '../../chunk-XFNFPTU6.js';
|
|
3
|
+
import '../../chunk-XWIYW67P.js';
|
|
4
4
|
import '../../chunk-2SYUOWTT.js';
|
|
5
5
|
import { inject, DestroyRef, signal } from '@angular/core';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createAdapterHooks } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
import { createAdapterHooks } from '../../chunk-XFNFPTU6.js';
|
|
2
|
+
import '../../chunk-XWIYW67P.js';
|
|
3
3
|
import '../../chunk-2SYUOWTT.js';
|
|
4
4
|
import { useSyncExternalStore } from 'react';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bindStoreWithActions } from '../../chunk-Y5MRAAGK.js';
|
|
2
|
-
import { createAdapterHooks } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
2
|
+
import { createAdapterHooks } from '../../chunk-XFNFPTU6.js';
|
|
3
|
+
import '../../chunk-XWIYW67P.js';
|
|
4
4
|
import '../../chunk-2SYUOWTT.js';
|
|
5
5
|
import { reactive, onScopeDispose } from 'vue';
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { uploaderStore, actions2, syncStore, actions5, emailStore, actions4, noteStore, actions3, multiObjectStore, actions6, tableStore, actions } from './chunk-
|
|
1
|
+
import { uploaderStore, actions2, syncStore, actions5, emailStore, actions4, noteStore, actions3, multiObjectStore, actions6, tableStore, actions } from './chunk-XWIYW67P.js';
|
|
2
2
|
|
|
3
3
|
// src/adapters/shared/createAdapterHooks.ts
|
|
4
4
|
function createAdapterHooks(createComposable) {
|
|
@@ -13,5 +13,5 @@ function createAdapterHooks(createComposable) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export { createAdapterHooks };
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-XFNFPTU6.js.map
|
|
17
|
+
//# sourceMappingURL=chunk-XFNFPTU6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/adapters/shared/createAdapterHooks.ts"],"names":["actions"],"mappings":";;;AA0BO,SAAS,mBAAmB,gBAAA,EAAqC;AACpE,EAAA,OAAO;AAAA,IACH,QAAA,EAAU,gBAAA,CAAkD,UAAA,EAAY,OAAY,CAAA;AAAA,IACpF,qBAAA,EAAuB,gBAAA,CAAiB,gBAAA,EAAkBA,QAAkB,CAAA;AAAA,IAC5E,OAAA,EAAS,gBAAA,CAAgD,SAAA,EAAWA,QAAW,CAAA;AAAA,IAC/E,QAAA,EAAU,gBAAA,CAAkD,UAAA,EAAYA,QAAY,CAAA;AAAA,IACpF,OAAA,EAAS,gBAAA,CAAgD,SAAA,EAAWA,QAAW,CAAA;AAAA,IAC/E,WAAA,EAAa,gBAAA,CAAwD,aAAA,EAAeA,QAAe;AAAA,GACvG;AACJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/adapters/shared/createAdapterHooks.ts"],"names":["actions"],"mappings":";;;AA0BO,SAAS,mBAAmB,gBAAA,EAAqC;AACpE,EAAA,OAAO;AAAA,IACH,QAAA,EAAU,gBAAA,CAAkD,UAAA,EAAY,OAAY,CAAA;AAAA,IACpF,qBAAA,EAAuB,gBAAA,CAAiB,gBAAA,EAAkBA,QAAkB,CAAA;AAAA,IAC5E,OAAA,EAAS,gBAAA,CAAgD,SAAA,EAAWA,QAAW,CAAA;AAAA,IAC/E,QAAA,EAAU,gBAAA,CAAkD,UAAA,EAAYA,QAAY,CAAA;AAAA,IACpF,OAAA,EAAS,gBAAA,CAAgD,SAAA,EAAWA,QAAW,CAAA;AAAA,IAC/E,WAAA,EAAa,gBAAA,CAAwD,aAAA,EAAeA,QAAe;AAAA,GACvG;AACJ","file":"chunk-XFNFPTU6.js","sourcesContent":["import type { SubscribableStore } from \"./bindStoreWithActions\";\nimport {\n tableStore,\n tableActions,\n type TableState,\n multiObjectStore,\n multiObjectActions,\n noteStore,\n noteActions,\n type NoteState,\n emailStore,\n emailActions,\n type EmailState,\n syncStore,\n syncActions,\n type SyncState,\n uploaderStore,\n uploaderActions,\n type UploaderState,\n} from \"./stores\";\n\ntype ComposableFactory = <TState extends object, TActions extends object>(\n store: SubscribableStore<TState>,\n actions: TActions,\n) => () => TState & TActions;\n\nexport function createAdapterHooks(createComposable: ComposableFactory) {\n return {\n useTable: createComposable<TableState, typeof tableActions>(tableStore, tableActions),\n useMultiObjectActions: createComposable(multiObjectStore, multiObjectActions),\n useNote: createComposable<NoteState, typeof noteActions>(noteStore, noteActions),\n useEmail: createComposable<EmailState, typeof emailActions>(emailStore, emailActions),\n useSync: createComposable<SyncState, typeof syncActions>(syncStore, syncActions),\n useUploader: createComposable<UploaderState, typeof uploaderActions>(uploaderStore, uploaderActions),\n };\n}\n"]}
|
|
@@ -1038,13 +1038,13 @@ var tableStore2 = createStore2({
|
|
|
1038
1038
|
viewType: ""
|
|
1039
1039
|
});
|
|
1040
1040
|
var actions2 = {
|
|
1041
|
-
/** Called from Client.object.list — feeds
|
|
1041
|
+
/** Called from Client.object.list — feeds purgeCrmListCacheAfterCrmWrite / purgeCrmDetailAndListAfterCrmWrite. */
|
|
1042
1042
|
setObjectsQueryParams(params) {
|
|
1043
1043
|
tableStore2.setState({
|
|
1044
1044
|
queryParams: params
|
|
1045
1045
|
});
|
|
1046
1046
|
},
|
|
1047
|
-
/** Called from Client.object.sideBarList — feeds
|
|
1047
|
+
/** Called from Client.object.sideBarList — feeds post-write list purge for sidebarTable writes. */
|
|
1048
1048
|
setMultiObjectsQueryParams(hubspotObjectTypeId, params) {
|
|
1049
1049
|
if (!hubspotObjectTypeId) {
|
|
1050
1050
|
return;
|
|
@@ -1688,13 +1688,17 @@ var actions6 = {
|
|
|
1688
1688
|
};
|
|
1689
1689
|
|
|
1690
1690
|
// src/utils/cache/builders.ts
|
|
1691
|
-
function buildCrmListPurgeTarget(objectTypeId, listQuery) {
|
|
1692
|
-
|
|
1691
|
+
function buildCrmListPurgeTarget(objectTypeId, listQuery, recordIds) {
|
|
1692
|
+
const target = {
|
|
1693
1693
|
domain: "crm_object_data",
|
|
1694
1694
|
objectTypeId,
|
|
1695
1695
|
views: ["list"],
|
|
1696
1696
|
listQuery: listQuery ?? { page: 1, limit: 10, view: "LIST" }
|
|
1697
1697
|
};
|
|
1698
|
+
if (recordIds?.length) {
|
|
1699
|
+
target.recordIds = recordIds;
|
|
1700
|
+
}
|
|
1701
|
+
return target;
|
|
1698
1702
|
}
|
|
1699
1703
|
function buildCrmSinglePurgeTarget(objectTypeId, recordIds, listQuery) {
|
|
1700
1704
|
return {
|
|
@@ -1709,7 +1713,7 @@ function buildEngagementPurgeTarget(objectTypeId, recordIds, views, options) {
|
|
|
1709
1713
|
if (!recordIds.length) {
|
|
1710
1714
|
throw new Error("recordIds is required for engagement purge views");
|
|
1711
1715
|
}
|
|
1712
|
-
|
|
1716
|
+
const target = {
|
|
1713
1717
|
domain: "crm_object_data",
|
|
1714
1718
|
objectTypeId,
|
|
1715
1719
|
recordIds,
|
|
@@ -1717,6 +1721,10 @@ function buildEngagementPurgeTarget(objectTypeId, recordIds, views, options) {
|
|
|
1717
1721
|
fileIds: options?.fileIds,
|
|
1718
1722
|
listQuery: options?.listQuery ?? { page: 1, limit: 10 }
|
|
1719
1723
|
};
|
|
1724
|
+
if (options?.engagementItemIds?.length) {
|
|
1725
|
+
target.engagementItemIds = options.engagementItemIds;
|
|
1726
|
+
}
|
|
1727
|
+
return target;
|
|
1720
1728
|
}
|
|
1721
1729
|
function buildUserSessionPurgeTarget() {
|
|
1722
1730
|
return { domain: "user_session" };
|
|
@@ -1731,7 +1739,7 @@ function mergePurgeTargets(...targets) {
|
|
|
1731
1739
|
return targets;
|
|
1732
1740
|
}
|
|
1733
1741
|
function buildCachePurgeRequest(targets, options) {
|
|
1734
|
-
|
|
1742
|
+
const request = {
|
|
1735
1743
|
mode: options?.mode ?? "soft",
|
|
1736
1744
|
warm: options?.warm ?? true,
|
|
1737
1745
|
includeContactAccess: options?.includeContactAccess ?? true,
|
|
@@ -1739,6 +1747,13 @@ function buildCachePurgeRequest(targets, options) {
|
|
|
1739
1747
|
confirmPortalWide: options?.confirmPortalWide ?? false,
|
|
1740
1748
|
targets
|
|
1741
1749
|
};
|
|
1750
|
+
if (options?.postCrmWrite) {
|
|
1751
|
+
request.postCrmWrite = true;
|
|
1752
|
+
}
|
|
1753
|
+
if (options?.warmListDelayMs != null) {
|
|
1754
|
+
request.warmListDelayMs = options.warmListDelayMs;
|
|
1755
|
+
}
|
|
1756
|
+
return request;
|
|
1742
1757
|
}
|
|
1743
1758
|
|
|
1744
1759
|
// src/utils/cache/createCachePurgeJob.ts
|
|
@@ -1831,15 +1846,45 @@ async function purgeCrmObjectDataCache(options) {
|
|
|
1831
1846
|
const result = await purgeCrmListCache(options);
|
|
1832
1847
|
return result.ok;
|
|
1833
1848
|
}
|
|
1849
|
+
async function purgeCrmListCacheAfterCrmWrite(options) {
|
|
1850
|
+
return purgeCrmListCache({
|
|
1851
|
+
...options,
|
|
1852
|
+
postCrmWrite: true
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
async function purgeCrmDetailAndListAfterCrmWrite(options) {
|
|
1856
|
+
const objectTypeId = options.objectTypeId?.trim();
|
|
1857
|
+
if (!objectTypeId || !options.recordIds?.length) {
|
|
1858
|
+
return {
|
|
1859
|
+
ok: false,
|
|
1860
|
+
errorCode: "VALIDATION",
|
|
1861
|
+
message: "objectTypeId and recordIds are required"
|
|
1862
|
+
};
|
|
1863
|
+
}
|
|
1864
|
+
return purgeCrmCombined({
|
|
1865
|
+
...options,
|
|
1866
|
+
postCrmWrite: true,
|
|
1867
|
+
targets: mergePurgeTargets(
|
|
1868
|
+
buildCrmListPurgeTarget(objectTypeId, options.listQuery, options.recordIds),
|
|
1869
|
+
buildCrmSinglePurgeTarget(objectTypeId, options.recordIds, options.listQuery)
|
|
1870
|
+
)
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1834
1873
|
async function purgeCrmListCache(options) {
|
|
1835
1874
|
const objectTypeId = options.objectTypeId?.trim();
|
|
1836
1875
|
if (!objectTypeId) {
|
|
1837
1876
|
return { ok: false, errorCode: "VALIDATION", message: "objectTypeId is required" };
|
|
1838
1877
|
}
|
|
1839
|
-
const target = buildCrmListPurgeTarget(
|
|
1878
|
+
const target = buildCrmListPurgeTarget(
|
|
1879
|
+
objectTypeId,
|
|
1880
|
+
options.listQuery,
|
|
1881
|
+
options.recordIds
|
|
1882
|
+
);
|
|
1840
1883
|
const request = buildCachePurgeRequest([target], {
|
|
1841
1884
|
mode: options.mode,
|
|
1842
|
-
warm: options.warm
|
|
1885
|
+
warm: options.warm,
|
|
1886
|
+
postCrmWrite: options.postCrmWrite,
|
|
1887
|
+
warmListDelayMs: options.warmListDelayMs
|
|
1843
1888
|
});
|
|
1844
1889
|
return createCachePurgeJob(request, {
|
|
1845
1890
|
idempotencyKey: options.idempotencyKey,
|
|
@@ -1862,7 +1907,9 @@ async function purgeCrmRecordCache(options) {
|
|
|
1862
1907
|
);
|
|
1863
1908
|
const request = buildCachePurgeRequest([target], {
|
|
1864
1909
|
mode: options.mode,
|
|
1865
|
-
warm: options.warm
|
|
1910
|
+
warm: options.warm,
|
|
1911
|
+
postCrmWrite: options.postCrmWrite,
|
|
1912
|
+
warmListDelayMs: options.warmListDelayMs
|
|
1866
1913
|
});
|
|
1867
1914
|
return createCachePurgeJob(request, {
|
|
1868
1915
|
idempotencyKey: options.idempotencyKey,
|
|
@@ -1870,6 +1917,15 @@ async function purgeCrmRecordCache(options) {
|
|
|
1870
1917
|
});
|
|
1871
1918
|
}
|
|
1872
1919
|
async function purgeEngagementCaches(options) {
|
|
1920
|
+
return purgeEngagementCachesInternal(options);
|
|
1921
|
+
}
|
|
1922
|
+
async function purgeEngagementCachesAfterCrmWrite(options) {
|
|
1923
|
+
return purgeEngagementCachesInternal({
|
|
1924
|
+
...options,
|
|
1925
|
+
postCrmWrite: true
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
async function purgeEngagementCachesInternal(options) {
|
|
1873
1929
|
const objectTypeId = options.objectTypeId?.trim();
|
|
1874
1930
|
if (!objectTypeId || !options.recordIds?.length || !options.views?.length) {
|
|
1875
1931
|
return {
|
|
@@ -1882,11 +1938,17 @@ async function purgeEngagementCaches(options) {
|
|
|
1882
1938
|
objectTypeId,
|
|
1883
1939
|
options.recordIds,
|
|
1884
1940
|
options.views,
|
|
1885
|
-
{
|
|
1941
|
+
{
|
|
1942
|
+
fileIds: options.fileIds,
|
|
1943
|
+
listQuery: options.listQuery,
|
|
1944
|
+
engagementItemIds: options.engagementItemIds
|
|
1945
|
+
}
|
|
1886
1946
|
);
|
|
1887
1947
|
const request = buildCachePurgeRequest([target], {
|
|
1888
1948
|
mode: options.mode,
|
|
1889
|
-
warm: options.warm
|
|
1949
|
+
warm: options.warm,
|
|
1950
|
+
postCrmWrite: options.postCrmWrite,
|
|
1951
|
+
warmListDelayMs: options.warmListDelayMs
|
|
1890
1952
|
});
|
|
1891
1953
|
return createCachePurgeJob(request, {
|
|
1892
1954
|
idempotencyKey: options.idempotencyKey,
|
|
@@ -1896,7 +1958,9 @@ async function purgeEngagementCaches(options) {
|
|
|
1896
1958
|
async function purgeCrmCombined(options) {
|
|
1897
1959
|
const request = buildCachePurgeRequest(options.targets, {
|
|
1898
1960
|
mode: options.mode,
|
|
1899
|
-
warm: options.warm
|
|
1961
|
+
warm: options.warm,
|
|
1962
|
+
postCrmWrite: options.postCrmWrite,
|
|
1963
|
+
warmListDelayMs: options.warmListDelayMs
|
|
1900
1964
|
});
|
|
1901
1965
|
return createCachePurgeJob(request, {
|
|
1902
1966
|
idempotencyKey: options.idempotencyKey,
|
|
@@ -1904,6 +1968,167 @@ async function purgeCrmCombined(options) {
|
|
|
1904
1968
|
});
|
|
1905
1969
|
}
|
|
1906
1970
|
|
|
1971
|
+
// src/utils/cache/extractHubspotRecordIdFromWriteResponse.ts
|
|
1972
|
+
function extractHubspotRecordIdFromWriteResponse(response) {
|
|
1973
|
+
if (response == null || typeof response !== "object") {
|
|
1974
|
+
return void 0;
|
|
1975
|
+
}
|
|
1976
|
+
const root = response;
|
|
1977
|
+
const data = root.data;
|
|
1978
|
+
if (data != null && typeof data === "object") {
|
|
1979
|
+
const fromData = idFromRecordPayload(data);
|
|
1980
|
+
if (fromData) {
|
|
1981
|
+
return fromData;
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
return idFromRecordPayload(root);
|
|
1985
|
+
}
|
|
1986
|
+
function idFromRecordPayload(payload) {
|
|
1987
|
+
const id = payload.id;
|
|
1988
|
+
if (id !== void 0 && id !== null && String(id).length > 0) {
|
|
1989
|
+
return String(id);
|
|
1990
|
+
}
|
|
1991
|
+
const hsObjectId = payload.hs_object_id;
|
|
1992
|
+
if (hsObjectId !== void 0 && hsObjectId !== null && String(hsObjectId).length > 0) {
|
|
1993
|
+
return String(hsObjectId);
|
|
1994
|
+
}
|
|
1995
|
+
return void 0;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
// src/utils/cache/extractEngagementItemIdFromWriteResponse.ts
|
|
1999
|
+
function extractEngagementItemIdFromWriteResponse(response) {
|
|
2000
|
+
if (response == null || typeof response !== "object") {
|
|
2001
|
+
return void 0;
|
|
2002
|
+
}
|
|
2003
|
+
const root = response;
|
|
2004
|
+
const candidates = [];
|
|
2005
|
+
const data = root.data;
|
|
2006
|
+
if (data != null && typeof data === "object") {
|
|
2007
|
+
const dataObj = data;
|
|
2008
|
+
candidates.push(dataObj);
|
|
2009
|
+
const nested = dataObj.response;
|
|
2010
|
+
if (nested != null && typeof nested === "object") {
|
|
2011
|
+
candidates.push(nested);
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
const topResponse = root.response;
|
|
2015
|
+
if (topResponse != null && typeof topResponse === "object") {
|
|
2016
|
+
candidates.push(topResponse);
|
|
2017
|
+
}
|
|
2018
|
+
candidates.push(root);
|
|
2019
|
+
for (const payload of candidates) {
|
|
2020
|
+
const id = engagementIdFromPayload(payload);
|
|
2021
|
+
if (id) {
|
|
2022
|
+
return id;
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
return void 0;
|
|
2026
|
+
}
|
|
2027
|
+
function engagementIdFromPayload(payload) {
|
|
2028
|
+
const fromHs = fieldValue(payload.hs_object_id);
|
|
2029
|
+
if (fromHs) {
|
|
2030
|
+
return fromHs;
|
|
2031
|
+
}
|
|
2032
|
+
const fromId = fieldValue(payload.id);
|
|
2033
|
+
if (fromId) {
|
|
2034
|
+
return fromId;
|
|
2035
|
+
}
|
|
2036
|
+
return void 0;
|
|
2037
|
+
}
|
|
2038
|
+
function fieldValue(raw) {
|
|
2039
|
+
if (raw == null) {
|
|
2040
|
+
return void 0;
|
|
2041
|
+
}
|
|
2042
|
+
if (typeof raw === "object") {
|
|
2043
|
+
const value = raw.value;
|
|
2044
|
+
if (value !== void 0 && value !== null && String(value).length > 0) {
|
|
2045
|
+
return String(value);
|
|
2046
|
+
}
|
|
2047
|
+
return void 0;
|
|
2048
|
+
}
|
|
2049
|
+
const s = String(raw);
|
|
2050
|
+
return s.length > 0 ? s : void 0;
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
// src/utils/cache/resolveCrmListPurgeQuery.ts
|
|
2054
|
+
var LIST_QUERY_KEYS = [
|
|
2055
|
+
"sort",
|
|
2056
|
+
"search",
|
|
2057
|
+
"filterPropertyName",
|
|
2058
|
+
"filterOperator",
|
|
2059
|
+
"filterValue",
|
|
2060
|
+
"page",
|
|
2061
|
+
"limit",
|
|
2062
|
+
"view",
|
|
2063
|
+
"mediatorObjectTypeId",
|
|
2064
|
+
"mediatorObjectRecordId",
|
|
2065
|
+
"parentObjectTypeId",
|
|
2066
|
+
"parentObjectRecordId",
|
|
2067
|
+
"stageId",
|
|
2068
|
+
"after"
|
|
2069
|
+
];
|
|
2070
|
+
function toCachePurgeListQuery(raw) {
|
|
2071
|
+
if (!raw || typeof raw !== "object") {
|
|
2072
|
+
return { page: 1, limit: 10, view: "LIST" };
|
|
2073
|
+
}
|
|
2074
|
+
const q = {};
|
|
2075
|
+
for (const key of LIST_QUERY_KEYS) {
|
|
2076
|
+
const value = raw[key];
|
|
2077
|
+
if (value !== void 0 && value !== null && String(value).length > 0) {
|
|
2078
|
+
q[key] = String(value);
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
if (raw.page !== void 0 && raw.page !== null) {
|
|
2082
|
+
const page = Number(raw.page);
|
|
2083
|
+
if (!Number.isNaN(page) && page > 0) {
|
|
2084
|
+
q.page = page;
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
if (raw.limit !== void 0 && raw.limit !== null) {
|
|
2088
|
+
const limit = Number(raw.limit);
|
|
2089
|
+
if (!Number.isNaN(limit) && limit > 0) {
|
|
2090
|
+
q.limit = limit;
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
const isPc = raw.isPrimaryCompany ?? raw.isPC;
|
|
2094
|
+
if (isPc !== void 0 && isPc !== null) {
|
|
2095
|
+
q.isPrimaryCompany = isPc === true || isPc === "true" || isPc === 1 || isPc === "1";
|
|
2096
|
+
}
|
|
2097
|
+
const view = raw.view;
|
|
2098
|
+
if (typeof view === "string") {
|
|
2099
|
+
q.view = view.toUpperCase() === "BOARD" ? "BOARD" : "LIST";
|
|
2100
|
+
}
|
|
2101
|
+
if (Object.keys(q).length === 0) {
|
|
2102
|
+
return { page: 1, limit: 10, view: "LIST" };
|
|
2103
|
+
}
|
|
2104
|
+
if (q.page === void 0) {
|
|
2105
|
+
q.page = 1;
|
|
2106
|
+
}
|
|
2107
|
+
if (q.limit === void 0) {
|
|
2108
|
+
q.limit = 10;
|
|
2109
|
+
}
|
|
2110
|
+
if (q.view === void 0) {
|
|
2111
|
+
q.view = "LIST";
|
|
2112
|
+
}
|
|
2113
|
+
return q;
|
|
2114
|
+
}
|
|
2115
|
+
function resolveCrmListPurgeQuery(options) {
|
|
2116
|
+
let raw;
|
|
2117
|
+
if (options.componentName === "sidebarTable" && options.hubspotObjectTypeId) {
|
|
2118
|
+
raw = options.multiObjectsQueryParams?.[String(options.hubspotObjectTypeId)] ?? null;
|
|
2119
|
+
} else {
|
|
2120
|
+
raw = options.tableQueryParams ?? null;
|
|
2121
|
+
}
|
|
2122
|
+
const base = toCachePurgeListQuery(raw ?? void 0);
|
|
2123
|
+
if (!options.writeContext || Object.keys(options.writeContext).length === 0) {
|
|
2124
|
+
return base;
|
|
2125
|
+
}
|
|
2126
|
+
return {
|
|
2127
|
+
...base,
|
|
2128
|
+
...options.writeContext
|
|
2129
|
+
};
|
|
2130
|
+
}
|
|
2131
|
+
|
|
1907
2132
|
// src/client/index.ts
|
|
1908
2133
|
var recordWriteContext = (paramsObject) => {
|
|
1909
2134
|
if (!paramsObject) {
|
|
@@ -1924,6 +2149,26 @@ var recordWriteContext = (paramsObject) => {
|
|
|
1924
2149
|
});
|
|
1925
2150
|
return Object.keys(context).length > 0 ? context : void 0;
|
|
1926
2151
|
};
|
|
2152
|
+
var triggerPostWriteListPurge = (props) => {
|
|
2153
|
+
const objectTypeId = props.hubspotObjectTypeId;
|
|
2154
|
+
if (!objectTypeId) {
|
|
2155
|
+
return;
|
|
2156
|
+
}
|
|
2157
|
+
const { queryParams, multiObjectsQueryParams } = tableStore2.getState();
|
|
2158
|
+
const listQuery = resolveCrmListPurgeQuery({
|
|
2159
|
+
componentName: props.componentName,
|
|
2160
|
+
hubspotObjectTypeId: objectTypeId,
|
|
2161
|
+
tableQueryParams: queryParams,
|
|
2162
|
+
multiObjectsQueryParams,
|
|
2163
|
+
writeContext: recordWriteContext(props.paramsObject)
|
|
2164
|
+
});
|
|
2165
|
+
const recordIds = props.recordId ? [String(props.recordId)] : void 0;
|
|
2166
|
+
purgeCrmListCacheAfterCrmWrite({
|
|
2167
|
+
objectTypeId: String(objectTypeId),
|
|
2168
|
+
listQuery,
|
|
2169
|
+
recordIds
|
|
2170
|
+
});
|
|
2171
|
+
};
|
|
1927
2172
|
var mergeRecordWriteBody = (payload, paramsObject, options) => {
|
|
1928
2173
|
const base = { ...payload || {} };
|
|
1929
2174
|
const context = recordWriteContext(paramsObject);
|
|
@@ -2106,15 +2351,17 @@ var Client = {
|
|
|
2106
2351
|
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId };
|
|
2107
2352
|
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.RECORDS_CREATE, params, queryParams: props?.params });
|
|
2108
2353
|
const response = await HttpClient.post(apiUrl, body);
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
}
|
|
2354
|
+
triggerPostWriteListPurge({
|
|
2355
|
+
hubspotObjectTypeId: props?.hubspotObjectTypeId,
|
|
2356
|
+
componentName: props?.componentName,
|
|
2357
|
+
paramsObject,
|
|
2358
|
+
recordId: extractHubspotRecordIdFromWriteResponse(response)
|
|
2359
|
+
});
|
|
2115
2360
|
return response;
|
|
2116
2361
|
},
|
|
2117
|
-
createExisting: (props = null) => {
|
|
2362
|
+
createExisting: async (props = null) => {
|
|
2363
|
+
const { getParamDetails: getParamDetailsForAssociate } = routeParam;
|
|
2364
|
+
const { paramsObject } = getParamDetailsForAssociate({ type: props?.componentName });
|
|
2118
2365
|
const { getLinkParams } = useUpdateLink();
|
|
2119
2366
|
const fParams = getLinkParams();
|
|
2120
2367
|
const queryParams = { ...fParams, ...props?.params };
|
|
@@ -2125,9 +2372,18 @@ var Client = {
|
|
|
2125
2372
|
};
|
|
2126
2373
|
const payload = props.payload;
|
|
2127
2374
|
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.RECORDS_ASSOCIATE, params, queryParams });
|
|
2128
|
-
|
|
2375
|
+
const response = await HttpClient.post(apiUrl, payload);
|
|
2376
|
+
const objectTypeId = props?.toObjectTypeId ?? props?.hubspotObjectTypeId;
|
|
2377
|
+
const recordId = extractHubspotRecordIdFromWriteResponse(response) ?? (props?.fromRecordId != null ? String(props.fromRecordId) : void 0);
|
|
2378
|
+
triggerPostWriteListPurge({
|
|
2379
|
+
hubspotObjectTypeId: objectTypeId,
|
|
2380
|
+
componentName: props?.componentName,
|
|
2381
|
+
paramsObject,
|
|
2382
|
+
recordId
|
|
2383
|
+
});
|
|
2384
|
+
return response;
|
|
2129
2385
|
},
|
|
2130
|
-
removeExisting: (props = null) => {
|
|
2386
|
+
removeExisting: async (props = null) => {
|
|
2131
2387
|
const { getParamDetails: getParamDetailsForRemove } = routeParam;
|
|
2132
2388
|
const { paramsObject } = getParamDetailsForRemove({ type: props?.componentName });
|
|
2133
2389
|
const body = mergeRecordWriteBody(props?.payload, paramsObject, void 0);
|
|
@@ -2137,7 +2393,23 @@ var Client = {
|
|
|
2137
2393
|
toObjectTypeId: props?.toObjectTypeId
|
|
2138
2394
|
};
|
|
2139
2395
|
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.RECORDS_DISASSOCIATE, params });
|
|
2140
|
-
|
|
2396
|
+
const response = await HttpClient.delete(apiUrl, { data: body });
|
|
2397
|
+
const objectTypeId = props?.toObjectTypeId ?? props?.hubspotObjectTypeId;
|
|
2398
|
+
if (objectTypeId) {
|
|
2399
|
+
const { queryParams, multiObjectsQueryParams } = tableStore2.getState();
|
|
2400
|
+
const listQuery = resolveCrmListPurgeQuery({
|
|
2401
|
+
componentName: props?.componentName,
|
|
2402
|
+
hubspotObjectTypeId: objectTypeId,
|
|
2403
|
+
tableQueryParams: queryParams,
|
|
2404
|
+
multiObjectsQueryParams,
|
|
2405
|
+
writeContext: recordWriteContext(paramsObject)
|
|
2406
|
+
});
|
|
2407
|
+
purgeCrmListCache({
|
|
2408
|
+
objectTypeId: String(objectTypeId),
|
|
2409
|
+
listQuery
|
|
2410
|
+
});
|
|
2411
|
+
}
|
|
2412
|
+
return response;
|
|
2141
2413
|
},
|
|
2142
2414
|
details: (props = null) => {
|
|
2143
2415
|
const { paramsObject: urlParam, parentAccessLabel } = getParamDetails("", true);
|
|
@@ -2177,18 +2449,29 @@ var Client = {
|
|
|
2177
2449
|
if (hubspotObjectTypeId) queryParams.parentObjectTypeId = hubspotObjectTypeId;
|
|
2178
2450
|
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.RECORDS_UPDATE, params, queryParams });
|
|
2179
2451
|
const { queryParams: tableQueryParams, multiObjectsQueryParams } = tableStore2.getState();
|
|
2180
|
-
const
|
|
2452
|
+
const writeContext = recordWriteContext(paramsObject);
|
|
2453
|
+
const listQuery = resolveCrmListPurgeQuery({
|
|
2454
|
+
componentName: props?.componentName,
|
|
2455
|
+
hubspotObjectTypeId: props?.hubspotObjectTypeId ?? props?.params?.objectId,
|
|
2456
|
+
tableQueryParams,
|
|
2457
|
+
multiObjectsQueryParams,
|
|
2458
|
+
writeContext
|
|
2459
|
+
});
|
|
2181
2460
|
const response = await HttpClient.put(apiUrl, body);
|
|
2182
2461
|
const objectTypeId = props?.hubspotObjectTypeId ?? props?.params?.objectId;
|
|
2183
2462
|
const recordId = props?.params?.id;
|
|
2184
2463
|
if (objectTypeId && recordId) {
|
|
2185
|
-
|
|
2464
|
+
purgeCrmDetailAndListAfterCrmWrite({
|
|
2186
2465
|
objectTypeId: String(objectTypeId),
|
|
2187
2466
|
recordIds: [String(recordId)],
|
|
2188
2467
|
listQuery
|
|
2189
2468
|
});
|
|
2190
2469
|
} else if (objectTypeId) {
|
|
2191
|
-
|
|
2470
|
+
triggerPostWriteListPurge({
|
|
2471
|
+
hubspotObjectTypeId: objectTypeId,
|
|
2472
|
+
componentName: props?.componentName,
|
|
2473
|
+
paramsObject
|
|
2474
|
+
});
|
|
2192
2475
|
}
|
|
2193
2476
|
return response;
|
|
2194
2477
|
}
|
|
@@ -2211,16 +2494,18 @@ var Client = {
|
|
|
2211
2494
|
const queryParams = props.queryParams;
|
|
2212
2495
|
const payload = props.payload;
|
|
2213
2496
|
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.NOTES_CREATE, params, queryParams });
|
|
2214
|
-
const listQuery = noteStore.getState().queryParams ?? {};
|
|
2497
|
+
const listQuery = toCachePurgeListQuery(noteStore.getState().queryParams ?? {});
|
|
2215
2498
|
const response = await HttpClient.post(apiUrl, payload);
|
|
2216
2499
|
const recordId = props?.params?.id;
|
|
2217
2500
|
const objectTypeId = props?.params?.objectId;
|
|
2218
2501
|
if (recordId && objectTypeId) {
|
|
2219
|
-
|
|
2502
|
+
const engagementItemId = extractEngagementItemIdFromWriteResponse(response);
|
|
2503
|
+
purgeEngagementCachesAfterCrmWrite({
|
|
2220
2504
|
objectTypeId,
|
|
2221
2505
|
recordIds: [String(recordId)],
|
|
2222
2506
|
views: ["notes"],
|
|
2223
|
-
listQuery
|
|
2507
|
+
listQuery,
|
|
2508
|
+
engagementItemIds: engagementItemId ? [engagementItemId] : void 0
|
|
2224
2509
|
});
|
|
2225
2510
|
}
|
|
2226
2511
|
return response;
|
|
@@ -2235,16 +2520,19 @@ var Client = {
|
|
|
2235
2520
|
};
|
|
2236
2521
|
const { paramsObject: queryParams } = getParamDetails();
|
|
2237
2522
|
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.NOTES_DETAILS_UPDATE, params, queryParams });
|
|
2238
|
-
const listQuery = noteStore.getState().queryParams ?? {};
|
|
2523
|
+
const listQuery = toCachePurgeListQuery(noteStore.getState().queryParams ?? {});
|
|
2239
2524
|
const response = await HttpClient.put(apiUrl, props.payload);
|
|
2240
2525
|
const recordId = props?.params?.id;
|
|
2241
2526
|
const objectTypeId = props?.params?.objectId;
|
|
2527
|
+
const noteId = props?.params?.note_id;
|
|
2242
2528
|
if (recordId && objectTypeId) {
|
|
2243
|
-
|
|
2529
|
+
const engagementItemId = extractEngagementItemIdFromWriteResponse(response) ?? (noteId != null && String(noteId).length > 0 ? String(noteId) : void 0);
|
|
2530
|
+
purgeEngagementCachesAfterCrmWrite({
|
|
2244
2531
|
objectTypeId,
|
|
2245
2532
|
recordIds: [String(recordId)],
|
|
2246
2533
|
views: ["notes"],
|
|
2247
|
-
listQuery
|
|
2534
|
+
listQuery,
|
|
2535
|
+
engagementItemIds: engagementItemId ? [engagementItemId] : void 0
|
|
2248
2536
|
});
|
|
2249
2537
|
}
|
|
2250
2538
|
return response;
|
|
@@ -2294,16 +2582,18 @@ var Client = {
|
|
|
2294
2582
|
const queryParams = props.queryParams;
|
|
2295
2583
|
const payload = props.payload;
|
|
2296
2584
|
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.EMAILS_CREATE, params, queryParams });
|
|
2297
|
-
const listQuery = emailStore.getState().queryParams ?? {};
|
|
2585
|
+
const listQuery = toCachePurgeListQuery(emailStore.getState().queryParams ?? {});
|
|
2298
2586
|
const response = await HttpClient.post(apiUrl, payload);
|
|
2299
2587
|
const recordId = props?.params?.id;
|
|
2300
2588
|
const objectTypeId = props?.params?.objectId;
|
|
2301
2589
|
if (recordId && objectTypeId) {
|
|
2302
|
-
|
|
2590
|
+
const engagementItemId = extractEngagementItemIdFromWriteResponse(response);
|
|
2591
|
+
purgeEngagementCachesAfterCrmWrite({
|
|
2303
2592
|
objectTypeId,
|
|
2304
2593
|
recordIds: [String(recordId)],
|
|
2305
2594
|
views: ["emails"],
|
|
2306
|
-
listQuery
|
|
2595
|
+
listQuery,
|
|
2596
|
+
engagementItemIds: engagementItemId ? [engagementItemId] : void 0
|
|
2307
2597
|
});
|
|
2308
2598
|
}
|
|
2309
2599
|
return response;
|
|
@@ -2318,16 +2608,19 @@ var Client = {
|
|
|
2318
2608
|
};
|
|
2319
2609
|
const { paramsObject: queryParams } = getParamDetails();
|
|
2320
2610
|
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.EMAILS_DETAILS_UPDATE, params, queryParams });
|
|
2321
|
-
const listQuery = emailStore.getState().queryParams ?? {};
|
|
2611
|
+
const listQuery = toCachePurgeListQuery(emailStore.getState().queryParams ?? {});
|
|
2322
2612
|
const response = await HttpClient.put(apiUrl, props.payload);
|
|
2323
2613
|
const recordId = props?.params?.id;
|
|
2324
2614
|
const objectTypeId = props?.params?.objectId;
|
|
2615
|
+
const emailId = props?.params?.email_id ?? props?.params?.note_id;
|
|
2325
2616
|
if (recordId && objectTypeId) {
|
|
2326
|
-
|
|
2617
|
+
const engagementItemId = extractEngagementItemIdFromWriteResponse(response) ?? (emailId != null && String(emailId).length > 0 ? String(emailId) : void 0);
|
|
2618
|
+
purgeEngagementCachesAfterCrmWrite({
|
|
2327
2619
|
objectTypeId,
|
|
2328
2620
|
recordIds: [String(recordId)],
|
|
2329
2621
|
views: ["emails"],
|
|
2330
|
-
listQuery
|
|
2622
|
+
listQuery,
|
|
2623
|
+
engagementItemIds: engagementItemId ? [engagementItemId] : void 0
|
|
2331
2624
|
});
|
|
2332
2625
|
}
|
|
2333
2626
|
return response;
|
|
@@ -3636,6 +3929,6 @@ var routeParam = {
|
|
|
3636
3929
|
getParamDetails
|
|
3637
3930
|
};
|
|
3638
3931
|
|
|
3639
|
-
export { DEFAULT_HUBSPOT_TIMEZONE, actions2 as actions, actions3 as actions2, actions4 as actions3, actions5 as actions4, actions7 as actions5, actions8 as actions6, api, breadcrumbsDetails, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, client_exports, createCachePurgeJob, emailStore, formatGmtOffset, formatHubSpotActivityDateTime, formatHubSpotActivityDateTimeParts, getCurrentTimeZone, getFieldErrors, getFormErrors, initializeHttpClient, mergePurgeTargets, multiObjectStore, normalizeToTimestamp, noteStore, purgeCrmCombined, purgeCrmListCache, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, routeParam, store, syncStore, tableStore2 as tableStore, uploaderStore, url };
|
|
3640
|
-
//# sourceMappingURL=chunk-
|
|
3641
|
-
//# sourceMappingURL=chunk-
|
|
3932
|
+
export { DEFAULT_HUBSPOT_TIMEZONE, actions2 as actions, actions3 as actions2, actions4 as actions3, actions5 as actions4, actions7 as actions5, actions8 as actions6, api, breadcrumbsDetails, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, client_exports, createCachePurgeJob, emailStore, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, formatGmtOffset, formatHubSpotActivityDateTime, formatHubSpotActivityDateTimeParts, getCurrentTimeZone, getFieldErrors, getFormErrors, initializeHttpClient, mergePurgeTargets, multiObjectStore, normalizeToTimestamp, noteStore, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, routeParam, store, syncStore, tableStore2 as tableStore, toCachePurgeListQuery, uploaderStore, url };
|
|
3933
|
+
//# sourceMappingURL=chunk-XWIYW67P.js.map
|
|
3934
|
+
//# sourceMappingURL=chunk-XWIYW67P.js.map
|