sales-frontend-api 0.0.96 → 0.0.98

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/method.cjs CHANGED
@@ -315,11 +315,8 @@ var getTestMethod = async ({ id, config, setupFn }) => {
315
315
  const res = await httpClient.api.get(testAPI);
316
316
  return res.data;
317
317
  };
318
-
319
- // src/http-methods/search-modal/address/address-search.service.ts
320
318
  var getAddressListMethod = async (params, config) => {
321
- const serviceCode = getServiceCode();
322
- const apiUrl = `${serviceCode}/api/dis/v1/get/codes/address-list`;
319
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dis")}/v1/get/codes/address-list`;
323
320
  const httpClient = new HttpClientAxios(config);
324
321
  const res = await httpClient.api.post(apiUrl, params);
325
322
  return res.data;
@@ -335,11 +332,8 @@ var useSearchAddressQuery = (params, options, config) => {
335
332
  ...options
336
333
  });
337
334
  };
338
-
339
- // src/http-methods/search-modal/address/postal-code.service.ts
340
335
  var getAddressPostalCodeMethod = async (params, config) => {
341
- const serviceCode = getServiceCode();
342
- const apiUrl = `${serviceCode}/api/dis/v1/get/codes/address/postal-code`;
336
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dis")}/v1/get/codes/address/postal-code`;
343
337
  const httpClient = new HttpClientAxios(config);
344
338
  const res = await httpClient.api.post(apiUrl, params);
345
339
  return res.data;
@@ -355,11 +349,8 @@ var useSearchPostalCodeQuery = (params, options, config) => {
355
349
  ...options
356
350
  });
357
351
  };
358
-
359
- // src/http-methods/search-modal/address/address-standardization.service.ts
360
352
  var getAddressStandardizationListMethod = async (params, config) => {
361
- const serviceCode = getServiceCode();
362
- const apiUrl = `${serviceCode}/api/dis/v1/get/codes/address-standardization-list`;
353
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dis")}/v1/get/codes/address-standardization-list`;
363
354
  const httpClient = new HttpClientAxios(config);
364
355
  const res = await httpClient.api.post(apiUrl, params);
365
356
  return res.data;
@@ -375,18 +366,14 @@ var useSearchAddressStandardizationQuery = (params, options, config) => {
375
366
  ...options
376
367
  });
377
368
  };
378
-
379
- // src/http-methods/search-modal/occupation/occupation-search.service.ts
380
369
  var getOccupationListMethod = async (params, config) => {
381
- const serviceCode = getServiceCode();
382
- const apiUrl = `${serviceCode}/api/dis/v1/get/codes/occupation-list`;
370
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dis")}/v1/get/codes/occupation-list`;
383
371
  const httpClient = new HttpClientAxios(config);
384
372
  const res = await httpClient.api.post(apiUrl, params);
385
373
  return res.data;
386
374
  };
387
375
  var getOccupationDetailMethod = async (params, config) => {
388
- const serviceCode = getServiceCode();
389
- const apiUrl = `${serviceCode}/api/dis/v1/get/codes/occupation/detail`;
376
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dis")}/v1/get/codes/occupation/detail`;
390
377
  const httpClient = new HttpClientAxios(config);
391
378
  const res = await httpClient.api.post(apiUrl, params);
392
379
  return res.data;
@@ -413,11 +400,8 @@ var useSearchOccupationDetailQuery = (params, options, config) => {
413
400
  ...options
414
401
  });
415
402
  };
416
-
417
- // src/http-methods/search-modal/vehicle/vehicle-search.service.ts
418
403
  var getVehicleListMethod = async (config) => {
419
- const serviceCode = getServiceCode();
420
- const apiUrl = `${serviceCode}/api/dis/v1/get/codes/vehicle-type-list`;
404
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dis")}/v1/get/codes/vehicle-type-list`;
421
405
  const httpClient = new HttpClientAxios(config);
422
406
  const res = await httpClient.api.post(apiUrl);
423
407
  return res.data;
@@ -433,11 +417,8 @@ var useSearchVehicleQuery = (options, config) => {
433
417
  ...options
434
418
  });
435
419
  };
436
-
437
- // src/http-methods/search-modal/employee/employee-search.service.ts
438
420
  var getEmployeeProfileListMethod = async (params, config) => {
439
- const serviceCode = getServiceCode();
440
- const apiUrl = `${serviceCode}/api/dea/v1/get/participant/profile/employee`;
421
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dea")}/v1/get/participant/profile/employee`;
441
422
  const httpClient = new HttpClientAxios(config);
442
423
  const res = await httpClient.api.post(apiUrl, params);
443
424
  return res.data;
@@ -453,11 +434,8 @@ var useSearchEmployeeProfileQuery = (params, options, config) => {
453
434
  ...options
454
435
  });
455
436
  };
