@tamasha/kafka-schema-validation 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +101 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/orderEvents.d.ts +46 -9
- package/dist/orderEvents.d.ts.map +1 -1
- package/dist/orderEvents.js +40 -11
- package/dist/orderEvents.js.map +1 -1
- package/dist/productEvents.d.ts +40 -0
- package/dist/productEvents.d.ts.map +1 -0
- package/dist/productEvents.js +51 -0
- package/dist/productEvents.js.map +1 -0
- package/dist/userEvents.d.ts +22 -9
- package/dist/userEvents.d.ts.map +1 -1
- package/dist/userEvents.js +23 -10
- package/dist/userEvents.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { TopicActionPayloadMap, TopicMessage, TopicMessageMap } from "./base";
|
|
2
|
-
import { userEventsSchema } from "./userEvents";
|
|
3
|
-
import { orderEventsSchema } from "./orderEvents";
|
|
4
2
|
import { walletEventsSchema } from "./walletEvents";
|
|
5
3
|
import { callEventsSchema } from "./callEvents";
|
|
6
4
|
import { audienceUpdateSchema } from "./audienceEvents";
|
|
@@ -12,45 +10,90 @@ export { WALLET_EVENT_TOPIC, walletEventsSchema } from "./walletEvents";
|
|
|
12
10
|
export { CALL_EVENT_TOPIC, callEventsSchema } from "./callEvents";
|
|
13
11
|
export { AUDIENCE_UPDATE_TOPIC, audienceUpdateSchema } from "./audienceEvents";
|
|
14
12
|
export { CUSTOMER_EVENTS_TOPIC, customerEventsSchema } from "./customerEvents";
|
|
13
|
+
export { PRODUCT_EVENTS_TOPIC, productEventsSchema } from "./productEvents";
|
|
15
14
|
export declare const DEFAULT_TOPIC_SCHEMAS: {
|
|
16
|
-
readonly
|
|
17
|
-
|
|
15
|
+
readonly users: import("./base").TopicSchema<{
|
|
16
|
+
created: import("./base").ActionSchema<{
|
|
18
17
|
payload: {
|
|
19
|
-
action: "
|
|
20
|
-
|
|
18
|
+
action: "created";
|
|
19
|
+
user_id: string;
|
|
21
20
|
timestamp: number;
|
|
22
21
|
service: string;
|
|
23
|
-
|
|
22
|
+
properties: {
|
|
23
|
+
email: string;
|
|
24
|
+
username: string;
|
|
25
|
+
};
|
|
24
26
|
};
|
|
25
27
|
}>;
|
|
26
|
-
|
|
28
|
+
updated: import("./base").ActionSchema<{
|
|
27
29
|
payload: {
|
|
28
|
-
action: "
|
|
29
|
-
|
|
30
|
+
action: "updated";
|
|
31
|
+
user_id: string;
|
|
32
|
+
timestamp: number;
|
|
33
|
+
service: string;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
deleted: import("./base").ActionSchema<{
|
|
37
|
+
payload: {
|
|
38
|
+
action: "deleted";
|
|
39
|
+
user_id: string;
|
|
30
40
|
timestamp: number;
|
|
31
41
|
service: string;
|
|
32
|
-
reason?: string;
|
|
33
42
|
};
|
|
34
43
|
}>;
|
|
35
44
|
}>;
|
|
36
|
-
readonly
|
|
45
|
+
readonly orders: import("./base").TopicSchema<{
|
|
37
46
|
created: import("./base").ActionSchema<{
|
|
38
47
|
payload: {
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
action: "created";
|
|
49
|
+
order_id: string;
|
|
50
|
+
user_id: string;
|
|
51
|
+
timestamp: number;
|
|
52
|
+
service: string;
|
|
53
|
+
properties: {
|
|
54
|
+
items: Array<{
|
|
55
|
+
product_id: string;
|
|
56
|
+
product_name: string;
|
|
57
|
+
quantity: number;
|
|
58
|
+
unit_price: number;
|
|
59
|
+
}>;
|
|
60
|
+
total_amount: number;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
}>;
|
|
64
|
+
confirmed: import("./base").ActionSchema<{
|
|
65
|
+
payload: {
|
|
66
|
+
action: "confirmed";
|
|
67
|
+
order_id: string;
|
|
41
68
|
timestamp: number;
|
|
42
69
|
service: string;
|
|
43
|
-
amount: number;
|
|
44
70
|
};
|
|
45
71
|
}>;
|
|
46
|
-
|
|
72
|
+
shipped: import("./base").ActionSchema<{
|
|
47
73
|
payload: {
|
|
48
|
-
|
|
49
|
-
|
|
74
|
+
action: "shipped";
|
|
75
|
+
order_id: string;
|
|
50
76
|
timestamp: number;
|
|
51
77
|
service: string;
|
|
52
|
-
|
|
53
|
-
|
|
78
|
+
properties?: {
|
|
79
|
+
tracking_number?: string;
|
|
80
|
+
carrier?: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
}>;
|
|
84
|
+
cancelled: import("./base").ActionSchema<{
|
|
85
|
+
payload: {
|
|
86
|
+
action: "cancelled";
|
|
87
|
+
order_id: string;
|
|
88
|
+
timestamp: number;
|
|
89
|
+
service: string;
|
|
90
|
+
properties: {
|
|
91
|
+
items: Array<{
|
|
92
|
+
product_id: string;
|
|
93
|
+
quantity: number;
|
|
94
|
+
}>;
|
|
95
|
+
reason?: string;
|
|
96
|
+
};
|
|
54
97
|
};
|
|
55
98
|
}>;
|
|
56
99
|
}>;
|
|
@@ -150,12 +193,46 @@ export declare const DEFAULT_TOPIC_SCHEMAS: {
|
|
|
150
193
|
};
|
|
151
194
|
}>;
|
|
152
195
|
}>;
|
|
196
|
+
readonly products: import("./base").TopicSchema<{
|
|
197
|
+
created: import("./base").ActionSchema<{
|
|
198
|
+
payload: {
|
|
199
|
+
action: "created";
|
|
200
|
+
product_id: string;
|
|
201
|
+
timestamp: number;
|
|
202
|
+
service: string;
|
|
203
|
+
properties: {
|
|
204
|
+
name: string;
|
|
205
|
+
sku: string;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
}>;
|
|
209
|
+
updated: import("./base").ActionSchema<{
|
|
210
|
+
payload: {
|
|
211
|
+
action: "updated";
|
|
212
|
+
product_id: string;
|
|
213
|
+
timestamp: number;
|
|
214
|
+
service: string;
|
|
215
|
+
};
|
|
216
|
+
}>;
|
|
217
|
+
stock_changed: import("./base").ActionSchema<{
|
|
218
|
+
payload: {
|
|
219
|
+
action: "stock_changed";
|
|
220
|
+
product_id: string;
|
|
221
|
+
timestamp: number;
|
|
222
|
+
service: string;
|
|
223
|
+
properties: {
|
|
224
|
+
previous_stock: number;
|
|
225
|
+
new_stock: number;
|
|
226
|
+
change: number;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
}>;
|
|
230
|
+
}>;
|
|
153
231
|
};
|
|
154
232
|
export type DefaultTopicSchemas = typeof DEFAULT_TOPIC_SCHEMAS;
|
|
155
|
-
export type
|
|
156
|
-
export type UserEventMessage
|
|
157
|
-
export type
|
|
158
|
-
export type OrderEventMessage = TopicMessage<typeof orderEventsSchema>;
|
|
233
|
+
export type { OrderEventPayloads, OrderEventMessage } from "./orderEvents";
|
|
234
|
+
export type { UserEventPayloads, UserEventMessage } from "./userEvents";
|
|
235
|
+
export type { ProductEventPayloads, ProductEventMessage } from "./productEvents";
|
|
159
236
|
export type WalletEventPayloads = TopicActionPayloadMap<typeof walletEventsSchema>;
|
|
160
237
|
export type WalletEventMessage = TopicMessage<typeof walletEventsSchema>;
|
|
161
238
|
export type CallEventPayloads = TopicActionPayloadMap<typeof callEventsSchema>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,qBAAqB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,qBAAqB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAGlG,OAAO,EAAsB,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAoB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAyB,oBAAoB,EAAE,MA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G/D,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE3E,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACxE,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACnF,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEzE,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAErE,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE7E,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvF,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAG7E,MAAM,MAAM,0BAA0B,CAAC,KAAK,SAAS,MAAM,mBAAmB,IAAI,qBAAqB,CACnG,mBAAmB,CAAC,KAAK,CAAC,CAC7B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;AAE1E,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,MAAM,sBAAsB,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_TOPIC_SCHEMAS = exports.customerEventsSchema = exports.CUSTOMER_EVENTS_TOPIC = exports.audienceUpdateSchema = exports.AUDIENCE_UPDATE_TOPIC = exports.callEventsSchema = exports.CALL_EVENT_TOPIC = exports.walletEventsSchema = exports.WALLET_EVENT_TOPIC = exports.orderEventsSchema = exports.ORDER_EVENTS_TOPIC = exports.userEventsSchema = exports.USER_EVENTS_TOPIC = exports.TopicSchemaRegistry = exports.defineTopicSchemas = exports.defineTopic = exports.defineAction = void 0;
|
|
3
|
+
exports.DEFAULT_TOPIC_SCHEMAS = exports.productEventsSchema = exports.PRODUCT_EVENTS_TOPIC = exports.customerEventsSchema = exports.CUSTOMER_EVENTS_TOPIC = exports.audienceUpdateSchema = exports.AUDIENCE_UPDATE_TOPIC = exports.callEventsSchema = exports.CALL_EVENT_TOPIC = exports.walletEventsSchema = exports.WALLET_EVENT_TOPIC = exports.orderEventsSchema = exports.ORDER_EVENTS_TOPIC = exports.userEventsSchema = exports.USER_EVENTS_TOPIC = exports.TopicSchemaRegistry = exports.defineTopicSchemas = exports.defineTopic = exports.defineAction = void 0;
|
|
4
4
|
const base_1 = require("./base");
|
|
5
5
|
const userEvents_1 = require("./userEvents");
|
|
6
6
|
const orderEvents_1 = require("./orderEvents");
|
|
@@ -8,6 +8,7 @@ const walletEvents_1 = require("./walletEvents");
|
|
|
8
8
|
const callEvents_1 = require("./callEvents");
|
|
9
9
|
const audienceEvents_1 = require("./audienceEvents");
|
|
10
10
|
const customerEvents_1 = require("./customerEvents");
|
|
11
|
+
const productEvents_1 = require("./productEvents");
|
|
11
12
|
// Re-export base types and classes
|
|
12
13
|
var base_2 = require("./base");
|
|
13
14
|
Object.defineProperty(exports, "defineAction", { enumerable: true, get: function () { return base_2.defineAction; } });
|
|
@@ -33,6 +34,9 @@ Object.defineProperty(exports, "audienceUpdateSchema", { enumerable: true, get:
|
|
|
33
34
|
var customerEvents_2 = require("./customerEvents");
|
|
34
35
|
Object.defineProperty(exports, "CUSTOMER_EVENTS_TOPIC", { enumerable: true, get: function () { return customerEvents_2.CUSTOMER_EVENTS_TOPIC; } });
|
|
35
36
|
Object.defineProperty(exports, "customerEventsSchema", { enumerable: true, get: function () { return customerEvents_2.customerEventsSchema; } });
|
|
37
|
+
var productEvents_2 = require("./productEvents");
|
|
38
|
+
Object.defineProperty(exports, "PRODUCT_EVENTS_TOPIC", { enumerable: true, get: function () { return productEvents_2.PRODUCT_EVENTS_TOPIC; } });
|
|
39
|
+
Object.defineProperty(exports, "productEventsSchema", { enumerable: true, get: function () { return productEvents_2.productEventsSchema; } });
|
|
36
40
|
// Default topic schemas registry
|
|
37
41
|
exports.DEFAULT_TOPIC_SCHEMAS = (0, base_1.defineTopicSchemas)({
|
|
38
42
|
[userEvents_1.USER_EVENTS_TOPIC]: userEvents_1.userEventsSchema,
|
|
@@ -41,5 +45,6 @@ exports.DEFAULT_TOPIC_SCHEMAS = (0, base_1.defineTopicSchemas)({
|
|
|
41
45
|
[callEvents_1.CALL_EVENT_TOPIC]: callEvents_1.callEventsSchema,
|
|
42
46
|
[audienceEvents_1.AUDIENCE_UPDATE_TOPIC]: audienceEvents_1.audienceUpdateSchema,
|
|
43
47
|
[customerEvents_1.CUSTOMER_EVENTS_TOPIC]: customerEvents_1.customerEventsSchema,
|
|
48
|
+
[productEvents_1.PRODUCT_EVENTS_TOPIC]: productEvents_1.productEventsSchema,
|
|
44
49
|
});
|
|
45
50
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAAkG;AAClG,6CAAmE;AACnE,+CAAsE;AACtE,iDAAwE;AACxE,6CAAkE;AAClE,qDAA+E;AAC/E,qDAA+E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAAkG;AAClG,6CAAmE;AACnE,+CAAsE;AACtE,iDAAwE;AACxE,6CAAkE;AAClE,qDAA+E;AAC/E,qDAA+E;AAC/E,mDAA4E;AAE5E,mCAAmC;AACnC,+BAcgB;AAbZ,oGAAA,YAAY,OAAA;AACZ,mGAAA,WAAW,OAAA;AACX,0GAAA,kBAAkB,OAAA;AAClB,2GAAA,mBAAmB,OAAA;AAYvB,wCAAwC;AACxC,2CAAmE;AAA1D,+GAAA,iBAAiB,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AAC5C,6CAAsE;AAA7D,iHAAA,kBAAkB,OAAA;AAAE,gHAAA,iBAAiB,OAAA;AAC9C,+CAAwE;AAA/D,kHAAA,kBAAkB,OAAA;AAAE,kHAAA,kBAAkB,OAAA;AAC/C,2CAAkE;AAAzD,8GAAA,gBAAgB,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AAC3C,mDAA+E;AAAtE,uHAAA,qBAAqB,OAAA;AAAE,sHAAA,oBAAoB,OAAA;AACpD,mDAA+E;AAAtE,uHAAA,qBAAqB,OAAA;AAAE,sHAAA,oBAAoB,OAAA;AACpD,iDAA4E;AAAnE,qHAAA,oBAAoB,OAAA;AAAE,oHAAA,mBAAmB,OAAA;AAElD,iCAAiC;AACpB,QAAA,qBAAqB,GAAG,IAAA,yBAAkB,EAAC;IACpD,CAAC,8BAAiB,CAAC,EAAE,6BAAgB;IACrC,CAAC,gCAAkB,CAAC,EAAE,+BAAiB;IACvC,CAAC,iCAAkB,CAAC,EAAE,iCAAkB;IACxC,CAAC,6BAAgB,CAAC,EAAE,6BAAgB;IACpC,CAAC,sCAAqB,CAAC,EAAE,qCAAoB;IAC7C,CAAC,sCAAqB,CAAC,EAAE,qCAAoB;IAC7C,CAAC,oCAAoB,CAAC,EAAE,mCAAmB;CACrC,CAAC,CAAC"}
|
package/dist/orderEvents.d.ts
CHANGED
|
@@ -1,23 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
import { TopicActionPayloadMap, TopicMessage } from "./base";
|
|
2
|
+
export declare const ORDER_EVENTS_TOPIC: "orders";
|
|
2
3
|
export declare const orderEventsSchema: import("./base").TopicSchema<{
|
|
3
4
|
created: import("./base").ActionSchema<{
|
|
4
5
|
payload: {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
action: "created";
|
|
7
|
+
order_id: string;
|
|
8
|
+
user_id: string;
|
|
7
9
|
timestamp: number;
|
|
8
10
|
service: string;
|
|
9
|
-
|
|
11
|
+
properties: {
|
|
12
|
+
items: Array<{
|
|
13
|
+
product_id: string;
|
|
14
|
+
product_name: string;
|
|
15
|
+
quantity: number;
|
|
16
|
+
unit_price: number;
|
|
17
|
+
}>;
|
|
18
|
+
total_amount: number;
|
|
19
|
+
};
|
|
10
20
|
};
|
|
11
21
|
}>;
|
|
12
|
-
|
|
22
|
+
confirmed: import("./base").ActionSchema<{
|
|
13
23
|
payload: {
|
|
14
|
-
|
|
15
|
-
|
|
24
|
+
action: "confirmed";
|
|
25
|
+
order_id: string;
|
|
16
26
|
timestamp: number;
|
|
17
27
|
service: string;
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
shipped: import("./base").ActionSchema<{
|
|
31
|
+
payload: {
|
|
32
|
+
action: "shipped";
|
|
33
|
+
order_id: string;
|
|
34
|
+
timestamp: number;
|
|
35
|
+
service: string;
|
|
36
|
+
properties?: {
|
|
37
|
+
tracking_number?: string;
|
|
38
|
+
carrier?: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
cancelled: import("./base").ActionSchema<{
|
|
43
|
+
payload: {
|
|
44
|
+
action: "cancelled";
|
|
45
|
+
order_id: string;
|
|
46
|
+
timestamp: number;
|
|
47
|
+
service: string;
|
|
48
|
+
properties: {
|
|
49
|
+
items: Array<{
|
|
50
|
+
product_id: string;
|
|
51
|
+
quantity: number;
|
|
52
|
+
}>;
|
|
53
|
+
reason?: string;
|
|
54
|
+
};
|
|
20
55
|
};
|
|
21
56
|
}>;
|
|
22
57
|
}>;
|
|
58
|
+
export type OrderEventPayloads = TopicActionPayloadMap<typeof orderEventsSchema>;
|
|
59
|
+
export type OrderEventMessage = TopicMessage<typeof orderEventsSchema>;
|
|
23
60
|
//# sourceMappingURL=orderEvents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderEvents.d.ts","sourceRoot":"","sources":["../src/orderEvents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"orderEvents.d.ts","sourceRoot":"","sources":["../src/orderEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,qBAAqB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACxF,eAAO,MAAM,kBAAkB,EAAG,QAAiB,CAAC;AACpD,eAAO,MAAM,iBAAiB;;iBAKT;YACL,MAAM,EAAE,SAAS,CAAC;YAClB,QAAQ,EAAE,MAAM,CAAC;YACjB,OAAO,EAAE,MAAM,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,UAAU,EAAE;gBACR,KAAK,EAAE,KAAK,CAAC;oBACT,UAAU,EAAE,MAAM,CAAC;oBACnB,YAAY,EAAE,MAAM,CAAC;oBACrB,QAAQ,EAAE,MAAM,CAAC;oBACjB,UAAU,EAAE,MAAM,CAAC;iBACtB,CAAC,CAAC;gBACH,YAAY,EAAE,MAAM,CAAC;aACxB,CAAC;SACL;;;iBAkBQ;YACL,MAAM,EAAE,WAAW,CAAC;YACpB,QAAQ,EAAE,MAAM,CAAC;YACjB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;SACnB;;;iBAUQ;YACL,MAAM,EAAE,SAAS,CAAC;YAClB,QAAQ,EAAE,MAAM,CAAC;YACjB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,UAAU,CAAC,EAAE;gBACT,eAAe,CAAC,EAAE,MAAM,CAAC;gBACzB,OAAO,CAAC,EAAE,MAAM,CAAC;aACpB,CAAC;SACL;;;iBAWQ;YACL,MAAM,EAAE,WAAW,CAAC;YACpB,QAAQ,EAAE,MAAM,CAAC;YACjB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,UAAU,EAAE;gBACR,KAAK,EAAE,KAAK,CAAC;oBACT,UAAU,EAAE,MAAM,CAAC;oBACnB,QAAQ,EAAE,MAAM,CAAC;iBACpB,CAAC,CAAC;gBACH,MAAM,CAAC,EAAE,MAAM,CAAC;aACnB,CAAC;SACL;;EAiBX,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjF,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
package/dist/orderEvents.js
CHANGED
|
@@ -2,28 +2,57 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.orderEventsSchema = exports.ORDER_EVENTS_TOPIC = void 0;
|
|
4
4
|
const base_1 = require("./base");
|
|
5
|
-
exports.ORDER_EVENTS_TOPIC = "
|
|
5
|
+
exports.ORDER_EVENTS_TOPIC = "orders";
|
|
6
6
|
exports.orderEventsSchema = (0, base_1.defineTopic)({
|
|
7
|
-
actionField: "payload.
|
|
8
|
-
partitionField: "payload.
|
|
7
|
+
actionField: "payload.action",
|
|
8
|
+
partitionField: "payload.order_id",
|
|
9
9
|
actions: {
|
|
10
10
|
created: (0, base_1.defineAction)({
|
|
11
11
|
fields: {
|
|
12
|
-
"payload.
|
|
13
|
-
"payload.
|
|
12
|
+
"payload.action": { type: "string", literal: "created" },
|
|
13
|
+
"payload.order_id": { type: "string" },
|
|
14
|
+
"payload.user_id": { type: "string" },
|
|
14
15
|
"payload.timestamp": { type: "number" },
|
|
15
16
|
"payload.service": { type: "string" },
|
|
16
|
-
"payload.
|
|
17
|
+
"payload.properties": {
|
|
18
|
+
type: "object",
|
|
19
|
+
fields: {
|
|
20
|
+
items: { type: "array" },
|
|
21
|
+
total_amount: { type: "number" },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
17
24
|
},
|
|
18
25
|
}),
|
|
19
|
-
|
|
26
|
+
confirmed: (0, base_1.defineAction)({
|
|
20
27
|
fields: {
|
|
21
|
-
"payload.
|
|
22
|
-
"payload.
|
|
28
|
+
"payload.action": { type: "string", literal: "confirmed" },
|
|
29
|
+
"payload.order_id": { type: "string" },
|
|
23
30
|
"payload.timestamp": { type: "number" },
|
|
24
31
|
"payload.service": { type: "string" },
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
shipped: (0, base_1.defineAction)({
|
|
35
|
+
fields: {
|
|
36
|
+
"payload.action": { type: "string", literal: "shipped" },
|
|
37
|
+
"payload.order_id": { type: "string" },
|
|
38
|
+
"payload.timestamp": { type: "number" },
|
|
39
|
+
"payload.service": { type: "string" },
|
|
40
|
+
"payload.properties": { type: "object", optional: true },
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
cancelled: (0, base_1.defineAction)({
|
|
44
|
+
fields: {
|
|
45
|
+
"payload.action": { type: "string", literal: "cancelled" },
|
|
46
|
+
"payload.order_id": { type: "string" },
|
|
47
|
+
"payload.timestamp": { type: "number" },
|
|
48
|
+
"payload.service": { type: "string" },
|
|
49
|
+
"payload.properties": {
|
|
50
|
+
type: "object",
|
|
51
|
+
fields: {
|
|
52
|
+
items: { type: "array" },
|
|
53
|
+
reason: { type: "string", optional: true },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
27
56
|
},
|
|
28
57
|
}),
|
|
29
58
|
},
|
package/dist/orderEvents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderEvents.js","sourceRoot":"","sources":["../src/orderEvents.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"orderEvents.js","sourceRoot":"","sources":["../src/orderEvents.ts"],"names":[],"mappings":";;;AAAA,iCAAwF;AAC3E,QAAA,kBAAkB,GAAG,Q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B,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACrC,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;aAC3D;SACJ,CAAC;QACF,SAAS,EAAE,IAAA,mBAAY,EAcpB;YACC,MAAM,EAAE;gBACJ,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE;gBAC1D,kBAAkB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACtC,mBAAmB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACvC,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACrC,oBAAoB,EAAE;oBAClB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE;wBACJ,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;wBACxB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;qBAC7C;iBACJ;aACJ;SACJ,CAAC;KACL;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { TopicActionPayloadMap, TopicMessage } from "./base";
|
|
2
|
+
export declare const PRODUCT_EVENTS_TOPIC: "products";
|
|
3
|
+
export declare const productEventsSchema: import("./base").TopicSchema<{
|
|
4
|
+
created: import("./base").ActionSchema<{
|
|
5
|
+
payload: {
|
|
6
|
+
action: "created";
|
|
7
|
+
product_id: string;
|
|
8
|
+
timestamp: number;
|
|
9
|
+
service: string;
|
|
10
|
+
properties: {
|
|
11
|
+
name: string;
|
|
12
|
+
sku: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
16
|
+
updated: import("./base").ActionSchema<{
|
|
17
|
+
payload: {
|
|
18
|
+
action: "updated";
|
|
19
|
+
product_id: string;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
service: string;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
stock_changed: import("./base").ActionSchema<{
|
|
25
|
+
payload: {
|
|
26
|
+
action: "stock_changed";
|
|
27
|
+
product_id: string;
|
|
28
|
+
timestamp: number;
|
|
29
|
+
service: string;
|
|
30
|
+
properties: {
|
|
31
|
+
previous_stock: number;
|
|
32
|
+
new_stock: number;
|
|
33
|
+
change: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
38
|
+
export type ProductEventPayloads = TopicActionPayloadMap<typeof productEventsSchema>;
|
|
39
|
+
export type ProductEventMessage = TopicMessage<typeof productEventsSchema>;
|
|
40
|
+
//# sourceMappingURL=productEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productEvents.d.ts","sourceRoot":"","sources":["../src/productEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,qBAAqB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACxF,eAAO,MAAM,oBAAoB,EAAG,UAAmB,CAAC;AACxD,eAAO,MAAM,mBAAmB;;iBAKX;YACL,MAAM,EAAE,SAAS,CAAC;YAClB,UAAU,EAAE,MAAM,CAAC;YACnB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,UAAU,EAAE;gBACR,IAAI,EAAE,MAAM,CAAC;gBACb,GAAG,EAAE,MAAM,CAAC;aACf,CAAC;SACL;;;iBAiBQ;YACL,MAAM,EAAE,SAAS,CAAC;YAClB,UAAU,EAAE,MAAM,CAAC;YACnB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;SACnB;;;iBAUQ;YACL,MAAM,EAAE,eAAe,CAAC;YACxB,UAAU,EAAE,MAAM,CAAC;YACnB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,UAAU,EAAE;gBACR,cAAc,EAAE,MAAM,CAAC;gBACvB,SAAS,EAAE,MAAM,CAAC;gBAClB,MAAM,EAAE,MAAM,CAAC;aAClB,CAAC;SACL;;EAkBX,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrF,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.productEventsSchema = exports.PRODUCT_EVENTS_TOPIC = void 0;
|
|
4
|
+
const base_1 = require("./base");
|
|
5
|
+
exports.PRODUCT_EVENTS_TOPIC = "products";
|
|
6
|
+
exports.productEventsSchema = (0, base_1.defineTopic)({
|
|
7
|
+
actionField: "payload.action",
|
|
8
|
+
partitionField: "payload.product_id",
|
|
9
|
+
actions: {
|
|
10
|
+
created: (0, base_1.defineAction)({
|
|
11
|
+
fields: {
|
|
12
|
+
"payload.action": { type: "string", literal: "created" },
|
|
13
|
+
"payload.product_id": { type: "string" },
|
|
14
|
+
"payload.timestamp": { type: "number" },
|
|
15
|
+
"payload.service": { type: "string" },
|
|
16
|
+
"payload.properties": {
|
|
17
|
+
type: "object",
|
|
18
|
+
fields: {
|
|
19
|
+
name: { type: "string" },
|
|
20
|
+
sku: { type: "string" },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
updated: (0, base_1.defineAction)({
|
|
26
|
+
fields: {
|
|
27
|
+
"payload.action": { type: "string", literal: "updated" },
|
|
28
|
+
"payload.product_id": { type: "string" },
|
|
29
|
+
"payload.timestamp": { type: "number" },
|
|
30
|
+
"payload.service": { type: "string" },
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
stock_changed: (0, base_1.defineAction)({
|
|
34
|
+
fields: {
|
|
35
|
+
"payload.action": { type: "string", literal: "stock_changed" },
|
|
36
|
+
"payload.product_id": { type: "string" },
|
|
37
|
+
"payload.timestamp": { type: "number" },
|
|
38
|
+
"payload.service": { type: "string" },
|
|
39
|
+
"payload.properties": {
|
|
40
|
+
type: "object",
|
|
41
|
+
fields: {
|
|
42
|
+
previous_stock: { type: "number" },
|
|
43
|
+
new_stock: { type: "number" },
|
|
44
|
+
change: { type: "number" },
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=productEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productEvents.js","sourceRoot":"","sources":["../src/productEvents.ts"],"names":[],"mappings":";;;AAAA,iCAAwF;AAC3E,QAAA,oBAAoB,GAAG,UAAmB,CAAC;AAC3C,QAAA,mBAAmB,GAAG,IAAA,kBAAW,EAAC;IAC3C,WAAW,EAAE,gBAAgB;IAC7B,cAAc,EAAE,oBAAoB;IACpC,OAAO,EAAE;QACL,OAAO,EAAE,IAAA,mBAAY,EAWlB;YACC,MAAM,EAAE;gBACJ,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE;gBACxD,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxC,mBAAmB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACvC,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACrC,oBAAoB,EAAE;oBAClB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE;wBACJ,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACxB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAC1B;iBACJ;aACJ;SACJ,CAAC;QACF,OAAO,EAAE,IAAA,mBAAY,EAOlB;YACC,MAAM,EAAE;gBACJ,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE;gBACxD,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxC,mBAAmB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACvC,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aACxC;SACJ,CAAC;QACF,aAAa,EAAE,IAAA,mBAAY,EAYxB;YACC,MAAM,EAAE;gBACJ,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE;gBAC9D,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxC,mBAAmB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACvC,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACrC,oBAAoB,EAAE;oBAClB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE;wBACJ,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAClC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBAC7B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAC7B;iBACJ;aACJ;SACJ,CAAC;KACL;CACJ,CAAC,CAAC"}
|
package/dist/userEvents.d.ts
CHANGED
|
@@ -1,22 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
import { TopicActionPayloadMap, TopicMessage } from "./base";
|
|
2
|
+
export declare const USER_EVENTS_TOPIC: "users";
|
|
2
3
|
export declare const userEventsSchema: import("./base").TopicSchema<{
|
|
3
|
-
|
|
4
|
+
created: import("./base").ActionSchema<{
|
|
4
5
|
payload: {
|
|
5
|
-
action: "
|
|
6
|
-
|
|
6
|
+
action: "created";
|
|
7
|
+
user_id: string;
|
|
7
8
|
timestamp: number;
|
|
8
9
|
service: string;
|
|
9
|
-
|
|
10
|
+
properties: {
|
|
11
|
+
email: string;
|
|
12
|
+
username: string;
|
|
13
|
+
};
|
|
10
14
|
};
|
|
11
15
|
}>;
|
|
12
|
-
|
|
16
|
+
updated: import("./base").ActionSchema<{
|
|
13
17
|
payload: {
|
|
14
|
-
action: "
|
|
15
|
-
|
|
18
|
+
action: "updated";
|
|
19
|
+
user_id: string;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
service: string;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
deleted: import("./base").ActionSchema<{
|
|
25
|
+
payload: {
|
|
26
|
+
action: "deleted";
|
|
27
|
+
user_id: string;
|
|
16
28
|
timestamp: number;
|
|
17
29
|
service: string;
|
|
18
|
-
reason?: string;
|
|
19
30
|
};
|
|
20
31
|
}>;
|
|
21
32
|
}>;
|
|
33
|
+
export type UserEventPayloads = TopicActionPayloadMap<typeof userEventsSchema>;
|
|
34
|
+
export type UserEventMessage = TopicMessage<typeof userEventsSchema>;
|
|
22
35
|
//# sourceMappingURL=userEvents.d.ts.map
|
package/dist/userEvents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userEvents.d.ts","sourceRoot":"","sources":["../src/userEvents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"userEvents.d.ts","sourceRoot":"","sources":["../src/userEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,qBAAqB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACxF,eAAO,MAAM,iBAAiB,EAAG,OAAgB,CAAC;AAClD,eAAO,MAAM,gBAAgB;;iBAKR;YACL,MAAM,EAAE,SAAS,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,UAAU,EAAE;gBACR,KAAK,EAAE,MAAM,CAAC;gBACd,QAAQ,EAAE,MAAM,CAAC;aACpB,CAAC;SACL;;;iBAiBQ;YACL,MAAM,EAAE,SAAS,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;SACnB;;;iBAUQ;YACL,MAAM,EAAE,SAAS,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;SACnB;;EAUX,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC/E,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/dist/userEvents.js
CHANGED
|
@@ -2,27 +2,40 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.userEventsSchema = exports.USER_EVENTS_TOPIC = void 0;
|
|
4
4
|
const base_1 = require("./base");
|
|
5
|
-
exports.USER_EVENTS_TOPIC = "
|
|
5
|
+
exports.USER_EVENTS_TOPIC = "users";
|
|
6
6
|
exports.userEventsSchema = (0, base_1.defineTopic)({
|
|
7
7
|
actionField: "payload.action",
|
|
8
|
-
partitionField: "payload.
|
|
8
|
+
partitionField: "payload.user_id",
|
|
9
9
|
actions: {
|
|
10
|
-
|
|
10
|
+
created: (0, base_1.defineAction)({
|
|
11
11
|
fields: {
|
|
12
|
-
"payload.action": { type: "string", literal: "
|
|
13
|
-
"payload.
|
|
12
|
+
"payload.action": { type: "string", literal: "created" },
|
|
13
|
+
"payload.user_id": { type: "string" },
|
|
14
14
|
"payload.timestamp": { type: "number" },
|
|
15
15
|
"payload.service": { type: "string" },
|
|
16
|
-
"payload.
|
|
16
|
+
"payload.properties": {
|
|
17
|
+
type: "object",
|
|
18
|
+
fields: {
|
|
19
|
+
email: { type: "string" },
|
|
20
|
+
username: { type: "string" },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
17
23
|
},
|
|
18
24
|
}),
|
|
19
|
-
|
|
25
|
+
updated: (0, base_1.defineAction)({
|
|
20
26
|
fields: {
|
|
21
|
-
"payload.action": { type: "string", literal: "
|
|
22
|
-
"payload.
|
|
27
|
+
"payload.action": { type: "string", literal: "updated" },
|
|
28
|
+
"payload.user_id": { type: "string" },
|
|
29
|
+
"payload.timestamp": { type: "number" },
|
|
30
|
+
"payload.service": { type: "string" },
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
deleted: (0, base_1.defineAction)({
|
|
34
|
+
fields: {
|
|
35
|
+
"payload.action": { type: "string", literal: "deleted" },
|
|
36
|
+
"payload.user_id": { type: "string" },
|
|
23
37
|
"payload.timestamp": { type: "number" },
|
|
24
38
|
"payload.service": { type: "string" },
|
|
25
|
-
"payload.reason": { type: "string", optional: true },
|
|
26
39
|
},
|
|
27
40
|
}),
|
|
28
41
|
},
|
package/dist/userEvents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userEvents.js","sourceRoot":"","sources":["../src/userEvents.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"userEvents.js","sourceRoot":"","sources":["../src/userEvents.ts"],"names":[],"mappings":";;;AAAA,iCAAwF;AAC3E,QAAA,iBAAiB,GAAG,OAAgB,CAAC;AACrC,QAAA,gBAAgB,GAAG,IAAA,kBAAW,EAAC;IACxC,WAAW,EAAE,gBAAgB;IAC7B,cAAc,EAAE,iBAAiB;IACjC,OAAO,EAAE;QACL,OAAO,EAAE,IAAA,mBAAY,EAWlB;YACC,MAAM,EAAE;gBACJ,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE;gBACxD,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACrC,mBAAmB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACvC,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACrC,oBAAoB,EAAE;oBAClB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE;wBACJ,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACzB,QAAQ,EAAE,EAAE,IAAI,EAAE,Q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