@fieldia/core 0.26.1 → 0.27.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.
- package/README.md +307 -3
- package/package.json +1 -1
- package/schema/page.schema.json +227 -23
- package/src/index.d.mts +8 -2
- package/src/index.d.ts +8 -2
- package/src/index.js +22 -1
- package/src/index.js.map +1 -1
- package/src/index.mjs +9 -2
- package/src/index.mjs.map +1 -1
- package/src/lib/expression/app-functions.d.mts +47 -0
- package/src/lib/expression/app-functions.d.ts +47 -0
- package/src/lib/expression/app-functions.js +64 -0
- package/src/lib/expression/app-functions.js.map +1 -0
- package/src/lib/expression/app-functions.mjs +58 -0
- package/src/lib/expression/app-functions.mjs.map +1 -0
- package/src/lib/expression/dates.d.mts +21 -0
- package/src/lib/expression/dates.d.ts +21 -0
- package/src/lib/expression/dates.js +73 -0
- package/src/lib/expression/dates.js.map +1 -0
- package/src/lib/expression/dates.mjs +67 -0
- package/src/lib/expression/dates.mjs.map +1 -0
- package/src/lib/expression/evaluator.js +12 -6
- package/src/lib/expression/evaluator.js.map +1 -1
- package/src/lib/expression/evaluator.mjs +12 -6
- package/src/lib/expression/evaluator.mjs.map +1 -1
- package/src/lib/expression/expression.d.mts +7 -3
- package/src/lib/expression/expression.d.ts +7 -3
- package/src/lib/expression/expression.js +8 -2
- package/src/lib/expression/expression.js.map +1 -1
- package/src/lib/expression/expression.mjs +7 -2
- package/src/lib/expression/expression.mjs.map +1 -1
- package/src/lib/expression/functions-part.d.mts +7 -0
- package/src/lib/expression/functions-part.d.ts +7 -0
- package/src/lib/expression/functions-part.js +13 -0
- package/src/lib/expression/functions-part.js.map +1 -0
- package/src/lib/expression/functions-part.mjs +8 -0
- package/src/lib/expression/functions-part.mjs.map +1 -0
- package/src/lib/expression/functions.d.mts +60 -3
- package/src/lib/expression/functions.d.ts +60 -3
- package/src/lib/expression/functions.js +109 -15
- package/src/lib/expression/functions.js.map +1 -1
- package/src/lib/expression/functions.mjs +103 -16
- package/src/lib/expression/functions.mjs.map +1 -1
- package/src/lib/expression/kinds.d.mts +31 -0
- package/src/lib/expression/kinds.d.ts +31 -0
- package/src/lib/expression/kinds.js +159 -0
- package/src/lib/expression/kinds.js.map +1 -0
- package/src/lib/expression/kinds.mjs +151 -0
- package/src/lib/expression/kinds.mjs.map +1 -0
- package/src/lib/expression/modifier.d.mts +4 -3
- package/src/lib/expression/modifier.d.ts +4 -3
- package/src/lib/expression/modifier.js +4 -3
- package/src/lib/expression/modifier.js.map +1 -1
- package/src/lib/expression/modifier.mjs +4 -3
- package/src/lib/expression/modifier.mjs.map +1 -1
- package/src/lib/expression/more-functions.d.mts +8 -0
- package/src/lib/expression/more-functions.d.ts +8 -0
- package/src/lib/expression/more-functions.js +235 -0
- package/src/lib/expression/more-functions.js.map +1 -0
- package/src/lib/expression/more-functions.mjs +230 -0
- package/src/lib/expression/more-functions.mjs.map +1 -0
- package/src/lib/expression/parser.d.mts +4 -1
- package/src/lib/expression/parser.d.ts +4 -1
- package/src/lib/expression/parser.js +6 -3
- package/src/lib/expression/parser.js.map +1 -1
- package/src/lib/expression/parser.mjs +6 -3
- package/src/lib/expression/parser.mjs.map +1 -1
- package/src/lib/expression/reads.d.mts +2 -2
- package/src/lib/expression/reads.d.ts +2 -2
- package/src/lib/expression/reads.js +6 -4
- package/src/lib/expression/reads.js.map +1 -1
- package/src/lib/expression/reads.mjs +6 -4
- package/src/lib/expression/reads.mjs.map +1 -1
- package/src/lib/format/actions.d.mts +16 -16
- package/src/lib/format/actions.d.ts +16 -16
- package/src/lib/format/check-page.d.mts +7 -2
- package/src/lib/format/check-page.d.ts +7 -2
- package/src/lib/format/check-page.js +10 -4
- package/src/lib/format/check-page.js.map +1 -1
- package/src/lib/format/check-page.mjs +10 -4
- package/src/lib/format/check-page.mjs.map +1 -1
- package/src/lib/format/choice-options.d.mts +34 -0
- package/src/lib/format/choice-options.d.ts +34 -0
- package/src/lib/format/choice-options.js +60 -0
- package/src/lib/format/choice-options.js.map +1 -0
- package/src/lib/format/choice-options.mjs +51 -0
- package/src/lib/format/choice-options.mjs.map +1 -0
- package/src/lib/format/endings-checks.d.mts +8 -0
- package/src/lib/format/endings-checks.d.ts +8 -0
- package/src/lib/format/endings-checks.js +23 -0
- package/src/lib/format/endings-checks.js.map +1 -0
- package/src/lib/format/endings-checks.mjs +20 -0
- package/src/lib/format/endings-checks.mjs.map +1 -0
- package/src/lib/format/endings.d.mts +40 -0
- package/src/lib/format/endings.d.ts +40 -0
- package/src/lib/format/endings.js +15 -0
- package/src/lib/format/endings.js.map +1 -0
- package/src/lib/format/endings.mjs +12 -0
- package/src/lib/format/endings.mjs.map +1 -0
- package/src/lib/format/field.d.mts +151 -16
- package/src/lib/format/field.d.ts +151 -16
- package/src/lib/format/field.js +64 -11
- package/src/lib/format/field.js.map +1 -1
- package/src/lib/format/field.mjs +63 -10
- package/src/lib/format/field.mjs.map +1 -1
- package/src/lib/format/head-checks.d.mts +2 -0
- package/src/lib/format/head-checks.d.ts +2 -0
- package/src/lib/format/head-checks.js +2 -59
- package/src/lib/format/head-checks.js.map +1 -1
- package/src/lib/format/head-checks.mjs +1 -58
- package/src/lib/format/head-checks.mjs.map +1 -1
- package/src/lib/format/later-checks.d.mts +17 -0
- package/src/lib/format/later-checks.d.ts +17 -0
- package/src/lib/format/later-checks.js +20 -0
- package/src/lib/format/later-checks.js.map +1 -0
- package/src/lib/format/later-checks.mjs +17 -0
- package/src/lib/format/later-checks.mjs.map +1 -0
- package/src/lib/format/layout.d.mts +241 -188
- package/src/lib/format/layout.d.ts +241 -188
- package/src/lib/format/layout.js +33 -28
- package/src/lib/format/layout.js.map +1 -1
- package/src/lib/format/layout.mjs +13 -3
- package/src/lib/format/layout.mjs.map +1 -1
- package/src/lib/format/layout.types.d.mts +2 -1
- package/src/lib/format/layout.types.d.ts +2 -1
- package/src/lib/format/limits-checks.d.mts +14 -0
- package/src/lib/format/limits-checks.d.ts +14 -0
- package/src/lib/format/limits-checks.js +36 -0
- package/src/lib/format/limits-checks.js.map +1 -0
- package/src/lib/format/limits-checks.mjs +33 -0
- package/src/lib/format/limits-checks.mjs.map +1 -0
- package/src/lib/format/limits.d.mts +24 -0
- package/src/lib/format/limits.d.ts +24 -0
- package/src/lib/format/limits.js +35 -0
- package/src/lib/format/limits.js.map +1 -0
- package/src/lib/format/limits.mjs +32 -0
- package/src/lib/format/limits.mjs.map +1 -0
- package/src/lib/format/list-checks.d.mts +44 -0
- package/src/lib/format/list-checks.d.ts +44 -0
- package/src/lib/format/list-checks.js +340 -0
- package/src/lib/format/list-checks.js.map +1 -0
- package/src/lib/format/list-checks.mjs +336 -0
- package/src/lib/format/list-checks.mjs.map +1 -0
- package/src/lib/format/map-checks.d.mts +33 -0
- package/src/lib/format/map-checks.d.ts +33 -0
- package/src/lib/format/map-checks.js +180 -0
- package/src/lib/format/map-checks.js.map +1 -0
- package/src/lib/format/map-checks.mjs +175 -0
- package/src/lib/format/map-checks.mjs.map +1 -0
- package/src/lib/format/mapchecks-part.d.mts +5 -0
- package/src/lib/format/mapchecks-part.d.ts +5 -0
- package/src/lib/format/mapchecks-part.js +11 -0
- package/src/lib/format/mapchecks-part.js.map +1 -0
- package/src/lib/format/mapchecks-part.mjs +6 -0
- package/src/lib/format/mapchecks-part.mjs.map +1 -0
- package/src/lib/format/option-checks.d.mts +16 -0
- package/src/lib/format/option-checks.d.ts +16 -0
- package/src/lib/format/option-checks.js +39 -0
- package/src/lib/format/option-checks.js.map +1 -0
- package/src/lib/format/option-checks.mjs +36 -0
- package/src/lib/format/option-checks.mjs.map +1 -0
- package/src/lib/format/options-part.d.mts +6 -0
- package/src/lib/format/options-part.d.ts +6 -0
- package/src/lib/format/options-part.js +11 -0
- package/src/lib/format/options-part.js.map +1 -0
- package/src/lib/format/options-part.mjs +7 -0
- package/src/lib/format/options-part.mjs.map +1 -0
- package/src/lib/format/page.d.mts +147 -71
- package/src/lib/format/page.d.ts +147 -71
- package/src/lib/format/page.js +5 -0
- package/src/lib/format/page.js.map +1 -1
- package/src/lib/format/page.mjs +5 -0
- package/src/lib/format/page.mjs.map +1 -1
- package/src/lib/format/part-checks.d.mts +20 -0
- package/src/lib/format/part-checks.d.ts +20 -0
- package/src/lib/format/part-checks.js +3 -0
- package/src/lib/format/part-checks.js.map +1 -0
- package/src/lib/format/part-checks.mjs +2 -0
- package/src/lib/format/part-checks.mjs.map +1 -0
- package/src/lib/format/references.d.mts +71 -65
- package/src/lib/format/references.d.ts +71 -65
- package/src/lib/format/references.js +194 -631
- package/src/lib/format/references.js.map +1 -1
- package/src/lib/format/references.mjs +194 -631
- package/src/lib/format/references.mjs.map +1 -1
- package/src/lib/format/seats-checks.d.mts +3 -0
- package/src/lib/format/seats-checks.d.ts +3 -0
- package/src/lib/format/seats-checks.js +13 -0
- package/src/lib/format/seats-checks.js.map +1 -0
- package/src/lib/format/seats-checks.mjs +10 -0
- package/src/lib/format/seats-checks.mjs.map +1 -0
- package/src/lib/format/sheet-head-checks.d.mts +4 -0
- package/src/lib/format/sheet-head-checks.d.ts +4 -0
- package/src/lib/format/sheet-head-checks.js +68 -0
- package/src/lib/format/sheet-head-checks.js.map +1 -0
- package/src/lib/format/sheet-head-checks.mjs +65 -0
- package/src/lib/format/sheet-head-checks.mjs.map +1 -0
- package/src/lib/format/signature-checks.d.mts +7 -0
- package/src/lib/format/signature-checks.d.ts +7 -0
- package/src/lib/format/signature-checks.js +32 -0
- package/src/lib/format/signature-checks.js.map +1 -0
- package/src/lib/format/signature-checks.mjs +29 -0
- package/src/lib/format/signature-checks.mjs.map +1 -0
- package/src/lib/format/signature-options.d.mts +24 -0
- package/src/lib/format/signature-options.d.ts +24 -0
- package/src/lib/format/signature-options.js +30 -0
- package/src/lib/format/signature-options.js.map +1 -0
- package/src/lib/format/signature-options.mjs +26 -0
- package/src/lib/format/signature-options.mjs.map +1 -0
- package/src/lib/format/slots-checks.d.mts +4 -0
- package/src/lib/format/slots-checks.d.ts +4 -0
- package/src/lib/format/slots-checks.js +21 -0
- package/src/lib/format/slots-checks.js.map +1 -0
- package/src/lib/format/slots-checks.mjs +18 -0
- package/src/lib/format/slots-checks.mjs.map +1 -0
- package/src/lib/format/statusbar-checks.d.mts +8 -0
- package/src/lib/format/statusbar-checks.d.ts +8 -0
- package/src/lib/format/statusbar-checks.js +35 -0
- package/src/lib/format/statusbar-checks.js.map +1 -0
- package/src/lib/format/statusbar-checks.mjs +32 -0
- package/src/lib/format/statusbar-checks.mjs.map +1 -0
- package/src/lib/format/table-checks.d.mts +21 -0
- package/src/lib/format/table-checks.d.ts +21 -0
- package/src/lib/format/table-checks.js +86 -0
- package/src/lib/format/table-checks.js.map +1 -0
- package/src/lib/format/table-checks.mjs +82 -0
- package/src/lib/format/table-checks.mjs.map +1 -0
- package/src/lib/format/translate.js +2 -2
- package/src/lib/format/translate.js.map +1 -1
- package/src/lib/format/translate.mjs +2 -2
- package/src/lib/format/translate.mjs.map +1 -1
- package/src/lib/format/upgrade.d.mts +6 -3
- package/src/lib/format/upgrade.d.ts +6 -3
- package/src/lib/format/upgrade.js +6 -3
- package/src/lib/format/upgrade.js.map +1 -1
- package/src/lib/format/upgrade.mjs +6 -3
- package/src/lib/format/upgrade.mjs.map +1 -1
- package/src/lib/format/validate.d.mts +18 -2
- package/src/lib/format/validate.d.ts +18 -2
- package/src/lib/format/validate.js +36 -3
- package/src/lib/format/validate.js.map +1 -1
- package/src/lib/format/validate.mjs +35 -3
- package/src/lib/format/validate.mjs.map +1 -1
- package/src/lib/format/version.d.mts +2 -2
- package/src/lib/format/version.d.ts +2 -2
- package/src/lib/format/version.js +2 -2
- package/src/lib/format/version.js.map +1 -1
- package/src/lib/format/version.mjs +2 -2
- package/src/lib/format/version.mjs.map +1 -1
- package/src/lib/format/words.d.mts +6 -2
- package/src/lib/format/words.d.ts +6 -2
- package/src/lib/format/words.js +13 -7
- package/src/lib/format/words.js.map +1 -1
- package/src/lib/format/words.mjs +13 -7
- package/src/lib/format/words.mjs.map +1 -1
- package/src/lib/parts.d.mts +45 -0
- package/src/lib/parts.d.ts +45 -0
- package/src/lib/parts.js +60 -0
- package/src/lib/parts.js.map +1 -0
- package/src/lib/parts.mjs +53 -0
- package/src/lib/parts.mjs.map +1 -0
- package/src/lib/record/cells.d.mts +3 -3
- package/src/lib/record/cells.d.ts +3 -3
- package/src/lib/record/cells.js +16 -15
- package/src/lib/record/cells.js.map +1 -1
- package/src/lib/record/cells.mjs +16 -15
- package/src/lib/record/cells.mjs.map +1 -1
- package/src/lib/record/compute.d.mts +16 -5
- package/src/lib/record/compute.d.ts +16 -5
- package/src/lib/record/compute.js +57 -16
- package/src/lib/record/compute.js.map +1 -1
- package/src/lib/record/compute.mjs +57 -16
- package/src/lib/record/compute.mjs.map +1 -1
- package/src/lib/record/data-source.d.mts +140 -3
- package/src/lib/record/data-source.d.ts +140 -3
- package/src/lib/record/data-source.js.map +1 -1
- package/src/lib/record/data-source.mjs.map +1 -1
- package/src/lib/record/drafts.d.mts +19 -0
- package/src/lib/record/drafts.d.ts +19 -0
- package/src/lib/record/drafts.js +35 -0
- package/src/lib/record/drafts.js.map +1 -0
- package/src/lib/record/drafts.mjs +31 -0
- package/src/lib/record/drafts.mjs.map +1 -0
- package/src/lib/record/env.d.mts +5 -1
- package/src/lib/record/env.d.ts +5 -1
- package/src/lib/record/env.js +9 -1
- package/src/lib/record/env.js.map +1 -1
- package/src/lib/record/env.mjs +8 -1
- package/src/lib/record/env.mjs.map +1 -1
- package/src/lib/record/form-limits.d.mts +81 -0
- package/src/lib/record/form-limits.d.ts +81 -0
- package/src/lib/record/form-limits.js +231 -0
- package/src/lib/record/form-limits.js.map +1 -0
- package/src/lib/record/form-limits.mjs +224 -0
- package/src/lib/record/form-limits.mjs.map +1 -0
- package/src/lib/record/form.d.mts +173 -4
- package/src/lib/record/form.d.ts +173 -4
- package/src/lib/record/form.js +792 -88
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +792 -88
- package/src/lib/record/form.mjs.map +1 -1
- package/src/lib/record/limits-part.d.mts +6 -0
- package/src/lib/record/limits-part.d.ts +6 -0
- package/src/lib/record/limits-part.js +12 -0
- package/src/lib/record/limits-part.js.map +1 -0
- package/src/lib/record/limits-part.mjs +7 -0
- package/src/lib/record/limits-part.mjs.map +1 -0
- package/src/lib/record/line-choices.d.mts +30 -0
- package/src/lib/record/line-choices.d.ts +30 -0
- package/src/lib/record/line-choices.js +42 -0
- package/src/lib/record/line-choices.js.map +1 -0
- package/src/lib/record/line-choices.mjs +36 -0
- package/src/lib/record/line-choices.mjs.map +1 -0
- package/src/lib/record/locales/ar.js +10 -0
- package/src/lib/record/locales/ar.js.map +1 -1
- package/src/lib/record/locales/ar.mjs +10 -0
- package/src/lib/record/locales/ar.mjs.map +1 -1
- package/src/lib/record/locales/de.js +10 -0
- package/src/lib/record/locales/de.js.map +1 -1
- package/src/lib/record/locales/de.mjs +10 -0
- package/src/lib/record/locales/de.mjs.map +1 -1
- package/src/lib/record/locales/fr.js +10 -0
- package/src/lib/record/locales/fr.js.map +1 -1
- package/src/lib/record/locales/fr.mjs +10 -0
- package/src/lib/record/locales/fr.mjs.map +1 -1
- package/src/lib/record/memory-data-source.d.mts +44 -3
- package/src/lib/record/memory-data-source.d.ts +44 -3
- package/src/lib/record/memory-data-source.js +102 -40
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +101 -40
- package/src/lib/record/memory-data-source.mjs.map +1 -1
- package/src/lib/record/memory-kept.d.mts +20 -0
- package/src/lib/record/memory-kept.d.ts +20 -0
- package/src/lib/record/memory-kept.js +46 -0
- package/src/lib/record/memory-kept.js.map +1 -0
- package/src/lib/record/memory-kept.mjs +43 -0
- package/src/lib/record/memory-kept.mjs.map +1 -0
- package/src/lib/record/memory-later.d.mts +19 -0
- package/src/lib/record/memory-later.d.ts +19 -0
- package/src/lib/record/memory-later.js +39 -0
- package/src/lib/record/memory-later.js.map +1 -0
- package/src/lib/record/memory-later.mjs +35 -0
- package/src/lib/record/memory-later.mjs.map +1 -0
- package/src/lib/record/memory-part.d.mts +7 -0
- package/src/lib/record/memory-part.d.ts +7 -0
- package/src/lib/record/memory-part.js +13 -0
- package/src/lib/record/memory-part.js.map +1 -0
- package/src/lib/record/memory-part.mjs +8 -0
- package/src/lib/record/memory-part.mjs.map +1 -0
- package/src/lib/record/messages.d.mts +17 -0
- package/src/lib/record/messages.d.ts +17 -0
- package/src/lib/record/messages.js +10 -0
- package/src/lib/record/messages.js.map +1 -1
- package/src/lib/record/messages.mjs +10 -0
- package/src/lib/record/messages.mjs.map +1 -1
- package/src/lib/record/option-rules.d.mts +50 -0
- package/src/lib/record/option-rules.d.ts +50 -0
- package/src/lib/record/option-rules.js +137 -0
- package/src/lib/record/option-rules.js.map +1 -0
- package/src/lib/record/option-rules.mjs +134 -0
- package/src/lib/record/option-rules.mjs.map +1 -0
- package/src/lib/record/rules.d.mts +2 -2
- package/src/lib/record/rules.d.ts +2 -2
- package/src/lib/record/rules.js +3 -3
- package/src/lib/record/rules.js.map +1 -1
- package/src/lib/record/rules.mjs +3 -3
- package/src/lib/record/rules.mjs.map +1 -1
- package/src/lib/record/run.js +9 -7
- package/src/lib/record/run.js.map +1 -1
- package/src/lib/record/run.mjs +9 -7
- package/src/lib/record/run.mjs.map +1 -1
- package/src/lib/record/search.d.mts +12 -2
- package/src/lib/record/search.d.ts +12 -2
- package/src/lib/record/search.js +29 -4
- package/src/lib/record/search.js.map +1 -1
- package/src/lib/record/search.mjs +29 -4
- package/src/lib/record/search.mjs.map +1 -1
- package/src/lib/record/set-when.d.mts +3 -3
- package/src/lib/record/set-when.d.ts +3 -3
- package/src/lib/record/set-when.js +9 -9
- package/src/lib/record/set-when.js.map +1 -1
- package/src/lib/record/set-when.mjs +9 -9
- package/src/lib/record/set-when.mjs.map +1 -1
- package/src/lib/record/signed.d.mts +21 -0
- package/src/lib/record/signed.d.ts +21 -0
- package/src/lib/record/signed.js +62 -0
- package/src/lib/record/signed.js.map +1 -0
- package/src/lib/record/signed.mjs +57 -0
- package/src/lib/record/signed.mjs.map +1 -0
- package/src/lib/record/taking.d.mts +60 -0
- package/src/lib/record/taking.d.ts +60 -0
- package/src/lib/record/taking.js +58 -0
- package/src/lib/record/taking.js.map +1 -0
- package/src/lib/record/taking.mjs +50 -0
- package/src/lib/record/taking.mjs.map +1 -0
- package/src/lib/record/value-map.js +11 -4
- package/src/lib/record/value-map.js.map +1 -1
- package/src/lib/record/value-map.mjs +11 -4
- package/src/lib/record/value-map.mjs.map +1 -1
- package/src/lib/record/values.d.mts +20 -0
- package/src/lib/record/values.d.ts +20 -0
- package/src/lib/record/values.js.map +1 -1
- package/src/lib/record/values.mjs.map +1 -1
- package/src/lib/record/waits.d.mts +6 -1
- package/src/lib/record/waits.d.ts +6 -1
- package/src/lib/record/waits.js +2 -2
- package/src/lib/record/waits.js.map +1 -1
- package/src/lib/record/waits.mjs +2 -2
- package/src/lib/record/waits.mjs.map +1 -1
- package/src/runtime.d.mts +16 -5
- package/src/runtime.d.ts +16 -5
- package/src/runtime.js +41 -3
- package/src/runtime.js.map +1 -1
- package/src/runtime.mjs +13 -0
- package/src/runtime.mjs.map +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Page } from './page.mjs';
|
|
2
|
+
/** What a page's limits are checked with: the reference check's own report, and its word that they are owed (`owe`). */
|
|
3
|
+
export interface LimitsTools {
|
|
4
|
+
report(path: string, message: string): void;
|
|
5
|
+
/** Said where checks come in a part that has not come (the one-tag script's: later-checks.ts): they are owed. */
|
|
6
|
+
owe(part: string): void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A page's `limits`: on a page of responses, saying something — when it opens or closes, its most responses, one per
|
|
10
|
+
* person — each day a day there is, closing after it opens. And `continueLater`: a page a person types in, never a
|
|
11
|
+
* list of records. In the one-tag script they come with the limits part, which a page with either asks for: run once
|
|
12
|
+
* it came (later-checks.ts).
|
|
13
|
+
*/
|
|
14
|
+
export declare function checkLimits(page: Page, tools: LimitsTools): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Page } from './page';
|
|
2
|
+
/** What a page's limits are checked with: the reference check's own report, and its word that they are owed (`owe`). */
|
|
3
|
+
export interface LimitsTools {
|
|
4
|
+
report(path: string, message: string): void;
|
|
5
|
+
/** Said where checks come in a part that has not come (the one-tag script's: later-checks.ts): they are owed. */
|
|
6
|
+
owe(part: string): void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A page's `limits`: on a page of responses, saying something — when it opens or closes, its most responses, one per
|
|
10
|
+
* person — each day a day there is, closing after it opens. And `continueLater`: a page a person types in, never a
|
|
11
|
+
* list of records. In the one-tag script they come with the limits part, which a page with either asks for: run once
|
|
12
|
+
* it came (later-checks.ts).
|
|
13
|
+
*/
|
|
14
|
+
export declare function checkLimits(page: Page, tools: LimitsTools): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkLimits = checkLimits;
|
|
4
|
+
const taking_1 = require("../record/taking");
|
|
5
|
+
/**
|
|
6
|
+
* A page's `limits`: on a page of responses, saying something — when it opens or closes, its most responses, one per
|
|
7
|
+
* person — each day a day there is, closing after it opens. And `continueLater`: a page a person types in, never a
|
|
8
|
+
* list of records. In the one-tag script they come with the limits part, which a page with either asks for: run once
|
|
9
|
+
* it came (later-checks.ts).
|
|
10
|
+
*/
|
|
11
|
+
function checkLimits(page, tools) {
|
|
12
|
+
const report = (path, message) => tools.report(path, message);
|
|
13
|
+
if (page.continueLater !== undefined && page.layout.type === 'list')
|
|
14
|
+
report('continueLater', 'Continue later keeps a person’s answers as they type them: a list of records has none to keep');
|
|
15
|
+
const limits = page.limits;
|
|
16
|
+
if (limits === undefined)
|
|
17
|
+
return;
|
|
18
|
+
if (page.data.kind !== 'responses')
|
|
19
|
+
report('limits', 'open and close dates and limits are for a page of responses — a sign-up, a survey, an offer; a choice’s places are its options’ seats on any page');
|
|
20
|
+
if (limits.opens === undefined && limits.closes === undefined && limits.maxResponses === undefined && limits.onePerPerson !== true)
|
|
21
|
+
report('limits', 'say when it opens or closes, the most responses it takes, or that it takes one from each person');
|
|
22
|
+
const opens = limits.opens !== undefined ? (0, taking_1.limitInstant)(limits.opens, page.timeZone) : null;
|
|
23
|
+
const closes = limits.closes !== undefined ? (0, taking_1.limitInstant)(limits.closes, page.timeZone, true) : null;
|
|
24
|
+
for (const [key, written, at] of [['opens', limits.opens, opens], ['closes', limits.closes, closes]]) {
|
|
25
|
+
if (written === undefined)
|
|
26
|
+
continue;
|
|
27
|
+
const day = written.slice(0, 10);
|
|
28
|
+
const [y, m, d] = day.split('-').map(Number);
|
|
29
|
+
const real = new Date(Date.UTC(y, m - 1, d));
|
|
30
|
+
if (at === null || real.getUTCMonth() !== m - 1 || real.getUTCDate() !== d)
|
|
31
|
+
report(`limits.${key}`, `${day} is no day of the calendar`);
|
|
32
|
+
}
|
|
33
|
+
if (opens !== null && closes !== null && closes <= opens)
|
|
34
|
+
report('limits.closes', 'it closes before it opens: closes comes after opens');
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=limits-checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits-checks.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/limits-checks.ts"],"names":[],"mappings":";;AAgBA,kCAiBC;AAhCD,6CAAgD;AAShD;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,IAAU,EAAE,KAAkB;IACxD,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9E,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM;QAAE,MAAM,CAAC,eAAe,EAAE,+FAA+F,CAAC,CAAC;IAC9L,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO;IACjC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW;QAAE,MAAM,CAAC,QAAQ,EAAE,mJAAmJ,CAAC,CAAC;IAC1M,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,IAAI,MAAM,CAAC,YAAY,KAAK,IAAI;QAAE,MAAM,CAAC,QAAQ,EAAE,iGAAiG,CAAC,CAAC;IACxP,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAA,qBAAY,EAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5F,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAA,qBAAY,EAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACrG,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAU,EAAE,CAAC;QAC9G,IAAI,OAAO,KAAK,SAAS;YAAE,SAAS;QACpC,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,IAAI,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;YAAE,MAAM,CAAC,UAAU,GAAG,EAAE,EAAE,GAAG,GAAG,4BAA4B,CAAC,CAAC;IAC1I,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK;QAAE,MAAM,CAAC,eAAe,EAAE,qDAAqD,CAAC,CAAC;AAC3I,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { limitInstant } from '../record/taking.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* A page's `limits`: on a page of responses, saying something — when it opens or closes, its most responses, one per
|
|
4
|
+
* person — each day a day there is, closing after it opens. And `continueLater`: a page a person types in, never a
|
|
5
|
+
* list of records. In the one-tag script they come with the limits part, which a page with either asks for: run once
|
|
6
|
+
* it came (later-checks.ts).
|
|
7
|
+
*/
|
|
8
|
+
export function checkLimits(page, tools) {
|
|
9
|
+
const report = (path, message) => tools.report(path, message);
|
|
10
|
+
if (page.continueLater !== undefined && page.layout.type === 'list')
|
|
11
|
+
report('continueLater', 'Continue later keeps a person’s answers as they type them: a list of records has none to keep');
|
|
12
|
+
const limits = page.limits;
|
|
13
|
+
if (limits === undefined)
|
|
14
|
+
return;
|
|
15
|
+
if (page.data.kind !== 'responses')
|
|
16
|
+
report('limits', 'open and close dates and limits are for a page of responses — a sign-up, a survey, an offer; a choice’s places are its options’ seats on any page');
|
|
17
|
+
if (limits.opens === undefined && limits.closes === undefined && limits.maxResponses === undefined && limits.onePerPerson !== true)
|
|
18
|
+
report('limits', 'say when it opens or closes, the most responses it takes, or that it takes one from each person');
|
|
19
|
+
const opens = limits.opens !== undefined ? limitInstant(limits.opens, page.timeZone) : null;
|
|
20
|
+
const closes = limits.closes !== undefined ? limitInstant(limits.closes, page.timeZone, true) : null;
|
|
21
|
+
for (const [key, written, at] of [['opens', limits.opens, opens], ['closes', limits.closes, closes]]) {
|
|
22
|
+
if (written === undefined)
|
|
23
|
+
continue;
|
|
24
|
+
const day = written.slice(0, 10);
|
|
25
|
+
const [y, m, d] = day.split('-').map(Number);
|
|
26
|
+
const real = new Date(Date.UTC(y, m - 1, d));
|
|
27
|
+
if (at === null || real.getUTCMonth() !== m - 1 || real.getUTCDate() !== d)
|
|
28
|
+
report(`limits.${key}`, `${day} is no day of the calendar`);
|
|
29
|
+
}
|
|
30
|
+
if (opens !== null && closes !== null && closes <= opens)
|
|
31
|
+
report('limits.closes', 'it closes before it opens: closes comes after opens');
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=limits-checks.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits-checks.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/limits-checks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAShD;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,IAAU,EAAE,KAAkB;IACxD,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9E,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM;QAAE,MAAM,CAAC,eAAe,EAAE,+FAA+F,CAAC,CAAC;IAC9L,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO;IACjC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW;QAAE,MAAM,CAAC,QAAQ,EAAE,mJAAmJ,CAAC,CAAC;IAC1M,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,IAAI,MAAM,CAAC,YAAY,KAAK,IAAI;QAAE,MAAM,CAAC,QAAQ,EAAE,iGAAiG,CAAC,CAAC;IACxP,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5F,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACrG,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAU,EAAE,CAAC;QAC9G,IAAI,OAAO,KAAK,SAAS;YAAE,SAAS;QACpC,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7C,IAAI,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;YAAE,MAAM,CAAC,UAAU,GAAG,EAAE,EAAE,GAAG,GAAG,4BAA4B,CAAC,CAAC;IAC1I,CAAC;IACD,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK;QAAE,MAAM,CAAC,eAAe,EAAE,qDAAqD,CAAC,CAAC;AAC3I,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* When a page of responses takes answers, and how many (`limits` on a page): a sign-up that opens on a day and closes
|
|
4
|
+
* on another, a limited offer that takes 200, a vote that takes one from each person. A closed form says so at once,
|
|
5
|
+
* as it is opened — when it opens, or when it closed, and the page's own words — and never takes answers it would
|
|
6
|
+
* refuse: a person learns it before they start, never after filling it.
|
|
7
|
+
*
|
|
8
|
+
* "limits": { "opens": "2026-11-01T09:00", "closes": "2026-11-20", "maxResponses": 200, "onePerPerson": true,
|
|
9
|
+
* "message": "Sign-ups for November are closed. See you in December." }
|
|
10
|
+
*
|
|
11
|
+
* `opens` and `closes` are read on the page's clock (`timeZone`; the browser's without one): a day alone opens at its
|
|
12
|
+
* first minute and closes at its end (the form takes answers through that day). They need nothing of the data
|
|
13
|
+
* source. `maxResponses` and `onePerPerson` are counted on the app's server, through the data source's `limits`
|
|
14
|
+
* (`responses`, `mine`): without it, they are not drawn on — the server's `submit` refuses as it would. A choice's
|
|
15
|
+
* places (`seats` on an option) are the option's own, on any page.
|
|
16
|
+
*/
|
|
17
|
+
export declare const PageLimitsSchema: z.ZodObject<{
|
|
18
|
+
opens: z.ZodOptional<z.ZodString>;
|
|
19
|
+
closes: z.ZodOptional<z.ZodString>;
|
|
20
|
+
maxResponses: z.ZodOptional<z.ZodInt>;
|
|
21
|
+
onePerPerson: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
message: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export type PageLimits = z.infer<typeof PageLimitsSchema>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* When a page of responses takes answers, and how many (`limits` on a page): a sign-up that opens on a day and closes
|
|
4
|
+
* on another, a limited offer that takes 200, a vote that takes one from each person. A closed form says so at once,
|
|
5
|
+
* as it is opened — when it opens, or when it closed, and the page's own words — and never takes answers it would
|
|
6
|
+
* refuse: a person learns it before they start, never after filling it.
|
|
7
|
+
*
|
|
8
|
+
* "limits": { "opens": "2026-11-01T09:00", "closes": "2026-11-20", "maxResponses": 200, "onePerPerson": true,
|
|
9
|
+
* "message": "Sign-ups for November are closed. See you in December." }
|
|
10
|
+
*
|
|
11
|
+
* `opens` and `closes` are read on the page's clock (`timeZone`; the browser's without one): a day alone opens at its
|
|
12
|
+
* first minute and closes at its end (the form takes answers through that day). They need nothing of the data
|
|
13
|
+
* source. `maxResponses` and `onePerPerson` are counted on the app's server, through the data source's `limits`
|
|
14
|
+
* (`responses`, `mine`): without it, they are not drawn on — the server's `submit` refuses as it would. A choice's
|
|
15
|
+
* places (`seats` on an option) are the option's own, on any page.
|
|
16
|
+
*/
|
|
17
|
+
export declare const PageLimitsSchema: z.ZodObject<{
|
|
18
|
+
opens: z.ZodOptional<z.ZodString>;
|
|
19
|
+
closes: z.ZodOptional<z.ZodString>;
|
|
20
|
+
maxResponses: z.ZodOptional<z.ZodInt>;
|
|
21
|
+
onePerPerson: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
message: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.z.core.$strict>;
|
|
24
|
+
export type PageLimits = z.infer<typeof PageLimitsSchema>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageLimitsSchema = void 0;
|
|
4
|
+
const z = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* A day ("2026-11-20"), a day and a time on the page's clock ("2026-11-01T09:00"), or an instant with its offset
|
|
7
|
+
* ("2026-11-01T07:00:00Z", "2026-11-01T09:00+02:00").
|
|
8
|
+
*/
|
|
9
|
+
const WHEN = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2})?)?$/;
|
|
10
|
+
const when = (what) => z.string().regex(WHEN, { error: `${what} is a day ("2026-11-20"), or a day and a time on the page's clock ("2026-11-01T09:00")` });
|
|
11
|
+
/**
|
|
12
|
+
* When a page of responses takes answers, and how many (`limits` on a page): a sign-up that opens on a day and closes
|
|
13
|
+
* on another, a limited offer that takes 200, a vote that takes one from each person. A closed form says so at once,
|
|
14
|
+
* as it is opened — when it opens, or when it closed, and the page's own words — and never takes answers it would
|
|
15
|
+
* refuse: a person learns it before they start, never after filling it.
|
|
16
|
+
*
|
|
17
|
+
* "limits": { "opens": "2026-11-01T09:00", "closes": "2026-11-20", "maxResponses": 200, "onePerPerson": true,
|
|
18
|
+
* "message": "Sign-ups for November are closed. See you in December." }
|
|
19
|
+
*
|
|
20
|
+
* `opens` and `closes` are read on the page's clock (`timeZone`; the browser's without one): a day alone opens at its
|
|
21
|
+
* first minute and closes at its end (the form takes answers through that day). They need nothing of the data
|
|
22
|
+
* source. `maxResponses` and `onePerPerson` are counted on the app's server, through the data source's `limits`
|
|
23
|
+
* (`responses`, `mine`): without it, they are not drawn on — the server's `submit` refuses as it would. A choice's
|
|
24
|
+
* places (`seats` on an option) are the option's own, on any page.
|
|
25
|
+
*/
|
|
26
|
+
exports.PageLimitsSchema = z
|
|
27
|
+
.strictObject({
|
|
28
|
+
opens: when('opens').optional(),
|
|
29
|
+
closes: when('closes').optional(),
|
|
30
|
+
maxResponses: z.int().min(1).max(100_000_000).optional(),
|
|
31
|
+
onePerPerson: z.boolean().optional(),
|
|
32
|
+
message: z.string().regex(/\S/, 'message is the page’s own words while it takes no answers').max(1000).optional(),
|
|
33
|
+
})
|
|
34
|
+
.meta({ id: 'PageLimits' });
|
|
35
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/limits.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AAEzB;;;GAGG;AACH,MAAM,IAAI,GAAG,6EAA6E,CAAC;AAC3F,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,wFAAwF,EAAE,CAAC,CAAC;AAElK;;;;;;;;;;;;;;GAcG;AACU,QAAA,gBAAgB,GAAG,CAAC;KAC9B,YAAY,CAAC;IACZ,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE;IACjC,YAAY,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;IACxD,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,2DAA2D,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;CAClH,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A day ("2026-11-20"), a day and a time on the page's clock ("2026-11-01T09:00"), or an instant with its offset
|
|
4
|
+
* ("2026-11-01T07:00:00Z", "2026-11-01T09:00+02:00").
|
|
5
|
+
*/
|
|
6
|
+
const WHEN = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2})?)?$/;
|
|
7
|
+
const when = (what) => z.string().regex(WHEN, { error: `${what} is a day ("2026-11-20"), or a day and a time on the page's clock ("2026-11-01T09:00")` });
|
|
8
|
+
/**
|
|
9
|
+
* When a page of responses takes answers, and how many (`limits` on a page): a sign-up that opens on a day and closes
|
|
10
|
+
* on another, a limited offer that takes 200, a vote that takes one from each person. A closed form says so at once,
|
|
11
|
+
* as it is opened — when it opens, or when it closed, and the page's own words — and never takes answers it would
|
|
12
|
+
* refuse: a person learns it before they start, never after filling it.
|
|
13
|
+
*
|
|
14
|
+
* "limits": { "opens": "2026-11-01T09:00", "closes": "2026-11-20", "maxResponses": 200, "onePerPerson": true,
|
|
15
|
+
* "message": "Sign-ups for November are closed. See you in December." }
|
|
16
|
+
*
|
|
17
|
+
* `opens` and `closes` are read on the page's clock (`timeZone`; the browser's without one): a day alone opens at its
|
|
18
|
+
* first minute and closes at its end (the form takes answers through that day). They need nothing of the data
|
|
19
|
+
* source. `maxResponses` and `onePerPerson` are counted on the app's server, through the data source's `limits`
|
|
20
|
+
* (`responses`, `mine`): without it, they are not drawn on — the server's `submit` refuses as it would. A choice's
|
|
21
|
+
* places (`seats` on an option) are the option's own, on any page.
|
|
22
|
+
*/
|
|
23
|
+
export const PageLimitsSchema = z
|
|
24
|
+
.strictObject({
|
|
25
|
+
opens: when('opens').optional(),
|
|
26
|
+
closes: when('closes').optional(),
|
|
27
|
+
maxResponses: z.int().min(1).max(100_000_000).optional(),
|
|
28
|
+
onePerPerson: z.boolean().optional(),
|
|
29
|
+
message: z.string().regex(/\S/, 'message is the page’s own words while it takes no answers').max(1000).optional(),
|
|
30
|
+
})
|
|
31
|
+
.meta({ id: 'PageLimits' });
|
|
32
|
+
//# sourceMappingURL=limits.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/limits.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB;;;GAGG;AACH,MAAM,IAAI,GAAG,6EAA6E,CAAC;AAC3F,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,wFAAwF,EAAE,CAAC,CAAC;AAElK;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,YAAY,CAAC;IACZ,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE;IACjC,YAAY,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE;IACxD,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,2DAA2D,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;CAClH,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ButtonNode, ListNode, MapCard, Pin, RelatedNode, StatButton } from './layout.mjs';
|
|
2
|
+
import type { Field, FilterItem, LineField } from './field.mjs';
|
|
3
|
+
import type { Page } from './page.mjs';
|
|
4
|
+
import type { Scope } from './references.mjs';
|
|
5
|
+
/**
|
|
6
|
+
* The checks of a list page's own settings (`layout.type: "list"`): its filters, buttons, calendar, map, filter bar,
|
|
7
|
+
* rows' cards and rules, Edit and Import — the reference check hands over its own tools, so what is said reads as the
|
|
8
|
+
* rest of its findings — and a related list's, which the list part draws too: what it shares with a list, its columns,
|
|
9
|
+
* order, search, cells and card.
|
|
10
|
+
* In the one-tag script they come with the list part, which draws what they check: a list page's are run once it came,
|
|
11
|
+
* before the page is drawn (later-checks.ts); the packages' `checkPage` and `validatePage` run them at once.
|
|
12
|
+
*/
|
|
13
|
+
export interface ListTools {
|
|
14
|
+
readonly page: Page;
|
|
15
|
+
need(name: string, path: string, scope?: Record<string, Field | LineField>): Field | LineField | undefined;
|
|
16
|
+
report(path: string, message: string): void;
|
|
17
|
+
claim(id: string, path: string): void;
|
|
18
|
+
checkModifiers(owner: object, path: string, keys?: readonly string[], scope?: Scope): void;
|
|
19
|
+
checkPress(button: ButtonNode | StatButton, path: string): void;
|
|
20
|
+
checkPlace(at: {
|
|
21
|
+
point?: string;
|
|
22
|
+
latitude?: string;
|
|
23
|
+
longitude?: string;
|
|
24
|
+
}, path: string, scope: Scope, pin?: Pin, card?: MapCard): void;
|
|
25
|
+
/** Where the page's own expressions read. */
|
|
26
|
+
here(): Scope;
|
|
27
|
+
/** Whether the page checked is a table's line's own form. */
|
|
28
|
+
readonly onLine: boolean;
|
|
29
|
+
/** A money field's currency: a field beside it, or on a line `parent.` and a field of the record. */
|
|
30
|
+
checkCurrency(name: string, path: string, fields: Record<string, Field | LineField>, lines: string | undefined, parent?: Record<string, Field | LineField>): void;
|
|
31
|
+
/** A time zone the browser knows. */
|
|
32
|
+
checkZone(zone: unknown, path: string): void;
|
|
33
|
+
/** A filter's conditions, each valueFrom one that reads. */
|
|
34
|
+
checkFilterItem(item: FilterItem, at: string, scope: Scope): void;
|
|
35
|
+
/** Said where checks come in a part that has not come (the one-tag script's: later-checks.ts): they are owed. */
|
|
36
|
+
owe(part: string): void;
|
|
37
|
+
}
|
|
38
|
+
export declare function checkList(list: ListNode, path: string, tools: ListTools): void;
|
|
39
|
+
/**
|
|
40
|
+
* A related list: on a record's page, its columns, order, search, cells, card and rows' rules of its own records'
|
|
41
|
+
* fields, its link to this record a link of theirs to this model where its fields name it, and its filter's
|
|
42
|
+
* `valueFrom` this record's.
|
|
43
|
+
*/
|
|
44
|
+
export declare function checkRelated(node: RelatedNode, path: string, tools: ListTools): void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ButtonNode, ListNode, MapCard, Pin, RelatedNode, StatButton } from './layout';
|
|
2
|
+
import type { Field, FilterItem, LineField } from './field';
|
|
3
|
+
import type { Page } from './page';
|
|
4
|
+
import type { Scope } from './references';
|
|
5
|
+
/**
|
|
6
|
+
* The checks of a list page's own settings (`layout.type: "list"`): its filters, buttons, calendar, map, filter bar,
|
|
7
|
+
* rows' cards and rules, Edit and Import — the reference check hands over its own tools, so what is said reads as the
|
|
8
|
+
* rest of its findings — and a related list's, which the list part draws too: what it shares with a list, its columns,
|
|
9
|
+
* order, search, cells and card.
|
|
10
|
+
* In the one-tag script they come with the list part, which draws what they check: a list page's are run once it came,
|
|
11
|
+
* before the page is drawn (later-checks.ts); the packages' `checkPage` and `validatePage` run them at once.
|
|
12
|
+
*/
|
|
13
|
+
export interface ListTools {
|
|
14
|
+
readonly page: Page;
|
|
15
|
+
need(name: string, path: string, scope?: Record<string, Field | LineField>): Field | LineField | undefined;
|
|
16
|
+
report(path: string, message: string): void;
|
|
17
|
+
claim(id: string, path: string): void;
|
|
18
|
+
checkModifiers(owner: object, path: string, keys?: readonly string[], scope?: Scope): void;
|
|
19
|
+
checkPress(button: ButtonNode | StatButton, path: string): void;
|
|
20
|
+
checkPlace(at: {
|
|
21
|
+
point?: string;
|
|
22
|
+
latitude?: string;
|
|
23
|
+
longitude?: string;
|
|
24
|
+
}, path: string, scope: Scope, pin?: Pin, card?: MapCard): void;
|
|
25
|
+
/** Where the page's own expressions read. */
|
|
26
|
+
here(): Scope;
|
|
27
|
+
/** Whether the page checked is a table's line's own form. */
|
|
28
|
+
readonly onLine: boolean;
|
|
29
|
+
/** A money field's currency: a field beside it, or on a line `parent.` and a field of the record. */
|
|
30
|
+
checkCurrency(name: string, path: string, fields: Record<string, Field | LineField>, lines: string | undefined, parent?: Record<string, Field | LineField>): void;
|
|
31
|
+
/** A time zone the browser knows. */
|
|
32
|
+
checkZone(zone: unknown, path: string): void;
|
|
33
|
+
/** A filter's conditions, each valueFrom one that reads. */
|
|
34
|
+
checkFilterItem(item: FilterItem, at: string, scope: Scope): void;
|
|
35
|
+
/** Said where checks come in a part that has not come (the one-tag script's: later-checks.ts): they are owed. */
|
|
36
|
+
owe(part: string): void;
|
|
37
|
+
}
|
|
38
|
+
export declare function checkList(list: ListNode, path: string, tools: ListTools): void;
|
|
39
|
+
/**
|
|
40
|
+
* A related list: on a record's page, its columns, order, search, cells, card and rows' rules of its own records'
|
|
41
|
+
* fields, its link to this record a link of theirs to this model where its fields name it, and its filter's
|
|
42
|
+
* `valueFrom` this record's.
|
|
43
|
+
*/
|
|
44
|
+
export declare function checkRelated(node: RelatedNode, path: string, tools: ListTools): void;
|