@gofynd/fdk-client-javascript 1.3.4-beta.1 → 1.3.4-beta.2
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 +1 -1
- package/package.json +1 -1
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +18 -1
- package/sdk/application/Catalog/CatalogApplicationModel.js +20 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +3 -3
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +23 -9
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +21 -7
- package/sdk/application/User/UserApplicationClient.d.ts +56 -0
- package/sdk/application/User/UserApplicationClient.js +385 -0
- package/sdk/application/User/UserApplicationModel.d.ts +93 -1
- package/sdk/application/User/UserApplicationModel.js +110 -0
- package/sdk/application/User/UserApplicationValidator.d.ts +66 -1
- package/sdk/application/User/UserApplicationValidator.js +68 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +96 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +177 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +139 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +158 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +6 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +33 -0
- package/sdk/partner/PartnerClient.d.ts +2 -0
- package/sdk/partner/PartnerClient.js +3 -0
- package/sdk/partner/index.d.ts +1 -0
- package/sdk/partner/index.js +2 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +4 -16
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +11 -79
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +12 -8
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -9
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +37 -27
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +145 -56
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +22 -11
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +24 -10
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +4 -4
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +4 -8
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +832 -150
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +940 -138
- package/sdk/platform/Order/OrderPlatformClient.d.ts +2 -2
- package/sdk/platform/Order/OrderPlatformClient.js +1 -1
- package/sdk/platform/Order/OrderPlatformModel.d.ts +10 -2
- package/sdk/platform/Order/OrderPlatformModel.js +10 -2
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +4 -4
- package/sdk/platform/Order/OrderPlatformValidator.js +4 -4
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +42 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +241 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +41 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +40 -0
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +72 -1
- package/sdk/platform/Payment/PaymentPlatformModel.js +54 -0
|
@@ -37,12 +37,12 @@ declare class FileStorage {
|
|
|
37
37
|
* @param {FileStoragePlatformApplicationValidator.AppCopyFilesParam} arg - Arg object
|
|
38
38
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
39
39
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
40
|
-
* @returns {Promise<
|
|
40
|
+
* @returns {Promise<Object>} - Success response
|
|
41
41
|
* @name appCopyFiles
|
|
42
42
|
* @summary: Copy Files
|
|
43
43
|
* @description: Copy Files - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/appCopyFiles/).
|
|
44
44
|
*/
|
|
45
|
-
appCopyFiles({ body, sync, requestHeaders }?: FileStoragePlatformApplicationValidator.AppCopyFilesParam, { responseHeaders }?: object): Promise<
|
|
45
|
+
appCopyFiles({ body, sync, requestHeaders }?: FileStoragePlatformApplicationValidator.AppCopyFilesParam, { responseHeaders }?: object): Promise<any>;
|
|
46
46
|
/**
|
|
47
47
|
* @param {FileStoragePlatformApplicationValidator.AppStartUploadParam} arg
|
|
48
48
|
* - Arg object
|
|
@@ -77,89 +77,99 @@ declare class FileStorage {
|
|
|
77
77
|
* @param {FileStoragePlatformApplicationValidator.AppbrowseParam} arg - Arg object
|
|
78
78
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
79
79
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
80
|
-
* @returns {Promise<
|
|
80
|
+
* @returns {Promise<Object>} - Success response
|
|
81
81
|
* @name appbrowse
|
|
82
82
|
* @summary: Browse Files
|
|
83
83
|
* @description: Browse Files - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/appbrowse/).
|
|
84
84
|
*/
|
|
85
|
-
appbrowse({ namespace, page, limit, requestHeaders }?: FileStoragePlatformApplicationValidator.AppbrowseParam, { responseHeaders }?: object): Promise<
|
|
85
|
+
appbrowse({ namespace, page, limit, requestHeaders }?: FileStoragePlatformApplicationValidator.AppbrowseParam, { responseHeaders }?: object): Promise<any>;
|
|
86
|
+
/**
|
|
87
|
+
* @param {FileStoragePlatformApplicationValidator.GeneratePaymentReceiptParam} arg
|
|
88
|
+
* - Arg object
|
|
89
|
+
*
|
|
90
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
91
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
92
|
+
* @returns {Promise<Object>} - Success response
|
|
93
|
+
* @name generatePaymentReceipt
|
|
94
|
+
* @summary: Generate Payment Receipt for Jiomart Digital
|
|
95
|
+
* @description: Generate Payment Receipt for Jiomart Digital - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/generatePaymentReceipt/).
|
|
96
|
+
*/
|
|
97
|
+
generatePaymentReceipt({ body, requestHeaders }?: FileStoragePlatformApplicationValidator.GeneratePaymentReceiptParam, { responseHeaders }?: object): Promise<any>;
|
|
86
98
|
/**
|
|
87
99
|
* @param {FileStoragePlatformApplicationValidator.GetDefaultHtmlTemplateParam} arg
|
|
88
100
|
* - Arg object
|
|
89
101
|
*
|
|
90
102
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
91
103
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
92
|
-
* @returns {Promise<FileStoragePlatformModel.PdfConfigSuccess
|
|
104
|
+
* @returns {Promise<FileStoragePlatformModel.PdfConfigSuccess>} - Success response
|
|
93
105
|
* @name getDefaultHtmlTemplate
|
|
94
106
|
* @summary: Get html template for sales channel
|
|
95
107
|
* @description: Get default html template for invoice or label - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getDefaultHtmlTemplate/).
|
|
96
108
|
*/
|
|
97
|
-
getDefaultHtmlTemplate({ pdfTypeId, format, requestHeaders }?: FileStoragePlatformApplicationValidator.GetDefaultHtmlTemplateParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.PdfConfigSuccess
|
|
109
|
+
getDefaultHtmlTemplate({ pdfTypeId, format, requestHeaders }?: FileStoragePlatformApplicationValidator.GetDefaultHtmlTemplateParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.PdfConfigSuccess>;
|
|
98
110
|
/**
|
|
99
111
|
* @param {FileStoragePlatformApplicationValidator.GetDefaultPdfDataParam} arg
|
|
100
112
|
* - Arg object
|
|
101
113
|
*
|
|
102
114
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
103
115
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
104
|
-
* @returns {Promise<FileStoragePlatformModel.DummyTemplateDataItems
|
|
116
|
+
* @returns {Promise<FileStoragePlatformModel.DummyTemplateDataItems>} -
|
|
105
117
|
* Success response
|
|
106
118
|
* @name getDefaultPdfData
|
|
107
119
|
* @summary: Get Dummy pdf data for invoice or label
|
|
108
120
|
* @description: Get Dummy pdf data for invoice or label - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getDefaultPdfData/).
|
|
109
121
|
*/
|
|
110
|
-
getDefaultPdfData({ pdfTypeId, requestHeaders }?: FileStoragePlatformApplicationValidator.GetDefaultPdfDataParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.DummyTemplateDataItems
|
|
122
|
+
getDefaultPdfData({ pdfTypeId, requestHeaders }?: FileStoragePlatformApplicationValidator.GetDefaultPdfDataParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.DummyTemplateDataItems>;
|
|
111
123
|
/**
|
|
112
124
|
* @param {FileStoragePlatformApplicationValidator.GetDefaultPdfTemplateParam} arg
|
|
113
125
|
* - Arg object
|
|
114
126
|
*
|
|
115
127
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
116
128
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
117
|
-
* @returns {Promise<
|
|
118
|
-
*
|
|
119
|
-
* >}
|
|
120
|
-
* - Success response
|
|
121
|
-
*
|
|
129
|
+
* @returns {Promise<FileStoragePlatformModel.PdfDefaultTemplateSuccess>} -
|
|
130
|
+
* Success response
|
|
122
131
|
* @name getDefaultPdfTemplate
|
|
123
132
|
* @summary: Default html template
|
|
124
133
|
* @description: Get default html template data for invoice or label - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getDefaultPdfTemplate/).
|
|
125
134
|
*/
|
|
126
|
-
getDefaultPdfTemplate({ pdfTypeId, format, requestHeaders }?: FileStoragePlatformApplicationValidator.GetDefaultPdfTemplateParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.PdfDefaultTemplateSuccess
|
|
135
|
+
getDefaultPdfTemplate({ pdfTypeId, format, requestHeaders }?: FileStoragePlatformApplicationValidator.GetDefaultPdfTemplateParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.PdfDefaultTemplateSuccess>;
|
|
127
136
|
/**
|
|
128
137
|
* @param {FileStoragePlatformApplicationValidator.GetPdfTypesParam} arg - Arg object
|
|
129
138
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
130
139
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
131
|
-
* @returns {Promise<FileStoragePlatformModel.InvoiceTypesResponse
|
|
140
|
+
* @returns {Promise<FileStoragePlatformModel.InvoiceTypesResponse>} -
|
|
132
141
|
* Success response
|
|
133
142
|
* @name getPdfTypes
|
|
134
143
|
* @summary: Get all the supported invoice pdf types
|
|
135
144
|
* @description: Get all the supported invoice pdf types such as Invoice, Label, Deliver challan - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getPdfTypes/).
|
|
136
145
|
*/
|
|
137
|
-
getPdfTypes({ requestHeaders }?: any, { responseHeaders }?: object): Promise<FileStoragePlatformModel.InvoiceTypesResponse
|
|
146
|
+
getPdfTypes({ requestHeaders }?: any, { responseHeaders }?: object): Promise<FileStoragePlatformModel.InvoiceTypesResponse>;
|
|
138
147
|
/**
|
|
139
|
-
* @param {FileStoragePlatformApplicationValidator.
|
|
148
|
+
* @param {FileStoragePlatformApplicationValidator.SaveHtmlTemplateParam} arg
|
|
140
149
|
* - Arg object
|
|
141
150
|
*
|
|
142
151
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
143
152
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
144
|
-
* @returns {Promise<
|
|
145
|
-
*
|
|
146
|
-
* @
|
|
147
|
-
* @
|
|
153
|
+
* @returns {Promise<FileStoragePlatformModel.PdfConfigSaveSuccess>} -
|
|
154
|
+
* Success response
|
|
155
|
+
* @name saveHtmlTemplate
|
|
156
|
+
* @summary: Update html template for invoice or label
|
|
157
|
+
* @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/saveHtmlTemplate/).
|
|
148
158
|
*/
|
|
149
|
-
|
|
159
|
+
saveHtmlTemplate({ body, requestHeaders }?: FileStoragePlatformApplicationValidator.SaveHtmlTemplateParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.PdfConfigSaveSuccess>;
|
|
150
160
|
/**
|
|
151
|
-
* @param {FileStoragePlatformApplicationValidator.
|
|
161
|
+
* @param {FileStoragePlatformApplicationValidator.UpdateHtmlTemplateParam} arg
|
|
152
162
|
* - Arg object
|
|
153
163
|
*
|
|
154
164
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
155
165
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
156
|
-
* @returns {Promise<FileStoragePlatformModel.PdfConfigSaveSuccess
|
|
166
|
+
* @returns {Promise<FileStoragePlatformModel.PdfConfigSaveSuccess>} -
|
|
157
167
|
* Success response
|
|
158
|
-
* @name
|
|
168
|
+
* @name updateHtmlTemplate
|
|
159
169
|
* @summary: Update html template for invoice or label
|
|
160
|
-
* @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/
|
|
170
|
+
* @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/updateHtmlTemplate/).
|
|
161
171
|
*/
|
|
162
|
-
|
|
172
|
+
updateHtmlTemplate({ id, body, requestHeaders }?: FileStoragePlatformApplicationValidator.UpdateHtmlTemplateParam, { responseHeaders }?: object): Promise<FileStoragePlatformModel.PdfConfigSaveSuccess>;
|
|
163
173
|
/**
|
|
164
174
|
* @param data
|
|
165
175
|
* @param {string} file_name
|
|
@@ -117,7 +117,7 @@ class FileStorage {
|
|
|
117
117
|
* @param {FileStoragePlatformApplicationValidator.AppCopyFilesParam} arg - Arg object
|
|
118
118
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
119
119
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
120
|
-
* @returns {Promise<
|
|
120
|
+
* @returns {Promise<Object>} - Success response
|
|
121
121
|
* @name appCopyFiles
|
|
122
122
|
* @summary: Copy Files
|
|
123
123
|
* @description: Copy Files - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/appCopyFiles/).
|
|
@@ -174,9 +174,7 @@ class FileStorage {
|
|
|
174
174
|
responseData = response[0];
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
const {
|
|
178
|
-
error: res_error,
|
|
179
|
-
} = FileStoragePlatformModel.BulkUploadSyncMode().validate(responseData, {
|
|
177
|
+
const { error: res_error } = Joi.any().validate(responseData, {
|
|
180
178
|
abortEarly: false,
|
|
181
179
|
allowUnknown: false,
|
|
182
180
|
});
|
|
@@ -294,7 +292,7 @@ class FileStorage {
|
|
|
294
292
|
* @param {FileStoragePlatformApplicationValidator.AppbrowseParam} arg - Arg object
|
|
295
293
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
296
294
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
297
|
-
* @returns {Promise<
|
|
295
|
+
* @returns {Promise<Object>} - Success response
|
|
298
296
|
* @name appbrowse
|
|
299
297
|
* @summary: Browse Files
|
|
300
298
|
* @description: Browse Files - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/appbrowse/).
|
|
@@ -356,9 +354,7 @@ class FileStorage {
|
|
|
356
354
|
responseData = response[0];
|
|
357
355
|
}
|
|
358
356
|
|
|
359
|
-
const {
|
|
360
|
-
error: res_error,
|
|
361
|
-
} = FileStoragePlatformModel.BrowseResponse().validate(responseData, {
|
|
357
|
+
const { error: res_error } = Joi.any().validate(responseData, {
|
|
362
358
|
abortEarly: false,
|
|
363
359
|
allowUnknown: false,
|
|
364
360
|
});
|
|
@@ -373,13 +369,88 @@ class FileStorage {
|
|
|
373
369
|
return response;
|
|
374
370
|
}
|
|
375
371
|
|
|
372
|
+
/**
|
|
373
|
+
* @param {FileStoragePlatformApplicationValidator.GeneratePaymentReceiptParam} arg
|
|
374
|
+
* - Arg object
|
|
375
|
+
*
|
|
376
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
377
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
378
|
+
* @returns {Promise<Object>} - Success response
|
|
379
|
+
* @name generatePaymentReceipt
|
|
380
|
+
* @summary: Generate Payment Receipt for Jiomart Digital
|
|
381
|
+
* @description: Generate Payment Receipt for Jiomart Digital - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/generatePaymentReceipt/).
|
|
382
|
+
*/
|
|
383
|
+
async generatePaymentReceipt(
|
|
384
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
385
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
386
|
+
) {
|
|
387
|
+
const {
|
|
388
|
+
error,
|
|
389
|
+
} = FileStoragePlatformApplicationValidator.generatePaymentReceipt().validate(
|
|
390
|
+
{
|
|
391
|
+
body,
|
|
392
|
+
},
|
|
393
|
+
{ abortEarly: false, allowUnknown: true }
|
|
394
|
+
);
|
|
395
|
+
if (error) {
|
|
396
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// Showing warrnings if extra unknown parameters are found
|
|
400
|
+
const {
|
|
401
|
+
error: warrning,
|
|
402
|
+
} = FileStoragePlatformApplicationValidator.generatePaymentReceipt().validate(
|
|
403
|
+
{
|
|
404
|
+
body,
|
|
405
|
+
},
|
|
406
|
+
{ abortEarly: false, allowUnknown: false }
|
|
407
|
+
);
|
|
408
|
+
if (warrning) {
|
|
409
|
+
Logger({
|
|
410
|
+
level: "WARN",
|
|
411
|
+
message: `Parameter Validation warrnings for platform > FileStorage > generatePaymentReceipt \n ${warrning}`,
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
const query_params = {};
|
|
416
|
+
|
|
417
|
+
const response = await PlatformAPIClient.execute(
|
|
418
|
+
this.config,
|
|
419
|
+
"post",
|
|
420
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/payment-receipt`,
|
|
421
|
+
query_params,
|
|
422
|
+
body,
|
|
423
|
+
requestHeaders,
|
|
424
|
+
{ responseHeaders }
|
|
425
|
+
);
|
|
426
|
+
|
|
427
|
+
let responseData = response;
|
|
428
|
+
if (responseHeaders) {
|
|
429
|
+
responseData = response[0];
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const { error: res_error } = Joi.any().validate(responseData, {
|
|
433
|
+
abortEarly: false,
|
|
434
|
+
allowUnknown: false,
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
if (res_error) {
|
|
438
|
+
Logger({
|
|
439
|
+
level: "WARN",
|
|
440
|
+
message: `Response Validation Warnnings for platform > FileStorage > generatePaymentReceipt \n ${res_error}`,
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
return response;
|
|
445
|
+
}
|
|
446
|
+
|
|
376
447
|
/**
|
|
377
448
|
* @param {FileStoragePlatformApplicationValidator.GetDefaultHtmlTemplateParam} arg
|
|
378
449
|
* - Arg object
|
|
379
450
|
*
|
|
380
451
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
381
452
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
382
|
-
* @returns {Promise<FileStoragePlatformModel.PdfConfigSuccess
|
|
453
|
+
* @returns {Promise<FileStoragePlatformModel.PdfConfigSuccess>} - Success response
|
|
383
454
|
* @name getDefaultHtmlTemplate
|
|
384
455
|
* @summary: Get html template for sales channel
|
|
385
456
|
* @description: Get default html template for invoice or label - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getDefaultHtmlTemplate/).
|
|
@@ -437,9 +508,12 @@ class FileStorage {
|
|
|
437
508
|
responseData = response[0];
|
|
438
509
|
}
|
|
439
510
|
|
|
440
|
-
const {
|
|
441
|
-
|
|
442
|
-
|
|
511
|
+
const {
|
|
512
|
+
error: res_error,
|
|
513
|
+
} = FileStoragePlatformModel.PdfConfigSuccess().validate(responseData, {
|
|
514
|
+
abortEarly: false,
|
|
515
|
+
allowUnknown: false,
|
|
516
|
+
});
|
|
443
517
|
|
|
444
518
|
if (res_error) {
|
|
445
519
|
Logger({
|
|
@@ -457,7 +531,7 @@ class FileStorage {
|
|
|
457
531
|
*
|
|
458
532
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
459
533
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
460
|
-
* @returns {Promise<FileStoragePlatformModel.DummyTemplateDataItems
|
|
534
|
+
* @returns {Promise<FileStoragePlatformModel.DummyTemplateDataItems>} -
|
|
461
535
|
* Success response
|
|
462
536
|
* @name getDefaultPdfData
|
|
463
537
|
* @summary: Get Dummy pdf data for invoice or label
|
|
@@ -513,9 +587,12 @@ class FileStorage {
|
|
|
513
587
|
responseData = response[0];
|
|
514
588
|
}
|
|
515
589
|
|
|
516
|
-
const {
|
|
517
|
-
|
|
518
|
-
|
|
590
|
+
const {
|
|
591
|
+
error: res_error,
|
|
592
|
+
} = FileStoragePlatformModel.DummyTemplateDataItems().validate(
|
|
593
|
+
responseData,
|
|
594
|
+
{ abortEarly: false, allowUnknown: false }
|
|
595
|
+
);
|
|
519
596
|
|
|
520
597
|
if (res_error) {
|
|
521
598
|
Logger({
|
|
@@ -533,11 +610,8 @@ class FileStorage {
|
|
|
533
610
|
*
|
|
534
611
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
535
612
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
536
|
-
* @returns {Promise<
|
|
537
|
-
*
|
|
538
|
-
* >}
|
|
539
|
-
* - Success response
|
|
540
|
-
*
|
|
613
|
+
* @returns {Promise<FileStoragePlatformModel.PdfDefaultTemplateSuccess>} -
|
|
614
|
+
* Success response
|
|
541
615
|
* @name getDefaultPdfTemplate
|
|
542
616
|
* @summary: Default html template
|
|
543
617
|
* @description: Get default html template data for invoice or label - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/filestorage/getDefaultPdfTemplate/).
|
|
@@ -595,9 +669,12 @@ class FileStorage {
|
|
|
595
669
|
responseData = response[0];
|
|
596
670
|
}
|
|
597
671
|
|
|
598
|
-
const {
|
|
599
|
-
|
|
600
|
-
|
|
672
|
+
const {
|
|
673
|
+
error: res_error,
|
|
674
|
+
} = FileStoragePlatformModel.PdfDefaultTemplateSuccess().validate(
|
|
675
|
+
responseData,
|
|
676
|
+
{ abortEarly: false, allowUnknown: false }
|
|
677
|
+
);
|
|
601
678
|
|
|
602
679
|
if (res_error) {
|
|
603
680
|
Logger({
|
|
@@ -613,7 +690,7 @@ class FileStorage {
|
|
|
613
690
|
* @param {FileStoragePlatformApplicationValidator.GetPdfTypesParam} arg - Arg object
|
|
614
691
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
615
692
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
616
|
-
* @returns {Promise<FileStoragePlatformModel.InvoiceTypesResponse
|
|
693
|
+
* @returns {Promise<FileStoragePlatformModel.InvoiceTypesResponse>} -
|
|
617
694
|
* Success response
|
|
618
695
|
* @name getPdfTypes
|
|
619
696
|
* @summary: Get all the supported invoice pdf types
|
|
@@ -664,9 +741,12 @@ class FileStorage {
|
|
|
664
741
|
responseData = response[0];
|
|
665
742
|
}
|
|
666
743
|
|
|
667
|
-
const {
|
|
668
|
-
|
|
669
|
-
|
|
744
|
+
const {
|
|
745
|
+
error: res_error,
|
|
746
|
+
} = FileStoragePlatformModel.InvoiceTypesResponse().validate(responseData, {
|
|
747
|
+
abortEarly: false,
|
|
748
|
+
allowUnknown: false,
|
|
749
|
+
});
|
|
670
750
|
|
|
671
751
|
if (res_error) {
|
|
672
752
|
Logger({
|
|
@@ -679,23 +759,24 @@ class FileStorage {
|
|
|
679
759
|
}
|
|
680
760
|
|
|
681
761
|
/**
|
|
682
|
-
* @param {FileStoragePlatformApplicationValidator.
|
|
762
|
+
* @param {FileStoragePlatformApplicationValidator.SaveHtmlTemplateParam} arg
|
|
683
763
|
* - Arg object
|
|
684
764
|
*
|
|
685
765
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
686
766
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
687
|
-
* @returns {Promise<
|
|
688
|
-
*
|
|
689
|
-
* @
|
|
690
|
-
* @
|
|
767
|
+
* @returns {Promise<FileStoragePlatformModel.PdfConfigSaveSuccess>} -
|
|
768
|
+
* Success response
|
|
769
|
+
* @name saveHtmlTemplate
|
|
770
|
+
* @summary: Update html template for invoice or label
|
|
771
|
+
* @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/saveHtmlTemplate/).
|
|
691
772
|
*/
|
|
692
|
-
async
|
|
773
|
+
async saveHtmlTemplate(
|
|
693
774
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
694
775
|
{ responseHeaders } = { responseHeaders: false }
|
|
695
776
|
) {
|
|
696
777
|
const {
|
|
697
778
|
error,
|
|
698
|
-
} = FileStoragePlatformApplicationValidator.
|
|
779
|
+
} = FileStoragePlatformApplicationValidator.saveHtmlTemplate().validate(
|
|
699
780
|
{
|
|
700
781
|
body,
|
|
701
782
|
},
|
|
@@ -708,7 +789,7 @@ class FileStorage {
|
|
|
708
789
|
// Showing warrnings if extra unknown parameters are found
|
|
709
790
|
const {
|
|
710
791
|
error: warrning,
|
|
711
|
-
} = FileStoragePlatformApplicationValidator.
|
|
792
|
+
} = FileStoragePlatformApplicationValidator.saveHtmlTemplate().validate(
|
|
712
793
|
{
|
|
713
794
|
body,
|
|
714
795
|
},
|
|
@@ -717,7 +798,7 @@ class FileStorage {
|
|
|
717
798
|
if (warrning) {
|
|
718
799
|
Logger({
|
|
719
800
|
level: "WARN",
|
|
720
|
-
message: `Parameter Validation warrnings for platform > FileStorage >
|
|
801
|
+
message: `Parameter Validation warrnings for platform > FileStorage > saveHtmlTemplate \n ${warrning}`,
|
|
721
802
|
});
|
|
722
803
|
}
|
|
723
804
|
|
|
@@ -726,7 +807,7 @@ class FileStorage {
|
|
|
726
807
|
const response = await PlatformAPIClient.execute(
|
|
727
808
|
this.config,
|
|
728
809
|
"post",
|
|
729
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/
|
|
810
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/config`,
|
|
730
811
|
query_params,
|
|
731
812
|
body,
|
|
732
813
|
requestHeaders,
|
|
@@ -738,14 +819,17 @@ class FileStorage {
|
|
|
738
819
|
responseData = response[0];
|
|
739
820
|
}
|
|
740
821
|
|
|
741
|
-
const {
|
|
742
|
-
|
|
743
|
-
|
|
822
|
+
const {
|
|
823
|
+
error: res_error,
|
|
824
|
+
} = FileStoragePlatformModel.PdfConfigSaveSuccess().validate(responseData, {
|
|
825
|
+
abortEarly: false,
|
|
826
|
+
allowUnknown: false,
|
|
827
|
+
});
|
|
744
828
|
|
|
745
829
|
if (res_error) {
|
|
746
830
|
Logger({
|
|
747
831
|
level: "WARN",
|
|
748
|
-
message: `Response Validation Warnnings for platform > FileStorage >
|
|
832
|
+
message: `Response Validation Warnnings for platform > FileStorage > saveHtmlTemplate \n ${res_error}`,
|
|
749
833
|
});
|
|
750
834
|
}
|
|
751
835
|
|
|
@@ -753,25 +837,26 @@ class FileStorage {
|
|
|
753
837
|
}
|
|
754
838
|
|
|
755
839
|
/**
|
|
756
|
-
* @param {FileStoragePlatformApplicationValidator.
|
|
840
|
+
* @param {FileStoragePlatformApplicationValidator.UpdateHtmlTemplateParam} arg
|
|
757
841
|
* - Arg object
|
|
758
842
|
*
|
|
759
843
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
760
844
|
* @param {import("../PlatformAPIClient").Options} - Options
|
|
761
|
-
* @returns {Promise<FileStoragePlatformModel.PdfConfigSaveSuccess
|
|
845
|
+
* @returns {Promise<FileStoragePlatformModel.PdfConfigSaveSuccess>} -
|
|
762
846
|
* Success response
|
|
763
|
-
* @name
|
|
847
|
+
* @name updateHtmlTemplate
|
|
764
848
|
* @summary: Update html template for invoice or label
|
|
765
|
-
* @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/
|
|
849
|
+
* @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/updateHtmlTemplate/).
|
|
766
850
|
*/
|
|
767
|
-
async
|
|
768
|
-
{ body, requestHeaders } = { requestHeaders: {} },
|
|
851
|
+
async updateHtmlTemplate(
|
|
852
|
+
{ id, body, requestHeaders } = { requestHeaders: {} },
|
|
769
853
|
{ responseHeaders } = { responseHeaders: false }
|
|
770
854
|
) {
|
|
771
855
|
const {
|
|
772
856
|
error,
|
|
773
|
-
} = FileStoragePlatformApplicationValidator.
|
|
857
|
+
} = FileStoragePlatformApplicationValidator.updateHtmlTemplate().validate(
|
|
774
858
|
{
|
|
859
|
+
id,
|
|
775
860
|
body,
|
|
776
861
|
},
|
|
777
862
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -783,8 +868,9 @@ class FileStorage {
|
|
|
783
868
|
// Showing warrnings if extra unknown parameters are found
|
|
784
869
|
const {
|
|
785
870
|
error: warrning,
|
|
786
|
-
} = FileStoragePlatformApplicationValidator.
|
|
871
|
+
} = FileStoragePlatformApplicationValidator.updateHtmlTemplate().validate(
|
|
787
872
|
{
|
|
873
|
+
id,
|
|
788
874
|
body,
|
|
789
875
|
},
|
|
790
876
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -792,7 +878,7 @@ class FileStorage {
|
|
|
792
878
|
if (warrning) {
|
|
793
879
|
Logger({
|
|
794
880
|
level: "WARN",
|
|
795
|
-
message: `Parameter Validation warrnings for platform > FileStorage >
|
|
881
|
+
message: `Parameter Validation warrnings for platform > FileStorage > updateHtmlTemplate \n ${warrning}`,
|
|
796
882
|
});
|
|
797
883
|
}
|
|
798
884
|
|
|
@@ -801,7 +887,7 @@ class FileStorage {
|
|
|
801
887
|
const response = await PlatformAPIClient.execute(
|
|
802
888
|
this.config,
|
|
803
889
|
"put",
|
|
804
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/config`,
|
|
890
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/pdf/config/${id}`,
|
|
805
891
|
query_params,
|
|
806
892
|
body,
|
|
807
893
|
requestHeaders,
|
|
@@ -813,14 +899,17 @@ class FileStorage {
|
|
|
813
899
|
responseData = response[0];
|
|
814
900
|
}
|
|
815
901
|
|
|
816
|
-
const {
|
|
817
|
-
|
|
818
|
-
|
|
902
|
+
const {
|
|
903
|
+
error: res_error,
|
|
904
|
+
} = FileStoragePlatformModel.PdfConfigSaveSuccess().validate(responseData, {
|
|
905
|
+
abortEarly: false,
|
|
906
|
+
allowUnknown: false,
|
|
907
|
+
});
|
|
819
908
|
|
|
820
909
|
if (res_error) {
|
|
821
910
|
Logger({
|
|
822
911
|
level: "WARN",
|
|
823
|
-
message: `Response Validation Warnnings for platform > FileStorage >
|
|
912
|
+
message: `Response Validation Warnnings for platform > FileStorage > updateHtmlTemplate \n ${res_error}`,
|
|
824
913
|
});
|
|
825
914
|
}
|
|
826
915
|
|
|
@@ -29,6 +29,10 @@ export = FileStoragePlatformApplicationValidator;
|
|
|
29
29
|
* @property {number} [page] - Page no
|
|
30
30
|
* @property {number} [limit] - Limit
|
|
31
31
|
*/
|
|
32
|
+
/**
|
|
33
|
+
* @typedef GeneratePaymentReceiptParam
|
|
34
|
+
* @property {FileStoragePlatformModel.PaymentReceiptRequestBody} body
|
|
35
|
+
*/
|
|
32
36
|
/**
|
|
33
37
|
* @typedef GetDefaultHtmlTemplateParam
|
|
34
38
|
* @property {number} pdfTypeId
|
|
@@ -45,12 +49,13 @@ export = FileStoragePlatformApplicationValidator;
|
|
|
45
49
|
*/
|
|
46
50
|
/** @typedef GetPdfTypesParam */
|
|
47
51
|
/**
|
|
48
|
-
* @typedef
|
|
49
|
-
* @property {FileStoragePlatformModel.
|
|
52
|
+
* @typedef SaveHtmlTemplateParam
|
|
53
|
+
* @property {FileStoragePlatformModel.PdfConfig} body
|
|
50
54
|
*/
|
|
51
55
|
/**
|
|
52
|
-
* @typedef
|
|
53
|
-
* @property {
|
|
56
|
+
* @typedef UpdateHtmlTemplateParam
|
|
57
|
+
* @property {string} id
|
|
58
|
+
* @property {FileStoragePlatformModel.PdfConfig} body
|
|
54
59
|
*/
|
|
55
60
|
declare class FileStoragePlatformApplicationValidator {
|
|
56
61
|
/** @returns {AppCompleteUploadParam} */
|
|
@@ -61,6 +66,8 @@ declare class FileStoragePlatformApplicationValidator {
|
|
|
61
66
|
static appStartUpload(): AppStartUploadParam;
|
|
62
67
|
/** @returns {AppbrowseParam} */
|
|
63
68
|
static appbrowse(): AppbrowseParam;
|
|
69
|
+
/** @returns {GeneratePaymentReceiptParam} */
|
|
70
|
+
static generatePaymentReceipt(): GeneratePaymentReceiptParam;
|
|
64
71
|
/** @returns {GetDefaultHtmlTemplateParam} */
|
|
65
72
|
static getDefaultHtmlTemplate(): GetDefaultHtmlTemplateParam;
|
|
66
73
|
/** @returns {GetDefaultPdfDataParam} */
|
|
@@ -69,13 +76,13 @@ declare class FileStoragePlatformApplicationValidator {
|
|
|
69
76
|
static getDefaultPdfTemplate(): GetDefaultPdfTemplateParam;
|
|
70
77
|
/** @returns {GetPdfTypesParam} */
|
|
71
78
|
static getPdfTypes(): any;
|
|
72
|
-
/** @returns {PreviewTemplateParam} */
|
|
73
|
-
static previewTemplate(): PreviewTemplateParam;
|
|
74
79
|
/** @returns {SaveHtmlTemplateParam} */
|
|
75
80
|
static saveHtmlTemplate(): SaveHtmlTemplateParam;
|
|
81
|
+
/** @returns {UpdateHtmlTemplateParam} */
|
|
82
|
+
static updateHtmlTemplate(): UpdateHtmlTemplateParam;
|
|
76
83
|
}
|
|
77
84
|
declare namespace FileStoragePlatformApplicationValidator {
|
|
78
|
-
export { AppCompleteUploadParam, AppCopyFilesParam, AppStartUploadParam, AppbrowseParam, GetDefaultHtmlTemplateParam, GetDefaultPdfDataParam, GetDefaultPdfTemplateParam, GetPdfTypesParam,
|
|
85
|
+
export { AppCompleteUploadParam, AppCopyFilesParam, AppStartUploadParam, AppbrowseParam, GeneratePaymentReceiptParam, GetDefaultHtmlTemplateParam, GetDefaultPdfDataParam, GetDefaultPdfTemplateParam, GetPdfTypesParam, SaveHtmlTemplateParam, UpdateHtmlTemplateParam };
|
|
79
86
|
}
|
|
80
87
|
type AppCompleteUploadParam = {
|
|
81
88
|
/**
|
|
@@ -121,6 +128,9 @@ type AppbrowseParam = {
|
|
|
121
128
|
*/
|
|
122
129
|
limit?: number;
|
|
123
130
|
};
|
|
131
|
+
type GeneratePaymentReceiptParam = {
|
|
132
|
+
body: FileStoragePlatformModel.PaymentReceiptRequestBody;
|
|
133
|
+
};
|
|
124
134
|
type GetDefaultHtmlTemplateParam = {
|
|
125
135
|
pdfTypeId: number;
|
|
126
136
|
format: string;
|
|
@@ -132,11 +142,12 @@ type GetDefaultPdfTemplateParam = {
|
|
|
132
142
|
pdfTypeId: number;
|
|
133
143
|
format: string;
|
|
134
144
|
};
|
|
135
|
-
type PreviewTemplateParam = {
|
|
136
|
-
body: FileStoragePlatformModel.pdfRender;
|
|
137
|
-
};
|
|
138
145
|
type SaveHtmlTemplateParam = {
|
|
139
|
-
body: FileStoragePlatformModel.
|
|
146
|
+
body: FileStoragePlatformModel.PdfConfig;
|
|
147
|
+
};
|
|
148
|
+
type UpdateHtmlTemplateParam = {
|
|
149
|
+
id: string;
|
|
150
|
+
body: FileStoragePlatformModel.PdfConfig;
|
|
140
151
|
};
|
|
141
152
|
type GetPdfTypesParam = any;
|
|
142
153
|
import FileStoragePlatformModel = require("./FileStoragePlatformModel");
|