@gofynd/fdk-client-javascript 1.3.4-beta.1 → 1.3.4-beta.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/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +18 -1
- package/sdk/application/Catalog/CatalogApplicationModel.js +20 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +3 -3
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +23 -9
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +21 -7
- package/sdk/application/User/UserApplicationClient.d.ts +56 -0
- package/sdk/application/User/UserApplicationClient.js +385 -0
- package/sdk/application/User/UserApplicationModel.d.ts +93 -1
- package/sdk/application/User/UserApplicationModel.js +110 -0
- package/sdk/application/User/UserApplicationValidator.d.ts +66 -1
- package/sdk/application/User/UserApplicationValidator.js +68 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +96 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +177 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +139 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +158 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +6 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +33 -0
- package/sdk/partner/PartnerClient.d.ts +2 -0
- package/sdk/partner/PartnerClient.js +3 -0
- package/sdk/partner/index.d.ts +1 -0
- package/sdk/partner/index.js +2 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +4 -16
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +11 -79
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +12 -8
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +7 -9
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +37 -27
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +145 -56
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +22 -11
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +24 -10
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +4 -4
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +4 -8
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +832 -150
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +940 -138
- package/sdk/platform/Order/OrderPlatformClient.d.ts +2 -2
- package/sdk/platform/Order/OrderPlatformClient.js +1 -1
- package/sdk/platform/Order/OrderPlatformModel.d.ts +10 -2
- package/sdk/platform/Order/OrderPlatformModel.js +10 -2
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +4 -4
- package/sdk/platform/Order/OrderPlatformValidator.js +4 -4
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +42 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +241 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +41 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +40 -0
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +72 -1
- package/sdk/platform/Payment/PaymentPlatformModel.js +54 -0
|
@@ -5,6 +5,15 @@ const Joi = require("joi");
|
|
|
5
5
|
* @property {string} [app_id]
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @typedef APIError
|
|
10
|
+
* @property {string} [code]
|
|
11
|
+
* @property {string} [info] - Error code description link
|
|
12
|
+
* @property {string} [message]
|
|
13
|
+
* @property {Object} [meta]
|
|
14
|
+
* @property {string} [request_id]
|
|
15
|
+
*/
|
|
16
|
+
|
|
8
17
|
/**
|
|
9
18
|
* @typedef AuthenticationApiErrorSchema
|
|
10
19
|
* @property {string} [message]
|
|
@@ -344,11 +353,23 @@ const Joi = require("joi");
|
|
|
344
353
|
* @property {PlatformMobile} [mobile]
|
|
345
354
|
*/
|
|
346
355
|
|
|
356
|
+
/**
|
|
357
|
+
* @typedef ResetForgotPasswordSuccess
|
|
358
|
+
* @property {boolean} [success]
|
|
359
|
+
*/
|
|
360
|
+
|
|
347
361
|
/**
|
|
348
362
|
* @typedef ResetPasswordSuccess
|
|
349
363
|
* @property {string} [status]
|
|
350
364
|
*/
|
|
351
365
|
|
|
366
|
+
/**
|
|
367
|
+
* @typedef SendEmailForgotOtpRequestSchema
|
|
368
|
+
* @property {string} [action]
|
|
369
|
+
* @property {string} [email]
|
|
370
|
+
* @property {string} [token]
|
|
371
|
+
*/
|
|
372
|
+
|
|
352
373
|
/**
|
|
353
374
|
* @typedef SendEmailOtpRequestSchema
|
|
354
375
|
* @property {string} [action]
|
|
@@ -363,6 +384,15 @@ const Joi = require("joi");
|
|
|
363
384
|
* @property {boolean} [verify_email_link]
|
|
364
385
|
*/
|
|
365
386
|
|
|
387
|
+
/**
|
|
388
|
+
* @typedef SendMobileForgotOtpRequestSchema
|
|
389
|
+
* @property {string} [action]
|
|
390
|
+
* @property {string} [android_hash]
|
|
391
|
+
* @property {string} [country_code]
|
|
392
|
+
* @property {string} [mobile]
|
|
393
|
+
* @property {string} [token]
|
|
394
|
+
*/
|
|
395
|
+
|
|
366
396
|
/**
|
|
367
397
|
* @typedef SendMobileOtpRequestSchema
|
|
368
398
|
* @property {string} [action]
|
|
@@ -489,6 +519,12 @@ const Joi = require("joi");
|
|
|
489
519
|
* @property {string} [username]
|
|
490
520
|
*/
|
|
491
521
|
|
|
522
|
+
/**
|
|
523
|
+
* @typedef VerifyEmailForgotOtpRequestSchema
|
|
524
|
+
* @property {string} [email]
|
|
525
|
+
* @property {string} [otp]
|
|
526
|
+
*/
|
|
527
|
+
|
|
492
528
|
/**
|
|
493
529
|
* @typedef VerifyEmailOtpRequestSchema
|
|
494
530
|
* @property {string} [action]
|
|
@@ -508,6 +544,18 @@ const Joi = require("joi");
|
|
|
508
544
|
* @property {string} [message]
|
|
509
545
|
*/
|
|
510
546
|
|
|
547
|
+
/**
|
|
548
|
+
* @typedef VerifyForgotOtpSuccess
|
|
549
|
+
* @property {string} [forgot_token]
|
|
550
|
+
* @property {boolean} [success]
|
|
551
|
+
*/
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* @typedef VerifyMobileForgotOtpRequestSchema
|
|
555
|
+
* @property {string} [otp]
|
|
556
|
+
* @property {string} [request_id]
|
|
557
|
+
*/
|
|
558
|
+
|
|
511
559
|
/**
|
|
512
560
|
* @typedef VerifyMobileOTPSuccess
|
|
513
561
|
* @property {UserSchema} [user]
|
|
@@ -536,6 +584,17 @@ class UserApplicationModel {
|
|
|
536
584
|
});
|
|
537
585
|
}
|
|
538
586
|
|
|
587
|
+
/** @returns {APIError} */
|
|
588
|
+
static APIError() {
|
|
589
|
+
return Joi.object({
|
|
590
|
+
code: Joi.string().allow(""),
|
|
591
|
+
info: Joi.string().allow(""),
|
|
592
|
+
message: Joi.string().allow(""),
|
|
593
|
+
meta: Joi.any(),
|
|
594
|
+
request_id: Joi.string().allow(""),
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
|
|
539
598
|
/** @returns {AuthenticationApiErrorSchema} */
|
|
540
599
|
static AuthenticationApiErrorSchema() {
|
|
541
600
|
return Joi.object({
|
|
@@ -965,6 +1024,13 @@ class UserApplicationModel {
|
|
|
965
1024
|
});
|
|
966
1025
|
}
|
|
967
1026
|
|
|
1027
|
+
/** @returns {ResetForgotPasswordSuccess} */
|
|
1028
|
+
static ResetForgotPasswordSuccess() {
|
|
1029
|
+
return Joi.object({
|
|
1030
|
+
success: Joi.boolean(),
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
|
|
968
1034
|
/** @returns {ResetPasswordSuccess} */
|
|
969
1035
|
static ResetPasswordSuccess() {
|
|
970
1036
|
return Joi.object({
|
|
@@ -972,6 +1038,15 @@ class UserApplicationModel {
|
|
|
972
1038
|
});
|
|
973
1039
|
}
|
|
974
1040
|
|
|
1041
|
+
/** @returns {SendEmailForgotOtpRequestSchema} */
|
|
1042
|
+
static SendEmailForgotOtpRequestSchema() {
|
|
1043
|
+
return Joi.object({
|
|
1044
|
+
action: Joi.string().allow(""),
|
|
1045
|
+
email: Joi.string().allow(""),
|
|
1046
|
+
token: Joi.string().allow(""),
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1049
|
+
|
|
975
1050
|
/** @returns {SendEmailOtpRequestSchema} */
|
|
976
1051
|
static SendEmailOtpRequestSchema() {
|
|
977
1052
|
return Joi.object({
|
|
@@ -990,6 +1065,17 @@ class UserApplicationModel {
|
|
|
990
1065
|
});
|
|
991
1066
|
}
|
|
992
1067
|
|
|
1068
|
+
/** @returns {SendMobileForgotOtpRequestSchema} */
|
|
1069
|
+
static SendMobileForgotOtpRequestSchema() {
|
|
1070
|
+
return Joi.object({
|
|
1071
|
+
action: Joi.string().allow(""),
|
|
1072
|
+
android_hash: Joi.string().allow(""),
|
|
1073
|
+
country_code: Joi.string().allow(""),
|
|
1074
|
+
mobile: Joi.string().allow(""),
|
|
1075
|
+
token: Joi.string().allow(""),
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
|
|
993
1079
|
/** @returns {SendMobileOtpRequestSchema} */
|
|
994
1080
|
static SendMobileOtpRequestSchema() {
|
|
995
1081
|
return Joi.object({
|
|
@@ -1146,6 +1232,14 @@ class UserApplicationModel {
|
|
|
1146
1232
|
});
|
|
1147
1233
|
}
|
|
1148
1234
|
|
|
1235
|
+
/** @returns {VerifyEmailForgotOtpRequestSchema} */
|
|
1236
|
+
static VerifyEmailForgotOtpRequestSchema() {
|
|
1237
|
+
return Joi.object({
|
|
1238
|
+
email: Joi.string().allow(""),
|
|
1239
|
+
otp: Joi.string().allow(""),
|
|
1240
|
+
});
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1149
1243
|
/** @returns {VerifyEmailOtpRequestSchema} */
|
|
1150
1244
|
static VerifyEmailOtpRequestSchema() {
|
|
1151
1245
|
return Joi.object({
|
|
@@ -1171,6 +1265,22 @@ class UserApplicationModel {
|
|
|
1171
1265
|
});
|
|
1172
1266
|
}
|
|
1173
1267
|
|
|
1268
|
+
/** @returns {VerifyForgotOtpSuccess} */
|
|
1269
|
+
static VerifyForgotOtpSuccess() {
|
|
1270
|
+
return Joi.object({
|
|
1271
|
+
forgot_token: Joi.string().allow(""),
|
|
1272
|
+
success: Joi.boolean(),
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
/** @returns {VerifyMobileForgotOtpRequestSchema} */
|
|
1277
|
+
static VerifyMobileForgotOtpRequestSchema() {
|
|
1278
|
+
return Joi.object({
|
|
1279
|
+
otp: Joi.string().allow(""),
|
|
1280
|
+
request_id: Joi.string().allow(""),
|
|
1281
|
+
});
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1174
1284
|
/** @returns {VerifyMobileOTPSuccess} */
|
|
1175
1285
|
static VerifyMobileOTPSuccess() {
|
|
1176
1286
|
return Joi.object({
|
|
@@ -93,6 +93,20 @@ export = UserApplicationValidator;
|
|
|
93
93
|
* @property {string} [platform] - ID of the application
|
|
94
94
|
* @property {UserApplicationModel.FormRegisterRequestSchema} body
|
|
95
95
|
*/
|
|
96
|
+
/**
|
|
97
|
+
* @typedef ResetForgotPasswordParam
|
|
98
|
+
* @property {UserApplicationModel.ForgotPasswordRequestSchema} body
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* @typedef SendForgotOTPOnEmailParam
|
|
102
|
+
* @property {string} [platform] - ID of the application
|
|
103
|
+
* @property {UserApplicationModel.SendEmailForgotOtpRequestSchema} body
|
|
104
|
+
*/
|
|
105
|
+
/**
|
|
106
|
+
* @typedef SendForgotOTPOnMobileParam
|
|
107
|
+
* @property {string} [platform] - ID of the application
|
|
108
|
+
* @property {UserApplicationModel.SendMobileForgotOtpRequestSchema} body
|
|
109
|
+
*/
|
|
96
110
|
/**
|
|
97
111
|
* @typedef SendOTPOnEmailParam
|
|
98
112
|
* @property {string} [platform] - ID of the application
|
|
@@ -148,6 +162,11 @@ export = UserApplicationValidator;
|
|
|
148
162
|
* @typedef VerifyEmailParam
|
|
149
163
|
* @property {UserApplicationModel.CodeRequestBodySchema} body
|
|
150
164
|
*/
|
|
165
|
+
/**
|
|
166
|
+
* @typedef VerifyEmailForgotOTPParam
|
|
167
|
+
* @property {string} [platform] - ID of the application
|
|
168
|
+
* @property {UserApplicationModel.VerifyEmailForgotOtpRequestSchema} body
|
|
169
|
+
*/
|
|
151
170
|
/**
|
|
152
171
|
* @typedef VerifyEmailOTPParam
|
|
153
172
|
* @property {string} [platform] - ID of the application
|
|
@@ -157,6 +176,11 @@ export = UserApplicationValidator;
|
|
|
157
176
|
* @typedef VerifyMobileParam
|
|
158
177
|
* @property {UserApplicationModel.CodeRequestBodySchema} body
|
|
159
178
|
*/
|
|
179
|
+
/**
|
|
180
|
+
* @typedef VerifyMobileForgotOTPParam
|
|
181
|
+
* @property {string} [platform] - ID of the application
|
|
182
|
+
* @property {UserApplicationModel.VerifyMobileForgotOtpRequestSchema} body
|
|
183
|
+
*/
|
|
160
184
|
/**
|
|
161
185
|
* @typedef VerifyMobileOTPParam
|
|
162
186
|
* @property {string} [platform] - ID of the application
|
|
@@ -203,6 +227,12 @@ declare class UserApplicationValidator {
|
|
|
203
227
|
static logout(): any;
|
|
204
228
|
/** @returns {RegisterWithFormParam} */
|
|
205
229
|
static registerWithForm(): RegisterWithFormParam;
|
|
230
|
+
/** @returns {ResetForgotPasswordParam} */
|
|
231
|
+
static resetForgotPassword(): ResetForgotPasswordParam;
|
|
232
|
+
/** @returns {SendForgotOTPOnEmailParam} */
|
|
233
|
+
static sendForgotOTPOnEmail(): SendForgotOTPOnEmailParam;
|
|
234
|
+
/** @returns {SendForgotOTPOnMobileParam} */
|
|
235
|
+
static sendForgotOTPOnMobile(): SendForgotOTPOnMobileParam;
|
|
206
236
|
/** @returns {SendOTPOnEmailParam} */
|
|
207
237
|
static sendOTPOnEmail(): SendOTPOnEmailParam;
|
|
208
238
|
/** @returns {SendOTPOnMobileParam} */
|
|
@@ -227,15 +257,19 @@ declare class UserApplicationValidator {
|
|
|
227
257
|
static updateProfile(): UpdateProfileParam;
|
|
228
258
|
/** @returns {VerifyEmailParam} */
|
|
229
259
|
static verifyEmail(): VerifyEmailParam;
|
|
260
|
+
/** @returns {VerifyEmailForgotOTPParam} */
|
|
261
|
+
static verifyEmailForgotOTP(): VerifyEmailForgotOTPParam;
|
|
230
262
|
/** @returns {VerifyEmailOTPParam} */
|
|
231
263
|
static verifyEmailOTP(): VerifyEmailOTPParam;
|
|
232
264
|
/** @returns {VerifyMobileParam} */
|
|
233
265
|
static verifyMobile(): VerifyMobileParam;
|
|
266
|
+
/** @returns {VerifyMobileForgotOTPParam} */
|
|
267
|
+
static verifyMobileForgotOTP(): VerifyMobileForgotOTPParam;
|
|
234
268
|
/** @returns {VerifyMobileOTPParam} */
|
|
235
269
|
static verifyMobileOTP(): VerifyMobileOTPParam;
|
|
236
270
|
}
|
|
237
271
|
declare namespace UserApplicationValidator {
|
|
238
|
-
export { AddEmailParam, AddMobileNumberParam, DeleteEmailParam, DeleteMobileNumberParam, DeleteUserParam, ForgotPasswordParam, GetListOfActiveSessionsParam, GetLoggedInUserParam, GetPlatformConfigParam, HasPasswordParam, LoginWithAppleIOSParam, LoginWithEmailAndPasswordParam, LoginWithFacebookParam, LoginWithGoogleParam, LoginWithGoogleAndroidParam, LoginWithGoogleIOSParam, LoginWithOTPParam, LoginWithTokenParam, LogoutParam, RegisterWithFormParam, SendOTPOnEmailParam, SendOTPOnMobileParam, SendResetPasswordEmailParam, SendResetPasswordMobileParam, SendResetTokenParam, SendVerificationLinkToEmailParam, SendVerificationLinkToMobileParam, SetEmailAsPrimaryParam, SetMobileNumberAsPrimaryParam, UpdatePasswordParam, UpdateProfileParam, VerifyEmailParam, VerifyEmailOTPParam, VerifyMobileParam, VerifyMobileOTPParam };
|
|
272
|
+
export { AddEmailParam, AddMobileNumberParam, DeleteEmailParam, DeleteMobileNumberParam, DeleteUserParam, ForgotPasswordParam, GetListOfActiveSessionsParam, GetLoggedInUserParam, GetPlatformConfigParam, HasPasswordParam, LoginWithAppleIOSParam, LoginWithEmailAndPasswordParam, LoginWithFacebookParam, LoginWithGoogleParam, LoginWithGoogleAndroidParam, LoginWithGoogleIOSParam, LoginWithOTPParam, LoginWithTokenParam, LogoutParam, RegisterWithFormParam, ResetForgotPasswordParam, SendForgotOTPOnEmailParam, SendForgotOTPOnMobileParam, SendOTPOnEmailParam, SendOTPOnMobileParam, SendResetPasswordEmailParam, SendResetPasswordMobileParam, SendResetTokenParam, SendVerificationLinkToEmailParam, SendVerificationLinkToMobileParam, SetEmailAsPrimaryParam, SetMobileNumberAsPrimaryParam, UpdatePasswordParam, UpdateProfileParam, VerifyEmailParam, VerifyEmailForgotOTPParam, VerifyEmailOTPParam, VerifyMobileParam, VerifyMobileForgotOTPParam, VerifyMobileOTPParam };
|
|
239
273
|
}
|
|
240
274
|
type AddEmailParam = {
|
|
241
275
|
/**
|
|
@@ -374,6 +408,23 @@ type RegisterWithFormParam = {
|
|
|
374
408
|
platform?: string;
|
|
375
409
|
body: UserApplicationModel.FormRegisterRequestSchema;
|
|
376
410
|
};
|
|
411
|
+
type ResetForgotPasswordParam = {
|
|
412
|
+
body: UserApplicationModel.ForgotPasswordRequestSchema;
|
|
413
|
+
};
|
|
414
|
+
type SendForgotOTPOnEmailParam = {
|
|
415
|
+
/**
|
|
416
|
+
* - ID of the application
|
|
417
|
+
*/
|
|
418
|
+
platform?: string;
|
|
419
|
+
body: UserApplicationModel.SendEmailForgotOtpRequestSchema;
|
|
420
|
+
};
|
|
421
|
+
type SendForgotOTPOnMobileParam = {
|
|
422
|
+
/**
|
|
423
|
+
* - ID of the application
|
|
424
|
+
*/
|
|
425
|
+
platform?: string;
|
|
426
|
+
body: UserApplicationModel.SendMobileForgotOtpRequestSchema;
|
|
427
|
+
};
|
|
377
428
|
type SendOTPOnEmailParam = {
|
|
378
429
|
/**
|
|
379
430
|
* - ID of the application
|
|
@@ -438,6 +489,13 @@ type UpdateProfileParam = {
|
|
|
438
489
|
type VerifyEmailParam = {
|
|
439
490
|
body: UserApplicationModel.CodeRequestBodySchema;
|
|
440
491
|
};
|
|
492
|
+
type VerifyEmailForgotOTPParam = {
|
|
493
|
+
/**
|
|
494
|
+
* - ID of the application
|
|
495
|
+
*/
|
|
496
|
+
platform?: string;
|
|
497
|
+
body: UserApplicationModel.VerifyEmailForgotOtpRequestSchema;
|
|
498
|
+
};
|
|
441
499
|
type VerifyEmailOTPParam = {
|
|
442
500
|
/**
|
|
443
501
|
* - ID of the application
|
|
@@ -448,6 +506,13 @@ type VerifyEmailOTPParam = {
|
|
|
448
506
|
type VerifyMobileParam = {
|
|
449
507
|
body: UserApplicationModel.CodeRequestBodySchema;
|
|
450
508
|
};
|
|
509
|
+
type VerifyMobileForgotOTPParam = {
|
|
510
|
+
/**
|
|
511
|
+
* - ID of the application
|
|
512
|
+
*/
|
|
513
|
+
platform?: string;
|
|
514
|
+
body: UserApplicationModel.VerifyMobileForgotOtpRequestSchema;
|
|
515
|
+
};
|
|
451
516
|
type VerifyMobileOTPParam = {
|
|
452
517
|
/**
|
|
453
518
|
* - ID of the application
|
|
@@ -116,6 +116,23 @@ const UserApplicationModel = require("./UserApplicationModel");
|
|
|
116
116
|
* @property {UserApplicationModel.FormRegisterRequestSchema} body
|
|
117
117
|
*/
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* @typedef ResetForgotPasswordParam
|
|
121
|
+
* @property {UserApplicationModel.ForgotPasswordRequestSchema} body
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @typedef SendForgotOTPOnEmailParam
|
|
126
|
+
* @property {string} [platform] - ID of the application
|
|
127
|
+
* @property {UserApplicationModel.SendEmailForgotOtpRequestSchema} body
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @typedef SendForgotOTPOnMobileParam
|
|
132
|
+
* @property {string} [platform] - ID of the application
|
|
133
|
+
* @property {UserApplicationModel.SendMobileForgotOtpRequestSchema} body
|
|
134
|
+
*/
|
|
135
|
+
|
|
119
136
|
/**
|
|
120
137
|
* @typedef SendOTPOnEmailParam
|
|
121
138
|
* @property {string} [platform] - ID of the application
|
|
@@ -183,6 +200,12 @@ const UserApplicationModel = require("./UserApplicationModel");
|
|
|
183
200
|
* @property {UserApplicationModel.CodeRequestBodySchema} body
|
|
184
201
|
*/
|
|
185
202
|
|
|
203
|
+
/**
|
|
204
|
+
* @typedef VerifyEmailForgotOTPParam
|
|
205
|
+
* @property {string} [platform] - ID of the application
|
|
206
|
+
* @property {UserApplicationModel.VerifyEmailForgotOtpRequestSchema} body
|
|
207
|
+
*/
|
|
208
|
+
|
|
186
209
|
/**
|
|
187
210
|
* @typedef VerifyEmailOTPParam
|
|
188
211
|
* @property {string} [platform] - ID of the application
|
|
@@ -194,6 +217,12 @@ const UserApplicationModel = require("./UserApplicationModel");
|
|
|
194
217
|
* @property {UserApplicationModel.CodeRequestBodySchema} body
|
|
195
218
|
*/
|
|
196
219
|
|
|
220
|
+
/**
|
|
221
|
+
* @typedef VerifyMobileForgotOTPParam
|
|
222
|
+
* @property {string} [platform] - ID of the application
|
|
223
|
+
* @property {UserApplicationModel.VerifyMobileForgotOtpRequestSchema} body
|
|
224
|
+
*/
|
|
225
|
+
|
|
197
226
|
/**
|
|
198
227
|
* @typedef VerifyMobileOTPParam
|
|
199
228
|
* @property {string} [platform] - ID of the application
|
|
@@ -351,6 +380,29 @@ class UserApplicationValidator {
|
|
|
351
380
|
}).required();
|
|
352
381
|
}
|
|
353
382
|
|
|
383
|
+
/** @returns {ResetForgotPasswordParam} */
|
|
384
|
+
static resetForgotPassword() {
|
|
385
|
+
return Joi.object({
|
|
386
|
+
body: UserApplicationModel.ForgotPasswordRequestSchema().required(),
|
|
387
|
+
}).required();
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** @returns {SendForgotOTPOnEmailParam} */
|
|
391
|
+
static sendForgotOTPOnEmail() {
|
|
392
|
+
return Joi.object({
|
|
393
|
+
platform: Joi.string().allow(""),
|
|
394
|
+
body: UserApplicationModel.SendEmailForgotOtpRequestSchema().required(),
|
|
395
|
+
}).required();
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/** @returns {SendForgotOTPOnMobileParam} */
|
|
399
|
+
static sendForgotOTPOnMobile() {
|
|
400
|
+
return Joi.object({
|
|
401
|
+
platform: Joi.string().allow(""),
|
|
402
|
+
body: UserApplicationModel.SendMobileForgotOtpRequestSchema().required(),
|
|
403
|
+
}).required();
|
|
404
|
+
}
|
|
405
|
+
|
|
354
406
|
/** @returns {SendOTPOnEmailParam} */
|
|
355
407
|
static sendOTPOnEmail() {
|
|
356
408
|
return Joi.object({
|
|
@@ -442,6 +494,14 @@ class UserApplicationValidator {
|
|
|
442
494
|
}).required();
|
|
443
495
|
}
|
|
444
496
|
|
|
497
|
+
/** @returns {VerifyEmailForgotOTPParam} */
|
|
498
|
+
static verifyEmailForgotOTP() {
|
|
499
|
+
return Joi.object({
|
|
500
|
+
platform: Joi.string().allow(""),
|
|
501
|
+
body: UserApplicationModel.VerifyEmailForgotOtpRequestSchema().required(),
|
|
502
|
+
}).required();
|
|
503
|
+
}
|
|
504
|
+
|
|
445
505
|
/** @returns {VerifyEmailOTPParam} */
|
|
446
506
|
static verifyEmailOTP() {
|
|
447
507
|
return Joi.object({
|
|
@@ -457,6 +517,14 @@ class UserApplicationValidator {
|
|
|
457
517
|
}).required();
|
|
458
518
|
}
|
|
459
519
|
|
|
520
|
+
/** @returns {VerifyMobileForgotOTPParam} */
|
|
521
|
+
static verifyMobileForgotOTP() {
|
|
522
|
+
return Joi.object({
|
|
523
|
+
platform: Joi.string().allow(""),
|
|
524
|
+
body: UserApplicationModel.VerifyMobileForgotOtpRequestSchema().required(),
|
|
525
|
+
}).required();
|
|
526
|
+
}
|
|
527
|
+
|
|
460
528
|
/** @returns {VerifyMobileOTPParam} */
|
|
461
529
|
static verifyMobileOTP() {
|
|
462
530
|
return Joi.object({
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export = FileStorage;
|
|
2
|
+
declare class FileStorage {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
8
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
9
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
10
|
+
* stored inside the storage bucket.
|
|
11
|
+
* @param {StartRequest} arg.body
|
|
12
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
13
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
14
|
+
* @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.
|
|
15
|
+
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
16
|
+
*
|
|
17
|
+
* It has three Major Steps:
|
|
18
|
+
* Start
|
|
19
|
+
* Upload
|
|
20
|
+
* Complete
|
|
21
|
+
*
|
|
22
|
+
* ### Start
|
|
23
|
+
* Initiates the assets upload using `startUpload`.
|
|
24
|
+
* It returns the storage link in response.
|
|
25
|
+
*
|
|
26
|
+
* ### Upload
|
|
27
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
28
|
+
* Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body.
|
|
29
|
+
*
|
|
30
|
+
* ### Complete
|
|
31
|
+
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
32
|
+
* This operation will return the url for the uploaded file.
|
|
33
|
+
*/
|
|
34
|
+
startUpload({ namespace, body, requestHeaders }?: {
|
|
35
|
+
namespace: string;
|
|
36
|
+
body: StartRequest;
|
|
37
|
+
requestHeaders?: object;
|
|
38
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
39
|
+
/**
|
|
40
|
+
* @param {Object} arg - Arg object.
|
|
41
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
42
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
43
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
44
|
+
* stored inside the storage bucket.
|
|
45
|
+
* @param {StartResponse} arg.body
|
|
46
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
47
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
48
|
+
* @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
|
|
49
|
+
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
50
|
+
*
|
|
51
|
+
* It has three Major Steps:
|
|
52
|
+
* Start
|
|
53
|
+
* Upload
|
|
54
|
+
* Complete
|
|
55
|
+
*
|
|
56
|
+
* ### Start
|
|
57
|
+
* Initiates the assets upload using `startUpload`.
|
|
58
|
+
* It returns the storage link in response.
|
|
59
|
+
*
|
|
60
|
+
* ### Upload
|
|
61
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
62
|
+
* Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body.
|
|
63
|
+
*
|
|
64
|
+
* ### Complete
|
|
65
|
+
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
66
|
+
* This operation will return the url for the uploaded file.
|
|
67
|
+
*/
|
|
68
|
+
completeUpload({ namespace, body, requestHeaders }?: {
|
|
69
|
+
namespace: string;
|
|
70
|
+
body: StartResponse;
|
|
71
|
+
requestHeaders?: object;
|
|
72
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
73
|
+
/**
|
|
74
|
+
* @param {Object} arg - Arg object.
|
|
75
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
76
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
77
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
78
|
+
* stored inside the storage bucket.
|
|
79
|
+
* @param {string} arg.applicationId -
|
|
80
|
+
* @param {number} arg.companyId -
|
|
81
|
+
* @param {number} [arg.page] - Page no
|
|
82
|
+
* @param {number} [arg.limit] - Limit
|
|
83
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
84
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
85
|
+
* @summary: Browse Files
|
|
86
|
+
* @description: Browse Files
|
|
87
|
+
*/
|
|
88
|
+
browse({ namespace, applicationId, companyId, page, limit, requestHeaders }?: {
|
|
89
|
+
namespace: string;
|
|
90
|
+
applicationId: string;
|
|
91
|
+
companyId: number;
|
|
92
|
+
page?: number;
|
|
93
|
+
limit?: number;
|
|
94
|
+
requestHeaders?: object;
|
|
95
|
+
}, { responseHeaders }?: import("../PartnerAPIClient").Options): Promise<any>;
|
|
96
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
const Paginator = require("../../common/Paginator");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const PartnerAPIClient = require("../PartnerAPIClient");
|
|
4
|
+
const FileStorageValidator = require("./FileStoragePartnerValidator");
|
|
5
|
+
const FileStorageModel = require("./FileStoragePartnerModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
|
|
8
|
+
class FileStorage {
|
|
9
|
+
constructor(config) {
|
|
10
|
+
this.config = config;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param {Object} arg - Arg object.
|
|
15
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
16
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
17
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
18
|
+
* stored inside the storage bucket.
|
|
19
|
+
* @param {StartRequest} arg.body
|
|
20
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
21
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
22
|
+
* @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.
|
|
23
|
+
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
24
|
+
*
|
|
25
|
+
* It has three Major Steps:
|
|
26
|
+
* Start
|
|
27
|
+
* Upload
|
|
28
|
+
* Complete
|
|
29
|
+
*
|
|
30
|
+
* ### Start
|
|
31
|
+
* Initiates the assets upload using `startUpload`.
|
|
32
|
+
* It returns the storage link in response.
|
|
33
|
+
*
|
|
34
|
+
* ### Upload
|
|
35
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
36
|
+
* Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body.
|
|
37
|
+
*
|
|
38
|
+
* ### Complete
|
|
39
|
+
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
40
|
+
* This operation will return the url for the uploaded file.
|
|
41
|
+
*/
|
|
42
|
+
startUpload(
|
|
43
|
+
{ namespace, body, requestHeaders } = { requestHeaders: {} },
|
|
44
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
45
|
+
) {
|
|
46
|
+
const { error } = FileStorageValidator.startUpload().validate(
|
|
47
|
+
{
|
|
48
|
+
namespace,
|
|
49
|
+
body,
|
|
50
|
+
},
|
|
51
|
+
{ abortEarly: false }
|
|
52
|
+
);
|
|
53
|
+
if (error) {
|
|
54
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const query_params = {};
|
|
58
|
+
|
|
59
|
+
return PartnerAPIClient.execute(
|
|
60
|
+
this.config,
|
|
61
|
+
"post",
|
|
62
|
+
`/service/partner/assets/v1.0/organization/${this.config.organizationId}/namespaces/${namespace}/upload/start`,
|
|
63
|
+
query_params,
|
|
64
|
+
body,
|
|
65
|
+
requestHeaders,
|
|
66
|
+
{ responseHeaders }
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @param {Object} arg - Arg object.
|
|
72
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
73
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
74
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
75
|
+
* stored inside the storage bucket.
|
|
76
|
+
* @param {StartResponse} arg.body
|
|
77
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
78
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
79
|
+
* @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
|
|
80
|
+
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
81
|
+
*
|
|
82
|
+
* It has three Major Steps:
|
|
83
|
+
* Start
|
|
84
|
+
* Upload
|
|
85
|
+
* Complete
|
|
86
|
+
*
|
|
87
|
+
* ### Start
|
|
88
|
+
* Initiates the assets upload using `startUpload`.
|
|
89
|
+
* It returns the storage link in response.
|
|
90
|
+
*
|
|
91
|
+
* ### Upload
|
|
92
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
93
|
+
* Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body.
|
|
94
|
+
*
|
|
95
|
+
* ### Complete
|
|
96
|
+
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
97
|
+
* This operation will return the url for the uploaded file.
|
|
98
|
+
*/
|
|
99
|
+
completeUpload(
|
|
100
|
+
{ namespace, body, requestHeaders } = { requestHeaders: {} },
|
|
101
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
102
|
+
) {
|
|
103
|
+
const { error } = FileStorageValidator.completeUpload().validate(
|
|
104
|
+
{
|
|
105
|
+
namespace,
|
|
106
|
+
body,
|
|
107
|
+
},
|
|
108
|
+
{ abortEarly: false }
|
|
109
|
+
);
|
|
110
|
+
if (error) {
|
|
111
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const query_params = {};
|
|
115
|
+
|
|
116
|
+
return PartnerAPIClient.execute(
|
|
117
|
+
this.config,
|
|
118
|
+
"post",
|
|
119
|
+
`/service/partner/assets/v1.0/organization/${this.config.organizationId}/namespaces/${namespace}/upload/complete`,
|
|
120
|
+
query_params,
|
|
121
|
+
body,
|
|
122
|
+
requestHeaders,
|
|
123
|
+
{ responseHeaders }
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @param {Object} arg - Arg object.
|
|
129
|
+
* @param {string} arg.namespace - Segregation of different types of
|
|
130
|
+
* files(products, orders, logistics etc), Required for validating the
|
|
131
|
+
* data of the file being uploaded, decides where exactly the file will be
|
|
132
|
+
* stored inside the storage bucket.
|
|
133
|
+
* @param {string} arg.applicationId -
|
|
134
|
+
* @param {number} arg.companyId -
|
|
135
|
+
* @param {number} [arg.page] - Page no
|
|
136
|
+
* @param {number} [arg.limit] - Limit
|
|
137
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
138
|
+
* @param {import("../PartnerAPIClient").Options} - Options
|
|
139
|
+
* @summary: Browse Files
|
|
140
|
+
* @description: Browse Files
|
|
141
|
+
*/
|
|
142
|
+
browse(
|
|
143
|
+
{ namespace, applicationId, companyId, page, limit, requestHeaders } = {
|
|
144
|
+
requestHeaders: {},
|
|
145
|
+
},
|
|
146
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
147
|
+
) {
|
|
148
|
+
const { error } = FileStorageValidator.browse().validate(
|
|
149
|
+
{
|
|
150
|
+
namespace,
|
|
151
|
+
applicationId,
|
|
152
|
+
companyId,
|
|
153
|
+
page,
|
|
154
|
+
limit,
|
|
155
|
+
},
|
|
156
|
+
{ abortEarly: false }
|
|
157
|
+
);
|
|
158
|
+
if (error) {
|
|
159
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const query_params = {};
|
|
163
|
+
query_params["page"] = page;
|
|
164
|
+
query_params["limit"] = limit;
|
|
165
|
+
|
|
166
|
+
return PartnerAPIClient.execute(
|
|
167
|
+
this.config,
|
|
168
|
+
"get",
|
|
169
|
+
`/service/partner/assets/v1.0/organization/${this.config.organizationId}/company/${companyId}/application/${applicationId}/namespaces/${namespace}/browse`,
|
|
170
|
+
query_params,
|
|
171
|
+
undefined,
|
|
172
|
+
requestHeaders,
|
|
173
|
+
{ responseHeaders }
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
module.exports = FileStorage;
|