@fctc/interface-logic 1.7.7 → 1.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs.d.mts +4 -4
- package/dist/configs.d.ts +4 -4
- package/dist/configs.js +15 -12
- package/dist/configs.mjs +15 -12
- package/dist/environment.d.mts +56 -35
- package/dist/environment.d.ts +56 -35
- package/dist/environment.js +1915 -1851
- package/dist/environment.mjs +1913 -1850
- package/dist/hooks.d.mts +1 -6
- package/dist/hooks.d.ts +1 -6
- package/dist/hooks.js +2150 -1889
- package/dist/hooks.mjs +2123 -1861
- package/dist/provider.js +310 -18
- package/dist/provider.mjs +310 -18
- package/dist/services.d.mts +0 -1
- package/dist/services.d.ts +0 -1
- package/dist/services.js +2099 -1822
- package/dist/services.mjs +2099 -1822
- package/dist/store.d.mts +28 -112
- package/dist/store.d.ts +28 -112
- package/dist/store.js +6 -12
- package/dist/store.mjs +6 -12
- package/package.json +81 -81
package/dist/hooks.js
CHANGED
|
@@ -96,7 +96,6 @@ __export(hooks_exports, {
|
|
|
96
96
|
useUploadFile: () => use_upload_file_default,
|
|
97
97
|
useUploadIdFile: () => use_upload_id_file_default,
|
|
98
98
|
useUploadImage: () => use_upload_image_default,
|
|
99
|
-
useValidateActionToken: () => use_validate_action_token_default,
|
|
100
99
|
useVerify2FA: () => use_verify_2FA_default,
|
|
101
100
|
useVerifyTotp: () => use_verify_totp_default
|
|
102
101
|
});
|
|
@@ -135,667 +134,47 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
135
134
|
return UriConstants2;
|
|
136
135
|
})(UriConstants || {});
|
|
137
136
|
|
|
138
|
-
// src/
|
|
139
|
-
var
|
|
137
|
+
// src/configs/axios-client.ts
|
|
138
|
+
var import_axios = __toESM(require("axios"));
|
|
140
139
|
|
|
141
|
-
// src/
|
|
142
|
-
var
|
|
143
|
-
var initialState = {
|
|
144
|
-
breadCrumbs: []
|
|
145
|
-
};
|
|
146
|
-
var breadcrumbsSlice = (0, import_toolkit.createSlice)({
|
|
147
|
-
name: "breadcrumbs",
|
|
148
|
-
initialState,
|
|
149
|
-
reducers: {
|
|
150
|
-
setBreadCrumbs: (state, action) => {
|
|
151
|
-
state.breadCrumbs = [...state.breadCrumbs, action.payload];
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
var { setBreadCrumbs } = breadcrumbsSlice.actions;
|
|
156
|
-
var breadcrums_slice_default = breadcrumbsSlice.reducer;
|
|
140
|
+
// src/utils/format.ts
|
|
141
|
+
var import_moment = __toESM(require("moment"));
|
|
157
142
|
|
|
158
|
-
// src/
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
db: "",
|
|
165
|
-
refreshTokenEndpoint: "",
|
|
166
|
-
config: {
|
|
167
|
-
grantType: "",
|
|
168
|
-
clientId: "",
|
|
169
|
-
clientSecret: "",
|
|
170
|
-
redirectUri: ""
|
|
171
|
-
},
|
|
172
|
-
envFile: null,
|
|
173
|
-
defaultCompany: {
|
|
174
|
-
id: null,
|
|
175
|
-
logo: "",
|
|
176
|
-
secondary_color: "",
|
|
177
|
-
primary_color: ""
|
|
178
|
-
},
|
|
179
|
-
context: {
|
|
180
|
-
uid: null,
|
|
181
|
-
allowed_company_ids: [],
|
|
182
|
-
lang: "vi_VN",
|
|
183
|
-
tz: "Asia/Saigon"
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
var envSlice = (0, import_toolkit2.createSlice)({
|
|
187
|
-
name: "env",
|
|
188
|
-
initialState: initialState2,
|
|
189
|
-
reducers: {
|
|
190
|
-
setEnv: (state, action) => {
|
|
191
|
-
Object.assign(state, action.payload);
|
|
192
|
-
},
|
|
193
|
-
setUid: (state, action) => {
|
|
194
|
-
state.context.uid = action.payload;
|
|
195
|
-
},
|
|
196
|
-
setAllowCompanies: (state, action) => {
|
|
197
|
-
state.context.allowed_company_ids = action.payload;
|
|
198
|
-
},
|
|
199
|
-
setCompanies: (state, action) => {
|
|
200
|
-
state.companies = action.payload;
|
|
201
|
-
},
|
|
202
|
-
setDefaultCompany: (state, action) => {
|
|
203
|
-
state.defaultCompany = action.payload;
|
|
204
|
-
},
|
|
205
|
-
setLang: (state, action) => {
|
|
206
|
-
state.context.lang = action.payload;
|
|
207
|
-
},
|
|
208
|
-
setUser: (state, action) => {
|
|
209
|
-
state.user = action.payload;
|
|
210
|
-
},
|
|
211
|
-
setConfig: (state, action) => {
|
|
212
|
-
state.config = action.payload;
|
|
213
|
-
},
|
|
214
|
-
setEnvFile: (state, action) => {
|
|
215
|
-
state.envFile = action.payload;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
var {
|
|
220
|
-
setEnv,
|
|
221
|
-
setUid,
|
|
222
|
-
setLang,
|
|
223
|
-
setAllowCompanies,
|
|
224
|
-
setCompanies,
|
|
225
|
-
setDefaultCompany,
|
|
226
|
-
setUser,
|
|
227
|
-
setConfig,
|
|
228
|
-
setEnvFile
|
|
229
|
-
} = envSlice.actions;
|
|
230
|
-
var env_slice_default = envSlice.reducer;
|
|
143
|
+
// src/constants/widget/widget-avatar-constant.ts
|
|
144
|
+
var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
145
|
+
WIDGETAVATAR2["many2one_avatar_user"] = "many2one_avatar_user";
|
|
146
|
+
WIDGETAVATAR2["many2many_avatar_user"] = "many2many_avatar_user";
|
|
147
|
+
return WIDGETAVATAR2;
|
|
148
|
+
})(WIDGETAVATAR || {});
|
|
231
149
|
|
|
232
|
-
// src/
|
|
233
|
-
var
|
|
234
|
-
var initialState3 = {
|
|
235
|
-
dataParse: null,
|
|
236
|
-
idFile: null,
|
|
237
|
-
isFileLoaded: false,
|
|
238
|
-
loadingImport: false,
|
|
239
|
-
selectedFile: null,
|
|
240
|
-
errorData: null
|
|
150
|
+
// src/utils/domain/py_tokenizer.ts
|
|
151
|
+
var TokenizerError = class extends Error {
|
|
241
152
|
};
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
state.isFileLoaded = action.payload;
|
|
254
|
-
},
|
|
255
|
-
setLoadingImport: (state, action) => {
|
|
256
|
-
state.loadingImport = action.payload;
|
|
257
|
-
},
|
|
258
|
-
setSelectedFile: (state, action) => {
|
|
259
|
-
state.selectedFile = action.payload;
|
|
260
|
-
},
|
|
261
|
-
setErrorData: (state, action) => {
|
|
262
|
-
state.errorData = action.payload;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
var {
|
|
267
|
-
setDataParse,
|
|
268
|
-
setIdFile,
|
|
269
|
-
setIsFileLoaded,
|
|
270
|
-
setLoadingImport,
|
|
271
|
-
setSelectedFile,
|
|
272
|
-
setErrorData
|
|
273
|
-
} = excelSlice.actions;
|
|
274
|
-
var excel_slice_default = excelSlice.reducer;
|
|
275
|
-
|
|
276
|
-
// src/store/reducers/form-slice/index.ts
|
|
277
|
-
var import_toolkit4 = require("@reduxjs/toolkit");
|
|
278
|
-
var initialState4 = {
|
|
279
|
-
viewDataStore: {},
|
|
280
|
-
isShowingModalDetail: false,
|
|
281
|
-
isShowModalTranslate: false,
|
|
282
|
-
formSubmitComponent: {},
|
|
283
|
-
fieldTranslation: null,
|
|
284
|
-
listSubject: {},
|
|
285
|
-
dataUser: {}
|
|
153
|
+
var directMap = {
|
|
154
|
+
"\\": "\\",
|
|
155
|
+
'"': '"',
|
|
156
|
+
"'": "'",
|
|
157
|
+
a: "\x07",
|
|
158
|
+
b: "\b",
|
|
159
|
+
f: "\f",
|
|
160
|
+
n: "\n",
|
|
161
|
+
r: "\r",
|
|
162
|
+
t: " ",
|
|
163
|
+
v: "\v"
|
|
286
164
|
};
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
setIsShowingModalDetail: (state, action) => {
|
|
295
|
-
state.isShowingModalDetail = action.payload;
|
|
296
|
-
},
|
|
297
|
-
setIsShowModalTranslate: (state, action) => {
|
|
298
|
-
state.isShowModalTranslate = action.payload;
|
|
299
|
-
},
|
|
300
|
-
setFormSubmitComponent: (state, action) => {
|
|
301
|
-
state.formSubmitComponent[action.payload.key] = action.payload.component;
|
|
302
|
-
},
|
|
303
|
-
setFieldTranslate: (state, action) => {
|
|
304
|
-
state.fieldTranslation = action.payload;
|
|
305
|
-
},
|
|
306
|
-
setListSubject: (state, action) => {
|
|
307
|
-
state.listSubject = action.payload;
|
|
308
|
-
},
|
|
309
|
-
setDataUser: (state, action) => {
|
|
310
|
-
state.dataUser = action.payload;
|
|
165
|
+
function decodeStringLiteral(str, unicode) {
|
|
166
|
+
const out = [];
|
|
167
|
+
let code;
|
|
168
|
+
for (let i = 0; i < str.length; ++i) {
|
|
169
|
+
if (str[i] !== "\\") {
|
|
170
|
+
out.push(str[i]);
|
|
171
|
+
continue;
|
|
311
172
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
setIsShowModalTranslate,
|
|
318
|
-
setFormSubmitComponent,
|
|
319
|
-
setFieldTranslate,
|
|
320
|
-
setListSubject,
|
|
321
|
-
setDataUser
|
|
322
|
-
} = formSlice.actions;
|
|
323
|
-
var form_slice_default = formSlice.reducer;
|
|
324
|
-
|
|
325
|
-
// src/store/reducers/header-slice/index.ts
|
|
326
|
-
var import_toolkit5 = require("@reduxjs/toolkit");
|
|
327
|
-
var headerSlice = (0, import_toolkit5.createSlice)({
|
|
328
|
-
name: "header",
|
|
329
|
-
initialState: {
|
|
330
|
-
value: { allowedCompanyIds: [] }
|
|
331
|
-
},
|
|
332
|
-
reducers: {
|
|
333
|
-
setHeader: (state, action) => {
|
|
334
|
-
state.value = { ...state.value, ...action.payload };
|
|
335
|
-
},
|
|
336
|
-
setAllowedCompanyIds: (state, action) => {
|
|
337
|
-
state.value.allowedCompanyIds = action.payload;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
|
|
342
|
-
var header_slice_default = headerSlice.reducer;
|
|
343
|
-
|
|
344
|
-
// src/store/reducers/list-slice/index.ts
|
|
345
|
-
var import_toolkit6 = require("@reduxjs/toolkit");
|
|
346
|
-
var initialState5 = {
|
|
347
|
-
pageLimit: 10,
|
|
348
|
-
fields: {},
|
|
349
|
-
order: "",
|
|
350
|
-
selectedRowKeys: [],
|
|
351
|
-
selectedRadioKey: 0,
|
|
352
|
-
indexRowTableModal: -2,
|
|
353
|
-
isUpdateTableModal: false,
|
|
354
|
-
footerGroupTable: {},
|
|
355
|
-
transferDetail: null,
|
|
356
|
-
page: 0,
|
|
357
|
-
domainTable: []
|
|
358
|
-
};
|
|
359
|
-
var listSlice = (0, import_toolkit6.createSlice)({
|
|
360
|
-
name: "list",
|
|
361
|
-
initialState: initialState5,
|
|
362
|
-
reducers: {
|
|
363
|
-
setPageLimit: (state, action) => {
|
|
364
|
-
state.pageLimit = action.payload;
|
|
365
|
-
},
|
|
366
|
-
setFields: (state, action) => {
|
|
367
|
-
state.fields = action.payload;
|
|
368
|
-
},
|
|
369
|
-
setOrder: (state, action) => {
|
|
370
|
-
state.order = action.payload;
|
|
371
|
-
},
|
|
372
|
-
setSelectedRowKeys: (state, action) => {
|
|
373
|
-
state.selectedRowKeys = action.payload;
|
|
374
|
-
},
|
|
375
|
-
setSelectedRadioKey: (state, action) => {
|
|
376
|
-
state.selectedRadioKey = action.payload;
|
|
377
|
-
},
|
|
378
|
-
setIndexRowTableModal: (state, action) => {
|
|
379
|
-
state.indexRowTableModal = action.payload;
|
|
380
|
-
},
|
|
381
|
-
setTransferDetail: (state, action) => {
|
|
382
|
-
state.transferDetail = action.payload;
|
|
383
|
-
},
|
|
384
|
-
setIsUpdateTableModal: (state, action) => {
|
|
385
|
-
state.isUpdateTableModal = action.payload;
|
|
386
|
-
},
|
|
387
|
-
setPage: (state, action) => {
|
|
388
|
-
state.page = action.payload;
|
|
389
|
-
},
|
|
390
|
-
setDomainTable: (state, action) => {
|
|
391
|
-
state.domainTable = action.payload;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
var {
|
|
396
|
-
setPageLimit,
|
|
397
|
-
setFields,
|
|
398
|
-
setOrder,
|
|
399
|
-
setSelectedRowKeys,
|
|
400
|
-
setIndexRowTableModal,
|
|
401
|
-
setIsUpdateTableModal,
|
|
402
|
-
setPage,
|
|
403
|
-
setSelectedRadioKey,
|
|
404
|
-
setTransferDetail,
|
|
405
|
-
setDomainTable
|
|
406
|
-
} = listSlice.actions;
|
|
407
|
-
var list_slice_default = listSlice.reducer;
|
|
408
|
-
|
|
409
|
-
// src/store/reducers/login-slice/index.ts
|
|
410
|
-
var import_toolkit7 = require("@reduxjs/toolkit");
|
|
411
|
-
var initialState6 = {
|
|
412
|
-
db: "",
|
|
413
|
-
redirectTo: "/",
|
|
414
|
-
forgotPasswordUrl: "/"
|
|
415
|
-
};
|
|
416
|
-
var loginSlice = (0, import_toolkit7.createSlice)({
|
|
417
|
-
name: "login",
|
|
418
|
-
initialState: initialState6,
|
|
419
|
-
reducers: {
|
|
420
|
-
setDb: (state, action) => {
|
|
421
|
-
state.db = action.payload;
|
|
422
|
-
},
|
|
423
|
-
setRedirectTo: (state, action) => {
|
|
424
|
-
state.redirectTo = action.payload;
|
|
425
|
-
},
|
|
426
|
-
setForgotPasswordUrl: (state, action) => {
|
|
427
|
-
state.forgotPasswordUrl = action.payload;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
|
|
432
|
-
var login_slice_default = loginSlice.reducer;
|
|
433
|
-
|
|
434
|
-
// src/store/reducers/navbar-slice/index.ts
|
|
435
|
-
var import_toolkit8 = require("@reduxjs/toolkit");
|
|
436
|
-
var initialState7 = {
|
|
437
|
-
menuFocus: {},
|
|
438
|
-
menuAction: {},
|
|
439
|
-
navbarWidth: 250,
|
|
440
|
-
menuList: []
|
|
441
|
-
};
|
|
442
|
-
var navbarSlice = (0, import_toolkit8.createSlice)({
|
|
443
|
-
name: "navbar",
|
|
444
|
-
initialState: initialState7,
|
|
445
|
-
reducers: {
|
|
446
|
-
setMenuFocus: (state, action) => {
|
|
447
|
-
state.menuFocus = action.payload;
|
|
448
|
-
},
|
|
449
|
-
setMenuFocusAction: (state, action) => {
|
|
450
|
-
state.menuAction = action.payload;
|
|
451
|
-
},
|
|
452
|
-
setNavbarWidth: (state, action) => {
|
|
453
|
-
state.navbarWidth = action.payload;
|
|
454
|
-
},
|
|
455
|
-
setMenuList: (state, action) => {
|
|
456
|
-
state.menuList = action.payload;
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSlice.actions;
|
|
461
|
-
var navbar_slice_default = navbarSlice.reducer;
|
|
462
|
-
|
|
463
|
-
// src/store/reducers/profile-slice/index.ts
|
|
464
|
-
var import_toolkit9 = require("@reduxjs/toolkit");
|
|
465
|
-
var initialState8 = {
|
|
466
|
-
profile: {}
|
|
467
|
-
};
|
|
468
|
-
var profileSlice = (0, import_toolkit9.createSlice)({
|
|
469
|
-
name: "profile",
|
|
470
|
-
initialState: initialState8,
|
|
471
|
-
reducers: {
|
|
472
|
-
setProfile: (state, action) => {
|
|
473
|
-
state.profile = action.payload;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
});
|
|
477
|
-
var { setProfile } = profileSlice.actions;
|
|
478
|
-
var profile_slice_default = profileSlice.reducer;
|
|
479
|
-
|
|
480
|
-
// src/store/reducers/search-slice/index.ts
|
|
481
|
-
var import_toolkit10 = require("@reduxjs/toolkit");
|
|
482
|
-
var initialState9 = {
|
|
483
|
-
groupByDomain: null,
|
|
484
|
-
searchBy: [],
|
|
485
|
-
searchString: "",
|
|
486
|
-
hoveredIndexSearchList: null,
|
|
487
|
-
selectedTags: [],
|
|
488
|
-
firstDomain: null,
|
|
489
|
-
searchMap: {},
|
|
490
|
-
filterBy: [],
|
|
491
|
-
groupBy: []
|
|
492
|
-
};
|
|
493
|
-
var searchSlice = (0, import_toolkit10.createSlice)({
|
|
494
|
-
name: "search",
|
|
495
|
-
initialState: initialState9,
|
|
496
|
-
reducers: {
|
|
497
|
-
setGroupByDomain: (state, action) => {
|
|
498
|
-
state.groupByDomain = action.payload;
|
|
499
|
-
},
|
|
500
|
-
setSearchBy: (state, action) => {
|
|
501
|
-
state.searchBy = action.payload;
|
|
502
|
-
},
|
|
503
|
-
setSearchString: (state, action) => {
|
|
504
|
-
state.searchString = action.payload;
|
|
505
|
-
},
|
|
506
|
-
setHoveredIndexSearchList: (state, action) => {
|
|
507
|
-
state.hoveredIndexSearchList = action.payload;
|
|
508
|
-
},
|
|
509
|
-
setSelectedTags: (state, action) => {
|
|
510
|
-
state.selectedTags = action.payload;
|
|
511
|
-
},
|
|
512
|
-
setFirstDomain: (state, action) => {
|
|
513
|
-
state.firstDomain = action.payload;
|
|
514
|
-
},
|
|
515
|
-
setFilterBy: (state, action) => {
|
|
516
|
-
state.filterBy = action.payload;
|
|
517
|
-
},
|
|
518
|
-
setGroupBy: (state, action) => {
|
|
519
|
-
state.groupBy = action.payload;
|
|
520
|
-
},
|
|
521
|
-
setSearchMap: (state, action) => {
|
|
522
|
-
state.searchMap = action.payload;
|
|
523
|
-
},
|
|
524
|
-
updateSearchMap: (state, action) => {
|
|
525
|
-
if (!state.searchMap[action.payload.key]) {
|
|
526
|
-
state.searchMap[action.payload.key] = [];
|
|
527
|
-
}
|
|
528
|
-
state.searchMap[action.payload.key].push(action.payload.value);
|
|
529
|
-
},
|
|
530
|
-
removeKeyFromSearchMap: (state, action) => {
|
|
531
|
-
const { key, item } = action.payload;
|
|
532
|
-
const values = state.searchMap[key];
|
|
533
|
-
if (!values) return;
|
|
534
|
-
if (item) {
|
|
535
|
-
const filtered = values.filter((value) => value.name !== item.name);
|
|
536
|
-
if (filtered.length > 0) {
|
|
537
|
-
state.searchMap[key] = filtered;
|
|
538
|
-
} else {
|
|
539
|
-
delete state.searchMap[key];
|
|
540
|
-
}
|
|
541
|
-
} else {
|
|
542
|
-
delete state.searchMap[key];
|
|
543
|
-
}
|
|
544
|
-
},
|
|
545
|
-
clearSearchMap: (state) => {
|
|
546
|
-
state.searchMap = {};
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
});
|
|
550
|
-
var {
|
|
551
|
-
setGroupByDomain,
|
|
552
|
-
setSelectedTags,
|
|
553
|
-
setSearchString,
|
|
554
|
-
setHoveredIndexSearchList,
|
|
555
|
-
setFirstDomain,
|
|
556
|
-
setSearchBy,
|
|
557
|
-
setFilterBy,
|
|
558
|
-
setSearchMap,
|
|
559
|
-
updateSearchMap,
|
|
560
|
-
removeKeyFromSearchMap,
|
|
561
|
-
setGroupBy,
|
|
562
|
-
clearSearchMap
|
|
563
|
-
} = searchSlice.actions;
|
|
564
|
-
var search_slice_default = searchSlice.reducer;
|
|
565
|
-
|
|
566
|
-
// src/store/store.ts
|
|
567
|
-
var import_toolkit11 = require("@reduxjs/toolkit");
|
|
568
|
-
|
|
569
|
-
// node_modules/redux/dist/redux.mjs
|
|
570
|
-
function formatProdErrorMessage(code) {
|
|
571
|
-
return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
|
|
572
|
-
}
|
|
573
|
-
var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
|
|
574
|
-
var ActionTypes = {
|
|
575
|
-
INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
|
|
576
|
-
REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
|
|
577
|
-
PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
|
|
578
|
-
};
|
|
579
|
-
var actionTypes_default = ActionTypes;
|
|
580
|
-
function isPlainObject(obj) {
|
|
581
|
-
if (typeof obj !== "object" || obj === null)
|
|
582
|
-
return false;
|
|
583
|
-
let proto = obj;
|
|
584
|
-
while (Object.getPrototypeOf(proto) !== null) {
|
|
585
|
-
proto = Object.getPrototypeOf(proto);
|
|
586
|
-
}
|
|
587
|
-
return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
|
|
588
|
-
}
|
|
589
|
-
function miniKindOf(val) {
|
|
590
|
-
if (val === void 0)
|
|
591
|
-
return "undefined";
|
|
592
|
-
if (val === null)
|
|
593
|
-
return "null";
|
|
594
|
-
const type = typeof val;
|
|
595
|
-
switch (type) {
|
|
596
|
-
case "boolean":
|
|
597
|
-
case "string":
|
|
598
|
-
case "number":
|
|
599
|
-
case "symbol":
|
|
600
|
-
case "function": {
|
|
601
|
-
return type;
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
if (Array.isArray(val))
|
|
605
|
-
return "array";
|
|
606
|
-
if (isDate(val))
|
|
607
|
-
return "date";
|
|
608
|
-
if (isError(val))
|
|
609
|
-
return "error";
|
|
610
|
-
const constructorName = ctorName(val);
|
|
611
|
-
switch (constructorName) {
|
|
612
|
-
case "Symbol":
|
|
613
|
-
case "Promise":
|
|
614
|
-
case "WeakMap":
|
|
615
|
-
case "WeakSet":
|
|
616
|
-
case "Map":
|
|
617
|
-
case "Set":
|
|
618
|
-
return constructorName;
|
|
619
|
-
}
|
|
620
|
-
return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, "");
|
|
621
|
-
}
|
|
622
|
-
function ctorName(val) {
|
|
623
|
-
return typeof val.constructor === "function" ? val.constructor.name : null;
|
|
624
|
-
}
|
|
625
|
-
function isError(val) {
|
|
626
|
-
return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
|
|
627
|
-
}
|
|
628
|
-
function isDate(val) {
|
|
629
|
-
if (val instanceof Date)
|
|
630
|
-
return true;
|
|
631
|
-
return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
|
|
632
|
-
}
|
|
633
|
-
function kindOf(val) {
|
|
634
|
-
let typeOfVal = typeof val;
|
|
635
|
-
if (process.env.NODE_ENV !== "production") {
|
|
636
|
-
typeOfVal = miniKindOf(val);
|
|
637
|
-
}
|
|
638
|
-
return typeOfVal;
|
|
639
|
-
}
|
|
640
|
-
function warning(message) {
|
|
641
|
-
if (typeof console !== "undefined" && typeof console.error === "function") {
|
|
642
|
-
console.error(message);
|
|
643
|
-
}
|
|
644
|
-
try {
|
|
645
|
-
throw new Error(message);
|
|
646
|
-
} catch (e) {
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
|
650
|
-
const reducerKeys = Object.keys(reducers);
|
|
651
|
-
const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
|
|
652
|
-
if (reducerKeys.length === 0) {
|
|
653
|
-
return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
|
|
654
|
-
}
|
|
655
|
-
if (!isPlainObject(inputState)) {
|
|
656
|
-
return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`;
|
|
657
|
-
}
|
|
658
|
-
const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);
|
|
659
|
-
unexpectedKeys.forEach((key) => {
|
|
660
|
-
unexpectedKeyCache[key] = true;
|
|
661
|
-
});
|
|
662
|
-
if (action && action.type === actionTypes_default.REPLACE)
|
|
663
|
-
return;
|
|
664
|
-
if (unexpectedKeys.length > 0) {
|
|
665
|
-
return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`;
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
function assertReducerShape(reducers) {
|
|
669
|
-
Object.keys(reducers).forEach((key) => {
|
|
670
|
-
const reducer = reducers[key];
|
|
671
|
-
const initialState10 = reducer(void 0, {
|
|
672
|
-
type: actionTypes_default.INIT
|
|
673
|
-
});
|
|
674
|
-
if (typeof initialState10 === "undefined") {
|
|
675
|
-
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : `The slice reducer for key "${key}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
|
|
676
|
-
}
|
|
677
|
-
if (typeof reducer(void 0, {
|
|
678
|
-
type: actionTypes_default.PROBE_UNKNOWN_ACTION()
|
|
679
|
-
}) === "undefined") {
|
|
680
|
-
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : `The slice reducer for key "${key}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);
|
|
681
|
-
}
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
function combineReducers(reducers) {
|
|
685
|
-
const reducerKeys = Object.keys(reducers);
|
|
686
|
-
const finalReducers = {};
|
|
687
|
-
for (let i = 0; i < reducerKeys.length; i++) {
|
|
688
|
-
const key = reducerKeys[i];
|
|
689
|
-
if (process.env.NODE_ENV !== "production") {
|
|
690
|
-
if (typeof reducers[key] === "undefined") {
|
|
691
|
-
warning(`No reducer provided for key "${key}"`);
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
if (typeof reducers[key] === "function") {
|
|
695
|
-
finalReducers[key] = reducers[key];
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
const finalReducerKeys = Object.keys(finalReducers);
|
|
699
|
-
let unexpectedKeyCache;
|
|
700
|
-
if (process.env.NODE_ENV !== "production") {
|
|
701
|
-
unexpectedKeyCache = {};
|
|
702
|
-
}
|
|
703
|
-
let shapeAssertionError;
|
|
704
|
-
try {
|
|
705
|
-
assertReducerShape(finalReducers);
|
|
706
|
-
} catch (e) {
|
|
707
|
-
shapeAssertionError = e;
|
|
708
|
-
}
|
|
709
|
-
return function combination(state = {}, action) {
|
|
710
|
-
if (shapeAssertionError) {
|
|
711
|
-
throw shapeAssertionError;
|
|
712
|
-
}
|
|
713
|
-
if (process.env.NODE_ENV !== "production") {
|
|
714
|
-
const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
|
715
|
-
if (warningMessage) {
|
|
716
|
-
warning(warningMessage);
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
let hasChanged = false;
|
|
720
|
-
const nextState = {};
|
|
721
|
-
for (let i = 0; i < finalReducerKeys.length; i++) {
|
|
722
|
-
const key = finalReducerKeys[i];
|
|
723
|
-
const reducer = finalReducers[key];
|
|
724
|
-
const previousStateForKey = state[key];
|
|
725
|
-
const nextStateForKey = reducer(previousStateForKey, action);
|
|
726
|
-
if (typeof nextStateForKey === "undefined") {
|
|
727
|
-
const actionType = action && action.type;
|
|
728
|
-
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `"${String(actionType)}"` : "(unknown type)"}, the slice reducer for key "${key}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);
|
|
729
|
-
}
|
|
730
|
-
nextState[key] = nextStateForKey;
|
|
731
|
-
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
|
732
|
-
}
|
|
733
|
-
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
|
|
734
|
-
return hasChanged ? nextState : state;
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
// src/store/store.ts
|
|
739
|
-
var rootReducer = combineReducers({
|
|
740
|
-
env: env_slice_default,
|
|
741
|
-
header: header_slice_default,
|
|
742
|
-
navbar: navbar_slice_default,
|
|
743
|
-
list: list_slice_default,
|
|
744
|
-
search: search_slice_default,
|
|
745
|
-
form: form_slice_default,
|
|
746
|
-
breadcrumbs: breadcrums_slice_default,
|
|
747
|
-
login: login_slice_default,
|
|
748
|
-
excel: excel_slice_default,
|
|
749
|
-
profile: profile_slice_default
|
|
750
|
-
});
|
|
751
|
-
var envStore = (0, import_toolkit11.configureStore)({
|
|
752
|
-
reducer: rootReducer,
|
|
753
|
-
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
754
|
-
serializableCheck: false
|
|
755
|
-
})
|
|
756
|
-
});
|
|
757
|
-
|
|
758
|
-
// src/configs/axios-client.ts
|
|
759
|
-
var import_axios = __toESM(require("axios"));
|
|
760
|
-
|
|
761
|
-
// src/utils/format.ts
|
|
762
|
-
var import_moment = __toESM(require("moment"));
|
|
763
|
-
|
|
764
|
-
// src/constants/widget/widget-avatar-constant.ts
|
|
765
|
-
var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
|
|
766
|
-
WIDGETAVATAR2["many2one_avatar_user"] = "many2one_avatar_user";
|
|
767
|
-
WIDGETAVATAR2["many2many_avatar_user"] = "many2many_avatar_user";
|
|
768
|
-
return WIDGETAVATAR2;
|
|
769
|
-
})(WIDGETAVATAR || {});
|
|
770
|
-
|
|
771
|
-
// src/utils/domain/py_tokenizer.ts
|
|
772
|
-
var TokenizerError = class extends Error {
|
|
773
|
-
};
|
|
774
|
-
var directMap = {
|
|
775
|
-
"\\": "\\",
|
|
776
|
-
'"': '"',
|
|
777
|
-
"'": "'",
|
|
778
|
-
a: "\x07",
|
|
779
|
-
b: "\b",
|
|
780
|
-
f: "\f",
|
|
781
|
-
n: "\n",
|
|
782
|
-
r: "\r",
|
|
783
|
-
t: " ",
|
|
784
|
-
v: "\v"
|
|
785
|
-
};
|
|
786
|
-
function decodeStringLiteral(str, unicode) {
|
|
787
|
-
const out = [];
|
|
788
|
-
let code;
|
|
789
|
-
for (let i = 0; i < str.length; ++i) {
|
|
790
|
-
if (str[i] !== "\\") {
|
|
791
|
-
out.push(str[i]);
|
|
792
|
-
continue;
|
|
793
|
-
}
|
|
794
|
-
const escape = str[i + 1];
|
|
795
|
-
if (escape in directMap) {
|
|
796
|
-
out.push(directMap[escape]);
|
|
797
|
-
++i;
|
|
798
|
-
continue;
|
|
173
|
+
const escape = str[i + 1];
|
|
174
|
+
if (escape in directMap) {
|
|
175
|
+
out.push(directMap[escape]);
|
|
176
|
+
++i;
|
|
177
|
+
continue;
|
|
799
178
|
}
|
|
800
179
|
switch (escape) {
|
|
801
180
|
case "\n":
|
|
@@ -1704,1211 +1083,2121 @@ var PyTime = class _PyTime extends PyDate {
|
|
|
1704
1083
|
}
|
|
1705
1084
|
});
|
|
1706
1085
|
}
|
|
1707
|
-
toJSON() {
|
|
1708
|
-
return this.strftime("%H:%M:%S");
|
|
1086
|
+
toJSON() {
|
|
1087
|
+
return this.strftime("%H:%M:%S");
|
|
1088
|
+
}
|
|
1089
|
+
};
|
|
1090
|
+
var DAYS_IN_YEAR = [
|
|
1091
|
+
31,
|
|
1092
|
+
59,
|
|
1093
|
+
90,
|
|
1094
|
+
120,
|
|
1095
|
+
151,
|
|
1096
|
+
181,
|
|
1097
|
+
212,
|
|
1098
|
+
243,
|
|
1099
|
+
273,
|
|
1100
|
+
304,
|
|
1101
|
+
334,
|
|
1102
|
+
366
|
|
1103
|
+
];
|
|
1104
|
+
var TIME_PERIODS = ["hour", "minute", "second"];
|
|
1105
|
+
var PERIODS = ["year", "month", "day", ...TIME_PERIODS];
|
|
1106
|
+
var RELATIVE_KEYS = "years months weeks days hours minutes seconds microseconds leapdays".split(
|
|
1107
|
+
" "
|
|
1108
|
+
);
|
|
1109
|
+
var ABSOLUTE_KEYS = "year month day hour minute second microsecond weekday nlyearday yearday".split(
|
|
1110
|
+
" "
|
|
1111
|
+
);
|
|
1112
|
+
var argsSpec = ["dt1", "dt2"];
|
|
1113
|
+
var PyRelativeDelta = class _PyRelativeDelta {
|
|
1114
|
+
static create(...args) {
|
|
1115
|
+
const params = parseArgs(args, argsSpec);
|
|
1116
|
+
if ("dt1" in params) {
|
|
1117
|
+
throw new Error("relativedelta(dt1, dt2) is not supported for now");
|
|
1118
|
+
}
|
|
1119
|
+
for (const period of PERIODS) {
|
|
1120
|
+
if (period in params) {
|
|
1121
|
+
const val = params[period];
|
|
1122
|
+
assert(val >= 0, `${period} ${val} is out of range`);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
for (const key of RELATIVE_KEYS) {
|
|
1126
|
+
params[key] = params[key] || 0;
|
|
1127
|
+
}
|
|
1128
|
+
for (const key of ABSOLUTE_KEYS) {
|
|
1129
|
+
params[key] = key in params ? params[key] : null;
|
|
1130
|
+
}
|
|
1131
|
+
params.days += 7 * params.weeks;
|
|
1132
|
+
let yearDay = 0;
|
|
1133
|
+
if (params.nlyearday) {
|
|
1134
|
+
yearDay = params.nlyearday;
|
|
1135
|
+
} else if (params.yearday) {
|
|
1136
|
+
yearDay = params.yearday;
|
|
1137
|
+
if (yearDay > 59) {
|
|
1138
|
+
params.leapDays = -1;
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
if (yearDay) {
|
|
1142
|
+
for (let monthIndex = 0; monthIndex < DAYS_IN_YEAR.length; monthIndex++) {
|
|
1143
|
+
if (yearDay <= DAYS_IN_YEAR[monthIndex]) {
|
|
1144
|
+
params.month = monthIndex + 1;
|
|
1145
|
+
if (monthIndex === 0) {
|
|
1146
|
+
params.day = yearDay;
|
|
1147
|
+
} else {
|
|
1148
|
+
params.day = yearDay - DAYS_IN_YEAR[monthIndex - 1];
|
|
1149
|
+
}
|
|
1150
|
+
break;
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
return new _PyRelativeDelta(params);
|
|
1155
|
+
}
|
|
1156
|
+
static add(date, delta) {
|
|
1157
|
+
if (!(date instanceof PyDate || date instanceof PyDateTime)) {
|
|
1158
|
+
throw new NotSupportedError();
|
|
1159
|
+
}
|
|
1160
|
+
const s = tmxxx(
|
|
1161
|
+
(delta.year || date.year) + delta.years,
|
|
1162
|
+
(delta.month || date.month) + delta.months,
|
|
1163
|
+
delta.day || date.day,
|
|
1164
|
+
delta.hour || (date instanceof PyDateTime ? date.hour : 0),
|
|
1165
|
+
delta.minute || (date instanceof PyDateTime ? date.minute : 0),
|
|
1166
|
+
delta.second || (date instanceof PyDateTime ? date.second : 0),
|
|
1167
|
+
delta.microseconds || (date instanceof PyDateTime ? date.microsecond : 0)
|
|
1168
|
+
);
|
|
1169
|
+
const newDateTime = new PyDateTime(
|
|
1170
|
+
s.year,
|
|
1171
|
+
s.month,
|
|
1172
|
+
s.day,
|
|
1173
|
+
s.hour,
|
|
1174
|
+
s.minute,
|
|
1175
|
+
s.second,
|
|
1176
|
+
s.microsecond
|
|
1177
|
+
);
|
|
1178
|
+
let leapDays = 0;
|
|
1179
|
+
if (delta.leapDays && newDateTime.month > 2 && isLeap(newDateTime.year)) {
|
|
1180
|
+
leapDays = delta.leapDays;
|
|
1181
|
+
}
|
|
1182
|
+
const temp = newDateTime.add(
|
|
1183
|
+
PyTimeDelta.create({
|
|
1184
|
+
days: delta.days + leapDays,
|
|
1185
|
+
hours: delta.hours,
|
|
1186
|
+
minutes: delta.minutes,
|
|
1187
|
+
seconds: delta.seconds,
|
|
1188
|
+
microseconds: delta.microseconds
|
|
1189
|
+
})
|
|
1190
|
+
);
|
|
1191
|
+
const hasTime = Boolean(
|
|
1192
|
+
temp.hour || temp.minute || temp.second || temp.microsecond
|
|
1193
|
+
);
|
|
1194
|
+
const returnDate = !hasTime && date instanceof PyDate ? new PyDate(temp.year, temp.month, temp.day) : temp;
|
|
1195
|
+
if (delta.weekday !== null) {
|
|
1196
|
+
const wantedDow = delta.weekday + 1;
|
|
1197
|
+
const _date = new Date(
|
|
1198
|
+
returnDate.year,
|
|
1199
|
+
returnDate.month - 1,
|
|
1200
|
+
returnDate.day
|
|
1201
|
+
);
|
|
1202
|
+
const days = (7 - _date.getDay() + wantedDow) % 7;
|
|
1203
|
+
return returnDate.add(new PyTimeDelta(days, 0, 0));
|
|
1204
|
+
}
|
|
1205
|
+
return returnDate;
|
|
1206
|
+
}
|
|
1207
|
+
static substract(date, delta) {
|
|
1208
|
+
return _PyRelativeDelta.add(date, delta.negate());
|
|
1209
|
+
}
|
|
1210
|
+
constructor(params = {}, sign = 1) {
|
|
1211
|
+
this.years = sign * params.years;
|
|
1212
|
+
this.months = sign * params.months;
|
|
1213
|
+
this.days = sign * params.days;
|
|
1214
|
+
this.hours = sign * params.hours;
|
|
1215
|
+
this.minutes = sign * params.minutes;
|
|
1216
|
+
this.seconds = sign * params.seconds;
|
|
1217
|
+
this.microseconds = sign * params.microseconds;
|
|
1218
|
+
this.leapDays = params.leapDays;
|
|
1219
|
+
this.year = params.year;
|
|
1220
|
+
this.month = params.month;
|
|
1221
|
+
this.day = params.day;
|
|
1222
|
+
this.hour = params.hour;
|
|
1223
|
+
this.minute = params.minute;
|
|
1224
|
+
this.second = params.second;
|
|
1225
|
+
this.microsecond = params.microsecond;
|
|
1226
|
+
this.weekday = params.weekday;
|
|
1227
|
+
}
|
|
1228
|
+
years;
|
|
1229
|
+
months;
|
|
1230
|
+
days;
|
|
1231
|
+
hours;
|
|
1232
|
+
minutes;
|
|
1233
|
+
seconds;
|
|
1234
|
+
microseconds;
|
|
1235
|
+
leapDays;
|
|
1236
|
+
year;
|
|
1237
|
+
month;
|
|
1238
|
+
day;
|
|
1239
|
+
hour;
|
|
1240
|
+
minute;
|
|
1241
|
+
second;
|
|
1242
|
+
microsecond;
|
|
1243
|
+
weekday;
|
|
1244
|
+
negate() {
|
|
1245
|
+
return new _PyRelativeDelta(this, -1);
|
|
1246
|
+
}
|
|
1247
|
+
isEqual() {
|
|
1248
|
+
throw new NotSupportedError();
|
|
1249
|
+
}
|
|
1250
|
+
};
|
|
1251
|
+
var TIME_DELTA_KEYS = "weeks days hours minutes seconds milliseconds microseconds".split(" ");
|
|
1252
|
+
function modf(x) {
|
|
1253
|
+
const mod = x % 1;
|
|
1254
|
+
return [mod < 0 ? mod + 1 : mod, Math.floor(x)];
|
|
1255
|
+
}
|
|
1256
|
+
var PyTimeDelta = class _PyTimeDelta {
|
|
1257
|
+
constructor(days, seconds, microseconds) {
|
|
1258
|
+
this.days = days;
|
|
1259
|
+
this.seconds = seconds;
|
|
1260
|
+
this.microseconds = microseconds;
|
|
1261
|
+
}
|
|
1262
|
+
static create(...args) {
|
|
1263
|
+
const namedArgs = parseArgs(args, ["days", "seconds", "microseconds"]);
|
|
1264
|
+
for (const key of TIME_DELTA_KEYS) {
|
|
1265
|
+
namedArgs[key] = namedArgs[key] || 0;
|
|
1266
|
+
}
|
|
1267
|
+
let d = 0;
|
|
1268
|
+
let s = 0;
|
|
1269
|
+
let us = 0;
|
|
1270
|
+
const days = namedArgs.days + namedArgs.weeks * 7;
|
|
1271
|
+
let seconds = namedArgs.seconds + 60 * namedArgs.minutes + 3600 * namedArgs.hours;
|
|
1272
|
+
let microseconds = namedArgs.microseconds + 1e3 * namedArgs.milliseconds;
|
|
1273
|
+
const [dFrac, dInt] = modf(days);
|
|
1274
|
+
d = dInt;
|
|
1275
|
+
let daysecondsfrac = 0;
|
|
1276
|
+
if (dFrac) {
|
|
1277
|
+
const [dsFrac, dsInt] = modf(dFrac * 24 * 3600);
|
|
1278
|
+
s = dsInt;
|
|
1279
|
+
daysecondsfrac = dsFrac;
|
|
1280
|
+
}
|
|
1281
|
+
const [sFrac, sInt] = modf(seconds);
|
|
1282
|
+
seconds = sInt;
|
|
1283
|
+
const secondsfrac = sFrac + daysecondsfrac;
|
|
1284
|
+
divmod(seconds, 24 * 3600, (days2, seconds2) => {
|
|
1285
|
+
d += days2;
|
|
1286
|
+
s += seconds2;
|
|
1287
|
+
});
|
|
1288
|
+
microseconds += secondsfrac * 1e6;
|
|
1289
|
+
divmod(microseconds, 1e6, (seconds2, microseconds2) => {
|
|
1290
|
+
divmod(seconds2, 24 * 3600, (days2, seconds3) => {
|
|
1291
|
+
d += days2;
|
|
1292
|
+
s += seconds3;
|
|
1293
|
+
us += Math.round(microseconds2);
|
|
1294
|
+
});
|
|
1295
|
+
});
|
|
1296
|
+
return new _PyTimeDelta(d, s, us);
|
|
1297
|
+
}
|
|
1298
|
+
add(other) {
|
|
1299
|
+
return _PyTimeDelta.create({
|
|
1300
|
+
days: this.days + other.days,
|
|
1301
|
+
seconds: this.seconds + other.seconds,
|
|
1302
|
+
microseconds: this.microseconds + other.microseconds
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1305
|
+
divide(n) {
|
|
1306
|
+
const us = (this.days * 24 * 3600 + this.seconds) * 1e6 + this.microseconds;
|
|
1307
|
+
return _PyTimeDelta.create({ microseconds: Math.floor(us / n) });
|
|
1308
|
+
}
|
|
1309
|
+
isEqual(other) {
|
|
1310
|
+
if (!(other instanceof _PyTimeDelta)) {
|
|
1311
|
+
return false;
|
|
1312
|
+
}
|
|
1313
|
+
return this.days === other.days && this.seconds === other.seconds && this.microseconds === other.microseconds;
|
|
1314
|
+
}
|
|
1315
|
+
isTrue() {
|
|
1316
|
+
return this.days !== 0 || this.seconds !== 0 || this.microseconds !== 0;
|
|
1317
|
+
}
|
|
1318
|
+
multiply(n) {
|
|
1319
|
+
return _PyTimeDelta.create({
|
|
1320
|
+
days: n * this.days,
|
|
1321
|
+
seconds: n * this.seconds,
|
|
1322
|
+
microseconds: n * this.microseconds
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
negate() {
|
|
1326
|
+
return _PyTimeDelta.create({
|
|
1327
|
+
days: -this.days,
|
|
1328
|
+
seconds: -this.seconds,
|
|
1329
|
+
microseconds: -this.microseconds
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
substract(other) {
|
|
1333
|
+
return _PyTimeDelta.create({
|
|
1334
|
+
days: this.days - other.days,
|
|
1335
|
+
seconds: this.seconds - other.seconds,
|
|
1336
|
+
microseconds: this.microseconds - other.microseconds
|
|
1337
|
+
});
|
|
1338
|
+
}
|
|
1339
|
+
total_seconds() {
|
|
1340
|
+
return this.days * 86400 + this.seconds + this.microseconds / 1e6;
|
|
1709
1341
|
}
|
|
1710
1342
|
};
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
);
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1343
|
+
|
|
1344
|
+
// src/utils/domain/py_builtin.ts
|
|
1345
|
+
var EvaluationError = class extends Error {
|
|
1346
|
+
constructor(message) {
|
|
1347
|
+
super(message);
|
|
1348
|
+
this.name = "EvaluationError";
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
function execOnIterable(iterable, func) {
|
|
1352
|
+
if (iterable === null) {
|
|
1353
|
+
throw new EvaluationError("value not iterable");
|
|
1354
|
+
}
|
|
1355
|
+
if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
|
|
1356
|
+
iterable = Object.keys(iterable);
|
|
1357
|
+
}
|
|
1358
|
+
if (typeof iterable?.[Symbol.iterator] !== "function") {
|
|
1359
|
+
throw new EvaluationError("value not iterable");
|
|
1360
|
+
}
|
|
1361
|
+
return func(iterable);
|
|
1362
|
+
}
|
|
1363
|
+
var BUILTINS = {
|
|
1364
|
+
/**
|
|
1365
|
+
* @param {any} value
|
|
1366
|
+
* @returns {boolean}
|
|
1367
|
+
*/
|
|
1368
|
+
bool(value) {
|
|
1369
|
+
switch (typeof value) {
|
|
1370
|
+
case "number":
|
|
1371
|
+
return value !== 0;
|
|
1372
|
+
case "string":
|
|
1373
|
+
return value !== "";
|
|
1374
|
+
case "boolean":
|
|
1375
|
+
return value;
|
|
1376
|
+
case "object":
|
|
1377
|
+
if (value === null || value === void 0) {
|
|
1378
|
+
return false;
|
|
1379
|
+
}
|
|
1380
|
+
if ("isTrue" in value && typeof value.isTrue === "function") {
|
|
1381
|
+
return value.isTrue();
|
|
1382
|
+
}
|
|
1383
|
+
if (value instanceof Array) {
|
|
1384
|
+
return !!value.length;
|
|
1385
|
+
}
|
|
1386
|
+
if (value instanceof Set) {
|
|
1387
|
+
return !!value.size;
|
|
1388
|
+
}
|
|
1389
|
+
return Object.keys(value).length !== 0;
|
|
1390
|
+
default:
|
|
1391
|
+
return true;
|
|
1748
1392
|
}
|
|
1749
|
-
|
|
1750
|
-
|
|
1393
|
+
},
|
|
1394
|
+
set(iterable) {
|
|
1395
|
+
if (arguments.length > 2) {
|
|
1396
|
+
throw new EvaluationError(
|
|
1397
|
+
`set expected at most 1 argument, got (${arguments.length - 1})`
|
|
1398
|
+
);
|
|
1751
1399
|
}
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
}
|
|
1400
|
+
return execOnIterable(
|
|
1401
|
+
iterable,
|
|
1402
|
+
(iterable2) => new Set(iterable2)
|
|
1403
|
+
);
|
|
1404
|
+
},
|
|
1405
|
+
time: {
|
|
1406
|
+
strftime(format) {
|
|
1407
|
+
return PyDateTime.now().strftime(format);
|
|
1761
1408
|
}
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1409
|
+
},
|
|
1410
|
+
context_today() {
|
|
1411
|
+
return PyDate.today();
|
|
1412
|
+
},
|
|
1413
|
+
get current_date() {
|
|
1414
|
+
return this.today;
|
|
1415
|
+
},
|
|
1416
|
+
get today() {
|
|
1417
|
+
return PyDate.today().strftime("%Y-%m-%d");
|
|
1418
|
+
},
|
|
1419
|
+
get now() {
|
|
1420
|
+
return PyDateTime.now().strftime("%Y-%m-%d %H:%M:%S");
|
|
1421
|
+
},
|
|
1422
|
+
datetime: {
|
|
1423
|
+
time: PyTime,
|
|
1424
|
+
timedelta: PyTimeDelta,
|
|
1425
|
+
datetime: PyDateTime,
|
|
1426
|
+
date: PyDate
|
|
1427
|
+
},
|
|
1428
|
+
relativedelta: PyRelativeDelta,
|
|
1429
|
+
true: true,
|
|
1430
|
+
false: false
|
|
1431
|
+
};
|
|
1432
|
+
|
|
1433
|
+
// src/utils/domain/py_utils.ts
|
|
1434
|
+
function toPyValue(value) {
|
|
1435
|
+
switch (typeof value) {
|
|
1436
|
+
case "string":
|
|
1437
|
+
return { type: 1, value };
|
|
1438
|
+
case "number":
|
|
1439
|
+
return { type: 0, value };
|
|
1440
|
+
case "boolean":
|
|
1441
|
+
return { type: 2, value };
|
|
1442
|
+
case "object":
|
|
1443
|
+
if (Array.isArray(value)) {
|
|
1444
|
+
return { type: 4, value: value.map(toPyValue) };
|
|
1445
|
+
} else if (value === null) {
|
|
1446
|
+
return {
|
|
1447
|
+
type: 3
|
|
1448
|
+
/* None */
|
|
1449
|
+
};
|
|
1450
|
+
} else if (value instanceof Date) {
|
|
1451
|
+
return {
|
|
1452
|
+
type: 1,
|
|
1453
|
+
value: String(PyDateTime.convertDate(value))
|
|
1454
|
+
};
|
|
1455
|
+
} else if (value instanceof PyDate || value instanceof PyDateTime) {
|
|
1456
|
+
return { type: 1, value };
|
|
1457
|
+
} else {
|
|
1458
|
+
const content = {};
|
|
1459
|
+
for (const key in value) {
|
|
1460
|
+
content[key] = toPyValue(value[key]);
|
|
1772
1461
|
}
|
|
1462
|
+
return { type: 11, value: content };
|
|
1463
|
+
}
|
|
1464
|
+
default:
|
|
1465
|
+
throw new Error("Invalid type");
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
function formatAST(ast, lbp = 0) {
|
|
1469
|
+
switch (ast.type) {
|
|
1470
|
+
case 3:
|
|
1471
|
+
return "None";
|
|
1472
|
+
case 1:
|
|
1473
|
+
return JSON.stringify(ast.value);
|
|
1474
|
+
case 0:
|
|
1475
|
+
return String(ast.value);
|
|
1476
|
+
case 2:
|
|
1477
|
+
return ast.value ? "True" : "False";
|
|
1478
|
+
case 4:
|
|
1479
|
+
return `[${ast.value.map(formatAST).join(", ")}]`;
|
|
1480
|
+
case 6:
|
|
1481
|
+
if (ast.op === "not") {
|
|
1482
|
+
return `not ${formatAST(ast.right, 50)}`;
|
|
1483
|
+
}
|
|
1484
|
+
return `${ast.op}${formatAST(ast.right, 130)}`;
|
|
1485
|
+
case 7:
|
|
1486
|
+
const abp = bp(ast.op);
|
|
1487
|
+
const binaryStr = `${formatAST(ast.left, abp)} ${ast.op} ${formatAST(ast.right, abp)}`;
|
|
1488
|
+
return abp < lbp ? `(${binaryStr})` : binaryStr;
|
|
1489
|
+
case 11:
|
|
1490
|
+
const pairs = [];
|
|
1491
|
+
for (const k in ast.value) {
|
|
1492
|
+
pairs.push(`"${k}": ${formatAST(ast.value[k])}`);
|
|
1493
|
+
}
|
|
1494
|
+
return `{${pairs.join(", ")}}`;
|
|
1495
|
+
case 10:
|
|
1496
|
+
return `(${ast.value.map(formatAST).join(", ")})`;
|
|
1497
|
+
case 5:
|
|
1498
|
+
return ast.value;
|
|
1499
|
+
case 12:
|
|
1500
|
+
return `${formatAST(ast.target)}[${formatAST(ast.key)}]`;
|
|
1501
|
+
case 13:
|
|
1502
|
+
const { ifTrue, condition, ifFalse } = ast;
|
|
1503
|
+
return `${formatAST(ifTrue)} if ${formatAST(condition)} else ${formatAST(ifFalse)}`;
|
|
1504
|
+
case 14:
|
|
1505
|
+
const boolAbp = bp(ast.op);
|
|
1506
|
+
const boolStr = `${formatAST(ast.left, boolAbp)} ${ast.op} ${formatAST(ast.right, boolAbp)}`;
|
|
1507
|
+
return boolAbp < lbp ? `(${boolStr})` : boolStr;
|
|
1508
|
+
case 15:
|
|
1509
|
+
return `${formatAST(ast.obj, 150)}.${ast.key}`;
|
|
1510
|
+
case 8:
|
|
1511
|
+
const args = ast.args.map(formatAST);
|
|
1512
|
+
const kwargs = [];
|
|
1513
|
+
for (const kwarg in ast.kwargs) {
|
|
1514
|
+
kwargs.push(`${kwarg} = ${formatAST(ast.kwargs[kwarg])}`);
|
|
1773
1515
|
}
|
|
1516
|
+
const argStr = args.concat(kwargs).join(", ");
|
|
1517
|
+
return `${formatAST(ast.fn)}(${argStr})`;
|
|
1518
|
+
default:
|
|
1519
|
+
throw new Error("invalid expression: " + JSON.stringify(ast));
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
var PY_DICT = /* @__PURE__ */ Object.create(null);
|
|
1523
|
+
function toPyDict(obj) {
|
|
1524
|
+
return new Proxy(obj, {
|
|
1525
|
+
getPrototypeOf() {
|
|
1526
|
+
return PY_DICT;
|
|
1774
1527
|
}
|
|
1775
|
-
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
// src/utils/domain/py_interpreter.ts
|
|
1532
|
+
var isTrue = BUILTINS.bool;
|
|
1533
|
+
function applyUnaryOp(ast, context) {
|
|
1534
|
+
const value = evaluate(ast.right, context);
|
|
1535
|
+
switch (ast.op) {
|
|
1536
|
+
case "-":
|
|
1537
|
+
if (value instanceof Object && "negate" in value) {
|
|
1538
|
+
return value.negate();
|
|
1539
|
+
}
|
|
1540
|
+
return -value;
|
|
1541
|
+
case "+":
|
|
1542
|
+
return value;
|
|
1543
|
+
case "not":
|
|
1544
|
+
return !isTrue(value);
|
|
1545
|
+
default:
|
|
1546
|
+
throw new EvaluationError(`Unknown unary operator: ${ast.op}`);
|
|
1776
1547
|
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1548
|
+
}
|
|
1549
|
+
function pytypeIndex(val) {
|
|
1550
|
+
switch (typeof val) {
|
|
1551
|
+
case "object":
|
|
1552
|
+
return val === null ? 1 : Array.isArray(val) ? 5 : 3;
|
|
1553
|
+
case "number":
|
|
1554
|
+
return 2;
|
|
1555
|
+
case "string":
|
|
1556
|
+
return 4;
|
|
1557
|
+
default:
|
|
1558
|
+
throw new EvaluationError(`Unknown type: ${typeof val}`);
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
function isLess(left, right) {
|
|
1562
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
1563
|
+
return left < right;
|
|
1564
|
+
}
|
|
1565
|
+
if (typeof left === "boolean") {
|
|
1566
|
+
left = left ? 1 : 0;
|
|
1567
|
+
}
|
|
1568
|
+
if (typeof right === "boolean") {
|
|
1569
|
+
right = right ? 1 : 0;
|
|
1570
|
+
}
|
|
1571
|
+
const leftIndex = pytypeIndex(left);
|
|
1572
|
+
const rightIndex = pytypeIndex(right);
|
|
1573
|
+
if (leftIndex === rightIndex) {
|
|
1574
|
+
return left < right;
|
|
1575
|
+
}
|
|
1576
|
+
return leftIndex < rightIndex;
|
|
1577
|
+
}
|
|
1578
|
+
function isEqual(left, right) {
|
|
1579
|
+
if (typeof left !== typeof right) {
|
|
1580
|
+
if (typeof left === "boolean" && typeof right === "number") {
|
|
1581
|
+
return right === (left ? 1 : 0);
|
|
1802
1582
|
}
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
days: delta.days + leapDays,
|
|
1806
|
-
hours: delta.hours,
|
|
1807
|
-
minutes: delta.minutes,
|
|
1808
|
-
seconds: delta.seconds,
|
|
1809
|
-
microseconds: delta.microseconds
|
|
1810
|
-
})
|
|
1811
|
-
);
|
|
1812
|
-
const hasTime = Boolean(
|
|
1813
|
-
temp.hour || temp.minute || temp.second || temp.microsecond
|
|
1814
|
-
);
|
|
1815
|
-
const returnDate = !hasTime && date instanceof PyDate ? new PyDate(temp.year, temp.month, temp.day) : temp;
|
|
1816
|
-
if (delta.weekday !== null) {
|
|
1817
|
-
const wantedDow = delta.weekday + 1;
|
|
1818
|
-
const _date = new Date(
|
|
1819
|
-
returnDate.year,
|
|
1820
|
-
returnDate.month - 1,
|
|
1821
|
-
returnDate.day
|
|
1822
|
-
);
|
|
1823
|
-
const days = (7 - _date.getDay() + wantedDow) % 7;
|
|
1824
|
-
return returnDate.add(new PyTimeDelta(days, 0, 0));
|
|
1583
|
+
if (typeof left === "number" && typeof right === "boolean") {
|
|
1584
|
+
return left === (right ? 1 : 0);
|
|
1825
1585
|
}
|
|
1826
|
-
return
|
|
1586
|
+
return false;
|
|
1827
1587
|
}
|
|
1828
|
-
|
|
1829
|
-
return
|
|
1588
|
+
if (left instanceof Object && "isEqual" in left) {
|
|
1589
|
+
return left.isEqual(right);
|
|
1830
1590
|
}
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
this.minutes = sign * params.minutes;
|
|
1837
|
-
this.seconds = sign * params.seconds;
|
|
1838
|
-
this.microseconds = sign * params.microseconds;
|
|
1839
|
-
this.leapDays = params.leapDays;
|
|
1840
|
-
this.year = params.year;
|
|
1841
|
-
this.month = params.month;
|
|
1842
|
-
this.day = params.day;
|
|
1843
|
-
this.hour = params.hour;
|
|
1844
|
-
this.minute = params.minute;
|
|
1845
|
-
this.second = params.second;
|
|
1846
|
-
this.microsecond = params.microsecond;
|
|
1847
|
-
this.weekday = params.weekday;
|
|
1591
|
+
return left === right;
|
|
1592
|
+
}
|
|
1593
|
+
function isIn(left, right) {
|
|
1594
|
+
if (Array.isArray(right)) {
|
|
1595
|
+
return right.includes(left);
|
|
1848
1596
|
}
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
days;
|
|
1852
|
-
hours;
|
|
1853
|
-
minutes;
|
|
1854
|
-
seconds;
|
|
1855
|
-
microseconds;
|
|
1856
|
-
leapDays;
|
|
1857
|
-
year;
|
|
1858
|
-
month;
|
|
1859
|
-
day;
|
|
1860
|
-
hour;
|
|
1861
|
-
minute;
|
|
1862
|
-
second;
|
|
1863
|
-
microsecond;
|
|
1864
|
-
weekday;
|
|
1865
|
-
negate() {
|
|
1866
|
-
return new _PyRelativeDelta(this, -1);
|
|
1597
|
+
if (typeof right === "string" && typeof left === "string") {
|
|
1598
|
+
return right.includes(left);
|
|
1867
1599
|
}
|
|
1868
|
-
|
|
1869
|
-
|
|
1600
|
+
if (typeof right === "object") {
|
|
1601
|
+
return left in right;
|
|
1870
1602
|
}
|
|
1871
|
-
|
|
1872
|
-
var TIME_DELTA_KEYS = "weeks days hours minutes seconds milliseconds microseconds".split(" ");
|
|
1873
|
-
function modf(x) {
|
|
1874
|
-
const mod = x % 1;
|
|
1875
|
-
return [mod < 0 ? mod + 1 : mod, Math.floor(x)];
|
|
1603
|
+
return false;
|
|
1876
1604
|
}
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1605
|
+
function applyBinaryOp(ast, context) {
|
|
1606
|
+
const left = evaluate(ast.left, context);
|
|
1607
|
+
const right = evaluate(ast.right, context);
|
|
1608
|
+
switch (ast.op) {
|
|
1609
|
+
case "+": {
|
|
1610
|
+
const relativeDeltaOnLeft = left instanceof PyRelativeDelta;
|
|
1611
|
+
const relativeDeltaOnRight = right instanceof PyRelativeDelta;
|
|
1612
|
+
if (relativeDeltaOnLeft || relativeDeltaOnRight) {
|
|
1613
|
+
const date = relativeDeltaOnLeft ? right : left;
|
|
1614
|
+
const delta = relativeDeltaOnLeft ? left : right;
|
|
1615
|
+
return PyRelativeDelta.add(date, delta);
|
|
1616
|
+
}
|
|
1617
|
+
const timeDeltaOnLeft = left instanceof PyTimeDelta;
|
|
1618
|
+
const timeDeltaOnRight = right instanceof PyTimeDelta;
|
|
1619
|
+
if (timeDeltaOnLeft && timeDeltaOnRight) {
|
|
1620
|
+
return left.add(right);
|
|
1621
|
+
}
|
|
1622
|
+
if (timeDeltaOnLeft) {
|
|
1623
|
+
if (right instanceof PyDate || right instanceof PyDateTime) {
|
|
1624
|
+
return right.add(left);
|
|
1625
|
+
} else {
|
|
1626
|
+
throw new NotSupportedError();
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
if (timeDeltaOnRight) {
|
|
1630
|
+
if (left instanceof PyDate || left instanceof PyDateTime) {
|
|
1631
|
+
return left.add(right);
|
|
1632
|
+
} else {
|
|
1633
|
+
throw new NotSupportedError();
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
if (left instanceof Array && right instanceof Array) {
|
|
1637
|
+
return [...left, ...right];
|
|
1638
|
+
}
|
|
1639
|
+
return left + right;
|
|
1640
|
+
}
|
|
1641
|
+
case "-": {
|
|
1642
|
+
const isRightDelta = right instanceof PyRelativeDelta;
|
|
1643
|
+
if (isRightDelta) {
|
|
1644
|
+
return PyRelativeDelta.substract(left, right);
|
|
1645
|
+
}
|
|
1646
|
+
const timeDeltaOnRight = right instanceof PyTimeDelta;
|
|
1647
|
+
if (timeDeltaOnRight) {
|
|
1648
|
+
if (left instanceof PyTimeDelta) {
|
|
1649
|
+
return left.substract(right);
|
|
1650
|
+
} else if (left instanceof PyDate || left instanceof PyDateTime) {
|
|
1651
|
+
return left.substract(right);
|
|
1652
|
+
} else {
|
|
1653
|
+
throw new NotSupportedError();
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
if (left instanceof PyDate) {
|
|
1657
|
+
return left.substract(right);
|
|
1658
|
+
}
|
|
1659
|
+
return left - right;
|
|
1660
|
+
}
|
|
1661
|
+
case "*": {
|
|
1662
|
+
const timeDeltaOnLeft = left instanceof PyTimeDelta;
|
|
1663
|
+
const timeDeltaOnRight = right instanceof PyTimeDelta;
|
|
1664
|
+
if (timeDeltaOnLeft || timeDeltaOnRight) {
|
|
1665
|
+
const number = timeDeltaOnLeft ? right : left;
|
|
1666
|
+
const delta = timeDeltaOnLeft ? left : right;
|
|
1667
|
+
return delta.multiply(number);
|
|
1668
|
+
}
|
|
1669
|
+
return left * right;
|
|
1670
|
+
}
|
|
1671
|
+
case "/":
|
|
1672
|
+
return left / right;
|
|
1673
|
+
case "%":
|
|
1674
|
+
return left % right;
|
|
1675
|
+
case "//":
|
|
1676
|
+
if (left instanceof PyTimeDelta) {
|
|
1677
|
+
return left.divide(right);
|
|
1678
|
+
}
|
|
1679
|
+
return Math.floor(left / right);
|
|
1680
|
+
case "**":
|
|
1681
|
+
return left ** right;
|
|
1682
|
+
case "==":
|
|
1683
|
+
return isEqual(left, right);
|
|
1684
|
+
case "<>":
|
|
1685
|
+
case "!=":
|
|
1686
|
+
return !isEqual(left, right);
|
|
1687
|
+
case "<":
|
|
1688
|
+
return isLess(left, right);
|
|
1689
|
+
case ">":
|
|
1690
|
+
return isLess(right, left);
|
|
1691
|
+
case ">=":
|
|
1692
|
+
return isEqual(left, right) || isLess(right, left);
|
|
1693
|
+
case "<=":
|
|
1694
|
+
return isEqual(left, right) || isLess(left, right);
|
|
1695
|
+
case "in":
|
|
1696
|
+
return isIn(left, right);
|
|
1697
|
+
case "not in":
|
|
1698
|
+
return !isIn(left, right);
|
|
1699
|
+
default:
|
|
1700
|
+
throw new EvaluationError(`Unknown binary operator: ${ast.op}`);
|
|
1882
1701
|
}
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
let seconds = namedArgs.seconds + 60 * namedArgs.minutes + 3600 * namedArgs.hours;
|
|
1893
|
-
let microseconds = namedArgs.microseconds + 1e3 * namedArgs.milliseconds;
|
|
1894
|
-
const [dFrac, dInt] = modf(days);
|
|
1895
|
-
d = dInt;
|
|
1896
|
-
let daysecondsfrac = 0;
|
|
1897
|
-
if (dFrac) {
|
|
1898
|
-
const [dsFrac, dsInt] = modf(dFrac * 24 * 3600);
|
|
1899
|
-
s = dsInt;
|
|
1900
|
-
daysecondsfrac = dsFrac;
|
|
1702
|
+
}
|
|
1703
|
+
var DICT = {
|
|
1704
|
+
get(...args) {
|
|
1705
|
+
const { key, defValue } = parseArgs(args, ["key", "defValue"]);
|
|
1706
|
+
const self = this;
|
|
1707
|
+
if (key in self) {
|
|
1708
|
+
return self[key];
|
|
1709
|
+
} else if (defValue !== void 0) {
|
|
1710
|
+
return defValue;
|
|
1901
1711
|
}
|
|
1902
|
-
|
|
1903
|
-
seconds = sInt;
|
|
1904
|
-
const secondsfrac = sFrac + daysecondsfrac;
|
|
1905
|
-
divmod(seconds, 24 * 3600, (days2, seconds2) => {
|
|
1906
|
-
d += days2;
|
|
1907
|
-
s += seconds2;
|
|
1908
|
-
});
|
|
1909
|
-
microseconds += secondsfrac * 1e6;
|
|
1910
|
-
divmod(microseconds, 1e6, (seconds2, microseconds2) => {
|
|
1911
|
-
divmod(seconds2, 24 * 3600, (days2, seconds3) => {
|
|
1912
|
-
d += days2;
|
|
1913
|
-
s += seconds3;
|
|
1914
|
-
us += Math.round(microseconds2);
|
|
1915
|
-
});
|
|
1916
|
-
});
|
|
1917
|
-
return new _PyTimeDelta(d, s, us);
|
|
1918
|
-
}
|
|
1919
|
-
add(other) {
|
|
1920
|
-
return _PyTimeDelta.create({
|
|
1921
|
-
days: this.days + other.days,
|
|
1922
|
-
seconds: this.seconds + other.seconds,
|
|
1923
|
-
microseconds: this.microseconds + other.microseconds
|
|
1924
|
-
});
|
|
1712
|
+
return null;
|
|
1925
1713
|
}
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1714
|
+
};
|
|
1715
|
+
var STRING = {
|
|
1716
|
+
lower() {
|
|
1717
|
+
return this.toLowerCase();
|
|
1718
|
+
},
|
|
1719
|
+
upper() {
|
|
1720
|
+
return this.toUpperCase();
|
|
1929
1721
|
}
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
return this.days === other.days && this.seconds === other.seconds && this.microseconds === other.microseconds;
|
|
1722
|
+
};
|
|
1723
|
+
function applyFunc(key, func, set, ...args) {
|
|
1724
|
+
if (args.length === 1) {
|
|
1725
|
+
return new Set(set);
|
|
1935
1726
|
}
|
|
1936
|
-
|
|
1937
|
-
|
|
1727
|
+
if (args.length > 2) {
|
|
1728
|
+
throw new EvaluationError(
|
|
1729
|
+
`${key}: py_js supports at most 1 argument, got (${args.length - 1})`
|
|
1730
|
+
);
|
|
1938
1731
|
}
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1732
|
+
return execOnIterable(args[0], func);
|
|
1733
|
+
}
|
|
1734
|
+
var SET = {
|
|
1735
|
+
intersection(...args) {
|
|
1736
|
+
return applyFunc(
|
|
1737
|
+
"intersection",
|
|
1738
|
+
(iterable) => {
|
|
1739
|
+
const intersection = /* @__PURE__ */ new Set();
|
|
1740
|
+
for (const i of iterable) {
|
|
1741
|
+
if (this.has(i)) {
|
|
1742
|
+
intersection.add(i);
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
return intersection;
|
|
1746
|
+
},
|
|
1747
|
+
this,
|
|
1748
|
+
...args
|
|
1749
|
+
);
|
|
1750
|
+
},
|
|
1751
|
+
difference(...args) {
|
|
1752
|
+
return applyFunc(
|
|
1753
|
+
"difference",
|
|
1754
|
+
(iterable) => {
|
|
1755
|
+
iterable = new Set(iterable);
|
|
1756
|
+
const difference = /* @__PURE__ */ new Set();
|
|
1757
|
+
for (const e of this) {
|
|
1758
|
+
if (!iterable.has(e)) {
|
|
1759
|
+
difference.add(e);
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
return difference;
|
|
1763
|
+
},
|
|
1764
|
+
this,
|
|
1765
|
+
...args
|
|
1766
|
+
);
|
|
1767
|
+
},
|
|
1768
|
+
union(...args) {
|
|
1769
|
+
return applyFunc(
|
|
1770
|
+
"union",
|
|
1771
|
+
(iterable) => {
|
|
1772
|
+
return /* @__PURE__ */ new Set([...this, ...iterable]);
|
|
1773
|
+
},
|
|
1774
|
+
this,
|
|
1775
|
+
...args
|
|
1776
|
+
);
|
|
1945
1777
|
}
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1778
|
+
};
|
|
1779
|
+
function methods(_class) {
|
|
1780
|
+
return Object.getOwnPropertyNames(_class.prototype).map(
|
|
1781
|
+
(prop) => _class.prototype[prop]
|
|
1782
|
+
);
|
|
1783
|
+
}
|
|
1784
|
+
var allowedFns = /* @__PURE__ */ new Set([
|
|
1785
|
+
BUILTINS.time.strftime,
|
|
1786
|
+
BUILTINS.set,
|
|
1787
|
+
BUILTINS.bool,
|
|
1788
|
+
BUILTINS.context_today,
|
|
1789
|
+
BUILTINS.datetime.datetime.now,
|
|
1790
|
+
BUILTINS.datetime.datetime.combine,
|
|
1791
|
+
BUILTINS.datetime.date.today,
|
|
1792
|
+
...methods(BUILTINS.relativedelta),
|
|
1793
|
+
...Object.values(BUILTINS.datetime).flatMap((obj) => methods(obj)),
|
|
1794
|
+
...Object.values(SET),
|
|
1795
|
+
...Object.values(DICT),
|
|
1796
|
+
...Object.values(STRING)
|
|
1797
|
+
]);
|
|
1798
|
+
var unboundFn = Symbol("unbound function");
|
|
1799
|
+
function evaluate(ast, context = {}) {
|
|
1800
|
+
const dicts = /* @__PURE__ */ new Set();
|
|
1801
|
+
let pyContext;
|
|
1802
|
+
const evalContext = Object.create(context);
|
|
1803
|
+
if (!evalContext?.context) {
|
|
1804
|
+
Object.defineProperty(evalContext, "context", {
|
|
1805
|
+
get() {
|
|
1806
|
+
if (!pyContext) {
|
|
1807
|
+
pyContext = toPyDict(context);
|
|
1808
|
+
}
|
|
1809
|
+
return pyContext;
|
|
1810
|
+
}
|
|
1951
1811
|
});
|
|
1952
1812
|
}
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1813
|
+
function _innerEvaluate(ast2) {
|
|
1814
|
+
switch (ast2?.type) {
|
|
1815
|
+
case 0:
|
|
1816
|
+
// Number
|
|
1817
|
+
case 1:
|
|
1818
|
+
return ast2.value;
|
|
1819
|
+
case 5:
|
|
1820
|
+
if (ast2.value in evalContext) {
|
|
1821
|
+
if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
|
|
1822
|
+
return evalContext[ast2.value]?.id;
|
|
1823
|
+
}
|
|
1824
|
+
return evalContext[ast2.value] ?? false;
|
|
1825
|
+
} else if (ast2.value in BUILTINS) {
|
|
1826
|
+
return BUILTINS[ast2.value];
|
|
1827
|
+
} else {
|
|
1828
|
+
return false;
|
|
1829
|
+
}
|
|
1830
|
+
case 3:
|
|
1831
|
+
return null;
|
|
1832
|
+
case 2:
|
|
1833
|
+
return ast2.value;
|
|
1834
|
+
case 6:
|
|
1835
|
+
return applyUnaryOp(ast2, evalContext);
|
|
1836
|
+
case 7:
|
|
1837
|
+
return applyBinaryOp(ast2, evalContext);
|
|
1838
|
+
case 14:
|
|
1839
|
+
const left = _evaluate(ast2.left);
|
|
1840
|
+
if (ast2.op === "and") {
|
|
1841
|
+
return isTrue(left) ? _evaluate(ast2.right) : left;
|
|
1842
|
+
} else {
|
|
1843
|
+
return isTrue(left) ? left : _evaluate(ast2.right);
|
|
1844
|
+
}
|
|
1845
|
+
case 4:
|
|
1846
|
+
// List
|
|
1847
|
+
case 10:
|
|
1848
|
+
return ast2.value.map(_evaluate);
|
|
1849
|
+
case 11:
|
|
1850
|
+
const dict = {};
|
|
1851
|
+
for (const key2 in ast2.value) {
|
|
1852
|
+
dict[key2] = _evaluate(ast2.value[key2]);
|
|
1853
|
+
}
|
|
1854
|
+
dicts.add(dict);
|
|
1855
|
+
return dict;
|
|
1856
|
+
case 8:
|
|
1857
|
+
const fnValue = _evaluate(ast2.fn);
|
|
1858
|
+
const args = ast2.args.map(_evaluate);
|
|
1859
|
+
const kwargs = {};
|
|
1860
|
+
for (const kwarg in ast2.kwargs) {
|
|
1861
|
+
kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
|
|
1862
|
+
}
|
|
1863
|
+
if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
|
|
1864
|
+
return fnValue.create(...args, kwargs);
|
|
1865
|
+
}
|
|
1866
|
+
return fnValue(...args, kwargs);
|
|
1867
|
+
case 12:
|
|
1868
|
+
const dictVal = _evaluate(ast2.target);
|
|
1869
|
+
const key = _evaluate(ast2.key);
|
|
1870
|
+
return dictVal[key];
|
|
1871
|
+
case 13:
|
|
1872
|
+
if (isTrue(_evaluate(ast2.condition))) {
|
|
1873
|
+
return _evaluate(ast2.ifTrue);
|
|
1874
|
+
} else {
|
|
1875
|
+
return _evaluate(ast2.ifFalse);
|
|
1876
|
+
}
|
|
1877
|
+
case 15:
|
|
1878
|
+
let leftVal = _evaluate(ast2.obj);
|
|
1879
|
+
let result;
|
|
1880
|
+
if (dicts.has(leftVal) || Object.isPrototypeOf.call(PY_DICT, leftVal)) {
|
|
1881
|
+
result = DICT[ast2.key];
|
|
1882
|
+
} else if (typeof leftVal === "string") {
|
|
1883
|
+
result = STRING[ast2.key];
|
|
1884
|
+
} else if (leftVal instanceof Set) {
|
|
1885
|
+
result = SET[ast2.key];
|
|
1886
|
+
} else if (ast2.key === "get" && typeof leftVal === "object") {
|
|
1887
|
+
result = DICT[ast2.key];
|
|
1888
|
+
leftVal = toPyDict(leftVal);
|
|
1889
|
+
} else {
|
|
1890
|
+
result = leftVal[ast2.key];
|
|
1891
|
+
}
|
|
1892
|
+
if (typeof result === "function") {
|
|
1893
|
+
const bound = result.bind(leftVal);
|
|
1894
|
+
bound[unboundFn] = result;
|
|
1895
|
+
return bound;
|
|
1896
|
+
}
|
|
1897
|
+
return result;
|
|
1898
|
+
default:
|
|
1899
|
+
throw new EvaluationError(`AST of type ${ast2.type} cannot be evaluated`);
|
|
1900
|
+
}
|
|
1959
1901
|
}
|
|
1960
|
-
|
|
1961
|
-
|
|
1902
|
+
function _evaluate(ast2) {
|
|
1903
|
+
const val = _innerEvaluate(ast2);
|
|
1904
|
+
if (typeof val === "function" && !allowedFns.has(val) && !allowedFns.has(val[unboundFn])) {
|
|
1905
|
+
throw new Error("Invalid Function Call");
|
|
1906
|
+
}
|
|
1907
|
+
return val;
|
|
1962
1908
|
}
|
|
1963
|
-
|
|
1909
|
+
return _evaluate(ast);
|
|
1910
|
+
}
|
|
1964
1911
|
|
|
1965
|
-
// src/utils/domain/
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1912
|
+
// src/utils/domain/py.ts
|
|
1913
|
+
function parseExpr(expr) {
|
|
1914
|
+
const tokens = tokenize(expr);
|
|
1915
|
+
return parse(tokens);
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
// src/utils/domain/objects.ts
|
|
1919
|
+
function shallowEqual(obj1, obj2, comparisonFn = (a, b) => a === b) {
|
|
1920
|
+
if (!obj1 || !obj2 || typeof obj1 !== "object" || typeof obj2 !== "object") {
|
|
1921
|
+
return obj1 === obj2;
|
|
1970
1922
|
}
|
|
1923
|
+
const obj1Keys = Object.keys(obj1);
|
|
1924
|
+
return obj1Keys.length === Object.keys(obj2).length && obj1Keys.every((key) => comparisonFn(obj1[key], obj2[key]));
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1927
|
+
// src/utils/domain/arrays.ts
|
|
1928
|
+
var shallowEqual2 = shallowEqual;
|
|
1929
|
+
|
|
1930
|
+
// src/utils/domain/strings.ts
|
|
1931
|
+
var escapeMethod = Symbol("html");
|
|
1932
|
+
function escapeRegExp(str) {
|
|
1933
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
// src/utils/domain/domain.ts
|
|
1937
|
+
var InvalidDomainError = class extends Error {
|
|
1971
1938
|
};
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1939
|
+
var Domain = class _Domain {
|
|
1940
|
+
ast = { type: -1, value: null };
|
|
1941
|
+
static TRUE;
|
|
1942
|
+
static FALSE;
|
|
1943
|
+
static combine(domains, operator) {
|
|
1944
|
+
if (domains.length === 0) {
|
|
1945
|
+
return new _Domain([]);
|
|
1946
|
+
}
|
|
1947
|
+
const domain1 = domains[0] instanceof _Domain ? domains[0] : new _Domain(domains[0]);
|
|
1948
|
+
if (domains.length === 1) {
|
|
1949
|
+
return domain1;
|
|
1950
|
+
}
|
|
1951
|
+
const domain2 = _Domain.combine(domains.slice(1), operator);
|
|
1952
|
+
const result = new _Domain([]);
|
|
1953
|
+
const astValues1 = domain1.ast.value;
|
|
1954
|
+
const astValues2 = domain2.ast.value;
|
|
1955
|
+
const op = operator === "AND" ? "&" : "|";
|
|
1956
|
+
const combinedAST = {
|
|
1957
|
+
type: 4,
|
|
1958
|
+
value: astValues1.concat(astValues2)
|
|
1959
|
+
};
|
|
1960
|
+
result.ast = normalizeDomainAST(combinedAST, op);
|
|
1961
|
+
return result;
|
|
1975
1962
|
}
|
|
1976
|
-
|
|
1977
|
-
|
|
1963
|
+
static and(domains) {
|
|
1964
|
+
return _Domain.combine(domains, "AND");
|
|
1978
1965
|
}
|
|
1979
|
-
|
|
1980
|
-
|
|
1966
|
+
static or(domains) {
|
|
1967
|
+
return _Domain.combine(domains, "OR");
|
|
1981
1968
|
}
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
return false;
|
|
2000
|
-
}
|
|
2001
|
-
if ("isTrue" in value && typeof value.isTrue === "function") {
|
|
2002
|
-
return value.isTrue();
|
|
1969
|
+
static not(domain) {
|
|
1970
|
+
const result = new _Domain(domain);
|
|
1971
|
+
result.ast.value.unshift({ type: 1, value: "!" });
|
|
1972
|
+
return result;
|
|
1973
|
+
}
|
|
1974
|
+
static removeDomainLeaves(domain, keysToRemove) {
|
|
1975
|
+
function processLeaf(elements, idx, operatorCtx, newDomain2) {
|
|
1976
|
+
const leaf = elements[idx];
|
|
1977
|
+
if (leaf.type === 10) {
|
|
1978
|
+
if (keysToRemove.includes(leaf.value[0].value)) {
|
|
1979
|
+
if (operatorCtx === "&") {
|
|
1980
|
+
newDomain2.ast.value.push(..._Domain.TRUE.ast.value);
|
|
1981
|
+
} else if (operatorCtx === "|") {
|
|
1982
|
+
newDomain2.ast.value.push(..._Domain.FALSE.ast.value);
|
|
1983
|
+
}
|
|
1984
|
+
} else {
|
|
1985
|
+
newDomain2.ast.value.push(leaf);
|
|
2003
1986
|
}
|
|
2004
|
-
|
|
2005
|
-
|
|
1987
|
+
return 1;
|
|
1988
|
+
} else if (leaf.type === 1) {
|
|
1989
|
+
if (leaf.value === "|" && elements[idx + 1].type === 10 && elements[idx + 2].type === 10 && keysToRemove.includes(elements[idx + 1].value[0].value) && keysToRemove.includes(elements[idx + 2].value[0].value)) {
|
|
1990
|
+
newDomain2.ast.value.push(..._Domain.TRUE.ast.value);
|
|
1991
|
+
return 3;
|
|
2006
1992
|
}
|
|
2007
|
-
|
|
2008
|
-
|
|
1993
|
+
newDomain2.ast.value.push(leaf);
|
|
1994
|
+
if (leaf.value === "!") {
|
|
1995
|
+
return 1 + processLeaf(elements, idx + 1, "&", newDomain2);
|
|
2009
1996
|
}
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
1997
|
+
const firstLeafSkip = processLeaf(
|
|
1998
|
+
elements,
|
|
1999
|
+
idx + 1,
|
|
2000
|
+
leaf.value,
|
|
2001
|
+
newDomain2
|
|
2002
|
+
);
|
|
2003
|
+
const secondLeafSkip = processLeaf(
|
|
2004
|
+
elements,
|
|
2005
|
+
idx + 1 + firstLeafSkip,
|
|
2006
|
+
leaf.value,
|
|
2007
|
+
newDomain2
|
|
2008
|
+
);
|
|
2009
|
+
return 1 + firstLeafSkip + secondLeafSkip;
|
|
2010
|
+
}
|
|
2011
|
+
return 0;
|
|
2020
2012
|
}
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
);
|
|
2025
|
-
},
|
|
2026
|
-
time: {
|
|
2027
|
-
strftime(format) {
|
|
2028
|
-
return PyDateTime.now().strftime(format);
|
|
2013
|
+
const d = new _Domain(domain);
|
|
2014
|
+
if (d.ast.value.length === 0) {
|
|
2015
|
+
return d;
|
|
2029
2016
|
}
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
return
|
|
2033
|
-
}
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
},
|
|
2049
|
-
relativedelta: PyRelativeDelta,
|
|
2050
|
-
true: true,
|
|
2051
|
-
false: false
|
|
2052
|
-
};
|
|
2053
|
-
|
|
2054
|
-
// src/utils/domain/py_utils.ts
|
|
2055
|
-
function toPyValue(value) {
|
|
2056
|
-
switch (typeof value) {
|
|
2057
|
-
case "string":
|
|
2058
|
-
return { type: 1, value };
|
|
2059
|
-
case "number":
|
|
2060
|
-
return { type: 0, value };
|
|
2061
|
-
case "boolean":
|
|
2062
|
-
return { type: 2, value };
|
|
2063
|
-
case "object":
|
|
2064
|
-
if (Array.isArray(value)) {
|
|
2065
|
-
return { type: 4, value: value.map(toPyValue) };
|
|
2066
|
-
} else if (value === null) {
|
|
2067
|
-
return {
|
|
2068
|
-
type: 3
|
|
2069
|
-
/* None */
|
|
2070
|
-
};
|
|
2071
|
-
} else if (value instanceof Date) {
|
|
2072
|
-
return {
|
|
2073
|
-
type: 1,
|
|
2074
|
-
value: String(PyDateTime.convertDate(value))
|
|
2075
|
-
};
|
|
2076
|
-
} else if (value instanceof PyDate || value instanceof PyDateTime) {
|
|
2077
|
-
return { type: 1, value };
|
|
2078
|
-
} else {
|
|
2079
|
-
const content = {};
|
|
2080
|
-
for (const key in value) {
|
|
2081
|
-
content[key] = toPyValue(value[key]);
|
|
2082
|
-
}
|
|
2083
|
-
return { type: 11, value: content };
|
|
2084
|
-
}
|
|
2085
|
-
default:
|
|
2086
|
-
throw new Error("Invalid type");
|
|
2087
|
-
}
|
|
2088
|
-
}
|
|
2089
|
-
function formatAST(ast, lbp = 0) {
|
|
2090
|
-
switch (ast.type) {
|
|
2091
|
-
case 3:
|
|
2092
|
-
return "None";
|
|
2093
|
-
case 1:
|
|
2094
|
-
return JSON.stringify(ast.value);
|
|
2095
|
-
case 0:
|
|
2096
|
-
return String(ast.value);
|
|
2097
|
-
case 2:
|
|
2098
|
-
return ast.value ? "True" : "False";
|
|
2099
|
-
case 4:
|
|
2100
|
-
return `[${ast.value.map(formatAST).join(", ")}]`;
|
|
2101
|
-
case 6:
|
|
2102
|
-
if (ast.op === "not") {
|
|
2103
|
-
return `not ${formatAST(ast.right, 50)}`;
|
|
2104
|
-
}
|
|
2105
|
-
return `${ast.op}${formatAST(ast.right, 130)}`;
|
|
2106
|
-
case 7:
|
|
2107
|
-
const abp = bp(ast.op);
|
|
2108
|
-
const binaryStr = `${formatAST(ast.left, abp)} ${ast.op} ${formatAST(ast.right, abp)}`;
|
|
2109
|
-
return abp < lbp ? `(${binaryStr})` : binaryStr;
|
|
2110
|
-
case 11:
|
|
2111
|
-
const pairs = [];
|
|
2112
|
-
for (const k in ast.value) {
|
|
2113
|
-
pairs.push(`"${k}": ${formatAST(ast.value[k])}`);
|
|
2017
|
+
const newDomain = new _Domain([]);
|
|
2018
|
+
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
2019
|
+
return newDomain;
|
|
2020
|
+
}
|
|
2021
|
+
constructor(descr = []) {
|
|
2022
|
+
if (descr instanceof _Domain) {
|
|
2023
|
+
return new _Domain(descr.toString());
|
|
2024
|
+
} else {
|
|
2025
|
+
let rawAST;
|
|
2026
|
+
try {
|
|
2027
|
+
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
2028
|
+
} catch (error) {
|
|
2029
|
+
throw new InvalidDomainError(
|
|
2030
|
+
`Invalid domain representation: ${descr}`,
|
|
2031
|
+
{
|
|
2032
|
+
cause: error
|
|
2033
|
+
}
|
|
2034
|
+
);
|
|
2114
2035
|
}
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
for (const kwarg in ast.kwargs) {
|
|
2135
|
-
kwargs.push(`${kwarg} = ${formatAST(ast.kwargs[kwarg])}`);
|
|
2036
|
+
this.ast = normalizeDomainAST(rawAST);
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
contains(record) {
|
|
2040
|
+
const expr = evaluate(this.ast, record);
|
|
2041
|
+
return matchDomain(record, expr);
|
|
2042
|
+
}
|
|
2043
|
+
toString() {
|
|
2044
|
+
return formatAST(this.ast);
|
|
2045
|
+
}
|
|
2046
|
+
toList(context) {
|
|
2047
|
+
return evaluate(this.ast, context);
|
|
2048
|
+
}
|
|
2049
|
+
toJson() {
|
|
2050
|
+
try {
|
|
2051
|
+
const evaluatedAsList = this.toList({});
|
|
2052
|
+
const evaluatedDomain = new _Domain(evaluatedAsList);
|
|
2053
|
+
if (evaluatedDomain.toString() === this.toString()) {
|
|
2054
|
+
return evaluatedAsList;
|
|
2136
2055
|
}
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2056
|
+
return this.toString();
|
|
2057
|
+
} catch {
|
|
2058
|
+
return this.toString();
|
|
2059
|
+
}
|
|
2141
2060
|
}
|
|
2142
|
-
}
|
|
2143
|
-
var
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2061
|
+
};
|
|
2062
|
+
var TRUE_LEAF = [1, "=", 1];
|
|
2063
|
+
var FALSE_LEAF = [0, "=", 1];
|
|
2064
|
+
var TRUE_DOMAIN = new Domain([TRUE_LEAF]);
|
|
2065
|
+
var FALSE_DOMAIN = new Domain([FALSE_LEAF]);
|
|
2066
|
+
Domain.TRUE = TRUE_DOMAIN;
|
|
2067
|
+
Domain.FALSE = FALSE_DOMAIN;
|
|
2068
|
+
function toAST(domain) {
|
|
2069
|
+
const elems = domain.map((elem) => {
|
|
2070
|
+
switch (elem) {
|
|
2071
|
+
case "!":
|
|
2072
|
+
case "&":
|
|
2073
|
+
case "|":
|
|
2074
|
+
return { type: 1, value: elem };
|
|
2075
|
+
default:
|
|
2076
|
+
return {
|
|
2077
|
+
type: 10,
|
|
2078
|
+
value: elem.map(toPyValue)
|
|
2079
|
+
};
|
|
2148
2080
|
}
|
|
2149
2081
|
});
|
|
2082
|
+
return { type: 4, value: elems };
|
|
2150
2083
|
}
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
case "-":
|
|
2158
|
-
if (value instanceof Object && "negate" in value) {
|
|
2159
|
-
return value.negate();
|
|
2084
|
+
function normalizeDomainAST(domain, op = "&") {
|
|
2085
|
+
if (domain.type !== 4) {
|
|
2086
|
+
if (domain.type === 10) {
|
|
2087
|
+
const value = domain.value;
|
|
2088
|
+
if (value.findIndex((e) => e.type === 10) === -1 || !value.every((e) => e.type === 10 || e.type === 1)) {
|
|
2089
|
+
throw new InvalidDomainError("Invalid domain AST");
|
|
2160
2090
|
}
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2091
|
+
} else {
|
|
2092
|
+
throw new InvalidDomainError("Invalid domain AST");
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
if (domain.value.length === 0) {
|
|
2096
|
+
return domain;
|
|
2097
|
+
}
|
|
2098
|
+
let expected = 1;
|
|
2099
|
+
for (const child of domain.value) {
|
|
2100
|
+
switch (child.type) {
|
|
2101
|
+
case 1:
|
|
2102
|
+
if (child.value === "&" || child.value === "|") {
|
|
2103
|
+
expected++;
|
|
2104
|
+
} else if (child.value !== "!") {
|
|
2105
|
+
throw new InvalidDomainError("Invalid domain AST");
|
|
2106
|
+
}
|
|
2107
|
+
break;
|
|
2108
|
+
case 4:
|
|
2109
|
+
/* list */
|
|
2110
|
+
case 10:
|
|
2111
|
+
if (child.value.length === 3) {
|
|
2112
|
+
expected--;
|
|
2113
|
+
break;
|
|
2114
|
+
}
|
|
2115
|
+
throw new InvalidDomainError("Invalid domain AST");
|
|
2116
|
+
default:
|
|
2117
|
+
throw new InvalidDomainError("Invalid domain AST");
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
const values = domain.value.slice();
|
|
2121
|
+
while (expected < 0) {
|
|
2122
|
+
expected++;
|
|
2123
|
+
values.unshift({ type: 1, value: op });
|
|
2124
|
+
}
|
|
2125
|
+
if (expected > 0) {
|
|
2126
|
+
throw new InvalidDomainError(
|
|
2127
|
+
`invalid domain ${formatAST(domain)} (missing ${expected} segment(s))`
|
|
2128
|
+
);
|
|
2168
2129
|
}
|
|
2130
|
+
return { type: 4, value: values };
|
|
2169
2131
|
}
|
|
2170
|
-
function
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2132
|
+
function matchCondition(record, condition) {
|
|
2133
|
+
if (typeof condition === "boolean") {
|
|
2134
|
+
return condition;
|
|
2135
|
+
}
|
|
2136
|
+
const [field, operator, value] = condition;
|
|
2137
|
+
if (typeof field === "string") {
|
|
2138
|
+
const names = field.split(".");
|
|
2139
|
+
if (names.length >= 2) {
|
|
2140
|
+
return matchCondition(record[names[0]], [
|
|
2141
|
+
names.slice(1).join("."),
|
|
2142
|
+
operator,
|
|
2143
|
+
value
|
|
2144
|
+
]);
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
let likeRegexp, ilikeRegexp;
|
|
2148
|
+
if (["like", "not like", "ilike", "not ilike"].includes(operator)) {
|
|
2149
|
+
likeRegexp = new RegExp(
|
|
2150
|
+
`(.*)${escapeRegExp(value).replaceAll("%", "(.*)")}(.*)`,
|
|
2151
|
+
"g"
|
|
2152
|
+
);
|
|
2153
|
+
ilikeRegexp = new RegExp(
|
|
2154
|
+
`(.*)${escapeRegExp(value).replaceAll("%", "(.*)")}(.*)`,
|
|
2155
|
+
"gi"
|
|
2156
|
+
);
|
|
2157
|
+
}
|
|
2158
|
+
const fieldValue = typeof field === "number" ? field : record[field];
|
|
2159
|
+
switch (operator) {
|
|
2160
|
+
case "=?":
|
|
2161
|
+
if ([false, null].includes(value)) {
|
|
2162
|
+
return true;
|
|
2163
|
+
}
|
|
2164
|
+
// eslint-disable-next-line no-fallthrough
|
|
2165
|
+
case "=":
|
|
2166
|
+
case "==":
|
|
2167
|
+
if (Array.isArray(fieldValue) && Array.isArray(value)) {
|
|
2168
|
+
return shallowEqual2(fieldValue, value);
|
|
2169
|
+
}
|
|
2170
|
+
return fieldValue === value;
|
|
2171
|
+
case "!=":
|
|
2172
|
+
case "<>":
|
|
2173
|
+
return !matchCondition(record, [field, "==", value]);
|
|
2174
|
+
case "<":
|
|
2175
|
+
return fieldValue < value;
|
|
2176
|
+
case "<=":
|
|
2177
|
+
return fieldValue <= value;
|
|
2178
|
+
case ">":
|
|
2179
|
+
return fieldValue > value;
|
|
2180
|
+
case ">=":
|
|
2181
|
+
return fieldValue >= value;
|
|
2182
|
+
case "in": {
|
|
2183
|
+
const val = Array.isArray(value) ? value : [value];
|
|
2184
|
+
const fieldVal = Array.isArray(fieldValue) ? fieldValue : [fieldValue];
|
|
2185
|
+
return fieldVal.some((fv) => val.includes(fv));
|
|
2186
|
+
}
|
|
2187
|
+
case "not in": {
|
|
2188
|
+
const val = Array.isArray(value) ? value : [value];
|
|
2189
|
+
const fieldVal = Array.isArray(fieldValue) ? fieldValue : [fieldValue];
|
|
2190
|
+
return !fieldVal.some((fv) => val.includes(fv));
|
|
2191
|
+
}
|
|
2192
|
+
case "like":
|
|
2193
|
+
if (fieldValue === false) {
|
|
2194
|
+
return false;
|
|
2195
|
+
}
|
|
2196
|
+
return Boolean(fieldValue.match(likeRegexp));
|
|
2197
|
+
case "not like":
|
|
2198
|
+
if (fieldValue === false) {
|
|
2199
|
+
return false;
|
|
2200
|
+
}
|
|
2201
|
+
return Boolean(!fieldValue.match(likeRegexp));
|
|
2202
|
+
case "=like":
|
|
2203
|
+
if (fieldValue === false) {
|
|
2204
|
+
return false;
|
|
2205
|
+
}
|
|
2206
|
+
return new RegExp(escapeRegExp(value).replace(/%/g, ".*")).test(
|
|
2207
|
+
fieldValue
|
|
2208
|
+
);
|
|
2209
|
+
case "ilike":
|
|
2210
|
+
if (fieldValue === false) {
|
|
2211
|
+
return false;
|
|
2212
|
+
}
|
|
2213
|
+
return Boolean(fieldValue.match(ilikeRegexp));
|
|
2214
|
+
case "not ilike":
|
|
2215
|
+
if (fieldValue === false) {
|
|
2216
|
+
return false;
|
|
2217
|
+
}
|
|
2218
|
+
return Boolean(!fieldValue.match(ilikeRegexp));
|
|
2219
|
+
case "=ilike":
|
|
2220
|
+
if (fieldValue === false) {
|
|
2221
|
+
return false;
|
|
2222
|
+
}
|
|
2223
|
+
return new RegExp(escapeRegExp(value).replace(/%/g, ".*"), "i").test(
|
|
2224
|
+
fieldValue
|
|
2225
|
+
);
|
|
2180
2226
|
}
|
|
2227
|
+
throw new InvalidDomainError("could not match domain");
|
|
2181
2228
|
}
|
|
2182
|
-
function
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
|
-
|
|
2229
|
+
function makeOperators(record) {
|
|
2230
|
+
const match = matchCondition.bind(null, record);
|
|
2231
|
+
return {
|
|
2232
|
+
"!": (x) => !match(x),
|
|
2233
|
+
"&": (a, b) => match(a) && match(b),
|
|
2234
|
+
"|": (a, b) => match(a) || match(b)
|
|
2235
|
+
};
|
|
2236
|
+
}
|
|
2237
|
+
function matchDomain(record, domain) {
|
|
2238
|
+
if (domain.length === 0) {
|
|
2239
|
+
return true;
|
|
2191
2240
|
}
|
|
2192
|
-
const
|
|
2193
|
-
const
|
|
2194
|
-
|
|
2195
|
-
|
|
2241
|
+
const operators = makeOperators(record);
|
|
2242
|
+
const reversedDomain = Array.from(domain).reverse();
|
|
2243
|
+
const condStack = [];
|
|
2244
|
+
for (const item of reversedDomain) {
|
|
2245
|
+
const operator = typeof item === "string" && operators[item];
|
|
2246
|
+
if (operator) {
|
|
2247
|
+
const operands = condStack.splice(-operator.length);
|
|
2248
|
+
condStack.push(operator(...operands));
|
|
2249
|
+
} else {
|
|
2250
|
+
condStack.push(item);
|
|
2251
|
+
}
|
|
2196
2252
|
}
|
|
2197
|
-
return
|
|
2253
|
+
return matchCondition(record, condStack.pop());
|
|
2198
2254
|
}
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2255
|
+
|
|
2256
|
+
// src/utils/function.ts
|
|
2257
|
+
var import_react = require("react");
|
|
2258
|
+
var toQueryString = (params) => {
|
|
2259
|
+
return Object.keys(params).map(
|
|
2260
|
+
(key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
|
|
2261
|
+
).join("&");
|
|
2262
|
+
};
|
|
2263
|
+
var isBase64File = (str) => {
|
|
2264
|
+
try {
|
|
2265
|
+
const dataUriPattern = /^data:([a-zA-Z]+\/[a-zA-Z0-9-.+]+)?;base64,/;
|
|
2266
|
+
if (dataUriPattern.test(str)) {
|
|
2267
|
+
return true;
|
|
2206
2268
|
}
|
|
2269
|
+
const base64Pattern = (
|
|
2270
|
+
// eslint-disable-next-line no-useless-escape
|
|
2271
|
+
/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)?$/
|
|
2272
|
+
);
|
|
2273
|
+
return base64Pattern.test(str);
|
|
2274
|
+
} catch (e) {
|
|
2207
2275
|
return false;
|
|
2208
2276
|
}
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2277
|
+
};
|
|
2278
|
+
var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
|
|
2279
|
+
if (!originalRequest.data) return originalRequest.data;
|
|
2280
|
+
if (typeof originalRequest.data === "string") {
|
|
2281
|
+
try {
|
|
2282
|
+
const parsedData = JSON.parse(originalRequest.data);
|
|
2283
|
+
if (parsedData.with_context && typeof parsedData.with_context === "object") {
|
|
2284
|
+
parsedData.with_context.token = newAccessToken;
|
|
2285
|
+
}
|
|
2286
|
+
return JSON.stringify(parsedData);
|
|
2287
|
+
} catch (e) {
|
|
2288
|
+
console.warn("Failed to parse originalRequest.data", e);
|
|
2289
|
+
return originalRequest.data;
|
|
2290
|
+
}
|
|
2220
2291
|
}
|
|
2221
|
-
if (typeof
|
|
2222
|
-
|
|
2292
|
+
if (typeof originalRequest.data === "object" && originalRequest.data.with_context) {
|
|
2293
|
+
originalRequest.data.with_context.token = newAccessToken;
|
|
2223
2294
|
}
|
|
2224
|
-
return
|
|
2225
|
-
}
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2295
|
+
return originalRequest.data;
|
|
2296
|
+
};
|
|
2297
|
+
|
|
2298
|
+
// src/utils/storage/local-storage.ts
|
|
2299
|
+
var localStorageUtils = () => {
|
|
2300
|
+
const setToken = async (access_token) => {
|
|
2301
|
+
localStorage.setItem("accessToken", access_token);
|
|
2302
|
+
};
|
|
2303
|
+
const setRefreshToken = async (refresh_token) => {
|
|
2304
|
+
localStorage.setItem("refreshToken", refresh_token);
|
|
2305
|
+
};
|
|
2306
|
+
const getAccessToken = async () => {
|
|
2307
|
+
return localStorage.getItem("accessToken");
|
|
2308
|
+
};
|
|
2309
|
+
const getRefreshToken = async () => {
|
|
2310
|
+
return localStorage.getItem("refreshToken");
|
|
2311
|
+
};
|
|
2312
|
+
const clearToken = async () => {
|
|
2313
|
+
localStorage.removeItem("accessToken");
|
|
2314
|
+
localStorage.removeItem("refreshToken");
|
|
2315
|
+
};
|
|
2316
|
+
return {
|
|
2317
|
+
setToken,
|
|
2318
|
+
setRefreshToken,
|
|
2319
|
+
getAccessToken,
|
|
2320
|
+
getRefreshToken,
|
|
2321
|
+
clearToken
|
|
2322
|
+
};
|
|
2323
|
+
};
|
|
2324
|
+
|
|
2325
|
+
// src/utils/storage/session-storage.ts
|
|
2326
|
+
var sessionStorageUtils = () => {
|
|
2327
|
+
const getBrowserSession = async () => {
|
|
2328
|
+
return sessionStorage.getItem("browserSession");
|
|
2329
|
+
};
|
|
2330
|
+
return {
|
|
2331
|
+
getBrowserSession
|
|
2332
|
+
};
|
|
2333
|
+
};
|
|
2334
|
+
|
|
2335
|
+
// src/configs/axios-client.ts
|
|
2336
|
+
var axiosClient = {
|
|
2337
|
+
init(config) {
|
|
2338
|
+
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
2339
|
+
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
2340
|
+
const db = config?.db;
|
|
2341
|
+
let isRefreshing = false;
|
|
2342
|
+
let failedQueue = [];
|
|
2343
|
+
const processQueue = (error, token = null) => {
|
|
2344
|
+
failedQueue?.forEach((prom) => {
|
|
2345
|
+
if (error) {
|
|
2346
|
+
prom.reject(error);
|
|
2246
2347
|
} else {
|
|
2247
|
-
|
|
2348
|
+
prom.resolve(token);
|
|
2349
|
+
}
|
|
2350
|
+
});
|
|
2351
|
+
failedQueue = [];
|
|
2352
|
+
};
|
|
2353
|
+
const instance = import_axios.default.create({
|
|
2354
|
+
adapter: import_axios.default.defaults.adapter,
|
|
2355
|
+
baseURL: config.baseUrl,
|
|
2356
|
+
timeout: 5e4,
|
|
2357
|
+
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2358
|
+
});
|
|
2359
|
+
instance.interceptors.request.use(
|
|
2360
|
+
async (config2) => {
|
|
2361
|
+
const useRefreshToken = config2.useRefreshToken;
|
|
2362
|
+
const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
|
|
2363
|
+
if (token) {
|
|
2364
|
+
config2.headers["Authorization"] = "Bearer " + token;
|
|
2248
2365
|
}
|
|
2366
|
+
return config2;
|
|
2367
|
+
},
|
|
2368
|
+
(error) => {
|
|
2369
|
+
Promise.reject(error);
|
|
2249
2370
|
}
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2371
|
+
);
|
|
2372
|
+
instance.interceptors.response.use(
|
|
2373
|
+
(response) => {
|
|
2374
|
+
return handleResponse(response);
|
|
2375
|
+
},
|
|
2376
|
+
async (error) => {
|
|
2377
|
+
const handleError3 = async (error2) => {
|
|
2378
|
+
if (!error2.response) {
|
|
2379
|
+
return error2;
|
|
2380
|
+
}
|
|
2381
|
+
const { data } = error2.response;
|
|
2382
|
+
if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
|
|
2383
|
+
await clearAuthToken();
|
|
2384
|
+
}
|
|
2385
|
+
return data;
|
|
2386
|
+
};
|
|
2387
|
+
const originalRequest = error.config;
|
|
2388
|
+
if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
|
|
2389
|
+
error.response.data.code
|
|
2390
|
+
)) {
|
|
2391
|
+
if (isRefreshing) {
|
|
2392
|
+
return new Promise(function(resolve, reject) {
|
|
2393
|
+
failedQueue.push({ resolve, reject });
|
|
2394
|
+
}).then((token) => {
|
|
2395
|
+
originalRequest.headers["Authorization"] = "Bearer " + token;
|
|
2396
|
+
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
2397
|
+
originalRequest,
|
|
2398
|
+
token
|
|
2399
|
+
);
|
|
2400
|
+
return instance.request(originalRequest);
|
|
2401
|
+
}).catch(async (err) => {
|
|
2402
|
+
if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
|
|
2403
|
+
await clearAuthToken();
|
|
2404
|
+
}
|
|
2405
|
+
});
|
|
2406
|
+
}
|
|
2407
|
+
const browserSession = await sessionStorage2.getBrowserSession();
|
|
2408
|
+
const refreshToken = await localStorage2.getRefreshToken();
|
|
2409
|
+
const accessTokenExp = await localStorage2.getAccessToken();
|
|
2410
|
+
isRefreshing = true;
|
|
2411
|
+
if (!refreshToken && (!browserSession || browserSession == "unActive")) {
|
|
2412
|
+
await clearAuthToken();
|
|
2413
|
+
} else {
|
|
2414
|
+
const payload = Object.fromEntries(
|
|
2415
|
+
Object.entries({
|
|
2416
|
+
refresh_token: refreshToken,
|
|
2417
|
+
grant_type: "refresh_token",
|
|
2418
|
+
client_id: config.config.clientId,
|
|
2419
|
+
client_secret: config.config.clientSecret
|
|
2420
|
+
}).filter(([_, value]) => !!value)
|
|
2421
|
+
);
|
|
2422
|
+
return new Promise(function(resolve) {
|
|
2423
|
+
import_axios.default.post(
|
|
2424
|
+
`${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
|
|
2425
|
+
payload,
|
|
2426
|
+
{
|
|
2427
|
+
headers: {
|
|
2428
|
+
"Content-Type": config.refreshTokenEndpoint ? "application/x-www-form-urlencoded" : "multipart/form-data",
|
|
2429
|
+
Authorization: `Bearer ${accessTokenExp}`
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
).then(async (res) => {
|
|
2433
|
+
const data = res.data;
|
|
2434
|
+
await localStorage2.setToken(data.access_token);
|
|
2435
|
+
await localStorage2.setRefreshToken(data.refresh_token);
|
|
2436
|
+
import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
|
|
2437
|
+
originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
|
|
2438
|
+
originalRequest.data = updateTokenParamInOriginalRequest(
|
|
2439
|
+
originalRequest,
|
|
2440
|
+
data.access_token
|
|
2441
|
+
);
|
|
2442
|
+
processQueue(null, data.access_token);
|
|
2443
|
+
resolve(instance.request(originalRequest));
|
|
2444
|
+
}).catch(async (err) => {
|
|
2445
|
+
if (err && (err?.error_code === "AUTHEN_FAIL" || err?.error_code === "TOKEN_EXPIRED" || err?.error_code === "TOKEN_INCORRECT" || err?.code === "ERR_BAD_REQUEST") || err?.error_code === "ERR_2FA_006") {
|
|
2446
|
+
await clearAuthToken();
|
|
2447
|
+
}
|
|
2448
|
+
if (err && err.response) {
|
|
2449
|
+
const { error_code } = err.response?.data || {};
|
|
2450
|
+
if (error_code === "AUTHEN_FAIL") {
|
|
2451
|
+
await clearAuthToken();
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
processQueue(err, null);
|
|
2455
|
+
}).finally(() => {
|
|
2456
|
+
isRefreshing = false;
|
|
2457
|
+
});
|
|
2458
|
+
});
|
|
2459
|
+
}
|
|
2255
2460
|
}
|
|
2461
|
+
return Promise.reject(await handleError3(error));
|
|
2256
2462
|
}
|
|
2257
|
-
|
|
2258
|
-
|
|
2463
|
+
);
|
|
2464
|
+
const handleResponse = (res) => {
|
|
2465
|
+
if (res && res.data) {
|
|
2466
|
+
return res.data;
|
|
2259
2467
|
}
|
|
2260
|
-
return
|
|
2468
|
+
return res;
|
|
2469
|
+
};
|
|
2470
|
+
const handleError2 = (error) => {
|
|
2471
|
+
if (error.isAxiosError && error.code === "ECONNABORTED") {
|
|
2472
|
+
console.error("Request Timeout Error:", error);
|
|
2473
|
+
return "Request Timeout Error";
|
|
2474
|
+
} else if (error.isAxiosError && !error.response) {
|
|
2475
|
+
console.error("Network Error:", error);
|
|
2476
|
+
return "Network Error";
|
|
2477
|
+
} else {
|
|
2478
|
+
console.error("Other Error:", error?.response);
|
|
2479
|
+
const errorMessage = error?.response?.data?.message || "An error occurred";
|
|
2480
|
+
return { message: errorMessage, status: error?.response?.status };
|
|
2481
|
+
}
|
|
2482
|
+
};
|
|
2483
|
+
const clearAuthToken = async () => {
|
|
2484
|
+
await localStorage2.clearToken();
|
|
2485
|
+
if (typeof window !== "undefined") {
|
|
2486
|
+
window.location.href = `/login`;
|
|
2487
|
+
}
|
|
2488
|
+
};
|
|
2489
|
+
function formatUrl(url, db2) {
|
|
2490
|
+
return url + (db2 ? "?db=" + db2 : "");
|
|
2491
|
+
}
|
|
2492
|
+
const responseBody = (response) => response;
|
|
2493
|
+
const requests = {
|
|
2494
|
+
get: (url, headers) => instance.get(formatUrl(url, db), headers).then(responseBody),
|
|
2495
|
+
post: (url, body, headers) => instance.post(formatUrl(url, db), body, headers).then(responseBody),
|
|
2496
|
+
post_excel: (url, body, headers) => instance.post(formatUrl(url, db), body, {
|
|
2497
|
+
responseType: "arraybuffer",
|
|
2498
|
+
headers: {
|
|
2499
|
+
"Content-Type": typeof window !== "undefined" ? "application/json" : "application/javascript",
|
|
2500
|
+
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
2501
|
+
}
|
|
2502
|
+
}).then(responseBody),
|
|
2503
|
+
put: (url, body, headers) => instance.put(formatUrl(url, db), body, headers).then(responseBody),
|
|
2504
|
+
patch: (url, body) => instance.patch(formatUrl(url, db), body).then(responseBody),
|
|
2505
|
+
delete: (url, body) => instance.delete(formatUrl(url, db), body).then(responseBody)
|
|
2506
|
+
};
|
|
2507
|
+
return requests;
|
|
2508
|
+
}
|
|
2509
|
+
};
|
|
2510
|
+
|
|
2511
|
+
// src/store/index.ts
|
|
2512
|
+
var import_react_redux = require("react-redux");
|
|
2513
|
+
|
|
2514
|
+
// src/store/reducers/breadcrums-slice/index.ts
|
|
2515
|
+
var import_toolkit = require("@reduxjs/toolkit");
|
|
2516
|
+
var initialState = {
|
|
2517
|
+
breadCrumbs: []
|
|
2518
|
+
};
|
|
2519
|
+
var breadcrumbsSlice = (0, import_toolkit.createSlice)({
|
|
2520
|
+
name: "breadcrumbs",
|
|
2521
|
+
initialState,
|
|
2522
|
+
reducers: {
|
|
2523
|
+
setBreadCrumbs: (state, action) => {
|
|
2524
|
+
state.breadCrumbs = [...state.breadCrumbs, action.payload];
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
});
|
|
2528
|
+
var { setBreadCrumbs } = breadcrumbsSlice.actions;
|
|
2529
|
+
var breadcrums_slice_default = breadcrumbsSlice.reducer;
|
|
2530
|
+
|
|
2531
|
+
// src/store/reducers/env-slice/index.ts
|
|
2532
|
+
var import_toolkit2 = require("@reduxjs/toolkit");
|
|
2533
|
+
var initialState2 = {
|
|
2534
|
+
baseUrl: "",
|
|
2535
|
+
requests: null,
|
|
2536
|
+
companies: [],
|
|
2537
|
+
user: {},
|
|
2538
|
+
config: null,
|
|
2539
|
+
envFile: null,
|
|
2540
|
+
defaultCompany: {
|
|
2541
|
+
id: null,
|
|
2542
|
+
logo: "",
|
|
2543
|
+
secondary_color: "",
|
|
2544
|
+
primary_color: ""
|
|
2545
|
+
},
|
|
2546
|
+
context: {
|
|
2547
|
+
uid: null,
|
|
2548
|
+
allowed_company_ids: [],
|
|
2549
|
+
lang: "vi_VN",
|
|
2550
|
+
tz: "Asia/Saigon"
|
|
2551
|
+
}
|
|
2552
|
+
};
|
|
2553
|
+
var envSlice = (0, import_toolkit2.createSlice)({
|
|
2554
|
+
name: "env",
|
|
2555
|
+
initialState: initialState2,
|
|
2556
|
+
reducers: {
|
|
2557
|
+
setEnv: (state, action) => {
|
|
2558
|
+
Object.assign(state, action.payload);
|
|
2559
|
+
},
|
|
2560
|
+
setUid: (state, action) => {
|
|
2561
|
+
state.context.uid = action.payload;
|
|
2562
|
+
},
|
|
2563
|
+
setAllowCompanies: (state, action) => {
|
|
2564
|
+
state.context.allowed_company_ids = action.payload;
|
|
2565
|
+
},
|
|
2566
|
+
setCompanies: (state, action) => {
|
|
2567
|
+
state.companies = action.payload;
|
|
2568
|
+
},
|
|
2569
|
+
setDefaultCompany: (state, action) => {
|
|
2570
|
+
state.defaultCompany = action.payload;
|
|
2571
|
+
},
|
|
2572
|
+
setLang: (state, action) => {
|
|
2573
|
+
state.context.lang = action.payload;
|
|
2574
|
+
},
|
|
2575
|
+
setUser: (state, action) => {
|
|
2576
|
+
state.user = action.payload;
|
|
2577
|
+
},
|
|
2578
|
+
setConfig: (state, action) => {
|
|
2579
|
+
state.config = action.payload;
|
|
2580
|
+
},
|
|
2581
|
+
setEnvFile: (state, action) => {
|
|
2582
|
+
state.envFile = action.payload;
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
});
|
|
2586
|
+
var {
|
|
2587
|
+
setEnv,
|
|
2588
|
+
setUid,
|
|
2589
|
+
setLang,
|
|
2590
|
+
setAllowCompanies,
|
|
2591
|
+
setCompanies,
|
|
2592
|
+
setDefaultCompany,
|
|
2593
|
+
setUser,
|
|
2594
|
+
setConfig,
|
|
2595
|
+
setEnvFile
|
|
2596
|
+
} = envSlice.actions;
|
|
2597
|
+
var env_slice_default = envSlice.reducer;
|
|
2598
|
+
|
|
2599
|
+
// src/store/reducers/excel-slice/index.ts
|
|
2600
|
+
var import_toolkit3 = require("@reduxjs/toolkit");
|
|
2601
|
+
var initialState3 = {
|
|
2602
|
+
dataParse: null,
|
|
2603
|
+
idFile: null,
|
|
2604
|
+
isFileLoaded: false,
|
|
2605
|
+
loadingImport: false,
|
|
2606
|
+
selectedFile: null,
|
|
2607
|
+
errorData: null
|
|
2608
|
+
};
|
|
2609
|
+
var excelSlice = (0, import_toolkit3.createSlice)({
|
|
2610
|
+
name: "excel",
|
|
2611
|
+
initialState: initialState3,
|
|
2612
|
+
reducers: {
|
|
2613
|
+
setDataParse: (state, action) => {
|
|
2614
|
+
state.dataParse = action.payload;
|
|
2615
|
+
},
|
|
2616
|
+
setIdFile: (state, action) => {
|
|
2617
|
+
state.idFile = action.payload;
|
|
2618
|
+
},
|
|
2619
|
+
setIsFileLoaded: (state, action) => {
|
|
2620
|
+
state.isFileLoaded = action.payload;
|
|
2621
|
+
},
|
|
2622
|
+
setLoadingImport: (state, action) => {
|
|
2623
|
+
state.loadingImport = action.payload;
|
|
2624
|
+
},
|
|
2625
|
+
setSelectedFile: (state, action) => {
|
|
2626
|
+
state.selectedFile = action.payload;
|
|
2627
|
+
},
|
|
2628
|
+
setErrorData: (state, action) => {
|
|
2629
|
+
state.errorData = action.payload;
|
|
2261
2630
|
}
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2631
|
+
}
|
|
2632
|
+
});
|
|
2633
|
+
var {
|
|
2634
|
+
setDataParse,
|
|
2635
|
+
setIdFile,
|
|
2636
|
+
setIsFileLoaded,
|
|
2637
|
+
setLoadingImport,
|
|
2638
|
+
setSelectedFile,
|
|
2639
|
+
setErrorData
|
|
2640
|
+
} = excelSlice.actions;
|
|
2641
|
+
var excel_slice_default = excelSlice.reducer;
|
|
2642
|
+
|
|
2643
|
+
// src/store/reducers/form-slice/index.ts
|
|
2644
|
+
var import_toolkit4 = require("@reduxjs/toolkit");
|
|
2645
|
+
var initialState4 = {
|
|
2646
|
+
viewDataStore: {},
|
|
2647
|
+
isShowingModalDetail: false,
|
|
2648
|
+
isShowModalTranslate: false,
|
|
2649
|
+
formSubmitComponent: {},
|
|
2650
|
+
fieldTranslation: null,
|
|
2651
|
+
listSubject: {},
|
|
2652
|
+
dataUser: {}
|
|
2653
|
+
};
|
|
2654
|
+
var formSlice = (0, import_toolkit4.createSlice)({
|
|
2655
|
+
name: "form",
|
|
2656
|
+
initialState: initialState4,
|
|
2657
|
+
reducers: {
|
|
2658
|
+
setViewDataStore: (state, action) => {
|
|
2659
|
+
state.viewDataStore = action.payload;
|
|
2660
|
+
},
|
|
2661
|
+
setIsShowingModalDetail: (state, action) => {
|
|
2662
|
+
state.isShowingModalDetail = action.payload;
|
|
2663
|
+
},
|
|
2664
|
+
setIsShowModalTranslate: (state, action) => {
|
|
2665
|
+
state.isShowModalTranslate = action.payload;
|
|
2666
|
+
},
|
|
2667
|
+
setFormSubmitComponent: (state, action) => {
|
|
2668
|
+
state.formSubmitComponent[action.payload.key] = action.payload.component;
|
|
2669
|
+
},
|
|
2670
|
+
setFieldTranslate: (state, action) => {
|
|
2671
|
+
state.fieldTranslation = action.payload;
|
|
2672
|
+
},
|
|
2673
|
+
setListSubject: (state, action) => {
|
|
2674
|
+
state.listSubject = action.payload;
|
|
2675
|
+
},
|
|
2676
|
+
setDataUser: (state, action) => {
|
|
2677
|
+
state.dataUser = action.payload;
|
|
2281
2678
|
}
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2679
|
+
}
|
|
2680
|
+
});
|
|
2681
|
+
var {
|
|
2682
|
+
setViewDataStore,
|
|
2683
|
+
setIsShowingModalDetail,
|
|
2684
|
+
setIsShowModalTranslate,
|
|
2685
|
+
setFormSubmitComponent,
|
|
2686
|
+
setFieldTranslate,
|
|
2687
|
+
setListSubject,
|
|
2688
|
+
setDataUser
|
|
2689
|
+
} = formSlice.actions;
|
|
2690
|
+
var form_slice_default = formSlice.reducer;
|
|
2691
|
+
|
|
2692
|
+
// src/store/reducers/header-slice/index.ts
|
|
2693
|
+
var import_toolkit5 = require("@reduxjs/toolkit");
|
|
2694
|
+
var headerSlice = (0, import_toolkit5.createSlice)({
|
|
2695
|
+
name: "header",
|
|
2696
|
+
initialState: {
|
|
2697
|
+
value: { allowedCompanyIds: [] }
|
|
2698
|
+
},
|
|
2699
|
+
reducers: {
|
|
2700
|
+
setHeader: (state, action) => {
|
|
2701
|
+
state.value = { ...state.value, ...action.payload };
|
|
2702
|
+
},
|
|
2703
|
+
setAllowedCompanyIds: (state, action) => {
|
|
2704
|
+
state.value.allowedCompanyIds = action.payload;
|
|
2291
2705
|
}
|
|
2292
|
-
case "/":
|
|
2293
|
-
return left / right;
|
|
2294
|
-
case "%":
|
|
2295
|
-
return left % right;
|
|
2296
|
-
case "//":
|
|
2297
|
-
if (left instanceof PyTimeDelta) {
|
|
2298
|
-
return left.divide(right);
|
|
2299
|
-
}
|
|
2300
|
-
return Math.floor(left / right);
|
|
2301
|
-
case "**":
|
|
2302
|
-
return left ** right;
|
|
2303
|
-
case "==":
|
|
2304
|
-
return isEqual(left, right);
|
|
2305
|
-
case "<>":
|
|
2306
|
-
case "!=":
|
|
2307
|
-
return !isEqual(left, right);
|
|
2308
|
-
case "<":
|
|
2309
|
-
return isLess(left, right);
|
|
2310
|
-
case ">":
|
|
2311
|
-
return isLess(right, left);
|
|
2312
|
-
case ">=":
|
|
2313
|
-
return isEqual(left, right) || isLess(right, left);
|
|
2314
|
-
case "<=":
|
|
2315
|
-
return isEqual(left, right) || isLess(left, right);
|
|
2316
|
-
case "in":
|
|
2317
|
-
return isIn(left, right);
|
|
2318
|
-
case "not in":
|
|
2319
|
-
return !isIn(left, right);
|
|
2320
|
-
default:
|
|
2321
|
-
throw new EvaluationError(`Unknown binary operator: ${ast.op}`);
|
|
2322
2706
|
}
|
|
2323
|
-
}
|
|
2324
|
-
var
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2707
|
+
});
|
|
2708
|
+
var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
|
|
2709
|
+
var header_slice_default = headerSlice.reducer;
|
|
2710
|
+
|
|
2711
|
+
// src/store/reducers/list-slice/index.ts
|
|
2712
|
+
var import_toolkit6 = require("@reduxjs/toolkit");
|
|
2713
|
+
var initialState5 = {
|
|
2714
|
+
pageLimit: 10,
|
|
2715
|
+
fields: {},
|
|
2716
|
+
order: "",
|
|
2717
|
+
selectedRowKeys: [],
|
|
2718
|
+
selectedRadioKey: 0,
|
|
2719
|
+
indexRowTableModal: -2,
|
|
2720
|
+
isUpdateTableModal: false,
|
|
2721
|
+
footerGroupTable: {},
|
|
2722
|
+
transferDetail: null,
|
|
2723
|
+
page: 0,
|
|
2724
|
+
domainTable: []
|
|
2725
|
+
};
|
|
2726
|
+
var listSlice = (0, import_toolkit6.createSlice)({
|
|
2727
|
+
name: "list",
|
|
2728
|
+
initialState: initialState5,
|
|
2729
|
+
reducers: {
|
|
2730
|
+
setPageLimit: (state, action) => {
|
|
2731
|
+
state.pageLimit = action.payload;
|
|
2732
|
+
},
|
|
2733
|
+
setFields: (state, action) => {
|
|
2734
|
+
state.fields = action.payload;
|
|
2735
|
+
},
|
|
2736
|
+
setOrder: (state, action) => {
|
|
2737
|
+
state.order = action.payload;
|
|
2738
|
+
},
|
|
2739
|
+
setSelectedRowKeys: (state, action) => {
|
|
2740
|
+
state.selectedRowKeys = action.payload;
|
|
2741
|
+
},
|
|
2742
|
+
setSelectedRadioKey: (state, action) => {
|
|
2743
|
+
state.selectedRadioKey = action.payload;
|
|
2744
|
+
},
|
|
2745
|
+
setIndexRowTableModal: (state, action) => {
|
|
2746
|
+
state.indexRowTableModal = action.payload;
|
|
2747
|
+
},
|
|
2748
|
+
setTransferDetail: (state, action) => {
|
|
2749
|
+
state.transferDetail = action.payload;
|
|
2750
|
+
},
|
|
2751
|
+
setIsUpdateTableModal: (state, action) => {
|
|
2752
|
+
state.isUpdateTableModal = action.payload;
|
|
2753
|
+
},
|
|
2754
|
+
setPage: (state, action) => {
|
|
2755
|
+
state.page = action.payload;
|
|
2756
|
+
},
|
|
2757
|
+
setDomainTable: (state, action) => {
|
|
2758
|
+
state.domainTable = action.payload;
|
|
2332
2759
|
}
|
|
2333
|
-
return null;
|
|
2334
2760
|
}
|
|
2761
|
+
});
|
|
2762
|
+
var {
|
|
2763
|
+
setPageLimit,
|
|
2764
|
+
setFields,
|
|
2765
|
+
setOrder,
|
|
2766
|
+
setSelectedRowKeys,
|
|
2767
|
+
setIndexRowTableModal,
|
|
2768
|
+
setIsUpdateTableModal,
|
|
2769
|
+
setPage,
|
|
2770
|
+
setSelectedRadioKey,
|
|
2771
|
+
setTransferDetail,
|
|
2772
|
+
setDomainTable
|
|
2773
|
+
} = listSlice.actions;
|
|
2774
|
+
var list_slice_default = listSlice.reducer;
|
|
2775
|
+
|
|
2776
|
+
// src/store/reducers/login-slice/index.ts
|
|
2777
|
+
var import_toolkit7 = require("@reduxjs/toolkit");
|
|
2778
|
+
var initialState6 = {
|
|
2779
|
+
db: "",
|
|
2780
|
+
redirectTo: "/",
|
|
2781
|
+
forgotPasswordUrl: "/"
|
|
2335
2782
|
};
|
|
2336
|
-
var
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2783
|
+
var loginSlice = (0, import_toolkit7.createSlice)({
|
|
2784
|
+
name: "login",
|
|
2785
|
+
initialState: initialState6,
|
|
2786
|
+
reducers: {
|
|
2787
|
+
setDb: (state, action) => {
|
|
2788
|
+
state.db = action.payload;
|
|
2789
|
+
},
|
|
2790
|
+
setRedirectTo: (state, action) => {
|
|
2791
|
+
state.redirectTo = action.payload;
|
|
2792
|
+
},
|
|
2793
|
+
setForgotPasswordUrl: (state, action) => {
|
|
2794
|
+
state.forgotPasswordUrl = action.payload;
|
|
2795
|
+
}
|
|
2342
2796
|
}
|
|
2797
|
+
});
|
|
2798
|
+
var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
|
|
2799
|
+
var login_slice_default = loginSlice.reducer;
|
|
2800
|
+
|
|
2801
|
+
// src/store/reducers/navbar-slice/index.ts
|
|
2802
|
+
var import_toolkit8 = require("@reduxjs/toolkit");
|
|
2803
|
+
var initialState7 = {
|
|
2804
|
+
menuFocus: {},
|
|
2805
|
+
menuAction: {},
|
|
2806
|
+
navbarWidth: 250,
|
|
2807
|
+
menuList: []
|
|
2343
2808
|
};
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
)
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
const intersection = /* @__PURE__ */ new Set();
|
|
2361
|
-
for (const i of iterable) {
|
|
2362
|
-
if (this.has(i)) {
|
|
2363
|
-
intersection.add(i);
|
|
2364
|
-
}
|
|
2365
|
-
}
|
|
2366
|
-
return intersection;
|
|
2367
|
-
},
|
|
2368
|
-
this,
|
|
2369
|
-
...args
|
|
2370
|
-
);
|
|
2371
|
-
},
|
|
2372
|
-
difference(...args) {
|
|
2373
|
-
return applyFunc(
|
|
2374
|
-
"difference",
|
|
2375
|
-
(iterable) => {
|
|
2376
|
-
iterable = new Set(iterable);
|
|
2377
|
-
const difference = /* @__PURE__ */ new Set();
|
|
2378
|
-
for (const e of this) {
|
|
2379
|
-
if (!iterable.has(e)) {
|
|
2380
|
-
difference.add(e);
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2383
|
-
return difference;
|
|
2384
|
-
},
|
|
2385
|
-
this,
|
|
2386
|
-
...args
|
|
2387
|
-
);
|
|
2388
|
-
},
|
|
2389
|
-
union(...args) {
|
|
2390
|
-
return applyFunc(
|
|
2391
|
-
"union",
|
|
2392
|
-
(iterable) => {
|
|
2393
|
-
return /* @__PURE__ */ new Set([...this, ...iterable]);
|
|
2394
|
-
},
|
|
2395
|
-
this,
|
|
2396
|
-
...args
|
|
2397
|
-
);
|
|
2809
|
+
var navbarSlice = (0, import_toolkit8.createSlice)({
|
|
2810
|
+
name: "navbar",
|
|
2811
|
+
initialState: initialState7,
|
|
2812
|
+
reducers: {
|
|
2813
|
+
setMenuFocus: (state, action) => {
|
|
2814
|
+
state.menuFocus = action.payload;
|
|
2815
|
+
},
|
|
2816
|
+
setMenuFocusAction: (state, action) => {
|
|
2817
|
+
state.menuAction = action.payload;
|
|
2818
|
+
},
|
|
2819
|
+
setNavbarWidth: (state, action) => {
|
|
2820
|
+
state.navbarWidth = action.payload;
|
|
2821
|
+
},
|
|
2822
|
+
setMenuList: (state, action) => {
|
|
2823
|
+
state.menuList = action.payload;
|
|
2824
|
+
}
|
|
2398
2825
|
}
|
|
2826
|
+
});
|
|
2827
|
+
var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSlice.actions;
|
|
2828
|
+
var navbar_slice_default = navbarSlice.reducer;
|
|
2829
|
+
|
|
2830
|
+
// src/store/reducers/profile-slice/index.ts
|
|
2831
|
+
var import_toolkit9 = require("@reduxjs/toolkit");
|
|
2832
|
+
var initialState8 = {
|
|
2833
|
+
profile: {}
|
|
2399
2834
|
};
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
BUILTINS.set,
|
|
2408
|
-
BUILTINS.bool,
|
|
2409
|
-
BUILTINS.context_today,
|
|
2410
|
-
BUILTINS.datetime.datetime.now,
|
|
2411
|
-
BUILTINS.datetime.datetime.combine,
|
|
2412
|
-
BUILTINS.datetime.date.today,
|
|
2413
|
-
...methods(BUILTINS.relativedelta),
|
|
2414
|
-
...Object.values(BUILTINS.datetime).flatMap((obj) => methods(obj)),
|
|
2415
|
-
...Object.values(SET),
|
|
2416
|
-
...Object.values(DICT),
|
|
2417
|
-
...Object.values(STRING)
|
|
2418
|
-
]);
|
|
2419
|
-
var unboundFn = Symbol("unbound function");
|
|
2420
|
-
function evaluate(ast, context = {}) {
|
|
2421
|
-
const dicts = /* @__PURE__ */ new Set();
|
|
2422
|
-
let pyContext;
|
|
2423
|
-
const evalContext = Object.create(context);
|
|
2424
|
-
if (!evalContext?.context) {
|
|
2425
|
-
Object.defineProperty(evalContext, "context", {
|
|
2426
|
-
get() {
|
|
2427
|
-
if (!pyContext) {
|
|
2428
|
-
pyContext = toPyDict(context);
|
|
2429
|
-
}
|
|
2430
|
-
return pyContext;
|
|
2431
|
-
}
|
|
2432
|
-
});
|
|
2835
|
+
var profileSlice = (0, import_toolkit9.createSlice)({
|
|
2836
|
+
name: "profile",
|
|
2837
|
+
initialState: initialState8,
|
|
2838
|
+
reducers: {
|
|
2839
|
+
setProfile: (state, action) => {
|
|
2840
|
+
state.profile = action.payload;
|
|
2841
|
+
}
|
|
2433
2842
|
}
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
return _evaluate(ast2.ifFalse);
|
|
2497
|
-
}
|
|
2498
|
-
case 15:
|
|
2499
|
-
let leftVal = _evaluate(ast2.obj);
|
|
2500
|
-
let result;
|
|
2501
|
-
if (dicts.has(leftVal) || Object.isPrototypeOf.call(PY_DICT, leftVal)) {
|
|
2502
|
-
result = DICT[ast2.key];
|
|
2503
|
-
} else if (typeof leftVal === "string") {
|
|
2504
|
-
result = STRING[ast2.key];
|
|
2505
|
-
} else if (leftVal instanceof Set) {
|
|
2506
|
-
result = SET[ast2.key];
|
|
2507
|
-
} else if (ast2.key === "get" && typeof leftVal === "object") {
|
|
2508
|
-
result = DICT[ast2.key];
|
|
2509
|
-
leftVal = toPyDict(leftVal);
|
|
2843
|
+
});
|
|
2844
|
+
var { setProfile } = profileSlice.actions;
|
|
2845
|
+
var profile_slice_default = profileSlice.reducer;
|
|
2846
|
+
|
|
2847
|
+
// src/store/reducers/search-slice/index.ts
|
|
2848
|
+
var import_toolkit10 = require("@reduxjs/toolkit");
|
|
2849
|
+
var initialState9 = {
|
|
2850
|
+
groupByDomain: null,
|
|
2851
|
+
searchBy: [],
|
|
2852
|
+
searchString: "",
|
|
2853
|
+
hoveredIndexSearchList: null,
|
|
2854
|
+
selectedTags: [],
|
|
2855
|
+
firstDomain: null,
|
|
2856
|
+
searchMap: {},
|
|
2857
|
+
filterBy: [],
|
|
2858
|
+
groupBy: []
|
|
2859
|
+
};
|
|
2860
|
+
var searchSlice = (0, import_toolkit10.createSlice)({
|
|
2861
|
+
name: "search",
|
|
2862
|
+
initialState: initialState9,
|
|
2863
|
+
reducers: {
|
|
2864
|
+
setGroupByDomain: (state, action) => {
|
|
2865
|
+
state.groupByDomain = action.payload;
|
|
2866
|
+
},
|
|
2867
|
+
setSearchBy: (state, action) => {
|
|
2868
|
+
state.searchBy = action.payload;
|
|
2869
|
+
},
|
|
2870
|
+
setSearchString: (state, action) => {
|
|
2871
|
+
state.searchString = action.payload;
|
|
2872
|
+
},
|
|
2873
|
+
setHoveredIndexSearchList: (state, action) => {
|
|
2874
|
+
state.hoveredIndexSearchList = action.payload;
|
|
2875
|
+
},
|
|
2876
|
+
setSelectedTags: (state, action) => {
|
|
2877
|
+
state.selectedTags = action.payload;
|
|
2878
|
+
},
|
|
2879
|
+
setFirstDomain: (state, action) => {
|
|
2880
|
+
state.firstDomain = action.payload;
|
|
2881
|
+
},
|
|
2882
|
+
setFilterBy: (state, action) => {
|
|
2883
|
+
state.filterBy = action.payload;
|
|
2884
|
+
},
|
|
2885
|
+
setGroupBy: (state, action) => {
|
|
2886
|
+
state.groupBy = action.payload;
|
|
2887
|
+
},
|
|
2888
|
+
setSearchMap: (state, action) => {
|
|
2889
|
+
state.searchMap = action.payload;
|
|
2890
|
+
},
|
|
2891
|
+
updateSearchMap: (state, action) => {
|
|
2892
|
+
if (!state.searchMap[action.payload.key]) {
|
|
2893
|
+
state.searchMap[action.payload.key] = [];
|
|
2894
|
+
}
|
|
2895
|
+
state.searchMap[action.payload.key].push(action.payload.value);
|
|
2896
|
+
},
|
|
2897
|
+
removeKeyFromSearchMap: (state, action) => {
|
|
2898
|
+
const { key, item } = action.payload;
|
|
2899
|
+
const values = state.searchMap[key];
|
|
2900
|
+
if (!values) return;
|
|
2901
|
+
if (item) {
|
|
2902
|
+
const filtered = values.filter((value) => value.name !== item.name);
|
|
2903
|
+
if (filtered.length > 0) {
|
|
2904
|
+
state.searchMap[key] = filtered;
|
|
2510
2905
|
} else {
|
|
2511
|
-
|
|
2512
|
-
}
|
|
2513
|
-
if (typeof result === "function") {
|
|
2514
|
-
const bound = result.bind(leftVal);
|
|
2515
|
-
bound[unboundFn] = result;
|
|
2516
|
-
return bound;
|
|
2906
|
+
delete state.searchMap[key];
|
|
2517
2907
|
}
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
}
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
const val = _innerEvaluate(ast2);
|
|
2525
|
-
if (typeof val === "function" && !allowedFns.has(val) && !allowedFns.has(val[unboundFn])) {
|
|
2526
|
-
throw new Error("Invalid Function Call");
|
|
2908
|
+
} else {
|
|
2909
|
+
delete state.searchMap[key];
|
|
2910
|
+
}
|
|
2911
|
+
},
|
|
2912
|
+
clearSearchMap: (state) => {
|
|
2913
|
+
state.searchMap = {};
|
|
2527
2914
|
}
|
|
2528
|
-
return val;
|
|
2529
|
-
}
|
|
2530
|
-
return _evaluate(ast);
|
|
2531
|
-
}
|
|
2532
|
-
|
|
2533
|
-
// src/utils/domain/py.ts
|
|
2534
|
-
function parseExpr(expr) {
|
|
2535
|
-
const tokens = tokenize(expr);
|
|
2536
|
-
return parse(tokens);
|
|
2537
|
-
}
|
|
2538
|
-
|
|
2539
|
-
// src/utils/domain/objects.ts
|
|
2540
|
-
function shallowEqual(obj1, obj2, comparisonFn = (a, b) => a === b) {
|
|
2541
|
-
if (!obj1 || !obj2 || typeof obj1 !== "object" || typeof obj2 !== "object") {
|
|
2542
|
-
return obj1 === obj2;
|
|
2543
2915
|
}
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2916
|
+
});
|
|
2917
|
+
var {
|
|
2918
|
+
setGroupByDomain,
|
|
2919
|
+
setSelectedTags,
|
|
2920
|
+
setSearchString,
|
|
2921
|
+
setHoveredIndexSearchList,
|
|
2922
|
+
setFirstDomain,
|
|
2923
|
+
setSearchBy,
|
|
2924
|
+
setFilterBy,
|
|
2925
|
+
setSearchMap,
|
|
2926
|
+
updateSearchMap,
|
|
2927
|
+
removeKeyFromSearchMap,
|
|
2928
|
+
setGroupBy,
|
|
2929
|
+
clearSearchMap
|
|
2930
|
+
} = searchSlice.actions;
|
|
2931
|
+
var search_slice_default = searchSlice.reducer;
|
|
2547
2932
|
|
|
2548
|
-
// src/
|
|
2549
|
-
var
|
|
2933
|
+
// src/store/store.ts
|
|
2934
|
+
var import_toolkit11 = require("@reduxjs/toolkit");
|
|
2550
2935
|
|
|
2551
|
-
//
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2936
|
+
// node_modules/redux/dist/redux.mjs
|
|
2937
|
+
function formatProdErrorMessage(code) {
|
|
2938
|
+
return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
|
|
2555
2939
|
}
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2940
|
+
var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
|
|
2941
|
+
var ActionTypes = {
|
|
2942
|
+
INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
|
|
2943
|
+
REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
|
|
2944
|
+
PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
|
|
2559
2945
|
};
|
|
2560
|
-
var
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
}
|
|
2568
|
-
const domain1 = domains[0] instanceof _Domain ? domains[0] : new _Domain(domains[0]);
|
|
2569
|
-
if (domains.length === 1) {
|
|
2570
|
-
return domain1;
|
|
2571
|
-
}
|
|
2572
|
-
const domain2 = _Domain.combine(domains.slice(1), operator);
|
|
2573
|
-
const result = new _Domain([]);
|
|
2574
|
-
const astValues1 = domain1.ast.value;
|
|
2575
|
-
const astValues2 = domain2.ast.value;
|
|
2576
|
-
const op = operator === "AND" ? "&" : "|";
|
|
2577
|
-
const combinedAST = {
|
|
2578
|
-
type: 4,
|
|
2579
|
-
value: astValues1.concat(astValues2)
|
|
2580
|
-
};
|
|
2581
|
-
result.ast = normalizeDomainAST(combinedAST, op);
|
|
2582
|
-
return result;
|
|
2946
|
+
var actionTypes_default = ActionTypes;
|
|
2947
|
+
function isPlainObject(obj) {
|
|
2948
|
+
if (typeof obj !== "object" || obj === null)
|
|
2949
|
+
return false;
|
|
2950
|
+
let proto = obj;
|
|
2951
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
2952
|
+
proto = Object.getPrototypeOf(proto);
|
|
2583
2953
|
}
|
|
2584
|
-
|
|
2585
|
-
|
|
2954
|
+
return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
|
|
2955
|
+
}
|
|
2956
|
+
function miniKindOf(val) {
|
|
2957
|
+
if (val === void 0)
|
|
2958
|
+
return "undefined";
|
|
2959
|
+
if (val === null)
|
|
2960
|
+
return "null";
|
|
2961
|
+
const type = typeof val;
|
|
2962
|
+
switch (type) {
|
|
2963
|
+
case "boolean":
|
|
2964
|
+
case "string":
|
|
2965
|
+
case "number":
|
|
2966
|
+
case "symbol":
|
|
2967
|
+
case "function": {
|
|
2968
|
+
return type;
|
|
2969
|
+
}
|
|
2586
2970
|
}
|
|
2587
|
-
|
|
2588
|
-
return
|
|
2971
|
+
if (Array.isArray(val))
|
|
2972
|
+
return "array";
|
|
2973
|
+
if (isDate(val))
|
|
2974
|
+
return "date";
|
|
2975
|
+
if (isError(val))
|
|
2976
|
+
return "error";
|
|
2977
|
+
const constructorName = ctorName(val);
|
|
2978
|
+
switch (constructorName) {
|
|
2979
|
+
case "Symbol":
|
|
2980
|
+
case "Promise":
|
|
2981
|
+
case "WeakMap":
|
|
2982
|
+
case "WeakSet":
|
|
2983
|
+
case "Map":
|
|
2984
|
+
case "Set":
|
|
2985
|
+
return constructorName;
|
|
2589
2986
|
}
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2987
|
+
return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, "");
|
|
2988
|
+
}
|
|
2989
|
+
function ctorName(val) {
|
|
2990
|
+
return typeof val.constructor === "function" ? val.constructor.name : null;
|
|
2991
|
+
}
|
|
2992
|
+
function isError(val) {
|
|
2993
|
+
return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
|
|
2994
|
+
}
|
|
2995
|
+
function isDate(val) {
|
|
2996
|
+
if (val instanceof Date)
|
|
2997
|
+
return true;
|
|
2998
|
+
return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
|
|
2999
|
+
}
|
|
3000
|
+
function kindOf(val) {
|
|
3001
|
+
let typeOfVal = typeof val;
|
|
3002
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3003
|
+
typeOfVal = miniKindOf(val);
|
|
2594
3004
|
}
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
if (operatorCtx === "&") {
|
|
2601
|
-
newDomain2.ast.value.push(..._Domain.TRUE.ast.value);
|
|
2602
|
-
} else if (operatorCtx === "|") {
|
|
2603
|
-
newDomain2.ast.value.push(..._Domain.FALSE.ast.value);
|
|
2604
|
-
}
|
|
2605
|
-
} else {
|
|
2606
|
-
newDomain2.ast.value.push(leaf);
|
|
2607
|
-
}
|
|
2608
|
-
return 1;
|
|
2609
|
-
} else if (leaf.type === 1) {
|
|
2610
|
-
if (leaf.value === "|" && elements[idx + 1].type === 10 && elements[idx + 2].type === 10 && keysToRemove.includes(elements[idx + 1].value[0].value) && keysToRemove.includes(elements[idx + 2].value[0].value)) {
|
|
2611
|
-
newDomain2.ast.value.push(..._Domain.TRUE.ast.value);
|
|
2612
|
-
return 3;
|
|
2613
|
-
}
|
|
2614
|
-
newDomain2.ast.value.push(leaf);
|
|
2615
|
-
if (leaf.value === "!") {
|
|
2616
|
-
return 1 + processLeaf(elements, idx + 1, "&", newDomain2);
|
|
2617
|
-
}
|
|
2618
|
-
const firstLeafSkip = processLeaf(
|
|
2619
|
-
elements,
|
|
2620
|
-
idx + 1,
|
|
2621
|
-
leaf.value,
|
|
2622
|
-
newDomain2
|
|
2623
|
-
);
|
|
2624
|
-
const secondLeafSkip = processLeaf(
|
|
2625
|
-
elements,
|
|
2626
|
-
idx + 1 + firstLeafSkip,
|
|
2627
|
-
leaf.value,
|
|
2628
|
-
newDomain2
|
|
2629
|
-
);
|
|
2630
|
-
return 1 + firstLeafSkip + secondLeafSkip;
|
|
2631
|
-
}
|
|
2632
|
-
return 0;
|
|
2633
|
-
}
|
|
2634
|
-
const d = new _Domain(domain);
|
|
2635
|
-
if (d.ast.value.length === 0) {
|
|
2636
|
-
return d;
|
|
2637
|
-
}
|
|
2638
|
-
const newDomain = new _Domain([]);
|
|
2639
|
-
processLeaf(d.ast.value, 0, "&", newDomain);
|
|
2640
|
-
return newDomain;
|
|
3005
|
+
return typeOfVal;
|
|
3006
|
+
}
|
|
3007
|
+
function warning(message) {
|
|
3008
|
+
if (typeof console !== "undefined" && typeof console.error === "function") {
|
|
3009
|
+
console.error(message);
|
|
2641
3010
|
}
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
} else {
|
|
2646
|
-
let rawAST;
|
|
2647
|
-
try {
|
|
2648
|
-
rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
|
|
2649
|
-
} catch (error) {
|
|
2650
|
-
throw new InvalidDomainError(
|
|
2651
|
-
`Invalid domain representation: ${descr}`,
|
|
2652
|
-
{
|
|
2653
|
-
cause: error
|
|
2654
|
-
}
|
|
2655
|
-
);
|
|
2656
|
-
}
|
|
2657
|
-
this.ast = normalizeDomainAST(rawAST);
|
|
2658
|
-
}
|
|
3011
|
+
try {
|
|
3012
|
+
throw new Error(message);
|
|
3013
|
+
} catch (e) {
|
|
2659
3014
|
}
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
3015
|
+
}
|
|
3016
|
+
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
|
3017
|
+
const reducerKeys = Object.keys(reducers);
|
|
3018
|
+
const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
|
|
3019
|
+
if (reducerKeys.length === 0) {
|
|
3020
|
+
return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
|
|
2663
3021
|
}
|
|
2664
|
-
|
|
2665
|
-
return
|
|
3022
|
+
if (!isPlainObject(inputState)) {
|
|
3023
|
+
return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`;
|
|
2666
3024
|
}
|
|
2667
|
-
|
|
2668
|
-
|
|
3025
|
+
const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);
|
|
3026
|
+
unexpectedKeys.forEach((key) => {
|
|
3027
|
+
unexpectedKeyCache[key] = true;
|
|
3028
|
+
});
|
|
3029
|
+
if (action && action.type === actionTypes_default.REPLACE)
|
|
3030
|
+
return;
|
|
3031
|
+
if (unexpectedKeys.length > 0) {
|
|
3032
|
+
return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`;
|
|
2669
3033
|
}
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
return this.toString();
|
|
3034
|
+
}
|
|
3035
|
+
function assertReducerShape(reducers) {
|
|
3036
|
+
Object.keys(reducers).forEach((key) => {
|
|
3037
|
+
const reducer = reducers[key];
|
|
3038
|
+
const initialState10 = reducer(void 0, {
|
|
3039
|
+
type: actionTypes_default.INIT
|
|
3040
|
+
});
|
|
3041
|
+
if (typeof initialState10 === "undefined") {
|
|
3042
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : `The slice reducer for key "${key}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
|
|
2680
3043
|
}
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
var TRUE_DOMAIN = new Domain([TRUE_LEAF]);
|
|
2686
|
-
var FALSE_DOMAIN = new Domain([FALSE_LEAF]);
|
|
2687
|
-
Domain.TRUE = TRUE_DOMAIN;
|
|
2688
|
-
Domain.FALSE = FALSE_DOMAIN;
|
|
2689
|
-
function toAST(domain) {
|
|
2690
|
-
const elems = domain.map((elem) => {
|
|
2691
|
-
switch (elem) {
|
|
2692
|
-
case "!":
|
|
2693
|
-
case "&":
|
|
2694
|
-
case "|":
|
|
2695
|
-
return { type: 1, value: elem };
|
|
2696
|
-
default:
|
|
2697
|
-
return {
|
|
2698
|
-
type: 10,
|
|
2699
|
-
value: elem.map(toPyValue)
|
|
2700
|
-
};
|
|
3044
|
+
if (typeof reducer(void 0, {
|
|
3045
|
+
type: actionTypes_default.PROBE_UNKNOWN_ACTION()
|
|
3046
|
+
}) === "undefined") {
|
|
3047
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : `The slice reducer for key "${key}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);
|
|
2701
3048
|
}
|
|
2702
3049
|
});
|
|
2703
|
-
return { type: 4, value: elems };
|
|
2704
3050
|
}
|
|
2705
|
-
function
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
3051
|
+
function combineReducers(reducers) {
|
|
3052
|
+
const reducerKeys = Object.keys(reducers);
|
|
3053
|
+
const finalReducers = {};
|
|
3054
|
+
for (let i = 0; i < reducerKeys.length; i++) {
|
|
3055
|
+
const key = reducerKeys[i];
|
|
3056
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3057
|
+
if (typeof reducers[key] === "undefined") {
|
|
3058
|
+
warning(`No reducer provided for key "${key}"`);
|
|
2711
3059
|
}
|
|
2712
|
-
} else {
|
|
2713
|
-
throw new InvalidDomainError("Invalid domain AST");
|
|
2714
3060
|
}
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
return domain;
|
|
2718
|
-
}
|
|
2719
|
-
let expected = 1;
|
|
2720
|
-
for (const child of domain.value) {
|
|
2721
|
-
switch (child.type) {
|
|
2722
|
-
case 1:
|
|
2723
|
-
if (child.value === "&" || child.value === "|") {
|
|
2724
|
-
expected++;
|
|
2725
|
-
} else if (child.value !== "!") {
|
|
2726
|
-
throw new InvalidDomainError("Invalid domain AST");
|
|
2727
|
-
}
|
|
2728
|
-
break;
|
|
2729
|
-
case 4:
|
|
2730
|
-
/* list */
|
|
2731
|
-
case 10:
|
|
2732
|
-
if (child.value.length === 3) {
|
|
2733
|
-
expected--;
|
|
2734
|
-
break;
|
|
2735
|
-
}
|
|
2736
|
-
throw new InvalidDomainError("Invalid domain AST");
|
|
2737
|
-
default:
|
|
2738
|
-
throw new InvalidDomainError("Invalid domain AST");
|
|
3061
|
+
if (typeof reducers[key] === "function") {
|
|
3062
|
+
finalReducers[key] = reducers[key];
|
|
2739
3063
|
}
|
|
2740
3064
|
}
|
|
2741
|
-
const
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
}
|
|
2746
|
-
if (expected > 0) {
|
|
2747
|
-
throw new InvalidDomainError(
|
|
2748
|
-
`invalid domain ${formatAST(domain)} (missing ${expected} segment(s))`
|
|
2749
|
-
);
|
|
3065
|
+
const finalReducerKeys = Object.keys(finalReducers);
|
|
3066
|
+
let unexpectedKeyCache;
|
|
3067
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3068
|
+
unexpectedKeyCache = {};
|
|
2750
3069
|
}
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
3070
|
+
let shapeAssertionError;
|
|
3071
|
+
try {
|
|
3072
|
+
assertReducerShape(finalReducers);
|
|
3073
|
+
} catch (e) {
|
|
3074
|
+
shapeAssertionError = e;
|
|
2756
3075
|
}
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
if (names.length >= 2) {
|
|
2761
|
-
return matchCondition(record[names[0]], [
|
|
2762
|
-
names.slice(1).join("."),
|
|
2763
|
-
operator,
|
|
2764
|
-
value
|
|
2765
|
-
]);
|
|
3076
|
+
return function combination(state = {}, action) {
|
|
3077
|
+
if (shapeAssertionError) {
|
|
3078
|
+
throw shapeAssertionError;
|
|
2766
3079
|
}
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
`(.*)${escapeRegExp(value).replaceAll("%", "(.*)")}(.*)`,
|
|
2772
|
-
"g"
|
|
2773
|
-
);
|
|
2774
|
-
ilikeRegexp = new RegExp(
|
|
2775
|
-
`(.*)${escapeRegExp(value).replaceAll("%", "(.*)")}(.*)`,
|
|
2776
|
-
"gi"
|
|
2777
|
-
);
|
|
2778
|
-
}
|
|
2779
|
-
const fieldValue = typeof field === "number" ? field : record[field];
|
|
2780
|
-
switch (operator) {
|
|
2781
|
-
case "=?":
|
|
2782
|
-
if ([false, null].includes(value)) {
|
|
2783
|
-
return true;
|
|
2784
|
-
}
|
|
2785
|
-
// eslint-disable-next-line no-fallthrough
|
|
2786
|
-
case "=":
|
|
2787
|
-
case "==":
|
|
2788
|
-
if (Array.isArray(fieldValue) && Array.isArray(value)) {
|
|
2789
|
-
return shallowEqual2(fieldValue, value);
|
|
3080
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3081
|
+
const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
|
3082
|
+
if (warningMessage) {
|
|
3083
|
+
warning(warningMessage);
|
|
2790
3084
|
}
|
|
2791
|
-
return fieldValue === value;
|
|
2792
|
-
case "!=":
|
|
2793
|
-
case "<>":
|
|
2794
|
-
return !matchCondition(record, [field, "==", value]);
|
|
2795
|
-
case "<":
|
|
2796
|
-
return fieldValue < value;
|
|
2797
|
-
case "<=":
|
|
2798
|
-
return fieldValue <= value;
|
|
2799
|
-
case ">":
|
|
2800
|
-
return fieldValue > value;
|
|
2801
|
-
case ">=":
|
|
2802
|
-
return fieldValue >= value;
|
|
2803
|
-
case "in": {
|
|
2804
|
-
const val = Array.isArray(value) ? value : [value];
|
|
2805
|
-
const fieldVal = Array.isArray(fieldValue) ? fieldValue : [fieldValue];
|
|
2806
|
-
return fieldVal.some((fv) => val.includes(fv));
|
|
2807
3085
|
}
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
case "not like":
|
|
2819
|
-
if (fieldValue === false) {
|
|
2820
|
-
return false;
|
|
2821
|
-
}
|
|
2822
|
-
return Boolean(!fieldValue.match(likeRegexp));
|
|
2823
|
-
case "=like":
|
|
2824
|
-
if (fieldValue === false) {
|
|
2825
|
-
return false;
|
|
2826
|
-
}
|
|
2827
|
-
return new RegExp(escapeRegExp(value).replace(/%/g, ".*")).test(
|
|
2828
|
-
fieldValue
|
|
2829
|
-
);
|
|
2830
|
-
case "ilike":
|
|
2831
|
-
if (fieldValue === false) {
|
|
2832
|
-
return false;
|
|
2833
|
-
}
|
|
2834
|
-
return Boolean(fieldValue.match(ilikeRegexp));
|
|
2835
|
-
case "not ilike":
|
|
2836
|
-
if (fieldValue === false) {
|
|
2837
|
-
return false;
|
|
2838
|
-
}
|
|
2839
|
-
return Boolean(!fieldValue.match(ilikeRegexp));
|
|
2840
|
-
case "=ilike":
|
|
2841
|
-
if (fieldValue === false) {
|
|
2842
|
-
return false;
|
|
3086
|
+
let hasChanged = false;
|
|
3087
|
+
const nextState = {};
|
|
3088
|
+
for (let i = 0; i < finalReducerKeys.length; i++) {
|
|
3089
|
+
const key = finalReducerKeys[i];
|
|
3090
|
+
const reducer = finalReducers[key];
|
|
3091
|
+
const previousStateForKey = state[key];
|
|
3092
|
+
const nextStateForKey = reducer(previousStateForKey, action);
|
|
3093
|
+
if (typeof nextStateForKey === "undefined") {
|
|
3094
|
+
const actionType = action && action.type;
|
|
3095
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `"${String(actionType)}"` : "(unknown type)"}, the slice reducer for key "${key}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);
|
|
2843
3096
|
}
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
);
|
|
2847
|
-
}
|
|
2848
|
-
throw new InvalidDomainError("could not match domain");
|
|
2849
|
-
}
|
|
2850
|
-
function makeOperators(record) {
|
|
2851
|
-
const match = matchCondition.bind(null, record);
|
|
2852
|
-
return {
|
|
2853
|
-
"!": (x) => !match(x),
|
|
2854
|
-
"&": (a, b) => match(a) && match(b),
|
|
2855
|
-
"|": (a, b) => match(a) || match(b)
|
|
2856
|
-
};
|
|
2857
|
-
}
|
|
2858
|
-
function matchDomain(record, domain) {
|
|
2859
|
-
if (domain.length === 0) {
|
|
2860
|
-
return true;
|
|
2861
|
-
}
|
|
2862
|
-
const operators = makeOperators(record);
|
|
2863
|
-
const reversedDomain = Array.from(domain).reverse();
|
|
2864
|
-
const condStack = [];
|
|
2865
|
-
for (const item of reversedDomain) {
|
|
2866
|
-
const operator = typeof item === "string" && operators[item];
|
|
2867
|
-
if (operator) {
|
|
2868
|
-
const operands = condStack.splice(-operator.length);
|
|
2869
|
-
condStack.push(operator(...operands));
|
|
2870
|
-
} else {
|
|
2871
|
-
condStack.push(item);
|
|
3097
|
+
nextState[key] = nextStateForKey;
|
|
3098
|
+
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
|
2872
3099
|
}
|
|
2873
|
-
|
|
2874
|
-
|
|
3100
|
+
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
|
|
3101
|
+
return hasChanged ? nextState : state;
|
|
3102
|
+
};
|
|
2875
3103
|
}
|
|
2876
3104
|
|
|
2877
|
-
// src/
|
|
2878
|
-
var
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
return false;
|
|
2897
|
-
}
|
|
2898
|
-
};
|
|
3105
|
+
// src/store/store.ts
|
|
3106
|
+
var rootReducer = combineReducers({
|
|
3107
|
+
env: env_slice_default,
|
|
3108
|
+
header: header_slice_default,
|
|
3109
|
+
navbar: navbar_slice_default,
|
|
3110
|
+
list: list_slice_default,
|
|
3111
|
+
search: search_slice_default,
|
|
3112
|
+
form: form_slice_default,
|
|
3113
|
+
breadcrumbs: breadcrums_slice_default,
|
|
3114
|
+
login: login_slice_default,
|
|
3115
|
+
excel: excel_slice_default,
|
|
3116
|
+
profile: profile_slice_default
|
|
3117
|
+
});
|
|
3118
|
+
var envStore = (0, import_toolkit11.configureStore)({
|
|
3119
|
+
reducer: rootReducer,
|
|
3120
|
+
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
3121
|
+
serializableCheck: false
|
|
3122
|
+
})
|
|
3123
|
+
});
|
|
2899
3124
|
|
|
2900
3125
|
// src/environment/EnvStore.ts
|
|
2901
|
-
var
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
3126
|
+
var EnvStore = class _EnvStore {
|
|
3127
|
+
static instance = null;
|
|
3128
|
+
static localStorageUtils;
|
|
3129
|
+
static sessionStorageUtils;
|
|
3130
|
+
constructor() {
|
|
3131
|
+
}
|
|
3132
|
+
static getInstance(localStorageUtils2, sessionStorageUtils2) {
|
|
3133
|
+
if (!_EnvStore.instance) {
|
|
3134
|
+
console.log("Creating new EnvStore instance");
|
|
3135
|
+
_EnvStore.instance = new _EnvStore();
|
|
3136
|
+
_EnvStore.localStorageUtils = localStorageUtils2;
|
|
3137
|
+
_EnvStore.sessionStorageUtils = sessionStorageUtils2;
|
|
3138
|
+
} else {
|
|
3139
|
+
console.log("Returning existing EnvStore instance");
|
|
3140
|
+
}
|
|
3141
|
+
return _EnvStore.instance;
|
|
3142
|
+
}
|
|
3143
|
+
static getState() {
|
|
3144
|
+
const state = envStore.getState().env;
|
|
3145
|
+
console.log("Redux env state:", state);
|
|
3146
|
+
return {
|
|
3147
|
+
baseUrl: state?.baseUrl,
|
|
3148
|
+
requests: state?.requests,
|
|
3149
|
+
context: state?.context,
|
|
3150
|
+
defaultCompany: state?.defaultCompany,
|
|
3151
|
+
config: state?.config,
|
|
3152
|
+
companies: state?.companies || [],
|
|
3153
|
+
user: state?.user,
|
|
3154
|
+
db: state?.db,
|
|
3155
|
+
refreshTokenEndpoint: state?.refreshTokenEndpoint,
|
|
3156
|
+
uid: state?.uid,
|
|
3157
|
+
lang: state?.lang,
|
|
3158
|
+
allowCompanies: state?.allowCompanies
|
|
3159
|
+
};
|
|
3160
|
+
}
|
|
3161
|
+
static setupEnv(envConfig) {
|
|
3162
|
+
const dispatch = envStore.dispatch;
|
|
3163
|
+
const env = {
|
|
3164
|
+
..._EnvStore.getState(),
|
|
3165
|
+
...envConfig,
|
|
3166
|
+
localStorageUtils: _EnvStore.localStorageUtils,
|
|
3167
|
+
sessionStorageUtils: _EnvStore.sessionStorageUtils
|
|
3168
|
+
};
|
|
3169
|
+
console.log("Setting up env with config:", envConfig);
|
|
3170
|
+
const requests = axiosClient.init(env);
|
|
3171
|
+
console.log("axiosClient.init result:", requests);
|
|
3172
|
+
dispatch(setEnv({ ...env, requests }));
|
|
3173
|
+
}
|
|
3174
|
+
static setUid(uid) {
|
|
3175
|
+
const dispatch = envStore.dispatch;
|
|
3176
|
+
dispatch(setUid(uid));
|
|
3177
|
+
}
|
|
3178
|
+
static setLang(lang) {
|
|
3179
|
+
const dispatch = envStore.dispatch;
|
|
3180
|
+
dispatch(setLang(lang));
|
|
3181
|
+
}
|
|
3182
|
+
static setAllowCompanies(allowCompanies) {
|
|
3183
|
+
const dispatch = envStore.dispatch;
|
|
3184
|
+
dispatch(setAllowCompanies(allowCompanies));
|
|
3185
|
+
}
|
|
3186
|
+
static setCompanies(companies) {
|
|
3187
|
+
const dispatch = envStore.dispatch;
|
|
3188
|
+
dispatch(setCompanies(companies));
|
|
3189
|
+
}
|
|
3190
|
+
static setDefaultCompany(company) {
|
|
3191
|
+
const dispatch = envStore.dispatch;
|
|
3192
|
+
dispatch(setDefaultCompany(company));
|
|
3193
|
+
}
|
|
3194
|
+
static setUserInfo(userInfo) {
|
|
3195
|
+
const dispatch = envStore.dispatch;
|
|
3196
|
+
dispatch(setUser(userInfo));
|
|
3197
|
+
}
|
|
2908
3198
|
};
|
|
2909
3199
|
function getEnv() {
|
|
2910
|
-
|
|
2911
|
-
return { ...env, requests };
|
|
3200
|
+
return EnvStore.getState();
|
|
2912
3201
|
}
|
|
2913
3202
|
|
|
2914
3203
|
// src/services/action-service/index.ts
|
|
@@ -3076,7 +3365,7 @@ var AuthService = {
|
|
|
3076
3365
|
}).filter(([_, value]) => !!value)
|
|
3077
3366
|
);
|
|
3078
3367
|
const encodedData = new URLSearchParams(payload).toString();
|
|
3079
|
-
return env?.requests?.post(body
|
|
3368
|
+
return env?.requests?.post(body.path, encodedData, {
|
|
3080
3369
|
headers: {
|
|
3081
3370
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
3082
3371
|
}
|
|
@@ -3173,20 +3462,6 @@ var AuthService = {
|
|
|
3173
3462
|
}
|
|
3174
3463
|
});
|
|
3175
3464
|
},
|
|
3176
|
-
async isValidActionToken(actionToken, path) {
|
|
3177
|
-
const env = getEnv();
|
|
3178
|
-
return env?.requests?.post(
|
|
3179
|
-
path,
|
|
3180
|
-
{},
|
|
3181
|
-
{
|
|
3182
|
-
headers: {
|
|
3183
|
-
"Content-Type": "application/json"
|
|
3184
|
-
},
|
|
3185
|
-
useActionToken: true,
|
|
3186
|
-
actionToken
|
|
3187
|
-
}
|
|
3188
|
-
);
|
|
3189
|
-
},
|
|
3190
3465
|
async loginSocial({
|
|
3191
3466
|
db,
|
|
3192
3467
|
state,
|
|
@@ -3951,7 +4226,7 @@ var model_service_default = ModelService;
|
|
|
3951
4226
|
var UserService = {
|
|
3952
4227
|
async getProfile(path) {
|
|
3953
4228
|
const env = getEnv();
|
|
3954
|
-
return env
|
|
4229
|
+
return env.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
|
|
3955
4230
|
headers: {
|
|
3956
4231
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
3957
4232
|
}
|
|
@@ -4270,7 +4545,8 @@ var ViewService = {
|
|
|
4270
4545
|
},
|
|
4271
4546
|
async getVersion() {
|
|
4272
4547
|
const env = getEnv();
|
|
4273
|
-
|
|
4548
|
+
console.log("env?.requests", env, env?.requests);
|
|
4549
|
+
return env?.requests?.get("", {
|
|
4274
4550
|
headers: {
|
|
4275
4551
|
"Content-Type": "application/json"
|
|
4276
4552
|
}
|
|
@@ -4587,40 +4863,26 @@ var useGetAccessByCode = () => {
|
|
|
4587
4863
|
};
|
|
4588
4864
|
var use_get_access_by_code_default = useGetAccessByCode;
|
|
4589
4865
|
|
|
4590
|
-
// src/hooks/auth/use-validate-action-token.ts
|
|
4591
|
-
var import_react_query12 = require("@tanstack/react-query");
|
|
4592
|
-
var useValidateActionToken = () => {
|
|
4593
|
-
return (0, import_react_query12.useMutation)({
|
|
4594
|
-
mutationFn: ({
|
|
4595
|
-
actionToken,
|
|
4596
|
-
path
|
|
4597
|
-
}) => {
|
|
4598
|
-
return auth_service_default.isValidActionToken(actionToken, path);
|
|
4599
|
-
}
|
|
4600
|
-
});
|
|
4601
|
-
};
|
|
4602
|
-
var use_validate_action_token_default = useValidateActionToken;
|
|
4603
|
-
|
|
4604
4866
|
// src/hooks/company/use-get-company-info.ts
|
|
4605
|
-
var
|
|
4867
|
+
var import_react_query12 = require("@tanstack/react-query");
|
|
4606
4868
|
var useGetCompanyInfo = () => {
|
|
4607
|
-
return (0,
|
|
4869
|
+
return (0, import_react_query12.useMutation)({
|
|
4608
4870
|
mutationFn: (id) => company_service_default.getInfoCompany(id)
|
|
4609
4871
|
});
|
|
4610
4872
|
};
|
|
4611
4873
|
var use_get_company_info_default = useGetCompanyInfo;
|
|
4612
4874
|
|
|
4613
4875
|
// src/hooks/company/use-get-current-company.ts
|
|
4614
|
-
var
|
|
4876
|
+
var import_react_query13 = require("@tanstack/react-query");
|
|
4615
4877
|
var useGetCurrentCompany = () => {
|
|
4616
|
-
return (0,
|
|
4878
|
+
return (0, import_react_query13.useMutation)({
|
|
4617
4879
|
mutationFn: () => company_service_default.getCurrentCompany()
|
|
4618
4880
|
});
|
|
4619
4881
|
};
|
|
4620
4882
|
var use_get_current_company_default = useGetCurrentCompany;
|
|
4621
4883
|
|
|
4622
4884
|
// src/hooks/company/use-get-list-company.ts
|
|
4623
|
-
var
|
|
4885
|
+
var import_react_query14 = require("@tanstack/react-query");
|
|
4624
4886
|
var useGetListCompany = (companyIDs = []) => {
|
|
4625
4887
|
const companySpec = {
|
|
4626
4888
|
id: {},
|
|
@@ -4631,7 +4893,7 @@ var useGetListCompany = (companyIDs = []) => {
|
|
|
4631
4893
|
ids: companyIDs,
|
|
4632
4894
|
specification: companySpec
|
|
4633
4895
|
};
|
|
4634
|
-
return (0,
|
|
4896
|
+
return (0, import_react_query14.useQuery)({
|
|
4635
4897
|
queryKey: ["list_company" /* LIST_COMPANY */, companyIDs],
|
|
4636
4898
|
queryFn: () => model_service_default.getList(getListParams),
|
|
4637
4899
|
refetchOnWindowFocus: false
|
|
@@ -4640,9 +4902,9 @@ var useGetListCompany = (companyIDs = []) => {
|
|
|
4640
4902
|
var use_get_list_company_default = useGetListCompany;
|
|
4641
4903
|
|
|
4642
4904
|
// src/hooks/excel/use-export-excel.ts
|
|
4643
|
-
var
|
|
4905
|
+
var import_react_query15 = require("@tanstack/react-query");
|
|
4644
4906
|
var useExportExcel = () => {
|
|
4645
|
-
return (0,
|
|
4907
|
+
return (0, import_react_query15.useMutation)({
|
|
4646
4908
|
mutationFn: ({
|
|
4647
4909
|
model,
|
|
4648
4910
|
domain,
|
|
@@ -4667,9 +4929,9 @@ var useExportExcel = () => {
|
|
|
4667
4929
|
var use_export_excel_default = useExportExcel;
|
|
4668
4930
|
|
|
4669
4931
|
// src/hooks/excel/use-get-field-export.ts
|
|
4670
|
-
var
|
|
4932
|
+
var import_react_query16 = require("@tanstack/react-query");
|
|
4671
4933
|
var useGetFieldExport = () => {
|
|
4672
|
-
return (0,
|
|
4934
|
+
return (0, import_react_query16.useMutation)({
|
|
4673
4935
|
mutationFn: ({
|
|
4674
4936
|
ids,
|
|
4675
4937
|
model,
|
|
@@ -4698,9 +4960,9 @@ var useGetFieldExport = () => {
|
|
|
4698
4960
|
var use_get_field_export_default = useGetFieldExport;
|
|
4699
4961
|
|
|
4700
4962
|
// src/hooks/excel/use-get-file-excel.ts
|
|
4701
|
-
var
|
|
4963
|
+
var import_react_query17 = require("@tanstack/react-query");
|
|
4702
4964
|
var useGetFileExcel = ({ model }) => {
|
|
4703
|
-
return (0,
|
|
4965
|
+
return (0, import_react_query17.useQuery)({
|
|
4704
4966
|
queryKey: [],
|
|
4705
4967
|
queryFn: () => excel_service_default.getFileExcel({
|
|
4706
4968
|
model
|
|
@@ -4716,9 +4978,9 @@ var useGetFileExcel = ({ model }) => {
|
|
|
4716
4978
|
var use_get_file_excel_default = useGetFileExcel;
|
|
4717
4979
|
|
|
4718
4980
|
// src/hooks/excel/use-parse-preview.ts
|
|
4719
|
-
var
|
|
4981
|
+
var import_react_query18 = require("@tanstack/react-query");
|
|
4720
4982
|
var useParsePreview = () => {
|
|
4721
|
-
return (0,
|
|
4983
|
+
return (0, import_react_query18.useMutation)({
|
|
4722
4984
|
mutationFn: ({
|
|
4723
4985
|
id,
|
|
4724
4986
|
selectedSheet,
|
|
@@ -4735,9 +4997,9 @@ var useParsePreview = () => {
|
|
|
4735
4997
|
var use_parse_preview_default = useParsePreview;
|
|
4736
4998
|
|
|
4737
4999
|
// src/hooks/excel/use-upload-file.ts
|
|
4738
|
-
var
|
|
5000
|
+
var import_react_query19 = require("@tanstack/react-query");
|
|
4739
5001
|
var useUploadFile = () => {
|
|
4740
|
-
return (0,
|
|
5002
|
+
return (0, import_react_query19.useMutation)({
|
|
4741
5003
|
mutationFn: ({ formData }) => excel_service_default.uploadFile({
|
|
4742
5004
|
formData
|
|
4743
5005
|
})
|
|
@@ -4746,9 +5008,9 @@ var useUploadFile = () => {
|
|
|
4746
5008
|
var use_upload_file_default = useUploadFile;
|
|
4747
5009
|
|
|
4748
5010
|
// src/hooks/excel/use-upload-id-file.ts
|
|
4749
|
-
var
|
|
5011
|
+
var import_react_query20 = require("@tanstack/react-query");
|
|
4750
5012
|
var useUploadIdFile = () => {
|
|
4751
|
-
return (0,
|
|
5013
|
+
return (0, import_react_query20.useMutation)({
|
|
4752
5014
|
mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
|
|
4753
5015
|
formData
|
|
4754
5016
|
})
|
|
@@ -4757,9 +5019,9 @@ var useUploadIdFile = () => {
|
|
|
4757
5019
|
var use_upload_id_file_default = useUploadIdFile;
|
|
4758
5020
|
|
|
4759
5021
|
// src/hooks/excel/uss-execute-import.ts
|
|
4760
|
-
var
|
|
5022
|
+
var import_react_query21 = require("@tanstack/react-query");
|
|
4761
5023
|
var useExecuteImport = () => {
|
|
4762
|
-
return (0,
|
|
5024
|
+
return (0, import_react_query21.useMutation)({
|
|
4763
5025
|
mutationFn: ({
|
|
4764
5026
|
fields,
|
|
4765
5027
|
columns,
|
|
@@ -4780,9 +5042,9 @@ var useExecuteImport = () => {
|
|
|
4780
5042
|
var uss_execute_import_default = useExecuteImport;
|
|
4781
5043
|
|
|
4782
5044
|
// src/hooks/form/use-change-status.ts
|
|
4783
|
-
var
|
|
5045
|
+
var import_react_query22 = require("@tanstack/react-query");
|
|
4784
5046
|
var useChangeStatus = () => {
|
|
4785
|
-
return (0,
|
|
5047
|
+
return (0, import_react_query22.useMutation)({
|
|
4786
5048
|
mutationFn: ({ data }) => {
|
|
4787
5049
|
return form_service_default.changeStatus({
|
|
4788
5050
|
data
|
|
@@ -4793,9 +5055,9 @@ var useChangeStatus = () => {
|
|
|
4793
5055
|
var use_change_status_default = useChangeStatus;
|
|
4794
5056
|
|
|
4795
5057
|
// src/hooks/form/use-delete-comment.ts
|
|
4796
|
-
var
|
|
5058
|
+
var import_react_query23 = require("@tanstack/react-query");
|
|
4797
5059
|
var useDeleteComment = () => {
|
|
4798
|
-
return (0,
|
|
5060
|
+
return (0, import_react_query23.useMutation)({
|
|
4799
5061
|
mutationFn: ({ data }) => form_service_default.deleteComment({
|
|
4800
5062
|
data
|
|
4801
5063
|
})
|
|
@@ -4804,9 +5066,9 @@ var useDeleteComment = () => {
|
|
|
4804
5066
|
var use_delete_comment_default = useDeleteComment;
|
|
4805
5067
|
|
|
4806
5068
|
// src/hooks/form/use-get-comment.ts
|
|
4807
|
-
var
|
|
5069
|
+
var import_react_query24 = require("@tanstack/react-query");
|
|
4808
5070
|
var useGetComment = ({ data, queryKey }) => {
|
|
4809
|
-
return (0,
|
|
5071
|
+
return (0, import_react_query24.useQuery)({
|
|
4810
5072
|
queryKey,
|
|
4811
5073
|
queryFn: () => form_service_default.getComment({ data }).then((res) => {
|
|
4812
5074
|
if (res) {
|
|
@@ -4820,13 +5082,13 @@ var useGetComment = ({ data, queryKey }) => {
|
|
|
4820
5082
|
var use_get_comment_default = useGetComment;
|
|
4821
5083
|
|
|
4822
5084
|
// src/hooks/form/use-get-form-view.ts
|
|
4823
|
-
var
|
|
5085
|
+
var import_react_query25 = require("@tanstack/react-query");
|
|
4824
5086
|
var useGetFormView = ({
|
|
4825
5087
|
data,
|
|
4826
5088
|
queryKey,
|
|
4827
5089
|
enabled
|
|
4828
5090
|
}) => {
|
|
4829
|
-
return (0,
|
|
5091
|
+
return (0, import_react_query25.useQuery)({
|
|
4830
5092
|
queryKey,
|
|
4831
5093
|
queryFn: () => form_service_default.getFormView({ data }).then((res) => {
|
|
4832
5094
|
if (res) {
|
|
@@ -4840,13 +5102,13 @@ var useGetFormView = ({
|
|
|
4840
5102
|
var use_get_form_view_default = useGetFormView;
|
|
4841
5103
|
|
|
4842
5104
|
// src/hooks/form/use-get-image.ts
|
|
4843
|
-
var
|
|
5105
|
+
var import_react_query26 = require("@tanstack/react-query");
|
|
4844
5106
|
var useGetImage = ({
|
|
4845
5107
|
data,
|
|
4846
5108
|
queryKey,
|
|
4847
5109
|
src
|
|
4848
5110
|
}) => {
|
|
4849
|
-
return (0,
|
|
5111
|
+
return (0, import_react_query26.useQuery)({
|
|
4850
5112
|
queryKey,
|
|
4851
5113
|
queryFn: () => form_service_default.getImage({ data }).then((res) => {
|
|
4852
5114
|
if (res) {
|
|
@@ -4860,9 +5122,9 @@ var useGetImage = ({
|
|
|
4860
5122
|
var use_get_image_default = useGetImage;
|
|
4861
5123
|
|
|
4862
5124
|
// src/hooks/form/use-send-comment.ts
|
|
4863
|
-
var
|
|
5125
|
+
var import_react_query27 = require("@tanstack/react-query");
|
|
4864
5126
|
var useSendComment = () => {
|
|
4865
|
-
return (0,
|
|
5127
|
+
return (0, import_react_query27.useMutation)({
|
|
4866
5128
|
mutationFn: ({ data }) => form_service_default.sentComment({
|
|
4867
5129
|
data
|
|
4868
5130
|
})
|
|
@@ -4871,9 +5133,9 @@ var useSendComment = () => {
|
|
|
4871
5133
|
var use_send_comment_default = useSendComment;
|
|
4872
5134
|
|
|
4873
5135
|
// src/hooks/form/use-upload-image.ts
|
|
4874
|
-
var
|
|
5136
|
+
var import_react_query28 = require("@tanstack/react-query");
|
|
4875
5137
|
var useUploadImage = () => {
|
|
4876
|
-
return (0,
|
|
5138
|
+
return (0, import_react_query28.useMutation)({
|
|
4877
5139
|
mutationFn: ({ data }) => form_service_default.uploadImage({
|
|
4878
5140
|
data
|
|
4879
5141
|
})
|
|
@@ -4882,18 +5144,18 @@ var useUploadImage = () => {
|
|
|
4882
5144
|
var use_upload_image_default = useUploadImage;
|
|
4883
5145
|
|
|
4884
5146
|
// src/hooks/model/use-delete.ts
|
|
4885
|
-
var
|
|
5147
|
+
var import_react_query29 = require("@tanstack/react-query");
|
|
4886
5148
|
var useDelete = () => {
|
|
4887
|
-
return (0,
|
|
5149
|
+
return (0, import_react_query29.useMutation)({
|
|
4888
5150
|
mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
|
|
4889
5151
|
});
|
|
4890
5152
|
};
|
|
4891
5153
|
var use_delete_default = useDelete;
|
|
4892
5154
|
|
|
4893
5155
|
// src/hooks/model/use-get-all.ts
|
|
4894
|
-
var
|
|
5156
|
+
var import_react_query30 = require("@tanstack/react-query");
|
|
4895
5157
|
var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
4896
|
-
return (0,
|
|
5158
|
+
return (0, import_react_query30.useQuery)({
|
|
4897
5159
|
queryKey,
|
|
4898
5160
|
queryFn: () => model_service_default.getAll({ data }).then((res) => {
|
|
4899
5161
|
if (res) {
|
|
@@ -4908,9 +5170,9 @@ var useGetAll = ({ data, queryKey, viewResponse }) => {
|
|
|
4908
5170
|
var use_get_all_default = useGetAll;
|
|
4909
5171
|
|
|
4910
5172
|
// src/hooks/model/use-get-conversion-rate.ts
|
|
4911
|
-
var
|
|
5173
|
+
var import_react_query31 = require("@tanstack/react-query");
|
|
4912
5174
|
var useGetConversionRate = () => {
|
|
4913
|
-
return (0,
|
|
5175
|
+
return (0, import_react_query31.useQuery)({
|
|
4914
5176
|
queryKey: ["currency-rate"],
|
|
4915
5177
|
queryFn: () => model_service_default.getConversionRate().then((res) => {
|
|
4916
5178
|
if (res) {
|
|
@@ -4923,9 +5185,9 @@ var useGetConversionRate = () => {
|
|
|
4923
5185
|
var use_get_conversion_rate_default = useGetConversionRate;
|
|
4924
5186
|
|
|
4925
5187
|
// src/hooks/model/use-get-currency.ts
|
|
4926
|
-
var
|
|
5188
|
+
var import_react_query32 = require("@tanstack/react-query");
|
|
4927
5189
|
var useGetCurrency = () => {
|
|
4928
|
-
return (0,
|
|
5190
|
+
return (0, import_react_query32.useQuery)({
|
|
4929
5191
|
queryKey: ["currency"],
|
|
4930
5192
|
queryFn: () => model_service_default.getCurrency().then((res) => {
|
|
4931
5193
|
if (res) {
|
|
@@ -4938,9 +5200,9 @@ var useGetCurrency = () => {
|
|
|
4938
5200
|
var use_get_currency_default = useGetCurrency;
|
|
4939
5201
|
|
|
4940
5202
|
// src/hooks/model/use-get-detail.ts
|
|
4941
|
-
var
|
|
5203
|
+
var import_react_query33 = require("@tanstack/react-query");
|
|
4942
5204
|
var useGetDetail = () => {
|
|
4943
|
-
return (0,
|
|
5205
|
+
return (0, import_react_query33.useMutation)({
|
|
4944
5206
|
mutationFn: ({
|
|
4945
5207
|
model,
|
|
4946
5208
|
ids,
|
|
@@ -4957,9 +5219,9 @@ var useGetDetail = () => {
|
|
|
4957
5219
|
var use_get_detail_default = useGetDetail;
|
|
4958
5220
|
|
|
4959
5221
|
// src/hooks/model/use-get-field-onchange.ts
|
|
4960
|
-
var
|
|
5222
|
+
var import_react_query34 = require("@tanstack/react-query");
|
|
4961
5223
|
var useGetFieldOnChange = ({ model }) => {
|
|
4962
|
-
return (0,
|
|
5224
|
+
return (0, import_react_query34.useQuery)({
|
|
4963
5225
|
queryKey: [`field-onchange-${model}`, model],
|
|
4964
5226
|
queryFn: () => model_service_default.getListFieldsOnchange({
|
|
4965
5227
|
model
|
|
@@ -4975,13 +5237,13 @@ var useGetFieldOnChange = ({ model }) => {
|
|
|
4975
5237
|
var use_get_field_onchange_default = useGetFieldOnChange;
|
|
4976
5238
|
|
|
4977
5239
|
// src/hooks/model/use-get-list-my-bank-account.ts
|
|
4978
|
-
var
|
|
5240
|
+
var import_react_query35 = require("@tanstack/react-query");
|
|
4979
5241
|
var useGetListMyBankAccount = ({
|
|
4980
5242
|
domain,
|
|
4981
5243
|
spectification,
|
|
4982
5244
|
model
|
|
4983
5245
|
}) => {
|
|
4984
|
-
return (0,
|
|
5246
|
+
return (0, import_react_query35.useQuery)({
|
|
4985
5247
|
queryKey: ["bank-account", model, domain],
|
|
4986
5248
|
queryFn: () => model_service_default.getListMyBankAccount({
|
|
4987
5249
|
domain,
|
|
@@ -5133,9 +5395,9 @@ var useOdooDataTransform = () => {
|
|
|
5133
5395
|
var use_odoo_data_transform_default = useOdooDataTransform;
|
|
5134
5396
|
|
|
5135
5397
|
// src/hooks/model/use-onchange-form.ts
|
|
5136
|
-
var
|
|
5398
|
+
var import_react_query36 = require("@tanstack/react-query");
|
|
5137
5399
|
var useOnChangeForm = () => {
|
|
5138
|
-
return (0,
|
|
5400
|
+
return (0, import_react_query36.useMutation)({
|
|
5139
5401
|
mutationFn: ({
|
|
5140
5402
|
ids,
|
|
5141
5403
|
model,
|
|
@@ -5156,9 +5418,9 @@ var useOnChangeForm = () => {
|
|
|
5156
5418
|
var use_onchange_form_default = useOnChangeForm;
|
|
5157
5419
|
|
|
5158
5420
|
// src/hooks/model/use-save.ts
|
|
5159
|
-
var
|
|
5421
|
+
var import_react_query37 = require("@tanstack/react-query");
|
|
5160
5422
|
var useSave = () => {
|
|
5161
|
-
return (0,
|
|
5423
|
+
return (0, import_react_query37.useMutation)({
|
|
5162
5424
|
mutationFn: ({
|
|
5163
5425
|
ids,
|
|
5164
5426
|
model,
|
|
@@ -5172,18 +5434,18 @@ var useSave = () => {
|
|
|
5172
5434
|
var use_save_default = useSave;
|
|
5173
5435
|
|
|
5174
5436
|
// src/hooks/user/use-get-profile.ts
|
|
5175
|
-
var
|
|
5437
|
+
var import_react_query38 = require("@tanstack/react-query");
|
|
5176
5438
|
var useGetProfile = (path) => {
|
|
5177
|
-
return (0,
|
|
5439
|
+
return (0, import_react_query38.useMutation)({
|
|
5178
5440
|
mutationFn: () => user_service_default.getProfile(path)
|
|
5179
5441
|
});
|
|
5180
5442
|
};
|
|
5181
5443
|
var use_get_profile_default = useGetProfile;
|
|
5182
5444
|
|
|
5183
5445
|
// src/hooks/user/use-get-user.ts
|
|
5184
|
-
var
|
|
5446
|
+
var import_react_query39 = require("@tanstack/react-query");
|
|
5185
5447
|
var useGetUser = () => {
|
|
5186
|
-
return (0,
|
|
5448
|
+
return (0, import_react_query39.useMutation)({
|
|
5187
5449
|
mutationFn: ({ id, context }) => user_service_default.getUser({
|
|
5188
5450
|
id,
|
|
5189
5451
|
context
|
|
@@ -5193,9 +5455,9 @@ var useGetUser = () => {
|
|
|
5193
5455
|
var use_get_user_default = useGetUser;
|
|
5194
5456
|
|
|
5195
5457
|
// src/hooks/user/use-switch-locale.ts
|
|
5196
|
-
var
|
|
5458
|
+
var import_react_query40 = require("@tanstack/react-query");
|
|
5197
5459
|
var useSwitchLocale = () => {
|
|
5198
|
-
return (0,
|
|
5460
|
+
return (0, import_react_query40.useMutation)({
|
|
5199
5461
|
mutationFn: ({ data }) => {
|
|
5200
5462
|
return user_service_default.switchUserLocale({
|
|
5201
5463
|
id: data.id,
|
|
@@ -5207,9 +5469,9 @@ var useSwitchLocale = () => {
|
|
|
5207
5469
|
var use_switch_locale_default = useSwitchLocale;
|
|
5208
5470
|
|
|
5209
5471
|
// src/hooks/view/use-button.ts
|
|
5210
|
-
var
|
|
5472
|
+
var import_react_query41 = require("@tanstack/react-query");
|
|
5211
5473
|
var useButton = () => {
|
|
5212
|
-
return (0,
|
|
5474
|
+
return (0, import_react_query41.useMutation)({
|
|
5213
5475
|
mutationFn: ({
|
|
5214
5476
|
model,
|
|
5215
5477
|
ids,
|
|
@@ -5229,9 +5491,9 @@ var useButton = () => {
|
|
|
5229
5491
|
var use_button_default = useButton;
|
|
5230
5492
|
|
|
5231
5493
|
// src/hooks/view/use-duplicate-record.ts
|
|
5232
|
-
var
|
|
5494
|
+
var import_react_query42 = require("@tanstack/react-query");
|
|
5233
5495
|
var useDuplicateRecord = () => {
|
|
5234
|
-
return (0,
|
|
5496
|
+
return (0, import_react_query42.useMutation)({
|
|
5235
5497
|
mutationFn: ({
|
|
5236
5498
|
id,
|
|
5237
5499
|
model,
|
|
@@ -5246,7 +5508,7 @@ var useDuplicateRecord = () => {
|
|
|
5246
5508
|
var use_duplicate_record_default = useDuplicateRecord;
|
|
5247
5509
|
|
|
5248
5510
|
// src/hooks/view/use-get-action-detail.ts
|
|
5249
|
-
var
|
|
5511
|
+
var import_react_query43 = require("@tanstack/react-query");
|
|
5250
5512
|
var useGetActionDetail = ({
|
|
5251
5513
|
aid,
|
|
5252
5514
|
context,
|
|
@@ -5260,7 +5522,7 @@ var useGetActionDetail = ({
|
|
|
5260
5522
|
model: model ?? "",
|
|
5261
5523
|
context
|
|
5262
5524
|
};
|
|
5263
|
-
return (0,
|
|
5525
|
+
return (0, import_react_query43.useQuery)({
|
|
5264
5526
|
queryKey,
|
|
5265
5527
|
queryFn: async () => {
|
|
5266
5528
|
if (aid) {
|
|
@@ -5281,9 +5543,9 @@ var useGetActionDetail = ({
|
|
|
5281
5543
|
var use_get_action_detail_default = useGetActionDetail;
|
|
5282
5544
|
|
|
5283
5545
|
// src/hooks/view/use-get-calendar.ts
|
|
5284
|
-
var
|
|
5546
|
+
var import_react_query44 = require("@tanstack/react-query");
|
|
5285
5547
|
var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
5286
|
-
return (0,
|
|
5548
|
+
return (0, import_react_query44.useQuery)({
|
|
5287
5549
|
queryKey,
|
|
5288
5550
|
queryFn: () => model_service_default.getListCalendar({ data: listDataProps }).then((res) => {
|
|
5289
5551
|
if (res) {
|
|
@@ -5299,12 +5561,12 @@ var useGetCalendar = (listDataProps, queryKey, enabled) => {
|
|
|
5299
5561
|
var use_get_calendar_default = useGetCalendar;
|
|
5300
5562
|
|
|
5301
5563
|
// src/hooks/view/use-get-groups.ts
|
|
5302
|
-
var
|
|
5564
|
+
var import_react_query45 = require("@tanstack/react-query");
|
|
5303
5565
|
var useGetGroups = ({
|
|
5304
5566
|
model,
|
|
5305
5567
|
width_context
|
|
5306
5568
|
}) => {
|
|
5307
|
-
return (0,
|
|
5569
|
+
return (0, import_react_query45.useQuery)({
|
|
5308
5570
|
queryKey: [model, width_context],
|
|
5309
5571
|
queryFn: () => kanban_service_default.getGroups({
|
|
5310
5572
|
model,
|
|
@@ -5321,9 +5583,9 @@ var useGetGroups = ({
|
|
|
5321
5583
|
var use_get_groups_default = useGetGroups;
|
|
5322
5584
|
|
|
5323
5585
|
// src/hooks/view/use-get-list-data.ts
|
|
5324
|
-
var
|
|
5586
|
+
var import_react_query46 = require("@tanstack/react-query");
|
|
5325
5587
|
var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
5326
|
-
return (0,
|
|
5588
|
+
return (0, import_react_query46.useQuery)({
|
|
5327
5589
|
queryKey,
|
|
5328
5590
|
queryFn: () => model_service_default.getAll({ data: listDataProps }).then((res) => {
|
|
5329
5591
|
if (res) {
|
|
@@ -5339,9 +5601,9 @@ var useGetListData = (listDataProps, queryKey, enabled) => {
|
|
|
5339
5601
|
var use_get_list_data_default = useGetListData;
|
|
5340
5602
|
|
|
5341
5603
|
// src/hooks/view/use-get-menu.ts
|
|
5342
|
-
var
|
|
5604
|
+
var import_react_query47 = require("@tanstack/react-query");
|
|
5343
5605
|
var useGetMenu = (context, enabled) => {
|
|
5344
|
-
return (0,
|
|
5606
|
+
return (0, import_react_query47.useQuery)({
|
|
5345
5607
|
queryKey: ["menus" /* MENU */, context],
|
|
5346
5608
|
queryFn: () => view_service_default.getMenu(context).then((res) => {
|
|
5347
5609
|
if (res && res?.records && res?.records?.length > 0) {
|
|
@@ -5357,9 +5619,9 @@ var useGetMenu = (context, enabled) => {
|
|
|
5357
5619
|
var use_get_menu_default = useGetMenu;
|
|
5358
5620
|
|
|
5359
5621
|
// src/hooks/view/use-get-print-report.ts
|
|
5360
|
-
var
|
|
5622
|
+
var import_react_query48 = require("@tanstack/react-query");
|
|
5361
5623
|
var useGetPrintReport = () => {
|
|
5362
|
-
return (0,
|
|
5624
|
+
return (0, import_react_query48.useMutation)({
|
|
5363
5625
|
mutationFn: ({ id }) => action_service_default.getPrintReportName({
|
|
5364
5626
|
id
|
|
5365
5627
|
})
|
|
@@ -5368,14 +5630,14 @@ var useGetPrintReport = () => {
|
|
|
5368
5630
|
var use_get_print_report_default = useGetPrintReport;
|
|
5369
5631
|
|
|
5370
5632
|
// src/hooks/view/use-get-progress-bar.ts
|
|
5371
|
-
var
|
|
5633
|
+
var import_react_query49 = require("@tanstack/react-query");
|
|
5372
5634
|
var useGetProGressBar = ({
|
|
5373
5635
|
field,
|
|
5374
5636
|
color,
|
|
5375
5637
|
model,
|
|
5376
5638
|
width_context
|
|
5377
5639
|
}) => {
|
|
5378
|
-
return (0,
|
|
5640
|
+
return (0, import_react_query49.useQuery)({
|
|
5379
5641
|
queryKey: [],
|
|
5380
5642
|
queryFn: () => kanban_service_default.getProgressBar({
|
|
5381
5643
|
field,
|
|
@@ -5394,13 +5656,13 @@ var useGetProGressBar = ({
|
|
|
5394
5656
|
var use_get_progress_bar_default = useGetProGressBar;
|
|
5395
5657
|
|
|
5396
5658
|
// src/hooks/view/use-get-selection.ts
|
|
5397
|
-
var
|
|
5659
|
+
var import_react_query50 = require("@tanstack/react-query");
|
|
5398
5660
|
var useGetSelection = ({
|
|
5399
5661
|
data,
|
|
5400
5662
|
queryKey,
|
|
5401
5663
|
enabled
|
|
5402
5664
|
}) => {
|
|
5403
|
-
return (0,
|
|
5665
|
+
return (0, import_react_query50.useQuery)({
|
|
5404
5666
|
queryKey,
|
|
5405
5667
|
queryFn: () => view_service_default.getSelectionItem({ data }),
|
|
5406
5668
|
enabled,
|
|
@@ -5410,9 +5672,9 @@ var useGetSelection = ({
|
|
|
5410
5672
|
var use_get_selection_default = useGetSelection;
|
|
5411
5673
|
|
|
5412
5674
|
// src/hooks/view/use-get-view.ts
|
|
5413
|
-
var
|
|
5675
|
+
var import_react_query51 = require("@tanstack/react-query");
|
|
5414
5676
|
var useGetView = (viewParams, actData) => {
|
|
5415
|
-
return (0,
|
|
5677
|
+
return (0, import_react_query51.useQuery)({
|
|
5416
5678
|
queryKey: ["get_view_by_action" /* GET_VIEW_BY_ACTION */, viewParams],
|
|
5417
5679
|
queryFn: () => view_service_default.getView(viewParams),
|
|
5418
5680
|
enabled: !!actData,
|
|
@@ -5423,9 +5685,9 @@ var useGetView = (viewParams, actData) => {
|
|
|
5423
5685
|
var use_get_view_default = useGetView;
|
|
5424
5686
|
|
|
5425
5687
|
// src/hooks/view/use-load-action.ts
|
|
5426
|
-
var
|
|
5688
|
+
var import_react_query52 = require("@tanstack/react-query");
|
|
5427
5689
|
var useLoadAction = () => {
|
|
5428
|
-
return (0,
|
|
5690
|
+
return (0, import_react_query52.useMutation)({
|
|
5429
5691
|
mutationFn: ({
|
|
5430
5692
|
idAction,
|
|
5431
5693
|
context
|
|
@@ -5440,9 +5702,9 @@ var useLoadAction = () => {
|
|
|
5440
5702
|
var use_load_action_default = useLoadAction;
|
|
5441
5703
|
|
|
5442
5704
|
// src/hooks/view/use-load-message.ts
|
|
5443
|
-
var
|
|
5705
|
+
var import_react_query53 = require("@tanstack/react-query");
|
|
5444
5706
|
var useLoadMessage = () => {
|
|
5445
|
-
return (0,
|
|
5707
|
+
return (0, import_react_query53.useQuery)({
|
|
5446
5708
|
queryKey: [`load-message-failure`],
|
|
5447
5709
|
queryFn: () => view_service_default.loadMessages(),
|
|
5448
5710
|
refetchOnWindowFocus: false
|
|
@@ -5451,9 +5713,9 @@ var useLoadMessage = () => {
|
|
|
5451
5713
|
var use_load_message_default = useLoadMessage;
|
|
5452
5714
|
|
|
5453
5715
|
// src/hooks/view/use-print.ts
|
|
5454
|
-
var
|
|
5716
|
+
var import_react_query54 = require("@tanstack/react-query");
|
|
5455
5717
|
var usePrint = () => {
|
|
5456
|
-
return (0,
|
|
5718
|
+
return (0, import_react_query54.useMutation)({
|
|
5457
5719
|
mutationFn: ({ id, report, db }) => action_service_default.print({
|
|
5458
5720
|
id,
|
|
5459
5721
|
report,
|
|
@@ -5464,9 +5726,9 @@ var usePrint = () => {
|
|
|
5464
5726
|
var use_print_default = usePrint;
|
|
5465
5727
|
|
|
5466
5728
|
// src/hooks/view/use-remove-row.ts
|
|
5467
|
-
var
|
|
5729
|
+
var import_react_query55 = require("@tanstack/react-query");
|
|
5468
5730
|
var useRemoveRow = () => {
|
|
5469
|
-
return (0,
|
|
5731
|
+
return (0, import_react_query55.useMutation)({
|
|
5470
5732
|
mutationFn: ({
|
|
5471
5733
|
model,
|
|
5472
5734
|
ids,
|
|
@@ -5481,9 +5743,9 @@ var useRemoveRow = () => {
|
|
|
5481
5743
|
var use_remove_row_default = useRemoveRow;
|
|
5482
5744
|
|
|
5483
5745
|
// src/hooks/view/use-resequence.ts
|
|
5484
|
-
var
|
|
5746
|
+
var import_react_query56 = require("@tanstack/react-query");
|
|
5485
5747
|
var useGetResequence = (model, resIds, context, offset) => {
|
|
5486
|
-
return (0,
|
|
5748
|
+
return (0, import_react_query56.useQuery)({
|
|
5487
5749
|
queryKey: [],
|
|
5488
5750
|
queryFn: () => view_service_default.getResequence({
|
|
5489
5751
|
model,
|
|
@@ -5498,9 +5760,9 @@ var useGetResequence = (model, resIds, context, offset) => {
|
|
|
5498
5760
|
var use_resequence_default = useGetResequence;
|
|
5499
5761
|
|
|
5500
5762
|
// src/hooks/view/use-run-action.ts
|
|
5501
|
-
var
|
|
5763
|
+
var import_react_query57 = require("@tanstack/react-query");
|
|
5502
5764
|
var useRunAction = () => {
|
|
5503
|
-
return (0,
|
|
5765
|
+
return (0, import_react_query57.useMutation)({
|
|
5504
5766
|
mutationFn: ({
|
|
5505
5767
|
idAction,
|
|
5506
5768
|
context
|
|
@@ -5513,9 +5775,9 @@ var useRunAction = () => {
|
|
|
5513
5775
|
var use_run_action_default = useRunAction;
|
|
5514
5776
|
|
|
5515
5777
|
// src/hooks/view/use-signin-sso.ts
|
|
5516
|
-
var
|
|
5778
|
+
var import_react_query58 = require("@tanstack/react-query");
|
|
5517
5779
|
var useSignInSSO = () => {
|
|
5518
|
-
return (0,
|
|
5780
|
+
return (0, import_react_query58.useMutation)({
|
|
5519
5781
|
mutationFn: ({
|
|
5520
5782
|
redirect_uri,
|
|
5521
5783
|
state,
|
|
@@ -5536,9 +5798,9 @@ var useSignInSSO = () => {
|
|
|
5536
5798
|
var use_signin_sso_default = useSignInSSO;
|
|
5537
5799
|
|
|
5538
5800
|
// src/hooks/view/use-verify-2FA.ts
|
|
5539
|
-
var
|
|
5801
|
+
var import_react_query59 = require("@tanstack/react-query");
|
|
5540
5802
|
var useVerify2FA = () => {
|
|
5541
|
-
return (0,
|
|
5803
|
+
return (0, import_react_query59.useMutation)({
|
|
5542
5804
|
mutationFn: ({
|
|
5543
5805
|
method,
|
|
5544
5806
|
with_context,
|
|
@@ -5559,9 +5821,9 @@ var useVerify2FA = () => {
|
|
|
5559
5821
|
var use_verify_2FA_default = useVerify2FA;
|
|
5560
5822
|
|
|
5561
5823
|
// src/hooks/view/uset-get-2FA-method.ts
|
|
5562
|
-
var
|
|
5824
|
+
var import_react_query60 = require("@tanstack/react-query");
|
|
5563
5825
|
var useGet2FAMethods = () => {
|
|
5564
|
-
return (0,
|
|
5826
|
+
return (0, import_react_query60.useMutation)({
|
|
5565
5827
|
mutationFn: ({
|
|
5566
5828
|
method,
|
|
5567
5829
|
with_context
|
|
@@ -5576,9 +5838,9 @@ var useGet2FAMethods = () => {
|
|
|
5576
5838
|
var uset_get_2FA_method_default = useGet2FAMethods;
|
|
5577
5839
|
|
|
5578
5840
|
// src/hooks/view/use-get-fields-view-security.ts
|
|
5579
|
-
var
|
|
5841
|
+
var import_react_query61 = require("@tanstack/react-query");
|
|
5580
5842
|
var useGetFieldsViewSecurity = () => {
|
|
5581
|
-
return (0,
|
|
5843
|
+
return (0, import_react_query61.useMutation)({
|
|
5582
5844
|
mutationFn: ({
|
|
5583
5845
|
method,
|
|
5584
5846
|
token,
|
|
@@ -5595,9 +5857,9 @@ var useGetFieldsViewSecurity = () => {
|
|
|
5595
5857
|
var use_get_fields_view_security_default = useGetFieldsViewSecurity;
|
|
5596
5858
|
|
|
5597
5859
|
// src/hooks/view/use-grant-access.ts
|
|
5598
|
-
var
|
|
5860
|
+
var import_react_query62 = require("@tanstack/react-query");
|
|
5599
5861
|
var useGrantAccess = () => {
|
|
5600
|
-
return (0,
|
|
5862
|
+
return (0, import_react_query62.useMutation)({
|
|
5601
5863
|
mutationFn: ({
|
|
5602
5864
|
redirect_uri,
|
|
5603
5865
|
state,
|
|
@@ -5616,9 +5878,9 @@ var useGrantAccess = () => {
|
|
|
5616
5878
|
var use_grant_access_default = useGrantAccess;
|
|
5617
5879
|
|
|
5618
5880
|
// src/hooks/view/use-remove-totp-setup.ts
|
|
5619
|
-
var
|
|
5881
|
+
var import_react_query63 = require("@tanstack/react-query");
|
|
5620
5882
|
var useRemoveTotpSetup = () => {
|
|
5621
|
-
return (0,
|
|
5883
|
+
return (0, import_react_query63.useMutation)({
|
|
5622
5884
|
mutationFn: ({ method, token }) => {
|
|
5623
5885
|
return view_service_default.removeTotpSetUp({
|
|
5624
5886
|
method,
|
|
@@ -5630,9 +5892,9 @@ var useRemoveTotpSetup = () => {
|
|
|
5630
5892
|
var use_remove_totp_setup_default = useRemoveTotpSetup;
|
|
5631
5893
|
|
|
5632
5894
|
// src/hooks/view/use-request-setup-totp.ts
|
|
5633
|
-
var
|
|
5895
|
+
var import_react_query64 = require("@tanstack/react-query");
|
|
5634
5896
|
var useRequestSetupTotp = () => {
|
|
5635
|
-
return (0,
|
|
5897
|
+
return (0, import_react_query64.useMutation)({
|
|
5636
5898
|
mutationFn: ({ method, token }) => {
|
|
5637
5899
|
return view_service_default.requestSetupTotp({
|
|
5638
5900
|
method,
|
|
@@ -5644,9 +5906,9 @@ var useRequestSetupTotp = () => {
|
|
|
5644
5906
|
var use_request_setup_totp_default = useRequestSetupTotp;
|
|
5645
5907
|
|
|
5646
5908
|
// src/hooks/view/use-settings-web-read-2fa.ts
|
|
5647
|
-
var
|
|
5909
|
+
var import_react_query65 = require("@tanstack/react-query");
|
|
5648
5910
|
var useSettingsWebRead2fa = () => {
|
|
5649
|
-
return (0,
|
|
5911
|
+
return (0, import_react_query65.useMutation)({
|
|
5650
5912
|
mutationFn: ({
|
|
5651
5913
|
method,
|
|
5652
5914
|
token,
|
|
@@ -5665,9 +5927,9 @@ var useSettingsWebRead2fa = () => {
|
|
|
5665
5927
|
var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
|
|
5666
5928
|
|
|
5667
5929
|
// src/hooks/view/use-verify-totp.ts
|
|
5668
|
-
var
|
|
5930
|
+
var import_react_query66 = require("@tanstack/react-query");
|
|
5669
5931
|
var useVerifyTotp = () => {
|
|
5670
|
-
return (0,
|
|
5932
|
+
return (0, import_react_query66.useMutation)({
|
|
5671
5933
|
mutationFn: ({
|
|
5672
5934
|
method,
|
|
5673
5935
|
action_token,
|
|
@@ -5750,7 +6012,6 @@ var use_verify_totp_default = useVerifyTotp;
|
|
|
5750
6012
|
useUploadFile,
|
|
5751
6013
|
useUploadIdFile,
|
|
5752
6014
|
useUploadImage,
|
|
5753
|
-
useValidateActionToken,
|
|
5754
6015
|
useVerify2FA,
|
|
5755
6016
|
useVerifyTotp
|
|
5756
6017
|
});
|