@aranova/tracking-next 0.27.0 → 1.1.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.
Files changed (73) hide show
  1. package/dist/blog-server.d.mts +2 -1
  2. package/dist/blog-server.d.ts +2 -1
  3. package/dist/blog-server.js +121 -98
  4. package/dist/blog-server.js.map +1 -1
  5. package/dist/blog-server.mjs +86 -63
  6. package/dist/blog-server.mjs.map +1 -1
  7. package/dist/blog.d.mts +651 -1755
  8. package/dist/blog.d.ts +651 -1755
  9. package/dist/blog.js +121 -98
  10. package/dist/blog.js.map +1 -1
  11. package/dist/blog.mjs +86 -63
  12. package/dist/blog.mjs.map +1 -1
  13. package/dist/calendar-server.d.mts +2 -2
  14. package/dist/calendar-server.d.ts +2 -2
  15. package/dist/calendar-server.js +0 -26
  16. package/dist/calendar-server.js.map +1 -1
  17. package/dist/calendar-server.mjs +0 -26
  18. package/dist/calendar-server.mjs.map +1 -1
  19. package/dist/calendar.d.mts +3 -3
  20. package/dist/calendar.d.ts +3 -3
  21. package/dist/calendar.js +227 -126
  22. package/dist/calendar.js.map +1 -1
  23. package/dist/calendar.mjs +216 -125
  24. package/dist/calendar.mjs.map +1 -1
  25. package/dist/client.d.mts +11 -4
  26. package/dist/client.d.ts +11 -4
  27. package/dist/client.js +611 -347
  28. package/dist/client.js.map +1 -1
  29. package/dist/client.mjs +611 -347
  30. package/dist/client.mjs.map +1 -1
  31. package/dist/index.d.mts +9 -8
  32. package/dist/index.d.ts +9 -8
  33. package/dist/index.js +550 -487
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +539 -487
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/ingest-typed-MBuMe9Pn.d.ts +883 -0
  38. package/dist/ingest-typed-UA13xTfI.d.mts +883 -0
  39. package/dist/middleware.js +0 -467
  40. package/dist/middleware.js.map +1 -1
  41. package/dist/middleware.mjs +0 -467
  42. package/dist/middleware.mjs.map +1 -1
  43. package/dist/{phone-utils-BVzSNBf1.d.mts → phone-utils-C0ds6cqZ.d.mts} +24 -78
  44. package/dist/{phone-utils-BVzSNBf1.d.ts → phone-utils-C0ds6cqZ.d.ts} +24 -78
  45. package/dist/phone.d.mts +2 -2
  46. package/dist/phone.d.ts +2 -2
  47. package/dist/phone.js +0 -464
  48. package/dist/phone.js.map +1 -1
  49. package/dist/phone.mjs +0 -464
  50. package/dist/phone.mjs.map +1 -1
  51. package/dist/{sales-IGC2tq4J.d.ts → sales-DQC815f3.d.ts} +90 -329
  52. package/dist/{sales-DQGzXSgL.d.mts → sales-w1reW_Y3.d.mts} +90 -329
  53. package/dist/sales.d.mts +3 -3
  54. package/dist/sales.d.ts +3 -3
  55. package/dist/sales.js +270 -127
  56. package/dist/sales.js.map +1 -1
  57. package/dist/sales.mjs +259 -127
  58. package/dist/sales.mjs.map +1 -1
  59. package/dist/server.d.mts +2 -2
  60. package/dist/server.d.ts +2 -2
  61. package/dist/server.js +0 -467
  62. package/dist/server.js.map +1 -1
  63. package/dist/server.mjs +0 -467
  64. package/dist/server.mjs.map +1 -1
  65. package/dist/{tracking-config-runtime-D7prdTE1.d.mts → tracking-config-runtime-C6H7ofmo.d.mts} +6 -0
  66. package/dist/{tracking-config-runtime-D7prdTE1.d.ts → tracking-config-runtime-C6H7ofmo.d.ts} +6 -0
  67. package/dist/transport-CDmGOiCq.d.ts +253 -0
  68. package/dist/transport-I_cMSFQ6.d.mts +253 -0
  69. package/package.json +2 -2
  70. package/dist/ingest-typed-BxLFlZ7N.d.mts +0 -1371
  71. package/dist/ingest-typed-ByQVRMvP.d.ts +0 -1371
  72. package/dist/transport-C-_rFSR4.d.ts +0 -721
  73. package/dist/transport-yUF5Wize.d.mts +0 -721
