@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/compute.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"compute.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/compute.ts"],"names":[],"mappings":";;AAuDA,sBAoBC;AAMD,0CA8EC;AA7JD,yDAA0G;AAE1G,yDAAqE;AACrE,+CAAsD;AACtD,+BAA6F;AAC7F,qCAAsG;AAyBtG,gGAAgG;AAChG,SAAS,OAAO,CAAC,KAAoC,EAAE,IAAY;IACjE,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,GAAG;QAAE,OAAO,GAAG,CAAC;IACpB,KAAK,MAAM,CAAC,GAAG,EAAE,K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AAG,CAAC,CAAC,CAAC,EAAE,EAAE;oBAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;oBAC1E,IAAI,MAAM,KAAK,CAAC,CAAC,MAAM;wBAAE,OAAO,CAAC,CAAC;oBAClC,OAAO,GAAG,IAAI,CAAC;oBACf,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;gBAClC,CAAC,CAAC,CAAC;gBACH,IAAI,OAAO;oBAAE,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;YACpD,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAC;YAC7B,OAAO,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,IAAA,mBAAa,EAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,mBAAa,EAAC,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QACzI,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -3,12 +3,22 @@ import { isNumber, roundTo, truthy } from '../expression/operations.mjs';
|
|
|
3
3
|
import { dependencyOrder } from '../expression/order.mjs';
|
|
4
4
|
import { expressionEnv, lineContext, recordContext } from './env.mjs';
|
|
5
5
|
import { expressionContext, lineKind, sameValue } from './values.mjs';
|
|
6
|
+
/** What waits at a path, or inside it (a table's lines' cells): undefined when nothing does. */
|
|
7
|
+
function waitsIn(asked, path) {
|
|
8
|
+
const own = asked.get(path);
|
|
9
|
+
if (own)
|
|
10
|
+
return own;
|
|
11
|
+
for (const [key, found] of asked)
|
|
12
|
+
if (key.startsWith(`${path}.`))
|
|
13
|
+
return found;
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
6
16
|
/** The worked-out fields among `fields`, each read once, in the order to work them out. */
|
|
7
|
-
function steps(fields) {
|
|
17
|
+
function steps(fields, functions) {
|
|
8
18
|
const compiled = new Map();
|
|
9
19
|
for (const [name, def] of Object.entries(fields))
|
|
10
20
|
if (def.compute !== undefined)
|
|
11
|
-
compiled.set(name, compileExpression(def.compute));
|
|
21
|
+
compiled.set(name, compileExpression(def.compute, functions));
|
|
12
22
|
const { order } = dependencyOrder(new Map([...compiled].map(([name, expression]) => [name, expression.fields])));
|
|
13
23
|
return order.map((name) => [name, compiled.get(name), fields[name]]);
|
|
14
24
|
}
|
|
@@ -41,25 +51,56 @@ export function fitTo(def, value) {
|
|
|
41
51
|
return value;
|
|
42
52
|
}
|
|
43
53
|
}
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Read every `compute` of a page once. `today` is the day `today()` gives; `about`, the record's id and the person, as
|
|
56
|
+
* lines read them on `parent`; `app`, the app's functions and the answers of those that ask.
|
|
57
|
+
*/
|
|
58
|
+
export function compileComputed(page, today, about = () => ({ recordId: null }), app = {}) {
|
|
59
|
+
const own = steps(page.fields, app.functions);
|
|
47
60
|
const lineSteps = new Map();
|
|
48
61
|
for (const [name, def] of Object.entries(page.fields)) {
|
|
49
62
|
if (def.type !== 'one2many')
|
|
50
63
|
continue;
|
|
51
|
-
const found = steps(def.fields);
|
|
64
|
+
const found = steps(def.fields, app.functions);
|
|
52
65
|
if (found.length)
|
|
53
66
|
lineSteps.set(name, { def, steps: found });
|
|
54
67
|
}
|
|
55
|
-
// Lines hold no lines of their own: inside one, only today()
|
|
56
|
-
const lineEnv = { today };
|
|
57
|
-
/**
|
|
58
|
-
function
|
|
68
|
+
// Lines hold no lines of their own: inside one, only today() and the app's functions need the env.
|
|
69
|
+
const lineEnv = { ...app, today };
|
|
70
|
+
/** A value worked out, and whether it waits for an app's answer, or why that did not come. */
|
|
71
|
+
function worked(expression, context, env) {
|
|
72
|
+
const answer = env.answer;
|
|
73
|
+
if (!answer)
|
|
74
|
+
return { value: expression.evaluate(context, env) };
|
|
75
|
+
let asked;
|
|
76
|
+
const value = expression.evaluate(context, {
|
|
77
|
+
...env,
|
|
78
|
+
answer(key, promise) {
|
|
79
|
+
const found = answer(key, promise);
|
|
80
|
+
if (found === 'asking')
|
|
81
|
+
asked ??= {};
|
|
82
|
+
else if (found?.failed !== undefined)
|
|
83
|
+
asked = { failed: found.failed };
|
|
84
|
+
return found;
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
return asked ? { value, asked } : { value };
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Work out the steps on these values, writing each change into a copy; `read` gives the values as expressions read
|
|
91
|
+
* them; `at`, the path a value's waiting is told by (a line's `field.lineKey.`).
|
|
92
|
+
*/
|
|
93
|
+
function run(values, list, fields, env, read, asked, at = '') {
|
|
59
94
|
let next = values;
|
|
60
95
|
const context = read(values);
|
|
61
96
|
for (const [name, expression, def] of list) {
|
|
62
|
-
const
|
|
97
|
+
const found = worked(expression, context, env);
|
|
98
|
+
// Worked out from a value that waits — a field, or a table's line — it waits as that one does.
|
|
99
|
+
const from = asked?.size ? expression.fields.map((field) => waitsIn(asked, at + field)).find((one) => one !== undefined) : undefined;
|
|
100
|
+
const waits = found.asked ?? from;
|
|
101
|
+
if (waits)
|
|
102
|
+
asked?.set(at + name, waits);
|
|
103
|
+
const value = fitTo(def, found.value);
|
|
63
104
|
if (sameValue(value, next[name]))
|
|
64
105
|
continue;
|
|
65
106
|
next = { ...next, [name]: value };
|
|
@@ -68,16 +109,16 @@ export function compileComputed(page, today, about = () => ({ recordId: null }))
|
|
|
68
109
|
}
|
|
69
110
|
return next;
|
|
70
111
|
}
|
|
71
|
-
function line(field, values, parent) {
|
|
112
|
+
function line(field, values, parent, asked, at = '') {
|
|
72
113
|
const found = lineSteps.get(field);
|
|
73
114
|
// A section or a note has nothing to work out.
|
|
74
115
|
if (!found || lineKind(found.def, values) !== null)
|
|
75
116
|
return values;
|
|
76
|
-
return run(values, found.steps, found.def.fields, lineEnv, (v) => lineContext(v, found.def.fields, parent));
|
|
117
|
+
return run(values, found.steps, found.def.fields, lineEnv, (v) => lineContext(v, found.def.fields, parent), asked, at);
|
|
77
118
|
}
|
|
78
119
|
return {
|
|
79
120
|
line: (field, values, record) => line(field, values, recordContext(record, page.fields, about())),
|
|
80
|
-
apply(values) {
|
|
121
|
+
apply(values, asked) {
|
|
81
122
|
let next = values;
|
|
82
123
|
const parent = lineSteps.size ? recordContext(values, page.fields, about()) : {};
|
|
83
124
|
for (const field of lineSteps.keys()) {
|
|
@@ -86,7 +127,7 @@ export function compileComputed(page, today, about = () => ({ recordId: null }))
|
|
|
86
127
|
continue;
|
|
87
128
|
let changed = false;
|
|
88
129
|
const updated = current.map((l) => {
|
|
89
|
-
const worked = line(field, l.values, parent);
|
|
130
|
+
const worked = line(field, l.values, parent, asked, `${field}.${l.key}.`);
|
|
90
131
|
if (worked === l.values)
|
|
91
132
|
return l;
|
|
92
133
|
changed = true;
|
|
@@ -97,7 +138,7 @@ export function compileComputed(page, today, about = () => ({ recordId: null }))
|
|
|
97
138
|
}
|
|
98
139
|
if (!own.length)
|
|
99
140
|
return next;
|
|
100
|
-
return run(next, own, page.fields, expressionEnv(next, page.fields, today), (v) => recordContext(v, page.fields, about()));
|
|
141
|
+
return run(next, own, page.fields, expressionEnv(next, page.fields, today, app), (v) => recordContext(v, page.fields, about()), asked);
|
|
101
142
|
},
|
|
102
143
|
};
|
|
103
144
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/compute.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAA+C,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version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E,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QACzI,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -34,7 +34,7 @@ export interface DataSource {
|
|
|
34
34
|
list?(request: ListRequest): Promise<ListResult>;
|
|
35
35
|
/** How many records fall under each value of a field, for a list's Group By. */
|
|
36
36
|
groups?(request: GroupRequest): Promise<Group[]>;
|
|
37
|
-
/** The choices of one of the app's lists, for a selection with `optionsFrom
|
|
37
|
+
/** The choices of one of the app's lists, for a selection with `optionsFrom` — a page's field, or a table's line by its values. */
|
|
38
38
|
options?(request: OptionsRequest): Promise<Option[]>;
|
|
39
39
|
/** The definitions of a properties field with `definitionsFrom`: those the linked record keeps. */
|
|
40
40
|
definitions?(request: OptionsRequest): Promise<PropertyDefinition[]>;
|
|
@@ -132,6 +132,120 @@ export interface DataSource {
|
|
|
132
132
|
* with why) and nothing changes. Without it, possible duplicates offer no Merge.
|
|
133
133
|
*/
|
|
134
134
|
merge?(request: MergeRequest): Promise<MergeResult | void>;
|
|
135
|
+
/**
|
|
136
|
+
* The records a person said are someone else for this one ("It's someone new"), by id: asked as a saved record is
|
|
137
|
+
* shown, before its possible duplicates are said, so one let be on another device stays let be here. A pair: answer
|
|
138
|
+
* from either side where you keep them so. With `markNotDuplicate`, these are kept on your server; without both,
|
|
139
|
+
* in the person's browser (the viewer's `preferences`), as before. To fail, throw: what the browser kept is read.
|
|
140
|
+
*/
|
|
141
|
+
notDuplicates?(request: NotDuplicatesRequest): Promise<RecordId[]>;
|
|
142
|
+
/**
|
|
143
|
+
* Keep that a record found is someone else for this one: the person pressed "It's someone new" on a saved record,
|
|
144
|
+
* or saved a new one after pressing it (once for each). Never said as its duplicate again, on any device. Refused
|
|
145
|
+
* (thrown), the browser keeps it instead, as without this.
|
|
146
|
+
*/
|
|
147
|
+
markNotDuplicate?(request: MarkNotDuplicateRequest): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* How many answers a page has taken, for its `limits` and its options' `seats`: the responses sent so far (what
|
|
150
|
+
* `maxResponses` counts), this person's (what `onePerPerson` counts), and for each choice field asked how many hold
|
|
151
|
+
* each of its options. Asked as the page opens — a closed or full form says so before anything is typed — and again
|
|
152
|
+
* just before its answers are sent. Without it, the page keeps to its dates alone and shows no places left; its
|
|
153
|
+
* `submit` (or `save`) refuses as it would.
|
|
154
|
+
*/
|
|
155
|
+
limits?(request: LimitsRequest): Promise<LimitsResult>;
|
|
156
|
+
/**
|
|
157
|
+
* Keep a page's answers so far on the app's server, to continue from on this device or another: as they are typed
|
|
158
|
+
* (a moment after typing stops), as a wizard's step is entered, and when the person presses "Continue later"
|
|
159
|
+
* (`later`). The first time `key` is null: answer with the key the draft is kept under, and on "Continue later" a
|
|
160
|
+
* `link` to continue from (the app makes it, with the key in it) and words of the app's own ("We emailed you the
|
|
161
|
+
* link"). The answers kept are the app's to see — where people stopped, what they had written. Without it, drafts
|
|
162
|
+
* stay in the browser's store (`drafts`), as before, and no "Continue later" shows.
|
|
163
|
+
*/
|
|
164
|
+
saveDraft?(request: SaveDraftRequest): Promise<SavedDraft>;
|
|
165
|
+
/** A draft kept by `saveDraft`, by its key: what the viewer's `resume` opens. Null when there is none (sent, or gone). */
|
|
166
|
+
loadDraft?(request: LoadDraftRequest): Promise<StoredDraft | null>;
|
|
167
|
+
}
|
|
168
|
+
/** Whose possible duplicates were let be: what `notDuplicates` is asked. */
|
|
169
|
+
export interface NotDuplicatesRequest {
|
|
170
|
+
model: string;
|
|
171
|
+
/** The record shown, saved. */
|
|
172
|
+
recordId: RecordId;
|
|
173
|
+
}
|
|
174
|
+
/** A record found, said to be someone else for this one: what `markNotDuplicate` is asked. */
|
|
175
|
+
export interface MarkNotDuplicateRequest {
|
|
176
|
+
model: string;
|
|
177
|
+
/** The record shown, saved. */
|
|
178
|
+
recordId: RecordId;
|
|
179
|
+
/** The record found like it, which is someone else. */
|
|
180
|
+
matchId: RecordId;
|
|
181
|
+
}
|
|
182
|
+
/** What `limits` is asked: the page, the record (whose own choice is no other's place) and the choice fields with places. */
|
|
183
|
+
export interface LimitsRequest {
|
|
184
|
+
pageId: string;
|
|
185
|
+
/** The page's model; empty for a page of responses. */
|
|
186
|
+
model: string;
|
|
187
|
+
/** The record edited, whose own choices are not counted as another's; null for a new one or a response. */
|
|
188
|
+
recordId: RecordId | null;
|
|
189
|
+
/** The choice fields whose options have `seats`, by name: count how many hold each option. */
|
|
190
|
+
fields: string[];
|
|
191
|
+
/** The person as the app told the form (`user`), where it did: a server knows them by its own sign-in first. */
|
|
192
|
+
user?: {
|
|
193
|
+
id: RecordId | null;
|
|
194
|
+
name?: string;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
/** How many answers a page has taken. Each part is told where the source knows it; one left out is not kept to. */
|
|
198
|
+
export interface LimitsResult {
|
|
199
|
+
/** The responses (or records) sent so far: what the page's `maxResponses` counts. */
|
|
200
|
+
responses?: number;
|
|
201
|
+
/** Those this person sent: one or more refuses another where the page says `onePerPerson`. */
|
|
202
|
+
mine?: number;
|
|
203
|
+
/** For each field asked, by option value: how many answers hold it (the record edited not counted). */
|
|
204
|
+
perChoice?: Record<string, Record<string, number>>;
|
|
205
|
+
}
|
|
206
|
+
/** A page's answers so far, as a draft keeps them: on the app's server (`saveDraft`) or in the browser's store. */
|
|
207
|
+
export interface StoredDraft {
|
|
208
|
+
/** The answers, as typed so far: where files are stored apart, no file's bytes. */
|
|
209
|
+
values: Values;
|
|
210
|
+
/** The wizard's step on screen, which the draft opens at again. */
|
|
211
|
+
step?: string | null;
|
|
212
|
+
/** The optional steps passed over with Skip. */
|
|
213
|
+
skipped?: string[];
|
|
214
|
+
/** Text typed that does not read yet, by its box's path, kept as it was typed and said again as the draft opens. */
|
|
215
|
+
unread?: Record<string, {
|
|
216
|
+
text: string;
|
|
217
|
+
message: string;
|
|
218
|
+
}>;
|
|
219
|
+
/** The fields the person answered (changed), in the page's order: where they got to. */
|
|
220
|
+
answered?: string[];
|
|
221
|
+
/** When it was kept, as ISO. */
|
|
222
|
+
savedAt: string;
|
|
223
|
+
}
|
|
224
|
+
/** What `saveDraft` is asked: the draft, and the key it was kept under before. */
|
|
225
|
+
export interface SaveDraftRequest {
|
|
226
|
+
pageId: string;
|
|
227
|
+
/** The page's model; empty for a page of responses. */
|
|
228
|
+
model: string;
|
|
229
|
+
/** The record edited; null for a new one or a response. */
|
|
230
|
+
recordId: RecordId | null;
|
|
231
|
+
/** The key the source gave this draft before; null the first time: answer with a new one. */
|
|
232
|
+
key: string | null;
|
|
233
|
+
draft: StoredDraft;
|
|
234
|
+
/** The person pressed "Continue later": the app may send them the link now, and answers with it. */
|
|
235
|
+
later?: boolean;
|
|
236
|
+
}
|
|
237
|
+
/** A draft kept on the server: its key, and after "Continue later" the link to continue from and the app's own words. */
|
|
238
|
+
export interface SavedDraft {
|
|
239
|
+
key: string;
|
|
240
|
+
/** The address to continue from, with the key in it, as the app makes it: shown with Copy. */
|
|
241
|
+
link?: string;
|
|
242
|
+
/** Words of the app's own, said as they are: "We emailed the link to mona@example.com." */
|
|
243
|
+
message?: string;
|
|
244
|
+
}
|
|
245
|
+
/** What `loadDraft` is asked: the page, and the key the draft was kept under. */
|
|
246
|
+
export interface LoadDraftRequest {
|
|
247
|
+
pageId: string;
|
|
248
|
+
key: string;
|
|
135
249
|
}
|
|
136
250
|
/** Many records made at once, each with its own values: a list's Import. */
|
|
137
251
|
export interface CreateManyRequest {
|
|
@@ -339,8 +453,16 @@ export interface ArchiveRequest extends RecordRequest {
|
|
|
339
453
|
export interface OptionsRequest {
|
|
340
454
|
/** The list's name, from the field's `optionsFrom.list`. */
|
|
341
455
|
list: string;
|
|
342
|
-
/**
|
|
456
|
+
/**
|
|
457
|
+
* Every value of the form, for a list that changes with another field (`dependsOn`). For a table's line, the line's
|
|
458
|
+
* values: its connection, for its tools.
|
|
459
|
+
*/
|
|
343
460
|
values: Values;
|
|
461
|
+
/**
|
|
462
|
+
* For a table's line — or a form editing one in a dialog — the values of the record it is on, which a line's list
|
|
463
|
+
* may change with (`parent.` in its `dependsOn`). Left out for a page's own field.
|
|
464
|
+
*/
|
|
465
|
+
parent?: Values;
|
|
344
466
|
}
|
|
345
467
|
export interface CreateRequest {
|
|
346
468
|
model: string;
|
|
@@ -380,6 +502,8 @@ export interface SaveRequest {
|
|
|
380
502
|
* the record as it is now.
|
|
381
503
|
*/
|
|
382
504
|
version?: RecordVersion;
|
|
505
|
+
/** The key of the draft these changes were kept in on the server (`saveDraft`): the source may let it go. */
|
|
506
|
+
draft?: string;
|
|
383
507
|
}
|
|
384
508
|
export interface SaveResult {
|
|
385
509
|
id: RecordId;
|
|
@@ -491,7 +615,11 @@ export interface GroupRequest extends GroupInterval {
|
|
|
491
615
|
field: string;
|
|
492
616
|
filter: ResolvedFilter[];
|
|
493
617
|
}
|
|
494
|
-
/**
|
|
618
|
+
/**
|
|
619
|
+
* The records under one value of a field: a link's by its id, a record of links (a many2many) under each of its links
|
|
620
|
+
* — tags counted as a server groups them, a list's filter counting each — and those with none as a group of their own
|
|
621
|
+
* (value null).
|
|
622
|
+
*/
|
|
495
623
|
export interface Group {
|
|
496
624
|
value: JsonValue;
|
|
497
625
|
label: string;
|
|
@@ -606,6 +734,8 @@ export interface SubmitRequest {
|
|
|
606
734
|
values: Values;
|
|
607
735
|
/** On a page with a bot check (`botCheck`): what it saw, for the app to decide on. The page never refuses a send for it. */
|
|
608
736
|
bot?: BotReport;
|
|
737
|
+
/** The key of the draft these answers were kept in on the server (`saveDraft`): the source may let it go, or mark it sent. */
|
|
738
|
+
draft?: string;
|
|
609
739
|
}
|
|
610
740
|
/**
|
|
611
741
|
* What a page's bot check saw as its answers were sent. A person never fills the hidden box and takes longer than a
|
|
@@ -623,7 +753,14 @@ export interface BotReport {
|
|
|
623
753
|
captcha?: string | null;
|
|
624
754
|
}
|
|
625
755
|
export interface SubmitResult {
|
|
756
|
+
/** The id the app gave the response: a booking's reference ("B-1043"), a ticket's number. An ending's words say it as `{id}`. */
|
|
626
757
|
id?: RecordId;
|
|
758
|
+
/**
|
|
759
|
+
* Values the app worked out as it kept the response, by the page's fields — a reference field it filled in, the time
|
|
760
|
+
* it confirmed — laid over the answers sent where an ending reads them (its `when` and its `{field}`s). The form's
|
|
761
|
+
* answers themselves stay as they were sent.
|
|
762
|
+
*/
|
|
763
|
+
values?: Values;
|
|
627
764
|
}
|
|
628
765
|
/**
|
|
629
766
|
* What changed, using the operation names Odoo gives its x2many commands, so
|
|
@@ -34,7 +34,7 @@ export interface DataSource {
|
|
|
34
34
|
list?(request: ListRequest): Promise<ListResult>;
|
|
35
35
|
/** How many records fall under each value of a field, for a list's Group By. */
|
|
36
36
|
groups?(request: GroupRequest): Promise<Group[]>;
|
|
37
|
-
/** The choices of one of the app's lists, for a selection with `optionsFrom
|
|
37
|
+
/** The choices of one of the app's lists, for a selection with `optionsFrom` — a page's field, or a table's line by its values. */
|
|
38
38
|
options?(request: OptionsRequest): Promise<Option[]>;
|
|
39
39
|
/** The definitions of a properties field with `definitionsFrom`: those the linked record keeps. */
|
|
40
40
|
definitions?(request: OptionsRequest): Promise<PropertyDefinition[]>;
|
|
@@ -132,6 +132,120 @@ export interface DataSource {
|
|
|
132
132
|
* with why) and nothing changes. Without it, possible duplicates offer no Merge.
|
|
133
133
|
*/
|
|
134
134
|
merge?(request: MergeRequest): Promise<MergeResult | void>;
|
|
135
|
+
/**
|
|
136
|
+
* The records a person said are someone else for this one ("It's someone new"), by id: asked as a saved record is
|
|
137
|
+
* shown, before its possible duplicates are said, so one let be on another device stays let be here. A pair: answer
|
|
138
|
+
* from either side where you keep them so. With `markNotDuplicate`, these are kept on your server; without both,
|
|
139
|
+
* in the person's browser (the viewer's `preferences`), as before. To fail, throw: what the browser kept is read.
|
|
140
|
+
*/
|
|
141
|
+
notDuplicates?(request: NotDuplicatesRequest): Promise<RecordId[]>;
|
|
142
|
+
/**
|
|
143
|
+
* Keep that a record found is someone else for this one: the person pressed "It's someone new" on a saved record,
|
|
144
|
+
* or saved a new one after pressing it (once for each). Never said as its duplicate again, on any device. Refused
|
|
145
|
+
* (thrown), the browser keeps it instead, as without this.
|
|
146
|
+
*/
|
|
147
|
+
markNotDuplicate?(request: MarkNotDuplicateRequest): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* How many answers a page has taken, for its `limits` and its options' `seats`: the responses sent so far (what
|
|
150
|
+
* `maxResponses` counts), this person's (what `onePerPerson` counts), and for each choice field asked how many hold
|
|
151
|
+
* each of its options. Asked as the page opens — a closed or full form says so before anything is typed — and again
|
|
152
|
+
* just before its answers are sent. Without it, the page keeps to its dates alone and shows no places left; its
|
|
153
|
+
* `submit` (or `save`) refuses as it would.
|
|
154
|
+
*/
|
|
155
|
+
limits?(request: LimitsRequest): Promise<LimitsResult>;
|
|
156
|
+
/**
|
|
157
|
+
* Keep a page's answers so far on the app's server, to continue from on this device or another: as they are typed
|
|
158
|
+
* (a moment after typing stops), as a wizard's step is entered, and when the person presses "Continue later"
|
|
159
|
+
* (`later`). The first time `key` is null: answer with the key the draft is kept under, and on "Continue later" a
|
|
160
|
+
* `link` to continue from (the app makes it, with the key in it) and words of the app's own ("We emailed you the
|
|
161
|
+
* link"). The answers kept are the app's to see — where people stopped, what they had written. Without it, drafts
|
|
162
|
+
* stay in the browser's store (`drafts`), as before, and no "Continue later" shows.
|
|
163
|
+
*/
|
|
164
|
+
saveDraft?(request: SaveDraftRequest): Promise<SavedDraft>;
|
|
165
|
+
/** A draft kept by `saveDraft`, by its key: what the viewer's `resume` opens. Null when there is none (sent, or gone). */
|
|
166
|
+
loadDraft?(request: LoadDraftRequest): Promise<StoredDraft | null>;
|
|
167
|
+
}
|
|
168
|
+
/** Whose possible duplicates were let be: what `notDuplicates` is asked. */
|
|
169
|
+
export interface NotDuplicatesRequest {
|
|
170
|
+
model: string;
|
|
171
|
+
/** The record shown, saved. */
|
|
172
|
+
recordId: RecordId;
|
|
173
|
+
}
|
|
174
|
+
/** A record found, said to be someone else for this one: what `markNotDuplicate` is asked. */
|
|
175
|
+
export interface MarkNotDuplicateRequest {
|
|
176
|
+
model: string;
|
|
177
|
+
/** The record shown, saved. */
|
|
178
|
+
recordId: RecordId;
|
|
179
|
+
/** The record found like it, which is someone else. */
|
|
180
|
+
matchId: RecordId;
|
|
181
|
+
}
|
|
182
|
+
/** What `limits` is asked: the page, the record (whose own choice is no other's place) and the choice fields with places. */
|
|
183
|
+
export interface LimitsRequest {
|
|
184
|
+
pageId: string;
|
|
185
|
+
/** The page's model; empty for a page of responses. */
|
|
186
|
+
model: string;
|
|
187
|
+
/** The record edited, whose own choices are not counted as another's; null for a new one or a response. */
|
|
188
|
+
recordId: RecordId | null;
|
|
189
|
+
/** The choice fields whose options have `seats`, by name: count how many hold each option. */
|
|
190
|
+
fields: string[];
|
|
191
|
+
/** The person as the app told the form (`user`), where it did: a server knows them by its own sign-in first. */
|
|
192
|
+
user?: {
|
|
193
|
+
id: RecordId | null;
|
|
194
|
+
name?: string;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
/** How many answers a page has taken. Each part is told where the source knows it; one left out is not kept to. */
|
|
198
|
+
export interface LimitsResult {
|
|
199
|
+
/** The responses (or records) sent so far: what the page's `maxResponses` counts. */
|
|
200
|
+
responses?: number;
|
|
201
|
+
/** Those this person sent: one or more refuses another where the page says `onePerPerson`. */
|
|
202
|
+
mine?: number;
|
|
203
|
+
/** For each field asked, by option value: how many answers hold it (the record edited not counted). */
|
|
204
|
+
perChoice?: Record<string, Record<string, number>>;
|
|
205
|
+
}
|
|
206
|
+
/** A page's answers so far, as a draft keeps them: on the app's server (`saveDraft`) or in the browser's store. */
|
|
207
|
+
export interface StoredDraft {
|
|
208
|
+
/** The answers, as typed so far: where files are stored apart, no file's bytes. */
|
|
209
|
+
values: Values;
|
|
210
|
+
/** The wizard's step on screen, which the draft opens at again. */
|
|
211
|
+
step?: string | null;
|
|
212
|
+
/** The optional steps passed over with Skip. */
|
|
213
|
+
skipped?: string[];
|
|
214
|
+
/** Text typed that does not read yet, by its box's path, kept as it was typed and said again as the draft opens. */
|
|
215
|
+
unread?: Record<string, {
|
|
216
|
+
text: string;
|
|
217
|
+
message: string;
|
|
218
|
+
}>;
|
|
219
|
+
/** The fields the person answered (changed), in the page's order: where they got to. */
|
|
220
|
+
answered?: string[];
|
|
221
|
+
/** When it was kept, as ISO. */
|
|
222
|
+
savedAt: string;
|
|
223
|
+
}
|
|
224
|
+
/** What `saveDraft` is asked: the draft, and the key it was kept under before. */
|
|
225
|
+
export interface SaveDraftRequest {
|
|
226
|
+
pageId: string;
|
|
227
|
+
/** The page's model; empty for a page of responses. */
|
|
228
|
+
model: string;
|
|
229
|
+
/** The record edited; null for a new one or a response. */
|
|
230
|
+
recordId: RecordId | null;
|
|
231
|
+
/** The key the source gave this draft before; null the first time: answer with a new one. */
|
|
232
|
+
key: string | null;
|
|
233
|
+
draft: StoredDraft;
|
|
234
|
+
/** The person pressed "Continue later": the app may send them the link now, and answers with it. */
|
|
235
|
+
later?: boolean;
|
|
236
|
+
}
|
|
237
|
+
/** A draft kept on the server: its key, and after "Continue later" the link to continue from and the app's own words. */
|
|
238
|
+
export interface SavedDraft {
|
|
239
|
+
key: string;
|
|
240
|
+
/** The address to continue from, with the key in it, as the app makes it: shown with Copy. */
|
|
241
|
+
link?: string;
|
|
242
|
+
/** Words of the app's own, said as they are: "We emailed the link to mona@example.com." */
|
|
243
|
+
message?: string;
|
|
244
|
+
}
|
|
245
|
+
/** What `loadDraft` is asked: the page, and the key the draft was kept under. */
|
|
246
|
+
export interface LoadDraftRequest {
|
|
247
|
+
pageId: string;
|
|
248
|
+
key: string;
|
|
135
249
|
}
|
|
136
250
|
/** Many records made at once, each with its own values: a list's Import. */
|
|
137
251
|
export interface CreateManyRequest {
|
|
@@ -339,8 +453,16 @@ export interface ArchiveRequest extends RecordRequest {
|
|
|
339
453
|
export interface OptionsRequest {
|
|
340
454
|
/** The list's name, from the field's `optionsFrom.list`. */
|
|
341
455
|
list: string;
|
|
342
|
-
/**
|
|
456
|
+
/**
|
|
457
|
+
* Every value of the form, for a list that changes with another field (`dependsOn`). For a table's line, the line's
|
|
458
|
+
* values: its connection, for its tools.
|
|
459
|
+
*/
|
|
343
460
|
values: Values;
|
|
461
|
+
/**
|
|
462
|
+
* For a table's line — or a form editing one in a dialog — the values of the record it is on, which a line's list
|
|
463
|
+
* may change with (`parent.` in its `dependsOn`). Left out for a page's own field.
|
|
464
|
+
*/
|
|
465
|
+
parent?: Values;
|
|
344
466
|
}
|
|
345
467
|
export interface CreateRequest {
|
|
346
468
|
model: string;
|
|
@@ -380,6 +502,8 @@ export interface SaveRequest {
|
|
|
380
502
|
* the record as it is now.
|
|
381
503
|
*/
|
|
382
504
|
version?: RecordVersion;
|
|
505
|
+
/** The key of the draft these changes were kept in on the server (`saveDraft`): the source may let it go. */
|
|
506
|
+
draft?: string;
|
|
383
507
|
}
|
|
384
508
|
export interface SaveResult {
|
|
385
509
|
id: RecordId;
|
|
@@ -491,7 +615,11 @@ export interface GroupRequest extends GroupInterval {
|
|
|
491
615
|
field: string;
|
|
492
616
|
filter: ResolvedFilter[];
|
|
493
617
|
}
|
|
494
|
-
/**
|
|
618
|
+
/**
|
|
619
|
+
* The records under one value of a field: a link's by its id, a record of links (a many2many) under each of its links
|
|
620
|
+
* — tags counted as a server groups them, a list's filter counting each — and those with none as a group of their own
|
|
621
|
+
* (value null).
|
|
622
|
+
*/
|
|
495
623
|
export interface Group {
|
|
496
624
|
value: JsonValue;
|
|
497
625
|
label: string;
|
|
@@ -606,6 +734,8 @@ export interface SubmitRequest {
|
|
|
606
734
|
values: Values;
|
|
607
735
|
/** On a page with a bot check (`botCheck`): what it saw, for the app to decide on. The page never refuses a send for it. */
|
|
608
736
|
bot?: BotReport;
|
|
737
|
+
/** The key of the draft these answers were kept in on the server (`saveDraft`): the source may let it go, or mark it sent. */
|
|
738
|
+
draft?: string;
|
|
609
739
|
}
|
|
610
740
|
/**
|
|
611
741
|
* What a page's bot check saw as its answers were sent. A person never fills the hidden box and takes longer than a
|
|
@@ -623,7 +753,14 @@ export interface BotReport {
|
|
|
623
753
|
captcha?: string | null;
|
|
624
754
|
}
|
|
625
755
|
export interface SubmitResult {
|
|
756
|
+
/** The id the app gave the response: a booking's reference ("B-1043"), a ticket's number. An ending's words say it as `{id}`. */
|
|
626
757
|
id?: RecordId;
|
|
758
|
+
/**
|
|
759
|
+
* Values the app worked out as it kept the response, by the page's fields — a reference field it filled in, the time
|
|
760
|
+
* it confirmed — laid over the answers sent where an ending reads them (its `when` and its `{field}`s). The form's
|
|
761
|
+
* answers themselves stay as they were sent.
|
|
762
|
+
*/
|
|
763
|
+
values?: Values;
|
|
627
764
|
}
|
|
628
765
|
/**
|
|
629
766
|
* What changed, using the operation names Odoo gives its x2many commands, so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-source.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/data-source.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"data-source.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/data-source.ts"],"names":[],"mappings":";;;AAkbA,oCAEC;AAGD,wCAGC;AA+ZD,kCAEC;AAGD,sCAMC;AAgDD,sCAOC;AA1eD,6GAA6G;AAC7G,SAAgB,YAAY,CAAC,MAAc,EAAE,OAA6D,EAAE;IAC1G,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC/H,CAAC;AAED,6HAA6H;AAC7H,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AC;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;IAClH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACpC,CAAC;AA2CD;;;;GAIG;AACH,SAAgB,aAAa,CAAC,KAAa,EAAE,MAAc,EAAE,MAAc;IACzE,MAAM,OAAO,GAAkB,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACpE,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,KAAK,WAAW;YAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAyB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;;YACjK,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IACpC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-source.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/data-source.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-source.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/data-source.ts"],"names":[],"mappings":"AAibA,6GAA6G;AAC7G,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,OAA6D,EAAE;IAC1G,OAAO,EAA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E,OAAO,EAAE,MAAM,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoredDraft } from './data-source.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* Drafts: what is typed kept to be offered again, in the browser's store (`drafts.store`) or on the app's server (the
|
|
4
|
+
* data source's `saveDraft` and `loadDraft`), the store keeping only its key then. A draft keeps the answers, the
|
|
5
|
+
* wizard's step and the optional steps passed over, and text typed that does not read yet, as it was typed.
|
|
6
|
+
*/
|
|
7
|
+
/** A draft as the browser's store keeps it: the draft itself, or — kept on the app's server — its key. */
|
|
8
|
+
export type KeptDraft = StoredDraft | {
|
|
9
|
+
savedAt: string;
|
|
10
|
+
key: string;
|
|
11
|
+
};
|
|
12
|
+
/** A draft read back from the browser's store, of this Fieldia or an older one (answers alone); null for none, or words that are none. */
|
|
13
|
+
export declare function draftRead(raw: string | null): KeptDraft | null;
|
|
14
|
+
/**
|
|
15
|
+
* The step a draft opens at: its own where it applies still, else the nearest before it that does — never one after
|
|
16
|
+
* it, whose questions were not reached — and the first that applies for a draft that names none (or one the page
|
|
17
|
+
* no longer has). Null for a page with no steps.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resumeStep(steps: readonly string[], applies: readonly string[], step: string | null | undefined): string | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoredDraft } from './data-source';
|
|
2
|
+
/**
|
|
3
|
+
* Drafts: what is typed kept to be offered again, in the browser's store (`drafts.store`) or on the app's server (the
|
|
4
|
+
* data source's `saveDraft` and `loadDraft`), the store keeping only its key then. A draft keeps the answers, the
|
|
5
|
+
* wizard's step and the optional steps passed over, and text typed that does not read yet, as it was typed.
|
|
6
|
+
*/
|
|
7
|
+
/** A draft as the browser's store keeps it: the draft itself, or — kept on the app's server — its key. */
|
|
8
|
+
export type KeptDraft = StoredDraft | {
|
|
9
|
+
savedAt: string;
|
|
10
|
+
key: string;
|
|
11
|
+
};
|
|
12
|
+
/** A draft read back from the browser's store, of this Fieldia or an older one (answers alone); null for none, or words that are none. */
|
|
13
|
+
export declare function draftRead(raw: string | null): KeptDraft | null;
|
|
14
|
+
/**
|
|
15
|
+
* The step a draft opens at: its own where it applies still, else the nearest before it that does — never one after
|
|
16
|
+
* it, whose questions were not reached — and the first that applies for a draft that names none (or one the page
|
|
17
|
+
* no longer has). Null for a page with no steps.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resumeStep(steps: readonly string[], applies: readonly string[], step: string | null | undefined): string | null;
|