woodsportal-client-sdk 1.1.4-dev.6 → 1.1.4-dev.60
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/CHANGELOG.md +4 -0
- package/README.md +64 -2
- package/dist/adapters/angular/index.d.ts +42 -0
- package/dist/adapters/angular/index.js +34 -0
- package/dist/adapters/angular/index.js.map +1 -0
- package/dist/adapters/react/index.d.ts +42 -0
- package/dist/adapters/react/index.js +18 -0
- package/dist/adapters/react/index.js.map +1 -0
- package/dist/adapters/vue/index.d.ts +42 -0
- package/dist/adapters/vue/index.js +25 -0
- package/dist/adapters/vue/index.js.map +1 -0
- package/dist/auth-utils-TZSW6BVD.js +3 -0
- package/dist/auth-utils-TZSW6BVD.js.map +1 -0
- package/dist/chunk-2SYUOWTT.js +139 -0
- package/dist/chunk-2SYUOWTT.js.map +1 -0
- package/dist/chunk-AZ7K37OU.js +17 -0
- package/dist/chunk-AZ7K37OU.js.map +1 -0
- package/dist/chunk-IVNXDHLP.js +3641 -0
- package/dist/chunk-IVNXDHLP.js.map +1 -0
- package/dist/chunk-Y5MRAAGK.js +10 -0
- package/dist/chunk-Y5MRAAGK.js.map +1 -0
- package/dist/index.d.ts +209 -2
- package/dist/index.js +2 -2278
- package/dist/index.js.map +1 -1
- package/dist/use-uploader-DOpqLu77.d.ts +55 -0
- package/package.json +45 -8
package/dist/index.js
CHANGED
|
@@ -1,2280 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import pako from 'pako';
|
|
4
|
-
import { Base64 } from 'js-base64';
|
|
5
|
-
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __esm = (fn, res) => function __init() {
|
|
9
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
-
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// src/utils/constants.ts
|
|
17
|
-
var LOGIN_DETAILS, REFRESH_TOKEN, PORTAL, SUBSCRIPTION_TYPE, HUBSPOT_DATA, HUB_ID, DEV_PORTAL_ID, PORTAL_ID;
|
|
18
|
-
var init_constants = __esm({
|
|
19
|
-
"src/utils/constants.ts"() {
|
|
20
|
-
LOGIN_DETAILS = "loginDetails";
|
|
21
|
-
REFRESH_TOKEN = "refreshToken";
|
|
22
|
-
PORTAL = "portal";
|
|
23
|
-
SUBSCRIPTION_TYPE = "ssubscriptionType";
|
|
24
|
-
HUBSPOT_DATA = "hubSpotData";
|
|
25
|
-
HUB_ID = "hubId";
|
|
26
|
-
DEV_PORTAL_ID = "devPortalId";
|
|
27
|
-
PORTAL_ID = "portalId";
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var setCookie, getCookie, removeAllCookie, isCookieExpired;
|
|
31
|
-
var init_cookie = __esm({
|
|
32
|
-
"src/utils/cookie.ts"() {
|
|
33
|
-
setCookie = (key, value, expire) => {
|
|
34
|
-
return Cookies.set(key, value, {
|
|
35
|
-
expires: expire,
|
|
36
|
-
sameSite: "none",
|
|
37
|
-
secure: true
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
getCookie = (key) => {
|
|
41
|
-
return Cookies.get(key);
|
|
42
|
-
};
|
|
43
|
-
removeAllCookie = () => {
|
|
44
|
-
Object.keys(Cookies.get()).forEach((cookieName) => {
|
|
45
|
-
Cookies.remove(cookieName);
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
isCookieExpired = (key) => {
|
|
49
|
-
const value = Cookies.get(key);
|
|
50
|
-
try {
|
|
51
|
-
const { expiresAt } = JSON.parse(value);
|
|
52
|
-
return Date.now() > expiresAt ? true : false;
|
|
53
|
-
} catch {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// src/clint/auth-utils.ts
|
|
61
|
-
var auth_utils_exports = {};
|
|
62
|
-
__export(auth_utils_exports, {
|
|
63
|
-
getPortal: () => getPortal,
|
|
64
|
-
getProfile: () => getProfile,
|
|
65
|
-
getRefreshToken: () => getRefreshToken,
|
|
66
|
-
getSubscriptionType: () => getSubscriptionType,
|
|
67
|
-
setAccessToken: () => setAccessToken,
|
|
68
|
-
setLoggedInDetails: () => setLoggedInDetails,
|
|
69
|
-
setPortal: () => setPortal,
|
|
70
|
-
setRefreshToken: () => setRefreshToken,
|
|
71
|
-
setSubscriptionType: () => setSubscriptionType
|
|
72
|
-
});
|
|
73
|
-
function setRefreshToken(token, expiresAt) {
|
|
74
|
-
return new Promise((resolve) => {
|
|
75
|
-
setCookie(REFRESH_TOKEN, JSON.stringify(token), expiresAt);
|
|
76
|
-
resolve();
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
function setAccessToken(token, expiresIn) {
|
|
80
|
-
return new Promise((resolve) => {
|
|
81
|
-
storAccessToken(token, expiresIn);
|
|
82
|
-
resolve();
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
function getProfile() {
|
|
86
|
-
return JSON.parse(getCookie(LOGIN_DETAILS || null) || null);
|
|
87
|
-
}
|
|
88
|
-
function getRefreshToken() {
|
|
89
|
-
return JSON.parse(getCookie(REFRESH_TOKEN || null) || null);
|
|
90
|
-
}
|
|
91
|
-
function getPortal() {
|
|
92
|
-
return JSON.parse(getCookie(PORTAL || null) || null);
|
|
93
|
-
}
|
|
94
|
-
function getSubscriptionType() {
|
|
95
|
-
return JSON.parse(getCookie(SUBSCRIPTION_TYPE || null) || null);
|
|
96
|
-
}
|
|
97
|
-
var setLoggedInDetails, setPortal, setSubscriptionType;
|
|
98
|
-
var init_auth_utils = __esm({
|
|
99
|
-
"src/clint/auth-utils.ts"() {
|
|
100
|
-
init_constants();
|
|
101
|
-
init_cookie();
|
|
102
|
-
init_token_store();
|
|
103
|
-
setLoggedInDetails = async (data) => {
|
|
104
|
-
return new Promise((resolve) => {
|
|
105
|
-
setCookie(LOGIN_DETAILS, JSON.stringify(data));
|
|
106
|
-
resolve();
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
setPortal = async (data) => {
|
|
110
|
-
return new Promise((resolve) => {
|
|
111
|
-
setCookie(PORTAL, JSON.stringify(data));
|
|
112
|
-
resolve();
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
setSubscriptionType = async (data) => {
|
|
116
|
-
return new Promise((resolve) => {
|
|
117
|
-
setCookie(SUBSCRIPTION_TYPE, JSON.stringify(data));
|
|
118
|
-
resolve();
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
// src/clint/token-store.ts
|
|
125
|
-
function getAccessToken() {
|
|
126
|
-
return accessToken;
|
|
127
|
-
}
|
|
128
|
-
function storAccessToken(token, expiresIn) {
|
|
129
|
-
accessToken = token;
|
|
130
|
-
if (expiresIn) {
|
|
131
|
-
tokenExpiresAt = Date.now() + expiresIn * 1e3;
|
|
132
|
-
} else {
|
|
133
|
-
tokenExpiresAt = null;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function clearAccessToken() {
|
|
137
|
-
accessToken = null;
|
|
138
|
-
tokenExpiresAt = null;
|
|
139
|
-
}
|
|
140
|
-
function isExpiresAccessToken() {
|
|
141
|
-
if (!tokenExpiresAt) return true;
|
|
142
|
-
return Date.now() >= tokenExpiresAt;
|
|
143
|
-
}
|
|
144
|
-
function setRefreshCallback(callback) {
|
|
145
|
-
refreshCallback = callback;
|
|
146
|
-
}
|
|
147
|
-
async function ensureValidRefresh() {
|
|
148
|
-
if (isExpiresAccessToken() && refreshCallback) {
|
|
149
|
-
const { getRefreshToken: getRefreshToken2 } = await Promise.resolve().then(() => (init_auth_utils(), auth_utils_exports));
|
|
150
|
-
const refreshToken = getRefreshToken2();
|
|
151
|
-
if (refreshToken) {
|
|
152
|
-
await refreshCallback(refreshToken);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function isAuthenticateApp() {
|
|
157
|
-
if (isCookieExpired(REFRESH_TOKEN) || isExpiresAccessToken()) {
|
|
158
|
-
return false;
|
|
159
|
-
}
|
|
160
|
-
return true;
|
|
161
|
-
}
|
|
162
|
-
var accessToken, tokenExpiresAt, refreshCallback;
|
|
163
|
-
var init_token_store = __esm({
|
|
164
|
-
"src/clint/token-store.ts"() {
|
|
165
|
-
init_cookie();
|
|
166
|
-
init_constants();
|
|
167
|
-
accessToken = null;
|
|
168
|
-
tokenExpiresAt = null;
|
|
169
|
-
refreshCallback = null;
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
// src/utils/config.ts
|
|
174
|
-
init_constants();
|
|
175
|
-
|
|
176
|
-
// src/utils/localStoraget.ts
|
|
177
|
-
var storage = {
|
|
178
|
-
set: (key, value) => {
|
|
179
|
-
localStorage.setItem(key, JSON.stringify(value));
|
|
180
|
-
},
|
|
181
|
-
get: (key) => {
|
|
182
|
-
const item = localStorage.getItem(key);
|
|
183
|
-
return item ? JSON.parse(item) : null;
|
|
184
|
-
},
|
|
185
|
-
remove: (key) => {
|
|
186
|
-
localStorage.removeItem(key);
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
// src/utils/config.ts
|
|
191
|
-
var config = {
|
|
192
|
-
get hubId() {
|
|
193
|
-
const hubSpotData = storage.get(HUBSPOT_DATA);
|
|
194
|
-
return hubSpotData?.[HUB_ID] || "";
|
|
195
|
-
},
|
|
196
|
-
get devPortalId() {
|
|
197
|
-
const hubSpotData = storage.get(HUBSPOT_DATA);
|
|
198
|
-
return hubSpotData?.[DEV_PORTAL_ID] || "";
|
|
199
|
-
},
|
|
200
|
-
get portalId() {
|
|
201
|
-
const hubSpotData = storage.get(HUBSPOT_DATA);
|
|
202
|
-
return hubSpotData?.[PORTAL_ID] || "";
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
var setConfig = {
|
|
206
|
-
setDevPortalId(portalId) {
|
|
207
|
-
const existing = storage.get(HUBSPOT_DATA) || {};
|
|
208
|
-
storage.set(HUBSPOT_DATA, {
|
|
209
|
-
...existing,
|
|
210
|
-
[PORTAL_ID]: portalId
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
// src/utils/generateApiUrl.ts
|
|
216
|
-
var generateApiUrl = ({
|
|
217
|
-
route,
|
|
218
|
-
params = {},
|
|
219
|
-
queryParams = ""
|
|
220
|
-
}) => {
|
|
221
|
-
const defaultParams = {
|
|
222
|
-
hubId: config.hubId,
|
|
223
|
-
portalId: config.portalId
|
|
224
|
-
};
|
|
225
|
-
params = { ...defaultParams, ...params };
|
|
226
|
-
const url2 = replaceParams(route, params);
|
|
227
|
-
let queryString = "";
|
|
228
|
-
if (queryParams && typeof queryParams === "object") {
|
|
229
|
-
const cleanedParams = Object.entries(queryParams).filter(([_, value]) => value !== null && value !== void 0).reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {});
|
|
230
|
-
queryString = new URLSearchParams(cleanedParams).toString();
|
|
231
|
-
}
|
|
232
|
-
return queryString ? `${url2}?${queryString}` : url2;
|
|
233
|
-
};
|
|
234
|
-
function replaceParams(template, values) {
|
|
235
|
-
return template.replace(
|
|
236
|
-
/\$\{(\w+)\}/g,
|
|
237
|
-
(_, key) => key in values ? String(values[key]) : `\${${key}}`
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// src/clint/api-endpoints.ts
|
|
242
|
-
var API_ENDPOINTS = {
|
|
243
|
-
// Auth
|
|
244
|
-
PRE_LOGIN: "/api/auth/pre-login",
|
|
245
|
-
LOGIN: "/api/auth/login",
|
|
246
|
-
AUTH_REFRESH: "/api/auth/refresh",
|
|
247
|
-
FORGET_PASSWORD: "/api/auth/forget-password",
|
|
248
|
-
RESET_PASSWORD_VERIFY_TOKEN: "/api/auth/token/validate",
|
|
249
|
-
RESET_PASSWORD: "/api/auth/reset-password",
|
|
250
|
-
VERIFY_EMAIL: "/api/auth/verify-email",
|
|
251
|
-
REGISTER_EXISTING_USER: "/api/auth/existing-user-register",
|
|
252
|
-
RESEND_EMAIL: "/api/auth/resend-email",
|
|
253
|
-
LOGOUT: "/api/auth/logout",
|
|
254
|
-
// SSO
|
|
255
|
-
SSO_DETAILS: "/api/auth/sso/active",
|
|
256
|
-
SSO_URL: "/api/auth/sso/authorize",
|
|
257
|
-
SSO_CALLBACK: "/api/auth/sso/callback",
|
|
258
|
-
// User
|
|
259
|
-
ME: "/api/auth/me",
|
|
260
|
-
PROFILE: "/api/${hubId}/${portalId}/profiles",
|
|
261
|
-
CHANGE_PASSWORD: "/api/auth/change-password",
|
|
262
|
-
// Pipeline
|
|
263
|
-
PIPELINES: "api/${hubId}/${portalId}/hubspot-object-pipelines/${hubspotObjectTypeId}",
|
|
264
|
-
// Stage
|
|
265
|
-
STAGES: "api/${hubId}/${portalId}/hubspot-object-pipelines/${objectTypeId}/${pipelineId}/stages",
|
|
266
|
-
// Object
|
|
267
|
-
OBJECTS: "api/${hubId}/${portalId}/hubspot-object-data/${hubspotObjectTypeId}",
|
|
268
|
-
OBJECTS_FORM: "api/${hubId}/${portalId}/hubspot-object-forms/${hubspotObjectTypeId}/fields",
|
|
269
|
-
OBJECTS_FORM_OPTIONS: "api/${hubId}/${portalId}/hubspot-object-forms/:fromRecordId/:fromObjectTypeId",
|
|
270
|
-
OBJECTS_CREATE: "api/${hubId}/${portalId}/hubspot-object-forms/${hubspotObjectTypeId}/fields",
|
|
271
|
-
OBJECTS_CREATE_EXISTING: "api/${hubId}/${portalId}/hubspot-object-forms/:fromObjectTypeId/:fromRecordId/associations/:toObjectTypeId",
|
|
272
|
-
OBJECTS_REMOVE_EXISTING: "api/${hubId}/${portalId}/hubspot-object-forms/:fromObjectTypeId/:fromRecordId/disassociate/:toObjectTypeId",
|
|
273
|
-
OBJECTS_DETAILS: "api/${hubId}/${portalId}/hubspot-object-data/${objectId}/${id}",
|
|
274
|
-
OBJECTS_DETAILS_UPDATE: "api/${hubId}/${portalId}/hubspot-object-forms/${objectId}/properties/${id}",
|
|
275
|
-
// Note
|
|
276
|
-
NOTES: "api/${hubId}/${portalId}/hubspot-object-notes/${objectId}/${id}",
|
|
277
|
-
NOTES_CREATE: "api/${hubId}/${portalId}/hubspot-object-notes/${objectId}/${id}",
|
|
278
|
-
NOTES_DETAILS_UPDATE: "api/${hubId}/${portalId}/hubspot-object-notes/${objectId}/${id}/${note_id}",
|
|
279
|
-
NOTES_IMAGE_UPLOAD: "api/${hubId}/${portalId}/hubspot-object-notes/images/${objectId}/${id}",
|
|
280
|
-
NOTES_ATTACHMENT_UPLOAD: "api/${hubId}/${portalId}/hubspot-object-notes/attachments/${objectId}/${id}",
|
|
281
|
-
// Email
|
|
282
|
-
EMAILS: "api/${hubId}/${portalId}/hubspot-object-emails/${objectId}/${id}",
|
|
283
|
-
EMAILS_CREATE: "api/${hubId}/${portalId}/hubspot-object-emails/${objectId}/${id}",
|
|
284
|
-
EMAILS_DETAILS_UPDATE: "api/${hubId}/${portalId}/hubspot-object-emails/${objectId}/${id}/${note_id}",
|
|
285
|
-
EMAILS_IMAGE_UPLOAD: "api/${hubId}/${portalId}/hubspot-object-emails/images/${objectId}/${id}",
|
|
286
|
-
EMAILS_ATTACHMENT_UPLOAD: "api/${hubId}/${portalId}/hubspot-object-emails/attachments/${objectId}/${id}",
|
|
287
|
-
// File
|
|
288
|
-
FILES: "api/${hubId}/${portalId}/hubspot-object-files/${objectId}/${id}",
|
|
289
|
-
FILE: "api/${hubId}/${portalId}/hubspot-object-files/${objectId}/${id}/${rowId}",
|
|
290
|
-
FILES_CREATE_FOLDER: "api/${hubId}/${portalId}/hubspot-object-folders/${objectId}/${id}",
|
|
291
|
-
FILES_UPLOAD: "api/${hubId}/${portalId}/hubspot-object-files/${objectId}/${id}",
|
|
292
|
-
FILES_DELETE: "api/feature-data/files/${me.hubspotPortals.templateName}${path}/${postId}/${fileId}"
|
|
293
|
-
};
|
|
294
|
-
init_token_store();
|
|
295
|
-
|
|
296
|
-
// src/clint/config.ts
|
|
297
|
-
var config2 = {
|
|
298
|
-
baseURL: "https://api.dev.woodsportal.com"
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
// src/clint/http-clint.ts
|
|
302
|
-
init_auth_utils();
|
|
303
|
-
var axiosInstance = null;
|
|
304
|
-
var config3 = {};
|
|
305
|
-
function initializeHttpClient(clientConfig) {
|
|
306
|
-
config3 = clientConfig;
|
|
307
|
-
const baseURL = config3.baseURL ?? config2.baseURL;
|
|
308
|
-
const timeout = config3.timeout ?? 5e4;
|
|
309
|
-
axiosInstance = axios.create({
|
|
310
|
-
baseURL,
|
|
311
|
-
timeout,
|
|
312
|
-
headers: {
|
|
313
|
-
"Content-Type": "application/json",
|
|
314
|
-
...config3.headers
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
setRefreshCallback(getAuthRefreshToken);
|
|
318
|
-
axiosInstance.interceptors.request.use((config4) => {
|
|
319
|
-
const token = getAccessToken();
|
|
320
|
-
if (token) {
|
|
321
|
-
config4.headers.set("Authorization", `Bearer ${token}`);
|
|
322
|
-
}
|
|
323
|
-
return config4;
|
|
324
|
-
});
|
|
325
|
-
axiosInstance.interceptors.response.use(
|
|
326
|
-
(response) => response,
|
|
327
|
-
(error) => {
|
|
328
|
-
if (error.response && error.response.status === 401) {
|
|
329
|
-
config3.skipCurrentPublicPath?.() ?? false;
|
|
330
|
-
}
|
|
331
|
-
return Promise.reject(error);
|
|
332
|
-
}
|
|
333
|
-
);
|
|
334
|
-
}
|
|
335
|
-
function getAxiosInstance() {
|
|
336
|
-
if (!axiosInstance) {
|
|
337
|
-
initializeHttpClient({
|
|
338
|
-
baseURL: config2.baseURL,
|
|
339
|
-
timeout: 5e4
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
return axiosInstance;
|
|
343
|
-
}
|
|
344
|
-
function formatBooleanSearchParam(key, value) {
|
|
345
|
-
return value ? `${key}:1` : `${key}:`;
|
|
346
|
-
}
|
|
347
|
-
var HttpClient = class {
|
|
348
|
-
static async get(url2, params) {
|
|
349
|
-
await ensureValidRefresh();
|
|
350
|
-
const response = await getAxiosInstance().get(url2, { params });
|
|
351
|
-
return response.data;
|
|
352
|
-
}
|
|
353
|
-
static async post(url2, data, options) {
|
|
354
|
-
await ensureValidRefresh();
|
|
355
|
-
const response = await getAxiosInstance().post(url2, data, options);
|
|
356
|
-
return response.data;
|
|
357
|
-
}
|
|
358
|
-
static async put(url2, data) {
|
|
359
|
-
await ensureValidRefresh();
|
|
360
|
-
const response = await getAxiosInstance().put(url2, data);
|
|
361
|
-
return response.data;
|
|
362
|
-
}
|
|
363
|
-
static async delete(url2) {
|
|
364
|
-
await ensureValidRefresh();
|
|
365
|
-
const response = await getAxiosInstance().delete(url2);
|
|
366
|
-
return response.data;
|
|
367
|
-
}
|
|
368
|
-
static formatSearchParams(params) {
|
|
369
|
-
return Object.entries(params).filter(([, value]) => Boolean(value)).map(
|
|
370
|
-
([k, v]) => [
|
|
371
|
-
"type",
|
|
372
|
-
"categories",
|
|
373
|
-
"tags",
|
|
374
|
-
"author",
|
|
375
|
-
"manufacturer",
|
|
376
|
-
"shops",
|
|
377
|
-
"refund_reason"
|
|
378
|
-
].includes(k) ? `${k}.slug:${v}` : ["is_approved"].includes(k) ? formatBooleanSearchParam(k, v) : `${k}:${v}`
|
|
379
|
-
).join(";");
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
var AuthHttpClient = class {
|
|
383
|
-
static async get(url2, params) {
|
|
384
|
-
const response = await getAxiosInstance().get(url2, { params });
|
|
385
|
-
return response.data;
|
|
386
|
-
}
|
|
387
|
-
static async post(url2, data, options) {
|
|
388
|
-
const response = await getAxiosInstance().post(url2, data, options);
|
|
389
|
-
return response.data;
|
|
390
|
-
}
|
|
391
|
-
static async put(url2, data, options) {
|
|
392
|
-
const response = await getAxiosInstance().put(url2, data, options);
|
|
393
|
-
return response.data;
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
function getFormErrors(error) {
|
|
397
|
-
if (axios.isAxiosError(error)) {
|
|
398
|
-
return error.response?.data?.message ?? null;
|
|
399
|
-
}
|
|
400
|
-
return null;
|
|
401
|
-
}
|
|
402
|
-
function getFieldErrors(error) {
|
|
403
|
-
if (axios.isAxiosError(error)) {
|
|
404
|
-
return error.response?.data?.errors ?? null;
|
|
405
|
-
}
|
|
406
|
-
return null;
|
|
407
|
-
}
|
|
408
|
-
async function getAuthRefreshToken(refreshToken) {
|
|
409
|
-
try {
|
|
410
|
-
const headers = {};
|
|
411
|
-
if (config.devPortalId) {
|
|
412
|
-
headers["X-Dev-Portal-Id"] = config.devPortalId;
|
|
413
|
-
}
|
|
414
|
-
const api_url = generateApiUrl({ route: API_ENDPOINTS.AUTH_REFRESH, queryParams: { hubId: config.hubId } });
|
|
415
|
-
const response = await getAxiosInstance().post(
|
|
416
|
-
api_url,
|
|
417
|
-
{ refreshToken },
|
|
418
|
-
{ headers }
|
|
419
|
-
);
|
|
420
|
-
const maybeData = response?.data?.data || response?.data;
|
|
421
|
-
const tokenData = maybeData?.tokenData || maybeData || {};
|
|
422
|
-
const newRefreshToken = tokenData?.refreshToken;
|
|
423
|
-
const token = tokenData?.token;
|
|
424
|
-
const expiresIn = tokenData?.expiresIn;
|
|
425
|
-
const rExpiresIn = tokenData?.refreshExpiresIn;
|
|
426
|
-
const rExpiresAt = tokenData?.refreshExpiresAt;
|
|
427
|
-
if (typeof newRefreshToken === "string") {
|
|
428
|
-
let rExpires = 0;
|
|
429
|
-
if (typeof rExpiresIn === "number") {
|
|
430
|
-
rExpires = Date.now() + rExpiresIn * 1e3;
|
|
431
|
-
} else if (typeof rExpiresAt === "number") {
|
|
432
|
-
rExpires = rExpiresAt * 1e3;
|
|
433
|
-
}
|
|
434
|
-
setRefreshToken(newRefreshToken, rExpires);
|
|
435
|
-
}
|
|
436
|
-
if (typeof token === "string") {
|
|
437
|
-
setAccessToken(token, typeof expiresIn === "number" ? expiresIn : void 0);
|
|
438
|
-
return { token, success: true };
|
|
439
|
-
}
|
|
440
|
-
return { token: null, success: false };
|
|
441
|
-
} catch {
|
|
442
|
-
return { token: null, success: false };
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
// src/data/user.ts
|
|
447
|
-
var PROFILE = null;
|
|
448
|
-
var setProfileData = (data) => {
|
|
449
|
-
PROFILE = data;
|
|
450
|
-
};
|
|
451
|
-
var getProfileData = () => {
|
|
452
|
-
return PROFILE;
|
|
453
|
-
};
|
|
454
|
-
function convertToBase64(obj) {
|
|
455
|
-
try {
|
|
456
|
-
if (!obj) return "";
|
|
457
|
-
const json = JSON.stringify(obj);
|
|
458
|
-
const compressed = pako.deflate(json);
|
|
459
|
-
const base64 = Base64.fromUint8Array(compressed, true);
|
|
460
|
-
return base64;
|
|
461
|
-
} catch (error) {
|
|
462
|
-
console.error("Failed to encode object:", error);
|
|
463
|
-
return "";
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
function decodeToBase64(encoded) {
|
|
467
|
-
try {
|
|
468
|
-
if (!encoded) return null;
|
|
469
|
-
const uint8Array = Base64.toUint8Array(encoded);
|
|
470
|
-
const decompressed = pako.inflate(uint8Array, { to: "string" });
|
|
471
|
-
return JSON.parse(decompressed);
|
|
472
|
-
} catch (error) {
|
|
473
|
-
console.error("Failed to decode object:", error);
|
|
474
|
-
return null;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
// src/breadcrumb/url-utils.ts
|
|
479
|
-
function mapKeysDeep(obj, keyMap2) {
|
|
480
|
-
if (Array.isArray(obj)) {
|
|
481
|
-
return obj.map((item) => mapKeysDeep(item, keyMap2));
|
|
482
|
-
} else if (obj !== null && typeof obj === "object") {
|
|
483
|
-
return Object.entries(obj).reduce((acc, [key, value]) => {
|
|
484
|
-
const mappedKey = keyMap2[key] || key;
|
|
485
|
-
acc[mappedKey] = mapKeysDeep(value, keyMap2);
|
|
486
|
-
return acc;
|
|
487
|
-
}, {});
|
|
488
|
-
}
|
|
489
|
-
return obj;
|
|
490
|
-
}
|
|
491
|
-
function isMessingParent(breadcrumbs) {
|
|
492
|
-
let lastItem = breadcrumbs[breadcrumbs.length - 1];
|
|
493
|
-
let lastItem2 = breadcrumbs[breadcrumbs.length - 2];
|
|
494
|
-
let lastItem3 = breadcrumbs[breadcrumbs.length - 3];
|
|
495
|
-
return lastItem?.o_r_id && (!lastItem2?.o_r_id && lastItem2?.o_t_id) && lastItem3?.o_r_id ? true : false;
|
|
496
|
-
}
|
|
497
|
-
function isMessingParentLastItem(breadcrumbs) {
|
|
498
|
-
let lastItem = breadcrumbs[breadcrumbs.length - 1];
|
|
499
|
-
let lastItem2 = breadcrumbs[breadcrumbs.length - 2];
|
|
500
|
-
return !lastItem?.o_t_id && (lastItem2?.o_r_id && lastItem2?.o_t_id) ? false : true;
|
|
501
|
-
}
|
|
502
|
-
function breadcrumbStage(breadcrumbItems) {
|
|
503
|
-
let breadcrumbType = "child";
|
|
504
|
-
if (breadcrumbItems.length === 1) {
|
|
505
|
-
breadcrumbType = "root";
|
|
506
|
-
} else if (breadcrumbItems.length === 2) {
|
|
507
|
-
breadcrumbType = "root_details";
|
|
508
|
-
}
|
|
509
|
-
return breadcrumbType;
|
|
510
|
-
}
|
|
511
|
-
var generateUrl = (props, breadcrumbs) => {
|
|
512
|
-
const newBase64 = convertToBase64(breadcrumbs);
|
|
513
|
-
let url2 = "";
|
|
514
|
-
if (props?.objectTypeId && props?.recordId) {
|
|
515
|
-
url2 = `/${props?.recordId}/${props?.objectTypeId}/${props?.recordId}?b=${newBase64}`;
|
|
516
|
-
} else {
|
|
517
|
-
url2 = `/association/${props?.objectTypeId}?b=${newBase64}`;
|
|
518
|
-
}
|
|
519
|
-
return url2;
|
|
520
|
-
};
|
|
521
|
-
function getTotalParentLength(data) {
|
|
522
|
-
return data.filter(
|
|
523
|
-
(item) => (item.pt || item.o_t_id) && !item.o_r_id
|
|
524
|
-
).length;
|
|
525
|
-
}
|
|
526
|
-
var generatePath = (breadcrumbs, breadcrumb, index) => {
|
|
527
|
-
const bc = convertToBase64(breadcrumbs.slice(0, index + 1));
|
|
528
|
-
if (index === 0) {
|
|
529
|
-
return {
|
|
530
|
-
name: breadcrumb?.n,
|
|
531
|
-
path: `/${breadcrumb?.pt || breadcrumb?.o_t_id}?b=${bc}`
|
|
532
|
-
};
|
|
533
|
-
} else if (index === 1) {
|
|
534
|
-
if (breadcrumb?.isHome) {
|
|
535
|
-
return {
|
|
536
|
-
name: breadcrumb?.n,
|
|
537
|
-
path: `/association/${breadcrumb?.o_t_id}?b=${bc}`
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
return {
|
|
541
|
-
name: breadcrumb?.n,
|
|
542
|
-
path: `/${breadcrumb?.o_r_id}/${breadcrumb?.o_t_id}/${breadcrumb?.o_r_id}?b=${bc}`
|
|
543
|
-
};
|
|
544
|
-
} else {
|
|
545
|
-
if (breadcrumb?.o_t_id && breadcrumb?.o_r_id && !breadcrumb?.isHome) {
|
|
546
|
-
return {
|
|
547
|
-
name: breadcrumb?.n,
|
|
548
|
-
path: `/${breadcrumb?.o_r_id}/${breadcrumb?.o_t_id}/${breadcrumb?.o_r_id}?b=${bc}`
|
|
549
|
-
};
|
|
550
|
-
} else {
|
|
551
|
-
return {
|
|
552
|
-
name: breadcrumb?.n,
|
|
553
|
-
path: `/association/${breadcrumb?.o_t_id}?b=${bc}`
|
|
554
|
-
};
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
};
|
|
558
|
-
|
|
559
|
-
// src/breadcrumb/key-map.ts
|
|
560
|
-
var keyMap = {
|
|
561
|
-
dp: "defPermissions",
|
|
562
|
-
n: "name",
|
|
563
|
-
sort: "sort",
|
|
564
|
-
o_t_id: "objectTypeId",
|
|
565
|
-
s: "search",
|
|
566
|
-
fPn: "filterPropertyName",
|
|
567
|
-
fO: "filterOperator",
|
|
568
|
-
fV: "filterValue",
|
|
569
|
-
c: "cache",
|
|
570
|
-
isPC: "isPrimaryCompany",
|
|
571
|
-
v: "view",
|
|
572
|
-
l: "limit",
|
|
573
|
-
pt: "path",
|
|
574
|
-
p: "page",
|
|
575
|
-
a: "after",
|
|
576
|
-
aPip: "activePipeline",
|
|
577
|
-
aT: "activeTab",
|
|
578
|
-
cT: "create",
|
|
579
|
-
dP: "display",
|
|
580
|
-
dL: "display_label",
|
|
581
|
-
pId: "pipeline_id"
|
|
582
|
-
};
|
|
583
|
-
|
|
584
|
-
// src/utils/param.ts
|
|
585
|
-
function getParam(paramName) {
|
|
586
|
-
if (typeof globalThis === "undefined" || !globalThis.location) return null;
|
|
587
|
-
const hash = globalThis.location.hash || "";
|
|
588
|
-
if (!hash.startsWith("#/")) return null;
|
|
589
|
-
const hashWithoutHash = hash.startsWith("#") ? hash.substring(1) : hash;
|
|
590
|
-
const queryString = hashWithoutHash.split("?")[1];
|
|
591
|
-
if (!queryString) return null;
|
|
592
|
-
const params = new URLSearchParams(queryString);
|
|
593
|
-
return params.get(paramName);
|
|
594
|
-
}
|
|
595
|
-
function getPath() {
|
|
596
|
-
if (typeof globalThis === "undefined" || !globalThis.location) return null;
|
|
597
|
-
const hash = globalThis.location.hash || "";
|
|
598
|
-
if (!hash.startsWith("#/")) return null;
|
|
599
|
-
return hash.slice(1).split("?")[0];
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
// src/breadcrumb/param.ts
|
|
603
|
-
var getRouteMenu = (path) => {
|
|
604
|
-
const apiRoutes = globalThis?.apiRoutes || [];
|
|
605
|
-
return apiRoutes.find((menu) => menu?.path === path);
|
|
606
|
-
};
|
|
607
|
-
var getRouteDetails = () => {
|
|
608
|
-
const search = getParam("b");
|
|
609
|
-
const breadcrumbs = decodeToBase64(search) || [];
|
|
610
|
-
const lastItem = breadcrumbs[breadcrumbs.length - 1];
|
|
611
|
-
const mapped = lastItem ? mapKeysDeep(lastItem, keyMap) : null;
|
|
612
|
-
return { routeDetails: mapped };
|
|
613
|
-
};
|
|
614
|
-
var getParamDetails = (props, isDetailsPage = false) => {
|
|
615
|
-
const search = getParam("b");
|
|
616
|
-
let breadcrumbs = decodeToBase64(search) || [];
|
|
617
|
-
if (breadcrumbs.length > 0 && breadcrumbs?.[0]?.isHome) {
|
|
618
|
-
breadcrumbs = breadcrumbs.slice(1);
|
|
619
|
-
}
|
|
620
|
-
let mediatorObjectTypeId = "";
|
|
621
|
-
let mediatorObjectRecordId = "";
|
|
622
|
-
let parentObjectTypeId = "";
|
|
623
|
-
let parentObjectRecordId = "";
|
|
624
|
-
let lastItem = breadcrumbs[breadcrumbs.length - 1];
|
|
625
|
-
const lastItem2 = breadcrumbs[breadcrumbs.length - 2];
|
|
626
|
-
const lastItem3 = breadcrumbs[breadcrumbs.length - 3];
|
|
627
|
-
if (isDetailsPage === true && lastItem && "prm" in lastItem) {
|
|
628
|
-
delete lastItem.prm;
|
|
629
|
-
}
|
|
630
|
-
if (breadcrumbs.length > 1) {
|
|
631
|
-
if (props?.type === "ticket" || props?.type === "association") {
|
|
632
|
-
mediatorObjectTypeId = breadcrumbs[1]?.o_t_id || "";
|
|
633
|
-
mediatorObjectRecordId = breadcrumbs[1]?.o_r_id || "";
|
|
634
|
-
parentObjectTypeId = lastItem?.o_t_id || "";
|
|
635
|
-
parentObjectRecordId = lastItem?.o_r_id || "";
|
|
636
|
-
} else {
|
|
637
|
-
if (breadcrumbs.length > 2) {
|
|
638
|
-
mediatorObjectTypeId = breadcrumbs[1]?.o_t_id || "";
|
|
639
|
-
mediatorObjectRecordId = breadcrumbs[1]?.o_r_id || "";
|
|
640
|
-
}
|
|
641
|
-
if (!lastItem?.o_r_id && breadcrumbs.length > 2) {
|
|
642
|
-
parentObjectTypeId = lastItem2?.o_t_id || "";
|
|
643
|
-
parentObjectRecordId = lastItem2?.o_r_id || "";
|
|
644
|
-
}
|
|
645
|
-
if (lastItem?.o_r_id && breadcrumbs.length > 2) {
|
|
646
|
-
parentObjectTypeId = lastItem3?.o_t_id || "";
|
|
647
|
-
parentObjectRecordId = lastItem3?.o_r_id || "";
|
|
648
|
-
}
|
|
649
|
-
if (lastItem2?.o_t_id === "0-5" && !parentObjectTypeId && !parentObjectRecordId) {
|
|
650
|
-
parentObjectTypeId = lastItem2?.o_t_id || "";
|
|
651
|
-
parentObjectRecordId = lastItem2?.o_r_id || "";
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
let paramsObject = {};
|
|
656
|
-
if (breadcrumbs[0]?.prm?.isPC || breadcrumbs[1]?.prm?.isPC || lastItem?.prm?.isPC) {
|
|
657
|
-
paramsObject["isPrimaryCompany"] = true;
|
|
658
|
-
}
|
|
659
|
-
if (parentObjectTypeId && parentObjectRecordId) {
|
|
660
|
-
paramsObject["parentObjectTypeId"] = parentObjectTypeId;
|
|
661
|
-
paramsObject["parentObjectRecordId"] = parentObjectRecordId;
|
|
662
|
-
}
|
|
663
|
-
if (mediatorObjectTypeId && mediatorObjectRecordId) {
|
|
664
|
-
paramsObject["mediatorObjectTypeId"] = mediatorObjectTypeId;
|
|
665
|
-
paramsObject["mediatorObjectRecordId"] = mediatorObjectRecordId;
|
|
666
|
-
}
|
|
667
|
-
const mappedLastItemParam = Object.fromEntries(
|
|
668
|
-
Object.entries(lastItem?.prm || {}).map(([key, value]) => [
|
|
669
|
-
keyMap[key] || key,
|
|
670
|
-
// use mapped name if exists, else keep original
|
|
671
|
-
value
|
|
672
|
-
])
|
|
673
|
-
);
|
|
674
|
-
let queryString = null;
|
|
675
|
-
if (props?.type === "association") {
|
|
676
|
-
queryString = new URLSearchParams({ ...paramsObject, ...{ cache: false } }).toString();
|
|
677
|
-
} else {
|
|
678
|
-
queryString = new URLSearchParams({ ...paramsObject, ...mappedLastItemParam }).toString();
|
|
679
|
-
}
|
|
680
|
-
let params = queryString ? `?${queryString}` : "";
|
|
681
|
-
const totalParentLength = getTotalParentLength(breadcrumbs);
|
|
682
|
-
let parentAccessLabel = false;
|
|
683
|
-
if (breadcrumbs[0]?.prm?.isPC && totalParentLength > 2 || // company object
|
|
684
|
-
!breadcrumbs[0]?.prm?.isPC && totalParentLength > 3 || // normal object
|
|
685
|
-
breadcrumbs[0]?.prm?.isPC && totalParentLength > 1 && props?.type === "ticket" || // company ticket
|
|
686
|
-
!breadcrumbs[0]?.prm?.isPC && totalParentLength > 2 && props?.type === "ticket") {
|
|
687
|
-
parentAccessLabel = true;
|
|
688
|
-
}
|
|
689
|
-
return {
|
|
690
|
-
breadcrumbs,
|
|
691
|
-
// paramsObject: Object.keys(mParamsObject).length === 0 ? null : mParamsObject,
|
|
692
|
-
paramsObject,
|
|
693
|
-
params,
|
|
694
|
-
parentAccessLabel
|
|
695
|
-
};
|
|
696
|
-
};
|
|
697
|
-
|
|
698
|
-
// src/breadcrumb/url.ts
|
|
699
|
-
var useUpdateLink = () => {
|
|
700
|
-
const updateLink = async (props, displayName = "prm") => {
|
|
701
|
-
const search = getParam("b");
|
|
702
|
-
const pathname = getPath();
|
|
703
|
-
let breadcrumbs = decodeToBase64(search) || [];
|
|
704
|
-
if (breadcrumbs.length < 1) {
|
|
705
|
-
const routeMenu = getRouteMenu(pathname);
|
|
706
|
-
breadcrumbs = [
|
|
707
|
-
{
|
|
708
|
-
n: routeMenu?.title,
|
|
709
|
-
pt: routeMenu?.path
|
|
710
|
-
}
|
|
711
|
-
];
|
|
712
|
-
}
|
|
713
|
-
const lastBreadcrumb = breadcrumbs[breadcrumbs.length - 1];
|
|
714
|
-
let udatedBreadcrumb = null;
|
|
715
|
-
if (displayName) {
|
|
716
|
-
const ex = await getDeep(lastBreadcrumb, displayName) || {};
|
|
717
|
-
udatedBreadcrumb = await setDeep(lastBreadcrumb, displayName, {
|
|
718
|
-
...ex,
|
|
719
|
-
...props
|
|
720
|
-
});
|
|
721
|
-
} else {
|
|
722
|
-
udatedBreadcrumb = Object.assign(lastBreadcrumb, props);
|
|
723
|
-
}
|
|
724
|
-
breadcrumbs[breadcrumbs.length - 1] = udatedBreadcrumb;
|
|
725
|
-
const newBase64 = convertToBase64(breadcrumbs);
|
|
726
|
-
updateBParam(newBase64);
|
|
727
|
-
};
|
|
728
|
-
function setDeep(obj, path, value) {
|
|
729
|
-
const keys = path.split(".");
|
|
730
|
-
let curr = obj;
|
|
731
|
-
for (let i = 0; i < keys.length - 1; i++) {
|
|
732
|
-
if (!curr[keys[i]] || typeof curr[keys[i]] !== "object") {
|
|
733
|
-
curr[keys[i]] = {};
|
|
734
|
-
}
|
|
735
|
-
curr = curr[keys[i]];
|
|
736
|
-
}
|
|
737
|
-
curr[keys[keys.length - 1]] = value;
|
|
738
|
-
return curr;
|
|
739
|
-
}
|
|
740
|
-
function getDeep(obj, path) {
|
|
741
|
-
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
742
|
-
}
|
|
743
|
-
const getLinkParams = (displayName = "prm") => {
|
|
744
|
-
const search = getParam("b");
|
|
745
|
-
let breadcrumbs = decodeToBase64(search) || [];
|
|
746
|
-
if (breadcrumbs.length < 1) return null;
|
|
747
|
-
const lastItem = breadcrumbs[breadcrumbs.length - 1];
|
|
748
|
-
const getDeep2 = (obj, path) => {
|
|
749
|
-
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
750
|
-
};
|
|
751
|
-
const expandKeys = (obj) => {
|
|
752
|
-
return Object.fromEntries(
|
|
753
|
-
Object.entries(obj).map(([key, value]) => [
|
|
754
|
-
keyMap[key] || key,
|
|
755
|
-
// map if exists, else keep original
|
|
756
|
-
value
|
|
757
|
-
])
|
|
758
|
-
);
|
|
759
|
-
};
|
|
760
|
-
const nestedValue = displayName ? getDeep2(lastItem, displayName) : null;
|
|
761
|
-
const output = nestedValue ? expandKeys(nestedValue) : null;
|
|
762
|
-
return output;
|
|
763
|
-
};
|
|
764
|
-
const filterParams = (displayName = "prm") => {
|
|
765
|
-
const search = getParam("b");
|
|
766
|
-
let breadcrumbs = decodeToBase64(search) || [];
|
|
767
|
-
if (breadcrumbs.length < 1) return null;
|
|
768
|
-
const lastItem = breadcrumbs[breadcrumbs.length - 1];
|
|
769
|
-
const getDeep2 = (obj, path) => {
|
|
770
|
-
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
771
|
-
};
|
|
772
|
-
const expandKeys = (obj) => {
|
|
773
|
-
return Object.fromEntries(
|
|
774
|
-
Object.entries(obj).map(([key, value]) => [
|
|
775
|
-
keyMap[key] || key,
|
|
776
|
-
// map if exists, else keep original
|
|
777
|
-
value
|
|
778
|
-
])
|
|
779
|
-
);
|
|
780
|
-
};
|
|
781
|
-
const nestedValue = displayName ? getDeep2(lastItem, displayName) : null;
|
|
782
|
-
const output = nestedValue ? expandKeys(nestedValue) : expandKeys(lastItem);
|
|
783
|
-
return output;
|
|
784
|
-
};
|
|
785
|
-
return { updateLink, getLinkParams, filterParams };
|
|
786
|
-
};
|
|
787
|
-
var updateBParam = (newValue) => {
|
|
788
|
-
if (typeof globalThis === "undefined" || !globalThis.location) return;
|
|
789
|
-
const hash = globalThis.location.hash || "";
|
|
790
|
-
if (!hash.startsWith("#/")) return;
|
|
791
|
-
const withoutHash = hash.slice(2);
|
|
792
|
-
const [path, queryString] = withoutHash.split("?");
|
|
793
|
-
const params = new URLSearchParams(queryString || "");
|
|
794
|
-
params.set("b", newValue);
|
|
795
|
-
const newHash = `#/${path}?${params.toString()}`;
|
|
796
|
-
if (typeof globalThis !== "undefined" && globalThis.history && globalThis.history.replaceState) {
|
|
797
|
-
globalThis.history.replaceState(null, "", newHash);
|
|
798
|
-
}
|
|
799
|
-
};
|
|
800
|
-
|
|
801
|
-
// src/clint/index.ts
|
|
802
|
-
var Client = {
|
|
803
|
-
authentication: {
|
|
804
|
-
preLogin: (data) => AuthHttpClient.post(API_ENDPOINTS.PRE_LOGIN, data),
|
|
805
|
-
login: (data) => {
|
|
806
|
-
return AuthHttpClient.post(
|
|
807
|
-
generateApiUrl({ route: API_ENDPOINTS.LOGIN, queryParams: null }),
|
|
808
|
-
data,
|
|
809
|
-
config?.devPortalId && {
|
|
810
|
-
headers: {
|
|
811
|
-
"X-Dev-Portal-Id": config.devPortalId
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
);
|
|
815
|
-
},
|
|
816
|
-
verifyEmail: (data) => AuthHttpClient.post(API_ENDPOINTS.VERIFY_EMAIL, data),
|
|
817
|
-
resetPasswordVerifyToken: (data) => AuthHttpClient.post(API_ENDPOINTS.RESET_PASSWORD_VERIFY_TOKEN, data),
|
|
818
|
-
resetPassword: (data) => AuthHttpClient.post(API_ENDPOINTS.RESET_PASSWORD, data),
|
|
819
|
-
forgetPassword: (data) => AuthHttpClient.post(API_ENDPOINTS.FORGET_PASSWORD, data),
|
|
820
|
-
registerExistingUser: (data) => AuthHttpClient.post(API_ENDPOINTS.REGISTER_EXISTING_USER, data),
|
|
821
|
-
verifyEmailResend: (data) => AuthHttpClient.post(API_ENDPOINTS.REGISTER_EXISTING_USER, data),
|
|
822
|
-
resendEmail: (data) => AuthHttpClient.post(API_ENDPOINTS.RESEND_EMAIL, data),
|
|
823
|
-
logout: () => HttpClient.post(API_ENDPOINTS.LOGOUT, null)
|
|
824
|
-
},
|
|
825
|
-
sso: {
|
|
826
|
-
getSsoDetails: () => AuthHttpClient.get(API_ENDPOINTS.SSO_DETAILS),
|
|
827
|
-
generateSsoUrl: (payload) => AuthHttpClient.get(generateApiUrl({ route: API_ENDPOINTS.SSO_URL, queryParams: payload?.queryParams })),
|
|
828
|
-
ssoCallback: (payload) => AuthHttpClient.get(generateApiUrl({ route: API_ENDPOINTS.SSO_CALLBACK, queryParams: payload?.queryParams }))
|
|
829
|
-
},
|
|
830
|
-
user: {
|
|
831
|
-
me: () => HttpClient.get(generateApiUrl({ route: API_ENDPOINTS.ME })),
|
|
832
|
-
profile: (payload) => HttpClient.get(generateApiUrl({ route: API_ENDPOINTS.PROFILE, queryParams: payload })),
|
|
833
|
-
changePassword: (data) => HttpClient.post(API_ENDPOINTS.CHANGE_PASSWORD, data)
|
|
834
|
-
},
|
|
835
|
-
pipeline: {
|
|
836
|
-
list: (payload = null, param = null) => {
|
|
837
|
-
const params = { hubspotObjectTypeId: payload?.hubspotObjectTypeId };
|
|
838
|
-
const { getParamDetails: getParamDetails2 } = routeParam;
|
|
839
|
-
const { paramsObject } = getParamDetails2({ type: payload?.componentName });
|
|
840
|
-
const userData = getProfileData();
|
|
841
|
-
const apiParams = {};
|
|
842
|
-
if (paramsObject?.parentObjectTypeId) {
|
|
843
|
-
apiParams.parentObjectTypeId = paramsObject?.parentObjectTypeId;
|
|
844
|
-
} else if (payload?.isHome && userData?.data?.info?.objectTypeId && !param?.isPrimaryCompany) {
|
|
845
|
-
apiParams.parentObjectTypeId = userData?.data?.info?.objectTypeId;
|
|
846
|
-
} else if (payload?.isHome && userData?.data?.info?.objectTypeId && param?.isPrimaryCompany) {
|
|
847
|
-
apiParams.parentObjectTypeId = "0-2";
|
|
848
|
-
}
|
|
849
|
-
apiParams.isPrimaryCompany = param?.isPrimaryCompany;
|
|
850
|
-
apiParams.cache = payload?.cache;
|
|
851
|
-
console.log("payload", payload);
|
|
852
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.PIPELINES, params, queryParams: apiParams });
|
|
853
|
-
return HttpClient.get(apiUrl);
|
|
854
|
-
}
|
|
855
|
-
},
|
|
856
|
-
stage: {
|
|
857
|
-
list: (props = null) => {
|
|
858
|
-
const params = {
|
|
859
|
-
// hubId: config.hubId,
|
|
860
|
-
// portalId: portalId,
|
|
861
|
-
objectTypeId: props?.params?.objectTypeId,
|
|
862
|
-
pipelineId: props?.params?.pipelineId
|
|
863
|
-
};
|
|
864
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.STAGES, params });
|
|
865
|
-
return HttpClient.get(apiUrl);
|
|
866
|
-
}
|
|
867
|
-
},
|
|
868
|
-
object: {
|
|
869
|
-
list: async (payload = null, param = null) => {
|
|
870
|
-
param.cache = payload.cache;
|
|
871
|
-
const params = { hubspotObjectTypeId: payload?.hubspotObjectTypeId };
|
|
872
|
-
const { updateLink, getLinkParams } = useUpdateLink();
|
|
873
|
-
const { getParamDetails: getParamDetails2 } = routeParam;
|
|
874
|
-
const { paramsObject, parentAccessLabel } = getParamDetails2({ type: payload?.componentName });
|
|
875
|
-
const userData = getProfileData();
|
|
876
|
-
const pipeline = payload?.variables?.pipeline;
|
|
877
|
-
const mPipelines = payload?.variables?.mPipelines;
|
|
878
|
-
const mSelectedPipeline = pipeline !== void 0 ? pipeline : payload?.selectedPipeline;
|
|
879
|
-
if (mSelectedPipeline) {
|
|
880
|
-
param.filterValue = mSelectedPipeline;
|
|
881
|
-
} else if (payload?.specPipeLine && payload?.pipeLineId) {
|
|
882
|
-
param.filterValue = payload?.pipeLineId;
|
|
883
|
-
} else if (payload?.hubspotObjectTypeId != "0-3" || payload?.hubspotObjectTypeId != "0-5") {
|
|
884
|
-
param.filterValue = "";
|
|
885
|
-
}
|
|
886
|
-
const fParams = getLinkParams();
|
|
887
|
-
param = { ...payload?.isFristTimeLoadData && fParams && !payload?.isHome ? fParams : param, ...paramsObject };
|
|
888
|
-
if (!payload?.isFristTimeLoadData || !fParams) {
|
|
889
|
-
await updateLink({
|
|
890
|
-
"sort": param?.sort,
|
|
891
|
-
"s": param?.search,
|
|
892
|
-
"fPn": param?.filterPropertyName,
|
|
893
|
-
"fO": param?.filterOperator,
|
|
894
|
-
"fV": param?.filterValue,
|
|
895
|
-
"c": param?.cache,
|
|
896
|
-
"isPC": param?.isPrimaryCompany,
|
|
897
|
-
"v": param?.view,
|
|
898
|
-
"l": param?.limit,
|
|
899
|
-
"p": param?.page,
|
|
900
|
-
"a": param?.after
|
|
901
|
-
});
|
|
902
|
-
}
|
|
903
|
-
if (mPipelines != void 0 && mPipelines?.length === 0 && !payload?.specPipeLine) {
|
|
904
|
-
param.filterValue = "";
|
|
905
|
-
await updateLink({
|
|
906
|
-
"fV": param?.filterValue
|
|
907
|
-
});
|
|
908
|
-
}
|
|
909
|
-
if (mPipelines != void 0 && mPipelines?.length === 1 && !payload?.specPipeLine && mSelectedPipeline != null) {
|
|
910
|
-
param.filterValue = mPipelines[0].pipelineId;
|
|
911
|
-
await updateLink({
|
|
912
|
-
"fV": param?.filterValue
|
|
913
|
-
});
|
|
914
|
-
}
|
|
915
|
-
if (payload?.isHome) {
|
|
916
|
-
let parentObjectTypeId = "";
|
|
917
|
-
if (userData?.info?.objectTypeId && !param?.isPrimaryCompany) {
|
|
918
|
-
parentObjectTypeId = userData?.info?.objectTypeId;
|
|
919
|
-
} else if (userData?.info?.objectTypeId && param?.isPrimaryCompany) {
|
|
920
|
-
parentObjectTypeId = "0-2";
|
|
921
|
-
}
|
|
922
|
-
param.parentObjectTypeId = parentObjectTypeId;
|
|
923
|
-
}
|
|
924
|
-
param.parentAccessLabel = parentAccessLabel;
|
|
925
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.OBJECTS, params, queryParams: param });
|
|
926
|
-
return HttpClient.get(apiUrl);
|
|
927
|
-
},
|
|
928
|
-
form: (payload = null) => {
|
|
929
|
-
const params = { hubspotObjectTypeId: payload?.hubspotObjectTypeId };
|
|
930
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.OBJECTS_CREATE, params, queryParams: payload?.params });
|
|
931
|
-
return HttpClient.get(apiUrl);
|
|
932
|
-
},
|
|
933
|
-
objectFormOptions: (payload = null) => {
|
|
934
|
-
const params = { hubspotObjectTypeId: payload?.hubspotObjectTypeId };
|
|
935
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.OBJECTS_FORM_OPTIONS, params, queryParams: payload?.params });
|
|
936
|
-
return HttpClient.get(apiUrl);
|
|
937
|
-
},
|
|
938
|
-
create: (props = null) => {
|
|
939
|
-
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId };
|
|
940
|
-
const queryParams = props.params;
|
|
941
|
-
const payload = props.payload;
|
|
942
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.OBJECTS_CREATE, params, queryParams });
|
|
943
|
-
return HttpClient.post(apiUrl, payload);
|
|
944
|
-
},
|
|
945
|
-
createExisting: (props = null) => {
|
|
946
|
-
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId };
|
|
947
|
-
const queryParams = props.params;
|
|
948
|
-
const payload = props.payload;
|
|
949
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.OBJECTS_CREATE_EXISTING, params, queryParams });
|
|
950
|
-
return HttpClient.post(apiUrl, payload);
|
|
951
|
-
},
|
|
952
|
-
removeExisting: (props = null) => {
|
|
953
|
-
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId };
|
|
954
|
-
const queryParams = props.params;
|
|
955
|
-
const payload = props.payload;
|
|
956
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.OBJECTS_REMOVE_EXISTING, params, queryParams });
|
|
957
|
-
return HttpClient.post(apiUrl, payload);
|
|
958
|
-
},
|
|
959
|
-
details: (props = null) => {
|
|
960
|
-
const { paramsObject: urlParam, parentAccessLabel } = getParamDetails("", true);
|
|
961
|
-
const params = {
|
|
962
|
-
// hubId: config.hubId,
|
|
963
|
-
// portalId: portalId,
|
|
964
|
-
objectId: props?.params?.objectId,
|
|
965
|
-
id: props?.params?.id
|
|
966
|
-
};
|
|
967
|
-
const queryParams = {
|
|
968
|
-
parentAccessLabel,
|
|
969
|
-
...props?.queryParams,
|
|
970
|
-
...urlParam
|
|
971
|
-
};
|
|
972
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.OBJECTS_DETAILS, params, queryParams });
|
|
973
|
-
return HttpClient.get(apiUrl);
|
|
974
|
-
},
|
|
975
|
-
update: (props = null) => {
|
|
976
|
-
const params = {
|
|
977
|
-
// hubId: config.hubId,
|
|
978
|
-
// portalId: portalId,
|
|
979
|
-
objectId: props?.params?.objectId,
|
|
980
|
-
id: props?.params?.id
|
|
981
|
-
};
|
|
982
|
-
const { paramsObject: queryParams } = getParamDetails();
|
|
983
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.OBJECTS_DETAILS_UPDATE, params, queryParams });
|
|
984
|
-
return HttpClient.put(apiUrl, props.payload);
|
|
985
|
-
}
|
|
986
|
-
},
|
|
987
|
-
note: {
|
|
988
|
-
list: (props = null) => {
|
|
989
|
-
const params = {
|
|
990
|
-
// hubId: config.hubId,
|
|
991
|
-
// portalId: portalId,
|
|
992
|
-
objectId: props?.params?.objectId,
|
|
993
|
-
id: props?.params?.id
|
|
994
|
-
};
|
|
995
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.NOTES, params, queryParams: props?.queryParams });
|
|
996
|
-
return HttpClient.get(apiUrl);
|
|
997
|
-
},
|
|
998
|
-
create: (props = null) => {
|
|
999
|
-
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId, ...props.params };
|
|
1000
|
-
const queryParams = props.queryParams;
|
|
1001
|
-
const payload = props.payload;
|
|
1002
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.NOTES_CREATE, params, queryParams });
|
|
1003
|
-
return HttpClient.post(apiUrl, payload);
|
|
1004
|
-
},
|
|
1005
|
-
update: (props = null) => {
|
|
1006
|
-
const params = {
|
|
1007
|
-
// hubId: config.hubId,
|
|
1008
|
-
// portalId: portalId,
|
|
1009
|
-
objectId: props?.params?.objectId,
|
|
1010
|
-
id: props?.params?.id,
|
|
1011
|
-
note_id: props?.params?.note_id
|
|
1012
|
-
};
|
|
1013
|
-
const { paramsObject: queryParams } = getParamDetails();
|
|
1014
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.NOTES_DETAILS_UPDATE, params, queryParams });
|
|
1015
|
-
return HttpClient.put(apiUrl, props.payload);
|
|
1016
|
-
},
|
|
1017
|
-
image: (props = null) => {
|
|
1018
|
-
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId, ...props.params };
|
|
1019
|
-
const queryParams = props.queryParams;
|
|
1020
|
-
const payload = props.payload;
|
|
1021
|
-
const axiosConfig = props.config || {};
|
|
1022
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.NOTES_IMAGE_UPLOAD, params, queryParams });
|
|
1023
|
-
return HttpClient.post(apiUrl, payload, {
|
|
1024
|
-
headers: {
|
|
1025
|
-
"Content-Type": "multipart/form-data"
|
|
1026
|
-
},
|
|
1027
|
-
...axiosConfig
|
|
1028
|
-
});
|
|
1029
|
-
},
|
|
1030
|
-
attachment: (props = null) => {
|
|
1031
|
-
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId, ...props.params };
|
|
1032
|
-
const queryParams = props.queryParams;
|
|
1033
|
-
const payload = props.payload;
|
|
1034
|
-
const axiosConfig = props.config || {};
|
|
1035
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.NOTES_ATTACHMENT_UPLOAD, params, queryParams });
|
|
1036
|
-
return HttpClient.post(apiUrl, payload, {
|
|
1037
|
-
headers: {
|
|
1038
|
-
"Content-Type": "multipart/form-data"
|
|
1039
|
-
},
|
|
1040
|
-
...axiosConfig
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
},
|
|
1044
|
-
email: {
|
|
1045
|
-
list: (props = null) => {
|
|
1046
|
-
const params = {
|
|
1047
|
-
// hubId: config.hubId,
|
|
1048
|
-
// portalId: portalId,
|
|
1049
|
-
objectId: props?.params?.objectId,
|
|
1050
|
-
id: props?.params?.id
|
|
1051
|
-
};
|
|
1052
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.EMAILS, params, queryParams: props?.queryParams });
|
|
1053
|
-
return HttpClient.get(apiUrl);
|
|
1054
|
-
},
|
|
1055
|
-
create: (props = null) => {
|
|
1056
|
-
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId, ...props.params };
|
|
1057
|
-
const queryParams = props.queryParams;
|
|
1058
|
-
const payload = props.payload;
|
|
1059
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.EMAILS_CREATE, params, queryParams });
|
|
1060
|
-
return HttpClient.post(apiUrl, payload);
|
|
1061
|
-
},
|
|
1062
|
-
update: (props = null) => {
|
|
1063
|
-
const params = {
|
|
1064
|
-
// hubId: config.hubId,
|
|
1065
|
-
// portalId: portalId,
|
|
1066
|
-
objectId: props?.params?.objectId,
|
|
1067
|
-
id: props?.params?.id,
|
|
1068
|
-
note_id: props?.params?.note_id
|
|
1069
|
-
};
|
|
1070
|
-
const { paramsObject: queryParams } = getParamDetails();
|
|
1071
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.EMAILS_DETAILS_UPDATE, params, queryParams });
|
|
1072
|
-
return HttpClient.put(apiUrl, props.payload);
|
|
1073
|
-
},
|
|
1074
|
-
image: (props = null) => {
|
|
1075
|
-
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId, ...props.params };
|
|
1076
|
-
const queryParams = props.queryParams;
|
|
1077
|
-
const payload = props.payload;
|
|
1078
|
-
const axiosConfig = props.config || {};
|
|
1079
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.EMAILS_IMAGE_UPLOAD, params, queryParams });
|
|
1080
|
-
return HttpClient.post(apiUrl, payload, {
|
|
1081
|
-
headers: {
|
|
1082
|
-
"Content-Type": "multipart/form-data"
|
|
1083
|
-
},
|
|
1084
|
-
...axiosConfig
|
|
1085
|
-
});
|
|
1086
|
-
},
|
|
1087
|
-
attachment: (props = null) => {
|
|
1088
|
-
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId, ...props.params };
|
|
1089
|
-
const queryParams = props.queryParams;
|
|
1090
|
-
const payload = props.payload;
|
|
1091
|
-
const axiosConfig = props.config || {};
|
|
1092
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.EMAILS_ATTACHMENT_UPLOAD, params, queryParams });
|
|
1093
|
-
return HttpClient.post(apiUrl, payload, {
|
|
1094
|
-
headers: {
|
|
1095
|
-
"Content-Type": "multipart/form-data"
|
|
1096
|
-
},
|
|
1097
|
-
...axiosConfig
|
|
1098
|
-
});
|
|
1099
|
-
}
|
|
1100
|
-
},
|
|
1101
|
-
file: {
|
|
1102
|
-
list: (props = null) => {
|
|
1103
|
-
const params = {
|
|
1104
|
-
// hubId: config.hubId,
|
|
1105
|
-
// portalId: portalId,
|
|
1106
|
-
objectId: props?.params?.objectId,
|
|
1107
|
-
id: props?.params?.id
|
|
1108
|
-
};
|
|
1109
|
-
console.log("params_0", params);
|
|
1110
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.FILES, params, queryParams: props?.queryParams });
|
|
1111
|
-
return HttpClient.get(apiUrl);
|
|
1112
|
-
},
|
|
1113
|
-
details: (props = null) => {
|
|
1114
|
-
const params = {
|
|
1115
|
-
// hubId: config.hubId,
|
|
1116
|
-
// portalId: portalId,
|
|
1117
|
-
objectId: props?.params?.objectId,
|
|
1118
|
-
id: props?.params?.id,
|
|
1119
|
-
rowId: props?.params?.rowId
|
|
1120
|
-
};
|
|
1121
|
-
console.log("params_1", params);
|
|
1122
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.FILE, params, queryParams: props?.queryParams });
|
|
1123
|
-
return HttpClient.get(apiUrl);
|
|
1124
|
-
},
|
|
1125
|
-
addFolder: (props = null) => {
|
|
1126
|
-
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId, ...props.params };
|
|
1127
|
-
const queryParams = props.queryParams;
|
|
1128
|
-
const payload = props.payload;
|
|
1129
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.FILES_CREATE_FOLDER, params, queryParams });
|
|
1130
|
-
return HttpClient.post(apiUrl, payload);
|
|
1131
|
-
},
|
|
1132
|
-
addFile: (props = null) => {
|
|
1133
|
-
const params = { hubspotObjectTypeId: props?.hubspotObjectTypeId, ...props.params };
|
|
1134
|
-
const queryParams = props.queryParams;
|
|
1135
|
-
const payload = props.payload;
|
|
1136
|
-
const axiosConfig = props.config || {};
|
|
1137
|
-
const apiUrl = generateApiUrl({ route: API_ENDPOINTS.FILES_UPLOAD, params, queryParams });
|
|
1138
|
-
return HttpClient.post(apiUrl, payload, {
|
|
1139
|
-
headers: {
|
|
1140
|
-
"Content-Type": "multipart/form-data"
|
|
1141
|
-
},
|
|
1142
|
-
...axiosConfig
|
|
1143
|
-
});
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
};
|
|
1147
|
-
|
|
1148
|
-
// src/mutation/createMutation.ts
|
|
1149
|
-
function createMutation(mutationFn, options) {
|
|
1150
|
-
let inFlight = 0;
|
|
1151
|
-
let lastReportedLoading = null;
|
|
1152
|
-
const syncLoading = () => {
|
|
1153
|
-
const active = inFlight > 0;
|
|
1154
|
-
if (lastReportedLoading === active) return;
|
|
1155
|
-
lastReportedLoading = active;
|
|
1156
|
-
options?.onLoadingChange?.(active);
|
|
1157
|
-
};
|
|
1158
|
-
const mutate = async (payload) => {
|
|
1159
|
-
inFlight += 1;
|
|
1160
|
-
syncLoading();
|
|
1161
|
-
try {
|
|
1162
|
-
const response = await mutationFn(payload);
|
|
1163
|
-
await options?.onSuccess?.(response, payload);
|
|
1164
|
-
return response;
|
|
1165
|
-
} catch (error) {
|
|
1166
|
-
options?.onError?.(error, payload);
|
|
1167
|
-
throw error;
|
|
1168
|
-
} finally {
|
|
1169
|
-
inFlight -= 1;
|
|
1170
|
-
syncLoading();
|
|
1171
|
-
}
|
|
1172
|
-
};
|
|
1173
|
-
return {
|
|
1174
|
-
mutate,
|
|
1175
|
-
isLoading: () => inFlight > 0
|
|
1176
|
-
};
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
// src/apis/authentication.ts
|
|
1180
|
-
init_auth_utils();
|
|
1181
|
-
init_cookie();
|
|
1182
|
-
init_token_store();
|
|
1183
|
-
function preLogin(options) {
|
|
1184
|
-
const { mutate, isLoading } = createMutation(
|
|
1185
|
-
async (payload) => {
|
|
1186
|
-
const response = await Client.authentication.preLogin(payload);
|
|
1187
|
-
return response;
|
|
1188
|
-
},
|
|
1189
|
-
options
|
|
1190
|
-
);
|
|
1191
|
-
return {
|
|
1192
|
-
mutate,
|
|
1193
|
-
login: mutate,
|
|
1194
|
-
isLoading
|
|
1195
|
-
};
|
|
1196
|
-
}
|
|
1197
|
-
function login(options) {
|
|
1198
|
-
const { mutate, isLoading } = createMutation(
|
|
1199
|
-
async (payload) => {
|
|
1200
|
-
const response = await Client.authentication.login(payload);
|
|
1201
|
-
const tokenData = response?.data?.tokenData || {};
|
|
1202
|
-
const loggedInDetails = response?.data?.loggedInDetails || {};
|
|
1203
|
-
const currentPortal = response?.data?.loggedInDetails?.currentPortal || {};
|
|
1204
|
-
const currentPortalId = currentPortal?.portalId || null;
|
|
1205
|
-
const SubscriptionType = loggedInDetails?.subscriptionType || "BASIC";
|
|
1206
|
-
const token = tokenData?.token;
|
|
1207
|
-
const refreshToken = tokenData?.refreshToken;
|
|
1208
|
-
const expiresIn = tokenData?.expiresIn;
|
|
1209
|
-
const rExpiresIn = tokenData?.refreshExpiresIn;
|
|
1210
|
-
setPortal(currentPortal);
|
|
1211
|
-
setSubscriptionType(SubscriptionType);
|
|
1212
|
-
await setAccessToken(token, expiresIn);
|
|
1213
|
-
await setRefreshToken(refreshToken, rExpiresIn);
|
|
1214
|
-
await setLoggedInDetails(response.data);
|
|
1215
|
-
setConfig.setDevPortalId(currentPortalId);
|
|
1216
|
-
return response;
|
|
1217
|
-
},
|
|
1218
|
-
options
|
|
1219
|
-
);
|
|
1220
|
-
return {
|
|
1221
|
-
mutate,
|
|
1222
|
-
login: mutate,
|
|
1223
|
-
isLoading
|
|
1224
|
-
};
|
|
1225
|
-
}
|
|
1226
|
-
function verifyEmail(options) {
|
|
1227
|
-
const { mutate, isLoading } = createMutation(
|
|
1228
|
-
async (payload) => {
|
|
1229
|
-
const verifyEmailPayload = payload || {};
|
|
1230
|
-
const token = getParam("token");
|
|
1231
|
-
if (!verifyEmailPayload?.token) verifyEmailPayload.token = token;
|
|
1232
|
-
const response = await Client.authentication.verifyEmail(verifyEmailPayload);
|
|
1233
|
-
return response;
|
|
1234
|
-
},
|
|
1235
|
-
options
|
|
1236
|
-
);
|
|
1237
|
-
return {
|
|
1238
|
-
mutate,
|
|
1239
|
-
verifyEmail: mutate,
|
|
1240
|
-
isLoading
|
|
1241
|
-
};
|
|
1242
|
-
}
|
|
1243
|
-
function resetPasswordVerifyToken(options) {
|
|
1244
|
-
const { mutate, isLoading } = createMutation(
|
|
1245
|
-
async (payload) => {
|
|
1246
|
-
const resetPasswordVerifyTokenPayload = payload || {};
|
|
1247
|
-
const token = getParam("token");
|
|
1248
|
-
if (!resetPasswordVerifyTokenPayload?.token) resetPasswordVerifyTokenPayload.token = token;
|
|
1249
|
-
const response = await Client.authentication.resetPasswordVerifyToken(resetPasswordVerifyTokenPayload);
|
|
1250
|
-
return response;
|
|
1251
|
-
},
|
|
1252
|
-
options
|
|
1253
|
-
);
|
|
1254
|
-
return {
|
|
1255
|
-
mutate,
|
|
1256
|
-
resetPasswordVerifyToken: mutate,
|
|
1257
|
-
isLoading
|
|
1258
|
-
};
|
|
1259
|
-
}
|
|
1260
|
-
function resetPassword(options) {
|
|
1261
|
-
const { mutate, isLoading } = createMutation(
|
|
1262
|
-
async (payload) => {
|
|
1263
|
-
const response = await Client.authentication.resetPassword(payload);
|
|
1264
|
-
return response;
|
|
1265
|
-
},
|
|
1266
|
-
options
|
|
1267
|
-
);
|
|
1268
|
-
return {
|
|
1269
|
-
mutate,
|
|
1270
|
-
resetPassword: mutate,
|
|
1271
|
-
isLoading
|
|
1272
|
-
};
|
|
1273
|
-
}
|
|
1274
|
-
function forgetPassword(options) {
|
|
1275
|
-
const { mutate, isLoading } = createMutation(
|
|
1276
|
-
async (payload) => {
|
|
1277
|
-
const response = await Client.authentication.forgetPassword(payload);
|
|
1278
|
-
return response;
|
|
1279
|
-
},
|
|
1280
|
-
options
|
|
1281
|
-
);
|
|
1282
|
-
return {
|
|
1283
|
-
mutate,
|
|
1284
|
-
forgetPassword: mutate,
|
|
1285
|
-
isLoading
|
|
1286
|
-
};
|
|
1287
|
-
}
|
|
1288
|
-
function logout(options) {
|
|
1289
|
-
const { mutate, isLoading } = createMutation(
|
|
1290
|
-
async () => {
|
|
1291
|
-
const response = await Client.authentication.logout();
|
|
1292
|
-
clearAccessToken();
|
|
1293
|
-
removeAllCookie();
|
|
1294
|
-
return response;
|
|
1295
|
-
},
|
|
1296
|
-
options
|
|
1297
|
-
);
|
|
1298
|
-
return {
|
|
1299
|
-
mutate,
|
|
1300
|
-
logout: mutate,
|
|
1301
|
-
isLoading
|
|
1302
|
-
};
|
|
1303
|
-
}
|
|
1304
|
-
function registerExistingUser(options) {
|
|
1305
|
-
const { mutate, isLoading } = createMutation(
|
|
1306
|
-
async (payload) => {
|
|
1307
|
-
const response = await Client.authentication.registerExistingUser(payload);
|
|
1308
|
-
return response;
|
|
1309
|
-
},
|
|
1310
|
-
options
|
|
1311
|
-
);
|
|
1312
|
-
return {
|
|
1313
|
-
mutate,
|
|
1314
|
-
registerExistingUser: mutate,
|
|
1315
|
-
isLoading
|
|
1316
|
-
};
|
|
1317
|
-
}
|
|
1318
|
-
function verifyEmailResend(options) {
|
|
1319
|
-
const { mutate, isLoading } = createMutation(
|
|
1320
|
-
async (payload) => {
|
|
1321
|
-
const response = await Client.authentication.verifyEmailResend(payload);
|
|
1322
|
-
return response;
|
|
1323
|
-
},
|
|
1324
|
-
options
|
|
1325
|
-
);
|
|
1326
|
-
return {
|
|
1327
|
-
mutate,
|
|
1328
|
-
verifyEmailResend: mutate,
|
|
1329
|
-
isLoading
|
|
1330
|
-
};
|
|
1331
|
-
}
|
|
1332
|
-
function resendEmail(options) {
|
|
1333
|
-
const { mutate, isLoading } = createMutation(
|
|
1334
|
-
async (payload) => {
|
|
1335
|
-
const response = await Client.authentication.resendEmail(payload);
|
|
1336
|
-
return response;
|
|
1337
|
-
},
|
|
1338
|
-
options
|
|
1339
|
-
);
|
|
1340
|
-
return {
|
|
1341
|
-
mutate,
|
|
1342
|
-
resendEmail: mutate,
|
|
1343
|
-
isLoading
|
|
1344
|
-
};
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
// src/apis/sso.ts
|
|
1348
|
-
function getSsoDetails(options) {
|
|
1349
|
-
const { mutate, isLoading } = createMutation(
|
|
1350
|
-
async () => {
|
|
1351
|
-
const response = await Client.sso.getSsoDetails();
|
|
1352
|
-
return response;
|
|
1353
|
-
},
|
|
1354
|
-
options
|
|
1355
|
-
);
|
|
1356
|
-
return {
|
|
1357
|
-
mutate,
|
|
1358
|
-
getSsoDetails: mutate,
|
|
1359
|
-
isLoading
|
|
1360
|
-
};
|
|
1361
|
-
}
|
|
1362
|
-
function generateSsoUrl(options) {
|
|
1363
|
-
const { mutate, isLoading } = createMutation(
|
|
1364
|
-
async (payload) => {
|
|
1365
|
-
const response = await Client.sso.generateSsoUrl(payload);
|
|
1366
|
-
return response;
|
|
1367
|
-
},
|
|
1368
|
-
options
|
|
1369
|
-
);
|
|
1370
|
-
return {
|
|
1371
|
-
mutate,
|
|
1372
|
-
generateSsoUrl: mutate,
|
|
1373
|
-
isLoading
|
|
1374
|
-
};
|
|
1375
|
-
}
|
|
1376
|
-
function ssoCallback(options) {
|
|
1377
|
-
const { mutate, isLoading } = createMutation(
|
|
1378
|
-
async (payload) => {
|
|
1379
|
-
const response = await Client.sso.ssoCallback(payload);
|
|
1380
|
-
return response;
|
|
1381
|
-
},
|
|
1382
|
-
options
|
|
1383
|
-
);
|
|
1384
|
-
return {
|
|
1385
|
-
mutate,
|
|
1386
|
-
ssoCallback: mutate,
|
|
1387
|
-
isLoading
|
|
1388
|
-
};
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
// src/apis/users.ts
|
|
1392
|
-
function me(options) {
|
|
1393
|
-
const { mutate, isLoading } = createMutation(
|
|
1394
|
-
async () => {
|
|
1395
|
-
const response = await Client.user.me();
|
|
1396
|
-
return response;
|
|
1397
|
-
},
|
|
1398
|
-
options
|
|
1399
|
-
);
|
|
1400
|
-
return {
|
|
1401
|
-
mutate,
|
|
1402
|
-
me: mutate,
|
|
1403
|
-
isLoading
|
|
1404
|
-
};
|
|
1405
|
-
}
|
|
1406
|
-
function profile(options) {
|
|
1407
|
-
const { mutate, isLoading } = createMutation(
|
|
1408
|
-
async (paylaod) => {
|
|
1409
|
-
const response = await Client.user.profile(paylaod);
|
|
1410
|
-
setProfileData(response);
|
|
1411
|
-
return response;
|
|
1412
|
-
},
|
|
1413
|
-
options
|
|
1414
|
-
);
|
|
1415
|
-
return {
|
|
1416
|
-
mutate,
|
|
1417
|
-
profile: mutate,
|
|
1418
|
-
isLoading
|
|
1419
|
-
};
|
|
1420
|
-
}
|
|
1421
|
-
function changePassword(options) {
|
|
1422
|
-
const { mutate, isLoading } = createMutation(
|
|
1423
|
-
async (payload) => {
|
|
1424
|
-
const response = await Client.user.changePassword(payload);
|
|
1425
|
-
return response;
|
|
1426
|
-
},
|
|
1427
|
-
options
|
|
1428
|
-
);
|
|
1429
|
-
return {
|
|
1430
|
-
mutate,
|
|
1431
|
-
changePassword: mutate,
|
|
1432
|
-
isLoading
|
|
1433
|
-
};
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
// src/store/index.ts
|
|
1437
|
-
function createStore(initializer) {
|
|
1438
|
-
let state;
|
|
1439
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
1440
|
-
const get = () => state;
|
|
1441
|
-
const set = (partial) => {
|
|
1442
|
-
const prevState = state;
|
|
1443
|
-
const partialState = typeof partial === "function" ? partial(state) : partial;
|
|
1444
|
-
state = {
|
|
1445
|
-
...state,
|
|
1446
|
-
...partialState
|
|
1447
|
-
};
|
|
1448
|
-
listeners.forEach(
|
|
1449
|
-
(listener) => listener(state, prevState)
|
|
1450
|
-
);
|
|
1451
|
-
};
|
|
1452
|
-
const subscribe = (listener) => {
|
|
1453
|
-
listeners.add(listener);
|
|
1454
|
-
return () => listeners.delete(listener);
|
|
1455
|
-
};
|
|
1456
|
-
state = initializer(set, get);
|
|
1457
|
-
return {
|
|
1458
|
-
getState: get,
|
|
1459
|
-
setState: set,
|
|
1460
|
-
subscribe
|
|
1461
|
-
};
|
|
1462
|
-
}
|
|
1463
|
-
|
|
1464
|
-
// src/utils/getCookieData.ts
|
|
1465
|
-
init_cookie();
|
|
1466
|
-
var getAuthSubscriptionType = () => {
|
|
1467
|
-
return getCookie("subscriptionType");
|
|
1468
|
-
};
|
|
1469
|
-
|
|
1470
|
-
// src/store/use-table.ts
|
|
1471
|
-
var pageLimit = 10;
|
|
1472
|
-
var tableStore = createStore((set, get) => ({
|
|
1473
|
-
// ==============================
|
|
1474
|
-
// STATE
|
|
1475
|
-
// ==============================
|
|
1476
|
-
tableUniqueId: null,
|
|
1477
|
-
gridData: [],
|
|
1478
|
-
sort: "-hs_createdate",
|
|
1479
|
-
limit: 10,
|
|
1480
|
-
after: "",
|
|
1481
|
-
page: 1,
|
|
1482
|
-
totalItems: 1,
|
|
1483
|
-
numOfPages: 1,
|
|
1484
|
-
currentPage: 1,
|
|
1485
|
-
search: "",
|
|
1486
|
-
filterPropertyName: "hs_pipeline",
|
|
1487
|
-
filterOperator: "eq",
|
|
1488
|
-
filterValue: "",
|
|
1489
|
-
isPrimaryCompany: null,
|
|
1490
|
-
view: null,
|
|
1491
|
-
selectedPipeline: "",
|
|
1492
|
-
tableParam: {},
|
|
1493
|
-
tableDefPermissions: {},
|
|
1494
|
-
// ==============================
|
|
1495
|
-
// BASIC SETTERS
|
|
1496
|
-
// ==============================
|
|
1497
|
-
setTableUniqueId: (v) => set({ tableUniqueId: v }),
|
|
1498
|
-
setSort: (v) => set({ sort: v }),
|
|
1499
|
-
setLimit: (v) => set({ limit: v }),
|
|
1500
|
-
setAfter: (v) => set({ after: v }),
|
|
1501
|
-
setPage: (v) => set({ page: v }),
|
|
1502
|
-
setTotalItems: (v) => set({ totalItems: v }),
|
|
1503
|
-
setNumOfPages: (v) => set({ numOfPages: v }),
|
|
1504
|
-
setCurrentPage: (v) => set({ currentPage: v }),
|
|
1505
|
-
setSearch: (v) => set({ search: v }),
|
|
1506
|
-
setFilterPropertyName: (v) => set({ filterPropertyName: v }),
|
|
1507
|
-
setFilterOperator: (v) => set({ filterOperator: v }),
|
|
1508
|
-
setFilterValue: (v) => set({ filterValue: v }),
|
|
1509
|
-
setIsPrimaryCompany: (v) => set({ isPrimaryCompany: v }),
|
|
1510
|
-
// ==============================
|
|
1511
|
-
// VIEW
|
|
1512
|
-
// ==============================
|
|
1513
|
-
setView: (mView) => {
|
|
1514
|
-
set({
|
|
1515
|
-
page: getAuthSubscriptionType() === "FREE" ? "" : 1,
|
|
1516
|
-
view: mView
|
|
1517
|
-
});
|
|
1518
|
-
},
|
|
1519
|
-
// ==============================
|
|
1520
|
-
// PIPELINE
|
|
1521
|
-
// ==============================
|
|
1522
|
-
changePipeline: (mView) => {
|
|
1523
|
-
set({
|
|
1524
|
-
page: getAuthSubscriptionType() === "FREE" ? "" : 1,
|
|
1525
|
-
selectedPipeline: mView || ""
|
|
1526
|
-
});
|
|
1527
|
-
},
|
|
1528
|
-
setSelectedPipeline: (pipelines, pipeLineId) => {
|
|
1529
|
-
let filterValue = "";
|
|
1530
|
-
if (pipeLineId) {
|
|
1531
|
-
const pipelineSingle = pipelines.find(
|
|
1532
|
-
(pipeline) => pipeline.pipelineId === pipeLineId
|
|
1533
|
-
);
|
|
1534
|
-
filterValue = pipelineSingle?.pipelineId || "";
|
|
1535
|
-
}
|
|
1536
|
-
set({
|
|
1537
|
-
filterPropertyName: "hs_pipeline",
|
|
1538
|
-
filterOperator: "eq",
|
|
1539
|
-
filterValue,
|
|
1540
|
-
selectedPipeline: filterValue
|
|
1541
|
-
});
|
|
1542
|
-
},
|
|
1543
|
-
// ==============================
|
|
1544
|
-
// RESET
|
|
1545
|
-
// ==============================
|
|
1546
|
-
resetTableParam: () => {
|
|
1547
|
-
set({
|
|
1548
|
-
sort: "-hs_createdate",
|
|
1549
|
-
limit: pageLimit,
|
|
1550
|
-
after: "",
|
|
1551
|
-
page: getAuthSubscriptionType() === "FREE" ? "" : 1,
|
|
1552
|
-
totalItems: 1,
|
|
1553
|
-
numOfPages: 1,
|
|
1554
|
-
currentPage: 1,
|
|
1555
|
-
search: "",
|
|
1556
|
-
filterPropertyName: "hs_pipeline",
|
|
1557
|
-
filterOperator: "eq",
|
|
1558
|
-
filterValue: "",
|
|
1559
|
-
isPrimaryCompany: null,
|
|
1560
|
-
selectedPipeline: ""
|
|
1561
|
-
});
|
|
1562
|
-
},
|
|
1563
|
-
// ==============================
|
|
1564
|
-
// PARAM BUILDER
|
|
1565
|
-
// ==============================
|
|
1566
|
-
getTableParam: (companyAsMediator, currentPageOverride) => {
|
|
1567
|
-
const state = get();
|
|
1568
|
-
const baseParams = {
|
|
1569
|
-
sort: state.sort,
|
|
1570
|
-
search: state.search,
|
|
1571
|
-
filterPropertyName: state.filterPropertyName,
|
|
1572
|
-
filterOperator: state.filterOperator,
|
|
1573
|
-
filterValue: state.selectedPipeline,
|
|
1574
|
-
cache: true,
|
|
1575
|
-
isPrimaryCompany: companyAsMediator || false,
|
|
1576
|
-
view: state.view
|
|
1577
|
-
};
|
|
1578
|
-
if (getAuthSubscriptionType() === "FREE") {
|
|
1579
|
-
return {
|
|
1580
|
-
...baseParams,
|
|
1581
|
-
after: state.page
|
|
1582
|
-
};
|
|
1583
|
-
}
|
|
1584
|
-
return {
|
|
1585
|
-
...baseParams,
|
|
1586
|
-
limit: state.limit,
|
|
1587
|
-
page: currentPageOverride || state.page,
|
|
1588
|
-
...state.after && {
|
|
1589
|
-
after: state.after
|
|
1590
|
-
}
|
|
1591
|
-
};
|
|
1592
|
-
},
|
|
1593
|
-
// ==============================
|
|
1594
|
-
// GRID DATA
|
|
1595
|
-
// ==============================
|
|
1596
|
-
setGridData: async (type, deals) => {
|
|
1597
|
-
if (type === "reset") {
|
|
1598
|
-
set({ gridData: [] });
|
|
1599
|
-
return;
|
|
1600
|
-
}
|
|
1601
|
-
if (type === "directly") {
|
|
1602
|
-
set({ gridData: deals });
|
|
1603
|
-
return;
|
|
1604
|
-
}
|
|
1605
|
-
const finalData = await deals.map(
|
|
1606
|
-
(deal) => {
|
|
1607
|
-
const cards = deal?.data?.results?.rows?.map(
|
|
1608
|
-
(row) => ({
|
|
1609
|
-
id: row?.hs_object_id,
|
|
1610
|
-
...row,
|
|
1611
|
-
hubspotObjectTypeId: type === "deals" ? "0-3" : "0-5"
|
|
1612
|
-
})
|
|
1613
|
-
) || [];
|
|
1614
|
-
return {
|
|
1615
|
-
id: deal.id,
|
|
1616
|
-
name: deal.label,
|
|
1617
|
-
count: deal?.data?.total,
|
|
1618
|
-
...deal,
|
|
1619
|
-
cards
|
|
1620
|
-
};
|
|
1621
|
-
}
|
|
1622
|
-
);
|
|
1623
|
-
await set({ gridData: finalData });
|
|
1624
|
-
return finalData;
|
|
1625
|
-
},
|
|
1626
|
-
// ==============================
|
|
1627
|
-
// DEFAULT PIPELINE
|
|
1628
|
-
// ==============================
|
|
1629
|
-
setDefaultPipeline(data, hubspotObjectTypeId) {
|
|
1630
|
-
if (!data) {
|
|
1631
|
-
set({ selectedPipeline: "" });
|
|
1632
|
-
return "";
|
|
1633
|
-
}
|
|
1634
|
-
const { updateLink, filterParams } = useUpdateLink();
|
|
1635
|
-
const params = filterParams();
|
|
1636
|
-
const excludedIds = ["0-1", "0-2", "0-3", "0-4", "0-5"];
|
|
1637
|
-
const state = get();
|
|
1638
|
-
const view = state.view;
|
|
1639
|
-
const selectedPipeline = state.selectedPipeline;
|
|
1640
|
-
let defaultPipelineId = "";
|
|
1641
|
-
let mFilterValue = "";
|
|
1642
|
-
const defaultPipeline = data?.data?.[0];
|
|
1643
|
-
if (excludedIds.includes(hubspotObjectTypeId)) {
|
|
1644
|
-
defaultPipelineId = defaultPipeline?.pipelineId || "";
|
|
1645
|
-
}
|
|
1646
|
-
if (params && params?.filterPropertyName === "hs_pipeline" && params?.filterValue) {
|
|
1647
|
-
mFilterValue = params.filterValue;
|
|
1648
|
-
} else {
|
|
1649
|
-
if (view === "BOARD" && !selectedPipeline) {
|
|
1650
|
-
mFilterValue = defaultPipelineId;
|
|
1651
|
-
updateLink({
|
|
1652
|
-
fV: defaultPipelineId
|
|
1653
|
-
});
|
|
1654
|
-
} else if (!excludedIds.includes(hubspotObjectTypeId)) {
|
|
1655
|
-
mFilterValue = selectedPipeline || null;
|
|
1656
|
-
} else {
|
|
1657
|
-
mFilterValue = data.data.length === 1 ? defaultPipelineId : selectedPipeline;
|
|
1658
|
-
}
|
|
1659
|
-
}
|
|
1660
|
-
set({ selectedPipeline: mFilterValue });
|
|
1661
|
-
return mFilterValue;
|
|
1662
|
-
}
|
|
1663
|
-
}));
|
|
1664
|
-
function useTable() {
|
|
1665
|
-
const tableState = tableStore.getState();
|
|
1666
|
-
return {
|
|
1667
|
-
...tableState,
|
|
1668
|
-
...{ listeners: { subscribe: tableStore.subscribe } }
|
|
1669
|
-
};
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
// src/apis/pipeline.ts
|
|
1673
|
-
function list(options) {
|
|
1674
|
-
const {
|
|
1675
|
-
getTableParam
|
|
1676
|
-
} = useTable();
|
|
1677
|
-
const { mutate, isLoading } = createMutation(
|
|
1678
|
-
async (payload) => {
|
|
1679
|
-
const param = await getTableParam(payload?.companyAsMediator);
|
|
1680
|
-
const response = await Client.pipeline.list(payload, param);
|
|
1681
|
-
return response;
|
|
1682
|
-
},
|
|
1683
|
-
options
|
|
1684
|
-
);
|
|
1685
|
-
return {
|
|
1686
|
-
mutate,
|
|
1687
|
-
getPipelines: mutate,
|
|
1688
|
-
isLoading
|
|
1689
|
-
};
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
|
-
// src/apis/stage.ts
|
|
1693
|
-
function list2(options) {
|
|
1694
|
-
const { mutate, isLoading } = createMutation(
|
|
1695
|
-
async (payload) => {
|
|
1696
|
-
const response = await Client.stage.list(payload);
|
|
1697
|
-
return response;
|
|
1698
|
-
},
|
|
1699
|
-
options
|
|
1700
|
-
);
|
|
1701
|
-
return {
|
|
1702
|
-
mutate,
|
|
1703
|
-
getStages: mutate,
|
|
1704
|
-
isLoading
|
|
1705
|
-
};
|
|
1706
|
-
}
|
|
1707
|
-
|
|
1708
|
-
// src/apis/object.ts
|
|
1709
|
-
function list3(options) {
|
|
1710
|
-
const {
|
|
1711
|
-
getTableParam
|
|
1712
|
-
} = useTable();
|
|
1713
|
-
const { mutate, isLoading } = createMutation(
|
|
1714
|
-
async (payload) => {
|
|
1715
|
-
const param = await getTableParam(payload?.companyAsMediator);
|
|
1716
|
-
const response = await Client.object.list(payload, param);
|
|
1717
|
-
return response;
|
|
1718
|
-
},
|
|
1719
|
-
options
|
|
1720
|
-
);
|
|
1721
|
-
return {
|
|
1722
|
-
mutate,
|
|
1723
|
-
getObjects: mutate,
|
|
1724
|
-
isLoading
|
|
1725
|
-
};
|
|
1726
|
-
}
|
|
1727
|
-
function form(options) {
|
|
1728
|
-
const { mutate, isLoading } = createMutation(
|
|
1729
|
-
async (payload) => {
|
|
1730
|
-
const response = await Client.object.form(payload);
|
|
1731
|
-
return response;
|
|
1732
|
-
},
|
|
1733
|
-
options
|
|
1734
|
-
);
|
|
1735
|
-
return {
|
|
1736
|
-
mutate,
|
|
1737
|
-
getObjectsForm: mutate,
|
|
1738
|
-
isLoading
|
|
1739
|
-
};
|
|
1740
|
-
}
|
|
1741
|
-
function objectFormOptions(options) {
|
|
1742
|
-
const { mutate, isLoading } = createMutation(
|
|
1743
|
-
async (payload) => {
|
|
1744
|
-
const response = await Client.object.objectFormOptions(payload);
|
|
1745
|
-
return response;
|
|
1746
|
-
},
|
|
1747
|
-
options
|
|
1748
|
-
);
|
|
1749
|
-
return {
|
|
1750
|
-
mutate,
|
|
1751
|
-
objectFormOptions: mutate,
|
|
1752
|
-
isLoading
|
|
1753
|
-
};
|
|
1754
|
-
}
|
|
1755
|
-
function create(options) {
|
|
1756
|
-
const { mutate, isLoading } = createMutation(
|
|
1757
|
-
async (props) => {
|
|
1758
|
-
const response = await Client.object.create(props);
|
|
1759
|
-
return response;
|
|
1760
|
-
},
|
|
1761
|
-
options
|
|
1762
|
-
);
|
|
1763
|
-
return {
|
|
1764
|
-
mutate,
|
|
1765
|
-
createObject: mutate,
|
|
1766
|
-
isLoading
|
|
1767
|
-
};
|
|
1768
|
-
}
|
|
1769
|
-
function createExisting(options) {
|
|
1770
|
-
const { mutate, isLoading } = createMutation(
|
|
1771
|
-
async (props) => {
|
|
1772
|
-
const response = await Client.object.createExisting(props);
|
|
1773
|
-
return response;
|
|
1774
|
-
},
|
|
1775
|
-
options
|
|
1776
|
-
);
|
|
1777
|
-
return {
|
|
1778
|
-
mutate,
|
|
1779
|
-
createExistingObject: mutate,
|
|
1780
|
-
isLoading
|
|
1781
|
-
};
|
|
1782
|
-
}
|
|
1783
|
-
function removeExisting(options) {
|
|
1784
|
-
const { mutate, isLoading } = createMutation(
|
|
1785
|
-
async (props) => {
|
|
1786
|
-
const response = await Client.object.removeExisting(props);
|
|
1787
|
-
return response;
|
|
1788
|
-
},
|
|
1789
|
-
options
|
|
1790
|
-
);
|
|
1791
|
-
return {
|
|
1792
|
-
mutate,
|
|
1793
|
-
removeExisting: mutate,
|
|
1794
|
-
isLoading
|
|
1795
|
-
};
|
|
1796
|
-
}
|
|
1797
|
-
function details(options) {
|
|
1798
|
-
const { mutate, isLoading } = createMutation(
|
|
1799
|
-
async (payload) => {
|
|
1800
|
-
const response = await Client.object.details(payload);
|
|
1801
|
-
return response;
|
|
1802
|
-
},
|
|
1803
|
-
options
|
|
1804
|
-
);
|
|
1805
|
-
return {
|
|
1806
|
-
mutate,
|
|
1807
|
-
getObjectsDetails: mutate,
|
|
1808
|
-
isLoading
|
|
1809
|
-
};
|
|
1810
|
-
}
|
|
1811
|
-
function update(options) {
|
|
1812
|
-
const { mutate, isLoading } = createMutation(
|
|
1813
|
-
async (payload) => {
|
|
1814
|
-
const response = await Client.object.update(payload);
|
|
1815
|
-
return response;
|
|
1816
|
-
},
|
|
1817
|
-
options
|
|
1818
|
-
);
|
|
1819
|
-
return {
|
|
1820
|
-
mutate,
|
|
1821
|
-
updateObjectsDetails: mutate,
|
|
1822
|
-
isLoading
|
|
1823
|
-
};
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
// src/apis/note.ts
|
|
1827
|
-
function list4(options) {
|
|
1828
|
-
const { mutate, isLoading } = createMutation(
|
|
1829
|
-
async (payload) => {
|
|
1830
|
-
const response = await Client.note.list(payload);
|
|
1831
|
-
return response;
|
|
1832
|
-
},
|
|
1833
|
-
options
|
|
1834
|
-
);
|
|
1835
|
-
return {
|
|
1836
|
-
mutate,
|
|
1837
|
-
getNotes: mutate,
|
|
1838
|
-
isLoading
|
|
1839
|
-
};
|
|
1840
|
-
}
|
|
1841
|
-
function create2(options) {
|
|
1842
|
-
const { mutate, isLoading } = createMutation(
|
|
1843
|
-
async (props) => {
|
|
1844
|
-
const response = await Client.note.create(props);
|
|
1845
|
-
return response;
|
|
1846
|
-
},
|
|
1847
|
-
options
|
|
1848
|
-
);
|
|
1849
|
-
return {
|
|
1850
|
-
mutate,
|
|
1851
|
-
createNote: mutate,
|
|
1852
|
-
isLoading
|
|
1853
|
-
};
|
|
1854
|
-
}
|
|
1855
|
-
function update2(options) {
|
|
1856
|
-
const { mutate, isLoading } = createMutation(
|
|
1857
|
-
async (payload) => {
|
|
1858
|
-
const response = await Client.note.update(payload);
|
|
1859
|
-
return response;
|
|
1860
|
-
},
|
|
1861
|
-
options
|
|
1862
|
-
);
|
|
1863
|
-
return {
|
|
1864
|
-
mutate,
|
|
1865
|
-
updateNote: mutate,
|
|
1866
|
-
isLoading
|
|
1867
|
-
};
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
// src/apis/email.ts
|
|
1871
|
-
function list5(options) {
|
|
1872
|
-
const { mutate, isLoading } = createMutation(
|
|
1873
|
-
async (payload) => {
|
|
1874
|
-
const response = await Client.email.list(payload);
|
|
1875
|
-
return response;
|
|
1876
|
-
},
|
|
1877
|
-
options
|
|
1878
|
-
);
|
|
1879
|
-
return {
|
|
1880
|
-
mutate,
|
|
1881
|
-
getEmails: mutate,
|
|
1882
|
-
isLoading
|
|
1883
|
-
};
|
|
1884
|
-
}
|
|
1885
|
-
function create3(options) {
|
|
1886
|
-
const { mutate, isLoading } = createMutation(
|
|
1887
|
-
async (props) => {
|
|
1888
|
-
const response = await Client.email.create(props);
|
|
1889
|
-
return response;
|
|
1890
|
-
},
|
|
1891
|
-
options
|
|
1892
|
-
);
|
|
1893
|
-
return {
|
|
1894
|
-
mutate,
|
|
1895
|
-
createEmail: mutate,
|
|
1896
|
-
isLoading
|
|
1897
|
-
};
|
|
1898
|
-
}
|
|
1899
|
-
function update3(options) {
|
|
1900
|
-
const { mutate, isLoading } = createMutation(
|
|
1901
|
-
async (payload) => {
|
|
1902
|
-
const response = await Client.email.update(payload);
|
|
1903
|
-
return response;
|
|
1904
|
-
},
|
|
1905
|
-
options
|
|
1906
|
-
);
|
|
1907
|
-
return {
|
|
1908
|
-
mutate,
|
|
1909
|
-
updateEmail: mutate,
|
|
1910
|
-
isLoading
|
|
1911
|
-
};
|
|
1912
|
-
}
|
|
1913
|
-
|
|
1914
|
-
// src/apis/uploader.ts
|
|
1915
|
-
function imageUpload(options) {
|
|
1916
|
-
const { mutate, isLoading } = createMutation(
|
|
1917
|
-
async (payload) => {
|
|
1918
|
-
const response = payload?.type === "email" ? await Client.email.image(payload) : await Client.note.image(payload);
|
|
1919
|
-
return response;
|
|
1920
|
-
},
|
|
1921
|
-
options
|
|
1922
|
-
);
|
|
1923
|
-
return {
|
|
1924
|
-
mutate,
|
|
1925
|
-
imageUpload: mutate,
|
|
1926
|
-
isLoading
|
|
1927
|
-
};
|
|
1928
|
-
}
|
|
1929
|
-
function attachmentUpload(options) {
|
|
1930
|
-
const { mutate, isLoading } = createMutation(
|
|
1931
|
-
async (payload) => {
|
|
1932
|
-
const response = payload?.type === "email" ? await Client.email.attachment(payload) : await Client.note.attachment(payload);
|
|
1933
|
-
return response;
|
|
1934
|
-
},
|
|
1935
|
-
options
|
|
1936
|
-
);
|
|
1937
|
-
return {
|
|
1938
|
-
mutate,
|
|
1939
|
-
attachmentUpload: mutate,
|
|
1940
|
-
isLoading
|
|
1941
|
-
};
|
|
1942
|
-
}
|
|
1943
|
-
|
|
1944
|
-
// src/apis/file.ts
|
|
1945
|
-
function list6(options) {
|
|
1946
|
-
const { mutate, isLoading } = createMutation(
|
|
1947
|
-
async (payload) => {
|
|
1948
|
-
const response = await Client.file.list(payload);
|
|
1949
|
-
return response;
|
|
1950
|
-
},
|
|
1951
|
-
options
|
|
1952
|
-
);
|
|
1953
|
-
return {
|
|
1954
|
-
mutate,
|
|
1955
|
-
getFiles: mutate,
|
|
1956
|
-
isLoading
|
|
1957
|
-
};
|
|
1958
|
-
}
|
|
1959
|
-
function details2(options) {
|
|
1960
|
-
const { mutate, isLoading } = createMutation(
|
|
1961
|
-
async (payload) => {
|
|
1962
|
-
const response = await Client.file.details(payload);
|
|
1963
|
-
return response;
|
|
1964
|
-
},
|
|
1965
|
-
options
|
|
1966
|
-
);
|
|
1967
|
-
return {
|
|
1968
|
-
mutate,
|
|
1969
|
-
getFile: mutate,
|
|
1970
|
-
isLoading
|
|
1971
|
-
};
|
|
1972
|
-
}
|
|
1973
|
-
function addFolder(options) {
|
|
1974
|
-
const { mutate, isLoading } = createMutation(
|
|
1975
|
-
async (props) => {
|
|
1976
|
-
const response = await Client.file.addFolder(props);
|
|
1977
|
-
return response;
|
|
1978
|
-
},
|
|
1979
|
-
options
|
|
1980
|
-
);
|
|
1981
|
-
return {
|
|
1982
|
-
mutate,
|
|
1983
|
-
addFolder: mutate,
|
|
1984
|
-
isLoading
|
|
1985
|
-
};
|
|
1986
|
-
}
|
|
1987
|
-
function addFile(options) {
|
|
1988
|
-
const { mutate, isLoading } = createMutation(
|
|
1989
|
-
async (props) => {
|
|
1990
|
-
const response = await Client.file.addFile(props);
|
|
1991
|
-
return response;
|
|
1992
|
-
},
|
|
1993
|
-
options
|
|
1994
|
-
);
|
|
1995
|
-
return {
|
|
1996
|
-
mutate,
|
|
1997
|
-
addFile: mutate,
|
|
1998
|
-
isLoading
|
|
1999
|
-
};
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
// src/index.ts
|
|
2003
|
-
init_auth_utils();
|
|
2004
|
-
init_token_store();
|
|
2005
|
-
init_cookie();
|
|
2006
|
-
|
|
2007
|
-
// src/breadcrumb/breadcrumbs.ts
|
|
2008
|
-
var getBreadcrumbs = () => {
|
|
2009
|
-
const search = getParam("b");
|
|
2010
|
-
let breadcrumbs = decodeToBase64(search) || [];
|
|
2011
|
-
if (!breadcrumbs && breadcrumbs.length < 1) return [];
|
|
2012
|
-
const updated = breadcrumbs.map((breadcrumb, index) => {
|
|
2013
|
-
return generatePath(breadcrumbs, breadcrumb, index);
|
|
2014
|
-
});
|
|
2015
|
-
if (updated.length < 1) {
|
|
2016
|
-
const pathname = getPath();
|
|
2017
|
-
const routeMenu = getRouteMenu(pathname);
|
|
2018
|
-
return [
|
|
2019
|
-
{
|
|
2020
|
-
name: routeMenu?.title,
|
|
2021
|
-
path: routeMenu?.path
|
|
2022
|
-
}
|
|
2023
|
-
];
|
|
2024
|
-
}
|
|
2025
|
-
return updated;
|
|
2026
|
-
};
|
|
2027
|
-
var getTableTitle = (componentName, title, ticketTableTitle) => {
|
|
2028
|
-
const search = getParam("b");
|
|
2029
|
-
let breadcrumbs = decodeToBase64(search) || [];
|
|
2030
|
-
if (breadcrumbs.length < 1) {
|
|
2031
|
-
const pathname = getPath();
|
|
2032
|
-
const routeMenu = getRouteMenu(pathname);
|
|
2033
|
-
breadcrumbs = [
|
|
2034
|
-
{
|
|
2035
|
-
n: routeMenu?.title,
|
|
2036
|
-
pt: routeMenu?.path
|
|
2037
|
-
}
|
|
2038
|
-
];
|
|
2039
|
-
}
|
|
2040
|
-
let associatedtableTitleSingular = "";
|
|
2041
|
-
let tableTitle = "";
|
|
2042
|
-
let singularTableTitle = "";
|
|
2043
|
-
if (breadcrumbs && breadcrumbs.length > 0) {
|
|
2044
|
-
const lastItem = breadcrumbs[breadcrumbs.length - 1];
|
|
2045
|
-
const last = lastItem ? generatePath(breadcrumbs, lastItem, breadcrumbs.length - 1) : null;
|
|
2046
|
-
const previousItem = breadcrumbs[breadcrumbs.length - 2];
|
|
2047
|
-
const previous = previousItem ? generatePath(breadcrumbs, previousItem, breadcrumbs.length - 2) : null;
|
|
2048
|
-
const singularLastName = last?.name;
|
|
2049
|
-
associatedtableTitleSingular = singularLastName;
|
|
2050
|
-
if (componentName != "ticket") {
|
|
2051
|
-
tableTitle = previous?.name ? { last, previous } : { last };
|
|
2052
|
-
singularTableTitle = previous?.name ? `${singularLastName} with ${previous?.name}` : singularLastName;
|
|
2053
|
-
} else {
|
|
2054
|
-
const ticketTableTitleSingular = ticketTableTitle.endsWith("s") ? ticketTableTitle.slice(0, -1) : ticketTableTitle;
|
|
2055
|
-
tableTitle = { last: { name: title } };
|
|
2056
|
-
singularTableTitle = previous?.name ? `${ticketTableTitleSingular} with ${singularLastName} ` : ticketTableTitleSingular;
|
|
2057
|
-
}
|
|
2058
|
-
}
|
|
2059
|
-
return { associatedtableTitleSingular, tableTitle, singularTableTitle };
|
|
2060
|
-
};
|
|
2061
|
-
var getFormTitle = (type, title, activeTab) => {
|
|
2062
|
-
const search = getParam("b");
|
|
2063
|
-
let breadcrumbs = decodeToBase64(search) || [];
|
|
2064
|
-
if (breadcrumbs.length < 1) {
|
|
2065
|
-
const pathname = getPath();
|
|
2066
|
-
const routeMenu = getRouteMenu(pathname);
|
|
2067
|
-
breadcrumbs = [
|
|
2068
|
-
{
|
|
2069
|
-
n: routeMenu?.title,
|
|
2070
|
-
pt: routeMenu?.path
|
|
2071
|
-
}
|
|
2072
|
-
];
|
|
2073
|
-
}
|
|
2074
|
-
let objectName = "";
|
|
2075
|
-
let puralObjectName = "";
|
|
2076
|
-
let dialogTitle = "";
|
|
2077
|
-
if (breadcrumbs && breadcrumbs?.length > 0) {
|
|
2078
|
-
const last = breadcrumbs[breadcrumbs?.length - 1];
|
|
2079
|
-
const lastName = last?.n;
|
|
2080
|
-
const mTitle = title;
|
|
2081
|
-
if (type === "association" && breadcrumbs && breadcrumbs?.length > 0) {
|
|
2082
|
-
objectName = title;
|
|
2083
|
-
puralObjectName = title;
|
|
2084
|
-
dialogTitle = `${activeTab == "addNew" ? `Create a new ${mTitle} for ${nameTrancate(lastName)}` : `Associate an Existing ${mTitle} with ${nameTrancate(lastName)}`}`;
|
|
2085
|
-
} else {
|
|
2086
|
-
const singularLastName = typeof lastName === "string" && lastName?.endsWith("s") ? lastName.slice(0, -1) : lastName;
|
|
2087
|
-
objectName = singularLastName;
|
|
2088
|
-
puralObjectName = lastName;
|
|
2089
|
-
dialogTitle = `${activeTab == "addNew" ? `Create a new ${mTitle?.includes("with") ? nameTrancate(mTitle?.replace("with", "for")) : nameTrancate(mTitle)}` : `Associate an Existing ${nameTrancate(mTitle)}`}`;
|
|
2090
|
-
}
|
|
2091
|
-
}
|
|
2092
|
-
return { objectName, puralObjectName, dialogTitle };
|
|
2093
|
-
};
|
|
2094
|
-
var nameTrancate = (name) => {
|
|
2095
|
-
return name?.length > 30 ? `${name?.slice(0, 30) + "..."}` : name;
|
|
2096
|
-
};
|
|
2097
|
-
|
|
2098
|
-
// src/breadcrumb/generate-url.ts
|
|
2099
|
-
var useMakeLink = () => {
|
|
2100
|
-
const search = getParam("b");
|
|
2101
|
-
const makeLink = (props) => {
|
|
2102
|
-
if (!search || "isPC" in props) {
|
|
2103
|
-
return buildParentRoute(props);
|
|
2104
|
-
} else {
|
|
2105
|
-
const breadcrumbItems = decodeToBase64(search) || [];
|
|
2106
|
-
return buildChildRoute(props, breadcrumbItems);
|
|
2107
|
-
}
|
|
2108
|
-
};
|
|
2109
|
-
return { makeLink };
|
|
2110
|
-
};
|
|
2111
|
-
var buildParentRoute = (props) => {
|
|
2112
|
-
const pathname = getPath();
|
|
2113
|
-
const routeMenu = getRouteMenu(pathname);
|
|
2114
|
-
const breadcrumbItems = [
|
|
2115
|
-
{
|
|
2116
|
-
n: routeMenu?.title,
|
|
2117
|
-
o_t_id: routeMenu?.path,
|
|
2118
|
-
isHome: props?.isHome || false
|
|
2119
|
-
}
|
|
2120
|
-
];
|
|
2121
|
-
return buildChildRoute(props, breadcrumbItems);
|
|
2122
|
-
};
|
|
2123
|
-
var buildChildRoute = (props, breadcrumbItems) => {
|
|
2124
|
-
let breadcrumbs = [...breadcrumbItems];
|
|
2125
|
-
let breadcrumbType = breadcrumbStage(breadcrumbItems);
|
|
2126
|
-
if (props?.isHome && isMessingParentLastItem(breadcrumbItems)) {
|
|
2127
|
-
const parent = {
|
|
2128
|
-
n: props?.title || "",
|
|
2129
|
-
o_t_id: props?.objectTypeId,
|
|
2130
|
-
"pt": `/association/${props?.objectTypeId}`,
|
|
2131
|
-
isHome: props?.isHome || false,
|
|
2132
|
-
"prm": {
|
|
2133
|
-
"sort": "-hs_createdate",
|
|
2134
|
-
"s": "",
|
|
2135
|
-
"fPn": "hs_pipeline",
|
|
2136
|
-
"fO": "eq",
|
|
2137
|
-
"fV": "",
|
|
2138
|
-
"c": true,
|
|
2139
|
-
"isPC": props?.isPC,
|
|
2140
|
-
"v": "LIST",
|
|
2141
|
-
"l": "10",
|
|
2142
|
-
"p": 1
|
|
2143
|
-
}
|
|
2144
|
-
};
|
|
2145
|
-
breadcrumbs.push(parent);
|
|
2146
|
-
const newCrumb = {
|
|
2147
|
-
n: props?.name,
|
|
2148
|
-
o_t_id: props?.objectTypeId,
|
|
2149
|
-
o_r_id: props?.recordId
|
|
2150
|
-
};
|
|
2151
|
-
breadcrumbs.push(newCrumb);
|
|
2152
|
-
} else if (breadcrumbType === "root") {
|
|
2153
|
-
const newCrumb = {
|
|
2154
|
-
n: props?.name,
|
|
2155
|
-
o_t_id: props?.objectTypeId,
|
|
2156
|
-
o_r_id: props?.recordId
|
|
2157
|
-
};
|
|
2158
|
-
if (props?.isPC) {
|
|
2159
|
-
newCrumb.prm = {
|
|
2160
|
-
isPC: props?.isPC
|
|
2161
|
-
};
|
|
2162
|
-
}
|
|
2163
|
-
breadcrumbs.push(newCrumb);
|
|
2164
|
-
} else {
|
|
2165
|
-
const lastItem = breadcrumbs[breadcrumbs.length - 1];
|
|
2166
|
-
if (props?.objectTypeId != "0-5" && breadcrumbs.length > 2 && // check for only association ticket object
|
|
2167
|
-
(!isMessingParent(breadcrumbItems) && lastItem?.o_t_id === props?.objectTypeId) && // check for all associated object and check isMessingParent for skip parent to child and child to parent association data
|
|
2168
|
-
(props?.isHome && !isMessingParentLastItem(breadcrumbItems))) {
|
|
2169
|
-
const newCrumb = {
|
|
2170
|
-
n: props?.name,
|
|
2171
|
-
o_t_id: props?.objectTypeId,
|
|
2172
|
-
o_r_id: props?.recordId
|
|
2173
|
-
};
|
|
2174
|
-
if (props?.isPC) {
|
|
2175
|
-
newCrumb.prm = {
|
|
2176
|
-
isPC: props?.isPC
|
|
2177
|
-
};
|
|
2178
|
-
}
|
|
2179
|
-
breadcrumbs.push(newCrumb);
|
|
2180
|
-
} else {
|
|
2181
|
-
const lastItem2 = breadcrumbs[breadcrumbs.length - 1];
|
|
2182
|
-
const parent = {
|
|
2183
|
-
n: props?.associationLabel || props?.name,
|
|
2184
|
-
o_t_id: props?.objectTypeId
|
|
2185
|
-
};
|
|
2186
|
-
if (props?.tableParam) {
|
|
2187
|
-
parent.prm = props?.tableParam;
|
|
2188
|
-
}
|
|
2189
|
-
if (props?.defPermissions) {
|
|
2190
|
-
parent.dp = props?.defPermissions;
|
|
2191
|
-
}
|
|
2192
|
-
if (lastItem2?.o_t_id && lastItem2?.o_r_id) {
|
|
2193
|
-
breadcrumbs.push(parent);
|
|
2194
|
-
}
|
|
2195
|
-
if (props?.recordId) {
|
|
2196
|
-
const newCrumb = {
|
|
2197
|
-
n: props?.name,
|
|
2198
|
-
o_t_id: props?.objectTypeId,
|
|
2199
|
-
o_r_id: props?.recordId
|
|
2200
|
-
};
|
|
2201
|
-
if (props?.isPC) {
|
|
2202
|
-
newCrumb.prm = {
|
|
2203
|
-
isPC: props?.isPC
|
|
2204
|
-
};
|
|
2205
|
-
}
|
|
2206
|
-
breadcrumbs.push(newCrumb);
|
|
2207
|
-
}
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
2210
|
-
return generateUrl(props, breadcrumbs);
|
|
2211
|
-
};
|
|
2212
|
-
|
|
2213
|
-
// src/index.ts
|
|
2214
|
-
var api = {
|
|
2215
|
-
preLogin,
|
|
2216
|
-
login,
|
|
2217
|
-
verifyEmail,
|
|
2218
|
-
resetPasswordVerifyToken,
|
|
2219
|
-
resetPassword,
|
|
2220
|
-
registerExistingUser,
|
|
2221
|
-
verifyEmailResend,
|
|
2222
|
-
resendEmail,
|
|
2223
|
-
getSsoDetails,
|
|
2224
|
-
generateSsoUrl,
|
|
2225
|
-
ssoCallback,
|
|
2226
|
-
forgetPassword,
|
|
2227
|
-
logout,
|
|
2228
|
-
me,
|
|
2229
|
-
profile,
|
|
2230
|
-
changePassword,
|
|
2231
|
-
pipelines: list,
|
|
2232
|
-
stages: list2,
|
|
2233
|
-
objects: list3,
|
|
2234
|
-
objectsForm: form,
|
|
2235
|
-
createObject: create,
|
|
2236
|
-
createExistingObject: createExisting,
|
|
2237
|
-
removeExistingObject: removeExisting,
|
|
2238
|
-
objectsDetails: details,
|
|
2239
|
-
updateObjectsDetails: update,
|
|
2240
|
-
objectFormOptions,
|
|
2241
|
-
notes: list4,
|
|
2242
|
-
createNote: create2,
|
|
2243
|
-
updateNote: update2,
|
|
2244
|
-
emails: list5,
|
|
2245
|
-
createEmail: create3,
|
|
2246
|
-
updateEmail: update3,
|
|
2247
|
-
imageUpload,
|
|
2248
|
-
attachmentUpload,
|
|
2249
|
-
files: list6,
|
|
2250
|
-
file: details2,
|
|
2251
|
-
addFolder,
|
|
2252
|
-
addFile,
|
|
2253
|
-
getRefreshToken,
|
|
2254
|
-
getAuthRefreshToken,
|
|
2255
|
-
isCookieExpired,
|
|
2256
|
-
isExpiresAccessToken,
|
|
2257
|
-
isAuthenticateApp,
|
|
2258
|
-
getAccessToken
|
|
2259
|
-
};
|
|
2260
|
-
var store = {
|
|
2261
|
-
storage,
|
|
2262
|
-
useTable
|
|
2263
|
-
};
|
|
2264
|
-
var breadcrumbsDetails = {
|
|
2265
|
-
getBreadcrumbs,
|
|
2266
|
-
getTableTitle,
|
|
2267
|
-
getFormTitle
|
|
2268
|
-
};
|
|
2269
|
-
var url = {
|
|
2270
|
-
useMakeLink,
|
|
2271
|
-
useUpdateLink
|
|
2272
|
-
};
|
|
2273
|
-
var routeParam = {
|
|
2274
|
-
getRouteDetails,
|
|
2275
|
-
getParamDetails
|
|
2276
|
-
};
|
|
2277
|
-
|
|
2278
|
-
export { api, breadcrumbsDetails, getFieldErrors, getFormErrors, initializeHttpClient, routeParam, store, url };
|
|
1
|
+
export { DEFAULT_HUBSPOT_TIMEZONE, api, breadcrumbsDetails, buildCachePurgeRequest, buildCrmListPurgeTarget, buildCrmSinglePurgeTarget, buildEngagementPurgeTarget, buildPortalConfigPurgeTarget, buildUserSessionPurgeTarget, client_exports as clint, createCachePurgeJob, formatGmtOffset, formatHubSpotActivityDateTime, formatHubSpotActivityDateTimeParts, getCurrentTimeZone, getFieldErrors, getFormErrors, initializeHttpClient, mergePurgeTargets, normalizeToTimestamp, purgeCrmCombined, purgeCrmListCache, purgeCrmObjectDataCache, purgeCrmRecordCache, purgeEngagementCaches, routeParam, store, url } from './chunk-IVNXDHLP.js';
|
|
2
|
+
import './chunk-2SYUOWTT.js';
|
|
2279
3
|
//# sourceMappingURL=index.js.map
|
|
2280
4
|
//# sourceMappingURL=index.js.map
|