@fieldia/core 0.30.1 → 0.31.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 +362 -1
- package/package.json +1 -1
- package/schema/page.schema.json +758 -1
- package/src/index.d.mts +13 -2
- package/src/index.d.ts +13 -2
- package/src/index.js +45 -2
- package/src/index.js.map +1 -1
- package/src/index.mjs +18 -2
- package/src/index.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/actions.js +3 -0
- package/src/lib/format/actions.js.map +1 -1
- package/src/lib/format/actions.mjs +3 -0
- package/src/lib/format/actions.mjs.map +1 -1
- package/src/lib/format/address-search.js +3 -0
- package/src/lib/format/address-search.js.map +1 -1
- package/src/lib/format/address-search.mjs +3 -0
- package/src/lib/format/address-search.mjs.map +1 -1
- package/src/lib/format/duplicates.js +3 -0
- package/src/lib/format/duplicates.js.map +1 -1
- package/src/lib/format/duplicates.mjs +3 -0
- package/src/lib/format/duplicates.mjs.map +1 -1
- package/src/lib/format/endings.js +3 -0
- package/src/lib/format/endings.js.map +1 -1
- package/src/lib/format/endings.mjs +3 -0
- package/src/lib/format/endings.mjs.map +1 -1
- package/src/lib/format/field.d.mts +669 -0
- package/src/lib/format/field.d.ts +669 -0
- package/src/lib/format/field.js +42 -4
- package/src/lib/format/field.js.map +1 -1
- package/src/lib/format/field.mjs +42 -4
- package/src/lib/format/field.mjs.map +1 -1
- package/src/lib/format/flow-checks.d.mts +14 -0
- package/src/lib/format/flow-checks.d.ts +14 -0
- package/src/lib/format/flow-checks.js +61 -0
- package/src/lib/format/flow-checks.js.map +1 -0
- package/src/lib/format/flow-checks.mjs +58 -0
- package/src/lib/format/flow-checks.mjs.map +1 -0
- package/src/lib/format/flow.d.mts +43 -0
- package/src/lib/format/flow.d.ts +43 -0
- package/src/lib/format/flow.js +22 -0
- package/src/lib/format/flow.js.map +1 -0
- package/src/lib/format/flow.mjs +19 -0
- package/src/lib/format/flow.mjs.map +1 -0
- package/src/lib/format/from-schema.d.mts +70 -0
- package/src/lib/format/from-schema.d.ts +70 -0
- package/src/lib/format/from-schema.js +599 -0
- package/src/lib/format/from-schema.js.map +1 -0
- package/src/lib/format/from-schema.mjs +591 -0
- package/src/lib/format/from-schema.mjs.map +1 -0
- package/src/lib/format/jitless.d.mts +1 -0
- package/src/lib/format/jitless.d.ts +1 -0
- package/src/lib/format/jitless.js +27 -0
- package/src/lib/format/jitless.js.map +1 -0
- package/src/lib/format/jitless.mjs +24 -0
- package/src/lib/format/jitless.mjs.map +1 -0
- package/src/lib/format/json-schema.js +3 -0
- package/src/lib/format/json-schema.js.map +1 -1
- package/src/lib/format/json-schema.mjs +3 -0
- package/src/lib/format/json-schema.mjs.map +1 -1
- package/src/lib/format/json.js +3 -0
- package/src/lib/format/json.js.map +1 -1
- package/src/lib/format/json.mjs +3 -0
- package/src/lib/format/json.mjs.map +1 -1
- package/src/lib/format/languages-checks.d.mts +2 -1
- package/src/lib/format/languages-checks.d.ts +2 -1
- package/src/lib/format/languages-checks.js +8 -2
- package/src/lib/format/languages-checks.js.map +1 -1
- package/src/lib/format/languages-checks.mjs +8 -2
- package/src/lib/format/languages-checks.mjs.map +1 -1
- package/src/lib/format/later-checks.d.mts +3 -1
- package/src/lib/format/later-checks.d.ts +3 -1
- package/src/lib/format/later-checks.js +3 -1
- package/src/lib/format/later-checks.js.map +1 -1
- package/src/lib/format/later-checks.mjs +3 -1
- package/src/lib/format/later-checks.mjs.map +1 -1
- package/src/lib/format/layout.d.mts +13192 -7550
- package/src/lib/format/layout.d.ts +13192 -7550
- package/src/lib/format/layout.js +61 -3
- package/src/lib/format/layout.js.map +1 -1
- package/src/lib/format/layout.mjs +59 -1
- package/src/lib/format/layout.mjs.map +1 -1
- package/src/lib/format/layout.types.d.mts +3 -1
- package/src/lib/format/layout.types.d.ts +3 -1
- package/src/lib/format/limits.js +3 -0
- package/src/lib/format/limits.js.map +1 -1
- package/src/lib/format/limits.mjs +3 -0
- package/src/lib/format/limits.mjs.map +1 -1
- package/src/lib/format/list-checks.d.mts +1 -1
- package/src/lib/format/list-checks.d.ts +1 -1
- package/src/lib/format/list-checks.js +67 -22
- package/src/lib/format/list-checks.js.map +1 -1
- package/src/lib/format/list-checks.mjs +67 -22
- package/src/lib/format/list-checks.mjs.map +1 -1
- package/src/lib/format/list-rows-checks.d.mts +11 -0
- package/src/lib/format/list-rows-checks.d.ts +11 -0
- package/src/lib/format/list-rows-checks.js +62 -0
- package/src/lib/format/list-rows-checks.js.map +1 -0
- package/src/lib/format/list-rows-checks.mjs +59 -0
- package/src/lib/format/list-rows-checks.mjs.map +1 -0
- package/src/lib/format/media-options.d.mts +84 -0
- package/src/lib/format/media-options.d.ts +84 -0
- package/src/lib/format/media-options.js +86 -0
- package/src/lib/format/media-options.js.map +1 -0
- package/src/lib/format/media-options.mjs +80 -0
- package/src/lib/format/media-options.mjs.map +1 -0
- package/src/lib/format/outbox-checks.d.mts +11 -0
- package/src/lib/format/outbox-checks.d.ts +11 -0
- package/src/lib/format/outbox-checks.js +12 -0
- package/src/lib/format/outbox-checks.js.map +1 -0
- package/src/lib/format/outbox-checks.mjs +9 -0
- package/src/lib/format/outbox-checks.mjs.map +1 -0
- package/src/lib/format/page.d.mts +3057 -966
- package/src/lib/format/page.d.ts +3057 -966
- package/src/lib/format/page.js +15 -0
- package/src/lib/format/page.js.map +1 -1
- package/src/lib/format/page.mjs +15 -0
- package/src/lib/format/page.mjs.map +1 -1
- package/src/lib/format/part-checks.d.mts +3 -0
- package/src/lib/format/part-checks.d.ts +3 -0
- package/src/lib/format/payment-checks.d.mts +13 -0
- package/src/lib/format/payment-checks.d.ts +13 -0
- package/src/lib/format/payment-checks.js +30 -0
- package/src/lib/format/payment-checks.js.map +1 -0
- package/src/lib/format/payment-checks.mjs +27 -0
- package/src/lib/format/payment-checks.mjs.map +1 -0
- package/src/lib/format/payment.d.mts +37 -0
- package/src/lib/format/payment.d.ts +37 -0
- package/src/lib/format/payment.js +15 -0
- package/src/lib/format/payment.js.map +1 -0
- package/src/lib/format/payment.mjs +12 -0
- package/src/lib/format/payment.mjs.map +1 -0
- package/src/lib/format/phone.js +3 -0
- package/src/lib/format/phone.js.map +1 -1
- package/src/lib/format/phone.mjs +3 -0
- package/src/lib/format/phone.mjs.map +1 -1
- package/src/lib/format/picker-options.d.mts +12 -0
- package/src/lib/format/picker-options.d.ts +12 -0
- package/src/lib/format/picker-options.js +21 -3
- package/src/lib/format/picker-options.js.map +1 -1
- package/src/lib/format/picker-options.mjs +20 -2
- package/src/lib/format/picker-options.mjs.map +1 -1
- package/src/lib/format/prefill-checks.d.mts +13 -0
- package/src/lib/format/prefill-checks.d.ts +13 -0
- package/src/lib/format/prefill-checks.js +35 -0
- package/src/lib/format/prefill-checks.js.map +1 -0
- package/src/lib/format/prefill-checks.mjs +32 -0
- package/src/lib/format/prefill-checks.mjs.map +1 -0
- package/src/lib/format/prefill.d.mts +33 -0
- package/src/lib/format/prefill.d.ts +33 -0
- package/src/lib/format/prefill.js +20 -0
- package/src/lib/format/prefill.js.map +1 -0
- package/src/lib/format/prefill.mjs +17 -0
- package/src/lib/format/prefill.mjs.map +1 -0
- package/src/lib/format/quiz.d.mts +58 -0
- package/src/lib/format/quiz.d.ts +58 -0
- package/src/lib/format/quiz.js +24 -0
- package/src/lib/format/quiz.js.map +1 -0
- package/src/lib/format/quiz.mjs +21 -0
- package/src/lib/format/quiz.mjs.map +1 -0
- package/src/lib/format/records.js +3 -0
- package/src/lib/format/records.js.map +1 -1
- package/src/lib/format/records.mjs +3 -0
- package/src/lib/format/records.mjs.map +1 -1
- package/src/lib/format/references.d.mts +1 -1
- package/src/lib/format/references.d.ts +1 -1
- package/src/lib/format/references.js +56 -7
- package/src/lib/format/references.js.map +1 -1
- package/src/lib/format/references.mjs +57 -8
- package/src/lib/format/references.mjs.map +1 -1
- package/src/lib/format/schedule-checks.d.mts +8 -0
- package/src/lib/format/schedule-checks.d.ts +8 -0
- package/src/lib/format/schedule-checks.js +16 -0
- package/src/lib/format/schedule-checks.js.map +1 -0
- package/src/lib/format/schedule-checks.mjs +13 -0
- package/src/lib/format/schedule-checks.mjs.map +1 -0
- package/src/lib/format/signature-checks.d.mts +8 -0
- package/src/lib/format/signature-checks.d.ts +8 -0
- package/src/lib/format/signature-checks.js +21 -0
- package/src/lib/format/signature-checks.js.map +1 -1
- package/src/lib/format/signature-checks.mjs +20 -0
- package/src/lib/format/signature-checks.mjs.map +1 -1
- package/src/lib/format/signature-options.js +3 -0
- package/src/lib/format/signature-options.js.map +1 -1
- package/src/lib/format/signature-options.mjs +3 -0
- package/src/lib/format/signature-options.mjs.map +1 -1
- package/src/lib/format/slots-options.js +3 -0
- package/src/lib/format/slots-options.js.map +1 -1
- package/src/lib/format/slots-options.mjs +3 -0
- package/src/lib/format/slots-options.mjs.map +1 -1
- package/src/lib/format/templates-checks.d.mts +6 -0
- package/src/lib/format/templates-checks.d.ts +6 -0
- package/src/lib/format/templates-checks.js +16 -0
- package/src/lib/format/templates-checks.js.map +1 -0
- package/src/lib/format/templates-checks.mjs +13 -0
- package/src/lib/format/templates-checks.mjs.map +1 -0
- package/src/lib/format/translate.d.mts +2 -0
- package/src/lib/format/translate.d.ts +2 -0
- package/src/lib/format/translate.js +6 -2
- package/src/lib/format/translate.js.map +1 -1
- package/src/lib/format/translate.mjs +4 -2
- package/src/lib/format/translate.mjs.map +1 -1
- package/src/lib/format/typed-options.d.mts +43 -0
- package/src/lib/format/typed-options.d.ts +43 -0
- package/src/lib/format/typed-options.js +50 -0
- package/src/lib/format/typed-options.js.map +1 -0
- package/src/lib/format/typed-options.mjs +46 -0
- package/src/lib/format/typed-options.mjs.map +1 -0
- package/src/lib/format/upgrade.d.mts +5 -1
- package/src/lib/format/upgrade.d.ts +5 -1
- package/src/lib/format/upgrade.js +5 -1
- package/src/lib/format/upgrade.js.map +1 -1
- package/src/lib/format/upgrade.mjs +5 -1
- package/src/lib/format/upgrade.mjs.map +1 -1
- package/src/lib/format/validate.js +3 -0
- package/src/lib/format/validate.js.map +1 -1
- package/src/lib/format/validate.mjs +3 -0
- package/src/lib/format/validate.mjs.map +1 -1
- package/src/lib/format/verify-checks.d.mts +10 -0
- package/src/lib/format/verify-checks.d.ts +10 -0
- package/src/lib/format/verify-checks.js +44 -0
- package/src/lib/format/verify-checks.js.map +1 -0
- package/src/lib/format/verify-checks.mjs +41 -0
- package/src/lib/format/verify-checks.mjs.map +1 -0
- 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/week.d.mts +18 -0
- package/src/lib/format/week.d.ts +18 -0
- package/src/lib/format/week.js +58 -0
- package/src/lib/format/week.js.map +1 -0
- package/src/lib/format/week.mjs +55 -0
- package/src/lib/format/week.mjs.map +1 -0
- package/src/lib/record/approvals-part.d.mts +1 -1
- package/src/lib/record/approvals-part.d.ts +1 -1
- package/src/lib/record/approvals-part.js +2 -2
- package/src/lib/record/approvals-part.js.map +1 -1
- package/src/lib/record/approvals-part.mjs +1 -1
- package/src/lib/record/approvals-part.mjs.map +1 -1
- package/src/lib/record/data-source.d.mts +331 -0
- package/src/lib/record/data-source.d.ts +331 -0
- package/src/lib/record/data-source.js.map +1 -1
- package/src/lib/record/data-source.mjs.map +1 -1
- package/src/lib/record/day-words.d.mts +22 -1
- package/src/lib/record/day-words.d.ts +22 -1
- package/src/lib/record/day-words.js +29 -2
- package/src/lib/record/day-words.js.map +1 -1
- package/src/lib/record/day-words.mjs +24 -2
- package/src/lib/record/day-words.mjs.map +1 -1
- package/src/lib/record/files-part.d.mts +1 -0
- package/src/lib/record/files-part.d.ts +1 -0
- package/src/lib/record/files-part.js +7 -1
- package/src/lib/record/files-part.js.map +1 -1
- package/src/lib/record/files-part.mjs +5 -1
- package/src/lib/record/files-part.mjs.map +1 -1
- package/src/lib/record/form-approvals.d.mts +12 -17
- package/src/lib/record/form-approvals.d.ts +12 -17
- package/src/lib/record/form-approvals.js +14 -8
- package/src/lib/record/form-approvals.js.map +1 -1
- package/src/lib/record/form-approvals.mjs +13 -7
- package/src/lib/record/form-approvals.mjs.map +1 -1
- package/src/lib/record/form-limits.d.mts +4 -28
- package/src/lib/record/form-limits.d.ts +4 -28
- package/src/lib/record/form-limits.js +8 -5
- package/src/lib/record/form-limits.js.map +1 -1
- package/src/lib/record/form-limits.mjs +8 -5
- package/src/lib/record/form-limits.mjs.map +1 -1
- package/src/lib/record/form.d.mts +115 -3
- package/src/lib/record/form.d.ts +115 -3
- package/src/lib/record/form.js +262 -65
- package/src/lib/record/form.js.map +1 -1
- package/src/lib/record/form.mjs +263 -66
- package/src/lib/record/form.mjs.map +1 -1
- package/src/lib/record/history-steps.d.mts +38 -0
- package/src/lib/record/history-steps.d.ts +38 -0
- package/src/lib/record/history-steps.js +63 -0
- package/src/lib/record/history-steps.js.map +1 -0
- package/src/lib/record/history-steps.mjs +58 -0
- package/src/lib/record/history-steps.mjs.map +1 -0
- package/src/lib/record/history.d.mts +16 -0
- package/src/lib/record/history.d.ts +16 -0
- package/src/lib/record/history.js +3 -0
- package/src/lib/record/history.js.map +1 -0
- package/src/lib/record/history.mjs +2 -0
- package/src/lib/record/history.mjs.map +1 -0
- package/src/lib/record/input-rules.d.mts +2 -0
- package/src/lib/record/input-rules.d.ts +2 -0
- package/src/lib/record/input-rules.js +4 -1
- package/src/lib/record/input-rules.js.map +1 -1
- package/src/lib/record/input-rules.mjs +2 -0
- package/src/lib/record/input-rules.mjs.map +1 -1
- package/src/lib/record/joins.d.mts +143 -0
- package/src/lib/record/joins.d.ts +143 -0
- package/src/lib/record/joins.js +28 -0
- package/src/lib/record/joins.js.map +1 -0
- package/src/lib/record/joins.mjs +24 -0
- package/src/lib/record/joins.mjs.map +1 -0
- package/src/lib/record/limits.js +7 -4
- package/src/lib/record/limits.js.map +1 -1
- package/src/lib/record/limits.mjs +8 -5
- package/src/lib/record/limits.mjs.map +1 -1
- package/src/lib/record/link-values.d.mts +31 -0
- package/src/lib/record/link-values.d.ts +31 -0
- package/src/lib/record/link-values.js +132 -0
- package/src/lib/record/link-values.js.map +1 -0
- package/src/lib/record/link-values.mjs +125 -0
- package/src/lib/record/link-values.mjs.map +1 -0
- package/src/lib/record/live-later.d.mts +15 -0
- package/src/lib/record/live-later.d.ts +15 -0
- package/src/lib/record/live-later.js +10 -0
- package/src/lib/record/live-later.js.map +1 -0
- package/src/lib/record/live-later.mjs +7 -0
- package/src/lib/record/live-later.mjs.map +1 -0
- package/src/lib/record/live-part.d.mts +6 -0
- package/src/lib/record/live-part.d.ts +6 -0
- package/src/lib/record/live-part.js +12 -0
- package/src/lib/record/live-part.js.map +1 -0
- package/src/lib/record/live-part.mjs +7 -0
- package/src/lib/record/live-part.mjs.map +1 -0
- package/src/lib/record/live.d.mts +8 -0
- package/src/lib/record/live.d.ts +8 -0
- package/src/lib/record/live.js +133 -0
- package/src/lib/record/live.js.map +1 -0
- package/src/lib/record/live.mjs +129 -0
- package/src/lib/record/live.mjs.map +1 -0
- package/src/lib/record/locales/all.d.mts +5 -5
- package/src/lib/record/locales/all.d.ts +5 -5
- package/src/lib/record/locales/all.js +3 -3
- package/src/lib/record/locales/all.js.map +1 -1
- package/src/lib/record/locales/all.mjs +3 -3
- package/src/lib/record/locales/all.mjs.map +1 -1
- package/src/lib/record/locales/ar.js +8 -0
- package/src/lib/record/locales/ar.js.map +1 -1
- package/src/lib/record/locales/ar.mjs +8 -0
- package/src/lib/record/locales/ar.mjs.map +1 -1
- package/src/lib/record/locales/de.js +8 -0
- package/src/lib/record/locales/de.js.map +1 -1
- package/src/lib/record/locales/de.mjs +8 -0
- package/src/lib/record/locales/de.mjs.map +1 -1
- package/src/lib/record/locales/es.d.mts +8 -0
- package/src/lib/record/locales/es.d.ts +8 -0
- package/src/lib/record/locales/es.js +111 -0
- package/src/lib/record/locales/es.js.map +1 -0
- package/src/lib/record/locales/es.mjs +108 -0
- package/src/lib/record/locales/es.mjs.map +1 -0
- package/src/lib/record/locales/fa.d.mts +5 -0
- package/src/lib/record/locales/fa.d.ts +5 -0
- package/src/lib/record/locales/fa.js +117 -0
- package/src/lib/record/locales/fa.js.map +1 -0
- package/src/lib/record/locales/fa.mjs +114 -0
- package/src/lib/record/locales/fa.mjs.map +1 -0
- package/src/lib/record/locales/fr.js +8 -0
- package/src/lib/record/locales/fr.js.map +1 -1
- package/src/lib/record/locales/fr.mjs +8 -0
- package/src/lib/record/locales/fr.mjs.map +1 -1
- package/src/lib/record/locales/later.d.mts +8 -0
- package/src/lib/record/locales/later.d.ts +8 -0
- package/src/lib/record/locales/later.js +16 -0
- package/src/lib/record/locales/later.js.map +1 -0
- package/src/lib/record/locales/later.mjs +13 -0
- package/src/lib/record/locales/later.mjs.map +1 -0
- package/src/lib/record/locales/tr.d.mts +6 -0
- package/src/lib/record/locales/tr.d.ts +6 -0
- package/src/lib/record/locales/tr.js +118 -0
- package/src/lib/record/locales/tr.js.map +1 -0
- package/src/lib/record/locales/tr.mjs +115 -0
- package/src/lib/record/locales/tr.mjs.map +1 -0
- package/src/lib/record/locales/ur.d.mts +9 -0
- package/src/lib/record/locales/ur.d.ts +9 -0
- package/src/lib/record/locales/ur.js +118 -0
- package/src/lib/record/locales/ur.js.map +1 -0
- package/src/lib/record/locales/ur.mjs +115 -0
- package/src/lib/record/locales/ur.mjs.map +1 -0
- package/src/lib/record/memory-codes.d.mts +37 -0
- package/src/lib/record/memory-codes.d.ts +37 -0
- package/src/lib/record/memory-codes.js +50 -0
- package/src/lib/record/memory-codes.js.map +1 -0
- package/src/lib/record/memory-codes.mjs +47 -0
- package/src/lib/record/memory-codes.mjs.map +1 -0
- package/src/lib/record/memory-data-source.d.mts +56 -2
- package/src/lib/record/memory-data-source.d.ts +56 -2
- package/src/lib/record/memory-data-source.js +67 -1
- package/src/lib/record/memory-data-source.js.map +1 -1
- package/src/lib/record/memory-data-source.mjs +67 -1
- package/src/lib/record/memory-data-source.mjs.map +1 -1
- package/src/lib/record/memory-kept.d.mts +3 -1
- package/src/lib/record/memory-kept.d.ts +3 -1
- package/src/lib/record/memory-kept.js +7 -2
- package/src/lib/record/memory-kept.js.map +1 -1
- package/src/lib/record/memory-kept.mjs +7 -2
- package/src/lib/record/memory-kept.mjs.map +1 -1
- package/src/lib/record/memory-later.d.mts +3 -1
- package/src/lib/record/memory-later.d.ts +3 -1
- package/src/lib/record/memory-later.js +9 -5
- package/src/lib/record/memory-later.js.map +1 -1
- package/src/lib/record/memory-later.mjs +8 -4
- package/src/lib/record/memory-later.mjs.map +1 -1
- package/src/lib/record/memory-live.d.mts +8 -0
- package/src/lib/record/memory-live.d.ts +8 -0
- package/src/lib/record/memory-live.js +70 -0
- package/src/lib/record/memory-live.js.map +1 -0
- package/src/lib/record/memory-live.mjs +67 -0
- package/src/lib/record/memory-live.mjs.map +1 -0
- package/src/lib/record/memory-views.d.mts +11 -0
- package/src/lib/record/memory-views.d.ts +11 -0
- package/src/lib/record/memory-views.js +60 -0
- package/src/lib/record/memory-views.js.map +1 -0
- package/src/lib/record/memory-views.mjs +57 -0
- package/src/lib/record/memory-views.mjs.map +1 -0
- package/src/lib/record/messages.d.mts +21 -3
- package/src/lib/record/messages.d.ts +21 -3
- package/src/lib/record/messages.js +15 -2
- package/src/lib/record/messages.js.map +1 -1
- package/src/lib/record/messages.mjs +15 -2
- package/src/lib/record/messages.mjs.map +1 -1
- package/src/lib/record/order.d.mts +21 -0
- package/src/lib/record/order.d.ts +21 -0
- package/src/lib/record/order.js +129 -0
- package/src/lib/record/order.js.map +1 -0
- package/src/lib/record/order.mjs +122 -0
- package/src/lib/record/order.mjs.map +1 -0
- package/src/lib/record/outbox-form.d.mts +79 -0
- package/src/lib/record/outbox-form.d.ts +79 -0
- package/src/lib/record/outbox-form.js +291 -0
- package/src/lib/record/outbox-form.js.map +1 -0
- package/src/lib/record/outbox-form.mjs +286 -0
- package/src/lib/record/outbox-form.mjs.map +1 -0
- package/src/lib/record/outbox-part.d.mts +6 -0
- package/src/lib/record/outbox-part.d.ts +6 -0
- package/src/lib/record/outbox-part.js +13 -0
- package/src/lib/record/outbox-part.js.map +1 -0
- package/src/lib/record/outbox-part.mjs +7 -0
- package/src/lib/record/outbox-part.mjs.map +1 -0
- package/src/lib/record/pay-part.d.mts +6 -0
- package/src/lib/record/pay-part.d.ts +6 -0
- package/src/lib/record/pay-part.js +11 -0
- package/src/lib/record/pay-part.js.map +1 -0
- package/src/lib/record/pay-part.mjs +7 -0
- package/src/lib/record/pay-part.mjs.map +1 -0
- package/src/lib/record/payment-form.d.mts +25 -0
- package/src/lib/record/payment-form.d.ts +25 -0
- package/src/lib/record/payment-form.js +98 -0
- package/src/lib/record/payment-form.js.map +1 -0
- package/src/lib/record/payment-form.mjs +95 -0
- package/src/lib/record/payment-form.mjs.map +1 -0
- package/src/lib/record/prefill-part.d.mts +7 -0
- package/src/lib/record/prefill-part.d.ts +7 -0
- package/src/lib/record/prefill-part.js +15 -0
- package/src/lib/record/prefill-part.js.map +1 -0
- package/src/lib/record/prefill-part.mjs +8 -0
- package/src/lib/record/prefill-part.mjs.map +1 -0
- package/src/lib/record/press-undo.d.mts +42 -0
- package/src/lib/record/press-undo.d.ts +42 -0
- package/src/lib/record/press-undo.js +115 -0
- package/src/lib/record/press-undo.js.map +1 -0
- package/src/lib/record/press-undo.mjs +110 -0
- package/src/lib/record/press-undo.mjs.map +1 -0
- package/src/lib/record/quiz.d.mts +36 -0
- package/src/lib/record/quiz.d.ts +36 -0
- package/src/lib/record/quiz.js +90 -0
- package/src/lib/record/quiz.js.map +1 -0
- package/src/lib/record/quiz.mjs +87 -0
- package/src/lib/record/quiz.mjs.map +1 -0
- package/src/lib/record/record-words.js +1 -1
- package/src/lib/record/record-words.js.map +1 -1
- package/src/lib/record/record-words.mjs +1 -1
- package/src/lib/record/record-words.mjs.map +1 -1
- package/src/lib/record/run.d.mts +54 -2
- package/src/lib/record/run.d.ts +54 -2
- package/src/lib/record/run.js +30 -6
- package/src/lib/record/run.js.map +1 -1
- package/src/lib/record/run.mjs +28 -5
- package/src/lib/record/run.mjs.map +1 -1
- package/src/lib/record/survey-kit.d.mts +37 -0
- package/src/lib/record/survey-kit.d.ts +37 -0
- package/src/lib/record/survey-kit.js +99 -0
- package/src/lib/record/survey-kit.js.map +1 -0
- package/src/lib/record/survey-kit.mjs +96 -0
- package/src/lib/record/survey-kit.mjs.map +1 -0
- package/src/lib/record/survey.d.mts +16 -0
- package/src/lib/record/survey.d.ts +16 -0
- package/src/lib/record/survey.js +17 -0
- package/src/lib/record/survey.js.map +1 -0
- package/src/lib/record/survey.mjs +13 -0
- package/src/lib/record/survey.mjs.map +1 -0
- package/src/lib/record/surveyflow-part.d.mts +9 -0
- package/src/lib/record/surveyflow-part.d.ts +9 -0
- package/src/lib/record/surveyflow-part.js +20 -0
- package/src/lib/record/surveyflow-part.js.map +1 -0
- package/src/lib/record/surveyflow-part.mjs +10 -0
- package/src/lib/record/surveyflow-part.mjs.map +1 -0
- package/src/lib/record/timing.d.mts +76 -0
- package/src/lib/record/timing.d.ts +76 -0
- package/src/lib/record/timing.js +112 -0
- package/src/lib/record/timing.js.map +1 -0
- package/src/lib/record/timing.mjs +104 -0
- package/src/lib/record/timing.mjs.map +1 -0
- package/src/lib/record/undo-later.d.mts +9 -0
- package/src/lib/record/undo-later.d.ts +9 -0
- package/src/lib/record/undo-later.js +10 -0
- package/src/lib/record/undo-later.js.map +1 -0
- package/src/lib/record/undo-later.mjs +7 -0
- package/src/lib/record/undo-later.mjs.map +1 -0
- package/src/lib/record/undo-part.d.mts +8 -0
- package/src/lib/record/undo-part.d.ts +8 -0
- package/src/lib/record/undo-part.js +17 -0
- package/src/lib/record/undo-part.js.map +1 -0
- package/src/lib/record/undo-part.mjs +9 -0
- package/src/lib/record/undo-part.mjs.map +1 -0
- package/src/lib/record/upload-to-later.d.mts +10 -0
- package/src/lib/record/upload-to-later.d.ts +10 -0
- package/src/lib/record/upload-to-later.js +15 -0
- package/src/lib/record/upload-to-later.js.map +1 -0
- package/src/lib/record/upload-to-later.mjs +12 -0
- package/src/lib/record/upload-to-later.mjs.map +1 -0
- package/src/lib/record/uploads.d.mts +5 -0
- package/src/lib/record/uploads.d.ts +5 -0
- package/src/lib/record/uploads.js.map +1 -1
- package/src/lib/record/uploads.mjs.map +1 -1
- package/src/lib/record/values.d.mts +6 -0
- package/src/lib/record/values.d.ts +6 -0
- package/src/lib/record/values.js.map +1 -1
- package/src/lib/record/values.mjs.map +1 -1
- package/src/lib/record/verify-form.d.mts +24 -0
- package/src/lib/record/verify-form.d.ts +24 -0
- package/src/lib/record/verify-form.js +65 -0
- package/src/lib/record/verify-form.js.map +1 -0
- package/src/lib/record/verify-form.mjs +62 -0
- package/src/lib/record/verify-form.mjs.map +1 -0
- package/src/lib/record/verify-part.d.mts +6 -0
- package/src/lib/record/verify-part.d.ts +6 -0
- package/src/lib/record/verify-part.js +11 -0
- package/src/lib/record/verify-part.js.map +1 -0
- package/src/lib/record/verify-part.mjs +7 -0
- package/src/lib/record/verify-part.mjs.map +1 -0
- package/src/lib/record/words-chunks.d.mts +37 -0
- package/src/lib/record/words-chunks.d.ts +37 -0
- package/src/lib/record/words-chunks.js +94 -0
- package/src/lib/record/words-chunks.js.map +1 -0
- package/src/lib/record/words-chunks.mjs +86 -0
- package/src/lib/record/words-chunks.mjs.map +1 -0
- package/src/runtime.d.mts +28 -6
- package/src/runtime.d.ts +28 -6
- package/src/runtime.js +35 -6
- package/src/runtime.js.map +1 -1
- package/src/runtime.mjs +15 -3
- package/src/runtime.mjs.map +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkPrefill = checkPrefill;
|
|
4
|
+
/** The kinds a link's words fill as the page opens (`prefill`): read as linkValue reads them. */
|
|
5
|
+
const PREFILLED_KINDS = new Set(['char', 'text', 'integer', 'float', 'monetary', 'boolean', 'selection', 'date', 'datetime']);
|
|
6
|
+
/**
|
|
7
|
+
* The fields a link fills (`prefill.fromUrl`): each a field of the page that reads a link's words — a line of text, a
|
|
8
|
+
* number, a yes or no, a choice of the page's own options, a day — filled by one parameter, never worked out. In the
|
|
9
|
+
* one-tag script they come with the prefill part, which a page with `prefill` asks for (later-checks.ts).
|
|
10
|
+
*/
|
|
11
|
+
function checkPrefill(page, tools) {
|
|
12
|
+
const report = (path, message) => tools.report(path, message);
|
|
13
|
+
if (page.layout.type === 'list')
|
|
14
|
+
return report('prefill', 'a link fills the answers of a record or a response as it starts: a list of records has none');
|
|
15
|
+
const filled = new Set();
|
|
16
|
+
(page.prefill?.fromUrl ?? []).forEach((one, i) => {
|
|
17
|
+
const at = `prefill.fromUrl[${i}]`;
|
|
18
|
+
const [param, name] = typeof one === 'string' ? [one, one] : [one.param, one.field];
|
|
19
|
+
if (filled.has(name))
|
|
20
|
+
return report(at, `"${name}" is filled by two of the link's parameters: name it once`);
|
|
21
|
+
filled.add(name);
|
|
22
|
+
const def = page.fields[name];
|
|
23
|
+
if (!def)
|
|
24
|
+
return report(at, `no field "${name}" for the link's "${param}" to fill: add it to the page's fields (placed nowhere, it is a hidden field, sent with the answers)`);
|
|
25
|
+
if (def.compute !== undefined)
|
|
26
|
+
return report(at, `"${name}" is worked out from other fields: a link cannot fill it`);
|
|
27
|
+
if (Array.isArray(def.translate))
|
|
28
|
+
return report(at, `"${name}" keeps its text in several languages, each typed by a person: a link's words fill none of them`);
|
|
29
|
+
if (!PREFILLED_KINDS.has(def.type))
|
|
30
|
+
return report(at, `"${name}" is a ${def.type}: a link's words fill a line of text, a number, a yes or no, a choice or a day — keep them in a text field (an agent's code), and let your app link the record`);
|
|
31
|
+
if (def.type === 'selection' && def.optionsFrom !== undefined)
|
|
32
|
+
report(at, `"${name}" takes its options from elsewhere: a link fills a choice of the page's own options`);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=prefill-checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefill-checks.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/prefill-checks.ts"],"names":[],"mappings":";;AAiBA,oCAgBC;AA/BD,iGAAiG;AACjG,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAS9H;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAU,EAAE,KAAmB;IAC1D,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9E,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC,SAAS,EAAE,6FAA6F,CAAC,CAAC;IACzJ,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QAC/C,MAAM,EAAE,GAAG,mBAAmB,CAAC,GAAG,CAAC;QACnC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QACpF,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,MAAM,CAAC,EAAE,EAAE,IAAI,IAAI,2DAA2D,CAAC,CAAC;QAC7G,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjB,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG;YAAE,OAAO,MAAM,CAAC,EAAE,EAAE,aAAa,IAAI,qBAAqB,KAAK,sGAAsG,CAAC,CAAC;QAC/K,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC,EAAE,EAAE,IAAI,IAAI,0DAA0D,CAAC,CAAC;QACrH,IAAI,KAAK,CAAC,OAAO,CAAE,GAA+B,CAAC,SAAS,CAAC;YAAE,OAAO,MAAM,CAAC,EAAE,EAAE,IAAI,IAAI,iGAAiG,CAAC,CAAC;QAC5L,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,MAAM,CAAC,EAAE,EAAE,IAAI,IAAI,UAAU,GAAG,CAAC,IAAI,gKAAgK,CAAC,CAAC;QAClP,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,WAAW,KAAK,SAAS;YAAE,MAAM,CAAC,EAAE,EAAE,IAAI,IAAI,qFAAqF,CAAC,CAAC;IAC3K,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** The kinds a link's words fill as the page opens (`prefill`): read as linkValue reads them. */
|
|
2
|
+
const PREFILLED_KINDS = new Set(['char', 'text', 'integer', 'float', 'monetary', 'boolean', 'selection', 'date', 'datetime']);
|
|
3
|
+
/**
|
|
4
|
+
* The fields a link fills (`prefill.fromUrl`): each a field of the page that reads a link's words — a line of text, a
|
|
5
|
+
* number, a yes or no, a choice of the page's own options, a day — filled by one parameter, never worked out. In the
|
|
6
|
+
* one-tag script they come with the prefill part, which a page with `prefill` asks for (later-checks.ts).
|
|
7
|
+
*/
|
|
8
|
+
export function checkPrefill(page, tools) {
|
|
9
|
+
const report = (path, message) => tools.report(path, message);
|
|
10
|
+
if (page.layout.type === 'list')
|
|
11
|
+
return report('prefill', 'a link fills the answers of a record or a response as it starts: a list of records has none');
|
|
12
|
+
const filled = new Set();
|
|
13
|
+
(page.prefill?.fromUrl ?? []).forEach((one, i) => {
|
|
14
|
+
const at = `prefill.fromUrl[${i}]`;
|
|
15
|
+
const [param, name] = typeof one === 'string' ? [one, one] : [one.param, one.field];
|
|
16
|
+
if (filled.has(name))
|
|
17
|
+
return report(at, `"${name}" is filled by two of the link's parameters: name it once`);
|
|
18
|
+
filled.add(name);
|
|
19
|
+
const def = page.fields[name];
|
|
20
|
+
if (!def)
|
|
21
|
+
return report(at, `no field "${name}" for the link's "${param}" to fill: add it to the page's fields (placed nowhere, it is a hidden field, sent with the answers)`);
|
|
22
|
+
if (def.compute !== undefined)
|
|
23
|
+
return report(at, `"${name}" is worked out from other fields: a link cannot fill it`);
|
|
24
|
+
if (Array.isArray(def.translate))
|
|
25
|
+
return report(at, `"${name}" keeps its text in several languages, each typed by a person: a link's words fill none of them`);
|
|
26
|
+
if (!PREFILLED_KINDS.has(def.type))
|
|
27
|
+
return report(at, `"${name}" is a ${def.type}: a link's words fill a line of text, a number, a yes or no, a choice or a day — keep them in a text field (an agent's code), and let your app link the record`);
|
|
28
|
+
if (def.type === 'selection' && def.optionsFrom !== undefined)
|
|
29
|
+
report(at, `"${name}" takes its options from elsewhere: a link fills a choice of the page's own options`);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=prefill-checks.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefill-checks.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/prefill-checks.ts"],"names":[],"mappings":"AAEA,iGAAiG;AACjG,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAS9H;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAU,EAAE,KAAmB;IAC1D,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9E,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC,SAAS,EAAE,6FAA6F,CAAC,CAAC;IACzJ,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QAC/C,MAAM,EAAE,GAAG,mBAAmB,CAAC,GAAG,CAAC;QACnC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QACpF,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,MAAM,CAAC,EAAE,EAAE,IAAI,IAAI,2DAA2D,CAAC,CAAC;QAC7G,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjB,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG;YAAE,OAAO,MAAM,CAAC,EAAE,EAAE,aAAa,IAAI,qBAAqB,KAAK,sGAAsG,CAAC,CAAC;QAC/K,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC,EAAE,EAAE,IAAI,IAAI,0DAA0D,CAAC,CAAC;QACrH,IAAI,KAAK,CAAC,OAAO,CAAE,GAA+B,CAAC,SAAS,CAAC;YAAE,OAAO,MAAM,CAAC,EAAE,EAAE,IAAI,IAAI,iGAAiG,CAAC,CAAC;QAC5L,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO,MAAM,CAAC,EAAE,EAAE,IAAI,IAAI,UAAU,GAAG,CAAC,IAAI,gKAAgK,CAAC,CAAC;QAClP,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,WAAW,KAAK,SAAS;YAAE,MAAM,CAAC,EAAE,EAAE,IAAI,IAAI,qFAAqF,CAAC,CAAC;IAC3K,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A link's parameter that fills a field as the page opens: the field of its own name, or another (`field`) — a
|
|
4
|
+
* campaign's `utm_source` into `source`, a broker's `agent` into `agent_code`.
|
|
5
|
+
*/
|
|
6
|
+
export type PrefillParam = string | {
|
|
7
|
+
param: string;
|
|
8
|
+
field: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Fields filled from the link a page is opened with (`prefill` on a page): a campaign's, a broker's, a listing's —
|
|
12
|
+
* `?utm_source=whatsapp&agent=mona&unit=B-12` — with no code of the app's. Each parameter named fills the field of its
|
|
13
|
+
* name, or the `field` it names, as the form starts (a new record, a response, and each started again with Submit
|
|
14
|
+
* another), read as that field reads words: a number as a number, a yes or no, a choice by one of its options' values,
|
|
15
|
+
* a day as 2026-10-20; one that does not read so is left out, never guessed. What the person types afterwards is
|
|
16
|
+
* theirs, and a draft opened over it is too: the link never writes over an answer.
|
|
17
|
+
*
|
|
18
|
+
* "prefill": { "fromUrl": ["utm_source", "utm_campaign", { "param": "agent", "field": "agent_code" }] }
|
|
19
|
+
*
|
|
20
|
+
* A field the page fills so and places nowhere is a hidden field: sent with the answers all the same (a page of
|
|
21
|
+
* responses sends only what its questions show, and these besides), seen by no one. One placed on the page shows the
|
|
22
|
+
* value the link gave, for the person to keep or change.
|
|
23
|
+
*/
|
|
24
|
+
export interface PagePrefill {
|
|
25
|
+
/** The link's parameters, by name, each filling the field of its name — or `{ param, field }` where the two differ. */
|
|
26
|
+
fromUrl: PrefillParam[];
|
|
27
|
+
}
|
|
28
|
+
export declare const PagePrefillSchema: z.ZodObject<{
|
|
29
|
+
fromUrl: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
30
|
+
param: z.ZodString;
|
|
31
|
+
field: z.ZodString;
|
|
32
|
+
}, z.core.$strict>]>>;
|
|
33
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A link's parameter that fills a field as the page opens: the field of its own name, or another (`field`) — a
|
|
4
|
+
* campaign's `utm_source` into `source`, a broker's `agent` into `agent_code`.
|
|
5
|
+
*/
|
|
6
|
+
export type PrefillParam = string | {
|
|
7
|
+
param: string;
|
|
8
|
+
field: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Fields filled from the link a page is opened with (`prefill` on a page): a campaign's, a broker's, a listing's —
|
|
12
|
+
* `?utm_source=whatsapp&agent=mona&unit=B-12` — with no code of the app's. Each parameter named fills the field of its
|
|
13
|
+
* name, or the `field` it names, as the form starts (a new record, a response, and each started again with Submit
|
|
14
|
+
* another), read as that field reads words: a number as a number, a yes or no, a choice by one of its options' values,
|
|
15
|
+
* a day as 2026-10-20; one that does not read so is left out, never guessed. What the person types afterwards is
|
|
16
|
+
* theirs, and a draft opened over it is too: the link never writes over an answer.
|
|
17
|
+
*
|
|
18
|
+
* "prefill": { "fromUrl": ["utm_source", "utm_campaign", { "param": "agent", "field": "agent_code" }] }
|
|
19
|
+
*
|
|
20
|
+
* A field the page fills so and places nowhere is a hidden field: sent with the answers all the same (a page of
|
|
21
|
+
* responses sends only what its questions show, and these besides), seen by no one. One placed on the page shows the
|
|
22
|
+
* value the link gave, for the person to keep or change.
|
|
23
|
+
*/
|
|
24
|
+
export interface PagePrefill {
|
|
25
|
+
/** The link's parameters, by name, each filling the field of its name — or `{ param, field }` where the two differ. */
|
|
26
|
+
fromUrl: PrefillParam[];
|
|
27
|
+
}
|
|
28
|
+
export declare const PagePrefillSchema: z.ZodObject<{
|
|
29
|
+
fromUrl: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
30
|
+
param: z.ZodString;
|
|
31
|
+
field: z.ZodString;
|
|
32
|
+
}, z.z.core.$strict>]>>;
|
|
33
|
+
}, z.z.core.$strict>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PagePrefillSchema = void 0;
|
|
4
|
+
const z = require("zod");
|
|
5
|
+
const names_1 = require("./names");
|
|
6
|
+
const PARAM = /^[A-Za-z0-9_.~-]{1,100}$/;
|
|
7
|
+
exports.PagePrefillSchema = z
|
|
8
|
+
.strictObject({
|
|
9
|
+
fromUrl: z
|
|
10
|
+
.array(z.union([
|
|
11
|
+
z.string().regex(names_1.FIELD_NAME, { error: 'a parameter named alone fills the field of its name: a field’s name ("utm_source"), or { "param": …, "field": … }' }),
|
|
12
|
+
z.strictObject({
|
|
13
|
+
param: z.string().regex(PARAM, { error: 'a link’s parameter is letters, digits and _ . ~ -, at most 100' }),
|
|
14
|
+
field: z.string().regex(names_1.FIELD_NAME),
|
|
15
|
+
}),
|
|
16
|
+
]))
|
|
17
|
+
.min(1, { error: 'name at least one parameter of the link' }),
|
|
18
|
+
})
|
|
19
|
+
.meta({ id: 'PagePrefill' });
|
|
20
|
+
//# sourceMappingURL=prefill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefill.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/prefill.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,mCAAqC;AA2BrC,MAAM,KAAK,GAAG,0BAA0B,CAAC;AAE5B,QAAA,iBAAiB,GAAG,CAAC;KAC/B,YAAY,CAAC;IACZ,OAAO,EAAE,CAAC;SACP,KAAK,CACJ,CAAC,CAAC,KAAK,CAAC;QACN,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kBAAU,EAAE,EAAE,KAAK,EAAE,mHAAmH,EAAE,CAAC;QAC5J,CAAC,CAAC,YAAY,CAAC;YACb,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gEAAgE,EAAE,CAAC;YAC3G,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,kBAAU,CAAC;SACpC,CAAC;KACH,CAAC,CACH;SACA,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,yCAAyC,EAAE,CAAC;CAChE,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { FIELD_NAME } from './names.mjs';
|
|
3
|
+
const PARAM = /^[A-Za-z0-9_.~-]{1,100}$/;
|
|
4
|
+
export const PagePrefillSchema = z
|
|
5
|
+
.strictObject({
|
|
6
|
+
fromUrl: z
|
|
7
|
+
.array(z.union([
|
|
8
|
+
z.string().regex(FIELD_NAME, { error: 'a parameter named alone fills the field of its name: a field’s name ("utm_source"), or { "param": …, "field": … }' }),
|
|
9
|
+
z.strictObject({
|
|
10
|
+
param: z.string().regex(PARAM, { error: 'a link’s parameter is letters, digits and _ . ~ -, at most 100' }),
|
|
11
|
+
field: z.string().regex(FIELD_NAME),
|
|
12
|
+
}),
|
|
13
|
+
]))
|
|
14
|
+
.min(1, { error: 'name at least one parameter of the link' }),
|
|
15
|
+
})
|
|
16
|
+
.meta({ id: 'PagePrefill' });
|
|
17
|
+
//# sourceMappingURL=prefill.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefill.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/prefill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA2BrC,MAAM,KAAK,GAAG,0BAA0B,CAAC;AAEzC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,YAAY,CAAC;IACZ,OAAO,EAAE,CAAC;SACP,KAAK,CACJ,CAAC,CAAC,KAAK,CAAC;QACN,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,mHAAmH,EAAE,CAAC;QAC5J,CAAC,CAAC,YAAY,CAAC;YACb,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gEAAgE,EAAE,CAAC;YAC3G,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;SACpC,CAAC;KACH,CAAC,CACH;SACA,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,yCAAyC,EAAE,CAAC;CAChE,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A quiz: a page of responses whose questions have right answers or points, and whose results the person sees
|
|
4
|
+
* (`quiz` on a page). A choice's right answers are its options marked `correct`; a question typed — a word, a number —
|
|
5
|
+
* names the answers it takes (`quiz.answers` on its field). Each right answer earns the question's points (`quiz.points`
|
|
6
|
+
* on its field, else the page's, else 1); a choice whose options carry points (`score`) earns those, as before. Once
|
|
7
|
+
* the answers are sent the person sees their score and each question's answer marked right or wrong, the right answer
|
|
8
|
+
* to one they missed and the question's own feedback — or, with `results: "later"`, that their results come once their
|
|
9
|
+
* answers are reviewed.
|
|
10
|
+
*
|
|
11
|
+
* "quiz": { "results": "now", "points": 1 }
|
|
12
|
+
* "fields": { "reversible": { "type": "selection", "label": "Which filler can be dissolved?",
|
|
13
|
+
* "options": [{ "value": "ha", "label": "Hyaluronic acid", "correct": true }, { "value": "caha", "label": "Calcium hydroxylapatite" }],
|
|
14
|
+
* "quiz": { "feedback": { "right": "Yes: hyaluronidase dissolves it.", "wrong": "Only hyaluronic acid: hyaluronidase dissolves it." } } } }
|
|
15
|
+
*
|
|
16
|
+
* The right answers travel in the page, where a person who reads its JSON finds them. A test where that matters keeps
|
|
17
|
+
* them out of the page and marks the answers on the app's server: its source answers the send with the results
|
|
18
|
+
* (`SubmitResult.quiz`), and the page shows those.
|
|
19
|
+
*/
|
|
20
|
+
export interface PageQuiz {
|
|
21
|
+
/** When the person sees their results: as the answers are sent (`now`, the default), or later, once the app has reviewed them. */
|
|
22
|
+
results?: 'now' | 'later';
|
|
23
|
+
/** What a right answer earns where its question says nothing: 1 unless said. */
|
|
24
|
+
points?: number;
|
|
25
|
+
/** Whether a question answered wrongly shows its right answer: true unless false. */
|
|
26
|
+
rightAnswers?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare const PageQuizSchema: z.ZodObject<{
|
|
29
|
+
results: z.ZodOptional<z.ZodEnum<{
|
|
30
|
+
now: "now";
|
|
31
|
+
later: "later";
|
|
32
|
+
}>>;
|
|
33
|
+
points: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
rightAnswers: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
/** What a question of a quiz says of itself (`quiz` on its field): its points, the answers it takes, its feedback. */
|
|
37
|
+
export interface QuizQuestion {
|
|
38
|
+
/** What a right answer earns: the page's `quiz.points` (1 unless said) where left out. */
|
|
39
|
+
points?: number;
|
|
40
|
+
/**
|
|
41
|
+
* A question typed rather than chosen — a word, a number — and the answers it takes: a word as written, whatever its
|
|
42
|
+
* case and the spaces round it; a number as its value.
|
|
43
|
+
*/
|
|
44
|
+
answers?: (string | number)[];
|
|
45
|
+
/** Words shown under the question in the results: when its answer was right, and when it was wrong or missing. */
|
|
46
|
+
feedback?: {
|
|
47
|
+
right?: string;
|
|
48
|
+
wrong?: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export declare const QuizQuestionSchema: z.ZodObject<{
|
|
52
|
+
points: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
answers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
54
|
+
feedback: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
right: z.ZodOptional<z.ZodString>;
|
|
56
|
+
wrong: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A quiz: a page of responses whose questions have right answers or points, and whose results the person sees
|
|
4
|
+
* (`quiz` on a page). A choice's right answers are its options marked `correct`; a question typed — a word, a number —
|
|
5
|
+
* names the answers it takes (`quiz.answers` on its field). Each right answer earns the question's points (`quiz.points`
|
|
6
|
+
* on its field, else the page's, else 1); a choice whose options carry points (`score`) earns those, as before. Once
|
|
7
|
+
* the answers are sent the person sees their score and each question's answer marked right or wrong, the right answer
|
|
8
|
+
* to one they missed and the question's own feedback — or, with `results: "later"`, that their results come once their
|
|
9
|
+
* answers are reviewed.
|
|
10
|
+
*
|
|
11
|
+
* "quiz": { "results": "now", "points": 1 }
|
|
12
|
+
* "fields": { "reversible": { "type": "selection", "label": "Which filler can be dissolved?",
|
|
13
|
+
* "options": [{ "value": "ha", "label": "Hyaluronic acid", "correct": true }, { "value": "caha", "label": "Calcium hydroxylapatite" }],
|
|
14
|
+
* "quiz": { "feedback": { "right": "Yes: hyaluronidase dissolves it.", "wrong": "Only hyaluronic acid: hyaluronidase dissolves it." } } } }
|
|
15
|
+
*
|
|
16
|
+
* The right answers travel in the page, where a person who reads its JSON finds them. A test where that matters keeps
|
|
17
|
+
* them out of the page and marks the answers on the app's server: its source answers the send with the results
|
|
18
|
+
* (`SubmitResult.quiz`), and the page shows those.
|
|
19
|
+
*/
|
|
20
|
+
export interface PageQuiz {
|
|
21
|
+
/** When the person sees their results: as the answers are sent (`now`, the default), or later, once the app has reviewed them. */
|
|
22
|
+
results?: 'now' | 'later';
|
|
23
|
+
/** What a right answer earns where its question says nothing: 1 unless said. */
|
|
24
|
+
points?: number;
|
|
25
|
+
/** Whether a question answered wrongly shows its right answer: true unless false. */
|
|
26
|
+
rightAnswers?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare const PageQuizSchema: z.ZodObject<{
|
|
29
|
+
results: z.ZodOptional<z.ZodEnum<{
|
|
30
|
+
now: "now";
|
|
31
|
+
later: "later";
|
|
32
|
+
}>>;
|
|
33
|
+
points: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
rightAnswers: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
}, z.z.core.$strict>;
|
|
36
|
+
/** What a question of a quiz says of itself (`quiz` on its field): its points, the answers it takes, its feedback. */
|
|
37
|
+
export interface QuizQuestion {
|
|
38
|
+
/** What a right answer earns: the page's `quiz.points` (1 unless said) where left out. */
|
|
39
|
+
points?: number;
|
|
40
|
+
/**
|
|
41
|
+
* A question typed rather than chosen — a word, a number — and the answers it takes: a word as written, whatever its
|
|
42
|
+
* case and the spaces round it; a number as its value.
|
|
43
|
+
*/
|
|
44
|
+
answers?: (string | number)[];
|
|
45
|
+
/** Words shown under the question in the results: when its answer was right, and when it was wrong or missing. */
|
|
46
|
+
feedback?: {
|
|
47
|
+
right?: string;
|
|
48
|
+
wrong?: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export declare const QuizQuestionSchema: z.ZodObject<{
|
|
52
|
+
points: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
answers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
54
|
+
feedback: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
right: z.ZodOptional<z.ZodString>;
|
|
56
|
+
wrong: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.z.core.$strict>>;
|
|
58
|
+
}, z.z.core.$strict>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuizQuestionSchema = exports.PageQuizSchema = void 0;
|
|
4
|
+
const z = require("zod");
|
|
5
|
+
exports.PageQuizSchema = z
|
|
6
|
+
.strictObject({
|
|
7
|
+
results: z.enum(['now', 'later']).optional(),
|
|
8
|
+
points: z.number().positive().max(1000).optional(),
|
|
9
|
+
rightAnswers: z.boolean().optional(),
|
|
10
|
+
})
|
|
11
|
+
.meta({ id: 'PageQuiz' });
|
|
12
|
+
exports.QuizQuestionSchema = z
|
|
13
|
+
.strictObject({
|
|
14
|
+
points: z.number().positive().max(1000).optional(),
|
|
15
|
+
answers: z.array(z.union([z.string().regex(/\S/, 'an answer is words or a number'), z.number()])).min(1).max(50).optional(),
|
|
16
|
+
feedback: z
|
|
17
|
+
.strictObject({
|
|
18
|
+
right: z.string().regex(/\S/, 'feedback is words').max(2000).optional(),
|
|
19
|
+
wrong: z.string().regex(/\S/, 'feedback is words').max(2000).optional(),
|
|
20
|
+
})
|
|
21
|
+
.optional(),
|
|
22
|
+
})
|
|
23
|
+
.meta({ id: 'QuizQuestion' });
|
|
24
|
+
//# sourceMappingURL=quiz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quiz.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/quiz.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AA6BZ,QAAA,cAAc,GAAG,CAAC;KAC5B,YAAY,CAAC;IACZ,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAClD,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;AAef,QAAA,kBAAkB,GAAG,CAAC;KAChC,YAAY,CAAC;IACZ,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAClD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,gCAAgC,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC3H,QAAQ,EAAE,CAAC;SACR,YAAY,CAAC;QACZ,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QACvE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;KACxE,CAAC;SACD,QAAQ,EAAE;CACd,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export const PageQuizSchema = z
|
|
3
|
+
.strictObject({
|
|
4
|
+
results: z.enum(['now', 'later']).optional(),
|
|
5
|
+
points: z.number().positive().max(1000).optional(),
|
|
6
|
+
rightAnswers: z.boolean().optional(),
|
|
7
|
+
})
|
|
8
|
+
.meta({ id: 'PageQuiz' });
|
|
9
|
+
export const QuizQuestionSchema = z
|
|
10
|
+
.strictObject({
|
|
11
|
+
points: z.number().positive().max(1000).optional(),
|
|
12
|
+
answers: z.array(z.union([z.string().regex(/\S/, 'an answer is words or a number'), z.number()])).min(1).max(50).optional(),
|
|
13
|
+
feedback: z
|
|
14
|
+
.strictObject({
|
|
15
|
+
right: z.string().regex(/\S/, 'feedback is words').max(2000).optional(),
|
|
16
|
+
wrong: z.string().regex(/\S/, 'feedback is words').max(2000).optional(),
|
|
17
|
+
})
|
|
18
|
+
.optional(),
|
|
19
|
+
})
|
|
20
|
+
.meta({ id: 'QuizQuestion' });
|
|
21
|
+
//# sourceMappingURL=quiz.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quiz.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/quiz.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA6BzB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,YAAY,CAAC;IACZ,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAClD,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;AAe5B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,YAAY,CAAC;IACZ,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAClD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,gCAAgC,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC3H,QAAQ,EAAE,CAAC;SACR,YAAY,CAAC;QACZ,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QACvE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;KACxE,CAAC;SACD,QAAQ,EAAE;CACd,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC"}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PageRecordsSchema = void 0;
|
|
4
4
|
const z = require("zod");
|
|
5
|
+
const jitless_1 = require("./jitless");
|
|
6
|
+
// zod compiles no code for these schemas: a strict Content-Security-Policy refuses it (jitless.ts).
|
|
7
|
+
(0, jitless_1.makeSchemasJitless)();
|
|
5
8
|
/**
|
|
6
9
|
* What a page's records are called (`records` on a page), so Fieldia's own sentences name them as the business does:
|
|
7
10
|
* "A customer with this phone already exists", "17 customers imported", "Are you sure you want to delete this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/records.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;
|
|
1
|
+
{"version":3,"file":"records.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/records.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,uCAA+C;AAE/C,oGAAoG;AACpG,IAAA,4BAAkB,GAAE,CAAC;AAErB;;;;;;;;;;;;;;;GAeG;AACU,QAAA,iBAAiB,GAAG,CAAC;KAC/B,YAAY,CAAC;IACZ,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,4CAA4C,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACjF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,yDAAyD,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAChG,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,2EAA2E,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1H,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
+
import { makeSchemasJitless } from './jitless.mjs';
|
|
3
|
+
// zod compiles no code for these schemas: a strict Content-Security-Policy refuses it (jitless.ts).
|
|
4
|
+
makeSchemasJitless();
|
|
2
5
|
/**
|
|
3
6
|
* What a page's records are called (`records` on a page), so Fieldia's own sentences name them as the business does:
|
|
4
7
|
* "A customer with this phone already exists", "17 customers imported", "Are you sure you want to delete this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/records.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"records.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/format/records.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,oGAAoG;AACpG,kBAAkB,EAAE,CAAC;AAErB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,YAAY,CAAC;IACZ,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,4CAA4C,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACjF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,yDAAyD,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAChG,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,2EAA2E,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1H,CAAC;KACD,IAAI,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC"}
|
|
@@ -160,7 +160,7 @@ export declare class ReferenceCheck {
|
|
|
160
160
|
private checkCurrency;
|
|
161
161
|
/** The tools a table of lines' checks are handed (table-checks.ts). */
|
|
162
162
|
private tableTools;
|
|
163
|
-
/** The tools a part's checks
|
|
163
|
+
/** The tools a part's checks are handed (part-checks.ts): a field's, and the reading of conditions. */
|
|
164
164
|
private fieldTools;
|
|
165
165
|
/** The tools a map's checks are handed (map-checks.ts). */
|
|
166
166
|
private mapTools;
|
|
@@ -160,7 +160,7 @@ export declare class ReferenceCheck {
|
|
|
160
160
|
private checkCurrency;
|
|
161
161
|
/** The tools a table of lines' checks are handed (table-checks.ts). */
|
|
162
162
|
private tableTools;
|
|
163
|
-
/** The tools a part's checks
|
|
163
|
+
/** The tools a part's checks are handed (part-checks.ts): a field's, and the reading of conditions. */
|
|
164
164
|
private fieldTools;
|
|
165
165
|
/** The tools a map's checks are handed (map-checks.ts). */
|
|
166
166
|
private mapTools;
|
|
@@ -24,14 +24,22 @@ const seats_checks_1 = require("./seats-checks");
|
|
|
24
24
|
const list_checks_1 = require("./list-checks");
|
|
25
25
|
const editable_checks_1 = require("./editable-checks");
|
|
26
26
|
const slots_checks_1 = require("./slots-checks");
|
|
27
|
+
const schedule_checks_1 = require("./schedule-checks");
|
|
28
|
+
const templates_checks_1 = require("./templates-checks");
|
|
27
29
|
const signature_checks_1 = require("./signature-checks");
|
|
28
30
|
const assist_checks_1 = require("./assist-checks");
|
|
29
31
|
const scan_checks_1 = require("./scan-checks");
|
|
30
32
|
const endings_checks_1 = require("./endings-checks");
|
|
33
|
+
const flow_checks_1 = require("./flow-checks");
|
|
34
|
+
const survey_1 = require("../record/survey");
|
|
31
35
|
const map_checks_1 = require("./map-checks");
|
|
32
36
|
const table_checks_1 = require("./table-checks");
|
|
33
37
|
const statusbar_checks_1 = require("./statusbar-checks");
|
|
34
38
|
const option_checks_1 = require("./option-checks");
|
|
39
|
+
const prefill_checks_1 = require("./prefill-checks");
|
|
40
|
+
const verify_checks_1 = require("./verify-checks");
|
|
41
|
+
const payment_checks_1 = require("./payment-checks");
|
|
42
|
+
const outbox_checks_1 = require("./outbox-checks");
|
|
35
43
|
const has = (record, key) => Object.prototype.hasOwnProperty.call(record, key);
|
|
36
44
|
/** Whether a field, or a column of its table, is scanned into with the camera (`options.scan`). */
|
|
37
45
|
const scansAny = (node) => [node, ...Object.values(node.cells ?? {})].some((one) => one?.options?.['scan'] !== undefined);
|
|
@@ -102,16 +110,35 @@ class ReferenceCheck {
|
|
|
102
110
|
this.checkDuplicates(this.page);
|
|
103
111
|
if (this.page.records !== undefined && !this.line)
|
|
104
112
|
this.checkRecords(this.page.records);
|
|
113
|
+
// The settings of the parts that join a form — its link's fields, its payment, its outbox: in the one-tag script, each
|
|
114
|
+
// one's checks come with its part, which a page with it asks for.
|
|
115
|
+
if (!this.line) {
|
|
116
|
+
const tools = this.fieldTools();
|
|
117
|
+
if (this.page.prefill !== undefined)
|
|
118
|
+
(0, prefill_checks_1.checkPrefill)(this.page, tools);
|
|
119
|
+
if (this.page.payment !== undefined)
|
|
120
|
+
(0, payment_checks_1.checkPayment)(this.page, tools);
|
|
121
|
+
if (this.page.outbox)
|
|
122
|
+
(0, outbox_checks_1.checkOutbox)(this.page, tools);
|
|
123
|
+
}
|
|
105
124
|
if (this.page.endings !== undefined && !this.line) {
|
|
106
125
|
if (this.page.data.kind !== 'responses')
|
|
107
126
|
this.report('endings', 'endings are for a page of responses, shown once it is sent');
|
|
108
127
|
// Each ending: in the one-tag script, its checks come with the answers part, which a page with any asks for.
|
|
109
128
|
if (Array.isArray(this.page.endings) && this.page.endings.length)
|
|
110
|
-
(0, endings_checks_1.checkEndings)(this.page, { ...this.fieldTools(),
|
|
129
|
+
(0, endings_checks_1.checkEndings)(this.page, { ...this.fieldTools(), checkWords: (owner, path, keys, sent) => this.checkWords(owner, path, keys, sent) });
|
|
111
130
|
}
|
|
131
|
+
const owing = { report: (path, message) => this.report(path, message), owe: (part) => void this.later.add(part) };
|
|
112
132
|
// A page's limits and Continue later: checked where it has either (in the one-tag script, by the limits part it asks for).
|
|
133
|
+
// Templates people save: in the one-tag script, checked by the templates part a page with them asks for.
|
|
134
|
+
if (!this.line && this.page.templates)
|
|
135
|
+
(0, templates_checks_1.checkTemplates)(this.fieldTools());
|
|
113
136
|
if (!this.line && (this.page.limits !== undefined || this.page.continueLater !== undefined))
|
|
114
|
-
(0, limits_checks_1.checkLimits)(this.page,
|
|
137
|
+
(0, limits_checks_1.checkLimits)(this.page, owing);
|
|
138
|
+
// A survey's flow — a quiz and each question's own, a review, one at a time, a draw, a time limit — checked where the
|
|
139
|
+
// page has any (in the one-tag script, by the survey flow's part it asks for).
|
|
140
|
+
if (!this.line && ((0, survey_1.surveyFlow)(this.page) || JSON.stringify(this.page.fields).includes('"quiz":')))
|
|
141
|
+
(0, flow_checks_1.checkSurveyFlow)(this.page, owing);
|
|
115
142
|
// A record's approvals: checked where it has them (in the one-tag script, by the approvals part it asks for).
|
|
116
143
|
if (!this.line && this.page.approval !== undefined)
|
|
117
144
|
(0, approval_checks_1.checkApproval)(this.page, this.fieldTools());
|
|
@@ -503,7 +530,7 @@ class ReferenceCheck {
|
|
|
503
530
|
// Options by condition, or carried from an earlier question: in the one-tag script, checked by the options part a
|
|
504
531
|
// page with any asks for.
|
|
505
532
|
if ((0, choice_options_1.changesOptions)(def))
|
|
506
|
-
(0, option_checks_1.checkOptionRules)(name, def, path, fields, scope,
|
|
533
|
+
(0, option_checks_1.checkOptionRules)(name, def, path, fields, scope, this.fieldTools());
|
|
507
534
|
}
|
|
508
535
|
checkFields(fields, base, lines, parent) {
|
|
509
536
|
const scope = { fields, lines, ...(parent ? { parent } : {}) };
|
|
@@ -621,13 +648,18 @@ class ReferenceCheck {
|
|
|
621
648
|
return {
|
|
622
649
|
...this.fieldTools(),
|
|
623
650
|
claim: (id, path) => this.claim(id, path),
|
|
624
|
-
checkModifiers: (owner, path, keys, scope) => this.checkModifiers(owner, path, keys, scope),
|
|
625
651
|
checkPress: (button, path) => this.checkPress(button, path),
|
|
626
652
|
};
|
|
627
653
|
}
|
|
628
|
-
/** The tools a part's checks
|
|
654
|
+
/** The tools a part's checks are handed (part-checks.ts): a field's, and the reading of conditions. */
|
|
629
655
|
fieldTools() {
|
|
630
|
-
return {
|
|
656
|
+
return {
|
|
657
|
+
page: this.page,
|
|
658
|
+
need: (name, path, scope) => this.need(name, path, scope),
|
|
659
|
+
report: (path, message) => this.report(path, message),
|
|
660
|
+
owe: (part) => this.later.add(part),
|
|
661
|
+
checkModifiers: (owner, path, keys, scope) => this.checkModifiers(owner, path, keys, scope),
|
|
662
|
+
};
|
|
631
663
|
}
|
|
632
664
|
/** The tools a map's checks are handed (map-checks.ts). */
|
|
633
665
|
mapTools() {
|
|
@@ -776,7 +808,7 @@ class ReferenceCheck {
|
|
|
776
808
|
}
|
|
777
809
|
// A statusbar, drawn by the business part, whose checks come with it in the one-tag script.
|
|
778
810
|
if (sheet.statusbar)
|
|
779
|
-
(0, statusbar_checks_1.checkStatusbar)(sheet.statusbar, path,
|
|
811
|
+
(0, statusbar_checks_1.checkStatusbar)(sheet.statusbar, path, this.fieldTools());
|
|
780
812
|
sheet.buttons?.forEach((button, i) => {
|
|
781
813
|
this.claim(button.id, `${path}.buttons[${i}]`);
|
|
782
814
|
this.checkModifiers(button, `${path}.buttons[${i}]`);
|
|
@@ -909,6 +941,9 @@ class ReferenceCheck {
|
|
|
909
941
|
this.report(`${path}.widget`, `slots is for a datetime field; "${node.field}" is a ${def.type}`);
|
|
910
942
|
else if (node.widget === 'slots')
|
|
911
943
|
(0, slots_checks_1.checkSlots)(node, path, this.fieldTools());
|
|
944
|
+
// A repeat rule, a week's opening hours: the schedule part's, as their checks are in the one-tag script.
|
|
945
|
+
if (node.widget === 'repeat' || node.widget === 'hours')
|
|
946
|
+
(0, schedule_checks_1.checkSchedule)(node, def, path, this.fieldTools());
|
|
912
947
|
if (node.widget === 'signature' && def && def.type !== 'binary')
|
|
913
948
|
this.report(`${path}.widget`, `signature is for a binary field; "${node.field}" is a ${def.type}`);
|
|
914
949
|
else if (node.widget === 'signature')
|
|
@@ -919,6 +954,20 @@ class ReferenceCheck {
|
|
|
919
954
|
// A photo set is a picture field's of several photos: one photo has no order, no cover.
|
|
920
955
|
if (node.widget === 'photos' && def && (def.type !== 'image' || !def.multiple))
|
|
921
956
|
this.report(`${path}.widget`, `photos is for an image field of several photos (multiple); "${node.field}" is not one`);
|
|
957
|
+
// A value shown as a code: a QR code holds words, a barcode words or a whole number; pins on a picture are a json's.
|
|
958
|
+
const codes = { qrcode: ['char', 'text'], barcode: ['char', 'integer'], pins: ['json'] };
|
|
959
|
+
if (def && node.widget && codes[node.widget] && !codes[node.widget].includes(def.type))
|
|
960
|
+
this.report(`${path}.widget`, `${node.widget} is for a ${codes[node.widget].join(' or ')} field; "${node.field}" is a ${def.type}`);
|
|
961
|
+
// A file field that records a voice note or a film: its checks come with the files part, which draws it.
|
|
962
|
+
const records = node.options?.['record'] !== undefined || node.options?.['maxSeconds'] !== undefined;
|
|
963
|
+
if (records && def && def.type !== 'binary')
|
|
964
|
+
this.report(`${path}.options.record`, `record is for a binary field; "${node.field}" is a ${def.type}`);
|
|
965
|
+
else if (records && def)
|
|
966
|
+
(0, signature_checks_1.checkRecording)(node, def, path, this.fieldTools());
|
|
967
|
+
// Proof of an email or a phone by a code (`options.verify`), drawn by the verify part, whose checks come with it in the one-tag script.
|
|
968
|
+
// Asked as the page asks for the verify part (`formJoins`): `false` asks for none, and needs no check.
|
|
969
|
+
if (node.options?.['verify'] !== undefined && node.options['verify'] !== false)
|
|
970
|
+
(0, verify_checks_1.checkVerify)(node, def, path, !!this.line, this.fieldTools());
|
|
922
971
|
if (def)
|
|
923
972
|
this.checkPicker(node, def, path);
|
|
924
973
|
// Scanned into with the camera — the field, or a table's columns: checked with the scan part's code, which draws it.
|