@gofynd/fdk-client-javascript 1.6.3 → 2.0.0

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.
Files changed (146) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.d.ts +5 -5
  4. package/sdk/application/Cart/CartApplicationClient.js +26 -268
  5. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +20 -20
  6. package/sdk/application/Catalog/CatalogApplicationClient.js +98 -347
  7. package/sdk/application/Common/CommonApplicationClient.js +1 -16
  8. package/sdk/application/Communication/CommunicationApplicationClient.js +1 -24
  9. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +24 -2
  10. package/sdk/application/Configuration/ConfigurationApplicationClient.js +58 -137
  11. package/sdk/application/Content/ContentApplicationClient.d.ts +47 -7
  12. package/sdk/application/Content/ContentApplicationClient.js +222 -191
  13. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +2 -2
  14. package/sdk/application/FileStorage/FileStorageApplicationClient.js +11 -30
  15. package/sdk/application/Finance/FinanceApplicationClient.js +1 -16
  16. package/sdk/application/Lead/LeadApplicationClient.d.ts +4 -4
  17. package/sdk/application/Lead/LeadApplicationClient.js +21 -52
  18. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +16 -56
  19. package/sdk/application/Logistic/LogisticApplicationClient.js +57 -332
  20. package/sdk/application/Order/OrderApplicationClient.d.ts +11 -11
  21. package/sdk/application/Order/OrderApplicationClient.js +68 -153
  22. package/sdk/application/Payment/PaymentApplicationClient.d.ts +2 -12
  23. package/sdk/application/Payment/PaymentApplicationClient.js +7 -487
  24. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +1 -1
  25. package/sdk/application/Rewards/RewardsApplicationClient.js +6 -59
  26. package/sdk/application/Share/ShareApplicationClient.d.ts +4 -4
  27. package/sdk/application/Share/ShareApplicationClient.js +21 -75
  28. package/sdk/application/Theme/ThemeApplicationClient.d.ts +3 -3
  29. package/sdk/application/Theme/ThemeApplicationClient.js +19 -47
  30. package/sdk/application/User/UserApplicationClient.js +1 -407
  31. package/sdk/application/Webhook/WebhookApplicationClient.js +1 -8
  32. package/sdk/common/Utility.d.ts +1 -1
  33. package/sdk/common/Utility.js +4 -4
  34. package/sdk/common/Validator.d.ts +1 -0
  35. package/sdk/common/Validator.js +20 -0
  36. package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +1 -55
  37. package/sdk/partner/FileStorage/FileStoragePartnerClient.js +1 -408
  38. package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +0 -5
  39. package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +0 -37
  40. package/sdk/partner/Lead/LeadPartnerModel.d.ts +5 -0
  41. package/sdk/partner/Lead/LeadPartnerModel.js +2 -0
  42. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +29 -25
  43. package/sdk/partner/Logistics/LogisticsPartnerClient.js +65 -42
  44. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +1008 -794
  45. package/sdk/partner/Logistics/LogisticsPartnerModel.js +573 -460
  46. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +10 -5
  47. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +64 -1
  48. package/sdk/partner/Webhook/WebhookPartnerModel.js +36 -0
  49. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +5 -0
  50. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +2 -0
  51. package/sdk/platform/Cart/CartPlatformModel.d.ts +67 -9
  52. package/sdk/platform/Cart/CartPlatformModel.js +38 -5
  53. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1 -1
  54. package/sdk/platform/Catalog/CatalogPlatformClient.js +4 -4
  55. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +47 -13
  56. package/sdk/platform/Catalog/CatalogPlatformModel.js +29 -7
  57. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +2 -2
  58. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +7 -4
  59. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +71 -7
  60. package/sdk/platform/Communication/CommunicationPlatformModel.js +70 -6
  61. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +0 -27
  62. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +8 -60
  63. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +31 -20
  64. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +18 -18
  65. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +1 -1
  66. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +3 -3
  67. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +13 -0
  68. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +30 -1
  69. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +68 -11
  70. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +49 -7
  71. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +169 -0
  72. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1279 -132
  73. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +156 -1
  74. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +180 -0
  75. package/sdk/platform/Content/ContentPlatformClient.d.ts +162 -0
  76. package/sdk/platform/Content/ContentPlatformClient.js +1697 -497
  77. package/sdk/platform/Content/ContentPlatformModel.d.ts +1053 -35
  78. package/sdk/platform/Content/ContentPlatformModel.js +717 -34
  79. package/sdk/platform/Content/ContentPlatformValidator.d.ts +127 -1
  80. package/sdk/platform/Content/ContentPlatformValidator.js +171 -0
  81. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +34 -0
  82. package/sdk/platform/Discount/DiscountPlatformClient.js +59 -0
  83. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +365 -93
  84. package/sdk/platform/Discount/DiscountPlatformModel.js +98 -93
  85. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +54 -34
  86. package/sdk/platform/Discount/DiscountPlatformValidator.js +27 -17
  87. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +0 -156
  88. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +0 -1072
  89. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -137
  90. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +0 -173
  91. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +1 -1105
  92. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +0 -1125
  93. package/sdk/platform/Lead/LeadPlatformModel.d.ts +5 -0
  94. package/sdk/platform/Lead/LeadPlatformModel.js +2 -0
  95. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  96. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  97. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  98. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  99. package/sdk/platform/Order/OrderPlatformClient.d.ts +212 -0
  100. package/sdk/platform/Order/OrderPlatformClient.js +397 -0
  101. package/sdk/platform/Order/OrderPlatformModel.d.ts +66 -10
  102. package/sdk/platform/Order/OrderPlatformModel.js +39 -7
  103. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  104. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  105. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +58 -10
  106. package/sdk/platform/Partner/PartnerPlatformModel.js +19 -10
  107. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +12 -2
  108. package/sdk/platform/Payment/PaymentPlatformModel.js +8 -2
  109. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +5 -0
  110. package/sdk/platform/Rewards/RewardsPlatformModel.js +2 -0
  111. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +240 -24
  112. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +1753 -277
  113. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +320 -22
  114. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +269 -19
  115. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +53 -104
  116. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +201 -629
  117. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +5720 -2891
  118. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +3414 -2181
  119. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +138 -216
  120. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +81 -148
  121. package/sdk/platform/Share/SharePlatformModel.d.ts +5 -0
  122. package/sdk/platform/Share/SharePlatformModel.js +2 -0
  123. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +73 -0
  124. package/sdk/platform/User/UserPlatformApplicationClient.js +543 -0
  125. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +129 -1
  126. package/sdk/platform/User/UserPlatformApplicationValidator.js +97 -0
  127. package/sdk/platform/User/UserPlatformModel.d.ts +269 -6
  128. package/sdk/platform/User/UserPlatformModel.js +187 -5
  129. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +64 -1
  130. package/sdk/platform/Webhook/WebhookPlatformModel.js +36 -0
  131. package/sdk/public/Catalog/CatalogPublicClient.d.ts +1 -1
  132. package/sdk/public/Catalog/CatalogPublicClient.js +6 -11
  133. package/sdk/public/Configuration/ConfigurationPublicClient.js +1 -16
  134. package/sdk/public/Content/ContentPublicClient.d.ts +36 -3
  135. package/sdk/public/Content/ContentPublicClient.js +261 -104
  136. package/sdk/public/Content/ContentPublicModel.d.ts +155 -1
  137. package/sdk/public/Content/ContentPublicModel.js +102 -0
  138. package/sdk/public/Content/ContentPublicValidator.d.ts +18 -1
  139. package/sdk/public/Content/ContentPublicValidator.js +26 -0
  140. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  141. package/sdk/public/Partner/PartnerPublicClient.js +6 -11
  142. package/sdk/public/Partner/PartnerPublicModel.d.ts +248 -72
  143. package/sdk/public/Partner/PartnerPublicModel.js +81 -71
  144. package/sdk/public/Partner/PartnerPublicValidator.d.ts +2 -2
  145. package/sdk/public/Partner/PartnerPublicValidator.js +1 -1
  146. package/sdk/public/Webhook/WebhookPublicClient.js +1 -40
