@gofynd/fdk-client-javascript 1.2.0 → 1.3.1-beta.1
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 +44 -7
- package/package.json +1 -2
- package/sdk/application/ApplicationAPIClient.d.ts +3 -3
- package/sdk/application/ApplicationAPIClient.js +6 -4
- package/sdk/application/ApplicationClient.d.ts +2 -3
- package/sdk/application/ApplicationClient.js +1 -45
- package/sdk/application/ApplicationConfig.d.ts +46 -6
- package/sdk/application/ApplicationConfig.js +15 -16
- package/sdk/application/Cart/CartApplicationClient.d.ts +61 -33
- package/sdk/application/Cart/CartApplicationClient.js +225 -134
- package/sdk/application/Cart/CartApplicationModel.d.ts +6 -4
- package/sdk/application/Cart/CartApplicationModel.js +6 -4
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +61 -30
- package/sdk/application/Catalog/CatalogApplicationClient.js +234 -146
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +115 -13
- package/sdk/application/Catalog/CatalogApplicationModel.js +77 -12
- package/sdk/application/Common/CommonApplicationClient.d.ts +5 -3
- package/sdk/application/Common/CommonApplicationClient.js +13 -11
- package/sdk/application/Common/CommonApplicationModel.d.ts +3 -83
- package/sdk/application/Common/CommonApplicationModel.js +2 -58
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +9 -3
- package/sdk/application/Communication/CommunicationApplicationClient.js +25 -13
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +1 -34
- package/sdk/application/Communication/CommunicationApplicationModel.js +0 -36
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +46 -16
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +144 -68
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1 -219
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -226
- package/sdk/application/Content/ContentApplicationClient.d.ts +49 -21
- package/sdk/application/Content/ContentApplicationClient.js +159 -80
- package/sdk/application/Content/ContentApplicationModel.d.ts +5 -622
- package/sdk/application/Content/ContentApplicationModel.js +11 -763
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +20 -14
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +1 -152
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -180
- package/sdk/application/Lead/LeadApplicationClient.d.ts +14 -7
- package/sdk/application/Lead/LeadApplicationClient.js +50 -31
- package/sdk/application/Lead/LeadApplicationModel.d.ts +22 -741
- package/sdk/application/Lead/LeadApplicationModel.js +21 -481
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +11 -5
- package/sdk/application/Logistic/LogisticApplicationClient.js +41 -20
- package/sdk/application/Order/OrderApplicationClient.d.ts +24 -12
- package/sdk/application/Order/OrderApplicationClient.js +88 -56
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +91 -42
- package/sdk/application/Payment/PaymentApplicationClient.js +293 -194
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +36 -36
- package/sdk/application/Payment/PaymentApplicationModel.js +36 -36
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +59 -32
- package/sdk/application/PosCart/PosCartApplicationClient.js +214 -130
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +2 -2
- package/sdk/application/PosCart/PosCartApplicationModel.js +2 -2
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +16 -7
- package/sdk/application/Rewards/RewardsApplicationClient.js +56 -29
- package/sdk/application/Share/ShareApplicationClient.d.ts +15 -7
- package/sdk/application/Share/ShareApplicationClient.js +51 -31
- package/sdk/application/Share/ShareApplicationModel.d.ts +1 -33
- package/sdk/application/Share/ShareApplicationModel.js +0 -38
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +9 -4
- package/sdk/application/Theme/ThemeApplicationClient.js +35 -18
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +982 -312
- package/sdk/application/Theme/ThemeApplicationModel.js +621 -284
- package/sdk/application/User/UserApplicationClient.d.ts +74 -35
- package/sdk/application/User/UserApplicationClient.js +252 -161
- package/sdk/application/User/UserApplicationModel.d.ts +3 -401
- package/sdk/application/User/UserApplicationModel.js +2 -490
- package/sdk/common/AxiosHelper.js +1 -2
- package/sdk/common/FDKError.d.ts +3 -0
- package/sdk/common/FDKError.js +8 -0
- package/sdk/common/utils.d.ts +3 -0
- package/sdk/common/utils.js +29 -0
- package/sdk/partner/PartnerAPIClient.d.ts +5 -4
- package/sdk/partner/PartnerAPIClient.js +7 -4
- package/sdk/partner/PartnerClient.d.ts +2 -0
- package/sdk/partner/PartnerClient.js +3 -0
- 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 +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +38 -16
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +1 -13
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +0 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +10 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +4 -0
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +59 -14
- package/sdk/platform/Billing/BillingPlatformClient.js +315 -64
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +56 -196
- package/sdk/platform/Billing/BillingPlatformModel.js +63 -217
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +23 -1
- package/sdk/platform/Billing/BillingPlatformValidator.js +31 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +124 -63
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +431 -265
- package/sdk/platform/Cart/CartPlatformModel.d.ts +253 -53
- package/sdk/platform/Cart/CartPlatformModel.js +104 -54
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +120 -53
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +398 -247
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +155 -78
- package/sdk/platform/Catalog/CatalogPlatformClient.js +561 -355
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +10 -12
- package/sdk/platform/Catalog/CatalogPlatformModel.js +10 -12
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +30 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -0
- package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -3
- package/sdk/platform/Common/CommonPlatformClient.js +13 -11
- package/sdk/platform/Common/CommonPlatformModel.d.ts +39 -64
- package/sdk/platform/Common/CommonPlatformModel.js +23 -57
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +5 -10
- package/sdk/platform/Common/CommonPlatformValidator.js +3 -4
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +370 -120
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2328 -888
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +143 -24
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +179 -15
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +6 -5
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +386 -308
- package/sdk/platform/Communication/CommunicationPlatformModel.js +415 -355
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +38 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +171 -57
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +53 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +54 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +5 -1
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +96 -29
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +311 -126
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +5 -1
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +7 -0
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +121 -86
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +13 -180
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +5 -113
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +162 -70
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +528 -309
- package/sdk/platform/Content/ContentPlatformModel.d.ts +9 -198
- package/sdk/platform/Content/ContentPlatformModel.js +8 -231
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +48 -11
- package/sdk/platform/Discount/DiscountPlatformClient.js +142 -48
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +40 -1
- package/sdk/platform/Discount/DiscountPlatformModel.js +27 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +84 -18
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +486 -53
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +71 -7
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +81 -5
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +13 -18
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +58 -65
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +198 -71
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +212 -64
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +18 -10
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -6
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +177 -40
- package/sdk/platform/Finance/FinancePlatformClient.js +1028 -132
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +670 -22
- package/sdk/platform/Finance/FinancePlatformModel.js +809 -23
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +111 -1
- package/sdk/platform/Finance/FinancePlatformValidator.js +134 -0
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +24 -12
- package/sdk/platform/Inventory/InventoryPlatformClient.js +94 -52
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +27 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +101 -55
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +50 -39
- package/sdk/platform/Lead/LeadPlatformClient.js +171 -112
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +32 -390
- package/sdk/platform/Lead/LeadPlatformModel.js +31 -214
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +33 -33
- package/sdk/platform/Lead/LeadPlatformValidator.js +23 -23
- package/sdk/platform/OAuthClient.js +6 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +12 -10
- package/sdk/platform/Order/OrderPlatformClient.d.ts +165 -71
- package/sdk/platform/Order/OrderPlatformClient.js +738 -205
- package/sdk/platform/Order/OrderPlatformModel.d.ts +261 -3
- package/sdk/platform/Order/OrderPlatformModel.js +225 -2
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +104 -3
- package/sdk/platform/Order/OrderPlatformValidator.js +85 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -22
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +12 -159
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +1 -30
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +0 -26
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -690
- package/sdk/platform/Partner/PartnerPlatformModel.js +0 -809
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +167 -32
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +793 -145
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +91 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +91 -0
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -10
- package/sdk/platform/Payment/PaymentPlatformClient.js +68 -47
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +549 -7
- package/sdk/platform/Payment/PaymentPlatformModel.js +305 -6
- package/sdk/platform/PlatformAPIClient.d.ts +3 -3
- package/sdk/platform/PlatformAPIClient.js +2 -2
- package/sdk/platform/PlatformClient.d.ts +2 -2
- package/sdk/platform/PlatformClient.js +4 -4
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +28 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +90 -53
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +1 -12
- package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -14
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +62 -26
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +210 -93
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +20 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +23 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +36 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +142 -78
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +12 -3
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +14 -2
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -26
- package/sdk/platform/Share/SharePlatformApplicationClient.js +36 -67
- package/sdk/platform/Share/SharePlatformModel.d.ts +4 -4
- package/sdk/platform/Share/SharePlatformModel.js +4 -4
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +127 -57
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +564 -189
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +63 -26
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +62 -22
- package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
- package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1167 -261
- package/sdk/platform/Theme/ThemePlatformModel.js +801 -244
- package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
- package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +35 -17
- package/sdk/platform/User/UserPlatformApplicationClient.js +132 -73
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.js +3 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +1 -738
- package/sdk/platform/User/UserPlatformModel.js +3 -899
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +120 -7
- package/sdk/platform/Webhook/WebhookPlatformClient.js +799 -41
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +476 -86
- package/sdk/platform/Webhook/WebhookPlatformModel.js +388 -89
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +90 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +113 -3
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +5 -3
- package/sdk/public/Configuration/ConfigurationPublicClient.js +13 -11
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +3 -106
- package/sdk/public/Configuration/ConfigurationPublicModel.js +2 -59
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +12 -6
- package/sdk/public/Inventory/InventoryPublicClient.js +42 -27
- 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 +2 -0
- package/sdk/public/PublicClient.js +4 -0
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +5 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +15 -9
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +1 -191
- package/sdk/public/Webhook/WebhookPublicModel.js +0 -229
- package/sdk/public/index.d.ts +1 -0
- package/sdk/public/index.js +2 -0
- package/sdk/application/ApplicationModels.d.ts +0 -48
- package/sdk/application/ApplicationModels.js +0 -38
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -106
- package/sdk/platform/Partner/PartnerPlatformClient.js +0 -878
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -208
- package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -169
|
@@ -1,878 +0,0 @@
|
|
|
1
|
-
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
|
-
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
-
const Paginator = require("../../common/Paginator");
|
|
4
|
-
const PartnerPlatformValidator = require("./PartnerPlatformValidator");
|
|
5
|
-
const PartnerPlatformModel = require("./PartnerPlatformModel");
|
|
6
|
-
const { Logger } = require("./../../common/Logger");
|
|
7
|
-
const Joi = require("joi");
|
|
8
|
-
|
|
9
|
-
class Partner {
|
|
10
|
-
constructor(config) {
|
|
11
|
-
this.config = config;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @param {PartnerPlatformValidator.DeleteExtensionByIdParam} arg - Arg object
|
|
16
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
17
|
-
* @returns {Promise<PartnerPlatformModel.UninstallExtension>} - Success response
|
|
18
|
-
* @name deleteExtensionById
|
|
19
|
-
* @summary: Uninstall extension
|
|
20
|
-
* @description: Use this API to remove extension from yout company or channel - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/partner/deleteExtensionById/).
|
|
21
|
-
*/
|
|
22
|
-
async deleteExtensionById(
|
|
23
|
-
{ extensionId, message, uninstallReasonType } = {},
|
|
24
|
-
{ headers } = { headers: false }
|
|
25
|
-
) {
|
|
26
|
-
const { error } = PartnerPlatformValidator.deleteExtensionById().validate(
|
|
27
|
-
{
|
|
28
|
-
extensionId,
|
|
29
|
-
message,
|
|
30
|
-
uninstallReasonType,
|
|
31
|
-
},
|
|
32
|
-
{ abortEarly: false, allowUnknown: true }
|
|
33
|
-
);
|
|
34
|
-
if (error) {
|
|
35
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Showing warrnings if extra unknown parameters are found
|
|
39
|
-
const {
|
|
40
|
-
error: warrning,
|
|
41
|
-
} = PartnerPlatformValidator.deleteExtensionById().validate(
|
|
42
|
-
{
|
|
43
|
-
extensionId,
|
|
44
|
-
message,
|
|
45
|
-
uninstallReasonType,
|
|
46
|
-
},
|
|
47
|
-
{ abortEarly: false, allowUnknown: false }
|
|
48
|
-
);
|
|
49
|
-
if (warrning) {
|
|
50
|
-
Logger({
|
|
51
|
-
level: "WARN",
|
|
52
|
-
message: `Parameter Validation warrnings for platform > Partner > deleteExtensionById \n ${warrning}`,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const query_params = {};
|
|
57
|
-
query_params["message"] = message;
|
|
58
|
-
query_params["uninstall_reason_type"] = uninstallReasonType;
|
|
59
|
-
|
|
60
|
-
const xHeaders = {};
|
|
61
|
-
|
|
62
|
-
const response = await PlatformAPIClient.execute(
|
|
63
|
-
this.config,
|
|
64
|
-
"delete",
|
|
65
|
-
`/service/platform/partners/v1.0/company/${this.config.companyId}/extension/${extensionId}`,
|
|
66
|
-
query_params,
|
|
67
|
-
undefined,
|
|
68
|
-
xHeaders,
|
|
69
|
-
{ headers }
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
let responseData = response;
|
|
73
|
-
if (headers) {
|
|
74
|
-
responseData = response[0];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const {
|
|
78
|
-
error: res_error,
|
|
79
|
-
} = PartnerPlatformModel.UninstallExtension().validate(responseData, {
|
|
80
|
-
abortEarly: false,
|
|
81
|
-
allowUnknown: false,
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
if (res_error) {
|
|
85
|
-
Logger({
|
|
86
|
-
level: "WARN",
|
|
87
|
-
message: `Response Validation Warnnings for platform > Partner > deleteExtensionById \n ${res_error}`,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return response;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* @param {PartnerPlatformValidator.GetExtensionByIdParam} arg - Arg object
|
|
96
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
97
|
-
* @returns {Promise<PartnerPlatformModel.ExtensionCommon>} - Success response
|
|
98
|
-
* @name getExtensionById
|
|
99
|
-
* @summary: Get extension details
|
|
100
|
-
* @description: Use this API to get the details of extension - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/partner/getExtensionById/).
|
|
101
|
-
*/
|
|
102
|
-
async getExtensionById(
|
|
103
|
-
{ extensionId } = {},
|
|
104
|
-
{ headers } = { headers: false }
|
|
105
|
-
) {
|
|
106
|
-
const { error } = PartnerPlatformValidator.getExtensionById().validate(
|
|
107
|
-
{
|
|
108
|
-
extensionId,
|
|
109
|
-
},
|
|
110
|
-
{ abortEarly: false, allowUnknown: true }
|
|
111
|
-
);
|
|
112
|
-
if (error) {
|
|
113
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Showing warrnings if extra unknown parameters are found
|
|
117
|
-
const {
|
|
118
|
-
error: warrning,
|
|
119
|
-
} = PartnerPlatformValidator.getExtensionById().validate(
|
|
120
|
-
{
|
|
121
|
-
extensionId,
|
|
122
|
-
},
|
|
123
|
-
{ abortEarly: false, allowUnknown: false }
|
|
124
|
-
);
|
|
125
|
-
if (warrning) {
|
|
126
|
-
Logger({
|
|
127
|
-
level: "WARN",
|
|
128
|
-
message: `Parameter Validation warrnings for platform > Partner > getExtensionById \n ${warrning}`,
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
const query_params = {};
|
|
133
|
-
|
|
134
|
-
const xHeaders = {};
|
|
135
|
-
|
|
136
|
-
const response = await PlatformAPIClient.execute(
|
|
137
|
-
this.config,
|
|
138
|
-
"get",
|
|
139
|
-
`/service/platform/partners/v1.0/company/${this.config.companyId}/extension/${extensionId}`,
|
|
140
|
-
query_params,
|
|
141
|
-
undefined,
|
|
142
|
-
xHeaders,
|
|
143
|
-
{ headers }
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
let responseData = response;
|
|
147
|
-
if (headers) {
|
|
148
|
-
responseData = response[0];
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const {
|
|
152
|
-
error: res_error,
|
|
153
|
-
} = PartnerPlatformModel.ExtensionCommon().validate(responseData, {
|
|
154
|
-
abortEarly: false,
|
|
155
|
-
allowUnknown: false,
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
if (res_error) {
|
|
159
|
-
Logger({
|
|
160
|
-
level: "WARN",
|
|
161
|
-
message: `Response Validation Warnnings for platform > Partner > getExtensionById \n ${res_error}`,
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return response;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* @param {PartnerPlatformValidator.GetExtensionsForCompanyParam} arg - Arg object
|
|
170
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
171
|
-
* @returns {Promise<PartnerPlatformModel.ExtensionList>} - Success response
|
|
172
|
-
* @name getExtensionsForCompany
|
|
173
|
-
* @summary: Get the list of all the extensions
|
|
174
|
-
* @description: Use this API to get the the extensions for the company - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/partner/getExtensionsForCompany/).
|
|
175
|
-
*/
|
|
176
|
-
async getExtensionsForCompany(
|
|
177
|
-
{ pageSize, tag, currentPage, pageNo, filterBy, query } = {},
|
|
178
|
-
{ headers } = { headers: false }
|
|
179
|
-
) {
|
|
180
|
-
const {
|
|
181
|
-
error,
|
|
182
|
-
} = PartnerPlatformValidator.getExtensionsForCompany().validate(
|
|
183
|
-
{
|
|
184
|
-
pageSize,
|
|
185
|
-
tag,
|
|
186
|
-
currentPage,
|
|
187
|
-
pageNo,
|
|
188
|
-
filterBy,
|
|
189
|
-
query,
|
|
190
|
-
},
|
|
191
|
-
{ abortEarly: false, allowUnknown: true }
|
|
192
|
-
);
|
|
193
|
-
if (error) {
|
|
194
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Showing warrnings if extra unknown parameters are found
|
|
198
|
-
const {
|
|
199
|
-
error: warrning,
|
|
200
|
-
} = PartnerPlatformValidator.getExtensionsForCompany().validate(
|
|
201
|
-
{
|
|
202
|
-
pageSize,
|
|
203
|
-
tag,
|
|
204
|
-
currentPage,
|
|
205
|
-
pageNo,
|
|
206
|
-
filterBy,
|
|
207
|
-
query,
|
|
208
|
-
},
|
|
209
|
-
{ abortEarly: false, allowUnknown: false }
|
|
210
|
-
);
|
|
211
|
-
if (warrning) {
|
|
212
|
-
Logger({
|
|
213
|
-
level: "WARN",
|
|
214
|
-
message: `Parameter Validation warrnings for platform > Partner > getExtensionsForCompany \n ${warrning}`,
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
const query_params = {};
|
|
219
|
-
query_params["page_size"] = pageSize;
|
|
220
|
-
query_params["tag"] = tag;
|
|
221
|
-
query_params["current_page"] = currentPage;
|
|
222
|
-
query_params["page_no"] = pageNo;
|
|
223
|
-
query_params["filter_by"] = filterBy;
|
|
224
|
-
query_params["query"] = query;
|
|
225
|
-
|
|
226
|
-
const xHeaders = {};
|
|
227
|
-
|
|
228
|
-
const response = await PlatformAPIClient.execute(
|
|
229
|
-
this.config,
|
|
230
|
-
"get",
|
|
231
|
-
`/service/platform/partners/v1.0/company/${this.config.companyId}/extensions`,
|
|
232
|
-
query_params,
|
|
233
|
-
undefined,
|
|
234
|
-
xHeaders,
|
|
235
|
-
{ headers }
|
|
236
|
-
);
|
|
237
|
-
|
|
238
|
-
let responseData = response;
|
|
239
|
-
if (headers) {
|
|
240
|
-
responseData = response[0];
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const {
|
|
244
|
-
error: res_error,
|
|
245
|
-
} = PartnerPlatformModel.ExtensionList().validate(responseData, {
|
|
246
|
-
abortEarly: false,
|
|
247
|
-
allowUnknown: false,
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
if (res_error) {
|
|
251
|
-
Logger({
|
|
252
|
-
level: "WARN",
|
|
253
|
-
message: `Response Validation Warnnings for platform > Partner > getExtensionsForCompany \n ${res_error}`,
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
return response;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* @param {PartnerPlatformValidator.GetExtensionsSuggestionsParam} arg - Arg object
|
|
262
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
263
|
-
* @returns {Promise<PartnerPlatformModel.ExtensionSuggestionList>} - Success response
|
|
264
|
-
* @name getExtensionsSuggestions
|
|
265
|
-
* @summary: Get the list of all the extension suggestions
|
|
266
|
-
* @description: Use this API to get the the extensions suggestions - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/partner/getExtensionsSuggestions/).
|
|
267
|
-
*/
|
|
268
|
-
async getExtensionsSuggestions(
|
|
269
|
-
{ pageSize } = {},
|
|
270
|
-
{ headers } = { headers: false }
|
|
271
|
-
) {
|
|
272
|
-
const {
|
|
273
|
-
error,
|
|
274
|
-
} = PartnerPlatformValidator.getExtensionsSuggestions().validate(
|
|
275
|
-
{
|
|
276
|
-
pageSize,
|
|
277
|
-
},
|
|
278
|
-
{ abortEarly: false, allowUnknown: true }
|
|
279
|
-
);
|
|
280
|
-
if (error) {
|
|
281
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
// Showing warrnings if extra unknown parameters are found
|
|
285
|
-
const {
|
|
286
|
-
error: warrning,
|
|
287
|
-
} = PartnerPlatformValidator.getExtensionsSuggestions().validate(
|
|
288
|
-
{
|
|
289
|
-
pageSize,
|
|
290
|
-
},
|
|
291
|
-
{ abortEarly: false, allowUnknown: false }
|
|
292
|
-
);
|
|
293
|
-
if (warrning) {
|
|
294
|
-
Logger({
|
|
295
|
-
level: "WARN",
|
|
296
|
-
message: `Parameter Validation warrnings for platform > Partner > getExtensionsSuggestions \n ${warrning}`,
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
const query_params = {};
|
|
301
|
-
query_params["page_size"] = pageSize;
|
|
302
|
-
|
|
303
|
-
const xHeaders = {};
|
|
304
|
-
|
|
305
|
-
const response = await PlatformAPIClient.execute(
|
|
306
|
-
this.config,
|
|
307
|
-
"get",
|
|
308
|
-
`/service/platform/partners/v1.0/company/${this.config.companyId}/extension/suggestions`,
|
|
309
|
-
query_params,
|
|
310
|
-
undefined,
|
|
311
|
-
xHeaders,
|
|
312
|
-
{ headers }
|
|
313
|
-
);
|
|
314
|
-
|
|
315
|
-
let responseData = response;
|
|
316
|
-
if (headers) {
|
|
317
|
-
responseData = response[0];
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
const {
|
|
321
|
-
error: res_error,
|
|
322
|
-
} = PartnerPlatformModel.ExtensionSuggestionList().validate(responseData, {
|
|
323
|
-
abortEarly: false,
|
|
324
|
-
allowUnknown: false,
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
if (res_error) {
|
|
328
|
-
Logger({
|
|
329
|
-
level: "WARN",
|
|
330
|
-
message: `Response Validation Warnnings for platform > Partner > getExtensionsSuggestions \n ${res_error}`,
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
return response;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* @param {PartnerPlatformValidator.GetPartnerInvitesParam} arg - Arg object
|
|
339
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
340
|
-
* @returns {Promise<PartnerPlatformModel.PartnerRequestList>} - Success response
|
|
341
|
-
* @name getPartnerInvites
|
|
342
|
-
* @summary: Get partner invites
|
|
343
|
-
* @description: Use this API to get pending, accepted and rejected partner invites in platform - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/partner/getPartnerInvites/).
|
|
344
|
-
*/
|
|
345
|
-
async getPartnerInvites(
|
|
346
|
-
{ requestStatus, pageSize, pageNo } = {},
|
|
347
|
-
{ headers } = { headers: false }
|
|
348
|
-
) {
|
|
349
|
-
const { error } = PartnerPlatformValidator.getPartnerInvites().validate(
|
|
350
|
-
{
|
|
351
|
-
requestStatus,
|
|
352
|
-
pageSize,
|
|
353
|
-
pageNo,
|
|
354
|
-
},
|
|
355
|
-
{ abortEarly: false, allowUnknown: true }
|
|
356
|
-
);
|
|
357
|
-
if (error) {
|
|
358
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
// Showing warrnings if extra unknown parameters are found
|
|
362
|
-
const {
|
|
363
|
-
error: warrning,
|
|
364
|
-
} = PartnerPlatformValidator.getPartnerInvites().validate(
|
|
365
|
-
{
|
|
366
|
-
requestStatus,
|
|
367
|
-
pageSize,
|
|
368
|
-
pageNo,
|
|
369
|
-
},
|
|
370
|
-
{ abortEarly: false, allowUnknown: false }
|
|
371
|
-
);
|
|
372
|
-
if (warrning) {
|
|
373
|
-
Logger({
|
|
374
|
-
level: "WARN",
|
|
375
|
-
message: `Parameter Validation warrnings for platform > Partner > getPartnerInvites \n ${warrning}`,
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
const query_params = {};
|
|
380
|
-
query_params["request_status"] = requestStatus;
|
|
381
|
-
query_params["page_size"] = pageSize;
|
|
382
|
-
query_params["page_no"] = pageNo;
|
|
383
|
-
|
|
384
|
-
const xHeaders = {};
|
|
385
|
-
|
|
386
|
-
const response = await PlatformAPIClient.execute(
|
|
387
|
-
this.config,
|
|
388
|
-
"get",
|
|
389
|
-
`/service/platform/partners/v1.0/company/${this.config.companyId}/partner-request`,
|
|
390
|
-
query_params,
|
|
391
|
-
undefined,
|
|
392
|
-
xHeaders,
|
|
393
|
-
{ headers }
|
|
394
|
-
);
|
|
395
|
-
|
|
396
|
-
let responseData = response;
|
|
397
|
-
if (headers) {
|
|
398
|
-
responseData = response[0];
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
const {
|
|
402
|
-
error: res_error,
|
|
403
|
-
} = PartnerPlatformModel.PartnerRequestList().validate(responseData, {
|
|
404
|
-
abortEarly: false,
|
|
405
|
-
allowUnknown: false,
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
if (res_error) {
|
|
409
|
-
Logger({
|
|
410
|
-
level: "WARN",
|
|
411
|
-
message: `Response Validation Warnnings for platform > Partner > getPartnerInvites \n ${res_error}`,
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
return response;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* @param {PartnerPlatformValidator.GetPartnerRequestDetailsParam} arg - Arg object
|
|
420
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
421
|
-
* @returns {Promise<PartnerPlatformModel.PartnerInviteDetails>} - Success response
|
|
422
|
-
* @name getPartnerRequestDetails
|
|
423
|
-
* @summary: Get partner request details
|
|
424
|
-
* @description: Use this API to get details of pending partner request - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/partner/getPartnerRequestDetails/).
|
|
425
|
-
*/
|
|
426
|
-
async getPartnerRequestDetails(
|
|
427
|
-
{ inviteId } = {},
|
|
428
|
-
{ headers } = { headers: false }
|
|
429
|
-
) {
|
|
430
|
-
const {
|
|
431
|
-
error,
|
|
432
|
-
} = PartnerPlatformValidator.getPartnerRequestDetails().validate(
|
|
433
|
-
{
|
|
434
|
-
inviteId,
|
|
435
|
-
},
|
|
436
|
-
{ abortEarly: false, allowUnknown: true }
|
|
437
|
-
);
|
|
438
|
-
if (error) {
|
|
439
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
// Showing warrnings if extra unknown parameters are found
|
|
443
|
-
const {
|
|
444
|
-
error: warrning,
|
|
445
|
-
} = PartnerPlatformValidator.getPartnerRequestDetails().validate(
|
|
446
|
-
{
|
|
447
|
-
inviteId,
|
|
448
|
-
},
|
|
449
|
-
{ abortEarly: false, allowUnknown: false }
|
|
450
|
-
);
|
|
451
|
-
if (warrning) {
|
|
452
|
-
Logger({
|
|
453
|
-
level: "WARN",
|
|
454
|
-
message: `Parameter Validation warrnings for platform > Partner > getPartnerRequestDetails \n ${warrning}`,
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
const query_params = {};
|
|
459
|
-
|
|
460
|
-
const xHeaders = {};
|
|
461
|
-
|
|
462
|
-
const response = await PlatformAPIClient.execute(
|
|
463
|
-
this.config,
|
|
464
|
-
"get",
|
|
465
|
-
`/service/platform/partners/v1.0/company/${this.config.companyId}/partner-request/${inviteId}`,
|
|
466
|
-
query_params,
|
|
467
|
-
undefined,
|
|
468
|
-
xHeaders,
|
|
469
|
-
{ headers }
|
|
470
|
-
);
|
|
471
|
-
|
|
472
|
-
let responseData = response;
|
|
473
|
-
if (headers) {
|
|
474
|
-
responseData = response[0];
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
const {
|
|
478
|
-
error: res_error,
|
|
479
|
-
} = PartnerPlatformModel.PartnerInviteDetails().validate(responseData, {
|
|
480
|
-
abortEarly: false,
|
|
481
|
-
allowUnknown: false,
|
|
482
|
-
});
|
|
483
|
-
|
|
484
|
-
if (res_error) {
|
|
485
|
-
Logger({
|
|
486
|
-
level: "WARN",
|
|
487
|
-
message: `Response Validation Warnnings for platform > Partner > getPartnerRequestDetails \n ${res_error}`,
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
return response;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* @param {PartnerPlatformValidator.GetPrivateExtensionsParam} arg - Arg object
|
|
496
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
497
|
-
* @returns {Promise<PartnerPlatformModel.ExtensionResponse>} - Success response
|
|
498
|
-
* @name getPrivateExtensions
|
|
499
|
-
* @summary: Get the list of private extensions
|
|
500
|
-
* @description: Use this API to get the list of private extensions - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/partner/getPrivateExtensions/).
|
|
501
|
-
*/
|
|
502
|
-
async getPrivateExtensions(
|
|
503
|
-
{ pageSize, pageNo, query } = {},
|
|
504
|
-
{ headers } = { headers: false }
|
|
505
|
-
) {
|
|
506
|
-
const { error } = PartnerPlatformValidator.getPrivateExtensions().validate(
|
|
507
|
-
{
|
|
508
|
-
pageSize,
|
|
509
|
-
pageNo,
|
|
510
|
-
query,
|
|
511
|
-
},
|
|
512
|
-
{ abortEarly: false, allowUnknown: true }
|
|
513
|
-
);
|
|
514
|
-
if (error) {
|
|
515
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
// Showing warrnings if extra unknown parameters are found
|
|
519
|
-
const {
|
|
520
|
-
error: warrning,
|
|
521
|
-
} = PartnerPlatformValidator.getPrivateExtensions().validate(
|
|
522
|
-
{
|
|
523
|
-
pageSize,
|
|
524
|
-
pageNo,
|
|
525
|
-
query,
|
|
526
|
-
},
|
|
527
|
-
{ abortEarly: false, allowUnknown: false }
|
|
528
|
-
);
|
|
529
|
-
if (warrning) {
|
|
530
|
-
Logger({
|
|
531
|
-
level: "WARN",
|
|
532
|
-
message: `Parameter Validation warrnings for platform > Partner > getPrivateExtensions \n ${warrning}`,
|
|
533
|
-
});
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
const query_params = {};
|
|
537
|
-
query_params["page_size"] = pageSize;
|
|
538
|
-
query_params["page_no"] = pageNo;
|
|
539
|
-
query_params["query"] = query;
|
|
540
|
-
|
|
541
|
-
const xHeaders = {};
|
|
542
|
-
|
|
543
|
-
const response = await PlatformAPIClient.execute(
|
|
544
|
-
this.config,
|
|
545
|
-
"get",
|
|
546
|
-
`/service/platform/partners/v1.0/company/${this.config.companyId}/private-extensions`,
|
|
547
|
-
query_params,
|
|
548
|
-
undefined,
|
|
549
|
-
xHeaders,
|
|
550
|
-
{ headers }
|
|
551
|
-
);
|
|
552
|
-
|
|
553
|
-
let responseData = response;
|
|
554
|
-
if (headers) {
|
|
555
|
-
responseData = response[0];
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
const {
|
|
559
|
-
error: res_error,
|
|
560
|
-
} = PartnerPlatformModel.ExtensionResponse().validate(responseData, {
|
|
561
|
-
abortEarly: false,
|
|
562
|
-
allowUnknown: false,
|
|
563
|
-
});
|
|
564
|
-
|
|
565
|
-
if (res_error) {
|
|
566
|
-
Logger({
|
|
567
|
-
level: "WARN",
|
|
568
|
-
message: `Response Validation Warnnings for platform > Partner > getPrivateExtensions \n ${res_error}`,
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
return response;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
/**
|
|
576
|
-
* @param {PartnerPlatformValidator.GetPublicExtensionParam} arg - Arg object
|
|
577
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
578
|
-
* @returns {Promise<PartnerPlatformModel.PublicExtension>} - Success response
|
|
579
|
-
* @name getPublicExtension
|
|
580
|
-
* @summary: Get details of public extension
|
|
581
|
-
* @description: Use this API to get the details of public extensions - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/partner/getPublicExtension/).
|
|
582
|
-
*/
|
|
583
|
-
async getPublicExtension(
|
|
584
|
-
{ extensionId } = {},
|
|
585
|
-
{ headers } = { headers: false }
|
|
586
|
-
) {
|
|
587
|
-
const { error } = PartnerPlatformValidator.getPublicExtension().validate(
|
|
588
|
-
{
|
|
589
|
-
extensionId,
|
|
590
|
-
},
|
|
591
|
-
{ abortEarly: false, allowUnknown: true }
|
|
592
|
-
);
|
|
593
|
-
if (error) {
|
|
594
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
// Showing warrnings if extra unknown parameters are found
|
|
598
|
-
const {
|
|
599
|
-
error: warrning,
|
|
600
|
-
} = PartnerPlatformValidator.getPublicExtension().validate(
|
|
601
|
-
{
|
|
602
|
-
extensionId,
|
|
603
|
-
},
|
|
604
|
-
{ abortEarly: false, allowUnknown: false }
|
|
605
|
-
);
|
|
606
|
-
if (warrning) {
|
|
607
|
-
Logger({
|
|
608
|
-
level: "WARN",
|
|
609
|
-
message: `Parameter Validation warrnings for platform > Partner > getPublicExtension \n ${warrning}`,
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
const query_params = {};
|
|
614
|
-
|
|
615
|
-
const xHeaders = {};
|
|
616
|
-
|
|
617
|
-
const response = await PlatformAPIClient.execute(
|
|
618
|
-
this.config,
|
|
619
|
-
"get",
|
|
620
|
-
`/service/platform/partners/v1.0/company/${this.config.companyId}/public-extension/${extensionId}`,
|
|
621
|
-
query_params,
|
|
622
|
-
undefined,
|
|
623
|
-
xHeaders,
|
|
624
|
-
{ headers }
|
|
625
|
-
);
|
|
626
|
-
|
|
627
|
-
let responseData = response;
|
|
628
|
-
if (headers) {
|
|
629
|
-
responseData = response[0];
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
const {
|
|
633
|
-
error: res_error,
|
|
634
|
-
} = PartnerPlatformModel.PublicExtension().validate(responseData, {
|
|
635
|
-
abortEarly: false,
|
|
636
|
-
allowUnknown: false,
|
|
637
|
-
});
|
|
638
|
-
|
|
639
|
-
if (res_error) {
|
|
640
|
-
Logger({
|
|
641
|
-
level: "WARN",
|
|
642
|
-
message: `Response Validation Warnnings for platform > Partner > getPublicExtension \n ${res_error}`,
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
return response;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
/**
|
|
650
|
-
* @param {PartnerPlatformValidator.ModifyPartnerRequestParam} arg - Arg object
|
|
651
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
652
|
-
* @returns {Promise<PartnerPlatformModel.PartnerInviteDetails>} - Success response
|
|
653
|
-
* @name modifyPartnerRequest
|
|
654
|
-
* @summary: Act on the pending partner request
|
|
655
|
-
* @description: Use this API to approve or reject the pending partner request - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/partner/modifyPartnerRequest/).
|
|
656
|
-
*/
|
|
657
|
-
async modifyPartnerRequest(
|
|
658
|
-
{ inviteId, body } = {},
|
|
659
|
-
{ headers } = { headers: false }
|
|
660
|
-
) {
|
|
661
|
-
const { error } = PartnerPlatformValidator.modifyPartnerRequest().validate(
|
|
662
|
-
{
|
|
663
|
-
inviteId,
|
|
664
|
-
body,
|
|
665
|
-
},
|
|
666
|
-
{ abortEarly: false, allowUnknown: true }
|
|
667
|
-
);
|
|
668
|
-
if (error) {
|
|
669
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
// Showing warrnings if extra unknown parameters are found
|
|
673
|
-
const {
|
|
674
|
-
error: warrning,
|
|
675
|
-
} = PartnerPlatformValidator.modifyPartnerRequest().validate(
|
|
676
|
-
{
|
|
677
|
-
inviteId,
|
|
678
|
-
body,
|
|
679
|
-
},
|
|
680
|
-
{ abortEarly: false, allowUnknown: false }
|
|
681
|
-
);
|
|
682
|
-
if (warrning) {
|
|
683
|
-
Logger({
|
|
684
|
-
level: "WARN",
|
|
685
|
-
message: `Parameter Validation warrnings for platform > Partner > modifyPartnerRequest \n ${warrning}`,
|
|
686
|
-
});
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
const query_params = {};
|
|
690
|
-
|
|
691
|
-
const xHeaders = {};
|
|
692
|
-
|
|
693
|
-
const response = await PlatformAPIClient.execute(
|
|
694
|
-
this.config,
|
|
695
|
-
"put",
|
|
696
|
-
`/service/platform/partners/v1.0/company/${this.config.companyId}/partner-request/${inviteId}`,
|
|
697
|
-
query_params,
|
|
698
|
-
body,
|
|
699
|
-
xHeaders,
|
|
700
|
-
{ headers }
|
|
701
|
-
);
|
|
702
|
-
|
|
703
|
-
let responseData = response;
|
|
704
|
-
if (headers) {
|
|
705
|
-
responseData = response[0];
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
const {
|
|
709
|
-
error: res_error,
|
|
710
|
-
} = PartnerPlatformModel.PartnerInviteDetails().validate(responseData, {
|
|
711
|
-
abortEarly: false,
|
|
712
|
-
allowUnknown: false,
|
|
713
|
-
});
|
|
714
|
-
|
|
715
|
-
if (res_error) {
|
|
716
|
-
Logger({
|
|
717
|
-
level: "WARN",
|
|
718
|
-
message: `Response Validation Warnnings for platform > Partner > modifyPartnerRequest \n ${res_error}`,
|
|
719
|
-
});
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
return response;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
* @param {PartnerPlatformValidator.SetupProductsParam} arg - Arg object
|
|
727
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
728
|
-
* @returns {Promise<PartnerPlatformModel.SetupProductRes>} - Success response
|
|
729
|
-
* @name setupProducts
|
|
730
|
-
* @summary:
|
|
731
|
-
* @description: Use this API for setup - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/partner/setupProducts/).
|
|
732
|
-
*/
|
|
733
|
-
async setupProducts({ requestId } = {}, { headers } = { headers: false }) {
|
|
734
|
-
const { error } = PartnerPlatformValidator.setupProducts().validate(
|
|
735
|
-
{
|
|
736
|
-
requestId,
|
|
737
|
-
},
|
|
738
|
-
{ abortEarly: false, allowUnknown: true }
|
|
739
|
-
);
|
|
740
|
-
if (error) {
|
|
741
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
// Showing warrnings if extra unknown parameters are found
|
|
745
|
-
const {
|
|
746
|
-
error: warrning,
|
|
747
|
-
} = PartnerPlatformValidator.setupProducts().validate(
|
|
748
|
-
{
|
|
749
|
-
requestId,
|
|
750
|
-
},
|
|
751
|
-
{ abortEarly: false, allowUnknown: false }
|
|
752
|
-
);
|
|
753
|
-
if (warrning) {
|
|
754
|
-
Logger({
|
|
755
|
-
level: "WARN",
|
|
756
|
-
message: `Parameter Validation warrnings for platform > Partner > setupProducts \n ${warrning}`,
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
const query_params = {};
|
|
761
|
-
query_params["request_id"] = requestId;
|
|
762
|
-
|
|
763
|
-
const xHeaders = {};
|
|
764
|
-
|
|
765
|
-
const response = await PlatformAPIClient.execute(
|
|
766
|
-
this.config,
|
|
767
|
-
"post",
|
|
768
|
-
`/service/platform/partners/v1.0/company/${this.config.companyId}/setup`,
|
|
769
|
-
query_params,
|
|
770
|
-
undefined,
|
|
771
|
-
xHeaders,
|
|
772
|
-
{ headers }
|
|
773
|
-
);
|
|
774
|
-
|
|
775
|
-
let responseData = response;
|
|
776
|
-
if (headers) {
|
|
777
|
-
responseData = response[0];
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
const {
|
|
781
|
-
error: res_error,
|
|
782
|
-
} = PartnerPlatformModel.SetupProductRes().validate(responseData, {
|
|
783
|
-
abortEarly: false,
|
|
784
|
-
allowUnknown: false,
|
|
785
|
-
});
|
|
786
|
-
|
|
787
|
-
if (res_error) {
|
|
788
|
-
Logger({
|
|
789
|
-
level: "WARN",
|
|
790
|
-
message: `Response Validation Warnnings for platform > Partner > setupProducts \n ${res_error}`,
|
|
791
|
-
});
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
return response;
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
/**
|
|
798
|
-
* @param {PartnerPlatformValidator.SubscribeExtensionParam} arg - Arg object
|
|
799
|
-
* @param {import("../PlatformAPIClient").Options} - Options
|
|
800
|
-
* @returns {Promise<PartnerPlatformModel.SubscriptionRes>} - Success response
|
|
801
|
-
* @name subscribeExtension
|
|
802
|
-
* @summary: Subscribe for extension plan
|
|
803
|
-
* @description: Use this API to select plan for paid extension - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/partner/subscribeExtension/).
|
|
804
|
-
*/
|
|
805
|
-
async subscribeExtension(
|
|
806
|
-
{ entity, extensionId, entityId, body } = {},
|
|
807
|
-
{ headers } = { headers: false }
|
|
808
|
-
) {
|
|
809
|
-
const { error } = PartnerPlatformValidator.subscribeExtension().validate(
|
|
810
|
-
{
|
|
811
|
-
entity,
|
|
812
|
-
extensionId,
|
|
813
|
-
entityId,
|
|
814
|
-
body,
|
|
815
|
-
},
|
|
816
|
-
{ abortEarly: false, allowUnknown: true }
|
|
817
|
-
);
|
|
818
|
-
if (error) {
|
|
819
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
// Showing warrnings if extra unknown parameters are found
|
|
823
|
-
const {
|
|
824
|
-
error: warrning,
|
|
825
|
-
} = PartnerPlatformValidator.subscribeExtension().validate(
|
|
826
|
-
{
|
|
827
|
-
entity,
|
|
828
|
-
extensionId,
|
|
829
|
-
entityId,
|
|
830
|
-
body,
|
|
831
|
-
},
|
|
832
|
-
{ abortEarly: false, allowUnknown: false }
|
|
833
|
-
);
|
|
834
|
-
if (warrning) {
|
|
835
|
-
Logger({
|
|
836
|
-
level: "WARN",
|
|
837
|
-
message: `Parameter Validation warrnings for platform > Partner > subscribeExtension \n ${warrning}`,
|
|
838
|
-
});
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
const query_params = {};
|
|
842
|
-
|
|
843
|
-
const xHeaders = {};
|
|
844
|
-
|
|
845
|
-
const response = await PlatformAPIClient.execute(
|
|
846
|
-
this.config,
|
|
847
|
-
"post",
|
|
848
|
-
`/service/platform/partners/v1.0/company/${this.config.companyId}/extension/${extensionId}/${entity}/${entityId}/charge_consent`,
|
|
849
|
-
query_params,
|
|
850
|
-
body,
|
|
851
|
-
xHeaders,
|
|
852
|
-
{ headers }
|
|
853
|
-
);
|
|
854
|
-
|
|
855
|
-
let responseData = response;
|
|
856
|
-
if (headers) {
|
|
857
|
-
responseData = response[0];
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
const {
|
|
861
|
-
error: res_error,
|
|
862
|
-
} = PartnerPlatformModel.SubscriptionRes().validate(responseData, {
|
|
863
|
-
abortEarly: false,
|
|
864
|
-
allowUnknown: false,
|
|
865
|
-
});
|
|
866
|
-
|
|
867
|
-
if (res_error) {
|
|
868
|
-
Logger({
|
|
869
|
-
level: "WARN",
|
|
870
|
-
message: `Response Validation Warnnings for platform > Partner > subscribeExtension \n ${res_error}`,
|
|
871
|
-
});
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
return response;
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
module.exports = Partner;
|