@gofynd/fdk-client-javascript 1.1.2 → 1.1.4

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 (120) hide show
  1. package/README.md +2 -2
  2. package/index.d.ts +7 -7
  3. package/index.js +12 -12
  4. package/package.json +1 -1
  5. package/sdk/application/ApplicationClient.d.ts +20 -20
  6. package/sdk/application/ApplicationClient.js +26 -26
  7. package/sdk/application/Cart/CartApplicationClient.d.ts +36 -6
  8. package/sdk/application/Cart/CartApplicationClient.js +105 -10
  9. package/sdk/application/Cart/CartApplicationModel.d.ts +9 -0
  10. package/sdk/application/Cart/CartApplicationModel.js +105 -1
  11. package/sdk/application/Cart/CartApplicationValidator.d.ts +1 -0
  12. package/sdk/application/Cart/CartApplicationValidator.js +15 -1
  13. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1 -0
  14. package/sdk/application/Catalog/CatalogApplicationModel.js +13 -0
  15. package/sdk/application/Common/CommonApplicationModel.js +4 -0
  16. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +14 -10
  17. package/sdk/application/Configuration/ConfigurationApplicationClient.js +16 -10
  18. package/sdk/application/Configuration/ConfigurationApplicationModel.js +6 -5
  19. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
  20. package/sdk/application/Content/ContentApplicationModel.js +3 -1
  21. package/sdk/application/Lead/LeadApplicationModel.js +4 -1
  22. package/sdk/application/Logistic/LogisticApplicationModel.js +3 -2
  23. package/sdk/application/Order/OrderApplicationClient.d.ts +2 -2
  24. package/sdk/application/Order/OrderApplicationClient.js +2 -2
  25. package/sdk/application/Order/OrderApplicationModel.js +18 -8
  26. package/sdk/application/Payment/PaymentApplicationClient.d.ts +35 -0
  27. package/sdk/application/Payment/PaymentApplicationClient.js +200 -0
  28. package/sdk/application/Payment/PaymentApplicationModel.d.ts +4 -0
  29. package/sdk/application/Payment/PaymentApplicationModel.js +58 -7
  30. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +3 -0
  31. package/sdk/application/Payment/PaymentApplicationValidator.js +19 -0
  32. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +16 -3
  33. package/sdk/application/PosCart/PosCartApplicationClient.js +39 -6
  34. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +6 -0
  35. package/sdk/application/PosCart/PosCartApplicationModel.js +63 -1
  36. package/sdk/application/PosCart/PosCartApplicationValidator.js +6 -0
  37. package/sdk/application/index.d.ts +10 -10
  38. package/sdk/application/index.js +13 -13
  39. package/sdk/common/Constant.d.ts +5 -0
  40. package/sdk/common/Constant.js +5 -0
  41. package/sdk/partner/OAuthClient.js +1 -1
  42. package/sdk/platform/Billing/BillingPlatformModel.js +6 -1
  43. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +491 -2
  44. package/sdk/platform/Cart/CartPlatformApplicationClient.js +2661 -337
  45. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +32 -0
  46. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +269 -0
  47. package/sdk/platform/Cart/CartPlatformModel.d.ts +58 -0
  48. package/sdk/platform/Cart/CartPlatformModel.js +652 -3
  49. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +8 -2
  50. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +10 -0
  51. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -0
  52. package/sdk/platform/Catalog/CatalogPlatformClient.js +2 -2
  53. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1 -0
  54. package/sdk/platform/Catalog/CatalogPlatformModel.js +43 -31
  55. package/sdk/platform/Common/CommonPlatformModel.js +4 -0
  56. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1 -0
  57. package/sdk/platform/Communication/CommunicationPlatformModel.js +9 -0
  58. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +2 -2
  59. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +2 -2
  60. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +5 -4
  61. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +99 -78
  62. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +99 -78
  63. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +87 -71
  64. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +87 -71
  65. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +2 -0
  66. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +34 -7
  67. package/sdk/platform/Content/ContentPlatformModel.js +3 -1
  68. package/sdk/platform/Finance/FinancePlatformClient.d.ts +135 -0
  69. package/sdk/platform/Finance/FinancePlatformClient.js +853 -0
  70. package/sdk/platform/Finance/FinancePlatformModel.d.ts +51 -0
  71. package/sdk/platform/Finance/FinancePlatformModel.js +342 -0
  72. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +16 -0
  73. package/sdk/platform/Finance/FinancePlatformValidator.js +84 -0
  74. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +11 -1
  75. package/sdk/platform/Order/OrderPlatformApplicationClient.js +66 -2
  76. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -0
  77. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -0
  78. package/sdk/platform/Order/OrderPlatformClient.d.ts +161 -79
  79. package/sdk/platform/Order/OrderPlatformClient.js +546 -114
  80. package/sdk/platform/Order/OrderPlatformModel.d.ts +42 -6
  81. package/sdk/platform/Order/OrderPlatformModel.js +569 -159
  82. package/sdk/platform/Order/OrderPlatformValidator.d.ts +6 -0
  83. package/sdk/platform/Order/OrderPlatformValidator.js +52 -9
  84. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +22 -0
  85. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +127 -0
  86. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +2 -0
  87. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +13 -0
  88. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +145 -0
  89. package/sdk/platform/Partner/PartnerPlatformClient.js +799 -0
  90. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +39 -0
  91. package/sdk/platform/Partner/PartnerPlatformModel.js +367 -0
  92. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +14 -0
  93. package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -0
  94. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +221 -0
  95. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1476 -190
  96. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +20 -0
  97. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +126 -0
  98. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +48 -0
  99. package/sdk/platform/Payment/PaymentPlatformModel.js +452 -7
  100. package/sdk/platform/PlatformApplicationClient.d.ts +1249 -937
  101. package/sdk/platform/PlatformApplicationClient.js +1366 -1033
  102. package/sdk/platform/PlatformClient.d.ts +10979 -8771
  103. package/sdk/platform/PlatformClient.js +11874 -9197
  104. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +134 -0
  105. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +852 -0
  106. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +16 -0
  107. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +81 -0
  108. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +223 -0
  109. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +1296 -0
  110. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +97 -0
  111. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +778 -0
  112. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +21 -0
  113. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +130 -0
  114. package/sdk/platform/index.d.ts +16 -14
  115. package/sdk/platform/index.js +22 -18
  116. package/sdk/public/Configuration/ConfigurationPublicModel.js +5 -0
  117. package/sdk/public/PublicClient.d.ts +2 -2
  118. package/sdk/public/PublicClient.js +4 -4
  119. package/sdk/public/index.d.ts +1 -1
  120. package/sdk/public/index.js +2 -2
