woodsportal-client-sdk 1.1.4-dev.40 → 1.1.4-dev.42

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getParamDetails, useUpdateLink, useTable, getRouteDetails, actions, actions2, actions3, getParam, decodeToBase64, generatePath, getPath, getRouteMenu, breadcrumbStage, isMessingParentLastItem, isMessingParent, generateUrl, resetAllStore } from './chunk-HRLJLCAZ.js';
1
+ import { getParamDetails, useUpdateLink, useTable, getRouteDetails, actions, actions5, actions2, actions3, getParam, decodeToBase64, generatePath, getPath, getRouteMenu, breadcrumbStage, isMessingParentLastItem, isMessingParent, generateUrl, resetAllStore } from './chunk-MFA4HYJU.js';
2
2
  import { ensureValidRefresh, HUBSPOT_DATA, PORTAL_ID, DEV_PORTAL_ID, HUB_ID, setRefreshCallback, getAccessToken, setRefreshToken, setAccessToken, isAuthenticateApp, isExpiresAccessToken, getRefreshToken, DEV_API_URL, setPortal, setSubscriptionType, setLoggedInDetails, clearAccessToken } from './chunk-YLZA5S7A.js';
3
3
  import { __export, isCookieExpired, removeAllCookie } from './chunk-NB7AINV4.js';
4
4
  import axios from 'axios';
@@ -173,6 +173,7 @@ var API_ENDPOINTS = {
173
173
  // File manager (nested under CRM record)
174
174
  FILES: "/api/${hubId}/${portalId}/hubspot-object-data/${objectId}/records/${id}/files",
175
175
  FILE: "/api/${hubId}/${portalId}/hubspot-object-data/${objectId}/records/${id}/files/${rowId}",
176
+ FILE_DOWNLOAD: "/api/${hubId}/${portalId}/hubspot-object-data/${objectId}/records/${id}/files/${rowId}/download",
176
177
  FILES_CREATE_FOLDER: "/api/${hubId}/${portalId}/hubspot-object-data/${objectId}/records/${id}/folders",
177
178
  FILES_UPLOAD: "/api/${hubId}/${portalId}/hubspot-object-data/${objectId}/records/${id}/files"
178
179
  };
@@ -748,6 +749,15 @@ var Client = {
748
749
  const apiUrl = generateApiUrl({ route: API_ENDPOINTS.FILE, params, queryParams: props?.queryParams });
749
750
  return HttpClient.get(apiUrl);
750
751
  },
752
+ download: (props = null) => {
753
+ const params = {
754
+ objectId: props?.params?.objectId,
755
+ id: props?.params?.id,
756
+ rowId: props?.params?.rowId
757
+ };
758
+ const apiUrl = generateApiUrl({ route: API_ENDPOINTS.FILE_DOWNLOAD, params, queryParams: props?.queryParams });
759
+ return HttpClient.post(apiUrl, {});
760
+ },
751
761
  addFolder: (props = null) => {
752
762
  const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId, ...props.params };
753
763
  const queryParams = props.queryParams;
@@ -1133,9 +1143,11 @@ function list3(options) {
1133
1143
  };
1134
1144
  }
1135
1145
  function sideBarList(options) {
1146
+ const { setMultiObjectData } = actions5;
1136
1147
  const { mutate, isLoading } = createMutation(
1137
1148
  async (payload) => {
1138
1149
  const response = await Client.object.sideBarList(payload);
1150
+ setMultiObjectData(response, payload);
1139
1151
  return response;
1140
1152
  },
1141
1153
  options
@@ -1176,15 +1188,18 @@ function objectFormOptions(options) {
1176
1188
  }
1177
1189
  function create(options) {
1178
1190
  const { setTablePrependData } = actions;
1191
+ const { setMultiObjectPrependData } = actions5;
1179
1192
  const { mutate, isLoading } = createMutation(
1180
1193
  async (props) => {
1181
- if (props?.componentName != "association") await setTablePrependData("loading", props);
1194
+ if (props?.componentName === "sidebarTable") await setMultiObjectPrependData("loading", props);
1195
+ if (props?.componentName != "association" && props?.componentName != "sidebarTable") await setTablePrependData("loading", props);
1182
1196
  const response = await Client.object.create(props);
1183
1197
  console.log(
1184
1198
  "props",
1185
1199
  props
1186
1200
  );
1187
- if (props?.componentName != "association") await setTablePrependData(response, props);
1201
+ if (props?.componentName === "sidebarTable") await setMultiObjectPrependData(response, props);
1202
+ if (props?.componentName != "association" && props?.componentName != "sidebarTable") await setTablePrependData(response, props);
1188
1203
  return response;
1189
1204
  },
1190
1205
  options
@@ -1441,6 +1456,20 @@ function addFile(options) {
1441
1456
  isLoading
1442
1457
  };
1443
1458
  }
1459
+ function download(options) {
1460
+ const { mutate, isLoading } = createMutation(
1461
+ async (payload) => {
1462
+ const response = await Client.file.download(payload);
1463
+ return response;
1464
+ },
1465
+ options
1466
+ );
1467
+ return {
1468
+ mutate,
1469
+ downloadFile: mutate,
1470
+ isLoading
1471
+ };
1472
+ }
1444
1473
 
1445
1474
  // src/apis/cache.ts
1446
1475
  function purge(options) {
@@ -1773,6 +1802,7 @@ var api = {
1773
1802
  attachmentUpload,
1774
1803
  files: list6,
1775
1804
  file: details2,
1805
+ fileDownload: download,
1776
1806
  addFolder,
1777
1807
  addFile,
1778
1808
  purgeCache: purge,