@gofynd/fdk-client-javascript 1.1.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -3
- package/index.js +0 -3
- package/package.json +1 -2
- package/sdk/application/ApplicationAPIClient.d.ts +15 -1
- package/sdk/application/ApplicationAPIClient.js +12 -3
- package/sdk/application/ApplicationClient.d.ts +36 -6
- package/sdk/application/ApplicationClient.js +30 -43
- package/sdk/application/ApplicationConfig.d.ts +92 -12
- package/sdk/application/ApplicationConfig.js +48 -14
- package/sdk/application/Cart/CartApplicationClient.d.ts +200 -357
- package/sdk/application/Cart/CartApplicationClient.js +711 -483
- package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
- package/sdk/application/Cart/CartApplicationModel.js +1224 -93
- package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
- package/sdk/application/Cart/CartApplicationValidator.js +270 -15
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +274 -422
- package/sdk/application/Catalog/CatalogApplicationClient.js +865 -630
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2320 -117
- package/sdk/application/Catalog/CatalogApplicationModel.js +1566 -172
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
- package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
- package/sdk/application/Common/CommonApplicationClient.d.ts +16 -21
- package/sdk/application/Common/CommonApplicationClient.js +52 -33
- package/sdk/application/Common/CommonApplicationModel.d.ts +368 -19
- package/sdk/application/Common/CommonApplicationModel.js +192 -40
- package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
- package/sdk/application/Common/CommonApplicationValidator.js +21 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +31 -18
- package/sdk/application/Communication/CommunicationApplicationClient.js +86 -47
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +157 -14
- package/sdk/application/Communication/CommunicationApplicationModel.js +104 -23
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
- package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +149 -118
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +457 -260
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2235 -110
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1113 -193
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
- package/sdk/application/Content/ContentApplicationClient.d.ts +149 -139
- package/sdk/application/Content/ContentApplicationClient.js +489 -278
- package/sdk/application/Content/ContentApplicationModel.d.ts +1010 -105
- package/sdk/application/Content/ContentApplicationModel.js +737 -396
- package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
- package/sdk/application/Content/ContentApplicationValidator.js +113 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +23 -29
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -47
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +148 -20
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +100 -87
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
- package/sdk/application/Lead/LeadApplicationClient.d.ts +57 -53
- package/sdk/application/Lead/LeadApplicationClient.js +188 -103
- package/sdk/application/Lead/LeadApplicationModel.d.ts +686 -54
- package/sdk/application/Lead/LeadApplicationModel.js +330 -244
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
- package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +40 -33
- package/sdk/application/Logistic/LogisticApplicationClient.js +131 -73
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
- package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
- package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
- package/sdk/application/Order/OrderApplicationClient.d.ts +93 -133
- package/sdk/application/Order/OrderApplicationClient.js +329 -217
- package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
- package/sdk/application/Order/OrderApplicationModel.js +776 -57
- package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
- package/sdk/application/Order/OrderApplicationValidator.js +114 -5
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +400 -366
- package/sdk/application/Payment/PaymentApplicationClient.js +1176 -703
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
- package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
- package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +205 -350
- package/sdk/application/PosCart/PosCartApplicationClient.js +720 -491
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
- package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
- package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +58 -47
- package/sdk/application/Rewards/RewardsApplicationClient.js +187 -102
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
- package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
- package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
- package/sdk/application/Share/ShareApplicationClient.d.ts +52 -50
- package/sdk/application/Share/ShareApplicationClient.js +185 -97
- package/sdk/application/Share/ShareApplicationModel.d.ts +198 -15
- package/sdk/application/Share/ShareApplicationModel.js +131 -31
- package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
- package/sdk/application/Share/ShareApplicationValidator.js +48 -4
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +30 -27
- package/sdk/application/Theme/ThemeApplicationClient.js +102 -56
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +1291 -48
- package/sdk/application/Theme/ThemeApplicationModel.js +895 -134
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
- package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
- package/sdk/application/User/UserApplicationClient.d.ts +260 -305
- package/sdk/application/User/UserApplicationClient.js +910 -522
- package/sdk/application/User/UserApplicationModel.d.ts +992 -101
- package/sdk/application/User/UserApplicationModel.js +699 -248
- package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
- package/sdk/application/User/UserApplicationValidator.js +265 -31
- package/sdk/common/AxiosHelper.js +7 -2
- package/sdk/common/FDKError.d.ts +3 -0
- package/sdk/common/FDKError.js +8 -0
- package/sdk/common/Paginator.d.ts +27 -12
- package/sdk/common/Paginator.js +15 -0
- package/sdk/common/RequestSigner.js +0 -1
- package/sdk/common/utils.d.ts +3 -0
- package/sdk/common/utils.js +29 -0
- package/sdk/partner/PartnerAPIClient.d.ts +16 -1
- package/sdk/partner/PartnerAPIClient.js +12 -2
- package/sdk/partner/PartnerClient.d.ts +22 -3
- package/sdk/partner/PartnerClient.js +20 -0
- package/sdk/partner/PartnerConfig.d.ts +40 -14
- package/sdk/partner/PartnerConfig.js +31 -6
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
- package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
- package/sdk/partner/index.d.ts +3 -1
- package/sdk/partner/index.js +3 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +30 -25
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +104 -53
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +190 -17
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +132 -15
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +52 -5
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +30 -4
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +133 -97
- package/sdk/platform/Billing/BillingPlatformClient.js +561 -191
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1071 -68
- package/sdk/platform/Billing/BillingPlatformModel.js +762 -151
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +175 -12
- package/sdk/platform/Billing/BillingPlatformValidator.js +118 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +454 -635
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1646 -957
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3839 -175
- package/sdk/platform/Cart/CartPlatformModel.js +2423 -217
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +528 -638
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1600 -984
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +652 -826
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1979 -1264
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6869 -326
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -351
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1361 -71
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +624 -30
- package/sdk/platform/Common/CommonPlatformClient.d.ts +16 -21
- package/sdk/platform/Common/CommonPlatformClient.js +50 -33
- package/sdk/platform/Common/CommonPlatformModel.d.ts +423 -19
- package/sdk/platform/Common/CommonPlatformModel.js +214 -40
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +37 -4
- package/sdk/platform/Common/CommonPlatformValidator.js +20 -3
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +731 -303
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +3095 -785
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +699 -41
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +463 -27
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +19 -5
- package/sdk/platform/Communication/CommunicationPlatformClient.js +59 -19
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1708 -102
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1360 -235
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +127 -111
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +435 -225
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +882 -43
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +666 -78
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +184 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +105 -10
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +327 -240
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +922 -438
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +297 -22
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +191 -17
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +184 -178
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +555 -311
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4337 -188
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2178 -248
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +605 -578
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1996 -987
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1472 -108
- package/sdk/platform/Content/ContentPlatformModel.js +1085 -204
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +85 -82
- package/sdk/platform/Discount/DiscountPlatformClient.js +333 -175
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +281 -15
- package/sdk/platform/Discount/DiscountPlatformModel.js +189 -10
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
- package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +109 -52
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +570 -105
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +141 -6
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +118 -7
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +43 -63
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +153 -135
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +426 -20
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +379 -40
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +106 -8
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +60 -8
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +260 -129
- package/sdk/platform/Finance/FinancePlatformClient.js +1182 -194
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +1267 -50
- package/sdk/platform/Finance/FinancePlatformModel.js +1252 -38
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +233 -15
- package/sdk/platform/Finance/FinancePlatformValidator.js +229 -16
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +111 -97
- package/sdk/platform/Inventory/InventoryPlatformClient.js +330 -199
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
- package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +100 -106
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +372 -186
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +89 -104
- package/sdk/platform/Lead/LeadPlatformClient.js +305 -180
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +1045 -54
- package/sdk/platform/Lead/LeadPlatformModel.js +504 -142
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
- package/sdk/platform/Lead/LeadPlatformValidator.js +92 -15
- package/sdk/platform/OAuthClient.js +6 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +20 -14
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +58 -29
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
- package/sdk/platform/Order/OrderPlatformClient.d.ts +437 -556
- package/sdk/platform/Order/OrderPlatformClient.js +1500 -760
- package/sdk/platform/Order/OrderPlatformModel.d.ts +5225 -247
- package/sdk/platform/Order/OrderPlatformModel.js +3473 -260
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +859 -37
- package/sdk/platform/Order/OrderPlatformValidator.js +435 -23
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +16 -42
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -155
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +37 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +19 -17
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +78 -45
- package/sdk/platform/Partner/PartnerPlatformModel.js +43 -369
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +418 -288
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1509 -505
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +438 -30
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +312 -19
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +83 -73
- package/sdk/platform/Payment/PaymentPlatformClient.js +259 -154
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +3200 -93
- package/sdk/platform/Payment/PaymentPlatformModel.js +1334 -36
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
- package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
- package/sdk/platform/PlatformAPIClient.d.ts +16 -1
- package/sdk/platform/PlatformAPIClient.js +9 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
- package/sdk/platform/PlatformApplicationClient.js +17 -1899
- package/sdk/platform/PlatformClient.d.ts +31 -12581
- package/sdk/platform/PlatformClient.js +30 -15089
- package/sdk/platform/PlatformConfig.d.ts +37 -11
- package/sdk/platform/PlatformConfig.js +32 -6
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +96 -92
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +344 -177
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +360 -23
- package/sdk/platform/Rewards/RewardsPlatformModel.js +238 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +159 -92
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +473 -208
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +138 -13
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +100 -14
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +166 -178
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +518 -329
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1408 -96
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1034 -71
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +41 -66
- package/sdk/platform/Share/SharePlatformApplicationClient.js +149 -116
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
- package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
- package/sdk/platform/Share/SharePlatformModel.js +167 -19
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +229 -193
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +976 -352
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +345 -24
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +206 -14
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
- package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1527 -48
- package/sdk/platform/Theme/ThemePlatformModel.js +1099 -118
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
- package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +138 -152
- package/sdk/platform/User/UserPlatformApplicationClient.js +470 -244
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +242 -18
- package/sdk/platform/User/UserPlatformApplicationValidator.js +129 -12
- package/sdk/platform/User/UserPlatformModel.d.ts +653 -101
- package/sdk/platform/User/UserPlatformModel.js +467 -424
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +153 -49
- package/sdk/platform/Webhook/WebhookPlatformClient.js +896 -88
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +632 -16
- package/sdk/platform/Webhook/WebhookPlatformModel.js +502 -54
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +170 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +157 -7
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +16 -21
- package/sdk/public/Configuration/ConfigurationPublicClient.js +48 -33
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +370 -19
- package/sdk/public/Configuration/ConfigurationPublicModel.js +191 -40
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +54 -48
- package/sdk/public/Inventory/InventoryPublicClient.js +161 -98
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
- package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
- package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
- package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
- package/sdk/public/Partner/PartnerPublicClient.js +110 -0
- package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
- package/sdk/public/Partner/PartnerPublicModel.js +280 -0
- package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
- package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
- package/sdk/public/PublicAPIClient.d.ts +14 -1
- package/sdk/public/PublicAPIClient.js +7 -1
- package/sdk/public/PublicClient.d.ts +21 -3
- package/sdk/public/PublicClient.js +20 -0
- package/sdk/public/PublicConfig.d.ts +27 -6
- package/sdk/public/PublicConfig.js +17 -1
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +16 -11
- package/sdk/public/Webhook/WebhookPublicClient.js +48 -27
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +52 -16
- package/sdk/public/Webhook/WebhookPublicModel.js +33 -113
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
- package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
- package/sdk/public/index.d.ts +1 -0
- package/sdk/public/index.js +2 -0
- package/sdk/application/ApplicationModels.d.ts +0 -3
- package/sdk/application/ApplicationModels.js +0 -20
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -145
- package/sdk/platform/Partner/PartnerPlatformClient.js +0 -799
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -14
- package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -87
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const Paginator = require("../../common/Paginator");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const OrderPlatformValidator = require("./OrderPlatformValidator");
|
|
5
|
+
const OrderPlatformModel = require("./OrderPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
7
|
const Joi = require("joi");
|
|
8
8
|
|
|
@@ -12,14 +12,19 @@ class Order {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {
|
|
17
|
-
* @
|
|
15
|
+
* @param {OrderPlatformValidator.AttachOrderUserParam} arg - Arg object
|
|
16
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
17
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
18
|
+
* @returns {Promise<OrderPlatformModel.AttachOrderUserResponse>} - Success response
|
|
19
|
+
* @name attachOrderUser
|
|
18
20
|
* @summary:
|
|
19
|
-
* @description:
|
|
21
|
+
* @description: Attach Order User - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/attachOrderUser/).
|
|
20
22
|
*/
|
|
21
|
-
async attachOrderUser(
|
|
22
|
-
|
|
23
|
+
async attachOrderUser(
|
|
24
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
25
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
26
|
+
) {
|
|
27
|
+
const { error } = OrderPlatformValidator.attachOrderUser().validate(
|
|
23
28
|
{
|
|
24
29
|
body,
|
|
25
30
|
},
|
|
@@ -30,7 +35,9 @@ class Order {
|
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
// Showing warrnings if extra unknown parameters are found
|
|
33
|
-
const {
|
|
38
|
+
const {
|
|
39
|
+
error: warrning,
|
|
40
|
+
} = OrderPlatformValidator.attachOrderUser().validate(
|
|
34
41
|
{
|
|
35
42
|
body,
|
|
36
43
|
},
|
|
@@ -39,9 +46,8 @@ class Order {
|
|
|
39
46
|
if (warrning) {
|
|
40
47
|
Logger({
|
|
41
48
|
level: "WARN",
|
|
42
|
-
message:
|
|
49
|
+
message: `Parameter Validation warrnings for platform > Order > attachOrderUser \n ${warrning}`,
|
|
43
50
|
});
|
|
44
|
-
Logger({ level: "WARN", message: warrning });
|
|
45
51
|
}
|
|
46
52
|
|
|
47
53
|
const query_params = {};
|
|
@@ -54,12 +60,18 @@ class Order {
|
|
|
54
60
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/user/attach`,
|
|
55
61
|
query_params,
|
|
56
62
|
body,
|
|
57
|
-
xHeaders
|
|
63
|
+
{ ...xHeaders, ...requestHeaders },
|
|
64
|
+
{ responseHeaders }
|
|
58
65
|
);
|
|
59
66
|
|
|
67
|
+
let responseData = response;
|
|
68
|
+
if (responseHeaders) {
|
|
69
|
+
responseData = response[0];
|
|
70
|
+
}
|
|
71
|
+
|
|
60
72
|
const {
|
|
61
73
|
error: res_error,
|
|
62
|
-
} =
|
|
74
|
+
} = OrderPlatformModel.AttachOrderUserResponse().validate(responseData, {
|
|
63
75
|
abortEarly: false,
|
|
64
76
|
allowUnknown: false,
|
|
65
77
|
});
|
|
@@ -67,23 +79,27 @@ class Order {
|
|
|
67
79
|
if (res_error) {
|
|
68
80
|
Logger({
|
|
69
81
|
level: "WARN",
|
|
70
|
-
message:
|
|
82
|
+
message: `Response Validation Warnnings for platform > Order > attachOrderUser \n ${res_error}`,
|
|
71
83
|
});
|
|
72
|
-
Logger({ level: "WARN", message: res_error });
|
|
73
84
|
}
|
|
74
85
|
|
|
75
86
|
return response;
|
|
76
87
|
}
|
|
77
88
|
|
|
78
89
|
/**
|
|
79
|
-
* @param {
|
|
80
|
-
* @param {
|
|
81
|
-
* @
|
|
90
|
+
* @param {OrderPlatformValidator.CheckOrderStatusParam} arg - Arg object
|
|
91
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
92
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
93
|
+
* @returns {Promise<OrderPlatformModel.OrderStatusResult>} - Success response
|
|
94
|
+
* @name checkOrderStatus
|
|
82
95
|
* @summary:
|
|
83
|
-
* @description:
|
|
96
|
+
* @description: Check order status - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/checkOrderStatus/).
|
|
84
97
|
*/
|
|
85
|
-
async checkOrderStatus(
|
|
86
|
-
|
|
98
|
+
async checkOrderStatus(
|
|
99
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
100
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
101
|
+
) {
|
|
102
|
+
const { error } = OrderPlatformValidator.checkOrderStatus().validate(
|
|
87
103
|
{
|
|
88
104
|
body,
|
|
89
105
|
},
|
|
@@ -94,7 +110,9 @@ class Order {
|
|
|
94
110
|
}
|
|
95
111
|
|
|
96
112
|
// Showing warrnings if extra unknown parameters are found
|
|
97
|
-
const {
|
|
113
|
+
const {
|
|
114
|
+
error: warrning,
|
|
115
|
+
} = OrderPlatformValidator.checkOrderStatus().validate(
|
|
98
116
|
{
|
|
99
117
|
body,
|
|
100
118
|
},
|
|
@@ -103,9 +121,8 @@ class Order {
|
|
|
103
121
|
if (warrning) {
|
|
104
122
|
Logger({
|
|
105
123
|
level: "WARN",
|
|
106
|
-
message:
|
|
124
|
+
message: `Parameter Validation warrnings for platform > Order > checkOrderStatus \n ${warrning}`,
|
|
107
125
|
});
|
|
108
|
-
Logger({ level: "WARN", message: warrning });
|
|
109
126
|
}
|
|
110
127
|
|
|
111
128
|
const query_params = {};
|
|
@@ -118,12 +135,18 @@ class Order {
|
|
|
118
135
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/debug/order_status`,
|
|
119
136
|
query_params,
|
|
120
137
|
body,
|
|
121
|
-
xHeaders
|
|
138
|
+
{ ...xHeaders, ...requestHeaders },
|
|
139
|
+
{ responseHeaders }
|
|
122
140
|
);
|
|
123
141
|
|
|
142
|
+
let responseData = response;
|
|
143
|
+
if (responseHeaders) {
|
|
144
|
+
responseData = response[0];
|
|
145
|
+
}
|
|
146
|
+
|
|
124
147
|
const {
|
|
125
148
|
error: res_error,
|
|
126
|
-
} =
|
|
149
|
+
} = OrderPlatformModel.OrderStatusResult().validate(responseData, {
|
|
127
150
|
abortEarly: false,
|
|
128
151
|
allowUnknown: false,
|
|
129
152
|
});
|
|
@@ -131,34 +154,29 @@ class Order {
|
|
|
131
154
|
if (res_error) {
|
|
132
155
|
Logger({
|
|
133
156
|
level: "WARN",
|
|
134
|
-
message:
|
|
157
|
+
message: `Response Validation Warnnings for platform > Order > checkOrderStatus \n ${res_error}`,
|
|
135
158
|
});
|
|
136
|
-
Logger({ level: "WARN", message: res_error });
|
|
137
159
|
}
|
|
138
160
|
|
|
139
161
|
return response;
|
|
140
162
|
}
|
|
141
163
|
|
|
142
164
|
/**
|
|
143
|
-
* @param {
|
|
144
|
-
* @param {
|
|
145
|
-
* @param {
|
|
146
|
-
* @
|
|
147
|
-
* @
|
|
148
|
-
* @param {string} [arg.method] - Provider Method to Call
|
|
149
|
-
* @returns {Promise<Click2CallResponse>} - Success response
|
|
165
|
+
* @param {OrderPlatformValidator.Click2CallParam} arg - Arg object
|
|
166
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
167
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
168
|
+
* @returns {Promise<OrderPlatformModel.Click2CallResponse>} - Success response
|
|
169
|
+
* @name click2Call
|
|
150
170
|
* @summary:
|
|
151
|
-
* @description:
|
|
171
|
+
* @description: Click to Call - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/click2Call/).
|
|
152
172
|
*/
|
|
153
|
-
async click2Call(
|
|
154
|
-
caller,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
} = {}) {
|
|
161
|
-
const { error } = OrderValidator.click2Call().validate(
|
|
173
|
+
async click2Call(
|
|
174
|
+
{ caller, receiver, bagId, callerId, method, requestHeaders } = {
|
|
175
|
+
requestHeaders: {},
|
|
176
|
+
},
|
|
177
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
178
|
+
) {
|
|
179
|
+
const { error } = OrderPlatformValidator.click2Call().validate(
|
|
162
180
|
{
|
|
163
181
|
caller,
|
|
164
182
|
receiver,
|
|
@@ -174,7 +192,7 @@ class Order {
|
|
|
174
192
|
}
|
|
175
193
|
|
|
176
194
|
// Showing warrnings if extra unknown parameters are found
|
|
177
|
-
const { error: warrning } =
|
|
195
|
+
const { error: warrning } = OrderPlatformValidator.click2Call().validate(
|
|
178
196
|
{
|
|
179
197
|
caller,
|
|
180
198
|
receiver,
|
|
@@ -188,9 +206,8 @@ class Order {
|
|
|
188
206
|
if (warrning) {
|
|
189
207
|
Logger({
|
|
190
208
|
level: "WARN",
|
|
191
|
-
message:
|
|
209
|
+
message: `Parameter Validation warrnings for platform > Order > click2Call \n ${warrning}`,
|
|
192
210
|
});
|
|
193
|
-
Logger({ level: "WARN", message: warrning });
|
|
194
211
|
}
|
|
195
212
|
|
|
196
213
|
const query_params = {};
|
|
@@ -208,12 +225,18 @@ class Order {
|
|
|
208
225
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/ninja/click2call`,
|
|
209
226
|
query_params,
|
|
210
227
|
undefined,
|
|
211
|
-
xHeaders
|
|
228
|
+
{ ...xHeaders, ...requestHeaders },
|
|
229
|
+
{ responseHeaders }
|
|
212
230
|
);
|
|
213
231
|
|
|
232
|
+
let responseData = response;
|
|
233
|
+
if (responseHeaders) {
|
|
234
|
+
responseData = response[0];
|
|
235
|
+
}
|
|
236
|
+
|
|
214
237
|
const {
|
|
215
238
|
error: res_error,
|
|
216
|
-
} =
|
|
239
|
+
} = OrderPlatformModel.Click2CallResponse().validate(responseData, {
|
|
217
240
|
abortEarly: false,
|
|
218
241
|
allowUnknown: false,
|
|
219
242
|
});
|
|
@@ -221,23 +244,28 @@ class Order {
|
|
|
221
244
|
if (res_error) {
|
|
222
245
|
Logger({
|
|
223
246
|
level: "WARN",
|
|
224
|
-
message:
|
|
247
|
+
message: `Response Validation Warnnings for platform > Order > click2Call \n ${res_error}`,
|
|
225
248
|
});
|
|
226
|
-
Logger({ level: "WARN", message: res_error });
|
|
227
249
|
}
|
|
228
250
|
|
|
229
251
|
return response;
|
|
230
252
|
}
|
|
231
253
|
|
|
232
254
|
/**
|
|
233
|
-
* @param {
|
|
234
|
-
* @param {
|
|
235
|
-
* @
|
|
255
|
+
* @param {OrderPlatformValidator.CreateChannelConfigParam} arg - Arg object
|
|
256
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
257
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
258
|
+
* @returns {Promise<OrderPlatformModel.CreateChannelConfigResponse>} -
|
|
259
|
+
* Success response
|
|
260
|
+
* @name createChannelConfig
|
|
236
261
|
* @summary:
|
|
237
|
-
* @description: createChannelConfig
|
|
262
|
+
* @description: createChannelConfig - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/createChannelConfig/).
|
|
238
263
|
*/
|
|
239
|
-
async createChannelConfig(
|
|
240
|
-
|
|
264
|
+
async createChannelConfig(
|
|
265
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
266
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
267
|
+
) {
|
|
268
|
+
const { error } = OrderPlatformValidator.createChannelConfig().validate(
|
|
241
269
|
{
|
|
242
270
|
body,
|
|
243
271
|
},
|
|
@@ -248,7 +276,9 @@ class Order {
|
|
|
248
276
|
}
|
|
249
277
|
|
|
250
278
|
// Showing warrnings if extra unknown parameters are found
|
|
251
|
-
const {
|
|
279
|
+
const {
|
|
280
|
+
error: warrning,
|
|
281
|
+
} = OrderPlatformValidator.createChannelConfig().validate(
|
|
252
282
|
{
|
|
253
283
|
body,
|
|
254
284
|
},
|
|
@@ -257,9 +287,8 @@ class Order {
|
|
|
257
287
|
if (warrning) {
|
|
258
288
|
Logger({
|
|
259
289
|
level: "WARN",
|
|
260
|
-
message:
|
|
290
|
+
message: `Parameter Validation warrnings for platform > Order > createChannelConfig \n ${warrning}`,
|
|
261
291
|
});
|
|
262
|
-
Logger({ level: "WARN", message: warrning });
|
|
263
292
|
}
|
|
264
293
|
|
|
265
294
|
const query_params = {};
|
|
@@ -272,36 +301,46 @@ class Order {
|
|
|
272
301
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/order-config`,
|
|
273
302
|
query_params,
|
|
274
303
|
body,
|
|
275
|
-
xHeaders
|
|
304
|
+
{ ...xHeaders, ...requestHeaders },
|
|
305
|
+
{ responseHeaders }
|
|
276
306
|
);
|
|
277
307
|
|
|
308
|
+
let responseData = response;
|
|
309
|
+
if (responseHeaders) {
|
|
310
|
+
responseData = response[0];
|
|
311
|
+
}
|
|
312
|
+
|
|
278
313
|
const {
|
|
279
314
|
error: res_error,
|
|
280
|
-
} =
|
|
281
|
-
|
|
282
|
-
allowUnknown: false
|
|
283
|
-
|
|
315
|
+
} = OrderPlatformModel.CreateChannelConfigResponse().validate(
|
|
316
|
+
responseData,
|
|
317
|
+
{ abortEarly: false, allowUnknown: false }
|
|
318
|
+
);
|
|
284
319
|
|
|
285
320
|
if (res_error) {
|
|
286
321
|
Logger({
|
|
287
322
|
level: "WARN",
|
|
288
|
-
message:
|
|
323
|
+
message: `Response Validation Warnnings for platform > Order > createChannelConfig \n ${res_error}`,
|
|
289
324
|
});
|
|
290
|
-
Logger({ level: "WARN", message: res_error });
|
|
291
325
|
}
|
|
292
326
|
|
|
293
327
|
return response;
|
|
294
328
|
}
|
|
295
329
|
|
|
296
330
|
/**
|
|
297
|
-
* @param {
|
|
298
|
-
* @param {
|
|
299
|
-
* @
|
|
331
|
+
* @param {OrderPlatformValidator.CreateOrderParam} arg - Arg object
|
|
332
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
333
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
334
|
+
* @returns {Promise<OrderPlatformModel.CreateOrderResponse>} - Success response
|
|
335
|
+
* @name createOrder
|
|
300
336
|
* @summary:
|
|
301
|
-
* @description:
|
|
337
|
+
* @description: Create Order - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/createOrder/).
|
|
302
338
|
*/
|
|
303
|
-
async createOrder(
|
|
304
|
-
|
|
339
|
+
async createOrder(
|
|
340
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
341
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
342
|
+
) {
|
|
343
|
+
const { error } = OrderPlatformValidator.createOrder().validate(
|
|
305
344
|
{
|
|
306
345
|
body,
|
|
307
346
|
},
|
|
@@ -312,7 +351,7 @@ class Order {
|
|
|
312
351
|
}
|
|
313
352
|
|
|
314
353
|
// Showing warrnings if extra unknown parameters are found
|
|
315
|
-
const { error: warrning } =
|
|
354
|
+
const { error: warrning } = OrderPlatformValidator.createOrder().validate(
|
|
316
355
|
{
|
|
317
356
|
body,
|
|
318
357
|
},
|
|
@@ -321,9 +360,8 @@ class Order {
|
|
|
321
360
|
if (warrning) {
|
|
322
361
|
Logger({
|
|
323
362
|
level: "WARN",
|
|
324
|
-
message:
|
|
363
|
+
message: `Parameter Validation warrnings for platform > Order > createOrder \n ${warrning}`,
|
|
325
364
|
});
|
|
326
|
-
Logger({ level: "WARN", message: warrning });
|
|
327
365
|
}
|
|
328
366
|
|
|
329
367
|
const query_params = {};
|
|
@@ -336,12 +374,18 @@ class Order {
|
|
|
336
374
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/create-order`,
|
|
337
375
|
query_params,
|
|
338
376
|
body,
|
|
339
|
-
xHeaders
|
|
377
|
+
{ ...xHeaders, ...requestHeaders },
|
|
378
|
+
{ responseHeaders }
|
|
340
379
|
);
|
|
341
380
|
|
|
381
|
+
let responseData = response;
|
|
382
|
+
if (responseHeaders) {
|
|
383
|
+
responseData = response[0];
|
|
384
|
+
}
|
|
385
|
+
|
|
342
386
|
const {
|
|
343
387
|
error: res_error,
|
|
344
|
-
} =
|
|
388
|
+
} = OrderPlatformModel.CreateOrderResponse().validate(responseData, {
|
|
345
389
|
abortEarly: false,
|
|
346
390
|
allowUnknown: false,
|
|
347
391
|
});
|
|
@@ -349,23 +393,27 @@ class Order {
|
|
|
349
393
|
if (res_error) {
|
|
350
394
|
Logger({
|
|
351
395
|
level: "WARN",
|
|
352
|
-
message:
|
|
396
|
+
message: `Response Validation Warnnings for platform > Order > createOrder \n ${res_error}`,
|
|
353
397
|
});
|
|
354
|
-
Logger({ level: "WARN", message: res_error });
|
|
355
398
|
}
|
|
356
399
|
|
|
357
400
|
return response;
|
|
358
401
|
}
|
|
359
402
|
|
|
360
403
|
/**
|
|
361
|
-
* @param {
|
|
362
|
-
* @param {
|
|
363
|
-
* @
|
|
404
|
+
* @param {OrderPlatformValidator.DispatchManifestParam} arg - Arg object
|
|
405
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
406
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
407
|
+
* @returns {Promise<OrderPlatformModel.SuccessResponse>} - Success response
|
|
408
|
+
* @name dispatchManifest
|
|
364
409
|
* @summary:
|
|
365
|
-
* @description:
|
|
410
|
+
* @description: Dispatch Manifest - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/dispatchManifest/).
|
|
366
411
|
*/
|
|
367
|
-
async dispatchManifest(
|
|
368
|
-
|
|
412
|
+
async dispatchManifest(
|
|
413
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
414
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
415
|
+
) {
|
|
416
|
+
const { error } = OrderPlatformValidator.dispatchManifest().validate(
|
|
369
417
|
{
|
|
370
418
|
body,
|
|
371
419
|
},
|
|
@@ -376,7 +424,9 @@ class Order {
|
|
|
376
424
|
}
|
|
377
425
|
|
|
378
426
|
// Showing warrnings if extra unknown parameters are found
|
|
379
|
-
const {
|
|
427
|
+
const {
|
|
428
|
+
error: warrning,
|
|
429
|
+
} = OrderPlatformValidator.dispatchManifest().validate(
|
|
380
430
|
{
|
|
381
431
|
body,
|
|
382
432
|
},
|
|
@@ -385,9 +435,8 @@ class Order {
|
|
|
385
435
|
if (warrning) {
|
|
386
436
|
Logger({
|
|
387
437
|
level: "WARN",
|
|
388
|
-
message:
|
|
438
|
+
message: `Parameter Validation warrnings for platform > Order > dispatchManifest \n ${warrning}`,
|
|
389
439
|
});
|
|
390
|
-
Logger({ level: "WARN", message: warrning });
|
|
391
440
|
}
|
|
392
441
|
|
|
393
442
|
const query_params = {};
|
|
@@ -400,34 +449,48 @@ class Order {
|
|
|
400
449
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/dispatch`,
|
|
401
450
|
query_params,
|
|
402
451
|
body,
|
|
403
|
-
xHeaders
|
|
452
|
+
{ ...xHeaders, ...requestHeaders },
|
|
453
|
+
{ responseHeaders }
|
|
404
454
|
);
|
|
405
455
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
456
|
+
let responseData = response;
|
|
457
|
+
if (responseHeaders) {
|
|
458
|
+
responseData = response[0];
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
const {
|
|
462
|
+
error: res_error,
|
|
463
|
+
} = OrderPlatformModel.SuccessResponse().validate(responseData, {
|
|
464
|
+
abortEarly: false,
|
|
465
|
+
allowUnknown: false,
|
|
466
|
+
});
|
|
410
467
|
|
|
411
468
|
if (res_error) {
|
|
412
469
|
Logger({
|
|
413
470
|
level: "WARN",
|
|
414
|
-
message:
|
|
471
|
+
message: `Response Validation Warnnings for platform > Order > dispatchManifest \n ${res_error}`,
|
|
415
472
|
});
|
|
416
|
-
Logger({ level: "WARN", message: res_error });
|
|
417
473
|
}
|
|
418
474
|
|
|
419
475
|
return response;
|
|
420
476
|
}
|
|
421
477
|
|
|
422
478
|
/**
|
|
423
|
-
* @param {
|
|
424
|
-
* @param {
|
|
425
|
-
* @
|
|
479
|
+
* @param {OrderPlatformValidator.DownloadBulkActionTemplateParam} arg - Arg object
|
|
480
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
481
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
482
|
+
* @returns {Promise<OrderPlatformModel.FileResponse>} - Success response
|
|
483
|
+
* @name downloadBulkActionTemplate
|
|
426
484
|
* @summary:
|
|
427
|
-
* @description:
|
|
485
|
+
* @description: Download bulk actions seller templates. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/downloadBulkActionTemplate/).
|
|
428
486
|
*/
|
|
429
|
-
async downloadBulkActionTemplate(
|
|
430
|
-
|
|
487
|
+
async downloadBulkActionTemplate(
|
|
488
|
+
{ templateSlug, requestHeaders } = { requestHeaders: {} },
|
|
489
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
490
|
+
) {
|
|
491
|
+
const {
|
|
492
|
+
error,
|
|
493
|
+
} = OrderPlatformValidator.downloadBulkActionTemplate().validate(
|
|
431
494
|
{
|
|
432
495
|
templateSlug,
|
|
433
496
|
},
|
|
@@ -440,7 +503,7 @@ class Order {
|
|
|
440
503
|
// Showing warrnings if extra unknown parameters are found
|
|
441
504
|
const {
|
|
442
505
|
error: warrning,
|
|
443
|
-
} =
|
|
506
|
+
} = OrderPlatformValidator.downloadBulkActionTemplate().validate(
|
|
444
507
|
{
|
|
445
508
|
templateSlug,
|
|
446
509
|
},
|
|
@@ -449,10 +512,8 @@ class Order {
|
|
|
449
512
|
if (warrning) {
|
|
450
513
|
Logger({
|
|
451
514
|
level: "WARN",
|
|
452
|
-
message:
|
|
453
|
-
"Parameter Validation warrnings for downloadBulkActionTemplate",
|
|
515
|
+
message: `Parameter Validation warrnings for platform > Order > downloadBulkActionTemplate \n ${warrning}`,
|
|
454
516
|
});
|
|
455
|
-
Logger({ level: "WARN", message: warrning });
|
|
456
517
|
}
|
|
457
518
|
|
|
458
519
|
const query_params = {};
|
|
@@ -466,10 +527,18 @@ class Order {
|
|
|
466
527
|
`/service/platform/order/v1.0/company/${this.config.companyId}/bulk-action/download-seller-templates`,
|
|
467
528
|
query_params,
|
|
468
529
|
undefined,
|
|
469
|
-
xHeaders
|
|
530
|
+
{ ...xHeaders, ...requestHeaders },
|
|
531
|
+
{ responseHeaders }
|
|
470
532
|
);
|
|
471
533
|
|
|
472
|
-
|
|
534
|
+
let responseData = response;
|
|
535
|
+
if (responseHeaders) {
|
|
536
|
+
responseData = response[0];
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
const {
|
|
540
|
+
error: res_error,
|
|
541
|
+
} = OrderPlatformModel.FileResponse().validate(responseData, {
|
|
473
542
|
abortEarly: false,
|
|
474
543
|
allowUnknown: false,
|
|
475
544
|
});
|
|
@@ -477,23 +546,28 @@ class Order {
|
|
|
477
546
|
if (res_error) {
|
|
478
547
|
Logger({
|
|
479
548
|
level: "WARN",
|
|
480
|
-
message:
|
|
549
|
+
message: `Response Validation Warnnings for platform > Order > downloadBulkActionTemplate \n ${res_error}`,
|
|
481
550
|
});
|
|
482
|
-
Logger({ level: "WARN", message: res_error });
|
|
483
551
|
}
|
|
484
552
|
|
|
485
553
|
return response;
|
|
486
554
|
}
|
|
487
555
|
|
|
488
556
|
/**
|
|
489
|
-
* @param {
|
|
490
|
-
* @param {
|
|
491
|
-
* @
|
|
557
|
+
* @param {OrderPlatformValidator.DownloadLanesReportParam} arg - Arg object
|
|
558
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
559
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
560
|
+
* @returns {Promise<OrderPlatformModel.BulkReportsDownloadResponse>} -
|
|
561
|
+
* Success response
|
|
562
|
+
* @name downloadLanesReport
|
|
492
563
|
* @summary:
|
|
493
|
-
* @description:
|
|
564
|
+
* @description: downloads lanes shipment/orders. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/downloadLanesReport/).
|
|
494
565
|
*/
|
|
495
|
-
async
|
|
496
|
-
|
|
566
|
+
async downloadLanesReport(
|
|
567
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
568
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
569
|
+
) {
|
|
570
|
+
const { error } = OrderPlatformValidator.downloadLanesReport().validate(
|
|
497
571
|
{
|
|
498
572
|
body,
|
|
499
573
|
},
|
|
@@ -506,7 +580,7 @@ class Order {
|
|
|
506
580
|
// Showing warrnings if extra unknown parameters are found
|
|
507
581
|
const {
|
|
508
582
|
error: warrning,
|
|
509
|
-
} =
|
|
583
|
+
} = OrderPlatformValidator.downloadLanesReport().validate(
|
|
510
584
|
{
|
|
511
585
|
body,
|
|
512
586
|
},
|
|
@@ -515,9 +589,8 @@ class Order {
|
|
|
515
589
|
if (warrning) {
|
|
516
590
|
Logger({
|
|
517
591
|
level: "WARN",
|
|
518
|
-
message:
|
|
592
|
+
message: `Parameter Validation warrnings for platform > Order > downloadLanesReport \n ${warrning}`,
|
|
519
593
|
});
|
|
520
|
-
Logger({ level: "WARN", message: warrning });
|
|
521
594
|
}
|
|
522
595
|
|
|
523
596
|
const query_params = {};
|
|
@@ -527,15 +600,94 @@ class Order {
|
|
|
527
600
|
const response = await PlatformAPIClient.execute(
|
|
528
601
|
this.config,
|
|
529
602
|
"post",
|
|
530
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
603
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/reports/lanes/download`,
|
|
531
604
|
query_params,
|
|
532
605
|
body,
|
|
533
|
-
xHeaders
|
|
606
|
+
{ ...xHeaders, ...requestHeaders },
|
|
607
|
+
{ responseHeaders }
|
|
534
608
|
);
|
|
535
609
|
|
|
610
|
+
let responseData = response;
|
|
611
|
+
if (responseHeaders) {
|
|
612
|
+
responseData = response[0];
|
|
613
|
+
}
|
|
614
|
+
|
|
536
615
|
const {
|
|
537
616
|
error: res_error,
|
|
538
|
-
} =
|
|
617
|
+
} = OrderPlatformModel.BulkReportsDownloadResponse().validate(
|
|
618
|
+
responseData,
|
|
619
|
+
{ abortEarly: false, allowUnknown: false }
|
|
620
|
+
);
|
|
621
|
+
|
|
622
|
+
if (res_error) {
|
|
623
|
+
Logger({
|
|
624
|
+
level: "WARN",
|
|
625
|
+
message: `Response Validation Warnnings for platform > Order > downloadLanesReport \n ${res_error}`,
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
return response;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* @param {OrderPlatformValidator.EInvoiceRetryParam} arg - Arg object
|
|
634
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
635
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
636
|
+
* @returns {Promise<OrderPlatformModel.EInvoiceRetryResponse>} - Success response
|
|
637
|
+
* @name eInvoiceRetry
|
|
638
|
+
* @summary:
|
|
639
|
+
* @description: Retry e-invoice after failure - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/eInvoiceRetry/).
|
|
640
|
+
*/
|
|
641
|
+
async eInvoiceRetry(
|
|
642
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
643
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
644
|
+
) {
|
|
645
|
+
const { error } = OrderPlatformValidator.eInvoiceRetry().validate(
|
|
646
|
+
{
|
|
647
|
+
body,
|
|
648
|
+
},
|
|
649
|
+
{ abortEarly: false, allowUnknown: true }
|
|
650
|
+
);
|
|
651
|
+
if (error) {
|
|
652
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
// Showing warrnings if extra unknown parameters are found
|
|
656
|
+
const { error: warrning } = OrderPlatformValidator.eInvoiceRetry().validate(
|
|
657
|
+
{
|
|
658
|
+
body,
|
|
659
|
+
},
|
|
660
|
+
{ abortEarly: false, allowUnknown: false }
|
|
661
|
+
);
|
|
662
|
+
if (warrning) {
|
|
663
|
+
Logger({
|
|
664
|
+
level: "WARN",
|
|
665
|
+
message: `Parameter Validation warrnings for platform > Order > eInvoiceRetry \n ${warrning}`,
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
const query_params = {};
|
|
670
|
+
|
|
671
|
+
const xHeaders = {};
|
|
672
|
+
|
|
673
|
+
const response = await PlatformAPIClient.execute(
|
|
674
|
+
this.config,
|
|
675
|
+
"post",
|
|
676
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/einvoice/retry/irn`,
|
|
677
|
+
query_params,
|
|
678
|
+
body,
|
|
679
|
+
{ ...xHeaders, ...requestHeaders },
|
|
680
|
+
{ responseHeaders }
|
|
681
|
+
);
|
|
682
|
+
|
|
683
|
+
let responseData = response;
|
|
684
|
+
if (responseHeaders) {
|
|
685
|
+
responseData = response[0];
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const {
|
|
689
|
+
error: res_error,
|
|
690
|
+
} = OrderPlatformModel.EInvoiceRetryResponse().validate(responseData, {
|
|
539
691
|
abortEarly: false,
|
|
540
692
|
allowUnknown: false,
|
|
541
693
|
});
|
|
@@ -543,23 +695,107 @@ class Order {
|
|
|
543
695
|
if (res_error) {
|
|
544
696
|
Logger({
|
|
545
697
|
level: "WARN",
|
|
546
|
-
message:
|
|
698
|
+
message: `Response Validation Warnnings for platform > Order > eInvoiceRetry \n ${res_error}`,
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
return response;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* @param {OrderPlatformValidator.FetchCreditBalanceDetailParam} arg - Arg object
|
|
707
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
708
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
709
|
+
* @returns {Promise<OrderPlatformModel.FetchCreditBalanceResponsePayload>}
|
|
710
|
+
* - Success response
|
|
711
|
+
*
|
|
712
|
+
* @name fetchCreditBalanceDetail
|
|
713
|
+
* @summary:
|
|
714
|
+
* @description: Fetch Credit Balance Detail - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/fetchCreditBalanceDetail/).
|
|
715
|
+
*/
|
|
716
|
+
async fetchCreditBalanceDetail(
|
|
717
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
718
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
719
|
+
) {
|
|
720
|
+
const {
|
|
721
|
+
error,
|
|
722
|
+
} = OrderPlatformValidator.fetchCreditBalanceDetail().validate(
|
|
723
|
+
{
|
|
724
|
+
body,
|
|
725
|
+
},
|
|
726
|
+
{ abortEarly: false, allowUnknown: true }
|
|
727
|
+
);
|
|
728
|
+
if (error) {
|
|
729
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
// Showing warrnings if extra unknown parameters are found
|
|
733
|
+
const {
|
|
734
|
+
error: warrning,
|
|
735
|
+
} = OrderPlatformValidator.fetchCreditBalanceDetail().validate(
|
|
736
|
+
{
|
|
737
|
+
body,
|
|
738
|
+
},
|
|
739
|
+
{ abortEarly: false, allowUnknown: false }
|
|
740
|
+
);
|
|
741
|
+
if (warrning) {
|
|
742
|
+
Logger({
|
|
743
|
+
level: "WARN",
|
|
744
|
+
message: `Parameter Validation warrnings for platform > Order > fetchCreditBalanceDetail \n ${warrning}`,
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
const query_params = {};
|
|
749
|
+
|
|
750
|
+
const xHeaders = {};
|
|
751
|
+
|
|
752
|
+
const response = await PlatformAPIClient.execute(
|
|
753
|
+
this.config,
|
|
754
|
+
"post",
|
|
755
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/customer-credit-balance`,
|
|
756
|
+
query_params,
|
|
757
|
+
body,
|
|
758
|
+
{ ...xHeaders, ...requestHeaders },
|
|
759
|
+
{ responseHeaders }
|
|
760
|
+
);
|
|
761
|
+
|
|
762
|
+
let responseData = response;
|
|
763
|
+
if (responseHeaders) {
|
|
764
|
+
responseData = response[0];
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
const {
|
|
768
|
+
error: res_error,
|
|
769
|
+
} = OrderPlatformModel.FetchCreditBalanceResponsePayload().validate(
|
|
770
|
+
responseData,
|
|
771
|
+
{ abortEarly: false, allowUnknown: false }
|
|
772
|
+
);
|
|
773
|
+
|
|
774
|
+
if (res_error) {
|
|
775
|
+
Logger({
|
|
776
|
+
level: "WARN",
|
|
777
|
+
message: `Response Validation Warnnings for platform > Order > fetchCreditBalanceDetail \n ${res_error}`,
|
|
547
778
|
});
|
|
548
|
-
Logger({ level: "WARN", message: res_error });
|
|
549
779
|
}
|
|
550
780
|
|
|
551
781
|
return response;
|
|
552
782
|
}
|
|
553
783
|
|
|
554
784
|
/**
|
|
555
|
-
* @param {
|
|
556
|
-
* @param {
|
|
557
|
-
* @
|
|
785
|
+
* @param {OrderPlatformValidator.FetchRefundModeConfigParam} arg - Arg object
|
|
786
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
787
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
788
|
+
* @returns {Promise<OrderPlatformModel.RefundModeConfigResponsePayload>} -
|
|
789
|
+
* Success response
|
|
790
|
+
* @name fetchRefundModeConfig
|
|
558
791
|
* @summary:
|
|
559
|
-
* @description:
|
|
792
|
+
* @description: Fetch Refund Mode Config - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/fetchRefundModeConfig/).
|
|
560
793
|
*/
|
|
561
|
-
async fetchRefundModeConfig(
|
|
562
|
-
|
|
794
|
+
async fetchRefundModeConfig(
|
|
795
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
796
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
797
|
+
) {
|
|
798
|
+
const { error } = OrderPlatformValidator.fetchRefundModeConfig().validate(
|
|
563
799
|
{
|
|
564
800
|
body,
|
|
565
801
|
},
|
|
@@ -570,7 +806,9 @@ class Order {
|
|
|
570
806
|
}
|
|
571
807
|
|
|
572
808
|
// Showing warrnings if extra unknown parameters are found
|
|
573
|
-
const {
|
|
809
|
+
const {
|
|
810
|
+
error: warrning,
|
|
811
|
+
} = OrderPlatformValidator.fetchRefundModeConfig().validate(
|
|
574
812
|
{
|
|
575
813
|
body,
|
|
576
814
|
},
|
|
@@ -579,9 +817,8 @@ class Order {
|
|
|
579
817
|
if (warrning) {
|
|
580
818
|
Logger({
|
|
581
819
|
level: "WARN",
|
|
582
|
-
message:
|
|
820
|
+
message: `Parameter Validation warrnings for platform > Order > fetchRefundModeConfig \n ${warrning}`,
|
|
583
821
|
});
|
|
584
|
-
Logger({ level: "WARN", message: warrning });
|
|
585
822
|
}
|
|
586
823
|
|
|
587
824
|
const query_params = {};
|
|
@@ -594,42 +831,51 @@ class Order {
|
|
|
594
831
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/refund-mode-config`,
|
|
595
832
|
query_params,
|
|
596
833
|
body,
|
|
597
|
-
xHeaders
|
|
834
|
+
{ ...xHeaders, ...requestHeaders },
|
|
835
|
+
{ responseHeaders }
|
|
598
836
|
);
|
|
599
837
|
|
|
838
|
+
let responseData = response;
|
|
839
|
+
if (responseHeaders) {
|
|
840
|
+
responseData = response[0];
|
|
841
|
+
}
|
|
842
|
+
|
|
600
843
|
const {
|
|
601
844
|
error: res_error,
|
|
602
|
-
} =
|
|
603
|
-
|
|
604
|
-
allowUnknown: false
|
|
605
|
-
|
|
845
|
+
} = OrderPlatformModel.RefundModeConfigResponsePayload().validate(
|
|
846
|
+
responseData,
|
|
847
|
+
{ abortEarly: false, allowUnknown: false }
|
|
848
|
+
);
|
|
606
849
|
|
|
607
850
|
if (res_error) {
|
|
608
851
|
Logger({
|
|
609
852
|
level: "WARN",
|
|
610
|
-
message:
|
|
853
|
+
message: `Response Validation Warnnings for platform > Order > fetchRefundModeConfig \n ${res_error}`,
|
|
611
854
|
});
|
|
612
|
-
Logger({ level: "WARN", message: res_error });
|
|
613
855
|
}
|
|
614
856
|
|
|
615
857
|
return response;
|
|
616
858
|
}
|
|
617
859
|
|
|
618
860
|
/**
|
|
619
|
-
* @param {
|
|
620
|
-
* @param {
|
|
621
|
-
* @param {
|
|
622
|
-
* @
|
|
623
|
-
*
|
|
861
|
+
* @param {OrderPlatformValidator.GeneratePOSReceiptByOrderIdParam} arg - Arg object
|
|
862
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
863
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
864
|
+
* @returns {Promise<OrderPlatformModel.GeneratePosOrderReceiptResponse>} -
|
|
865
|
+
* Success response
|
|
866
|
+
* @name generatePOSReceiptByOrderId
|
|
624
867
|
* @summary:
|
|
625
|
-
* @description:
|
|
868
|
+
* @description: Generate POS recipt by order id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/generatePOSReceiptByOrderId/).
|
|
626
869
|
*/
|
|
627
|
-
async generatePOSReceiptByOrderId(
|
|
628
|
-
orderId,
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
870
|
+
async generatePOSReceiptByOrderId(
|
|
871
|
+
{ orderId, shipmentId, documentType, requestHeaders } = {
|
|
872
|
+
requestHeaders: {},
|
|
873
|
+
},
|
|
874
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
875
|
+
) {
|
|
876
|
+
const {
|
|
877
|
+
error,
|
|
878
|
+
} = OrderPlatformValidator.generatePOSReceiptByOrderId().validate(
|
|
633
879
|
{
|
|
634
880
|
orderId,
|
|
635
881
|
shipmentId,
|
|
@@ -644,7 +890,7 @@ class Order {
|
|
|
644
890
|
// Showing warrnings if extra unknown parameters are found
|
|
645
891
|
const {
|
|
646
892
|
error: warrning,
|
|
647
|
-
} =
|
|
893
|
+
} = OrderPlatformValidator.generatePOSReceiptByOrderId().validate(
|
|
648
894
|
{
|
|
649
895
|
orderId,
|
|
650
896
|
shipmentId,
|
|
@@ -655,10 +901,8 @@ class Order {
|
|
|
655
901
|
if (warrning) {
|
|
656
902
|
Logger({
|
|
657
903
|
level: "WARN",
|
|
658
|
-
message:
|
|
659
|
-
"Parameter Validation warrnings for generatePOSReceiptByOrderId",
|
|
904
|
+
message: `Parameter Validation warrnings for platform > Order > generatePOSReceiptByOrderId \n ${warrning}`,
|
|
660
905
|
});
|
|
661
|
-
Logger({ level: "WARN", message: warrning });
|
|
662
906
|
}
|
|
663
907
|
|
|
664
908
|
const query_params = {};
|
|
@@ -673,38 +917,129 @@ class Order {
|
|
|
673
917
|
`/service/platform/order/v1.0/company/${this.config.companyId}/orders/${orderId}/generate/pos-receipt`,
|
|
674
918
|
query_params,
|
|
675
919
|
undefined,
|
|
676
|
-
xHeaders
|
|
920
|
+
{ ...xHeaders, ...requestHeaders },
|
|
921
|
+
{ responseHeaders }
|
|
677
922
|
);
|
|
678
923
|
|
|
924
|
+
let responseData = response;
|
|
925
|
+
if (responseHeaders) {
|
|
926
|
+
responseData = response[0];
|
|
927
|
+
}
|
|
928
|
+
|
|
679
929
|
const {
|
|
680
930
|
error: res_error,
|
|
681
|
-
} =
|
|
682
|
-
|
|
683
|
-
allowUnknown: false
|
|
684
|
-
|
|
931
|
+
} = OrderPlatformModel.GeneratePosOrderReceiptResponse().validate(
|
|
932
|
+
responseData,
|
|
933
|
+
{ abortEarly: false, allowUnknown: false }
|
|
934
|
+
);
|
|
685
935
|
|
|
686
936
|
if (res_error) {
|
|
687
937
|
Logger({
|
|
688
938
|
level: "WARN",
|
|
689
|
-
message:
|
|
690
|
-
"Response Validation Warnnings for generatePOSReceiptByOrderId",
|
|
939
|
+
message: `Response Validation Warnnings for platform > Order > generatePOSReceiptByOrderId \n ${res_error}`,
|
|
691
940
|
});
|
|
692
|
-
Logger({ level: "WARN", message: res_error });
|
|
693
941
|
}
|
|
694
942
|
|
|
695
943
|
return response;
|
|
696
944
|
}
|
|
697
945
|
|
|
698
946
|
/**
|
|
699
|
-
* @param {
|
|
700
|
-
* @param {
|
|
701
|
-
*
|
|
702
|
-
* @returns {Promise<
|
|
947
|
+
* @param {OrderPlatformValidator.GetAllowedStateTransitionParam} arg - Arg object
|
|
948
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
949
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
950
|
+
* @returns {Promise<OrderPlatformModel.RoleBaseStateTransitionMapping>} -
|
|
951
|
+
* Success response
|
|
952
|
+
* @name getAllowedStateTransition
|
|
953
|
+
* @summary: To fetch next state transitions.
|
|
954
|
+
* @description: This endpoint will fetch next possible states based on logged in user
|
|
955
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getAllowedStateTransition/).
|
|
956
|
+
*/
|
|
957
|
+
async getAllowedStateTransition(
|
|
958
|
+
{ orderingChannel, status, requestHeaders } = { requestHeaders: {} },
|
|
959
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
960
|
+
) {
|
|
961
|
+
const {
|
|
962
|
+
error,
|
|
963
|
+
} = OrderPlatformValidator.getAllowedStateTransition().validate(
|
|
964
|
+
{
|
|
965
|
+
orderingChannel,
|
|
966
|
+
status,
|
|
967
|
+
},
|
|
968
|
+
{ abortEarly: false, allowUnknown: true }
|
|
969
|
+
);
|
|
970
|
+
if (error) {
|
|
971
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
// Showing warrnings if extra unknown parameters are found
|
|
975
|
+
const {
|
|
976
|
+
error: warrning,
|
|
977
|
+
} = OrderPlatformValidator.getAllowedStateTransition().validate(
|
|
978
|
+
{
|
|
979
|
+
orderingChannel,
|
|
980
|
+
status,
|
|
981
|
+
},
|
|
982
|
+
{ abortEarly: false, allowUnknown: false }
|
|
983
|
+
);
|
|
984
|
+
if (warrning) {
|
|
985
|
+
Logger({
|
|
986
|
+
level: "WARN",
|
|
987
|
+
message: `Parameter Validation warrnings for platform > Order > getAllowedStateTransition \n ${warrning}`,
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
const query_params = {};
|
|
992
|
+
query_params["ordering_channel"] = orderingChannel;
|
|
993
|
+
query_params["status"] = status;
|
|
994
|
+
|
|
995
|
+
const xHeaders = {};
|
|
996
|
+
|
|
997
|
+
const response = await PlatformAPIClient.execute(
|
|
998
|
+
this.config,
|
|
999
|
+
"get",
|
|
1000
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/allowed/state/transition`,
|
|
1001
|
+
query_params,
|
|
1002
|
+
undefined,
|
|
1003
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1004
|
+
{ responseHeaders }
|
|
1005
|
+
);
|
|
1006
|
+
|
|
1007
|
+
let responseData = response;
|
|
1008
|
+
if (responseHeaders) {
|
|
1009
|
+
responseData = response[0];
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
const {
|
|
1013
|
+
error: res_error,
|
|
1014
|
+
} = OrderPlatformModel.RoleBaseStateTransitionMapping().validate(
|
|
1015
|
+
responseData,
|
|
1016
|
+
{ abortEarly: false, allowUnknown: false }
|
|
1017
|
+
);
|
|
1018
|
+
|
|
1019
|
+
if (res_error) {
|
|
1020
|
+
Logger({
|
|
1021
|
+
level: "WARN",
|
|
1022
|
+
message: `Response Validation Warnnings for platform > Order > getAllowedStateTransition \n ${res_error}`,
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
return response;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* @param {OrderPlatformValidator.GetAnnouncementsParam} arg - Arg object
|
|
1031
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1032
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1033
|
+
* @returns {Promise<OrderPlatformModel.AnnouncementsResponse>} - Success response
|
|
1034
|
+
* @name getAnnouncements
|
|
703
1035
|
* @summary:
|
|
704
|
-
* @description:
|
|
1036
|
+
* @description: Get Announcements - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getAnnouncements/).
|
|
705
1037
|
*/
|
|
706
|
-
async getAnnouncements(
|
|
707
|
-
|
|
1038
|
+
async getAnnouncements(
|
|
1039
|
+
{ date, requestHeaders } = { requestHeaders: {} },
|
|
1040
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1041
|
+
) {
|
|
1042
|
+
const { error } = OrderPlatformValidator.getAnnouncements().validate(
|
|
708
1043
|
{
|
|
709
1044
|
date,
|
|
710
1045
|
},
|
|
@@ -715,7 +1050,9 @@ class Order {
|
|
|
715
1050
|
}
|
|
716
1051
|
|
|
717
1052
|
// Showing warrnings if extra unknown parameters are found
|
|
718
|
-
const {
|
|
1053
|
+
const {
|
|
1054
|
+
error: warrning,
|
|
1055
|
+
} = OrderPlatformValidator.getAnnouncements().validate(
|
|
719
1056
|
{
|
|
720
1057
|
date,
|
|
721
1058
|
},
|
|
@@ -724,9 +1061,8 @@ class Order {
|
|
|
724
1061
|
if (warrning) {
|
|
725
1062
|
Logger({
|
|
726
1063
|
level: "WARN",
|
|
727
|
-
message:
|
|
1064
|
+
message: `Parameter Validation warrnings for platform > Order > getAnnouncements \n ${warrning}`,
|
|
728
1065
|
});
|
|
729
|
-
Logger({ level: "WARN", message: warrning });
|
|
730
1066
|
}
|
|
731
1067
|
|
|
732
1068
|
const query_params = {};
|
|
@@ -740,12 +1076,18 @@ class Order {
|
|
|
740
1076
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/announcements`,
|
|
741
1077
|
query_params,
|
|
742
1078
|
undefined,
|
|
743
|
-
xHeaders
|
|
1079
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1080
|
+
{ responseHeaders }
|
|
744
1081
|
);
|
|
745
1082
|
|
|
1083
|
+
let responseData = response;
|
|
1084
|
+
if (responseHeaders) {
|
|
1085
|
+
responseData = response[0];
|
|
1086
|
+
}
|
|
1087
|
+
|
|
746
1088
|
const {
|
|
747
1089
|
error: res_error,
|
|
748
|
-
} =
|
|
1090
|
+
} = OrderPlatformModel.AnnouncementsResponse().validate(responseData, {
|
|
749
1091
|
abortEarly: false,
|
|
750
1092
|
allowUnknown: false,
|
|
751
1093
|
});
|
|
@@ -753,25 +1095,28 @@ class Order {
|
|
|
753
1095
|
if (res_error) {
|
|
754
1096
|
Logger({
|
|
755
1097
|
level: "WARN",
|
|
756
|
-
message:
|
|
1098
|
+
message: `Response Validation Warnnings for platform > Order > getAnnouncements \n ${res_error}`,
|
|
757
1099
|
});
|
|
758
|
-
Logger({ level: "WARN", message: res_error });
|
|
759
1100
|
}
|
|
760
1101
|
|
|
761
1102
|
return response;
|
|
762
1103
|
}
|
|
763
1104
|
|
|
764
1105
|
/**
|
|
765
|
-
* @param {
|
|
766
|
-
* @param {
|
|
767
|
-
* @param {
|
|
768
|
-
* @
|
|
769
|
-
*
|
|
1106
|
+
* @param {OrderPlatformValidator.GetBagByIdParam} arg - Arg object
|
|
1107
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1108
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1109
|
+
* @returns {Promise<OrderPlatformModel.BagDetailsPlatformResponse>} -
|
|
1110
|
+
* Success response
|
|
1111
|
+
* @name getBagById
|
|
770
1112
|
* @summary:
|
|
771
|
-
* @description:
|
|
1113
|
+
* @description: Get Order Bag Details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getBagById/).
|
|
772
1114
|
*/
|
|
773
|
-
async getBagById(
|
|
774
|
-
|
|
1115
|
+
async getBagById(
|
|
1116
|
+
{ bagId, channelBagId, channelId, requestHeaders } = { requestHeaders: {} },
|
|
1117
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1118
|
+
) {
|
|
1119
|
+
const { error } = OrderPlatformValidator.getBagById().validate(
|
|
775
1120
|
{
|
|
776
1121
|
bagId,
|
|
777
1122
|
channelBagId,
|
|
@@ -784,7 +1129,7 @@ class Order {
|
|
|
784
1129
|
}
|
|
785
1130
|
|
|
786
1131
|
// Showing warrnings if extra unknown parameters are found
|
|
787
|
-
const { error: warrning } =
|
|
1132
|
+
const { error: warrning } = OrderPlatformValidator.getBagById().validate(
|
|
788
1133
|
{
|
|
789
1134
|
bagId,
|
|
790
1135
|
channelBagId,
|
|
@@ -795,9 +1140,8 @@ class Order {
|
|
|
795
1140
|
if (warrning) {
|
|
796
1141
|
Logger({
|
|
797
1142
|
level: "WARN",
|
|
798
|
-
message:
|
|
1143
|
+
message: `Parameter Validation warrnings for platform > Order > getBagById \n ${warrning}`,
|
|
799
1144
|
});
|
|
800
|
-
Logger({ level: "WARN", message: warrning });
|
|
801
1145
|
}
|
|
802
1146
|
|
|
803
1147
|
const query_params = {};
|
|
@@ -813,12 +1157,18 @@ class Order {
|
|
|
813
1157
|
`/service/platform/order/v1.0/company/${this.config.companyId}/bag-details/`,
|
|
814
1158
|
query_params,
|
|
815
1159
|
undefined,
|
|
816
|
-
xHeaders
|
|
1160
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1161
|
+
{ responseHeaders }
|
|
817
1162
|
);
|
|
818
1163
|
|
|
1164
|
+
let responseData = response;
|
|
1165
|
+
if (responseHeaders) {
|
|
1166
|
+
responseData = response[0];
|
|
1167
|
+
}
|
|
1168
|
+
|
|
819
1169
|
const {
|
|
820
1170
|
error: res_error,
|
|
821
|
-
} =
|
|
1171
|
+
} = OrderPlatformModel.BagDetailsPlatformResponse().validate(responseData, {
|
|
822
1172
|
abortEarly: false,
|
|
823
1173
|
allowUnknown: false,
|
|
824
1174
|
});
|
|
@@ -826,42 +1176,38 @@ class Order {
|
|
|
826
1176
|
if (res_error) {
|
|
827
1177
|
Logger({
|
|
828
1178
|
level: "WARN",
|
|
829
|
-
message:
|
|
1179
|
+
message: `Response Validation Warnnings for platform > Order > getBagById \n ${res_error}`,
|
|
830
1180
|
});
|
|
831
|
-
Logger({ level: "WARN", message: res_error });
|
|
832
1181
|
}
|
|
833
1182
|
|
|
834
1183
|
return response;
|
|
835
1184
|
}
|
|
836
1185
|
|
|
837
1186
|
/**
|
|
838
|
-
* @param {
|
|
839
|
-
* @param {
|
|
840
|
-
* @param {
|
|
841
|
-
* @
|
|
842
|
-
* @
|
|
843
|
-
* @param {string} [arg.channelShipmentIds] - Comma separated values of app
|
|
844
|
-
* shipment ids
|
|
845
|
-
* @param {string} [arg.channelOrderIds] - Comma separated values of app order ids
|
|
846
|
-
* @param {string} [arg.channelId] - Comma separated values of app ids
|
|
847
|
-
* @param {number} [arg.pageNo] - Page number for paginated data
|
|
848
|
-
* @param {number} [arg.pageSize] - Page size of data received per page
|
|
849
|
-
* @returns {Promise<GetBagsPlatformResponse>} - Success response
|
|
1187
|
+
* @param {OrderPlatformValidator.GetBagsParam} arg - Arg object
|
|
1188
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1189
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1190
|
+
* @returns {Promise<OrderPlatformModel.GetBagsPlatformResponse>} - Success response
|
|
1191
|
+
* @name getBags
|
|
850
1192
|
* @summary:
|
|
851
|
-
* @description:
|
|
1193
|
+
* @description: Get Bags for the order - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getBags/).
|
|
852
1194
|
*/
|
|
853
|
-
async getBags(
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
1195
|
+
async getBags(
|
|
1196
|
+
{
|
|
1197
|
+
bagIds,
|
|
1198
|
+
shipmentIds,
|
|
1199
|
+
orderIds,
|
|
1200
|
+
channelBagIds,
|
|
1201
|
+
channelShipmentIds,
|
|
1202
|
+
channelOrderIds,
|
|
1203
|
+
channelId,
|
|
1204
|
+
pageNo,
|
|
1205
|
+
pageSize,
|
|
1206
|
+
requestHeaders,
|
|
1207
|
+
} = { requestHeaders: {} },
|
|
1208
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1209
|
+
) {
|
|
1210
|
+
const { error } = OrderPlatformValidator.getBags().validate(
|
|
865
1211
|
{
|
|
866
1212
|
bagIds,
|
|
867
1213
|
shipmentIds,
|
|
@@ -880,7 +1226,7 @@ class Order {
|
|
|
880
1226
|
}
|
|
881
1227
|
|
|
882
1228
|
// Showing warrnings if extra unknown parameters are found
|
|
883
|
-
const { error: warrning } =
|
|
1229
|
+
const { error: warrning } = OrderPlatformValidator.getBags().validate(
|
|
884
1230
|
{
|
|
885
1231
|
bagIds,
|
|
886
1232
|
shipmentIds,
|
|
@@ -897,9 +1243,8 @@ class Order {
|
|
|
897
1243
|
if (warrning) {
|
|
898
1244
|
Logger({
|
|
899
1245
|
level: "WARN",
|
|
900
|
-
message:
|
|
1246
|
+
message: `Parameter Validation warrnings for platform > Order > getBags \n ${warrning}`,
|
|
901
1247
|
});
|
|
902
|
-
Logger({ level: "WARN", message: warrning });
|
|
903
1248
|
}
|
|
904
1249
|
|
|
905
1250
|
const query_params = {};
|
|
@@ -921,12 +1266,18 @@ class Order {
|
|
|
921
1266
|
`/service/platform/order/v1.0/company/${this.config.companyId}/bags`,
|
|
922
1267
|
query_params,
|
|
923
1268
|
undefined,
|
|
924
|
-
xHeaders
|
|
1269
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1270
|
+
{ responseHeaders }
|
|
925
1271
|
);
|
|
926
1272
|
|
|
1273
|
+
let responseData = response;
|
|
1274
|
+
if (responseHeaders) {
|
|
1275
|
+
responseData = response[0];
|
|
1276
|
+
}
|
|
1277
|
+
|
|
927
1278
|
const {
|
|
928
1279
|
error: res_error,
|
|
929
|
-
} =
|
|
1280
|
+
} = OrderPlatformModel.GetBagsPlatformResponse().validate(responseData, {
|
|
930
1281
|
abortEarly: false,
|
|
931
1282
|
allowUnknown: false,
|
|
932
1283
|
});
|
|
@@ -934,22 +1285,28 @@ class Order {
|
|
|
934
1285
|
if (res_error) {
|
|
935
1286
|
Logger({
|
|
936
1287
|
level: "WARN",
|
|
937
|
-
message:
|
|
1288
|
+
message: `Response Validation Warnnings for platform > Order > getBags \n ${res_error}`,
|
|
938
1289
|
});
|
|
939
|
-
Logger({ level: "WARN", message: res_error });
|
|
940
1290
|
}
|
|
941
1291
|
|
|
942
1292
|
return response;
|
|
943
1293
|
}
|
|
944
1294
|
|
|
945
1295
|
/**
|
|
946
|
-
* @param {
|
|
947
|
-
* @
|
|
1296
|
+
* @param {OrderPlatformValidator.GetBulkActionTemplateParam} arg - Arg object
|
|
1297
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1298
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1299
|
+
* @returns {Promise<OrderPlatformModel.BulkActionTemplateResponse>} -
|
|
1300
|
+
* Success response
|
|
1301
|
+
* @name getBulkActionTemplate
|
|
948
1302
|
* @summary:
|
|
949
|
-
* @description:
|
|
1303
|
+
* @description: Get Bulk Action seller templates. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getBulkActionTemplate/).
|
|
950
1304
|
*/
|
|
951
|
-
async getBulkActionTemplate(
|
|
952
|
-
|
|
1305
|
+
async getBulkActionTemplate(
|
|
1306
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
1307
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1308
|
+
) {
|
|
1309
|
+
const { error } = OrderPlatformValidator.getBulkActionTemplate().validate(
|
|
953
1310
|
{},
|
|
954
1311
|
{ abortEarly: false, allowUnknown: true }
|
|
955
1312
|
);
|
|
@@ -958,16 +1315,17 @@ class Order {
|
|
|
958
1315
|
}
|
|
959
1316
|
|
|
960
1317
|
// Showing warrnings if extra unknown parameters are found
|
|
961
|
-
const {
|
|
1318
|
+
const {
|
|
1319
|
+
error: warrning,
|
|
1320
|
+
} = OrderPlatformValidator.getBulkActionTemplate().validate(
|
|
962
1321
|
{},
|
|
963
1322
|
{ abortEarly: false, allowUnknown: false }
|
|
964
1323
|
);
|
|
965
1324
|
if (warrning) {
|
|
966
1325
|
Logger({
|
|
967
1326
|
level: "WARN",
|
|
968
|
-
message:
|
|
1327
|
+
message: `Parameter Validation warrnings for platform > Order > getBulkActionTemplate \n ${warrning}`,
|
|
969
1328
|
});
|
|
970
|
-
Logger({ level: "WARN", message: warrning });
|
|
971
1329
|
}
|
|
972
1330
|
|
|
973
1331
|
const query_params = {};
|
|
@@ -980,12 +1338,18 @@ class Order {
|
|
|
980
1338
|
`/service/platform/order/v1.0/company/${this.config.companyId}/bulk-action/get-seller-templates`,
|
|
981
1339
|
query_params,
|
|
982
1340
|
undefined,
|
|
983
|
-
xHeaders
|
|
1341
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1342
|
+
{ responseHeaders }
|
|
984
1343
|
);
|
|
985
1344
|
|
|
1345
|
+
let responseData = response;
|
|
1346
|
+
if (responseHeaders) {
|
|
1347
|
+
responseData = response[0];
|
|
1348
|
+
}
|
|
1349
|
+
|
|
986
1350
|
const {
|
|
987
1351
|
error: res_error,
|
|
988
|
-
} =
|
|
1352
|
+
} = OrderPlatformModel.BulkActionTemplateResponse().validate(responseData, {
|
|
989
1353
|
abortEarly: false,
|
|
990
1354
|
allowUnknown: false,
|
|
991
1355
|
});
|
|
@@ -993,47 +1357,43 @@ class Order {
|
|
|
993
1357
|
if (res_error) {
|
|
994
1358
|
Logger({
|
|
995
1359
|
level: "WARN",
|
|
996
|
-
message:
|
|
1360
|
+
message: `Response Validation Warnnings for platform > Order > getBulkActionTemplate \n ${res_error}`,
|
|
997
1361
|
});
|
|
998
|
-
Logger({ level: "WARN", message: res_error });
|
|
999
1362
|
}
|
|
1000
1363
|
|
|
1001
1364
|
return response;
|
|
1002
1365
|
}
|
|
1003
1366
|
|
|
1004
1367
|
/**
|
|
1005
|
-
* @param {
|
|
1006
|
-
* @param {
|
|
1007
|
-
* @param {
|
|
1008
|
-
* @
|
|
1009
|
-
* @
|
|
1010
|
-
* @param {string} [arg.stores] - Comma separated values of store ids
|
|
1011
|
-
* @param {string} [arg.tags] - Comma separated values of tags
|
|
1012
|
-
* @param {string} [arg.bagStatus] - Comma separated values of bag statuses
|
|
1013
|
-
* @param {string} [arg.paymentMethods] - Comma separated values of payment methods
|
|
1014
|
-
* @param {string} [arg.fileType] - File type to be downloaded
|
|
1015
|
-
* @param {number} [arg.timeToDispatch] - Sla breached or not breached
|
|
1016
|
-
* @param {number} [arg.pageNo] -
|
|
1017
|
-
* @param {number} [arg.pageSize] -
|
|
1018
|
-
* @returns {Promise<FileResponse>} - Success response
|
|
1368
|
+
* @param {OrderPlatformValidator.GetBulkShipmentExcelFileParam} arg - Arg object
|
|
1369
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1370
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1371
|
+
* @returns {Promise<OrderPlatformModel.FileResponse>} - Success response
|
|
1372
|
+
* @name getBulkShipmentExcelFile
|
|
1019
1373
|
* @summary:
|
|
1020
|
-
* @description:
|
|
1374
|
+
* @description: Generate Bulk Shipment Excel Report. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getBulkShipmentExcelFile/).
|
|
1021
1375
|
*/
|
|
1022
|
-
async getBulkShipmentExcelFile(
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1376
|
+
async getBulkShipmentExcelFile(
|
|
1377
|
+
{
|
|
1378
|
+
salesChannels,
|
|
1379
|
+
dpIds,
|
|
1380
|
+
fromDate,
|
|
1381
|
+
toDate,
|
|
1382
|
+
stores,
|
|
1383
|
+
tags,
|
|
1384
|
+
bagStatus,
|
|
1385
|
+
paymentMethods,
|
|
1386
|
+
fileType,
|
|
1387
|
+
timeToDispatch,
|
|
1388
|
+
pageNo,
|
|
1389
|
+
pageSize,
|
|
1390
|
+
requestHeaders,
|
|
1391
|
+
} = { requestHeaders: {} },
|
|
1392
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1393
|
+
) {
|
|
1394
|
+
const {
|
|
1395
|
+
error,
|
|
1396
|
+
} = OrderPlatformValidator.getBulkShipmentExcelFile().validate(
|
|
1037
1397
|
{
|
|
1038
1398
|
salesChannels,
|
|
1039
1399
|
dpIds,
|
|
@@ -1057,7 +1417,7 @@ class Order {
|
|
|
1057
1417
|
// Showing warrnings if extra unknown parameters are found
|
|
1058
1418
|
const {
|
|
1059
1419
|
error: warrning,
|
|
1060
|
-
} =
|
|
1420
|
+
} = OrderPlatformValidator.getBulkShipmentExcelFile().validate(
|
|
1061
1421
|
{
|
|
1062
1422
|
salesChannels,
|
|
1063
1423
|
dpIds,
|
|
@@ -1077,9 +1437,8 @@ class Order {
|
|
|
1077
1437
|
if (warrning) {
|
|
1078
1438
|
Logger({
|
|
1079
1439
|
level: "WARN",
|
|
1080
|
-
message:
|
|
1440
|
+
message: `Parameter Validation warrnings for platform > Order > getBulkShipmentExcelFile \n ${warrning}`,
|
|
1081
1441
|
});
|
|
1082
|
-
Logger({ level: "WARN", message: warrning });
|
|
1083
1442
|
}
|
|
1084
1443
|
|
|
1085
1444
|
const query_params = {};
|
|
@@ -1104,10 +1463,18 @@ class Order {
|
|
|
1104
1463
|
`/service/platform/order/v1.0/company/${this.config.companyId}/generate/file`,
|
|
1105
1464
|
query_params,
|
|
1106
1465
|
undefined,
|
|
1107
|
-
xHeaders
|
|
1466
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1467
|
+
{ responseHeaders }
|
|
1108
1468
|
);
|
|
1109
1469
|
|
|
1110
|
-
|
|
1470
|
+
let responseData = response;
|
|
1471
|
+
if (responseHeaders) {
|
|
1472
|
+
responseData = response[0];
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
const {
|
|
1476
|
+
error: res_error,
|
|
1477
|
+
} = OrderPlatformModel.FileResponse().validate(responseData, {
|
|
1111
1478
|
abortEarly: false,
|
|
1112
1479
|
allowUnknown: false,
|
|
1113
1480
|
});
|
|
@@ -1115,22 +1482,27 @@ class Order {
|
|
|
1115
1482
|
if (res_error) {
|
|
1116
1483
|
Logger({
|
|
1117
1484
|
level: "WARN",
|
|
1118
|
-
message:
|
|
1485
|
+
message: `Response Validation Warnnings for platform > Order > getBulkShipmentExcelFile \n ${res_error}`,
|
|
1119
1486
|
});
|
|
1120
|
-
Logger({ level: "WARN", message: res_error });
|
|
1121
1487
|
}
|
|
1122
1488
|
|
|
1123
1489
|
return response;
|
|
1124
1490
|
}
|
|
1125
1491
|
|
|
1126
1492
|
/**
|
|
1127
|
-
* @param {
|
|
1128
|
-
* @
|
|
1493
|
+
* @param {OrderPlatformValidator.GetChannelConfigParam} arg - Arg object
|
|
1494
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1495
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1496
|
+
* @returns {Promise<OrderPlatformModel.CreateChannelConfigData>} - Success response
|
|
1497
|
+
* @name getChannelConfig
|
|
1129
1498
|
* @summary:
|
|
1130
|
-
* @description: getChannelConfig
|
|
1499
|
+
* @description: getChannelConfig - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getChannelConfig/).
|
|
1131
1500
|
*/
|
|
1132
|
-
async getChannelConfig(
|
|
1133
|
-
|
|
1501
|
+
async getChannelConfig(
|
|
1502
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
1503
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1504
|
+
) {
|
|
1505
|
+
const { error } = OrderPlatformValidator.getChannelConfig().validate(
|
|
1134
1506
|
{},
|
|
1135
1507
|
{ abortEarly: false, allowUnknown: true }
|
|
1136
1508
|
);
|
|
@@ -1139,16 +1511,17 @@ class Order {
|
|
|
1139
1511
|
}
|
|
1140
1512
|
|
|
1141
1513
|
// Showing warrnings if extra unknown parameters are found
|
|
1142
|
-
const {
|
|
1514
|
+
const {
|
|
1515
|
+
error: warrning,
|
|
1516
|
+
} = OrderPlatformValidator.getChannelConfig().validate(
|
|
1143
1517
|
{},
|
|
1144
1518
|
{ abortEarly: false, allowUnknown: false }
|
|
1145
1519
|
);
|
|
1146
1520
|
if (warrning) {
|
|
1147
1521
|
Logger({
|
|
1148
1522
|
level: "WARN",
|
|
1149
|
-
message:
|
|
1523
|
+
message: `Parameter Validation warrnings for platform > Order > getChannelConfig \n ${warrning}`,
|
|
1150
1524
|
});
|
|
1151
|
-
Logger({ level: "WARN", message: warrning });
|
|
1152
1525
|
}
|
|
1153
1526
|
|
|
1154
1527
|
const query_params = {};
|
|
@@ -1161,12 +1534,18 @@ class Order {
|
|
|
1161
1534
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/order-config`,
|
|
1162
1535
|
query_params,
|
|
1163
1536
|
undefined,
|
|
1164
|
-
xHeaders
|
|
1537
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1538
|
+
{ responseHeaders }
|
|
1165
1539
|
);
|
|
1166
1540
|
|
|
1541
|
+
let responseData = response;
|
|
1542
|
+
if (responseHeaders) {
|
|
1543
|
+
responseData = response[0];
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1167
1546
|
const {
|
|
1168
1547
|
error: res_error,
|
|
1169
|
-
} =
|
|
1548
|
+
} = OrderPlatformModel.CreateChannelConfigData().validate(responseData, {
|
|
1170
1549
|
abortEarly: false,
|
|
1171
1550
|
allowUnknown: false,
|
|
1172
1551
|
});
|
|
@@ -1174,53 +1553,45 @@ class Order {
|
|
|
1174
1553
|
if (res_error) {
|
|
1175
1554
|
Logger({
|
|
1176
1555
|
level: "WARN",
|
|
1177
|
-
message:
|
|
1556
|
+
message: `Response Validation Warnnings for platform > Order > getChannelConfig \n ${res_error}`,
|
|
1178
1557
|
});
|
|
1179
|
-
Logger({ level: "WARN", message: res_error });
|
|
1180
1558
|
}
|
|
1181
1559
|
|
|
1182
1560
|
return response;
|
|
1183
1561
|
}
|
|
1184
1562
|
|
|
1185
1563
|
/**
|
|
1186
|
-
* @param {
|
|
1187
|
-
* @param {
|
|
1188
|
-
* @param {
|
|
1189
|
-
* @
|
|
1190
|
-
* @
|
|
1191
|
-
* @param {string} [arg.dpIds] - Comma separated values of delivery partner ids
|
|
1192
|
-
* @param {string} [arg.stores] - Comma separated values of store ids
|
|
1193
|
-
* @param {string} [arg.salesChannels] -
|
|
1194
|
-
* @param {string} [arg.paymentMode] - Comma separated values of payment modes
|
|
1195
|
-
* @param {string} [arg.bagStatus] - Comma separated values of bag statuses
|
|
1196
|
-
* @param {string} [arg.searchType] -
|
|
1197
|
-
* @param {string} [arg.searchValue] -
|
|
1198
|
-
* @param {string} [arg.tags] -
|
|
1199
|
-
* @param {string} [arg.timeToDispatch] -
|
|
1200
|
-
* @param {string} [arg.paymentMethods] -
|
|
1201
|
-
* @param {boolean} [arg.myOrders] -
|
|
1202
|
-
* @returns {Promise<LaneConfigResponse>} - Success response
|
|
1564
|
+
* @param {OrderPlatformValidator.GetLaneConfigParam} arg - Arg object
|
|
1565
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1566
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1567
|
+
* @returns {Promise<OrderPlatformModel.LaneConfigResponse>} - Success response
|
|
1568
|
+
* @name getLaneConfig
|
|
1203
1569
|
* @summary:
|
|
1204
|
-
* @description:
|
|
1570
|
+
* @description: Get lane config for the order - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getLaneConfig/).
|
|
1205
1571
|
*/
|
|
1206
|
-
async getLaneConfig(
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1572
|
+
async getLaneConfig(
|
|
1573
|
+
{
|
|
1574
|
+
superLane,
|
|
1575
|
+
groupEntity,
|
|
1576
|
+
fromDate,
|
|
1577
|
+
toDate,
|
|
1578
|
+
dpIds,
|
|
1579
|
+
stores,
|
|
1580
|
+
salesChannels,
|
|
1581
|
+
paymentMode,
|
|
1582
|
+
bagStatus,
|
|
1583
|
+
searchType,
|
|
1584
|
+
searchValue,
|
|
1585
|
+
tags,
|
|
1586
|
+
timeToDispatch,
|
|
1587
|
+
paymentMethods,
|
|
1588
|
+
myOrders,
|
|
1589
|
+
showCrossCompanyData,
|
|
1590
|
+
requestHeaders,
|
|
1591
|
+
} = { requestHeaders: {} },
|
|
1592
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1593
|
+
) {
|
|
1594
|
+
const { error } = OrderPlatformValidator.getLaneConfig().validate(
|
|
1224
1595
|
{
|
|
1225
1596
|
superLane,
|
|
1226
1597
|
groupEntity,
|
|
@@ -1237,6 +1608,7 @@ class Order {
|
|
|
1237
1608
|
timeToDispatch,
|
|
1238
1609
|
paymentMethods,
|
|
1239
1610
|
myOrders,
|
|
1611
|
+
showCrossCompanyData,
|
|
1240
1612
|
},
|
|
1241
1613
|
{ abortEarly: false, allowUnknown: true }
|
|
1242
1614
|
);
|
|
@@ -1245,7 +1617,7 @@ class Order {
|
|
|
1245
1617
|
}
|
|
1246
1618
|
|
|
1247
1619
|
// Showing warrnings if extra unknown parameters are found
|
|
1248
|
-
const { error: warrning } =
|
|
1620
|
+
const { error: warrning } = OrderPlatformValidator.getLaneConfig().validate(
|
|
1249
1621
|
{
|
|
1250
1622
|
superLane,
|
|
1251
1623
|
groupEntity,
|
|
@@ -1262,15 +1634,15 @@ class Order {
|
|
|
1262
1634
|
timeToDispatch,
|
|
1263
1635
|
paymentMethods,
|
|
1264
1636
|
myOrders,
|
|
1637
|
+
showCrossCompanyData,
|
|
1265
1638
|
},
|
|
1266
1639
|
{ abortEarly: false, allowUnknown: false }
|
|
1267
1640
|
);
|
|
1268
1641
|
if (warrning) {
|
|
1269
1642
|
Logger({
|
|
1270
1643
|
level: "WARN",
|
|
1271
|
-
message:
|
|
1644
|
+
message: `Parameter Validation warrnings for platform > Order > getLaneConfig \n ${warrning}`,
|
|
1272
1645
|
});
|
|
1273
|
-
Logger({ level: "WARN", message: warrning });
|
|
1274
1646
|
}
|
|
1275
1647
|
|
|
1276
1648
|
const query_params = {};
|
|
@@ -1289,6 +1661,7 @@ class Order {
|
|
|
1289
1661
|
query_params["time_to_dispatch"] = timeToDispatch;
|
|
1290
1662
|
query_params["payment_methods"] = paymentMethods;
|
|
1291
1663
|
query_params["my_orders"] = myOrders;
|
|
1664
|
+
query_params["show_cross_company_data"] = showCrossCompanyData;
|
|
1292
1665
|
|
|
1293
1666
|
const xHeaders = {};
|
|
1294
1667
|
|
|
@@ -1298,12 +1671,18 @@ class Order {
|
|
|
1298
1671
|
`/service/platform/order/v1.0/company/${this.config.companyId}/lane-config/`,
|
|
1299
1672
|
query_params,
|
|
1300
1673
|
undefined,
|
|
1301
|
-
xHeaders
|
|
1674
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1675
|
+
{ responseHeaders }
|
|
1302
1676
|
);
|
|
1303
1677
|
|
|
1678
|
+
let responseData = response;
|
|
1679
|
+
if (responseHeaders) {
|
|
1680
|
+
responseData = response[0];
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1304
1683
|
const {
|
|
1305
1684
|
error: res_error,
|
|
1306
|
-
} =
|
|
1685
|
+
} = OrderPlatformModel.LaneConfigResponse().validate(responseData, {
|
|
1307
1686
|
abortEarly: false,
|
|
1308
1687
|
allowUnknown: false,
|
|
1309
1688
|
});
|
|
@@ -1311,23 +1690,27 @@ class Order {
|
|
|
1311
1690
|
if (res_error) {
|
|
1312
1691
|
Logger({
|
|
1313
1692
|
level: "WARN",
|
|
1314
|
-
message:
|
|
1693
|
+
message: `Response Validation Warnnings for platform > Order > getLaneConfig \n ${res_error}`,
|
|
1315
1694
|
});
|
|
1316
|
-
Logger({ level: "WARN", message: res_error });
|
|
1317
1695
|
}
|
|
1318
1696
|
|
|
1319
1697
|
return response;
|
|
1320
1698
|
}
|
|
1321
1699
|
|
|
1322
1700
|
/**
|
|
1323
|
-
* @param {
|
|
1324
|
-
* @param {
|
|
1325
|
-
* @
|
|
1701
|
+
* @param {OrderPlatformValidator.GetOrderByIdParam} arg - Arg object
|
|
1702
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1703
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1704
|
+
* @returns {Promise<OrderPlatformModel.OrderDetailsResponse>} - Success response
|
|
1705
|
+
* @name getOrderById
|
|
1326
1706
|
* @summary:
|
|
1327
|
-
* @description:
|
|
1707
|
+
* @description: Get Order Details by ID - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getOrderById/).
|
|
1328
1708
|
*/
|
|
1329
|
-
async getOrderById(
|
|
1330
|
-
|
|
1709
|
+
async getOrderById(
|
|
1710
|
+
{ orderId, requestHeaders } = { requestHeaders: {} },
|
|
1711
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1712
|
+
) {
|
|
1713
|
+
const { error } = OrderPlatformValidator.getOrderById().validate(
|
|
1331
1714
|
{
|
|
1332
1715
|
orderId,
|
|
1333
1716
|
},
|
|
@@ -1338,7 +1721,7 @@ class Order {
|
|
|
1338
1721
|
}
|
|
1339
1722
|
|
|
1340
1723
|
// Showing warrnings if extra unknown parameters are found
|
|
1341
|
-
const { error: warrning } =
|
|
1724
|
+
const { error: warrning } = OrderPlatformValidator.getOrderById().validate(
|
|
1342
1725
|
{
|
|
1343
1726
|
orderId,
|
|
1344
1727
|
},
|
|
@@ -1347,9 +1730,8 @@ class Order {
|
|
|
1347
1730
|
if (warrning) {
|
|
1348
1731
|
Logger({
|
|
1349
1732
|
level: "WARN",
|
|
1350
|
-
message:
|
|
1733
|
+
message: `Parameter Validation warrnings for platform > Order > getOrderById \n ${warrning}`,
|
|
1351
1734
|
});
|
|
1352
|
-
Logger({ level: "WARN", message: warrning });
|
|
1353
1735
|
}
|
|
1354
1736
|
|
|
1355
1737
|
const query_params = {};
|
|
@@ -1363,12 +1745,18 @@ class Order {
|
|
|
1363
1745
|
`/service/platform/order/v1.0/company/${this.config.companyId}/order-details`,
|
|
1364
1746
|
query_params,
|
|
1365
1747
|
undefined,
|
|
1366
|
-
xHeaders
|
|
1748
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1749
|
+
{ responseHeaders }
|
|
1367
1750
|
);
|
|
1368
1751
|
|
|
1752
|
+
let responseData = response;
|
|
1753
|
+
if (responseHeaders) {
|
|
1754
|
+
responseData = response[0];
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1369
1757
|
const {
|
|
1370
1758
|
error: res_error,
|
|
1371
|
-
} =
|
|
1759
|
+
} = OrderPlatformModel.OrderDetailsResponse().validate(responseData, {
|
|
1372
1760
|
abortEarly: false,
|
|
1373
1761
|
allowUnknown: false,
|
|
1374
1762
|
});
|
|
@@ -1376,63 +1764,48 @@ class Order {
|
|
|
1376
1764
|
if (res_error) {
|
|
1377
1765
|
Logger({
|
|
1378
1766
|
level: "WARN",
|
|
1379
|
-
message:
|
|
1767
|
+
message: `Response Validation Warnnings for platform > Order > getOrderById \n ${res_error}`,
|
|
1380
1768
|
});
|
|
1381
|
-
Logger({ level: "WARN", message: res_error });
|
|
1382
1769
|
}
|
|
1383
1770
|
|
|
1384
1771
|
return response;
|
|
1385
1772
|
}
|
|
1386
1773
|
|
|
1387
1774
|
/**
|
|
1388
|
-
* @param {
|
|
1389
|
-
* @param {
|
|
1390
|
-
*
|
|
1391
|
-
* @
|
|
1392
|
-
*
|
|
1393
|
-
* @param {string} [arg.bagStatus] - Bag_status refers to status of the
|
|
1394
|
-
* entity. Filters orders based on the status.
|
|
1395
|
-
* @param {string} [arg.timeToDispatch] - Time_to_dispatch refers to
|
|
1396
|
-
* estimated SLA time.
|
|
1397
|
-
* @param {string} [arg.paymentMethods] -
|
|
1398
|
-
* @param {string} [arg.tags] - Tags refers to additional descriptive labels
|
|
1399
|
-
* associated with the order
|
|
1400
|
-
* @param {string} [arg.searchValue] - Search_value is matched against the
|
|
1401
|
-
* field specified by the search_type
|
|
1402
|
-
* @param {string} [arg.fromDate] -
|
|
1403
|
-
* @param {string} [arg.toDate] -
|
|
1404
|
-
* @param {string} [arg.dpIds] - Delivery Partner IDs to which shipments are assigned.
|
|
1405
|
-
* @param {string} [arg.stores] -
|
|
1406
|
-
* @param {string} [arg.salesChannels] -
|
|
1407
|
-
* @param {number} [arg.pageNo] -
|
|
1408
|
-
* @param {number} [arg.pageSize] -
|
|
1409
|
-
* @param {boolean} [arg.isPrioritySort] -
|
|
1410
|
-
* @param {string} [arg.customMeta] -
|
|
1411
|
-
* @param {boolean} [arg.myOrders] -
|
|
1412
|
-
* @returns {Promise<OrderListingResponse>} - Success response
|
|
1775
|
+
* @param {OrderPlatformValidator.GetOrdersParam} arg - Arg object
|
|
1776
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1777
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1778
|
+
* @returns {Promise<OrderPlatformModel.OrderListingResponse>} - Success response
|
|
1779
|
+
* @name getOrders
|
|
1413
1780
|
* @summary:
|
|
1414
|
-
* @description:
|
|
1781
|
+
* @description: Get Orders Listing - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getOrders/).
|
|
1415
1782
|
*/
|
|
1416
|
-
async getOrders(
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1783
|
+
async getOrders(
|
|
1784
|
+
{
|
|
1785
|
+
lane,
|
|
1786
|
+
searchType,
|
|
1787
|
+
bagStatus,
|
|
1788
|
+
timeToDispatch,
|
|
1789
|
+
paymentMethods,
|
|
1790
|
+
tags,
|
|
1791
|
+
searchValue,
|
|
1792
|
+
fromDate,
|
|
1793
|
+
toDate,
|
|
1794
|
+
dpIds,
|
|
1795
|
+
stores,
|
|
1796
|
+
salesChannels,
|
|
1797
|
+
pageNo,
|
|
1798
|
+
pageSize,
|
|
1799
|
+
isPrioritySort,
|
|
1800
|
+
customMeta,
|
|
1801
|
+
myOrders,
|
|
1802
|
+
showCrossCompanyData,
|
|
1803
|
+
customerId,
|
|
1804
|
+
requestHeaders,
|
|
1805
|
+
} = { requestHeaders: {} },
|
|
1806
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1807
|
+
) {
|
|
1808
|
+
const { error } = OrderPlatformValidator.getOrders().validate(
|
|
1436
1809
|
{
|
|
1437
1810
|
lane,
|
|
1438
1811
|
searchType,
|
|
@@ -1451,6 +1824,8 @@ class Order {
|
|
|
1451
1824
|
isPrioritySort,
|
|
1452
1825
|
customMeta,
|
|
1453
1826
|
myOrders,
|
|
1827
|
+
showCrossCompanyData,
|
|
1828
|
+
customerId,
|
|
1454
1829
|
},
|
|
1455
1830
|
{ abortEarly: false, allowUnknown: true }
|
|
1456
1831
|
);
|
|
@@ -1459,7 +1834,7 @@ class Order {
|
|
|
1459
1834
|
}
|
|
1460
1835
|
|
|
1461
1836
|
// Showing warrnings if extra unknown parameters are found
|
|
1462
|
-
const { error: warrning } =
|
|
1837
|
+
const { error: warrning } = OrderPlatformValidator.getOrders().validate(
|
|
1463
1838
|
{
|
|
1464
1839
|
lane,
|
|
1465
1840
|
searchType,
|
|
@@ -1478,15 +1853,16 @@ class Order {
|
|
|
1478
1853
|
isPrioritySort,
|
|
1479
1854
|
customMeta,
|
|
1480
1855
|
myOrders,
|
|
1856
|
+
showCrossCompanyData,
|
|
1857
|
+
customerId,
|
|
1481
1858
|
},
|
|
1482
1859
|
{ abortEarly: false, allowUnknown: false }
|
|
1483
1860
|
);
|
|
1484
1861
|
if (warrning) {
|
|
1485
1862
|
Logger({
|
|
1486
1863
|
level: "WARN",
|
|
1487
|
-
message:
|
|
1864
|
+
message: `Parameter Validation warrnings for platform > Order > getOrders \n ${warrning}`,
|
|
1488
1865
|
});
|
|
1489
|
-
Logger({ level: "WARN", message: warrning });
|
|
1490
1866
|
}
|
|
1491
1867
|
|
|
1492
1868
|
const query_params = {};
|
|
@@ -1507,6 +1883,8 @@ class Order {
|
|
|
1507
1883
|
query_params["is_priority_sort"] = isPrioritySort;
|
|
1508
1884
|
query_params["custom_meta"] = customMeta;
|
|
1509
1885
|
query_params["my_orders"] = myOrders;
|
|
1886
|
+
query_params["show_cross_company_data"] = showCrossCompanyData;
|
|
1887
|
+
query_params["customer_id"] = customerId;
|
|
1510
1888
|
|
|
1511
1889
|
const xHeaders = {};
|
|
1512
1890
|
|
|
@@ -1516,12 +1894,18 @@ class Order {
|
|
|
1516
1894
|
`/service/platform/order/v1.0/company/${this.config.companyId}/orders-listing`,
|
|
1517
1895
|
query_params,
|
|
1518
1896
|
undefined,
|
|
1519
|
-
xHeaders
|
|
1897
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1898
|
+
{ responseHeaders }
|
|
1520
1899
|
);
|
|
1521
1900
|
|
|
1901
|
+
let responseData = response;
|
|
1902
|
+
if (responseHeaders) {
|
|
1903
|
+
responseData = response[0];
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1522
1906
|
const {
|
|
1523
1907
|
error: res_error,
|
|
1524
|
-
} =
|
|
1908
|
+
} = OrderPlatformModel.OrderListingResponse().validate(responseData, {
|
|
1525
1909
|
abortEarly: false,
|
|
1526
1910
|
allowUnknown: false,
|
|
1527
1911
|
});
|
|
@@ -1529,22 +1913,27 @@ class Order {
|
|
|
1529
1913
|
if (res_error) {
|
|
1530
1914
|
Logger({
|
|
1531
1915
|
level: "WARN",
|
|
1532
|
-
message:
|
|
1916
|
+
message: `Response Validation Warnnings for platform > Order > getOrders \n ${res_error}`,
|
|
1533
1917
|
});
|
|
1534
|
-
Logger({ level: "WARN", message: res_error });
|
|
1535
1918
|
}
|
|
1536
1919
|
|
|
1537
1920
|
return response;
|
|
1538
1921
|
}
|
|
1539
1922
|
|
|
1540
1923
|
/**
|
|
1541
|
-
* @param {
|
|
1542
|
-
* @
|
|
1924
|
+
* @param {OrderPlatformValidator.GetRoleBasedActionsParam} arg - Arg object
|
|
1925
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1926
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1927
|
+
* @returns {Promise<OrderPlatformModel.GetActionsResponse>} - Success response
|
|
1928
|
+
* @name getRoleBasedActions
|
|
1543
1929
|
* @summary:
|
|
1544
|
-
* @description:
|
|
1930
|
+
* @description: Get Role Based Actions - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getRoleBasedActions/).
|
|
1545
1931
|
*/
|
|
1546
|
-
async getRoleBasedActions(
|
|
1547
|
-
|
|
1932
|
+
async getRoleBasedActions(
|
|
1933
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
1934
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
1935
|
+
) {
|
|
1936
|
+
const { error } = OrderPlatformValidator.getRoleBasedActions().validate(
|
|
1548
1937
|
{},
|
|
1549
1938
|
{ abortEarly: false, allowUnknown: true }
|
|
1550
1939
|
);
|
|
@@ -1553,16 +1942,17 @@ class Order {
|
|
|
1553
1942
|
}
|
|
1554
1943
|
|
|
1555
1944
|
// Showing warrnings if extra unknown parameters are found
|
|
1556
|
-
const {
|
|
1945
|
+
const {
|
|
1946
|
+
error: warrning,
|
|
1947
|
+
} = OrderPlatformValidator.getRoleBasedActions().validate(
|
|
1557
1948
|
{},
|
|
1558
1949
|
{ abortEarly: false, allowUnknown: false }
|
|
1559
1950
|
);
|
|
1560
1951
|
if (warrning) {
|
|
1561
1952
|
Logger({
|
|
1562
1953
|
level: "WARN",
|
|
1563
|
-
message:
|
|
1954
|
+
message: `Parameter Validation warrnings for platform > Order > getRoleBasedActions \n ${warrning}`,
|
|
1564
1955
|
});
|
|
1565
|
-
Logger({ level: "WARN", message: warrning });
|
|
1566
1956
|
}
|
|
1567
1957
|
|
|
1568
1958
|
const query_params = {};
|
|
@@ -1575,12 +1965,18 @@ class Order {
|
|
|
1575
1965
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/roles`,
|
|
1576
1966
|
query_params,
|
|
1577
1967
|
undefined,
|
|
1578
|
-
xHeaders
|
|
1968
|
+
{ ...xHeaders, ...requestHeaders },
|
|
1969
|
+
{ responseHeaders }
|
|
1579
1970
|
);
|
|
1580
1971
|
|
|
1972
|
+
let responseData = response;
|
|
1973
|
+
if (responseHeaders) {
|
|
1974
|
+
responseData = response[0];
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1581
1977
|
const {
|
|
1582
1978
|
error: res_error,
|
|
1583
|
-
} =
|
|
1979
|
+
} = OrderPlatformModel.GetActionsResponse().validate(responseData, {
|
|
1584
1980
|
abortEarly: false,
|
|
1585
1981
|
allowUnknown: false,
|
|
1586
1982
|
});
|
|
@@ -1588,24 +1984,27 @@ class Order {
|
|
|
1588
1984
|
if (res_error) {
|
|
1589
1985
|
Logger({
|
|
1590
1986
|
level: "WARN",
|
|
1591
|
-
message:
|
|
1987
|
+
message: `Response Validation Warnnings for platform > Order > getRoleBasedActions \n ${res_error}`,
|
|
1592
1988
|
});
|
|
1593
|
-
Logger({ level: "WARN", message: res_error });
|
|
1594
1989
|
}
|
|
1595
1990
|
|
|
1596
1991
|
return response;
|
|
1597
1992
|
}
|
|
1598
1993
|
|
|
1599
1994
|
/**
|
|
1600
|
-
* @param {
|
|
1601
|
-
* @param {
|
|
1602
|
-
* @param {
|
|
1603
|
-
* @returns {Promise<ShipmentInfoResponse>} - Success response
|
|
1995
|
+
* @param {OrderPlatformValidator.GetShipmentByIdParam} arg - Arg object
|
|
1996
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
1997
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
1998
|
+
* @returns {Promise<OrderPlatformModel.ShipmentInfoResponse>} - Success response
|
|
1999
|
+
* @name getShipmentById
|
|
1604
2000
|
* @summary:
|
|
1605
|
-
* @description:
|
|
2001
|
+
* @description: Get shipment details for the given shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipmentById/).
|
|
1606
2002
|
*/
|
|
1607
|
-
async getShipmentById(
|
|
1608
|
-
|
|
2003
|
+
async getShipmentById(
|
|
2004
|
+
{ channelShipmentId, shipmentId, requestHeaders } = { requestHeaders: {} },
|
|
2005
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2006
|
+
) {
|
|
2007
|
+
const { error } = OrderPlatformValidator.getShipmentById().validate(
|
|
1609
2008
|
{
|
|
1610
2009
|
channelShipmentId,
|
|
1611
2010
|
shipmentId,
|
|
@@ -1617,7 +2016,9 @@ class Order {
|
|
|
1617
2016
|
}
|
|
1618
2017
|
|
|
1619
2018
|
// Showing warrnings if extra unknown parameters are found
|
|
1620
|
-
const {
|
|
2019
|
+
const {
|
|
2020
|
+
error: warrning,
|
|
2021
|
+
} = OrderPlatformValidator.getShipmentById().validate(
|
|
1621
2022
|
{
|
|
1622
2023
|
channelShipmentId,
|
|
1623
2024
|
shipmentId,
|
|
@@ -1627,9 +2028,8 @@ class Order {
|
|
|
1627
2028
|
if (warrning) {
|
|
1628
2029
|
Logger({
|
|
1629
2030
|
level: "WARN",
|
|
1630
|
-
message:
|
|
2031
|
+
message: `Parameter Validation warrnings for platform > Order > getShipmentById \n ${warrning}`,
|
|
1631
2032
|
});
|
|
1632
|
-
Logger({ level: "WARN", message: warrning });
|
|
1633
2033
|
}
|
|
1634
2034
|
|
|
1635
2035
|
const query_params = {};
|
|
@@ -1644,12 +2044,18 @@ class Order {
|
|
|
1644
2044
|
`/service/platform/order/v1.0/company/${this.config.companyId}/shipment-details`,
|
|
1645
2045
|
query_params,
|
|
1646
2046
|
undefined,
|
|
1647
|
-
xHeaders
|
|
2047
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2048
|
+
{ responseHeaders }
|
|
1648
2049
|
);
|
|
1649
2050
|
|
|
2051
|
+
let responseData = response;
|
|
2052
|
+
if (responseHeaders) {
|
|
2053
|
+
responseData = response[0];
|
|
2054
|
+
}
|
|
2055
|
+
|
|
1650
2056
|
const {
|
|
1651
2057
|
error: res_error,
|
|
1652
|
-
} =
|
|
2058
|
+
} = OrderPlatformModel.ShipmentInfoResponse().validate(responseData, {
|
|
1653
2059
|
abortEarly: false,
|
|
1654
2060
|
allowUnknown: false,
|
|
1655
2061
|
});
|
|
@@ -1657,24 +2063,27 @@ class Order {
|
|
|
1657
2063
|
if (res_error) {
|
|
1658
2064
|
Logger({
|
|
1659
2065
|
level: "WARN",
|
|
1660
|
-
message:
|
|
2066
|
+
message: `Response Validation Warnnings for platform > Order > getShipmentById \n ${res_error}`,
|
|
1661
2067
|
});
|
|
1662
|
-
Logger({ level: "WARN", message: res_error });
|
|
1663
2068
|
}
|
|
1664
2069
|
|
|
1665
2070
|
return response;
|
|
1666
2071
|
}
|
|
1667
2072
|
|
|
1668
2073
|
/**
|
|
1669
|
-
* @param {
|
|
1670
|
-
* @param {
|
|
1671
|
-
* @param {
|
|
1672
|
-
* @returns {Promise<ShipmentHistoryResponse>} - Success response
|
|
2074
|
+
* @param {OrderPlatformValidator.GetShipmentHistoryParam} arg - Arg object
|
|
2075
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2076
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2077
|
+
* @returns {Promise<OrderPlatformModel.ShipmentHistoryResponse>} - Success response
|
|
2078
|
+
* @name getShipmentHistory
|
|
1673
2079
|
* @summary:
|
|
1674
|
-
* @description:
|
|
2080
|
+
* @description: Get Shipment History - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipmentHistory/).
|
|
1675
2081
|
*/
|
|
1676
|
-
async getShipmentHistory(
|
|
1677
|
-
|
|
2082
|
+
async getShipmentHistory(
|
|
2083
|
+
{ shipmentId, bagId, requestHeaders } = { requestHeaders: {} },
|
|
2084
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2085
|
+
) {
|
|
2086
|
+
const { error } = OrderPlatformValidator.getShipmentHistory().validate(
|
|
1678
2087
|
{
|
|
1679
2088
|
shipmentId,
|
|
1680
2089
|
bagId,
|
|
@@ -1686,7 +2095,9 @@ class Order {
|
|
|
1686
2095
|
}
|
|
1687
2096
|
|
|
1688
2097
|
// Showing warrnings if extra unknown parameters are found
|
|
1689
|
-
const {
|
|
2098
|
+
const {
|
|
2099
|
+
error: warrning,
|
|
2100
|
+
} = OrderPlatformValidator.getShipmentHistory().validate(
|
|
1690
2101
|
{
|
|
1691
2102
|
shipmentId,
|
|
1692
2103
|
bagId,
|
|
@@ -1696,9 +2107,8 @@ class Order {
|
|
|
1696
2107
|
if (warrning) {
|
|
1697
2108
|
Logger({
|
|
1698
2109
|
level: "WARN",
|
|
1699
|
-
message:
|
|
2110
|
+
message: `Parameter Validation warrnings for platform > Order > getShipmentHistory \n ${warrning}`,
|
|
1700
2111
|
});
|
|
1701
|
-
Logger({ level: "WARN", message: warrning });
|
|
1702
2112
|
}
|
|
1703
2113
|
|
|
1704
2114
|
const query_params = {};
|
|
@@ -1713,12 +2123,18 @@ class Order {
|
|
|
1713
2123
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/shipment/history`,
|
|
1714
2124
|
query_params,
|
|
1715
2125
|
undefined,
|
|
1716
|
-
xHeaders
|
|
2126
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2127
|
+
{ responseHeaders }
|
|
1717
2128
|
);
|
|
1718
2129
|
|
|
2130
|
+
let responseData = response;
|
|
2131
|
+
if (responseHeaders) {
|
|
2132
|
+
responseData = response[0];
|
|
2133
|
+
}
|
|
2134
|
+
|
|
1719
2135
|
const {
|
|
1720
2136
|
error: res_error,
|
|
1721
|
-
} =
|
|
2137
|
+
} = OrderPlatformModel.ShipmentHistoryResponse().validate(responseData, {
|
|
1722
2138
|
abortEarly: false,
|
|
1723
2139
|
allowUnknown: false,
|
|
1724
2140
|
});
|
|
@@ -1726,28 +2142,28 @@ class Order {
|
|
|
1726
2142
|
if (res_error) {
|
|
1727
2143
|
Logger({
|
|
1728
2144
|
level: "WARN",
|
|
1729
|
-
message:
|
|
2145
|
+
message: `Response Validation Warnnings for platform > Order > getShipmentHistory \n ${res_error}`,
|
|
1730
2146
|
});
|
|
1731
|
-
Logger({ level: "WARN", message: res_error });
|
|
1732
2147
|
}
|
|
1733
2148
|
|
|
1734
2149
|
return response;
|
|
1735
2150
|
}
|
|
1736
2151
|
|
|
1737
2152
|
/**
|
|
1738
|
-
* @param {
|
|
1739
|
-
* @param {
|
|
1740
|
-
*
|
|
1741
|
-
*
|
|
1742
|
-
*
|
|
1743
|
-
*
|
|
1744
|
-
* @param {string} arg.state - State for which reasons are required.
|
|
1745
|
-
* @returns {Promise<PlatformShipmentReasonsResponse>} - Success response
|
|
2153
|
+
* @param {OrderPlatformValidator.GetShipmentReasonsParam} arg - Arg object
|
|
2154
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2155
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2156
|
+
* @returns {Promise<OrderPlatformModel.PlatformShipmentReasonsResponse>} -
|
|
2157
|
+
* Success response
|
|
2158
|
+
* @name getShipmentReasons
|
|
1746
2159
|
* @summary: Get reasons behind full or partial cancellation of a shipment
|
|
1747
|
-
* @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
|
|
2160
|
+
* @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipmentReasons/).
|
|
1748
2161
|
*/
|
|
1749
|
-
async getShipmentReasons(
|
|
1750
|
-
|
|
2162
|
+
async getShipmentReasons(
|
|
2163
|
+
{ shipmentId, bagId, state, requestHeaders } = { requestHeaders: {} },
|
|
2164
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2165
|
+
) {
|
|
2166
|
+
const { error } = OrderPlatformValidator.getShipmentReasons().validate(
|
|
1751
2167
|
{
|
|
1752
2168
|
shipmentId,
|
|
1753
2169
|
bagId,
|
|
@@ -1760,7 +2176,9 @@ class Order {
|
|
|
1760
2176
|
}
|
|
1761
2177
|
|
|
1762
2178
|
// Showing warrnings if extra unknown parameters are found
|
|
1763
|
-
const {
|
|
2179
|
+
const {
|
|
2180
|
+
error: warrning,
|
|
2181
|
+
} = OrderPlatformValidator.getShipmentReasons().validate(
|
|
1764
2182
|
{
|
|
1765
2183
|
shipmentId,
|
|
1766
2184
|
bagId,
|
|
@@ -1771,9 +2189,8 @@ class Order {
|
|
|
1771
2189
|
if (warrning) {
|
|
1772
2190
|
Logger({
|
|
1773
2191
|
level: "WARN",
|
|
1774
|
-
message:
|
|
2192
|
+
message: `Parameter Validation warrnings for platform > Order > getShipmentReasons \n ${warrning}`,
|
|
1775
2193
|
});
|
|
1776
|
-
Logger({ level: "WARN", message: warrning });
|
|
1777
2194
|
}
|
|
1778
2195
|
|
|
1779
2196
|
const query_params = {};
|
|
@@ -1786,85 +2203,77 @@ class Order {
|
|
|
1786
2203
|
`/service/platform/order/v1.0/company/${this.config.companyId}/shipments/${shipmentId}/bags/${bagId}/state/${state}/reasons`,
|
|
1787
2204
|
query_params,
|
|
1788
2205
|
undefined,
|
|
1789
|
-
xHeaders
|
|
2206
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2207
|
+
{ responseHeaders }
|
|
1790
2208
|
);
|
|
1791
2209
|
|
|
2210
|
+
let responseData = response;
|
|
2211
|
+
if (responseHeaders) {
|
|
2212
|
+
responseData = response[0];
|
|
2213
|
+
}
|
|
2214
|
+
|
|
1792
2215
|
const {
|
|
1793
2216
|
error: res_error,
|
|
1794
|
-
} =
|
|
1795
|
-
|
|
1796
|
-
allowUnknown: false
|
|
1797
|
-
|
|
2217
|
+
} = OrderPlatformModel.PlatformShipmentReasonsResponse().validate(
|
|
2218
|
+
responseData,
|
|
2219
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2220
|
+
);
|
|
1798
2221
|
|
|
1799
2222
|
if (res_error) {
|
|
1800
2223
|
Logger({
|
|
1801
2224
|
level: "WARN",
|
|
1802
|
-
message:
|
|
2225
|
+
message: `Response Validation Warnnings for platform > Order > getShipmentReasons \n ${res_error}`,
|
|
1803
2226
|
});
|
|
1804
|
-
Logger({ level: "WARN", message: res_error });
|
|
1805
2227
|
}
|
|
1806
2228
|
|
|
1807
2229
|
return response;
|
|
1808
2230
|
}
|
|
1809
2231
|
|
|
1810
2232
|
/**
|
|
1811
|
-
* @param {
|
|
1812
|
-
* @param {
|
|
1813
|
-
* @param {
|
|
1814
|
-
* @
|
|
1815
|
-
*
|
|
1816
|
-
*
|
|
1817
|
-
* @
|
|
1818
|
-
* @param {string} [arg.searchValue] - Search type value
|
|
1819
|
-
* @param {string} [arg.fromDate] - Start Date in DD-MM-YYYY format
|
|
1820
|
-
* @param {string} [arg.toDate] - End Date in DD-MM-YYYY format
|
|
1821
|
-
* @param {string} [arg.dpIds] - Comma separated values of delivery partner ids
|
|
1822
|
-
* @param {string} [arg.stores] - Comma separated values of store ids
|
|
1823
|
-
* @param {string} [arg.salesChannels] - Comma separated values of sales channel ids
|
|
1824
|
-
* @param {number} [arg.pageNo] - Page number for paginated data
|
|
1825
|
-
* @param {number} [arg.pageSize] - Page size of data received per page
|
|
1826
|
-
* @param {boolean} [arg.fetchActiveShipment] - Flag to fetch active shipments
|
|
1827
|
-
* @param {boolean} [arg.excludeLockedShipments] - Flag to fetch locked shipments
|
|
1828
|
-
* @param {string} [arg.paymentMethods] - Comma separated values of payment methods
|
|
1829
|
-
* @param {string} [arg.channelShipmentId] - App Shipment Id
|
|
1830
|
-
* @param {string} [arg.channelOrderId] - App Order Id
|
|
1831
|
-
* @param {string} [arg.customMeta] -
|
|
1832
|
-
* @param {string} [arg.orderingChannel] -
|
|
1833
|
-
* @param {string} [arg.companyAffiliateTag] -
|
|
1834
|
-
* @param {boolean} [arg.myOrders] -
|
|
1835
|
-
* @param {string} [arg.platformUserId] -
|
|
1836
|
-
* @param {string} [arg.tags] - Comma separated values of tags
|
|
1837
|
-
* @returns {Promise<ShipmentInternalPlatformViewResponse>} - Success response
|
|
2233
|
+
* @param {OrderPlatformValidator.GetShipmentsParam} arg - Arg object
|
|
2234
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2235
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2236
|
+
* @returns {Promise<OrderPlatformModel.ShipmentInternalPlatformViewResponse>}
|
|
2237
|
+
* - Success response
|
|
2238
|
+
*
|
|
2239
|
+
* @name getShipments
|
|
1838
2240
|
* @summary:
|
|
1839
|
-
* @description:
|
|
2241
|
+
* @description: Get Shipments Listing for the company id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipments/).
|
|
1840
2242
|
*/
|
|
1841
|
-
async getShipments(
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
2243
|
+
async getShipments(
|
|
2244
|
+
{
|
|
2245
|
+
lane,
|
|
2246
|
+
bagStatus,
|
|
2247
|
+
statusOverrideLane,
|
|
2248
|
+
timeToDispatch,
|
|
2249
|
+
searchType,
|
|
2250
|
+
searchValue,
|
|
2251
|
+
fromDate,
|
|
2252
|
+
toDate,
|
|
2253
|
+
dpIds,
|
|
2254
|
+
stores,
|
|
2255
|
+
salesChannels,
|
|
2256
|
+
pageNo,
|
|
2257
|
+
pageSize,
|
|
2258
|
+
fetchActiveShipment,
|
|
2259
|
+
excludeLockedShipments,
|
|
2260
|
+
paymentMethods,
|
|
2261
|
+
channelShipmentId,
|
|
2262
|
+
channelOrderId,
|
|
2263
|
+
customMeta,
|
|
2264
|
+
orderingChannel,
|
|
2265
|
+
companyAffiliateTag,
|
|
2266
|
+
myOrders,
|
|
2267
|
+
platformUserId,
|
|
2268
|
+
sortType,
|
|
2269
|
+
showCrossCompanyData,
|
|
2270
|
+
tags,
|
|
2271
|
+
customerId,
|
|
2272
|
+
requestHeaders,
|
|
2273
|
+
} = { requestHeaders: {} },
|
|
2274
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2275
|
+
) {
|
|
2276
|
+
const { error } = OrderPlatformValidator.getShipments().validate(
|
|
1868
2277
|
{
|
|
1869
2278
|
lane,
|
|
1870
2279
|
bagStatus,
|
|
@@ -1889,7 +2298,10 @@ class Order {
|
|
|
1889
2298
|
companyAffiliateTag,
|
|
1890
2299
|
myOrders,
|
|
1891
2300
|
platformUserId,
|
|
2301
|
+
sortType,
|
|
2302
|
+
showCrossCompanyData,
|
|
1892
2303
|
tags,
|
|
2304
|
+
customerId,
|
|
1893
2305
|
},
|
|
1894
2306
|
{ abortEarly: false, allowUnknown: true }
|
|
1895
2307
|
);
|
|
@@ -1898,7 +2310,7 @@ class Order {
|
|
|
1898
2310
|
}
|
|
1899
2311
|
|
|
1900
2312
|
// Showing warrnings if extra unknown parameters are found
|
|
1901
|
-
const { error: warrning } =
|
|
2313
|
+
const { error: warrning } = OrderPlatformValidator.getShipments().validate(
|
|
1902
2314
|
{
|
|
1903
2315
|
lane,
|
|
1904
2316
|
bagStatus,
|
|
@@ -1923,16 +2335,18 @@ class Order {
|
|
|
1923
2335
|
companyAffiliateTag,
|
|
1924
2336
|
myOrders,
|
|
1925
2337
|
platformUserId,
|
|
2338
|
+
sortType,
|
|
2339
|
+
showCrossCompanyData,
|
|
1926
2340
|
tags,
|
|
2341
|
+
customerId,
|
|
1927
2342
|
},
|
|
1928
2343
|
{ abortEarly: false, allowUnknown: false }
|
|
1929
2344
|
);
|
|
1930
2345
|
if (warrning) {
|
|
1931
2346
|
Logger({
|
|
1932
2347
|
level: "WARN",
|
|
1933
|
-
message:
|
|
2348
|
+
message: `Parameter Validation warrnings for platform > Order > getShipments \n ${warrning}`,
|
|
1934
2349
|
});
|
|
1935
|
-
Logger({ level: "WARN", message: warrning });
|
|
1936
2350
|
}
|
|
1937
2351
|
|
|
1938
2352
|
const query_params = {};
|
|
@@ -1959,7 +2373,10 @@ class Order {
|
|
|
1959
2373
|
query_params["company_affiliate_tag"] = companyAffiliateTag;
|
|
1960
2374
|
query_params["my_orders"] = myOrders;
|
|
1961
2375
|
query_params["platform_user_id"] = platformUserId;
|
|
2376
|
+
query_params["sort_type"] = sortType;
|
|
2377
|
+
query_params["show_cross_company_data"] = showCrossCompanyData;
|
|
1962
2378
|
query_params["tags"] = tags;
|
|
2379
|
+
query_params["customer_id"] = customerId;
|
|
1963
2380
|
|
|
1964
2381
|
const xHeaders = {};
|
|
1965
2382
|
|
|
@@ -1969,35 +2386,46 @@ class Order {
|
|
|
1969
2386
|
`/service/platform/order/v1.0/company/${this.config.companyId}/shipments-listing`,
|
|
1970
2387
|
query_params,
|
|
1971
2388
|
undefined,
|
|
1972
|
-
xHeaders
|
|
2389
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2390
|
+
{ responseHeaders }
|
|
1973
2391
|
);
|
|
1974
2392
|
|
|
2393
|
+
let responseData = response;
|
|
2394
|
+
if (responseHeaders) {
|
|
2395
|
+
responseData = response[0];
|
|
2396
|
+
}
|
|
2397
|
+
|
|
1975
2398
|
const {
|
|
1976
2399
|
error: res_error,
|
|
1977
|
-
} =
|
|
1978
|
-
|
|
1979
|
-
allowUnknown: false
|
|
1980
|
-
|
|
2400
|
+
} = OrderPlatformModel.ShipmentInternalPlatformViewResponse().validate(
|
|
2401
|
+
responseData,
|
|
2402
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2403
|
+
);
|
|
1981
2404
|
|
|
1982
2405
|
if (res_error) {
|
|
1983
2406
|
Logger({
|
|
1984
2407
|
level: "WARN",
|
|
1985
|
-
message:
|
|
2408
|
+
message: `Response Validation Warnnings for platform > Order > getShipments \n ${res_error}`,
|
|
1986
2409
|
});
|
|
1987
|
-
Logger({ level: "WARN", message: res_error });
|
|
1988
2410
|
}
|
|
1989
2411
|
|
|
1990
2412
|
return response;
|
|
1991
2413
|
}
|
|
1992
2414
|
|
|
1993
2415
|
/**
|
|
1994
|
-
* @param {
|
|
1995
|
-
* @
|
|
2416
|
+
* @param {OrderPlatformValidator.GetStateTransitionMapParam} arg - Arg object
|
|
2417
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2418
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2419
|
+
* @returns {Promise<OrderPlatformModel.BagStateTransitionMap>} - Success response
|
|
2420
|
+
* @name getStateTransitionMap
|
|
1996
2421
|
* @summary:
|
|
1997
|
-
* @description:
|
|
2422
|
+
* @description: Get State Transition Map - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getStateTransitionMap/).
|
|
1998
2423
|
*/
|
|
1999
|
-
async getStateTransitionMap(
|
|
2000
|
-
|
|
2424
|
+
async getStateTransitionMap(
|
|
2425
|
+
{ requestHeaders } = { requestHeaders: {} },
|
|
2426
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2427
|
+
) {
|
|
2428
|
+
const { error } = OrderPlatformValidator.getStateTransitionMap().validate(
|
|
2001
2429
|
{},
|
|
2002
2430
|
{ abortEarly: false, allowUnknown: true }
|
|
2003
2431
|
);
|
|
@@ -2006,16 +2434,17 @@ class Order {
|
|
|
2006
2434
|
}
|
|
2007
2435
|
|
|
2008
2436
|
// Showing warrnings if extra unknown parameters are found
|
|
2009
|
-
const {
|
|
2437
|
+
const {
|
|
2438
|
+
error: warrning,
|
|
2439
|
+
} = OrderPlatformValidator.getStateTransitionMap().validate(
|
|
2010
2440
|
{},
|
|
2011
2441
|
{ abortEarly: false, allowUnknown: false }
|
|
2012
2442
|
);
|
|
2013
2443
|
if (warrning) {
|
|
2014
2444
|
Logger({
|
|
2015
2445
|
level: "WARN",
|
|
2016
|
-
message:
|
|
2446
|
+
message: `Parameter Validation warrnings for platform > Order > getStateTransitionMap \n ${warrning}`,
|
|
2017
2447
|
});
|
|
2018
|
-
Logger({ level: "WARN", message: warrning });
|
|
2019
2448
|
}
|
|
2020
2449
|
|
|
2021
2450
|
const query_params = {};
|
|
@@ -2028,12 +2457,18 @@ class Order {
|
|
|
2028
2457
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/bag/state/transition`,
|
|
2029
2458
|
query_params,
|
|
2030
2459
|
undefined,
|
|
2031
|
-
xHeaders
|
|
2460
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2461
|
+
{ responseHeaders }
|
|
2032
2462
|
);
|
|
2033
2463
|
|
|
2464
|
+
let responseData = response;
|
|
2465
|
+
if (responseHeaders) {
|
|
2466
|
+
responseData = response[0];
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2034
2469
|
const {
|
|
2035
2470
|
error: res_error,
|
|
2036
|
-
} =
|
|
2471
|
+
} = OrderPlatformModel.BagStateTransitionMap().validate(responseData, {
|
|
2037
2472
|
abortEarly: false,
|
|
2038
2473
|
allowUnknown: false,
|
|
2039
2474
|
});
|
|
@@ -2041,24 +2476,27 @@ class Order {
|
|
|
2041
2476
|
if (res_error) {
|
|
2042
2477
|
Logger({
|
|
2043
2478
|
level: "WARN",
|
|
2044
|
-
message:
|
|
2479
|
+
message: `Response Validation Warnnings for platform > Order > getStateTransitionMap \n ${res_error}`,
|
|
2045
2480
|
});
|
|
2046
|
-
Logger({ level: "WARN", message: res_error });
|
|
2047
2481
|
}
|
|
2048
2482
|
|
|
2049
2483
|
return response;
|
|
2050
2484
|
}
|
|
2051
2485
|
|
|
2052
2486
|
/**
|
|
2053
|
-
* @param {
|
|
2054
|
-
* @param {
|
|
2055
|
-
* @param {
|
|
2056
|
-
* @returns {Promise<FiltersResponse>} - Success response
|
|
2487
|
+
* @param {OrderPlatformValidator.GetfiltersParam} arg - Arg object
|
|
2488
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2489
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2490
|
+
* @returns {Promise<OrderPlatformModel.FiltersResponse>} - Success response
|
|
2491
|
+
* @name getfilters
|
|
2057
2492
|
* @summary:
|
|
2058
|
-
* @description:
|
|
2493
|
+
* @description: Get Listing Filters - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getfilters/).
|
|
2059
2494
|
*/
|
|
2060
|
-
async getfilters(
|
|
2061
|
-
|
|
2495
|
+
async getfilters(
|
|
2496
|
+
{ view, groupEntity, requestHeaders } = { requestHeaders: {} },
|
|
2497
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2498
|
+
) {
|
|
2499
|
+
const { error } = OrderPlatformValidator.getfilters().validate(
|
|
2062
2500
|
{
|
|
2063
2501
|
view,
|
|
2064
2502
|
groupEntity,
|
|
@@ -2070,7 +2508,7 @@ class Order {
|
|
|
2070
2508
|
}
|
|
2071
2509
|
|
|
2072
2510
|
// Showing warrnings if extra unknown parameters are found
|
|
2073
|
-
const { error: warrning } =
|
|
2511
|
+
const { error: warrning } = OrderPlatformValidator.getfilters().validate(
|
|
2074
2512
|
{
|
|
2075
2513
|
view,
|
|
2076
2514
|
groupEntity,
|
|
@@ -2080,9 +2518,8 @@ class Order {
|
|
|
2080
2518
|
if (warrning) {
|
|
2081
2519
|
Logger({
|
|
2082
2520
|
level: "WARN",
|
|
2083
|
-
message:
|
|
2521
|
+
message: `Parameter Validation warrnings for platform > Order > getfilters \n ${warrning}`,
|
|
2084
2522
|
});
|
|
2085
|
-
Logger({ level: "WARN", message: warrning });
|
|
2086
2523
|
}
|
|
2087
2524
|
|
|
2088
2525
|
const query_params = {};
|
|
@@ -2097,34 +2534,47 @@ class Order {
|
|
|
2097
2534
|
`/service/platform/order/v1.0/company/${this.config.companyId}/filter-listing`,
|
|
2098
2535
|
query_params,
|
|
2099
2536
|
undefined,
|
|
2100
|
-
xHeaders
|
|
2537
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2538
|
+
{ responseHeaders }
|
|
2101
2539
|
);
|
|
2102
2540
|
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2541
|
+
let responseData = response;
|
|
2542
|
+
if (responseHeaders) {
|
|
2543
|
+
responseData = response[0];
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
const {
|
|
2547
|
+
error: res_error,
|
|
2548
|
+
} = OrderPlatformModel.FiltersResponse().validate(responseData, {
|
|
2549
|
+
abortEarly: false,
|
|
2550
|
+
allowUnknown: false,
|
|
2551
|
+
});
|
|
2107
2552
|
|
|
2108
2553
|
if (res_error) {
|
|
2109
2554
|
Logger({
|
|
2110
2555
|
level: "WARN",
|
|
2111
|
-
message:
|
|
2556
|
+
message: `Response Validation Warnnings for platform > Order > getfilters \n ${res_error}`,
|
|
2112
2557
|
});
|
|
2113
|
-
Logger({ level: "WARN", message: res_error });
|
|
2114
2558
|
}
|
|
2115
2559
|
|
|
2116
2560
|
return response;
|
|
2117
2561
|
}
|
|
2118
2562
|
|
|
2119
2563
|
/**
|
|
2120
|
-
* @param {
|
|
2121
|
-
* @param {
|
|
2122
|
-
* @
|
|
2564
|
+
* @param {OrderPlatformValidator.InvalidateShipmentCacheParam} arg - Arg object
|
|
2565
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2566
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2567
|
+
* @returns {Promise<OrderPlatformModel.InvalidateShipmentCacheResponse>} -
|
|
2568
|
+
* Success response
|
|
2569
|
+
* @name invalidateShipmentCache
|
|
2123
2570
|
* @summary:
|
|
2124
|
-
* @description: Invalidate shipment Cache
|
|
2571
|
+
* @description: Invalidate shipment Cache - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/invalidateShipmentCache/).
|
|
2125
2572
|
*/
|
|
2126
|
-
async invalidateShipmentCache(
|
|
2127
|
-
|
|
2573
|
+
async invalidateShipmentCache(
|
|
2574
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2575
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2576
|
+
) {
|
|
2577
|
+
const { error } = OrderPlatformValidator.invalidateShipmentCache().validate(
|
|
2128
2578
|
{
|
|
2129
2579
|
body,
|
|
2130
2580
|
},
|
|
@@ -2137,7 +2587,7 @@ class Order {
|
|
|
2137
2587
|
// Showing warrnings if extra unknown parameters are found
|
|
2138
2588
|
const {
|
|
2139
2589
|
error: warrning,
|
|
2140
|
-
} =
|
|
2590
|
+
} = OrderPlatformValidator.invalidateShipmentCache().validate(
|
|
2141
2591
|
{
|
|
2142
2592
|
body,
|
|
2143
2593
|
},
|
|
@@ -2146,9 +2596,8 @@ class Order {
|
|
|
2146
2596
|
if (warrning) {
|
|
2147
2597
|
Logger({
|
|
2148
2598
|
level: "WARN",
|
|
2149
|
-
message:
|
|
2599
|
+
message: `Parameter Validation warrnings for platform > Order > invalidateShipmentCache \n ${warrning}`,
|
|
2150
2600
|
});
|
|
2151
|
-
Logger({ level: "WARN", message: warrning });
|
|
2152
2601
|
}
|
|
2153
2602
|
|
|
2154
2603
|
const query_params = {};
|
|
@@ -2161,36 +2610,46 @@ class Order {
|
|
|
2161
2610
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/update-cache`,
|
|
2162
2611
|
query_params,
|
|
2163
2612
|
body,
|
|
2164
|
-
xHeaders
|
|
2613
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2614
|
+
{ responseHeaders }
|
|
2165
2615
|
);
|
|
2166
2616
|
|
|
2617
|
+
let responseData = response;
|
|
2618
|
+
if (responseHeaders) {
|
|
2619
|
+
responseData = response[0];
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2167
2622
|
const {
|
|
2168
2623
|
error: res_error,
|
|
2169
|
-
} =
|
|
2170
|
-
|
|
2171
|
-
allowUnknown: false
|
|
2172
|
-
|
|
2624
|
+
} = OrderPlatformModel.InvalidateShipmentCacheResponse().validate(
|
|
2625
|
+
responseData,
|
|
2626
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2627
|
+
);
|
|
2173
2628
|
|
|
2174
2629
|
if (res_error) {
|
|
2175
2630
|
Logger({
|
|
2176
2631
|
level: "WARN",
|
|
2177
|
-
message:
|
|
2632
|
+
message: `Response Validation Warnnings for platform > Order > invalidateShipmentCache \n ${res_error}`,
|
|
2178
2633
|
});
|
|
2179
|
-
Logger({ level: "WARN", message: res_error });
|
|
2180
2634
|
}
|
|
2181
2635
|
|
|
2182
2636
|
return response;
|
|
2183
2637
|
}
|
|
2184
2638
|
|
|
2185
2639
|
/**
|
|
2186
|
-
* @param {
|
|
2187
|
-
* @param {
|
|
2188
|
-
* @
|
|
2640
|
+
* @param {OrderPlatformValidator.OrderUpdateParam} arg - Arg object
|
|
2641
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2642
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2643
|
+
* @returns {Promise<OrderPlatformModel.ResponseDetail>} - Success response
|
|
2644
|
+
* @name orderUpdate
|
|
2189
2645
|
* @summary:
|
|
2190
|
-
* @description:
|
|
2646
|
+
* @description: Update Order - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/orderUpdate/).
|
|
2191
2647
|
*/
|
|
2192
|
-
async orderUpdate(
|
|
2193
|
-
|
|
2648
|
+
async orderUpdate(
|
|
2649
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2650
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2651
|
+
) {
|
|
2652
|
+
const { error } = OrderPlatformValidator.orderUpdate().validate(
|
|
2194
2653
|
{
|
|
2195
2654
|
body,
|
|
2196
2655
|
},
|
|
@@ -2201,7 +2660,7 @@ class Order {
|
|
|
2201
2660
|
}
|
|
2202
2661
|
|
|
2203
2662
|
// Showing warrnings if extra unknown parameters are found
|
|
2204
|
-
const { error: warrning } =
|
|
2663
|
+
const { error: warrning } = OrderPlatformValidator.orderUpdate().validate(
|
|
2205
2664
|
{
|
|
2206
2665
|
body,
|
|
2207
2666
|
},
|
|
@@ -2210,9 +2669,8 @@ class Order {
|
|
|
2210
2669
|
if (warrning) {
|
|
2211
2670
|
Logger({
|
|
2212
2671
|
level: "WARN",
|
|
2213
|
-
message:
|
|
2672
|
+
message: `Parameter Validation warrnings for platform > Order > orderUpdate \n ${warrning}`,
|
|
2214
2673
|
});
|
|
2215
|
-
Logger({ level: "WARN", message: warrning });
|
|
2216
2674
|
}
|
|
2217
2675
|
|
|
2218
2676
|
const query_params = {};
|
|
@@ -2225,34 +2683,46 @@ class Order {
|
|
|
2225
2683
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/order/validation`,
|
|
2226
2684
|
query_params,
|
|
2227
2685
|
body,
|
|
2228
|
-
xHeaders
|
|
2686
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2687
|
+
{ responseHeaders }
|
|
2229
2688
|
);
|
|
2230
2689
|
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2690
|
+
let responseData = response;
|
|
2691
|
+
if (responseHeaders) {
|
|
2692
|
+
responseData = response[0];
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
const {
|
|
2696
|
+
error: res_error,
|
|
2697
|
+
} = OrderPlatformModel.ResponseDetail().validate(responseData, {
|
|
2698
|
+
abortEarly: false,
|
|
2699
|
+
allowUnknown: false,
|
|
2700
|
+
});
|
|
2235
2701
|
|
|
2236
2702
|
if (res_error) {
|
|
2237
2703
|
Logger({
|
|
2238
2704
|
level: "WARN",
|
|
2239
|
-
message:
|
|
2705
|
+
message: `Response Validation Warnnings for platform > Order > orderUpdate \n ${res_error}`,
|
|
2240
2706
|
});
|
|
2241
|
-
Logger({ level: "WARN", message: res_error });
|
|
2242
2707
|
}
|
|
2243
2708
|
|
|
2244
2709
|
return response;
|
|
2245
2710
|
}
|
|
2246
2711
|
|
|
2247
2712
|
/**
|
|
2248
|
-
* @param {
|
|
2249
|
-
* @param {
|
|
2250
|
-
* @
|
|
2713
|
+
* @param {OrderPlatformValidator.PostShipmentHistoryParam} arg - Arg object
|
|
2714
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2715
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2716
|
+
* @returns {Promise<OrderPlatformModel.ShipmentHistoryResponse>} - Success response
|
|
2717
|
+
* @name postShipmentHistory
|
|
2251
2718
|
* @summary:
|
|
2252
|
-
* @description:
|
|
2719
|
+
* @description: Post shipment history - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/postShipmentHistory/).
|
|
2253
2720
|
*/
|
|
2254
|
-
async postShipmentHistory(
|
|
2255
|
-
|
|
2721
|
+
async postShipmentHistory(
|
|
2722
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2723
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2724
|
+
) {
|
|
2725
|
+
const { error } = OrderPlatformValidator.postShipmentHistory().validate(
|
|
2256
2726
|
{
|
|
2257
2727
|
body,
|
|
2258
2728
|
},
|
|
@@ -2263,7 +2733,9 @@ class Order {
|
|
|
2263
2733
|
}
|
|
2264
2734
|
|
|
2265
2735
|
// Showing warrnings if extra unknown parameters are found
|
|
2266
|
-
const {
|
|
2736
|
+
const {
|
|
2737
|
+
error: warrning,
|
|
2738
|
+
} = OrderPlatformValidator.postShipmentHistory().validate(
|
|
2267
2739
|
{
|
|
2268
2740
|
body,
|
|
2269
2741
|
},
|
|
@@ -2272,9 +2744,8 @@ class Order {
|
|
|
2272
2744
|
if (warrning) {
|
|
2273
2745
|
Logger({
|
|
2274
2746
|
level: "WARN",
|
|
2275
|
-
message:
|
|
2747
|
+
message: `Parameter Validation warrnings for platform > Order > postShipmentHistory \n ${warrning}`,
|
|
2276
2748
|
});
|
|
2277
|
-
Logger({ level: "WARN", message: warrning });
|
|
2278
2749
|
}
|
|
2279
2750
|
|
|
2280
2751
|
const query_params = {};
|
|
@@ -2287,12 +2758,18 @@ class Order {
|
|
|
2287
2758
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/shipment/history`,
|
|
2288
2759
|
query_params,
|
|
2289
2760
|
body,
|
|
2290
|
-
xHeaders
|
|
2761
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2762
|
+
{ responseHeaders }
|
|
2291
2763
|
);
|
|
2292
2764
|
|
|
2765
|
+
let responseData = response;
|
|
2766
|
+
if (responseHeaders) {
|
|
2767
|
+
responseData = response[0];
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2293
2770
|
const {
|
|
2294
2771
|
error: res_error,
|
|
2295
|
-
} =
|
|
2772
|
+
} = OrderPlatformModel.ShipmentHistoryResponse().validate(responseData, {
|
|
2296
2773
|
abortEarly: false,
|
|
2297
2774
|
allowUnknown: false,
|
|
2298
2775
|
});
|
|
@@ -2300,23 +2777,27 @@ class Order {
|
|
|
2300
2777
|
if (res_error) {
|
|
2301
2778
|
Logger({
|
|
2302
2779
|
level: "WARN",
|
|
2303
|
-
message:
|
|
2780
|
+
message: `Response Validation Warnnings for platform > Order > postShipmentHistory \n ${res_error}`,
|
|
2304
2781
|
});
|
|
2305
|
-
Logger({ level: "WARN", message: res_error });
|
|
2306
2782
|
}
|
|
2307
2783
|
|
|
2308
2784
|
return response;
|
|
2309
2785
|
}
|
|
2310
2786
|
|
|
2311
2787
|
/**
|
|
2312
|
-
* @param {
|
|
2313
|
-
* @param {
|
|
2314
|
-
* @
|
|
2788
|
+
* @param {OrderPlatformValidator.ProcessManifestParam} arg - Arg object
|
|
2789
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2790
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2791
|
+
* @returns {Promise<OrderPlatformModel.CreateOrderResponse>} - Success response
|
|
2792
|
+
* @name processManifest
|
|
2315
2793
|
* @summary:
|
|
2316
|
-
* @description:
|
|
2794
|
+
* @description: Process Manifest - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/processManifest/).
|
|
2317
2795
|
*/
|
|
2318
|
-
async processManifest(
|
|
2319
|
-
|
|
2796
|
+
async processManifest(
|
|
2797
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2798
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2799
|
+
) {
|
|
2800
|
+
const { error } = OrderPlatformValidator.processManifest().validate(
|
|
2320
2801
|
{
|
|
2321
2802
|
body,
|
|
2322
2803
|
},
|
|
@@ -2327,7 +2808,9 @@ class Order {
|
|
|
2327
2808
|
}
|
|
2328
2809
|
|
|
2329
2810
|
// Showing warrnings if extra unknown parameters are found
|
|
2330
|
-
const {
|
|
2811
|
+
const {
|
|
2812
|
+
error: warrning,
|
|
2813
|
+
} = OrderPlatformValidator.processManifest().validate(
|
|
2331
2814
|
{
|
|
2332
2815
|
body,
|
|
2333
2816
|
},
|
|
@@ -2336,9 +2819,8 @@ class Order {
|
|
|
2336
2819
|
if (warrning) {
|
|
2337
2820
|
Logger({
|
|
2338
2821
|
level: "WARN",
|
|
2339
|
-
message:
|
|
2822
|
+
message: `Parameter Validation warrnings for platform > Order > processManifest \n ${warrning}`,
|
|
2340
2823
|
});
|
|
2341
|
-
Logger({ level: "WARN", message: warrning });
|
|
2342
2824
|
}
|
|
2343
2825
|
|
|
2344
2826
|
const query_params = {};
|
|
@@ -2351,12 +2833,18 @@ class Order {
|
|
|
2351
2833
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/process-manifest`,
|
|
2352
2834
|
query_params,
|
|
2353
2835
|
body,
|
|
2354
|
-
xHeaders
|
|
2836
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2837
|
+
{ responseHeaders }
|
|
2355
2838
|
);
|
|
2356
2839
|
|
|
2840
|
+
let responseData = response;
|
|
2841
|
+
if (responseHeaders) {
|
|
2842
|
+
responseData = response[0];
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2357
2845
|
const {
|
|
2358
2846
|
error: res_error,
|
|
2359
|
-
} =
|
|
2847
|
+
} = OrderPlatformModel.CreateOrderResponse().validate(responseData, {
|
|
2360
2848
|
abortEarly: false,
|
|
2361
2849
|
allowUnknown: false,
|
|
2362
2850
|
});
|
|
@@ -2364,23 +2852,27 @@ class Order {
|
|
|
2364
2852
|
if (res_error) {
|
|
2365
2853
|
Logger({
|
|
2366
2854
|
level: "WARN",
|
|
2367
|
-
message:
|
|
2855
|
+
message: `Response Validation Warnnings for platform > Order > processManifest \n ${res_error}`,
|
|
2368
2856
|
});
|
|
2369
|
-
Logger({ level: "WARN", message: res_error });
|
|
2370
2857
|
}
|
|
2371
2858
|
|
|
2372
2859
|
return response;
|
|
2373
2860
|
}
|
|
2374
2861
|
|
|
2375
2862
|
/**
|
|
2376
|
-
* @param {
|
|
2377
|
-
* @param {
|
|
2378
|
-
* @
|
|
2863
|
+
* @param {OrderPlatformValidator.ReassignLocationParam} arg - Arg object
|
|
2864
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2865
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2866
|
+
* @returns {Promise<OrderPlatformModel.StoreReassignResponse>} - Success response
|
|
2867
|
+
* @name reassignLocation
|
|
2379
2868
|
* @summary:
|
|
2380
|
-
* @description: Reassign Location
|
|
2869
|
+
* @description: Reassign Location - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/reassignLocation/).
|
|
2381
2870
|
*/
|
|
2382
|
-
async reassignLocation(
|
|
2383
|
-
|
|
2871
|
+
async reassignLocation(
|
|
2872
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2873
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2874
|
+
) {
|
|
2875
|
+
const { error } = OrderPlatformValidator.reassignLocation().validate(
|
|
2384
2876
|
{
|
|
2385
2877
|
body,
|
|
2386
2878
|
},
|
|
@@ -2391,7 +2883,9 @@ class Order {
|
|
|
2391
2883
|
}
|
|
2392
2884
|
|
|
2393
2885
|
// Showing warrnings if extra unknown parameters are found
|
|
2394
|
-
const {
|
|
2886
|
+
const {
|
|
2887
|
+
error: warrning,
|
|
2888
|
+
} = OrderPlatformValidator.reassignLocation().validate(
|
|
2395
2889
|
{
|
|
2396
2890
|
body,
|
|
2397
2891
|
},
|
|
@@ -2400,9 +2894,8 @@ class Order {
|
|
|
2400
2894
|
if (warrning) {
|
|
2401
2895
|
Logger({
|
|
2402
2896
|
level: "WARN",
|
|
2403
|
-
message:
|
|
2897
|
+
message: `Parameter Validation warrnings for platform > Order > reassignLocation \n ${warrning}`,
|
|
2404
2898
|
});
|
|
2405
|
-
Logger({ level: "WARN", message: warrning });
|
|
2406
2899
|
}
|
|
2407
2900
|
|
|
2408
2901
|
const query_params = {};
|
|
@@ -2415,12 +2908,18 @@ class Order {
|
|
|
2415
2908
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/store/reassign-internal`,
|
|
2416
2909
|
query_params,
|
|
2417
2910
|
body,
|
|
2418
|
-
xHeaders
|
|
2911
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2912
|
+
{ responseHeaders }
|
|
2419
2913
|
);
|
|
2420
2914
|
|
|
2915
|
+
let responseData = response;
|
|
2916
|
+
if (responseHeaders) {
|
|
2917
|
+
responseData = response[0];
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2421
2920
|
const {
|
|
2422
2921
|
error: res_error,
|
|
2423
|
-
} =
|
|
2922
|
+
} = OrderPlatformModel.StoreReassignResponse().validate(responseData, {
|
|
2424
2923
|
abortEarly: false,
|
|
2425
2924
|
allowUnknown: false,
|
|
2426
2925
|
});
|
|
@@ -2428,23 +2927,27 @@ class Order {
|
|
|
2428
2927
|
if (res_error) {
|
|
2429
2928
|
Logger({
|
|
2430
2929
|
level: "WARN",
|
|
2431
|
-
message:
|
|
2930
|
+
message: `Response Validation Warnnings for platform > Order > reassignLocation \n ${res_error}`,
|
|
2432
2931
|
});
|
|
2433
|
-
Logger({ level: "WARN", message: res_error });
|
|
2434
2932
|
}
|
|
2435
2933
|
|
|
2436
2934
|
return response;
|
|
2437
2935
|
}
|
|
2438
2936
|
|
|
2439
2937
|
/**
|
|
2440
|
-
* @param {
|
|
2441
|
-
* @param {
|
|
2442
|
-
* @
|
|
2938
|
+
* @param {OrderPlatformValidator.SendSmsNinjaParam} arg - Arg object
|
|
2939
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
2940
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
2941
|
+
* @returns {Promise<OrderPlatformModel.OrderStatusResult>} - Success response
|
|
2942
|
+
* @name sendSmsNinja
|
|
2443
2943
|
* @summary:
|
|
2444
|
-
* @description:
|
|
2944
|
+
* @description: Send SMS Ninja Panel - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/sendSmsNinja/).
|
|
2445
2945
|
*/
|
|
2446
|
-
async sendSmsNinja(
|
|
2447
|
-
|
|
2946
|
+
async sendSmsNinja(
|
|
2947
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
2948
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
2949
|
+
) {
|
|
2950
|
+
const { error } = OrderPlatformValidator.sendSmsNinja().validate(
|
|
2448
2951
|
{
|
|
2449
2952
|
body,
|
|
2450
2953
|
},
|
|
@@ -2455,7 +2958,7 @@ class Order {
|
|
|
2455
2958
|
}
|
|
2456
2959
|
|
|
2457
2960
|
// Showing warrnings if extra unknown parameters are found
|
|
2458
|
-
const { error: warrning } =
|
|
2961
|
+
const { error: warrning } = OrderPlatformValidator.sendSmsNinja().validate(
|
|
2459
2962
|
{
|
|
2460
2963
|
body,
|
|
2461
2964
|
},
|
|
@@ -2464,9 +2967,8 @@ class Order {
|
|
|
2464
2967
|
if (warrning) {
|
|
2465
2968
|
Logger({
|
|
2466
2969
|
level: "WARN",
|
|
2467
|
-
message:
|
|
2970
|
+
message: `Parameter Validation warrnings for platform > Order > sendSmsNinja \n ${warrning}`,
|
|
2468
2971
|
});
|
|
2469
|
-
Logger({ level: "WARN", message: warrning });
|
|
2470
2972
|
}
|
|
2471
2973
|
|
|
2472
2974
|
const query_params = {};
|
|
@@ -2479,12 +2981,18 @@ class Order {
|
|
|
2479
2981
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/ninja/send-sms`,
|
|
2480
2982
|
query_params,
|
|
2481
2983
|
body,
|
|
2482
|
-
xHeaders
|
|
2984
|
+
{ ...xHeaders, ...requestHeaders },
|
|
2985
|
+
{ responseHeaders }
|
|
2483
2986
|
);
|
|
2484
2987
|
|
|
2988
|
+
let responseData = response;
|
|
2989
|
+
if (responseHeaders) {
|
|
2990
|
+
responseData = response[0];
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2485
2993
|
const {
|
|
2486
2994
|
error: res_error,
|
|
2487
|
-
} =
|
|
2995
|
+
} = OrderPlatformModel.OrderStatusResult().validate(responseData, {
|
|
2488
2996
|
abortEarly: false,
|
|
2489
2997
|
allowUnknown: false,
|
|
2490
2998
|
});
|
|
@@ -2492,23 +3000,27 @@ class Order {
|
|
|
2492
3000
|
if (res_error) {
|
|
2493
3001
|
Logger({
|
|
2494
3002
|
level: "WARN",
|
|
2495
|
-
message:
|
|
3003
|
+
message: `Response Validation Warnnings for platform > Order > sendSmsNinja \n ${res_error}`,
|
|
2496
3004
|
});
|
|
2497
|
-
Logger({ level: "WARN", message: res_error });
|
|
2498
3005
|
}
|
|
2499
3006
|
|
|
2500
3007
|
return response;
|
|
2501
3008
|
}
|
|
2502
3009
|
|
|
2503
3010
|
/**
|
|
2504
|
-
* @param {
|
|
2505
|
-
* @param {
|
|
2506
|
-
* @
|
|
3011
|
+
* @param {OrderPlatformValidator.SendUserMobileOTPParam} arg - Arg object
|
|
3012
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3013
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3014
|
+
* @returns {Promise<OrderPlatformModel.SendUserMobileOtpResponse>} - Success response
|
|
3015
|
+
* @name sendUserMobileOTP
|
|
2507
3016
|
* @summary:
|
|
2508
|
-
* @description:
|
|
3017
|
+
* @description: Send User Mobile OTP - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/sendUserMobileOTP/).
|
|
2509
3018
|
*/
|
|
2510
|
-
async sendUserMobileOTP(
|
|
2511
|
-
|
|
3019
|
+
async sendUserMobileOTP(
|
|
3020
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3021
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
3022
|
+
) {
|
|
3023
|
+
const { error } = OrderPlatformValidator.sendUserMobileOTP().validate(
|
|
2512
3024
|
{
|
|
2513
3025
|
body,
|
|
2514
3026
|
},
|
|
@@ -2519,7 +3031,9 @@ class Order {
|
|
|
2519
3031
|
}
|
|
2520
3032
|
|
|
2521
3033
|
// Showing warrnings if extra unknown parameters are found
|
|
2522
|
-
const {
|
|
3034
|
+
const {
|
|
3035
|
+
error: warrning,
|
|
3036
|
+
} = OrderPlatformValidator.sendUserMobileOTP().validate(
|
|
2523
3037
|
{
|
|
2524
3038
|
body,
|
|
2525
3039
|
},
|
|
@@ -2528,9 +3042,8 @@ class Order {
|
|
|
2528
3042
|
if (warrning) {
|
|
2529
3043
|
Logger({
|
|
2530
3044
|
level: "WARN",
|
|
2531
|
-
message:
|
|
3045
|
+
message: `Parameter Validation warrnings for platform > Order > sendUserMobileOTP \n ${warrning}`,
|
|
2532
3046
|
});
|
|
2533
|
-
Logger({ level: "WARN", message: warrning });
|
|
2534
3047
|
}
|
|
2535
3048
|
|
|
2536
3049
|
const query_params = {};
|
|
@@ -2543,12 +3056,18 @@ class Order {
|
|
|
2543
3056
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/user/send/otp/mobile`,
|
|
2544
3057
|
query_params,
|
|
2545
3058
|
body,
|
|
2546
|
-
xHeaders
|
|
3059
|
+
{ ...xHeaders, ...requestHeaders },
|
|
3060
|
+
{ responseHeaders }
|
|
2547
3061
|
);
|
|
2548
3062
|
|
|
3063
|
+
let responseData = response;
|
|
3064
|
+
if (responseHeaders) {
|
|
3065
|
+
responseData = response[0];
|
|
3066
|
+
}
|
|
3067
|
+
|
|
2549
3068
|
const {
|
|
2550
3069
|
error: res_error,
|
|
2551
|
-
} =
|
|
3070
|
+
} = OrderPlatformModel.SendUserMobileOtpResponse().validate(responseData, {
|
|
2552
3071
|
abortEarly: false,
|
|
2553
3072
|
allowUnknown: false,
|
|
2554
3073
|
});
|
|
@@ -2556,48 +3075,127 @@ class Order {
|
|
|
2556
3075
|
if (res_error) {
|
|
2557
3076
|
Logger({
|
|
2558
3077
|
level: "WARN",
|
|
2559
|
-
message:
|
|
3078
|
+
message: `Response Validation Warnnings for platform > Order > sendUserMobileOTP \n ${res_error}`,
|
|
2560
3079
|
});
|
|
2561
|
-
Logger({ level: "WARN", message: res_error });
|
|
2562
3080
|
}
|
|
2563
3081
|
|
|
2564
3082
|
return response;
|
|
2565
3083
|
}
|
|
2566
3084
|
|
|
2567
3085
|
/**
|
|
2568
|
-
* @param {
|
|
2569
|
-
* @param {
|
|
2570
|
-
* @param {
|
|
2571
|
-
* @
|
|
2572
|
-
*
|
|
2573
|
-
* @
|
|
2574
|
-
* @
|
|
2575
|
-
* @
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
3086
|
+
* @param {OrderPlatformValidator.TrackShipmentParam} arg - Arg object
|
|
3087
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3088
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3089
|
+
* @returns {Promise<OrderPlatformModel.CourierPartnerTrackingResponse>} -
|
|
3090
|
+
* Success response
|
|
3091
|
+
* @name trackShipment
|
|
3092
|
+
* @summary: Get courier partner tracking details
|
|
3093
|
+
* @description: This endpoint allows users to get courier partner tracking details for a given shipment id or awb no. The service will fetch courier partner statuses that are pushed to oms. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/trackShipment/).
|
|
3094
|
+
*/
|
|
3095
|
+
async trackShipment(
|
|
3096
|
+
{ shipmentId, awb, pageNo, pageSize, requestHeaders } = {
|
|
3097
|
+
requestHeaders: {},
|
|
3098
|
+
},
|
|
3099
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
3100
|
+
) {
|
|
3101
|
+
const { error } = OrderPlatformValidator.trackShipment().validate(
|
|
3102
|
+
{
|
|
3103
|
+
shipmentId,
|
|
3104
|
+
awb,
|
|
3105
|
+
pageNo,
|
|
3106
|
+
pageSize,
|
|
3107
|
+
},
|
|
3108
|
+
{ abortEarly: false, allowUnknown: true }
|
|
3109
|
+
);
|
|
3110
|
+
if (error) {
|
|
3111
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
3112
|
+
}
|
|
3113
|
+
|
|
3114
|
+
// Showing warrnings if extra unknown parameters are found
|
|
3115
|
+
const { error: warrning } = OrderPlatformValidator.trackShipment().validate(
|
|
3116
|
+
{
|
|
3117
|
+
shipmentId,
|
|
3118
|
+
awb,
|
|
3119
|
+
pageNo,
|
|
3120
|
+
pageSize,
|
|
3121
|
+
},
|
|
3122
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3123
|
+
);
|
|
3124
|
+
if (warrning) {
|
|
3125
|
+
Logger({
|
|
3126
|
+
level: "WARN",
|
|
3127
|
+
message: `Parameter Validation warrnings for platform > Order > trackShipment \n ${warrning}`,
|
|
3128
|
+
});
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
const query_params = {};
|
|
3132
|
+
query_params["shipment_id"] = shipmentId;
|
|
3133
|
+
query_params["awb"] = awb;
|
|
3134
|
+
query_params["page_no"] = pageNo;
|
|
3135
|
+
query_params["page_size"] = pageSize;
|
|
3136
|
+
|
|
3137
|
+
const xHeaders = {};
|
|
3138
|
+
|
|
3139
|
+
const response = await PlatformAPIClient.execute(
|
|
3140
|
+
this.config,
|
|
3141
|
+
"get",
|
|
3142
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/tracking`,
|
|
3143
|
+
query_params,
|
|
3144
|
+
undefined,
|
|
3145
|
+
{ ...xHeaders, ...requestHeaders },
|
|
3146
|
+
{ responseHeaders }
|
|
3147
|
+
);
|
|
3148
|
+
|
|
3149
|
+
let responseData = response;
|
|
3150
|
+
if (responseHeaders) {
|
|
3151
|
+
responseData = response[0];
|
|
3152
|
+
}
|
|
3153
|
+
|
|
3154
|
+
const {
|
|
3155
|
+
error: res_error,
|
|
3156
|
+
} = OrderPlatformModel.CourierPartnerTrackingResponse().validate(
|
|
3157
|
+
responseData,
|
|
3158
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3159
|
+
);
|
|
3160
|
+
|
|
3161
|
+
if (res_error) {
|
|
3162
|
+
Logger({
|
|
3163
|
+
level: "WARN",
|
|
3164
|
+
message: `Response Validation Warnnings for platform > Order > trackShipment \n ${res_error}`,
|
|
3165
|
+
});
|
|
3166
|
+
}
|
|
3167
|
+
|
|
3168
|
+
return response;
|
|
3169
|
+
}
|
|
3170
|
+
|
|
3171
|
+
/**
|
|
3172
|
+
* @param {OrderPlatformValidator.UpdateAddressParam} arg - Arg object
|
|
3173
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3174
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3175
|
+
* @returns {Promise<OrderPlatformModel.BaseResponse>} - Success response
|
|
3176
|
+
* @name updateAddress
|
|
2582
3177
|
* @summary:
|
|
2583
|
-
* @description:
|
|
3178
|
+
* @description: Update Address for the order - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/updateAddress/).
|
|
2584
3179
|
*/
|
|
2585
|
-
async updateAddress(
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
3180
|
+
async updateAddress(
|
|
3181
|
+
{
|
|
3182
|
+
shipmentId,
|
|
3183
|
+
addressCategory,
|
|
3184
|
+
name,
|
|
3185
|
+
address,
|
|
3186
|
+
addressType,
|
|
3187
|
+
pincode,
|
|
3188
|
+
phone,
|
|
3189
|
+
email,
|
|
3190
|
+
landmark,
|
|
3191
|
+
city,
|
|
3192
|
+
state,
|
|
3193
|
+
country,
|
|
3194
|
+
requestHeaders,
|
|
3195
|
+
} = { requestHeaders: {} },
|
|
3196
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
3197
|
+
) {
|
|
3198
|
+
const { error } = OrderPlatformValidator.updateAddress().validate(
|
|
2601
3199
|
{
|
|
2602
3200
|
shipmentId,
|
|
2603
3201
|
addressCategory,
|
|
@@ -2620,7 +3218,7 @@ class Order {
|
|
|
2620
3218
|
}
|
|
2621
3219
|
|
|
2622
3220
|
// Showing warrnings if extra unknown parameters are found
|
|
2623
|
-
const { error: warrning } =
|
|
3221
|
+
const { error: warrning } = OrderPlatformValidator.updateAddress().validate(
|
|
2624
3222
|
{
|
|
2625
3223
|
shipmentId,
|
|
2626
3224
|
addressCategory,
|
|
@@ -2641,9 +3239,8 @@ class Order {
|
|
|
2641
3239
|
if (warrning) {
|
|
2642
3240
|
Logger({
|
|
2643
3241
|
level: "WARN",
|
|
2644
|
-
message:
|
|
3242
|
+
message: `Parameter Validation warrnings for platform > Order > updateAddress \n ${warrning}`,
|
|
2645
3243
|
});
|
|
2646
|
-
Logger({ level: "WARN", message: warrning });
|
|
2647
3244
|
}
|
|
2648
3245
|
|
|
2649
3246
|
const query_params = {};
|
|
@@ -2668,10 +3265,18 @@ class Order {
|
|
|
2668
3265
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/delight/update-address`,
|
|
2669
3266
|
query_params,
|
|
2670
3267
|
undefined,
|
|
2671
|
-
xHeaders
|
|
3268
|
+
{ ...xHeaders, ...requestHeaders },
|
|
3269
|
+
{ responseHeaders }
|
|
2672
3270
|
);
|
|
2673
3271
|
|
|
2674
|
-
|
|
3272
|
+
let responseData = response;
|
|
3273
|
+
if (responseHeaders) {
|
|
3274
|
+
responseData = response[0];
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
const {
|
|
3278
|
+
error: res_error,
|
|
3279
|
+
} = OrderPlatformModel.BaseResponse().validate(responseData, {
|
|
2675
3280
|
abortEarly: false,
|
|
2676
3281
|
allowUnknown: false,
|
|
2677
3282
|
});
|
|
@@ -2679,23 +3284,31 @@ class Order {
|
|
|
2679
3284
|
if (res_error) {
|
|
2680
3285
|
Logger({
|
|
2681
3286
|
level: "WARN",
|
|
2682
|
-
message:
|
|
3287
|
+
message: `Response Validation Warnnings for platform > Order > updateAddress \n ${res_error}`,
|
|
2683
3288
|
});
|
|
2684
|
-
Logger({ level: "WARN", message: res_error });
|
|
2685
3289
|
}
|
|
2686
3290
|
|
|
2687
3291
|
return response;
|
|
2688
3292
|
}
|
|
2689
3293
|
|
|
2690
3294
|
/**
|
|
2691
|
-
* @param {
|
|
2692
|
-
* @param {
|
|
2693
|
-
* @
|
|
3295
|
+
* @param {OrderPlatformValidator.UpdatePackagingDimensionsParam} arg - Arg object
|
|
3296
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3297
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3298
|
+
* @returns {Promise<OrderPlatformModel.UpdatePackagingDimensionsResponse>}
|
|
3299
|
+
* - Success response
|
|
3300
|
+
*
|
|
3301
|
+
* @name updatePackagingDimensions
|
|
2694
3302
|
* @summary:
|
|
2695
|
-
* @description:
|
|
3303
|
+
* @description: Update Packaging Dimensions - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/updatePackagingDimensions/).
|
|
2696
3304
|
*/
|
|
2697
|
-
async updatePackagingDimensions(
|
|
2698
|
-
|
|
3305
|
+
async updatePackagingDimensions(
|
|
3306
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3307
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
3308
|
+
) {
|
|
3309
|
+
const {
|
|
3310
|
+
error,
|
|
3311
|
+
} = OrderPlatformValidator.updatePackagingDimensions().validate(
|
|
2699
3312
|
{
|
|
2700
3313
|
body,
|
|
2701
3314
|
},
|
|
@@ -2708,7 +3321,7 @@ class Order {
|
|
|
2708
3321
|
// Showing warrnings if extra unknown parameters are found
|
|
2709
3322
|
const {
|
|
2710
3323
|
error: warrning,
|
|
2711
|
-
} =
|
|
3324
|
+
} = OrderPlatformValidator.updatePackagingDimensions().validate(
|
|
2712
3325
|
{
|
|
2713
3326
|
body,
|
|
2714
3327
|
},
|
|
@@ -2717,9 +3330,8 @@ class Order {
|
|
|
2717
3330
|
if (warrning) {
|
|
2718
3331
|
Logger({
|
|
2719
3332
|
level: "WARN",
|
|
2720
|
-
message:
|
|
3333
|
+
message: `Parameter Validation warrnings for platform > Order > updatePackagingDimensions \n ${warrning}`,
|
|
2721
3334
|
});
|
|
2722
|
-
Logger({ level: "WARN", message: warrning });
|
|
2723
3335
|
}
|
|
2724
3336
|
|
|
2725
3337
|
const query_params = {};
|
|
@@ -2732,36 +3344,47 @@ class Order {
|
|
|
2732
3344
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/update-packaging-dimension`,
|
|
2733
3345
|
query_params,
|
|
2734
3346
|
body,
|
|
2735
|
-
xHeaders
|
|
3347
|
+
{ ...xHeaders, ...requestHeaders },
|
|
3348
|
+
{ responseHeaders }
|
|
2736
3349
|
);
|
|
2737
3350
|
|
|
3351
|
+
let responseData = response;
|
|
3352
|
+
if (responseHeaders) {
|
|
3353
|
+
responseData = response[0];
|
|
3354
|
+
}
|
|
3355
|
+
|
|
2738
3356
|
const {
|
|
2739
3357
|
error: res_error,
|
|
2740
|
-
} =
|
|
2741
|
-
|
|
2742
|
-
allowUnknown: false
|
|
2743
|
-
|
|
3358
|
+
} = OrderPlatformModel.UpdatePackagingDimensionsResponse().validate(
|
|
3359
|
+
responseData,
|
|
3360
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3361
|
+
);
|
|
2744
3362
|
|
|
2745
3363
|
if (res_error) {
|
|
2746
3364
|
Logger({
|
|
2747
3365
|
level: "WARN",
|
|
2748
|
-
message:
|
|
3366
|
+
message: `Response Validation Warnnings for platform > Order > updatePackagingDimensions \n ${res_error}`,
|
|
2749
3367
|
});
|
|
2750
|
-
Logger({ level: "WARN", message: res_error });
|
|
2751
3368
|
}
|
|
2752
3369
|
|
|
2753
3370
|
return response;
|
|
2754
3371
|
}
|
|
2755
3372
|
|
|
2756
3373
|
/**
|
|
2757
|
-
* @param {
|
|
2758
|
-
* @param {
|
|
2759
|
-
* @
|
|
3374
|
+
* @param {OrderPlatformValidator.UpdateShipmentLockParam} arg - Arg object
|
|
3375
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3376
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3377
|
+
* @returns {Promise<OrderPlatformModel.UpdateShipmentLockResponse>} -
|
|
3378
|
+
* Success response
|
|
3379
|
+
* @name updateShipmentLock
|
|
2760
3380
|
* @summary:
|
|
2761
|
-
* @description: update shipment/bag lock and check status
|
|
3381
|
+
* @description: update shipment/bag lock and check status - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/updateShipmentLock/).
|
|
2762
3382
|
*/
|
|
2763
|
-
async updateShipmentLock(
|
|
2764
|
-
|
|
3383
|
+
async updateShipmentLock(
|
|
3384
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3385
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
3386
|
+
) {
|
|
3387
|
+
const { error } = OrderPlatformValidator.updateShipmentLock().validate(
|
|
2765
3388
|
{
|
|
2766
3389
|
body,
|
|
2767
3390
|
},
|
|
@@ -2772,7 +3395,9 @@ class Order {
|
|
|
2772
3395
|
}
|
|
2773
3396
|
|
|
2774
3397
|
// Showing warrnings if extra unknown parameters are found
|
|
2775
|
-
const {
|
|
3398
|
+
const {
|
|
3399
|
+
error: warrning,
|
|
3400
|
+
} = OrderPlatformValidator.updateShipmentLock().validate(
|
|
2776
3401
|
{
|
|
2777
3402
|
body,
|
|
2778
3403
|
},
|
|
@@ -2781,9 +3406,8 @@ class Order {
|
|
|
2781
3406
|
if (warrning) {
|
|
2782
3407
|
Logger({
|
|
2783
3408
|
level: "WARN",
|
|
2784
|
-
message:
|
|
3409
|
+
message: `Parameter Validation warrnings for platform > Order > updateShipmentLock \n ${warrning}`,
|
|
2785
3410
|
});
|
|
2786
|
-
Logger({ level: "WARN", message: warrning });
|
|
2787
3411
|
}
|
|
2788
3412
|
|
|
2789
3413
|
const query_params = {};
|
|
@@ -2796,12 +3420,18 @@ class Order {
|
|
|
2796
3420
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/entity/lock-manager`,
|
|
2797
3421
|
query_params,
|
|
2798
3422
|
body,
|
|
2799
|
-
xHeaders
|
|
3423
|
+
{ ...xHeaders, ...requestHeaders },
|
|
3424
|
+
{ responseHeaders }
|
|
2800
3425
|
);
|
|
2801
3426
|
|
|
3427
|
+
let responseData = response;
|
|
3428
|
+
if (responseHeaders) {
|
|
3429
|
+
responseData = response[0];
|
|
3430
|
+
}
|
|
3431
|
+
|
|
2802
3432
|
const {
|
|
2803
3433
|
error: res_error,
|
|
2804
|
-
} =
|
|
3434
|
+
} = OrderPlatformModel.UpdateShipmentLockResponse().validate(responseData, {
|
|
2805
3435
|
abortEarly: false,
|
|
2806
3436
|
allowUnknown: false,
|
|
2807
3437
|
});
|
|
@@ -2809,23 +3439,29 @@ class Order {
|
|
|
2809
3439
|
if (res_error) {
|
|
2810
3440
|
Logger({
|
|
2811
3441
|
level: "WARN",
|
|
2812
|
-
message:
|
|
3442
|
+
message: `Response Validation Warnnings for platform > Order > updateShipmentLock \n ${res_error}`,
|
|
2813
3443
|
});
|
|
2814
|
-
Logger({ level: "WARN", message: res_error });
|
|
2815
3444
|
}
|
|
2816
3445
|
|
|
2817
3446
|
return response;
|
|
2818
3447
|
}
|
|
2819
3448
|
|
|
2820
3449
|
/**
|
|
2821
|
-
* @param {
|
|
2822
|
-
* @param {
|
|
2823
|
-
* @
|
|
3450
|
+
* @param {OrderPlatformValidator.UpdateShipmentStatusParam} arg - Arg object
|
|
3451
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3452
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3453
|
+
* @returns {Promise<OrderPlatformModel.UpdateShipmentStatusResponseBody>}
|
|
3454
|
+
* - Success response
|
|
3455
|
+
*
|
|
3456
|
+
* @name updateShipmentStatus
|
|
2824
3457
|
* @summary:
|
|
2825
|
-
* @description: This API is for Shipment State transition or Shipment data update or both below example is for partial state transition with data update
|
|
3458
|
+
* @description: This API is for Shipment State transition or Shipment data update or both below example is for partial state transition with data update - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/updateShipmentStatus/).
|
|
2826
3459
|
*/
|
|
2827
|
-
async updateShipmentStatus(
|
|
2828
|
-
|
|
3460
|
+
async updateShipmentStatus(
|
|
3461
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3462
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
3463
|
+
) {
|
|
3464
|
+
const { error } = OrderPlatformValidator.updateShipmentStatus().validate(
|
|
2829
3465
|
{
|
|
2830
3466
|
body,
|
|
2831
3467
|
},
|
|
@@ -2836,7 +3472,9 @@ class Order {
|
|
|
2836
3472
|
}
|
|
2837
3473
|
|
|
2838
3474
|
// Showing warrnings if extra unknown parameters are found
|
|
2839
|
-
const {
|
|
3475
|
+
const {
|
|
3476
|
+
error: warrning,
|
|
3477
|
+
} = OrderPlatformValidator.updateShipmentStatus().validate(
|
|
2840
3478
|
{
|
|
2841
3479
|
body,
|
|
2842
3480
|
},
|
|
@@ -2845,9 +3483,8 @@ class Order {
|
|
|
2845
3483
|
if (warrning) {
|
|
2846
3484
|
Logger({
|
|
2847
3485
|
level: "WARN",
|
|
2848
|
-
message:
|
|
3486
|
+
message: `Parameter Validation warrnings for platform > Order > updateShipmentStatus \n ${warrning}`,
|
|
2849
3487
|
});
|
|
2850
|
-
Logger({ level: "WARN", message: warrning });
|
|
2851
3488
|
}
|
|
2852
3489
|
|
|
2853
3490
|
const query_params = {};
|
|
@@ -2860,36 +3497,47 @@ class Order {
|
|
|
2860
3497
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/shipment/status-internal`,
|
|
2861
3498
|
query_params,
|
|
2862
3499
|
body,
|
|
2863
|
-
xHeaders
|
|
3500
|
+
{ ...xHeaders, ...requestHeaders },
|
|
3501
|
+
{ responseHeaders }
|
|
2864
3502
|
);
|
|
2865
3503
|
|
|
3504
|
+
let responseData = response;
|
|
3505
|
+
if (responseHeaders) {
|
|
3506
|
+
responseData = response[0];
|
|
3507
|
+
}
|
|
3508
|
+
|
|
2866
3509
|
const {
|
|
2867
3510
|
error: res_error,
|
|
2868
|
-
} =
|
|
2869
|
-
|
|
2870
|
-
allowUnknown: false
|
|
2871
|
-
|
|
3511
|
+
} = OrderPlatformModel.UpdateShipmentStatusResponseBody().validate(
|
|
3512
|
+
responseData,
|
|
3513
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3514
|
+
);
|
|
2872
3515
|
|
|
2873
3516
|
if (res_error) {
|
|
2874
3517
|
Logger({
|
|
2875
3518
|
level: "WARN",
|
|
2876
|
-
message:
|
|
3519
|
+
message: `Response Validation Warnnings for platform > Order > updateShipmentStatus \n ${res_error}`,
|
|
2877
3520
|
});
|
|
2878
|
-
Logger({ level: "WARN", message: res_error });
|
|
2879
3521
|
}
|
|
2880
3522
|
|
|
2881
3523
|
return response;
|
|
2882
3524
|
}
|
|
2883
3525
|
|
|
2884
3526
|
/**
|
|
2885
|
-
* @param {
|
|
2886
|
-
* @param {
|
|
2887
|
-
* @
|
|
2888
|
-
* @
|
|
2889
|
-
*
|
|
3527
|
+
* @param {OrderPlatformValidator.UpdateShipmentTrackingParam} arg - Arg object
|
|
3528
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3529
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3530
|
+
* @returns {Promise<OrderPlatformModel.CourierPartnerTrackingDetails>} -
|
|
3531
|
+
* Success response
|
|
3532
|
+
* @name updateShipmentTracking
|
|
3533
|
+
* @summary: Post courier partner tracking details
|
|
3534
|
+
* @description: This endpoint allows users to post courier partner tracking details for a given shipment id or awb no. The service will add entry for courier partner statuses and will be saved to oms. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/updateShipmentTracking/).
|
|
2890
3535
|
*/
|
|
2891
|
-
async
|
|
2892
|
-
|
|
3536
|
+
async updateShipmentTracking(
|
|
3537
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3538
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
3539
|
+
) {
|
|
3540
|
+
const { error } = OrderPlatformValidator.updateShipmentTracking().validate(
|
|
2893
3541
|
{
|
|
2894
3542
|
body,
|
|
2895
3543
|
},
|
|
@@ -2900,7 +3548,9 @@ class Order {
|
|
|
2900
3548
|
}
|
|
2901
3549
|
|
|
2902
3550
|
// Showing warrnings if extra unknown parameters are found
|
|
2903
|
-
const {
|
|
3551
|
+
const {
|
|
3552
|
+
error: warrning,
|
|
3553
|
+
} = OrderPlatformValidator.updateShipmentTracking().validate(
|
|
2904
3554
|
{
|
|
2905
3555
|
body,
|
|
2906
3556
|
},
|
|
@@ -2909,9 +3559,8 @@ class Order {
|
|
|
2909
3559
|
if (warrning) {
|
|
2910
3560
|
Logger({
|
|
2911
3561
|
level: "WARN",
|
|
2912
|
-
message:
|
|
3562
|
+
message: `Parameter Validation warrnings for platform > Order > updateShipmentTracking \n ${warrning}`,
|
|
2913
3563
|
});
|
|
2914
|
-
Logger({ level: "WARN", message: warrning });
|
|
2915
3564
|
}
|
|
2916
3565
|
|
|
2917
3566
|
const query_params = {};
|
|
@@ -2921,37 +3570,122 @@ class Order {
|
|
|
2921
3570
|
const response = await PlatformAPIClient.execute(
|
|
2922
3571
|
this.config,
|
|
2923
3572
|
"post",
|
|
2924
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
3573
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/tracking`,
|
|
2925
3574
|
query_params,
|
|
2926
3575
|
body,
|
|
2927
|
-
xHeaders
|
|
3576
|
+
{ ...xHeaders, ...requestHeaders },
|
|
3577
|
+
{ responseHeaders }
|
|
3578
|
+
);
|
|
3579
|
+
|
|
3580
|
+
let responseData = response;
|
|
3581
|
+
if (responseHeaders) {
|
|
3582
|
+
responseData = response[0];
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3585
|
+
const {
|
|
3586
|
+
error: res_error,
|
|
3587
|
+
} = OrderPlatformModel.CourierPartnerTrackingDetails().validate(
|
|
3588
|
+
responseData,
|
|
3589
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2928
3590
|
);
|
|
2929
3591
|
|
|
2930
|
-
|
|
2931
|
-
|
|
3592
|
+
if (res_error) {
|
|
3593
|
+
Logger({
|
|
3594
|
+
level: "WARN",
|
|
3595
|
+
message: `Response Validation Warnnings for platform > Order > updateShipmentTracking \n ${res_error}`,
|
|
3596
|
+
});
|
|
3597
|
+
}
|
|
3598
|
+
|
|
3599
|
+
return response;
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
/**
|
|
3603
|
+
* @param {OrderPlatformValidator.UploadConsentParam} arg - Arg object
|
|
3604
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3605
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3606
|
+
* @returns {Promise<OrderPlatformModel.SuccessResponse>} - Success response
|
|
3607
|
+
* @name uploadConsent
|
|
3608
|
+
* @summary:
|
|
3609
|
+
* @description: Upload Consent - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/uploadConsent/).
|
|
3610
|
+
*/
|
|
3611
|
+
async uploadConsent(
|
|
3612
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3613
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
3614
|
+
) {
|
|
3615
|
+
const { error } = OrderPlatformValidator.uploadConsent().validate(
|
|
3616
|
+
{
|
|
3617
|
+
body,
|
|
3618
|
+
},
|
|
3619
|
+
{ abortEarly: false, allowUnknown: true }
|
|
3620
|
+
);
|
|
3621
|
+
if (error) {
|
|
3622
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
3623
|
+
}
|
|
3624
|
+
|
|
3625
|
+
// Showing warrnings if extra unknown parameters are found
|
|
3626
|
+
const { error: warrning } = OrderPlatformValidator.uploadConsent().validate(
|
|
3627
|
+
{
|
|
3628
|
+
body,
|
|
3629
|
+
},
|
|
2932
3630
|
{ abortEarly: false, allowUnknown: false }
|
|
2933
3631
|
);
|
|
3632
|
+
if (warrning) {
|
|
3633
|
+
Logger({
|
|
3634
|
+
level: "WARN",
|
|
3635
|
+
message: `Parameter Validation warrnings for platform > Order > uploadConsent \n ${warrning}`,
|
|
3636
|
+
});
|
|
3637
|
+
}
|
|
3638
|
+
|
|
3639
|
+
const query_params = {};
|
|
3640
|
+
|
|
3641
|
+
const xHeaders = {};
|
|
3642
|
+
|
|
3643
|
+
const response = await PlatformAPIClient.execute(
|
|
3644
|
+
this.config,
|
|
3645
|
+
"post",
|
|
3646
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/uploadConsent`,
|
|
3647
|
+
query_params,
|
|
3648
|
+
body,
|
|
3649
|
+
{ ...xHeaders, ...requestHeaders },
|
|
3650
|
+
{ responseHeaders }
|
|
3651
|
+
);
|
|
3652
|
+
|
|
3653
|
+
let responseData = response;
|
|
3654
|
+
if (responseHeaders) {
|
|
3655
|
+
responseData = response[0];
|
|
3656
|
+
}
|
|
3657
|
+
|
|
3658
|
+
const {
|
|
3659
|
+
error: res_error,
|
|
3660
|
+
} = OrderPlatformModel.SuccessResponse().validate(responseData, {
|
|
3661
|
+
abortEarly: false,
|
|
3662
|
+
allowUnknown: false,
|
|
3663
|
+
});
|
|
2934
3664
|
|
|
2935
3665
|
if (res_error) {
|
|
2936
3666
|
Logger({
|
|
2937
3667
|
level: "WARN",
|
|
2938
|
-
message:
|
|
3668
|
+
message: `Response Validation Warnnings for platform > Order > uploadConsent \n ${res_error}`,
|
|
2939
3669
|
});
|
|
2940
|
-
Logger({ level: "WARN", message: res_error });
|
|
2941
3670
|
}
|
|
2942
3671
|
|
|
2943
3672
|
return response;
|
|
2944
3673
|
}
|
|
2945
3674
|
|
|
2946
3675
|
/**
|
|
2947
|
-
* @param {
|
|
2948
|
-
* @param {
|
|
2949
|
-
* @
|
|
3676
|
+
* @param {OrderPlatformValidator.VerifyMobileOTPParam} arg - Arg object
|
|
3677
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3678
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3679
|
+
* @returns {Promise<OrderPlatformModel.VerifyOtpResponse>} - Success response
|
|
3680
|
+
* @name verifyMobileOTP
|
|
2950
3681
|
* @summary:
|
|
2951
|
-
* @description:
|
|
3682
|
+
* @description: Verify Mobile OTP - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/verifyMobileOTP/).
|
|
2952
3683
|
*/
|
|
2953
|
-
async verifyMobileOTP(
|
|
2954
|
-
|
|
3684
|
+
async verifyMobileOTP(
|
|
3685
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
3686
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
3687
|
+
) {
|
|
3688
|
+
const { error } = OrderPlatformValidator.verifyMobileOTP().validate(
|
|
2955
3689
|
{
|
|
2956
3690
|
body,
|
|
2957
3691
|
},
|
|
@@ -2962,7 +3696,9 @@ class Order {
|
|
|
2962
3696
|
}
|
|
2963
3697
|
|
|
2964
3698
|
// Showing warrnings if extra unknown parameters are found
|
|
2965
|
-
const {
|
|
3699
|
+
const {
|
|
3700
|
+
error: warrning,
|
|
3701
|
+
} = OrderPlatformValidator.verifyMobileOTP().validate(
|
|
2966
3702
|
{
|
|
2967
3703
|
body,
|
|
2968
3704
|
},
|
|
@@ -2971,9 +3707,8 @@ class Order {
|
|
|
2971
3707
|
if (warrning) {
|
|
2972
3708
|
Logger({
|
|
2973
3709
|
level: "WARN",
|
|
2974
|
-
message:
|
|
3710
|
+
message: `Parameter Validation warrnings for platform > Order > verifyMobileOTP \n ${warrning}`,
|
|
2975
3711
|
});
|
|
2976
|
-
Logger({ level: "WARN", message: warrning });
|
|
2977
3712
|
}
|
|
2978
3713
|
|
|
2979
3714
|
const query_params = {};
|
|
@@ -2986,12 +3721,18 @@ class Order {
|
|
|
2986
3721
|
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/user/verify/otp`,
|
|
2987
3722
|
query_params,
|
|
2988
3723
|
body,
|
|
2989
|
-
xHeaders
|
|
3724
|
+
{ ...xHeaders, ...requestHeaders },
|
|
3725
|
+
{ responseHeaders }
|
|
2990
3726
|
);
|
|
2991
3727
|
|
|
3728
|
+
let responseData = response;
|
|
3729
|
+
if (responseHeaders) {
|
|
3730
|
+
responseData = response[0];
|
|
3731
|
+
}
|
|
3732
|
+
|
|
2992
3733
|
const {
|
|
2993
3734
|
error: res_error,
|
|
2994
|
-
} =
|
|
3735
|
+
} = OrderPlatformModel.VerifyOtpResponse().validate(responseData, {
|
|
2995
3736
|
abortEarly: false,
|
|
2996
3737
|
allowUnknown: false,
|
|
2997
3738
|
});
|
|
@@ -2999,9 +3740,8 @@ class Order {
|
|
|
2999
3740
|
if (res_error) {
|
|
3000
3741
|
Logger({
|
|
3001
3742
|
level: "WARN",
|
|
3002
|
-
message:
|
|
3743
|
+
message: `Response Validation Warnnings for platform > Order > verifyMobileOTP \n ${res_error}`,
|
|
3003
3744
|
});
|
|
3004
|
-
Logger({ level: "WARN", message: res_error });
|
|
3005
3745
|
}
|
|
3006
3746
|
|
|
3007
3747
|
return response;
|