woodsportal-client-sdk 1.1.4-dev.63 → 1.1.4-dev.64

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.
@@ -1,15 +1,15 @@
1
- import { __export, getProfile, ensureValidRefresh, HUBSPOT_DATA, PORTAL_ID, DEV_PORTAL_ID, HUB_ID, setRefreshCallback, getAccessToken, setRefreshToken, setAccessToken, isAuthenticateApp, isExpiresAccessToken, isCookieExpired, getRefreshToken, DEV_API_URL, setProfileDetails, getCookie, setPortal, setSubscriptionType, setLoggedInDetails, clearAccessToken, removeAllCookie } from './chunk-UGSUUZLT.js';
1
+ import { __export, getProfile, getAccessToken, ensureValidRefresh, HUBSPOT_DATA, PORTAL_ID, DEV_PORTAL_ID, HUB_ID, setRefreshCallback, setRefreshToken, setAccessToken, isAuthenticateApp, isExpiresAccessToken, isCookieExpired, getRefreshToken, DEV_API_URL, setProfileDetails, getCookie, clearAccessToken, removeAllCookie, setPortal, setSubscriptionType, setLoggedInDetails } from './chunk-S2NB4AXQ.js';
2
2
  import axios from 'axios';
3
3
  import pako from 'pako';
4
4
  import { Base64 } from 'js-base64';
5
5
 
6
- // src/client/index.ts
6
+ // src/main/client/index.ts
7
7
  var client_exports = {};
8
8
  __export(client_exports, {
9
9
  Client: () => Client
10
10
  });
11
11
 
12
- // src/utils/localStoraget.ts
12
+ // src/main/utils/localStoraget.ts
13
13
  var memory = /* @__PURE__ */ new Map();