@@ -0,0 +1,253 @@
1
+ import * as z from 'zod/mini';
2
+ import { A as ApiTransportConfig } from './request-Doq36Rt0.mjs';
3
+
4
+ /**
5
+ * Calendar wire schemas.
6
+ *
7
+ * The object shapes come from the backend's own spec — see
8
+ * `../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 XOR,
10
+ * the IANA timezone check, and defaults Pydantic omits from the spec because
11
+ * `default_factory` is not serialized (`attendees: []`, `reminders.overrides:
12
+ * []`) — composed onto the generated base, never duplicating its shape.
13
+ */
14
+ /** Bumped when the durable `metadata` payload changes shape. */
15
+ declare const CALENDAR_METADATA_SCHEMA_VERSION = 1;
16
+ declare const MAX_ATTENDEES = 20;
17
+ declare const MAX_REMINDER_OVERRIDES = 5;
18
+ /** Google's ceiling for `reminders.overrides[].minutes`: four weeks. */
19
+ declare const MAX_REMINDER_MINUTES = 40320;
20
+ declare const MAX_BOOKING_MINUTES = 1440;
21
+ declare const BOOKING_SOURCES: readonly ["website", "phone", "walk_in", "import", "operator"];
22
+ declare const BOOKING_STATUSES: readonly ["pending", "confirmed", "cancelled", "no_show"];
23
+ declare const GOOGLE_SYNC_STATES: readonly ["queued", "synced", "uncertain", "failed", "drifted"];
24
+ declare const CALENDAR_SYNC_STATUSES: readonly ["pending_invite", "awaiting_calendar_selection", "connected", "needs_reconnect", "revoked", "disabled"];
25
+ /** Every failure the calendar API can hand back, so a site can branch on it. */
26
+ declare const CALENDAR_ERROR_CODES: readonly ["slot_unavailable", "calendar_not_connected", "calendar_disconnected", "booking_not_found", "outside_booking_window", "rate_limited", "google_error"];
27
+ type CalendarErrorCode = (typeof CALENDAR_ERROR_CODES)[number];
28
+ type BookingStatus = (typeof BOOKING_STATUSES)[number];
29
+ type GoogleSyncState = (typeof GOOGLE_SYNC_STATES)[number];
30
+ type CalendarSyncStatus = (typeof CALENDAR_SYNC_STATUSES)[number];
31
+ type JsonScalar = string | number | boolean | null;
32
+ declare const bookingAttendeeSchema: z.ZodMiniObject<{
33
+ display_name: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
34
+ email: z.ZodMiniEmail;
35
+ optional: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
36
+ }, z.core.$strict>;
37
+ declare const bookingReminderSchema: z.ZodMiniObject<{
38
+ method: z.ZodMiniEnum<{
39
+ email: "email";
40
+ popup: "popup";
41
+ }>;
42
+ minutes_before: z.ZodMiniInt;
43
+ }, z.core.$strict>;
44
+ declare const bookingCustomerSchema: z.ZodMiniObject<{
45
+ email: z.ZodMiniEmail;
46
+ name: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
47
+ phone: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
48
+ sms_consent: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
49
+ }, z.core.$strict>;
50
+ declare const bookingMetadataSchema: z.ZodMiniObject<{
51
+ fbclid: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
52
+ gclid: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
53
+ landing_page: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
54
+ notes: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
55
+ referrer: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
56
+ schema_version: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniInt>>;
57
+ service: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
58
+ session_id: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
59
+ source: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniEnum<{
60
+ phone: "phone";
61
+ website: "website";
62
+ walk_in: "walk_in";
63
+ import: "import";
64
+ operator: "operator";
65
+ }>>>;
66
+ utm_campaign: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
67
+ utm_content: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
68
+ utm_medium: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
69
+ utm_source: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
70
+ utm_term: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
71
+ visitor_id: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
72
+ custom: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniInt, z.ZodMiniNumber<number>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull]>>>>;
73
+ }, z.core.$strict>;
74
+ declare const bookingLocationSchema: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
75
+ kind: z.ZodMiniLiteral<"google_meet">;
76
+ }, z.core.$strict>, z.ZodMiniObject<{
77
+ address: z.ZodMiniString<string>;
78
+ kind: z.ZodMiniLiteral<"physical">;
79
+ }, z.core.$strict>, z.ZodMiniObject<{
80
+ kind: z.ZodMiniLiteral<"phone">;
81
+ phone: z.ZodMiniString<string>;
82
+ }, z.core.$strict>, z.ZodMiniObject<{
83
+ kind: z.ZodMiniLiteral<"custom">;
84
+ text: z.ZodMiniString<string>;
85
+ }, z.core.$strict>]>;
86
+ /**
87
+ * The nullable form, flattened.
88
+ *
89
+ * `bookingLocationSchema.nullable()` would nest one `anyOf` inside another,
90
+ * while Pydantic's `BookingLocation | None` flattens to a single list — the
91
+ * drift snapshot compares structure, so both sides emit the flat shape.
92
+ */
93
+ declare const bookingLocationNullableSchema: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
94
+ kind: z.ZodMiniLiteral<"google_meet">;
95
+ }, z.core.$strict>, z.ZodMiniObject<{
96
+ address: z.ZodMiniString<string>;
97
+ kind: z.ZodMiniLiteral<"physical">;
98
+ }, z.core.$strict>, z.ZodMiniObject<{
99
+ kind: z.ZodMiniLiteral<"phone">;
100
+ phone: z.ZodMiniString<string>;
101
+ }, z.core.$strict>, z.ZodMiniObject<{
102
+ kind: z.ZodMiniLiteral<"custom">;
103
+ text: z.ZodMiniString<string>;
104
+ }, z.core.$strict>, z.ZodMiniNull]>;
105
+ declare const bookingRemindersSchema: z.ZodMiniObject<{
106
+ use_calendar_defaults: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
107
+ overrides: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
108
+ method: z.ZodMiniEnum<{
109
+ email: "email";
110
+ popup: "popup";
111
+ }>;
112
+ minutes_before: z.ZodMiniInt;
113
+ }, z.core.$strict>>>;
114
+ }, z.core.$strict>;
115
+ declare const bookingCreateSchema: z.ZodMiniObject<{
116
+ appointment_type: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
117
+ buffer_after_minutes: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniInt>>;
118
+ buffer_before_minutes: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniInt>>;
119
+ calendar_key: z.ZodMiniString<string>;
120
+ customer: z.ZodMiniObject<{
121
+ email: z.ZodMiniEmail;
122
+ name: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
123
+ phone: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
124
+ sms_consent: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
125
+ }, z.core.$strict>;
126
+ description: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
127
+ duration_minutes: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniInt>>;
128
+ end_at: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
129
+ idempotency_key: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
130
+ send_invites: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
131
+ start_at: z.iso.ZodMiniISODateTime;
132
+ title: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
133
+ time_zone: z.ZodMiniString<string>;
134
+ location: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
135
+ kind: z.ZodMiniLiteral<"google_meet">;
136
+ }, z.core.$strict>, z.ZodMiniObject<{
137
+ address: z.ZodMiniString<string>;
138
+ kind: z.ZodMiniLiteral<"physical">;
139
+ }, z.core.$strict>, z.ZodMiniObject<{
140
+ kind: z.ZodMiniLiteral<"phone">;
141
+ phone: z.ZodMiniString<string>;
142
+ }, z.core.$strict>, z.ZodMiniObject<{
143
+ kind: z.ZodMiniLiteral<"custom">;
144
+ text: z.ZodMiniString<string>;
145
+ }, z.core.$strict>, z.ZodMiniNull]>>;
146
+ attendees: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
147
+ display_name: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
148
+ email: z.ZodMiniEmail;
149
+ optional: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
150
+ }, z.core.$strict>>>;
151
+ reminders: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
152
+ use_calendar_defaults: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
153
+ overrides: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
154
+ method: z.ZodMiniEnum<{
155
+ email: "email";
156
+ popup: "popup";
157
+ }>;
158
+ minutes_before: z.ZodMiniInt;
159
+ }, z.core.$strict>>>;
160
+ }, z.core.$strict>>>;
161
+ metadata: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
162
+ fbclid: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
163
+ gclid: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
164
+ landing_page: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
165
+ notes: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
166
+ referrer: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
167
+ schema_version: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniInt>>;
168
+ service: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
169
+ session_id: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
170
+ source: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniEnum<{
171
+ phone: "phone";
172
+ website: "website";
173
+ walk_in: "walk_in";
174
+ import: "import";
175
+ operator: "operator";
176
+ }>>>;
177
+ utm_campaign: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
178
+ utm_content: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
179
+ utm_medium: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
180
+ utm_source: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
181
+ utm_term: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
182
+ visitor_id: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
183
+ custom: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniInt, z.ZodMiniNumber<number>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull]>>>>;
184
+ }, z.core.$strict>>>;
185
+ }, z.core.$strict>;
186
+ declare const bookingRescheduleSchema: z.ZodMiniObject<{
187
+ duration_minutes: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniInt>>;
188
+ end_at: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
189
+ notify_attendees: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
190
+ reason: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
191
+ start_at: z.iso.ZodMiniISODateTime;
192
+ time_zone: z.ZodMiniString<string>;
193
+ }, z.core.$strict>;
194
+ declare const bookingCancelSchema: z.ZodMiniObject<{
195
+ notify_attendees: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
196
+ reason: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
197
+ }, z.core.$strict>;
198
+ type BookingCreateInput = z.input<typeof bookingCreateSchema>;
199
+ type BookingRescheduleInput = z.input<typeof bookingRescheduleSchema>;
200
+ type BookingCancelInput = z.input<typeof bookingCancelSchema>;
201
+ type BookingAttendee = z.input<typeof bookingAttendeeSchema>;
202
+ type BookingReminders = z.input<typeof bookingRemindersSchema>;
203
+ type BookingLocation = z.input<typeof bookingLocationSchema>;
204
+ type BookingCustomer = z.input<typeof bookingCustomerSchema>;
205
+ type BookingMetadata<TCustom extends Record<string, JsonScalar> = Record<string, JsonScalar>> = Omit<z.input<typeof bookingMetadataSchema>, "custom"> & {
206
+ custom?: TCustom | null;
207
+ };
208
+ interface CalendarSummary {
209
+ calendar_key: string;
210
+ label: string;
211
+ time_zone: string;
212
+ status: CalendarSyncStatus;
213
+ /** Secret-key only. A public key gets `null`: whose Google account is behind
214
+ * a calendar is a third party's identity, not the client site's business. */
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
+ }
250
+
251
+ type CalendarTransportConfig = ApiTransportConfig;
252
+
253
+ export { bookingCustomerSchema as A, type BookingCreateInput as B, type CalendarTransportConfig as C, bookingLocationNullableSchema as D, bookingLocationSchema as E, bookingMetadataSchema as F, GOOGLE_SYNC_STATES as G, bookingReminderSchema as H, bookingRemindersSchema as I, type JsonScalar as J, bookingRescheduleSchema as K, MAX_ATTENDEES as M, type Booking as a, type BookingRescheduleInput as b, type BookingCancelInput as c, type BusyInterval as d, BOOKING_SOURCES as e, BOOKING_STATUSES as f, type BookingAttendee as g, type BookingCustomer as h, type BookingLocation as i, type BookingMetadata as j, type BookingReminders as k, type BookingStatus as l, type BusyResponse as m, CALENDAR_ERROR_CODES as n, CALENDAR_METADATA_SCHEMA_VERSION as o, CALENDAR_SYNC_STATUSES as p, type CalendarErrorCode as q, type CalendarSummary as r, type CalendarSyncStatus as s, type GoogleSyncState as t, MAX_BOOKING_MINUTES as u, MAX_REMINDER_MINUTES as v, MAX_REMINDER_OVERRIDES as w, bookingAttendeeSchema as x, bookingCancelSchema as y, bookingCreateSchema as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aranova/tracking-next",
3
- "version": "0.27.0",
3
+ "version": "1.1.0",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "description": "Next.js tracking utilities for Aranova client sites",
@@ -158,7 +158,7 @@
158
158
  "remark-parse": "^11.0.0",
159
159
  "server-only": "^0.0.1",
160
160
  "unified": "^11.0.5",
161
- "zod": "^3.24.1"
161
+ "zod": "^4.6.2"
162
162
  },
163
163
  "devDependencies": {
164
164
  "@types/react": "^19.2.2",