@aranova/tracking-next 0.27.0 → 1.0.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 (71) 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 +4 -3
  26. package/dist/client.d.ts +4 -3
  27. package/dist/client.js +185 -277
  28. package/dist/client.js.map +1 -1
  29. package/dist/client.mjs +157 -249
  30. package/dist/client.mjs.map +1 -1
  31. package/dist/index.d.mts +8 -7
  32. package/dist/index.d.ts +8 -7
  33. package/dist/index.js +482 -484
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +471 -484
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/ingest-typed-BdKmlouW.d.ts +791 -0
  38. package/dist/ingest-typed-Bo7WPmpU.d.mts +791 -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-CubQif9Z.d.mts} +18 -78
  44. package/dist/{phone-utils-BVzSNBf1.d.ts → phone-utils-CubQif9Z.d.ts} +18 -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-DQGzXSgL.d.mts → sales-D7KstKA-.d.mts} +89 -328
  52. package/dist/{sales-IGC2tq4J.d.ts → sales-DG150g3o.d.ts} +89 -328
  53. package/dist/sales.d.mts +2 -2
  54. package/dist/sales.d.ts +2 -2
  55. package/dist/sales.js +265 -127
  56. package/dist/sales.js.map +1 -1
  57. package/dist/sales.mjs +254 -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/transport-CDmGOiCq.d.ts +253 -0
  66. package/dist/transport-I_cMSFQ6.d.mts +253 -0
  67. package/package.json +2 -2
  68. package/dist/ingest-typed-BxLFlZ7N.d.mts +0 -1371
  69. package/dist/ingest-typed-ByQVRMvP.d.ts +0 -1371
  70. package/dist/transport-C-_rFSR4.d.ts +0 -721
  71. package/dist/transport-yUF5Wize.d.mts +0 -721
