@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
package/dist/blog.js CHANGED
@@ -81,18 +81,15 @@ function registerCapability(capability) {
81
81
  registered.add(capability);
82
82
  }
83
83
 
84
- // ../tracking-core/src/phone.ts
85
- var import_libphonenumber_js = require("libphonenumber-js");
86
-
87
84
  // ../tracking-core/src/resources/tracking-config-runtime.ts
88
85
  var DEFAULT_CDN_BASE_URL = "https://demos.aranova.io";
89
86
  var RETRY_MAX_MS = 5 * 6e4;
90
87
 
91
88
  // ../tracking-core/src/resources/blog/schema.ts
92
- var import_zod2 = require("zod");
89
+ var z2 = __toESM(require("zod/mini"));
93
90
 
94
91
  // ../tracking-core/src/resources/blog/theme.ts
95
- var import_zod = require("zod");
92
+ var z = __toESM(require("zod/mini"));
96
93
  var BLOG_BREAKPOINTS = ["sm", "md", "lg", "xl", "2xl", "3xl"];
97
94
  var BLOG_BREAKPOINT_MIN_WIDTHS_PX = {
98
95
  sm: 640,
@@ -111,40 +108,45 @@ var LENGTH = /^-?\d+(\.\d+)?(px|rem|em|%|ch|vw)$/;
111
108
  var LINE_HEIGHT = /^-?\d+(\.\d+)?(px|rem|em|%|ch|vw)?$/;
112
109
  var FONT_FAMILY_TOKEN = /^['"]?[a-zA-Z0-9 -]+['"]?$/;
113
110
  var FONT_FAMILY_VAR_TOKEN = /^var\(--[a-zA-Z0-9-]+\)$/;
114
- var colorValueSchema = import_zod.z.string().refine((v) => HEX_COLOR.test(v) || FUNCTIONAL_COLOR.test(v), {
115
- message: "must be a #hex or rgb()/rgba()/hsl()/hsla()/oklch() color"
116
- });
117
- var lengthValueSchema = import_zod.z.string().regex(LENGTH, {
118
- message: "must be a CSS length (px|rem|em|%|ch|vw)"
119
- });
120
- var lineHeightValueSchema = import_zod.z.string().regex(LINE_HEIGHT, {
121
- message: "must be a CSS length or unitless line-height"
122
- });
123
- var fontWeightSchema = import_zod.z.number().int().min(100).max(1e3);
124
- var alignValueSchema = import_zod.z.enum(["left", "center", "right"]);
125
- var fontFamilySchema = import_zod.z.string().refine(
126
- (v) => {
127
- const tokens = v.split(",").map((t) => t.trim());
128
- return tokens.length > 0 && tokens.every((t) => FONT_FAMILY_TOKEN.test(t) || FONT_FAMILY_VAR_TOKEN.test(t));
129
- },
130
- { message: "must be a comma-separated list of font-family or var(--custom-property) tokens" }
111
+ var colorValueSchema = z.string().check(
112
+ z.refine((v) => HEX_COLOR.test(v) || FUNCTIONAL_COLOR.test(v), {
113
+ error: "must be a #hex or rgb()/rgba()/hsl()/hsla()/oklch() color"
114
+ })
115
+ );
116
+ var lengthValueSchema = z.string().check(z.regex(LENGTH, { error: "must be a CSS length (px|rem|em|%|ch|vw)" }));
117
+ var lineHeightValueSchema = z.string().check(z.regex(LINE_HEIGHT, { error: "must be a CSS length or unitless line-height" }));
118
+ var fontWeightSchema = z.int().check(z.gte(100), z.lte(1e3));
119
+ var alignValueSchema = z.enum(["left", "center", "right"]);
120
+ var fontFamilySchema = z.string().check(
121
+ z.refine(
122
+ (v) => {
123
+ const tokens = v.split(",").map((t) => t.trim());
124
+ return tokens.length > 0 && tokens.every((t) => FONT_FAMILY_TOKEN.test(t) || FONT_FAMILY_VAR_TOKEN.test(t));
125
+ },
126
+ { error: "must be a comma-separated list of font-family or var(--custom-property) tokens" }
127
+ )
131
128
  );
132
129
  function nullishField(schema) {
133
- return schema.nullish().transform((v) => v ?? void 0);
130
+ return z.optional(
131
+ z.pipe(
132
+ z.nullish(schema),
133
+ z.transform((v) => v ?? void 0)
134
+ )
135
+ );
134
136
  }
135
137
  function breakpointMapSchema(valueSchema) {
136
- return import_zod.z.object({
138
+ return z.object({
137
139
  base: valueSchema,
138
- sm: nullishField(valueSchema).catch(void 0),
139
- md: nullishField(valueSchema).catch(void 0),
140
- lg: nullishField(valueSchema).catch(void 0),
141
- xl: nullishField(valueSchema).catch(void 0),
142
- "2xl": nullishField(valueSchema).catch(void 0),
143
- "3xl": nullishField(valueSchema).catch(void 0)
140
+ sm: z.catch(nullishField(valueSchema), void 0),
141
+ md: z.catch(nullishField(valueSchema), void 0),
142
+ lg: z.catch(nullishField(valueSchema), void 0),
143
+ xl: z.catch(nullishField(valueSchema), void 0),
144
+ "2xl": z.catch(nullishField(valueSchema), void 0),
145
+ "3xl": z.catch(nullishField(valueSchema), void 0)
144
146
  });
145
147
  }
146
148
  function responsive(valueSchema) {
147
- return import_zod.z.union([valueSchema, breakpointMapSchema(valueSchema)]);
149
+ return z.union([valueSchema, breakpointMapSchema(valueSchema)]);
148
150
  }
149
151
  var blogThemeColorsShape = {
150
152
  background: colorValueSchema,
@@ -158,14 +160,14 @@ var blogThemeColorsShape = {
158
160
  code_background: colorValueSchema,
159
161
  heading: colorValueSchema
160
162
  };
161
- var blogThemeColorsSchema = import_zod.z.object({
163
+ var blogThemeColorsSchema = z.object({
162
164
  ...blogThemeColorsShape,
163
165
  // The ONE optional color in a resolved theme: when unset, headings fall back
164
166
  // to `text` in the stylesheet (`--_heading-color`), so `blogThemeToCssVars`
165
167
  // only emits `--ara-blog-color-heading` when a theme actually sets it.
166
168
  heading: nullishField(colorValueSchema)
167
169
  });
168
- var blogThemeTypographySchema = import_zod.z.object({
170
+ var blogThemeTypographySchema = z.object({
169
171
  heading_family: fontFamilySchema,
170
172
  body_family: fontFamilySchema,
171
173
  heading_weight: fontWeightSchema,
@@ -184,17 +186,17 @@ var blogThemeTypographySchema = import_zod.z.object({
184
186
  // default center in the base CSS if unset.
185
187
  caption_align: alignValueSchema
186
188
  });
187
- var blogThemeSpacingSchema = import_zod.z.object({
189
+ var blogThemeSpacingSchema = z.object({
188
190
  content_max_width: responsive(lengthValueSchema),
189
191
  block_gap: responsive(lengthValueSchema),
190
192
  section_gap: responsive(lengthValueSchema)
191
193
  });
192
- var blogThemeColorsPartialSchema = import_zod.z.object(
194
+ var blogThemeColorsPartialSchema = z.object(
193
195
  Object.fromEntries(
194
196
  Object.keys(blogThemeColorsShape).map((key) => [key, nullishField(colorValueSchema)])
195
197
  )
196
198
  );
197
- var blogThemeSchema = import_zod.z.object({
199
+ var blogThemeSchema = z.object({
198
200
  colors: blogThemeColorsSchema,
199
201
  colors_dark: nullishField(blogThemeColorsPartialSchema),
200
202
  typography: blogThemeTypographySchema,
@@ -204,23 +206,26 @@ var blogThemeSchema = import_zod.z.object({
204
206
  function dropInvalidFields(shape) {
205
207
  const out = {};
206
208
  for (const [key, schema] of Object.entries(shape)) {
207
- out[key] = nullTolerant(schema).catch(void 0);
209
+ out[key] = z.catch(nullTolerant(schema), void 0);
208
210
  }
209
211
  return out;
210
212
  }
211
213
  function nullTolerant(schema) {
212
- if (schema instanceof import_zod.z.ZodUnion) {
213
- const options = schema.options;
214
- return import_zod.z.union([...options, import_zod.z.null()]).optional().transform((v) => v ?? void 0);
214
+ if (schema instanceof z.ZodMiniUnion) {
215
+ const options = schema.def.options;
216
+ return z.pipe(
217
+ z.optional(z.union([...options, z.null()])),
218
+ z.transform((v) => v ?? void 0)
219
+ );
215
220
  }
216
221
  return nullishField(schema);
217
222
  }
218
- var blogThemeColorsOverrideSchema = import_zod.z.object(dropInvalidFields(blogThemeColorsShape));
219
- var blogThemeTypographyOverrideSchema = import_zod.z.object(
223
+ var blogThemeColorsOverrideSchema = z.object(dropInvalidFields(blogThemeColorsShape));
224
+ var blogThemeTypographyOverrideSchema = z.object(
220
225
  dropInvalidFields(blogThemeTypographySchema.shape)
221
226
  );
222
- var blogThemeSpacingOverrideSchema = import_zod.z.object(dropInvalidFields(blogThemeSpacingSchema.shape));
223
- var blogThemeOverrideSchema = import_zod.z.object(
227
+ var blogThemeSpacingOverrideSchema = z.object(dropInvalidFields(blogThemeSpacingSchema.shape));
228
+ var blogThemeOverrideSchema = z.object(
224
229
  dropInvalidFields({
225
230
  colors: blogThemeColorsOverrideSchema,
226
231
  colors_dark: blogThemeColorsOverrideSchema,
@@ -333,94 +338,112 @@ function blogThemeToCssVars(theme) {
333
338
  }
334
339
 
335
340
  // ../tracking-core/src/resources/blog/schema.ts
336
- var schemaVersionSchema = import_zod2.z.literal(1);
337
- var blogHeroImageSchema = import_zod2.z.object({
338
- url: import_zod2.z.string(),
339
- alt: import_zod2.z.string().catch(""),
340
- width: import_zod2.z.number().int(),
341
- height: import_zod2.z.number().int()
341
+ var schemaVersionSchema = z2.literal(1);
342
+ var blogHeroImageSchema = z2.object({
343
+ url: z2.string(),
344
+ alt: z2.catch(z2.string(), ""),
345
+ width: z2.int(),
346
+ height: z2.int()
342
347
  });
343
- var blogManifestEntrySchema = import_zod2.z.object({
344
- slug: import_zod2.z.string(),
345
- title: import_zod2.z.string(),
346
- description: import_zod2.z.string().catch(""),
347
- content_hash: import_zod2.z.string(),
348
- content_key: import_zod2.z.string(),
349
- published_at: import_zod2.z.string(),
350
- updated_at: import_zod2.z.string(),
348
+ var blogManifestEntrySchema = z2.object({
349
+ slug: z2.string(),
350
+ title: z2.string(),
351
+ description: z2.catch(z2.string(), ""),
352
+ content_hash: z2.string(),
353
+ content_key: z2.string(),
354
+ published_at: z2.string(),
355
+ updated_at: z2.string(),
351
356
  // Estimated read time in whole minutes (computed at publish from the post
352
357
  // body). 0 when unknown; index cards render "N min read".
353
- reading_minutes: import_zod2.z.number().int().catch(0),
358
+ reading_minutes: z2.catch(z2.int(), 0),
354
359
  // A malformed tags array / hero_image degrades gracefully instead of
355
360
  // dropping the whole entry.
356
- tags: import_zod2.z.array(import_zod2.z.string()).catch([]),
357
- hero_image: blogHeroImageSchema.nullable().catch(null)
361
+ tags: z2.catch(z2.array(z2.string()), []),
362
+ hero_image: z2.catch(z2.nullable(blogHeroImageSchema), null)
358
363
  });
359
- var blogManifestWireSchema = import_zod2.z.object({
364
+ var blogManifestWireSchema = z2.object({
360
365
  schema_version: schemaVersionSchema,
361
- namespace: import_zod2.z.string(),
362
- generated_at: import_zod2.z.string(),
363
- posts: import_zod2.z.array(blogManifestEntrySchema).catch([])
366
+ namespace: z2.string(),
367
+ generated_at: z2.string(),
368
+ posts: z2.catch(z2.array(blogManifestEntrySchema), [])
364
369
  });
365
- var blogManifestSchema = blogManifestWireSchema.extend({
370
+ var blogManifestSchema = z2.extend(blogManifestWireSchema, {
366
371
  // A single malformed entry is dropped; the rest of the manifest survives.
367
- posts: import_zod2.z.array(blogManifestEntrySchema.nullable().catch(null)).transform((entries) => entries.filter((e) => e !== null)).catch([])
372
+ posts: z2.catch(
373
+ z2.pipe(
374
+ z2.array(z2.catch(z2.nullable(blogManifestEntrySchema), null)),
375
+ z2.transform((entries) => entries.filter((e) => e !== null))
376
+ ),
377
+ []
378
+ )
368
379
  });
369
- var blogImageSchema = import_zod2.z.object({
370
- id: import_zod2.z.string(),
371
- url: import_zod2.z.string(),
372
- alt: import_zod2.z.string().catch(""),
373
- caption: import_zod2.z.string().nullable().catch(null),
374
- role: import_zod2.z.enum(["hero", "inline"]).catch("inline"),
375
- width: import_zod2.z.number().int(),
376
- height: import_zod2.z.number().int(),
377
- mime: import_zod2.z.string().catch("")
380
+ var blogImageSchema = z2.object({
381
+ id: z2.string(),
382
+ url: z2.string(),
383
+ alt: z2.catch(z2.string(), ""),
384
+ caption: z2.catch(z2.nullable(z2.string()), null),
385
+ role: z2.catch(z2.enum(["hero", "inline"]), "inline"),
386
+ width: z2.int(),
387
+ height: z2.int(),
388
+ mime: z2.catch(z2.string(), "")
378
389
  });
379
- var blogSeoSchema = import_zod2.z.object({
380
- meta_title: import_zod2.z.string().catch(""),
381
- meta_description: import_zod2.z.string().catch(""),
382
- canonical_path: import_zod2.z.string().catch(""),
383
- og_image: import_zod2.z.string().nullable().catch(null)
390
+ var blogSeoSchema = z2.object({
391
+ meta_title: z2.catch(z2.string(), ""),
392
+ meta_description: z2.catch(z2.string(), ""),
393
+ canonical_path: z2.catch(z2.string(), ""),
394
+ og_image: z2.catch(z2.nullable(z2.string()), null)
384
395
  });
385
- var blogPostContentWireSchema = import_zod2.z.object({
396
+ var blogPostContentWireSchema = z2.object({
386
397
  schema_version: schemaVersionSchema,
387
- slug: import_zod2.z.string(),
388
- title: import_zod2.z.string(),
389
- description: import_zod2.z.string().catch(""),
390
- mdx: import_zod2.z.string(),
391
- images: import_zod2.z.array(blogImageSchema).catch([]),
398
+ slug: z2.string(),
399
+ title: z2.string(),
400
+ description: z2.catch(z2.string(), ""),
401
+ mdx: z2.string(),
402
+ images: z2.catch(z2.array(blogImageSchema), []),
392
403
  // Already schema-validated at publish time, but re-sanitized on read (and
393
404
  // again before rendering) — the override schema itself drops invalid values.
394
405
  // Nullish: the backend serializes an unset override as an explicit `null`
395
406
  // (Pydantic `model_dump()`); it folds into `undefined` for TS consumers.
396
- theme_overrides: nullishField(blogThemeOverrideSchema).catch(void 0),
397
- seo: blogSeoSchema.catch({
407
+ theme_overrides: z2.catch(nullishField(blogThemeOverrideSchema), void 0),
408
+ seo: z2.catch(blogSeoSchema, {
398
409
  meta_title: "",
399
410
  meta_description: "",
400
411
  canonical_path: "",
401
412
  og_image: null
402
413
  }),
403
- jsonld: import_zod2.z.record(import_zod2.z.unknown()).catch({}),
404
- published_at: import_zod2.z.string(),
414
+ jsonld: z2.catch(z2.record(z2.string(), z2.unknown()), {}),
415
+ published_at: z2.string(),
405
416
  // The applied_at of the version this content was published from; `null`
406
417
  // when the backend has no separate modified date. Nullish on the wire
407
418
  // (Pydantic `model_dump()` emits explicit `null`s), folded to `null` for a
408
419
  // single TS sentinel; a malformed value degrades to `null` instead of
409
420
  // dropping the post.
410
- updated_at: import_zod2.z.string().nullish().transform((v) => v ?? null).catch(null),
411
- version_number: import_zod2.z.number().int().catch(0),
412
- content_hash: import_zod2.z.string()
421
+ updated_at: z2.catch(
422
+ z2.pipe(
423
+ z2.nullish(z2.string()),
424
+ z2.transform((v) => v ?? null)
425
+ ),
426
+ null
427
+ ),
428
+ version_number: z2.catch(z2.int(), 0),
429
+ content_hash: z2.string()
413
430
  });
414
- var blogPostContentSchema = blogPostContentWireSchema.extend({
431
+ var blogPostContentSchema = z2.extend(blogPostContentWireSchema, {
415
432
  // A single malformed image record is dropped; the post survives.
416
- images: import_zod2.z.array(blogImageSchema.nullable().catch(null)).transform((images) => images.filter((i) => i !== null)).catch([])
433
+ images: z2.catch(
434
+ z2.pipe(
435
+ z2.array(z2.catch(z2.nullable(blogImageSchema), null)),
436
+ z2.transform((images) => images.filter((i) => i !== null))
437
+ ),
438
+ []
439
+ )
417
440
  });
418
441
  function parseBlogManifest(raw) {
419
- const parsed = blogManifestSchema.safeParse(raw);
442
+ const parsed = z2.safeParse(blogManifestSchema, raw);
420
443
  return parsed.success ? parsed.data : null;
421
444
  }
422
445
  function parseBlogPostContent(raw) {
423
- const parsed = blogPostContentSchema.safeParse(raw);
446
+ const parsed = z2.safeParse(blogPostContentSchema, raw);
424
447
  return parsed.success ? parsed.data : null;
425
448
  }
426
449