@gofynd/fdk-client-javascript 1.4.15-beta.13 → 1.4.15-beta.15
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/README.md +23 -26
- package/package.json +5 -1
- package/sdk/application/ApplicationClient.d.ts +5 -6
- package/sdk/application/ApplicationClient.js +24 -20
- package/sdk/application/Cart/CartApplicationClient.d.ts +133 -83
- package/sdk/application/Cart/CartApplicationClient.js +444 -76
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +132 -114
- package/sdk/application/Catalog/CatalogApplicationClient.js +209 -126
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -4
- package/sdk/application/Common/CommonApplicationClient.js +4 -4
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +3 -3
- package/sdk/application/Communication/CommunicationApplicationClient.js +3 -3
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +58 -36
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +73 -29
- package/sdk/application/Content/ContentApplicationClient.d.ts +95 -66
- package/sdk/application/Content/ContentApplicationClient.js +274 -111
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +11 -11
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +10 -10
- package/sdk/application/Finance/FinanceApplicationClient.d.ts +29 -0
- package/sdk/application/Finance/FinanceApplicationClient.js +111 -0
- package/sdk/application/Lead/LeadApplicationClient.d.ts +7 -7
- package/sdk/application/Lead/LeadApplicationClient.js +6 -6
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +37 -57
- package/sdk/application/Logistic/LogisticApplicationClient.js +117 -180
- package/sdk/application/Order/OrderApplicationClient.d.ts +63 -21
- package/sdk/application/Order/OrderApplicationClient.js +217 -17
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +179 -149
- package/sdk/application/Payment/PaymentApplicationClient.js +301 -167
- package/sdk/application/Share/ShareApplicationClient.d.ts +7 -7
- package/sdk/application/Share/ShareApplicationClient.js +7 -7
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +7 -7
- package/sdk/application/Theme/ThemeApplicationClient.js +10 -6
- package/sdk/application/User/UserApplicationClient.d.ts +103 -53
- package/sdk/application/User/UserApplicationClient.js +308 -49
- package/sdk/common/AxiosHelper.js +11 -4
- package/sdk/common/Constant.d.ts +27 -4
- package/sdk/common/Constant.js +33 -6
- package/sdk/common/utils.d.ts +10 -0
- package/sdk/common/utils.js +24 -3
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +46 -16
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +266 -40
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +163 -19
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +158 -14
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +5 -2
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +23 -7
- package/sdk/partner/Lead/LeadPartnerClient.d.ts +9 -9
- package/sdk/partner/Lead/LeadPartnerClient.js +9 -9
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +14 -9
- package/sdk/partner/Lead/LeadPartnerModel.js +19 -17
- package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +264 -49
- package/sdk/partner/Logistics/LogisticsPartnerClient.js +2116 -252
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +2256 -258
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +1187 -230
- package/sdk/partner/Logistics/LogisticsPartnerValidator.d.ts +21 -1
- package/sdk/partner/Logistics/LogisticsPartnerValidator.js +218 -13
- package/sdk/partner/PartnerClient.d.ts +5 -2
- package/sdk/partner/PartnerClient.js +21 -7
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +32 -34
- package/sdk/partner/Theme/ThemePartnerClient.js +42 -44
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +142 -43
- package/sdk/partner/Theme/ThemePartnerModel.js +129 -44
- package/sdk/partner/Theme/ThemePartnerValidator.js +4 -4
- package/sdk/partner/Webhook/WebhookPartnerClient.d.ts +83 -27
- package/sdk/partner/Webhook/WebhookPartnerClient.js +446 -27
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +920 -185
- package/sdk/partner/Webhook/WebhookPartnerModel.js +462 -154
- package/sdk/partner/Webhook/WebhookPartnerValidator.d.ts +5 -0
- package/sdk/partner/Webhook/WebhookPartnerValidator.js +41 -3
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +8 -7
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +17 -11
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +4 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +68 -13
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +44 -6
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +3 -33
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +4 -244
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +49 -145
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +20 -171
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -39
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +0 -35
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +15 -15
- package/sdk/platform/Billing/BillingPlatformClient.js +18 -18
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +443 -388
- package/sdk/platform/Billing/BillingPlatformModel.js +280 -263
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +16 -18
- package/sdk/platform/Billing/BillingPlatformValidator.js +8 -9
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +266 -203
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1446 -500
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +729 -100
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +446 -82
- package/sdk/platform/Cart/CartPlatformModel.d.ts +6927 -1396
- package/sdk/platform/Cart/CartPlatformModel.js +3065 -1316
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +433 -248
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1662 -559
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +464 -159
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +304 -87
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +383 -234
- package/sdk/platform/Catalog/CatalogPlatformClient.js +2475 -1557
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +9571 -2674
- package/sdk/platform/Catalog/CatalogPlatformModel.js +5081 -2019
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +364 -117
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +281 -104
- package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -4
- package/sdk/platform/Common/CommonPlatformClient.js +6 -5
- package/sdk/platform/Common/CommonPlatformModel.d.ts +36 -25
- package/sdk/platform/Common/CommonPlatformModel.js +25 -14
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -153
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +102 -541
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +36 -49
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +20 -60
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +1 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +1 -1
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +189 -43
- package/sdk/platform/Communication/CommunicationPlatformModel.js +165 -42
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +58 -81
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +68 -116
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +291 -249
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +243 -234
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +12 -12
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +12 -12
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +78 -65
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +101 -88
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +20 -20
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +19 -19
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +68 -34
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +174 -41
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +667 -244
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +474 -155
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +37 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +27 -8
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +366 -280
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1435 -753
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +323 -223
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +335 -205
- package/sdk/platform/Content/ContentPlatformClient.d.ts +304 -106
- package/sdk/platform/Content/ContentPlatformClient.js +1842 -450
- package/sdk/platform/Content/ContentPlatformModel.d.ts +2582 -566
- package/sdk/platform/Content/ContentPlatformModel.js +1426 -558
- package/sdk/platform/Content/ContentPlatformValidator.d.ts +293 -114
- package/sdk/platform/Content/ContentPlatformValidator.js +328 -101
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +59 -23
- package/sdk/platform/Discount/DiscountPlatformClient.js +84 -23
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +403 -110
- package/sdk/platform/Discount/DiscountPlatformModel.js +121 -107
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +56 -36
- package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -19
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +12 -110
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +14 -684
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +5 -94
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +4 -115
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +20 -20
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +22 -22
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +90 -920
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +53 -949
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +6 -6
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +6 -6
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +10 -10
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +11 -11
- package/sdk/platform/Lead/LeadPlatformClient.js +11 -11
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +14 -9
- package/sdk/platform/Lead/LeadPlatformModel.js +20 -18
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +56 -9
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +340 -10
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +128 -24
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +81 -19
- package/sdk/platform/Order/OrderPlatformClient.d.ts +517 -160
- package/sdk/platform/Order/OrderPlatformClient.js +1623 -384
- package/sdk/platform/Order/OrderPlatformModel.d.ts +10372 -1587
- package/sdk/platform/Order/OrderPlatformModel.js +5726 -1512
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +539 -123
- package/sdk/platform/Order/OrderPlatformValidator.js +323 -92
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +8 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +11 -9
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +6 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +3 -2
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +77 -25
- package/sdk/platform/Partner/PartnerPlatformModel.js +32 -21
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +144 -219
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +307 -796
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +86 -121
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +80 -138
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +30 -30
- package/sdk/platform/Payment/PaymentPlatformClient.js +30 -30
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +901 -761
- package/sdk/platform/Payment/PaymentPlatformModel.js +663 -583
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +8 -8
- package/sdk/platform/Payment/PaymentPlatformValidator.js +8 -8
- package/sdk/platform/PlatformApplicationClient.d.ts +0 -2
- package/sdk/platform/PlatformApplicationClient.js +0 -4
- package/sdk/platform/PlatformClient.d.ts +5 -4
- package/sdk/platform/PlatformClient.js +32 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +526 -69
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +3337 -337
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +603 -38
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +529 -32
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +184 -133
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +780 -491
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +9408 -1666
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +5720 -1765
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +257 -180
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +185 -127
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +7 -7
- package/sdk/platform/Share/SharePlatformApplicationClient.js +7 -7
- package/sdk/platform/Share/SharePlatformModel.d.ts +45 -9
- package/sdk/platform/Share/SharePlatformModel.js +31 -6
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +26 -26
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +38 -29
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +18 -3
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +10 -2
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +4 -4
- package/sdk/platform/Theme/ThemePlatformClient.js +4 -4
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +103 -17
- package/sdk/platform/Theme/ThemePlatformModel.js +92 -23
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +167 -45
- package/sdk/platform/User/UserPlatformApplicationClient.js +950 -67
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +189 -3
- package/sdk/platform/User/UserPlatformApplicationValidator.js +157 -3
- package/sdk/platform/User/UserPlatformModel.d.ts +880 -47
- package/sdk/platform/User/UserPlatformModel.js +607 -46
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +33 -86
- package/sdk/platform/Webhook/WebhookPlatformClient.js +79 -474
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +861 -422
- package/sdk/platform/Webhook/WebhookPlatformModel.js +469 -391
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +10 -55
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +12 -72
- package/sdk/platform/index.d.ts +0 -2
- package/sdk/platform/index.js +0 -4
- package/sdk/public/Catalog/CatalogPublicClient.d.ts +22 -0
- package/sdk/public/Catalog/CatalogPublicClient.js +133 -0
- package/sdk/public/Catalog/CatalogPublicModel.d.ts +158 -0
- package/sdk/public/Catalog/CatalogPublicModel.js +116 -0
- package/sdk/public/Catalog/CatalogPublicValidator.d.ts +55 -0
- package/sdk/public/Catalog/CatalogPublicValidator.js +35 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +5 -4
- package/sdk/public/Configuration/ConfigurationPublicClient.js +9 -8
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +41 -21
- package/sdk/public/Configuration/ConfigurationPublicModel.js +28 -12
- package/sdk/public/Content/ContentPublicClient.d.ts +145 -2
- package/sdk/public/Content/ContentPublicClient.js +1067 -17
- package/sdk/public/Content/ContentPublicModel.d.ts +704 -3
- package/sdk/public/Content/ContentPublicModel.js +751 -3
- package/sdk/public/Content/ContentPublicValidator.d.ts +94 -3
- package/sdk/public/Content/ContentPublicValidator.js +119 -2
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +1 -1
- package/sdk/public/Partner/PartnerPublicModel.d.ts +248 -72
- package/sdk/public/Partner/PartnerPublicModel.js +81 -71
- package/sdk/public/Partner/PartnerPublicValidator.d.ts +2 -2
- package/sdk/public/Partner/PartnerPublicValidator.js +1 -1
- package/sdk/public/PublicClient.d.ts +5 -2
- package/sdk/public/PublicClient.js +16 -6
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +13 -13
- package/sdk/public/Webhook/WebhookPublicClient.js +13 -13
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +249 -67
- package/sdk/public/Webhook/WebhookPublicModel.js +81 -61
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +4 -4
- package/sdk/public/Webhook/WebhookPublicValidator.js +4 -4
- package/sdk/public/index.d.ts +1 -0
- package/sdk/public/index.js +2 -0
- package/utility.d.ts +3 -0
- package/utility.js +7 -0
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +0 -79
- package/sdk/application/Rewards/RewardsApplicationClient.js +0 -315
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +0 -19
- package/sdk/application/Webhook/WebhookApplicationClient.js +0 -72
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +0 -320
- package/sdk/platform/Finance/FinancePlatformClient.js +0 -2333
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +0 -2890
- package/sdk/platform/Finance/FinancePlatformModel.js +0 -2148
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +0 -284
- package/sdk/platform/Finance/FinancePlatformValidator.js +0 -354
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +0 -136
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +0 -976
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +0 -152
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +0 -157
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +0 -382
- package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -408
|
@@ -23,10 +23,10 @@ class FileStorage {
|
|
|
23
23
|
*
|
|
24
24
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
25
25
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
26
|
-
* @returns {Promise<FileStoragePlatformModel.
|
|
26
|
+
* @returns {Promise<FileStoragePlatformModel.FileUploadComplete>} - Success response
|
|
27
27
|
* @name appCompleteUpload
|
|
28
|
-
* @summary:
|
|
29
|
-
* @description:
|
|
28
|
+
* @summary: Application complete upload.
|
|
29
|
+
* @description: Finish uploading a file from an application. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/filestorage/appCompleteUpload/).
|
|
30
30
|
*/
|
|
31
31
|
async appCompleteUpload(
|
|
32
32
|
{ namespace, body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -69,7 +69,7 @@ class FileStorage {
|
|
|
69
69
|
const response = await PlatformAPIClient.execute(
|
|
70
70
|
this.config,
|
|
71
71
|
"post",
|
|
72
|
-
`/service/platform/assets/
|
|
72
|
+
`/service/platform/assets/v2.0/company/${this.config.companyId}/application/${this.applicationId}/namespaces/${namespace}/upload/complete`,
|
|
73
73
|
query_params,
|
|
74
74
|
body,
|
|
75
75
|
requestHeaders,
|
|
@@ -83,7 +83,7 @@ class FileStorage {
|
|
|
83
83
|
|
|
84
84
|
const {
|
|
85
85
|
error: res_error,
|
|
86
|
-
} = FileStoragePlatformModel.
|
|
86
|
+
} = FileStoragePlatformModel.FileUploadComplete().validate(responseData, {
|
|
87
87
|
abortEarly: false,
|
|
88
88
|
allowUnknown: true,
|
|
89
89
|
});
|
|
@@ -102,96 +102,16 @@ 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: Copy files for Application
|
|
112
|
-
* @description: Handle multiple file uploads, updating progress and providing detailed status reports. - 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
|
|
188
108
|
*
|
|
189
109
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
190
110
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
191
|
-
* @returns {Promise<FileStoragePlatformModel.
|
|
111
|
+
* @returns {Promise<FileStoragePlatformModel.FileUpload>} - Success response
|
|
192
112
|
* @name appStartUpload
|
|
193
|
-
* @summary:
|
|
194
|
-
* @description:
|
|
113
|
+
* @summary: Application start upload.
|
|
114
|
+
* @description: Start uploading a file from an application and returns a storage link in response. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/filestorage/appStartUpload/).
|
|
195
115
|
*/
|
|
196
116
|
async appStartUpload(
|
|
197
117
|
{ namespace, body, requestHeaders } = { requestHeaders: {} },
|
|
@@ -234,7 +154,7 @@ class FileStorage {
|
|
|
234
154
|
const response = await PlatformAPIClient.execute(
|
|
235
155
|
this.config,
|
|
236
156
|
"post",
|
|
237
|
-
`/service/platform/assets/
|
|
157
|
+
`/service/platform/assets/v2.0/company/${this.config.companyId}/application/${this.applicationId}/namespaces/${namespace}/upload/start`,
|
|
238
158
|
query_params,
|
|
239
159
|
body,
|
|
240
160
|
requestHeaders,
|
|
@@ -248,7 +168,7 @@ class FileStorage {
|
|
|
248
168
|
|
|
249
169
|
const {
|
|
250
170
|
error: res_error,
|
|
251
|
-
} = FileStoragePlatformModel.
|
|
171
|
+
} = FileStoragePlatformModel.FileUpload().validate(responseData, {
|
|
252
172
|
abortEarly: false,
|
|
253
173
|
allowUnknown: true,
|
|
254
174
|
});
|
|
@@ -273,8 +193,8 @@ class FileStorage {
|
|
|
273
193
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
274
194
|
* @returns {Promise<Object>} - Success response
|
|
275
195
|
* @name appbrowse
|
|
276
|
-
* @summary:
|
|
277
|
-
* @description:
|
|
196
|
+
* @summary: Application browse files.
|
|
197
|
+
* @description: Browse files within an application. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/filestorage/appbrowse/).
|
|
278
198
|
*/
|
|
279
199
|
async appbrowse(
|
|
280
200
|
{ namespace, page, limit, search, requestHeaders } = { requestHeaders: {} },
|
|
@@ -361,8 +281,8 @@ class FileStorage {
|
|
|
361
281
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
362
282
|
* @returns {Promise<Object>} - Success response
|
|
363
283
|
* @name browsefiles
|
|
364
|
-
* @summary: Browse
|
|
365
|
-
* @description:
|
|
284
|
+
* @summary: Browse Files
|
|
285
|
+
* @description: Browse Files - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/filestorage/browsefiles/).
|
|
366
286
|
*/
|
|
367
287
|
async browsefiles(
|
|
368
288
|
{ namespace, body, page, limit, search, requestHeaders } = {
|
|
@@ -446,596 +366,6 @@ class FileStorage {
|
|
|
446
366
|
|
|
447
367
|
return response;
|
|
448
368
|
}
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* @param {FileStoragePlatformApplicationValidator.GeneratePaymentReceiptParam} 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 generatePaymentReceipt
|
|
458
|
-
* @summary: Generate payment receipt
|
|
459
|
-
* @description: Generate Payment Receipt for Jiomart Digital - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/generatePaymentReceipt/).
|
|
460
|
-
*/
|
|
461
|
-
async generatePaymentReceipt(
|
|
462
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
463
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
464
|
-
) {
|
|
465
|
-
const {
|
|
466
|
-
error,
|
|
467
|
-
} = FileStoragePlatformApplicationValidator.generatePaymentReceipt().validate(
|
|
468
|
-
{
|
|
469
|
-
body,
|
|
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.generatePaymentReceipt().validate(
|
|
481
|
-
{
|
|
482
|
-
body,
|
|
483
|
-
},
|
|
484
|
-
{ abortEarly: false, allowUnknown: false }
|
|
485
|
-
);
|
|
486
|
-
if (warrning) {
|
|
487
|
-
Logger({
|
|
488
|
-
level: "WARN",
|
|
489
|
-
message: `Parameter Validation warrnings for platform > FileStorage > generatePaymentReceipt \n ${warrning}`,
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
const query_params = {};
|
|
494
|
-
|
|
495
|
-
const response = await PlatformAPIClient.execute(
|
|
496
|
-
this.config,
|
|
497
|
-
"post",
|
|
498
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/payment-receipt`,
|
|
499
|
-
query_params,
|
|
500
|
-
body,
|
|
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 > generatePaymentReceipt \n ${res_error}`,
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
return response;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* @param {FileStoragePlatformApplicationValidator.GetDefaultHtmlTemplateParam} arg
|
|
531
|
-
* - Arg object
|
|
532
|
-
*
|
|
533
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
534
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
535
|
-
* @returns {Promise<FileStoragePlatformModel.PdfConfigSuccess>} - Success response
|
|
536
|
-
* @name getDefaultHtmlTemplate
|
|
537
|
-
* @summary: Get html template for Application
|
|
538
|
-
* @description: Get the saved html template for provided sales channel
|
|
539
|
-
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getDefaultHtmlTemplate/).
|
|
540
|
-
*/
|
|
541
|
-
async getDefaultHtmlTemplate(
|
|
542
|
-
{ pdfTypeId, format, countryCode, requestHeaders } = { requestHeaders: {} },
|
|
543
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
544
|
-
) {
|
|
545
|
-
const {
|
|
546
|
-
error,
|
|
547
|
-
} = FileStoragePlatformApplicationValidator.getDefaultHtmlTemplate().validate(
|
|
548
|
-
{
|
|
549
|
-
pdfTypeId,
|
|
550
|
-
format,
|
|
551
|
-
countryCode,
|
|
552
|
-
},
|
|
553
|
-
{ abortEarly: false, allowUnknown: true }
|
|
554
|
-
);
|
|
555
|
-
if (error) {
|
|
556
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
// Showing warrnings if extra unknown parameters are found
|
|
560
|
-
const {
|
|
561
|
-
error: warrning,
|
|
562
|
-
} = FileStoragePlatformApplicationValidator.getDefaultHtmlTemplate().validate(
|
|
563
|
-
{
|
|
564
|
-
pdfTypeId,
|
|
565
|
-
format,
|
|
566
|
-
countryCode,
|
|
567
|
-
},
|
|
568
|
-
{ abortEarly: false, allowUnknown: false }
|
|
569
|
-
);
|
|
570
|
-
if (warrning) {
|
|
571
|
-
Logger({
|
|
572
|
-
level: "WARN",
|
|
573
|
-
message: `Parameter Validation warrnings for platform > FileStorage > getDefaultHtmlTemplate \n ${warrning}`,
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
const query_params = {};
|
|
578
|
-
query_params["pdf_type_id"] = pdfTypeId;
|
|
579
|
-
query_params["format"] = format;
|
|
580
|
-
query_params["country_code"] = countryCode;
|
|
581
|
-
|
|
582
|
-
const response = await PlatformAPIClient.execute(
|
|
583
|
-
this.config,
|
|
584
|
-
"get",
|
|
585
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/config`,
|
|
586
|
-
query_params,
|
|
587
|
-
undefined,
|
|
588
|
-
requestHeaders,
|
|
589
|
-
{ responseHeaders }
|
|
590
|
-
);
|
|
591
|
-
|
|
592
|
-
let responseData = response;
|
|
593
|
-
if (responseHeaders) {
|
|
594
|
-
responseData = response[0];
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
const {
|
|
598
|
-
error: res_error,
|
|
599
|
-
} = FileStoragePlatformModel.PdfConfigSuccess().validate(responseData, {
|
|
600
|
-
abortEarly: false,
|
|
601
|
-
allowUnknown: true,
|
|
602
|
-
});
|
|
603
|
-
|
|
604
|
-
if (res_error) {
|
|
605
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
606
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
607
|
-
} else {
|
|
608
|
-
Logger({
|
|
609
|
-
level: "WARN",
|
|
610
|
-
message: `Response Validation Warnings for platform > FileStorage > getDefaultHtmlTemplate \n ${res_error}`,
|
|
611
|
-
});
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
return response;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* @param {FileStoragePlatformApplicationValidator.GetDefaultPdfDataParam} arg
|
|
620
|
-
* - Arg object
|
|
621
|
-
*
|
|
622
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
623
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
624
|
-
* @returns {Promise<FileStoragePlatformModel.DummyTemplateDataItems>} -
|
|
625
|
-
* Success response
|
|
626
|
-
* @name getDefaultPdfData
|
|
627
|
-
* @summary: Get default PDF data
|
|
628
|
-
* @description: Retrieve default pdf payload data for invoice generation. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getDefaultPdfData/).
|
|
629
|
-
*/
|
|
630
|
-
async getDefaultPdfData(
|
|
631
|
-
{ pdfTypeId, countryCode, requestHeaders } = { requestHeaders: {} },
|
|
632
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
633
|
-
) {
|
|
634
|
-
const {
|
|
635
|
-
error,
|
|
636
|
-
} = FileStoragePlatformApplicationValidator.getDefaultPdfData().validate(
|
|
637
|
-
{
|
|
638
|
-
pdfTypeId,
|
|
639
|
-
countryCode,
|
|
640
|
-
},
|
|
641
|
-
{ abortEarly: false, allowUnknown: true }
|
|
642
|
-
);
|
|
643
|
-
if (error) {
|
|
644
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
// Showing warrnings if extra unknown parameters are found
|
|
648
|
-
const {
|
|
649
|
-
error: warrning,
|
|
650
|
-
} = FileStoragePlatformApplicationValidator.getDefaultPdfData().validate(
|
|
651
|
-
{
|
|
652
|
-
pdfTypeId,
|
|
653
|
-
countryCode,
|
|
654
|
-
},
|
|
655
|
-
{ abortEarly: false, allowUnknown: false }
|
|
656
|
-
);
|
|
657
|
-
if (warrning) {
|
|
658
|
-
Logger({
|
|
659
|
-
level: "WARN",
|
|
660
|
-
message: `Parameter Validation warrnings for platform > FileStorage > getDefaultPdfData \n ${warrning}`,
|
|
661
|
-
});
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
const query_params = {};
|
|
665
|
-
query_params["pdf_type_id"] = pdfTypeId;
|
|
666
|
-
query_params["country_code"] = countryCode;
|
|
667
|
-
|
|
668
|
-
const response = await PlatformAPIClient.execute(
|
|
669
|
-
this.config,
|
|
670
|
-
"get",
|
|
671
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/mapper`,
|
|
672
|
-
query_params,
|
|
673
|
-
undefined,
|
|
674
|
-
requestHeaders,
|
|
675
|
-
{ responseHeaders }
|
|
676
|
-
);
|
|
677
|
-
|
|
678
|
-
let responseData = response;
|
|
679
|
-
if (responseHeaders) {
|
|
680
|
-
responseData = response[0];
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
const {
|
|
684
|
-
error: res_error,
|
|
685
|
-
} = FileStoragePlatformModel.DummyTemplateDataItems().validate(
|
|
686
|
-
responseData,
|
|
687
|
-
{ abortEarly: false, allowUnknown: true }
|
|
688
|
-
);
|
|
689
|
-
|
|
690
|
-
if (res_error) {
|
|
691
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
692
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
693
|
-
} else {
|
|
694
|
-
Logger({
|
|
695
|
-
level: "WARN",
|
|
696
|
-
message: `Response Validation Warnings for platform > FileStorage > getDefaultPdfData \n ${res_error}`,
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
return response;
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
/**
|
|
705
|
-
* @param {FileStoragePlatformApplicationValidator.GetDefaultPdfTemplateParam} arg
|
|
706
|
-
* - Arg object
|
|
707
|
-
*
|
|
708
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
709
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
710
|
-
* @returns {Promise<FileStoragePlatformModel.PdfDefaultTemplateSuccess>} -
|
|
711
|
-
* Success response
|
|
712
|
-
* @name getDefaultPdfTemplate
|
|
713
|
-
* @summary: Get default PDF template
|
|
714
|
-
* @description: Retrieve to get the default Invoice template. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getDefaultPdfTemplate/).
|
|
715
|
-
*/
|
|
716
|
-
async getDefaultPdfTemplate(
|
|
717
|
-
{ pdfTypeId, format, countryCode, requestHeaders } = { requestHeaders: {} },
|
|
718
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
719
|
-
) {
|
|
720
|
-
const {
|
|
721
|
-
error,
|
|
722
|
-
} = FileStoragePlatformApplicationValidator.getDefaultPdfTemplate().validate(
|
|
723
|
-
{
|
|
724
|
-
pdfTypeId,
|
|
725
|
-
format,
|
|
726
|
-
countryCode,
|
|
727
|
-
},
|
|
728
|
-
{ abortEarly: false, allowUnknown: true }
|
|
729
|
-
);
|
|
730
|
-
if (error) {
|
|
731
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
// Showing warrnings if extra unknown parameters are found
|
|
735
|
-
const {
|
|
736
|
-
error: warrning,
|
|
737
|
-
} = FileStoragePlatformApplicationValidator.getDefaultPdfTemplate().validate(
|
|
738
|
-
{
|
|
739
|
-
pdfTypeId,
|
|
740
|
-
format,
|
|
741
|
-
countryCode,
|
|
742
|
-
},
|
|
743
|
-
{ abortEarly: false, allowUnknown: false }
|
|
744
|
-
);
|
|
745
|
-
if (warrning) {
|
|
746
|
-
Logger({
|
|
747
|
-
level: "WARN",
|
|
748
|
-
message: `Parameter Validation warrnings for platform > FileStorage > getDefaultPdfTemplate \n ${warrning}`,
|
|
749
|
-
});
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
const query_params = {};
|
|
753
|
-
query_params["pdf_type_id"] = pdfTypeId;
|
|
754
|
-
query_params["format"] = format;
|
|
755
|
-
query_params["country_code"] = countryCode;
|
|
756
|
-
|
|
757
|
-
const response = await PlatformAPIClient.execute(
|
|
758
|
-
this.config,
|
|
759
|
-
"get",
|
|
760
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/default-template`,
|
|
761
|
-
query_params,
|
|
762
|
-
undefined,
|
|
763
|
-
requestHeaders,
|
|
764
|
-
{ responseHeaders }
|
|
765
|
-
);
|
|
766
|
-
|
|
767
|
-
let responseData = response;
|
|
768
|
-
if (responseHeaders) {
|
|
769
|
-
responseData = response[0];
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
const {
|
|
773
|
-
error: res_error,
|
|
774
|
-
} = FileStoragePlatformModel.PdfDefaultTemplateSuccess().validate(
|
|
775
|
-
responseData,
|
|
776
|
-
{ abortEarly: false, allowUnknown: true }
|
|
777
|
-
);
|
|
778
|
-
|
|
779
|
-
if (res_error) {
|
|
780
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
781
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
782
|
-
} else {
|
|
783
|
-
Logger({
|
|
784
|
-
level: "WARN",
|
|
785
|
-
message: `Response Validation Warnings for platform > FileStorage > getDefaultPdfTemplate \n ${res_error}`,
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
return response;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
/**
|
|
794
|
-
* @param {FileStoragePlatformApplicationValidator.GetPdfTypesParam} arg - Arg object
|
|
795
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
796
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
797
|
-
* @returns {Promise<FileStoragePlatformModel.InvoiceTypesResponse>} -
|
|
798
|
-
* Success response
|
|
799
|
-
* @name getPdfTypes
|
|
800
|
-
* @summary: Get PDF types
|
|
801
|
-
* @description: Retrieve a list of available invoice types. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getPdfTypes/).
|
|
802
|
-
*/
|
|
803
|
-
async getPdfTypes(
|
|
804
|
-
{ countryCode, requestHeaders } = { requestHeaders: {} },
|
|
805
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
806
|
-
) {
|
|
807
|
-
const {
|
|
808
|
-
error,
|
|
809
|
-
} = FileStoragePlatformApplicationValidator.getPdfTypes().validate(
|
|
810
|
-
{
|
|
811
|
-
countryCode,
|
|
812
|
-
},
|
|
813
|
-
{ abortEarly: false, allowUnknown: true }
|
|
814
|
-
);
|
|
815
|
-
if (error) {
|
|
816
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
// Showing warrnings if extra unknown parameters are found
|
|
820
|
-
const {
|
|
821
|
-
error: warrning,
|
|
822
|
-
} = FileStoragePlatformApplicationValidator.getPdfTypes().validate(
|
|
823
|
-
{
|
|
824
|
-
countryCode,
|
|
825
|
-
},
|
|
826
|
-
{ abortEarly: false, allowUnknown: false }
|
|
827
|
-
);
|
|
828
|
-
if (warrning) {
|
|
829
|
-
Logger({
|
|
830
|
-
level: "WARN",
|
|
831
|
-
message: `Parameter Validation warrnings for platform > FileStorage > getPdfTypes \n ${warrning}`,
|
|
832
|
-
});
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
const query_params = {};
|
|
836
|
-
query_params["country_code"] = countryCode;
|
|
837
|
-
|
|
838
|
-
const response = await PlatformAPIClient.execute(
|
|
839
|
-
this.config,
|
|
840
|
-
"get",
|
|
841
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/types`,
|
|
842
|
-
query_params,
|
|
843
|
-
undefined,
|
|
844
|
-
requestHeaders,
|
|
845
|
-
{ responseHeaders }
|
|
846
|
-
);
|
|
847
|
-
|
|
848
|
-
let responseData = response;
|
|
849
|
-
if (responseHeaders) {
|
|
850
|
-
responseData = response[0];
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
const {
|
|
854
|
-
error: res_error,
|
|
855
|
-
} = FileStoragePlatformModel.InvoiceTypesResponse().validate(responseData, {
|
|
856
|
-
abortEarly: false,
|
|
857
|
-
allowUnknown: true,
|
|
858
|
-
});
|
|
859
|
-
|
|
860
|
-
if (res_error) {
|
|
861
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
862
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
863
|
-
} else {
|
|
864
|
-
Logger({
|
|
865
|
-
level: "WARN",
|
|
866
|
-
message: `Response Validation Warnings for platform > FileStorage > getPdfTypes \n ${res_error}`,
|
|
867
|
-
});
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
return response;
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
/**
|
|
875
|
-
* @param {FileStoragePlatformApplicationValidator.SaveHtmlTemplateParam} arg
|
|
876
|
-
* - Arg object
|
|
877
|
-
*
|
|
878
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
879
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
880
|
-
* @returns {Promise<FileStoragePlatformModel.PdfConfigSaveSuccess>} -
|
|
881
|
-
* Success response
|
|
882
|
-
* @name saveHtmlTemplate
|
|
883
|
-
* @summary: Save PDF template
|
|
884
|
-
* @description: Save html template for provided sales channel - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/saveHtmlTemplate/).
|
|
885
|
-
*/
|
|
886
|
-
async saveHtmlTemplate(
|
|
887
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
888
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
889
|
-
) {
|
|
890
|
-
const {
|
|
891
|
-
error,
|
|
892
|
-
} = FileStoragePlatformApplicationValidator.saveHtmlTemplate().validate(
|
|
893
|
-
{
|
|
894
|
-
body,
|
|
895
|
-
},
|
|
896
|
-
{ abortEarly: false, allowUnknown: true }
|
|
897
|
-
);
|
|
898
|
-
if (error) {
|
|
899
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
// Showing warrnings if extra unknown parameters are found
|
|
903
|
-
const {
|
|
904
|
-
error: warrning,
|
|
905
|
-
} = FileStoragePlatformApplicationValidator.saveHtmlTemplate().validate(
|
|
906
|
-
{
|
|
907
|
-
body,
|
|
908
|
-
},
|
|
909
|
-
{ abortEarly: false, allowUnknown: false }
|
|
910
|
-
);
|
|
911
|
-
if (warrning) {
|
|
912
|
-
Logger({
|
|
913
|
-
level: "WARN",
|
|
914
|
-
message: `Parameter Validation warrnings for platform > FileStorage > saveHtmlTemplate \n ${warrning}`,
|
|
915
|
-
});
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
const query_params = {};
|
|
919
|
-
|
|
920
|
-
const response = await PlatformAPIClient.execute(
|
|
921
|
-
this.config,
|
|
922
|
-
"post",
|
|
923
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/config`,
|
|
924
|
-
query_params,
|
|
925
|
-
body,
|
|
926
|
-
requestHeaders,
|
|
927
|
-
{ responseHeaders }
|
|
928
|
-
);
|
|
929
|
-
|
|
930
|
-
let responseData = response;
|
|
931
|
-
if (responseHeaders) {
|
|
932
|
-
responseData = response[0];
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
const {
|
|
936
|
-
error: res_error,
|
|
937
|
-
} = FileStoragePlatformModel.PdfConfigSaveSuccess().validate(responseData, {
|
|
938
|
-
abortEarly: false,
|
|
939
|
-
allowUnknown: true,
|
|
940
|
-
});
|
|
941
|
-
|
|
942
|
-
if (res_error) {
|
|
943
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
944
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
945
|
-
} else {
|
|
946
|
-
Logger({
|
|
947
|
-
level: "WARN",
|
|
948
|
-
message: `Response Validation Warnings for platform > FileStorage > saveHtmlTemplate \n ${res_error}`,
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
return response;
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
/**
|
|
957
|
-
* @param {FileStoragePlatformApplicationValidator.UpdateHtmlTemplateParam} arg
|
|
958
|
-
* - Arg object
|
|
959
|
-
*
|
|
960
|
-
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
961
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
962
|
-
* @returns {Promise<FileStoragePlatformModel.PdfConfigSaveSuccess>} -
|
|
963
|
-
* Success response
|
|
964
|
-
* @name updateHtmlTemplate
|
|
965
|
-
* @summary: Update HTML Template
|
|
966
|
-
* @description: Update the HTML Template. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/updateHtmlTemplate/).
|
|
967
|
-
*/
|
|
968
|
-
async updateHtmlTemplate(
|
|
969
|
-
{ id, body, requestHeaders } = { requestHeaders: {} },
|
|
970
|
-
{ responseHeaders } = { responseHeaders: false }
|
|
971
|
-
) {
|
|
972
|
-
const {
|
|
973
|
-
error,
|
|
974
|
-
} = FileStoragePlatformApplicationValidator.updateHtmlTemplate().validate(
|
|
975
|
-
{
|
|
976
|
-
id,
|
|
977
|
-
body,
|
|
978
|
-
},
|
|
979
|
-
{ abortEarly: false, allowUnknown: true }
|
|
980
|
-
);
|
|
981
|
-
if (error) {
|
|
982
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
// Showing warrnings if extra unknown parameters are found
|
|
986
|
-
const {
|
|
987
|
-
error: warrning,
|
|
988
|
-
} = FileStoragePlatformApplicationValidator.updateHtmlTemplate().validate(
|
|
989
|
-
{
|
|
990
|
-
id,
|
|
991
|
-
body,
|
|
992
|
-
},
|
|
993
|
-
{ abortEarly: false, allowUnknown: false }
|
|
994
|
-
);
|
|
995
|
-
if (warrning) {
|
|
996
|
-
Logger({
|
|
997
|
-
level: "WARN",
|
|
998
|
-
message: `Parameter Validation warrnings for platform > FileStorage > updateHtmlTemplate \n ${warrning}`,
|
|
999
|
-
});
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
const query_params = {};
|
|
1003
|
-
|
|
1004
|
-
const response = await PlatformAPIClient.execute(
|
|
1005
|
-
this.config,
|
|
1006
|
-
"put",
|
|
1007
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/config/${id}`,
|
|
1008
|
-
query_params,
|
|
1009
|
-
body,
|
|
1010
|
-
requestHeaders,
|
|
1011
|
-
{ responseHeaders }
|
|
1012
|
-
);
|
|
1013
|
-
|
|
1014
|
-
let responseData = response;
|
|
1015
|
-
if (responseHeaders) {
|
|
1016
|
-
responseData = response[0];
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
const {
|
|
1020
|
-
error: res_error,
|
|
1021
|
-
} = FileStoragePlatformModel.PdfConfigSaveSuccess().validate(responseData, {
|
|
1022
|
-
abortEarly: false,
|
|
1023
|
-
allowUnknown: true,
|
|
1024
|
-
});
|
|
1025
|
-
|
|
1026
|
-
if (res_error) {
|
|
1027
|
-
if (this.config.options.strictResponseCheck === true) {
|
|
1028
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
1029
|
-
} else {
|
|
1030
|
-
Logger({
|
|
1031
|
-
level: "WARN",
|
|
1032
|
-
message: `Response Validation Warnings for platform > FileStorage > updateHtmlTemplate \n ${res_error}`,
|
|
1033
|
-
});
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
return response;
|
|
1038
|
-
}
|
|
1039
369
|
}
|
|
1040
370
|
|
|
1041
371
|
/**
|