@flipdish/events 1.25364.0 → 1.26008.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/ai-chat-agent.js +89 -0
- package/ai-chat-agent.ts +104 -0
- package/package.json +1 -1
- package/rms/menus/events/constants.js +1 -0
- package/rms/menus/events/constants.ts +1 -0
- package/rms/menus/events/index.js +3 -0
- package/rms/menus/events/index.ts +3 -0
- package/rms/menus/events/menu.validation.failed.v1.js +58 -0
- package/rms/menus/events/menu.validation.failed.v1.ts +70 -0
- package/rms/menus/events/webhook-examples.js +10 -0
- package/rms/menus/events/webhook-examples.ts +11 -0
- package/rms/menus/index.js +2 -0
- package/rms/menus/index.ts +2 -0
- package/webhooks/index.js +1 -0
- package/webhooks/index.ts +1 -0
package/ai-chat-agent.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { orgIdSchema, propertyIdSchema } from './common-schemas.js';
|
|
4
|
+
extendZodWithOpenApi(z);
|
|
5
|
+
export const eventTypes = {
|
|
6
|
+
AI_CHAT_AGENT_BASKET_UPDATED_V1: 'ai.chat_agent.basket.updated.v1',
|
|
7
|
+
AI_CHAT_AGENT_ORDER_SUBMITTED_V1: 'ai.chat_agent.order.submitted.v1',
|
|
8
|
+
AI_CHAT_AGENT_ORDER_FAILED_V1: 'ai.chat_agent.order.failed.v1',
|
|
9
|
+
};
|
|
10
|
+
export const commonAIChatAgentSchema = z.object({
|
|
11
|
+
chatId: z.string().openapi({
|
|
12
|
+
description: 'Unique identifier for the chat session',
|
|
13
|
+
example: 'chat_123e4567-e89b-12d3-a456-426614174000',
|
|
14
|
+
}),
|
|
15
|
+
orgIdSchema: orgIdSchema,
|
|
16
|
+
brandIdSchema: z.string().openapi({
|
|
17
|
+
description: 'Brand ID identifier',
|
|
18
|
+
example: 'brand123',
|
|
19
|
+
}),
|
|
20
|
+
propertyId: propertyIdSchema,
|
|
21
|
+
restaurantName: z.string().openapi({
|
|
22
|
+
description: 'Name of the restaurant',
|
|
23
|
+
example: "Joe's Pizza",
|
|
24
|
+
}),
|
|
25
|
+
});
|
|
26
|
+
export const basketMenuItemOptionSchema = z.object({
|
|
27
|
+
name: z.string().openapi({
|
|
28
|
+
description: 'Name of the menu item option',
|
|
29
|
+
example: 'Extra Cheese',
|
|
30
|
+
}),
|
|
31
|
+
menuItemOptionSetId: z.number().openapi({
|
|
32
|
+
description: 'ID of the menu item option set this option belongs to',
|
|
33
|
+
example: 123,
|
|
34
|
+
}),
|
|
35
|
+
menuItemOptionSetItemId: z.number().openapi({
|
|
36
|
+
description: 'ID of the specific option item within the option set',
|
|
37
|
+
example: 456,
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
export const menuItemSchema = z.object({
|
|
41
|
+
menuItemId: z.number().openapi({
|
|
42
|
+
description: 'Unique identifier for the menu item',
|
|
43
|
+
example: 789,
|
|
44
|
+
}),
|
|
45
|
+
name: z.string().openapi({
|
|
46
|
+
description: 'Name of the menu item',
|
|
47
|
+
example: 'Margherita Pizza',
|
|
48
|
+
}),
|
|
49
|
+
quantity: z.number().min(1).positive().openapi({
|
|
50
|
+
description: 'The quantity of the menu item',
|
|
51
|
+
example: 1,
|
|
52
|
+
}),
|
|
53
|
+
options: z.array(basketMenuItemOptionSchema).openapi({
|
|
54
|
+
description: 'Array of options selected for this menu item',
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
57
|
+
export const aiChatAgentBasketUpdatedV1Schema = commonAIChatAgentSchema.extend({
|
|
58
|
+
eventName: z.literal(eventTypes.AI_CHAT_AGENT_BASKET_UPDATED_V1),
|
|
59
|
+
basket: z.array(menuItemSchema).openapi({
|
|
60
|
+
description: 'Array of menu items currently in the basket',
|
|
61
|
+
}),
|
|
62
|
+
});
|
|
63
|
+
export const aiChatAgentOrderSubmittedV1Schema = commonAIChatAgentSchema.extend({
|
|
64
|
+
eventName: z.literal(eventTypes.AI_CHAT_AGENT_ORDER_SUBMITTED_V1),
|
|
65
|
+
orderId: z.number().openapi({
|
|
66
|
+
description: 'Unique identifier for the submitted order',
|
|
67
|
+
example: 12345,
|
|
68
|
+
}),
|
|
69
|
+
});
|
|
70
|
+
export const aiChatAgentOrderFailedV1Schema = commonAIChatAgentSchema.extend({
|
|
71
|
+
eventName: z.literal(eventTypes.AI_CHAT_AGENT_ORDER_FAILED_V1),
|
|
72
|
+
error: z.string().openapi({
|
|
73
|
+
description: 'Error message describing why the order submission failed',
|
|
74
|
+
example: 'Payment processing failed',
|
|
75
|
+
}),
|
|
76
|
+
});
|
|
77
|
+
// ================================
|
|
78
|
+
// Event Schemas
|
|
79
|
+
// ================================
|
|
80
|
+
export const aiChatAgentEventSchema = z.discriminatedUnion('eventName', [
|
|
81
|
+
aiChatAgentBasketUpdatedV1Schema,
|
|
82
|
+
aiChatAgentOrderSubmittedV1Schema,
|
|
83
|
+
aiChatAgentOrderFailedV1Schema,
|
|
84
|
+
]);
|
|
85
|
+
export const eventSchemaMap = Object.fromEntries([
|
|
86
|
+
[eventTypes.AI_CHAT_AGENT_BASKET_UPDATED_V1, aiChatAgentBasketUpdatedV1Schema],
|
|
87
|
+
[eventTypes.AI_CHAT_AGENT_ORDER_SUBMITTED_V1, aiChatAgentOrderSubmittedV1Schema],
|
|
88
|
+
[eventTypes.AI_CHAT_AGENT_ORDER_FAILED_V1, aiChatAgentOrderFailedV1Schema],
|
|
89
|
+
]);
|
package/ai-chat-agent.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { orgIdSchema, propertyIdSchema } from './common-schemas.js';
|
|
4
|
+
|
|
5
|
+
extendZodWithOpenApi(z);
|
|
6
|
+
|
|
7
|
+
export const eventTypes = {
|
|
8
|
+
AI_CHAT_AGENT_BASKET_UPDATED_V1: 'ai.chat_agent.basket.updated.v1',
|
|
9
|
+
AI_CHAT_AGENT_ORDER_SUBMITTED_V1: 'ai.chat_agent.order.submitted.v1',
|
|
10
|
+
AI_CHAT_AGENT_ORDER_FAILED_V1: 'ai.chat_agent.order.failed.v1',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const commonAIChatAgentSchema = z.object({
|
|
14
|
+
chatId: z.string().openapi({
|
|
15
|
+
description: 'Unique identifier for the chat session',
|
|
16
|
+
example: 'chat_123e4567-e89b-12d3-a456-426614174000',
|
|
17
|
+
}),
|
|
18
|
+
orgIdSchema: orgIdSchema,
|
|
19
|
+
brandIdSchema: z.string().openapi({
|
|
20
|
+
description: 'Brand ID identifier',
|
|
21
|
+
example: 'brand123',
|
|
22
|
+
}),
|
|
23
|
+
propertyId: propertyIdSchema,
|
|
24
|
+
restaurantName: z.string().openapi({
|
|
25
|
+
description: 'Name of the restaurant',
|
|
26
|
+
example: "Joe's Pizza",
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const basketMenuItemOptionSchema = z.object({
|
|
31
|
+
name: z.string().openapi({
|
|
32
|
+
description: 'Name of the menu item option',
|
|
33
|
+
example: 'Extra Cheese',
|
|
34
|
+
}),
|
|
35
|
+
menuItemOptionSetId: z.number().openapi({
|
|
36
|
+
description: 'ID of the menu item option set this option belongs to',
|
|
37
|
+
example: 123,
|
|
38
|
+
}),
|
|
39
|
+
menuItemOptionSetItemId: z.number().openapi({
|
|
40
|
+
description: 'ID of the specific option item within the option set',
|
|
41
|
+
example: 456,
|
|
42
|
+
}),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const menuItemSchema = z.object({
|
|
46
|
+
menuItemId: z.number().openapi({
|
|
47
|
+
description: 'Unique identifier for the menu item',
|
|
48
|
+
example: 789,
|
|
49
|
+
}),
|
|
50
|
+
name: z.string().openapi({
|
|
51
|
+
description: 'Name of the menu item',
|
|
52
|
+
example: 'Margherita Pizza',
|
|
53
|
+
}),
|
|
54
|
+
quantity: z.number().min(1).positive().openapi({
|
|
55
|
+
description: 'The quantity of the menu item',
|
|
56
|
+
example: 1,
|
|
57
|
+
}),
|
|
58
|
+
options: z.array(basketMenuItemOptionSchema).openapi({
|
|
59
|
+
description: 'Array of options selected for this menu item',
|
|
60
|
+
}),
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const aiChatAgentBasketUpdatedV1Schema = commonAIChatAgentSchema.extend({
|
|
64
|
+
eventName: z.literal(eventTypes.AI_CHAT_AGENT_BASKET_UPDATED_V1),
|
|
65
|
+
basket: z.array(menuItemSchema).openapi({
|
|
66
|
+
description: 'Array of menu items currently in the basket',
|
|
67
|
+
}),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const aiChatAgentOrderSubmittedV1Schema = commonAIChatAgentSchema.extend({
|
|
71
|
+
eventName: z.literal(eventTypes.AI_CHAT_AGENT_ORDER_SUBMITTED_V1),
|
|
72
|
+
orderId: z.number().openapi({
|
|
73
|
+
description: 'Unique identifier for the submitted order',
|
|
74
|
+
example: 12345,
|
|
75
|
+
}),
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export const aiChatAgentOrderFailedV1Schema = commonAIChatAgentSchema.extend({
|
|
79
|
+
eventName: z.literal(eventTypes.AI_CHAT_AGENT_ORDER_FAILED_V1),
|
|
80
|
+
error: z.string().openapi({
|
|
81
|
+
description: 'Error message describing why the order submission failed',
|
|
82
|
+
example: 'Payment processing failed',
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// ================================
|
|
87
|
+
// Event Schemas
|
|
88
|
+
// ================================
|
|
89
|
+
export const aiChatAgentEventSchema = z.discriminatedUnion('eventName', [
|
|
90
|
+
aiChatAgentBasketUpdatedV1Schema,
|
|
91
|
+
aiChatAgentOrderSubmittedV1Schema,
|
|
92
|
+
aiChatAgentOrderFailedV1Schema,
|
|
93
|
+
]);
|
|
94
|
+
|
|
95
|
+
export const eventSchemaMap = Object.fromEntries([
|
|
96
|
+
[eventTypes.AI_CHAT_AGENT_BASKET_UPDATED_V1, aiChatAgentBasketUpdatedV1Schema],
|
|
97
|
+
[eventTypes.AI_CHAT_AGENT_ORDER_SUBMITTED_V1, aiChatAgentOrderSubmittedV1Schema],
|
|
98
|
+
[eventTypes.AI_CHAT_AGENT_ORDER_FAILED_V1, aiChatAgentOrderFailedV1Schema],
|
|
99
|
+
]);
|
|
100
|
+
|
|
101
|
+
export type AIChatAgentEvent = z.infer<typeof aiChatAgentEventSchema>;
|
|
102
|
+
export type AIChatAgentBasketUpdatedEventV1 = z.infer<typeof aiChatAgentBasketUpdatedV1Schema>;
|
|
103
|
+
export type AIChatAgentOrderSubmittedEventV1 = z.infer<typeof aiChatAgentOrderSubmittedV1Schema>;
|
|
104
|
+
export type AIChatAgentOrderFailedEventV1 = z.infer<typeof aiChatAgentOrderFailedV1Schema>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { eventTypes } from './constants.js';
|
|
2
2
|
import { MenuEventBaseSchema } from './menu.published.v1.js';
|
|
3
|
+
import { MenuValidationFailedEventBaseSchema } from './menu.validation.failed.v1.js';
|
|
3
4
|
export * from './constants.js';
|
|
4
5
|
export * from './menu.published.v1.js';
|
|
6
|
+
export * from './menu.validation.failed.v1.js';
|
|
5
7
|
export const eventSchemaMap = Object.fromEntries([
|
|
6
8
|
[eventTypes.MENU_PUBLISHED_V1, MenuEventBaseSchema],
|
|
9
|
+
[eventTypes.MENU_VALIDATION_FAILED_V1, MenuValidationFailedEventBaseSchema],
|
|
7
10
|
]);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { eventTypes } from './constants.js';
|
|
2
2
|
import { MenuEventBaseSchema } from './menu.published.v1.js';
|
|
3
|
+
import { MenuValidationFailedEventBaseSchema } from './menu.validation.failed.v1.js';
|
|
3
4
|
|
|
4
5
|
export * from './constants.js';
|
|
5
6
|
export * from './menu.published.v1.js';
|
|
7
|
+
export * from './menu.validation.failed.v1.js';
|
|
6
8
|
|
|
7
9
|
export const eventSchemaMap = Object.fromEntries([
|
|
8
10
|
[eventTypes.MENU_PUBLISHED_V1, MenuEventBaseSchema],
|
|
11
|
+
[eventTypes.MENU_VALIDATION_FAILED_V1, MenuValidationFailedEventBaseSchema],
|
|
9
12
|
]);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { orgIdSchema, propertyIdSchema } from '../../../common-schemas.js';
|
|
4
|
+
import { metadataSchema } from '../../../metadata.js';
|
|
5
|
+
import { menuIdSchema, menuPublishIdSchema, revisionIdSchema } from '../schemas/common-schemas.js';
|
|
6
|
+
import { eventTypes } from './constants.js';
|
|
7
|
+
import { MENU_VALIDATION_FAILED_V1_WEBHOOK_EXAMPLE } from './webhook-examples.js';
|
|
8
|
+
// This must be called before defining any schemas
|
|
9
|
+
extendZodWithOpenApi(z);
|
|
10
|
+
// Event properties schema for menu validation failed events
|
|
11
|
+
export const MenuValidationFailedEventPropertiesSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
orgId: orgIdSchema,
|
|
14
|
+
brandId: z.string().openapi({
|
|
15
|
+
description: 'Unique ID of the client’s Brand that owns this menu. This ID remains the same for subsequent updates / revisions of the same menu.',
|
|
16
|
+
example: 'br456',
|
|
17
|
+
}),
|
|
18
|
+
propertyId: propertyIdSchema,
|
|
19
|
+
salesChannelId: z.string().openapi({
|
|
20
|
+
description: 'Unique ID of a Sales Channel, a digital channel tied to a Property and Brand (e.g., kiosk, web, mobile app). This ID remains the same for subsequent updates / revisions of the same menu.',
|
|
21
|
+
example: 'sc123',
|
|
22
|
+
}),
|
|
23
|
+
menuId: menuIdSchema,
|
|
24
|
+
menuRevisionId: revisionIdSchema,
|
|
25
|
+
menuPublishId: menuPublishIdSchema,
|
|
26
|
+
error: z.string().openapi({
|
|
27
|
+
description: 'The error message from the menu validation',
|
|
28
|
+
example: 'Menu validation failed',
|
|
29
|
+
}),
|
|
30
|
+
})
|
|
31
|
+
.openapi('MenuValidationFailedEventPropertiesSchema', {
|
|
32
|
+
description: 'Properties included with menu validation failed events.',
|
|
33
|
+
});
|
|
34
|
+
// =============================================================================
|
|
35
|
+
// MENU VALIDATION FAILED EVENT SCHEMAS
|
|
36
|
+
// =============================================================================
|
|
37
|
+
// EventBridge envelope schema for menu events
|
|
38
|
+
export const MenuValidationFailedEventBaseSchema = z
|
|
39
|
+
.object({
|
|
40
|
+
source: z.string().openapi({
|
|
41
|
+
description: 'Source of the event',
|
|
42
|
+
example: 'rms',
|
|
43
|
+
}),
|
|
44
|
+
'detail-type': z.literal(eventTypes.MENU_VALIDATION_FAILED_V1),
|
|
45
|
+
detail: z.object({
|
|
46
|
+
properties: MenuValidationFailedEventPropertiesSchema,
|
|
47
|
+
metadata: metadataSchema,
|
|
48
|
+
}),
|
|
49
|
+
})
|
|
50
|
+
.openapi({
|
|
51
|
+
description: 'Emitted when a menu validation fails after a menu publish.',
|
|
52
|
+
'x-webhook-group': 'Menu Validation',
|
|
53
|
+
'x-example': MENU_VALIDATION_FAILED_V1_WEBHOOK_EXAMPLE,
|
|
54
|
+
});
|
|
55
|
+
export default {
|
|
56
|
+
MenuValidationFailedEventBaseSchema,
|
|
57
|
+
MenuValidationFailedEventPropertiesSchema,
|
|
58
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { orgIdSchema, propertyIdSchema } from '../../../common-schemas.js';
|
|
4
|
+
import { metadataSchema } from '../../../metadata.js';
|
|
5
|
+
import { menuIdSchema, menuPublishIdSchema, revisionIdSchema } from '../schemas/common-schemas.js';
|
|
6
|
+
import { eventTypes } from './constants.js';
|
|
7
|
+
import { MENU_VALIDATION_FAILED_V1_WEBHOOK_EXAMPLE } from './webhook-examples.js';
|
|
8
|
+
|
|
9
|
+
// This must be called before defining any schemas
|
|
10
|
+
extendZodWithOpenApi(z);
|
|
11
|
+
|
|
12
|
+
// Event properties schema for menu validation failed events
|
|
13
|
+
export const MenuValidationFailedEventPropertiesSchema = z
|
|
14
|
+
.object({
|
|
15
|
+
orgId: orgIdSchema,
|
|
16
|
+
brandId: z.string().openapi({
|
|
17
|
+
description:
|
|
18
|
+
'Unique ID of the client’s Brand that owns this menu. This ID remains the same for subsequent updates / revisions of the same menu.',
|
|
19
|
+
example: 'br456',
|
|
20
|
+
}),
|
|
21
|
+
propertyId: propertyIdSchema,
|
|
22
|
+
salesChannelId: z.string().openapi({
|
|
23
|
+
description:
|
|
24
|
+
'Unique ID of a Sales Channel, a digital channel tied to a Property and Brand (e.g., kiosk, web, mobile app). This ID remains the same for subsequent updates / revisions of the same menu.',
|
|
25
|
+
example: 'sc123',
|
|
26
|
+
}),
|
|
27
|
+
menuId: menuIdSchema,
|
|
28
|
+
menuRevisionId: revisionIdSchema,
|
|
29
|
+
menuPublishId: menuPublishIdSchema,
|
|
30
|
+
error: z.string().openapi({
|
|
31
|
+
description: 'The error message from the menu validation',
|
|
32
|
+
example: 'Menu validation failed',
|
|
33
|
+
}),
|
|
34
|
+
})
|
|
35
|
+
.openapi('MenuValidationFailedEventPropertiesSchema', {
|
|
36
|
+
description: 'Properties included with menu validation failed events.',
|
|
37
|
+
});
|
|
38
|
+
export type MenuValidationFailedEventPropertiesType = z.infer<
|
|
39
|
+
typeof MenuValidationFailedEventPropertiesSchema
|
|
40
|
+
>;
|
|
41
|
+
|
|
42
|
+
// =============================================================================
|
|
43
|
+
// MENU VALIDATION FAILED EVENT SCHEMAS
|
|
44
|
+
// =============================================================================
|
|
45
|
+
|
|
46
|
+
// EventBridge envelope schema for menu events
|
|
47
|
+
export const MenuValidationFailedEventBaseSchema = z
|
|
48
|
+
.object({
|
|
49
|
+
source: z.string().openapi({
|
|
50
|
+
description: 'Source of the event',
|
|
51
|
+
example: 'rms',
|
|
52
|
+
}),
|
|
53
|
+
'detail-type': z.literal(eventTypes.MENU_VALIDATION_FAILED_V1),
|
|
54
|
+
detail: z.object({
|
|
55
|
+
properties: MenuValidationFailedEventPropertiesSchema,
|
|
56
|
+
metadata: metadataSchema,
|
|
57
|
+
}),
|
|
58
|
+
})
|
|
59
|
+
.openapi({
|
|
60
|
+
description: 'Emitted when a menu validation fails after a menu publish.',
|
|
61
|
+
'x-webhook-group': 'Menu Validation',
|
|
62
|
+
'x-example': MENU_VALIDATION_FAILED_V1_WEBHOOK_EXAMPLE,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export type MenuValidationFailedEventBaseType = z.infer<typeof MenuValidationFailedEventBaseSchema>;
|
|
66
|
+
|
|
67
|
+
export default {
|
|
68
|
+
MenuValidationFailedEventBaseSchema,
|
|
69
|
+
MenuValidationFailedEventPropertiesSchema,
|
|
70
|
+
};
|
|
@@ -357,3 +357,13 @@ export const MENU_PUBLISHED_V1_WEBHOOK_EXAMPLE = {
|
|
|
357
357
|
menu: MENU_EXAMPLE,
|
|
358
358
|
priceBandId: '13a85f64-5717-4562-b3fc-2c963f66afb6',
|
|
359
359
|
};
|
|
360
|
+
export const MENU_VALIDATION_FAILED_V1_WEBHOOK_EXAMPLE = {
|
|
361
|
+
orgId: 'org123',
|
|
362
|
+
brandId: 'br456',
|
|
363
|
+
propertyId: 'p789',
|
|
364
|
+
salesChannelId: 'sc123',
|
|
365
|
+
menuId: '123e4567-e89b-12d3-a456-426614174000',
|
|
366
|
+
menuPublishId: '123e4567-e89b-12d3-a456-426614174000',
|
|
367
|
+
menuRevisionId: 1,
|
|
368
|
+
error: 'Menu validation failed',
|
|
369
|
+
};
|
|
@@ -361,3 +361,14 @@ export const MENU_PUBLISHED_V1_WEBHOOK_EXAMPLE = {
|
|
|
361
361
|
menu: MENU_EXAMPLE,
|
|
362
362
|
priceBandId: '13a85f64-5717-4562-b3fc-2c963f66afb6',
|
|
363
363
|
};
|
|
364
|
+
|
|
365
|
+
export const MENU_VALIDATION_FAILED_V1_WEBHOOK_EXAMPLE = {
|
|
366
|
+
orgId: 'org123',
|
|
367
|
+
brandId: 'br456',
|
|
368
|
+
propertyId: 'p789',
|
|
369
|
+
salesChannelId: 'sc123',
|
|
370
|
+
menuId: '123e4567-e89b-12d3-a456-426614174000',
|
|
371
|
+
menuPublishId: '123e4567-e89b-12d3-a456-426614174000',
|
|
372
|
+
menuRevisionId: 1,
|
|
373
|
+
error: 'Menu validation failed',
|
|
374
|
+
};
|
package/rms/menus/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import MenuEventSchemas from './events/menu.published.v1.js';
|
|
4
|
+
import MenuValidationFailedEventSchemas from './events/menu.validation.failed.v1.js';
|
|
4
5
|
import CategoryGroupSchemas from './schemas/category-group.js';
|
|
5
6
|
import CategorySchemas from './schemas/category.js';
|
|
6
7
|
import ChargeSchemas from './schemas/charge.js';
|
|
@@ -27,5 +28,6 @@ export const Schemas = {
|
|
|
27
28
|
...TaxConfigSchemas,
|
|
28
29
|
...MenuSchemas,
|
|
29
30
|
...MenuEventSchemas,
|
|
31
|
+
...MenuValidationFailedEventSchemas,
|
|
30
32
|
};
|
|
31
33
|
export default Schemas;
|
package/rms/menus/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import MenuEventSchemas from './events/menu.published.v1.js';
|
|
4
|
+
import MenuValidationFailedEventSchemas from './events/menu.validation.failed.v1.js';
|
|
4
5
|
import CategoryGroupSchemas from './schemas/category-group.js';
|
|
5
6
|
import CategorySchemas from './schemas/category.js';
|
|
6
7
|
import ChargeSchemas from './schemas/charge.js';
|
|
@@ -30,6 +31,7 @@ export const Schemas = {
|
|
|
30
31
|
...TaxConfigSchemas,
|
|
31
32
|
...MenuSchemas,
|
|
32
33
|
...MenuEventSchemas,
|
|
34
|
+
...MenuValidationFailedEventSchemas,
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
export default Schemas;
|
package/webhooks/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { eventSchemaMap as rmsSalesEventSchemaMap, eventTypes as rmsSalesEvents,
|
|
|
3
3
|
import { eventSchemaMap as rmsSnoozeEventSchemaMap, eventTypes as rmsSnoozeEvents, } from '../rms/snoozes/index.js';
|
|
4
4
|
export const webhookEventTypes = [
|
|
5
5
|
rmsMenuEvents.MENU_PUBLISHED_V1,
|
|
6
|
+
rmsMenuEvents.MENU_VALIDATION_FAILED_V1,
|
|
6
7
|
rmsSnoozeEvents.MENU_ITEM_SNOOZED_V1,
|
|
7
8
|
rmsSnoozeEvents.MENU_ITEM_UNSNOOZED_V1,
|
|
8
9
|
rmsSnoozeEvents.SALES_CHANNEL_SNOOZED_V1,
|
package/webhooks/index.ts
CHANGED