@@ -3,7 +3,8 @@ export { BASE_BLOG_THEME, BLOG_BREAKPOINTS, BLOG_BREAKPOINT_MIN_WIDTHS_PX, BLOG_
3
3
  import { B as BlogHeading } from './toc-C_OvH3ES.mjs';
4
4
  export { e as estimateReadingTime, a as extractBlogHeadings } from './toc-C_OvH3ES.mjs';
5
5
  import { ComponentPropsWithoutRef, ReactNode } from 'react';
6
- import 'zod';
6
+ import 'zod/mini';
7
+ import 'zod/v4/core';
7
8
 
8
9
  /**
9
10
  * The CLOSED component interface the MDX renderer accepts. Generated MDX may
@@ -3,7 +3,8 @@ export { BASE_BLOG_THEME, BLOG_BREAKPOINTS, BLOG_BREAKPOINT_MIN_WIDTHS_PX, BLOG_
3
3
  import { B as BlogHeading } from './toc-C_OvH3ES.js';
4
4
  export { e as estimateReadingTime, a as extractBlogHeadings } from './toc-C_OvH3ES.js';
5
5
  import { ComponentPropsWithoutRef, ReactNode } from 'react';
6
- import 'zod';
6
+ import 'zod/mini';
7
+ import 'zod/v4/core';
7
8
 
8
9
  /**
9
10
  * The CLOSED component interface the MDX renderer accepts. Generated MDX may
@@ -91,18 +91,15 @@ function registerCapability(capability) {
91
91
  registered.add(capability);
92
92
  }
93
93
 
94
- // ../tracking-core/src/phone.ts
95
- var import_libphonenumber_js = require("libphonenumber-js");
96
-
97
94
  // ../tracking-core/src/resources/tracking-config-runtime.ts
98
95
  var DEFAULT_CDN_BASE_URL = "https://demos.aranova.io";
99
96
  var RETRY_MAX_MS = 5 * 6e4;
100
97
 
101
98
  // ../tracking-core/src/resources/blog/schema.ts
102
- var import_zod2 = require("zod");
99
+ var z2 = __toESM(require("zod/mini"));
103
100
 
104
101
  // ../tracking-core/src/resources/blog/theme.ts
105
- var import_zod = require("zod");
102
+ var z = __toESM(require("zod/mini"));
106
103
  var BLOG_BREAKPOINTS = ["sm", "md", "lg", "xl", "2xl", "3xl"];
107
104
  var BLOG_BREAKPOINT_MIN_WIDTHS_PX = {
108
105
  sm: 640,
@@ -121,40 +118,45 @@ var LENGTH = /^-?\d+(\.\d+)?(px|rem|em|%|ch|vw)$/;
121
118
  var LINE_HEIGHT = /^-?\d+(\.\d+)?(px|rem|em|%|ch|vw)?$/;
122
119
  var FONT_FAMILY_TOKEN = /^['"]?[a-zA-Z0-9 -]+['"]?$/;
123
120
  var FONT_FAMILY_VAR_TOKEN = /^var\(--[a-zA-Z0-9-]+\)$/;
124
- var colorValueSchema = import_zod.z.string().refine((v) => HEX_COLOR.test(v) || FUNCTIONAL_COLOR.test(v), {
125
- message: "must be a #hex or rgb()/rgba()/hsl()/hsla()/oklch() color"
126
- });
127
- var lengthValueSchema = import_zod.z.string().regex(LENGTH, {
128
- message: "must be a CSS length (px|rem|em|%|ch|vw)"
129
- });
130
- var lineHeightValueSchema = import_zod.z.string().regex(LINE_HEIGHT, {
131
- message: "must be a CSS length or unitless line-height"
132
- });
133
- var fontWeightSchema = import_zod.z.number().int().min(100).max(1e3);
134
- var alignValueSchema = import_zod.z.enum(["left", "center", "right"]);
135
- var fontFamilySchema = import_zod.z.string().refine(
136
- (v) => {
137
- const tokens = v.split(",").map((t) => t.trim());
138
- return tokens.length > 0 && tokens.every((t) => FONT_FAMILY_TOKEN.test(t) || FONT_FAMILY_VAR_TOKEN.test(t));
139
- },
140
- { message: "must be a comma-separated list of font-family or var(--custom-property) tokens" }
121
+ var colorValueSchema = z.string().check(
122
+ z.refine((v) => HEX_COLOR.test(v) || FUNCTIONAL_COLOR.test(v), {
123
+ error: "must be a #hex or rgb()/rgba()/hsl()/hsla()/oklch() color"
124
+ })
125
+ );
126
+ var lengthValueSchema = z.string().check(z.regex(LENGTH, { error: "must be a CSS length (px|rem|em|%|ch|vw)" }));
127
+ var lineHeightValueSchema = z.string().check(z.regex(LINE_HEIGHT, { error: "must be a CSS length or unitless line-height" }));
128
+ var fontWeightSchema = z.int().check(z.gte(100), z.lte(1e3));
129
+ var alignValueSchema = z.enum(["left", "center", "right"]);
130
+ var fontFamilySchema = z.string().check(
131
+ z.refine(
132
+ (v) => {
133
+ const tokens = v.split(",").map((t) => t.trim());
134
+ return tokens.length > 0 && tokens.every((t) => FONT_FAMILY_TOKEN.test(t) || FONT_FAMILY_VAR_TOKEN.test(t));
135
+ },
136
+ { error: "must be a comma-separated list of font-family or var(--custom-property) tokens" }
137
+ )
141
138
  );
142
139
  function nullishField(schema) {
143
- return schema.nullish().transform((v) => v ?? void 0);
140
+ return z.optional(
141
+ z.pipe(
142
+ z.nullish(schema),
143
+ z.transform((v) => v ?? void 0)
144
+ )
145
+ );
144
146
  }
145
147
  function breakpointMapSchema(valueSchema) {
146
- return import_zod.z.object({
148
+ return z.object({
147
149
  base: valueSchema,
148
- sm: nullishField(valueSchema).catch(void 0),
149
- md: nullishField(valueSchema).catch(void 0),
150
- lg: nullishField(valueSchema).catch(void 0),
151
- xl: nullishField(valueSchema).catch(void 0),
152
- "2xl": nullishField(valueSchema).catch(void 0),
153
- "3xl": nullishField(valueSchema).catch(void 0)
150
+ sm: z.catch(nullishField(valueSchema), void 0),
151
+ md: z.catch(nullishField(valueSchema), void 0),
152
+ lg: z.catch(nullishField(valueSchema), void 0),
153
+ xl: z.catch(nullishField(valueSchema), void 0),
154
+ "2xl": z.catch(nullishField(valueSchema), void 0),
155
+ "3xl": z.catch(nullishField(valueSchema), void 0)
154
156
  });
155
157
  }
156
158
  function responsive(valueSchema) {
157
- return import_zod.z.union([valueSchema, breakpointMapSchema(valueSchema)]);
159
+ return z.union([valueSchema, breakpointMapSchema(valueSchema)]);
158
160
  }
159
161
  var blogThemeColorsShape = {
160
162
  background: colorValueSchema,
@@ -168,14 +170,14 @@ var blogThemeColorsShape = {
168
170
  code_background: colorValueSchema,
169
171
  heading: colorValueSchema
170
172
  };
171
- var blogThemeColorsSchema = import_zod.z.object({
173
+ var blogThemeColorsSchema = z.object({
172
174
  ...blogThemeColorsShape,
173
175
  // The ONE optional color in a resolved theme: when unset, headings fall back
174
176
  // to `text` in the stylesheet (`--_heading-color`), so `blogThemeToCssVars`
175
177
  // only emits `--ara-blog-color-heading` when a theme actually sets it.
176
178
  heading: nullishField(colorValueSchema)
177
179
  });
178
- var blogThemeTypographySchema = import_zod.z.object({
180
+ var blogThemeTypographySchema = z.object({
179
181
  heading_family: fontFamilySchema,
180
182
  body_family: fontFamilySchema,
181
183
  heading_weight: fontWeightSchema,
@@ -194,17 +196,17 @@ var blogThemeTypographySchema = import_zod.z.object({
194
196
  // default center in the base CSS if unset.
195
197
  caption_align: alignValueSchema
196
198
  });
197
- var blogThemeSpacingSchema = import_zod.z.object({
199
+ var blogThemeSpacingSchema = z.object({
198
200
  content_max_width: responsive(lengthValueSchema),
199
201
  block_gap: responsive(lengthValueSchema),
200
202
  section_gap: responsive(lengthValueSchema)
201
203
  });
202
- var blogThemeColorsPartialSchema = import_zod.z.object(
204
+ var blogThemeColorsPartialSchema = z.object(
203
205
  Object.fromEntries(
204
206
  Object.keys(blogThemeColorsShape).map((key) => [key, nullishField(colorValueSchema)])
205
207
  )
206
208
  );
207
- var blogThemeSchema = import_zod.z.object({
209
+ var blogThemeSchema = z.object({
208
210
  colors: blogThemeColorsSchema,
209
211
  colors_dark: nullishField(blogThemeColorsPartialSchema),
210
212
  typography: blogThemeTypographySchema,
@@ -214,23 +216,26 @@ var blogThemeSchema = import_zod.z.object({
214
216
  function dropInvalidFields(shape) {
215
217
  const out = {};
216
218
  for (const [key, schema] of Object.entries(shape)) {
217
- out[key] = nullTolerant(schema).catch(void 0);
219
+ out[key] = z.catch(nullTolerant(schema), void 0);
218
220
  }
219
221
  return out;
220
222
  }
221
223
  function nullTolerant(schema) {
222
- if (schema instanceof import_zod.z.ZodUnion) {
223
- const options = schema.options;
224
- return import_zod.z.union([...options, import_zod.z.null()]).optional().transform((v) => v ?? void 0);
224
+ if (schema instanceof z.ZodMiniUnion) {
225
+ const options = schema.def.options;
226
+ return z.pipe(
227
+ z.optional(z.union([...options, z.null()])),
228
+ z.transform((v) => v ?? void 0)
229
+ );
225
230
  }
226
231
  return nullishField(schema);
227
232
  }
228
- var blogThemeColorsOverrideSchema = import_zod.z.object(dropInvalidFields(blogThemeColorsShape));
229
- var blogThemeTypographyOverrideSchema = import_zod.z.object(
233
+ var blogThemeColorsOverrideSchema = z.object(dropInvalidFields(blogThemeColorsShape));
234
+ var blogThemeTypographyOverrideSchema = z.object(
230
235
  dropInvalidFields(blogThemeTypographySchema.shape)
231
236
  );
232
- var blogThemeSpacingOverrideSchema = import_zod.z.object(dropInvalidFields(blogThemeSpacingSchema.shape));
233
- var blogThemeOverrideSchema = import_zod.z.object(
237
+ var blogThemeSpacingOverrideSchema = z.object(dropInvalidFields(blogThemeSpacingSchema.shape));
238
+ var blogThemeOverrideSchema = z.object(
234
239
  dropInvalidFields({
235
240
  colors: blogThemeColorsOverrideSchema,
236
241
  colors_dark: blogThemeColorsOverrideSchema,
@@ -343,94 +348,112 @@ function blogThemeToCssVars(theme) {
343
348
  }
344
349
 
345
350
  // ../tracking-core/src/resources/blog/schema.ts
346
- var schemaVersionSchema = import_zod2.z.literal(1);
347
- var blogHeroImageSchema = import_zod2.z.object({
348
- url: import_zod2.z.string(),
349
- alt: import_zod2.z.string().catch(""),
350
- width: import_zod2.z.number().int(),
351
- height: import_zod2.z.number().int()
351
+ var schemaVersionSchema = z2.literal(1);
352
+ var blogHeroImageSchema = z2.object({
353
+ url: z2.string(),
354
+ alt: z2.catch(z2.string(), ""),
355
+ width: z2.int(),
356
+ height: z2.int()
352
357
  });
353
- var blogManifestEntrySchema = import_zod2.z.object({
354
- slug: import_zod2.z.string(),
355
- title: import_zod2.z.string(),
356
- description: import_zod2.z.string().catch(""),
357
- content_hash: import_zod2.z.string(),
358
- content_key: import_zod2.z.string(),
359
- published_at: import_zod2.z.string(),
360
- updated_at: import_zod2.z.string(),
358
+ var blogManifestEntrySchema = z2.object({
359
+ slug: z2.string(),
360
+ title: z2.string(),
361
+ description: z2.catch(z2.string(), ""),
362
+ content_hash: z2.string(),
363
+ content_key: z2.string(),
364
+ published_at: z2.string(),
365
+ updated_at: z2.string(),
361
366
  // Estimated read time in whole minutes (computed at publish from the post
362
367
  // body). 0 when unknown; index cards render "N min read".
363
- reading_minutes: import_zod2.z.number().int().catch(0),
368
+ reading_minutes: z2.catch(z2.int(), 0),
364
369
  // A malformed tags array / hero_image degrades gracefully instead of
365
370
  // dropping the whole entry.
366
- tags: import_zod2.z.array(import_zod2.z.string()).catch([]),
367
- hero_image: blogHeroImageSchema.nullable().catch(null)
371
+ tags: z2.catch(z2.array(z2.string()), []),
372
+ hero_image: z2.catch(z2.nullable(blogHeroImageSchema), null)
368
373
  });
369
- var blogManifestWireSchema = import_zod2.z.object({
374
+ var blogManifestWireSchema = z2.object({
370
375
  schema_version: schemaVersionSchema,
371
- namespace: import_zod2.z.string(),
372
- generated_at: import_zod2.z.string(),
373
- posts: import_zod2.z.array(blogManifestEntrySchema).catch([])
376
+ namespace: z2.string(),
377
+ generated_at: z2.string(),
378
+ posts: z2.catch(z2.array(blogManifestEntrySchema), [])
374
379
  });
375
- var blogManifestSchema = blogManifestWireSchema.extend({
380
+ var blogManifestSchema = z2.extend(blogManifestWireSchema, {
376
381
  // A single malformed entry is dropped; the rest of the manifest survives.
377
- posts: import_zod2.z.array(blogManifestEntrySchema.nullable().catch(null)).transform((entries) => entries.filter((e) => e !== null)).catch([])
382
+ posts: z2.catch(
383
+ z2.pipe(
384
+ z2.array(z2.catch(z2.nullable(blogManifestEntrySchema), null)),
385
+ z2.transform((entries) => entries.filter((e) => e !== null))
386
+ ),
387
+ []
388
+ )
378
389
  });
379
- var blogImageSchema = import_zod2.z.object({
380
- id: import_zod2.z.string(),
381
- url: import_zod2.z.string(),
382
- alt: import_zod2.z.string().catch(""),
383
- caption: import_zod2.z.string().nullable().catch(null),
384
- role: import_zod2.z.enum(["hero", "inline"]).catch("inline"),
385
- width: import_zod2.z.number().int(),
386
- height: import_zod2.z.number().int(),
387
- mime: import_zod2.z.string().catch("")
390
+ var blogImageSchema = z2.object({
391
+ id: z2.string(),
392
+ url: z2.string(),
393
+ alt: z2.catch(z2.string(), ""),
394
+ caption: z2.catch(z2.nullable(z2.string()), null),
395
+ role: z2.catch(z2.enum(["hero", "inline"]), "inline"),
396
+ width: z2.int(),
397
+ height: z2.int(),
398
+ mime: z2.catch(z2.string(), "")
388
399
  });
389
- var blogSeoSchema = import_zod2.z.object({
390
- meta_title: import_zod2.z.string().catch(""),
391
- meta_description: import_zod2.z.string().catch(""),
392
- canonical_path: import_zod2.z.string().catch(""),
393
- og_image: import_zod2.z.string().nullable().catch(null)
400
+ var blogSeoSchema = z2.object({
401
+ meta_title: z2.catch(z2.string(), ""),
402
+ meta_description: z2.catch(z2.string(), ""),
403
+ canonical_path: z2.catch(z2.string(), ""),
404
+ og_image: z2.catch(z2.nullable(z2.string()), null)
394
405
  });
395
- var blogPostContentWireSchema = import_zod2.z.object({
406
+ var blogPostContentWireSchema = z2.object({
396
407
  schema_version: schemaVersionSchema,
397
- slug: import_zod2.z.string(),
398
- title: import_zod2.z.string(),
399
- description: import_zod2.z.string().catch(""),
400
- mdx: import_zod2.z.string(),
401
- images: import_zod2.z.array(blogImageSchema).catch([]),
408
+ slug: z2.string(),
409
+ title: z2.string(),
410
+ description: z2.catch(z2.string(), ""),
411
+ mdx: z2.string(),
412
+ images: z2.catch(z2.array(blogImageSchema), []),
402
413
  // Already schema-validated at publish time, but re-sanitized on read (and
403
414
  // again before rendering) — the override schema itself drops invalid values.
404
415
  // Nullish: the backend serializes an unset override as an explicit `null`
405
416
  // (Pydantic `model_dump()`); it folds into `undefined` for TS consumers.
406
- theme_overrides: nullishField(blogThemeOverrideSchema).catch(void 0),
407
- seo: blogSeoSchema.catch({
417
+ theme_overrides: z2.catch(nullishField(blogThemeOverrideSchema), void 0),
418
+ seo: z2.catch(blogSeoSchema, {
408
419
  meta_title: "",
409
420
  meta_description: "",
410
421
  canonical_path: "",
411
422
  og_image: null
412
423
  }),
413
- jsonld: import_zod2.z.record(import_zod2.z.unknown()).catch({}),
414
- published_at: import_zod2.z.string(),
424
+ jsonld: z2.catch(z2.record(z2.string(), z2.unknown()), {}),
425
+ published_at: z2.string(),
415
426
  // The applied_at of the version this content was published from; `null`
416
427
  // when the backend has no separate modified date. Nullish on the wire
417
428
  // (Pydantic `model_dump()` emits explicit `null`s), folded to `null` for a
418
429
  // single TS sentinel; a malformed value degrades to `null` instead of
419
430
  // dropping the post.
420
- updated_at: import_zod2.z.string().nullish().transform((v) => v ?? null).catch(null),
421
- version_number: import_zod2.z.number().int().catch(0),
422
- content_hash: import_zod2.z.string()
431
+ updated_at: z2.catch(
432
+ z2.pipe(
433
+ z2.nullish(z2.string()),
434
+ z2.transform((v) => v ?? null)
435
+ ),
436
+ null
437
+ ),
438
+ version_number: z2.catch(z2.int(), 0),
439
+ content_hash: z2.string()
423
440
  });
424
- var blogPostContentSchema = blogPostContentWireSchema.extend({
441
+ var blogPostContentSchema = z2.extend(blogPostContentWireSchema, {
425
442
  // A single malformed image record is dropped; the post survives.
426
- images: import_zod2.z.array(blogImageSchema.nullable().catch(null)).transform((images) => images.filter((i) => i !== null)).catch([])
443
+ images: z2.catch(
444
+ z2.pipe(
445
+ z2.array(z2.catch(z2.nullable(blogImageSchema), null)),
446
+ z2.transform((images) => images.filter((i) => i !== null))
447
+ ),
448
+ []
449
+ )
427
450
  });
428
451
  function parseBlogManifest(raw) {
429
- const parsed = blogManifestSchema.safeParse(raw);
452
+ const parsed = z2.safeParse(blogManifestSchema, raw);
430
453
  return parsed.success ? parsed.data : null;
431
454
  }
432
455
  function parseBlogPostContent(raw) {
433
- const parsed = blogPostContentSchema.safeParse(raw);
456
+ const parsed = z2.safeParse(blogPostContentSchema, raw);
434
457
  return parsed.success ? parsed.data : null;
435
458
  }
436
459