@gofynd/fdk-client-javascript 1.4.2-beta.2 → 1.4.2-beta.3
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/CartApplicationModel.d.ts +1742 -1726
- package/sdk/application/Cart/CartApplicationModel.js +1497 -1481
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1917 -1917
- package/sdk/application/Catalog/CatalogApplicationModel.js +1611 -1611
- package/sdk/application/Common/CommonApplicationModel.d.ts +235 -235
- package/sdk/application/Common/CommonApplicationModel.js +172 -172
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +72 -72
- package/sdk/application/Communication/CommunicationApplicationModel.js +64 -64
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1614 -1614
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1151 -1151
- package/sdk/application/Content/ContentApplicationModel.d.ts +797 -797
- package/sdk/application/Content/ContentApplicationModel.js +757 -757
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +79 -79
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +84 -84
- package/sdk/application/Lead/LeadApplicationModel.d.ts +417 -417
- package/sdk/application/Lead/LeadApplicationModel.js +301 -301
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +666 -666
- package/sdk/application/Logistic/LogisticApplicationModel.js +601 -601
- package/sdk/application/Order/OrderApplicationModel.d.ts +846 -846
- package/sdk/application/Order/OrderApplicationModel.js +822 -822
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +5 -5
- package/sdk/application/Payment/PaymentApplicationClient.js +10 -10
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +2155 -2150
- package/sdk/application/Payment/PaymentApplicationModel.js +1460 -1458
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +5 -5
- package/sdk/application/Payment/PaymentApplicationValidator.js +3 -3
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1462 -1462
- package/sdk/application/PosCart/PosCartApplicationModel.js +1260 -1260
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +214 -214
- package/sdk/application/Rewards/RewardsApplicationModel.js +211 -211
- package/sdk/application/Share/ShareApplicationModel.d.ts +114 -114
- package/sdk/application/Share/ShareApplicationModel.js +121 -121
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +895 -895
- package/sdk/application/Theme/ThemeApplicationModel.js +684 -684
- package/sdk/application/User/UserApplicationModel.d.ts +762 -762
- package/sdk/application/User/UserApplicationModel.js +738 -738
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +63 -63
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +65 -65
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +661 -661
- package/sdk/partner/Lead/LeadPartnerModel.js +491 -491
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +223 -223
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +235 -235
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1087 -1087
- package/sdk/partner/Theme/ThemePartnerModel.js +819 -819
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +386 -386
- package/sdk/partner/Webhook/WebhookPartnerModel.js +342 -342
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +123 -123
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +109 -109
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +801 -801
- package/sdk/platform/Billing/BillingPlatformModel.js +783 -783
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3333 -3317
- package/sdk/platform/Cart/CartPlatformModel.js +2936 -2920
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1013 -1013
- package/sdk/platform/Catalog/CatalogPlatformModel.js +923 -923
- package/sdk/platform/Common/CommonPlatformModel.d.ts +255 -255
- package/sdk/platform/Common/CommonPlatformModel.js +187 -187
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1238 -1238
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1273 -1273
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +661 -661
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +692 -692
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +3198 -3198
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2247 -2247
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1833 -1833
- package/sdk/platform/Content/ContentPlatformModel.js +1837 -1837
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +245 -245
- package/sdk/platform/Discount/DiscountPlatformModel.js +248 -248
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +865 -865
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +877 -877
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +1044 -1044
- package/sdk/platform/Finance/FinancePlatformModel.js +974 -974
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +942 -942
- package/sdk/platform/Inventory/InventoryPlatformModel.js +1003 -1003
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +608 -608
- package/sdk/platform/Lead/LeadPlatformModel.js +465 -465
- package/sdk/platform/Order/OrderPlatformModel.d.ts +5180 -5176
- package/sdk/platform/Order/OrderPlatformModel.js +4740 -4736
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +22 -22
- package/sdk/platform/Partner/PartnerPlatformModel.js +22 -22
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2670 -2660
- package/sdk/platform/Payment/PaymentPlatformModel.js +1831 -1827
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +204 -204
- package/sdk/platform/Rewards/RewardsPlatformModel.js +199 -199
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1505 -1507
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1532 -1536
- package/sdk/platform/Share/SharePlatformModel.d.ts +147 -147
- package/sdk/platform/Share/SharePlatformModel.js +139 -139
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1046 -1046
- package/sdk/platform/Theme/ThemePlatformModel.js +789 -789
- package/sdk/platform/User/UserPlatformModel.d.ts +758 -758
- package/sdk/platform/User/UserPlatformModel.js +643 -643
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +439 -439
- package/sdk/platform/Webhook/WebhookPlatformModel.js +364 -364
- package/sdk/public/Billing/BillingPublicModel.d.ts +55 -55
- package/sdk/public/Billing/BillingPublicModel.js +51 -51
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +237 -237
- package/sdk/public/Configuration/ConfigurationPublicModel.js +174 -174
- package/sdk/public/Content/ContentPublicModel.d.ts +26 -26
- package/sdk/public/Content/ContentPublicModel.js +28 -28
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +237 -237
- package/sdk/public/Inventory/InventoryPublicModel.js +257 -257
- package/sdk/public/Partner/PartnerPublicModel.d.ts +104 -104
- package/sdk/public/Partner/PartnerPublicModel.js +113 -113
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +87 -87
- package/sdk/public/Webhook/WebhookPublicModel.js +93 -93
|
@@ -1,199 +1,199 @@
|
|
|
1
1
|
export = WebhookPublicModel;
|
|
2
2
|
/**
|
|
3
3
|
* @typedef EventConfig
|
|
4
|
-
* @property {
|
|
5
|
-
* @property {string} [description]
|
|
6
|
-
* @property {string} [display_name]
|
|
7
|
-
* @property {string} [event_category]
|
|
4
|
+
* @property {number} [id]
|
|
8
5
|
* @property {string} [event_name]
|
|
9
|
-
* @property {Object} [event_schema]
|
|
10
6
|
* @property {string} [event_type]
|
|
11
|
-
* @property {
|
|
12
|
-
* @property {
|
|
7
|
+
* @property {string} [event_category]
|
|
8
|
+
* @property {Object} [event_schema]
|
|
13
9
|
* @property {string} [version]
|
|
10
|
+
* @property {string} [display_name]
|
|
11
|
+
* @property {string} [description]
|
|
12
|
+
* @property {string} [created_on]
|
|
13
|
+
* @property {string} [updated_on]
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @typedef EventConfigResponse
|
|
17
|
+
* @property {EventConfig[]} [event_configs]
|
|
14
18
|
*/
|
|
15
19
|
/**
|
|
16
20
|
* @typedef EventConfigBase
|
|
17
|
-
* @property {string} [event_category]
|
|
18
21
|
* @property {string} [event_name]
|
|
19
22
|
* @property {string} [event_type]
|
|
23
|
+
* @property {string} [event_category]
|
|
20
24
|
* @property {string} [version]
|
|
21
25
|
*/
|
|
22
|
-
/**
|
|
23
|
-
* @typedef EventConfigResponse
|
|
24
|
-
* @property {EventConfig[]} [event_configs]
|
|
25
|
-
*/
|
|
26
26
|
/**
|
|
27
27
|
* @typedef EventNotifier
|
|
28
|
-
* @property {string[]} [emails]
|
|
29
28
|
* @property {string} [message]
|
|
29
|
+
* @property {string[]} [emails]
|
|
30
30
|
*/
|
|
31
31
|
/**
|
|
32
32
|
* @typedef EventSchema
|
|
33
|
-
* @property {Object} [meta]
|
|
34
33
|
* @property {Object} [payload]
|
|
34
|
+
* @property {Object} [meta]
|
|
35
35
|
*/
|
|
36
36
|
/**
|
|
37
37
|
* @typedef InternalTransformEvent
|
|
38
|
-
* @property {number} [created_timestamp]
|
|
39
|
-
* @property {string} [name]
|
|
40
38
|
* @property {string[]} [trace_id]
|
|
39
|
+
* @property {string} [name]
|
|
41
40
|
* @property {string} [type]
|
|
42
41
|
* @property {string} [version]
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @typedef TransformEventAssociation
|
|
46
|
-
* @property {number} [company_id]
|
|
42
|
+
* @property {number} [created_timestamp]
|
|
47
43
|
*/
|
|
48
44
|
/**
|
|
49
45
|
* @typedef TransformEventData
|
|
46
|
+
* @property {InternalTransformEvent} [event]
|
|
50
47
|
* @property {number} [company_id]
|
|
51
48
|
* @property {string[]} [contains]
|
|
52
|
-
* @property {InternalTransformEvent} [event]
|
|
53
49
|
* @property {Object} [payload]
|
|
54
50
|
*/
|
|
55
51
|
/**
|
|
56
|
-
* @typedef
|
|
57
|
-
* @property {
|
|
58
|
-
* @property {string} [event_category]
|
|
59
|
-
* @property {string} [event_name]
|
|
60
|
-
* @property {string} [event_type]
|
|
61
|
-
* @property {string} [event_version]
|
|
52
|
+
* @typedef TransformEventServiceMeta
|
|
53
|
+
* @property {string} [name]
|
|
62
54
|
*/
|
|
63
55
|
/**
|
|
64
|
-
* @typedef
|
|
65
|
-
* @property {
|
|
66
|
-
* @property {TransformEventData} [data]
|
|
67
|
-
* @property {string} [event_name]
|
|
68
|
-
* @property {string[]} [event_trace_id]
|
|
69
|
-
* @property {string} [event_type]
|
|
70
|
-
* @property {TransformEventServiceMeta} [service_meta]
|
|
71
|
-
* @property {boolean} [status]
|
|
72
|
-
* @property {string} [version]
|
|
56
|
+
* @typedef TransformEventAssociation
|
|
57
|
+
* @property {number} [company_id]
|
|
73
58
|
*/
|
|
74
59
|
/**
|
|
75
|
-
* @typedef
|
|
76
|
-
* @property {string} [
|
|
60
|
+
* @typedef TransformEventRequest
|
|
61
|
+
* @property {string} [event_name]
|
|
62
|
+
* @property {string} [event_type]
|
|
63
|
+
* @property {string} [event_category]
|
|
64
|
+
* @property {string} [event_version]
|
|
65
|
+
* @property {EventSchema} [event]
|
|
77
66
|
*/
|
|
78
67
|
/**
|
|
79
68
|
* @typedef ValidateSchemaRequest
|
|
80
|
-
* @property {EventSchema} [event]
|
|
81
|
-
* @property {string} [event_category]
|
|
82
69
|
* @property {string} [event_name]
|
|
83
|
-
* @property {Object} [event_schema]
|
|
84
70
|
* @property {string} [event_type]
|
|
71
|
+
* @property {string} [event_category]
|
|
85
72
|
* @property {string} [event_version]
|
|
73
|
+
* @property {EventSchema} [event]
|
|
74
|
+
* @property {Object} [event_schema]
|
|
86
75
|
*/
|
|
87
76
|
/**
|
|
88
77
|
* @typedef ValidateSchemaResponse
|
|
78
|
+
* @property {boolean} [status]
|
|
89
79
|
* @property {string} [message]
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* @typedef TransformEventResponse
|
|
83
|
+
* @property {string[]} [event_trace_id]
|
|
84
|
+
* @property {TransformEventData} [data]
|
|
85
|
+
* @property {string} [event_name]
|
|
86
|
+
* @property {string} [version]
|
|
90
87
|
* @property {boolean} [status]
|
|
88
|
+
* @property {string} [event_type]
|
|
89
|
+
* @property {TransformEventServiceMeta} [service_meta]
|
|
90
|
+
* @property {TransformEventAssociation} [association]
|
|
91
91
|
*/
|
|
92
92
|
declare class WebhookPublicModel {
|
|
93
93
|
}
|
|
94
94
|
declare namespace WebhookPublicModel {
|
|
95
|
-
export { EventConfig,
|
|
95
|
+
export { EventConfig, EventConfigResponse, EventConfigBase, EventNotifier, EventSchema, InternalTransformEvent, TransformEventData, TransformEventServiceMeta, TransformEventAssociation, TransformEventRequest, ValidateSchemaRequest, ValidateSchemaResponse, TransformEventResponse };
|
|
96
96
|
}
|
|
97
97
|
/** @returns {EventConfig} */
|
|
98
98
|
declare function EventConfig(): EventConfig;
|
|
99
99
|
type EventConfig = {
|
|
100
|
-
|
|
101
|
-
description?: string;
|
|
102
|
-
display_name?: string;
|
|
103
|
-
event_category?: string;
|
|
100
|
+
id?: number;
|
|
104
101
|
event_name?: string;
|
|
105
|
-
event_schema?: any;
|
|
106
102
|
event_type?: string;
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
event_category?: string;
|
|
104
|
+
event_schema?: any;
|
|
109
105
|
version?: string;
|
|
106
|
+
display_name?: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
created_on?: string;
|
|
109
|
+
updated_on?: string;
|
|
110
|
+
};
|
|
111
|
+
/** @returns {EventConfigResponse} */
|
|
112
|
+
declare function EventConfigResponse(): EventConfigResponse;
|
|
113
|
+
type EventConfigResponse = {
|
|
114
|
+
event_configs?: EventConfig[];
|
|
110
115
|
};
|
|
111
116
|
/** @returns {EventConfigBase} */
|
|
112
117
|
declare function EventConfigBase(): EventConfigBase;
|
|
113
118
|
type EventConfigBase = {
|
|
114
|
-
event_category?: string;
|
|
115
119
|
event_name?: string;
|
|
116
120
|
event_type?: string;
|
|
121
|
+
event_category?: string;
|
|
117
122
|
version?: string;
|
|
118
123
|
};
|
|
119
|
-
/** @returns {EventConfigResponse} */
|
|
120
|
-
declare function EventConfigResponse(): EventConfigResponse;
|
|
121
|
-
type EventConfigResponse = {
|
|
122
|
-
event_configs?: EventConfig[];
|
|
123
|
-
};
|
|
124
124
|
/** @returns {EventNotifier} */
|
|
125
125
|
declare function EventNotifier(): EventNotifier;
|
|
126
126
|
type EventNotifier = {
|
|
127
|
-
emails?: string[];
|
|
128
127
|
message?: string;
|
|
128
|
+
emails?: string[];
|
|
129
129
|
};
|
|
130
130
|
/** @returns {EventSchema} */
|
|
131
131
|
declare function EventSchema(): EventSchema;
|
|
132
132
|
type EventSchema = {
|
|
133
|
-
meta?: any;
|
|
134
133
|
payload?: any;
|
|
134
|
+
meta?: any;
|
|
135
135
|
};
|
|
136
136
|
/** @returns {InternalTransformEvent} */
|
|
137
137
|
declare function InternalTransformEvent(): InternalTransformEvent;
|
|
138
138
|
type InternalTransformEvent = {
|
|
139
|
-
created_timestamp?: number;
|
|
140
|
-
name?: string;
|
|
141
139
|
trace_id?: string[];
|
|
140
|
+
name?: string;
|
|
142
141
|
type?: string;
|
|
143
142
|
version?: string;
|
|
144
|
-
|
|
145
|
-
/** @returns {TransformEventAssociation} */
|
|
146
|
-
declare function TransformEventAssociation(): TransformEventAssociation;
|
|
147
|
-
type TransformEventAssociation = {
|
|
148
|
-
company_id?: number;
|
|
143
|
+
created_timestamp?: number;
|
|
149
144
|
};
|
|
150
145
|
/** @returns {TransformEventData} */
|
|
151
146
|
declare function TransformEventData(): TransformEventData;
|
|
152
147
|
type TransformEventData = {
|
|
148
|
+
event?: InternalTransformEvent;
|
|
153
149
|
company_id?: number;
|
|
154
150
|
contains?: string[];
|
|
155
|
-
event?: InternalTransformEvent;
|
|
156
151
|
payload?: any;
|
|
157
152
|
};
|
|
153
|
+
/** @returns {TransformEventServiceMeta} */
|
|
154
|
+
declare function TransformEventServiceMeta(): TransformEventServiceMeta;
|
|
155
|
+
type TransformEventServiceMeta = {
|
|
156
|
+
name?: string;
|
|
157
|
+
};
|
|
158
|
+
/** @returns {TransformEventAssociation} */
|
|
159
|
+
declare function TransformEventAssociation(): TransformEventAssociation;
|
|
160
|
+
type TransformEventAssociation = {
|
|
161
|
+
company_id?: number;
|
|
162
|
+
};
|
|
158
163
|
/** @returns {TransformEventRequest} */
|
|
159
164
|
declare function TransformEventRequest(): TransformEventRequest;
|
|
160
165
|
type TransformEventRequest = {
|
|
161
|
-
event?: EventSchema;
|
|
162
|
-
event_category?: string;
|
|
163
166
|
event_name?: string;
|
|
164
167
|
event_type?: string;
|
|
168
|
+
event_category?: string;
|
|
165
169
|
event_version?: string;
|
|
166
|
-
|
|
167
|
-
/** @returns {TransformEventResponse} */
|
|
168
|
-
declare function TransformEventResponse(): TransformEventResponse;
|
|
169
|
-
type TransformEventResponse = {
|
|
170
|
-
association?: TransformEventAssociation;
|
|
171
|
-
data?: TransformEventData;
|
|
172
|
-
event_name?: string;
|
|
173
|
-
event_trace_id?: string[];
|
|
174
|
-
event_type?: string;
|
|
175
|
-
service_meta?: TransformEventServiceMeta;
|
|
176
|
-
status?: boolean;
|
|
177
|
-
version?: string;
|
|
178
|
-
};
|
|
179
|
-
/** @returns {TransformEventServiceMeta} */
|
|
180
|
-
declare function TransformEventServiceMeta(): TransformEventServiceMeta;
|
|
181
|
-
type TransformEventServiceMeta = {
|
|
182
|
-
name?: string;
|
|
170
|
+
event?: EventSchema;
|
|
183
171
|
};
|
|
184
172
|
/** @returns {ValidateSchemaRequest} */
|
|
185
173
|
declare function ValidateSchemaRequest(): ValidateSchemaRequest;
|
|
186
174
|
type ValidateSchemaRequest = {
|
|
187
|
-
event?: EventSchema;
|
|
188
|
-
event_category?: string;
|
|
189
175
|
event_name?: string;
|
|
190
|
-
event_schema?: any;
|
|
191
176
|
event_type?: string;
|
|
177
|
+
event_category?: string;
|
|
192
178
|
event_version?: string;
|
|
179
|
+
event?: EventSchema;
|
|
180
|
+
event_schema?: any;
|
|
193
181
|
};
|
|
194
182
|
/** @returns {ValidateSchemaResponse} */
|
|
195
183
|
declare function ValidateSchemaResponse(): ValidateSchemaResponse;
|
|
196
184
|
type ValidateSchemaResponse = {
|
|
185
|
+
status?: boolean;
|
|
197
186
|
message?: string;
|
|
187
|
+
};
|
|
188
|
+
/** @returns {TransformEventResponse} */
|
|
189
|
+
declare function TransformEventResponse(): TransformEventResponse;
|
|
190
|
+
type TransformEventResponse = {
|
|
191
|
+
event_trace_id?: string[];
|
|
192
|
+
data?: TransformEventData;
|
|
193
|
+
event_name?: string;
|
|
194
|
+
version?: string;
|
|
198
195
|
status?: boolean;
|
|
196
|
+
event_type?: string;
|
|
197
|
+
service_meta?: TransformEventServiceMeta;
|
|
198
|
+
association?: TransformEventAssociation;
|
|
199
199
|
};
|
|
@@ -2,234 +2,234 @@ const Joi = require("joi");
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef EventConfig
|
|
5
|
-
* @property {
|
|
6
|
-
* @property {string} [description]
|
|
7
|
-
* @property {string} [display_name]
|
|
8
|
-
* @property {string} [event_category]
|
|
5
|
+
* @property {number} [id]
|
|
9
6
|
* @property {string} [event_name]
|
|
10
|
-
* @property {Object} [event_schema]
|
|
11
7
|
* @property {string} [event_type]
|
|
12
|
-
* @property {
|
|
13
|
-
* @property {
|
|
8
|
+
* @property {string} [event_category]
|
|
9
|
+
* @property {Object} [event_schema]
|
|
14
10
|
* @property {string} [version]
|
|
11
|
+
* @property {string} [display_name]
|
|
12
|
+
* @property {string} [description]
|
|
13
|
+
* @property {string} [created_on]
|
|
14
|
+
* @property {string} [updated_on]
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @typedef EventConfigResponse
|
|
19
|
+
* @property {EventConfig[]} [event_configs]
|
|
15
20
|
*/
|
|
16
21
|
|
|
17
22
|
/**
|
|
18
23
|
* @typedef EventConfigBase
|
|
19
|
-
* @property {string} [event_category]
|
|
20
24
|
* @property {string} [event_name]
|
|
21
25
|
* @property {string} [event_type]
|
|
26
|
+
* @property {string} [event_category]
|
|
22
27
|
* @property {string} [version]
|
|
23
28
|
*/
|
|
24
29
|
|
|
25
|
-
/**
|
|
26
|
-
* @typedef EventConfigResponse
|
|
27
|
-
* @property {EventConfig[]} [event_configs]
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
30
|
/**
|
|
31
31
|
* @typedef EventNotifier
|
|
32
|
-
* @property {string[]} [emails]
|
|
33
32
|
* @property {string} [message]
|
|
33
|
+
* @property {string[]} [emails]
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* @typedef EventSchema
|
|
38
|
-
* @property {Object} [meta]
|
|
39
38
|
* @property {Object} [payload]
|
|
39
|
+
* @property {Object} [meta]
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @typedef InternalTransformEvent
|
|
44
|
-
* @property {number} [created_timestamp]
|
|
45
|
-
* @property {string} [name]
|
|
46
44
|
* @property {string[]} [trace_id]
|
|
45
|
+
* @property {string} [name]
|
|
47
46
|
* @property {string} [type]
|
|
48
47
|
* @property {string} [version]
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* @typedef TransformEventAssociation
|
|
53
|
-
* @property {number} [company_id]
|
|
48
|
+
* @property {number} [created_timestamp]
|
|
54
49
|
*/
|
|
55
50
|
|
|
56
51
|
/**
|
|
57
52
|
* @typedef TransformEventData
|
|
53
|
+
* @property {InternalTransformEvent} [event]
|
|
58
54
|
* @property {number} [company_id]
|
|
59
55
|
* @property {string[]} [contains]
|
|
60
|
-
* @property {InternalTransformEvent} [event]
|
|
61
56
|
* @property {Object} [payload]
|
|
62
57
|
*/
|
|
63
58
|
|
|
64
59
|
/**
|
|
65
|
-
* @typedef
|
|
66
|
-
* @property {
|
|
67
|
-
* @property {string} [event_category]
|
|
68
|
-
* @property {string} [event_name]
|
|
69
|
-
* @property {string} [event_type]
|
|
70
|
-
* @property {string} [event_version]
|
|
60
|
+
* @typedef TransformEventServiceMeta
|
|
61
|
+
* @property {string} [name]
|
|
71
62
|
*/
|
|
72
63
|
|
|
73
64
|
/**
|
|
74
|
-
* @typedef
|
|
75
|
-
* @property {
|
|
76
|
-
* @property {TransformEventData} [data]
|
|
77
|
-
* @property {string} [event_name]
|
|
78
|
-
* @property {string[]} [event_trace_id]
|
|
79
|
-
* @property {string} [event_type]
|
|
80
|
-
* @property {TransformEventServiceMeta} [service_meta]
|
|
81
|
-
* @property {boolean} [status]
|
|
82
|
-
* @property {string} [version]
|
|
65
|
+
* @typedef TransformEventAssociation
|
|
66
|
+
* @property {number} [company_id]
|
|
83
67
|
*/
|
|
84
68
|
|
|
85
69
|
/**
|
|
86
|
-
* @typedef
|
|
87
|
-
* @property {string} [
|
|
70
|
+
* @typedef TransformEventRequest
|
|
71
|
+
* @property {string} [event_name]
|
|
72
|
+
* @property {string} [event_type]
|
|
73
|
+
* @property {string} [event_category]
|
|
74
|
+
* @property {string} [event_version]
|
|
75
|
+
* @property {EventSchema} [event]
|
|
88
76
|
*/
|
|
89
77
|
|
|
90
78
|
/**
|
|
91
79
|
* @typedef ValidateSchemaRequest
|
|
92
|
-
* @property {EventSchema} [event]
|
|
93
|
-
* @property {string} [event_category]
|
|
94
80
|
* @property {string} [event_name]
|
|
95
|
-
* @property {Object} [event_schema]
|
|
96
81
|
* @property {string} [event_type]
|
|
82
|
+
* @property {string} [event_category]
|
|
97
83
|
* @property {string} [event_version]
|
|
84
|
+
* @property {EventSchema} [event]
|
|
85
|
+
* @property {Object} [event_schema]
|
|
98
86
|
*/
|
|
99
87
|
|
|
100
88
|
/**
|
|
101
89
|
* @typedef ValidateSchemaResponse
|
|
90
|
+
* @property {boolean} [status]
|
|
102
91
|
* @property {string} [message]
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @typedef TransformEventResponse
|
|
96
|
+
* @property {string[]} [event_trace_id]
|
|
97
|
+
* @property {TransformEventData} [data]
|
|
98
|
+
* @property {string} [event_name]
|
|
99
|
+
* @property {string} [version]
|
|
103
100
|
* @property {boolean} [status]
|
|
101
|
+
* @property {string} [event_type]
|
|
102
|
+
* @property {TransformEventServiceMeta} [service_meta]
|
|
103
|
+
* @property {TransformEventAssociation} [association]
|
|
104
104
|
*/
|
|
105
105
|
|
|
106
106
|
class WebhookPublicModel {
|
|
107
107
|
/** @returns {EventConfig} */
|
|
108
108
|
static EventConfig() {
|
|
109
109
|
return Joi.object({
|
|
110
|
-
|
|
111
|
-
description: Joi.string().allow("").allow(null),
|
|
112
|
-
display_name: Joi.string().allow(""),
|
|
113
|
-
event_category: Joi.string().allow(""),
|
|
110
|
+
id: Joi.number(),
|
|
114
111
|
event_name: Joi.string().allow(""),
|
|
115
|
-
event_schema: Joi.object().pattern(/\S/, Joi.any()),
|
|
116
112
|
event_type: Joi.string().allow(""),
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
event_category: Joi.string().allow(""),
|
|
114
|
+
event_schema: Joi.object().pattern(/\S/, Joi.any()),
|
|
119
115
|
version: Joi.string().allow(""),
|
|
116
|
+
display_name: Joi.string().allow(""),
|
|
117
|
+
description: Joi.string().allow("").allow(null),
|
|
118
|
+
created_on: Joi.string().allow(""),
|
|
119
|
+
updated_on: Joi.string().allow(""),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** @returns {EventConfigResponse} */
|
|
124
|
+
static EventConfigResponse() {
|
|
125
|
+
return Joi.object({
|
|
126
|
+
event_configs: Joi.array().items(WebhookPublicModel.EventConfig()),
|
|
120
127
|
});
|
|
121
128
|
}
|
|
122
129
|
|
|
123
130
|
/** @returns {EventConfigBase} */
|
|
124
131
|
static EventConfigBase() {
|
|
125
132
|
return Joi.object({
|
|
126
|
-
event_category: Joi.string().allow(""),
|
|
127
133
|
event_name: Joi.string().allow(""),
|
|
128
134
|
event_type: Joi.string().allow(""),
|
|
135
|
+
event_category: Joi.string().allow(""),
|
|
129
136
|
version: Joi.string().allow(""),
|
|
130
137
|
});
|
|
131
138
|
}
|
|
132
139
|
|
|
133
|
-
/** @returns {EventConfigResponse} */
|
|
134
|
-
static EventConfigResponse() {
|
|
135
|
-
return Joi.object({
|
|
136
|
-
event_configs: Joi.array().items(WebhookPublicModel.EventConfig()),
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
140
|
/** @returns {EventNotifier} */
|
|
141
141
|
static EventNotifier() {
|
|
142
142
|
return Joi.object({
|
|
143
|
-
emails: Joi.array().items(Joi.string().allow("")),
|
|
144
143
|
message: Joi.string().allow(""),
|
|
144
|
+
emails: Joi.array().items(Joi.string().allow("")),
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
/** @returns {EventSchema} */
|
|
149
149
|
static EventSchema() {
|
|
150
150
|
return Joi.object({
|
|
151
|
-
meta: Joi.object().pattern(/\S/, Joi.any()),
|
|
152
151
|
payload: Joi.object().pattern(/\S/, Joi.any()),
|
|
152
|
+
meta: Joi.object().pattern(/\S/, Joi.any()),
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
/** @returns {InternalTransformEvent} */
|
|
157
157
|
static InternalTransformEvent() {
|
|
158
158
|
return Joi.object({
|
|
159
|
-
created_timestamp: Joi.number(),
|
|
160
|
-
name: Joi.string().allow(""),
|
|
161
159
|
trace_id: Joi.array().items(Joi.string().allow("")),
|
|
160
|
+
name: Joi.string().allow(""),
|
|
162
161
|
type: Joi.string().allow(""),
|
|
163
162
|
version: Joi.string().allow(""),
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/** @returns {TransformEventAssociation} */
|
|
168
|
-
static TransformEventAssociation() {
|
|
169
|
-
return Joi.object({
|
|
170
|
-
company_id: Joi.number(),
|
|
163
|
+
created_timestamp: Joi.number(),
|
|
171
164
|
});
|
|
172
165
|
}
|
|
173
166
|
|
|
174
167
|
/** @returns {TransformEventData} */
|
|
175
168
|
static TransformEventData() {
|
|
176
169
|
return Joi.object({
|
|
170
|
+
event: WebhookPublicModel.InternalTransformEvent(),
|
|
177
171
|
company_id: Joi.number(),
|
|
178
172
|
contains: Joi.array().items(Joi.string().allow("")),
|
|
179
|
-
event: WebhookPublicModel.InternalTransformEvent(),
|
|
180
173
|
payload: Joi.object().pattern(/\S/, Joi.any()),
|
|
181
174
|
});
|
|
182
175
|
}
|
|
183
176
|
|
|
184
|
-
/** @returns {
|
|
185
|
-
static
|
|
177
|
+
/** @returns {TransformEventServiceMeta} */
|
|
178
|
+
static TransformEventServiceMeta() {
|
|
186
179
|
return Joi.object({
|
|
187
|
-
|
|
188
|
-
event_category: Joi.string().allow(""),
|
|
189
|
-
event_name: Joi.string().allow(""),
|
|
190
|
-
event_type: Joi.string().allow(""),
|
|
191
|
-
event_version: Joi.string().allow(""),
|
|
180
|
+
name: Joi.string().allow(""),
|
|
192
181
|
});
|
|
193
182
|
}
|
|
194
183
|
|
|
195
|
-
/** @returns {
|
|
196
|
-
static
|
|
184
|
+
/** @returns {TransformEventAssociation} */
|
|
185
|
+
static TransformEventAssociation() {
|
|
197
186
|
return Joi.object({
|
|
198
|
-
|
|
199
|
-
data: WebhookPublicModel.TransformEventData(),
|
|
200
|
-
event_name: Joi.string().allow(""),
|
|
201
|
-
event_trace_id: Joi.array().items(Joi.string().allow("")),
|
|
202
|
-
event_type: Joi.string().allow(""),
|
|
203
|
-
service_meta: WebhookPublicModel.TransformEventServiceMeta(),
|
|
204
|
-
status: Joi.boolean(),
|
|
205
|
-
version: Joi.string().allow(""),
|
|
187
|
+
company_id: Joi.number(),
|
|
206
188
|
});
|
|
207
189
|
}
|
|
208
190
|
|
|
209
|
-
/** @returns {
|
|
210
|
-
static
|
|
191
|
+
/** @returns {TransformEventRequest} */
|
|
192
|
+
static TransformEventRequest() {
|
|
211
193
|
return Joi.object({
|
|
212
|
-
|
|
194
|
+
event_name: Joi.string().allow(""),
|
|
195
|
+
event_type: Joi.string().allow(""),
|
|
196
|
+
event_category: Joi.string().allow(""),
|
|
197
|
+
event_version: Joi.string().allow(""),
|
|
198
|
+
event: WebhookPublicModel.EventSchema(),
|
|
213
199
|
});
|
|
214
200
|
}
|
|
215
201
|
|
|
216
202
|
/** @returns {ValidateSchemaRequest} */
|
|
217
203
|
static ValidateSchemaRequest() {
|
|
218
204
|
return Joi.object({
|
|
219
|
-
event: WebhookPublicModel.EventSchema(),
|
|
220
|
-
event_category: Joi.string().allow(""),
|
|
221
205
|
event_name: Joi.string().allow(""),
|
|
222
|
-
event_schema: Joi.object().pattern(/\S/, Joi.any()),
|
|
223
206
|
event_type: Joi.string().allow(""),
|
|
207
|
+
event_category: Joi.string().allow(""),
|
|
224
208
|
event_version: Joi.string().allow(""),
|
|
209
|
+
event: WebhookPublicModel.EventSchema(),
|
|
210
|
+
event_schema: Joi.object().pattern(/\S/, Joi.any()),
|
|
225
211
|
});
|
|
226
212
|
}
|
|
227
213
|
|
|
228
214
|
/** @returns {ValidateSchemaResponse} */
|
|
229
215
|
static ValidateSchemaResponse() {
|
|
230
216
|
return Joi.object({
|
|
217
|
+
status: Joi.boolean(),
|
|
231
218
|
message: Joi.string().allow(""),
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** @returns {TransformEventResponse} */
|
|
223
|
+
static TransformEventResponse() {
|
|
224
|
+
return Joi.object({
|
|
225
|
+
event_trace_id: Joi.array().items(Joi.string().allow("")),
|
|
226
|
+
data: WebhookPublicModel.TransformEventData(),
|
|
227
|
+
event_name: Joi.string().allow(""),
|
|
228
|
+
version: Joi.string().allow(""),
|
|
232
229
|
status: Joi.boolean(),
|
|
230
|
+
event_type: Joi.string().allow(""),
|
|
231
|
+
service_meta: WebhookPublicModel.TransformEventServiceMeta(),
|
|
232
|
+
association: WebhookPublicModel.TransformEventAssociation(),
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
}
|