14
14
  var memoryStore = {
15
15
  getItem(key) {
@@ -52,7 +52,7 @@ var storage = {
52
52
  }
53
53
  };
54
54
 
55
- // src/utils/config.ts
55
+ // src/main/utils/config.ts
56
56
  var config = {
57
57
  get hubId() {
58
58
  const hubSpotData = storage.get(HUBSPOT_DATA);
@@ -81,7 +81,7 @@ var setConfig = {
81
81
  }
82
82
  };
83
83
 
84
- // src/utils/generateApiUrl.ts
84
+ // src/main/utils/generateApiUrl.ts
85
85
  var generateApiUrl = ({
86
86
  route,
87
87
  params = {},
@@ -107,7 +107,7 @@ function replaceParams(template, values) {
107
107
  );
108
108
  }
109
109
 
110
- // src/client/api-endpoints.ts
110
+ // src/main/client/api-endpoints.ts
111
111
  var API_ENDPOINTS = {
112
112
  // Auth
113
113
  PRE_LOGIN: "/api/auth/pre-login",
@@ -121,6 +121,32 @@ var API_ENDPOINTS = {
121
121
  RESEND_EMAIL: "/api/auth/resend-email",
122
122
  VERIFY_EMAIL_RESEND: "/api/auth/verify-email/resend",
123
123
  LOGOUT: "/api/auth/logout",
124
+ VERIFY_OTP: "/api/auth/verify-otp",
125
+ // Auth MFA (client lane)
126
+ MFA_PENDING_OTP_SEND: "/api/auth/mfa/pending/otp/send",
127
+ MFA_PENDING_PASSKEY_OPTIONS: "/api/auth/mfa/pending/passkey/authenticate/options",
128
+ MFA_PENDING_PASSKEY_VERIFY: "/api/auth/mfa/pending/passkey/authenticate/verify",
129
+ MFA_STATUS: "/api/auth/mfa/status",
130
+ MFA_PREFERENCES: "/api/auth/mfa/preferences",
131
+ MFA_PHONE_VERIFY_START: "/api/auth/mfa/phone/verify/start",
132
+ MFA_PHONE_VERIFY_CONFIRM: "/api/auth/mfa/phone/verify/confirm",
133
+ MFA_TOTP_ENROLL_START: "/api/auth/mfa/totp/enroll/start",
134
+ MFA_TOTP_ENROLL_VERIFY: "/api/auth/mfa/totp/enroll/verify",
135
+ MFA_TOTP_DISABLE: "/api/auth/mfa/totp/disable",
136
+ MFA_WEBAUTHN_REGISTER_OPTIONS: "/api/auth/mfa/webauthn/register/options",
137
+ MFA_WEBAUTHN_REGISTER_VERIFY: "/api/auth/mfa/webauthn/register/verify",
138
+ MFA_WEBAUTHN_AUTH_OPTIONS: "/api/auth/mfa/webauthn/authenticate/options",
139
+ MFA_WEBAUTHN_AUTH_VERIFY: "/api/auth/mfa/webauthn/authenticate/verify",
140
+ MFA_WEBAUTHN_CREDENTIALS: "/api/auth/mfa/webauthn/credentials",
141
+ MFA_WEBAUTHN_CREDENTIAL_DELETE: "/api/auth/mfa/webauthn/credentials/${credentialRecordId}",
142
+ PASSKEY_LOGIN_OPTIONS: "/api/auth/passkey/login/options",
143
+ PASSKEY_LOGIN_VERIFY: "/api/auth/passkey/login/verify",
144
+ // Auth Security (client lane)
145
+ SECURITY_OVERVIEW: "/api/auth/security/overview",
146
+ SECURITY_LOGIN_ACTIVITY: "/api/auth/security/login-activity",
147
+ SECURITY_SESSIONS: "/api/auth/security/sessions",
148
+ SECURITY_SESSION_REVOKE: "/api/auth/security/sessions/${familyId}/revoke",
149
+ SECURITY_SESSIONS_REVOKE_OTHERS: "/api/auth/security/sessions/revoke-others",
124
150
  // SSO
125
151
  SSO_DETAILS: "/api/auth/sso/active",
126
152
  SSO_URL: "/api/auth/sso/authorize",
@@ -178,12 +204,12 @@ var API_ENDPOINTS = {
178
204
  FILES_UPLOAD: "/api/${hubId}/${portalId}/hubspot-object-data/${objectId}/records/${id}/files"
179
205
  };
180
206
 
181
- // src/client/config.ts
207
+ // src/main/client/config.ts
182
208
  var config2 = {
183
209
  baseURL: ""
184
210
  };
185
211
 
186
- // src/client/http-clint.ts
212
+ // src/main/client/http-clint.ts
187
213
  var axiosInstance = null;
188
214
  var config3 = {};
189
215
  function initializeHttpClient(clientConfig) {
@@ -234,9 +260,9 @@ function formatBooleanSearchParam(key, value) {
234
260
  return value ? `${key}:1` : `${key}:`;
235
261
  }
236
262
  var HttpClient = class {
237
- static async get(url2, params) {
263
+ static async get(url2, params, options) {
238
264
  await ensureValidRefresh();
239
- const response = await getAxiosInstance().get(url2, { params });
265
+ const response = await getAxiosInstance().get(url2, { params, ...options || {} });
240
266
  return response.data;
241
267
  }
242
268
  static async post(url2, data, options) {
@@ -335,7 +361,187 @@ async function getAuthRefreshToken(refreshToken) {
335
361
  }
336
362
  }
337
363
 
338
- // src/store2/store.ts
364
+ // src/main/client/auth-headers.ts
365
+ function devPortalHeaders() {
366
+ if (!config?.devPortalId) {
367
+ return void 0;
368
+ }
369
+ return { "X-Dev-Portal-Id": config.devPortalId };
370
+ }
371
+ function mergeRequestOptions(token, extraHeaders) {
372
+ const bearerToken = token || getAccessToken();
373
+ const headers = { ...extraHeaders };
374
+ if (bearerToken) {
375
+ headers.Authorization = `Bearer ${bearerToken}`;
376
+ }
377
+ const devHeaders = devPortalHeaders();
378
+ if (devHeaders) {
379
+ Object.assign(headers, devHeaders);
380
+ }
381
+ return Object.keys(headers).length > 0 ? { headers } : void 0;
382
+ }
383
+ function hubIdQuery() {
384
+ return config.hubId ? { hubId: config.hubId } : null;
385
+ }
386
+ function portalIdQuery(portalId) {
387
+ const id = portalId ?? config.portalId ?? config.devPortalId;
388
+ if (id === null || id === void 0 || id === "") {
389
+ return void 0;
390
+ }
391
+ return { portalId: String(id) };
392
+ }
393
+
394
+ // src/main/client/mfa-client.ts
395
+ var mfaPortalQuery = (portalId) => portalIdQuery(portalId) ?? null;
396
+ var mfaClient = {
397
+ verifyOtp: (data) => AuthHttpClient.post(
398
+ generateApiUrl({ route: API_ENDPOINTS.VERIFY_OTP, queryParams: hubIdQuery() }),
399
+ data,
400
+ mergeRequestOptions(data.token)
401
+ ),
402
+ sendPendingOtp: (data) => AuthHttpClient.post(
403
+ API_ENDPOINTS.MFA_PENDING_OTP_SEND,
404
+ data,
405
+ mergeRequestOptions(data.token)
406
+ ),
407
+ pendingPasskeyOptions: (data) => AuthHttpClient.post(
408
+ API_ENDPOINTS.MFA_PENDING_PASSKEY_OPTIONS,
409
+ data,
410
+ mergeRequestOptions(data.token)
411
+ ),
412
+ pendingPasskeyVerify: (data) => AuthHttpClient.post(
413
+ generateApiUrl({ route: API_ENDPOINTS.MFA_PENDING_PASSKEY_VERIFY, queryParams: hubIdQuery() }),
414
+ data,
415
+ mergeRequestOptions(data.token)
416
+ ),
417
+ getStatus: (query) => HttpClient.get(
418
+ generateApiUrl({
419
+ route: API_ENDPOINTS.MFA_STATUS,
420
+ queryParams: mfaPortalQuery(query?.portalId)
421
+ })
422
+ ),
423
+ setPreferences: (data, query) => HttpClient.put(
424
+ generateApiUrl({
425
+ route: API_ENDPOINTS.MFA_PREFERENCES,
426
+ queryParams: mfaPortalQuery(query?.portalId)
427
+ }),
428
+ data
429
+ ),
430
+ startPhoneVerify: (data) => HttpClient.post(API_ENDPOINTS.MFA_PHONE_VERIFY_START, data),
431
+ confirmPhoneVerify: (data) => HttpClient.post(API_ENDPOINTS.MFA_PHONE_VERIFY_CONFIRM, data),
432
+ totpEnrollStart: (query) => HttpClient.post(
433
+ generateApiUrl({
434
+ route: API_ENDPOINTS.MFA_TOTP_ENROLL_START,
435
+ queryParams: mfaPortalQuery(query?.portalId)
436
+ }),
437
+ null
438
+ ),
439
+ totpEnrollVerify: (data) => HttpClient.post(
440
+ generateApiUrl({
441
+ route: API_ENDPOINTS.MFA_TOTP_ENROLL_VERIFY,
442
+ queryParams: mfaPortalQuery(data.portalId)
443
+ }),
444
+ data
445
+ ),
446
+ totpDisable: (data) => HttpClient.post(API_ENDPOINTS.MFA_TOTP_DISABLE, data),
447
+ webauthnRegisterOptions: (query) => HttpClient.post(
448
+ generateApiUrl({
449
+ route: API_ENDPOINTS.MFA_WEBAUTHN_REGISTER_OPTIONS,
450
+ queryParams: mfaPortalQuery(query?.portalId)
451
+ }),
452
+ null,
453
+ mergeRequestOptions(void 0)
454
+ ),
455
+ webauthnRegisterVerify: (data) => HttpClient.post(
456
+ generateApiUrl({
457
+ route: API_ENDPOINTS.MFA_WEBAUTHN_REGISTER_VERIFY,
458
+ queryParams: mfaPortalQuery(data.portalId)
459
+ }),
460
+ data
461
+ ),
462
+ webauthnAuthOptions: (query) => HttpClient.post(
463
+ generateApiUrl({
464
+ route: API_ENDPOINTS.MFA_WEBAUTHN_AUTH_OPTIONS,
465
+ queryParams: mfaPortalQuery(query?.portalId)
466
+ }),
467
+ null
468
+ ),
469
+ webauthnAuthVerify: (data) => HttpClient.post(
470
+ generateApiUrl({
471
+ route: API_ENDPOINTS.MFA_WEBAUTHN_AUTH_VERIFY,
472
+ queryParams: mfaPortalQuery(data.portalId)
473
+ }),
474
+ data
475
+ ),
476
+ listWebauthnCredentials: (query) => HttpClient.get(
477
+ generateApiUrl({
478
+ route: API_ENDPOINTS.MFA_WEBAUTHN_CREDENTIALS,
479
+ queryParams: mfaPortalQuery(query?.portalId)
480
+ })
481
+ ),
482
+ deleteWebauthnCredential: (credentialRecordId, query) => HttpClient.delete(
483
+ generateApiUrl({
484
+ route: API_ENDPOINTS.MFA_WEBAUTHN_CREDENTIAL_DELETE,
485
+ params: { credentialRecordId: String(credentialRecordId) },
486
+ queryParams: mfaPortalQuery(query?.portalId)
487
+ })
488
+ ),
489
+ passkeyLoginOptions: (data) => AuthHttpClient.post(
490
+ generateApiUrl({ route: API_ENDPOINTS.PASSKEY_LOGIN_OPTIONS, queryParams: hubIdQuery() }),
491
+ data,
492
+ mergeRequestOptions(void 0)
493
+ ),
494
+ passkeyLoginVerify: (data) => AuthHttpClient.post(
495
+ generateApiUrl({ route: API_ENDPOINTS.PASSKEY_LOGIN_VERIFY, queryParams: hubIdQuery() }),
496
+ data,
497
+ mergeRequestOptions(void 0)
498
+ )
499
+ };
500
+
501
+ // src/main/client/security-client.ts
502
+ var refreshTokenHeaders = (refreshToken) => {
503
+ if (!refreshToken) {
504
+ return void 0;
505
+ }
506
+ return { "X-Refresh-Token": refreshToken };
507
+ };
508
+ var securityClient = {
509
+ getOverview: (query) => HttpClient.get(
510
+ generateApiUrl({
511
+ route: API_ENDPOINTS.SECURITY_OVERVIEW,
512
+ queryParams: portalIdQuery(query?.portalId)
513
+ })
514
+ ),
515
+ getLoginActivity: (query) => HttpClient.get(
516
+ generateApiUrl({
517
+ route: API_ENDPOINTS.SECURITY_LOGIN_ACTIVITY,
518
+ queryParams: query ?? {}
519
+ })
520
+ ),
521
+ getSessions: (query) => HttpClient.get(
522
+ generateApiUrl({
523
+ route: API_ENDPOINTS.SECURITY_SESSIONS,
524
+ queryParams: query?.currentFamilyId ? { currentFamilyId: query.currentFamilyId } : void 0
525
+ }),
526
+ void 0,
527
+ mergeRequestOptions(void 0, refreshTokenHeaders(query?.refreshToken))
528
+ ),
529
+ revokeSession: (payload) => HttpClient.post(
530
+ generateApiUrl({
531
+ route: API_ENDPOINTS.SECURITY_SESSION_REVOKE,
532
+ params: { familyId: payload.familyId }
533
+ }),
534
+ null,
535
+ mergeRequestOptions(void 0, refreshTokenHeaders(payload.refreshToken))
536
+ ),
537
+ revokeOtherSessions: (refreshToken) => HttpClient.post(
538
+ API_ENDPOINTS.SECURITY_SESSIONS_REVOKE_OTHERS,
539
+ null,
540
+ mergeRequestOptions(void 0, refreshTokenHeaders(refreshToken))
541
+ )
542
+ };
543
+
544
+ // src/main/store2/store.ts
339
545
  function createStore(initialState) {
340
546
  let state = initialState;
341
547
  const listeners = /* @__PURE__ */ new Set();
@@ -359,7 +565,7 @@ function createStore(initialState) {
359
565
  };
360
566
  }
361
567
 
362
- // src/store2/use-user.ts
568
+ // src/main/store2/use-user.ts
363
569
  var userStore = createStore({
364
570
  profile: getProfile()
365
571
  });
@@ -396,7 +602,7 @@ function decodeToBase64(encoded) {
396
602
  }
397
603
  }
398
604
 
399
- // src/breadcrumb/url-utils.ts
605
+ // src/main/breadcrumb/url-utils.ts
400
606
  function mapKeysDeep(obj, keyMap2) {
401
607
  if (Array.isArray(obj)) {
402
608
  return obj.map((item) => mapKeysDeep(item, keyMap2));
@@ -479,7 +685,7 @@ var generatePath = (breadcrumbs, breadcrumb, index) => {
479
685
  }
480
686
  };
481
687
 
482
- // src/breadcrumb/key-map.ts
688
+ // src/main/breadcrumb/key-map.ts
483
689
  var keyMap = {
484
690
  dp: "defPermissions",
485
691
  n: "name",
@@ -504,7 +710,7 @@ var keyMap = {
504
710
  pId: "pipeline_id"
505
711
  };
506
712
 
507
- // src/utils/url.ts
713
+ // src/main/utils/url.ts
508
714
  var ticketHubspotObjectTypeId = () => {
509
715
  const { getParamDetails: getParamDetails2 } = routeParam;
510
716
  const paramDetails = getParamDetails2();
@@ -523,7 +729,7 @@ var ticketHubspotObjectTypeId = () => {
523
729
  return "";
524
730
  };
525
731
 
526
- // src/utils/param.ts
732
+ // src/main/utils/param.ts
527
733
  function getParam(paramName) {
528
734
  if (typeof globalThis === "undefined" || !globalThis.location) return null;
529
735
  const hash = globalThis.location.hash || "";
@@ -541,7 +747,7 @@ function getPath() {
541
747
  return hash.slice(1).split("?")[0];
542
748
  }
543
749
 
544
- // src/breadcrumb/param.ts
750
+ // src/main/breadcrumb/param.ts
545
751
  var getRouteMenu = (path) => {
546
752
  const apiRoutes = globalThis?.apiRoutes || [];
547
753
  return apiRoutes.find((menu) => menu?.path === path);
@@ -637,7 +843,7 @@ var getParamDetails = (props, isDetailsPage = false) => {
637
843
  };
638
844
  };
639
845
 
640
- // src/store/index.ts
846
+ // src/main/store/index.ts
641
847
  function createStore2(initializer) {
642
848
  let state;
643
849
  const listeners = /* @__PURE__ */ new Set();
@@ -665,12 +871,12 @@ function createStore2(initializer) {
665
871
  };
666
872
  }
667
873
 
668
- // src/utils/getCookieData.ts
874
+ // src/main/utils/getCookieData.ts
669
875
  var getAuthSubscriptionType = () => {
670
876
  return getCookie("subscriptionType");
671
877
  };
672
878
 
673
- // src/breadcrumb/url.ts
879
+ // src/main/breadcrumb/url.ts
674
880
  var useUpdateLink = () => {
675
881
  const updateLink = async (props, displayName = "prm") => {
676
882
  const search = getParam("b");
@@ -771,7 +977,7 @@ var updateBParam = (newValue) => {
771
977
  }
772
978
  };
773
979
 
774
- // src/store/use-table.ts
980
+ // src/main/store/use-table.ts
775
981
  var pageLimit = 10;
776
982
  var tableStore = createStore2((set, get) => ({
777
983
  // ==============================
@@ -1020,7 +1226,7 @@ function useTable() {
1020
1226
  };
1021
1227
  }
1022
1228
 
1023
- // src/store2/use-form.ts
1229
+ // src/main/store2/use-form.ts
1024
1230
  var formStore = createStore({
1025
1231
  form: null
1026
1232
  });
@@ -1031,7 +1237,7 @@ var actions2 = {
1031
1237
  });
1032
1238
  }};
1033
1239
 
1034
- // src/store2/use-table.ts
1240
+ // src/main/store2/use-table.ts
1035
1241
  var tableStore2 = createStore({
1036
1242
  queryParams: null,
1037
1243
  multiObjectsQueryParams: {},
@@ -1328,7 +1534,7 @@ var actions3 = {
1328
1534
  }
1329
1535
  };
1330
1536
 
1331
- // src/store2/use-uploader.ts
1537
+ // src/main/store2/use-uploader.ts
1332
1538
  var uploaderStore = createStore({
1333
1539
  attachments: []
1334
1540
  });
@@ -1363,7 +1569,7 @@ var actions4 = {
1363
1569
  }
1364
1570
  };
1365
1571
 
1366
- // src/store2/use-note.ts
1572
+ // src/main/store2/use-note.ts
1367
1573
  var noteStore = createStore({
1368
1574
  notes: [],
1369
1575
  prependNotes: [],
@@ -1521,7 +1727,7 @@ var actions5 = {
1521
1727
  }
1522
1728
  };
1523
1729
 
1524
- // src/store2/use-email.ts
1730
+ // src/main/store2/use-email.ts
1525
1731
  var emailStore = createStore({
1526
1732
  emails: [],
1527
1733
  prependEmails: [],
@@ -1679,7 +1885,7 @@ var actions6 = {
1679
1885
  }
1680
1886
  };
1681
1887
 
1682
- // src/store2/use-file.ts
1888
+ // src/main/store2/use-file.ts
1683
1889
  var fileStore = createStore({
1684
1890
  queryParams: null
1685
1891
  });
@@ -1692,7 +1898,7 @@ var actions7 = {
1692
1898
  }
1693
1899
  };
1694
1900
 
1695
- // src/utils/cache/builders.ts
1901
+ // src/main/utils/cache/builders.ts
1696
1902
  function buildCrmListPurgeTarget(objectTypeId, listQuery, recordIds) {
1697
1903
  const target = {
1698
1904
  domain: "crm_object_data",
@@ -1761,7 +1967,7 @@ function buildCachePurgeRequest(targets, options) {
1761
1967
  return request;
1762
1968
  }
1763
1969
 
1764
- // src/utils/cache/createCachePurgeJob.ts
1970
+ // src/main/utils/cache/createCachePurgeJob.ts
1765
1971
  function randomIdempotencyKey() {
1766
1972
  if (typeof crypto !== "undefined" && crypto.randomUUID) {
1767
1973
  return crypto.randomUUID();
@@ -1846,7 +2052,7 @@ async function createCachePurgeJob(request, options = {}) {
1846
2052
  }
1847
2053
  }
1848
2054
 
1849
- // src/utils/cache/crmCacheRefresh.ts
2055
+ // src/main/utils/cache/crmCacheRefresh.ts
1850
2056
  async function purgeCrmObjectDataCache(options) {
1851
2057
  const result = await purgeCrmListCache(options);
1852
2058
  return result.ok;
@@ -1973,7 +2179,7 @@ async function purgeCrmCombined(options) {
1973
2179
  });
1974
2180
  }
1975
2181
 
1976
- // src/utils/cache/extractHubspotRecordIdFromWriteResponse.ts
2182
+ // src/main/utils/cache/extractHubspotRecordIdFromWriteResponse.ts
1977
2183
  function extractHubspotRecordIdFromWriteResponse(response) {
1978
2184
  if (response == null || typeof response !== "object") {
1979
2185
  return void 0;
@@ -2000,7 +2206,7 @@ function idFromRecordPayload(payload) {
2000
2206
  return void 0;
2001
2207
  }
2002
2208
 
2003
- // src/utils/cache/extractEngagementItemIdFromWriteResponse.ts
2209
+ // src/main/utils/cache/extractEngagementItemIdFromWriteResponse.ts
2004
2210
  function extractEngagementItemIdFromWriteResponse(response) {
2005
2211
  if (response == null || typeof response !== "object") {
2006
2212
  return void 0;
@@ -2055,7 +2261,7 @@ function fieldValue(raw) {
2055
2261
  return s.length > 0 ? s : void 0;
2056
2262
  }
2057
2263
 
2058
- // src/utils/cache/resolveCrmListPurgeQuery.ts
2264
+ // src/main/utils/cache/resolveCrmListPurgeQuery.ts
2059
2265
  var LIST_QUERY_KEYS = [
2060
2266
  "sort",
2061
2267
  "search",
@@ -2134,7 +2340,7 @@ function resolveCrmListPurgeQuery(options) {
2134
2340
  };
2135
2341
  }
2136
2342
 
2137
- // src/client/index.ts
2343
+ // src/main/client/index.ts
2138
2344
  var recordWriteContext = (paramsObject) => {
2139
2345
  if (!paramsObject) {
2140
2346
  return void 0;
@@ -2200,6 +2406,7 @@ var Client = {
2200
2406
  }
2201
2407
  );
2202
2408
  },
2409
+ verifyOtp: (data) => mfaClient.verifyOtp(data),
2203
2410
  verifyEmail: (data) => AuthHttpClient.post(API_ENDPOINTS.VERIFY_EMAIL, data),
2204
2411
  resetPasswordVerifyToken: (data) => AuthHttpClient.post(API_ENDPOINTS.RESET_PASSWORD_VERIFY_TOKEN, data),
2205
2412
  resetPassword: (data) => AuthHttpClient.post(API_ENDPOINTS.RESET_PASSWORD, data),
@@ -2747,10 +2954,12 @@ var Client = {
2747
2954
  }
2748
2955
  return response;
2749
2956
  }
2750
- }
2957
+ },
2958
+ mfa: mfaClient,
2959
+ security: securityClient
2751
2960
  };
2752
2961
 
2753
- // src/store2/use-sync.ts
2962
+ // src/main/store2/use-sync.ts
2754
2963
  var syncStore = createStore({
2755
2964
  apiSync: false,
2756
2965
  sync: false,
@@ -2789,7 +2998,7 @@ var resetAllStore = () => {
2789
2998
  actions6.clearPrependEmails();
2790
2999
  };
2791
3000
 
2792
- // src/utils/logError.ts
3001
+ // src/main/utils/logError.ts
2793
3002
  function logError(context, error) {
2794
3003
  if (axios.isAxiosError(error)) {
2795
3004
  resetAllStore();
@@ -2810,7 +3019,7 @@ function logError(context, error) {
2810
3019
  console.error(context, error);
2811
3020
  }
2812
3021
 
2813
- // src/mutation/createMutation.ts
3022
+ // src/main/mutation/createMutation.ts
2814
3023
  function createMutation(mutationFn, options) {
2815
3024
  let inFlight = 0;
2816
3025
  let lastReportedLoading = null;
@@ -2842,7 +3051,41 @@ function createMutation(mutationFn, options) {
2842
3051
  };
2843
3052
  }
2844
3053
 
2845
- // src/apis/authentication.ts
3054
+ // src/main/client/login-session.ts
3055
+ async function completeLoginSession(response) {
3056
+ const tokenData = response?.data?.tokenData || {};
3057
+ const loggedInDetails = response?.data?.loggedInDetails || {};
3058
+ const currentPortal = response?.data?.loggedInDetails?.currentPortal || {};
3059
+ const currentPortalId = currentPortal?.portalId || null;
3060
+ const subscriptionType = loggedInDetails?.subscriptionType || "BASIC";
3061
+ const token = tokenData?.token;
3062
+ const refreshToken = tokenData?.refreshToken;
3063
+ const expiresIn = tokenData?.expiresIn;
3064
+ const rExpiresIn = tokenData?.refreshExpiresIn;
3065
+ setPortal(currentPortal);
3066
+ setSubscriptionType(subscriptionType);
3067
+ await setAccessToken(token, expiresIn);
3068
+ await setRefreshToken(refreshToken, rExpiresIn);
3069
+ await setLoggedInDetails(response.data);
3070
+ actions.setProfile(response);
3071
+ setConfig.setDevPortalId(currentPortalId);
3072
+ return response;
3073
+ }
3074
+ async function applyLoginResponse(response) {
3075
+ const data = response?.data ?? response;
3076
+ if (data?.twoFactorRequired === true) {
3077
+ const tokenData = data?.tokenData || {};
3078
+ const token = tokenData?.token;
3079
+ const expiresIn = tokenData?.expiresIn;
3080
+ if (token) {
3081
+ await setAccessToken(token, expiresIn);
3082
+ }
3083
+ return response;
3084
+ }
3085
+ return completeLoginSession(response);
3086
+ }
3087
+
3088
+ // src/main/apis/authentication.ts
2846
3089
  function preLogin(options) {
2847
3090
  const { mutate, isLoading } = createMutation(
2848
3091
  async (payload) => {
@@ -2861,22 +3104,7 @@ function login(options) {
2861
3104
  const { mutate, isLoading } = createMutation(
2862
3105
  async (payload) => {
2863
3106
  const response = await Client.authentication.login(payload);
2864
- const tokenData = response?.data?.tokenData || {};
2865
- const loggedInDetails = response?.data?.loggedInDetails || {};
2866
- const currentPortal = response?.data?.loggedInDetails?.currentPortal || {};
2867
- const currentPortalId = currentPortal?.portalId || null;
2868
- const SubscriptionType = loggedInDetails?.subscriptionType || "BASIC";
2869
- const token = tokenData?.token;
2870
- const refreshToken = tokenData?.refreshToken;
2871
- const expiresIn = tokenData?.expiresIn;
2872
- const rExpiresIn = tokenData?.refreshExpiresIn;
2873
- setPortal(currentPortal);
2874
- setSubscriptionType(SubscriptionType);
2875
- await setAccessToken(token, expiresIn);
2876
- await setRefreshToken(refreshToken, rExpiresIn);
2877
- await setLoggedInDetails(response.data);
2878
- actions.setProfile(response);
2879
- setConfig.setDevPortalId(currentPortalId);
3107
+ await applyLoginResponse(response);
2880
3108
  return response;
2881
3109
  },
2882
3110
  options
@@ -3008,7 +3236,197 @@ function resendEmail(options) {
3008
3236
  };
3009
3237
  }
3010
3238
 
3011
- // src/apis/sso.ts
3239
+ // src/main/apis/mfa.ts
3240
+ function verifyOtp(options) {
3241
+ const { mutate, isLoading } = createMutation(
3242
+ async (payload) => {
3243
+ const response = await Client.authentication.verifyOtp(payload);
3244
+ await applyLoginResponse(response);
3245
+ return response;
3246
+ },
3247
+ options
3248
+ );
3249
+ return { mutate, verifyOtp: mutate, isLoading };
3250
+ }
3251
+ function sendMfaOtp(options) {
3252
+ const { mutate, isLoading } = createMutation(
3253
+ async (payload) => Client.mfa.sendPendingOtp(payload),
3254
+ options
3255
+ );
3256
+ return { mutate, sendMfaOtp: mutate, isLoading };
3257
+ }
3258
+ function pendingPasskeyOptions(options) {
3259
+ const { mutate, isLoading } = createMutation(
3260
+ async (payload) => Client.mfa.pendingPasskeyOptions(payload),
3261
+ options
3262
+ );
3263
+ return { mutate, pendingPasskeyOptions: mutate, isLoading };
3264
+ }
3265
+ function pendingPasskeyVerify(options) {
3266
+ const { mutate, isLoading } = createMutation(
3267
+ async (payload) => {
3268
+ const response = await Client.mfa.pendingPasskeyVerify(payload);
3269
+ await applyLoginResponse(response);
3270
+ return response;
3271
+ },
3272
+ options
3273
+ );
3274
+ return { mutate, pendingPasskeyVerify: mutate, isLoading };
3275
+ }
3276
+ function getMfaStatus(options) {
3277
+ const { mutate, isLoading } = createMutation(
3278
+ async (payload) => Client.mfa.getStatus(payload),
3279
+ options
3280
+ );
3281
+ return { mutate, getMfaStatus: mutate, isLoading };
3282
+ }
3283
+ function setMfaPreferences(options) {
3284
+ const { mutate, isLoading } = createMutation(
3285
+ async (payload) => {
3286
+ const { portalId, ...data } = payload;
3287
+ return Client.mfa.setPreferences(data, { portalId });
3288
+ },
3289
+ options
3290
+ );
3291
+ return { mutate, setMfaPreferences: mutate, isLoading };
3292
+ }
3293
+ function startPhoneVerify(options) {
3294
+ const { mutate, isLoading } = createMutation(
3295
+ async (payload) => Client.mfa.startPhoneVerify(payload),
3296
+ options
3297
+ );
3298
+ return { mutate, startPhoneVerify: mutate, isLoading };
3299
+ }
3300
+ function confirmPhoneVerify(options) {
3301
+ const { mutate, isLoading } = createMutation(
3302
+ async (payload) => Client.mfa.confirmPhoneVerify(payload),
3303
+ options
3304
+ );
3305
+ return { mutate, confirmPhoneVerify: mutate, isLoading };
3306
+ }
3307
+ function totpEnrollStart(options) {
3308
+ const { mutate, isLoading } = createMutation(
3309
+ async (payload) => Client.mfa.totpEnrollStart(payload),
3310
+ options
3311
+ );
3312
+ return { mutate, totpEnrollStart: mutate, isLoading };
3313
+ }
3314
+ function totpEnrollVerify(options) {
3315
+ const { mutate, isLoading } = createMutation(
3316
+ async (payload) => Client.mfa.totpEnrollVerify(payload),
3317
+ options
3318
+ );
3319
+ return { mutate, totpEnrollVerify: mutate, isLoading };
3320
+ }
3321
+ function totpDisable(options) {
3322
+ const { mutate, isLoading } = createMutation(
3323
+ async (payload) => Client.mfa.totpDisable(payload),
3324
+ options
3325
+ );
3326
+ return { mutate, totpDisable: mutate, isLoading };
3327
+ }
3328
+ function webauthnRegisterOptions(options) {
3329
+ const { mutate, isLoading } = createMutation(
3330
+ async (payload) => Client.mfa.webauthnRegisterOptions(payload),
3331
+ options
3332
+ );
3333
+ return { mutate, webauthnRegisterOptions: mutate, isLoading };
3334
+ }
3335
+ function webauthnRegisterVerify(options) {
3336
+ const { mutate, isLoading } = createMutation(
3337
+ async (payload) => Client.mfa.webauthnRegisterVerify(payload),
3338
+ options
3339
+ );
3340
+ return { mutate, webauthnRegisterVerify: mutate, isLoading };
3341
+ }
3342
+ function webauthnAuthOptions(options) {
3343
+ const { mutate, isLoading } = createMutation(
3344
+ async (payload) => Client.mfa.webauthnAuthOptions(payload),
3345
+ options
3346
+ );
3347
+ return { mutate, webauthnAuthOptions: mutate, isLoading };
3348
+ }
3349
+ function webauthnAuthVerify(options) {
3350
+ const { mutate, isLoading } = createMutation(
3351
+ async (payload) => Client.mfa.webauthnAuthVerify(payload),
3352
+ options
3353
+ );
3354
+ return { mutate, webauthnAuthVerify: mutate, isLoading };
3355
+ }
3356
+ function listWebauthnCredentials(options) {
3357
+ const { mutate, isLoading } = createMutation(
3358
+ async (payload) => Client.mfa.listWebauthnCredentials(payload),
3359
+ options
3360
+ );
3361
+ return { mutate, listWebauthnCredentials: mutate, isLoading };
3362
+ }
3363
+ function deleteWebauthnCredential(options) {
3364
+ const { mutate, isLoading } = createMutation(
3365
+ async (payload) => {
3366
+ const { credentialRecordId, portalId } = payload;
3367
+ return Client.mfa.deleteWebauthnCredential(credentialRecordId, { portalId });
3368
+ },
3369
+ options
3370
+ );
3371
+ return { mutate, deleteWebauthnCredential: mutate, isLoading };
3372
+ }
3373
+ function passkeyLoginOptions(options) {
3374
+ const { mutate, isLoading } = createMutation(
3375
+ async (payload) => Client.mfa.passkeyLoginOptions(payload),
3376
+ options
3377
+ );
3378
+ return { mutate, passkeyLoginOptions: mutate, isLoading };
3379
+ }
3380
+ function passkeyLoginVerify(options) {
3381
+ const { mutate, isLoading } = createMutation(
3382
+ async (payload) => {
3383
+ const response = await Client.mfa.passkeyLoginVerify(payload);
3384
+ await applyLoginResponse(response);
3385
+ return response;
3386
+ },
3387
+ options
3388
+ );
3389
+ return { mutate, passkeyLoginVerify: mutate, isLoading };
3390
+ }
3391
+
3392
+ // src/main/apis/security.ts
3393
+ function getSecurityOverview(options) {
3394
+ const { mutate, isLoading } = createMutation(
3395
+ async (payload) => Client.security.getOverview(payload),
3396
+ options
3397
+ );
3398
+ return { mutate, getSecurityOverview: mutate, isLoading };
3399
+ }
3400
+ function getSecurityLoginActivity(options) {
3401
+ const { mutate, isLoading } = createMutation(
3402
+ async (payload) => Client.security.getLoginActivity(payload),
3403
+ options
3404
+ );
3405
+ return { mutate, getSecurityLoginActivity: mutate, isLoading };
3406
+ }
3407
+ function getSecuritySessions(options) {
3408
+ const { mutate, isLoading } = createMutation(
3409
+ async (payload) => Client.security.getSessions(payload),
3410
+ options
3411
+ );
3412
+ return { mutate, getSecuritySessions: mutate, isLoading };
3413
+ }
3414
+ function revokeSecuritySession(options) {
3415
+ const { mutate, isLoading } = createMutation(
3416
+ async (payload) => Client.security.revokeSession(payload),
3417
+ options
3418
+ );
3419
+ return { mutate, revokeSecuritySession: mutate, isLoading };
3420
+ }
3421
+ function revokeOtherSecuritySessions(options) {
3422
+ const { mutate, isLoading } = createMutation(
3423
+ async (payload) => Client.security.revokeOtherSessions(payload?.refreshToken),
3424
+ options
3425
+ );
3426
+ return { mutate, revokeOtherSecuritySessions: mutate, isLoading };
3427
+ }
3428
+
3429
+ // src/main/apis/sso.ts
3012
3430
  function getSsoDetails(options) {
3013
3431
  const { mutate, isLoading } = createMutation(
3014
3432
  async () => {
@@ -3052,7 +3470,7 @@ function ssoCallback(options) {
3052
3470
  };
3053
3471
  }
3054
3472
 
3055
- // src/apis/users.ts
3473
+ // src/main/apis/users.ts
3056
3474
  function me(options) {
3057
3475
  const { mutate, isLoading } = createMutation(
3058
3476
  async () => {
@@ -3097,7 +3515,7 @@ function changePassword(options) {
3097
3515
  };
3098
3516
  }
3099
3517
 
3100
- // src/apis/pipeline.ts
3518
+ // src/main/apis/pipeline.ts
3101
3519
  function list(options) {
3102
3520
  const {
3103
3521
  getTableParam
@@ -3117,7 +3535,7 @@ function list(options) {
3117
3535
  };
3118
3536
  }
3119
3537
 
3120
- // src/apis/stage.ts
3538
+ // src/main/apis/stage.ts
3121
3539
  function list2(options) {
3122
3540
  const { mutate, isLoading } = createMutation(
3123
3541
  async (payload) => {
@@ -3133,7 +3551,7 @@ function list2(options) {
3133
3551
  };
3134
3552
  }
3135
3553
 
3136
- // src/store2/use-multi-object.ts
3554
+ // src/main/store2/use-multi-object.ts
3137
3555
  var multiObjectStore = createStore({
3138
3556
  objects: {},
3139
3557
  objectsPrependData: {},
@@ -3228,7 +3646,7 @@ var actions9 = {
3228
3646
  }
3229
3647
  };
3230
3648
 
3231
- // src/apis/object.ts
3649
+ // src/main/apis/object.ts
3232
3650
  function list3(options) {
3233
3651
  const { getTableParam } = useTable();
3234
3652
  const { setObjectsData, setTableData } = actions3;
@@ -3371,7 +3789,7 @@ function update(options) {
3371
3789
  };
3372
3790
  }
3373
3791
 
3374
- // src/apis/note.ts
3792
+ // src/main/apis/note.ts
3375
3793
  function list4(options) {
3376
3794
  const { setNotes } = actions5;
3377
3795
  const { mutate, isLoading } = createMutation(
@@ -3421,7 +3839,7 @@ function update2(options) {
3421
3839
  };
3422
3840
  }
3423
3841
 
3424
- // src/apis/email.ts
3842
+ // src/main/apis/email.ts
3425
3843
  function list5(options) {
3426
3844
  const { setEmails } = actions6;
3427
3845
  const { mutate, isLoading } = createMutation(
@@ -3471,7 +3889,7 @@ function update3(options) {
3471
3889
  };
3472
3890
  }
3473
3891
 
3474
- // src/apis/uploader.ts
3892
+ // src/main/apis/uploader.ts
3475
3893
  function imageUpload(options) {
3476
3894
  const { mutate, isLoading } = createMutation(
3477
3895
  async (payload) => {
@@ -3502,7 +3920,7 @@ function attachmentUpload(options) {
3502
3920
  };
3503
3921
  }
3504
3922
 
3505
- // src/apis/file.ts
3923
+ // src/main/apis/file.ts
3506
3924
  function list6(options) {
3507
3925
  const { mutate, isLoading } = createMutation(
3508
3926
  async (payload) => {
@@ -3574,7 +3992,7 @@ function download(options) {
3574
3992
  };
3575
3993
  }
3576
3994
 
3577
- // src/apis/cache.ts
3995
+ // src/main/apis/cache.ts
3578
3996
  function purge(options) {
3579
3997
  const { mutate, isLoading } = createMutation(
3580
3998
  async (payload) => {
@@ -3600,7 +4018,7 @@ function purgeStatus(purgeJobId, options) {
3600
4018
  };
3601
4019
  }
3602
4020
 
3603
- // src/breadcrumb/breadcrumbs.ts
4021
+ // src/main/breadcrumb/breadcrumbs.ts
3604
4022
  var getBreadcrumbs = () => {
3605
4023
  const search = getParam("b");
3606
4024
  let breadcrumbs = decodeToBase64(search) || [];
@@ -3691,7 +4109,7 @@ var nameTrancate = (name) => {
3691
4109
  return name?.length > 30 ? `${name?.slice(0, 30) + "..."}` : name;
3692
4110
  };
3693
4111
 
3694
- // src/breadcrumb/generate-url.ts
4112
+ // src/main/breadcrumb/generate-url.ts
3695
4113
  var useMakeLink = () => {
3696
4114
  const search = getParam("b");
3697
4115
  const makeLink = (props) => {
@@ -3806,7 +4224,7 @@ var buildChildRoute = (props, breadcrumbItems) => {
3806
4224
  return generateUrl(props, breadcrumbs);
3807
4225
  };
3808
4226
 
3809
- // src/utils/datetime.ts
4227
+ // src/main/utils/datetime.ts
3810
4228
  var DEFAULT_HUBSPOT_TIMEZONE = "Asia/Kolkata";
3811
4229
  function getCurrentTimeZone() {
3812
4230
  try {
@@ -3866,10 +4284,11 @@ function formatHubSpotActivityDateTime(timestamp, timeZone = getCurrentTimeZone(
3866
4284
  return formatHubSpotActivityDateTimeParts(timestamp, timeZone)?.formatted ?? "";
3867
4285
  }
3868
4286
 
3869
- // src/index.ts
4287
+ // src/main/index.ts
3870
4288
  var api = {
3871
4289
  preLogin,
3872
4290
  login,
4291
+ verifyOtp,
3873
4292
  verifyEmail,
3874
4293
  resetPasswordVerifyToken,
3875
4294
  resetPassword,
@@ -3884,6 +4303,29 @@ var api = {
3884
4303
  me,
3885
4304
  profile,
3886
4305
  changePassword,
4306
+ sendMfaOtp,
4307
+ pendingPasskeyOptions,
4308
+ pendingPasskeyVerify,
4309
+ getMfaStatus,
4310
+ setMfaPreferences,
4311
+ startPhoneVerify,
4312
+ confirmPhoneVerify,
4313
+ totpEnrollStart,
4314
+ totpEnrollVerify,
4315
+ totpDisable,
4316
+ webauthnRegisterOptions,
4317
+ webauthnRegisterVerify,
4318
+ webauthnAuthOptions,
4319
+ webauthnAuthVerify,
4320
+ listWebauthnCredentials,
4321
+ deleteWebauthnCredential,
4322
+ passkeyLoginOptions,
4323
+ passkeyLoginVerify,
4324
+ getSecurityOverview,
4325
+ getSecurityLoginActivity,
4326
+ getSecuritySessions,
4327
+ revokeSecuritySession,
4328
+ revokeOtherSecuritySessions,
3887
4329
  pipelines: list,
3888
4330
  stages: list2,
3889
4331
  objects: list3,
@@ -3936,5 +4378,5 @@ var routeParam = {
3936
4378
  };
3937
4379
 
3938
4380
  export { DEFAULT_HUBSPOT_TIMEZONE, actions, actions3 as actions2, actions4 as actions3, actions5 as actions4, actions6 as actions5, actions8 as actions6, actions9 as actions7, 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, userStore };
3939
- //# sourceMappingURL=chunk-YEHZZGAU.js.map
3940
- //# sourceMappingURL=chunk-YEHZZGAU.js.map
4381
+ //# sourceMappingURL=chunk-C76BHDO4.js.map
4382
+ //# sourceMappingURL=chunk-C76BHDO4.js.map