@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
|
@@ -105,10 +105,21 @@ export interface Messages {
|
|
|
105
105
|
* could not be read again: nothing is saved over work the person never saw.
|
|
106
106
|
*/
|
|
107
107
|
theirsUnread: string;
|
|
108
|
+
/** Told as the source pushes that the record shown was deleted elsewhere (`subscribe`); by whom, where it says. */
|
|
109
|
+
deletedElsewhere: string;
|
|
110
|
+
deletedBy: string;
|
|
111
|
+
/** Told as a change made elsewhere is laid on the record shown, the person having changed nothing: `{fields}`, their labels; by whom, where it says. */
|
|
112
|
+
changedElsewhere: string;
|
|
113
|
+
changedBy: string;
|
|
108
114
|
/** Asked before a step leaves the record while work of the person's is not saved: a copy shown, another record. */
|
|
109
115
|
discardChanges: string;
|
|
110
116
|
/** Why a run of steps stopped: the record it ran on was replaced by another while it went on, and its steps are not for that one. */
|
|
111
117
|
recordReplaced: string;
|
|
118
|
+
/** Said with Undo after a one-tap press that offers it and said nothing of its own: `{label}`, the button's. */
|
|
119
|
+
pressDone: string;
|
|
120
|
+
/** The same, for the menu's own Archive and Unarchive. */
|
|
121
|
+
pressArchived: string;
|
|
122
|
+
pressUnarchived: string;
|
|
112
123
|
/**
|
|
113
124
|
* The same sentences in the words a page names its records by (`Page.records`): `{record}` for one, `{records}` for
|
|
114
125
|
* more, `{aRecord}` for one with its article. Where a language leaves one out, it says its own sentence above.
|
|
@@ -165,6 +176,8 @@ export interface Messages {
|
|
|
165
176
|
*/
|
|
166
177
|
languagesNeeded: string;
|
|
167
178
|
languagesNeededQuestion: string;
|
|
179
|
+
/** An email or a phone that asks for a code (`options.verify`) sent before the person confirmed it with one. */
|
|
180
|
+
notVerified: string;
|
|
168
181
|
/** The language the days in these messages are written in, as Intl reads it. */
|
|
169
182
|
locale: string;
|
|
170
183
|
/**
|
|
@@ -178,12 +191,17 @@ export interface Messages {
|
|
|
178
191
|
*/
|
|
179
192
|
dateOrder?: DateOrder;
|
|
180
193
|
}
|
|
181
|
-
|
|
194
|
+
/**
|
|
195
|
+
* A language Fieldia has its own words in. Turkish, Persian, Urdu and Spanish are machine-assisted and not yet reviewed
|
|
196
|
+
* by a native speaker (0.31).
|
|
197
|
+
*/
|
|
198
|
+
export type Locale = 'en' | 'ar' | 'de' | 'fr' | 'tr' | 'fa' | 'ur' | 'es';
|
|
182
199
|
/** A message every language has: the sentences in a page's words for its records (`…Noun`) are each language's own to give. */
|
|
183
200
|
export type MessageKey = Exclude<keyof Messages, `${string}Noun` | 'lowerLabels' | 'dateOrder'>;
|
|
184
201
|
/**
|
|
185
|
-
* The messages in every language Fieldia has. This package holds all
|
|
186
|
-
*
|
|
202
|
+
* The messages in every language Fieldia has. This package holds all eight
|
|
203
|
+
* (Turkish, Persian, Urdu and Spanish machine-assisted, not yet reviewed by a
|
|
204
|
+
* native speaker); the one-tag script holds English alone, and a page adds another language
|
|
187
205
|
* with that language's script (fieldia.ar.js, …), through the viewer's
|
|
188
206
|
* `addLanguage`.
|
|
189
207
|
*/
|
|
@@ -4,6 +4,8 @@ exports.MESSAGES = void 0;
|
|
|
4
4
|
exports.fillMessage = fillMessage;
|
|
5
5
|
exports.fill = fill;
|
|
6
6
|
const all_1 = require("./locales/all");
|
|
7
|
+
const later_1 = require("./locales/later");
|
|
8
|
+
const words_chunks_1 = require("./words-chunks");
|
|
7
9
|
const record_words_1 = require("./record-words");
|
|
8
10
|
/** English: always here, and the words a language leaves out. */
|
|
9
11
|
const en = {
|
|
@@ -73,8 +75,15 @@ const en = {
|
|
|
73
75
|
mayNotDuplicate: 'You cannot duplicate this record.',
|
|
74
76
|
mayNotDelete: 'You cannot delete this record.',
|
|
75
77
|
theirsUnread: 'Their version could not be read, so yours was not saved over it. Try Keep mine again, or Reload.',
|
|
78
|
+
deletedElsewhere: 'This record was deleted elsewhere.',
|
|
79
|
+
deletedBy: '{name} deleted this record.',
|
|
80
|
+
changedElsewhere: 'Changed elsewhere: {fields}.',
|
|
81
|
+
changedBy: '{name} changed {fields}.',
|
|
76
82
|
discardChanges: 'Discard your changes?',
|
|
77
83
|
recordReplaced: 'Another record is shown now: the rest of these steps did not run.',
|
|
84
|
+
pressDone: 'Done: {label}',
|
|
85
|
+
pressArchived: 'Archived.',
|
|
86
|
+
pressUnarchived: 'Brought back from the archive.',
|
|
78
87
|
archiveConfirmNoun: 'Are you sure that you want to archive this {record}?',
|
|
79
88
|
deleteConfirmNoun: 'Are you sure you want to delete this {record}?',
|
|
80
89
|
mayNotEditNoun: 'You can read this {record}, but not change it.',
|
|
@@ -105,15 +114,19 @@ const en = {
|
|
|
105
114
|
approvalNotYours: '{level} is not yours to decide now',
|
|
106
115
|
languagesNeeded: '{label} is required in {languages}',
|
|
107
116
|
languagesNeededQuestion: 'Please answer {label} in {languages}',
|
|
117
|
+
notVerified: '{label} is not confirmed: send a code and type it in',
|
|
108
118
|
locale: 'en',
|
|
109
119
|
};
|
|
110
120
|
/**
|
|
111
|
-
* The messages in every language Fieldia has. This package holds all
|
|
112
|
-
*
|
|
121
|
+
* The messages in every language Fieldia has. This package holds all eight
|
|
122
|
+
* (Turkish, Persian, Urdu and Spanish machine-assisted, not yet reviewed by a
|
|
123
|
+
* native speaker); the one-tag script holds English alone, and a page adds another language
|
|
113
124
|
* with that language's script (fieldia.ar.js, …), through the viewer's
|
|
114
125
|
* `addLanguage`.
|
|
115
126
|
*/
|
|
116
127
|
exports.MESSAGES = { en, ...all_1.LANGUAGES };
|
|
128
|
+
// Turkish, Persian, Urdu and Spanish: each in a chunk of its own, there once asked for (`wordsReady`), English till it came.
|
|
129
|
+
(0, words_chunks_1.wordsInChunks)((0, words_chunks_1.tableInChunks)(exports.MESSAGES, later_1.LATER));
|
|
117
130
|
/** The blanks of a message a field's label fills: its own, a table's column, a range's start and end. */
|
|
118
131
|
const LABELS = ['label', 'column', 'start', 'end'];
|
|
119
132
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/messages.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/messages.ts"],"names":[],"mappings":";;;AAiVA,kCAIC;AAGD,oBAEC;AA1VD,uCAA0C;AAC1C,2CAAwC;AACxC,iDAA8D;AAC9D,iDAAyC;AA6MzC,iEAAiE;AACjE,MAAM,EAAE,GAAa;IACnB,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IAAI,CAAC,QAAgB,EAAE,MAAuC;IAC5E,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAClH,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { LANGUAGES } from './locales/all.mjs';
|
|
2
|
+
import { LATER } from './locales/later.mjs';
|
|
3
|
+
import { tableInChunks, wordsInChunks } from './words-chunks.mjs';
|
|
2
4
|
import { labelAt } from './record-words.mjs';
|
|
3
5
|
/** English: always here, and the words a language leaves out. */
|
|
4
6
|
const en = {
|
|
@@ -68,8 +70,15 @@ const en = {
|
|
|
68
70
|
mayNotDuplicate: 'You cannot duplicate this record.',
|
|
69
71
|
mayNotDelete: 'You cannot delete this record.',
|
|
70
72
|
theirsUnread: 'Their version could not be read, so yours was not saved over it. Try Keep mine again, or Reload.',
|
|
73
|
+
deletedElsewhere: 'This record was deleted elsewhere.',
|
|
74
|
+
deletedBy: '{name} deleted this record.',
|
|
75
|
+
changedElsewhere: 'Changed elsewhere: {fields}.',
|
|
76
|
+
changedBy: '{name} changed {fields}.',
|
|
71
77
|
discardChanges: 'Discard your changes?',
|
|
72
78
|
recordReplaced: 'Another record is shown now: the rest of these steps did not run.',
|
|
79
|
+
pressDone: 'Done: {label}',
|
|
80
|
+
pressArchived: 'Archived.',
|
|
81
|
+
pressUnarchived: 'Brought back from the archive.',
|
|
73
82
|
archiveConfirmNoun: 'Are you sure that you want to archive this {record}?',
|
|
74
83
|
deleteConfirmNoun: 'Are you sure you want to delete this {record}?',
|
|
75
84
|
mayNotEditNoun: 'You can read this {record}, but not change it.',
|
|
@@ -100,15 +109,19 @@ const en = {
|
|
|
100
109
|
approvalNotYours: '{level} is not yours to decide now',
|
|
101
110
|
languagesNeeded: '{label} is required in {languages}',
|
|
102
111
|
languagesNeededQuestion: 'Please answer {label} in {languages}',
|
|
112
|
+
notVerified: '{label} is not confirmed: send a code and type it in',
|
|
103
113
|
locale: 'en',
|
|
104
114
|
};
|
|
105
115
|
/**
|
|
106
|
-
* The messages in every language Fieldia has. This package holds all
|
|
107
|
-
*
|
|
116
|
+
* The messages in every language Fieldia has. This package holds all eight
|
|
117
|
+
* (Turkish, Persian, Urdu and Spanish machine-assisted, not yet reviewed by a
|
|
118
|
+
* native speaker); the one-tag script holds English alone, and a page adds another language
|
|
108
119
|
* with that language's script (fieldia.ar.js, …), through the viewer's
|
|
109
120
|
* `addLanguage`.
|
|
110
121
|
*/
|
|
111
122
|
export const MESSAGES = { en, ...LANGUAGES };
|
|
123
|
+
// Turkish, Persian, Urdu and Spanish: each in a chunk of its own, there once asked for (`wordsReady`), English till it came.
|
|
124
|
+
wordsInChunks(tableInChunks(MESSAGES, LATER));
|
|
112
125
|
/** The blanks of a message a field's label fills: its own, a table's column, a range's start and end. */
|
|
113
126
|
const LABELS = ['label', 'column', 'start', 'end'];
|
|
114
127
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AA6MzC,iEAAi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AAED,kCAAkC;AAClC,MAAM,UAAU,IAAI,CAAC,QAAgB,EAAE,MAAuC;IAC5E,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAClH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Page } from '../format/page.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* Questions and steps in an order drawn for each respondent (`order: "random"` on a wizard, a step or a group), and N
|
|
4
|
+
* of a step's or a group's questions drawn of M (`draw`): the survey flow's part's. The draw is seeded, so the same seed draws
|
|
5
|
+
* the same order in every engine — the form keeps it (`state.order`), in its drafts too, so a person who comes back
|
|
6
|
+
* finds their questions where they left them.
|
|
7
|
+
*/
|
|
8
|
+
/** Whether a page of responses draws its order, or some of its questions, for each respondent (`order: "random"`, `draw`). */
|
|
9
|
+
export declare const drawsOrder: (page: Page) => boolean;
|
|
10
|
+
/** For each part drawn, its parts' ids in the order shown: those not drawn left out. */
|
|
11
|
+
export type DrawnOrder = Record<string, string[]>;
|
|
12
|
+
/** Numbers from 0 to 1 drawn from a seed (sfc32): the same seed, the same numbers, everywhere. */
|
|
13
|
+
export declare function seeded(seed: string): () => number;
|
|
14
|
+
/**
|
|
15
|
+
* The order a page's parts are shown in for one seed: each wizard whose steps are in random order, each step and group
|
|
16
|
+
* whose questions are or which draws some of them — by its id, its parts' ids in the order shown, those not drawn left
|
|
17
|
+
* out. Empty for a page that draws nothing.
|
|
18
|
+
*/
|
|
19
|
+
export declare function drawOrder(page: Page, seed: string): DrawnOrder;
|
|
20
|
+
/** The fields asked, in the order they were shown: the page's parts walked in their drawn order, those whose answers were sent. */
|
|
21
|
+
export declare function askedInOrder(page: Page, order: DrawnOrder | null, values: Record<string, unknown>): string[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Page } from '../format/page';
|
|
2
|
+
/**
|
|
3
|
+
* Questions and steps in an order drawn for each respondent (`order: "random"` on a wizard, a step or a group), and N
|
|
4
|
+
* of a step's or a group's questions drawn of M (`draw`): the survey flow's part's. The draw is seeded, so the same seed draws
|
|
5
|
+
* the same order in every engine — the form keeps it (`state.order`), in its drafts too, so a person who comes back
|
|
6
|
+
* finds their questions where they left them.
|
|
7
|
+
*/
|
|
8
|
+
/** Whether a page of responses draws its order, or some of its questions, for each respondent (`order: "random"`, `draw`). */
|
|
9
|
+
export declare const drawsOrder: (page: Page) => boolean;
|
|
10
|
+
/** For each part drawn, its parts' ids in the order shown: those not drawn left out. */
|
|
11
|
+
export type DrawnOrder = Record<string, string[]>;
|
|
12
|
+
/** Numbers from 0 to 1 drawn from a seed (sfc32): the same seed, the same numbers, everywhere. */
|
|
13
|
+
export declare function seeded(seed: string): () => number;
|
|
14
|
+
/**
|
|
15
|
+
* The order a page's parts are shown in for one seed: each wizard whose steps are in random order, each step and group
|
|
16
|
+
* whose questions are or which draws some of them — by its id, its parts' ids in the order shown, those not drawn left
|
|
17
|
+
* out. Empty for a page that draws nothing.
|
|
18
|
+
*/
|
|
19
|
+
export declare function drawOrder(page: Page, seed: string): DrawnOrder;
|
|
20
|
+
/** The fields asked, in the order they were shown: the page's parts walked in their drawn order, those whose answers were sent. */
|
|
21
|
+
export declare function askedInOrder(page: Page, order: DrawnOrder | null, values: Record<string, unknown>): string[];
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.drawsOrder = void 0;
|
|
4
|
+
exports.seeded = seeded;
|
|
5
|
+
exports.drawOrder = drawOrder;
|
|
6
|
+
exports.askedInOrder = askedInOrder;
|
|
7
|
+
/**
|
|
8
|
+
* Questions and steps in an order drawn for each respondent (`order: "random"` on a wizard, a step or a group), and N
|
|
9
|
+
* of a step's or a group's questions drawn of M (`draw`): the survey flow's part's. The draw is seeded, so the same seed draws
|
|
10
|
+
* the same order in every engine — the form keeps it (`state.order`), in its drafts too, so a person who comes back
|
|
11
|
+
* finds their questions where they left them.
|
|
12
|
+
*/
|
|
13
|
+
/** Whether a page of responses draws its order, or some of its questions, for each respondent (`order: "random"`, `draw`). */
|
|
14
|
+
const drawsOrder = (page) => page.data.kind === 'responses' && /"(order":"random|draw":)/.test(JSON.stringify(page.layout));
|
|
15
|
+
exports.drawsOrder = drawsOrder;
|
|
16
|
+
/** A string's hash as four 32-bit numbers (cyrb128): a seed's words made into the generator's start. */
|
|
17
|
+
function hashed(seed) {
|
|
18
|
+
let h1 = 1779033703;
|
|
19
|
+
let h2 = 3144134277;
|
|
20
|
+
let h3 = 1013904242;
|
|
21
|
+
let h4 = 2773480762;
|
|
22
|
+
for (let i = 0; i < seed.length; i++) {
|
|
23
|
+
const k = seed.charCodeAt(i);
|
|
24
|
+
h1 = h2 ^ Math.imul(h1 ^ k, 597399067);
|
|
25
|
+
h2 = h3 ^ Math.imul(h2 ^ k, 2869860233);
|
|
26
|
+
h3 = h4 ^ Math.imul(h3 ^ k, 951274213);
|
|
27
|
+
h4 = h1 ^ Math.imul(h4 ^ k, 2716044179);
|
|
28
|
+
}
|
|
29
|
+
h1 = Math.imul(h3 ^ (h1 >>> 18), 597399067);
|
|
30
|
+
h2 = Math.imul(h4 ^ (h2 >>> 22), 2869860233);
|
|
31
|
+
h3 = Math.imul(h1 ^ (h3 >>> 17), 951274213);
|
|
32
|
+
h4 = Math.imul(h2 ^ (h4 >>> 19), 2716044179);
|
|
33
|
+
return [(h1 ^ h2 ^ h3 ^ h4) >>> 0, (h2 ^ h1) >>> 0, (h3 ^ h1) >>> 0, (h4 ^ h1) >>> 0];
|
|
34
|
+
}
|
|
35
|
+
/** Numbers from 0 to 1 drawn from a seed (sfc32): the same seed, the same numbers, everywhere. */
|
|
36
|
+
function seeded(seed) {
|
|
37
|
+
let [a, b, c, d] = hashed(seed);
|
|
38
|
+
return () => {
|
|
39
|
+
a >>>= 0;
|
|
40
|
+
b >>>= 0;
|
|
41
|
+
c >>>= 0;
|
|
42
|
+
d >>>= 0;
|
|
43
|
+
let t = (a + b) | 0;
|
|
44
|
+
a = b ^ (b >>> 9);
|
|
45
|
+
b = (c + (c << 3)) | 0;
|
|
46
|
+
c = (c << 21) | (c >>> 11);
|
|
47
|
+
d = (d + 1) | 0;
|
|
48
|
+
t = (t + d) | 0;
|
|
49
|
+
c = (c + t) | 0;
|
|
50
|
+
return (t >>> 0) / 4294967296;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** A list in an order drawn (Fisher–Yates). */
|
|
54
|
+
function shuffled(items, next) {
|
|
55
|
+
const out = [...items];
|
|
56
|
+
for (let i = out.length - 1; i > 0; i--) {
|
|
57
|
+
const j = Math.floor(next() * (i + 1));
|
|
58
|
+
[out[i], out[j]] = [out[j], out[i]];
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
/** Whether a part is one a draw moves or leaves out: a question — a field, a saved form, a group of them — not fixed in its place. */
|
|
63
|
+
const drawable = (node) => (node.type === 'field' || node.type === 'form' || node.type === 'section') && node.fixed !== true;
|
|
64
|
+
/**
|
|
65
|
+
* The parts of one part in their order drawn: those a draw moves change places among themselves — the rest (words,
|
|
66
|
+
* pictures, a part fixed in its place) keep theirs — and `draw` of them, at most, are kept, the rest left out.
|
|
67
|
+
*/
|
|
68
|
+
function drawnParts(children, movable, random, draw, next) {
|
|
69
|
+
const moving = children.filter(movable);
|
|
70
|
+
let kept = moving;
|
|
71
|
+
if (draw !== undefined && draw < moving.length) {
|
|
72
|
+
// Which of them are asked, drawn; in their own order unless the order is drawn too.
|
|
73
|
+
const picked = new Set(shuffled(moving, next).slice(0, draw));
|
|
74
|
+
kept = moving.filter((child) => picked.has(child));
|
|
75
|
+
}
|
|
76
|
+
const placed = random ? shuffled(kept, next) : kept;
|
|
77
|
+
// The places of those that move, in turn: the first filled with those placed, the rest left out with those not drawn.
|
|
78
|
+
let at = 0;
|
|
79
|
+
const out = [];
|
|
80
|
+
for (const child of children) {
|
|
81
|
+
if (!movable(child))
|
|
82
|
+
out.push(child.id);
|
|
83
|
+
else if (at < placed.length)
|
|
84
|
+
out.push(placed[at++].id);
|
|
85
|
+
}
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The order a page's parts are shown in for one seed: each wizard whose steps are in random order, each step and group
|
|
90
|
+
* whose questions are or which draws some of them — by its id, its parts' ids in the order shown, those not drawn left
|
|
91
|
+
* out. Empty for a page that draws nothing.
|
|
92
|
+
*/
|
|
93
|
+
function drawOrder(page, seed) {
|
|
94
|
+
const next = seeded(`${page.id}\u0000${seed}`);
|
|
95
|
+
const order = {};
|
|
96
|
+
const visit = (node) => {
|
|
97
|
+
const own = node;
|
|
98
|
+
const children = Array.isArray(own.children) ? own.children : [];
|
|
99
|
+
if ((own.order === 'random' || own.draw !== undefined) && children.length) {
|
|
100
|
+
const steps = node.type === 'wizard';
|
|
101
|
+
order[own.id] = drawnParts(children, steps ? (child) => child.fixed !== true : (child) => drawable(child), own.order === 'random', steps ? undefined : own.draw, next);
|
|
102
|
+
}
|
|
103
|
+
for (const child of children)
|
|
104
|
+
visit(child);
|
|
105
|
+
};
|
|
106
|
+
const root = page.layout;
|
|
107
|
+
visit(root);
|
|
108
|
+
return order;
|
|
109
|
+
}
|
|
110
|
+
/** The fields asked, in the order they were shown: the page's parts walked in their drawn order, those whose answers were sent. */
|
|
111
|
+
function askedInOrder(page, order, values) {
|
|
112
|
+
const out = [];
|
|
113
|
+
const visit = (node) => {
|
|
114
|
+
if (node.type === 'field' && node.field && node.field in values && !out.includes(node.field))
|
|
115
|
+
out.push(node.field);
|
|
116
|
+
const children = Array.isArray(node.children) ? node.children : [];
|
|
117
|
+
const drawn = node.id ? order?.[node.id] : undefined;
|
|
118
|
+
const shown = drawn ? drawn.map((id) => children.find((child) => child.id === id)).filter((child) => !!child) : children;
|
|
119
|
+
for (const child of shown)
|
|
120
|
+
visit(child);
|
|
121
|
+
};
|
|
122
|
+
visit(page.layout);
|
|
123
|
+
// A saved form's answers, and any other sent, after: by name.
|
|
124
|
+
for (const name of Object.keys(values))
|
|
125
|
+
if (!out.includes(name))
|
|
126
|
+
out.push(name);
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/order.ts"],"names":[],"mappings":";;;AAqCA,wBAgBC;AA2CD,8BAeC;AAGD,oCAaC;AA5HD;;;;;GAKG;AAEH,8HAA8H;AACvH,MAAM,UAAU,GAAG,CAAC,IAAU,EAAW,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAArI,QAAA,UAAU,cAA2H;AAKlJ,wGAAwG;AACxG,SAAS,MAAM,CAAC,IAAY;IAC1B,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC7B,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC;QACvC,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EA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AAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Questions and steps in an order drawn for each respondent (`order: "random"` on a wizard, a step or a group), and N
|
|
3
|
+
* of a step's or a group's questions drawn of M (`draw`): the survey flow's part's. The draw is seeded, so the same seed draws
|
|
4
|
+
* the same order in every engine — the form keeps it (`state.order`), in its drafts too, so a person who comes back
|
|
5
|
+
* finds their questions where they left them.
|
|
6
|
+
*/
|
|
7
|
+
/** Whether a page of responses draws its order, or some of its questions, for each respondent (`order: "random"`, `draw`). */
|
|
8
|
+
export const drawsOrder = (page) => page.data.kind === 'responses' && /"(order":"random|draw":)/.test(JSON.stringify(page.layout));
|
|
9
|
+
/** A string's hash as four 32-bit numbers (cyrb128): a seed's words made into the generator's start. */
|
|
10
|
+
function hashed(seed) {
|
|
11
|
+
let h1 = 1779033703;
|
|
12
|
+
let h2 = 3144134277;
|
|
13
|
+
let h3 = 1013904242;
|
|
14
|
+
let h4 = 2773480762;
|
|
15
|
+
for (let i = 0; i < seed.length; i++) {
|
|
16
|
+
const k = seed.charCodeAt(i);
|
|
17
|
+
h1 = h2 ^ Math.imul(h1 ^ k, 597399067);
|
|
18
|
+
h2 = h3 ^ Math.imul(h2 ^ k, 2869860233);
|
|
19
|
+
h3 = h4 ^ Math.imul(h3 ^ k, 951274213);
|
|
20
|
+
h4 = h1 ^ Math.imul(h4 ^ k, 2716044179);
|
|
21
|
+
}
|
|
22
|
+
h1 = Math.imul(h3 ^ (h1 >>> 18), 597399067);
|
|
23
|
+
h2 = Math.imul(h4 ^ (h2 >>> 22), 2869860233);
|
|
24
|
+
h3 = Math.imul(h1 ^ (h3 >>> 17), 951274213);
|
|
25
|
+
h4 = Math.imul(h2 ^ (h4 >>> 19), 2716044179);
|
|
26
|
+
return [(h1 ^ h2 ^ h3 ^ h4) >>> 0, (h2 ^ h1) >>> 0, (h3 ^ h1) >>> 0, (h4 ^ h1) >>> 0];
|
|
27
|
+
}
|
|
28
|
+
/** Numbers from 0 to 1 drawn from a seed (sfc32): the same seed, the same numbers, everywhere. */
|
|
29
|
+
export function seeded(seed) {
|
|
30
|
+
let [a, b, c, d] = hashed(seed);
|
|
31
|
+
return () => {
|
|
32
|
+
a >>>= 0;
|
|
33
|
+
b >>>= 0;
|
|
34
|
+
c >>>= 0;
|
|
35
|
+
d >>>= 0;
|
|
36
|
+
let t = (a + b) | 0;
|
|
37
|
+
a = b ^ (b >>> 9);
|
|
38
|
+
b = (c + (c << 3)) | 0;
|
|
39
|
+
c = (c << 21) | (c >>> 11);
|
|
40
|
+
d = (d + 1) | 0;
|
|
41
|
+
t = (t + d) | 0;
|
|
42
|
+
c = (c + t) | 0;
|
|
43
|
+
return (t >>> 0) / 4294967296;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** A list in an order drawn (Fisher–Yates). */
|
|
47
|
+
function shuffled(items, next) {
|
|
48
|
+
const out = [...items];
|
|
49
|
+
for (let i = out.length - 1; i > 0; i--) {
|
|
50
|
+
const j = Math.floor(next() * (i + 1));
|
|
51
|
+
[out[i], out[j]] = [out[j], out[i]];
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
/** Whether a part is one a draw moves or leaves out: a question — a field, a saved form, a group of them — not fixed in its place. */
|
|
56
|
+
const drawable = (node) => (node.type === 'field' || node.type === 'form' || node.type === 'section') && node.fixed !== true;
|
|
57
|
+
/**
|
|
58
|
+
* The parts of one part in their order drawn: those a draw moves change places among themselves — the rest (words,
|
|
59
|
+
* pictures, a part fixed in its place) keep theirs — and `draw` of them, at most, are kept, the rest left out.
|
|
60
|
+
*/
|
|
61
|
+
function drawnParts(children, movable, random, draw, next) {
|
|
62
|
+
const moving = children.filter(movable);
|
|
63
|
+
let kept = moving;
|
|
64
|
+
if (draw !== undefined && draw < moving.length) {
|
|
65
|
+
// Which of them are asked, drawn; in their own order unless the order is drawn too.
|
|
66
|
+
const picked = new Set(shuffled(moving, next).slice(0, draw));
|
|
67
|
+
kept = moving.filter((child) => picked.has(child));
|
|
68
|
+
}
|
|
69
|
+
const placed = random ? shuffled(kept, next) : kept;
|
|
70
|
+
// The places of those that move, in turn: the first filled with those placed, the rest left out with those not drawn.
|
|
71
|
+
let at = 0;
|
|
72
|
+
const out = [];
|
|
73
|
+
for (const child of children) {
|
|
74
|
+
if (!movable(child))
|
|
75
|
+
out.push(child.id);
|
|
76
|
+
else if (at < placed.length)
|
|
77
|
+
out.push(placed[at++].id);
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The order a page's parts are shown in for one seed: each wizard whose steps are in random order, each step and group
|
|
83
|
+
* whose questions are or which draws some of them — by its id, its parts' ids in the order shown, those not drawn left
|
|
84
|
+
* out. Empty for a page that draws nothing.
|
|
85
|
+
*/
|
|
86
|
+
export function drawOrder(page, seed) {
|
|
87
|
+
const next = seeded(`${page.id}\u0000${seed}`);
|
|
88
|
+
const order = {};
|
|
89
|
+
const visit = (node) => {
|
|
90
|
+
const own = node;
|
|
91
|
+
const children = Array.isArray(own.children) ? own.children : [];
|
|
92
|
+
if ((own.order === 'random' || own.draw !== undefined) && children.length) {
|
|
93
|
+
const steps = node.type === 'wizard';
|
|
94
|
+
order[own.id] = drawnParts(children, steps ? (child) => child.fixed !== true : (child) => drawable(child), own.order === 'random', steps ? undefined : own.draw, next);
|
|
95
|
+
}
|
|
96
|
+
for (const child of children)
|
|
97
|
+
visit(child);
|
|
98
|
+
};
|
|
99
|
+
const root = page.layout;
|
|
100
|
+
visit(root);
|
|
101
|
+
return order;
|
|
102
|
+
}
|
|
103
|
+
/** The fields asked, in the order they were shown: the page's parts walked in their drawn order, those whose answers were sent. */
|
|
104
|
+
export function askedInOrder(page, order, values) {
|
|
105
|
+
const out = [];
|
|
106
|
+
const visit = (node) => {
|
|
107
|
+
if (node.type === 'field' && node.field && node.field in values && !out.includes(node.field))
|
|
108
|
+
out.push(node.field);
|
|
109
|
+
const children = Array.isArray(node.children) ? node.children : [];
|
|
110
|
+
const drawn = node.id ? order?.[node.id] : undefined;
|
|
111
|
+
const shown = drawn ? drawn.map((id) => children.find((child) => child.id === id)).filter((child) => !!child) : children;
|
|
112
|
+
for (const child of shown)
|
|
113
|
+
visit(child);
|
|
114
|
+
};
|
|
115
|
+
visit(page.layout);
|
|
116
|
+
// A saved form's answers, and any other sent, after: by name.
|
|
117
|
+
for (const name of Object.keys(values))
|
|
118
|
+
if (!out.includes(name))
|
|
119
|
+
out.push(name);
|
|
120
|
+
return out;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=order.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order.mjs","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/record/order.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,8HAA8H;AAC9H,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAU,EAAW,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAKlJ,wGAAwG;AACxG,SAAS,MAAM,CAAC,IAAY;IAC1B,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC7B,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC;QACvC,EAAE,GAAG,EAAE,GAA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YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChF,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type SaveProblem, type SaveRequest, type SubmitRequest, type UploadFile } from './data-source.mjs';
|
|
2
|
+
import type { FormInner, FormJoin } from './joins.mjs';
|
|
3
|
+
import { type FileValue } from './values.mjs';
|
|
4
|
+
/**
|
|
5
|
+
* An offline outbox (`outbox` on a page), the form's side — the outbox part's, which joins a form whose page has one
|
|
6
|
+
* (joins.ts): a send that finds no network is kept on the device — its answers and its photos' bytes — and sent in order
|
|
7
|
+
* when the signal comes back. In the one-tag script, one script with the viewer's outbox part (fieldia.outbox.js).
|
|
8
|
+
*/
|
|
9
|
+
/** A send kept on the device until it can go: what it was, its answers, how far it got. */
|
|
10
|
+
export interface OutboxItem {
|
|
11
|
+
/** Its own key, the same for every try: sent with it (`queued.key`), so a server can tell a second try from a new send. */
|
|
12
|
+
key: string;
|
|
13
|
+
pageId: string;
|
|
14
|
+
/** A response's `submit`, or a record's `save`. */
|
|
15
|
+
kind: 'submit' | 'save';
|
|
16
|
+
/** The send as it would have gone, its files' bytes in its values where they were not stored yet. */
|
|
17
|
+
request: SubmitRequest | SaveRequest;
|
|
18
|
+
/** When it was kept, as ISO: its place in the order they go. */
|
|
19
|
+
at: string;
|
|
20
|
+
/** A new record's own key on the form that kept it: a later save of the same record while this waits takes its place. */
|
|
21
|
+
record?: string;
|
|
22
|
+
/** How many times it was tried. */
|
|
23
|
+
tries: number;
|
|
24
|
+
/** Refused when it was sent (not the network's doing): why, kept for the person to see, and nothing sent after it waits on it. */
|
|
25
|
+
refused?: {
|
|
26
|
+
message: string;
|
|
27
|
+
problem?: SaveProblem;
|
|
28
|
+
};
|
|
29
|
+
/** Who is sending it now, and until when: no other tab or page sends it meanwhile. */
|
|
30
|
+
claim?: {
|
|
31
|
+
by: string;
|
|
32
|
+
until: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Where an outbox keeps its items: the browser's IndexedDB in the viewer (the outbox part's), a memory store in tests
|
|
37
|
+
* (`memoryOutbox`), or the app's own. Every call is the store's to make atomic: `claim` takes an item for one sender only.
|
|
38
|
+
*/
|
|
39
|
+
export interface OutboxStore {
|
|
40
|
+
/** The items of a page, in the order they were kept. */
|
|
41
|
+
list(pageId: string): Promise<OutboxItem[]>;
|
|
42
|
+
put(item: OutboxItem): Promise<void>;
|
|
43
|
+
delete(key: string): Promise<void>;
|
|
44
|
+
/** Take an item to send it, unless another sender holds it still: whether it was taken. */
|
|
45
|
+
claim(key: string, by: string, until: number): Promise<boolean>;
|
|
46
|
+
}
|
|
47
|
+
/** A form's outbox, made for it (`join`; `form.joined('outbox')`). */
|
|
48
|
+
export interface FormOutbox extends FormJoin {
|
|
49
|
+
/** Keep a send that found no network, in order — a new record's later save in place of its earlier one still waiting. */
|
|
50
|
+
keep(kind: OutboxItem['kind'], request: SubmitRequest | SaveRequest, record?: string): Promise<OutboxItem>;
|
|
51
|
+
/** Send what waits, in order: a network's failure stops it there (tried again later), a refusal is kept and said. */
|
|
52
|
+
send(): Promise<void>;
|
|
53
|
+
/** What waits now, told in the form's state (`outbox`). */
|
|
54
|
+
refresh(): Promise<void>;
|
|
55
|
+
/** Let a refused send go: the person's Discard. */
|
|
56
|
+
discard(key: string): Promise<void>;
|
|
57
|
+
/** Try again a refused send, as it is. */
|
|
58
|
+
retry(key: string): Promise<void>;
|
|
59
|
+
/** A file the network could not take, as its field keeps it until the send goes: its bytes, in base64. */
|
|
60
|
+
bytes(file: UploadFile): Promise<FileValue>;
|
|
61
|
+
}
|
|
62
|
+
/** An outbox kept in memory: for tests, and where a browser keeps nothing (no IndexedDB). Lost with the page. */
|
|
63
|
+
export declare function memoryOutbox(): OutboxStore & {
|
|
64
|
+
readonly items: OutboxItem[];
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* An outbox kept in the browser's IndexedDB (database `fieldia-outbox`, store `items`): never lost on a reload, shared by
|
|
68
|
+
* the tabs of one site, an item taken by one sender at a time in a transaction of its own. Null where the browser has no
|
|
69
|
+
* IndexedDB.
|
|
70
|
+
*/
|
|
71
|
+
export declare function indexedOutbox(name?: string): OutboxStore | null;
|
|
72
|
+
/**
|
|
73
|
+
* The outbox part's side of a form (`outbox` on its page): around each send, one that finds no network kept on the
|
|
74
|
+
* device in order — the form going on as though it went, its ending saying so (`state.outbox.kept`) — and a file the
|
|
75
|
+
* network could not take kept as its bytes; what waits sent — each taken by one sender only, its photos stored first —
|
|
76
|
+
* when the signal comes back, and right after a send of this form went through; a refusal kept and said; what waits
|
|
77
|
+
* told in the form's state (`outbox`).
|
|
78
|
+
*/
|
|
79
|
+
export declare function join(joined: FormInner): FormOutbox;
|