@fctc/interface-logic 2.9.1 → 2.9.3

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/hooks.mjs CHANGED
@@ -3308,18 +3308,36 @@ import { useCallback as useCallback5 } from "react";
3308
3308
  function useExcelService() {
3309
3309
  const { env } = useEnv();
3310
3310
  const uploadFileExcel = useCallback5(
3311
- async ({ formData }) => {
3312
- return env.requests.post("/upload/file" /* UPLOAD_FILE_EXCEL_PATH */, formData);
3311
+ async ({
3312
+ formData,
3313
+ service,
3314
+ xNode
3315
+ }) => {
3316
+ return env.requests.post(
3317
+ "/upload/file" /* UPLOAD_FILE_EXCEL_PATH */,
3318
+ formData,
3319
+ {
3320
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3321
+ },
3322
+ service
3323
+ );
3313
3324
  },
3314
3325
  [env]
3315
3326
  );
3316
3327
  const uploadIdFile = useCallback5(
3317
- async ({ formData }) => {
3318
- return env.requests.post("/upload/file" /* UPLOAD_FILE_EXCEL_PATH */, formData, {
3319
- headers: {
3320
- "Content-Type": "multipart/form-data"
3321
- }
3322
- });
3328
+ async ({
3329
+ formData,
3330
+ service,
3331
+ xNode
3332
+ }) => {
3333
+ return env.requests.post(
3334
+ "/upload/file" /* UPLOAD_FILE_EXCEL_PATH */,
3335
+ formData,
3336
+ {
3337
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3338
+ },
3339
+ service
3340
+ );
3323
3341
  },
3324
3342
  [env]
3325
3343
  );
@@ -3328,7 +3346,9 @@ function useExcelService() {
3328
3346
  id,
3329
3347
  selectedSheet,
3330
3348
  isHeader,
3331
- context
3349
+ context,
3350
+ service,
3351
+ xNode
3332
3352
  }) => {
3333
3353
  const jsonData = {
3334
3354
  model: "base_import.import" /* BASE_IMPORT */,
@@ -3359,11 +3379,14 @@ function useExcelService() {
3359
3379
  },
3360
3380
  with_context: context
3361
3381
  };
3362
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3363
- headers: {
3364
- "Content-Type": "application/json"
3365
- }
3366
- });
3382
+ return env.requests.post(
3383
+ "/call" /* CALL_PATH */,
3384
+ jsonData,
3385
+ {
3386
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3387
+ },
3388
+ service
3389
+ );
3367
3390
  },
3368
3391
  [env]
3369
3392
  );
@@ -3374,7 +3397,9 @@ function useExcelService() {
3374
3397
  idFile,
3375
3398
  options,
3376
3399
  dryrun,
3377
- context
3400
+ context,
3401
+ service,
3402
+ xNode
3378
3403
  }) => {
3379
3404
  const jsonData = {
3380
3405
  model: "base_import.import" /* BASE_IMPORT */,
@@ -3388,22 +3413,36 @@ function useExcelService() {
3388
3413
  },
3389
3414
  with_context: context
3390
3415
  };
3391
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3392
- headers: {
3393
- "Content-Type": "application/json"
3394
- }
3395
- });
3416
+ return env.requests.post(
3417
+ "/call" /* CALL_PATH */,
3418
+ jsonData,
3419
+ {
3420
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3421
+ },
3422
+ service
3423
+ );
3396
3424
  },
3397
3425
  [env]
3398
3426
  );
