@qoretechnologies/reqraft 0.10.78 → 0.10.79-pr.145.g447ecec
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/dist/components/Description/AllowedValuesHelp.d.ts +7 -7
- package/dist/components/Description/AllowedValuesHelp.d.ts.map +1 -1
- package/dist/components/Description/AllowedValuesHelp.js +13 -10
- package/dist/components/Description/AllowedValuesHelp.js.map +1 -1
- package/dist/components/Description/describedControl.d.ts +1 -1
- package/dist/components/Description/describedControl.js +1 -1
- package/dist/components/Description/index.d.ts.map +1 -1
- package/dist/components/Description/index.js +22 -4
- package/dist/components/Description/index.js.map +1 -1
- package/dist/components/FocusedEditing/index.d.ts.map +1 -1
- package/dist/components/FocusedEditing/index.js +3 -1
- package/dist/components/FocusedEditing/index.js.map +1 -1
- package/dist/components/codeSize/index.d.ts +11 -3
- package/dist/components/codeSize/index.d.ts.map +1 -1
- package/dist/components/codeSize/index.js +24 -8
- package/dist/components/codeSize/index.js.map +1 -1
- package/dist/components/colorValue/colorValue.d.ts +4 -4
- package/dist/components/colorValue/colorValue.d.ts.map +1 -1
- package/dist/components/colorValue/colorValue.js +32 -41
- package/dist/components/colorValue/colorValue.js.map +1 -1
- package/dist/components/colorValue/index.js +1 -1
- package/dist/components/colorValue/index.js.map +1 -1
- package/dist/components/composer/Composer.d.ts +18 -2
- package/dist/components/composer/Composer.d.ts.map +1 -1
- package/dist/components/composer/Composer.js +57 -29
- package/dist/components/composer/Composer.js.map +1 -1
- package/dist/components/composer/labels.d.ts +24 -0
- package/dist/components/composer/labels.d.ts.map +1 -0
- package/dist/components/composer/labels.js +16 -0
- package/dist/components/composer/labels.js.map +1 -0
- package/dist/components/dpqlEditor/DpqlEditor.js +3 -3
- package/dist/components/dpqlEditor/DpqlEditor.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlCompletions.d.ts +4 -4
- package/dist/components/dpqlEditor/dpqlCompletions.d.ts.map +1 -1
- package/dist/components/dpqlEditor/dpqlCompletions.js +10 -10
- package/dist/components/dpqlEditor/dpqlCompletions.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlHelpers.d.ts +2 -2
- package/dist/components/dpqlEditor/dpqlHelpers.js +6 -6
- package/dist/components/dpqlEditor/dpqlHelpers.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlInserter.d.ts.map +1 -1
- package/dist/components/dpqlEditor/dpqlInserter.js +1 -2
- package/dist/components/dpqlEditor/dpqlInserter.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlTags.d.ts +1 -1
- package/dist/components/dpqlEditor/dpqlTags.js +4 -4
- package/dist/components/dpqlEditor/dpqlTags.js.map +1 -1
- package/dist/components/dpqlEditor/types.d.ts +7 -7
- package/dist/components/dpqlEditor/useDpqlSession.d.ts +1 -1
- package/dist/components/dpqlEditor/useDpqlSession.d.ts.map +1 -1
- package/dist/components/dpqlEditor/useDpqlSession.js +2 -2
- package/dist/components/dpqlEditor/useDpqlSession.js.map +1 -1
- package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
- package/dist/components/form/engine/CompactRow.js +243 -87
- package/dist/components/form/engine/CompactRow.js.map +1 -1
- package/dist/components/form/engine/CompactToolbar.d.ts.map +1 -1
- package/dist/components/form/engine/CompactToolbar.js +73 -21
- package/dist/components/form/engine/CompactToolbar.js.map +1 -1
- package/dist/components/form/engine/DefaultsNote.d.ts +32 -0
- package/dist/components/form/engine/DefaultsNote.d.ts.map +1 -0
- package/dist/components/form/engine/DefaultsNote.js +33 -0
- package/dist/components/form/engine/DefaultsNote.js.map +1 -0
- package/dist/components/form/engine/FieldMessageDetails.d.ts +17 -0
- package/dist/components/form/engine/FieldMessageDetails.d.ts.map +1 -0
- package/dist/components/form/engine/FieldMessageDetails.js +24 -0
- package/dist/components/form/engine/FieldMessageDetails.js.map +1 -0
- package/dist/components/form/engine/FormEngine.d.ts +125 -5
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +800 -257
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/FormFieldsSkeleton.d.ts +1 -1
- package/dist/components/form/engine/HiddenFieldsNote.d.ts +1 -1
- package/dist/components/form/engine/HiddenFieldsNote.js +1 -1
- package/dist/components/form/engine/ItemAttention.d.ts +12 -0
- package/dist/components/form/engine/ItemAttention.d.ts.map +1 -0
- package/dist/components/form/engine/ItemAttention.js +33 -0
- package/dist/components/form/engine/ItemAttention.js.map +1 -0
- package/dist/components/form/engine/OptionFieldMessages.d.ts +35 -2
- package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
- package/dist/components/form/engine/OptionFieldMessages.js +46 -10
- package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
- package/dist/components/form/engine/OptionsHelpDialog.js +3 -3
- package/dist/components/form/engine/OptionsHelpDialog.js.map +1 -1
- package/dist/components/form/engine/ReadReveal.d.ts +26 -0
- package/dist/components/form/engine/ReadReveal.d.ts.map +1 -0
- package/dist/components/form/engine/ReadReveal.js +52 -0
- package/dist/components/form/engine/ReadReveal.js.map +1 -0
- package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts +11 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.js +96 -19
- package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
- package/dist/components/form/engine/cardHeaderPin.d.ts +59 -0
- package/dist/components/form/engine/cardHeaderPin.d.ts.map +1 -0
- package/dist/components/form/engine/cardHeaderPin.js +137 -0
- package/dist/components/form/engine/cardHeaderPin.js.map +1 -0
- package/dist/components/form/engine/compactRowContext.d.ts +19 -3
- package/dist/components/form/engine/compactRowContext.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowContext.js.map +1 -1
- package/dist/components/form/engine/compactRowStyles.d.ts +32 -6
- package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowStyles.js +128 -60
- package/dist/components/form/engine/compactRowStyles.js.map +1 -1
- package/dist/components/form/engine/compactToolbarColors.d.ts +1 -1
- package/dist/components/form/engine/compactToolbarColors.js +1 -1
- package/dist/components/form/engine/compactToolbarContext.d.ts +9 -0
- package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
- package/dist/components/form/engine/compactToolbarContext.js.map +1 -1
- package/dist/components/form/engine/formAppearance.d.ts +96 -0
- package/dist/components/form/engine/formAppearance.d.ts.map +1 -0
- package/dist/components/form/engine/formAppearance.js +156 -0
- package/dist/components/form/engine/formAppearance.js.map +1 -0
- package/dist/components/form/engine/operatorSummary.d.ts +2 -2
- package/dist/components/form/engine/operatorSummary.js +2 -2
- package/dist/components/form/engine/readFirst.d.ts +47 -3
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +43 -9
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/engine/readFirstColors.d.ts +1 -1
- package/dist/components/form/engine/readFirstColors.js +1 -1
- package/dist/components/form/engine/revealRow.d.ts +20 -4
- package/dist/components/form/engine/revealRow.d.ts.map +1 -1
- package/dist/components/form/engine/revealRow.js +37 -8
- package/dist/components/form/engine/revealRow.js.map +1 -1
- package/dist/components/form/engine/rowFocus.d.ts +9 -1
- package/dist/components/form/engine/rowFocus.d.ts.map +1 -1
- package/dist/components/form/engine/rowFocus.js +17 -4
- package/dist/components/form/engine/rowFocus.js.map +1 -1
- package/dist/components/form/engine/rowLabelled.d.ts +9 -0
- package/dist/components/form/engine/rowLabelled.d.ts.map +1 -0
- package/dist/components/form/engine/rowLabelled.js +12 -0
- package/dist/components/form/engine/rowLabelled.js.map +1 -0
- package/dist/components/form/engine/rowPlaces.d.ts +43 -0
- package/dist/components/form/engine/rowPlaces.d.ts.map +1 -0
- package/dist/components/form/engine/rowPlaces.js +163 -0
- package/dist/components/form/engine/rowPlaces.js.map +1 -0
- package/dist/components/form/engine/variants/focusDemo.js +1 -1
- package/dist/components/form/engine/variants/focusDemo.js.map +1 -1
- package/dist/components/form/engine/variants/variantModel.d.ts +1 -1
- package/dist/components/form/engine/variants/variantModel.d.ts.map +1 -1
- package/dist/components/form/engine/variants/variantModel.js +2 -2
- package/dist/components/form/engine/variants/variantModel.js.map +1 -1
- package/dist/components/form/engine/variants/variantParts.js +3 -2
- package/dist/components/form/engine/variants/variantParts.js.map +1 -1
- package/dist/components/form/expressions/DpqlRendering.d.ts.map +1 -1
- package/dist/components/form/expressions/DpqlRendering.js +5 -3
- package/dist/components/form/expressions/DpqlRendering.js.map +1 -1
- package/dist/components/form/expressions/ExpressionField.d.ts +9 -11
- package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
- package/dist/components/form/expressions/ExpressionField.js +26 -24
- package/dist/components/form/expressions/ExpressionField.js.map +1 -1
- package/dist/components/form/expressions/argumentPresence.d.ts +1 -1
- package/dist/components/form/expressions/argumentPresence.js +1 -1
- package/dist/components/form/expressions/builder/argumentDetail.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentDetail.js +5 -2
- package/dist/components/form/expressions/builder/argumentDetail.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.d.ts +4 -2
- package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.js +69 -29
- package/dist/components/form/expressions/builder/argumentLabel.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentSlot.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentSlot.js +3 -2
- package/dist/components/form/expressions/builder/argumentSlot.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentWrapper.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentWrapper.js +11 -7
- package/dist/components/form/expressions/builder/argumentWrapper.js.map +1 -1
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts +1 -1
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js +15 -10
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js.map +1 -1
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js +4 -2
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js.map +1 -1
- package/dist/components/form/expressions/builder/index.d.ts +9 -4
- package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/index.js +120 -75
- package/dist/components/form/expressions/builder/index.js.map +1 -1
- package/dist/components/form/expressions/builder/item.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/item.js +4 -2
- package/dist/components/form/expressions/builder/item.js.map +1 -1
- package/dist/components/form/expressions/builder/moveToPositionStrip.d.ts +1 -1
- package/dist/components/form/expressions/builder/moveToPositionStrip.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/moveToPositionStrip.js +8 -7
- package/dist/components/form/expressions/builder/moveToPositionStrip.js.map +1 -1
- package/dist/components/form/expressions/builder/renderTemplate.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/renderTemplate.js +3 -1
- package/dist/components/form/expressions/builder/renderTemplate.js.map +1 -1
- package/dist/components/form/expressions/dpqlMockRecordPath.js +2 -2
- package/dist/components/form/expressions/dpqlMockRecordPath.js.map +1 -1
- package/dist/components/form/expressions/expressionOperands.js +1 -1
- package/dist/components/form/expressions/fieldPath.js +1 -1
- package/dist/components/form/expressions/fieldPath.js.map +1 -1
- package/dist/components/form/expressions/labels.d.ts +143 -0
- package/dist/components/form/expressions/labels.d.ts.map +1 -0
- package/dist/components/form/expressions/labels.js +123 -0
- package/dist/components/form/expressions/labels.js.map +1 -0
- package/dist/components/form/expressions/loneValue.d.ts +1 -1
- package/dist/components/form/expressions/loneValue.js +1 -1
- package/dist/components/form/expressions/mockExpressions.js +2 -2
- package/dist/components/form/expressions/mockExpressions.js.map +1 -1
- package/dist/components/form/expressions/renderExpressionToText.d.ts.map +1 -1
- package/dist/components/form/expressions/renderExpressionToText.js +16 -1
- package/dist/components/form/expressions/renderExpressionToText.js.map +1 -1
- package/dist/components/form/expressions/types.d.ts +2 -2
- package/dist/components/form/expressions/useExpressionType.js +1 -1
- package/dist/components/form/expressions/useExpressionType.js.map +1 -1
- package/dist/components/form/fields/ChoiceGroupHeading.d.ts +22 -0
- package/dist/components/form/fields/ChoiceGroupHeading.d.ts.map +1 -0
- package/dist/components/form/fields/ChoiceGroupHeading.js +40 -0
- package/dist/components/form/fields/ChoiceGroupHeading.js.map +1 -0
- package/dist/components/form/fields/Field.d.ts +9 -2
- package/dist/components/form/fields/Field.d.ts.map +1 -1
- package/dist/components/form/fields/Field.js +20 -15
- package/dist/components/form/fields/Field.js.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +11 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.js +42 -18
- package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
- package/dist/components/form/fields/allowed-values/choicePicture.d.ts +3 -3
- package/dist/components/form/fields/allowed-values/choicePicture.js +3 -3
- package/dist/components/form/fields/allowed-values/savedValues.d.ts +30 -0
- package/dist/components/form/fields/allowed-values/savedValues.d.ts.map +1 -0
- package/dist/components/form/fields/allowed-values/savedValues.js +39 -0
- package/dist/components/form/fields/allowed-values/savedValues.js.map +1 -0
- package/dist/components/form/fields/array/ArrayAuto.d.ts.map +1 -1
- package/dist/components/form/fields/array/ArrayAuto.js +32 -15
- package/dist/components/form/fields/array/ArrayAuto.js.map +1 -1
- package/dist/components/form/fields/array/ArrayAutoField.d.ts.map +1 -1
- package/dist/components/form/fields/array/ArrayAutoField.js +22 -20
- package/dist/components/form/fields/array/ArrayAutoField.js.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts +12 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.js +59 -29
- package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
- package/dist/components/form/fields/auto/hostEditorValue.d.ts +1 -1
- package/dist/components/form/fields/auto/hostEditorValue.js +1 -1
- package/dist/components/form/fields/binary/Binary.d.ts.map +1 -1
- package/dist/components/form/fields/binary/Binary.js +7 -2
- package/dist/components/form/fields/binary/Binary.js.map +1 -1
- package/dist/components/form/fields/boolean/Boolean.d.ts +8 -2
- package/dist/components/form/fields/boolean/Boolean.d.ts.map +1 -1
- package/dist/components/form/fields/boolean/Boolean.js +9 -3
- package/dist/components/form/fields/boolean/Boolean.js.map +1 -1
- package/dist/components/form/fields/codeFont.d.ts +12 -0
- package/dist/components/form/fields/codeFont.d.ts.map +1 -0
- package/dist/components/form/fields/codeFont.js +26 -0
- package/dist/components/form/fields/codeFont.js.map +1 -0
- package/dist/components/form/fields/color/Color.d.ts +1 -1
- package/dist/components/form/fields/color/Color.d.ts.map +1 -1
- package/dist/components/form/fields/color/Color.js +12 -10
- package/dist/components/form/fields/color/Color.js.map +1 -1
- package/dist/components/form/fields/date/Date.d.ts +7 -1
- package/dist/components/form/fields/date/Date.d.ts.map +1 -1
- package/dist/components/form/fields/date/Date.js +4 -2
- package/dist/components/form/fields/date/Date.js.map +1 -1
- package/dist/components/form/fields/emittedValues.d.ts +1 -1
- package/dist/components/form/fields/emittedValues.js +1 -1
- package/dist/components/form/fields/file/File.d.ts +1 -1
- package/dist/components/form/fields/file/File.d.ts.map +1 -1
- package/dist/components/form/fields/file/File.js +18 -6
- package/dist/components/form/fields/file/File.js.map +1 -1
- package/dist/components/form/fields/labels.d.ts +81 -0
- package/dist/components/form/fields/labels.d.ts.map +1 -0
- package/dist/components/form/fields/labels.js +52 -0
- package/dist/components/form/fields/labels.js.map +1 -0
- package/dist/components/form/fields/long-string/LongString.d.ts +7 -1
- package/dist/components/form/fields/long-string/LongString.d.ts.map +1 -1
- package/dist/components/form/fields/long-string/LongString.js +19 -9
- package/dist/components/form/fields/long-string/LongString.js.map +1 -1
- package/dist/components/form/fields/markdown/Markdown.d.ts.map +1 -1
- package/dist/components/form/fields/markdown/Markdown.js +3 -1
- package/dist/components/form/fields/markdown/Markdown.js.map +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js.map +1 -1
- package/dist/components/form/fields/number/Number.d.ts +6 -3
- package/dist/components/form/fields/number/Number.d.ts.map +1 -1
- package/dist/components/form/fields/number/Number.js +24 -10
- package/dist/components/form/fields/number/Number.js.map +1 -1
- package/dist/components/form/fields/object/Object.d.ts +36 -1
- package/dist/components/form/fields/object/Object.d.ts.map +1 -1
- package/dist/components/form/fields/object/Object.js +145 -19
- package/dist/components/form/fields/object/Object.js.map +1 -1
- package/dist/components/form/fields/pendingEdit.d.ts +1 -1
- package/dist/components/form/fields/pendingEdit.js +1 -1
- package/dist/components/form/fields/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/components/form/fields/radio-group/RadioGroup.js +13 -7
- package/dist/components/form/fields/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.d.ts +1 -1
- package/dist/components/form/fields/rich-text/RichText.d.ts.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.js +15 -12
- package/dist/components/form/fields/rich-text/RichText.js.map +1 -1
- package/dist/components/form/fields/rich-text/useTemplateTags.d.ts +3 -1
- package/dist/components/form/fields/rich-text/useTemplateTags.d.ts.map +1 -1
- package/dist/components/form/fields/rich-text/useTemplateTags.js +9 -3
- package/dist/components/form/fields/rich-text/useTemplateTags.js.map +1 -1
- package/dist/components/form/fields/schema-definition/CatalogLeafForm.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/CatalogLeafForm.js +11 -9
- package/dist/components/form/fields/schema-definition/CatalogLeafForm.js.map +1 -1
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.d.ts +1 -1
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js +42 -30
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js.map +1 -1
- package/dist/components/form/fields/schema-definition/Hint.d.ts +4 -3
- package/dist/components/form/fields/schema-definition/Hint.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/Hint.js +10 -2
- package/dist/components/form/fields/schema-definition/Hint.js.map +1 -1
- package/dist/components/form/fields/schema-definition/InlineValidationBanner.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/InlineValidationBanner.js +3 -1
- package/dist/components/form/fields/schema-definition/InlineValidationBanner.js.map +1 -1
- package/dist/components/form/fields/schema-definition/Loader.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/Loader.js +4 -2
- package/dist/components/form/fields/schema-definition/Loader.js.map +1 -1
- package/dist/components/form/fields/schema-definition/MigrationsTab.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/MigrationsTab.js +31 -26
- package/dist/components/form/fields/schema-definition/MigrationsTab.js.map +1 -1
- package/dist/components/form/fields/schema-definition/TableEditor.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/TableEditor.js +3 -1
- package/dist/components/form/fields/schema-definition/TableEditor.js.map +1 -1
- package/dist/components/form/fields/schema-definition/TablesTab.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/TablesTab.js +25 -23
- package/dist/components/form/fields/schema-definition/TablesTab.js.map +1 -1
- package/dist/components/form/fields/schema-definition/index.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/index.js +21 -15
- package/dist/components/form/fields/schema-definition/index.js.map +1 -1
- package/dist/components/form/fields/schema-definition/labels.d.ts +123 -0
- package/dist/components/form/fields/schema-definition/labels.d.ts.map +1 -0
- package/dist/components/form/fields/schema-definition/labels.js +113 -0
- package/dist/components/form/fields/schema-definition/labels.js.map +1 -0
- package/dist/components/form/fields/schema-definition/mockCatalog.d.ts +1 -1
- package/dist/components/form/fields/schema-definition/referenceSuggestions.d.ts +1 -1
- package/dist/components/form/fields/schema-definition/types.d.ts +2 -2
- package/dist/components/form/fields/schema-definition/types.js +1 -1
- package/dist/components/form/fields/select/Select.d.ts +11 -5
- package/dist/components/form/fields/select/Select.d.ts.map +1 -1
- package/dist/components/form/fields/select/Select.js +18 -11
- package/dist/components/form/fields/select/Select.js.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.d.ts +28 -3
- package/dist/components/form/fields/select/SelectCollection.d.ts.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.js +40 -9
- package/dist/components/form/fields/select/SelectCollection.js.map +1 -1
- package/dist/components/form/fields/select/unavailableRow.d.ts +1 -1
- package/dist/components/form/fields/select/unavailableRow.js +1 -1
- package/dist/components/form/fields/template/ExampleValueModal.d.ts.map +1 -1
- package/dist/components/form/fields/template/ExampleValueModal.js +4 -1
- package/dist/components/form/fields/template/ExampleValueModal.js.map +1 -1
- package/dist/components/form/fields/template/TemplateBrowser.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateBrowser.js +6 -4
- package/dist/components/form/fields/template/TemplateBrowser.js.map +1 -1
- package/dist/components/form/fields/template/TemplateField.d.ts +24 -5
- package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateField.js +117 -99
- package/dist/components/form/fields/template/TemplateField.js.map +1 -1
- package/dist/components/form/fields/template/TemplatePicker.d.ts +9 -3
- package/dist/components/form/fields/template/TemplatePicker.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplatePicker.js +62 -34
- package/dist/components/form/fields/template/TemplatePicker.js.map +1 -1
- package/dist/components/form/fields/template/referenceNames.d.ts +2 -2
- package/dist/components/form/fields/template/templatesListProps.d.ts +11 -0
- package/dist/components/form/fields/template/templatesListProps.d.ts.map +1 -0
- package/dist/components/form/fields/template/templatesListProps.js +37 -0
- package/dist/components/form/fields/template/templatesListProps.js.map +1 -0
- package/dist/components/form/fields/template/writtenAsText.d.ts +2 -2
- package/dist/components/form/fields/template/writtenAsText.js +2 -2
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +2 -0
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/form/typeSentenceForm.js +1 -1
- package/dist/components/imageLightbox/ImageLightbox.d.ts.map +1 -1
- package/dist/components/imageLightbox/ImageLightbox.js +11 -7
- package/dist/components/imageLightbox/ImageLightbox.js.map +1 -1
- package/dist/components/log/Log.d.ts +1 -1
- package/dist/components/log/Log.d.ts.map +1 -1
- package/dist/components/log/Log.js +22 -19
- package/dist/components/log/Log.js.map +1 -1
- package/dist/components/log/labels.d.ts +25 -0
- package/dist/components/log/labels.d.ts.map +1 -0
- package/dist/components/log/labels.js +22 -0
- package/dist/components/log/labels.js.map +1 -0
- package/dist/components/menu/Menu.d.ts.map +1 -1
- package/dist/components/menu/Menu.js +3 -1
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/qonsoleSmartInput/useQonsoleSession.d.ts.map +1 -1
- package/dist/components/qonsoleSmartInput/useQonsoleSession.js +3 -2
- package/dist/components/qonsoleSmartInput/useQonsoleSession.js.map +1 -1
- package/dist/components/smartEditor/CompletionMenu.d.ts +1 -1
- package/dist/components/smartEditor/CompletionMenu.d.ts.map +1 -1
- package/dist/components/smartEditor/CompletionMenu.js +25 -19
- package/dist/components/smartEditor/CompletionMenu.js.map +1 -1
- package/dist/components/smartEditor/SmartEditor.d.ts.map +1 -1
- package/dist/components/smartEditor/SmartEditor.js +21 -23
- package/dist/components/smartEditor/SmartEditor.js.map +1 -1
- package/dist/components/smartEditor/caretBox.d.ts +1 -1
- package/dist/components/smartEditor/caretBox.js +1 -1
- package/dist/components/smartEditor/completionStyle.d.ts +21 -6
- package/dist/components/smartEditor/completionStyle.d.ts.map +1 -1
- package/dist/components/smartEditor/completionStyle.js +46 -23
- package/dist/components/smartEditor/completionStyle.js.map +1 -1
- package/dist/components/smartEditor/contextTitle.d.ts +2 -2
- package/dist/components/smartEditor/contextTitle.js +2 -2
- package/dist/components/smartEditor/editingAids.d.ts +2 -2
- package/dist/components/smartEditor/editingAids.js +2 -2
- package/dist/components/smartEditor/index.js +1 -1
- package/dist/components/smartEditor/index.js.map +1 -1
- package/dist/components/smartEditor/templateCompletions.d.ts +7 -7
- package/dist/components/smartEditor/templateCompletions.d.ts.map +1 -1
- package/dist/components/smartEditor/templateCompletions.js +14 -15
- package/dist/components/smartEditor/templateCompletions.js.map +1 -1
- package/dist/components/smartEditor/typedReferences.d.ts +1 -1
- package/dist/components/smartEditor/typedReferences.js +3 -3
- package/dist/components/smartEditor/typedReferences.js.map +1 -1
- package/dist/components/smartEditor/types.d.ts +8 -8
- package/dist/components/smartEditor/useEditingAids.js +1 -1
- package/dist/components/smartEditor/useEditingAids.js.map +1 -1
- package/dist/components/smartEditor/useLspAutocomplete.d.ts +9 -4
- package/dist/components/smartEditor/useLspAutocomplete.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspAutocomplete.js +92 -38
- package/dist/components/smartEditor/useLspAutocomplete.js.map +1 -1
- package/dist/components/smartEditor/useLspHover.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspHover.js +4 -5
- package/dist/components/smartEditor/useLspHover.js.map +1 -1
- package/dist/components/smartEditor/useTabCameIn.d.ts +1 -1
- package/dist/components/smartEditor/useTabCameIn.js +1 -1
- package/dist/components/supportTicket/AttachmentChips.d.ts.map +1 -1
- package/dist/components/supportTicket/AttachmentChips.js +5 -3
- package/dist/components/supportTicket/AttachmentChips.js.map +1 -1
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts +10 -3
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts.map +1 -1
- package/dist/components/supportTicket/InterfaceReferenceTags.js +9 -8
- package/dist/components/supportTicket/InterfaceReferenceTags.js.map +1 -1
- package/dist/components/supportTicket/ReferencePicker.d.ts +3 -2
- package/dist/components/supportTicket/ReferencePicker.d.ts.map +1 -1
- package/dist/components/supportTicket/ReferencePicker.js +36 -26
- package/dist/components/supportTicket/ReferencePicker.js.map +1 -1
- package/dist/components/supportTicket/TicketHeader.d.ts.map +1 -1
- package/dist/components/supportTicket/TicketHeader.js +6 -3
- package/dist/components/supportTicket/TicketHeader.js.map +1 -1
- package/dist/components/supportTicket/TicketMetaTags.d.ts +19 -12
- package/dist/components/supportTicket/TicketMetaTags.d.ts.map +1 -1
- package/dist/components/supportTicket/TicketMetaTags.js +57 -6
- package/dist/components/supportTicket/TicketMetaTags.js.map +1 -1
- package/dist/components/supportTicket/TicketReplyBox.d.ts +3 -2
- package/dist/components/supportTicket/TicketReplyBox.d.ts.map +1 -1
- package/dist/components/supportTicket/TicketReplyBox.js +41 -19
- package/dist/components/supportTicket/TicketReplyBox.js.map +1 -1
- package/dist/components/supportTicket/WorkspaceAccessStatus.d.ts +10 -2
- package/dist/components/supportTicket/WorkspaceAccessStatus.d.ts.map +1 -1
- package/dist/components/supportTicket/WorkspaceAccessStatus.js +45 -17
- package/dist/components/supportTicket/WorkspaceAccessStatus.js.map +1 -1
- package/dist/components/supportTicket/accessMeta.d.ts +6 -1
- package/dist/components/supportTicket/accessMeta.d.ts.map +1 -1
- package/dist/components/supportTicket/accessMeta.js +83 -65
- package/dist/components/supportTicket/accessMeta.js.map +1 -1
- package/dist/components/supportTicket/attachmentAccess.d.ts.map +1 -1
- package/dist/components/supportTicket/attachmentAccess.js +14 -26
- package/dist/components/supportTicket/attachmentAccess.js.map +1 -1
- package/dist/components/supportTicket/fileToAttachment.d.ts.map +1 -1
- package/dist/components/supportTicket/fileToAttachment.js +4 -1
- package/dist/components/supportTicket/fileToAttachment.js.map +1 -1
- package/dist/components/supportTicket/labels.d.ts +159 -0
- package/dist/components/supportTicket/labels.d.ts.map +1 -0
- package/dist/components/supportTicket/labels.js +216 -0
- package/dist/components/supportTicket/labels.js.map +1 -0
- package/dist/components/supportTicket/meta.d.ts +35 -6
- package/dist/components/supportTicket/meta.d.ts.map +1 -1
- package/dist/components/supportTicket/meta.js +100 -73
- package/dist/components/supportTicket/meta.js.map +1 -1
- package/dist/components/supportTicket/ticketAttentionInks.d.ts +23 -0
- package/dist/components/supportTicket/ticketAttentionInks.d.ts.map +1 -0
- package/dist/components/supportTicket/ticketAttentionInks.js +42 -0
- package/dist/components/supportTicket/ticketAttentionInks.js.map +1 -0
- package/dist/components/supportTicket/ticketModel.d.ts +6 -2
- package/dist/components/supportTicket/ticketModel.d.ts.map +1 -1
- package/dist/components/supportTicket/useLoadedImages.d.ts +10 -0
- package/dist/components/supportTicket/useLoadedImages.d.ts.map +1 -1
- package/dist/components/supportTicket/useLoadedImages.js +64 -1
- package/dist/components/supportTicket/useLoadedImages.js.map +1 -1
- package/dist/components/ticketReferences/TicketReferences.d.ts.map +1 -1
- package/dist/components/ticketReferences/TicketReferences.js +57 -46
- package/dist/components/ticketReferences/TicketReferences.js.map +1 -1
- package/dist/components/ticketThread/TicketThread.d.ts +22 -2
- package/dist/components/ticketThread/TicketThread.d.ts.map +1 -1
- package/dist/components/ticketThread/TicketThread.js +61 -39
- package/dist/components/ticketThread/TicketThread.js.map +1 -1
- package/dist/components/ticketThread/index.d.ts +1 -1
- package/dist/components/ticketThread/index.d.ts.map +1 -1
- package/dist/components/ticketThread/index.js +2 -1
- package/dist/components/ticketThread/index.js.map +1 -1
- package/dist/helpers/allowedValues.d.ts +1 -1
- package/dist/helpers/allowedValues.d.ts.map +1 -1
- package/dist/helpers/allowedValues.js +12 -5
- package/dist/helpers/allowedValues.js.map +1 -1
- package/dist/helpers/common.d.ts +4 -0
- package/dist/helpers/common.d.ts.map +1 -1
- package/dist/helpers/common.js +11 -7
- package/dist/helpers/common.js.map +1 -1
- package/dist/helpers/domProps.js +1 -1
- package/dist/helpers/expressions.d.ts +7 -7
- package/dist/helpers/expressions.d.ts.map +1 -1
- package/dist/helpers/expressions.js +15 -20
- package/dist/helpers/expressions.js.map +1 -1
- package/dist/helpers/fieldDescription.d.ts +16 -0
- package/dist/helpers/fieldDescription.d.ts.map +1 -0
- package/dist/helpers/fieldDescription.js +40 -0
- package/dist/helpers/fieldDescription.js.map +1 -0
- package/dist/helpers/hoveringPointer.d.ts +1 -1
- package/dist/helpers/hoveringPointer.js +1 -1
- package/dist/helpers/markdownText.d.ts +9 -0
- package/dist/helpers/markdownText.d.ts.map +1 -1
- package/dist/helpers/markdownText.js +50 -3
- package/dist/helpers/markdownText.js.map +1 -1
- package/dist/helpers/noDescription.d.ts +9 -5
- package/dist/helpers/noDescription.d.ts.map +1 -1
- package/dist/helpers/noDescription.js +18 -7
- package/dist/helpers/noDescription.js.map +1 -1
- package/dist/helpers/optionUiTypes.d.ts +3 -3
- package/dist/helpers/options.d.ts +2 -2
- package/dist/helpers/options.d.ts.map +1 -1
- package/dist/helpers/options.js +11 -8
- package/dist/helpers/options.js.map +1 -1
- package/dist/helpers/qorusTypeCatalogue.d.ts +9 -9
- package/dist/helpers/qorusTypeCatalogue.js +11 -11
- package/dist/helpers/qorusTypeCatalogue.js.map +1 -1
- package/dist/helpers/readableColors.d.ts +9 -1
- package/dist/helpers/readableColors.d.ts.map +1 -1
- package/dist/helpers/readableColors.js +13 -2
- package/dist/helpers/readableColors.js.map +1 -1
- package/dist/helpers/recordFieldReference.js +1 -1
- package/dist/helpers/recordFieldReference.js.map +1 -1
- package/dist/helpers/reqraftLabels.d.ts +129 -7
- package/dist/helpers/reqraftLabels.d.ts.map +1 -1
- package/dist/helpers/reqraftLabels.js +101 -21
- package/dist/helpers/reqraftLabels.js.map +1 -1
- package/dist/helpers/sentenceCase.d.ts +9 -0
- package/dist/helpers/sentenceCase.d.ts.map +1 -0
- package/dist/helpers/sentenceCase.js +22 -0
- package/dist/helpers/sentenceCase.js.map +1 -0
- package/dist/helpers/singleLineString.d.ts.map +1 -1
- package/dist/helpers/singleLineString.js +1 -0
- package/dist/helpers/singleLineString.js.map +1 -1
- package/dist/helpers/templateCatalogue.d.ts +2 -2
- package/dist/helpers/templateCatalogue.js +3 -3
- package/dist/helpers/templateCatalogueContext.d.ts +1 -1
- package/dist/helpers/templateCatalogueContext.js +1 -1
- package/dist/helpers/templateItems.d.ts +15 -1
- package/dist/helpers/templateItems.d.ts.map +1 -1
- package/dist/helpers/templateItems.js +59 -2
- package/dist/helpers/templateItems.js.map +1 -1
- package/dist/helpers/templateListLabels.d.ts +9 -0
- package/dist/helpers/templateListLabels.d.ts.map +1 -1
- package/dist/helpers/templateListLabels.js +10 -0
- package/dist/helpers/templateListLabels.js.map +1 -1
- package/dist/helpers/templateTree.d.ts +9 -9
- package/dist/helpers/templateTree.js +14 -14
- package/dist/helpers/templateType.d.ts +1 -1
- package/dist/helpers/templateType.js +1 -1
- package/dist/helpers/templates.d.ts +53 -9
- package/dist/helpers/templates.d.ts.map +1 -1
- package/dist/helpers/templates.js +165 -44
- package/dist/helpers/templates.js.map +1 -1
- package/dist/helpers/validationLabels.d.ts +193 -0
- package/dist/helpers/validationLabels.d.ts.map +1 -0
- package/dist/helpers/validationLabels.js +213 -0
- package/dist/helpers/validationLabels.js.map +1 -0
- package/dist/helpers/validations.d.ts +16 -4
- package/dist/helpers/validations.d.ts.map +1 -1
- package/dist/helpers/validations.js +211 -209
- package/dist/helpers/validations.js.map +1 -1
- package/dist/helpers/webLink.d.ts +2 -2
- package/dist/helpers/webLink.js +2 -2
- package/dist/hooks/useDestructiveButtonProps.d.ts +22 -0
- package/dist/hooks/useDestructiveButtonProps.d.ts.map +1 -0
- package/dist/hooks/useDestructiveButtonProps.js +46 -0
- package/dist/hooks/useDestructiveButtonProps.js.map +1 -0
- package/dist/hooks/useEqualValue.d.ts +14 -0
- package/dist/hooks/useEqualValue.d.ts.map +1 -0
- package/dist/hooks/useEqualValue.js +27 -0
- package/dist/hooks/useEqualValue.js.map +1 -0
- package/dist/hooks/useFetch/useFetch.js +1 -1
- package/dist/hooks/useReadableIntentShade.d.ts +1 -1
- package/dist/hooks/useReadableIntentShade.js +1 -1
- package/dist/hooks/useReadableOpacity.d.ts +1 -1
- package/dist/hooks/useReadableOpacity.js +1 -1
- package/dist/hooks/useTemplates.d.ts +0 -7
- package/dist/hooks/useTemplates.d.ts.map +1 -1
- package/dist/hooks/useTemplates.js +25 -12
- package/dist/hooks/useTemplates.js.map +1 -1
- package/dist/hooks/useWebSocket/useWebSocket.d.ts.map +1 -1
- package/dist/hooks/useWebSocket/useWebSocket.js +6 -5
- package/dist/hooks/useWebSocket/useWebSocket.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/dist/providers/StorageProvider.d.ts +1 -1
- package/dist/providers/StorageProvider.js +1 -1
- package/dist/stores/currentUser/currentUser.d.ts +5 -5
- package/dist/stores/currentUser/currentUser.d.ts.map +1 -1
- package/dist/tracking/ui/ExperimentCard.d.ts +3 -3
- package/dist/tracking/ui/ExperimentCard.d.ts.map +1 -1
- package/dist/tracking/ui/ExperimentCard.js +34 -46
- package/dist/tracking/ui/ExperimentCard.js.map +1 -1
- package/dist/tracking/ui/ExperimentsOverlay.d.ts +3 -3
- package/dist/tracking/ui/ExperimentsOverlay.d.ts.map +1 -1
- package/dist/tracking/ui/ExperimentsOverlay.js +8 -6
- package/dist/tracking/ui/ExperimentsOverlay.js.map +1 -1
- package/dist/tracking/ui/card.d.ts +9 -13
- package/dist/tracking/ui/card.d.ts.map +1 -1
- package/dist/tracking/ui/card.js +96 -107
- package/dist/tracking/ui/card.js.map +1 -1
- package/dist/tracking/ui/client.d.ts +0 -6
- package/dist/tracking/ui/client.d.ts.map +1 -1
- package/dist/tracking/ui/client.js +9 -2
- package/dist/tracking/ui/client.js.map +1 -1
- package/dist/tracking/ui/labels.d.ts +198 -0
- package/dist/tracking/ui/labels.d.ts.map +1 -0
- package/dist/tracking/ui/labels.js +171 -0
- package/dist/tracking/ui/labels.js.map +1 -0
- package/dist/tracking/ui/readable.js +1 -1
- package/dist/utils/fetch.d.ts +1 -1
- package/dist/utils/fetch.js +1 -1
- package/package.json +2 -1
|
@@ -44,13 +44,16 @@ var templates_1 = require("./templates");
|
|
|
44
44
|
var allowedValues_1 = require("./allowedValues");
|
|
45
45
|
var colorValue_1 = require("../components/colorValue/colorValue");
|
|
46
46
|
var loneValue_1 = require("../components/form/expressions/loneValue");
|
|
47
|
+
var reqraftLabels_1 = require("./reqraftLabels");
|
|
47
48
|
/** The five cron fields, in order, as a schedule hash may name them. */
|
|
49
|
+
// each part of a schedule under each name a caller may give it; a Qorus job's `job-schedule` hash names the weekday
|
|
50
|
+
// `dayofweek`
|
|
48
51
|
var CRON_FIELDS = [
|
|
49
52
|
['minutes', 'minute'],
|
|
50
53
|
['hours', 'hour'],
|
|
51
54
|
['days', 'day'],
|
|
52
55
|
['months', 'month'],
|
|
53
|
-
['dow', 'weekday'],
|
|
56
|
+
['dow', 'weekday', 'dayofweek'],
|
|
54
57
|
];
|
|
55
58
|
/**
|
|
56
59
|
* A five-field cron expression, from either representation a caller may hold.
|
|
@@ -73,19 +76,14 @@ var cronExpressionFromValue = function (value) {
|
|
|
73
76
|
return undefined;
|
|
74
77
|
}
|
|
75
78
|
var hash = value;
|
|
76
|
-
var parts = CRON_FIELDS.map(function (
|
|
77
|
-
var
|
|
78
|
-
var plural = _a[0], singular = _a[1];
|
|
79
|
-
var field = (_b = hash[plural]) !== null && _b !== void 0 ? _b : hash[singular];
|
|
79
|
+
var parts = CRON_FIELDS.map(function (names) {
|
|
80
|
+
var field = names.map(function (name) { return hash[name]; }).find(function (value) { return value !== undefined && value !== null; });
|
|
80
81
|
return field === undefined || field === null || field === '' ? '*' : String(field);
|
|
81
82
|
});
|
|
82
83
|
// An object with none of the five keys is not a schedule — every part
|
|
83
84
|
// defaulting to `*` would otherwise turn any object at all into "* * * * *"
|
|
84
85
|
return parts.every(function (part) { return part === '*'; }) &&
|
|
85
|
-
!CRON_FIELDS.some(function (
|
|
86
|
-
var plural = _a[0], singular = _a[1];
|
|
87
|
-
return plural in hash || singular in hash;
|
|
88
|
-
})
|
|
86
|
+
!CRON_FIELDS.some(function (names) { return names.some(function (name) { return name in hash; }); })
|
|
89
87
|
? undefined
|
|
90
88
|
: parts.join(' ');
|
|
91
89
|
};
|
|
@@ -106,27 +104,25 @@ var SEMANTIC_FORMAT_PATTERNS = {
|
|
|
106
104
|
ipv6: /^([0-9A-Fa-f]{0,4}:){2,7}[0-9A-Fa-f]{0,4}$/,
|
|
107
105
|
phone: /^\+?[0-9 ().-]{3,}$/,
|
|
108
106
|
};
|
|
107
|
+
/** The words a reason is said in, read when it is said: a host that gives others is answered in them. */
|
|
108
|
+
var words = function () { return (0, reqraftLabels_1.reqraftLabels)().validation; };
|
|
109
109
|
var validResult = function () { return ({ isValid: true, reasons: [] }); };
|
|
110
110
|
/**
|
|
111
111
|
* Why a value its field's pattern refuses is refused, in words the author can act on: what the pattern accepts,
|
|
112
112
|
* as the server says it ("Must be a host name and a port."); else the form a value must have, by the field's
|
|
113
|
-
* example; the pattern itself last, as a detail
|
|
114
|
-
*
|
|
113
|
+
* example; the pattern itself last, as a detail: the author is told why there is an error, what does not match
|
|
114
|
+
* and what the pattern is. It said "Value does not match validation pattern".
|
|
115
115
|
*/
|
|
116
116
|
var patternMismatchReason = function (field) {
|
|
117
|
-
var sentence = function (text) { return (/[.!?]$/.test(text) ? text : "".concat(text, ".")); };
|
|
118
117
|
var desc = typeof (field === null || field === void 0 ? void 0 : field.validation_regex_desc) === 'string' ? field.validation_regex_desc.trim() : '';
|
|
119
118
|
if (desc) {
|
|
120
|
-
return
|
|
119
|
+
return words().mustBe(desc);
|
|
121
120
|
}
|
|
122
121
|
var example = field === null || field === void 0 ? void 0 : field.example_value;
|
|
123
122
|
var exampleText = typeof example === 'string' ? example.trim()
|
|
124
123
|
: typeof example === 'number' || typeof example === 'boolean' ? String(example)
|
|
125
124
|
: '';
|
|
126
|
-
|
|
127
|
-
"Must match the expected form, for example ".concat(exampleText, ".")
|
|
128
|
-
: 'Must match the expected form.';
|
|
129
|
-
return (field === null || field === void 0 ? void 0 : field.validation_regex) ? "".concat(main, " Pattern: ").concat(field.validation_regex) : main;
|
|
125
|
+
return words().mustMatchExpectedForm(exampleText || undefined, (field === null || field === void 0 ? void 0 : field.validation_regex) || undefined);
|
|
130
126
|
};
|
|
131
127
|
exports.patternMismatchReason = patternMismatchReason;
|
|
132
128
|
var invalidResult = function (reason, childReasons) {
|
|
@@ -142,12 +138,11 @@ var withContext = function (result, context) {
|
|
|
142
138
|
if (result.isValid || !context) {
|
|
143
139
|
return result;
|
|
144
140
|
}
|
|
145
|
-
var
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
};
|
|
141
|
+
var checked = context;
|
|
142
|
+
var reasons = result.reasons.length > 0 ?
|
|
143
|
+
result.reasons.map(function (reason) { return words().inContext(checked, reason); })
|
|
144
|
+
: [checked];
|
|
145
|
+
return __assign({ isValid: false, reason: reasons[0], reasons: reasons }, (result.missingOperand ? { missingOperand: true } : {}));
|
|
151
146
|
};
|
|
152
147
|
var resultFromBoolean = function (isValid, reason) {
|
|
153
148
|
return isValid ? validResult() : invalidResult(reason);
|
|
@@ -178,10 +173,10 @@ var checkNumericBounds = function (value, field) {
|
|
|
178
173
|
var min = field === null || field === void 0 ? void 0 : field.min_value;
|
|
179
174
|
var max = field === null || field === void 0 ? void 0 : field.max_value;
|
|
180
175
|
if (typeof min === 'number' && Number.isFinite(min) && num < min) {
|
|
181
|
-
return invalidResult(
|
|
176
|
+
return invalidResult(words().atLeast(min));
|
|
182
177
|
}
|
|
183
178
|
if (typeof max === 'number' && Number.isFinite(max) && num > max) {
|
|
184
|
-
return invalidResult(
|
|
179
|
+
return invalidResult(words().atMost(max));
|
|
185
180
|
}
|
|
186
181
|
return validResult();
|
|
187
182
|
};
|
|
@@ -213,16 +208,13 @@ var isValueDefined = function (type, value) {
|
|
|
213
208
|
};
|
|
214
209
|
/**
|
|
215
210
|
* A type named inside a sentence: its sentence form in the server's type catalogue ("a whole number"), as reqraft
|
|
216
|
-
* keeps it - the form's own words, said before and without any server
|
|
211
|
+
* keeps it - the form's own words, said before and without any server.
|
|
217
212
|
*/
|
|
218
213
|
var typeInSentence = function (type) {
|
|
219
214
|
return (0, qorusTypeCatalogue_1.qorusTypeSentenceForm)(qorusTypeCatalogue_1.defaultQorusTypes, type);
|
|
220
215
|
};
|
|
221
|
-
/** What is said of a value that is not of its field's type, the type named where there is one
|
|
222
|
-
var valueMustBe = function (type) {
|
|
223
|
-
var named = typeInSentence(type);
|
|
224
|
-
return named ? "Value must be ".concat(named) : "Value must be of this field's type";
|
|
225
|
-
};
|
|
216
|
+
/** What is said of a value that is not of its field's type, the type named where there is one. */
|
|
217
|
+
var valueMustBe = function (type) { return words().valueMustBe(typeInSentence(type)); };
|
|
226
218
|
/** The types a value is written as text in, where text around a template makes it text and not one of them. */
|
|
227
219
|
var NOT_TEXT_WITH_A_TEMPLATE = new Set([
|
|
228
220
|
'int',
|
|
@@ -240,41 +232,30 @@ var NOT_TEXT_WITH_A_TEMPLATE = new Set([
|
|
|
240
232
|
]);
|
|
241
233
|
/**
|
|
242
234
|
* What is said of a value of a type that is not text, written with text around a template: what makes it
|
|
243
|
-
* text, and what to do about it (
|
|
235
|
+
* text, and what to do about it ("How does the user fix this? Why has this
|
|
244
236
|
* happened?"). `undefined` where the type is text, or the value is not text around a template.
|
|
245
237
|
*/
|
|
246
238
|
var textAroundATemplateReason = function (type, value) {
|
|
247
|
-
var
|
|
248
|
-
var notA = NOT_TEXT_WITH_A_TEMPLATE.has(type)
|
|
249
|
-
? ((_a = typeInSentence(type)) !== null && _a !== void 0 ? _a : "of this field's type")
|
|
250
|
-
: undefined;
|
|
251
|
-
var around = notA ? (0, templates_1.textAroundATemplate)(value) : undefined;
|
|
239
|
+
var around = NOT_TEXT_WITH_A_TEMPLATE.has(type) ? (0, templates_1.textAroundATemplate)(value) : undefined;
|
|
252
240
|
if (!around) {
|
|
253
241
|
return undefined;
|
|
254
242
|
}
|
|
243
|
+
// the type as the catalogue names it inside a sentence; the words say it of the field's type where it has no name
|
|
244
|
+
var named = typeInSentence(type);
|
|
255
245
|
if (around.templates > 1) {
|
|
256
246
|
return around.text.length
|
|
257
|
-
?
|
|
258
|
-
:
|
|
247
|
+
? words().textAndTemplatesMakeText(named)
|
|
248
|
+
: words().templatesSideBySide(named);
|
|
259
249
|
}
|
|
260
|
-
return
|
|
261
|
-
};
|
|
262
|
-
/** 1st, 2nd, 3rd, 4th, … 11th, 12th, 13th, … 21st: a position as it is written. */
|
|
263
|
-
var ordinal = function (n) {
|
|
264
|
-
var _a;
|
|
265
|
-
var tens = n % 100;
|
|
266
|
-
if (tens >= 11 && tens <= 13) {
|
|
267
|
-
return "".concat(n, "th");
|
|
268
|
-
}
|
|
269
|
-
return "".concat(n).concat((_a = { 1: 'st', 2: 'nd', 3: 'rd' }[n % 10]) !== null && _a !== void 0 ? _a : 'th');
|
|
250
|
+
return words().textAroundTemplate(around.text, named);
|
|
270
251
|
};
|
|
271
252
|
var _validateField = function (type, value, field, canBeNull) {
|
|
272
253
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
273
254
|
if (!type) {
|
|
274
255
|
if (value === undefined || value === null) {
|
|
275
|
-
return invalidResult(
|
|
256
|
+
return invalidResult(words().missingValue);
|
|
276
257
|
}
|
|
277
|
-
return invalidResult(
|
|
258
|
+
return invalidResult(words().missingType);
|
|
278
259
|
}
|
|
279
260
|
// Check if the type starts with a * to indicate it can be null
|
|
280
261
|
if (type.startsWith('*')) {
|
|
@@ -292,7 +273,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
292
273
|
}
|
|
293
274
|
/* A value whose type is not text, written with text around a template, is not of that type: a whole
|
|
294
275
|
number written as "$record:{pos} Stk." passed as a template - anything starting with `$` and holding
|
|
295
|
-
a `:` did - and the form could be saved with a value its type cannot hold
|
|
276
|
+
a `:` did - and the form could be saved with a value its type cannot hold. A template
|
|
296
277
|
alone, a literal and an expression are judged as before. */
|
|
297
278
|
var textAroundReason = textAroundATemplateReason(type, value);
|
|
298
279
|
if (textAroundReason) {
|
|
@@ -302,7 +283,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
302
283
|
if ((0, templates_1.isValueTemplate)(value)) {
|
|
303
284
|
var hasKey = !!(0, templates_1.getTemplateKey)(value);
|
|
304
285
|
var hasValue = !!(0, templates_1.getTemplateValue)(value);
|
|
305
|
-
return resultFromBoolean(hasKey && hasValue,
|
|
286
|
+
return resultFromBoolean(hasKey && hasValue, words().templateNeedsKeyAndValue);
|
|
306
287
|
}
|
|
307
288
|
// Expression values (`is_expression`) carry the AST `{ exp, args }` instead of
|
|
308
289
|
// a typed literal, so the declared type says nothing about them — validate
|
|
@@ -332,7 +313,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
332
313
|
// here with the field's schema (choices included) and the AST as the value.
|
|
333
314
|
var unlistedChoiceReason = type === 'expression' ? undefined : (0, allowedValues_1.getUnlistedChoiceReason)(value, field);
|
|
334
315
|
if (unlistedChoiceReason) {
|
|
335
|
-
return invalidResult(unlistedChoiceReason);
|
|
316
|
+
return __assign(__assign({}, invalidResult(unlistedChoiceReason)), { unlistedChoice: true });
|
|
336
317
|
}
|
|
337
318
|
// An interface type names another Qorus object by its name, so a non-empty
|
|
338
319
|
// string is the whole contract. `connection` is the exception: it carries
|
|
@@ -342,14 +323,18 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
342
323
|
}
|
|
343
324
|
switch (type) {
|
|
344
325
|
case 'richtext': {
|
|
345
|
-
if (
|
|
346
|
-
return invalidResult(
|
|
326
|
+
if (value === undefined || value === null || value === '') {
|
|
327
|
+
return invalidResult(words().textEmpty);
|
|
347
328
|
}
|
|
348
329
|
if (typeof value === 'string') {
|
|
349
330
|
return validResult();
|
|
350
331
|
}
|
|
351
|
-
|
|
352
|
-
|
|
332
|
+
// A number or a yes / no is not empty text: it is not text (it said "Text value is empty" of 123).
|
|
333
|
+
if (typeof value !== 'object') {
|
|
334
|
+
return invalidResult(valueMustBe('string'));
|
|
335
|
+
}
|
|
336
|
+
if (!(0, size_1.default)(value) || isRichTextWithoutValue(value)) {
|
|
337
|
+
return invalidResult(words().textEmpty);
|
|
353
338
|
}
|
|
354
339
|
return validResult();
|
|
355
340
|
}
|
|
@@ -360,21 +345,21 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
360
345
|
(value === undefined && (field === null || field === void 0 ? void 0 : field.has_to_have_value) === false), valueMustBe('bool'));
|
|
361
346
|
case 'connection': {
|
|
362
347
|
if (!value) {
|
|
363
|
-
return invalidResult(
|
|
348
|
+
return invalidResult(words().connectionMissing);
|
|
364
349
|
}
|
|
365
350
|
if (field === null || field === void 0 ? void 0 : field.allowed_values) {
|
|
366
351
|
var allowedValue = field.allowed_values.find(function (val) { return (0, allowedValues_1.allowedValueOf)(val) === value || val.name === value; });
|
|
367
352
|
if (!allowedValue) {
|
|
368
|
-
return invalidResult(
|
|
353
|
+
return invalidResult(words().connectionNotAllowed);
|
|
369
354
|
}
|
|
370
355
|
if (allowedValue.disabled || ((_b = allowedValue.metadata) === null || _b === void 0 ? void 0 : _b.needs_auth)) {
|
|
371
|
-
return invalidResult(
|
|
356
|
+
return invalidResult(words().connectionDisabled);
|
|
372
357
|
}
|
|
373
358
|
}
|
|
374
359
|
if ((field === null || field === void 0 ? void 0 : field.disabled) || ((_c = field === null || field === void 0 ? void 0 : field.metadata) === null || _c === void 0 ? void 0 : _c.needs_auth)) {
|
|
375
|
-
return invalidResult(
|
|
360
|
+
return invalidResult(words().connectionDisabled);
|
|
376
361
|
}
|
|
377
|
-
return withContext((0, exports.validateFieldWithResult)('string', value, field),
|
|
362
|
+
return withContext((0, exports.validateFieldWithResult)('string', value, field), words().connectionTextInvalid);
|
|
378
363
|
}
|
|
379
364
|
// semantic string formats — permissive patterns mirror the qore DataProvider
|
|
380
365
|
// QoreStringFormatDataType backstop; a server-supplied validation_regex, if
|
|
@@ -386,20 +371,20 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
386
371
|
case 'ipv6':
|
|
387
372
|
case 'phone': {
|
|
388
373
|
if (value === undefined || value === null || value === '' || typeof value !== 'string') {
|
|
389
|
-
return invalidResult(
|
|
374
|
+
return invalidResult(words().nonEmptyText);
|
|
390
375
|
}
|
|
391
376
|
if ((field === null || field === void 0 ? void 0 : field.validation_regex) && !value.match(field.validation_regex)) {
|
|
392
377
|
return invalidResult((0, exports.patternMismatchReason)(field));
|
|
393
378
|
}
|
|
394
|
-
return resultFromBoolean(SEMANTIC_FORMAT_PATTERNS[type].test(value),
|
|
379
|
+
return resultFromBoolean(SEMANTIC_FORMAT_PATTERNS[type].test(value), words().notValidFormat(type));
|
|
395
380
|
}
|
|
396
381
|
case 'binary': {
|
|
397
382
|
if (typeof value !== 'string') {
|
|
398
|
-
return invalidResult(
|
|
383
|
+
return invalidResult(words().binaryNotText);
|
|
399
384
|
}
|
|
400
385
|
var trimmed = value.trim();
|
|
401
386
|
if (trimmed.length === 0) {
|
|
402
|
-
return invalidResult(
|
|
387
|
+
return invalidResult(words().binaryEmpty);
|
|
403
388
|
}
|
|
404
389
|
// the canonical wire form is base64 (matching the server decode); a "data:<mime>;base64,..." URL
|
|
405
390
|
// and legacy "0x"-prefixed hex are also accepted
|
|
@@ -408,9 +393,9 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
408
393
|
}
|
|
409
394
|
if (/^0x/i.test(trimmed)) {
|
|
410
395
|
var hex = trimmed.replace(/^0x/i, '');
|
|
411
|
-
return resultFromBoolean(hex.length % 2 === 0 && /^[0-9a-fA-F]+$/.test(hex),
|
|
396
|
+
return resultFromBoolean(hex.length % 2 === 0 && /^[0-9a-fA-F]+$/.test(hex), words().binaryHexInvalid);
|
|
412
397
|
}
|
|
413
|
-
return resultFromBoolean(/^[A-Za-z0-9+/]+={0,2}$/.test(trimmed),
|
|
398
|
+
return resultFromBoolean(/^[A-Za-z0-9+/]+={0,2}$/.test(trimmed), words().binaryForm);
|
|
414
399
|
}
|
|
415
400
|
case 'string':
|
|
416
401
|
case 'mapper':
|
|
@@ -425,8 +410,12 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
425
410
|
case 'method-name':
|
|
426
411
|
case 'code-editor':
|
|
427
412
|
case 'data': {
|
|
428
|
-
if (value === undefined || value === null || value === ''
|
|
429
|
-
return invalidResult(
|
|
413
|
+
if (value === undefined || value === null || value === '') {
|
|
414
|
+
return invalidResult(words().nonEmptyText);
|
|
415
|
+
}
|
|
416
|
+
// A value of another type is not empty: it is not text.
|
|
417
|
+
if (typeof value !== 'string') {
|
|
418
|
+
return invalidResult(valueMustBe('string'));
|
|
430
419
|
}
|
|
431
420
|
var reasons = [];
|
|
432
421
|
if ((field === null || field === void 0 ? void 0 : field.validation_regex) && !value.match(field.validation_regex)) {
|
|
@@ -438,12 +427,12 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
438
427
|
if ((field === null || field === void 0 ? void 0 : field.has_to_be_valid_identifier) ||
|
|
439
428
|
(Array.isArray(field === null || field === void 0 ? void 0 : field.rules) && field.rules.includes('valid_identifier'))) {
|
|
440
429
|
if (value.match(/^[0-9]|\W/)) {
|
|
441
|
-
reasons.push(
|
|
430
|
+
reasons.push(words().notIdentifier);
|
|
442
431
|
}
|
|
443
432
|
}
|
|
444
433
|
if (field === null || field === void 0 ? void 0 : field.has_to_have_value) {
|
|
445
434
|
if (value === '' || value.length === 0) {
|
|
446
|
-
reasons.push(
|
|
435
|
+
reasons.push(words().required);
|
|
447
436
|
}
|
|
448
437
|
}
|
|
449
438
|
return reasons.length ? invalidResult(undefined, reasons) : validResult();
|
|
@@ -479,9 +468,9 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
479
468
|
// Report both parts. Returning on the first failure meant a bad file name
|
|
480
469
|
// masked the content result entirely, so the form could only ever surface
|
|
481
470
|
// one problem at a time.
|
|
482
|
-
var reasons = __spreadArray(__spreadArray([], (nameResult.isValid ? [] : withContext(nameResult,
|
|
471
|
+
var reasons = __spreadArray(__spreadArray([], (nameResult.isValid ? [] : withContext(nameResult, words().fileNameInvalid).reasons), true), (contentResult.isValid
|
|
483
472
|
? []
|
|
484
|
-
: withContext(contentResult,
|
|
473
|
+
: withContext(contentResult, words().fileContentInvalid).reasons), true);
|
|
485
474
|
return reasons.length ? invalidResult(reasons) : validResult();
|
|
486
475
|
}
|
|
487
476
|
case 'collection-documents': {
|
|
@@ -499,23 +488,22 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
499
488
|
return validResult();
|
|
500
489
|
}
|
|
501
490
|
if (!Array.isArray(value)) {
|
|
502
|
-
return invalidResult(
|
|
491
|
+
return invalidResult(words().documentsNotList);
|
|
503
492
|
}
|
|
504
493
|
var reasons_1 = [];
|
|
505
494
|
value.forEach(function (row, idx) {
|
|
506
495
|
if (!row || typeof row !== 'object') {
|
|
507
|
-
reasons_1.push(
|
|
496
|
+
reasons_1.push(words().documentRowNotObject(idx + 1));
|
|
508
497
|
return;
|
|
509
498
|
}
|
|
510
499
|
if (typeof row.name !== 'string' || !row.name) {
|
|
511
|
-
reasons_1.push(
|
|
500
|
+
reasons_1.push(words().documentRowNoName(idx + 1));
|
|
512
501
|
return;
|
|
513
502
|
}
|
|
514
503
|
var hasServerId = typeof row.ai_documentid === 'number';
|
|
515
504
|
var hasContent = typeof row.content === 'string' && !!row.content;
|
|
516
505
|
if (!hasServerId && !hasContent) {
|
|
517
|
-
reasons_1.push(
|
|
518
|
-
"content nor a server document id");
|
|
506
|
+
reasons_1.push(words().documentRowNoContent(idx + 1, row.name));
|
|
519
507
|
}
|
|
520
508
|
});
|
|
521
509
|
return reasons_1.length ? invalidResult(undefined, reasons_1) : validResult();
|
|
@@ -526,26 +514,26 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
526
514
|
// Check if every pair has key & value
|
|
527
515
|
// assigned properly
|
|
528
516
|
if (!Array.isArray(value)) {
|
|
529
|
-
return invalidResult(
|
|
517
|
+
return invalidResult(words().notList);
|
|
530
518
|
}
|
|
531
519
|
if (!(value === null || value === void 0 ? void 0 : value.every(function (pair) {
|
|
532
520
|
return pair[field.fields[0]] !== '' && pair[field.fields[1]] !== '';
|
|
533
521
|
}))) {
|
|
534
522
|
valid = false;
|
|
535
|
-
reasons.push(
|
|
523
|
+
reasons.push(words().pairsNeedBothFields);
|
|
536
524
|
}
|
|
537
525
|
// Get a list of unique values
|
|
538
526
|
var uniqueValues = (0, uniqWith_1.default)(value, function (cur, prev) { return cur[field.fields[0]] === prev[field.fields[0]]; });
|
|
539
527
|
// Check if there are any duplicates
|
|
540
528
|
if ((0, size_1.default)(uniqueValues) !== (0, size_1.default)(value)) {
|
|
541
529
|
valid = false;
|
|
542
|
-
reasons.push(
|
|
530
|
+
reasons.push(words().pairsUniqueKeys);
|
|
543
531
|
}
|
|
544
532
|
return valid ? validResult() : invalidResult(undefined, reasons);
|
|
545
533
|
}
|
|
546
534
|
case 'class-connectors': {
|
|
547
535
|
if (!Array.isArray(value) || value.length === 0) {
|
|
548
|
-
return invalidResult(
|
|
536
|
+
return invalidResult(words().connectorRequired);
|
|
549
537
|
}
|
|
550
538
|
var valid = true;
|
|
551
539
|
var reasons = [];
|
|
@@ -555,35 +543,35 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
555
543
|
return !!pair.name && pair.name !== '' && !!pair.method && pair.method !== '';
|
|
556
544
|
}))) {
|
|
557
545
|
valid = false;
|
|
558
|
-
reasons.push(
|
|
546
|
+
reasons.push(words().connectorNameAndMethod);
|
|
559
547
|
}
|
|
560
548
|
// Get a list of unique values
|
|
561
549
|
var uniqueValues = (0, uniqWith_1.default)(value, function (cur, prev) { return cur.name === prev.name; });
|
|
562
550
|
// Check if there are any duplicates
|
|
563
551
|
if ((0, size_1.default)(uniqueValues) !== (0, size_1.default)(value)) {
|
|
564
552
|
valid = false;
|
|
565
|
-
reasons.push(
|
|
553
|
+
reasons.push(words().connectorNamesUnique);
|
|
566
554
|
}
|
|
567
555
|
return valid ? validResult() : invalidResult(undefined, reasons);
|
|
568
556
|
}
|
|
569
557
|
// Classes check
|
|
570
558
|
case 'class-array': {
|
|
571
559
|
if (!(Array.isArray(value) && value.length > 0)) {
|
|
572
|
-
return invalidResult(
|
|
560
|
+
return invalidResult(words().classRequired);
|
|
573
561
|
}
|
|
574
562
|
var valid = true;
|
|
575
563
|
var reasons = [];
|
|
576
564
|
// Check if the fields are not empty
|
|
577
565
|
if (!(value === null || value === void 0 ? void 0 : value.every(function (pair) { return !!pair.name && pair.name !== ''; }))) {
|
|
578
566
|
valid = false;
|
|
579
|
-
reasons.push(
|
|
567
|
+
reasons.push(words().classNeedsName);
|
|
580
568
|
}
|
|
581
569
|
// Get a list of unique values
|
|
582
570
|
var uniqueValues = (0, uniqWith_1.default)(value, function (cur, prev) { return "".concat(cur.prefix).concat(cur.name) === "".concat(prev.prefix).concat(prev.name); });
|
|
583
571
|
// Check if there are any duplicates
|
|
584
572
|
if ((0, size_1.default)(uniqueValues) !== (0, size_1.default)(value)) {
|
|
585
573
|
valid = false;
|
|
586
|
-
reasons.push(
|
|
574
|
+
reasons.push(words().classNamesUnique);
|
|
587
575
|
}
|
|
588
576
|
return valid ? validResult() : invalidResult(undefined, reasons);
|
|
589
577
|
}
|
|
@@ -607,10 +595,10 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
607
595
|
case 'multi-select':
|
|
608
596
|
case 'array':
|
|
609
597
|
case 'file-tree':
|
|
610
|
-
return resultFromBoolean(value && value.length > 0,
|
|
598
|
+
return resultFromBoolean(value && value.length > 0, words().atLeastOneValue);
|
|
611
599
|
case 'cron': {
|
|
612
600
|
if (!value) {
|
|
613
|
-
return invalidResult(
|
|
601
|
+
return invalidResult(words().cronRequired);
|
|
614
602
|
}
|
|
615
603
|
var expression = (0, exports.cronExpressionFromValue)(value);
|
|
616
604
|
// A value that is neither a cron string nor a schedule hash is INVALID,
|
|
@@ -618,37 +606,47 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
618
606
|
// passing it a hash threw a TypeError out of validation and took the
|
|
619
607
|
// whole form down through the host's error boundary.
|
|
620
608
|
if (expression === undefined) {
|
|
621
|
-
return invalidResult(
|
|
609
|
+
return invalidResult(words().cronInvalid);
|
|
622
610
|
}
|
|
623
|
-
return resultFromBoolean((0, cron_validator_1.isValidCron)(expression, { alias: true }),
|
|
611
|
+
return resultFromBoolean((0, cron_validator_1.isValidCron)(expression, { alias: true }), words().cronInvalid);
|
|
624
612
|
}
|
|
625
613
|
case 'date':
|
|
626
614
|
return resultFromBoolean(value !== undefined &&
|
|
627
615
|
value !== null &&
|
|
628
616
|
value !== '' &&
|
|
629
|
-
new Date(value).toString() !== 'Invalid Date',
|
|
617
|
+
new Date(value).toString() !== 'Invalid Date', words().dateInvalid);
|
|
630
618
|
case 'hash':
|
|
631
619
|
case 'free-hash': {
|
|
632
|
-
var
|
|
620
|
+
var parsedValue = typeof value === 'object' ? value : (0, exports.maybeParseYaml)(value);
|
|
633
621
|
if (field === null || field === void 0 ? void 0 : field.arg_schema) {
|
|
634
|
-
|
|
635
|
-
|
|
622
|
+
// The first argument that is wrong, named, and what is wrong with it: "Hash arguments are invalid" named
|
|
623
|
+
// nothing, and the author had to find the argument and guess why.
|
|
624
|
+
for (var _i = 0, _s = Object.entries(field.arg_schema); _i < _s.length; _i++) {
|
|
625
|
+
var _t = _s[_i], argName = _t[0], fieldData = _t[1];
|
|
626
|
+
var argValue = (0, exports.readArgValue)(parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue[argName]);
|
|
627
|
+
var argLabel = fieldData.display_name || argName;
|
|
636
628
|
// Absent and present-but-empty are the same answer to the only
|
|
637
629
|
// question the schema asks here: was the arg supplied?
|
|
638
630
|
if (argValue === undefined) {
|
|
639
|
-
|
|
631
|
+
if (fieldData.required) {
|
|
632
|
+
return invalidResult(words().hashArgumentRequired(argLabel));
|
|
633
|
+
}
|
|
634
|
+
continue;
|
|
640
635
|
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
636
|
+
var argResult = (0, exports.validateFieldWithResult)(fieldData.ui_type || fieldData.type, argValue, fieldData);
|
|
637
|
+
if (!argResult.isValid) {
|
|
638
|
+
return invalidResult(words().hashArgumentInvalid(argLabel, argResult.reason));
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return validResult();
|
|
644
642
|
}
|
|
645
|
-
if (!
|
|
643
|
+
if (!parsedValue || !(0, isPlainObject_1.default)(parsedValue)) {
|
|
646
644
|
return invalidResult(valueMustBe('hash'));
|
|
647
645
|
}
|
|
648
646
|
return validResult();
|
|
649
647
|
}
|
|
650
648
|
case 'rgbcolor': {
|
|
651
|
-
// the hash { r, g, b, a? }
|
|
649
|
+
// the hash { r, g, b, a? }: a hex code, bare or as { hex }, is shown but not stored
|
|
652
650
|
var problem = (0, colorValue_1.storedColorProblem)(value);
|
|
653
651
|
return problem ? invalidResult(problem) : validResult();
|
|
654
652
|
}
|
|
@@ -660,7 +658,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
660
658
|
return validResult();
|
|
661
659
|
}
|
|
662
660
|
if (!(0, isArray_1.default)(parsedValue)) {
|
|
663
|
-
return invalidResult(
|
|
661
|
+
return invalidResult(words().notList);
|
|
664
662
|
}
|
|
665
663
|
if ((field === null || field === void 0 ? void 0 : field.ui_element_type) || (field === null || field === void 0 ? void 0 : field.element_type)) {
|
|
666
664
|
for (var i = 0; i < parsedValue.length; i++) {
|
|
@@ -673,7 +671,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
673
671
|
// a null element.
|
|
674
672
|
(0, options_1.getListElementValue)(parsedValue[i]), field);
|
|
675
673
|
if (!itemResult.isValid) {
|
|
676
|
-
return withContext(itemResult,
|
|
674
|
+
return withContext(itemResult, words().listItemInvalid(i));
|
|
677
675
|
}
|
|
678
676
|
}
|
|
679
677
|
}
|
|
@@ -682,34 +680,34 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
682
680
|
case 'list-of-hashes': {
|
|
683
681
|
var parsedValue = (0, exports.maybeParseYaml)(value);
|
|
684
682
|
if (!parsedValue || !(0, isArray_1.default)(parsedValue)) {
|
|
685
|
-
return invalidResult(
|
|
683
|
+
return invalidResult(words().notListOfHashes);
|
|
686
684
|
}
|
|
687
685
|
for (var i = 0; i < parsedValue.length; i++) {
|
|
688
686
|
var item = parsedValue[i];
|
|
689
687
|
if (!(0, size_1.default)(item)) {
|
|
690
|
-
return invalidResult(
|
|
688
|
+
return invalidResult(words().hashEmptyAt(i));
|
|
691
689
|
}
|
|
692
690
|
var itemResult = (0, exports.validateFieldWithResult)('hash', item);
|
|
693
691
|
if (!itemResult.isValid) {
|
|
694
|
-
return withContext(itemResult,
|
|
692
|
+
return withContext(itemResult, words().hashInvalidAt(i));
|
|
695
693
|
}
|
|
696
694
|
}
|
|
697
695
|
return validResult();
|
|
698
696
|
}
|
|
699
697
|
case 'mapper-code': {
|
|
700
698
|
if (!value) {
|
|
701
|
-
return invalidResult(
|
|
699
|
+
return invalidResult(words().mapperCodeRequired);
|
|
702
700
|
}
|
|
703
701
|
// Split the value
|
|
704
|
-
var
|
|
702
|
+
var _u = value.split('::'), code = _u[0], method = _u[1];
|
|
705
703
|
// Both fields need to be strings & filled
|
|
706
704
|
var codeResult = (0, exports.validateFieldWithResult)('string', code);
|
|
707
705
|
if (!codeResult.isValid) {
|
|
708
|
-
return withContext(codeResult,
|
|
706
|
+
return withContext(codeResult, words().mapperCodeInvalid);
|
|
709
707
|
}
|
|
710
708
|
var methodResult = (0, exports.validateFieldWithResult)('string', method);
|
|
711
709
|
if (!methodResult.isValid) {
|
|
712
|
-
return withContext(methodResult,
|
|
710
|
+
return withContext(methodResult, words().mapperMethodInvalid);
|
|
713
711
|
}
|
|
714
712
|
return validResult();
|
|
715
713
|
}
|
|
@@ -718,19 +716,19 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
718
716
|
if ((varAction === null || varAction === void 0 ? void 0 : varAction.var_type) !== 'localvar' &&
|
|
719
717
|
(varAction === null || varAction === void 0 ? void 0 : varAction.var_type) !== 'globalvar' &&
|
|
720
718
|
(varAction === null || varAction === void 0 ? void 0 : varAction.var_type) !== 'autovar') {
|
|
721
|
-
return invalidResult(
|
|
719
|
+
return invalidResult(words().variableTypeInvalid);
|
|
722
720
|
}
|
|
723
721
|
var nameResult = (0, exports.validateFieldWithResult)('string', varAction.var_name, {
|
|
724
722
|
has_to_have_value: true,
|
|
725
723
|
});
|
|
726
724
|
if (!nameResult.isValid) {
|
|
727
|
-
return withContext(nameResult,
|
|
725
|
+
return withContext(nameResult, words().variableNameInvalid);
|
|
728
726
|
}
|
|
729
727
|
var actionResult = (0, exports.validateFieldWithResult)('string', varAction.action_type, {
|
|
730
728
|
has_to_have_value: true,
|
|
731
729
|
});
|
|
732
730
|
if (!actionResult.isValid) {
|
|
733
|
-
return withContext(actionResult,
|
|
731
|
+
return withContext(actionResult, words().variableActionTypeInvalid);
|
|
734
732
|
}
|
|
735
733
|
// If the action type is transaction, the transaction_action needs to be set
|
|
736
734
|
if (varAction.action_type === 'transaction') {
|
|
@@ -738,17 +736,17 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
738
736
|
has_to_have_value: true,
|
|
739
737
|
});
|
|
740
738
|
if (!transactionResult.isValid) {
|
|
741
|
-
return withContext(transactionResult,
|
|
739
|
+
return withContext(transactionResult, words().transactionActionInvalid);
|
|
742
740
|
}
|
|
743
741
|
return validResult();
|
|
744
742
|
}
|
|
745
743
|
// If the variable data is missing
|
|
746
744
|
if (!((_d = field === null || field === void 0 ? void 0 : field.variableData) === null || _d === void 0 ? void 0 : _d.value)) {
|
|
747
|
-
return invalidResult(
|
|
745
|
+
return invalidResult(words().variableDataMissing);
|
|
748
746
|
}
|
|
749
747
|
// Get the variable data
|
|
750
748
|
var variableData = __assign(__assign({}, value), field.variableData.value);
|
|
751
|
-
return withContext((0, exports.validateFieldWithResult)(varAction.action_type, variableData, field),
|
|
749
|
+
return withContext((0, exports.validateFieldWithResult)(varAction.action_type, variableData, field), words().variableActionInvalid);
|
|
752
750
|
}
|
|
753
751
|
case 'type-selector':
|
|
754
752
|
case 'data-provider':
|
|
@@ -761,11 +759,11 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
761
759
|
case 'create': {
|
|
762
760
|
var newValue = (0, providerValue_1.maybeBuildOptionProvider)(value);
|
|
763
761
|
if (!newValue) {
|
|
764
|
-
return invalidResult(
|
|
762
|
+
return invalidResult(words().providerInvalid);
|
|
765
763
|
}
|
|
766
764
|
// Api call only supports requests / response
|
|
767
765
|
if (type === 'api-call' && !value.supports_request) {
|
|
768
|
-
return invalidResult(
|
|
766
|
+
return invalidResult(words().apiCallNeedsRequests);
|
|
769
767
|
}
|
|
770
768
|
// If the provider is from FSM variables, it needs pass this
|
|
771
769
|
if ((field === null || field === void 0 ? void 0 : field.isVariable) &&
|
|
@@ -776,41 +774,41 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
776
774
|
newValue.supports_request ||
|
|
777
775
|
newValue.supports_messages ||
|
|
778
776
|
newValue.transaction_management)) {
|
|
779
|
-
return invalidResult(
|
|
777
|
+
return invalidResult(words().variableProviderNeedsAction);
|
|
780
778
|
}
|
|
781
779
|
// Send message only supports messages
|
|
782
780
|
if (type === 'send-message' &&
|
|
783
781
|
(!newValue.supports_messages || !newValue.message_id || !newValue.message)) {
|
|
784
|
-
return invalidResult(
|
|
782
|
+
return invalidResult(words().sendMessageProviderIncomplete);
|
|
785
783
|
}
|
|
786
784
|
if (newValue.message_id) {
|
|
787
785
|
var messageIdResult = (0, exports.validateFieldWithResult)('string', newValue.message_id);
|
|
788
786
|
if (!messageIdResult.isValid) {
|
|
789
|
-
return withContext(messageIdResult,
|
|
787
|
+
return withContext(messageIdResult, words().messageIdInvalid);
|
|
790
788
|
}
|
|
791
789
|
if (!newValue.message) {
|
|
792
|
-
return invalidResult(
|
|
790
|
+
return invalidResult(words().messageContentMissing);
|
|
793
791
|
}
|
|
794
792
|
var messageResult = (0, exports.validateFieldWithResult)(newValue.message.type, newValue.message.value);
|
|
795
793
|
if (!messageResult.isValid) {
|
|
796
|
-
return withContext(messageResult,
|
|
794
|
+
return withContext(messageResult, words().messageContentInvalid);
|
|
797
795
|
}
|
|
798
796
|
}
|
|
799
797
|
if (newValue.use_args) {
|
|
800
798
|
if (((_e = newValue.args) === null || _e === void 0 ? void 0 : _e.type) !== 'nothing') {
|
|
801
799
|
if (!newValue.args) {
|
|
802
|
-
return invalidResult(
|
|
800
|
+
return invalidResult(words().argumentsMissing);
|
|
803
801
|
}
|
|
804
802
|
var argsResult = (0, exports.validateFieldWithResult)(newValue.args.type === 'hash' ? 'system-options' : newValue.args.type, newValue.args.value);
|
|
805
803
|
if (!argsResult.isValid) {
|
|
806
|
-
return withContext(argsResult,
|
|
804
|
+
return withContext(argsResult, words().argumentsInvalid);
|
|
807
805
|
}
|
|
808
806
|
}
|
|
809
807
|
}
|
|
810
808
|
if ((type === 'search-single' || type === 'search') &&
|
|
811
809
|
(0, size_1.default)(newValue.search_args) !== 0 &&
|
|
812
810
|
!(0, exports.validateFieldWithResult)('system-options-with-operators', newValue.search_args).isValid) {
|
|
813
|
-
return invalidResult(
|
|
811
|
+
return invalidResult(words().searchArgumentsInvalid);
|
|
814
812
|
}
|
|
815
813
|
var isUpdateOrCreate = type === 'update' || type === 'create';
|
|
816
814
|
if (isUpdateOrCreate) {
|
|
@@ -821,66 +819,66 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
821
819
|
((0, size_1.default)(newValue["".concat(type, "_args_freeform")]) === 0 ||
|
|
822
820
|
!(0, exports.validateFieldWithResult)('list-of-hashes', newValue["".concat(type, "_args_freeform")]).isValid);
|
|
823
821
|
if ("".concat(type, "_args") in newValue && areNormalArgsInvalid && areFreeFormArgsInvalid) {
|
|
824
|
-
return invalidResult(
|
|
822
|
+
return invalidResult(words().updateCreateArgumentsInvalid);
|
|
825
823
|
}
|
|
826
824
|
if ("".concat(type, "_args_freeform") in newValue && areFreeFormArgsInvalid && areNormalArgsInvalid) {
|
|
827
|
-
return invalidResult(
|
|
825
|
+
return invalidResult(words().updateCreateArgumentsInvalid);
|
|
828
826
|
}
|
|
829
827
|
}
|
|
830
828
|
if ((newValue === null || newValue === void 0 ? void 0 : newValue.type) === 'factory') {
|
|
831
829
|
if (newValue.optionsChanged) {
|
|
832
|
-
return invalidResult(
|
|
830
|
+
return invalidResult(words().factoryOptionsNotSaved);
|
|
833
831
|
}
|
|
834
832
|
var options = true;
|
|
835
833
|
if (newValue.options) {
|
|
836
834
|
options = (0, exports.validateFieldWithResult)('system-options', newValue.options).isValid;
|
|
837
835
|
}
|
|
838
836
|
// Type path and name are required
|
|
839
|
-
return resultFromBoolean(!!(newValue.type && newValue.name && options),
|
|
837
|
+
return resultFromBoolean(!!(newValue.type && newValue.name && options), words().factoryIncomplete);
|
|
840
838
|
}
|
|
841
839
|
if (newValue.record_requires_search_options && newValue.searchOptionsChanged) {
|
|
842
|
-
return invalidResult(
|
|
840
|
+
return invalidResult(words().searchOptionsNotSaved);
|
|
843
841
|
}
|
|
844
842
|
if (newValue.search_options &&
|
|
845
843
|
!(0, exports.validateFieldWithResult)('system-options', newValue.search_options).isValid) {
|
|
846
|
-
return invalidResult(
|
|
844
|
+
return invalidResult(words().searchOptionsInvalid);
|
|
847
845
|
}
|
|
848
|
-
return resultFromBoolean(!!(newValue.type && newValue.name),
|
|
846
|
+
return resultFromBoolean(!!(newValue.type && newValue.name), words().providerTypeAndName);
|
|
849
847
|
}
|
|
850
848
|
case 'context-selector': {
|
|
851
849
|
if ((0, lodash_1.isString)(value)) {
|
|
852
850
|
var cont = value.split(':');
|
|
853
851
|
var contextResult = (0, exports.validateFieldWithResult)('string', cont[0]);
|
|
854
852
|
if (!contextResult.isValid) {
|
|
855
|
-
return withContext(contextResult,
|
|
853
|
+
return withContext(contextResult, words().contextPrefixInvalid);
|
|
856
854
|
}
|
|
857
855
|
var nameResult = (0, exports.validateFieldWithResult)('string', cont[1]);
|
|
858
856
|
if (!nameResult.isValid) {
|
|
859
|
-
return withContext(nameResult,
|
|
857
|
+
return withContext(nameResult, words().contextNameInvalid);
|
|
860
858
|
}
|
|
861
859
|
return validResult();
|
|
862
860
|
}
|
|
863
|
-
return resultFromBoolean(!!(value === null || value === void 0 ? void 0 : value.iface_kind) && !!(value === null || value === void 0 ? void 0 : value.name),
|
|
861
|
+
return resultFromBoolean(!!(value === null || value === void 0 ? void 0 : value.iface_kind) && !!(value === null || value === void 0 ? void 0 : value.name), words().contextSelectorIncomplete);
|
|
864
862
|
}
|
|
865
863
|
case 'service-event': {
|
|
866
864
|
var typeResult = (0, exports.validateFieldWithResult)('type-selector', value);
|
|
867
865
|
if (!typeResult.isValid) {
|
|
868
|
-
return withContext(typeResult,
|
|
866
|
+
return withContext(typeResult, words().serviceEventTypeInvalid);
|
|
869
867
|
}
|
|
870
868
|
if (!(0, size_1.default)(value.handlers) ||
|
|
871
869
|
!(0, every_1.default)(value.handlers, function (handler) { return (handler.type === 'fsm' || handler.type === 'method') && handler.value; })) {
|
|
872
|
-
return invalidResult(
|
|
870
|
+
return invalidResult(words().serviceEventHandlersInvalid);
|
|
873
871
|
}
|
|
874
872
|
return validResult();
|
|
875
873
|
}
|
|
876
874
|
case 'service-events': {
|
|
877
875
|
if (!(0, isArray_1.default)(value) || !(0, size_1.default)(value)) {
|
|
878
|
-
return invalidResult(
|
|
876
|
+
return invalidResult(words().serviceEventRequired);
|
|
879
877
|
}
|
|
880
878
|
for (var i = 0; i < value.length; i++) {
|
|
881
879
|
var serviceEventResult = (0, exports.validateFieldWithResult)('service-event', value[i]);
|
|
882
880
|
if (!serviceEventResult.isValid) {
|
|
883
|
-
return withContext(serviceEventResult,
|
|
881
|
+
return withContext(serviceEventResult, words().serviceEventInvalid(i));
|
|
884
882
|
}
|
|
885
883
|
}
|
|
886
884
|
return validResult();
|
|
@@ -889,27 +887,27 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
889
887
|
if (!(0, exports.validateFieldWithResult)('string', value === null || value === void 0 ? void 0 : value.name).isValid ||
|
|
890
888
|
!(0, exports.validateFieldWithResult)('string', value === null || value === void 0 ? void 0 : value['rest-method']).isValid ||
|
|
891
889
|
!(0, exports.validateFieldWithResult)('string', value === null || value === void 0 ? void 0 : value.auth).isValid) {
|
|
892
|
-
return invalidResult(
|
|
890
|
+
return invalidResult(words().webhookIncomplete);
|
|
893
891
|
}
|
|
894
892
|
if (value.handler) {
|
|
895
893
|
if (value.handler.type !== 'fsm' && value.handler.type !== 'method') {
|
|
896
|
-
return invalidResult(
|
|
894
|
+
return invalidResult(words().webhookHandlerTypeInvalid);
|
|
897
895
|
}
|
|
898
896
|
var handlerResult = (0, exports.validateFieldWithResult)('string', value.handler.value);
|
|
899
897
|
if (!handlerResult.isValid) {
|
|
900
|
-
return withContext(handlerResult,
|
|
898
|
+
return withContext(handlerResult, words().webhookHandlerValueInvalid);
|
|
901
899
|
}
|
|
902
900
|
}
|
|
903
901
|
return validResult();
|
|
904
902
|
}
|
|
905
903
|
case 'service-webhooks': {
|
|
906
904
|
if (!(0, isArray_1.default)(value) || !(0, size_1.default)(value)) {
|
|
907
|
-
return invalidResult(
|
|
905
|
+
return invalidResult(words().webhookRequired);
|
|
908
906
|
}
|
|
909
907
|
for (var i = 0; i < value.length; i++) {
|
|
910
908
|
var webhookResult = (0, exports.validateFieldWithResult)('service-webhook', value[i]);
|
|
911
909
|
if (!webhookResult.isValid) {
|
|
912
|
-
return withContext(webhookResult,
|
|
910
|
+
return withContext(webhookResult, words().serviceWebhookInvalid(i));
|
|
913
911
|
}
|
|
914
912
|
}
|
|
915
913
|
return validResult();
|
|
@@ -937,7 +935,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
937
935
|
parsedData = js_yaml_1.default.load(value);
|
|
938
936
|
}
|
|
939
937
|
catch (e) {
|
|
940
|
-
return invalidResult(
|
|
938
|
+
return invalidResult(words().notYaml);
|
|
941
939
|
}
|
|
942
940
|
}
|
|
943
941
|
/* A FALSY value is not an ABSENT one. `null`, `0`, `false` and `""` are
|
|
@@ -955,7 +953,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
955
953
|
because that is the rule for a REQUIRED text field — a different
|
|
956
954
|
question from whether an untyped field may hold a blank string. */
|
|
957
955
|
if (parsedData === undefined) {
|
|
958
|
-
return invalidResult(
|
|
956
|
+
return invalidResult(words().valueEmpty);
|
|
959
957
|
}
|
|
960
958
|
if (parsedData === null || parsedData === '') {
|
|
961
959
|
return validResult();
|
|
@@ -967,23 +965,23 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
967
965
|
"1" against it — "Value must be an integer", on a value that is one.
|
|
968
966
|
The author saw their field go invalid on the first character they
|
|
969
967
|
typed. */
|
|
970
|
-
return withContext((0, exports.validateFieldWithResult)((0, exports.getTypeFromValue)(parsedData), parsedData),
|
|
968
|
+
return withContext((0, exports.validateFieldWithResult)((0, exports.getTypeFromValue)(parsedData), parsedData), words().autoTypeInvalid);
|
|
971
969
|
}
|
|
972
970
|
case 'processor': {
|
|
973
971
|
if (!value || !value['processor-input-type'] || !value['processor-output-type']) {
|
|
974
|
-
return invalidResult(
|
|
972
|
+
return invalidResult(words().processorTypesRequired);
|
|
975
973
|
}
|
|
976
974
|
// Validate the input and output types
|
|
977
975
|
if (value === null || value === void 0 ? void 0 : value['processor-input-type']) {
|
|
978
976
|
var inputResult = (0, exports.validateFieldWithResult)('type-selector', value === null || value === void 0 ? void 0 : value['processor-input-type']);
|
|
979
977
|
if (!inputResult.isValid) {
|
|
980
|
-
return withContext(inputResult,
|
|
978
|
+
return withContext(inputResult, words().processorInputInvalid);
|
|
981
979
|
}
|
|
982
980
|
}
|
|
983
981
|
if (value === null || value === void 0 ? void 0 : value['processor-output-type']) {
|
|
984
982
|
var outputResult = (0, exports.validateFieldWithResult)('type-selector', value === null || value === void 0 ? void 0 : value['processor-output-type']);
|
|
985
983
|
if (!outputResult.isValid) {
|
|
986
|
-
return withContext(outputResult,
|
|
984
|
+
return withContext(outputResult, words().processorOutputInvalid);
|
|
987
985
|
}
|
|
988
986
|
}
|
|
989
987
|
return validResult();
|
|
@@ -993,23 +991,23 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
993
991
|
// Each mapping must have an outputPath (the target field being mapped)
|
|
994
992
|
// and either an inputPath (source field) or options configured
|
|
995
993
|
if (!(0, isArray_1.default)(value)) {
|
|
996
|
-
return canBeNull ? validResult() : invalidResult(
|
|
994
|
+
return canBeNull ? validResult() : invalidResult(words().processorMappingsNotList);
|
|
997
995
|
}
|
|
998
996
|
for (var i = 0; i < value.length; i++) {
|
|
999
997
|
var mapping = value[i];
|
|
1000
998
|
if (!mapping || !(0, isPlainObject_1.default)(mapping)) {
|
|
1001
|
-
return invalidResult(
|
|
999
|
+
return invalidResult(words().mappingInvalidAt(i));
|
|
1002
1000
|
}
|
|
1003
1001
|
// outputPath is always required - it identifies which output field is being mapped
|
|
1004
1002
|
var outputPathResult = (0, exports.validateFieldWithResult)('string', mapping.outputPath);
|
|
1005
1003
|
if (!outputPathResult.isValid) {
|
|
1006
|
-
return withContext(outputPathResult,
|
|
1004
|
+
return withContext(outputPathResult, words().mappingOutputPathInvalid(i));
|
|
1007
1005
|
}
|
|
1008
1006
|
// A mapping must have either an inputPath or options (or both)
|
|
1009
1007
|
var hasInputPath = mapping.inputPath && mapping.inputPath !== '';
|
|
1010
1008
|
var hasOptions = mapping.options && (0, size_1.default)(mapping.options) > 0;
|
|
1011
1009
|
if (!hasInputPath && !hasOptions) {
|
|
1012
|
-
return invalidResult(
|
|
1010
|
+
return invalidResult(words().mappingNeedsInput(String(mapping.outputPath)));
|
|
1013
1011
|
}
|
|
1014
1012
|
}
|
|
1015
1013
|
return validResult();
|
|
@@ -1022,12 +1020,12 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1022
1020
|
// "<connection>" — all tools from a connection
|
|
1023
1021
|
// "<connection>/<tool>" — a specific tool from a connection
|
|
1024
1022
|
if (!(0, isArray_1.default)(value)) {
|
|
1025
|
-
return canBeNull ? validResult() : invalidResult(
|
|
1023
|
+
return canBeNull ? validResult() : invalidResult(words().toolCatalogNotList);
|
|
1026
1024
|
}
|
|
1027
1025
|
for (var i = 0; i < value.length; i++) {
|
|
1028
1026
|
var selector = value[i];
|
|
1029
1027
|
if (typeof selector !== 'string' || selector.length === 0) {
|
|
1030
|
-
return invalidResult(
|
|
1028
|
+
return invalidResult(words().toolSelectorAt(i));
|
|
1031
1029
|
}
|
|
1032
1030
|
}
|
|
1033
1031
|
return validResult();
|
|
@@ -1035,67 +1033,67 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1035
1033
|
case 'fsm-list': {
|
|
1036
1034
|
// users call FSMs Qogs: this is said to them
|
|
1037
1035
|
if (!(0, isArray_1.default)(value)) {
|
|
1038
|
-
return invalidResult(
|
|
1036
|
+
return invalidResult(words().qogListNotArray);
|
|
1039
1037
|
}
|
|
1040
1038
|
for (var i = 0; i < value.length; i++) {
|
|
1041
1039
|
var itemResult = (0, exports.validateFieldWithResult)('string', (_f = value[i]) === null || _f === void 0 ? void 0 : _f.name);
|
|
1042
1040
|
if (!itemResult.isValid) {
|
|
1043
|
-
return withContext(itemResult,
|
|
1041
|
+
return withContext(itemResult, words().qogEntryNameInvalid(i));
|
|
1044
1042
|
}
|
|
1045
1043
|
}
|
|
1046
1044
|
return validResult();
|
|
1047
1045
|
}
|
|
1048
1046
|
case 'api-manager': {
|
|
1049
1047
|
if (!value) {
|
|
1050
|
-
return invalidResult(
|
|
1048
|
+
return invalidResult(words().apiManagerMissing);
|
|
1051
1049
|
}
|
|
1052
1050
|
var factoryResult = (0, exports.validateFieldWithResult)('string', value.factory);
|
|
1053
1051
|
if (!factoryResult.isValid) {
|
|
1054
|
-
return withContext(factoryResult,
|
|
1052
|
+
return withContext(factoryResult, words().apiManagerFactoryInvalid);
|
|
1055
1053
|
}
|
|
1056
1054
|
var endpointsResult = (0, exports.validateFieldWithResult)('api-endpoints', value.endpoints);
|
|
1057
1055
|
if (!endpointsResult.isValid) {
|
|
1058
|
-
return withContext(endpointsResult,
|
|
1056
|
+
return withContext(endpointsResult, words().apiManagerEndpointsInvalid);
|
|
1059
1057
|
}
|
|
1060
1058
|
return validResult();
|
|
1061
1059
|
}
|
|
1062
1060
|
case 'api-endpoints': {
|
|
1063
1061
|
if (!(0, isArray_1.default)(value) || !(0, size_1.default)(value)) {
|
|
1064
|
-
return invalidResult(
|
|
1062
|
+
return invalidResult(words().apiEndpointRequired);
|
|
1065
1063
|
}
|
|
1066
1064
|
for (var i = 0; i < value.length; i++) {
|
|
1067
1065
|
var endpointResult = (0, exports.validateFieldWithResult)('string', (_g = value[i]) === null || _g === void 0 ? void 0 : _g.value);
|
|
1068
1066
|
if (!endpointResult.isValid) {
|
|
1069
|
-
return withContext(endpointResult,
|
|
1067
|
+
return withContext(endpointResult, words().endpointValueInvalid(i));
|
|
1070
1068
|
}
|
|
1071
1069
|
var authorizationResult = (0, exports.validateFieldWithResult)('api-endpoint-authorization', (_h = value[i]) === null || _h === void 0 ? void 0 : _h.authorization, undefined, true);
|
|
1072
1070
|
if (!authorizationResult.isValid) {
|
|
1073
|
-
return withContext(authorizationResult,
|
|
1071
|
+
return withContext(authorizationResult, words().endpointAuthorizationInvalid(i));
|
|
1074
1072
|
}
|
|
1075
1073
|
}
|
|
1076
1074
|
return validResult();
|
|
1077
1075
|
}
|
|
1078
1076
|
case 'api-endpoint-authorization': {
|
|
1079
1077
|
if (!value) {
|
|
1080
|
-
return canBeNull ? validResult() : invalidResult(
|
|
1078
|
+
return canBeNull ? validResult() : invalidResult(words().authorizationMissing);
|
|
1081
1079
|
}
|
|
1082
1080
|
if (typeof value !== 'object' || (0, isArray_1.default)(value)) {
|
|
1083
|
-
return invalidResult(
|
|
1081
|
+
return invalidResult(words().authorizationNotObject);
|
|
1084
1082
|
}
|
|
1085
1083
|
if (value.mode !== undefined && !['merge', 'replace'].includes(value.mode)) {
|
|
1086
|
-
return invalidResult(
|
|
1084
|
+
return invalidResult(words().authorizationMode);
|
|
1087
1085
|
}
|
|
1088
1086
|
if (value.allow_anonymous !== undefined && typeof value.allow_anonymous !== 'boolean') {
|
|
1089
|
-
return invalidResult(
|
|
1087
|
+
return invalidResult(words().authorizationAllowAnonymous);
|
|
1090
1088
|
}
|
|
1091
1089
|
if (value.roles !== undefined) {
|
|
1092
1090
|
if (!(0, isArray_1.default)(value.roles)) {
|
|
1093
|
-
return invalidResult(
|
|
1091
|
+
return invalidResult(words().authorizationRolesNotList);
|
|
1094
1092
|
}
|
|
1095
1093
|
for (var i = 0; i < value.roles.length; i++) {
|
|
1096
1094
|
var roleResult = (0, exports.validateFieldWithResult)('string', value.roles[i]);
|
|
1097
1095
|
if (!roleResult.isValid) {
|
|
1098
|
-
return withContext(roleResult,
|
|
1096
|
+
return withContext(roleResult, words().authorizationRoleInvalid(i));
|
|
1099
1097
|
}
|
|
1100
1098
|
}
|
|
1101
1099
|
}
|
|
@@ -1110,7 +1108,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1110
1108
|
if (optionSchema === void 0) { optionSchema = {}; }
|
|
1111
1109
|
if (!options || (0, size_1.default)(options) === 0) {
|
|
1112
1110
|
if (!canBeNull) {
|
|
1113
|
-
return invalidResult(
|
|
1111
|
+
return invalidResult(words().optionsRequired);
|
|
1114
1112
|
}
|
|
1115
1113
|
return validResult();
|
|
1116
1114
|
}
|
|
@@ -1118,7 +1116,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1118
1116
|
var unresolvedRequiredOption = (0, exports.getUnresolvedRequiredOptions)(optionSchema, options)[0];
|
|
1119
1117
|
if (unresolvedRequiredOption) {
|
|
1120
1118
|
return unresolvedRequiredOption.validation
|
|
1121
|
-
? withContext(unresolvedRequiredOption.validation,
|
|
1119
|
+
? withContext(unresolvedRequiredOption.validation, words().optionInvalid(unresolvedRequiredOption.name))
|
|
1122
1120
|
: invalidResult((0, exports.getUnresolvedRequiredOptionReason)(unresolvedRequiredOption, optionSchema));
|
|
1123
1121
|
}
|
|
1124
1122
|
for (var _i = 0, _e = Object.keys(options); _i < _e.length; _i++) {
|
|
@@ -1156,7 +1154,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1156
1154
|
? (0, exports.validateFieldWithResult)((0, exports.getTypeFromValue)(optionData), optionData)
|
|
1157
1155
|
: (0, exports.validateFieldWithResult)(optionData.type, optionData.value, __assign(__assign({}, optionSchema === null || optionSchema === void 0 ? void 0 : optionSchema[option]), { optionSchema: optionSchema, options: options, isFunction: optionData.is_expression }));
|
|
1158
1156
|
if (!optionResult.isValid) {
|
|
1159
|
-
return withContext(optionResult,
|
|
1157
|
+
return withContext(optionResult, words().optionInvalid(option));
|
|
1160
1158
|
}
|
|
1161
1159
|
}
|
|
1162
1160
|
return validResult();
|
|
@@ -1165,7 +1163,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1165
1163
|
for (var i = 0; i < value.length; i++) {
|
|
1166
1164
|
var optionResult = getIsValid(value[i], field === null || field === void 0 ? void 0 : field.optionSchema);
|
|
1167
1165
|
if (!optionResult.isValid) {
|
|
1168
|
-
return withContext(optionResult,
|
|
1166
|
+
return withContext(optionResult, words().optionSetInvalid(i));
|
|
1169
1167
|
}
|
|
1170
1168
|
}
|
|
1171
1169
|
return validResult();
|
|
@@ -1178,7 +1176,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1178
1176
|
if (canBeNull) {
|
|
1179
1177
|
return validResult();
|
|
1180
1178
|
}
|
|
1181
|
-
return invalidResult(
|
|
1179
|
+
return invalidResult(words().optionsWithOperatorsRequired);
|
|
1182
1180
|
}
|
|
1183
1181
|
for (var _i = 0, _a = Object.keys(val); _i < _a.length; _i++) {
|
|
1184
1182
|
var option = _a[_i];
|
|
@@ -1187,11 +1185,11 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1187
1185
|
? (0, exports.validateFieldWithResult)((0, exports.getTypeFromValue)(optionData), optionData)
|
|
1188
1186
|
: (0, exports.validateFieldWithResult)(optionData.type, optionData.value);
|
|
1189
1187
|
if (!optionResult.isValid) {
|
|
1190
|
-
return withContext(optionResult,
|
|
1188
|
+
return withContext(optionResult, words().optionInvalid(option));
|
|
1191
1189
|
}
|
|
1192
1190
|
if (!optionData.op ||
|
|
1193
1191
|
!(0, common_1.fixOperatorValue)(optionData.op).every(function (operator) { return (0, exports.validateFieldWithResult)('string', operator).isValid; })) {
|
|
1194
|
-
return invalidResult(
|
|
1192
|
+
return invalidResult(words().operatorsInvalid(option));
|
|
1195
1193
|
}
|
|
1196
1194
|
}
|
|
1197
1195
|
return validResult();
|
|
@@ -1200,7 +1198,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1200
1198
|
for (var i = 0; i < value.length; i++) {
|
|
1201
1199
|
var optionResult = isValid(value[i]);
|
|
1202
1200
|
if (!optionResult.isValid) {
|
|
1203
|
-
return withContext(optionResult,
|
|
1201
|
+
return withContext(optionResult, words().optionSetInvalid(i));
|
|
1204
1202
|
}
|
|
1205
1203
|
}
|
|
1206
1204
|
return validResult();
|
|
@@ -1209,15 +1207,15 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1209
1207
|
}
|
|
1210
1208
|
case 'byte-size': {
|
|
1211
1209
|
if (typeof value !== 'string')
|
|
1212
|
-
return invalidResult(
|
|
1213
|
-
var
|
|
1210
|
+
return invalidResult(words().byteSizeNotText);
|
|
1211
|
+
var _v = (0, common_1.splitByteSize)(value), bytes = _v[0], sizeUnit = _v[1];
|
|
1214
1212
|
var bytesResult = (0, exports.validateFieldWithResult)('number', bytes);
|
|
1215
1213
|
if (!bytesResult.isValid) {
|
|
1216
|
-
return withContext(bytesResult,
|
|
1214
|
+
return withContext(bytesResult, words().byteSizeNumberInvalid);
|
|
1217
1215
|
}
|
|
1218
1216
|
var sizeResult = (0, exports.validateFieldWithResult)('string', sizeUnit);
|
|
1219
1217
|
if (!sizeResult.isValid) {
|
|
1220
|
-
return withContext(sizeResult,
|
|
1218
|
+
return withContext(sizeResult, words().byteSizeUnitInvalid);
|
|
1221
1219
|
}
|
|
1222
1220
|
return validResult();
|
|
1223
1221
|
}
|
|
@@ -1226,7 +1224,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1226
1224
|
// so the stored value validates as an int.
|
|
1227
1225
|
var msResult = (0, exports.validateFieldWithResult)('int', value);
|
|
1228
1226
|
if (!msResult.isValid) {
|
|
1229
|
-
return withContext(msResult,
|
|
1227
|
+
return withContext(msResult, words().timeoutMilliseconds);
|
|
1230
1228
|
}
|
|
1231
1229
|
return validResult();
|
|
1232
1230
|
}
|
|
@@ -1234,11 +1232,11 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1234
1232
|
case 'uri': {
|
|
1235
1233
|
var protocolResult = (0, exports.validateFieldWithResult)('string', (0, common_1.getProtocol)(value));
|
|
1236
1234
|
if (!protocolResult.isValid) {
|
|
1237
|
-
return withContext(protocolResult,
|
|
1235
|
+
return withContext(protocolResult, words().urlProtocolInvalid);
|
|
1238
1236
|
}
|
|
1239
1237
|
var addressResult = (0, exports.validateFieldWithResult)('string', (0, common_1.getAddress)(value));
|
|
1240
1238
|
if (!addressResult.isValid) {
|
|
1241
|
-
return withContext(addressResult,
|
|
1239
|
+
return withContext(addressResult, words().urlAddressInvalid);
|
|
1242
1240
|
}
|
|
1243
1241
|
return validResult();
|
|
1244
1242
|
}
|
|
@@ -1246,10 +1244,10 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1246
1244
|
// The minimal NEW_FIELD.md shape check, so malformed definitions can't
|
|
1247
1245
|
// silently save through FormEngine.
|
|
1248
1246
|
if (!(0, isPlainObject_1.default)(value)) {
|
|
1249
|
-
return invalidResult(
|
|
1247
|
+
return invalidResult(words().schemaDefinitionNotObject);
|
|
1250
1248
|
}
|
|
1251
1249
|
if (!(0, isPlainObject_1.default)(value.schema)) {
|
|
1252
|
-
return invalidResult(
|
|
1250
|
+
return invalidResult(words().schemaDefinitionNoSchema);
|
|
1253
1251
|
}
|
|
1254
1252
|
return validResult();
|
|
1255
1253
|
}
|
|
@@ -1271,10 +1269,10 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1271
1269
|
// the field's own "show invalid only" filter listed a different set of
|
|
1272
1270
|
// rows on a fast machine than on a slow one.
|
|
1273
1271
|
if (!castedValue_1) {
|
|
1274
|
-
return invalidResult(
|
|
1272
|
+
return invalidResult(words().expressionEmpty);
|
|
1275
1273
|
}
|
|
1276
1274
|
if (!((_j = castedValue_1.value) === null || _j === void 0 ? void 0 : _j.exp)) {
|
|
1277
|
-
return invalidResult(
|
|
1275
|
+
return invalidResult((0, reqraftLabels_1.reqraftLabels)().expressions.noOperationYet(false));
|
|
1278
1276
|
}
|
|
1279
1277
|
// Everything past this point needs the expression's definition, which
|
|
1280
1278
|
// only the catalogue can supply. Until it loads there is nothing to check
|
|
@@ -1286,7 +1284,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1286
1284
|
// Get the expression definition from the catalogue - a lone template's as the lone value it is (`asLoneValue`)
|
|
1287
1285
|
var expressionDefinition_1 = expressions.find(function (expr) { var _a; return expr.name === ((_a = (0, loneValue_1.asLoneValue)(castedValue_1.value)) === null || _a === void 0 ? void 0 : _a.exp); });
|
|
1288
1286
|
if (!expressionDefinition_1) {
|
|
1289
|
-
return invalidResult(
|
|
1287
|
+
return invalidResult(words().noSuchOperation(String((_k = castedValue_1.value) === null || _k === void 0 ? void 0 : _k.exp)));
|
|
1290
1288
|
}
|
|
1291
1289
|
// If the expression has no required args, we can consider it valid
|
|
1292
1290
|
var hasRequiredArgs = (_l = expressionDefinition_1.args) === null || _l === void 0 ? void 0 : _l.some(function (arg) { return arg.required; });
|
|
@@ -1296,7 +1294,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1296
1294
|
// If there are no args provided but the expression requires some (normal expressions require at least 1 arg
|
|
1297
1295
|
// because we checked for required args earlier), or min_args is set
|
|
1298
1296
|
if ((0, size_1.default)(((_o = castedValue_1.value) === null || _o === void 0 ? void 0 : _o.args) || []) < (expressionDefinition_1.min_args || 1)) {
|
|
1299
|
-
return invalidResult(
|
|
1297
|
+
return invalidResult(words().notEnoughArguments);
|
|
1300
1298
|
}
|
|
1301
1299
|
// Now we need to validate each argument, either as a normal value or as a sub-expression
|
|
1302
1300
|
var args = (_q = (_p = castedValue_1.value) === null || _p === void 0 ? void 0 : _p.args) !== null && _q !== void 0 ? _q : [];
|
|
@@ -1306,7 +1304,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1306
1304
|
var definition = expressionDefinition_1.varargs
|
|
1307
1305
|
? expressionDefinition_1.args[0]
|
|
1308
1306
|
: expressionDefinition_1.args[index];
|
|
1309
|
-
return (_b = (_a = definition === null || definition === void 0 ? void 0 : definition.display_name) !== null && _a !== void 0 ? _a : definition === null || definition === void 0 ? void 0 : definition.name) !== null && _b !== void 0 ? _b :
|
|
1307
|
+
return (_b = (_a = definition === null || definition === void 0 ? void 0 : definition.display_name) !== null && _a !== void 0 ? _a : definition === null || definition === void 0 ? void 0 : definition.name) !== null && _b !== void 0 ? _b : words().unnamedOperand(index + 1);
|
|
1310
1308
|
});
|
|
1311
1309
|
var _loop_1 = function (index) {
|
|
1312
1310
|
var argValue = args[index];
|
|
@@ -1320,12 +1318,13 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1320
1318
|
("undefined") is invalid" and named a field that does not exist. */
|
|
1321
1319
|
var argLabel = argLabels[index];
|
|
1322
1320
|
/* Which operand, where its name alone does not say: every operand of a call taking any number of
|
|
1323
|
-
them is "Value" (
|
|
1321
|
+
them is "Value" ("which "value" is the message mentioning"). Said by
|
|
1324
1322
|
its position too, as the editor shows them, left to right - and so is a lone operand of a call that
|
|
1325
|
-
can take more
|
|
1326
|
-
|
|
1323
|
+
can take more, as the operands that join it will be. The words say the position
|
|
1324
|
+
their own way ("the 2nd"); it is given only where it is said. */
|
|
1325
|
+
var position = expressionDefinition_1.varargs ||
|
|
1327
1326
|
argLabels.some(function (label, other) { return other !== index && label === argLabel; })
|
|
1328
|
-
?
|
|
1327
|
+
? index + 1
|
|
1329
1328
|
: undefined;
|
|
1330
1329
|
/* An explicit null is a VALUE, and DPQL says so: `null` is a literal
|
|
1331
1330
|
that parses, serializes and round-trips like any other.
|
|
@@ -1353,7 +1352,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1353
1352
|
has_to_have_value: argDefinition === null || argDefinition === void 0 ? void 0 : argDefinition.required,
|
|
1354
1353
|
});
|
|
1355
1354
|
if (!result_1.isValid) {
|
|
1356
|
-
return { value: withContext(result_1,
|
|
1355
|
+
return { value: withContext(result_1, words().operandExpressionHasError(argLabel, position)) };
|
|
1357
1356
|
}
|
|
1358
1357
|
return "continue";
|
|
1359
1358
|
}
|
|
@@ -1373,12 +1372,12 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1373
1372
|
has_to_have_value: argDefinition === null || argDefinition === void 0 ? void 0 : argDefinition.required,
|
|
1374
1373
|
});
|
|
1375
1374
|
if (!result.isValid) {
|
|
1376
|
-
// an operand not filled in yet says what to do; one that is wrong says which and why (
|
|
1377
|
-
//
|
|
1375
|
+
// an operand not filled in yet says what to do; one that is wrong says which and why (it said
|
|
1376
|
+
// "Value for argument 1 ("Value") is invalid: Missing value" while building)
|
|
1378
1377
|
if ((argValue === null || argValue === void 0 ? void 0 : argValue.value) === undefined || (argValue === null || argValue === void 0 ? void 0 : argValue.value) === null || (argValue === null || argValue === void 0 ? void 0 : argValue.value) === '') {
|
|
1379
|
-
return { value:
|
|
1378
|
+
return { value: __assign(__assign({}, invalidResult(words().enterOperand(argLabel, position))), { missingOperand: true }) };
|
|
1380
1379
|
}
|
|
1381
|
-
return { value: withContext(result,
|
|
1380
|
+
return { value: withContext(result, words().operandInvalid(argLabel, position)) };
|
|
1382
1381
|
}
|
|
1383
1382
|
};
|
|
1384
1383
|
for (var index = 0; index < args.length; index++) {
|
|
@@ -1389,7 +1388,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1389
1388
|
return validResult();
|
|
1390
1389
|
}
|
|
1391
1390
|
case 'nothing':
|
|
1392
|
-
return invalidResult(
|
|
1391
|
+
return invalidResult(words().nothingNotValid);
|
|
1393
1392
|
default:
|
|
1394
1393
|
return validResult();
|
|
1395
1394
|
}
|
|
@@ -1419,6 +1418,9 @@ exports.readArgValue = readArgValue;
|
|
|
1419
1418
|
exports.validateFieldWithResult = (0, lodash_1.memoize)(exports._validateField, function (type, value, field, canBeNull) {
|
|
1420
1419
|
return "".concat(type, "-").concat(JSON.stringify(value), "-").concat(JSON.stringify(field), "-").concat(canBeNull);
|
|
1421
1420
|
});
|
|
1421
|
+
/* A reason kept is worded as it was when it was first asked for: when the host gives other words, the kept reasons
|
|
1422
|
+
are dropped, and the next asking words them again. */
|
|
1423
|
+
(0, reqraftLabels_1.onReqraftLabelsChange)(function () { var _a, _b; return (_b = (_a = exports.validateFieldWithResult.cache).clear) === null || _b === void 0 ? void 0 : _b.call(_a); });
|
|
1422
1424
|
var validateField = function (type, value, field, canBeNull) {
|
|
1423
1425
|
return (0, exports.validateFieldWithResult)(type, value, field, canBeNull).isValid;
|
|
1424
1426
|
};
|
|
@@ -1526,13 +1528,13 @@ var getUnresolvedRequiredOptionReason = function (_a, optionSchema) {
|
|
|
1526
1528
|
var name = _a.name, reason = _a.reason;
|
|
1527
1529
|
switch (reason) {
|
|
1528
1530
|
case 'dependency':
|
|
1529
|
-
return
|
|
1531
|
+
return words().optionDependenciesNotFulfilled(name);
|
|
1530
1532
|
case 'invalid':
|
|
1531
|
-
return
|
|
1533
|
+
return words().optionInvalid(name);
|
|
1532
1534
|
default:
|
|
1533
1535
|
return ((_b = optionSchema === null || optionSchema === void 0 ? void 0 : optionSchema[name]) === null || _b === void 0 ? void 0 : _b.required)
|
|
1534
|
-
?
|
|
1535
|
-
:
|
|
1536
|
+
? words().optionRequired(name)
|
|
1537
|
+
: words().optionRequiresValue(name);
|
|
1536
1538
|
}
|
|
1537
1539
|
};
|
|
1538
1540
|
exports.getUnresolvedRequiredOptionReason = getUnresolvedRequiredOptionReason;
|