@automate.ax/integration-contracts 0.116.0 → 0.118.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.
@@ -0,0 +1,105 @@
1
+ import * as z from "zod"
2
+
3
+ const DATE_TIME_SCHEMA = z.iso.datetime({ offset: true })
4
+ const ID_SCHEMA = z.number().int().positive()
5
+
6
+ export const TIDYCAL_ACCOUNT_SCHEMA = z.object({
7
+ currencySymbol: z.string(),
8
+ email: z.email(),
9
+ language: z.string(),
10
+ lifetimeProAt: DATE_TIME_SCHEMA.nullable(),
11
+ name: z.string(),
12
+ profilePictureUrl: z.url().nullable(),
13
+ vanityPath: z.string(),
14
+ })
15
+
16
+ export const TIDYCAL_CONTACT_SCHEMA = z.object({
17
+ createdAt: DATE_TIME_SCHEMA,
18
+ email: z.email(),
19
+ id: ID_SCHEMA,
20
+ ipAddress: z.string().nullable().optional(),
21
+ name: z.string(),
22
+ phoneNumber: z.string().nullable().optional(),
23
+ timezone: z.string().nullable().optional(),
24
+ updatedAt: DATE_TIME_SCHEMA,
25
+ })
26
+
27
+ export const TIDYCAL_PAYMENT_SCHEMA = z.object({
28
+ amount: z.number().nonnegative(),
29
+ bookingId: ID_SCHEMA,
30
+ createdAt: DATE_TIME_SCHEMA,
31
+ currency: z.string(),
32
+ id: ID_SCHEMA,
33
+ paymentId: z.string(),
34
+ updatedAt: DATE_TIME_SCHEMA,
35
+ })
36
+
37
+ export const TIDYCAL_QUESTION_SCHEMA = z.object({
38
+ answer: z.string(),
39
+ bookingId: ID_SCHEMA,
40
+ createdAt: DATE_TIME_SCHEMA,
41
+ id: ID_SCHEMA,
42
+ question: z.string(),
43
+ updatedAt: DATE_TIME_SCHEMA,
44
+ })
45
+
46
+ export const TIDYCAL_BOOKING_SCHEMA = z.object({
47
+ bookingTypeId: ID_SCHEMA,
48
+ cancelledAt: DATE_TIME_SCHEMA.nullable(),
49
+ contact: TIDYCAL_CONTACT_SCHEMA,
50
+ contactId: ID_SCHEMA,
51
+ createdAt: DATE_TIME_SCHEMA,
52
+ endsAt: DATE_TIME_SCHEMA,
53
+ id: ID_SCHEMA,
54
+ meetingId: z.string().nullable().optional(),
55
+ meetingUrl: z.url().nullable().optional(),
56
+ payment: TIDYCAL_PAYMENT_SCHEMA.nullable().optional(),
57
+ questions: TIDYCAL_QUESTION_SCHEMA.array(),
58
+ startsAt: DATE_TIME_SCHEMA,
59
+ timezone: z.string(),
60
+ updatedAt: DATE_TIME_SCHEMA,
61
+ })
62
+
63
+ export const TIDYCAL_BOOKING_TYPE_SCHEMA = z.object({
64
+ bookingThresholdMinutes: z.number().int().min(0),
65
+ createdAt: DATE_TIME_SCHEMA,
66
+ currencyCode: z.string().nullable().optional(),
67
+ description: z.string(),
68
+ disabledAt: DATE_TIME_SCHEMA.nullable(),
69
+ durationMinutes: z.number().int().positive(),
70
+ id: ID_SCHEMA,
71
+ latestAvailabilityDays: z.number().int().min(0),
72
+ maxBookings: z.number().int().positive(),
73
+ paddingMinutes: z.number().int().min(0),
74
+ paymentPlatform: z.enum(["paypal", "stripe", "tidycal"]).nullable(),
75
+ paymentPlatformId: z.string().nullable().optional(),
76
+ price: z.number().nonnegative(),
77
+ private: z.boolean(),
78
+ redirectUrl: z.url().nullable(),
79
+ title: z.string(),
80
+ updatedAt: DATE_TIME_SCHEMA,
81
+ url: z.url(),
82
+ urlSlug: z.string(),
83
+ userId: ID_SCHEMA,
84
+ })
85
+
86
+ export const TIDYCAL_TIMESLOT_SCHEMA = z.object({
87
+ availableBookings: z.number().int().nonnegative(),
88
+ endsAt: DATE_TIME_SCHEMA,
89
+ startsAt: DATE_TIME_SCHEMA,
90
+ })
91
+
92
+ export const TIDYCAL_TEAM_SCHEMA = z.object({
93
+ createdAt: DATE_TIME_SCHEMA,
94
+ id: ID_SCHEMA,
95
+ name: z.string(),
96
+ updatedAt: DATE_TIME_SCHEMA,
97
+ })
98
+
99
+ export const TIDYCAL_TEAM_USER_SCHEMA = z.object({
100
+ createdAt: DATE_TIME_SCHEMA,
101
+ email: z.email(),
102
+ id: ID_SCHEMA,
103
+ name: z.string(),
104
+ updatedAt: DATE_TIME_SCHEMA,
105
+ })