@ai-matrx/records 0.72.10 → 0.72.12

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.
@@ -3466,6 +3466,28 @@ function validateTemplate(raw, options = {}) {
3466
3466
  const tz = raw.business?.timezone || "UTC";
3467
3467
  const tablesRaw = allTables(raw);
3468
3468
  const ISO_DAY = /\b\d{4}-\d{2}-\d{2}\b/;
3469
+ for (const e of raw.extras ?? []) {
3470
+ if (e.kind !== "checklist") continue;
3471
+ for (const st of e.steps ?? []) {
3472
+ if (st.dueDays !== void 0 && !(Number.isInteger(st.dueDays) && st.dueDays >= 0 && st.dueDays <= 3650)) {
3473
+ say(`extras (${e.token}).steps (${st.ref ?? "?"}).dueDays`, `A step is due a whole number of days after the checklist starts, from 0 to 3650; ${st.dueDays} is not. Start the checklist earlier instead of counting backwards.`);
3474
+ }
3475
+ }
3476
+ }
3477
+ for (const table of tablesRaw) {
3478
+ for (const f of table.fields) {
3479
+ for (const rule of f.rules ?? []) {
3480
+ if (rule.kind !== "pattern" || typeof rule.value !== "string" || typeof rule.example !== "string") continue;
3481
+ let re = null;
3482
+ try {
3483
+ re = new RegExp(rule.value);
3484
+ } catch {
3485
+ continue;
3486
+ }
3487
+ if (!re.test(rule.example)) say(`tables (${table.token}).fields (${f.key}).rules`, `"${f.label}" shows "${rule.example}" as the way to write it, and its own pattern refuses that. Make the example match the pattern.`);
3488
+ }
3489
+ }
3490
+ }
3469
3491
  const EMAIL_SHAPE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
3470
3492
  for (const table of tablesRaw) {
3471
3493
  for (const f of table.fields.filter((x) => x.parityType === "email" || x.format === "email")) {