456
-
457
- // src/http-methods/search-modal/organization/organization-search.service.ts
458
437
  var getOrganizationProfileListMethod = async (params, config) => {
459
- const serviceCode = getServiceCode();
460
- const apiUrl = `${serviceCode}/api/dea/v1/get/participant/profile/organization`;
438
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dea")}/v1/get/participant/profile/organization`;
461
439
  const httpClient = new HttpClientAxios(config);
462
440
  const res = await httpClient.api.post(apiUrl, params);
463
441
  return res.data;
@@ -473,11 +451,8 @@ var useSearchOrganizationQuery = (params, options, config) => {
473
451
  ...options
474
452
  });
475
453
  };
476
-
477
- // src/http-methods/search-modal/nationality/nationality-search.service.ts
478
454
  var getNationalityListMethod = async (params, config) => {
479
- const serviceCode = getServiceCode();
480
- const apiUrl = `${serviceCode}/api/dis/v1/get/codes/nationality-list`;
455
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dis")}/v1/get/codes/nationality-list`;
481
456
  const httpClient = new HttpClientAxios(config);
482
457
  const res = await httpClient.api.post(apiUrl, params);
483
458
  return res.data;
@@ -494,11 +469,8 @@ var useSearchNationalityQuery = (params, options, config) => {
494
469
  ...options
495
470
  });
496
471
  };
497
-
498
- // src/http-methods/search-modal/customer-list/customer-list-search.service.ts
499
472
  var getCustomerListMethod = async (params, config) => {
500
- const serviceCode = getServiceCode();
501
- const apiUrl = `${serviceCode}/api/dis/v1/get/customer-list`;
473
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dis")}/v1/get/customer-list`;
502
474
  const httpClient = new HttpClientAxios(config);
503
475
  const res = await httpClient.api.post(apiUrl, params);
504
476
  return res.data;
@@ -514,11 +486,8 @@ var useSearchCustomerListQuery = (params, options, config) => {
514
486
  ...options
515
487
  });
516
488
  };
517
-
518
- // src/http-methods/search-modal/risk-grade/risk-grade-search.service.ts
519
489
  var getRiskGradeMethod = async (params, config) => {
520
- const serviceCode = getServiceCode();
521
- const apiUrl = `${serviceCode}/api/dis/v1/get/codes/risk-grade`;
490
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dis")}/v1/get/codes/risk-grade`;
522
491
  const httpClient = new HttpClientAxios(config);
523
492
  const res = await httpClient.api.post(apiUrl, params);
524
493
  return res.data;
@@ -534,11 +503,8 @@ var useSearchRiskGradeQuery = (params, options, config) => {
534
503
  ...options
535
504
  });
536
505
  };
537
-
538
- // src/http-methods/search-modal/dea-customer-list/dea-customer-list-search.service.ts
539
506
  var getDspCustomerListMethod = async (params, config) => {
540
- const serviceCode = getServiceCode();
541
- const apiUrl = `${serviceCode}/api/dea/v1/get/participant/profile/customer/personal`;
507
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dea")}/v1/get/participant/profile/customer/personal`;
542
508
  const httpClient = new HttpClientAxios(config);
543
509
  const res = await httpClient.api.post(apiUrl, params);
544
510
  return res.data;
@@ -554,11 +520,8 @@ var useSearchDspCustomerListQuery = (params, options, config) => {
554
520
  ...options
555
521
  });
556
522
  };
557
-
558
- // src/http-methods/search-modal/visa/visa-search.service.ts
559
523
  var getVisaListMethod = async (config) => {
560
- const serviceCode = getServiceCode();
561
- const apiUrl = `${serviceCode}/api/dis/v1/get/codes/visa-status-list`;
524
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dis")}/v1/get/codes/visa-status-list`;
562
525
  const httpClient = new HttpClientAxios(config);
563
526
  const res = await httpClient.api.post(apiUrl);
564
527
  return res.data;
@@ -574,11 +537,9 @@ var useSearchVisaQuery = (options, config) => {
574
537
  ...options
575
538
  });
576
539
  };