3399
3427
  const getFileExcel = useCallback5(
3400
- async ({ model }) => {
3428
+ async ({
3429
+ model,
3430
+ service,
3431
+ xNode
3432
+ }) => {
3401
3433
  const jsonData = {
3402
3434
  model,
3403
3435
  method: "get_import_templates" /* GET_IMPORT */,
3404
3436
  args: []
3405
3437
  };
3406
- return env.requests.post("/call" /* CALL_PATH */, jsonData);
3438
+ return env.requests.post(
3439
+ "/call" /* CALL_PATH */,
3440
+ jsonData,
3441
+ {
3442
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3443
+ },
3444
+ service
3445
+ );
3407
3446
  },
3408
3447
  [env]
3409
3448
  );
@@ -3418,7 +3457,9 @@ function useExcelService() {
3418
3457
  prefix,
3419
3458
  name,
3420
3459
  context,
3421
- importCompat
3460
+ importCompat,
3461
+ service,
3462
+ xNode
3422
3463
  }) => {
3423
3464
  const jsonData = {
3424
3465
  model,
@@ -3434,7 +3475,14 @@ function useExcelService() {
3434
3475
  jsonData.prefix = prefix;
3435
3476
  jsonData.exclude = [null];
3436
3477
  }
3437
- return env.requests.post("/export/get_fields", jsonData);
3478
+ return env.requests.post(
3479
+ "/export/get_fields",
3480
+ jsonData,
3481
+ {
3482
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3483
+ },
3484
+ service
3485
+ );
3438
3486
  },
3439
3487
  [env]
3440
3488
  );
@@ -3447,7 +3495,9 @@ function useExcelService() {
3447
3495
  type,
3448
3496
  importCompat,
3449
3497
  context,
3450
- groupby
3498
+ groupby,
3499
+ service,
3500
+ xNode
3451
3501
  }) => {
3452
3502
  const jsonData = {
3453
3503
  model,
@@ -3458,7 +3508,14 @@ function useExcelService() {
3458
3508
  with_context: context,
3459
3509
  groupby: groupby ?? []
3460
3510
  };
3461
- return env.requests.post_excel(`/export/${type}`, jsonData);
3511
+ return env.requests.post_excel(
3512
+ `/export/${type}`,
3513
+ jsonData,
3514
+ {
3515
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3516
+ },
3517
+ service
3518
+ );
3462
3519
  },
3463
3520
  [env]
3464
3521
  );
@@ -5279,7 +5336,9 @@ var useExportExcel = () => {
5279
5336
  type,
5280
5337
  importCompat,
5281
5338
  context,
5282
- groupby
5339
+ groupby,
5340
+ service,
5341
+ xNode
5283
5342
  }) => exportExcel({
5284
5343
  model,
5285
5344
  domain,
@@ -5288,7 +5347,9 @@ var useExportExcel = () => {
5288
5347
  type,
5289
5348
  importCompat,
5290
5349
  context,
5291
- groupby
5350
+ groupby,
5351
+ service,
5352
+ xNode
5292
5353
  })
5293
5354
  });
5294
5355
  };
@@ -5309,7 +5370,9 @@ var useGetFieldExport = () => {
5309
5370
  prefix,
5310
5371
  name,
5311
5372
  context,
5312
- importCompat
5373
+ importCompat,
5374
+ service,
5375
+ xNode
5313
5376
  }) => getFieldExport({
5314
5377
  ids,
5315
5378
  model,
@@ -5320,7 +5383,9 @@ var useGetFieldExport = () => {
5320
5383
  prefix,
5321
5384
  name,
5322
5385
  context,
5323
- importCompat
5386
+ importCompat,
5387
+ service,
5388
+ xNode
5324
5389
  })
5325
5390
  });
5326
5391
  };
@@ -5328,12 +5393,18 @@ var use_get_field_export_default = useGetFieldExport;
5328
5393
 
5329
5394
  // src/hooks/excel/use-get-file-excel.ts
5330
5395
  import { useQuery as useQuery2 } from "@tanstack/react-query";
