@gofynd/fdk-client-javascript 1.0.0 → 1.0.2
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/documentation/application/CART.md +251 -251
- package/documentation/application/CATALOG.md +393 -393
- package/documentation/application/CONTENT.md +15 -1
- package/documentation/application/ORDER.md +268 -268
- package/documentation/application/PAYMENT.md +249 -249
- package/documentation/application/POSCART.md +297 -297
- package/documentation/platform/CART.md +499 -499
- package/documentation/platform/CATALOG.md +3497 -3097
- package/documentation/platform/COMPANYPROFILE.md +207 -207
- package/documentation/platform/CONTENT.md +123 -1
- package/documentation/platform/ORDER.md +1518 -1324
- package/documentation/platform/PARTNER.md +7 -7
- package/documentation/platform/PAYMENT.md +96 -96
- package/index.js +7 -1
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.js +865 -52
- package/sdk/application/Cart/CartApplicationModel.d.ts +7 -7
- package/sdk/application/Cart/CartApplicationModel.js +335 -335
- package/sdk/application/Cart/CartApplicationValidator.js +1 -0
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +1 -1
- package/sdk/application/Catalog/CatalogApplicationClient.js +1034 -60
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationModel.js +532 -532
- package/sdk/application/Catalog/CatalogApplicationValidator.js +1 -0
- package/sdk/application/Common/CommonApplicationClient.js +66 -4
- package/sdk/application/Common/CommonApplicationValidator.js +1 -0
- package/sdk/application/Communication/CommunicationApplicationClient.js +108 -6
- package/sdk/application/Communication/CommunicationApplicationValidator.js +1 -0
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +1 -1
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +558 -32
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +1 -0
- package/sdk/application/Content/ContentApplicationClient.js +621 -38
- package/sdk/application/Content/ContentApplicationModel.d.ts +1 -0
- package/sdk/application/Content/ContentApplicationModel.js +11 -1
- package/sdk/application/Content/ContentApplicationValidator.js +1 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +101 -6
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +1 -0
- package/sdk/application/Lead/LeadApplicationClient.js +229 -14
- package/sdk/application/Lead/LeadApplicationValidator.js +1 -0
- package/sdk/application/Logistic/LogisticApplicationClient.js +134 -8
- package/sdk/application/Logistic/LogisticApplicationValidator.js +1 -0
- package/sdk/application/Order/OrderApplicationClient.d.ts +1 -1
- package/sdk/application/Order/OrderApplicationClient.js +403 -24
- package/sdk/application/Order/OrderApplicationModel.d.ts +20 -20
- package/sdk/application/Order/OrderApplicationModel.js +334 -334
- package/sdk/application/Order/OrderApplicationValidator.js +1 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +1381 -78
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +2 -2
- package/sdk/application/Payment/PaymentApplicationModel.js +350 -350
- package/sdk/application/Payment/PaymentApplicationValidator.js +1 -0
- package/sdk/application/PosCart/PosCartApplicationClient.js +914 -54
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +15 -15
- package/sdk/application/PosCart/PosCartApplicationModel.js +389 -389
- package/sdk/application/PosCart/PosCartApplicationValidator.js +1 -0
- package/sdk/application/Rewards/RewardsApplicationClient.js +235 -14
- package/sdk/application/Rewards/RewardsApplicationValidator.js +1 -0
- package/sdk/application/Share/ShareApplicationClient.js +226 -14
- package/sdk/application/Share/ShareApplicationValidator.js +1 -0
- package/sdk/application/Theme/ThemeApplicationClient.js +130 -8
- package/sdk/application/Theme/ThemeApplicationValidator.js +1 -0
- package/sdk/application/User/UserApplicationClient.js +1133 -70
- package/sdk/application/User/UserApplicationValidator.js +1 -0
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +16 -8
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +287 -16
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +153 -8
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +141 -8
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -12
- package/sdk/platform/Billing/BillingPlatformClient.js +429 -24
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +34 -17
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +617 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +35 -35
- package/sdk/platform/Cart/CartPlatformModel.js +617 -617
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +191 -138
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2202 -302
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +45 -45
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +344 -226
- package/sdk/platform/Catalog/CatalogPlatformClient.js +3282 -488
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +110 -100
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2073 -1795
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +23 -21
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +103 -84
- package/sdk/platform/Common/CommonPlatformClient.d.ts +4 -2
- package/sdk/platform/Common/CommonPlatformClient.js +73 -4
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +80 -40
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1499 -80
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +41 -2
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +27 -14
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +486 -26
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +9 -9
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +274 -274
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +56 -28
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1022 -56
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +693 -36
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +148 -67
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +2446 -140
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +4 -0
- package/sdk/platform/Content/ContentPlatformModel.js +43 -1
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +21 -10
- package/sdk/platform/Discount/DiscountPlatformClient.js +400 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +148 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +12 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +214 -12
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +27 -14
- package/sdk/platform/Inventory/InventoryPlatformClient.js +449 -24
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +447 -26
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +22 -11
- package/sdk/platform/Lead/LeadPlatformClient.js +384 -22
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +6 -3
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +125 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +108 -47
- package/sdk/platform/Order/OrderPlatformClient.js +1641 -100
- package/sdk/platform/Order/OrderPlatformModel.d.ts +69 -58
- package/sdk/platform/Order/OrderPlatformModel.js +1485 -1493
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +2 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +15 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +74 -4
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +8 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +22 -11
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +418 -22
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +21 -11
- package/sdk/platform/Payment/PaymentPlatformClient.js +374 -20
- package/sdk/platform/Payment/PaymentPlatformModel.js +139 -139
- package/sdk/platform/PlatformApplicationClient.d.ts +2973 -2827
- package/sdk/platform/PlatformApplicationClient.js +3461 -3263
- package/sdk/platform/PlatformClient.d.ts +2973 -2827
- package/sdk/platform/PlatformClient.js +3461 -3263
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +26 -13
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +449 -26
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +8 -4
- package/sdk/platform/Share/SharePlatformApplicationClient.js +139 -8
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +47 -23
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +816 -48
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +24 -12
- package/sdk/platform/User/UserPlatformApplicationClient.js +417 -24
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +12 -6
- package/sdk/platform/Webhook/WebhookPlatformClient.js +229 -12
- package/sdk/public/Configuration/ConfigurationPublicClient.js +72 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +3 -1
- package/sdk/public/Inventory/InventoryPublicClient.js +210 -12
- package/sdk/public/Inventory/InventoryPublicValidator.js +3 -1
- package/sdk/public/Webhook/WebhookPublicClient.js +74 -4
- package/sdk/public/Webhook/WebhookPublicValidator.js +3 -1
|
@@ -7,6 +7,7 @@ declare class FileStorage {
|
|
|
7
7
|
* @param {Object} arg - Arg object.
|
|
8
8
|
* @param {string} arg.namespace - Bucket name
|
|
9
9
|
* @param {StartRequest} arg.body
|
|
10
|
+
* @returns {Promise<StartResponse>} - Success response
|
|
10
11
|
* @summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
|
|
11
12
|
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
12
13
|
*
|
|
@@ -30,11 +31,12 @@ declare class FileStorage {
|
|
|
30
31
|
appStartUpload({ namespace, body }?: {
|
|
31
32
|
namespace: string;
|
|
32
33
|
body: StartRequest;
|
|
33
|
-
}): Promise<
|
|
34
|
+
}): Promise<StartResponse>;
|
|
34
35
|
/**
|
|
35
36
|
* @param {Object} arg - Arg object.
|
|
36
37
|
* @param {string} arg.namespace - Bucket name
|
|
37
38
|
* @param {StartResponse} arg.body
|
|
39
|
+
* @returns {Promise<CompleteResponse>} - Success response
|
|
38
40
|
* @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
|
|
39
41
|
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
40
42
|
*
|
|
@@ -58,29 +60,31 @@ declare class FileStorage {
|
|
|
58
60
|
appCompleteUpload({ namespace, body }?: {
|
|
59
61
|
namespace: string;
|
|
60
62
|
body: StartResponse;
|
|
61
|
-
}): Promise<
|
|
63
|
+
}): Promise<CompleteResponse>;
|
|
62
64
|
/**
|
|
63
65
|
* @param {Object} arg - Arg object.
|
|
64
66
|
* @param {boolean} [arg.sync] - Sync
|
|
65
67
|
* @param {BulkRequest} arg.body
|
|
68
|
+
* @returns {Promise<BulkUploadResponse>} - Success response
|
|
66
69
|
* @summary: Copy Files
|
|
67
70
|
* @description: Copy Files
|
|
68
71
|
*/
|
|
69
72
|
appCopyFiles({ body, sync }?: {
|
|
70
73
|
sync?: boolean;
|
|
71
74
|
body: BulkRequest;
|
|
72
|
-
}): Promise<
|
|
75
|
+
}): Promise<BulkUploadResponse>;
|
|
73
76
|
/**
|
|
74
77
|
* @param {Object} arg - Arg object.
|
|
75
78
|
* @param {string} arg.namespace - Bucket name
|
|
76
79
|
* @param {number} [arg.pageNo] - Page no
|
|
80
|
+
* @returns {Promise<BrowseResponse>} - Success response
|
|
77
81
|
* @summary: Browse Files
|
|
78
82
|
* @description: Browse Files
|
|
79
83
|
*/
|
|
80
84
|
browse({ namespace, pageNo }?: {
|
|
81
85
|
namespace: string;
|
|
82
86
|
pageNo?: number;
|
|
83
|
-
}): Promise<
|
|
87
|
+
}): Promise<BrowseResponse>;
|
|
84
88
|
/**
|
|
85
89
|
* @param {Object} arg - Arg object.
|
|
86
90
|
* @param {string} arg.namespace - Bucket name
|
|
@@ -2,6 +2,8 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
3
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
4
|
const FileStorageValidator = require("./FileStoragePlatformApplicationValidator");
|
|
5
|
+
const FileStorageModel = require("./FileStoragePlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
5
7
|
|
|
6
8
|
class FileStorage {
|
|
7
9
|
constructor(config, applicationId) {
|
|
@@ -13,6 +15,7 @@ class FileStorage {
|
|
|
13
15
|
* @param {Object} arg - Arg object.
|
|
14
16
|
* @param {string} arg.namespace - Bucket name
|
|
15
17
|
* @param {StartRequest} arg.body
|
|
18
|
+
* @returns {Promise<StartResponse>} - Success response
|
|
16
19
|
* @summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
|
|
17
20
|
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
18
21
|
*
|
|
@@ -33,7 +36,7 @@ class FileStorage {
|
|
|
33
36
|
* After successfully upload, call `appCompleteUpload` api to complete the upload process.
|
|
34
37
|
* This operation will return the url for the uploaded file.
|
|
35
38
|
*/
|
|
36
|
-
appStartUpload({ namespace, body } = {}) {
|
|
39
|
+
async appStartUpload({ namespace, body } = {}) {
|
|
37
40
|
const { error } = FileStorageValidator.appStartUpload().validate(
|
|
38
41
|
{
|
|
39
42
|
namespace,
|
|
@@ -45,21 +48,55 @@ class FileStorage {
|
|
|
45
48
|
return Promise.reject(new FDKClientValidationError(error));
|
|
46
49
|
}
|
|
47
50
|
|
|
51
|
+
// Showing warrnings if extra unknown parameters are found
|
|
52
|
+
const { error: warrning } = FileStorageValidator.appStartUpload().validate(
|
|
53
|
+
{
|
|
54
|
+
namespace,
|
|
55
|
+
body,
|
|
56
|
+
},
|
|
57
|
+
{ abortEarly: false, allowUnknown: false }
|
|
58
|
+
);
|
|
59
|
+
if (warrning) {
|
|
60
|
+
Logger({
|
|
61
|
+
level: "WARN",
|
|
62
|
+
message: "Parameter Validation warrnings for appStartUpload",
|
|
63
|
+
});
|
|
64
|
+
Logger({ level: "WARN", message: warrning });
|
|
65
|
+
}
|
|
66
|
+
|
|
48
67
|
const query_params = {};
|
|
49
68
|
|
|
50
|
-
|
|
69
|
+
const response = await PlatformAPIClient.execute(
|
|
51
70
|
this.config,
|
|
52
71
|
"post",
|
|
53
72
|
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/namespaces/${namespace}/upload/start/`,
|
|
54
73
|
query_params,
|
|
55
74
|
body
|
|
56
75
|
);
|
|
76
|
+
|
|
77
|
+
const {
|
|
78
|
+
error: res_error,
|
|
79
|
+
} = FileStorageModel.StartResponse().validate(response, {
|
|
80
|
+
abortEarly: false,
|
|
81
|
+
allowUnknown: false,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
if (res_error) {
|
|
85
|
+
Logger({
|
|
86
|
+
level: "WARN",
|
|
87
|
+
message: "Response Validation Warnnings for appStartUpload",
|
|
88
|
+
});
|
|
89
|
+
Logger({ level: "WARN", message: res_error });
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return response;
|
|
57
93
|
}
|
|
58
94
|
|
|
59
95
|
/**
|
|
60
96
|
* @param {Object} arg - Arg object.
|
|
61
97
|
* @param {string} arg.namespace - Bucket name
|
|
62
98
|
* @param {StartResponse} arg.body
|
|
99
|
+
* @returns {Promise<CompleteResponse>} - Success response
|
|
63
100
|
* @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
|
|
64
101
|
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
65
102
|
*
|
|
@@ -80,7 +117,7 @@ class FileStorage {
|
|
|
80
117
|
* After successfully upload, call `appCompleteUpload` api to complete the upload process.
|
|
81
118
|
* This operation will return the url for the uploaded file.
|
|
82
119
|
*/
|
|
83
|
-
appCompleteUpload({ namespace, body } = {}) {
|
|
120
|
+
async appCompleteUpload({ namespace, body } = {}) {
|
|
84
121
|
const { error } = FileStorageValidator.appCompleteUpload().validate(
|
|
85
122
|
{
|
|
86
123
|
namespace,
|
|
@@ -92,25 +129,61 @@ class FileStorage {
|
|
|
92
129
|
return Promise.reject(new FDKClientValidationError(error));
|
|
93
130
|
}
|
|
94
131
|
|
|
132
|
+
// Showing warrnings if extra unknown parameters are found
|
|
133
|
+
const {
|
|
134
|
+
error: warrning,
|
|
135
|
+
} = FileStorageValidator.appCompleteUpload().validate(
|
|
136
|
+
{
|
|
137
|
+
namespace,
|
|
138
|
+
body,
|
|
139
|
+
},
|
|
140
|
+
{ abortEarly: false, allowUnknown: false }
|
|
141
|
+
);
|
|
142
|
+
if (warrning) {
|
|
143
|
+
Logger({
|
|
144
|
+
level: "WARN",
|
|
145
|
+
message: "Parameter Validation warrnings for appCompleteUpload",
|
|
146
|
+
});
|
|
147
|
+
Logger({ level: "WARN", message: warrning });
|
|
148
|
+
}
|
|
149
|
+
|
|
95
150
|
const query_params = {};
|
|
96
151
|
|
|
97
|
-
|
|
152
|
+
const response = await PlatformAPIClient.execute(
|
|
98
153
|
this.config,
|
|
99
154
|
"post",
|
|
100
155
|
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/namespaces/${namespace}/upload/complete/`,
|
|
101
156
|
query_params,
|
|
102
157
|
body
|
|
103
158
|
);
|
|
159
|
+
|
|
160
|
+
const {
|
|
161
|
+
error: res_error,
|
|
162
|
+
} = FileStorageModel.CompleteResponse().validate(response, {
|
|
163
|
+
abortEarly: false,
|
|
164
|
+
allowUnknown: false,
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
if (res_error) {
|
|
168
|
+
Logger({
|
|
169
|
+
level: "WARN",
|
|
170
|
+
message: "Response Validation Warnnings for appCompleteUpload",
|
|
171
|
+
});
|
|
172
|
+
Logger({ level: "WARN", message: res_error });
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return response;
|
|
104
176
|
}
|
|
105
177
|
|
|
106
178
|
/**
|
|
107
179
|
* @param {Object} arg - Arg object.
|
|
108
180
|
* @param {boolean} [arg.sync] - Sync
|
|
109
181
|
* @param {BulkRequest} arg.body
|
|
182
|
+
* @returns {Promise<BulkUploadResponse>} - Success response
|
|
110
183
|
* @summary: Copy Files
|
|
111
184
|
* @description: Copy Files
|
|
112
185
|
*/
|
|
113
|
-
appCopyFiles({ body, sync } = {}) {
|
|
186
|
+
async appCopyFiles({ body, sync } = {}) {
|
|
114
187
|
const { error } = FileStorageValidator.appCopyFiles().validate(
|
|
115
188
|
{
|
|
116
189
|
body,
|
|
@@ -122,26 +195,60 @@ class FileStorage {
|
|
|
122
195
|
return Promise.reject(new FDKClientValidationError(error));
|
|
123
196
|
}
|
|
124
197
|
|
|
198
|
+
// Showing warrnings if extra unknown parameters are found
|
|
199
|
+
const { error: warrning } = FileStorageValidator.appCopyFiles().validate(
|
|
200
|
+
{
|
|
201
|
+
body,
|
|
202
|
+
sync,
|
|
203
|
+
},
|
|
204
|
+
{ abortEarly: false, allowUnknown: false }
|
|
205
|
+
);
|
|
206
|
+
if (warrning) {
|
|
207
|
+
Logger({
|
|
208
|
+
level: "WARN",
|
|
209
|
+
message: "Parameter Validation warrnings for appCopyFiles",
|
|
210
|
+
});
|
|
211
|
+
Logger({ level: "WARN", message: warrning });
|
|
212
|
+
}
|
|
213
|
+
|
|
125
214
|
const query_params = {};
|
|
126
215
|
query_params["sync"] = sync;
|
|
127
216
|
|
|
128
|
-
|
|
217
|
+
const response = await PlatformAPIClient.execute(
|
|
129
218
|
this.config,
|
|
130
219
|
"post",
|
|
131
220
|
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/uploads/copy/`,
|
|
132
221
|
query_params,
|
|
133
222
|
body
|
|
134
223
|
);
|
|
224
|
+
|
|
225
|
+
const {
|
|
226
|
+
error: res_error,
|
|
227
|
+
} = FileStorageModel.BulkUploadResponse().validate(response, {
|
|
228
|
+
abortEarly: false,
|
|
229
|
+
allowUnknown: false,
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
if (res_error) {
|
|
233
|
+
Logger({
|
|
234
|
+
level: "WARN",
|
|
235
|
+
message: "Response Validation Warnnings for appCopyFiles",
|
|
236
|
+
});
|
|
237
|
+
Logger({ level: "WARN", message: res_error });
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return response;
|
|
135
241
|
}
|
|
136
242
|
|
|
137
243
|
/**
|
|
138
244
|
* @param {Object} arg - Arg object.
|
|
139
245
|
* @param {string} arg.namespace - Bucket name
|
|
140
246
|
* @param {number} [arg.pageNo] - Page no
|
|
247
|
+
* @returns {Promise<BrowseResponse>} - Success response
|
|
141
248
|
* @summary: Browse Files
|
|
142
249
|
* @description: Browse Files
|
|
143
250
|
*/
|
|
144
|
-
browse({ namespace, pageNo } = {}) {
|
|
251
|
+
async browse({ namespace, pageNo } = {}) {
|
|
145
252
|
const { error } = FileStorageValidator.browse().validate(
|
|
146
253
|
{
|
|
147
254
|
namespace,
|
|
@@ -153,16 +260,49 @@ class FileStorage {
|
|
|
153
260
|
return Promise.reject(new FDKClientValidationError(error));
|
|
154
261
|
}
|
|
155
262
|
|
|
263
|
+
// Showing warrnings if extra unknown parameters are found
|
|
264
|
+
const { error: warrning } = FileStorageValidator.browse().validate(
|
|
265
|
+
{
|
|
266
|
+
namespace,
|
|
267
|
+
pageNo,
|
|
268
|
+
},
|
|
269
|
+
{ abortEarly: false, allowUnknown: false }
|
|
270
|
+
);
|
|
271
|
+
if (warrning) {
|
|
272
|
+
Logger({
|
|
273
|
+
level: "WARN",
|
|
274
|
+
message: "Parameter Validation warrnings for browse",
|
|
275
|
+
});
|
|
276
|
+
Logger({ level: "WARN", message: warrning });
|
|
277
|
+
}
|
|
278
|
+
|
|
156
279
|
const query_params = {};
|
|
157
280
|
query_params["page_no"] = pageNo;
|
|
158
281
|
|
|
159
|
-
|
|
282
|
+
const response = await PlatformAPIClient.execute(
|
|
160
283
|
this.config,
|
|
161
284
|
"get",
|
|
162
285
|
`/service/platform/assets/v1.0/company/${this.config.companyId}/application/${this.applicationId}/namespaces/${namespace}/browse/`,
|
|
163
286
|
query_params,
|
|
164
287
|
undefined
|
|
165
288
|
);
|
|
289
|
+
|
|
290
|
+
const {
|
|
291
|
+
error: res_error,
|
|
292
|
+
} = FileStorageModel.BrowseResponse().validate(response, {
|
|
293
|
+
abortEarly: false,
|
|
294
|
+
allowUnknown: false,
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
if (res_error) {
|
|
298
|
+
Logger({
|
|
299
|
+
level: "WARN",
|
|
300
|
+
message: "Response Validation Warnnings for browse",
|
|
301
|
+
});
|
|
302
|
+
Logger({ level: "WARN", message: res_error });
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
return response;
|
|
166
306
|
}
|
|
167
307
|
|
|
168
308
|
/**
|
|
@@ -6,6 +6,7 @@ declare class FileStorage {
|
|
|
6
6
|
* @param {Object} arg - Arg object.
|
|
7
7
|
* @param {string} arg.namespace - Bucket name
|
|
8
8
|
* @param {StartRequest} arg.body
|
|
9
|
+
* @returns {Promise<StartResponse>} - Success response
|
|
9
10
|
* @summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
|
|
10
11
|
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
11
12
|
*
|
|
@@ -29,11 +30,12 @@ declare class FileStorage {
|
|
|
29
30
|
startUpload({ namespace, body }?: {
|
|
30
31
|
namespace: string;
|
|
31
32
|
body: StartRequest;
|
|
32
|
-
}): Promise<
|
|
33
|
+
}): Promise<StartResponse>;
|
|
33
34
|
/**
|
|
34
35
|
* @param {Object} arg - Arg object.
|
|
35
36
|
* @param {string} arg.namespace - Bucket name
|
|
36
37
|
* @param {StartResponse} arg.body
|
|
38
|
+
* @returns {Promise<CompleteResponse>} - Success response
|
|
37
39
|
* @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
|
|
38
40
|
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
39
41
|
*
|
|
@@ -57,38 +59,41 @@ declare class FileStorage {
|
|
|
57
59
|
completeUpload({ namespace, body }?: {
|
|
58
60
|
namespace: string;
|
|
59
61
|
body: StartResponse;
|
|
60
|
-
}): Promise<
|
|
62
|
+
}): Promise<CompleteResponse>;
|
|
61
63
|
/**
|
|
62
64
|
* @param {Object} arg - Arg object.
|
|
63
65
|
* @param {SignUrlRequest} arg.body
|
|
66
|
+
* @returns {Promise<SignUrlResponse>} - Success response
|
|
64
67
|
* @summary: Gives signed urls to access private files
|
|
65
68
|
* @description: Describe here
|
|
66
69
|
*/
|
|
67
70
|
getSignUrls({ body }?: {
|
|
68
71
|
body: SignUrlRequest;
|
|
69
|
-
}): Promise<
|
|
72
|
+
}): Promise<SignUrlResponse>;
|
|
70
73
|
/**
|
|
71
74
|
* @param {Object} arg - Arg object.
|
|
72
75
|
* @param {boolean} [arg.sync] - Sync
|
|
73
76
|
* @param {BulkRequest} arg.body
|
|
77
|
+
* @returns {Promise<BulkUploadResponse>} - Success response
|
|
74
78
|
* @summary: Copy Files
|
|
75
79
|
* @description: Copy Files
|
|
76
80
|
*/
|
|
77
81
|
copyFiles({ body, sync }?: {
|
|
78
82
|
sync?: boolean;
|
|
79
83
|
body: BulkRequest;
|
|
80
|
-
}): Promise<
|
|
84
|
+
}): Promise<BulkUploadResponse>;
|
|
81
85
|
/**
|
|
82
86
|
* @param {Object} arg - Arg object.
|
|
83
87
|
* @param {string} arg.namespace - Bucket name
|
|
84
88
|
* @param {number} [arg.pageNo] - Page no
|
|
89
|
+
* @returns {Promise<BrowseResponse>} - Success response
|
|
85
90
|
* @summary: Browse Files
|
|
86
91
|
* @description: Browse Files
|
|
87
92
|
*/
|
|
88
93
|
browse({ namespace, pageNo }?: {
|
|
89
94
|
namespace: string;
|
|
90
95
|
pageNo?: number;
|
|
91
|
-
}): Promise<
|
|
96
|
+
}): Promise<BrowseResponse>;
|
|
92
97
|
/**
|
|
93
98
|
* @param {Object} arg - Arg object.
|
|
94
99
|
* @param {string} arg.namespace - Bucket name
|
|
@@ -101,12 +106,13 @@ declare class FileStorage {
|
|
|
101
106
|
/**
|
|
102
107
|
* @param {Object} arg - Arg object.
|
|
103
108
|
* @param {string} arg.url - Url
|
|
109
|
+
* @returns {Promise<string>} - Success response
|
|
104
110
|
* @summary: Proxy
|
|
105
111
|
* @description: Proxy
|
|
106
112
|
*/
|
|
107
113
|
proxy({ url }?: {
|
|
108
114
|
url: string;
|
|
109
|
-
}): Promise<
|
|
115
|
+
}): Promise<string>;
|
|
110
116
|
/**
|
|
111
117
|
* @param data
|
|
112
118
|
* @param {string} file_name
|