@ai-matrx/records 0.72.6 → 0.72.10

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,15 @@ 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
+ const EMAIL_SHAPE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
3470
+ for (const table of tablesRaw) {
3471
+ for (const f of table.fields.filter((x) => x.parityType === "email" || x.format === "email")) {
3472
+ table.rows?.forEach((row) => {
3473
+ const v = unwrap(row.values?.[f.key]);
3474
+ if (typeof v === "string" && v !== "" && !EMAIL_SHAPE.test(v)) say(`tables (${table.token}).rows (${row.key}).${f.key}`, `"${v}" is not an email address the store will take (no spaces, one @, a dotted domain).`);
3475
+ });
3476
+ }
3477
+ }
3469
3478
  for (const table of tablesRaw) {
3470
3479
  const tf = table.fields.find((f) => f.key === table.titleField);
3471
3480
  if (tf && tf.default !== void 0) say(`tables (${table.token}).fields (${tf.key})`, `"${tf.label}" names each ${table.labelSingular.toLowerCase()}, so it takes no default; ask it on the form instead.`);
@@ -5546,7 +5555,7 @@ ${e.body}`.matchAll(MERGE_TOKEN)].map((m) => m[1]));
5546
5555
  }
5547
5556
  }
5548
5557
  }
5549
- if (/report_due|reporting_due/.test(f.key)) {
5558
+ if (/report_due|reporting_due/.test(f.key) && /grant|award|funder|funding/i.test(`${t.token} ${t.name} ${t.labelSingular}`)) {
5550
5559
  const st = t.fields.find((x) => isChoice(x) && /status|stage/.test(x.key));
5551
5560
  if (!st) continue;
5552
5561
  for (const r of t.rows) {
@@ -6053,7 +6062,8 @@ function compileInstallPlan(written) {
6053
6062
  const documentRefs = Object.fromEntries(
6054
6063
  spec.extras.filter((e) => e.kind === "document").map((e) => [e.token, ref(`documents.${e.token}`)])
6055
6064
  );
6056
- for (const e of spec.extras) {
6065
+ const extrasInOrder = [...spec.extras.filter((e) => e.kind === "document"), ...spec.extras.filter((e) => e.kind !== "document")];
6066
+ for (const e of extrasInOrder) {
6057
6067
  switch (e.kind) {
6058
6068
  case "booking":
6059
6069
  steps.push({