@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/provider.mjs CHANGED
@@ -3317,18 +3317,36 @@ import { useCallback as useCallback4 } from "react";
3317
3317
  function useExcelService() {
3318
3318
  const { env } = useEnv();
3319
3319
  const uploadFileExcel = useCallback4(
3320
- async ({ formData }) => {
3321
- return env.requests.post("/upload/file" /* UPLOAD_FILE_EXCEL_PATH */, formData);
3320
+ async ({
3321
+ formData,
3322
+ service,
3323
+ xNode
3324
+ }) => {
3325
+ return env.requests.post(
3326
+ "/upload/file" /* UPLOAD_FILE_EXCEL_PATH */,
3327
+ formData,
3328
+ {
3329
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3330
+ },
3331
+ service
3332
+ );
3322
3333
  },
3323
3334
  [env]
3324
3335
  );
3325
3336
  const uploadIdFile = useCallback4(
3326
- async ({ formData }) => {
3327
- return env.requests.post("/upload/file" /* UPLOAD_FILE_EXCEL_PATH */, formData, {
3328
- headers: {
3329
- "Content-Type": "multipart/form-data"
3330
- }
3331
- });
3337
+ async ({
3338
+ formData,
3339
+ service,
3340
+ xNode
3341
+ }) => {
3342
+ return env.requests.post(
3343
+ "/upload/file" /* UPLOAD_FILE_EXCEL_PATH */,
3344
+ formData,
3345
+ {
3346
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3347
+ },
3348
+ service
3349
+ );
3332
3350
  },
3333
3351
  [env]
3334
3352
  );
@@ -3337,7 +3355,9 @@ function useExcelService() {
3337
3355
  id,
3338
3356
  selectedSheet,
3339
3357
  isHeader,
3340
- context
3358
+ context,
3359
+ service,
3360
+ xNode
3341
3361
  }) => {
3342
3362
  const jsonData = {
3343
3363
  model: "base_import.import" /* BASE_IMPORT */,
@@ -3368,11 +3388,14 @@ function useExcelService() {
3368
3388
  },
3369
3389
  with_context: context
3370
3390
  };
3371
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3372
- headers: {
3373
- "Content-Type": "application/json"
3374
- }
3375
- });
3391
+ return env.requests.post(
3392
+ "/call" /* CALL_PATH */,
3393
+ jsonData,
3394
+ {
3395
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3396
+ },
3397
+ service
3398
+ );
3376
3399
  },
3377
3400
  [env]
3378
3401
  );
@@ -3383,7 +3406,9 @@ function useExcelService() {
3383
3406
  idFile,
3384
3407
  options,
3385
3408
  dryrun,
3386
- context
3409
+ context,
3410
+ service,
3411
+ xNode
3387
3412
  }) => {
3388
3413
  const jsonData = {
3389
3414
  model: "base_import.import" /* BASE_IMPORT */,
@@ -3397,22 +3422,36 @@ function useExcelService() {
3397
3422
  },
3398
3423
  with_context: context
3399
3424
  };
3400
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3401
- headers: {
3402
- "Content-Type": "application/json"
3403
- }
3404
- });
3425
+ return env.requests.post(
3426
+ "/call" /* CALL_PATH */,
3427
+ jsonData,
3428
+ {
3429
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3430
+ },
3431
+ service
3432
+ );
3405
3433
  },
3406
3434
  [env]
3407
3435
  );
3408
3436
  const getFileExcel = useCallback4(
3409
- async ({ model }) => {
3437
+ async ({
3438
+ model,
3439
+ service,
3440
+ xNode
3441
+ }) => {
3410
3442
  const jsonData = {
3411
3443
  model,
3412
3444
  method: "get_import_templates" /* GET_IMPORT */,
3413
3445
  args: []
3414
3446
  };
3415
- return env.requests.post("/call" /* CALL_PATH */, jsonData);
3447
+ return env.requests.post(
3448
+ "/call" /* CALL_PATH */,
3449
+ jsonData,
3450
+ {
3451
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3452
+ },
3453
+ service
3454
+ );
3416
3455
  },
3417
3456
  [env]
3418
3457
  );
@@ -3427,7 +3466,9 @@ function useExcelService() {
3427
3466
  prefix,
3428
3467
  name,
3429
3468
  context,
3430
- importCompat
3469
+ importCompat,
3470
+ service,
3471
+ xNode
3431
3472
  }) => {
3432
3473
  const jsonData = {
3433
3474
  model,
@@ -3443,7 +3484,14 @@ function useExcelService() {
3443
3484
  jsonData.prefix = prefix;
3444
3485
  jsonData.exclude = [null];
3445
3486
  }
3446
- return env.requests.post("/export/get_fields", jsonData);
3487
+ return env.requests.post(
3488
+ "/export/get_fields",
3489
+ jsonData,
3490
+ {
3491
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3492
+ },
3493
+ service
3494
+ );
3447
3495
  },
3448
3496
  [env]
3449
3497
  );
