@gofynd/fdk-client-javascript 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/index.d.ts +7 -7
- package/index.js +12 -12
- package/package.json +1 -1
- package/sdk/application/ApplicationClient.d.ts +20 -20
- package/sdk/application/ApplicationClient.js +26 -26
- package/sdk/application/Cart/CartApplicationClient.d.ts +36 -6
- package/sdk/application/Cart/CartApplicationClient.js +105 -10
- package/sdk/application/Cart/CartApplicationModel.d.ts +9 -0
- package/sdk/application/Cart/CartApplicationModel.js +105 -1
- package/sdk/application/Cart/CartApplicationValidator.d.ts +1 -0
- package/sdk/application/Cart/CartApplicationValidator.js +15 -1
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1 -0
- package/sdk/application/Catalog/CatalogApplicationModel.js +13 -0
- package/sdk/application/Common/CommonApplicationModel.js +4 -0
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +14 -10
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +16 -10
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +6 -5
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
- package/sdk/application/Content/ContentApplicationModel.js +3 -1
- package/sdk/application/Lead/LeadApplicationModel.js +4 -1
- package/sdk/application/Logistic/LogisticApplicationModel.js +3 -2
- package/sdk/application/Order/OrderApplicationClient.d.ts +2 -2
- package/sdk/application/Order/OrderApplicationClient.js +2 -2
- package/sdk/application/Order/OrderApplicationModel.js +18 -8
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +35 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +200 -0
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +4 -0
- package/sdk/application/Payment/PaymentApplicationModel.js +58 -7
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +3 -0
- package/sdk/application/Payment/PaymentApplicationValidator.js +19 -0
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +16 -3
- package/sdk/application/PosCart/PosCartApplicationClient.js +39 -6
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +6 -0
- package/sdk/application/PosCart/PosCartApplicationModel.js +63 -1
- package/sdk/application/PosCart/PosCartApplicationValidator.js +6 -0
- package/sdk/application/index.d.ts +10 -10
- package/sdk/application/index.js +13 -13
- package/sdk/common/Constant.d.ts +5 -0
- package/sdk/common/Constant.js +5 -0
- package/sdk/partner/OAuthClient.js +1 -1
- package/sdk/platform/Billing/BillingPlatformModel.js +6 -1
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +491 -2
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +2661 -337
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +32 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +269 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +58 -0
- package/sdk/platform/Cart/CartPlatformModel.js +652 -3
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +8 -2
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +10 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -0
- package/sdk/platform/Catalog/CatalogPlatformClient.js +2 -2
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.js +43 -31
- package/sdk/platform/Common/CommonPlatformModel.js +4 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.js +9 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +2 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +2 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +5 -4
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +99 -78
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +99 -78
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +87 -71
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +87 -71
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +2 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +34 -7
- package/sdk/platform/Content/ContentPlatformModel.js +3 -1
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +135 -0
- package/sdk/platform/Finance/FinancePlatformClient.js +853 -0
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +51 -0
- package/sdk/platform/Finance/FinancePlatformModel.js +342 -0
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +16 -0
- package/sdk/platform/Finance/FinancePlatformValidator.js +84 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +11 -1
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +66 -2
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -0
- package/sdk/platform/Order/OrderPlatformClient.d.ts +161 -79
- package/sdk/platform/Order/OrderPlatformClient.js +546 -114
- package/sdk/platform/Order/OrderPlatformModel.d.ts +42 -6
- package/sdk/platform/Order/OrderPlatformModel.js +569 -159
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +6 -0
- package/sdk/platform/Order/OrderPlatformValidator.js +52 -9
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +22 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +127 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +2 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +13 -0
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +145 -0
- package/sdk/platform/Partner/PartnerPlatformClient.js +799 -0
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +39 -0
- package/sdk/platform/Partner/PartnerPlatformModel.js +367 -0
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +14 -0
- package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +221 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1476 -190
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +20 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +126 -0
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +48 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +452 -7
- package/sdk/platform/PlatformApplicationClient.d.ts +1249 -937
- package/sdk/platform/PlatformApplicationClient.js +1366 -1033
- package/sdk/platform/PlatformClient.d.ts +10979 -8771
- package/sdk/platform/PlatformClient.js +11874 -9197
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +134 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +852 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +16 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +81 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +223 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +1296 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +97 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +778 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +21 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +130 -0
- package/sdk/platform/index.d.ts +16 -14
- package/sdk/platform/index.js +22 -18
- package/sdk/public/Configuration/ConfigurationPublicModel.js +5 -0
- package/sdk/public/PublicClient.d.ts +2 -2
- package/sdk/public/PublicClient.js +4 -4
- package/sdk/public/index.d.ts +1 -1
- package/sdk/public/index.js +2 -2
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export = OrderValidator;
|
|
2
2
|
declare class OrderValidator {
|
|
3
|
+
static attachOrderUser(): any;
|
|
3
4
|
static checkOrderStatus(): any;
|
|
4
5
|
static click2Call(): any;
|
|
5
6
|
static createChannelConfig(): any;
|
|
6
7
|
static createOrder(): any;
|
|
7
8
|
static dispatchManifest(): any;
|
|
8
9
|
static downloadBulkActionTemplate(): any;
|
|
10
|
+
static fetchCreditBalanceDetail(): any;
|
|
11
|
+
static fetchRefundModeConfig(): any;
|
|
12
|
+
static generatePOSReceiptByOrderId(): any;
|
|
9
13
|
static getAnnouncements(): any;
|
|
10
14
|
static getBagById(): any;
|
|
11
15
|
static getBags(): any;
|
|
@@ -28,9 +32,11 @@ declare class OrderValidator {
|
|
|
28
32
|
static processManifest(): any;
|
|
29
33
|
static reassignLocation(): any;
|
|
30
34
|
static sendSmsNinja(): any;
|
|
35
|
+
static sendUserMobileOTP(): any;
|
|
31
36
|
static updateAddress(): any;
|
|
32
37
|
static updatePackagingDimensions(): any;
|
|
33
38
|
static updateShipmentLock(): any;
|
|
34
39
|
static updateShipmentStatus(): any;
|
|
35
40
|
static uploadConsent(): any;
|
|
41
|
+
static verifyMobileOTP(): any;
|
|
36
42
|
}
|
|
@@ -2,6 +2,12 @@ const Joi = require("joi");
|
|
|
2
2
|
|
|
3
3
|
const OrderModel = require("./OrderPlatformModel");
|
|
4
4
|
class OrderValidator {
|
|
5
|
+
static attachOrderUser() {
|
|
6
|
+
return Joi.object({
|
|
7
|
+
body: OrderModel.AttachOrderUser().required(),
|
|
8
|
+
}).required();
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
static checkOrderStatus() {
|
|
6
12
|
return Joi.object({
|
|
7
13
|
body: OrderModel.OrderStatus().required(),
|
|
@@ -42,6 +48,26 @@ class OrderValidator {
|
|
|
42
48
|
}).required();
|
|
43
49
|
}
|
|
44
50
|
|
|
51
|
+
static fetchCreditBalanceDetail() {
|
|
52
|
+
return Joi.object({
|
|
53
|
+
body: OrderModel.FetchCreditBalanceRequestPayload().required(),
|
|
54
|
+
}).required();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static fetchRefundModeConfig() {
|
|
58
|
+
return Joi.object({
|
|
59
|
+
body: OrderModel.RefundModeConfigRequestPayload().required(),
|
|
60
|
+
}).required();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static generatePOSReceiptByOrderId() {
|
|
64
|
+
return Joi.object({
|
|
65
|
+
orderId: Joi.string().allow("").required(),
|
|
66
|
+
shipmentId: Joi.string().allow(""),
|
|
67
|
+
documentType: Joi.string().allow(""),
|
|
68
|
+
}).required();
|
|
69
|
+
}
|
|
70
|
+
|
|
45
71
|
static getAnnouncements() {
|
|
46
72
|
return Joi.object({
|
|
47
73
|
date: Joi.string().allow(""),
|
|
@@ -103,9 +129,15 @@ class OrderValidator {
|
|
|
103
129
|
toDate: Joi.string().allow(""),
|
|
104
130
|
dpIds: Joi.string().allow(""),
|
|
105
131
|
stores: Joi.string().allow(""),
|
|
106
|
-
|
|
132
|
+
salesChannels: Joi.string().allow(""),
|
|
107
133
|
paymentMode: Joi.string().allow(""),
|
|
108
134
|
bagStatus: Joi.string().allow(""),
|
|
135
|
+
searchType: Joi.string().allow(""),
|
|
136
|
+
searchValue: Joi.string().allow(""),
|
|
137
|
+
tags: Joi.string().allow(""),
|
|
138
|
+
timeToDispatch: Joi.string().allow(""),
|
|
139
|
+
paymentMethods: Joi.string().allow(""),
|
|
140
|
+
myOrders: Joi.boolean(),
|
|
109
141
|
}).required();
|
|
110
142
|
}
|
|
111
143
|
|
|
@@ -133,6 +165,7 @@ class OrderValidator {
|
|
|
133
165
|
pageSize: Joi.number(),
|
|
134
166
|
isPrioritySort: Joi.boolean(),
|
|
135
167
|
customMeta: Joi.string().allow(""),
|
|
168
|
+
myOrders: Joi.boolean(),
|
|
136
169
|
}).required();
|
|
137
170
|
}
|
|
138
171
|
|
|
@@ -144,8 +177,6 @@ class OrderValidator {
|
|
|
144
177
|
return Joi.object({
|
|
145
178
|
channelShipmentId: Joi.string().allow(""),
|
|
146
179
|
shipmentId: Joi.string().allow(""),
|
|
147
|
-
orderingCompanyId: Joi.string().allow(""),
|
|
148
|
-
requestByExt: Joi.string().allow(""),
|
|
149
180
|
}).required();
|
|
150
181
|
}
|
|
151
182
|
|
|
@@ -169,19 +200,16 @@ class OrderValidator {
|
|
|
169
200
|
lane: Joi.string().allow(""),
|
|
170
201
|
bagStatus: Joi.string().allow(""),
|
|
171
202
|
statusOverrideLane: Joi.boolean(),
|
|
203
|
+
timeToDispatch: Joi.string().allow(""),
|
|
172
204
|
searchType: Joi.string().allow(""),
|
|
173
205
|
searchValue: Joi.string().allow(""),
|
|
174
|
-
searchId: Joi.string().allow(""),
|
|
175
206
|
fromDate: Joi.string().allow(""),
|
|
176
207
|
toDate: Joi.string().allow(""),
|
|
177
208
|
dpIds: Joi.string().allow(""),
|
|
178
|
-
orderingCompanyId: Joi.string().allow(""),
|
|
179
209
|
stores: Joi.string().allow(""),
|
|
180
|
-
|
|
181
|
-
requestByExt: Joi.string().allow(""),
|
|
210
|
+
salesChannels: Joi.string().allow(""),
|
|
182
211
|
pageNo: Joi.number(),
|
|
183
212
|
pageSize: Joi.number(),
|
|
184
|
-
isPrioritySort: Joi.boolean(),
|
|
185
213
|
fetchActiveShipment: Joi.boolean(),
|
|
186
214
|
excludeLockedShipments: Joi.boolean(),
|
|
187
215
|
paymentMethods: Joi.string().allow(""),
|
|
@@ -190,6 +218,9 @@ class OrderValidator {
|
|
|
190
218
|
customMeta: Joi.string().allow(""),
|
|
191
219
|
orderingChannel: Joi.string().allow(""),
|
|
192
220
|
companyAffiliateTag: Joi.string().allow(""),
|
|
221
|
+
myOrders: Joi.boolean(),
|
|
222
|
+
platformUserId: Joi.string().allow(""),
|
|
223
|
+
tags: Joi.string().allow(""),
|
|
193
224
|
}).required();
|
|
194
225
|
}
|
|
195
226
|
|
|
@@ -240,6 +271,12 @@ class OrderValidator {
|
|
|
240
271
|
}).required();
|
|
241
272
|
}
|
|
242
273
|
|
|
274
|
+
static sendUserMobileOTP() {
|
|
275
|
+
return Joi.object({
|
|
276
|
+
body: OrderModel.SendUserMobileOTP().required(),
|
|
277
|
+
}).required();
|
|
278
|
+
}
|
|
279
|
+
|
|
243
280
|
static updateAddress() {
|
|
244
281
|
return Joi.object({
|
|
245
282
|
shipmentId: Joi.string().allow("").required(),
|
|
@@ -259,7 +296,7 @@ class OrderValidator {
|
|
|
259
296
|
|
|
260
297
|
static updatePackagingDimensions() {
|
|
261
298
|
return Joi.object({
|
|
262
|
-
body: OrderModel.
|
|
299
|
+
body: OrderModel.UpdatePackagingDimensionsPayload().required(),
|
|
263
300
|
}).required();
|
|
264
301
|
}
|
|
265
302
|
|
|
@@ -280,6 +317,12 @@ class OrderValidator {
|
|
|
280
317
|
body: OrderModel.UploadConsent().required(),
|
|
281
318
|
}).required();
|
|
282
319
|
}
|
|
320
|
+
|
|
321
|
+
static verifyMobileOTP() {
|
|
322
|
+
return Joi.object({
|
|
323
|
+
body: OrderModel.VerifyMobileOTP().required(),
|
|
324
|
+
}).required();
|
|
325
|
+
}
|
|
283
326
|
}
|
|
284
327
|
|
|
285
328
|
module.exports = OrderValidator;
|
|
@@ -16,6 +16,28 @@ declare class Partner {
|
|
|
16
16
|
extensionId: string;
|
|
17
17
|
body: AddProxyReq;
|
|
18
18
|
}): Promise<AddProxyResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* @param {Object} arg - Arg object.
|
|
21
|
+
* @param {string} [arg.extensionId] - Extension id
|
|
22
|
+
* @returns {Promise<getProxyPathRes>} - Success response
|
|
23
|
+
* @summary: Proxy
|
|
24
|
+
* @description: Use this API to get proxy url
|
|
25
|
+
*/
|
|
26
|
+
getProxyPath({ extensionId }?: {
|
|
27
|
+
extensionId?: string;
|
|
28
|
+
}): Promise<getProxyPathRes>;
|
|
29
|
+
/**
|
|
30
|
+
* @param {Object} arg - Arg object.
|
|
31
|
+
* @param {string} [arg.extensionId] - Extension id
|
|
32
|
+
* @param {string} [arg.attachedPath] - Application id
|
|
33
|
+
* @returns {Promise<AddProxyResponse>} - Success response
|
|
34
|
+
* @summary: Proxy
|
|
35
|
+
* @description: Use this API to get proxy url
|
|
36
|
+
*/
|
|
37
|
+
getProxyPathAttachedPath({ extensionId, attachedPath }?: {
|
|
38
|
+
extensionId?: string;
|
|
39
|
+
attachedPath?: string;
|
|
40
|
+
}): Promise<AddProxyResponse>;
|
|
19
41
|
/**
|
|
20
42
|
* @param {Object} arg - Arg object.
|
|
21
43
|
* @param {string} arg.extensionId - Extension id for which proxy URL needs
|
|
@@ -77,6 +77,133 @@ class Partner {
|
|
|
77
77
|
return response;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* @param {Object} arg - Arg object.
|
|
82
|
+
* @param {string} [arg.extensionId] - Extension id
|
|
83
|
+
* @returns {Promise<getProxyPathRes>} - Success response
|
|
84
|
+
* @summary: Proxy
|
|
85
|
+
* @description: Use this API to get proxy url
|
|
86
|
+
*/
|
|
87
|
+
async getProxyPath({ extensionId } = {}) {
|
|
88
|
+
const { error } = PartnerValidator.getProxyPath().validate(
|
|
89
|
+
{
|
|
90
|
+
extensionId,
|
|
91
|
+
},
|
|
92
|
+
{ abortEarly: false, allowUnknown: true }
|
|
93
|
+
);
|
|
94
|
+
if (error) {
|
|
95
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Showing warrnings if extra unknown parameters are found
|
|
99
|
+
const { error: warrning } = PartnerValidator.getProxyPath().validate(
|
|
100
|
+
{
|
|
101
|
+
extensionId,
|
|
102
|
+
},
|
|
103
|
+
{ abortEarly: false, allowUnknown: false }
|
|
104
|
+
);
|
|
105
|
+
if (warrning) {
|
|
106
|
+
Logger({
|
|
107
|
+
level: "WARN",
|
|
108
|
+
message: "Parameter Validation warrnings for getProxyPath",
|
|
109
|
+
});
|
|
110
|
+
Logger({ level: "WARN", message: warrning });
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const query_params = {};
|
|
114
|
+
|
|
115
|
+
const response = await PlatformAPIClient.execute(
|
|
116
|
+
this.config,
|
|
117
|
+
"get",
|
|
118
|
+
`/service/platform/partners/v1.0/company/${this.config.companyId}/application/${this.applicationId}/proxy/${extensionId}`,
|
|
119
|
+
query_params,
|
|
120
|
+
undefined
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
const {
|
|
124
|
+
error: res_error,
|
|
125
|
+
} = PartnerModel.getProxyPathRes().validate(response, {
|
|
126
|
+
abortEarly: false,
|
|
127
|
+
allowUnknown: false,
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
if (res_error) {
|
|
131
|
+
Logger({
|
|
132
|
+
level: "WARN",
|
|
133
|
+
message: "Response Validation Warnnings for getProxyPath",
|
|
134
|
+
});
|
|
135
|
+
Logger({ level: "WARN", message: res_error });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return response;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @param {Object} arg - Arg object.
|
|
143
|
+
* @param {string} [arg.extensionId] - Extension id
|
|
144
|
+
* @param {string} [arg.attachedPath] - Application id
|
|
145
|
+
* @returns {Promise<AddProxyResponse>} - Success response
|
|
146
|
+
* @summary: Proxy
|
|
147
|
+
* @description: Use this API to get proxy url
|
|
148
|
+
*/
|
|
149
|
+
async getProxyPathAttachedPath({ extensionId, attachedPath } = {}) {
|
|
150
|
+
const { error } = PartnerValidator.getProxyPathAttachedPath().validate(
|
|
151
|
+
{
|
|
152
|
+
extensionId,
|
|
153
|
+
attachedPath,
|
|
154
|
+
},
|
|
155
|
+
{ abortEarly: false, allowUnknown: true }
|
|
156
|
+
);
|
|
157
|
+
if (error) {
|
|
158
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Showing warrnings if extra unknown parameters are found
|
|
162
|
+
const {
|
|
163
|
+
error: warrning,
|
|
164
|
+
} = PartnerValidator.getProxyPathAttachedPath().validate(
|
|
165
|
+
{
|
|
166
|
+
extensionId,
|
|
167
|
+
attachedPath,
|
|
168
|
+
},
|
|
169
|
+
{ abortEarly: false, allowUnknown: false }
|
|
170
|
+
);
|
|
171
|
+
if (warrning) {
|
|
172
|
+
Logger({
|
|
173
|
+
level: "WARN",
|
|
174
|
+
message: "Parameter Validation warrnings for getProxyPathAttachedPath",
|
|
175
|
+
});
|
|
176
|
+
Logger({ level: "WARN", message: warrning });
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const query_params = {};
|
|
180
|
+
|
|
181
|
+
const response = await PlatformAPIClient.execute(
|
|
182
|
+
this.config,
|
|
183
|
+
"get",
|
|
184
|
+
`/service/platform/partners/v1.0/company/${this.config.companyId}/application/${this.applicationId}/proxy/${extensionId}/${attachedPath}`,
|
|
185
|
+
query_params,
|
|
186
|
+
undefined
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
const {
|
|
190
|
+
error: res_error,
|
|
191
|
+
} = PartnerModel.AddProxyResponse().validate(response, {
|
|
192
|
+
abortEarly: false,
|
|
193
|
+
allowUnknown: false,
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
if (res_error) {
|
|
197
|
+
Logger({
|
|
198
|
+
level: "WARN",
|
|
199
|
+
message: "Response Validation Warnnings for getProxyPathAttachedPath",
|
|
200
|
+
});
|
|
201
|
+
Logger({ level: "WARN", message: res_error });
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return response;
|
|
205
|
+
}
|
|
206
|
+
|
|
80
207
|
/**
|
|
81
208
|
* @param {Object} arg - Arg object.
|
|
82
209
|
* @param {string} arg.extensionId - Extension id for which proxy URL needs
|
|
@@ -9,6 +9,19 @@ class PartnerValidator {
|
|
|
9
9
|
}).required();
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
static getProxyPath() {
|
|
13
|
+
return Joi.object({
|
|
14
|
+
extensionId: Joi.string().allow(""),
|
|
15
|
+
}).required();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static getProxyPathAttachedPath() {
|
|
19
|
+
return Joi.object({
|
|
20
|
+
extensionId: Joi.string().allow(""),
|
|
21
|
+
attachedPath: Joi.string().allow(""),
|
|
22
|
+
}).required();
|
|
23
|
+
}
|
|
24
|
+
|
|
12
25
|
static removeProxyPath() {
|
|
13
26
|
return Joi.object({
|
|
14
27
|
extensionId: Joi.string().allow("").required(),
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
export = Partner;
|
|
2
|
+
declare class Partner {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @param {string} arg.extensionId - Extension id
|
|
8
|
+
* @param {string} arg.message - Message while uninstalling extension
|
|
9
|
+
* @param {string} arg.uninstallReasonType - Reason for uninstalling extension
|
|
10
|
+
* @returns {Promise<UninstallExtension>} - Success response
|
|
11
|
+
* @summary: Uninstall extension
|
|
12
|
+
* @description: Use this API to remove extension from yout company or channel
|
|
13
|
+
*/
|
|
14
|
+
deleteExtensionById({ extensionId, message, uninstallReasonType, }?: {
|
|
15
|
+
extensionId: string;
|
|
16
|
+
message: string;
|
|
17
|
+
uninstallReasonType: string;
|
|
18
|
+
}): Promise<UninstallExtension>;
|
|
19
|
+
/**
|
|
20
|
+
* @param {Object} arg - Arg object.
|
|
21
|
+
* @param {string} arg.extensionId - Extension id
|
|
22
|
+
* @returns {Promise<ExtensionCommon>} - Success response
|
|
23
|
+
* @summary: Get extension details
|
|
24
|
+
* @description: Use this API to get the details of extension
|
|
25
|
+
*/
|
|
26
|
+
getExtensionById({ extensionId }?: {
|
|
27
|
+
extensionId: string;
|
|
28
|
+
}): Promise<ExtensionCommon>;
|
|
29
|
+
/**
|
|
30
|
+
* @param {Object} arg - Arg object.
|
|
31
|
+
* @param {number} [arg.pageSize] - Number of records you want to get in single page
|
|
32
|
+
* @param {string} [arg.tag] - Tag
|
|
33
|
+
* @param {string} [arg.currentPage] - Tag
|
|
34
|
+
* @param {number} [arg.pageNo] - Current page number
|
|
35
|
+
* @param {string} [arg.filterBy] - Filter by
|
|
36
|
+
* @param {string} [arg.query] - Query
|
|
37
|
+
* @returns {Promise<ExtensionList>} - Success response
|
|
38
|
+
* @summary: Get the list of all the extensions
|
|
39
|
+
* @description: Use this API to get the the extensions for the company
|
|
40
|
+
*/
|
|
41
|
+
getExtensionsForCompany({ pageSize, tag, currentPage, pageNo, filterBy, query, }?: {
|
|
42
|
+
pageSize?: number;
|
|
43
|
+
tag?: string;
|
|
44
|
+
currentPage?: string;
|
|
45
|
+
pageNo?: number;
|
|
46
|
+
filterBy?: string;
|
|
47
|
+
query?: string;
|
|
48
|
+
}): Promise<ExtensionList>;
|
|
49
|
+
/**
|
|
50
|
+
* @param {Object} arg - Arg object.
|
|
51
|
+
* @param {number} [arg.pageSize] - Number of records you want to get in single page
|
|
52
|
+
* @returns {Promise<ExtensionSuggestionList>} - Success response
|
|
53
|
+
* @summary: Get the list of all the extension suggestions
|
|
54
|
+
* @description: Use this API to get the the extensions suggestions
|
|
55
|
+
*/
|
|
56
|
+
getExtensionsSuggestions({ pageSize }?: {
|
|
57
|
+
pageSize?: number;
|
|
58
|
+
}): Promise<ExtensionSuggestionList>;
|
|
59
|
+
/**
|
|
60
|
+
* @param {Object} arg - Arg object.
|
|
61
|
+
* @param {string} [arg.requestStatus] - Status of the request
|
|
62
|
+
* @param {string} [arg.pageSize] - Number of records per page
|
|
63
|
+
* @param {string} [arg.pageNo] - Number of page the user want to fetch
|
|
64
|
+
* @returns {Promise<PartnerRequestList>} - Success response
|
|
65
|
+
* @summary: Get partner invites
|
|
66
|
+
* @description: Use this API to get pending, accepted and rejected partner invites in platform
|
|
67
|
+
*/
|
|
68
|
+
getPartnerInvites({ requestStatus, pageSize, pageNo }?: {
|
|
69
|
+
requestStatus?: string;
|
|
70
|
+
pageSize?: string;
|
|
71
|
+
pageNo?: string;
|
|
72
|
+
}): Promise<PartnerRequestList>;
|
|
73
|
+
/**
|
|
74
|
+
* @param {Object} arg - Arg object.
|
|
75
|
+
* @param {string} arg.inviteId - Invitation id
|
|
76
|
+
* @returns {Promise<PartnerInviteDetails>} - Success response
|
|
77
|
+
* @summary: Get partner request details
|
|
78
|
+
* @description: Use this API to get details of pending partner request
|
|
79
|
+
*/
|
|
80
|
+
getPartnerRequestDetails({ inviteId }?: {
|
|
81
|
+
inviteId: string;
|
|
82
|
+
}): Promise<PartnerInviteDetails>;
|
|
83
|
+
/**
|
|
84
|
+
* @param {Object} arg - Arg object.
|
|
85
|
+
* @param {number} [arg.pageSize] - Number of records you want to get in single page
|
|
86
|
+
* @param {number} [arg.pageNo] - Number of page
|
|
87
|
+
* @param {string} [arg.query] - Filter query which we want to pass
|
|
88
|
+
* @returns {Promise<ExtensionResponse>} - Success response
|
|
89
|
+
* @summary: Get the list of private extensions
|
|
90
|
+
* @description: Use this API to get the list of private extensions
|
|
91
|
+
*/
|
|
92
|
+
getPrivateExtensions({ pageSize, pageNo, query }?: {
|
|
93
|
+
pageSize?: number;
|
|
94
|
+
pageNo?: number;
|
|
95
|
+
query?: string;
|
|
96
|
+
}): Promise<ExtensionResponse>;
|
|
97
|
+
/**
|
|
98
|
+
* @param {Object} arg - Arg object.
|
|
99
|
+
* @param {string} arg.extensionId - Extension id
|
|
100
|
+
* @returns {Promise<PublicExtension>} - Success response
|
|
101
|
+
* @summary: Get details of public extension
|
|
102
|
+
* @description: Use this API to get the details of public extensions
|
|
103
|
+
*/
|
|
104
|
+
getPublicExtension({ extensionId }?: {
|
|
105
|
+
extensionId: string;
|
|
106
|
+
}): Promise<PublicExtension>;
|
|
107
|
+
/**
|
|
108
|
+
* @param {Object} arg - Arg object.
|
|
109
|
+
* @param {string} arg.inviteId - Invitation id
|
|
110
|
+
* @param {ModifyPartnerReq} arg.body
|
|
111
|
+
* @returns {Promise<PartnerInviteDetails>} - Success response
|
|
112
|
+
* @summary: Act on the pending partner request
|
|
113
|
+
* @description: Use this API to approve or reject the pending partner request
|
|
114
|
+
*/
|
|
115
|
+
modifyPartnerRequest({ inviteId, body }?: {
|
|
116
|
+
inviteId: string;
|
|
117
|
+
body: ModifyPartnerReq;
|
|
118
|
+
}): Promise<PartnerInviteDetails>;
|
|
119
|
+
/**
|
|
120
|
+
* @param {Object} arg - Arg object.
|
|
121
|
+
* @param {string} [arg.requestId] - Extrequest id
|
|
122
|
+
* @returns {Promise<SetupProductRes>} - Success response
|
|
123
|
+
* @summary:
|
|
124
|
+
* @description: Use this API for setup
|
|
125
|
+
*/
|
|
126
|
+
setupProducts({ requestId }?: {
|
|
127
|
+
requestId?: string;
|
|
128
|
+
}): Promise<SetupProductRes>;
|
|
129
|
+
/**
|
|
130
|
+
* @param {Object} arg - Arg object.
|
|
131
|
+
* @param {string} arg.entity - Entity
|
|
132
|
+
* @param {string} arg.extensionId - Extension id
|
|
133
|
+
* @param {string} arg.entityId - Entity id
|
|
134
|
+
* @param {SubscriptionRequest} arg.body
|
|
135
|
+
* @returns {Promise<SubscriptionRes>} - Success response
|
|
136
|
+
* @summary: Subscribe for extension plan
|
|
137
|
+
* @description: Use this API to select plan for paid extension
|
|
138
|
+
*/
|
|
139
|
+
subscribeExtension({ entity, extensionId, entityId, body }?: {
|
|
140
|
+
entity: string;
|
|
141
|
+
extensionId: string;
|
|
142
|
+
entityId: string;
|
|
143
|
+
body: SubscriptionRequest;
|
|
144
|
+
}): Promise<SubscriptionRes>;
|
|
145
|
+
}
|