5331
- var useGetFileExcel = ({ model }) => {
5396
+ var useGetFileExcel = ({
5397
+ model,
5398
+ service,
5399
+ xNode
5400
+ }) => {
5332
5401
  const { getFileExcel } = useExcelService();
5333
5402
  return useQuery2({
5334
5403
  queryKey: [],
5335
5404
  queryFn: () => getFileExcel({
5336
- model
5405
+ model,
5406
+ service,
5407
+ xNode
5337
5408
  }).then((res) => {
5338
5409
  if (res) {
5339
5410
  return res;
@@ -5354,12 +5425,16 @@ var useParsePreview = () => {
5354
5425
  id,
5355
5426
  selectedSheet,
5356
5427
  isHeader,
5357
- context
5428
+ context,
5429
+ service,
5430
+ xNode
5358
5431
  }) => parsePreview({
5359
5432
  id,
5360
5433
  selectedSheet,
5361
5434
  isHeader,
5362
- context
5435
+ context,
5436
+ service,
5437
+ xNode
5363
5438
  })
5364
5439
  });
5365
5440
  };
@@ -5370,8 +5445,14 @@ import { useMutation as useMutation18 } from "@tanstack/react-query";
5370
5445
  var useUploadFileExcel = () => {
5371
5446
  const { uploadFileExcel } = useExcelService();
5372
5447
  return useMutation18({
5373
- mutationFn: ({ formData }) => uploadFileExcel({
5374
- formData
5448
+ mutationFn: ({
5449
+ formData,
5450
+ service,
5451
+ xNode
5452
+ }) => uploadFileExcel({
5453
+ formData,
5454
+ service,
5455
+ xNode
5375
5456
  })
5376
5457
  });
5377
5458
  };
@@ -5382,8 +5463,14 @@ import { useMutation as useMutation19 } from "@tanstack/react-query";
5382
5463
  var useUploadIdFile = () => {
5383
5464
  const { uploadIdFile } = useExcelService();
5384
5465
  return useMutation19({
5385
- mutationFn: ({ formData }) => uploadIdFile({
5386
- formData
5466
+ mutationFn: ({
5467
+ formData,
5468
+ service,
5469
+ xNode
5470
+ }) => uploadIdFile({
5471
+ formData,
5472
+ service,
5473
+ xNode
5387
5474
  })
5388
5475
  });
5389
5476
  };
@@ -5400,14 +5487,18 @@ var useExecuteImport = () => {
5400
5487
  idFile,
5401
5488
  options,
5402
5489
  dryrun,
5403
- context
5490
+ context,
5491
+ service,
5492
+ xNode
5404
5493
  }) => executeImport({
5405
5494
  fields,
5406
5495
  columns,
5407
5496
  idFile,
5408
5497
  options,
5409
5498
  dryrun,
5410
- context
5499
+ context,
5500
+ service,
5501
+ xNode
5411
5502
  })
5412
5503
  });
5413
5504
  };
package/dist/provider.js CHANGED
@@ -3360,18 +3360,36 @@ var import_react5 = require("react");
3360
3360
  function useExcelService() {
3361
3361
  const { env } = useEnv();
3362
3362
  const uploadFileExcel = (0, import_react5.useCallback)(
3363
- async ({ formData }) => {
3364
- return env.requests.post("/upload/file" /* UPLOAD_FILE_EXCEL_PATH */, formData);
3363
+ async ({
3364
+ formData,
3365
+ service,
3366
+ xNode
3367
+ }) => {
3368
+ return env.requests.post(
3369
+ "/upload/file" /* UPLOAD_FILE_EXCEL_PATH */,
3370
+ formData,
3371
+ {
3372
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3373
+ },
3374
+ service
3375
+ );
3365
3376
  },
3366
3377
  [env]
3367
3378
  );
3368
3379
  const uploadIdFile = (0, import_react5.useCallback)(
3369
- async ({ formData }) => {
3370
- return env.requests.post("/upload/file" /* UPLOAD_FILE_EXCEL_PATH */, formData, {
3371
- headers: {
3372
- "Content-Type": "multipart/form-data"
3373
- }
3374
- });
3380
+ async ({
3381
+ formData,
3382
+ service,
3383
+ xNode
3384
+ }) => {
3385
+ return env.requests.post(
3386
+ "/upload/file" /* UPLOAD_FILE_EXCEL_PATH */,
3387
+ formData,
3388
+ {
3389
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3390
+ },
3391
+ service
3392
+ );
3375
3393
  },
3376
3394
  [env]
3377
3395
  );
@@ -3380,7 +3398,9 @@ function useExcelService() {
3380
3398
  id,
3381
3399
  selectedSheet,
3382
3400
  isHeader,
3383
- context
3401
+ context,
3402
+ service,
3403
+ xNode
3384
3404
  }) => {
3385
3405
  const jsonData = {
3386
3406
  model: "base_import.import" /* BASE_IMPORT */,
@@ -3411,11 +3431,14 @@ function useExcelService() {
3411
3431
  },
3412
3432
  with_context: context
3413
3433
  };
3414
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3415
- headers: {
3416
- "Content-Type": "application/json"
3417
- }
3418
- });
3434
+ return env.requests.post(
3435
+ "/call" /* CALL_PATH */,
3436
+ jsonData,
3437
+ {
3438
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3439
+ },
3440
+ service
3441
+ );
3419
3442
  },
3420
3443
  [env]
3421
3444
  );
@@ -3426,7 +3449,9 @@ function useExcelService() {
3426
3449
  idFile,
3427
3450
  options,
3428
3451
  dryrun,
3429
- context
3452
+ context,
3453
+ service,
3454
+ xNode
3430
3455
  }) => {
3431
3456
  const jsonData = {
3432
3457
  model: "base_import.import" /* BASE_IMPORT */,
@@ -3440,22 +3465,36 @@ function useExcelService() {
3440
3465
  },
3441
3466
  with_context: context
3442
3467
  };
3443
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3444
- headers: {
3445
- "Content-Type": "application/json"
3446
- }
3447
- });
3468
+ return env.requests.post(
3469
+ "/call" /* CALL_PATH */,
3470
+ jsonData,
3471
+ {
3472
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3473
+ },
3474
+ service
3475
+ );
3448
3476
  },