@@ -3456,7 +3504,9 @@ function useExcelService() {
3456
3504
  type,
3457
3505
  importCompat,
3458
3506
  context,
3459
- groupby
3507
+ groupby,
3508
+ service,
3509
+ xNode
3460
3510
  }) => {
3461
3511
  const jsonData = {
3462
3512
  model,
@@ -3467,7 +3517,14 @@ function useExcelService() {
3467
3517
  with_context: context,
3468
3518
  groupby: groupby ?? []
3469
3519
  };
3470
- return env.requests.post_excel(`/export/${type}`, jsonData);
3520
+ return env.requests.post_excel(
3521
+ `/export/${type}`,
3522
+ jsonData,
3523
+ {
3524
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3525
+ },
3526
+ service
3527
+ );
3471
3528
  },
3472
3529
  [env]
3473
3530
  );
@@ -5706,7 +5763,9 @@ var useExportExcel = () => {
5706
5763
  type,
5707
5764
  importCompat,
5708
5765
  context,
5709
- groupby
5766
+ groupby,
5767
+ service,
5768
+ xNode
5710
5769
  }) => exportExcel({
5711
5770
  model,
5712
5771
  domain,
@@ -5715,7 +5774,9 @@ var useExportExcel = () => {
5715
5774
  type,
5716
5775
  importCompat,
5717
5776
  context,
5718
- groupby
5777
+ groupby,
5778
+ service,
5779
+ xNode
5719
5780
  })
5720
5781
  });
5721
5782
  };
@@ -5736,7 +5797,9 @@ var useGetFieldExport = () => {
5736
5797
  prefix,
5737
5798
  name,
5738
5799
  context,
5739
- importCompat
5800
+ importCompat,
5801
+ service,
5802
+ xNode
5740
5803
  }) => getFieldExport({
5741
5804
  ids,
5742
5805
  model,
@@ -5747,7 +5810,9 @@ var useGetFieldExport = () => {
5747
5810
  prefix,
5748
5811
  name,
5749
5812
  context,
5750
- importCompat
5813
+ importCompat,
5814
+ service,
5815
+ xNode
5751
5816
  })
5752
5817
  });
5753
5818
  };
@@ -5755,12 +5820,18 @@ var use_get_field_export_default = useGetFieldExport;
5755
5820
 
5756
5821
  // src/hooks/excel/use-get-file-excel.ts
5757
5822
  import { useQuery as useQuery2 } from "@tanstack/react-query";
