@gofynd/fdk-client-javascript 0.1.35
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/.github/workflows/on_create_release.yml +23 -0
- package/.github/workflows/on_merge_main.yml +38 -0
- package/.github/workflows/on_pull_request.yml +35 -0
- package/.prettierrc +5 -0
- package/LICENSE +21 -0
- package/README.md +118 -0
- package/application.d.ts +3 -0
- package/application.js +6 -0
- package/common.d.ts +4 -0
- package/common.js +9 -0
- package/documentation/application/CART.md +7290 -0
- package/documentation/application/CATALOG.md +9570 -0
- package/documentation/application/COMMON.md +448 -0
- package/documentation/application/COMMUNICATION.md +463 -0
- package/documentation/application/CONFIGURATION.md +2902 -0
- package/documentation/application/CONTENT.md +3350 -0
- package/documentation/application/FILESTORAGE.md +491 -0
- package/documentation/application/LEAD.md +1891 -0
- package/documentation/application/LOGISTIC.md +439 -0
- package/documentation/application/ORDER.md +3428 -0
- package/documentation/application/PAYMENT.md +5035 -0
- package/documentation/application/POSCART.md +7889 -0
- package/documentation/application/README.md +21 -0
- package/documentation/application/REWARDS.md +714 -0
- package/documentation/application/SHARE.md +729 -0
- package/documentation/application/THEME.md +5796 -0
- package/documentation/application/USER.md +4326 -0
- package/documentation/platform/ANALYTICS.md +1150 -0
- package/documentation/platform/AUDITTRAIL.md +572 -0
- package/documentation/platform/BILLING.md +2396 -0
- package/documentation/platform/CART.md +5539 -0
- package/documentation/platform/CATALOG.md +21624 -0
- package/documentation/platform/COMMON.md +448 -0
- package/documentation/platform/COMMUNICATION.md +5714 -0
- package/documentation/platform/COMPANYPROFILE.md +2141 -0
- package/documentation/platform/CONFIGURATION.md +7335 -0
- package/documentation/platform/CONTENT.md +8989 -0
- package/documentation/platform/DISCOUNT.md +773 -0
- package/documentation/platform/FILESTORAGE.md +994 -0
- package/documentation/platform/INVENTORY.md +1775 -0
- package/documentation/platform/LEAD.md +4736 -0
- package/documentation/platform/ORDER.md +3764 -0
- package/documentation/platform/PARTNER.md +216 -0
- package/documentation/platform/PAYMENT.md +3444 -0
- package/documentation/platform/README.md +27 -0
- package/documentation/platform/REWARDS.md +871 -0
- package/documentation/platform/SHARE.md +602 -0
- package/documentation/platform/THEME.md +35725 -0
- package/documentation/platform/USER.md +2305 -0
- package/documentation/platform/WEBHOOK.md +587 -0
- package/documentation/public/CONFIGURATION.md +448 -0
- package/documentation/public/INVENTORY.md +686 -0
- package/documentation/public/WEBHOOK.md +348 -0
- package/index.d.ts +10 -0
- package/index.js +18 -0
- package/jest.config.d.ts +4 -0
- package/jest.config.js +6 -0
- package/package.json +35 -0
- package/platform.d.ts +3 -0
- package/platform.js +6 -0
- package/public.d.ts +3 -0
- package/public.js +6 -0
- package/sdk/application/ApplicationAPIClient.d.ts +11 -0
- package/sdk/application/ApplicationAPIClient.js +44 -0
- package/sdk/application/ApplicationClient.d.ts +40 -0
- package/sdk/application/ApplicationClient.js +84 -0
- package/sdk/application/ApplicationConfig.d.ts +19 -0
- package/sdk/application/ApplicationConfig.js +55 -0
- package/sdk/application/ApplicationModels.d.ts +826 -0
- package/sdk/application/ApplicationModels.js +10474 -0
- package/sdk/application/client/CartApplicationClient.d.ts +432 -0
- package/sdk/application/client/CartApplicationClient.js +1066 -0
- package/sdk/application/client/CatalogApplicationClient.d.ts +694 -0
- package/sdk/application/client/CatalogApplicationClient.js +1629 -0
- package/sdk/application/client/CommonApplicationClient.d.ts +38 -0
- package/sdk/application/client/CommonApplicationClient.js +105 -0
- package/sdk/application/client/CommunicationApplicationClient.d.ts +39 -0
- package/sdk/application/client/CommunicationApplicationClient.js +131 -0
- package/sdk/application/client/ConfigurationApplicationClient.d.ts +210 -0
- package/sdk/application/client/ConfigurationApplicationClient.js +649 -0
- package/sdk/application/client/ContentApplicationClient.d.ts +256 -0
- package/sdk/application/client/ContentApplicationClient.js +785 -0
- package/sdk/application/client/FileStorageApplicationClient.d.ts +88 -0
- package/sdk/application/client/FileStorageApplicationClient.js +214 -0
- package/sdk/application/client/LeadApplicationClient.d.ts +90 -0
- package/sdk/application/client/LeadApplicationClient.js +264 -0
- package/sdk/application/client/LogisticApplicationClient.d.ts +42 -0
- package/sdk/application/client/LogisticApplicationClient.js +128 -0
- package/sdk/application/client/OrderApplicationClient.d.ts +190 -0
- package/sdk/application/client/OrderApplicationClient.js +479 -0
- package/sdk/application/client/PaymentApplicationClient.d.ts +454 -0
- package/sdk/application/client/PaymentApplicationClient.js +1378 -0
- package/sdk/application/client/PosCartApplicationClient.d.ts +449 -0
- package/sdk/application/client/PosCartApplicationClient.js +1123 -0
- package/sdk/application/client/RewardsApplicationClient.d.ts +93 -0
- package/sdk/application/client/RewardsApplicationClient.js +293 -0
- package/sdk/application/client/ShareApplicationClient.d.ts +87 -0
- package/sdk/application/client/ShareApplicationClient.js +268 -0
- package/sdk/application/client/ThemeApplicationClient.d.ts +52 -0
- package/sdk/application/client/ThemeApplicationClient.js +161 -0
- package/sdk/application/client/UserApplicationClient.d.ts +446 -0
- package/sdk/application/client/UserApplicationClient.js +1275 -0
- package/sdk/application/constructUrl.d.ts +5 -0
- package/sdk/application/constructUrl.js +13 -0
- package/sdk/application/index.d.ts +2 -0
- package/sdk/application/index.js +4 -0
- package/sdk/application/models/CartValidator.d.ts +29 -0
- package/sdk/application/models/CartValidator.js +223 -0
- package/sdk/application/models/CatalogValidator.d.ts +33 -0
- package/sdk/application/models/CatalogValidator.js +233 -0
- package/sdk/application/models/CommonValidator.d.ts +5 -0
- package/sdk/application/models/CommonValidator.js +18 -0
- package/sdk/application/models/CommunicationValidator.d.ts +6 -0
- package/sdk/application/models/CommunicationValidator.js +20 -0
- package/sdk/application/models/ConfigurationValidator.d.ts +19 -0
- package/sdk/application/models/ConfigurationValidator.js +88 -0
- package/sdk/application/models/ContentValidator.d.ts +22 -0
- package/sdk/application/models/ContentValidator.js +106 -0
- package/sdk/application/models/FileStorageValidator.d.ts +6 -0
- package/sdk/application/models/FileStorageValidator.js +24 -0
- package/sdk/application/models/LeadValidator.d.ts +10 -0
- package/sdk/application/models/LeadValidator.js +48 -0
- package/sdk/application/models/LogisticValidator.d.ts +6 -0
- package/sdk/application/models/LogisticValidator.js +22 -0
- package/sdk/application/models/OrderValidator.d.ts +15 -0
- package/sdk/application/models/OrderValidator.js +87 -0
- package/sdk/application/models/PaymentValidator.d.ts +40 -0
- package/sdk/application/models/PaymentValidator.js +235 -0
- package/sdk/application/models/PosCartValidator.d.ts +30 -0
- package/sdk/application/models/PosCartValidator.js +232 -0
- package/sdk/application/models/RewardsValidator.d.ts +10 -0
- package/sdk/application/models/RewardsValidator.js +43 -0
- package/sdk/application/models/ShareValidator.d.ts +10 -0
- package/sdk/application/models/ShareValidator.js +44 -0
- package/sdk/application/models/ThemeValidator.d.ts +7 -0
- package/sdk/application/models/ThemeValidator.js +27 -0
- package/sdk/application/models/UserValidator.d.ts +38 -0
- package/sdk/application/models/UserValidator.js +233 -0
- package/sdk/common/AxiosHelper.d.ts +1 -0
- package/sdk/common/AxiosHelper.js +141 -0
- package/sdk/common/Constant.d.ts +294 -0
- package/sdk/common/Constant.js +332 -0
- package/sdk/common/FDKError.d.ts +26 -0
- package/sdk/common/FDKError.js +51 -0
- package/sdk/common/Logger.d.ts +2 -0
- package/sdk/common/Logger.js +85 -0
- package/sdk/common/Paginator.d.ts +16 -0
- package/sdk/common/Paginator.js +26 -0
- package/sdk/common/RequestSigner.d.ts +1 -0
- package/sdk/common/RequestSigner.js +306 -0
- package/sdk/common/Utility.d.ts +9 -0
- package/sdk/common/Utility.js +86 -0
- package/sdk/common/utils.d.ts +14 -0
- package/sdk/common/utils.js +165 -0
- package/sdk/platform/OAuthClient.d.ts +26 -0
- package/sdk/platform/OAuthClient.js +221 -0
- package/sdk/platform/PlatformAPIClient.d.ts +12 -0
- package/sdk/platform/PlatformAPIClient.js +43 -0
- package/sdk/platform/PlatformApplicationClient.d.ts +24398 -0
- package/sdk/platform/PlatformApplicationClient.js +23185 -0
- package/sdk/platform/PlatformApplicationModels.d.ts +333 -0
- package/sdk/platform/PlatformApplicationModels.js +21262 -0
- package/sdk/platform/PlatformClient.d.ts +9535 -0
- package/sdk/platform/PlatformClient.js +12336 -0
- package/sdk/platform/PlatformConfig.d.ts +29 -0
- package/sdk/platform/PlatformConfig.js +36 -0
- package/sdk/platform/PlatformModels.d.ts +1396 -0
- package/sdk/platform/PlatformModels.js +19222 -0
- package/sdk/platform/client/AnalyticsPlatformClient.d.ts +84 -0
- package/sdk/platform/client/AnalyticsPlatformClient.js +215 -0
- package/sdk/platform/client/AuditTrailPlatformClient.d.ts +38 -0
- package/sdk/platform/client/AuditTrailPlatformClient.js +133 -0
- package/sdk/platform/client/BillingPlatformClient.d.ts +109 -0
- package/sdk/platform/client/BillingPlatformClient.js +381 -0
- package/sdk/platform/client/CatalogPlatformClient.d.ts +806 -0
- package/sdk/platform/client/CatalogPlatformClient.js +2462 -0
- package/sdk/platform/client/CommonPlatformClient.d.ts +30 -0
- package/sdk/platform/client/CommonPlatformClient.js +84 -0
- package/sdk/platform/client/CommunicationPlatformClient.d.ts +26 -0
- package/sdk/platform/client/CommunicationPlatformClient.js +72 -0
- package/sdk/platform/client/CompanyProfilePlatformClient.d.ts +182 -0
- package/sdk/platform/client/CompanyProfilePlatformClient.js +540 -0
- package/sdk/platform/client/ConfigurationPlatformClient.d.ts +277 -0
- package/sdk/platform/client/ConfigurationPlatformClient.js +806 -0
- package/sdk/platform/client/DiscountPlatformClient.d.ts +118 -0
- package/sdk/platform/client/DiscountPlatformClient.js +364 -0
- package/sdk/platform/client/FileStoragePlatformClient.d.ts +111 -0
- package/sdk/platform/client/FileStoragePlatformClient.js +268 -0
- package/sdk/platform/client/InventoryPlatformClient.d.ts +125 -0
- package/sdk/platform/client/InventoryPlatformClient.js +409 -0
- package/sdk/platform/client/LeadPlatformClient.d.ts +150 -0
- package/sdk/platform/client/LeadPlatformClient.js +439 -0
- package/sdk/platform/client/OrderPlatformClient.d.ts +190 -0
- package/sdk/platform/client/OrderPlatformClient.js +521 -0
- package/sdk/platform/client/PaymentPlatformClient.d.ts +98 -0
- package/sdk/platform/client/PaymentPlatformClient.js +331 -0
- package/sdk/platform/client/WebhookPlatformClient.d.ts +64 -0
- package/sdk/platform/client/WebhookPlatformClient.js +207 -0
- package/sdk/platform/index.d.ts +2 -0
- package/sdk/platform/index.js +4 -0
- package/sdk/platform/models/AnalyticsValidator.d.ts +7 -0
- package/sdk/platform/models/AnalyticsValidator.js +36 -0
- package/sdk/platform/models/AuditTrailValidator.d.ts +7 -0
- package/sdk/platform/models/AuditTrailValidator.js +26 -0
- package/sdk/platform/models/BillingValidator.d.ts +15 -0
- package/sdk/platform/models/BillingValidator.js +72 -0
- package/sdk/platform/models/CartValidator.d.ts +0 -0
- package/sdk/platform/models/CartValidator.js +0 -0
- package/sdk/platform/models/CatalogValidator.d.ts +74 -0
- package/sdk/platform/models/CatalogValidator.js +484 -0
- package/sdk/platform/models/CommonValidator.d.ts +5 -0
- package/sdk/platform/models/CommonValidator.js +18 -0
- package/sdk/platform/models/CommunicationValidator.d.ts +4 -0
- package/sdk/platform/models/CommunicationValidator.js +11 -0
- package/sdk/platform/models/CompanyProfileValidator.d.ts +17 -0
- package/sdk/platform/models/CompanyProfileValidator.js +93 -0
- package/sdk/platform/models/ConfigurationValidator.d.ts +21 -0
- package/sdk/platform/models/ConfigurationValidator.js +134 -0
- package/sdk/platform/models/ContentValidator.d.ts +0 -0
- package/sdk/platform/models/ContentValidator.js +0 -0
- package/sdk/platform/models/DiscountValidator.d.ts +13 -0
- package/sdk/platform/models/DiscountValidator.js +75 -0
- package/sdk/platform/models/FileStorageValidator.d.ts +9 -0
- package/sdk/platform/models/FileStorageValidator.js +44 -0
- package/sdk/platform/models/InventoryValidator.d.ts +15 -0
- package/sdk/platform/models/InventoryValidator.js +81 -0
- package/sdk/platform/models/LeadValidator.d.ts +14 -0
- package/sdk/platform/models/LeadValidator.js +78 -0
- package/sdk/platform/models/OrderValidator.d.ts +14 -0
- package/sdk/platform/models/OrderValidator.js +110 -0
- package/sdk/platform/models/PartnerValidator.d.ts +0 -0
- package/sdk/platform/models/PartnerValidator.js +0 -0
- package/sdk/platform/models/PaymentValidator.d.ts +13 -0
- package/sdk/platform/models/PaymentValidator.js +65 -0
- package/sdk/platform/models/RewardsValidator.d.ts +0 -0
- package/sdk/platform/models/RewardsValidator.js +0 -0
- package/sdk/platform/models/ShareValidator.d.ts +0 -0
- package/sdk/platform/models/ShareValidator.js +0 -0
- package/sdk/platform/models/ThemeValidator.d.ts +0 -0
- package/sdk/platform/models/ThemeValidator.js +0 -0
- package/sdk/platform/models/UserValidator.d.ts +0 -0
- package/sdk/platform/models/UserValidator.js +0 -0
- package/sdk/platform/models/WebhookValidator.d.ts +9 -0
- package/sdk/platform/models/WebhookValidator.js +42 -0
- package/sdk/public/PublicAPIClient.d.ts +11 -0
- package/sdk/public/PublicAPIClient.js +38 -0
- package/sdk/public/PublicClient.d.ts +12 -0
- package/sdk/public/PublicClient.js +24 -0
- package/sdk/public/PublicConfig.d.ts +10 -0
- package/sdk/public/PublicConfig.js +12 -0
- package/sdk/public/PublicModels.d.ts +50 -0
- package/sdk/public/PublicModels.js +712 -0
- package/sdk/public/client/ConfigurationPublicClient.d.ts +38 -0
- package/sdk/public/client/ConfigurationPublicClient.js +102 -0
- package/sdk/public/client/InventoryPublicClient.d.ts +81 -0
- package/sdk/public/client/InventoryPublicClient.js +239 -0
- package/sdk/public/client/WebhookPublicClient.d.ts +28 -0
- package/sdk/public/client/WebhookPublicClient.js +92 -0
- package/sdk/public/constructUrl.d.ts +5 -0
- package/sdk/public/constructUrl.js +13 -0
- package/sdk/public/index.d.ts +2 -0
- package/sdk/public/index.js +4 -0
- package/sdk/public/models/ConfigurationValidator.d.ts +5 -0
- package/sdk/public/models/ConfigurationValidator.js +18 -0
- package/sdk/public/models/InventoryValidator.d.ts +9 -0
- package/sdk/public/models/InventoryValidator.js +43 -0
- package/sdk/public/models/WebhookValidator.d.ts +5 -0
- package/sdk/public/models/WebhookValidator.js +14 -0
- package/tests/application/catalog.spec.js +47 -0
- package/tests/common/action-url.spec.js +35 -0
- package/tests/common/schema/action-url.json +163 -0
- package/tests/common/schema/url-action.json +667 -0
- package/tests/common/url-action.spec.js +48 -0
- package/tests/helpers/cookie.helper.js +31 -0
- package/tests/helpers/oauth.helper.js +43 -0
- package/tests/platform/catalog.spec.js +49 -0
- package/tests/public/location.spec.js +39 -0
|
@@ -0,0 +1,712 @@
|
|
|
1
|
+
const Joi = require("joi");
|
|
2
|
+
|
|
3
|
+
class Validator {
|
|
4
|
+
static ApplicationResponse() {
|
|
5
|
+
return Joi.object({
|
|
6
|
+
application: this.Application(),
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static Currency() {
|
|
11
|
+
return Joi.object({
|
|
12
|
+
_id: Joi.string().allow(""),
|
|
13
|
+
|
|
14
|
+
is_active: Joi.boolean(),
|
|
15
|
+
|
|
16
|
+
name: Joi.string().allow(""),
|
|
17
|
+
|
|
18
|
+
code: Joi.string().allow(""),
|
|
19
|
+
|
|
20
|
+
created_at: Joi.string().allow(""),
|
|
21
|
+
|
|
22
|
+
updated_at: Joi.string().allow(""),
|
|
23
|
+
|
|
24
|
+
decimal_digits: Joi.number(),
|
|
25
|
+
|
|
26
|
+
symbol: Joi.string().allow(""),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static Domain() {
|
|
31
|
+
return Joi.object({
|
|
32
|
+
verified: Joi.boolean(),
|
|
33
|
+
|
|
34
|
+
is_primary: Joi.boolean(),
|
|
35
|
+
|
|
36
|
+
is_shortlink: Joi.boolean(),
|
|
37
|
+
|
|
38
|
+
_id: Joi.string().allow(""),
|
|
39
|
+
|
|
40
|
+
name: Joi.string().allow(""),
|
|
41
|
+
|
|
42
|
+
is_predefined: Joi.boolean(),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static ApplicationWebsite() {
|
|
47
|
+
return Joi.object({
|
|
48
|
+
enabled: Joi.boolean(),
|
|
49
|
+
|
|
50
|
+
basepath: Joi.string().allow(""),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static ApplicationCors() {
|
|
55
|
+
return Joi.object({
|
|
56
|
+
domains: Joi.array().items(Joi.string().allow("")),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static ApplicationAuth() {
|
|
61
|
+
return Joi.object({
|
|
62
|
+
enabled: Joi.boolean(),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static ApplicationRedirections() {
|
|
67
|
+
return Joi.object({
|
|
68
|
+
redirect_from: Joi.string().allow(""),
|
|
69
|
+
|
|
70
|
+
redirect_to: Joi.string().allow(""),
|
|
71
|
+
|
|
72
|
+
type: Joi.string().allow(""),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
static ApplicationMeta() {
|
|
77
|
+
return Joi.object({
|
|
78
|
+
name: Joi.string().allow(""),
|
|
79
|
+
|
|
80
|
+
value: Joi.string().allow(""),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
static SecureUrl() {
|
|
85
|
+
return Joi.object({
|
|
86
|
+
secure_url: Joi.string().allow(""),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
static Application() {
|
|
91
|
+
return Joi.object({
|
|
92
|
+
website: this.ApplicationWebsite(),
|
|
93
|
+
|
|
94
|
+
cors: this.ApplicationCors(),
|
|
95
|
+
|
|
96
|
+
auth: this.ApplicationAuth(),
|
|
97
|
+
|
|
98
|
+
description: Joi.string().allow(""),
|
|
99
|
+
|
|
100
|
+
channel_type: Joi.string().allow(""),
|
|
101
|
+
|
|
102
|
+
cache_ttl: Joi.number(),
|
|
103
|
+
|
|
104
|
+
is_internal: Joi.boolean(),
|
|
105
|
+
|
|
106
|
+
is_active: Joi.boolean(),
|
|
107
|
+
|
|
108
|
+
_id: Joi.string().allow(""),
|
|
109
|
+
|
|
110
|
+
name: Joi.string().allow(""),
|
|
111
|
+
|
|
112
|
+
owner: Joi.string().allow(""),
|
|
113
|
+
|
|
114
|
+
company_id: Joi.number(),
|
|
115
|
+
|
|
116
|
+
token: Joi.string().allow(""),
|
|
117
|
+
|
|
118
|
+
redirections: Joi.array().items(this.ApplicationRedirections()),
|
|
119
|
+
|
|
120
|
+
meta: Joi.array().items(this.ApplicationMeta()),
|
|
121
|
+
|
|
122
|
+
created_at: Joi.string().allow(""),
|
|
123
|
+
|
|
124
|
+
updated_at: Joi.string().allow(""),
|
|
125
|
+
|
|
126
|
+
__v: Joi.number(),
|
|
127
|
+
|
|
128
|
+
banner: this.SecureUrl(),
|
|
129
|
+
|
|
130
|
+
logo: this.SecureUrl(),
|
|
131
|
+
|
|
132
|
+
favicon: this.SecureUrl(),
|
|
133
|
+
|
|
134
|
+
domains: Joi.array().items(this.Domain()),
|
|
135
|
+
|
|
136
|
+
app_type: Joi.string().allow(""),
|
|
137
|
+
|
|
138
|
+
mobile_logo: this.SecureUrl(),
|
|
139
|
+
|
|
140
|
+
domain: this.Domain(),
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
static NotFound() {
|
|
145
|
+
return Joi.object({
|
|
146
|
+
message: Joi.string().allow(""),
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
static BadRequest() {
|
|
151
|
+
return Joi.object({
|
|
152
|
+
message: Joi.string().allow(""),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
static Page() {
|
|
157
|
+
return Joi.object({
|
|
158
|
+
type: Joi.string().allow("").required(),
|
|
159
|
+
|
|
160
|
+
size: Joi.number(),
|
|
161
|
+
|
|
162
|
+
current: Joi.number(),
|
|
163
|
+
|
|
164
|
+
has_next: Joi.boolean(),
|
|
165
|
+
|
|
166
|
+
item_total: Joi.number(),
|
|
167
|
+
|
|
168
|
+
next_id: Joi.string().allow(""),
|
|
169
|
+
|
|
170
|
+
has_previous: Joi.boolean(),
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
static LocationDefaultLanguage() {
|
|
175
|
+
return Joi.object({
|
|
176
|
+
name: Joi.string().allow(""),
|
|
177
|
+
|
|
178
|
+
code: Joi.string().allow(""),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
static LocationDefaultCurrency() {
|
|
183
|
+
return Joi.object({
|
|
184
|
+
name: Joi.string().allow(""),
|
|
185
|
+
|
|
186
|
+
symbol: Joi.string().allow(""),
|
|
187
|
+
|
|
188
|
+
code: Joi.string().allow(""),
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
static LocationCountry() {
|
|
193
|
+
return Joi.object({
|
|
194
|
+
capital: Joi.string().allow(""),
|
|
195
|
+
|
|
196
|
+
currency: Joi.string().allow(""),
|
|
197
|
+
|
|
198
|
+
iso2: Joi.string().allow(""),
|
|
199
|
+
|
|
200
|
+
iso3: Joi.string().allow(""),
|
|
201
|
+
|
|
202
|
+
name: Joi.string().allow(""),
|
|
203
|
+
|
|
204
|
+
parent: Joi.string().allow(""),
|
|
205
|
+
|
|
206
|
+
phone_code: Joi.string().allow(""),
|
|
207
|
+
|
|
208
|
+
type: Joi.string().allow(""),
|
|
209
|
+
|
|
210
|
+
uid: Joi.number(),
|
|
211
|
+
|
|
212
|
+
__v: Joi.number(),
|
|
213
|
+
|
|
214
|
+
_id: Joi.string().allow(""),
|
|
215
|
+
|
|
216
|
+
default_currency: this.LocationDefaultCurrency(),
|
|
217
|
+
|
|
218
|
+
default_language: this.LocationDefaultLanguage(),
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
static Locations() {
|
|
223
|
+
return Joi.object({
|
|
224
|
+
items: Joi.array().items(Joi.any()),
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
static EventConfig() {
|
|
229
|
+
return Joi.object({
|
|
230
|
+
id: Joi.number(),
|
|
231
|
+
|
|
232
|
+
event_name: Joi.string().allow(""),
|
|
233
|
+
|
|
234
|
+
event_type: Joi.string().allow(""),
|
|
235
|
+
|
|
236
|
+
event_category: Joi.string().allow(""),
|
|
237
|
+
|
|
238
|
+
version: Joi.string().allow(""),
|
|
239
|
+
|
|
240
|
+
display_name: Joi.string().allow(""),
|
|
241
|
+
|
|
242
|
+
description: Joi.string().allow(""),
|
|
243
|
+
|
|
244
|
+
created_on: Joi.string().allow(""),
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
static EventConfigList() {
|
|
249
|
+
return Joi.object({
|
|
250
|
+
items: Joi.array().items(this.EventConfig()),
|
|
251
|
+
|
|
252
|
+
page: this.Page(),
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
static EventConfigResponse() {
|
|
257
|
+
return Joi.object({
|
|
258
|
+
event_configs: Joi.array().items(this.EventConfig()),
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
static SubscriberConfigList() {
|
|
263
|
+
return Joi.object({
|
|
264
|
+
items: Joi.array().items(this.SubscriberResponse()),
|
|
265
|
+
|
|
266
|
+
page: this.Page(),
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
static EventProcessedStatus() {
|
|
271
|
+
return Joi.object({
|
|
272
|
+
id: Joi.number(),
|
|
273
|
+
|
|
274
|
+
subscriber_id: Joi.string().allow(""),
|
|
275
|
+
|
|
276
|
+
attempt: Joi.number(),
|
|
277
|
+
|
|
278
|
+
response_code: Joi.string().allow(""),
|
|
279
|
+
|
|
280
|
+
response_message: Joi.string().allow(""),
|
|
281
|
+
|
|
282
|
+
created_on: Joi.string().allow(""),
|
|
283
|
+
|
|
284
|
+
processed_on: Joi.string().allow(""),
|
|
285
|
+
|
|
286
|
+
status: Joi.boolean(),
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
static EventPayload() {
|
|
291
|
+
return Joi.object({
|
|
292
|
+
id: Joi.number(),
|
|
293
|
+
|
|
294
|
+
event_trace_id: Joi.string().allow(""),
|
|
295
|
+
|
|
296
|
+
message_id: Joi.string().allow(""),
|
|
297
|
+
|
|
298
|
+
event_name: Joi.string().allow(""),
|
|
299
|
+
|
|
300
|
+
event_type: Joi.string().allow(""),
|
|
301
|
+
|
|
302
|
+
version: Joi.string().allow(""),
|
|
303
|
+
|
|
304
|
+
status: Joi.boolean(),
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
static SubscriberConfig() {
|
|
309
|
+
return Joi.object({
|
|
310
|
+
id: Joi.number(),
|
|
311
|
+
|
|
312
|
+
name: Joi.string().allow(""),
|
|
313
|
+
|
|
314
|
+
webhook_url: Joi.string().allow(""),
|
|
315
|
+
|
|
316
|
+
association: this.Association(),
|
|
317
|
+
|
|
318
|
+
custom_headers: Joi.any(),
|
|
319
|
+
|
|
320
|
+
status: this.SubscriberStatus(),
|
|
321
|
+
|
|
322
|
+
email_id: Joi.string().allow(""),
|
|
323
|
+
|
|
324
|
+
auth_meta: this.AuthMeta(),
|
|
325
|
+
|
|
326
|
+
event_id: Joi.array().items(Joi.number()),
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
static SubscriberResponse() {
|
|
331
|
+
return Joi.object({
|
|
332
|
+
id: Joi.number(),
|
|
333
|
+
|
|
334
|
+
name: Joi.string().allow(""),
|
|
335
|
+
|
|
336
|
+
webhook_url: Joi.string().allow(""),
|
|
337
|
+
|
|
338
|
+
association: this.Association(),
|
|
339
|
+
|
|
340
|
+
custom_headers: Joi.any(),
|
|
341
|
+
|
|
342
|
+
email_id: Joi.string().allow(""),
|
|
343
|
+
|
|
344
|
+
status: this.SubscriberStatus(),
|
|
345
|
+
|
|
346
|
+
auth_meta: this.AuthMeta(),
|
|
347
|
+
|
|
348
|
+
created_on: Joi.string().allow(""),
|
|
349
|
+
|
|
350
|
+
updated_on: Joi.string().allow(""),
|
|
351
|
+
|
|
352
|
+
event_configs: Joi.array().items(this.EventConfig()),
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
static SubscriberEvent() {
|
|
357
|
+
return Joi.object({
|
|
358
|
+
id: Joi.number(),
|
|
359
|
+
|
|
360
|
+
subscriber_id: Joi.number(),
|
|
361
|
+
|
|
362
|
+
event_id: Joi.number(),
|
|
363
|
+
|
|
364
|
+
created_date: Joi.string().allow(""),
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
static AuthMeta() {
|
|
369
|
+
return Joi.object({
|
|
370
|
+
type: Joi.string().allow(""),
|
|
371
|
+
|
|
372
|
+
secret: Joi.string().allow(""),
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
static Association() {
|
|
377
|
+
return Joi.object({
|
|
378
|
+
company_id: Joi.number(),
|
|
379
|
+
|
|
380
|
+
application_id: Joi.array().items(Joi.string().allow("")),
|
|
381
|
+
|
|
382
|
+
extension_id: Joi.string().allow(""),
|
|
383
|
+
|
|
384
|
+
criteria: Joi.string().allow(""),
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
static EventConfigBase() {
|
|
389
|
+
return Joi.object({
|
|
390
|
+
event_name: Joi.string().allow(""),
|
|
391
|
+
|
|
392
|
+
event_type: Joi.string().allow(""),
|
|
393
|
+
|
|
394
|
+
event_category: Joi.string().allow(""),
|
|
395
|
+
|
|
396
|
+
version: Joi.string().allow(""),
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
static EmailJobMetrics() {
|
|
401
|
+
return Joi.object({
|
|
402
|
+
executed: Joi.boolean(),
|
|
403
|
+
|
|
404
|
+
id: Joi.string().allow(""),
|
|
405
|
+
|
|
406
|
+
job_code: Joi.string().allow(""),
|
|
407
|
+
|
|
408
|
+
daily_job: Joi.boolean(),
|
|
409
|
+
|
|
410
|
+
last_executed_on: Joi.string().allow(""),
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
static ResponseEnvelopeEmailJobMetrics() {
|
|
415
|
+
return Joi.object({
|
|
416
|
+
timestamp: Joi.string().allow(""),
|
|
417
|
+
|
|
418
|
+
status: Joi.number(),
|
|
419
|
+
|
|
420
|
+
error: Joi.string().allow(""),
|
|
421
|
+
|
|
422
|
+
exception: Joi.string().allow(""),
|
|
423
|
+
|
|
424
|
+
message: Joi.string().allow(""),
|
|
425
|
+
|
|
426
|
+
total_time_taken_in_millis: Joi.number(),
|
|
427
|
+
|
|
428
|
+
http_status: Joi.string().allow(""),
|
|
429
|
+
|
|
430
|
+
items: this.EmailJobMetrics(),
|
|
431
|
+
|
|
432
|
+
payload: this.EmailJobMetrics(),
|
|
433
|
+
|
|
434
|
+
trace_id: Joi.string().allow(""),
|
|
435
|
+
|
|
436
|
+
page: this.Page(),
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
static GCompany() {
|
|
441
|
+
return Joi.object({
|
|
442
|
+
_id: Joi.string().allow(""),
|
|
443
|
+
|
|
444
|
+
integration: Joi.string().allow(""),
|
|
445
|
+
|
|
446
|
+
level: Joi.string().allow(""),
|
|
447
|
+
|
|
448
|
+
uid: Joi.number(),
|
|
449
|
+
|
|
450
|
+
opted: Joi.boolean(),
|
|
451
|
+
|
|
452
|
+
permissions: Joi.array().items(Joi.string().allow("")),
|
|
453
|
+
|
|
454
|
+
token: Joi.string().allow(""),
|
|
455
|
+
|
|
456
|
+
name: Joi.string().allow(""),
|
|
457
|
+
|
|
458
|
+
stores: Joi.array().items(this.GStore()),
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
static GStore() {
|
|
463
|
+
return Joi.object({
|
|
464
|
+
_id: Joi.string().allow(""),
|
|
465
|
+
|
|
466
|
+
integration: Joi.string().allow(""),
|
|
467
|
+
|
|
468
|
+
level: Joi.string().allow(""),
|
|
469
|
+
|
|
470
|
+
uid: Joi.number(),
|
|
471
|
+
|
|
472
|
+
opted: Joi.boolean(),
|
|
473
|
+
|
|
474
|
+
permissions: Joi.array().items(Joi.string().allow("")),
|
|
475
|
+
|
|
476
|
+
token: Joi.string().allow(""),
|
|
477
|
+
|
|
478
|
+
code: Joi.string().allow(""),
|
|
479
|
+
|
|
480
|
+
name: Joi.string().allow(""),
|
|
481
|
+
|
|
482
|
+
data: this.StoreData(),
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
static Metum() {
|
|
487
|
+
return Joi.object({
|
|
488
|
+
_id: Joi.string().allow(""),
|
|
489
|
+
|
|
490
|
+
name: Joi.string().allow(""),
|
|
491
|
+
|
|
492
|
+
value: Joi.string().allow(""),
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
static ResponseEnvelopeSlingshotConfigurationDetail() {
|
|
497
|
+
return Joi.object({
|
|
498
|
+
timestamp: Joi.string().allow(""),
|
|
499
|
+
|
|
500
|
+
status: Joi.number(),
|
|
501
|
+
|
|
502
|
+
error: Joi.string().allow(""),
|
|
503
|
+
|
|
504
|
+
exception: Joi.string().allow(""),
|
|
505
|
+
|
|
506
|
+
message: Joi.string().allow(""),
|
|
507
|
+
|
|
508
|
+
total_time_taken_in_millis: Joi.number(),
|
|
509
|
+
|
|
510
|
+
http_status: Joi.string().allow(""),
|
|
511
|
+
|
|
512
|
+
items: this.SlingshotConfigurationDetail(),
|
|
513
|
+
|
|
514
|
+
payload: this.SlingshotConfigurationDetail(),
|
|
515
|
+
|
|
516
|
+
trace_id: Joi.string().allow(""),
|
|
517
|
+
|
|
518
|
+
page: this.Page(),
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
static SlingshotConfigurationDetail() {
|
|
523
|
+
return Joi.object({
|
|
524
|
+
integration: this.SlingshotIntegration(),
|
|
525
|
+
|
|
526
|
+
companies: Joi.array().items(this.GCompany()),
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
static SlingshotIntegration() {
|
|
531
|
+
return Joi.object({
|
|
532
|
+
_id: Joi.string().allow(""),
|
|
533
|
+
|
|
534
|
+
description: Joi.string().allow(""),
|
|
535
|
+
|
|
536
|
+
name: Joi.string().allow(""),
|
|
537
|
+
|
|
538
|
+
slug: Joi.string().allow(""),
|
|
539
|
+
|
|
540
|
+
meta: Joi.array().items(this.Metum()),
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
static StoreData() {
|
|
545
|
+
return Joi.object({
|
|
546
|
+
location_id: Joi.string().allow(""),
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
static ApikeyModel() {
|
|
551
|
+
return Joi.object({
|
|
552
|
+
session_id: Joi.string().allow(""),
|
|
553
|
+
|
|
554
|
+
error_message: Joi.string().allow(""),
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
static ResponseEnvelopeApikeyModel() {
|
|
559
|
+
return Joi.object({
|
|
560
|
+
timestamp: Joi.string().allow(""),
|
|
561
|
+
|
|
562
|
+
status: Joi.number(),
|
|
563
|
+
|
|
564
|
+
error: Joi.string().allow(""),
|
|
565
|
+
|
|
566
|
+
exception: Joi.string().allow(""),
|
|
567
|
+
|
|
568
|
+
message: Joi.string().allow(""),
|
|
569
|
+
|
|
570
|
+
total_time_taken_in_millis: Joi.number(),
|
|
571
|
+
|
|
572
|
+
http_status: Joi.string().allow(""),
|
|
573
|
+
|
|
574
|
+
items: this.ApikeyModel(),
|
|
575
|
+
|
|
576
|
+
payload: this.ApikeyModel(),
|
|
577
|
+
|
|
578
|
+
trace_id: Joi.string().allow(""),
|
|
579
|
+
|
|
580
|
+
page: this.Page(),
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
static DataTresholdDTO() {
|
|
585
|
+
return Joi.object({
|
|
586
|
+
min_price: Joi.number(),
|
|
587
|
+
|
|
588
|
+
safe_stock: Joi.number(),
|
|
589
|
+
|
|
590
|
+
period_threshold: Joi.number(),
|
|
591
|
+
|
|
592
|
+
period_threshold_type: Joi.string().allow(""),
|
|
593
|
+
|
|
594
|
+
period_type_list: Joi.array().items(this.GenericDTO()),
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
static GenericDTO() {
|
|
599
|
+
return Joi.object({
|
|
600
|
+
text: Joi.string().allow(""),
|
|
601
|
+
|
|
602
|
+
value: Joi.any(),
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
static JobConfigDTO() {
|
|
607
|
+
return Joi.object({
|
|
608
|
+
integration_data: Joi.object().pattern(/\S/, Joi.any()),
|
|
609
|
+
|
|
610
|
+
company_name: Joi.string().allow(""),
|
|
611
|
+
|
|
612
|
+
integration: Joi.string().allow("").required(),
|
|
613
|
+
|
|
614
|
+
company_id: Joi.number().required(),
|
|
615
|
+
|
|
616
|
+
task_details: this.TaskDTO(),
|
|
617
|
+
|
|
618
|
+
threshold_details: this.DataTresholdDTO(),
|
|
619
|
+
|
|
620
|
+
job_code: Joi.string().allow(""),
|
|
621
|
+
|
|
622
|
+
alias: Joi.string().allow(""),
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
static ResponseEnvelopeJobConfigDTO() {
|
|
627
|
+
return Joi.object({
|
|
628
|
+
timestamp: Joi.string().allow(""),
|
|
629
|
+
|
|
630
|
+
status: Joi.number(),
|
|
631
|
+
|
|
632
|
+
error: Joi.string().allow(""),
|
|
633
|
+
|
|
634
|
+
exception: Joi.string().allow(""),
|
|
635
|
+
|
|
636
|
+
message: Joi.string().allow(""),
|
|
637
|
+
|
|
638
|
+
total_time_taken_in_millis: Joi.number(),
|
|
639
|
+
|
|
640
|
+
http_status: Joi.string().allow(""),
|
|
641
|
+
|
|
642
|
+
items: this.JobConfigDTO(),
|
|
643
|
+
|
|
644
|
+
payload: this.JobConfigDTO(),
|
|
645
|
+
|
|
646
|
+
trace_id: Joi.string().allow(""),
|
|
647
|
+
|
|
648
|
+
page: this.Page(),
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
static TaskDTO() {
|
|
653
|
+
return Joi.object({
|
|
654
|
+
type: Joi.number(),
|
|
655
|
+
|
|
656
|
+
group_list: Joi.array().items(this.GenericDTO()),
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
static ResponseEnvelopeListJobConfigDTO() {
|
|
661
|
+
return Joi.object({
|
|
662
|
+
timestamp: Joi.string().allow(""),
|
|
663
|
+
|
|
664
|
+
status: Joi.number(),
|
|
665
|
+
|
|
666
|
+
error: Joi.string().allow(""),
|
|
667
|
+
|
|
668
|
+
exception: Joi.string().allow(""),
|
|
669
|
+
|
|
670
|
+
message: Joi.string().allow(""),
|
|
671
|
+
|
|
672
|
+
total_time_taken_in_millis: Joi.number(),
|
|
673
|
+
|
|
674
|
+
http_status: Joi.string().allow(""),
|
|
675
|
+
|
|
676
|
+
items: Joi.array().items(this.JobConfigDTO()),
|
|
677
|
+
|
|
678
|
+
payload: Joi.array().items(this.JobConfigDTO()),
|
|
679
|
+
|
|
680
|
+
trace_id: Joi.string().allow(""),
|
|
681
|
+
|
|
682
|
+
page: this.Page(),
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
static ResponseEnvelopeObject() {
|
|
687
|
+
return Joi.object({
|
|
688
|
+
timestamp: Joi.string().allow(""),
|
|
689
|
+
|
|
690
|
+
status: Joi.number(),
|
|
691
|
+
|
|
692
|
+
error: Joi.string().allow(""),
|
|
693
|
+
|
|
694
|
+
exception: Joi.string().allow(""),
|
|
695
|
+
|
|
696
|
+
message: Joi.string().allow(""),
|
|
697
|
+
|
|
698
|
+
total_time_taken_in_millis: Joi.number(),
|
|
699
|
+
|
|
700
|
+
http_status: Joi.string().allow(""),
|
|
701
|
+
|
|
702
|
+
items: Joi.any(),
|
|
703
|
+
|
|
704
|
+
payload: Joi.any(),
|
|
705
|
+
|
|
706
|
+
trace_id: Joi.string().allow(""),
|
|
707
|
+
|
|
708
|
+
page: this.Page(),
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
module.exports = Validator;
|