@gofynd/fdk-client-javascript 1.4.15-beta.1 → 1.4.15-beta.10
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/application.d.ts +1 -2
- package/application.js +2 -3
- package/index.d.ts +1 -2
- package/index.js +7 -1
- package/package.json +2 -3
- package/sdk/application/ApplicationClient.js +0 -18
- package/sdk/application/Cart/CartApplicationClient.d.ts +55 -90
- package/sdk/application/Cart/CartApplicationClient.js +60 -1185
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +80 -142
- package/sdk/application/Catalog/CatalogApplicationClient.js +148 -1293
- package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
- package/sdk/application/Common/CommonApplicationClient.js +5 -89
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
- package/sdk/application/Communication/CommunicationApplicationClient.js +6 -145
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +31 -718
- package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
- package/sdk/application/Content/ContentApplicationClient.js +77 -914
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +9 -12
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +22 -125
- package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
- package/sdk/application/Lead/LeadApplicationClient.js +32 -202
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
- package/sdk/application/Logistic/LogisticApplicationClient.js +50 -478
- package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
- package/sdk/application/Order/OrderApplicationClient.js +86 -472
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
- package/sdk/application/Payment/PaymentApplicationClient.js +57 -2102
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
- package/sdk/application/Rewards/RewardsApplicationClient.js +16 -305
- package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
- package/sdk/application/Share/ShareApplicationClient.js +34 -294
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
- package/sdk/application/Theme/ThemeApplicationClient.js +28 -162
- package/sdk/application/User/UserApplicationClient.d.ts +85 -136
- package/sdk/application/User/UserApplicationClient.js +45 -1815
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
- package/sdk/application/Webhook/WebhookApplicationClient.js +4 -47
- package/sdk/application/index.d.ts +0 -18
- package/sdk/application/index.js +0 -33
- package/sdk/common/Utility.d.ts +1 -1
- package/sdk/common/Utility.js +10 -7
- package/sdk/common/Validator.d.ts +1 -0
- package/sdk/common/Validator.js +20 -0
- package/sdk/common/utils.d.ts +0 -1
- package/sdk/common/utils.js +0 -14
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +2 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +2 -0
- package/sdk/partner/OAuthClient.js +1 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
- package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
- package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -0
- package/sdk/platform/Cart/CartPlatformModel.js +12 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
- package/sdk/platform/Catalog/CatalogPlatformModel.js +1 -4
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +14 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +6 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -1
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +3 -0
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -1
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +20 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
- package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
- package/sdk/platform/Order/OrderPlatformClient.js +99 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +7 -0
- package/sdk/platform/Order/OrderPlatformModel.js +3 -0
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +56 -19
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +42 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +3 -3
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -2
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
- package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
- package/sdk/public/Configuration/ConfigurationPublicClient.js +5 -2
- package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
- package/sdk/public/Content/ContentPublicClient.js +14 -2
- package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
- package/sdk/public/Partner/PartnerPublicClient.js +14 -2
- package/sdk/public/Webhook/WebhookPublicClient.js +5 -2
- package/sdk/application/Cart/CartApplicationModel.d.ts +0 -3994
- package/sdk/application/Cart/CartApplicationModel.js +0 -2497
- package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -769
- package/sdk/application/Cart/CartApplicationValidator.js +0 -530
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3857
- package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2629
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -791
- package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -551
- package/sdk/application/Common/CommonApplicationModel.d.ts +0 -449
- package/sdk/application/Common/CommonApplicationModel.js +0 -308
- package/sdk/application/Common/CommonApplicationValidator.d.ts +0 -46
- package/sdk/application/Common/CommonApplicationValidator.js +0 -38
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +0 -293
- package/sdk/application/Communication/CommunicationApplicationModel.js +0 -201
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +0 -29
- package/sdk/application/Communication/CommunicationApplicationValidator.js +0 -38
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +0 -2556
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1887
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +0 -179
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +0 -176
- package/sdk/application/Content/ContentApplicationModel.d.ts +0 -2133
- package/sdk/application/Content/ContentApplicationModel.js +0 -1589
- package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -284
- package/sdk/application/Content/ContentApplicationValidator.js +0 -264
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -272
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -190
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
- package/sdk/application/Lead/LeadApplicationModel.d.ts +0 -590
- package/sdk/application/Lead/LeadApplicationModel.js +0 -480
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +0 -68
- package/sdk/application/Lead/LeadApplicationValidator.js +0 -71
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +0 -1675
- package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1121
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -254
- package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -190
- package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2296
- package/sdk/application/Order/OrderApplicationModel.js +0 -1471
- package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -265
- package/sdk/application/Order/OrderApplicationValidator.js +0 -197
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4058
- package/sdk/application/Payment/PaymentApplicationModel.js +0 -2630
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +0 -576
- package/sdk/application/Payment/PaymentApplicationValidator.js +0 -594
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +0 -365
- package/sdk/application/Rewards/RewardsApplicationModel.js +0 -396
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +0 -73
- package/sdk/application/Rewards/RewardsApplicationValidator.js +0 -84
- package/sdk/application/Share/ShareApplicationModel.d.ts +0 -339
- package/sdk/application/Share/ShareApplicationModel.js +0 -234
- package/sdk/application/Share/ShareApplicationValidator.d.ts +0 -90
- package/sdk/application/Share/ShareApplicationValidator.js +0 -91
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +0 -1713
- package/sdk/application/Theme/ThemeApplicationModel.js +0 -1426
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -66
- package/sdk/application/Theme/ThemeApplicationValidator.js +0 -58
- package/sdk/application/User/UserApplicationModel.d.ts +0 -1943
- package/sdk/application/User/UserApplicationModel.js +0 -1382
- package/sdk/application/User/UserApplicationValidator.d.ts +0 -560
- package/sdk/application/User/UserApplicationValidator.js +0 -573
- package/sdk/application/Webhook/WebhookApplicationModel.d.ts +0 -52
- package/sdk/application/Webhook/WebhookApplicationModel.js +0 -46
- package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +0 -16
- package/sdk/application/Webhook/WebhookApplicationValidator.js +0 -19
- package/sdk/common/Clickstream.d.ts +0 -1
- package/sdk/common/Clickstream.js +0 -464
|
@@ -10,35 +10,32 @@ declare class FileStorage {
|
|
|
10
10
|
_urls: {};
|
|
11
11
|
updateUrls(urls: any): void;
|
|
12
12
|
/**
|
|
13
|
-
* @param {FileStorageApplicationValidator.CompleteUploadParam} arg - Arg object.
|
|
14
13
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
15
14
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
16
|
-
* @returns {Promise<
|
|
15
|
+
* @returns {Promise<CompleteResponse>} - Success response
|
|
17
16
|
* @name completeUpload
|
|
18
17
|
* @summary: Complete file upload
|
|
19
18
|
* @description: Complete the file upload and store the file details such as name, size, content type, and namespace to maintain integrity within the system's database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/completeUpload/).
|
|
20
19
|
*/
|
|
21
|
-
completeUpload({ namespace, body, requestHeaders }?:
|
|
20
|
+
completeUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<CompleteResponse>;
|
|
22
21
|
/**
|
|
23
|
-
* @param {FileStorageApplicationValidator.SignUrlsParam} arg - Arg object.
|
|
24
22
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
25
23
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
26
|
-
* @returns {Promise<
|
|
24
|
+
* @returns {Promise<SignUrlResponse>} - Success response
|
|
27
25
|
* @name signUrls
|
|
28
26
|
* @summary: Get signed URLs
|
|
29
27
|
* @description: Generates secure, signed URLs that is valid for certain expiry time for accessing stored files. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/signUrls/).
|
|
30
28
|
*/
|
|
31
|
-
signUrls({ body, requestHeaders }?:
|
|
29
|
+
signUrls({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<SignUrlResponse>;
|
|
32
30
|
/**
|
|
33
|
-
* @param {FileStorageApplicationValidator.StartUploadParam} arg - Arg object.
|
|
34
31
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
35
32
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
36
|
-
* @returns {Promise<
|
|
33
|
+
* @returns {Promise<StartResponse>} - Success response
|
|
37
34
|
* @name startUpload
|
|
38
35
|
* @summary: Initiates file upload
|
|
39
36
|
* @description: Starts the process of uploading a file to storage location, and returns a signed url in response. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/startUpload/).
|
|
40
37
|
*/
|
|
41
|
-
startUpload({ namespace, body, requestHeaders }?:
|
|
38
|
+
startUpload({ namespace, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<StartResponse>;
|
|
42
39
|
/**
|
|
43
40
|
* @param data
|
|
44
41
|
* @param {string} file_name
|
|
@@ -46,15 +43,15 @@ declare class FileStorage {
|
|
|
46
43
|
* @param {string} namespace
|
|
47
44
|
* @param {number} size
|
|
48
45
|
* @param {number} tags
|
|
46
|
+
* @param {string} enc_key
|
|
49
47
|
*/
|
|
50
|
-
upload({ data, file_name, content_type, namespace, size, tags, }?: {
|
|
48
|
+
upload({ data, file_name, content_type, namespace, size, tags, enc_key, }?: {
|
|
51
49
|
data: any;
|
|
52
50
|
file_name: any;
|
|
53
51
|
content_type: any;
|
|
54
52
|
namespace: any;
|
|
55
53
|
size: any;
|
|
56
54
|
tags: any;
|
|
55
|
+
enc_key: any;
|
|
57
56
|
}): Promise<any>;
|
|
58
57
|
}
|
|
59
|
-
import FileStorageApplicationValidator = require("./FileStorageApplicationValidator");
|
|
60
|
-
import FileStorageApplicationModel = require("./FileStorageApplicationModel");
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
2
1
|
const {
|
|
3
2
|
FDKClientValidationError,
|
|
4
3
|
FDKResponseValidationError,
|
|
5
4
|
} = require("../../common/FDKError");
|
|
5
|
+
|
|
6
|
+
const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
6
7
|
const constructUrl = require("../constructUrl");
|
|
7
8
|
const Paginator = require("../../common/Paginator");
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const { Logger } = require("./../../common/Logger");
|
|
11
|
-
const Joi = require("joi");
|
|
9
|
+
const { validateRequiredParams } = require("../../common/Validator");
|
|
10
|
+
|
|
12
11
|
const { fdkAxios } = require("../../common/AxiosHelper.js");
|
|
13
12
|
|
|
14
13
|
class FileStorage {
|
|
@@ -38,10 +37,9 @@ class FileStorage {
|
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
/**
|
|
41
|
-
* @param {FileStorageApplicationValidator.CompleteUploadParam} arg - Arg object.
|
|
42
40
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
43
41
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
44
|
-
* @returns {Promise<
|
|
42
|
+
* @returns {Promise<CompleteResponse>} - Success response
|
|
45
43
|
* @name completeUpload
|
|
46
44
|
* @summary: Complete file upload
|
|
47
45
|
* @description: Complete the file upload and store the file details such as name, size, content type, and namespace to maintain integrity within the system's database. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/completeUpload/).
|
|
@@ -50,26 +48,13 @@ class FileStorage {
|
|
|
50
48
|
{ namespace, body, requestHeaders } = { requestHeaders: {} },
|
|
51
49
|
{ responseHeaders } = { responseHeaders: false }
|
|
52
50
|
) {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Showing warrnings if extra unknown parameters are found
|
|
62
|
-
const {
|
|
63
|
-
error: warrning,
|
|
64
|
-
} = FileStorageApplicationValidator.completeUpload().validate(
|
|
65
|
-
{ namespace, body },
|
|
66
|
-
{ abortEarly: false, allowUnknown: false }
|
|
67
|
-
);
|
|
68
|
-
if (warrning) {
|
|
69
|
-
Logger({
|
|
70
|
-
level: "WARN",
|
|
71
|
-
message: `Parameter Validation warrnings for application > FileStorage > completeUpload \n ${warrning}`,
|
|
51
|
+
const errors = validateRequiredParams(arguments[0], ["namespace"]);
|
|
52
|
+
if (errors.length > 0) {
|
|
53
|
+
const error = new FDKClientValidationError({
|
|
54
|
+
message: "Missing required field",
|
|
55
|
+
details: errors,
|
|
72
56
|
});
|
|
57
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
73
58
|
}
|
|
74
59
|
|
|
75
60
|
const query_params = {};
|
|
@@ -94,32 +79,13 @@ class FileStorage {
|
|
|
94
79
|
responseData = response[0];
|
|
95
80
|
}
|
|
96
81
|
|
|
97
|
-
const {
|
|
98
|
-
error: res_error,
|
|
99
|
-
} = FileStorageApplicationModel.CompleteResponse().validate(responseData, {
|
|
100
|
-
abortEarly: false,
|
|
101
|
-
allowUnknown: true,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
if (res_error) {
|
|
105
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
106
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
107
|
-
} else {
|
|
108
|
-
Logger({
|
|
109
|
-
level: "WARN",
|
|
110
|
-
message: `Response Validation Warnings for application > FileStorage > completeUpload \n ${res_error}`,
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
82
|
return response;
|
|
116
83
|
}
|
|
117
84
|
|
|
118
85
|
/**
|
|
119
|
-
* @param {FileStorageApplicationValidator.SignUrlsParam} arg - Arg object.
|
|
120
86
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
121
87
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
122
|
-
* @returns {Promise<
|
|
88
|
+
* @returns {Promise<SignUrlResponse>} - Success response
|
|
123
89
|
* @name signUrls
|
|
124
90
|
* @summary: Get signed URLs
|
|
125
91
|
* @description: Generates secure, signed URLs that is valid for certain expiry time for accessing stored files. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/signUrls/).
|
|
@@ -128,28 +94,6 @@ class FileStorage {
|
|
|
128
94
|
{ body, requestHeaders } = { requestHeaders: {} },
|
|
129
95
|
{ responseHeaders } = { responseHeaders: false }
|
|
130
96
|
) {
|
|
131
|
-
const { error } = FileStorageApplicationValidator.signUrls().validate(
|
|
132
|
-
{ body },
|
|
133
|
-
{ abortEarly: false, allowUnknown: true }
|
|
134
|
-
);
|
|
135
|
-
if (error) {
|
|
136
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Showing warrnings if extra unknown parameters are found
|
|
140
|
-
const {
|
|
141
|
-
error: warrning,
|
|
142
|
-
} = FileStorageApplicationValidator.signUrls().validate(
|
|
143
|
-
{ body },
|
|
144
|
-
{ abortEarly: false, allowUnknown: false }
|
|
145
|
-
);
|
|
146
|
-
if (warrning) {
|
|
147
|
-
Logger({
|
|
148
|
-
level: "WARN",
|
|
149
|
-
message: `Parameter Validation warrnings for application > FileStorage > signUrls \n ${warrning}`,
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
|
|
153
97
|
const query_params = {};
|
|
154
98
|
|
|
155
99
|
const xHeaders = {};
|
|
@@ -172,32 +116,13 @@ class FileStorage {
|
|
|
172
116
|
responseData = response[0];
|
|
173
117
|
}
|
|
174
118
|
|
|
175
|
-
const {
|
|
176
|
-
error: res_error,
|
|
177
|
-
} = FileStorageApplicationModel.SignUrlResponse().validate(responseData, {
|
|
178
|
-
abortEarly: false,
|
|
179
|
-
allowUnknown: true,
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
if (res_error) {
|
|
183
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
184
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
185
|
-
} else {
|
|
186
|
-
Logger({
|
|
187
|
-
level: "WARN",
|
|
188
|
-
message: `Response Validation Warnings for application > FileStorage > signUrls \n ${res_error}`,
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
119
|
return response;
|
|
194
120
|
}
|
|
195
121
|
|
|
196
122
|
/**
|
|
197
|
-
* @param {FileStorageApplicationValidator.StartUploadParam} arg - Arg object.
|
|
198
123
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
199
124
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
200
|
-
* @returns {Promise<
|
|
125
|
+
* @returns {Promise<StartResponse>} - Success response
|
|
201
126
|
* @name startUpload
|
|
202
127
|
* @summary: Initiates file upload
|
|
203
128
|
* @description: Starts the process of uploading a file to storage location, and returns a signed url in response. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/filestorage/startUpload/).
|
|
@@ -206,26 +131,13 @@ class FileStorage {
|
|
|
206
131
|
{ namespace, body, requestHeaders } = { requestHeaders: {} },
|
|
207
132
|
{ responseHeaders } = { responseHeaders: false }
|
|
208
133
|
) {
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// Showing warrnings if extra unknown parameters are found
|
|
218
|
-
const {
|
|
219
|
-
error: warrning,
|
|
220
|
-
} = FileStorageApplicationValidator.startUpload().validate(
|
|
221
|
-
{ namespace, body },
|
|
222
|
-
{ abortEarly: false, allowUnknown: false }
|
|
223
|
-
);
|
|
224
|
-
if (warrning) {
|
|
225
|
-
Logger({
|
|
226
|
-
level: "WARN",
|
|
227
|
-
message: `Parameter Validation warrnings for application > FileStorage > startUpload \n ${warrning}`,
|
|
134
|
+
const errors = validateRequiredParams(arguments[0], ["namespace"]);
|
|
135
|
+
if (errors.length > 0) {
|
|
136
|
+
const error = new FDKClientValidationError({
|
|
137
|
+
message: "Missing required field",
|
|
138
|
+
details: errors,
|
|
228
139
|
});
|
|
140
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
229
141
|
}
|
|
230
142
|
|
|
231
143
|
const query_params = {};
|
|
@@ -250,24 +162,6 @@ class FileStorage {
|
|
|
250
162
|
responseData = response[0];
|
|
251
163
|
}
|
|
252
164
|
|
|
253
|
-
const {
|
|
254
|
-
error: res_error,
|
|
255
|
-
} = FileStorageApplicationModel.StartResponse().validate(responseData, {
|
|
256
|
-
abortEarly: false,
|
|
257
|
-
allowUnknown: true,
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
if (res_error) {
|
|
261
|
-
if (this._conf.options.strictResponseCheck === true) {
|
|
262
|
-
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
263
|
-
} else {
|
|
264
|
-
Logger({
|
|
265
|
-
level: "WARN",
|
|
266
|
-
message: `Response Validation Warnings for application > FileStorage > startUpload \n ${res_error}`,
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
165
|
return response;
|
|
272
166
|
}
|
|
273
167
|
}
|
|
@@ -279,6 +173,7 @@ class FileStorage {
|
|
|
279
173
|
* @param {string} namespace
|
|
280
174
|
* @param {number} size
|
|
281
175
|
* @param {number} tags
|
|
176
|
+
* @param {string} enc_key
|
|
282
177
|
*/
|
|
283
178
|
FileStorage.prototype.upload = function ({
|
|
284
179
|
data,
|
|
@@ -287,6 +182,7 @@ FileStorage.prototype.upload = function ({
|
|
|
287
182
|
namespace,
|
|
288
183
|
size,
|
|
289
184
|
tags,
|
|
185
|
+
enc_key,
|
|
290
186
|
} = {}) {
|
|
291
187
|
return new Promise(async (resolve, reject) => {
|
|
292
188
|
try {
|
|
@@ -297,6 +193,7 @@ FileStorage.prototype.upload = function ({
|
|
|
297
193
|
content_type,
|
|
298
194
|
size: size,
|
|
299
195
|
tags: tags,
|
|
196
|
+
enc_key: enc_key,
|
|
300
197
|
},
|
|
301
198
|
});
|
|
302
199
|
if (dataObj.upload && dataObj.upload.url) {
|
|
@@ -12,56 +12,48 @@ declare class Lead {
|
|
|
12
12
|
_urls: {};
|
|
13
13
|
updateUrls(urls: any): void;
|
|
14
14
|
/**
|
|
15
|
-
* @param {LeadApplicationValidator.CreateHistoryParam} arg - Arg object.
|
|
16
15
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
17
16
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
18
|
-
* @returns {Promise<
|
|
17
|
+
* @returns {Promise<TicketHistory>} - Success response
|
|
19
18
|
* @name createHistory
|
|
20
19
|
* @summary: Log ticket history
|
|
21
20
|
* @description: Create a history entry for a specific support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/createHistory/).
|
|
22
21
|
*/
|
|
23
|
-
createHistory({ id, body, requestHeaders }?:
|
|
22
|
+
createHistory({ id, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<TicketHistory>;
|
|
24
23
|
/**
|
|
25
|
-
* @param {LeadApplicationValidator.CreateTicketParam} arg - Arg object.
|
|
26
24
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
27
25
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
28
|
-
* @returns {Promise<
|
|
26
|
+
* @returns {Promise<Ticket>} - Success response
|
|
29
27
|
* @name createTicket
|
|
30
28
|
* @summary: Creates a ticket
|
|
31
29
|
* @description: Create a new customer support ticket for a user query. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/createTicket/).
|
|
32
30
|
*/
|
|
33
|
-
createTicket({ body, requestHeaders }?:
|
|
31
|
+
createTicket({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<Ticket>;
|
|
34
32
|
/**
|
|
35
|
-
* @param {LeadApplicationValidator.GetCustomFormParam} arg - Arg object.
|
|
36
33
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
37
34
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
38
|
-
* @returns {Promise<
|
|
35
|
+
* @returns {Promise<CustomForm>} - Success response
|
|
39
36
|
* @name getCustomForm
|
|
40
37
|
* @summary: Get custom form
|
|
41
38
|
* @description: Get a customizable form template for data collection. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getCustomForm/).
|
|
42
39
|
*/
|
|
43
|
-
getCustomForm({ slug, requestHeaders }?:
|
|
40
|
+
getCustomForm({ slug, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<CustomForm>;
|
|
44
41
|
/**
|
|
45
|
-
* @param {LeadApplicationValidator.GetTicketParam} arg - Arg object.
|
|
46
42
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
47
43
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
48
|
-
* @returns {Promise<
|
|
44
|
+
* @returns {Promise<Ticket>} - Success response
|
|
49
45
|
* @name getTicket
|
|
50
46
|
* @summary: Get a support ticket
|
|
51
47
|
* @description: Get details of a specific customer support ticket. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/getTicket/).
|
|
52
48
|
*/
|
|
53
|
-
getTicket({ id, requestHeaders }?:
|
|
49
|
+
getTicket({ id, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<Ticket>;
|
|
54
50
|
/**
|
|
55
|
-
* @param {LeadApplicationValidator.SubmitCustomFormParam} arg - Arg object.
|
|
56
51
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
57
52
|
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
58
|
-
* @returns {Promise<
|
|
59
|
-
* Success response
|
|
53
|
+
* @returns {Promise<SubmitCustomFormResponse>} - Success response
|
|
60
54
|
* @name submitCustomForm
|
|
61
55
|
* @summary: Submits form data
|
|
62
56
|
* @description: Create user-entered data from a custom form for processing. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/lead/submitCustomForm/).
|
|
63
57
|
*/
|
|
64
|
-
submitCustomForm({ slug, body, requestHeaders }?:
|
|
58
|
+
submitCustomForm({ slug, body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options, ...args: any[]): Promise<SubmitCustomFormResponse>;
|
|
65
59
|
}
|
|
66
|
-
import LeadApplicationValidator = require("./LeadApplicationValidator");
|
|
67
|
-
import LeadApplicationModel = require("./LeadApplicationModel");
|