577
-
578
- // src/http-methods/fp-login/login-dsp.service.ts
579
540
  var postLoginMethod = async (userId) => {
580
541
  console.log("userId", userId);
581
- const apiUrl = "/api/dat/v1/post/login";
542
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dat")}/v1/post/login`;
582
543
  const httpClient = new HttpClientAxios({
583
544
  headers: {
584
545
  "Debug-Refresh-Queue-Off": "true"
@@ -590,29 +551,35 @@ var postLoginMethod = async (userId) => {
590
551
  });
591
552
  return res.data;
592
553
  };
593
-
594
- // src/http-methods/remote-identity-verification/remote-identity-verification.service.ts
595
554
  var getRemoteIdentityVerificationSystemToken = async (params, axiosConfig) => {
596
- const serviceCode = getServiceCode();
597
- const apiUrl = `${serviceCode}/api/dea/v1/post/participant/remote-identity-verification-system/token`;
555
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dea")}/v1/post/participant/remote-identity-verification-system/token`;
598
556
  const response = await new HttpClientAxios({
599
557
  ...axiosConfig
600
558
  }).api.post(apiUrl, params);
601
559
  return response.data;
602
560
  };
603
561
  var confirmRemoteIdentityVerificationSystemIdentificationCard = async (params, axiosConfig) => {
604
- const serviceCode = getServiceCode();
605
- const apiUrl = `${serviceCode}/api/dea/v1/post/participant/remote-identity-verification-system/identification-card/confirm`;
562
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dea")}/v1/post/participant/remote-identity-verification-system/identification-card/confirm`;
606
563
  const response = await new HttpClientAxios({
607
564
  ...axiosConfig
608
565
  }).api.post(apiUrl, params);
609
566
  return response.data;
610
567
  };
611
-
612
- // src/http-methods/common-code/common-code-search.service.ts
568
+ var useConfirmRemoteIdentityVerificationSystemIdentificationCardMutation = (options) => {
569
+ return reactQuery.useMutation({
570
+ mutationKey: ["confirmRemoteIdentityVerificationSystemIdentificationCard"],
571
+ mutationFn: async (params) => {
572
+ const response = await confirmRemoteIdentityVerificationSystemIdentificationCard(params);
573
+ if (response.isSuccess === false) {
574
+ throw new Error(`${response.code}: ${response.message}`);
575
+ }
576
+ return response.data;
577
+ },
578
+ ...options
579
+ });
580
+ };
613
581
  var getCommonCodeListMethod = async (param, config) => {
614
- const serviceCode = getServiceCode();
615
- const apiUrl = `${serviceCode}/api/dea/v1/get/common-code/list`;
582
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dea")}/v1/get/common-code/list`;
616
583
  const httpClient = new HttpClientAxios(config);
617
584
  const res = await httpClient.api.post(apiUrl, param);
618
585
  return res.data;
@@ -628,11 +595,8 @@ var useSearchCommonCodeQuery = (param, options, config) => {
628
595
  ...options
629
596
  });
630
597
  };
631
-
632
- // src/http-methods/app-config/app-config.service.ts
633
598
  var getUserProfile = async (axiosConfig) => {
634
- const serviceCode = getServiceCode();
635
- const apiUrl = `${serviceCode}/api/dat/v1/get/user/profile`;
599
+ const apiUrl = `${salesFrontendUtils.getDspApiHostNameFromEnvironment("dat")}/v1/get/user/profile`;
636
600
  const response = await new HttpClientAxios({
637
601
  ...axiosConfig
638
602
  }).api.post(apiUrl);
@@ -643,7 +607,7 @@ var getDayDiffFromToday = (date) => {
643
607
  return Math.floor(diff / (1e3 * 60 * 60 * 24));
644
608
  };
645
609
  var postFileUploadMethod = async (params, config) => {
646
- const apiUrl = `${salesFrontendUtils.getDudApiHostNameFromEnvironment(getServiceCode(), location.hostname)}/v1/post/file`;
610
+ const apiUrl = `${salesFrontendUtils.getDudApiHostNameFromEnvironment()}/v1/post/file`;
647
611
  const formData = new FormData();
648
612
  if (params.data instanceof File) {
649
613
  formData.append("data", params.data, params.name || params.data.name);
@@ -656,7 +620,7 @@ var postFileUploadMethod = async (params, config) => {
656
620
  params.expireDate && formData.append("preservationTerm", (getDayDiffFromToday(params.expireDate) + 1).toString() || "1");
657
621
  params.preservationTerm && formData.append("preservationTerm", params.preservationTerm.toString() || "1");
658
622
  formData.append("fileType", params.fileType || params.data.type.split("/").pop() || "png");
659
- const httpClient = new HttpClientAxios(config);
623
+ const httpClient = new HttpClientAxios({ ...config, withCredentials: false });
660
624
  httpClient.api.interceptors.response.use((response) => {
661
625
  const { data } = response;
662
626
  if (data.isSuccess === true && data.code.includes("erro")) {
@@ -668,7 +632,7 @@ var postFileUploadMethod = async (params, config) => {
668
632
  return res.data;
669
633
  };
670
634
  async function postFileDownloadMethod(params, config) {
671
- const apiUrl = `${getServiceCode()}/api/dud/v1/get/file`;
635
+ const apiUrl = `${salesFrontendUtils.getDudApiHostNameFromEnvironment()}/v1/get/file`;
672
636
  const httpClient = new HttpClientAxios({
673
637
  ...config,
674
638
  ...params.outputType === "BINARY" && { responseType: "blob" }
@@ -734,6 +698,7 @@ exports.getVisaListMethod = getVisaListMethod;
734
698
  exports.postFileDownloadMethod = postFileDownloadMethod;
735
699
  exports.postFileUploadMethod = postFileUploadMethod;
736
700
  exports.postLoginMethod = postLoginMethod;
701
+ exports.useConfirmRemoteIdentityVerificationSystemIdentificationCardMutation = useConfirmRemoteIdentityVerificationSystemIdentificationCardMutation;
737
702
  exports.useDudExternalFileDownloadQuery = useDudExternalFileDownloadQuery;
738
703
  exports.useDudExternalFileUploadMutation = useDudExternalFileUploadMutation;
739
704
  exports.useDudExternalFileUploadQuery = useDudExternalFileUploadQuery;