@gofynd/fdk-client-javascript 1.5.1 → 1.6.0
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/Cart/CartApplicationClient.js +293 -0
- package/sdk/application/Catalog/CatalogApplicationClient.js +408 -0
- package/sdk/application/Common/CommonApplicationClient.js +21 -0
- package/sdk/application/Communication/CommunicationApplicationClient.js +29 -0
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +147 -0
- package/sdk/application/Content/ContentApplicationClient.js +226 -0
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +43 -0
- package/sdk/application/Finance/FinanceApplicationClient.js +21 -0
- package/sdk/application/Lead/LeadApplicationClient.js +73 -0
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -1
- package/sdk/application/Logistic/LogisticApplicationClient.js +192 -3
- package/sdk/application/Order/OrderApplicationClient.js +202 -0
- package/sdk/application/Payment/PaymentApplicationClient.js +454 -0
- package/sdk/application/Rewards/RewardsApplicationClient.js +68 -0
- package/sdk/application/Share/ShareApplicationClient.js +96 -0
- package/sdk/application/Theme/ThemeApplicationClient.js +64 -0
- package/sdk/application/User/UserApplicationClient.js +412 -0
- package/sdk/application/Webhook/WebhookApplicationClient.js +13 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +10 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +75 -0
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +54 -1
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +43 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.d.ts +1 -0
- package/sdk/partner/FileStorage/FileStoragePartnerValidator.js +6 -0
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +16 -3
- package/sdk/partner/Webhook/WebhookPartnerModel.js +5 -3
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +4 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +46 -23
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +12 -23
- package/sdk/platform/Cart/CartPlatformModel.d.ts +59 -1
- package/sdk/platform/Cart/CartPlatformModel.js +31 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -12
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -81
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -10
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -12
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +13 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +82 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +10 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +12 -0
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +129 -1
- package/sdk/platform/Payment/PaymentPlatformModel.js +94 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +2 -2
- package/sdk/platform/User/UserPlatformModel.js +2 -2
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +58 -14
- package/sdk/platform/Webhook/WebhookPlatformModel.js +15 -14
- package/sdk/public/Catalog/CatalogPublicClient.d.ts +22 -0
- package/sdk/public/Catalog/CatalogPublicClient.js +138 -0
- package/sdk/public/Catalog/CatalogPublicModel.d.ts +155 -0
- package/sdk/public/Catalog/CatalogPublicModel.js +116 -0
- package/sdk/public/Catalog/CatalogPublicValidator.d.ts +55 -0
- package/sdk/public/Catalog/CatalogPublicValidator.js +35 -0
- package/sdk/public/Configuration/ConfigurationPublicClient.js +16 -0
- package/sdk/public/Content/ContentPublicClient.js +116 -0
- package/sdk/public/Partner/PartnerPublicClient.js +15 -0
- package/sdk/public/PublicClient.d.ts +2 -0
- package/sdk/public/PublicClient.js +4 -0
- package/sdk/public/Webhook/WebhookPublicClient.js +40 -0
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +194 -46
- package/sdk/public/Webhook/WebhookPublicModel.js +51 -46
- package/sdk/public/index.d.ts +1 -0
- package/sdk/public/index.js +2 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
export = CatalogPublicModel;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef TaxonomyItemAttributeSchemaObject
|
|
4
|
+
* @property {string} [type] - The data type of the attribute".
|
|
5
|
+
* @property {boolean} [mandatory] - Specifies if the attribute is mandatory.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @typedef TaxonomyItemAttributesResponseSchema
|
|
9
|
+
* @property {string} [id] - Unique identifier for the attribute.
|
|
10
|
+
* @property {string} [name] - The name of the attribute, such as "Color" or "Size".
|
|
11
|
+
* @property {string} [slug] - A URL-friendly identifier for the attribute,
|
|
12
|
+
* which is used for filtering or querying.
|
|
13
|
+
* @property {TaxonomyItemAttributeSchemaObject} [schema]
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @typedef TaxonomyItemResponseSchema
|
|
17
|
+
* @property {number} uid - Unique identifier for the taxonomy item.
|
|
18
|
+
* @property {string} name - The name of the taxonomy item. For example, it
|
|
19
|
+
* could be the name of a department or category.
|
|
20
|
+
* @property {string} slug - A URL-friendly identifier for the taxonomy item.
|
|
21
|
+
* The slug differs based on the level: - At level 0, it refers to the
|
|
22
|
+
* department. - At level 1, it refers to the L1 category. - At level 2, it
|
|
23
|
+
* refers to the L2 category. - At level 3, it refers to the L3 category.
|
|
24
|
+
* @property {number} level - The level level of the taxonomy item in the
|
|
25
|
+
* hierarchy: - 0: Department - 1: L1 category - 2: L2 category - 3: L3 category
|
|
26
|
+
* @property {TaxonomyItemAttributesResponseSchema[]} [attributes] - A list of
|
|
27
|
+
* attributes associated with the taxonomy item, such as color or size. These
|
|
28
|
+
* attributes may differ depending on the level of the taxonomy.
|
|
29
|
+
* @property {string} [product_template_slug] - A slug identifier for the
|
|
30
|
+
* template associated with this taxonomy item. It links the taxonomy to a
|
|
31
|
+
* specific product template.
|
|
32
|
+
* @property {string} [product_template_name] - A Name for the template
|
|
33
|
+
* associated with this taxonomy item. It links the taxonomy to a specific
|
|
34
|
+
* product template.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* @typedef TaxonomyResponseSchema
|
|
38
|
+
* @property {TaxonomyItemResponseSchema[]} [items] - List of taxonomy items for
|
|
39
|
+
* the requested level level. Each item represents a taxonomy node with
|
|
40
|
+
* details about its category, attributes, and associated template.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* @typedef ValidationErrors
|
|
44
|
+
* @property {ValidationError[]} errors
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* @typedef ValidationError
|
|
48
|
+
* @property {string} message - A brief description of the error encountered.
|
|
49
|
+
* @property {string} field - The field in the request that caused the error.
|
|
50
|
+
*/
|
|
51
|
+
declare class CatalogPublicModel {
|
|
52
|
+
}
|
|
53
|
+
declare namespace CatalogPublicModel {
|
|
54
|
+
export { TaxonomyItemAttributeSchemaObject, TaxonomyItemAttributesResponseSchema, TaxonomyItemResponseSchema, TaxonomyResponseSchema, ValidationErrors, ValidationError };
|
|
55
|
+
}
|
|
56
|
+
/** @returns {TaxonomyItemAttributeSchemaObject} */
|
|
57
|
+
declare function TaxonomyItemAttributeSchemaObject(): TaxonomyItemAttributeSchemaObject;
|
|
58
|
+
type TaxonomyItemAttributeSchemaObject = {
|
|
59
|
+
/**
|
|
60
|
+
* - The data type of the attribute".
|
|
61
|
+
*/
|
|
62
|
+
type?: string;
|
|
63
|
+
/**
|
|
64
|
+
* - Specifies if the attribute is mandatory.
|
|
65
|
+
*/
|
|
66
|
+
mandatory?: boolean;
|
|
67
|
+
};
|
|
68
|
+
/** @returns {TaxonomyItemAttributesResponseSchema} */
|
|
69
|
+
declare function TaxonomyItemAttributesResponseSchema(): TaxonomyItemAttributesResponseSchema;
|
|
70
|
+
type TaxonomyItemAttributesResponseSchema = {
|
|
71
|
+
/**
|
|
72
|
+
* - Unique identifier for the attribute.
|
|
73
|
+
*/
|
|
74
|
+
id?: string;
|
|
75
|
+
/**
|
|
76
|
+
* - The name of the attribute, such as "Color" or "Size".
|
|
77
|
+
*/
|
|
78
|
+
name?: string;
|
|
79
|
+
/**
|
|
80
|
+
* - A URL-friendly identifier for the attribute,
|
|
81
|
+
* which is used for filtering or querying.
|
|
82
|
+
*/
|
|
83
|
+
slug?: string;
|
|
84
|
+
schema?: TaxonomyItemAttributeSchemaObject;
|
|
85
|
+
};
|
|
86
|
+
/** @returns {TaxonomyItemResponseSchema} */
|
|
87
|
+
declare function TaxonomyItemResponseSchema(): TaxonomyItemResponseSchema;
|
|
88
|
+
type TaxonomyItemResponseSchema = {
|
|
89
|
+
/**
|
|
90
|
+
* - Unique identifier for the taxonomy item.
|
|
91
|
+
*/
|
|
92
|
+
uid: number;
|
|
93
|
+
/**
|
|
94
|
+
* - The name of the taxonomy item. For example, it
|
|
95
|
+
* could be the name of a department or category.
|
|
96
|
+
*/
|
|
97
|
+
name: string;
|
|
98
|
+
/**
|
|
99
|
+
* - A URL-friendly identifier for the taxonomy item.
|
|
100
|
+
* The slug differs based on the level: - At level 0, it refers to the
|
|
101
|
+
* department. - At level 1, it refers to the L1 category. - At level 2, it
|
|
102
|
+
* refers to the L2 category. - At level 3, it refers to the L3 category.
|
|
103
|
+
*/
|
|
104
|
+
slug: string;
|
|
105
|
+
/**
|
|
106
|
+
* - The level level of the taxonomy item in the
|
|
107
|
+
* hierarchy: - 0: Department - 1: L1 category - 2: L2 category - 3: L3 category
|
|
108
|
+
*/
|
|
109
|
+
level: number;
|
|
110
|
+
/**
|
|
111
|
+
* - A list of
|
|
112
|
+
* attributes associated with the taxonomy item, such as color or size. These
|
|
113
|
+
* attributes may differ depending on the level of the taxonomy.
|
|
114
|
+
*/
|
|
115
|
+
attributes?: TaxonomyItemAttributesResponseSchema[];
|
|
116
|
+
/**
|
|
117
|
+
* - A slug identifier for the
|
|
118
|
+
* template associated with this taxonomy item. It links the taxonomy to a
|
|
119
|
+
* specific product template.
|
|
120
|
+
*/
|
|
121
|
+
product_template_slug?: string;
|
|
122
|
+
/**
|
|
123
|
+
* - A Name for the template
|
|
124
|
+
* associated with this taxonomy item. It links the taxonomy to a specific
|
|
125
|
+
* product template.
|
|
126
|
+
*/
|
|
127
|
+
product_template_name?: string;
|
|
128
|
+
};
|
|
129
|
+
/** @returns {TaxonomyResponseSchema} */
|
|
130
|
+
declare function TaxonomyResponseSchema(): TaxonomyResponseSchema;
|
|
131
|
+
type TaxonomyResponseSchema = {
|
|
132
|
+
/**
|
|
133
|
+
* - List of taxonomy items for
|
|
134
|
+
* the requested level level. Each item represents a taxonomy node with
|
|
135
|
+
* details about its category, attributes, and associated template.
|
|
136
|
+
*/
|
|
137
|
+
items?: TaxonomyItemResponseSchema[];
|
|
138
|
+
};
|
|
139
|
+
/** @returns {ValidationErrors} */
|
|
140
|
+
declare function ValidationErrors(): ValidationErrors;
|
|
141
|
+
type ValidationErrors = {
|
|
142
|
+
errors: ValidationError[];
|
|
143
|
+
};
|
|
144
|
+
/** @returns {ValidationError} */
|
|
145
|
+
declare function ValidationError(): ValidationError;
|
|
146
|
+
type ValidationError = {
|
|
147
|
+
/**
|
|
148
|
+
* - A brief description of the error encountered.
|
|
149
|
+
*/
|
|
150
|
+
message: string;
|
|
151
|
+
/**
|
|
152
|
+
* - The field in the request that caused the error.
|
|
153
|
+
*/
|
|
154
|
+
field: string;
|
|
155
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
const Joi = require("joi");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef TaxonomyItemAttributeSchemaObject
|
|
5
|
+
* @property {string} [type] - The data type of the attribute".
|
|
6
|
+
* @property {boolean} [mandatory] - Specifies if the attribute is mandatory.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef TaxonomyItemAttributesResponseSchema
|
|
11
|
+
* @property {string} [id] - Unique identifier for the attribute.
|
|
12
|
+
* @property {string} [name] - The name of the attribute, such as "Color" or "Size".
|
|
13
|
+
* @property {string} [slug] - A URL-friendly identifier for the attribute,
|
|
14
|
+
* which is used for filtering or querying.
|
|
15
|
+
* @property {TaxonomyItemAttributeSchemaObject} [schema]
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @typedef TaxonomyItemResponseSchema
|
|
20
|
+
* @property {number} uid - Unique identifier for the taxonomy item.
|
|
21
|
+
* @property {string} name - The name of the taxonomy item. For example, it
|
|
22
|
+
* could be the name of a department or category.
|
|
23
|
+
* @property {string} slug - A URL-friendly identifier for the taxonomy item.
|
|
24
|
+
* The slug differs based on the level: - At level 0, it refers to the
|
|
25
|
+
* department. - At level 1, it refers to the L1 category. - At level 2, it
|
|
26
|
+
* refers to the L2 category. - At level 3, it refers to the L3 category.
|
|
27
|
+
* @property {number} level - The level level of the taxonomy item in the
|
|
28
|
+
* hierarchy: - 0: Department - 1: L1 category - 2: L2 category - 3: L3 category
|
|
29
|
+
* @property {TaxonomyItemAttributesResponseSchema[]} [attributes] - A list of
|
|
30
|
+
* attributes associated with the taxonomy item, such as color or size. These
|
|
31
|
+
* attributes may differ depending on the level of the taxonomy.
|
|
32
|
+
* @property {string} [product_template_slug] - A slug identifier for the
|
|
33
|
+
* template associated with this taxonomy item. It links the taxonomy to a
|
|
34
|
+
* specific product template.
|
|
35
|
+
* @property {string} [product_template_name] - A Name for the template
|
|
36
|
+
* associated with this taxonomy item. It links the taxonomy to a specific
|
|
37
|
+
* product template.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @typedef TaxonomyResponseSchema
|
|
42
|
+
* @property {TaxonomyItemResponseSchema[]} [items] - List of taxonomy items for
|
|
43
|
+
* the requested level level. Each item represents a taxonomy node with
|
|
44
|
+
* details about its category, attributes, and associated template.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @typedef ValidationErrors
|
|
49
|
+
* @property {ValidationError[]} errors
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @typedef ValidationError
|
|
54
|
+
* @property {string} message - A brief description of the error encountered.
|
|
55
|
+
* @property {string} field - The field in the request that caused the error.
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
class CatalogPublicModel {
|
|
59
|
+
/** @returns {TaxonomyItemAttributeSchemaObject} */
|
|
60
|
+
static TaxonomyItemAttributeSchemaObject() {
|
|
61
|
+
return Joi.object({
|
|
62
|
+
type: Joi.string().allow(""),
|
|
63
|
+
mandatory: Joi.boolean(),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** @returns {TaxonomyItemAttributesResponseSchema} */
|
|
68
|
+
static TaxonomyItemAttributesResponseSchema() {
|
|
69
|
+
return Joi.object({
|
|
70
|
+
id: Joi.string().allow(""),
|
|
71
|
+
name: Joi.string().allow(""),
|
|
72
|
+
slug: Joi.string().allow(""),
|
|
73
|
+
schema: CatalogPublicModel.TaxonomyItemAttributeSchemaObject(),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** @returns {TaxonomyItemResponseSchema} */
|
|
78
|
+
static TaxonomyItemResponseSchema() {
|
|
79
|
+
return Joi.object({
|
|
80
|
+
uid: Joi.number().required(),
|
|
81
|
+
name: Joi.string().allow("").required(),
|
|
82
|
+
slug: Joi.string().allow("").required(),
|
|
83
|
+
level: Joi.number().required(),
|
|
84
|
+
attributes: Joi.array().items(
|
|
85
|
+
CatalogPublicModel.TaxonomyItemAttributesResponseSchema()
|
|
86
|
+
),
|
|
87
|
+
product_template_slug: Joi.string().allow(""),
|
|
88
|
+
product_template_name: Joi.string().allow(""),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** @returns {TaxonomyResponseSchema} */
|
|
93
|
+
static TaxonomyResponseSchema() {
|
|
94
|
+
return Joi.object({
|
|
95
|
+
items: Joi.array().items(CatalogPublicModel.TaxonomyItemResponseSchema()),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** @returns {ValidationErrors} */
|
|
100
|
+
static ValidationErrors() {
|
|
101
|
+
return Joi.object({
|
|
102
|
+
errors: Joi.array()
|
|
103
|
+
.items(CatalogPublicModel.ValidationError())
|
|
104
|
+
.required(),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** @returns {ValidationError} */
|
|
109
|
+
static ValidationError() {
|
|
110
|
+
return Joi.object({
|
|
111
|
+
message: Joi.string().allow("").required(),
|
|
112
|
+
field: Joi.string().allow("").required(),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
module.exports = CatalogPublicModel;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export = CatalogPublicValidator;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef GetTaxonomyByLevelParam
|
|
4
|
+
* @property {number} level - The level of taxonomy hierarchy to fetch: 0: Fetch
|
|
5
|
+
* departments. 1: Fetch L1 categories. 2: Fetch L2 categories. 3: Fetch L3 categories.
|
|
6
|
+
* @property {string} [l0Slug] - Level 0 (Department) slug of the taxonomy to
|
|
7
|
+
* filter results.
|
|
8
|
+
* @property {string} [l1Slug] - Level 1 (L1 Category) slug of the taxonomy to
|
|
9
|
+
* filter results.
|
|
10
|
+
* @property {string} [l2Slug] - Level 2 (L2 Category) slug of the taxonomy to
|
|
11
|
+
* filter results.
|
|
12
|
+
* @property {string} [l3Slug] - Level 3 (L3 Category) slug of the taxonomy to
|
|
13
|
+
* filter results.
|
|
14
|
+
* @property {number} [limit] - Applied limit on the number of items to be
|
|
15
|
+
* returned. Default is 5000.
|
|
16
|
+
*/
|
|
17
|
+
declare class CatalogPublicValidator {
|
|
18
|
+
/** @returns {GetTaxonomyByLevelParam} */
|
|
19
|
+
static getTaxonomyByLevel(): GetTaxonomyByLevelParam;
|
|
20
|
+
}
|
|
21
|
+
declare namespace CatalogPublicValidator {
|
|
22
|
+
export { GetTaxonomyByLevelParam };
|
|
23
|
+
}
|
|
24
|
+
type GetTaxonomyByLevelParam = {
|
|
25
|
+
/**
|
|
26
|
+
* - The level of taxonomy hierarchy to fetch: 0: Fetch
|
|
27
|
+
* departments. 1: Fetch L1 categories. 2: Fetch L2 categories. 3: Fetch L3 categories.
|
|
28
|
+
*/
|
|
29
|
+
level: number;
|
|
30
|
+
/**
|
|
31
|
+
* - Level 0 (Department) slug of the taxonomy to
|
|
32
|
+
* filter results.
|
|
33
|
+
*/
|
|
34
|
+
l0Slug?: string;
|
|
35
|
+
/**
|
|
36
|
+
* - Level 1 (L1 Category) slug of the taxonomy to
|
|
37
|
+
* filter results.
|
|
38
|
+
*/
|
|
39
|
+
l1Slug?: string;
|
|
40
|
+
/**
|
|
41
|
+
* - Level 2 (L2 Category) slug of the taxonomy to
|
|
42
|
+
* filter results.
|
|
43
|
+
*/
|
|
44
|
+
l2Slug?: string;
|
|
45
|
+
/**
|
|
46
|
+
* - Level 3 (L3 Category) slug of the taxonomy to
|
|
47
|
+
* filter results.
|
|
48
|
+
*/
|
|
49
|
+
l3Slug?: string;
|
|
50
|
+
/**
|
|
51
|
+
* - Applied limit on the number of items to be
|
|
52
|
+
* returned. Default is 5000.
|
|
53
|
+
*/
|
|
54
|
+
limit?: number;
|
|
55
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const Joi = require("joi");
|
|
2
|
+
|
|
3
|
+
const CatalogPublicModel = require("./CatalogPublicModel");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef GetTaxonomyByLevelParam
|
|
7
|
+
* @property {number} level - The level of taxonomy hierarchy to fetch: 0: Fetch
|
|
8
|
+
* departments. 1: Fetch L1 categories. 2: Fetch L2 categories. 3: Fetch L3 categories.
|
|
9
|
+
* @property {string} [l0Slug] - Level 0 (Department) slug of the taxonomy to
|
|
10
|
+
* filter results.
|
|
11
|
+
* @property {string} [l1Slug] - Level 1 (L1 Category) slug of the taxonomy to
|
|
12
|
+
* filter results.
|
|
13
|
+
* @property {string} [l2Slug] - Level 2 (L2 Category) slug of the taxonomy to
|
|
14
|
+
* filter results.
|
|
15
|
+
* @property {string} [l3Slug] - Level 3 (L3 Category) slug of the taxonomy to
|
|
16
|
+
* filter results.
|
|
17
|
+
* @property {number} [limit] - Applied limit on the number of items to be
|
|
18
|
+
* returned. Default is 5000.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
class CatalogPublicValidator {
|
|
22
|
+
/** @returns {GetTaxonomyByLevelParam} */
|
|
23
|
+
static getTaxonomyByLevel() {
|
|
24
|
+
return Joi.object({
|
|
25
|
+
level: Joi.number().required(),
|
|
26
|
+
l0Slug: Joi.string().allow(""),
|
|
27
|
+
l1Slug: Joi.string().allow(""),
|
|
28
|
+
l2Slug: Joi.string().allow(""),
|
|
29
|
+
l3Slug: Joi.string().allow(""),
|
|
30
|
+
limit: Joi.number(),
|
|
31
|
+
}).required();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
module.exports = CatalogPublicValidator;
|
|
@@ -49,6 +49,14 @@ class Configuration {
|
|
|
49
49
|
{ locationType, id, requestHeaders } = { requestHeaders: {} },
|
|
50
50
|
{ responseHeaders } = { responseHeaders: false }
|
|
51
51
|
) {
|
|
52
|
+
let invalidInput = [];
|
|
53
|
+
if (invalidInput.length) {
|
|
54
|
+
const error = new Error();
|
|
55
|
+
error.message = "Missing required field";
|
|
56
|
+
error.details = invalidInput;
|
|
57
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
58
|
+
}
|
|
59
|
+
|
|
52
60
|
const { error } = ConfigurationPublicValidator.getLocations().validate(
|
|
53
61
|
{ locationType, id },
|
|
54
62
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -130,6 +138,14 @@ class Configuration {
|
|
|
130
138
|
{ authorization, query, requestHeaders } = { requestHeaders: {} },
|
|
131
139
|
{ responseHeaders } = { responseHeaders: false }
|
|
132
140
|
) {
|
|
141
|
+
let invalidInput = [];
|
|
142
|
+
if (invalidInput.length) {
|
|
143
|
+
const error = new Error();
|
|
144
|
+
error.message = "Missing required field";
|
|
145
|
+
error.details = invalidInput;
|
|
146
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
147
|
+
}
|
|
148
|
+
|
|
133
149
|
const { error } = ConfigurationPublicValidator.searchApplication().validate(
|
|
134
150
|
{ authorization, query },
|
|
135
151
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -58,6 +58,14 @@ class Content {
|
|
|
58
58
|
{ requestHeaders } = { requestHeaders: {} },
|
|
59
59
|
{ responseHeaders } = { responseHeaders: false }
|
|
60
60
|
) {
|
|
61
|
+
let invalidInput = [];
|
|
62
|
+
if (invalidInput.length) {
|
|
63
|
+
const error = new Error();
|
|
64
|
+
error.message = "Missing required field";
|
|
65
|
+
error.details = invalidInput;
|
|
66
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
67
|
+
}
|
|
68
|
+
|
|
61
69
|
const { error } = ContentPublicValidator.getAllTags().validate(
|
|
62
70
|
{},
|
|
63
71
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -134,6 +142,14 @@ class Content {
|
|
|
134
142
|
{ requestHeaders } = { requestHeaders: {} },
|
|
135
143
|
{ responseHeaders } = { responseHeaders: false }
|
|
136
144
|
) {
|
|
145
|
+
let invalidInput = [];
|
|
146
|
+
if (invalidInput.length) {
|
|
147
|
+
const error = new Error();
|
|
148
|
+
error.message = "Missing required field";
|
|
149
|
+
error.details = invalidInput;
|
|
150
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
151
|
+
}
|
|
152
|
+
|
|
137
153
|
const { error } = ContentPublicValidator.getAnalyticsTags().validate(
|
|
138
154
|
{},
|
|
139
155
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -212,6 +228,14 @@ class Content {
|
|
|
212
228
|
{ requestHeaders } = { requestHeaders: {} },
|
|
213
229
|
{ responseHeaders } = { responseHeaders: false }
|
|
214
230
|
) {
|
|
231
|
+
let invalidInput = [];
|
|
232
|
+
if (invalidInput.length) {
|
|
233
|
+
const error = new Error();
|
|
234
|
+
error.message = "Missing required field";
|
|
235
|
+
error.details = invalidInput;
|
|
236
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
237
|
+
}
|
|
238
|
+
|
|
215
239
|
const { error } = ContentPublicValidator.getBasicDetails().validate(
|
|
216
240
|
{},
|
|
217
241
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -290,6 +314,21 @@ class Content {
|
|
|
290
314
|
{ entityType, requestHeaders } = { requestHeaders: {} },
|
|
291
315
|
{ responseHeaders } = { responseHeaders: false }
|
|
292
316
|
) {
|
|
317
|
+
let invalidInput = [];
|
|
318
|
+
|
|
319
|
+
if (!entityType) {
|
|
320
|
+
invalidInput.push({
|
|
321
|
+
message: `The 'entityType' field is required.`,
|
|
322
|
+
path: ["entityType"],
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
if (invalidInput.length) {
|
|
326
|
+
const error = new Error();
|
|
327
|
+
error.message = "Missing required field";
|
|
328
|
+
error.details = invalidInput;
|
|
329
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
330
|
+
}
|
|
331
|
+
|
|
293
332
|
const { error } = ContentPublicValidator.getCredentialsByEntity().validate(
|
|
294
333
|
{ entityType },
|
|
295
334
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -368,6 +407,21 @@ class Content {
|
|
|
368
407
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
369
408
|
{ responseHeaders } = { responseHeaders: false }
|
|
370
409
|
) {
|
|
410
|
+
let invalidInput = [];
|
|
411
|
+
|
|
412
|
+
if (!slug) {
|
|
413
|
+
invalidInput.push({
|
|
414
|
+
message: `The 'slug' field is required.`,
|
|
415
|
+
path: ["slug"],
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
if (invalidInput.length) {
|
|
419
|
+
const error = new Error();
|
|
420
|
+
error.message = "Missing required field";
|
|
421
|
+
error.details = invalidInput;
|
|
422
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
423
|
+
}
|
|
424
|
+
|
|
371
425
|
const { error } = ContentPublicValidator.getCustomPage().validate(
|
|
372
426
|
{ slug },
|
|
373
427
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -444,6 +498,14 @@ class Content {
|
|
|
444
498
|
{ requestHeaders } = { requestHeaders: {} },
|
|
445
499
|
{ responseHeaders } = { responseHeaders: false }
|
|
446
500
|
) {
|
|
501
|
+
let invalidInput = [];
|
|
502
|
+
if (invalidInput.length) {
|
|
503
|
+
const error = new Error();
|
|
504
|
+
error.message = "Missing required field";
|
|
505
|
+
error.details = invalidInput;
|
|
506
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
507
|
+
}
|
|
508
|
+
|
|
447
509
|
const { error } = ContentPublicValidator.getFooterContent().validate(
|
|
448
510
|
{},
|
|
449
511
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -522,6 +584,21 @@ class Content {
|
|
|
522
584
|
{ pageType, requestHeaders } = { requestHeaders: {} },
|
|
523
585
|
{ responseHeaders } = { responseHeaders: false }
|
|
524
586
|
) {
|
|
587
|
+
let invalidInput = [];
|
|
588
|
+
|
|
589
|
+
if (!pageType) {
|
|
590
|
+
invalidInput.push({
|
|
591
|
+
message: `The 'pageType' field is required.`,
|
|
592
|
+
path: ["pageType"],
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
if (invalidInput.length) {
|
|
596
|
+
const error = new Error();
|
|
597
|
+
error.message = "Missing required field";
|
|
598
|
+
error.details = invalidInput;
|
|
599
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
600
|
+
}
|
|
601
|
+
|
|
525
602
|
const { error } = ContentPublicValidator.getHomePageContent().validate(
|
|
526
603
|
{ pageType },
|
|
527
604
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -601,6 +678,14 @@ class Content {
|
|
|
601
678
|
{ requestHeaders } = { requestHeaders: {} },
|
|
602
679
|
{ responseHeaders } = { responseHeaders: false }
|
|
603
680
|
) {
|
|
681
|
+
let invalidInput = [];
|
|
682
|
+
if (invalidInput.length) {
|
|
683
|
+
const error = new Error();
|
|
684
|
+
error.message = "Missing required field";
|
|
685
|
+
error.details = invalidInput;
|
|
686
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
687
|
+
}
|
|
688
|
+
|
|
604
689
|
const { error } = ContentPublicValidator.getMenuContent().validate(
|
|
605
690
|
{},
|
|
606
691
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -679,6 +764,21 @@ class Content {
|
|
|
679
764
|
{ type, requestHeaders } = { requestHeaders: {} },
|
|
680
765
|
{ responseHeaders } = { responseHeaders: false }
|
|
681
766
|
) {
|
|
767
|
+
let invalidInput = [];
|
|
768
|
+
|
|
769
|
+
if (!type) {
|
|
770
|
+
invalidInput.push({
|
|
771
|
+
message: `The 'type' field is required.`,
|
|
772
|
+
path: ["type"],
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
if (invalidInput.length) {
|
|
776
|
+
const error = new Error();
|
|
777
|
+
error.message = "Missing required field";
|
|
778
|
+
error.details = invalidInput;
|
|
779
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
780
|
+
}
|
|
781
|
+
|
|
682
782
|
const { error } = ContentPublicValidator.getMenuContentByType().validate(
|
|
683
783
|
{ type },
|
|
684
784
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -757,6 +857,14 @@ class Content {
|
|
|
757
857
|
{ requestHeaders } = { requestHeaders: {} },
|
|
758
858
|
{ responseHeaders } = { responseHeaders: false }
|
|
759
859
|
) {
|
|
860
|
+
let invalidInput = [];
|
|
861
|
+
if (invalidInput.length) {
|
|
862
|
+
const error = new Error();
|
|
863
|
+
error.message = "Missing required field";
|
|
864
|
+
error.details = invalidInput;
|
|
865
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
866
|
+
}
|
|
867
|
+
|
|
760
868
|
const { error } = ContentPublicValidator.getNavbar().validate(
|
|
761
869
|
{},
|
|
762
870
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -833,6 +941,14 @@ class Content {
|
|
|
833
941
|
{ requestHeaders } = { requestHeaders: {} },
|
|
834
942
|
{ responseHeaders } = { responseHeaders: false }
|
|
835
943
|
) {
|
|
944
|
+
let invalidInput = [];
|
|
945
|
+
if (invalidInput.length) {
|
|
946
|
+
const error = new Error();
|
|
947
|
+
error.message = "Missing required field";
|
|
948
|
+
error.details = invalidInput;
|
|
949
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
950
|
+
}
|
|
951
|
+
|
|
836
952
|
const { error } = ContentPublicValidator.getPricingBanner().validate(
|
|
837
953
|
{},
|
|
838
954
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -48,6 +48,21 @@ class Partner {
|
|
|
48
48
|
{ slug, requestHeaders } = { requestHeaders: {} },
|
|
49
49
|
{ responseHeaders } = { responseHeaders: false }
|
|
50
50
|
) {
|
|
51
|
+
let invalidInput = [];
|
|
52
|
+
|
|
53
|
+
if (!slug) {
|
|
54
|
+
invalidInput.push({
|
|
55
|
+
message: `The 'slug' field is required.`,
|
|
56
|
+
path: ["slug"],
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (invalidInput.length) {
|
|
60
|
+
const error = new Error();
|
|
61
|
+
error.message = "Missing required field";
|
|
62
|
+
error.details = invalidInput;
|
|
63
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
64
|
+
}
|
|
65
|
+
|
|
51
66
|
const {
|
|
52
67
|
error,
|
|
53
68
|
} = PartnerPublicValidator.getPanelExtensionDetails().validate(
|
|
@@ -12,6 +12,7 @@ declare class PublicClient {
|
|
|
12
12
|
*/
|
|
13
13
|
constructor(config: import("./PublicConfig"));
|
|
14
14
|
config: import("./PublicConfig");
|
|
15
|
+
catalog: Catalog;
|
|
15
16
|
configuration: Configuration;
|
|
16
17
|
content: Content;
|
|
17
18
|
partner: Partner;
|
|
@@ -24,6 +25,7 @@ declare class PublicClient {
|
|
|
24
25
|
*/
|
|
25
26
|
setExtraHeaders(header: object): void;
|
|
26
27
|
}
|
|
28
|
+
import Catalog = require("./Catalog/CatalogPublicClient");
|
|
27
29
|
import Configuration = require("./Configuration/ConfigurationPublicClient");
|
|
28
30
|
import Content = require("./Content/ContentPublicClient");
|
|
29
31
|
import Partner = require("./Partner/PartnerPublicClient");
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const Catalog = require("./Catalog/CatalogPublicClient");
|
|
2
|
+
|
|
1
3
|
const Configuration = require("./Configuration/ConfigurationPublicClient");
|
|
2
4
|
|
|
3
5
|
const Content = require("./Content/ContentPublicClient");
|
|
@@ -22,6 +24,8 @@ class PublicClient {
|
|
|
22
24
|
constructor(config) {
|
|
23
25
|
this.config = config;
|
|
24
26
|
|
|
27
|
+
this.catalog = new Catalog(config);
|
|
28
|
+
|
|
25
29
|
this.configuration = new Configuration(config);
|
|
26
30
|
|
|
27
31
|
this.content = new Content(config);
|