woodsportal-client-sdk 4.0.4-dev.1 → 4.0.4-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 (40) hide show
  1. package/README.md +2 -0
  2. package/dist/adapters/angular/index.d.ts +8 -2
  3. package/dist/adapters/angular/index.js +5 -5
  4. package/dist/adapters/angular/index.js.map +1 -1
  5. package/dist/adapters/react/index.d.ts +8 -2
  6. package/dist/adapters/react/index.js +5 -5
  7. package/dist/adapters/react/index.js.map +1 -1
  8. package/dist/adapters/vue/index.d.ts +8 -2
  9. package/dist/adapters/vue/index.js +5 -5
  10. package/dist/adapters/vue/index.js.map +1 -1
  11. package/dist/{cache-purge-G5WkHckd.d.ts → cache-purge-Ca4idzyy.d.ts} +1 -1
  12. package/dist/{chunk-Y3MS2SB6.js → chunk-3MOYNNS6.js} +61 -16
  13. package/dist/chunk-3MOYNNS6.js.map +1 -0
  14. package/dist/{chunk-IF5JQ5QC.js → chunk-4IPGDENW.js} +17 -7
  15. package/dist/chunk-4IPGDENW.js.map +1 -0
  16. package/dist/{chunk-S7PCM6XY.js → chunk-HIU3HVAH.js} +3 -3
  17. package/dist/{chunk-S7PCM6XY.js.map → chunk-HIU3HVAH.js.map} +1 -1
  18. package/dist/{chunk-D6Q7QHDA.js → chunk-OCAHDPIS.js} +209 -18
  19. package/dist/chunk-OCAHDPIS.js.map +1 -0
  20. package/dist/chunk-QLNLPV35.js +21 -0
  21. package/dist/chunk-QLNLPV35.js.map +1 -0
  22. package/dist/{chunk-HWACSRXM.js → chunk-TWOOR6U2.js} +305 -146
  23. package/dist/chunk-TWOOR6U2.js.map +1 -0
  24. package/dist/entries/auth.d.ts +8 -3
  25. package/dist/entries/auth.js +3 -3
  26. package/dist/entries/auth.js.map +1 -1
  27. package/dist/entries/crm.d.ts +3 -3
  28. package/dist/entries/crm.js +6 -6
  29. package/dist/{http-errors-hlKcIsXD.d.ts → http-errors-DqdtoJ1y.d.ts} +80 -8
  30. package/dist/{index-CCwMopD8.d.ts → index-Bh9eY8sA.d.ts} +5 -1
  31. package/dist/index.d.ts +21 -9
  32. package/dist/index.js +9 -9
  33. package/dist/{use-uploader-2F1zc7Cl.d.ts → use-file-BcO5l-Zf.d.ts} +7 -1
  34. package/package.json +4 -3
  35. package/dist/chunk-D6Q7QHDA.js.map +0 -1
  36. package/dist/chunk-HVDTMVQG.js +0 -20
  37. package/dist/chunk-HVDTMVQG.js.map +0 -1
  38. package/dist/chunk-HWACSRXM.js.map +0 -1
  39. package/dist/chunk-IF5JQ5QC.js.map +0 -1
  40. package/dist/chunk-Y3MS2SB6.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/main/adapters/shared/createAdapterHooks.ts"],"names":["actions"],"mappings":";;;;AAmCO,SAAS,mBAAmB,gBAAA,EAAqC;AACpE,EAAA,OAAO;AAAA,IACH,QAAA,EAAU,gBAAA,CAAkD,UAAA,EAAYA,QAAY,CAAA;AAAA,IACpF,UAAA,EAAY,gBAAA,CAAsD,YAAA,EAAc,cAAc,CAAA;AAAA,IAC9F,qBAAA,EAAuB,gBAAA,CAAiB,gBAAA,EAAkBA,OAAkB,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,OAAA,EAAS,gBAAA,CAAgD,SAAA,EAAWA,QAAW,CAAA;AAAA,IAC/E,WAAA,EAAa,gBAAA,CAAwD,aAAA,EAAeA,QAAe,CAAA;AAAA,IACnG,OAAA,EAAS,gBAAA,CAAgD,SAAA,EAAWA,QAAW;AAAA,GACnF;AACJ","file":"chunk-QLNLPV35.js","sourcesContent":["import type { SubscribableStore } from './bindStoreWithActions'\nimport {\n tableStore,\n tableActions,\n type TableState,\n tableUiStore,\n tableUiActions,\n type TableUiState,\n multiObjectStore,\n multiObjectActions,\n noteStore,\n noteActions,\n type NoteState,\n emailStore,\n emailActions,\n type EmailState,\n userStore,\n userActions,\n type UserState,\n syncStore,\n syncActions,\n type SyncState,\n uploaderStore,\n uploaderActions,\n type UploaderState,\n fileStore,\n fileActions,\n type FileState\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 useTableUi: createComposable<TableUiState, typeof tableUiActions>(tableUiStore, tableUiActions),\n useMultiObjectActions: createComposable(multiObjectStore, multiObjectActions),\n useNote: createComposable<NoteState, typeof noteActions>(noteStore, noteActions),\n useEmail: createComposable<EmailState, typeof emailActions>(emailStore, emailActions),\n useUser: createComposable<UserState, typeof userActions>(userStore, userActions),\n useSync: createComposable<SyncState, typeof syncActions>(syncStore, syncActions),\n useUploader: createComposable<UploaderState, typeof uploaderActions>(uploaderStore, uploaderActions),\n useFile: createComposable<FileState, typeof fileActions>(fileStore, fileActions)\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { createStore, getParamDetails, getRouteDetails, updateLink, configureLogger, isHttpTracingEnabled, logger, sanitizeAxiosErrorData, getParam, decodeToBase64, generatePath, getPath, getRouteMenu, tableUiActions, ticketHubspotObjectTypeId, tableStore, actions2, userStore, emailStore, actions5, noteStore, actions4 as actions4$1, tableUiStore, resetAllStore, breadcrumbStage, isMessingParentLastItem, isMessingParent, generateUrl } from './chunk-D6Q7QHDA.js';
1
+ import { getParamDetails, getRouteDetails, updateLink, configureLogger, isHttpTracingEnabled, logger, sanitizeAxiosErrorData, getParam, decodeToBase64, generatePath, getPath, getRouteMenu, tableUiActions, ticketHubspotObjectTypeId, tableStore, actions2, userStore, fileStore, actions6, emailStore, actions5, noteStore, actions4, tableUiStore, resetAllStore, breadcrumbStage, isMessingParentLastItem, isMessingParent, generateUrl } from './chunk-OCAHDPIS.js';
2
2
  import { HUBSPOT_DATA, PORTAL_ID, configureStorageKeys, setIframeStorageMode, setRefreshCallback, getAccessToken, setRefreshToken, setAccessToken, ensureValidRefresh, DEV_API_URL, DEV_PORTAL_ID, HUB_ID } from './chunk-QPSCMK4W.js';
3
3
  import axios2 from 'axios';
4
4
 
@@ -186,6 +186,9 @@ var API_ENDPOINTS = {
186
186
  MFA_PREFERENCES: "/api/auth/mfa/preferences",
187
187
  MFA_PHONE_VERIFY_START: "/api/auth/mfa/phone/verify/start",
188
188
  MFA_PHONE_VERIFY_CONFIRM: "/api/auth/mfa/phone/verify/confirm",
189
+ MFA_PHONE_UNVERIFY: "/api/auth/mfa/phone/unverify",
190
+ MFA_BACKUP_CODES_REGENERATE: "/api/auth/mfa/backup-codes/regenerate",
191
+ MFA_OPT_OUT: "/api/auth/mfa/opt-out",
189
192
  MFA_TOTP_ENROLL_START: "/api/auth/mfa/totp/enroll/start",
190
193
  MFA_TOTP_ENROLL_VERIFY: "/api/auth/mfa/totp/enroll/verify",
191
194
  MFA_TOTP_DISABLE: "/api/auth/mfa/totp/disable",
@@ -203,6 +206,8 @@ var API_ENDPOINTS = {
203
206
  SECURITY_SESSIONS: "/api/auth/security/sessions",
204
207
  SECURITY_SESSION_REVOKE: "/api/auth/security/sessions/${familyId}/revoke",
205
208
  SECURITY_SESSIONS_REVOKE_OTHERS: "/api/auth/security/sessions/revoke-others",
209
+ // Login bootstrap (portal MFA policy + SSO providers)
210
+ LOGIN_BOOTSTRAP: "/api/auth/login/bootstrap",
206
211
  // SSO
207
212
  SSO_DETAILS: "/api/auth/sso/active",
208
213
  SSO_URL: "/api/auth/sso/authorize",
@@ -515,9 +520,22 @@ var HttpClient = class {
515
520
  ).join(";");
516
521
  }
517
522
  };
523
+ function mergeAuthRequestOptions(options) {
524
+ const devPortalId = config.devPortalId;
525
+ if (!devPortalId && !options?.headers) {
526
+ return options;
527
+ }
528
+ return {
529
+ ...options,
530
+ headers: {
531
+ ...devPortalId ? { "X-Dev-Portal-Id": devPortalId } : {},
532
+ ...options?.headers
533
+ }
534
+ };
535
+ }
518
536
  var AuthHttpClient = class {
519
- static async get(url, params) {
520
- const response = await getAxiosInstance().get(url, { params });
537
+ static async get(url, params, options) {
538
+ const response = await getAxiosInstance().get(url, { params, ...mergeAuthRequestOptions(options) });
521
539
  return response.data;
522
540
  }
523
541
  static async post(url, data, options) {
@@ -926,8 +944,20 @@ var mfaClient = {
926
944
  }),
927
945
  data
928
946
  ),
929
- startPhoneVerify: (data) => HttpClient.post(API_ENDPOINTS.MFA_PHONE_VERIFY_START, data),
930
- confirmPhoneVerify: (data) => HttpClient.post(API_ENDPOINTS.MFA_PHONE_VERIFY_CONFIRM, data),
947
+ startPhoneVerify: (data, query) => HttpClient.post(
948
+ generateApiUrl({
949
+ route: API_ENDPOINTS.MFA_PHONE_VERIFY_START,
950
+ queryParams: mfaPortalQuery(query?.portalId)
951
+ }),
952
+ data
953
+ ),
954
+ confirmPhoneVerify: (data, query) => HttpClient.post(
955
+ generateApiUrl({
956
+ route: API_ENDPOINTS.MFA_PHONE_VERIFY_CONFIRM,
957
+ queryParams: mfaPortalQuery(query?.portalId)
958
+ }),
959
+ data
960
+ ),
931
961
  totpEnrollStart: (query) => HttpClient.post(
932
962
  generateApiUrl({
933
963
  route: API_ENDPOINTS.MFA_TOTP_ENROLL_START,
@@ -942,7 +972,34 @@ var mfaClient = {
942
972
  }),
943
973
  data
944
974
  ),
945
- totpDisable: (data) => HttpClient.post(API_ENDPOINTS.MFA_TOTP_DISABLE, data),
975
+ totpDisable: (data, query) => HttpClient.post(
976
+ generateApiUrl({
977
+ route: API_ENDPOINTS.MFA_TOTP_DISABLE,
978
+ queryParams: mfaPortalQuery(query?.portalId)
979
+ }),
980
+ data
981
+ ),
982
+ phoneUnverify: (data, query) => HttpClient.post(
983
+ generateApiUrl({
984
+ route: API_ENDPOINTS.MFA_PHONE_UNVERIFY,
985
+ queryParams: mfaPortalQuery(query?.portalId)
986
+ }),
987
+ data
988
+ ),
989
+ backupCodesRegenerate: (data, query) => HttpClient.post(
990
+ generateApiUrl({
991
+ route: API_ENDPOINTS.MFA_BACKUP_CODES_REGENERATE,
992
+ queryParams: mfaPortalQuery(query?.portalId)
993
+ }),
994
+ data
995
+ ),
996
+ optOut: (data, query) => HttpClient.post(
997
+ generateApiUrl({
998
+ route: API_ENDPOINTS.MFA_OPT_OUT,
999
+ queryParams: mfaPortalQuery(query?.portalId)
1000
+ }),
1001
+ data
1002
+ ),
946
1003
  webauthnRegisterOptions: (query) => HttpClient.post(
947
1004
  generateApiUrl({
948
1005
  route: API_ENDPOINTS.MFA_WEBAUTHN_REGISTER_OPTIONS,
@@ -1002,28 +1059,213 @@ var mfaClient = {
1002
1059
  )
1003
1060
  };
1004
1061
 
1005
- // src/main/state/crm/use-file.ts
1006
- var fileStore = createStore({
1007
- queryParams: null
1008
- });
1009
- var actions4 = {
1010
- /** Called from Client.file.list — feeds purgeEngagementCaches (view: files). */
1011
- setListQueryParams(params) {
1012
- fileStore.setState({
1013
- queryParams: params
1014
- });
1062
+ // src/main/features/crm/helpers/normalize-table-list-params.ts
1063
+ function resolveListTableParams(payload) {
1064
+ const param = tableUiActions.getTableParam(payload?.companyAsMediator, payload?.currentPageOverride);
1065
+ if (payload?.tableParams && typeof payload.tableParams === "object") {
1066
+ return { ...param, ...payload.tableParams };
1015
1067
  }
1016
- };
1068
+ return { ...param };
1069
+ }
1070
+ function applyBoardPaginationToParams(param, tableParams) {
1071
+ const stageId = tableParams.stageId;
1072
+ const page = tableParams.page;
1073
+ if (stageId !== void 0 && stageId !== null && stageId !== "") {
1074
+ param.stageId = stageId;
1075
+ }
1076
+ if (param.view === "BOARD" && page !== void 0) {
1077
+ param.page = page;
1078
+ }
1079
+ return param;
1080
+ }
1081
+ function finalizeBoardListQueryParams(param, context) {
1082
+ const { stageId, nextPage, view, selectedPipeline } = tableUiStore.getState();
1083
+ const payload = context?.payload;
1084
+ if (view) {
1085
+ param.view = view;
1086
+ }
1087
+ const ticketPipelineContext = payload?.isHome && payload?.hubspotObjectTypeId === "0-5" || payload?.componentName === "object" && payload?.hubspotObjectTypeId === "0-5";
1088
+ if (ticketPipelineContext && !param?.isPrimaryCompany) {
1089
+ param.parentObjectTypeId = "0-1";
1090
+ } else if (ticketPipelineContext && param?.isPrimaryCompany) {
1091
+ param.parentObjectTypeId = "0-2";
1092
+ }
1093
+ if (selectedPipeline !== void 0 && selectedPipeline !== null && selectedPipeline !== "") {
1094
+ param.filterValue = selectedPipeline;
1095
+ }
1096
+ return applyBoardPaginationToParams(param, {
1097
+ stageId,
1098
+ page: stageId ? nextPage : 1
1099
+ });
1100
+ }
1101
+
1102
+ // src/main/core/utils/cache/resolveCrmListPurgeQuery.ts
1103
+ var LIST_QUERY_KEYS = [
1104
+ "sort",
1105
+ "search",
1106
+ "filterPropertyName",
1107
+ "filterOperator",
1108
+ "filterValue",
1109
+ "page",
1110
+ "limit",
1111
+ "view",
1112
+ "mediatorObjectTypeId",
1113
+ "mediatorObjectRecordId",
1114
+ "parentObjectTypeId",
1115
+ "parentObjectRecordId",
1116
+ "stageId",
1117
+ "after"
1118
+ ];
1119
+ var PURGE_FILTER_KEYS = ["sort", "filterPropertyName", "filterOperator", "filterValue", "view", "page", "limit"];
1120
+ function hasPurgeFilterContext(raw) {
1121
+ if (!raw || typeof raw !== "object") {
1122
+ return false;
1123
+ }
1124
+ return PURGE_FILTER_KEYS.some((key) => {
1125
+ const value = raw[key];
1126
+ return value !== void 0 && value !== null && String(value).length > 0;
1127
+ });
1128
+ }
1129
+ function mergeLiveTableUiState(raw) {
1130
+ const state = tableUiStore.getState();
1131
+ const merged = { ...raw ?? {} };
1132
+ if (!merged.sort && state.sort) {
1133
+ merged.sort = state.sort;
1134
+ }
1135
+ if (!merged.search && state.search) {
1136
+ merged.search = state.search;
1137
+ }
1138
+ if (!merged.filterPropertyName && state.filterPropertyName) {
1139
+ merged.filterPropertyName = state.filterPropertyName;
1140
+ }
1141
+ if (!merged.filterOperator && state.filterOperator) {
1142
+ merged.filterOperator = state.filterOperator;
1143
+ }
1144
+ if (!merged.filterValue && state.selectedPipeline) {
1145
+ merged.filterValue = state.selectedPipeline;
1146
+ }
1147
+ if (merged.limit === void 0 && state.limit) {
1148
+ merged.limit = state.limit;
1149
+ }
1150
+ if (merged.page === void 0 && state.page !== void 0 && state.page !== "") {
1151
+ merged.page = state.page;
1152
+ }
1153
+ if (!merged.view && state.view) {
1154
+ merged.view = state.view;
1155
+ }
1156
+ if (merged.isPrimaryCompany === void 0 && state.isPrimaryCompany !== null) {
1157
+ merged.isPrimaryCompany = state.isPrimaryCompany;
1158
+ }
1159
+ return applyBoardPaginationToParams(merged, {
1160
+ stageId: state.stageId,
1161
+ page: state.stageId ? state.nextPage : 1
1162
+ });
1163
+ }
1164
+ function listQueryCacheKey(q) {
1165
+ return JSON.stringify({
1166
+ ...q,
1167
+ stageId: q.stageId ?? ""
1168
+ });
1169
+ }
1170
+ function toCachePurgeListQuery(raw) {
1171
+ if (!raw || typeof raw !== "object") {
1172
+ return { page: 1, limit: 10, view: "LIST" };
1173
+ }
1174
+ const q = {};
1175
+ for (const key of LIST_QUERY_KEYS) {
1176
+ const value = raw[key];
1177
+ if (value !== void 0 && value !== null && String(value).length > 0) {
1178
+ q[key] = String(value);
1179
+ }
1180
+ }
1181
+ if (raw.page !== void 0 && raw.page !== null) {
1182
+ const page = Number(raw.page);
1183
+ if (!Number.isNaN(page) && page > 0) {
1184
+ q.page = page;
1185
+ }
1186
+ }
1187
+ if (raw.limit !== void 0 && raw.limit !== null) {
1188
+ const limit = Number(raw.limit);
1189
+ if (!Number.isNaN(limit) && limit > 0) {
1190
+ q.limit = limit;
1191
+ }
1192
+ }
1193
+ const isPc = raw.isPrimaryCompany ?? raw.isPC;
1194
+ if (isPc !== void 0 && isPc !== null) {
1195
+ q.isPrimaryCompany = isPc === true || isPc === "true" || isPc === 1 || isPc === "1";
1196
+ }
1197
+ const view = raw.view;
1198
+ if (typeof view === "string") {
1199
+ q.view = view.toUpperCase() === "BOARD" ? "BOARD" : "LIST";
1200
+ }
1201
+ if (Object.keys(q).length === 0) {
1202
+ return { page: 1, limit: 10, view: "LIST" };
1203
+ }
1204
+ if (q.page === void 0) {
1205
+ q.page = 1;
1206
+ }
1207
+ if (q.limit === void 0) {
1208
+ q.limit = 10;
1209
+ }
1210
+ if (q.view === void 0) {
1211
+ q.view = "LIST";
1212
+ }
1213
+ return q;
1214
+ }
1215
+ function expandListPurgeQueriesForCrmWrite(base) {
1216
+ const listQuery = { ...base, view: "LIST" };
1217
+ delete listQuery.stageId;
1218
+ const boardQuery = { ...base, view: "BOARD" };
1219
+ const seen = /* @__PURE__ */ new Set();
1220
+ const expanded = [];
1221
+ for (const query of [listQuery, boardQuery]) {
1222
+ const key = listQueryCacheKey(query);
1223
+ if (seen.has(key)) {
1224
+ continue;
1225
+ }
1226
+ seen.add(key);
1227
+ expanded.push(query);
1228
+ }
1229
+ return expanded;
1230
+ }
1231
+ function resolveCrmListPurgeQuery(options) {
1232
+ let raw;
1233
+ if (options.componentName === "sidebarTable" && options.hubspotObjectTypeId) {
1234
+ raw = options.multiObjectsQueryParams?.[String(options.hubspotObjectTypeId)] ?? null;
1235
+ } else {
1236
+ raw = options.tableQueryParams ?? null;
1237
+ }
1238
+ if (!hasPurgeFilterContext(raw)) {
1239
+ raw = mergeLiveTableUiState(raw);
1240
+ }
1241
+ const base = toCachePurgeListQuery(raw ?? void 0);
1242
+ if (!options.writeContext || Object.keys(options.writeContext).length === 0) {
1243
+ return base;
1244
+ }
1245
+ return {
1246
+ ...base,
1247
+ ...options.writeContext
1248
+ };
1249
+ }
1017
1250
 
1018
1251
  // src/main/core/utils/cache/crmCacheRefresh.ts
1252
+ function buildPostWriteListPurgeTargets(objectTypeId, listQuery, recordIds) {
1253
+ const base = listQuery ?? { page: 1, limit: 10, view: "LIST" };
1254
+ return expandListPurgeQueriesForCrmWrite(base).map((query) => buildCrmListPurgeTarget(objectTypeId, query, recordIds));
1255
+ }
1019
1256
  async function purgeCrmObjectDataCache(options) {
1020
1257
  const result = await purgeCrmListCache(options);
1021
1258
  return result.ok;
1022
1259
  }
1023
1260
  async function purgeCrmListCacheAfterCrmWrite(options) {
1024
- return purgeCrmListCache({
1261
+ const objectTypeId = options.objectTypeId?.trim();
1262
+ if (!objectTypeId) {
1263
+ return { ok: false, errorCode: "VALIDATION", message: "objectTypeId is required" };
1264
+ }
1265
+ return purgeCrmCombined({
1025
1266
  ...options,
1026
- postCrmWrite: true
1267
+ postCrmWrite: true,
1268
+ targets: buildPostWriteListPurgeTargets(objectTypeId, options.listQuery, options.recordIds)
1027
1269
  });
1028
1270
  }
1029
1271
  async function purgeCrmDetailAndListAfterCrmWrite(options) {
@@ -1039,7 +1281,7 @@ async function purgeCrmDetailAndListAfterCrmWrite(options) {
1039
1281
  ...options,
1040
1282
  postCrmWrite: true,
1041
1283
  targets: mergePurgeTargets(
1042
- buildCrmListPurgeTarget(objectTypeId, options.listQuery, options.recordIds),
1284
+ ...buildPostWriteListPurgeTargets(objectTypeId, options.listQuery, options.recordIds),
1043
1285
  buildCrmSinglePurgeTarget(objectTypeId, options.recordIds, options.listQuery)
1044
1286
  )
1045
1287
  });
@@ -1211,85 +1453,6 @@ function fieldValue(raw) {
1211
1453
  return s.length > 0 ? s : void 0;
1212
1454
  }
1213
1455
 
1214
- // src/main/core/utils/cache/resolveCrmListPurgeQuery.ts
1215
- var LIST_QUERY_KEYS = [
1216
- "sort",
1217
- "search",
1218
- "filterPropertyName",
1219
- "filterOperator",
1220
- "filterValue",
1221
- "page",
1222
- "limit",
1223
- "view",
1224
- "mediatorObjectTypeId",
1225
- "mediatorObjectRecordId",
1226
- "parentObjectTypeId",
1227
- "parentObjectRecordId",
1228
- "stageId",
1229
- "after"
1230
- ];
1231
- function toCachePurgeListQuery(raw) {
1232
- if (!raw || typeof raw !== "object") {
1233
- return { page: 1, limit: 10, view: "LIST" };
1234
- }
1235
- const q = {};
1236
- for (const key of LIST_QUERY_KEYS) {
1237
- const value = raw[key];
1238
- if (value !== void 0 && value !== null && String(value).length > 0) {
1239
- q[key] = String(value);
1240
- }
1241
- }
1242
- if (raw.page !== void 0 && raw.page !== null) {
1243
- const page = Number(raw.page);
1244
- if (!Number.isNaN(page) && page > 0) {
1245
- q.page = page;
1246
- }
1247
- }
1248
- if (raw.limit !== void 0 && raw.limit !== null) {
1249
- const limit = Number(raw.limit);
1250
- if (!Number.isNaN(limit) && limit > 0) {
1251
- q.limit = limit;
1252
- }
1253
- }
1254
- const isPc = raw.isPrimaryCompany ?? raw.isPC;
1255
- if (isPc !== void 0 && isPc !== null) {
1256
- q.isPrimaryCompany = isPc === true || isPc === "true" || isPc === 1 || isPc === "1";
1257
- }
1258
- const view = raw.view;
1259
- if (typeof view === "string") {
1260
- q.view = view.toUpperCase() === "BOARD" ? "BOARD" : "LIST";
1261
- }
1262
- if (Object.keys(q).length === 0) {
1263
- return { page: 1, limit: 10, view: "LIST" };
1264
- }
1265
- if (q.page === void 0) {
1266
- q.page = 1;
1267
- }
1268
- if (q.limit === void 0) {
1269
- q.limit = 10;
1270
- }
1271
- if (q.view === void 0) {
1272
- q.view = "LIST";
1273
- }
1274
- return q;
1275
- }
1276
- function resolveCrmListPurgeQuery(options) {
1277
- let raw;
1278
- if (options.componentName === "sidebarTable" && options.hubspotObjectTypeId) {
1279
- raw = options.multiObjectsQueryParams?.[String(options.hubspotObjectTypeId)] ?? null;
1280
- } else {
1281
- raw = options.tableQueryParams ?? null;
1282
- }
1283
- const base = toCachePurgeListQuery(raw ?? void 0);
1284
- if (!options.writeContext || Object.keys(options.writeContext).length === 0) {
1285
- return base;
1286
- }
1287
- return {
1288
- ...base,
1289
- ...options.writeContext
1290
- };
1291
- }
1292
-
1293
1456
  // src/main/core/http/client-context.ts
1294
1457
  function getParamDetails2(...args) {
1295
1458
  return navigationApi.route.getParamDetails(...args);
@@ -1343,7 +1506,24 @@ var mergeRecordWriteBody = (payload, paramsObject, options) => {
1343
1506
  // src/main/features/auth/client/authentication-client.ts
1344
1507
  var authenticationClient = {
1345
1508
  authentication: {
1346
- preLogin: (data) => AuthHttpClient.post(API_ENDPOINTS.PRE_LOGIN, data),
1509
+ preLogin: (data) => {
1510
+ const queryParams = {};
1511
+ if (data.hubId != null) {
1512
+ queryParams.hubId = data.hubId;
1513
+ }
1514
+ const resolvedPortalId = data.portalId ?? (config?.devPortalId != null && String(config.devPortalId).trim() !== "" ? Number(config.devPortalId) : void 0);
1515
+ if (resolvedPortalId != null && !Number.isNaN(resolvedPortalId)) {
1516
+ queryParams.portalId = resolvedPortalId;
1517
+ }
1518
+ const email = data.email ?? data.username;
1519
+ return AuthHttpClient.post(
1520
+ generateApiUrl({
1521
+ route: API_ENDPOINTS.PRE_LOGIN,
1522
+ queryParams: Object.keys(queryParams).length > 0 ? queryParams : void 0
1523
+ }),
1524
+ { email }
1525
+ );
1526
+ },
1347
1527
  login: (data) => {
1348
1528
  const queryParams = config.hubId ? { hubId: config.hubId } : null;
1349
1529
  return AuthHttpClient.post(
@@ -1380,7 +1560,23 @@ var authenticationClient = {
1380
1560
  queryParams: { hubId: payload.hubId }
1381
1561
  }),
1382
1562
  { code: payload.code }
1383
- )
1563
+ ),
1564
+ getLoginBootstrap: (payload) => {
1565
+ const queryParams = {};
1566
+ if (payload?.hubId != null) {
1567
+ queryParams.hubId = payload.hubId;
1568
+ }
1569
+ const resolvedPortalId = payload?.portalId ?? (config?.devPortalId != null && String(config.devPortalId).trim() !== "" ? Number(config.devPortalId) : void 0);
1570
+ if (resolvedPortalId != null && !Number.isNaN(resolvedPortalId)) {
1571
+ queryParams.portalId = resolvedPortalId;
1572
+ }
1573
+ return AuthHttpClient.get(
1574
+ generateApiUrl({
1575
+ route: API_ENDPOINTS.LOGIN_BOOTSTRAP,
1576
+ queryParams: Object.keys(queryParams).length > 0 ? queryParams : void 0
1577
+ })
1578
+ );
1579
+ }
1384
1580
  },
1385
1581
  sso: {
1386
1582
  getSsoDetails: () => AuthHttpClient.get(API_ENDPOINTS.SSO_DETAILS),
@@ -1395,46 +1591,6 @@ var authenticationClient = {
1395
1591
  }
1396
1592
  };
1397
1593
 
1398
- // src/main/features/crm/helpers/normalize-table-list-params.ts
1399
- function resolveListTableParams(payload) {
1400
- const param = tableUiActions.getTableParam(payload?.companyAsMediator, payload?.currentPageOverride);
1401
- if (payload?.tableParams && typeof payload.tableParams === "object") {
1402
- return { ...param, ...payload.tableParams };
1403
- }
1404
- return { ...param };
1405
- }
1406
- function applyBoardPaginationToParams(param, tableParams) {
1407
- const stageId = tableParams.stageId;
1408
- const page = tableParams.page;
1409
- if (stageId !== void 0 && stageId !== null && stageId !== "") {
1410
- param.stageId = stageId;
1411
- }
1412
- if (param.view === "BOARD" && page !== void 0) {
1413
- param.page = page;
1414
- }
1415
- return param;
1416
- }
1417
- function finalizeBoardListQueryParams(param, context) {
1418
- const { stageId, nextPage, view, selectedPipeline } = tableUiStore.getState();
1419
- const payload = context?.payload;
1420
- const userData = context?.userData;
1421
- if (view) {
1422
- param.view = view;
1423
- }
1424
- const ticketPipelineContext = payload?.isHome && payload?.hubspotObjectTypeId === "0-5" || payload?.componentName === "object" && payload?.hubspotObjectTypeId === "0-5";
1425
- if (ticketPipelineContext && !param?.isPrimaryCompany && userData?.crmProfile?.configurations?.ticket?.pipeline_id) {
1426
- param.filterValue = userData?.crmProfile?.configurations?.ticket?.pipeline_id;
1427
- } else if (ticketPipelineContext && param?.isPrimaryCompany && userData?.crmProfile?.response?.associations?.COMPANY?.configurations?.ticket?.pipeline_id) {
1428
- param.filterValue = userData?.crmProfile?.response?.associations?.COMPANY?.configurations?.ticket?.pipeline_id;
1429
- } else if (selectedPipeline !== void 0 && selectedPipeline !== null && selectedPipeline !== "") {
1430
- param.filterValue = selectedPipeline;
1431
- }
1432
- return applyBoardPaginationToParams(param, {
1433
- stageId,
1434
- page: stageId ? nextPage : 1
1435
- });
1436
- }
1437
-
1438
1594
  // src/main/features/crm/client/crm-client.ts
1439
1595
  var crmClient = {
1440
1596
  pipeline: {
@@ -1524,7 +1680,7 @@ var crmClient = {
1524
1680
  param.parentObjectTypeId = parentObjectTypeId;
1525
1681
  }
1526
1682
  param.parentAccessLabel = parentAccessLabel;
1527
- finalizeBoardListQueryParams(param, { payload, userData });
1683
+ finalizeBoardListQueryParams(param, { payload});
1528
1684
  setObjectsQueryParams(param);
1529
1685
  param.cache = payload?.cache;
1530
1686
  const apiUrl = generateApiUrl({ route: API_ENDPOINTS.OBJECTS, params, queryParams: param });
@@ -1661,6 +1817,9 @@ var crmClient = {
1661
1817
  multiObjectsQueryParams,
1662
1818
  writeContext
1663
1819
  });
1820
+ if (props?.view === "board") {
1821
+ body.options.view = "board";
1822
+ }
1664
1823
  const response = await HttpClient.put(apiUrl, body);
1665
1824
  const objectTypeId = props?.hubspotObjectTypeId ?? props?.params?.objectId;
1666
1825
  const recordId = props?.params?.id;
@@ -1686,7 +1845,7 @@ var crmClient = {
1686
1845
  var engagementClient = {
1687
1846
  note: {
1688
1847
  list: (props = null) => {
1689
- const { setListQueryParams } = actions4$1;
1848
+ const { setListQueryParams } = actions4;
1690
1849
  setListQueryParams(props?.queryParams ?? {});
1691
1850
  const params = {
1692
1851
  // hubId: config.hubId,
@@ -1862,7 +2021,7 @@ var engagementClient = {
1862
2021
  },
1863
2022
  file: {
1864
2023
  list: (props = null) => {
1865
- const { setListQueryParams } = actions4;
2024
+ const { setListQueryParams } = actions6;
1866
2025
  setListQueryParams(props?.queryParams ?? {});
1867
2026
  const params = {
1868
2027
  // hubId: config.hubId,
@@ -2130,5 +2289,5 @@ function createMutation(mutationFn, options) {
2130
2289
  }
2131
2290
 
2132
2291
  export { Client, SERVICE_UNAVAILABLE_MESSAGE, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, classifyHttpError, config, createCachePurgeJob, createMutation, extractEngagementItemIdFromWriteResponse, extractHubspotRecordIdFromWriteResponse, getAuthRefreshToken, getFieldErrors, getFormErrors, getHttpErrorMessage, initializeHttpClient, isServiceUnavailableError, mergePurgeTargets, navigationApi, purgeCrmCombined, purgeCrmDetailAndListAfterCrmWrite, purgeCrmListCache, purgeCrmListCacheAfterCrmWrite, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, purgeEngagementCachesAfterCrmWrite, resolveCrmListPurgeQuery, resolveListTableParams, setConfig, setEditorPreviewMockHandler, storage, toCachePurgeListQuery };
2133
- //# sourceMappingURL=chunk-HWACSRXM.js.map
2134
- //# sourceMappingURL=chunk-HWACSRXM.js.map
2292
+ //# sourceMappingURL=chunk-TWOOR6U2.js.map
2293
+ //# sourceMappingURL=chunk-TWOOR6U2.js.map