5758
- var useGetFileExcel = ({ model }) => {
5823
+ var useGetFileExcel = ({
5824
+ model,
5825
+ service,
5826
+ xNode
5827
+ }) => {
5759
5828
  const { getFileExcel } = useExcelService();
5760
5829
  return useQuery2({
5761
5830
  queryKey: [],
5762
5831
  queryFn: () => getFileExcel({
5763
- model
5832
+ model,
5833
+ service,
5834
+ xNode
5764
5835
  }).then((res) => {
5765
5836
  if (res) {
5766
5837
  return res;
@@ -5781,12 +5852,16 @@ var useParsePreview = () => {
5781
5852
  id,
5782
5853
  selectedSheet,
5783
5854
  isHeader,
5784
- context
5855
+ context,
5856
+ service,
5857
+ xNode
5785
5858
  }) => parsePreview({
5786
5859
  id,
5787
5860
  selectedSheet,
5788
5861
  isHeader,
5789
- context
5862
+ context,
5863
+ service,
5864
+ xNode
5790
5865
  })
5791
5866
  });
5792
5867
  };
@@ -5797,8 +5872,14 @@ import { useMutation as useMutation18 } from "@tanstack/react-query";
5797
5872
  var useUploadFileExcel = () => {
5798
5873
  const { uploadFileExcel } = useExcelService();
5799
5874
  return useMutation18({
5800
- mutationFn: ({ formData }) => uploadFileExcel({
5801
- formData
5875
+ mutationFn: ({
5876
+ formData,
5877
+ service,
5878
+ xNode
5879
+ }) => uploadFileExcel({
5880
+ formData,
5881
+ service,
5882
+ xNode
5802
5883
  })
5803
5884
  });
5804
5885
  };
@@ -5809,8 +5890,14 @@ import { useMutation as useMutation19 } from "@tanstack/react-query";
5809
5890
  var useUploadIdFile = () => {
5810
5891
  const { uploadIdFile } = useExcelService();
5811
5892
  return useMutation19({
5812
- mutationFn: ({ formData }) => uploadIdFile({
5813
- formData
5893
+ mutationFn: ({
5894
+ formData,
5895
+ service,
5896
+ xNode
5897
+ }) => uploadIdFile({
5898
+ formData,
5899
+ service,
5900
+ xNode
5814
5901
  })
5815
5902
  });
5816
5903
  };
@@ -5827,14 +5914,18 @@ var useExecuteImport = () => {
5827
5914
  idFile,
5828
5915
  options,
5829
5916
  dryrun,
5830
- context
5917
+ context,
5918
+ service,
5919
+ xNode
5831
5920
  }) => executeImport({
5832
5921
  fields,
5833
5922
  columns,
5834
5923
  idFile,
5835
5924
  options,
5836
5925
  dryrun,
5837
- context
5926
+ context,
5927
+ service,
5928
+ xNode
5838
5929
  })
5839
5930
  });
5840
5931
  };
@@ -84,30 +84,40 @@ declare function useCompanyService(): {
84
84
  };
85
85
 
86
86
  declare function useExcelService(): {
87
- uploadFileExcel: ({ formData }: {
87
+ uploadFileExcel: ({ formData, service, xNode, }: {
88
88
  formData: any;
89
+ service?: string;
90
+ xNode?: string;
89
91
  }) => Promise<any>;
90
- uploadIdFile: ({ formData }: {
92
+ uploadIdFile: ({ formData, service, xNode, }: {
91
93
  formData: any;
94
+ service?: string;
95
+ xNode?: string;
92
96
  }) => Promise<any>;
93
- parsePreview: ({ id, selectedSheet, isHeader, context, }: {
97
+ parsePreview: ({ id, selectedSheet, isHeader, context, service, xNode, }: {
94
98
  id: any;
95
99
  selectedSheet: any;
96
100
  isHeader: boolean;
97
101
  context: any;
102
+ service?: string;
103
+ xNode?: string;
98
104
  }) => Promise<any>;
99
- executeImport: ({ columns, fields, idFile, options, dryrun, context, }: {
105
+ executeImport: ({ columns, fields, idFile, options, dryrun, context, service, xNode, }: {
100
106
  columns: any;
101
107
  fields: any;
102
108
  idFile: any;
103
109
  options: any;
104
110
  dryrun: any;
105
111
  context: any;
112
+ service?: string;
113
+ xNode?: string;
106
114
  }) => Promise<any>;
107
- getFileExcel: ({ model }: {
115
+ getFileExcel: ({ model, service, xNode, }: {
108
116
  model: string;
117
+ service?: string;
118
+ xNode?: string;
109
119
  }) => Promise<any>;
110
- getFieldExport: ({ ids, model, isShow, parentField, fieldType, parentName, prefix, name, context, importCompat, }: {
120
+ getFieldExport: ({ ids, model, isShow, parentField, fieldType, parentName, prefix, name, context, importCompat, service, xNode, }: {
111
121
  ids: any;
112
122
  model: string;
113
123
  isShow?: boolean;
@@ -118,8 +128,10 @@ declare function useExcelService(): {
118
128
  name?: any;
119
129
  context: any;
120
130
  importCompat?: any;
131
+ service?: string;
132
+ xNode?: string;
121
133
  }) => Promise<any>;
122
- exportExcel: ({ model, domain, ids, fields, type, importCompat, context, groupby, }: {
134
+ exportExcel: ({ model, domain, ids, fields, type, importCompat, context, groupby, service, xNode, }: {
123
135
  model: string;
124
136
  domain: any;
125
137
  ids: any;
@@ -128,6 +140,8 @@ declare function useExcelService(): {
128
140
  importCompat: any;
129
141
  context: any;
130
142
  groupby: any;
143
+ service?: string;
144
+ xNode?: string;
131
145
  }) => Promise<any>;
132
146
  };
133
147
 
@@ -84,30 +84,40 @@ declare function useCompanyService(): {
84
84
  };
85
85
 
86
86
  declare function useExcelService(): {
87
- uploadFileExcel: ({ formData }: {
87
+ uploadFileExcel: ({ formData, service, xNode, }: {
88
88
  formData: any;
89
+ service?: string;
90
+ xNode?: string;
89
91
  }) => Promise<any>;
90
- uploadIdFile: ({ formData }: {
92
+ uploadIdFile: ({ formData, service, xNode, }: {
91
93
  formData: any;
94
+ service?: string;
95
+ xNode?: string;
92
96
  }) => Promise<any>;
93
- parsePreview: ({ id, selectedSheet, isHeader, context, }: {
97
+ parsePreview: ({ id, selectedSheet, isHeader, context, service, xNode, }: {
94
98
  id: any;
95
99
  selectedSheet: any;
96
100
  isHeader: boolean;
97
101
  context: any;
102
+ service?: string;
103
+ xNode?: string;
98
104
  }) => Promise<any>;
99
- executeImport: ({ columns, fields, idFile, options, dryrun, context, }: {
105
+ executeImport: ({ columns, fields, idFile, options, dryrun, context, service, xNode, }: {
100
106
  columns: any;
101
107
  fields: any;
102
108
  idFile: any;
103
109
  options: any;
104
110
  dryrun: any;
105
111
  context: any;
112
+ service?: string;
113
+ xNode?: string;
106
114
  }) => Promise<any>;
107
- getFileExcel: ({ model }: {
115
+ getFileExcel: ({ model, service, xNode, }: {
108
116
  model: string;
117
+ service?: string;
118
+ xNode?: string;
109
119
  }) => Promise<any>;
110
- getFieldExport: ({ ids, model, isShow, parentField, fieldType, parentName, prefix, name, context, importCompat, }: {
120
+ getFieldExport: ({ ids, model, isShow, parentField, fieldType, parentName, prefix, name, context, importCompat, service, xNode, }: {
111
121
  ids: any;
112
122
  model: string;
113
123
  isShow?: boolean;
@@ -118,8 +128,10 @@ declare function useExcelService(): {
118
128
  name?: any;
119
129
  context: any;
120
130
  importCompat?: any;
131
+ service?: string;
132
+ xNode?: string;
121
133
  }) => Promise<any>;
122
- exportExcel: ({ model, domain, ids, fields, type, importCompat, context, groupby, }: {
134
+ exportExcel: ({ model, domain, ids, fields, type, importCompat, context, groupby, service, xNode, }: {
123
135
  model: string;
124
136
  domain: any;
125
137
  ids: any;
@@ -128,6 +140,8 @@ declare function useExcelService(): {
128
140
  importCompat: any;
129
141
  context: any;
130
142
  groupby: any;
143
+ service?: string;
144
+ xNode?: string;
131
145
  }) => Promise<any>;
132
146
  };
133
147
 
package/dist/services.js CHANGED
@@ -3581,18 +3581,36 @@ var import_react9 = require("react");
3581
3581
  function useExcelService() {
3582
3582
  const { env } = useEnv();
3583
3583
  const uploadFileExcel = (0, import_react9.useCallback)(
3584
- async ({ formData }) => {
3585
- return env.requests.post("/upload/file" /* UPLOAD_FILE_EXCEL_PATH */, formData);
3584
+ async ({
3585
+ formData,
3586
+ service,
3587
+ xNode
3588
+ }) => {
3589
+ return env.requests.post(
3590
+ "/upload/file" /* UPLOAD_FILE_EXCEL_PATH */,
3591
+ formData,
3592
+ {
3593
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3594
+ },
3595
+ service
3596
+ );
3586
3597
  },
3587
3598
  [env]
3588
3599
  );
3589
3600
  const uploadIdFile = (0, import_react9.useCallback)(
3590
- async ({ formData }) => {
3591
- return env.requests.post("/upload/file" /* UPLOAD_FILE_EXCEL_PATH */, formData, {
3592
- headers: {
3593
- "Content-Type": "multipart/form-data"
3594
- }
3595
- });
3601
+ async ({
3602
+ formData,
3603
+ service,
3604
+ xNode
3605
+ }) => {
3606
+ return env.requests.post(
3607
+ "/upload/file" /* UPLOAD_FILE_EXCEL_PATH */,
3608
+ formData,
3609
+ {
3610
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3611
+ },
3612
+ service
3613
+ );
3596
3614
  },
3597
3615
  [env]
3598
3616
  );
@@ -3601,7 +3619,9 @@ function useExcelService() {
3601
3619
  id,
3602
3620
  selectedSheet,
3603
3621
  isHeader,
3604
- context
3622
+ context,
3623
+ service,
3624
+ xNode
3605
3625
  }) => {
3606
3626
  const jsonData = {
3607
3627
  model: "base_import.import" /* BASE_IMPORT */,
@@ -3632,11 +3652,14 @@ function useExcelService() {
3632
3652
  },
3633
3653
  with_context: context
3634
3654
  };
3635
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3636
- headers: {
3637
- "Content-Type": "application/json"
3638
- }
3639
- });
3655
+ return env.requests.post(
3656
+ "/call" /* CALL_PATH */,
3657
+ jsonData,
3658
+ {
3659
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3660
+ },
3661
+ service
3662
+ );
3640
3663
  },
3641
3664
  [env]
3642
3665
  );
@@ -3647,7 +3670,9 @@ function useExcelService() {
3647
3670
  idFile,
3648
3671
  options,
3649
3672
  dryrun,
3650
- context
3673
+ context,
3674
+ service,
3675
+ xNode
3651
3676
  }) => {
3652
3677
  const jsonData = {
3653
3678
  model: "base_import.import" /* BASE_IMPORT */,
@@ -3661,22 +3686,36 @@ function useExcelService() {
3661
3686
  },
3662
3687
  with_context: context
3663
3688
  };
3664
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3665
- headers: {
3666
- "Content-Type": "application/json"
3667
- }
3668
- });
3689
+ return env.requests.post(
3690
+ "/call" /* CALL_PATH */,
3691
+ jsonData,
3692
+ {
3693
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3694
+ },
3695
+ service
3696
+ );
3669
3697
  },
3670
3698
  [env]
3671
3699
  );
3672
3700
  const getFileExcel = (0, import_react9.useCallback)(
3673
- async ({ model }) => {
3701
+ async ({
3702
+ model,
3703
+ service,
3704
+ xNode
3705
+ }) => {
3674
3706
  const jsonData = {
3675
3707
  model,
3676
3708
  method: "get_import_templates" /* GET_IMPORT */,
3677
3709
  args: []
3678
3710
  };
3679
- return env.requests.post("/call" /* CALL_PATH */, jsonData);
3711
+ return env.requests.post(
3712
+ "/call" /* CALL_PATH */,
3713
+ jsonData,
3714
+ {
3715
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3716
+ },
3717
+ service
3718
+ );
3680
3719
  },
3681
3720
  [env]
3682
3721
  );
@@ -3691,7 +3730,9 @@ function useExcelService() {
3691
3730
  prefix,
3692
3731
  name,
3693
3732
  context,
3694
- importCompat
3733
+ importCompat,
3734
+ service,
3735
+ xNode
3695
3736
  }) => {
3696
3737
  const jsonData = {
3697
3738
  model,
@@ -3707,7 +3748,14 @@ function useExcelService() {
3707
3748
  jsonData.prefix = prefix;
3708
3749
  jsonData.exclude = [null];
3709
3750
  }
3710
- return env.requests.post("/export/get_fields", jsonData);
3751
+ return env.requests.post(
3752
+ "/export/get_fields",
3753
+ jsonData,
3754
+ {
3755
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3756
+ },
3757
+ service
3758
+ );
3711
3759
  },
3712
3760
  [env]
3713
3761
  );
@@ -3720,7 +3768,9 @@ function useExcelService() {
3720
3768
  type,
3721
3769
  importCompat,
3722
3770
  context,
3723
- groupby
3771
+ groupby,
3772
+ service,
3773
+ xNode
3724
3774
  }) => {
3725
3775
  const jsonData = {
3726
3776
  model,
@@ -3731,7 +3781,14 @@ function useExcelService() {
3731
3781
  with_context: context,
3732
3782
  groupby: groupby ?? []
3733
3783
  };
3734
- return env.requests.post_excel(`/export/${type}`, jsonData);
3784
+ return env.requests.post_excel(
3785
+ `/export/${type}`,
3786
+ jsonData,
3787
+ {
3788
+ headers: { "Content-Type": "application/json", "X-Node": xNode }
3789
+ },
3790
+ service
3791
+ );
3735
3792
  },
3736
3793
  [env]
3737
3794
  );