@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 SharePlatformApplicationValidator = require("./SharePlatformApplicationValidator");
|
|
5
|
+
const SharePlatformModel = require("./SharePlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
7
|
const Joi = require("joi");
|
|
8
8
|
|
|
@@ -13,14 +13,21 @@ class Share {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
18
|
-
* @
|
|
16
|
+
* @param {SharePlatformApplicationValidator.CreateShortLinkParam} arg - Arg object
|
|
17
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
18
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
19
|
+
* @returns {Promise<SharePlatformModel.ShortLinkRes>} - Success response
|
|
20
|
+
* @name createShortLink
|
|
19
21
|
* @summary: Create short link
|
|
20
|
-
* @description: Create short link
|
|
22
|
+
* @description: Create short link - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/share/createShortLink/).
|
|
21
23
|
*/
|
|
22
|
-
async createShortLink(
|
|
23
|
-
|
|
24
|
+
async createShortLink(
|
|
25
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
26
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
27
|
+
) {
|
|
28
|
+
const {
|
|
29
|
+
error,
|
|
30
|
+
} = SharePlatformApplicationValidator.createShortLink().validate(
|
|
24
31
|
{
|
|
25
32
|
body,
|
|
26
33
|
},
|
|
@@ -31,7 +38,9 @@ class Share {
|
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
// Showing warrnings if extra unknown parameters are found
|
|
34
|
-
const {
|
|
41
|
+
const {
|
|
42
|
+
error: warrning,
|
|
43
|
+
} = SharePlatformApplicationValidator.createShortLink().validate(
|
|
35
44
|
{
|
|
36
45
|
body,
|
|
37
46
|
},
|
|
@@ -40,9 +49,8 @@ class Share {
|
|
|
40
49
|
if (warrning) {
|
|
41
50
|
Logger({
|
|
42
51
|
level: "WARN",
|
|
43
|
-
message:
|
|
52
|
+
message: `Parameter Validation warrnings for platform > Share > createShortLink \n ${warrning}`,
|
|
44
53
|
});
|
|
45
|
-
Logger({ level: "WARN", message: warrning });
|
|
46
54
|
}
|
|
47
55
|
|
|
48
56
|
const query_params = {};
|
|
@@ -52,10 +60,19 @@ class Share {
|
|
|
52
60
|
"post",
|
|
53
61
|
`/service/platform/share/v1.0/company/${this.config.companyId}/application/${this.applicationId}/links/short-link/`,
|
|
54
62
|
query_params,
|
|
55
|
-
body
|
|
63
|
+
body,
|
|
64
|
+
requestHeaders,
|
|
65
|
+
{ responseHeaders }
|
|
56
66
|
);
|
|
57
67
|
|
|
58
|
-
|
|
68
|
+
let responseData = response;
|
|
69
|
+
if (responseHeaders) {
|
|
70
|
+
responseData = response[0];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const {
|
|
74
|
+
error: res_error,
|
|
75
|
+
} = SharePlatformModel.ShortLinkRes().validate(responseData, {
|
|
59
76
|
abortEarly: false,
|
|
60
77
|
allowUnknown: false,
|
|
61
78
|
});
|
|
@@ -63,23 +80,29 @@ class Share {
|
|
|
63
80
|
if (res_error) {
|
|
64
81
|
Logger({
|
|
65
82
|
level: "WARN",
|
|
66
|
-
message:
|
|
83
|
+
message: `Response Validation Warnnings for platform > Share > createShortLink \n ${res_error}`,
|
|
67
84
|
});
|
|
68
|
-
Logger({ level: "WARN", message: res_error });
|
|
69
85
|
}
|
|
70
86
|
|
|
71
87
|
return response;
|
|
72
88
|
}
|
|
73
89
|
|
|
74
90
|
/**
|
|
75
|
-
* @param {
|
|
76
|
-
* @param {
|
|
77
|
-
* @
|
|
91
|
+
* @param {SharePlatformApplicationValidator.GetShortLinkByHashParam} arg - Arg object
|
|
92
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
93
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
94
|
+
* @returns {Promise<SharePlatformModel.ShortLinkRes>} - Success response
|
|
95
|
+
* @name getShortLinkByHash
|
|
78
96
|
* @summary: Get short link by hash
|
|
79
|
-
* @description: Get short link by hash
|
|
97
|
+
* @description: Get short link by hash - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/share/getShortLinkByHash/).
|
|
80
98
|
*/
|
|
81
|
-
async getShortLinkByHash(
|
|
82
|
-
|
|
99
|
+
async getShortLinkByHash(
|
|
100
|
+
{ hash, requestHeaders } = { requestHeaders: {} },
|
|
101
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
102
|
+
) {
|
|
103
|
+
const {
|
|
104
|
+
error,
|
|
105
|
+
} = SharePlatformApplicationValidator.getShortLinkByHash().validate(
|
|
83
106
|
{
|
|
84
107
|
hash,
|
|
85
108
|
},
|
|
@@ -90,7 +113,9 @@ class Share {
|
|
|
90
113
|
}
|
|
91
114
|
|
|
92
115
|
// Showing warrnings if extra unknown parameters are found
|
|
93
|
-
const {
|
|
116
|
+
const {
|
|
117
|
+
error: warrning,
|
|
118
|
+
} = SharePlatformApplicationValidator.getShortLinkByHash().validate(
|
|
94
119
|
{
|
|
95
120
|
hash,
|
|
96
121
|
},
|
|
@@ -99,9 +124,8 @@ class Share {
|
|
|
99
124
|
if (warrning) {
|
|
100
125
|
Logger({
|
|
101
126
|
level: "WARN",
|
|
102
|
-
message:
|
|
127
|
+
message: `Parameter Validation warrnings for platform > Share > getShortLinkByHash \n ${warrning}`,
|
|
103
128
|
});
|
|
104
|
-
Logger({ level: "WARN", message: warrning });
|
|
105
129
|
}
|
|
106
130
|
|
|
107
131
|
const query_params = {};
|
|
@@ -111,10 +135,19 @@ class Share {
|
|
|
111
135
|
"get",
|
|
112
136
|
`/service/platform/share/v1.0/company/${this.config.companyId}/application/${this.applicationId}/links/short-link/${hash}/`,
|
|
113
137
|
query_params,
|
|
114
|
-
undefined
|
|
138
|
+
undefined,
|
|
139
|
+
requestHeaders,
|
|
140
|
+
{ responseHeaders }
|
|
115
141
|
);
|
|
116
142
|
|
|
117
|
-
|
|
143
|
+
let responseData = response;
|
|
144
|
+
if (responseHeaders) {
|
|
145
|
+
responseData = response[0];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const {
|
|
149
|
+
error: res_error,
|
|
150
|
+
} = SharePlatformModel.ShortLinkRes().validate(responseData, {
|
|
118
151
|
abortEarly: false,
|
|
119
152
|
allowUnknown: false,
|
|
120
153
|
});
|
|
@@ -122,24 +155,31 @@ class Share {
|
|
|
122
155
|
if (res_error) {
|
|
123
156
|
Logger({
|
|
124
157
|
level: "WARN",
|
|
125
|
-
message:
|
|
158
|
+
message: `Response Validation Warnnings for platform > Share > getShortLinkByHash \n ${res_error}`,
|
|
126
159
|
});
|
|
127
|
-
Logger({ level: "WARN", message: res_error });
|
|
128
160
|
}
|
|
129
161
|
|
|
130
162
|
return response;
|
|
131
163
|
}
|
|
132
164
|
|
|
133
165
|
/**
|
|
134
|
-
* @param {
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* @
|
|
166
|
+
* @param {SharePlatformApplicationValidator.GetShortLinkClickStatsParam} arg
|
|
167
|
+
* - Arg object
|
|
168
|
+
*
|
|
169
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
170
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
171
|
+
* @returns {Promise<SharePlatformModel.ClickStatsResponse>} - Success response
|
|
172
|
+
* @name getShortLinkClickStats
|
|
138
173
|
* @summary: Get click statistics for a short link
|
|
139
|
-
* @description: Retrieve click statistics for a given short link ID.
|
|
174
|
+
* @description: Retrieve click statistics for a given short link ID. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/share/getShortLinkClickStats/).
|
|
140
175
|
*/
|
|
141
|
-
async getShortLinkClickStats(
|
|
142
|
-
|
|
176
|
+
async getShortLinkClickStats(
|
|
177
|
+
{ surlId, requestHeaders } = { requestHeaders: {} },
|
|
178
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
179
|
+
) {
|
|
180
|
+
const {
|
|
181
|
+
error,
|
|
182
|
+
} = SharePlatformApplicationValidator.getShortLinkClickStats().validate(
|
|
143
183
|
{ surlId },
|
|
144
184
|
{ abortEarly: false, allowUnknown: true }
|
|
145
185
|
);
|
|
@@ -150,16 +190,15 @@ class Share {
|
|
|
150
190
|
// Showing warrnings if extra unknown parameters are found
|
|
151
191
|
const {
|
|
152
192
|
error: warrning,
|
|
153
|
-
} =
|
|
193
|
+
} = SharePlatformApplicationValidator.getShortLinkClickStats().validate(
|
|
154
194
|
{ surlId },
|
|
155
195
|
{ abortEarly: false, allowUnknown: false }
|
|
156
196
|
);
|
|
157
197
|
if (warrning) {
|
|
158
198
|
Logger({
|
|
159
199
|
level: "WARN",
|
|
160
|
-
message:
|
|
200
|
+
message: `Parameter Validation warrnings for platform > Share > getShortLinkClickStats \n ${warrning}`,
|
|
161
201
|
});
|
|
162
|
-
Logger({ level: "WARN", message: warrning });
|
|
163
202
|
}
|
|
164
203
|
|
|
165
204
|
const query_params = {};
|
|
@@ -170,12 +209,19 @@ class Share {
|
|
|
170
209
|
"get",
|
|
171
210
|
`/service/platform/share/v1.0/company/${this.config.companyId}/application/${this.applicationId}/links/short-link/click-stats`,
|
|
172
211
|
query_params,
|
|
173
|
-
undefined
|
|
212
|
+
undefined,
|
|
213
|
+
requestHeaders,
|
|
214
|
+
{ responseHeaders }
|
|
174
215
|
);
|
|
175
216
|
|
|
217
|
+
let responseData = response;
|
|
218
|
+
if (responseHeaders) {
|
|
219
|
+
responseData = response[0];
|
|
220
|
+
}
|
|
221
|
+
|
|
176
222
|
const {
|
|
177
223
|
error: res_error,
|
|
178
|
-
} =
|
|
224
|
+
} = SharePlatformModel.ClickStatsResponse().validate(responseData, {
|
|
179
225
|
abortEarly: false,
|
|
180
226
|
allowUnknown: false,
|
|
181
227
|
});
|
|
@@ -183,27 +229,31 @@ class Share {
|
|
|
183
229
|
if (res_error) {
|
|
184
230
|
Logger({
|
|
185
231
|
level: "WARN",
|
|
186
|
-
message:
|
|
232
|
+
message: `Response Validation Warnnings for platform > Share > getShortLinkClickStats \n ${res_error}`,
|
|
187
233
|
});
|
|
188
|
-
Logger({ level: "WARN", message: res_error });
|
|
189
234
|
}
|
|
190
235
|
|
|
191
236
|
return response;
|
|
192
237
|
}
|
|
193
238
|
|
|
194
239
|
/**
|
|
195
|
-
* @param {
|
|
196
|
-
* @param {
|
|
197
|
-
* @param {
|
|
198
|
-
* @
|
|
199
|
-
* @
|
|
200
|
-
* @param {string} [arg.q] - Search text for original and short url
|
|
201
|
-
* @returns {Promise<ShortLinkList>} - Success response
|
|
240
|
+
* @param {SharePlatformApplicationValidator.GetShortLinksParam} arg - Arg object
|
|
241
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
242
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
243
|
+
* @returns {Promise<SharePlatformModel.ShortLinkList>} - Success response
|
|
244
|
+
* @name getShortLinks
|
|
202
245
|
* @summary: Get short links
|
|
203
|
-
* @description: Get short links
|
|
246
|
+
* @description: Get short links - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/share/getShortLinks/).
|
|
204
247
|
*/
|
|
205
|
-
async getShortLinks(
|
|
206
|
-
|
|
248
|
+
async getShortLinks(
|
|
249
|
+
{ pageNo, pageSize, createdBy, active, q, requestHeaders } = {
|
|
250
|
+
requestHeaders: {},
|
|
251
|
+
},
|
|
252
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
253
|
+
) {
|
|
254
|
+
const {
|
|
255
|
+
error,
|
|
256
|
+
} = SharePlatformApplicationValidator.getShortLinks().validate(
|
|
207
257
|
{
|
|
208
258
|
pageNo,
|
|
209
259
|
pageSize,
|
|
@@ -218,7 +268,9 @@ class Share {
|
|
|
218
268
|
}
|
|
219
269
|
|
|
220
270
|
// Showing warrnings if extra unknown parameters are found
|
|
221
|
-
const {
|
|
271
|
+
const {
|
|
272
|
+
error: warrning,
|
|
273
|
+
} = SharePlatformApplicationValidator.getShortLinks().validate(
|
|
222
274
|
{
|
|
223
275
|
pageNo,
|
|
224
276
|
pageSize,
|
|
@@ -231,9 +283,8 @@ class Share {
|
|
|
231
283
|
if (warrning) {
|
|
232
284
|
Logger({
|
|
233
285
|
level: "WARN",
|
|
234
|
-
message:
|
|
286
|
+
message: `Parameter Validation warrnings for platform > Share > getShortLinks \n ${warrning}`,
|
|
235
287
|
});
|
|
236
|
-
Logger({ level: "WARN", message: warrning });
|
|
237
288
|
}
|
|
238
289
|
|
|
239
290
|
const query_params = {};
|
|
@@ -248,10 +299,19 @@ class Share {
|
|
|
248
299
|
"get",
|
|
249
300
|
`/service/platform/share/v1.0/company/${this.config.companyId}/application/${this.applicationId}/links/short-link/`,
|
|
250
301
|
query_params,
|
|
251
|
-
undefined
|
|
302
|
+
undefined,
|
|
303
|
+
requestHeaders,
|
|
304
|
+
{ responseHeaders }
|
|
252
305
|
);
|
|
253
306
|
|
|
254
|
-
|
|
307
|
+
let responseData = response;
|
|
308
|
+
if (responseHeaders) {
|
|
309
|
+
responseData = response[0];
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const {
|
|
313
|
+
error: res_error,
|
|
314
|
+
} = SharePlatformModel.ShortLinkList().validate(responseData, {
|
|
255
315
|
abortEarly: false,
|
|
256
316
|
allowUnknown: false,
|
|
257
317
|
});
|
|
@@ -259,67 +319,31 @@ class Share {
|
|
|
259
319
|
if (res_error) {
|
|
260
320
|
Logger({
|
|
261
321
|
level: "WARN",
|
|
262
|
-
message:
|
|
322
|
+
message: `Response Validation Warnnings for platform > Share > getShortLinks \n ${res_error}`,
|
|
263
323
|
});
|
|
264
|
-
Logger({ level: "WARN", message: res_error });
|
|
265
324
|
}
|
|
266
325
|
|
|
267
326
|
return response;
|
|
268
327
|
}
|
|
269
328
|
|
|
270
329
|
/**
|
|
271
|
-
* @param {
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
* @param {
|
|
275
|
-
* @param {
|
|
276
|
-
* @
|
|
277
|
-
* @
|
|
278
|
-
* @summary: Get short links
|
|
279
|
-
* @description: Get short links
|
|
280
|
-
*/
|
|
281
|
-
getShortLinksPaginator({
|
|
282
|
-
companyId,
|
|
283
|
-
applicationId,
|
|
284
|
-
pageSize,
|
|
285
|
-
createdBy,
|
|
286
|
-
active,
|
|
287
|
-
q,
|
|
288
|
-
} = {}) {
|
|
289
|
-
const paginator = new Paginator();
|
|
290
|
-
const callback = async () => {
|
|
291
|
-
const pageId = paginator.nextId;
|
|
292
|
-
const pageNo = paginator.pageNo;
|
|
293
|
-
const pageType = "number";
|
|
294
|
-
const data = await this.getShortLinks({
|
|
295
|
-
companyId: companyId,
|
|
296
|
-
applicationId: applicationId,
|
|
297
|
-
pageNo: pageNo,
|
|
298
|
-
pageSize: pageSize,
|
|
299
|
-
createdBy: createdBy,
|
|
300
|
-
active: active,
|
|
301
|
-
q: q,
|
|
302
|
-
});
|
|
303
|
-
paginator.setPaginator({
|
|
304
|
-
hasNext: data.page.has_next ? true : false,
|
|
305
|
-
nextId: data.page.next_id,
|
|
306
|
-
});
|
|
307
|
-
return data;
|
|
308
|
-
};
|
|
309
|
-
paginator.setCallback(callback.bind(this));
|
|
310
|
-
return paginator;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* @param {Object} arg - Arg object.
|
|
315
|
-
* @param {string} arg.id - Short link document identifier
|
|
316
|
-
* @param {ShortLinkReq} arg.body
|
|
317
|
-
* @returns {Promise<ShortLinkRes>} - Success response
|
|
330
|
+
* @param {SharePlatformApplicationValidator.UpdateShortLinkByIdParam} arg
|
|
331
|
+
* - Arg object
|
|
332
|
+
*
|
|
333
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
334
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
335
|
+
* @returns {Promise<SharePlatformModel.ShortLinkRes>} - Success response
|
|
336
|
+
* @name updateShortLinkById
|
|
318
337
|
* @summary: Update short link by id
|
|
319
|
-
* @description: Update short link by id
|
|
338
|
+
* @description: Update short link by id - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/share/updateShortLinkById/).
|
|
320
339
|
*/
|
|
321
|
-
async updateShortLinkById(
|
|
322
|
-
|
|
340
|
+
async updateShortLinkById(
|
|
341
|
+
{ id, body, requestHeaders } = { requestHeaders: {} },
|
|
342
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
343
|
+
) {
|
|
344
|
+
const {
|
|
345
|
+
error,
|
|
346
|
+
} = SharePlatformApplicationValidator.updateShortLinkById().validate(
|
|
323
347
|
{
|
|
324
348
|
id,
|
|
325
349
|
body,
|
|
@@ -331,7 +355,9 @@ class Share {
|
|
|
331
355
|
}
|
|
332
356
|
|
|
333
357
|
// Showing warrnings if extra unknown parameters are found
|
|
334
|
-
const {
|
|
358
|
+
const {
|
|
359
|
+
error: warrning,
|
|
360
|
+
} = SharePlatformApplicationValidator.updateShortLinkById().validate(
|
|
335
361
|
{
|
|
336
362
|
id,
|
|
337
363
|
body,
|
|
@@ -341,9 +367,8 @@ class Share {
|
|
|
341
367
|
if (warrning) {
|
|
342
368
|
Logger({
|
|
343
369
|
level: "WARN",
|
|
344
|
-
message:
|
|
370
|
+
message: `Parameter Validation warrnings for platform > Share > updateShortLinkById \n ${warrning}`,
|
|
345
371
|
});
|
|
346
|
-
Logger({ level: "WARN", message: warrning });
|
|
347
372
|
}
|
|
348
373
|
|
|
349
374
|
const query_params = {};
|
|
@@ -353,10 +378,19 @@ class Share {
|
|
|
353
378
|
"patch",
|
|
354
379
|
`/service/platform/share/v1.0/company/${this.config.companyId}/application/${this.applicationId}/links/short-link/${id}/`,
|
|
355
380
|
query_params,
|
|
356
|
-
body
|
|
381
|
+
body,
|
|
382
|
+
requestHeaders,
|
|
383
|
+
{ responseHeaders }
|
|
357
384
|
);
|
|
358
385
|
|
|
359
|
-
|
|
386
|
+
let responseData = response;
|
|
387
|
+
if (responseHeaders) {
|
|
388
|
+
responseData = response[0];
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const {
|
|
392
|
+
error: res_error,
|
|
393
|
+
} = SharePlatformModel.ShortLinkRes().validate(responseData, {
|
|
360
394
|
abortEarly: false,
|
|
361
395
|
allowUnknown: false,
|
|
362
396
|
});
|
|
@@ -364,9 +398,8 @@ class Share {
|
|
|
364
398
|
if (res_error) {
|
|
365
399
|
Logger({
|
|
366
400
|
level: "WARN",
|
|
367
|
-
message:
|
|
401
|
+
message: `Response Validation Warnnings for platform > Share > updateShortLinkById \n ${res_error}`,
|
|
368
402
|
});
|
|
369
|
-
Logger({ level: "WARN", message: res_error });
|
|
370
403
|
}
|
|
371
404
|
|
|
372
405
|
return response;
|
|
@@ -1,8 +1,88 @@
|
|
|
1
|
-
export =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export = SharePlatformApplicationValidator;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef CreateShortLinkParam
|
|
4
|
+
* @property {SharePlatformModel.ShortLinkReq} body
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @typedef GetShortLinkByHashParam
|
|
8
|
+
* @property {string} hash - Hash of short url
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @typedef GetShortLinkClickStatsParam
|
|
12
|
+
* @property {string} surlId - Short link ID for which click statistics are to
|
|
13
|
+
* be retrieved.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @typedef GetShortLinksParam
|
|
17
|
+
* @property {number} [pageNo] - Current page number
|
|
18
|
+
* @property {number} [pageSize] - Current page size
|
|
19
|
+
* @property {string} [createdBy] - Short link creator
|
|
20
|
+
* @property {string} [active] - Short link active status
|
|
21
|
+
* @property {string} [q] - Search text for original and short url
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* @typedef UpdateShortLinkByIdParam
|
|
25
|
+
* @property {string} id - Short link document identifier
|
|
26
|
+
* @property {SharePlatformModel.ShortLinkReq} body
|
|
27
|
+
*/
|
|
28
|
+
declare class SharePlatformApplicationValidator {
|
|
29
|
+
/** @returns {CreateShortLinkParam} */
|
|
30
|
+
static createShortLink(): CreateShortLinkParam;
|
|
31
|
+
/** @returns {GetShortLinkByHashParam} */
|
|
32
|
+
static getShortLinkByHash(): GetShortLinkByHashParam;
|
|
33
|
+
/** @returns {GetShortLinkClickStatsParam} */
|
|
34
|
+
static getShortLinkClickStats(): GetShortLinkClickStatsParam;
|
|
35
|
+
/** @returns {GetShortLinksParam} */
|
|
36
|
+
static getShortLinks(): GetShortLinksParam;
|
|
37
|
+
/** @returns {UpdateShortLinkByIdParam} */
|
|
38
|
+
static updateShortLinkById(): UpdateShortLinkByIdParam;
|
|
8
39
|
}
|
|
40
|
+
declare namespace SharePlatformApplicationValidator {
|
|
41
|
+
export { CreateShortLinkParam, GetShortLinkByHashParam, GetShortLinkClickStatsParam, GetShortLinksParam, UpdateShortLinkByIdParam };
|
|
42
|
+
}
|
|
43
|
+
type CreateShortLinkParam = {
|
|
44
|
+
body: SharePlatformModel.ShortLinkReq;
|
|
45
|
+
};
|
|
46
|
+
type GetShortLinkByHashParam = {
|
|
47
|
+
/**
|
|
48
|
+
* - Hash of short url
|
|
49
|
+
*/
|
|
50
|
+
hash: string;
|
|
51
|
+
};
|
|
52
|
+
type GetShortLinkClickStatsParam = {
|
|
53
|
+
/**
|
|
54
|
+
* - Short link ID for which click statistics are to
|
|
55
|
+
* be retrieved.
|
|
56
|
+
*/
|
|
57
|
+
surlId: string;
|
|
58
|
+
};
|
|
59
|
+
type GetShortLinksParam = {
|
|
60
|
+
/**
|
|
61
|
+
* - Current page number
|
|
62
|
+
*/
|
|
63
|
+
pageNo?: number;
|
|
64
|
+
/**
|
|
65
|
+
* - Current page size
|
|
66
|
+
*/
|
|
67
|
+
pageSize?: number;
|
|
68
|
+
/**
|
|
69
|
+
* - Short link creator
|
|
70
|
+
*/
|
|
71
|
+
createdBy?: string;
|
|
72
|
+
/**
|
|
73
|
+
* - Short link active status
|
|
74
|
+
*/
|
|
75
|
+
active?: string;
|
|
76
|
+
/**
|
|
77
|
+
* - Search text for original and short url
|
|
78
|
+
*/
|
|
79
|
+
q?: string;
|
|
80
|
+
};
|
|
81
|
+
type UpdateShortLinkByIdParam = {
|
|
82
|
+
/**
|
|
83
|
+
* - Short link document identifier
|
|
84
|
+
*/
|
|
85
|
+
id: string;
|
|
86
|
+
body: SharePlatformModel.ShortLinkReq;
|
|
87
|
+
};
|
|
88
|
+
import SharePlatformModel = require("./SharePlatformModel");
|
|
@@ -1,25 +1,61 @@
|
|
|
1
1
|
const Joi = require("joi");
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const SharePlatformModel = require("./SharePlatformModel");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef CreateShortLinkParam
|
|
7
|
+
* @property {SharePlatformModel.ShortLinkReq} body
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @typedef GetShortLinkByHashParam
|
|
12
|
+
* @property {string} hash - Hash of short url
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @typedef GetShortLinkClickStatsParam
|
|
17
|
+
* @property {string} surlId - Short link ID for which click statistics are to
|
|
18
|
+
* be retrieved.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @typedef GetShortLinksParam
|
|
23
|
+
* @property {number} [pageNo] - Current page number
|
|
24
|
+
* @property {number} [pageSize] - Current page size
|
|
25
|
+
* @property {string} [createdBy] - Short link creator
|
|
26
|
+
* @property {string} [active] - Short link active status
|
|
27
|
+
* @property {string} [q] - Search text for original and short url
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @typedef UpdateShortLinkByIdParam
|
|
32
|
+
* @property {string} id - Short link document identifier
|
|
33
|
+
* @property {SharePlatformModel.ShortLinkReq} body
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
class SharePlatformApplicationValidator {
|
|
37
|
+
/** @returns {CreateShortLinkParam} */
|
|
5
38
|
static createShortLink() {
|
|
6
39
|
return Joi.object({
|
|
7
|
-
body:
|
|
40
|
+
body: SharePlatformModel.ShortLinkReq().required(),
|
|
8
41
|
}).required();
|
|
9
42
|
}
|
|
10
43
|
|
|
44
|
+
/** @returns {GetShortLinkByHashParam} */
|
|
11
45
|
static getShortLinkByHash() {
|
|
12
46
|
return Joi.object({
|
|
13
47
|
hash: Joi.string().allow("").required(),
|
|
14
48
|
}).required();
|
|
15
49
|
}
|
|
16
50
|
|
|
51
|
+
/** @returns {GetShortLinkClickStatsParam} */
|
|
17
52
|
static getShortLinkClickStats() {
|
|
18
53
|
return Joi.object({
|
|
19
54
|
surlId: Joi.string().allow("").required(),
|
|
20
55
|
}).required();
|
|
21
56
|
}
|
|
22
57
|
|
|
58
|
+
/** @returns {GetShortLinksParam} */
|
|
23
59
|
static getShortLinks() {
|
|
24
60
|
return Joi.object({
|
|
25
61
|
pageNo: Joi.number(),
|
|
@@ -30,12 +66,13 @@ class ShareValidator {
|
|
|
30
66
|
}).required();
|
|
31
67
|
}
|
|
32
68
|
|
|
69
|
+
/** @returns {UpdateShortLinkByIdParam} */
|
|
33
70
|
static updateShortLinkById() {
|
|
34
71
|
return Joi.object({
|
|
35
72
|
id: Joi.string().allow("").required(),
|
|
36
|
-
body:
|
|
73
|
+
body: SharePlatformModel.ShortLinkReq().required(),
|
|
37
74
|
}).required();
|
|
38
75
|
}
|
|
39
76
|
}
|
|
40
77
|
|
|
41
|
-
module.exports =
|
|
78
|
+
module.exports = SharePlatformApplicationValidator;
|