3449
3477
  [env]
3450
3478
  );
3451
3479
  const getFileExcel = (0, import_react5.useCallback)(
3452
- async ({ model }) => {
3480
+ async ({
3481
+ model,
3482
+ service,
3483
+ xNode
3484
+ }) => {
3453
3485
  const jsonData = {
3454
3486
  model,
3455
3487
  method: "get_import_templates" /* GET_IMPORT */,
3456
3488
  args: []
3457
3489
  };
3458
- return env.requests.post("/call" /* CALL_PATH */, jsonData);
3490
+ return env.requests.post(
3491
+ "/call" /* CALL_PATH */,
3492
+ jsonData,
3493
+ {
3494
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3495
+ },
3496
+ service
3497
+ );
3459
3498
  },
3460
3499
  [env]
3461
3500
  );
@@ -3470,7 +3509,9 @@ function useExcelService() {
3470
3509
  prefix,
3471
3510
  name,
3472
3511
  context,
3473
- importCompat
3512
+ importCompat,
3513
+ service,
3514
+ xNode
3474
3515
  }) => {
3475
3516
  const jsonData = {
3476
3517
  model,
@@ -3486,7 +3527,14 @@ function useExcelService() {
3486
3527
  jsonData.prefix = prefix;
3487
3528
  jsonData.exclude = [null];
3488
3529
  }
3489
- return env.requests.post("/export/get_fields", jsonData);
3530
+ return env.requests.post(
3531
+ "/export/get_fields",
3532
+ jsonData,
3533
+ {
3534
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3535
+ },
3536
+ service
3537
+ );
3490
3538
  },
3491
3539
  [env]
3492
3540
  );
@@ -3499,7 +3547,9 @@ function useExcelService() {
3499
3547
  type,
3500
3548
  importCompat,
3501
3549
  context,
3502
- groupby
3550
+ groupby,
3551
+ service,
3552
+ xNode
3503
3553
  }) => {
3504
3554
  const jsonData = {
3505
3555
  model,
@@ -3510,7 +3560,14 @@ function useExcelService() {
3510
3560
  with_context: context,
3511
3561
  groupby: groupby ?? []
3512
3562
  };
3513
- return env.requests.post_excel(`/export/${type}`, jsonData);
3563
+ return env.requests.post_excel(
3564
+ `/export/${type}`,
3565
+ jsonData,
3566
+ {
3567
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3568
+ },
3569
+ service
3570
+ );
3514
3571
  },
3515
3572
  [env]
3516
3573
  );
@@ -5749,7 +5806,9 @@ var useExportExcel = () => {
5749
5806
  type,
5750
5807
  importCompat,
5751
5808
  context,
5752
- groupby
5809
+ groupby,
5810
+ service,
5811
+ xNode
5753
5812
  }) => exportExcel({
5754
5813
  model,
5755
5814
  domain,
@@ -5758,7 +5817,9 @@ var useExportExcel = () => {
5758
5817
  type,
5759
5818
  importCompat,
5760
5819
  context,
5761
- groupby
5820
+ groupby,
5821
+ service,
5822
+ xNode
5762
5823
  })
5763
5824
  });
