@flipdish/events 1.25349.0 → 1.25350.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/package.json
CHANGED
|
@@ -2,35 +2,25 @@ import { z } from 'zod';
|
|
|
2
2
|
import { metadataSchema } from '../../metadata.js';
|
|
3
3
|
import { DeliveryStatus } from './constants.js';
|
|
4
4
|
export const eventType = 'sales.delivery.status.updated.v1';
|
|
5
|
+
const SaleDeliveryStatusUpdatedV1CommonPropertiesSchema = z.object({
|
|
6
|
+
orgId: z.string(),
|
|
7
|
+
brandId: z.string(),
|
|
8
|
+
propertyId: z.string(),
|
|
9
|
+
salesChannelId: z.string(),
|
|
10
|
+
saleId: z.string(),
|
|
11
|
+
externalId: z.string().optional(),
|
|
12
|
+
});
|
|
5
13
|
const SaleDeliveryStatusUpdatedV1PropertiesSchema = z
|
|
6
14
|
.discriminatedUnion('status', [
|
|
7
|
-
|
|
8
|
-
orgId: z.string(),
|
|
9
|
-
brandId: z.string(),
|
|
10
|
-
propertyId: z.string(),
|
|
11
|
-
storefrontId: z.string(),
|
|
12
|
-
saleId: z.string(),
|
|
13
|
-
externalId: z.string(),
|
|
15
|
+
SaleDeliveryStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
14
16
|
status: z.literal(DeliveryStatus.SALE_DISPATCHED),
|
|
15
17
|
dispatchTime: z.string().datetime(),
|
|
16
18
|
}),
|
|
17
|
-
|
|
18
|
-
orgId: z.string(),
|
|
19
|
-
brandId: z.string(),
|
|
20
|
-
propertyId: z.string(),
|
|
21
|
-
storefrontId: z.string(),
|
|
22
|
-
saleId: z.string(),
|
|
23
|
-
externalId: z.string(),
|
|
19
|
+
SaleDeliveryStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
24
20
|
status: z.literal(DeliveryStatus.SALE_ON_THE_WAY),
|
|
25
21
|
dispatchTime: z.string().datetime(),
|
|
26
22
|
}),
|
|
27
|
-
|
|
28
|
-
orgId: z.string(),
|
|
29
|
-
brandId: z.string(),
|
|
30
|
-
propertyId: z.string(),
|
|
31
|
-
storefrontId: z.string(),
|
|
32
|
-
saleId: z.string(),
|
|
33
|
-
externalId: z.string(),
|
|
23
|
+
SaleDeliveryStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
34
24
|
status: z.literal(DeliveryStatus.SALE_DELIVERED),
|
|
35
25
|
deliveryTime: z.string().datetime(),
|
|
36
26
|
}),
|
|
@@ -38,10 +28,10 @@ const SaleDeliveryStatusUpdatedV1PropertiesSchema = z
|
|
|
38
28
|
.openapi({
|
|
39
29
|
description: 'Emitted when a sale delivery status is updated',
|
|
40
30
|
example: {
|
|
41
|
-
orgId: '
|
|
42
|
-
brandId: '
|
|
43
|
-
propertyId: '
|
|
44
|
-
|
|
31
|
+
orgId: 'org123',
|
|
32
|
+
brandId: 'br123',
|
|
33
|
+
propertyId: 'p123',
|
|
34
|
+
salesChannelId: 'sc123',
|
|
45
35
|
saleId: 'sale-123',
|
|
46
36
|
externalId: 'sale-external-123',
|
|
47
37
|
status: DeliveryStatus.SALE_DISPATCHED,
|
|
@@ -4,35 +4,26 @@ import { DeliveryStatus } from './constants.js';
|
|
|
4
4
|
|
|
5
5
|
export const eventType = 'sales.delivery.status.updated.v1';
|
|
6
6
|
|
|
7
|
+
const SaleDeliveryStatusUpdatedV1CommonPropertiesSchema = z.object({
|
|
8
|
+
orgId: z.string(),
|
|
9
|
+
brandId: z.string(),
|
|
10
|
+
propertyId: z.string(),
|
|
11
|
+
salesChannelId: z.string(),
|
|
12
|
+
saleId: z.string(),
|
|
13
|
+
externalId: z.string().optional(),
|
|
14
|
+
});
|
|
15
|
+
|
|
7
16
|
const SaleDeliveryStatusUpdatedV1PropertiesSchema = z
|
|
8
17
|
.discriminatedUnion('status', [
|
|
9
|
-
|
|
10
|
-
orgId: z.string(),
|
|
11
|
-
brandId: z.string(),
|
|
12
|
-
propertyId: z.string(),
|
|
13
|
-
storefrontId: z.string(),
|
|
14
|
-
saleId: z.string(),
|
|
15
|
-
externalId: z.string(),
|
|
18
|
+
SaleDeliveryStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
16
19
|
status: z.literal(DeliveryStatus.SALE_DISPATCHED),
|
|
17
20
|
dispatchTime: z.string().datetime(),
|
|
18
21
|
}),
|
|
19
|
-
|
|
20
|
-
orgId: z.string(),
|
|
21
|
-
brandId: z.string(),
|
|
22
|
-
propertyId: z.string(),
|
|
23
|
-
storefrontId: z.string(),
|
|
24
|
-
saleId: z.string(),
|
|
25
|
-
externalId: z.string(),
|
|
22
|
+
SaleDeliveryStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
26
23
|
status: z.literal(DeliveryStatus.SALE_ON_THE_WAY),
|
|
27
24
|
dispatchTime: z.string().datetime(),
|
|
28
25
|
}),
|
|
29
|
-
|
|
30
|
-
orgId: z.string(),
|
|
31
|
-
brandId: z.string(),
|
|
32
|
-
propertyId: z.string(),
|
|
33
|
-
storefrontId: z.string(),
|
|
34
|
-
saleId: z.string(),
|
|
35
|
-
externalId: z.string(),
|
|
26
|
+
SaleDeliveryStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
36
27
|
status: z.literal(DeliveryStatus.SALE_DELIVERED),
|
|
37
28
|
deliveryTime: z.string().datetime(),
|
|
38
29
|
}),
|
|
@@ -40,10 +31,10 @@ const SaleDeliveryStatusUpdatedV1PropertiesSchema = z
|
|
|
40
31
|
.openapi({
|
|
41
32
|
description: 'Emitted when a sale delivery status is updated',
|
|
42
33
|
example: {
|
|
43
|
-
orgId: '
|
|
44
|
-
brandId: '
|
|
45
|
-
propertyId: '
|
|
46
|
-
|
|
34
|
+
orgId: 'org123',
|
|
35
|
+
brandId: 'br123',
|
|
36
|
+
propertyId: 'p123',
|
|
37
|
+
salesChannelId: 'sc123',
|
|
47
38
|
saleId: 'sale-123',
|
|
48
39
|
externalId: 'sale-external-123',
|
|
49
40
|
status: DeliveryStatus.SALE_DISPATCHED,
|
|
@@ -2,44 +2,28 @@ import { z } from 'zod';
|
|
|
2
2
|
import { metadataSchema } from '../../metadata.js';
|
|
3
3
|
import { SaleStatus } from './constants.js';
|
|
4
4
|
export const eventType = 'sales.status.updated.v1';
|
|
5
|
+
const SaleStatusUpdatedV1CommonPropertiesSchema = z.object({
|
|
6
|
+
orgId: z.string(),
|
|
7
|
+
brandId: z.string(),
|
|
8
|
+
propertyId: z.string(),
|
|
9
|
+
salesChannelId: z.string(),
|
|
10
|
+
saleId: z.string(),
|
|
11
|
+
externalId: z.string().optional(),
|
|
12
|
+
});
|
|
5
13
|
const SaleStatusUpdatedV1PropertiesSchema = z
|
|
6
14
|
.discriminatedUnion('status', [
|
|
7
|
-
|
|
8
|
-
orgId: z.string(),
|
|
9
|
-
brandId: z.string(),
|
|
10
|
-
propertyId: z.string(),
|
|
11
|
-
storefrontId: z.string(),
|
|
12
|
-
saleId: z.string(),
|
|
13
|
-
externalId: z.string(),
|
|
15
|
+
SaleStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
14
16
|
status: z.literal(SaleStatus.SALE_PREPARED_BY_KITCHEN),
|
|
15
17
|
}),
|
|
16
|
-
|
|
17
|
-
orgId: z.string(),
|
|
18
|
-
brandId: z.string(),
|
|
19
|
-
propertyId: z.string(),
|
|
20
|
-
storefrontId: z.string(),
|
|
21
|
-
saleId: z.string(),
|
|
22
|
-
externalId: z.string(),
|
|
18
|
+
SaleStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
23
19
|
status: z.literal(SaleStatus.SALE_PICKUP_TIME_CHANGED),
|
|
24
20
|
pickupTime: z.string().datetime(),
|
|
25
21
|
}),
|
|
26
|
-
|
|
27
|
-
orgId: z.string(),
|
|
28
|
-
brandId: z.string(),
|
|
29
|
-
propertyId: z.string(),
|
|
30
|
-
storefrontId: z.string(),
|
|
31
|
-
saleId: z.string(),
|
|
32
|
-
externalId: z.string(),
|
|
22
|
+
SaleStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
33
23
|
status: z.literal(SaleStatus.SALE_DELIVERY_TIME_CHANGED),
|
|
34
24
|
deliveryTime: z.string().datetime(),
|
|
35
25
|
}),
|
|
36
|
-
|
|
37
|
-
orgId: z.string(),
|
|
38
|
-
brandId: z.string(),
|
|
39
|
-
propertyId: z.string(),
|
|
40
|
-
storefrontId: z.string(),
|
|
41
|
-
saleId: z.string(),
|
|
42
|
-
externalId: z.string(),
|
|
26
|
+
SaleStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
43
27
|
status: z.literal(SaleStatus.SALE_CANCELLED),
|
|
44
28
|
cancellationReason: z.string(),
|
|
45
29
|
cancelledBy: z.string(),
|
|
@@ -48,10 +32,10 @@ const SaleStatusUpdatedV1PropertiesSchema = z
|
|
|
48
32
|
.openapi({
|
|
49
33
|
description: 'Emitted when a sale status is updated',
|
|
50
34
|
example: {
|
|
51
|
-
orgId: '
|
|
52
|
-
brandId: '
|
|
53
|
-
propertyId: '
|
|
54
|
-
|
|
35
|
+
orgId: 'org123',
|
|
36
|
+
brandId: 'br123',
|
|
37
|
+
propertyId: 'p123',
|
|
38
|
+
salesChannelId: 'sc123',
|
|
55
39
|
saleId: 'sale-123',
|
|
56
40
|
externalId: 'sale-external-123',
|
|
57
41
|
status: SaleStatus.SALE_PREPARED_BY_KITCHEN,
|
|
@@ -62,10 +46,10 @@ const SALE_STATUS_UPDATED_V1_WEBHOOK_EXAMPLE = {
|
|
|
62
46
|
'detail-type': eventType,
|
|
63
47
|
detail: {
|
|
64
48
|
properties: {
|
|
65
|
-
orgId: '
|
|
66
|
-
brandId: '
|
|
67
|
-
propertyId: '
|
|
68
|
-
|
|
49
|
+
orgId: 'org123',
|
|
50
|
+
brandId: 'br123',
|
|
51
|
+
propertyId: 'p123',
|
|
52
|
+
salesChannelId: 'sc123',
|
|
69
53
|
saleId: 'sale-123',
|
|
70
54
|
externalId: 'sale-external-123',
|
|
71
55
|
status: SaleStatus.SALE_PREPARED_BY_KITCHEN,
|
|
@@ -93,7 +77,7 @@ export const SaleStatusUpdatedV1Schema = z
|
|
|
93
77
|
}),
|
|
94
78
|
})
|
|
95
79
|
.openapi({
|
|
96
|
-
description: 'Emitted when
|
|
97
|
-
'x-webhook-group': '
|
|
80
|
+
description: 'Emitted when a sale status is updated',
|
|
81
|
+
'x-webhook-group': 'Sale Status Updated',
|
|
98
82
|
'x-example': SALE_STATUS_UPDATED_V1_WEBHOOK_EXAMPLE,
|
|
99
83
|
});
|
|
@@ -4,44 +4,29 @@ import { SaleStatus } from './constants.js';
|
|
|
4
4
|
|
|
5
5
|
export const eventType = 'sales.status.updated.v1';
|
|
6
6
|
|
|
7
|
+
const SaleStatusUpdatedV1CommonPropertiesSchema = z.object({
|
|
8
|
+
orgId: z.string(),
|
|
9
|
+
brandId: z.string(),
|
|
10
|
+
propertyId: z.string(),
|
|
11
|
+
salesChannelId: z.string(),
|
|
12
|
+
saleId: z.string(),
|
|
13
|
+
externalId: z.string().optional(),
|
|
14
|
+
});
|
|
15
|
+
|
|
7
16
|
const SaleStatusUpdatedV1PropertiesSchema = z
|
|
8
17
|
.discriminatedUnion('status', [
|
|
9
|
-
|
|
10
|
-
orgId: z.string(),
|
|
11
|
-
brandId: z.string(),
|
|
12
|
-
propertyId: z.string(),
|
|
13
|
-
storefrontId: z.string(),
|
|
14
|
-
saleId: z.string(),
|
|
15
|
-
externalId: z.string(),
|
|
18
|
+
SaleStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
16
19
|
status: z.literal(SaleStatus.SALE_PREPARED_BY_KITCHEN),
|
|
17
20
|
}),
|
|
18
|
-
|
|
19
|
-
orgId: z.string(),
|
|
20
|
-
brandId: z.string(),
|
|
21
|
-
propertyId: z.string(),
|
|
22
|
-
storefrontId: z.string(),
|
|
23
|
-
saleId: z.string(),
|
|
24
|
-
externalId: z.string(),
|
|
21
|
+
SaleStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
25
22
|
status: z.literal(SaleStatus.SALE_PICKUP_TIME_CHANGED),
|
|
26
23
|
pickupTime: z.string().datetime(),
|
|
27
24
|
}),
|
|
28
|
-
|
|
29
|
-
orgId: z.string(),
|
|
30
|
-
brandId: z.string(),
|
|
31
|
-
propertyId: z.string(),
|
|
32
|
-
storefrontId: z.string(),
|
|
33
|
-
saleId: z.string(),
|
|
34
|
-
externalId: z.string(),
|
|
25
|
+
SaleStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
35
26
|
status: z.literal(SaleStatus.SALE_DELIVERY_TIME_CHANGED),
|
|
36
27
|
deliveryTime: z.string().datetime(),
|
|
37
28
|
}),
|
|
38
|
-
|
|
39
|
-
orgId: z.string(),
|
|
40
|
-
brandId: z.string(),
|
|
41
|
-
propertyId: z.string(),
|
|
42
|
-
storefrontId: z.string(),
|
|
43
|
-
saleId: z.string(),
|
|
44
|
-
externalId: z.string(),
|
|
29
|
+
SaleStatusUpdatedV1CommonPropertiesSchema.extend({
|
|
45
30
|
status: z.literal(SaleStatus.SALE_CANCELLED),
|
|
46
31
|
cancellationReason: z.string(),
|
|
47
32
|
cancelledBy: z.string(),
|
|
@@ -50,10 +35,10 @@ const SaleStatusUpdatedV1PropertiesSchema = z
|
|
|
50
35
|
.openapi({
|
|
51
36
|
description: 'Emitted when a sale status is updated',
|
|
52
37
|
example: {
|
|
53
|
-
orgId: '
|
|
54
|
-
brandId: '
|
|
55
|
-
propertyId: '
|
|
56
|
-
|
|
38
|
+
orgId: 'org123',
|
|
39
|
+
brandId: 'br123',
|
|
40
|
+
propertyId: 'p123',
|
|
41
|
+
salesChannelId: 'sc123',
|
|
57
42
|
saleId: 'sale-123',
|
|
58
43
|
externalId: 'sale-external-123',
|
|
59
44
|
status: SaleStatus.SALE_PREPARED_BY_KITCHEN,
|
|
@@ -65,10 +50,10 @@ const SALE_STATUS_UPDATED_V1_WEBHOOK_EXAMPLE = {
|
|
|
65
50
|
'detail-type': eventType,
|
|
66
51
|
detail: {
|
|
67
52
|
properties: {
|
|
68
|
-
orgId: '
|
|
69
|
-
brandId: '
|
|
70
|
-
propertyId: '
|
|
71
|
-
|
|
53
|
+
orgId: 'org123',
|
|
54
|
+
brandId: 'br123',
|
|
55
|
+
propertyId: 'p123',
|
|
56
|
+
salesChannelId: 'sc123',
|
|
72
57
|
saleId: 'sale-123',
|
|
73
58
|
externalId: 'sale-external-123',
|
|
74
59
|
status: SaleStatus.SALE_PREPARED_BY_KITCHEN,
|
|
@@ -97,9 +82,8 @@ export const SaleStatusUpdatedV1Schema = z
|
|
|
97
82
|
}),
|
|
98
83
|
})
|
|
99
84
|
.openapi({
|
|
100
|
-
description:
|
|
101
|
-
|
|
102
|
-
'x-webhook-group': 'Menu Publishing',
|
|
85
|
+
description: 'Emitted when a sale status is updated',
|
|
86
|
+
'x-webhook-group': 'Sale Status Updated',
|
|
103
87
|
'x-example': SALE_STATUS_UPDATED_V1_WEBHOOK_EXAMPLE,
|
|
104
88
|
});
|
|
105
89
|
|