@@ -0,0 +1,51 @@
1
+ export = FinanceModel;
2
+ declare class FinanceModel {
3
+ static CreditlineDataPlatformPayload(): any;
4
+ static CreditlineDataPlatformRequest(): any;
5
+ static CreditlineDataPlatformResponse(): any;
6
+ static DownloadCreditDebitNote(): any;
7
+ static DownloadCreditDebitNoteRequest(): any;
8
+ static DownloadCreditDebitNoteResponse(): any;
9
+ static DownloadCreditDebitNoteResponseData(): any;
10
+ static DownloadReport(): any;
11
+ static DownloadReportItems(): any;
12
+ static DownloadReportList(): any;
13
+ static Error(): any;
14
+ static GenerateReportFilters(): any;
15
+ static GenerateReportJson(): any;
16
+ static GenerateReportMeta(): any;
17
+ static GenerateReportPlatform(): any;
18
+ static GenerateReportRequest(): any;
19
+ static GetAffiliate(): any;
20
+ static GetAffiliateResponse(): any;
21
+ static GetDocs(): any;
22
+ static GetEngineData(): any;
23
+ static GetEngineFilters(): any;
24
+ static GetEngineRequest(): any;
25
+ static GetEngineResponse(): any;
26
+ static GetReason(): any;
27
+ static GetReasonRequest(): any;
28
+ static GetReasonResponse(): any;
29
+ static GetReportListData(): any;
30
+ static GetReportListRequest(): any;
31
+ static InoviceListingPayloadDataFilters(): any;
32
+ static InvoiceListingPayloadData(): any;
33
+ static InvoiceListingRequest(): any;
34
+ static InvoiceListingResponse(): any;
35
+ static InvoiceListingResponseItems(): any;
36
+ static InvoicePdfPayloadData(): any;
37
+ static InvoicePdfRequest(): any;
38
+ static InvoicePdfResponse(): any;
39
+ static InvoiceTypePayloadData(): any;
40
+ static InvoiceTypeRequest(): any;
41
+ static InvoiceTypeResponse(): any;
42
+ static InvoiceTypeResponseItems(): any;
43
+ static IsCreditlinePayload(): any;
44
+ static IsCreditlinePlatformRequest(): any;
45
+ static IsCreditlinePlatformResponse(): any;
46
+ static Page(): any;
47
+ static PaymentProcessPayload(): any;
48
+ static PaymentProcessRequest(): any;
49
+ static PaymentProcessResponse(): any;
50
+ static UnpaidInvoiceDataItems(): any;
51
+ }
@@ -0,0 +1,342 @@
1
+ const Joi = require("joi");
2
+
3
+ class FinanceModel {
4
+ static CreditlineDataPlatformPayload() {
5
+ return Joi.object({
6
+ end_end: Joi.string().allow(""),
7
+ page: Joi.number(),
8
+ pagesize: Joi.number(),
9
+ seller_id: Joi.string().allow(""),
10
+ start_end: Joi.string().allow(""),
11
+ });
12
+ }
13
+ static CreditlineDataPlatformRequest() {
14
+ return Joi.object({
15
+ data: FinanceModel.CreditlineDataPlatformPayload(),
16
+ });
17
+ }
18
+ static CreditlineDataPlatformResponse() {
19
+ return Joi.object({
20
+ code: Joi.number(),
21
+ headers: Joi.array().items(Joi.string().allow("")),
22
+ item_count: Joi.number(),
23
+ items: Joi.array().items(Joi.any()),
24
+ message: Joi.string().allow(""),
25
+ page: Joi.any(),
26
+ show_mr: Joi.boolean(),
27
+ });
28
+ }
29
+ static DownloadCreditDebitNote() {
30
+ return Joi.object({
31
+ note_id: Joi.array().items(Joi.string().allow("")),
32
+ });
33
+ }
34
+ static DownloadCreditDebitNoteRequest() {
35
+ return Joi.object({
36
+ data: FinanceModel.DownloadCreditDebitNote(),
37
+ });
38
+ }
39
+ static DownloadCreditDebitNoteResponse() {
40
+ return Joi.object({
41
+ data: Joi.array().items(
42
+ FinanceModel.DownloadCreditDebitNoteResponseData()
43
+ ),
44
+ success: Joi.boolean(),
45
+ });
46
+ }
47
+ static DownloadCreditDebitNoteResponseData() {
48
+ return Joi.object({
49
+ id: Joi.string().allow(""),
50
+ pdf_s3_url: Joi.string().allow(""),
51
+ });
52
+ }
53
+ static DownloadReport() {
54
+ return Joi.object({
55
+ end_date: Joi.string().allow(""),
56
+ page: Joi.number(),
57
+ pagesize: Joi.number(),
58
+ start_date: Joi.string().allow(""),
59
+ });
60
+ }
61
+ static DownloadReportItems() {
62
+ return Joi.object({
63
+ end_date: Joi.string().allow(""),
64
+ filters: FinanceModel.GenerateReportFilters(),
65
+ meta: FinanceModel.GenerateReportMeta(),
66
+ report_id: Joi.string().allow(""),
67
+ start_date: Joi.string().allow(""),
68
+ type_of_request: Joi.string().allow(""),
69
+ });
70
+ }
71
+ static DownloadReportList() {
72
+ return Joi.object({
73
+ item_count: Joi.number(),
74
+ items: Joi.array().items(FinanceModel.DownloadReportItems()),
75
+ page: FinanceModel.Page(),
76
+ });
77
+ }
78
+ static Error() {
79
+ return Joi.object({
80
+ reason: Joi.string().allow(""),
81
+ success: Joi.boolean(),
82
+ });
83
+ }
84
+ static GenerateReportFilters() {
85
+ return Joi.object({
86
+ brand: Joi.array().items(Joi.string().allow("")),
87
+ channel: Joi.array().items(Joi.string().allow("")),
88
+ company: Joi.array().items(Joi.string().allow("")),
89
+ });
90
+ }
91
+ static GenerateReportJson() {
92
+ return Joi.object({
93
+ end_date: Joi.string().allow(""),
94
+ headers: Joi.array().items(Joi.string().allow("")),
95
+ item_count: Joi.number(),
96
+ items: Joi.array().items(Joi.array().items(Joi.string().allow(""))),
97
+ page: FinanceModel.Page(),
98
+ start_date: Joi.string().allow(""),
99
+ });
100
+ }
101
+ static GenerateReportMeta() {
102
+ return Joi.object({
103
+ brand: Joi.string().allow(""),
104
+ channel: Joi.string().allow(""),
105
+ company: Joi.string().allow(""),
106
+ });
107
+ }
108
+ static GenerateReportPlatform() {
109
+ return Joi.object({
110
+ end_date: Joi.string().allow(""),
111
+ filters: FinanceModel.GenerateReportFilters(),
112
+ meta: FinanceModel.GenerateReportMeta(),
113
+ report_id: Joi.string().allow(""),
114
+ start_date: Joi.string().allow(""),
115
+ });
116
+ }
117
+ static GenerateReportRequest() {
118
+ return Joi.object({
119
+ data: FinanceModel.GenerateReportPlatform(),
120
+ });
121
+ }
122
+ static GetAffiliate() {
123
+ return Joi.object({
124
+ company_id: Joi.number(),
125
+ });
126
+ }
127
+ static GetAffiliateResponse() {
128
+ return Joi.object({
129
+ docs: Joi.array().items(Joi.any()),
130
+ success: Joi.boolean(),
131
+ });
132
+ }
133
+ static GetDocs() {
134
+ return Joi.object({
135
+ docs: Joi.array().items(Joi.any()),
136
+ items: Joi.array().items(Joi.any()),
137
+ });
138
+ }
139
+ static GetEngineData() {
140
+ return Joi.object({
141
+ filters: FinanceModel.GetEngineFilters(),
142
+ project: Joi.array().items(Joi.string().allow("")),
143
+ table_name: Joi.string().allow(""),
144
+ });
145
+ }
146
+ static GetEngineFilters() {
147
+ return Joi.object({
148
+ config_field: Joi.string().allow(""),
149
+ });
150
+ }
151
+ static GetEngineRequest() {
152
+ return Joi.object({
153
+ data: FinanceModel.GetEngineData(),
154
+ });
155
+ }
156
+ static GetEngineResponse() {
157
+ return Joi.object({
158
+ item_count: Joi.number(),
159
+ items: Joi.array().items(Joi.any()),
160
+ page: FinanceModel.Page(),
161
+ success: Joi.boolean(),
162
+ });
163
+ }
164
+ static GetReason() {
165
+ return Joi.object({
166
+ reason_type: Joi.string().allow(""),
167
+ });
168
+ }
169
+ static GetReasonRequest() {
170
+ return Joi.object({
171
+ data: FinanceModel.GetReason(),
172
+ });
173
+ }
174
+ static GetReasonResponse() {
175
+ return Joi.object({
176
+ data: FinanceModel.GetDocs(),
177
+ success: Joi.boolean(),
178
+ });
179
+ }
180
+ static GetReportListData() {
181
+ return Joi.object({
182
+ listing_enabled: Joi.boolean(),
183
+ role_name: Joi.string().allow(""),
184
+ });
185
+ }
186
+ static GetReportListRequest() {
187
+ return Joi.object({
188
+ data: FinanceModel.GetReportListData(),
189
+ });
190
+ }
191
+ static InoviceListingPayloadDataFilters() {
192
+ return Joi.object({
193
+ company_id: Joi.array().items(Joi.string().allow("")),
194
+ invoice_type: Joi.array().items(Joi.string().allow("")),
195
+ payment_status: Joi.array().items(Joi.string().allow("")),
196
+ });
197
+ }
198
+ static InvoiceListingPayloadData() {
199
+ return Joi.object({
200
+ end_date: Joi.string().allow(""),
201
+ filters: FinanceModel.InoviceListingPayloadDataFilters(),
202
+ page: Joi.number(),
203
+ page_size: Joi.number(),
204
+ search: Joi.string().allow(""),
205
+ start_date: Joi.string().allow(""),
206
+ });
207
+ }
208
+ static InvoiceListingRequest() {
209
+ return Joi.object({
210
+ data: FinanceModel.InvoiceListingPayloadData(),
211
+ });
212
+ }
213
+ static InvoiceListingResponse() {
214
+ return Joi.object({
215
+ item_count: Joi.number(),
216
+ items: Joi.array().items(FinanceModel.InvoiceListingResponseItems()),
217
+ page: FinanceModel.Page(),
218
+ unpaid_invoice_data: FinanceModel.UnpaidInvoiceDataItems(),
219
+ });
220
+ }
221
+ static InvoiceListingResponseItems() {
222
+ return Joi.object({
223
+ amount: Joi.string().allow(""),
224
+ company: Joi.string().allow(""),
225
+ due_date: Joi.string().allow(""),
226
+ invoice_date: Joi.string().allow(""),
227
+ invoice_id: Joi.string().allow(""),
228
+ invoice_number: Joi.string().allow(""),
229
+ invoice_type: Joi.string().allow(""),
230
+ is_downloadable: Joi.boolean(),
231
+ period: Joi.string().allow(""),
232
+ status: Joi.string().allow(""),
233
+ });
234
+ }
235
+ static InvoicePdfPayloadData() {
236
+ return Joi.object({
237
+ invoice_number: Joi.array().items(Joi.string().allow("")),
238
+ });
239
+ }
240
+ static InvoicePdfRequest() {
241
+ return Joi.object({
242
+ data: FinanceModel.InvoicePdfPayloadData(),
243
+ });
244
+ }
245
+ static InvoicePdfResponse() {
246
+ return Joi.object({
247
+ data: Joi.array().items(Joi.string().allow("")),
248
+ error: Joi.array().items(Joi.string().allow("")),
249
+ success: Joi.boolean(),
250
+ });
251
+ }
252
+ static InvoiceTypePayloadData() {
253
+ return Joi.object({
254
+ is_active: Joi.boolean(),
255
+ });
256
+ }
257
+ static InvoiceTypeRequest() {
258
+ return Joi.object({
259
+ data: FinanceModel.InvoiceTypePayloadData(),
260
+ });
261
+ }
262
+ static InvoiceTypeResponse() {
263
+ return Joi.object({
264
+ invoice_type_list: Joi.array().items(
265
+ FinanceModel.InvoiceTypeResponseItems()
266
+ ),
267
+ payment_status_list: Joi.array().items(
268
+ FinanceModel.InvoiceTypeResponseItems()
269
+ ),
270
+ success: Joi.boolean(),
271
+ });
272
+ }
273
+ static InvoiceTypeResponseItems() {
274
+ return Joi.object({
275
+ text: Joi.string().allow(""),
276
+ value: Joi.string().allow(""),
277
+ });
278
+ }
279
+ static IsCreditlinePayload() {
280
+ return Joi.object({
281
+ seller_id: Joi.string().allow(""),
282
+ });
283
+ }
284
+ static IsCreditlinePlatformRequest() {
285
+ return Joi.object({
286
+ data: FinanceModel.IsCreditlinePayload(),
287
+ });
288
+ }
289
+ static IsCreditlinePlatformResponse() {
290
+ return Joi.object({
291
+ code: Joi.number(),
292
+ is_creditline_opted: Joi.boolean(),
293
+ });
294
+ }
295
+ static Page() {
296
+ return Joi.object({
297
+ current: Joi.number(),
298
+ has_next: Joi.boolean(),
299
+ has_previous: Joi.boolean(),
300
+ item_total: Joi.number(),
301
+ next_id: Joi.string().allow(""),
302
+ size: Joi.number(),
303
+ type: Joi.string().allow("").required(),
304
+ });
305
+ }
306
+ static PaymentProcessPayload() {
307
+ return Joi.object({
308
+ amount: Joi.string().allow(""),
309
+ currency: Joi.string().allow(""),
310
+ invoice_number: Joi.string().allow(""),
311
+ meta: Joi.any(),
312
+ mode_of_payment: Joi.string().allow(""),
313
+ platform: Joi.string().allow(""),
314
+ seller_id: Joi.string().allow(""),
315
+ source_reference: Joi.string().allow(""),
316
+ total_amount: Joi.string().allow(""),
317
+ transaction_type: Joi.string().allow(""),
318
+ });
319
+ }
320
+ static PaymentProcessRequest() {
321
+ return Joi.object({
322
+ data: FinanceModel.PaymentProcessPayload(),
323
+ });
324
+ }
325
+ static PaymentProcessResponse() {
326
+ return Joi.object({
327
+ code: Joi.number(),
328
+ message: Joi.string().allow(""),
329
+ meta: Joi.any(),
330
+ redirect_url: Joi.string().allow(""),
331
+ transaction_id: Joi.string().allow(""),
332
+ });
333
+ }
334
+ static UnpaidInvoiceDataItems() {
335
+ return Joi.object({
336
+ currency: Joi.string().allow(""),
337
+ total_unpaid_amount: Joi.number(),
338
+ total_unpaid_invoice_count: Joi.number(),
339
+ });
340
+ }
341
+ }
342
+ module.exports = FinanceModel;
@@ -0,0 +1,16 @@
1
+ export = FinanceValidator;
2
+ declare class FinanceValidator {
3
+ static creditlineDataplatform(): any;
4
+ static downloadCreditDebitNote(): any;
5
+ static downloadReport(): any;
6
+ static generateReport(): any;
7
+ static getAffiliate(): any;
8
+ static getData(): any;
9
+ static getReason(): any;
10
+ static getReportList(): any;
11
+ static invoiceListing(): any;
12
+ static invoicePDF(): any;
13
+ static invoiceType(): any;
14
+ static isCreditlinePlatform(): any;
15
+ static paymentProcess(): any;
16
+ }
@@ -0,0 +1,84 @@
1
+ const Joi = require("joi");
2
+
3
+ const FinanceModel = require("./FinancePlatformModel");
4
+ class FinanceValidator {
5
+ static creditlineDataplatform() {
6
+ return Joi.object({
7
+ body: FinanceModel.CreditlineDataPlatformRequest().required(),
8
+ }).required();
9
+ }
10
+
11
+ static downloadCreditDebitNote() {
12
+ return Joi.object({
13
+ body: FinanceModel.DownloadCreditDebitNoteRequest().required(),
14
+ }).required();
15
+ }
16
+
17
+ static downloadReport() {
18
+ return Joi.object({
19
+ body: FinanceModel.DownloadReport().required(),
20
+ }).required();
21
+ }
22
+
23
+ static generateReport() {
24
+ return Joi.object({
25
+ body: FinanceModel.GenerateReportRequest().required(),
26
+ }).required();
27
+ }
28
+
29
+ static getAffiliate() {
30
+ return Joi.object({
31
+ body: FinanceModel.GetAffiliate().required(),
32
+ }).required();
33
+ }
34
+
35
+ static getData() {
36
+ return Joi.object({
37
+ body: FinanceModel.GetEngineRequest().required(),
38
+ }).required();
39
+ }
40
+
41
+ static getReason() {
42
+ return Joi.object({
43
+ body: FinanceModel.GetReasonRequest().required(),
44
+ }).required();
45
+ }
46
+
47
+ static getReportList() {
48
+ return Joi.object({
49
+ body: FinanceModel.GetReportListRequest().required(),
50
+ }).required();
51
+ }
52
+
53
+ static invoiceListing() {
54
+ return Joi.object({
55
+ body: FinanceModel.InvoiceListingRequest().required(),
56
+ }).required();
57
+ }
58
+
59
+ static invoicePDF() {
60
+ return Joi.object({
61
+ body: FinanceModel.InvoicePdfRequest().required(),
62
+ }).required();
63
+ }
64
+
65
+ static invoiceType() {
66
+ return Joi.object({
67
+ body: FinanceModel.InvoiceTypeRequest().required(),
68
+ }).required();
69
+ }
70
+
71
+ static isCreditlinePlatform() {
72
+ return Joi.object({
73
+ body: FinanceModel.IsCreditlinePlatformRequest().required(),
74
+ }).required();
75
+ }
76
+
77
+ static paymentProcess() {
78
+ return Joi.object({
79
+ body: FinanceModel.PaymentProcessRequest().required(),
80
+ }).required();
81
+ }
82
+ }
83
+
84
+ module.exports = FinanceValidator;
@@ -5,7 +5,17 @@ declare class Order {
5
5
  applicationId: any;
6
6
  /**
7
7
  * @param {Object} arg - Arg object.
8
- * @param {string} arg.shipmentId -
8
+ * @param {string} arg.action -
9
+ * @returns {Promise<ShipmentReasonsResponse>} - Success response
10
+ * @summary: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
11
+ * @description: Using action, get reasons behind full or partial cancellation of a shipment
12
+ */
13
+ getPlatformShipmentReasons({ action }?: {
14
+ action: string;
15
+ }): Promise<ShipmentReasonsResponse>;
16
+ /**
17
+ * @param {Object} arg - Arg object.
18
+ * @param {string} arg.shipmentId - Shipment Id
9
19
  * @returns {Promise<PlatformShipmentTrack>} - Success response
10
20
  * @summary: Track shipment
11
21
  * @description: Track Shipment by shipment id, for application based on application Id
@@ -14,7 +14,71 @@ class Order {
14
14
 
15
15
  /**
16
16
  * @param {Object} arg - Arg object.
17
- * @param {string} arg.shipmentId -
17
+ * @param {string} arg.action -
18
+ * @returns {Promise<ShipmentReasonsResponse>} - Success response
19
+ * @summary: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
20
+ * @description: Using action, get reasons behind full or partial cancellation of a shipment
21
+ */
22
+ async getPlatformShipmentReasons({ action } = {}) {
23
+ const { error } = OrderValidator.getPlatformShipmentReasons().validate(
24
+ {
25
+ action,
26
+ },
27
+ { abortEarly: false, allowUnknown: true }
28
+ );
29
+ if (error) {
30
+ return Promise.reject(new FDKClientValidationError(error));
31
+ }
32
+
33
+ // Showing warrnings if extra unknown parameters are found
34
+ const {
35
+ error: warrning,
36
+ } = OrderValidator.getPlatformShipmentReasons().validate(
37
+ {
38
+ action,
39
+ },
40
+ { abortEarly: false, allowUnknown: false }
41
+ );
42
+ if (warrning) {
43
+ Logger({
44
+ level: "WARN",
45
+ message:
46
+ "Parameter Validation warrnings for getPlatformShipmentReasons",
47
+ });
48
+ Logger({ level: "WARN", message: warrning });
49
+ }
50
+
51
+ const query_params = {};
52
+
53
+ const response = await PlatformAPIClient.execute(
54
+ this.config,
55
+ "get",
56
+ `/service/platform/order/v1.0/company/${this.config.companyId}/application/${this.applicationId}/orders/shipments/reasons/${action}`,
57
+ query_params,
58
+ undefined
59
+ );
60
+
61
+ const {
62
+ error: res_error,
63
+ } = OrderModel.ShipmentReasonsResponse().validate(response, {
64
+ abortEarly: false,
65
+ allowUnknown: false,
66
+ });
67
+
68
+ if (res_error) {
69
+ Logger({
70
+ level: "WARN",
71
+ message: "Response Validation Warnnings for getPlatformShipmentReasons",
72
+ });
73
+ Logger({ level: "WARN", message: res_error });
74
+ }
75
+
76
+ return response;
77
+ }
78
+
79
+ /**
80
+ * @param {Object} arg - Arg object.
81
+ * @param {string} arg.shipmentId - Shipment Id
18
82
  * @returns {Promise<PlatformShipmentTrack>} - Success response
19
83
  * @summary: Track shipment
20
84
  * @description: Track Shipment by shipment id, for application based on application Id
@@ -50,7 +114,7 @@ class Order {
50
114
  const response = await PlatformAPIClient.execute(
51
115
  this.config,
52
116
  "get",
53
- `/service/platform/orders/v1.0/company/${this.config.companyId}/application/${this.applicationId}/orders/shipments/${shipmentId}/track`,
117
+ `/service/platform/order/v1.0/company/${this.config.companyId}/application/${this.applicationId}/orders/shipments/${shipmentId}/track`,
54
118
  query_params,
55
119
  undefined
56
120
  );
@@ -1,4 +1,5 @@
1
1
  export = OrderValidator;
2
2
  declare class OrderValidator {
3
+ static getPlatformShipmentReasons(): any;
3
4
  static trackShipmentPlatform(): any;
4
5
  }
@@ -2,6 +2,12 @@ const Joi = require("joi");
2
2
 
3
3
  const OrderModel = require("./OrderPlatformModel");
4
4
  class OrderValidator {
5
+ static getPlatformShipmentReasons() {
6
+ return Joi.object({
7
+ action: Joi.string().allow("").required(),
8
+ }).required();
9
+ }
10
+
5
11
  static trackShipmentPlatform() {
6
12
  return Joi.object({
7
13
  shipmentId: Joi.string().allow("").required(),