@aranova/tracking-next 1.1.0 → 1.2.1
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 +48 -1
- package/dist/calendar-server.d.mts +1 -1
- package/dist/calendar-server.d.ts +1 -1
- package/dist/calendar.d.mts +18 -4
- package/dist/calendar.d.ts +18 -4
- package/dist/calendar.js +218 -18
- package/dist/calendar.js.map +1 -1
- package/dist/calendar.mjs +217 -18
- package/dist/calendar.mjs.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +1 -1
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +171 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +170 -19
- package/dist/index.mjs.map +1 -1
- package/dist/sales.js +15 -0
- package/dist/sales.js.map +1 -1
- package/dist/sales.mjs +15 -0
- package/dist/sales.mjs.map +1 -1
- package/dist/{transport-CDmGOiCq.d.ts → transport-ChCL6vPv.d.ts} +122 -50
- package/dist/{transport-I_cMSFQ6.d.mts → transport-DvAEZ1xf.d.mts} +122 -50
- package/package.json +1 -1
|
@@ -1,12 +1,116 @@
|
|
|
1
1
|
import * as z from 'zod/mini';
|
|
2
2
|
import { A as ApiTransportConfig } from './request-Doq36Rt0.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* BookingResponse
|
|
6
|
+
*
|
|
7
|
+
* A created booking. `manage_token` is present only on the create response.
|
|
8
|
+
*/
|
|
9
|
+
declare const zBookingResponse: z.ZodMiniObject<{
|
|
10
|
+
all_day: z.ZodMiniBoolean<boolean>;
|
|
11
|
+
appointment_type: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
12
|
+
calendar_key: z.ZodMiniString<string>;
|
|
13
|
+
created_at: z.iso.ZodMiniISODateTime;
|
|
14
|
+
customer: z.ZodMiniObject<{
|
|
15
|
+
email: z.ZodMiniEmail;
|
|
16
|
+
name: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
17
|
+
phone: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
18
|
+
sms_consent: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
end_at: z.iso.ZodMiniISODateTime;
|
|
21
|
+
google_event_id: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
22
|
+
google_html_link: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
23
|
+
google_sync_state: z.ZodMiniEnum<{
|
|
24
|
+
failed: "failed";
|
|
25
|
+
queued: "queued";
|
|
26
|
+
synced: "synced";
|
|
27
|
+
uncertain: "uncertain";
|
|
28
|
+
drifted: "drifted";
|
|
29
|
+
}>;
|
|
30
|
+
ical_uid: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
31
|
+
id: z.ZodMiniString<string>;
|
|
32
|
+
manage_token: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
33
|
+
meet_url: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
34
|
+
organizer_email: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
35
|
+
start_at: z.iso.ZodMiniISODateTime;
|
|
36
|
+
status: z.ZodMiniEnum<{
|
|
37
|
+
pending: "pending";
|
|
38
|
+
confirmed: "confirmed";
|
|
39
|
+
cancelled: "cancelled";
|
|
40
|
+
no_show: "no_show";
|
|
41
|
+
}>;
|
|
42
|
+
time_zone: z.ZodMiniString<string>;
|
|
43
|
+
title: z.ZodMiniString<string>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
/**
|
|
46
|
+
* BusyInterval
|
|
47
|
+
*/
|
|
48
|
+
declare const zBusyInterval: z.ZodMiniObject<{
|
|
49
|
+
end_at: z.iso.ZodMiniISODateTime;
|
|
50
|
+
source: z.ZodMiniEnum<{
|
|
51
|
+
google: "google";
|
|
52
|
+
booking: "booking";
|
|
53
|
+
}>;
|
|
54
|
+
start_at: z.iso.ZodMiniISODateTime;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
/**
|
|
57
|
+
* BusyResponse
|
|
58
|
+
*
|
|
59
|
+
* The calendar's busy truth over a window — times only, never contents.
|
|
60
|
+
*/
|
|
61
|
+
declare const zBusyResponse: z.ZodMiniObject<{
|
|
62
|
+
busy: z.ZodMiniArray<z.ZodMiniObject<{
|
|
63
|
+
end_at: z.iso.ZodMiniISODateTime;
|
|
64
|
+
source: z.ZodMiniEnum<{
|
|
65
|
+
google: "google";
|
|
66
|
+
booking: "booking";
|
|
67
|
+
}>;
|
|
68
|
+
start_at: z.iso.ZodMiniISODateTime;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
calendar_key: z.ZodMiniString<string>;
|
|
71
|
+
generated_at: z.iso.ZodMiniISODateTime;
|
|
72
|
+
time_zone: z.ZodMiniString<string>;
|
|
73
|
+
window: z.ZodMiniObject<{
|
|
74
|
+
since: z.iso.ZodMiniISODateTime;
|
|
75
|
+
until: z.iso.ZodMiniISODateTime;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
/**
|
|
79
|
+
* CalendarSummary
|
|
80
|
+
*
|
|
81
|
+
* A calendar as a client website sees it.
|
|
82
|
+
*
|
|
83
|
+
* The trailing fields are populated only for a secret key. A public key ships
|
|
84
|
+
* in a browser bundle, and the grantee's email plus our granted scopes are a
|
|
85
|
+
* third party's identity and our integration posture — not the client site's
|
|
86
|
+
* business.
|
|
87
|
+
*/
|
|
88
|
+
declare const zCalendarSummary: z.ZodMiniObject<{
|
|
89
|
+
allow_overlaps: z.ZodMiniBoolean<boolean>;
|
|
90
|
+
calendar_key: z.ZodMiniString<string>;
|
|
91
|
+
connected_at: z.ZodMiniNullable<z.iso.ZodMiniISODateTime>;
|
|
92
|
+
google_account_email: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
93
|
+
granted_scopes: z.ZodMiniNullable<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
94
|
+
is_sandbox: z.ZodMiniBoolean<boolean>;
|
|
95
|
+
label: z.ZodMiniString<string>;
|
|
96
|
+
sandbox_key: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
97
|
+
status: z.ZodMiniEnum<{
|
|
98
|
+
disabled: "disabled";
|
|
99
|
+
pending_invite: "pending_invite";
|
|
100
|
+
awaiting_calendar_selection: "awaiting_calendar_selection";
|
|
101
|
+
connected: "connected";
|
|
102
|
+
needs_reconnect: "needs_reconnect";
|
|
103
|
+
revoked: "revoked";
|
|
104
|
+
}>;
|
|
105
|
+
time_zone: z.ZodMiniString<string>;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
|
|
4
108
|
/**
|
|
5
109
|
* Calendar wire schemas.
|
|
6
110
|
*
|
|
7
111
|
* The object shapes come from the backend's own spec — see
|
|
8
112
|
* `../generated/zod.gen.ts` and `packages/tracking-core/openapi-ts.config.ts`.
|
|
9
|
-
* This file adds only what JSON Schema cannot express: the end/duration
|
|
113
|
+
* This file adds only what JSON Schema cannot express: the start/date and end/duration XORs,
|
|
10
114
|
* the IANA timezone check, and defaults Pydantic omits from the spec because
|
|
11
115
|
* `default_factory` is not serialized (`attendees: []`, `reminders.overrides:
|
|
12
116
|
* []`) — composed onto the generated base, never duplicating its shape.
|
|
@@ -19,15 +123,17 @@ declare const MAX_REMINDER_OVERRIDES = 5;
|
|
|
19
123
|
declare const MAX_REMINDER_MINUTES = 40320;
|
|
20
124
|
declare const MAX_BOOKING_MINUTES = 1440;
|
|
21
125
|
declare const BOOKING_SOURCES: readonly ["website", "phone", "walk_in", "import", "operator"];
|
|
22
|
-
declare const BOOKING_STATUSES:
|
|
23
|
-
declare const GOOGLE_SYNC_STATES:
|
|
24
|
-
declare const CALENDAR_SYNC_STATUSES:
|
|
25
|
-
/**
|
|
26
|
-
|
|
126
|
+
declare const BOOKING_STATUSES: ("pending" | "confirmed" | "cancelled" | "no_show")[];
|
|
127
|
+
declare const GOOGLE_SYNC_STATES: ("failed" | "queued" | "synced" | "uncertain" | "drifted")[];
|
|
128
|
+
declare const CALENDAR_SYNC_STATUSES: ("disabled" | "pending_invite" | "awaiting_calendar_selection" | "connected" | "needs_reconnect" | "revoked")[];
|
|
129
|
+
/**
|
|
130
|
+
* Every failure code the calendar API can hand back, so a site can branch on it.
|
|
131
|
+
* `satisfies` pins each one to the backend's generated `ErrorCode` enum.
|
|
132
|
+
*/
|
|
133
|
+
declare const CALENDAR_ERROR_CODES: readonly ["slot_unavailable", "calendar_not_connected", "calendar_disconnected", "booking_not_found", "booking_not_cancellable", "booking_not_reschedulable", "manage_token_invalid", "rate_limited", "google_error"];
|
|
27
134
|
type CalendarErrorCode = (typeof CALENDAR_ERROR_CODES)[number];
|
|
28
135
|
type BookingStatus = (typeof BOOKING_STATUSES)[number];
|
|
29
136
|
type GoogleSyncState = (typeof GOOGLE_SYNC_STATES)[number];
|
|
30
|
-
type CalendarSyncStatus = (typeof CALENDAR_SYNC_STATUSES)[number];
|
|
31
137
|
type JsonScalar = string | number | boolean | null;
|
|
32
138
|
declare const bookingAttendeeSchema: z.ZodMiniObject<{
|
|
33
139
|
display_name: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
@@ -123,12 +229,13 @@ declare const bookingCreateSchema: z.ZodMiniObject<{
|
|
|
123
229
|
phone: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
124
230
|
sms_consent: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
|
|
125
231
|
}, z.core.$strict>;
|
|
232
|
+
date: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODate>>;
|
|
126
233
|
description: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
127
234
|
duration_minutes: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniInt>>;
|
|
128
235
|
end_at: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
|
|
129
236
|
idempotency_key: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
130
237
|
send_invites: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
|
|
131
|
-
start_at: z.iso.ZodMiniISODateTime
|
|
238
|
+
start_at: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
|
|
132
239
|
title: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
133
240
|
time_zone: z.ZodMiniString<string>;
|
|
134
241
|
location: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
@@ -205,48 +312,13 @@ type BookingCustomer = z.input<typeof bookingCustomerSchema>;
|
|
|
205
312
|
type BookingMetadata<TCustom extends Record<string, JsonScalar> = Record<string, JsonScalar>> = Omit<z.input<typeof bookingMetadataSchema>, "custom"> & {
|
|
206
313
|
custom?: TCustom | null;
|
|
207
314
|
};
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
google_account_email?: string | null;
|
|
216
|
-
granted_scopes?: string[] | null;
|
|
217
|
-
connected_at?: string | null;
|
|
218
|
-
}
|
|
219
|
-
interface BusyInterval {
|
|
220
|
-
start_at: string;
|
|
221
|
-
end_at: string;
|
|
222
|
-
source: "google" | "booking";
|
|
223
|
-
}
|
|
224
|
-
interface BusyResponse {
|
|
225
|
-
calendar_key: string;
|
|
226
|
-
time_zone: string;
|
|
227
|
-
window: {
|
|
228
|
-
since: string;
|
|
229
|
-
until: string;
|
|
230
|
-
};
|
|
231
|
-
busy: BusyInterval[];
|
|
232
|
-
generated_at: string;
|
|
233
|
-
}
|
|
234
|
-
interface Booking {
|
|
235
|
-
id: string;
|
|
236
|
-
calendar_key: string;
|
|
237
|
-
status: BookingStatus;
|
|
238
|
-
google_sync_state: GoogleSyncState;
|
|
239
|
-
start_at: string;
|
|
240
|
-
end_at: string;
|
|
241
|
-
time_zone: string;
|
|
242
|
-
appointment_type: string | null;
|
|
243
|
-
title: string;
|
|
244
|
-
customer: BookingCustomer;
|
|
245
|
-
google_html_link: string | null;
|
|
246
|
-
meet_url: string | null;
|
|
247
|
-
/** Returned only on create — the capability credential for manage links. */
|
|
248
|
-
manage_token?: string | null;
|
|
249
|
-
}
|
|
315
|
+
/** A calendar as the site sees it. `google_account_email` and friends are null for a public key. */
|
|
316
|
+
type CalendarSummary = z.output<typeof zCalendarSummary>;
|
|
317
|
+
type CalendarSyncStatus = CalendarSummary["status"];
|
|
318
|
+
type BusyInterval = z.output<typeof zBusyInterval>;
|
|
319
|
+
type BusyResponse = z.output<typeof zBusyResponse>;
|
|
320
|
+
/** A booking as the API returns it; field docs live on the backend's `BookingResponse`. */
|
|
321
|
+
type Booking = z.output<typeof zBookingResponse>;
|
|
250
322
|
|
|
251
323
|
type CalendarTransportConfig = ApiTransportConfig;
|
|
252
324
|
|
|
@@ -1,12 +1,116 @@
|
|
|
1
1
|
import * as z from 'zod/mini';
|
|
2
2
|
import { A as ApiTransportConfig } from './request-Doq36Rt0.mjs';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* BookingResponse
|
|
6
|
+
*
|
|
7
|
+
* A created booking. `manage_token` is present only on the create response.
|
|
8
|
+
*/
|
|
9
|
+
declare const zBookingResponse: z.ZodMiniObject<{
|
|
10
|
+
all_day: z.ZodMiniBoolean<boolean>;
|
|
11
|
+
appointment_type: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
12
|
+
calendar_key: z.ZodMiniString<string>;
|
|
13
|
+
created_at: z.iso.ZodMiniISODateTime;
|
|
14
|
+
customer: z.ZodMiniObject<{
|
|
15
|
+
email: z.ZodMiniEmail;
|
|
16
|
+
name: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
17
|
+
phone: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
18
|
+
sms_consent: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
end_at: z.iso.ZodMiniISODateTime;
|
|
21
|
+
google_event_id: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
22
|
+
google_html_link: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
23
|
+
google_sync_state: z.ZodMiniEnum<{
|
|
24
|
+
failed: "failed";
|
|
25
|
+
queued: "queued";
|
|
26
|
+
synced: "synced";
|
|
27
|
+
uncertain: "uncertain";
|
|
28
|
+
drifted: "drifted";
|
|
29
|
+
}>;
|
|
30
|
+
ical_uid: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
31
|
+
id: z.ZodMiniString<string>;
|
|
32
|
+
manage_token: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
33
|
+
meet_url: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
34
|
+
organizer_email: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
35
|
+
start_at: z.iso.ZodMiniISODateTime;
|
|
36
|
+
status: z.ZodMiniEnum<{
|
|
37
|
+
pending: "pending";
|
|
38
|
+
confirmed: "confirmed";
|
|
39
|
+
cancelled: "cancelled";
|
|
40
|
+
no_show: "no_show";
|
|
41
|
+
}>;
|
|
42
|
+
time_zone: z.ZodMiniString<string>;
|
|
43
|
+
title: z.ZodMiniString<string>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
/**
|
|
46
|
+
* BusyInterval
|
|
47
|
+
*/
|
|
48
|
+
declare const zBusyInterval: z.ZodMiniObject<{
|
|
49
|
+
end_at: z.iso.ZodMiniISODateTime;
|
|
50
|
+
source: z.ZodMiniEnum<{
|
|
51
|
+
google: "google";
|
|
52
|
+
booking: "booking";
|
|
53
|
+
}>;
|
|
54
|
+
start_at: z.iso.ZodMiniISODateTime;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
/**
|
|
57
|
+
* BusyResponse
|
|
58
|
+
*
|
|
59
|
+
* The calendar's busy truth over a window — times only, never contents.
|
|
60
|
+
*/
|
|
61
|
+
declare const zBusyResponse: z.ZodMiniObject<{
|
|
62
|
+
busy: z.ZodMiniArray<z.ZodMiniObject<{
|
|
63
|
+
end_at: z.iso.ZodMiniISODateTime;
|
|
64
|
+
source: z.ZodMiniEnum<{
|
|
65
|
+
google: "google";
|
|
66
|
+
booking: "booking";
|
|
67
|
+
}>;
|
|
68
|
+
start_at: z.iso.ZodMiniISODateTime;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
calendar_key: z.ZodMiniString<string>;
|
|
71
|
+
generated_at: z.iso.ZodMiniISODateTime;
|
|
72
|
+
time_zone: z.ZodMiniString<string>;
|
|
73
|
+
window: z.ZodMiniObject<{
|
|
74
|
+
since: z.iso.ZodMiniISODateTime;
|
|
75
|
+
until: z.iso.ZodMiniISODateTime;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
/**
|
|
79
|
+
* CalendarSummary
|
|
80
|
+
*
|
|
81
|
+
* A calendar as a client website sees it.
|
|
82
|
+
*
|
|
83
|
+
* The trailing fields are populated only for a secret key. A public key ships
|
|
84
|
+
* in a browser bundle, and the grantee's email plus our granted scopes are a
|
|
85
|
+
* third party's identity and our integration posture — not the client site's
|
|
86
|
+
* business.
|
|
87
|
+
*/
|
|
88
|
+
declare const zCalendarSummary: z.ZodMiniObject<{
|
|
89
|
+
allow_overlaps: z.ZodMiniBoolean<boolean>;
|
|
90
|
+
calendar_key: z.ZodMiniString<string>;
|
|
91
|
+
connected_at: z.ZodMiniNullable<z.iso.ZodMiniISODateTime>;
|
|
92
|
+
google_account_email: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
93
|
+
granted_scopes: z.ZodMiniNullable<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
94
|
+
is_sandbox: z.ZodMiniBoolean<boolean>;
|
|
95
|
+
label: z.ZodMiniString<string>;
|
|
96
|
+
sandbox_key: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
97
|
+
status: z.ZodMiniEnum<{
|
|
98
|
+
disabled: "disabled";
|
|
99
|
+
pending_invite: "pending_invite";
|
|
100
|
+
awaiting_calendar_selection: "awaiting_calendar_selection";
|
|
101
|
+
connected: "connected";
|
|
102
|
+
needs_reconnect: "needs_reconnect";
|
|
103
|
+
revoked: "revoked";
|
|
104
|
+
}>;
|
|
105
|
+
time_zone: z.ZodMiniString<string>;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
|
|
4
108
|
/**
|
|
5
109
|
* Calendar wire schemas.
|
|
6
110
|
*
|
|
7
111
|
* The object shapes come from the backend's own spec — see
|
|
8
112
|
* `../generated/zod.gen.ts` and `packages/tracking-core/openapi-ts.config.ts`.
|
|
9
|
-
* This file adds only what JSON Schema cannot express: the end/duration
|
|
113
|
+
* This file adds only what JSON Schema cannot express: the start/date and end/duration XORs,
|
|
10
114
|
* the IANA timezone check, and defaults Pydantic omits from the spec because
|
|
11
115
|
* `default_factory` is not serialized (`attendees: []`, `reminders.overrides:
|
|
12
116
|
* []`) — composed onto the generated base, never duplicating its shape.
|
|
@@ -19,15 +123,17 @@ declare const MAX_REMINDER_OVERRIDES = 5;
|
|
|
19
123
|
declare const MAX_REMINDER_MINUTES = 40320;
|
|
20
124
|
declare const MAX_BOOKING_MINUTES = 1440;
|
|
21
125
|
declare const BOOKING_SOURCES: readonly ["website", "phone", "walk_in", "import", "operator"];
|
|
22
|
-
declare const BOOKING_STATUSES:
|
|
23
|
-
declare const GOOGLE_SYNC_STATES:
|
|
24
|
-
declare const CALENDAR_SYNC_STATUSES:
|
|
25
|
-
/**
|
|
26
|
-
|
|
126
|
+
declare const BOOKING_STATUSES: ("pending" | "confirmed" | "cancelled" | "no_show")[];
|
|
127
|
+
declare const GOOGLE_SYNC_STATES: ("failed" | "queued" | "synced" | "uncertain" | "drifted")[];
|
|
128
|
+
declare const CALENDAR_SYNC_STATUSES: ("disabled" | "pending_invite" | "awaiting_calendar_selection" | "connected" | "needs_reconnect" | "revoked")[];
|
|
129
|
+
/**
|
|
130
|
+
* Every failure code the calendar API can hand back, so a site can branch on it.
|
|
131
|
+
* `satisfies` pins each one to the backend's generated `ErrorCode` enum.
|
|
132
|
+
*/
|
|
133
|
+
declare const CALENDAR_ERROR_CODES: readonly ["slot_unavailable", "calendar_not_connected", "calendar_disconnected", "booking_not_found", "booking_not_cancellable", "booking_not_reschedulable", "manage_token_invalid", "rate_limited", "google_error"];
|
|
27
134
|
type CalendarErrorCode = (typeof CALENDAR_ERROR_CODES)[number];
|
|
28
135
|
type BookingStatus = (typeof BOOKING_STATUSES)[number];
|
|
29
136
|
type GoogleSyncState = (typeof GOOGLE_SYNC_STATES)[number];
|
|
30
|
-
type CalendarSyncStatus = (typeof CALENDAR_SYNC_STATUSES)[number];
|
|
31
137
|
type JsonScalar = string | number | boolean | null;
|
|
32
138
|
declare const bookingAttendeeSchema: z.ZodMiniObject<{
|
|
33
139
|
display_name: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
@@ -123,12 +229,13 @@ declare const bookingCreateSchema: z.ZodMiniObject<{
|
|
|
123
229
|
phone: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
124
230
|
sms_consent: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
|
|
125
231
|
}, z.core.$strict>;
|
|
232
|
+
date: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODate>>;
|
|
126
233
|
description: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
127
234
|
duration_minutes: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniInt>>;
|
|
128
235
|
end_at: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
|
|
129
236
|
idempotency_key: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
130
237
|
send_invites: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
|
|
131
|
-
start_at: z.iso.ZodMiniISODateTime
|
|
238
|
+
start_at: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
|
|
132
239
|
title: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
133
240
|
time_zone: z.ZodMiniString<string>;
|
|
134
241
|
location: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
@@ -205,48 +312,13 @@ type BookingCustomer = z.input<typeof bookingCustomerSchema>;
|
|
|
205
312
|
type BookingMetadata<TCustom extends Record<string, JsonScalar> = Record<string, JsonScalar>> = Omit<z.input<typeof bookingMetadataSchema>, "custom"> & {
|
|
206
313
|
custom?: TCustom | null;
|
|
207
314
|
};
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
google_account_email?: string | null;
|
|
216
|
-
granted_scopes?: string[] | null;
|
|
217
|
-
connected_at?: string | null;
|
|
218
|
-
}
|
|
219
|
-
interface BusyInterval {
|
|
220
|
-
start_at: string;
|
|
221
|
-
end_at: string;
|
|
222
|
-
source: "google" | "booking";
|
|
223
|
-
}
|
|
224
|
-
interface BusyResponse {
|
|
225
|
-
calendar_key: string;
|
|
226
|
-
time_zone: string;
|
|
227
|
-
window: {
|
|
228
|
-
since: string;
|
|
229
|
-
until: string;
|
|
230
|
-
};
|
|
231
|
-
busy: BusyInterval[];
|
|
232
|
-
generated_at: string;
|
|
233
|
-
}
|
|
234
|
-
interface Booking {
|
|
235
|
-
id: string;
|
|
236
|
-
calendar_key: string;
|
|
237
|
-
status: BookingStatus;
|
|
238
|
-
google_sync_state: GoogleSyncState;
|
|
239
|
-
start_at: string;
|
|
240
|
-
end_at: string;
|
|
241
|
-
time_zone: string;
|
|
242
|
-
appointment_type: string | null;
|
|
243
|
-
title: string;
|
|
244
|
-
customer: BookingCustomer;
|
|
245
|
-
google_html_link: string | null;
|
|
246
|
-
meet_url: string | null;
|
|
247
|
-
/** Returned only on create — the capability credential for manage links. */
|
|
248
|
-
manage_token?: string | null;
|
|
249
|
-
}
|
|
315
|
+
/** A calendar as the site sees it. `google_account_email` and friends are null for a public key. */
|
|
316
|
+
type CalendarSummary = z.output<typeof zCalendarSummary>;
|
|
317
|
+
type CalendarSyncStatus = CalendarSummary["status"];
|
|
318
|
+
type BusyInterval = z.output<typeof zBusyInterval>;
|
|
319
|
+
type BusyResponse = z.output<typeof zBusyResponse>;
|
|
320
|
+
/** A booking as the API returns it; field docs live on the backend's `BookingResponse`. */
|
|
321
|
+
type Booking = z.output<typeof zBookingResponse>;
|
|
250
322
|
|
|
251
323
|
type CalendarTransportConfig = ApiTransportConfig;
|
|
252
324
|
|