@@ -102,86 +102,6 @@ class FileStorage {
102
102
  return response;
103
103
  }
104
104
 
105
- /**
106
- * @param {FileStoragePlatformApplicationValidator.AppCopyFilesParam} arg - Arg object
107
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
108
- * @param {import("../PlatformAPIClient").Options} - Options
109
- * @returns {Promise<Object>} - Success response
110
- * @name appCopyFiles
111
- * @summary: Application copy files.
112
- * @description: Copy files from an application to another location. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/appCopyFiles/).
113
- */
114
- async appCopyFiles(
115
- { body, sync, requestHeaders } = { requestHeaders: {} },
116
- { responseHeaders } = { responseHeaders: false }
117
- ) {
118
- const {
119
- error,
120
- } = FileStoragePlatformApplicationValidator.appCopyFiles().validate(
121
- {
122
- body,
123
- sync,
124
- },
125
- { abortEarly: false, allowUnknown: true }
126
- );
127
- if (error) {
128
- return Promise.reject(new FDKClientValidationError(error));
129
- }
130
-
131
- // Showing warrnings if extra unknown parameters are found
132
- const {
133
- error: warrning,
134
- } = FileStoragePlatformApplicationValidator.appCopyFiles().validate(
135
- {
136
- body,
137
- sync,
138
- },
139
- { abortEarly: false, allowUnknown: false }
140
- );
141
- if (warrning) {
142
- Logger({
143
- level: "WARN",
144
- message: `Parameter Validation warrnings for platform > FileStorage > appCopyFiles \n ${warrning}`,
145
- });
146
- }
147
-
148
- const query_params = {};
149
- query_params["sync"] = sync;
150
-
151
- const response = await PlatformAPIClient.execute(
152
- this.config,
153
- "post",
154
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/uploads/copy`,
155
- query_params,
156
- body,
157
- requestHeaders,
158
- { responseHeaders }
159
- );
160
-
161
- let responseData = response;
162
- if (responseHeaders) {
163
- responseData = response[0];
164
- }
165
-
166
- const { error: res_error } = Joi.any().validate(responseData, {
167
- abortEarly: false,
168
- allowUnknown: true,
169
- });
170
-
171
- if (res_error) {
172
- if (this.config.options.strictResponseCheck === true) {
173
- return Promise.reject(new FDKResponseValidationError(res_error));
174
- } else {
175
- Logger({
176
- level: "WARN",
177
- message: `Response Validation Warnings for platform > FileStorage > appCopyFiles \n ${res_error}`,
178
- });
179
- }
180
- }
181
-
182
- return response;
183
- }
184
-
185
105
  /**
186
106
  * @param {FileStoragePlatformApplicationValidator.AppStartUploadParam} arg
187
107
  * - Arg object
@@ -446,998 +366,6 @@ class FileStorage {
446
366
 
447
367
  return response;
448
368
  }
449
-
450
- /**
451
- * @param {FileStoragePlatformApplicationValidator.DeletePdfGeneratorConfigParam} arg
452
- * - Arg object
453
- *
454
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
455
- * @param {import("../PlatformAPIClient").Options} - Options
456
- * @returns {Promise<Object>} - Success response
457
- * @name deletePdfGeneratorConfig
458
- * @summary: Delete a PDF generator configuration
459
- * @description: Deletes a specific PDF generator configuration based on the provided id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/deletePdfGeneratorConfig/).
460
- */
461
- async deletePdfGeneratorConfig(
462
- { id, requestHeaders } = { requestHeaders: {} },
463
- { responseHeaders } = { responseHeaders: false }
464
- ) {
465
- const {
466
- error,
467
- } = FileStoragePlatformApplicationValidator.deletePdfGeneratorConfig().validate(
468
- {
469
- id,
470
- },
471
- { abortEarly: false, allowUnknown: true }
472
- );
473
- if (error) {
474
- return Promise.reject(new FDKClientValidationError(error));
475
- }
476
-
477
- // Showing warrnings if extra unknown parameters are found
478
- const {
479
- error: warrning,
480
- } = FileStoragePlatformApplicationValidator.deletePdfGeneratorConfig().validate(
481
- {
482
- id,
483
- },
484
- { abortEarly: false, allowUnknown: false }
485
- );
486
- if (warrning) {
487
- Logger({
488
- level: "WARN",
489
- message: `Parameter Validation warrnings for platform > FileStorage > deletePdfGeneratorConfig \n ${warrning}`,
490
- });
491
- }
492
-
493
- const query_params = {};
494
-
495
- const response = await PlatformAPIClient.execute(
496
- this.config,
497
- "delete",
498
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/config/${id}`,
499
- query_params,
500
- undefined,
501
- requestHeaders,
502
- { responseHeaders }
503
- );
504
-
505
- let responseData = response;
506
- if (responseHeaders) {
507
- responseData = response[0];
508
- }
509
-
510
- const { error: res_error } = Joi.any().validate(responseData, {
511
- abortEarly: false,
512
- allowUnknown: true,
513
- });
514
-
515
- if (res_error) {
516
- if (this.config.options.strictResponseCheck === true) {
517
- return Promise.reject(new FDKResponseValidationError(res_error));
518
- } else {
519
- Logger({
520
- level: "WARN",
521
- message: `Response Validation Warnings for platform > FileStorage > deletePdfGeneratorConfig \n ${res_error}`,
522
- });
523
- }
524
- }
525
-
526
- return response;
527
- }
528
-
529
- /**
530
- * @param {FileStoragePlatformApplicationValidator.FetchPdfDefaultTemplateByIdParam} arg
531
- * - Arg object
532
- *
533
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
534
- * @param {import("../PlatformAPIClient").Options} - Options
535
- * @returns {Promise<FileStoragePlatformModel.PdfDefaultTemplateById>} -
536
- * Success response
537
- * @name fetchPdfDefaultTemplateById
538
- * @summary: get default html template for invoice or label
539
- * @description: get default html template for invoice such as Invoice, Label, Deliver challan - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/fetchPdfDefaultTemplateById/).
540
- */
541
- async fetchPdfDefaultTemplateById(
542
- { id, requestHeaders } = { requestHeaders: {} },
543
- { responseHeaders } = { responseHeaders: false }
544
- ) {
545
- const {
546
- error,
547
- } = FileStoragePlatformApplicationValidator.fetchPdfDefaultTemplateById().validate(
548
- {
549
- id,
550
- },
551
- { abortEarly: false, allowUnknown: true }
552
- );
553
- if (error) {
554
- return Promise.reject(new FDKClientValidationError(error));
555
- }
556
-
557
- // Showing warrnings if extra unknown parameters are found
558
- const {
559
- error: warrning,
560
- } = FileStoragePlatformApplicationValidator.fetchPdfDefaultTemplateById().validate(
561
- {
562
- id,
563
- },
564
- { abortEarly: false, allowUnknown: false }
565
- );
566
- if (warrning) {
567
- Logger({
568
- level: "WARN",
569
- message: `Parameter Validation warrnings for platform > FileStorage > fetchPdfDefaultTemplateById \n ${warrning}`,
570
- });
571
- }
572
-
573
- const query_params = {};
574
-
575
- const response = await PlatformAPIClient.execute(
576
- this.config,
577
- "get",
578
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/default-template/${id}`,
579
- query_params,
580
- undefined,
581
- requestHeaders,
582
- { responseHeaders }
583
- );
584
-
585
- let responseData = response;
586
- if (responseHeaders) {
587
- responseData = response[0];
588
- }
589
-
590
- const {
591
- error: res_error,
592
- } = FileStoragePlatformModel.PdfDefaultTemplateById().validate(
593
- responseData,
594
- { abortEarly: false, allowUnknown: true }
595
- );
596
-
597
- if (res_error) {
598
- if (this.config.options.strictResponseCheck === true) {
599
- return Promise.reject(new FDKResponseValidationError(res_error));
600
- } else {
601
- Logger({
602
- level: "WARN",
603
- message: `Response Validation Warnings for platform > FileStorage > fetchPdfDefaultTemplateById \n ${res_error}`,
604
- });
605
- }
606
- }
607
-
608
- return response;
609
- }
610
-
611
- /**
612
- * @param {FileStoragePlatformApplicationValidator.FetchPdfTypeByIdParam} arg
613
- * - Arg object
614
- *
615
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
616
- * @param {import("../PlatformAPIClient").Options} - Options
617
- * @returns {Promise<FileStoragePlatformModel.PdfTypeByIdDetails>} - Success response
618
- * @name fetchPdfTypeById
619
- * @summary: Get the pdf types of by id
620
- * @description: Get the pdf types of PDF formats for filter - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/fetchPdfTypeById/).
621
- */
622
- async fetchPdfTypeById(
623
- { id, requestHeaders } = { requestHeaders: {} },
624
- { responseHeaders } = { responseHeaders: false }
625
- ) {
626
- const {
627
- error,
628
- } = FileStoragePlatformApplicationValidator.fetchPdfTypeById().validate(
629
- {
630
- id,
631
- },
632
- { abortEarly: false, allowUnknown: true }
633
- );
634
- if (error) {
635
- return Promise.reject(new FDKClientValidationError(error));
636
- }
637
-
638
- // Showing warrnings if extra unknown parameters are found
639
- const {
640
- error: warrning,
641
- } = FileStoragePlatformApplicationValidator.fetchPdfTypeById().validate(
642
- {
643
- id,
644
- },
645
- { abortEarly: false, allowUnknown: false }
646
- );
647
- if (warrning) {
648
- Logger({
649
- level: "WARN",
650
- message: `Parameter Validation warrnings for platform > FileStorage > fetchPdfTypeById \n ${warrning}`,
651
- });
652
- }
653
-
654
- const query_params = {};
655
-
656
- const response = await PlatformAPIClient.execute(
657
- this.config,
658
- "get",
659
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/types/${id}`,
660
- query_params,
661
- undefined,
662
- requestHeaders,
663
- { responseHeaders }
664
- );
665
-
666
- let responseData = response;
667
- if (responseHeaders) {
668
- responseData = response[0];
669
- }
670
-
671
- const {
672
- error: res_error,
673
- } = FileStoragePlatformModel.PdfTypeByIdDetails().validate(responseData, {
674
- abortEarly: false,
675
- allowUnknown: true,
676
- });
677
-
678
- if (res_error) {
679
- if (this.config.options.strictResponseCheck === true) {
680
- return Promise.reject(new FDKResponseValidationError(res_error));
681
- } else {
682
- Logger({
683
- level: "WARN",
684
- message: `Response Validation Warnings for platform > FileStorage > fetchPdfTypeById \n ${res_error}`,
685
- });
686
- }
687
- }
688
-
689
- return response;
690
- }
691
-
692
- /**
693
- * @param {FileStoragePlatformApplicationValidator.GeneratePaymentReceiptParam} arg
694
- * - Arg object
695
- *
696
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
697
- * @param {import("../PlatformAPIClient").Options} - Options
698
- * @returns {Promise<Object>} - Success response
699
- * @name generatePaymentReceipt
700
- * @summary: Generate payment receipt.
701
- * @description: Generate Payment Receipt for Jiomart Digital - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/generatePaymentReceipt/).
702
- */
703
- async generatePaymentReceipt(
704
- { body, requestHeaders } = { requestHeaders: {} },
705
- { responseHeaders } = { responseHeaders: false }
706
- ) {
707
- const {
708
- error,
709
- } = FileStoragePlatformApplicationValidator.generatePaymentReceipt().validate(
710
- {
711
- body,
712
- },
713
- { abortEarly: false, allowUnknown: true }
714
- );
715
- if (error) {
716
- return Promise.reject(new FDKClientValidationError(error));
717
- }
718
-
719
- // Showing warrnings if extra unknown parameters are found
720
- const {
721
- error: warrning,
722
- } = FileStoragePlatformApplicationValidator.generatePaymentReceipt().validate(
723
- {
724
- body,
725
- },
726
- { abortEarly: false, allowUnknown: false }
727
- );
728
- if (warrning) {
729
- Logger({
730
- level: "WARN",
731
- message: `Parameter Validation warrnings for platform > FileStorage > generatePaymentReceipt \n ${warrning}`,
732
- });
733
- }
734
-
735
- const query_params = {};
736
-
737
- const response = await PlatformAPIClient.execute(
738
- this.config,
739
- "post",
740
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/payment-receipt`,
741
- query_params,
742
- body,
743
- requestHeaders,
744
- { responseHeaders }
745
- );
746
-
747
- let responseData = response;
748
- if (responseHeaders) {
749
- responseData = response[0];
750
- }
751
-
752
- const { error: res_error } = Joi.any().validate(responseData, {
753
- abortEarly: false,
754
- allowUnknown: true,
755
- });
756
-
757
- if (res_error) {
758
- if (this.config.options.strictResponseCheck === true) {
759
- return Promise.reject(new FDKResponseValidationError(res_error));
760
- } else {
761
- Logger({
762
- level: "WARN",
763
- message: `Response Validation Warnings for platform > FileStorage > generatePaymentReceipt \n ${res_error}`,
764
- });
765
- }
766
- }
767
-
768
- return response;
769
- }
770
-
771
- /**
772
- * @param {FileStoragePlatformApplicationValidator.GetConfigHtmlTemplateByIdParam} arg
773
- * - Arg object
774
- *
775
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
776
- * @param {import("../PlatformAPIClient").Options} - Options
777
- * @returns {Promise<Object>} - Success response
778
- * @name getConfigHtmlTemplateById
779
- * @summary: Update html template for invoice or label
780
- * @description: Update html template for invoice such as Invoice, Label, Deliver challan - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getConfigHtmlTemplateById/).
781
- */
782
- async getConfigHtmlTemplateById(
783
- { id, requestHeaders } = { requestHeaders: {} },
784
- { responseHeaders } = { responseHeaders: false }
785
- ) {
786
- const {
787
- error,
788
- } = FileStoragePlatformApplicationValidator.getConfigHtmlTemplateById().validate(
789
- {
790
- id,
791
- },
792
- { abortEarly: false, allowUnknown: true }
793
- );
794
- if (error) {
795
- return Promise.reject(new FDKClientValidationError(error));
796
- }
797
-
798
- // Showing warrnings if extra unknown parameters are found
799
- const {
800
- error: warrning,
801
- } = FileStoragePlatformApplicationValidator.getConfigHtmlTemplateById().validate(
802
- {
803
- id,
804
- },
805
- { abortEarly: false, allowUnknown: false }
806
- );
807
- if (warrning) {
808
- Logger({
809
- level: "WARN",
810
- message: `Parameter Validation warrnings for platform > FileStorage > getConfigHtmlTemplateById \n ${warrning}`,
811
- });
812
- }
813
-
814
- const query_params = {};
815
-
816
- const response = await PlatformAPIClient.execute(
817
- this.config,
818
- "get",
819
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/config/${id}`,
820
- query_params,
821
- undefined,
822
- requestHeaders,
823
- { responseHeaders }
824
- );
825
-
826
- let responseData = response;
827
- if (responseHeaders) {
828
- responseData = response[0];
829
- }
830
-
831
- const { error: res_error } = Joi.any().validate(responseData, {
832
- abortEarly: false,
833
- allowUnknown: true,
834
- });
835
-
836
- if (res_error) {
837
- if (this.config.options.strictResponseCheck === true) {
838
- return Promise.reject(new FDKResponseValidationError(res_error));
839
- } else {
840
- Logger({
841
- level: "WARN",
842
- message: `Response Validation Warnings for platform > FileStorage > getConfigHtmlTemplateById \n ${res_error}`,
843
- });
844
- }
845
- }
846
-
847
- return response;
848
- }
849
-
850
- /**
851
- * @param {FileStoragePlatformApplicationValidator.GetDefaultPdfDataParam} arg
852
- * - Arg object
853
- *
854
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
855
- * @param {import("../PlatformAPIClient").Options} - Options
856
- * @returns {Promise<FileStoragePlatformModel.PdfDataItemsDetails>} - Success response
857
- * @name getDefaultPdfData
858
- * @summary: Get default PDF data.
859
- * @description: Retrieve default data for PDF generation. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getDefaultPdfData/).
860
- */
861
- async getDefaultPdfData(
862
- { pdfTypeId, countryCode, requestHeaders } = { requestHeaders: {} },
863
- { responseHeaders } = { responseHeaders: false }
864
- ) {
865
- const {
866
- error,
867
- } = FileStoragePlatformApplicationValidator.getDefaultPdfData().validate(
868
- {
869
- pdfTypeId,
870
- countryCode,
871
- },
872
- { abortEarly: false, allowUnknown: true }
873
- );
874
- if (error) {
875
- return Promise.reject(new FDKClientValidationError(error));
876
- }
877
-
878
- // Showing warrnings if extra unknown parameters are found
879
- const {
880
- error: warrning,
881
- } = FileStoragePlatformApplicationValidator.getDefaultPdfData().validate(
882
- {
883
- pdfTypeId,
884
- countryCode,
885
- },
886
- { abortEarly: false, allowUnknown: false }
887
- );
888
- if (warrning) {
889
- Logger({
890
- level: "WARN",
891
- message: `Parameter Validation warrnings for platform > FileStorage > getDefaultPdfData \n ${warrning}`,
892
- });
893
- }
894
-
895
- const query_params = {};
896
- query_params["pdf_type_id"] = pdfTypeId;
897
- query_params["country_code"] = countryCode;
898
-
899
- const response = await PlatformAPIClient.execute(
900
- this.config,
901
- "get",
902
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/mapper`,
903
- query_params,
904
- undefined,
905
- requestHeaders,
906
- { responseHeaders }
907
- );
908
-
909
- let responseData = response;
910
- if (responseHeaders) {
911
- responseData = response[0];
912
- }
913
-
914
- const {
915
- error: res_error,
916
- } = FileStoragePlatformModel.PdfDataItemsDetails().validate(responseData, {
917
- abortEarly: false,
918
- allowUnknown: true,
919
- });
920
-
921
- if (res_error) {
922
- if (this.config.options.strictResponseCheck === true) {
923
- return Promise.reject(new FDKResponseValidationError(res_error));
924
- } else {
925
- Logger({
926
- level: "WARN",
927
- message: `Response Validation Warnings for platform > FileStorage > getDefaultPdfData \n ${res_error}`,
928
- });
929
- }
930
- }
931
-
932
- return response;
933
- }
934
-
935
- /**
936
- * @param {FileStoragePlatformApplicationValidator.GetDefaultPdfTemplateParam} arg
937
- * - Arg object
938
- *
939
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
940
- * @param {import("../PlatformAPIClient").Options} - Options
941
- * @returns {Promise<FileStoragePlatformModel.PdfDefaultTemplateSuccess>} -
942
- * Success response
943
- * @name getDefaultPdfTemplate
944
- * @summary: Get default PDF template.
945
- * @description: Retrieve the default PDF template. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getDefaultPdfTemplate/).
946
- */
947
- async getDefaultPdfTemplate(
948
- { pdfTypeId, format, countryCode, requestHeaders } = { requestHeaders: {} },
949
- { responseHeaders } = { responseHeaders: false }
950
- ) {
951
- const {
952
- error,
953
- } = FileStoragePlatformApplicationValidator.getDefaultPdfTemplate().validate(
954
- {
955
- pdfTypeId,
956
- format,
957
- countryCode,
958
- },
959
- { abortEarly: false, allowUnknown: true }
960
- );
961
- if (error) {
962
- return Promise.reject(new FDKClientValidationError(error));
963
- }
964
-
965
- // Showing warrnings if extra unknown parameters are found
966
- const {
967
- error: warrning,
968
- } = FileStoragePlatformApplicationValidator.getDefaultPdfTemplate().validate(
969
- {
970
- pdfTypeId,
971
- format,
972
- countryCode,
973
- },
974
- { abortEarly: false, allowUnknown: false }
975
- );
976
- if (warrning) {
977
- Logger({
978
- level: "WARN",
979
- message: `Parameter Validation warrnings for platform > FileStorage > getDefaultPdfTemplate \n ${warrning}`,
980
- });
981
- }
982
-
983
- const query_params = {};
984
- query_params["pdf_type_id"] = pdfTypeId;
985
- query_params["format"] = format;
986
- query_params["country_code"] = countryCode;
987
-
988
- const response = await PlatformAPIClient.execute(
989
- this.config,
990
- "get",
991
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/default-template`,
992
- query_params,
993
- undefined,
994
- requestHeaders,
995
- { responseHeaders }
996
- );
997
-
998
- let responseData = response;
999
- if (responseHeaders) {
1000
- responseData = response[0];
1001
- }
1002
-
1003
- const {
1004
- error: res_error,
1005
- } = FileStoragePlatformModel.PdfDefaultTemplateSuccess().validate(
1006
- responseData,
1007
- { abortEarly: false, allowUnknown: true }
1008
- );
1009
-
1010
- if (res_error) {
1011
- if (this.config.options.strictResponseCheck === true) {
1012
- return Promise.reject(new FDKResponseValidationError(res_error));
1013
- } else {
1014
- Logger({
1015
- level: "WARN",
1016
- message: `Response Validation Warnings for platform > FileStorage > getDefaultPdfTemplate \n ${res_error}`,
1017
- });
1018
- }
1019
- }
1020
-
1021
- return response;
1022
- }
1023
-
1024
- /**
1025
- * @param {FileStoragePlatformApplicationValidator.GetHtmlTemplateConfigParam} arg
1026
- * - Arg object
1027
- *
1028
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1029
- * @param {import("../PlatformAPIClient").Options} - Options
1030
- * @returns {Promise<FileStoragePlatformModel.PdfConfigSuccess>} - Success response
1031
- * @name getHtmlTemplateConfig
1032
- * @summary: Get html template for sales channel
1033
- * @description: Get default html template for invoice or label - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getHtmlTemplateConfig/).
1034
- */
1035
- async getHtmlTemplateConfig(
1036
- { pdfTypeId, format, countryCode, requestHeaders } = { requestHeaders: {} },
1037
- { responseHeaders } = { responseHeaders: false }
1038
- ) {
1039
- const {
1040
- error,
1041
- } = FileStoragePlatformApplicationValidator.getHtmlTemplateConfig().validate(
1042
- {
1043
- pdfTypeId,
1044
- format,
1045
- countryCode,
1046
- },
1047
- { abortEarly: false, allowUnknown: true }
1048
- );
1049
- if (error) {
1050
- return Promise.reject(new FDKClientValidationError(error));
1051
- }
1052
-
1053
- // Showing warrnings if extra unknown parameters are found
1054
- const {
1055
- error: warrning,
1056
- } = FileStoragePlatformApplicationValidator.getHtmlTemplateConfig().validate(
1057
- {
1058
- pdfTypeId,
1059
- format,
1060
- countryCode,
1061
- },
1062
- { abortEarly: false, allowUnknown: false }
1063
- );
1064
- if (warrning) {
1065
- Logger({
1066
- level: "WARN",
1067
- message: `Parameter Validation warrnings for platform > FileStorage > getHtmlTemplateConfig \n ${warrning}`,
1068
- });
1069
- }
1070
-
1071
- const query_params = {};
1072
- query_params["pdf_type_id"] = pdfTypeId;
1073
- query_params["format"] = format;
1074
- query_params["country_code"] = countryCode;
1075
-
1076
- const response = await PlatformAPIClient.execute(
1077
- this.config,
1078
- "get",
1079
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/config`,
1080
- query_params,
1081
- undefined,
1082
- requestHeaders,
1083
- { responseHeaders }
1084
- );
1085
-
1086
- let responseData = response;
1087
- if (responseHeaders) {
1088
- responseData = response[0];
1089
- }
1090
-
1091
- const {
1092
- error: res_error,
1093
- } = FileStoragePlatformModel.PdfConfigSuccess().validate(responseData, {
1094
- abortEarly: false,
1095
- allowUnknown: true,
1096
- });
1097
-
1098
- if (res_error) {
1099
- if (this.config.options.strictResponseCheck === true) {
1100
- return Promise.reject(new FDKResponseValidationError(res_error));
1101
- } else {
1102
- Logger({
1103
- level: "WARN",
1104
- message: `Response Validation Warnings for platform > FileStorage > getHtmlTemplateConfig \n ${res_error}`,
1105
- });
1106
- }
1107
- }
1108
-
1109
- return response;
1110
- }
1111
-
1112
- /**
1113
- * @param {FileStoragePlatformApplicationValidator.GetPdfPayloadByIdParam} arg
1114
- * - Arg object
1115
- *
1116
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1117
- * @param {import("../PlatformAPIClient").Options} - Options
1118
- * @returns {Promise<FileStoragePlatformModel.MapperDetails>} - Success response
1119
- * @name getPdfPayloadById
1120
- * @summary: Get default PDF data.
1121
- * @description: Retrieve default data for PDF generation. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getPdfPayloadById/).
1122
- */
1123
- async getPdfPayloadById(
1124
- { id, requestHeaders } = { requestHeaders: {} },
1125
- { responseHeaders } = { responseHeaders: false }
1126
- ) {
1127
- const {
1128
- error,
1129
- } = FileStoragePlatformApplicationValidator.getPdfPayloadById().validate(
1130
- {
1131
- id,
1132
- },
1133
- { abortEarly: false, allowUnknown: true }
1134
- );
1135
- if (error) {
1136
- return Promise.reject(new FDKClientValidationError(error));
1137
- }
1138
-
1139
- // Showing warrnings if extra unknown parameters are found
1140
- const {
1141
- error: warrning,
1142
- } = FileStoragePlatformApplicationValidator.getPdfPayloadById().validate(
1143
- {
1144
- id,
1145
- },
1146
- { abortEarly: false, allowUnknown: false }
1147
- );
1148
- if (warrning) {
1149
- Logger({
1150
- level: "WARN",
1151
- message: `Parameter Validation warrnings for platform > FileStorage > getPdfPayloadById \n ${warrning}`,
1152
- });
1153
- }
1154
-
1155
- const query_params = {};
1156
-
1157
- const response = await PlatformAPIClient.execute(
1158
- this.config,
1159
- "get",
1160
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/mapper/${id}`,
1161
- query_params,
1162
- undefined,
1163
- requestHeaders,
1164
- { responseHeaders }
1165
- );
1166
-
1167
- let responseData = response;
1168
- if (responseHeaders) {
1169
- responseData = response[0];
1170
- }
1171
-
1172
- const {
1173
- error: res_error,
1174
- } = FileStoragePlatformModel.MapperDetails().validate(responseData, {
1175
- abortEarly: false,
1176
- allowUnknown: true,
1177
- });
1178
-
1179
- if (res_error) {
1180
- if (this.config.options.strictResponseCheck === true) {
1181
- return Promise.reject(new FDKResponseValidationError(res_error));
1182
- } else {
1183
- Logger({
1184
- level: "WARN",
1185
- message: `Response Validation Warnings for platform > FileStorage > getPdfPayloadById \n ${res_error}`,
1186
- });
1187
- }
1188
- }
1189
-
1190
- return response;
1191
- }
1192
-
1193
- /**
1194
- * @param {FileStoragePlatformApplicationValidator.GetPdfTypesParam} arg - Arg object
1195
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1196
- * @param {import("../PlatformAPIClient").Options} - Options
1197
- * @returns {Promise<FileStoragePlatformModel.InvoiceTypes>} - Success response
1198
- * @name getPdfTypes
1199
- * @summary: Get all the supported invoice pdf types
1200
- * @description: Get all the supported invoice pdf types such as Invoice, Label, Delivery challan - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getPdfTypes/).
1201
- */
1202
- async getPdfTypes(
1203
- { storeOs, countryCode, requestHeaders } = { requestHeaders: {} },
1204
- { responseHeaders } = { responseHeaders: false }
1205
- ) {
1206
- const {
1207
- error,
1208
- } = FileStoragePlatformApplicationValidator.getPdfTypes().validate(
1209
- {
1210
- storeOs,
1211
- countryCode,
1212
- },
1213
- { abortEarly: false, allowUnknown: true }
1214
- );
1215
- if (error) {
1216
- return Promise.reject(new FDKClientValidationError(error));
1217
- }
1218
-
1219
- // Showing warrnings if extra unknown parameters are found
1220
- const {
1221
- error: warrning,
1222
- } = FileStoragePlatformApplicationValidator.getPdfTypes().validate(
1223
- {
1224
- storeOs,
1225
- countryCode,
1226
- },
1227
- { abortEarly: false, allowUnknown: false }
1228
- );
1229
- if (warrning) {
1230
- Logger({
1231
- level: "WARN",
1232
- message: `Parameter Validation warrnings for platform > FileStorage > getPdfTypes \n ${warrning}`,
1233
- });
1234
- }
1235
-
1236
- const query_params = {};
1237
- query_params["country_code"] = countryCode;
1238
- query_params["store_os"] = storeOs;
1239
-
1240
- const response = await PlatformAPIClient.execute(
1241
- this.config,
1242
- "get",
1243
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/types`,
1244
- query_params,
1245
- undefined,
1246
- requestHeaders,
1247
- { responseHeaders }
1248
- );
1249
-
1250
- let responseData = response;
1251
- if (responseHeaders) {
1252
- responseData = response[0];
1253
- }
1254
-
1255
- const {
1256
- error: res_error,
1257
- } = FileStoragePlatformModel.InvoiceTypes().validate(responseData, {
1258
- abortEarly: false,
1259
- allowUnknown: true,
1260
- });
1261
-
1262
- if (res_error) {
1263
- if (this.config.options.strictResponseCheck === true) {
1264
- return Promise.reject(new FDKResponseValidationError(res_error));
1265
- } else {
1266
- Logger({
1267
- level: "WARN",
1268
- message: `Response Validation Warnings for platform > FileStorage > getPdfTypes \n ${res_error}`,
1269
- });
1270
- }
1271
- }
1272
-
1273
- return response;
1274
- }
1275
-
1276
- /**
1277
- * @param {FileStoragePlatformApplicationValidator.SaveHtmlTemplateParam} arg
1278
- * - Arg object
1279
- *
1280
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1281
- * @param {import("../PlatformAPIClient").Options} - Options
1282
- * @returns {Promise<FileStoragePlatformModel.PdfConfigSaveSuccess>} -
1283
- * Success response
1284
- * @name saveHtmlTemplate
1285
- * @summary: Save HTML template.
1286
- * @description: Store an HTML template. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/saveHtmlTemplate/).
1287
- */
1288
- async saveHtmlTemplate(
1289
- { body, requestHeaders } = { requestHeaders: {} },
1290
- { responseHeaders } = { responseHeaders: false }
1291
- ) {
1292
- const {
1293
- error,
1294
- } = FileStoragePlatformApplicationValidator.saveHtmlTemplate().validate(
1295
- {
1296
- body,
1297
- },
1298
- { abortEarly: false, allowUnknown: true }
1299
- );
1300
- if (error) {
1301
- return Promise.reject(new FDKClientValidationError(error));
1302
- }
1303
-
1304
- // Showing warrnings if extra unknown parameters are found
1305
- const {
1306
- error: warrning,
1307
- } = FileStoragePlatformApplicationValidator.saveHtmlTemplate().validate(
1308
- {
1309
- body,
1310
- },
1311
- { abortEarly: false, allowUnknown: false }
1312
- );
1313
- if (warrning) {
1314
- Logger({
1315
- level: "WARN",
1316
- message: `Parameter Validation warrnings for platform > FileStorage > saveHtmlTemplate \n ${warrning}`,
1317
- });
1318
- }
1319
-
1320
- const query_params = {};
1321
-
1322
- const response = await PlatformAPIClient.execute(
1323
- this.config,
1324
- "post",
1325
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/config`,
1326
- query_params,
1327
- body,
1328
- requestHeaders,
1329
- { responseHeaders }
1330
- );
1331
-
1332
- let responseData = response;
1333
- if (responseHeaders) {
1334
- responseData = response[0];
1335
- }
1336
-
1337
- const {
1338
- error: res_error,
1339
- } = FileStoragePlatformModel.PdfConfigSaveSuccess().validate(responseData, {
1340
- abortEarly: false,
1341
- allowUnknown: true,
1342
- });
1343
-
1344
- if (res_error) {
1345
- if (this.config.options.strictResponseCheck === true) {
1346
- return Promise.reject(new FDKResponseValidationError(res_error));
1347
- } else {
1348
- Logger({
1349
- level: "WARN",
1350
- message: `Response Validation Warnings for platform > FileStorage > saveHtmlTemplate \n ${res_error}`,
1351
- });
1352
- }
1353
- }
1354
-
1355
- return response;
1356
- }
1357
-
1358
- /**
1359
- * @param {FileStoragePlatformApplicationValidator.UpdateHtmlTemplateParam} arg
1360
- * - Arg object
1361
- *
1362
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1363
- * @param {import("../PlatformAPIClient").Options} - Options
1364
- * @returns {Promise<FileStoragePlatformModel.PdfConfigSaveSuccess>} -
1365
- * Success response
1366
- * @name updateHtmlTemplate
1367
- * @summary: Update HTML Template
1368
- * @description: Update the HTML Template. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/updateHtmlTemplate/).
1369
- */
1370
- async updateHtmlTemplate(
1371
- { id, body, requestHeaders } = { requestHeaders: {} },
1372
- { responseHeaders } = { responseHeaders: false }
1373
- ) {
1374
- const {
1375
- error,
1376
- } = FileStoragePlatformApplicationValidator.updateHtmlTemplate().validate(
1377
- {
1378
- id,
1379
- body,
1380
- },
1381
- { abortEarly: false, allowUnknown: true }
1382
- );
1383
- if (error) {
1384
- return Promise.reject(new FDKClientValidationError(error));
1385
- }
1386
-
1387
- // Showing warrnings if extra unknown parameters are found
1388
- const {
1389
- error: warrning,
1390
- } = FileStoragePlatformApplicationValidator.updateHtmlTemplate().validate(
1391
- {
1392
- id,
1393
- body,
1394
- },
1395
- { abortEarly: false, allowUnknown: false }
1396
- );
1397
- if (warrning) {
1398
- Logger({
1399
- level: "WARN",
1400
- message: `Parameter Validation warrnings for platform > FileStorage > updateHtmlTemplate \n ${warrning}`,
1401
- });
1402
- }
1403
-
1404
- const query_params = {};
1405
-
1406
- const response = await PlatformAPIClient.execute(
1407
- this.config,
1408
- "put",
1409
- `/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/config/${id}`,
1410
- query_params,
1411
- body,
1412
- requestHeaders,
1413
- { responseHeaders }
1414
- );
1415
-
1416
- let responseData = response;
1417
- if (responseHeaders) {
1418
- responseData = response[0];
1419
- }
1420
-
1421
- const {
1422
- error: res_error,
1423
- } = FileStoragePlatformModel.PdfConfigSaveSuccess().validate(responseData, {
1424
- abortEarly: false,
1425
- allowUnknown: true,
1426
- });
1427
-
1428
- if (res_error) {
1429
- if (this.config.options.strictResponseCheck === true) {
1430
- return Promise.reject(new FDKResponseValidationError(res_error));
1431
- } else {
1432
- Logger({
1433
- level: "WARN",
1434
- message: `Response Validation Warnings for platform > FileStorage > updateHtmlTemplate \n ${res_error}`,
1435
- });
1436
- }
1437
- }
1438
-
1439
- return response;
1440
- }
1441
369
  }
1442
370
 
1443
371
  /**