5764
5825
  };
@@ -5779,7 +5840,9 @@ var useGetFieldExport = () => {
5779
5840
  prefix,
5780
5841
  name,
5781
5842
  context,
5782
- importCompat
5843
+ importCompat,
5844
+ service,
5845
+ xNode
5783
5846
  }) => getFieldExport({
5784
5847
  ids,
5785
5848
  model,
@@ -5790,7 +5853,9 @@ var useGetFieldExport = () => {
5790
5853
  prefix,
5791
5854
  name,
5792
5855
  context,
5793
- importCompat
5856
+ importCompat,
5857
+ service,
5858
+ xNode
5794
5859
  })
5795
5860
  });
5796
5861
  };
@@ -5798,12 +5863,18 @@ var use_get_field_export_default = useGetFieldExport;
5798
5863
 
5799
5864
  // src/hooks/excel/use-get-file-excel.ts
5800
5865
  var import_react_query20 = require("@tanstack/react-query");
5801
- var useGetFileExcel = ({ model }) => {
5866
+ var useGetFileExcel = ({
5867
+ model,
5868
+ service,
5869
+ xNode
5870
+ }) => {
5802
5871
  const { getFileExcel } = useExcelService();
5803
5872
  return (0, import_react_query20.useQuery)({
5804
5873
  queryKey: [],
5805
5874
  queryFn: () => getFileExcel({
5806
- model
5875
+ model,
5876
+ service,
5877
+ xNode
5807
5878
  }).then((res) => {
5808
5879
  if (res) {
5809
5880
  return res;
@@ -5824,12 +5895,16 @@ var useParsePreview = () => {
5824
5895
  id,
5825
5896
  selectedSheet,
5826
5897
  isHeader,
5827
- context
5898
+ context,
5899
+ service,
5900
+ xNode
5828
5901
  }) => parsePreview({
5829
5902
  id,
5830
5903
  selectedSheet,
5831
5904
  isHeader,
5832
- context
5905
+ context,
5906
+ service,
5907
+ xNode
5833
5908
  })
5834
5909
  });
5835
5910
  };
@@ -5840,8 +5915,14 @@ var import_react_query22 = require("@tanstack/react-query");
5840
5915
  var useUploadFileExcel = () => {
5841
5916
  const { uploadFileExcel } = useExcelService();
5842
5917
  return (0, import_react_query22.useMutation)({
5843
- mutationFn: ({ formData }) => uploadFileExcel({
5844
- formData
5918
+ mutationFn: ({
5919
+ formData,
5920
+ service,
5921
+ xNode
5922
+ }) => uploadFileExcel({
5923
+ formData,
5924
+ service,
5925
+ xNode
5845
5926
  })
5846
5927
  });
5847
5928
  };
@@ -5852,8 +5933,14 @@ var import_react_query23 = require("@tanstack/react-query");
5852
5933
  var useUploadIdFile = () => {
5853
5934
  const { uploadIdFile } = useExcelService();
5854
5935
  return (0, import_react_query23.useMutation)({
5855
- mutationFn: ({ formData }) => uploadIdFile({
5856
- formData
5936
+ mutationFn: ({
5937
+ formData,
5938
+ service,
5939
+ xNode
5940
+ }) => uploadIdFile({
5941
+ formData,
5942
+ service,
5943
+ xNode
5857
5944
  })
5858
5945
  });
5859
5946
  };
@@ -5870,14 +5957,18 @@ var useExecuteImport = () => {
5870
5957
  idFile,
5871
5958
  options,
5872
5959
  dryrun,
5873
- context
5960
+ context,
5961
+ service,
5962
+ xNode
5874
5963
  }) => executeImport({
5875
5964
  fields,
5876
5965
  columns,
5877
5966
  idFile,
5878
5967
  options,
5879
5968
  dryrun,
5880
- context
5969
+ context,
5970
+ service,
5971
+ xNode
5881
5972
  })
5882
5973
  });
5883
5974
  };