@qoretechnologies/reqraft 0.10.77 → 0.10.78-pr.145.g24c0d9d
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 +4 -4
- package/dist/components/Description/AllowedValuesHelp.d.ts.map +1 -1
- package/dist/components/Description/AllowedValuesHelp.js +10 -7
- package/dist/components/Description/AllowedValuesHelp.js.map +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 +6 -0
- package/dist/components/codeSize/index.d.ts.map +1 -1
- package/dist/components/codeSize/index.js +12 -2
- package/dist/components/codeSize/index.js.map +1 -1
- package/dist/components/colorValue/colorValue.d.ts.map +1 -1
- package/dist/components/colorValue/colorValue.js +27 -36
- package/dist/components/colorValue/colorValue.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/dpqlTags.js +1 -1
- package/dist/components/dpqlEditor/dpqlTags.js.map +1 -1
- package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
- package/dist/components/form/engine/CompactRow.js +168 -32
- 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/FormEngine.d.ts +66 -2
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +576 -207
- package/dist/components/form/engine/FormEngine.js.map +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 +42 -6
- package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.js +27 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
- package/dist/components/form/engine/compactRowContext.d.ts +5 -0
- 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 +17 -0
- package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowStyles.js +99 -52
- package/dist/components/form/engine/compactRowStyles.js.map +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/readFirst.d.ts +38 -2
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +31 -6
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/engine/revealRow.d.ts +13 -0
- package/dist/components/form/engine/revealRow.d.ts.map +1 -1
- package/dist/components/form/engine/revealRow.js +24 -1
- 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/expressions/DpqlRendering.d.ts.map +1 -1
- package/dist/components/form/expressions/DpqlRendering.js +4 -2
- package/dist/components/form/expressions/DpqlRendering.js.map +1 -1
- package/dist/components/form/expressions/ExpressionField.d.ts +6 -8
- package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
- package/dist/components/form/expressions/ExpressionField.js +13 -11
- package/dist/components/form/expressions/ExpressionField.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentDetail.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentDetail.js +4 -1
- package/dist/components/form/expressions/builder/argumentDetail.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.d.ts +3 -1
- package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.js +66 -26
- 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 +10 -6
- package/dist/components/form/expressions/builder/argumentWrapper.js.map +1 -1
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js +13 -8
- 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 +6 -1
- package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/index.js +110 -64
- 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/expressionOperands.js +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/renderExpressionToText.d.ts.map +1 -1
- package/dist/components/form/expressions/renderExpressionToText.js +15 -0
- package/dist/components/form/expressions/renderExpressionToText.js.map +1 -1
- package/dist/components/form/expressions/types.d.ts +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.map +1 -1
- package/dist/components/form/fields/Field.js +9 -5
- package/dist/components/form/fields/Field.js.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +7 -0
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.js +34 -10
- package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
- 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 +31 -14
- 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 +21 -19
- package/dist/components/form/fields/array/ArrayAutoField.js.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts +5 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.js +41 -15
- package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
- package/dist/components/form/fields/binary/Binary.d.ts.map +1 -1
- package/dist/components/form/fields/binary/Binary.js +6 -1
- package/dist/components/form/fields/binary/Binary.js.map +1 -1
- package/dist/components/form/fields/boolean/Boolean.d.ts +7 -1
- package/dist/components/form/fields/boolean/Boolean.d.ts.map +1 -1
- package/dist/components/form/fields/boolean/Boolean.js +8 -2
- 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.map +1 -1
- package/dist/components/form/fields/color/Color.js +9 -6
- package/dist/components/form/fields/color/Color.js.map +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 +72 -0
- package/dist/components/form/fields/labels.d.ts.map +1 -0
- package/dist/components/form/fields/labels.js +47 -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 +15 -5
- 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/number/Number.d.ts +4 -1
- package/dist/components/form/fields/number/Number.d.ts.map +1 -1
- package/dist/components/form/fields/number/Number.js +21 -7
- package/dist/components/form/fields/number/Number.js.map +1 -1
- package/dist/components/form/fields/object/Object.d.ts +9 -1
- package/dist/components/form/fields/object/Object.d.ts.map +1 -1
- package/dist/components/form/fields/object/Object.js +24 -8
- package/dist/components/form/fields/object/Object.js.map +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.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.js +6 -3
- package/dist/components/form/fields/rich-text/RichText.js.map +1 -1
- package/dist/components/form/fields/rich-text/useTemplateTags.d.ts +2 -0
- package/dist/components/form/fields/rich-text/useTemplateTags.d.ts.map +1 -1
- package/dist/components/form/fields/rich-text/useTemplateTags.js +7 -1
- 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 +10 -8
- 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 +39 -27
- 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 +20 -14
- 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/select/Select.d.ts +1 -1
- package/dist/components/form/fields/select/Select.d.ts.map +1 -1
- package/dist/components/form/fields/select/Select.js +13 -6
- package/dist/components/form/fields/select/Select.js.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.d.ts +2 -2
- package/dist/components/form/fields/select/SelectCollection.d.ts.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.js +11 -3
- package/dist/components/form/fields/select/SelectCollection.js.map +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 +3 -1
- package/dist/components/form/fields/template/TemplateBrowser.js.map +1 -1
- package/dist/components/form/fields/template/TemplateField.d.ts +12 -2
- package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateField.js +71 -60
- package/dist/components/form/fields/template/TemplateField.js.map +1 -1
- package/dist/components/form/fields/template/TemplatePicker.d.ts +7 -1
- package/dist/components/form/fields/template/TemplatePicker.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplatePicker.js +35 -16
- package/dist/components/form/fields/template/TemplatePicker.js.map +1 -1
- 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/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/imageLightbox/ImageLightbox.d.ts.map +1 -1
- package/dist/components/imageLightbox/ImageLightbox.js +10 -6
- 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 +21 -18
- 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.map +1 -1
- package/dist/components/smartEditor/CompletionMenu.js +13 -6
- 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 +3 -1
- package/dist/components/smartEditor/SmartEditor.js.map +1 -1
- package/dist/components/smartEditor/completionStyle.d.ts +17 -2
- package/dist/components/smartEditor/completionStyle.d.ts.map +1 -1
- package/dist/components/smartEditor/completionStyle.js +32 -4
- package/dist/components/smartEditor/completionStyle.js.map +1 -1
- package/dist/components/smartEditor/templateCompletions.js +1 -1
- package/dist/components/smartEditor/templateCompletions.js.map +1 -1
- package/dist/components/smartEditor/types.d.ts +1 -1
- package/dist/components/smartEditor/useLspAutocomplete.d.ts +5 -0
- package/dist/components/smartEditor/useLspAutocomplete.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspAutocomplete.js +76 -20
- package/dist/components/smartEditor/useLspAutocomplete.js.map +1 -1
- package/dist/components/supportTicket/AttachmentChips.d.ts.map +1 -1
- package/dist/components/supportTicket/AttachmentChips.js +4 -2
- package/dist/components/supportTicket/AttachmentChips.js.map +1 -1
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts +3 -2
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts.map +1 -1
- package/dist/components/supportTicket/InterfaceReferenceTags.js +6 -6
- 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 +35 -25
- 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 +4 -1
- 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 +31 -4
- package/dist/components/supportTicket/meta.d.ts.map +1 -1
- package/dist/components/supportTicket/meta.js +98 -72
- 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 +5 -1
- 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 +56 -45
- 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 +58 -36
- 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.map +1 -1
- package/dist/helpers/allowedValues.js +11 -4
- package/dist/helpers/allowedValues.js.map +1 -1
- package/dist/helpers/expressions.d.ts.map +1 -1
- package/dist/helpers/expressions.js +7 -12
- 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/markdownText.d.ts +9 -0
- package/dist/helpers/markdownText.d.ts.map +1 -1
- package/dist/helpers/markdownText.js +49 -2
- package/dist/helpers/markdownText.js.map +1 -1
- package/dist/helpers/noDescription.d.ts +4 -4
- package/dist/helpers/noDescription.d.ts.map +1 -1
- package/dist/helpers/noDescription.js +8 -6
- 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 +1 -1
- package/dist/helpers/qorusTypeCatalogue.js +1 -1
- package/dist/helpers/readableColors.d.ts +8 -0
- package/dist/helpers/readableColors.d.ts.map +1 -1
- package/dist/helpers/readableColors.js +12 -1
- package/dist/helpers/readableColors.js.map +1 -1
- package/dist/helpers/reqraftLabels.d.ts +83 -0
- package/dist/helpers/reqraftLabels.d.ts.map +1 -1
- package/dist/helpers/reqraftLabels.js +60 -15
- 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/templateItems.d.ts +1 -1
- package/dist/helpers/templateItems.js +1 -1
- package/dist/helpers/templates.js +1 -1
- package/dist/helpers/templates.js.map +1 -1
- package/dist/helpers/validationLabels.d.ts +190 -0
- package/dist/helpers/validationLabels.d.ts.map +1 -0
- package/dist/helpers/validationLabels.js +210 -0
- package/dist/helpers/validationLabels.js.map +1 -0
- package/dist/helpers/validations.d.ts +14 -2
- package/dist/helpers/validations.d.ts.map +1 -1
- package/dist/helpers/validations.js +165 -178
- package/dist/helpers/validations.js.map +1 -1
- 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/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/tracking/ui/ExperimentCard.d.ts +3 -3
- package/dist/tracking/ui/ExperimentCard.d.ts.map +1 -1
- package/dist/tracking/ui/ExperimentCard.js +33 -45
- 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/package.json +1 -1
|
@@ -44,6 +44,7 @@ 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. */
|
|
48
49
|
var CRON_FIELDS = [
|
|
49
50
|
['minutes', 'minute'],
|
|
@@ -106,6 +107,8 @@ var SEMANTIC_FORMAT_PATTERNS = {
|
|
|
106
107
|
ipv6: /^([0-9A-Fa-f]{0,4}:){2,7}[0-9A-Fa-f]{0,4}$/,
|
|
107
108
|
phone: /^\+?[0-9 ().-]{3,}$/,
|
|
108
109
|
};
|
|
110
|
+
/** The words a reason is said in, read when it is said: a host that gives others is answered in them. */
|
|
111
|
+
var words = function () { return (0, reqraftLabels_1.reqraftLabels)().validation; };
|
|
109
112
|
var validResult = function () { return ({ isValid: true, reasons: [] }); };
|
|
110
113
|
/**
|
|
111
114
|
* Why a value its field's pattern refuses is refused, in words the author can act on: what the pattern accepts,
|
|
@@ -114,19 +117,15 @@ var validResult = function () { return ({ isValid: true, reasons: [] }); };
|
|
|
114
117
|
* i.e. what doesn't match the pattern - what is the pattern"). It said "Value does not match validation pattern".
|
|
115
118
|
*/
|
|
116
119
|
var patternMismatchReason = function (field) {
|
|
117
|
-
var sentence = function (text) { return (/[.!?]$/.test(text) ? text : "".concat(text, ".")); };
|
|
118
120
|
var desc = typeof (field === null || field === void 0 ? void 0 : field.validation_regex_desc) === 'string' ? field.validation_regex_desc.trim() : '';
|
|
119
121
|
if (desc) {
|
|
120
|
-
return
|
|
122
|
+
return words().mustBe(desc);
|
|
121
123
|
}
|
|
122
124
|
var example = field === null || field === void 0 ? void 0 : field.example_value;
|
|
123
125
|
var exampleText = typeof example === 'string' ? example.trim()
|
|
124
126
|
: typeof example === 'number' || typeof example === 'boolean' ? String(example)
|
|
125
127
|
: '';
|
|
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;
|
|
128
|
+
return words().mustMatchExpectedForm(exampleText || undefined, (field === null || field === void 0 ? void 0 : field.validation_regex) || undefined);
|
|
130
129
|
};
|
|
131
130
|
exports.patternMismatchReason = patternMismatchReason;
|
|
132
131
|
var invalidResult = function (reason, childReasons) {
|
|
@@ -142,12 +141,11 @@ var withContext = function (result, context) {
|
|
|
142
141
|
if (result.isValid || !context) {
|
|
143
142
|
return result;
|
|
144
143
|
}
|
|
145
|
-
var
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
};
|
|
144
|
+
var checked = context;
|
|
145
|
+
var reasons = result.reasons.length > 0 ?
|
|
146
|
+
result.reasons.map(function (reason) { return words().inContext(checked, reason); })
|
|
147
|
+
: [checked];
|
|
148
|
+
return __assign({ isValid: false, reason: reasons[0], reasons: reasons }, (result.missingOperand ? { missingOperand: true } : {}));
|
|
151
149
|
};
|
|
152
150
|
var resultFromBoolean = function (isValid, reason) {
|
|
153
151
|
return isValid ? validResult() : invalidResult(reason);
|
|
@@ -178,10 +176,10 @@ var checkNumericBounds = function (value, field) {
|
|
|
178
176
|
var min = field === null || field === void 0 ? void 0 : field.min_value;
|
|
179
177
|
var max = field === null || field === void 0 ? void 0 : field.max_value;
|
|
180
178
|
if (typeof min === 'number' && Number.isFinite(min) && num < min) {
|
|
181
|
-
return invalidResult(
|
|
179
|
+
return invalidResult(words().atLeast(min));
|
|
182
180
|
}
|
|
183
181
|
if (typeof max === 'number' && Number.isFinite(max) && num > max) {
|
|
184
|
-
return invalidResult(
|
|
182
|
+
return invalidResult(words().atMost(max));
|
|
185
183
|
}
|
|
186
184
|
return validResult();
|
|
187
185
|
};
|
|
@@ -219,10 +217,7 @@ var typeInSentence = function (type) {
|
|
|
219
217
|
return (0, qorusTypeCatalogue_1.qorusTypeSentenceForm)(qorusTypeCatalogue_1.defaultQorusTypes, type);
|
|
220
218
|
};
|
|
221
219
|
/** What is said of a value that is not of its field's type, the type named where there is one (qorus#646). */
|
|
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
|
-
};
|
|
220
|
+
var valueMustBe = function (type) { return words().valueMustBe(typeInSentence(type)); };
|
|
226
221
|
/** The types a value is written as text in, where text around a template makes it text and not one of them. */
|
|
227
222
|
var NOT_TEXT_WITH_A_TEMPLATE = new Set([
|
|
228
223
|
'int',
|
|
@@ -244,37 +239,26 @@ var NOT_TEXT_WITH_A_TEMPLATE = new Set([
|
|
|
244
239
|
* happened?"). `undefined` where the type is text, or the value is not text around a template.
|
|
245
240
|
*/
|
|
246
241
|
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;
|
|
242
|
+
var around = NOT_TEXT_WITH_A_TEMPLATE.has(type) ? (0, templates_1.textAroundATemplate)(value) : undefined;
|
|
252
243
|
if (!around) {
|
|
253
244
|
return undefined;
|
|
254
245
|
}
|
|
246
|
+
// the type as the catalogue names it inside a sentence; the words say it of the field's type where it has no name
|
|
247
|
+
var named = typeInSentence(type);
|
|
255
248
|
if (around.templates > 1) {
|
|
256
249
|
return around.text.length
|
|
257
|
-
?
|
|
258
|
-
:
|
|
259
|
-
}
|
|
260
|
-
return "\"".concat(around.text.join(' … '), "\" makes this text, not ").concat(notA, ". Delete it to keep the template alone.");
|
|
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");
|
|
250
|
+
? words().textAndTemplatesMakeText(named)
|
|
251
|
+
: words().templatesSideBySide(named);
|
|
268
252
|
}
|
|
269
|
-
return
|
|
253
|
+
return words().textAroundTemplate(around.text, named);
|
|
270
254
|
};
|
|
271
255
|
var _validateField = function (type, value, field, canBeNull) {
|
|
272
256
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
273
257
|
if (!type) {
|
|
274
258
|
if (value === undefined || value === null) {
|
|
275
|
-
return invalidResult(
|
|
259
|
+
return invalidResult(words().missingValue);
|
|
276
260
|
}
|
|
277
|
-
return invalidResult(
|
|
261
|
+
return invalidResult(words().missingType);
|
|
278
262
|
}
|
|
279
263
|
// Check if the type starts with a * to indicate it can be null
|
|
280
264
|
if (type.startsWith('*')) {
|
|
@@ -302,7 +286,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
302
286
|
if ((0, templates_1.isValueTemplate)(value)) {
|
|
303
287
|
var hasKey = !!(0, templates_1.getTemplateKey)(value);
|
|
304
288
|
var hasValue = !!(0, templates_1.getTemplateValue)(value);
|
|
305
|
-
return resultFromBoolean(hasKey && hasValue,
|
|
289
|
+
return resultFromBoolean(hasKey && hasValue, words().templateNeedsKeyAndValue);
|
|
306
290
|
}
|
|
307
291
|
// Expression values (`is_expression`) carry the AST `{ exp, args }` instead of
|
|
308
292
|
// a typed literal, so the declared type says nothing about them — validate
|
|
@@ -332,7 +316,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
332
316
|
// here with the field's schema (choices included) and the AST as the value.
|
|
333
317
|
var unlistedChoiceReason = type === 'expression' ? undefined : (0, allowedValues_1.getUnlistedChoiceReason)(value, field);
|
|
334
318
|
if (unlistedChoiceReason) {
|
|
335
|
-
return invalidResult(unlistedChoiceReason);
|
|
319
|
+
return __assign(__assign({}, invalidResult(unlistedChoiceReason)), { unlistedChoice: true });
|
|
336
320
|
}
|
|
337
321
|
// An interface type names another Qorus object by its name, so a non-empty
|
|
338
322
|
// string is the whole contract. `connection` is the exception: it carries
|
|
@@ -343,13 +327,13 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
343
327
|
switch (type) {
|
|
344
328
|
case 'richtext': {
|
|
345
329
|
if (!value || !(0, size_1.default)(value)) {
|
|
346
|
-
return invalidResult(
|
|
330
|
+
return invalidResult(words().textEmpty);
|
|
347
331
|
}
|
|
348
332
|
if (typeof value === 'string') {
|
|
349
333
|
return validResult();
|
|
350
334
|
}
|
|
351
335
|
if (isRichTextWithoutValue(value)) {
|
|
352
|
-
return invalidResult(
|
|
336
|
+
return invalidResult(words().textEmpty);
|
|
353
337
|
}
|
|
354
338
|
return validResult();
|
|
355
339
|
}
|
|
@@ -360,21 +344,21 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
360
344
|
(value === undefined && (field === null || field === void 0 ? void 0 : field.has_to_have_value) === false), valueMustBe('bool'));
|
|
361
345
|
case 'connection': {
|
|
362
346
|
if (!value) {
|
|
363
|
-
return invalidResult(
|
|
347
|
+
return invalidResult(words().connectionMissing);
|
|
364
348
|
}
|
|
365
349
|
if (field === null || field === void 0 ? void 0 : field.allowed_values) {
|
|
366
350
|
var allowedValue = field.allowed_values.find(function (val) { return (0, allowedValues_1.allowedValueOf)(val) === value || val.name === value; });
|
|
367
351
|
if (!allowedValue) {
|
|
368
|
-
return invalidResult(
|
|
352
|
+
return invalidResult(words().connectionNotAllowed);
|
|
369
353
|
}
|
|
370
354
|
if (allowedValue.disabled || ((_b = allowedValue.metadata) === null || _b === void 0 ? void 0 : _b.needs_auth)) {
|
|
371
|
-
return invalidResult(
|
|
355
|
+
return invalidResult(words().connectionDisabled);
|
|
372
356
|
}
|
|
373
357
|
}
|
|
374
358
|
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(
|
|
359
|
+
return invalidResult(words().connectionDisabled);
|
|
376
360
|
}
|
|
377
|
-
return withContext((0, exports.validateFieldWithResult)('string', value, field),
|
|
361
|
+
return withContext((0, exports.validateFieldWithResult)('string', value, field), words().connectionTextInvalid);
|
|
378
362
|
}
|
|
379
363
|
// semantic string formats — permissive patterns mirror the qore DataProvider
|
|
380
364
|
// QoreStringFormatDataType backstop; a server-supplied validation_regex, if
|
|
@@ -386,20 +370,20 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
386
370
|
case 'ipv6':
|
|
387
371
|
case 'phone': {
|
|
388
372
|
if (value === undefined || value === null || value === '' || typeof value !== 'string') {
|
|
389
|
-
return invalidResult(
|
|
373
|
+
return invalidResult(words().nonEmptyText);
|
|
390
374
|
}
|
|
391
375
|
if ((field === null || field === void 0 ? void 0 : field.validation_regex) && !value.match(field.validation_regex)) {
|
|
392
376
|
return invalidResult((0, exports.patternMismatchReason)(field));
|
|
393
377
|
}
|
|
394
|
-
return resultFromBoolean(SEMANTIC_FORMAT_PATTERNS[type].test(value),
|
|
378
|
+
return resultFromBoolean(SEMANTIC_FORMAT_PATTERNS[type].test(value), words().notValidFormat(type));
|
|
395
379
|
}
|
|
396
380
|
case 'binary': {
|
|
397
381
|
if (typeof value !== 'string') {
|
|
398
|
-
return invalidResult(
|
|
382
|
+
return invalidResult(words().binaryNotText);
|
|
399
383
|
}
|
|
400
384
|
var trimmed = value.trim();
|
|
401
385
|
if (trimmed.length === 0) {
|
|
402
|
-
return invalidResult(
|
|
386
|
+
return invalidResult(words().binaryEmpty);
|
|
403
387
|
}
|
|
404
388
|
// the canonical wire form is base64 (matching the server decode); a "data:<mime>;base64,..." URL
|
|
405
389
|
// and legacy "0x"-prefixed hex are also accepted
|
|
@@ -408,9 +392,9 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
408
392
|
}
|
|
409
393
|
if (/^0x/i.test(trimmed)) {
|
|
410
394
|
var hex = trimmed.replace(/^0x/i, '');
|
|
411
|
-
return resultFromBoolean(hex.length % 2 === 0 && /^[0-9a-fA-F]+$/.test(hex),
|
|
395
|
+
return resultFromBoolean(hex.length % 2 === 0 && /^[0-9a-fA-F]+$/.test(hex), words().binaryHexInvalid);
|
|
412
396
|
}
|
|
413
|
-
return resultFromBoolean(/^[A-Za-z0-9+/]+={0,2}$/.test(trimmed),
|
|
397
|
+
return resultFromBoolean(/^[A-Za-z0-9+/]+={0,2}$/.test(trimmed), words().binaryForm);
|
|
414
398
|
}
|
|
415
399
|
case 'string':
|
|
416
400
|
case 'mapper':
|
|
@@ -426,7 +410,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
426
410
|
case 'code-editor':
|
|
427
411
|
case 'data': {
|
|
428
412
|
if (value === undefined || value === null || value === '' || typeof value !== 'string') {
|
|
429
|
-
return invalidResult(
|
|
413
|
+
return invalidResult(words().nonEmptyText);
|
|
430
414
|
}
|
|
431
415
|
var reasons = [];
|
|
432
416
|
if ((field === null || field === void 0 ? void 0 : field.validation_regex) && !value.match(field.validation_regex)) {
|
|
@@ -438,12 +422,12 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
438
422
|
if ((field === null || field === void 0 ? void 0 : field.has_to_be_valid_identifier) ||
|
|
439
423
|
(Array.isArray(field === null || field === void 0 ? void 0 : field.rules) && field.rules.includes('valid_identifier'))) {
|
|
440
424
|
if (value.match(/^[0-9]|\W/)) {
|
|
441
|
-
reasons.push(
|
|
425
|
+
reasons.push(words().notIdentifier);
|
|
442
426
|
}
|
|
443
427
|
}
|
|
444
428
|
if (field === null || field === void 0 ? void 0 : field.has_to_have_value) {
|
|
445
429
|
if (value === '' || value.length === 0) {
|
|
446
|
-
reasons.push(
|
|
430
|
+
reasons.push(words().required);
|
|
447
431
|
}
|
|
448
432
|
}
|
|
449
433
|
return reasons.length ? invalidResult(undefined, reasons) : validResult();
|
|
@@ -479,9 +463,9 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
479
463
|
// Report both parts. Returning on the first failure meant a bad file name
|
|
480
464
|
// masked the content result entirely, so the form could only ever surface
|
|
481
465
|
// one problem at a time.
|
|
482
|
-
var reasons = __spreadArray(__spreadArray([], (nameResult.isValid ? [] : withContext(nameResult,
|
|
466
|
+
var reasons = __spreadArray(__spreadArray([], (nameResult.isValid ? [] : withContext(nameResult, words().fileNameInvalid).reasons), true), (contentResult.isValid
|
|
483
467
|
? []
|
|
484
|
-
: withContext(contentResult,
|
|
468
|
+
: withContext(contentResult, words().fileContentInvalid).reasons), true);
|
|
485
469
|
return reasons.length ? invalidResult(reasons) : validResult();
|
|
486
470
|
}
|
|
487
471
|
case 'collection-documents': {
|
|
@@ -499,23 +483,22 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
499
483
|
return validResult();
|
|
500
484
|
}
|
|
501
485
|
if (!Array.isArray(value)) {
|
|
502
|
-
return invalidResult(
|
|
486
|
+
return invalidResult(words().documentsNotList);
|
|
503
487
|
}
|
|
504
488
|
var reasons_1 = [];
|
|
505
489
|
value.forEach(function (row, idx) {
|
|
506
490
|
if (!row || typeof row !== 'object') {
|
|
507
|
-
reasons_1.push(
|
|
491
|
+
reasons_1.push(words().documentRowNotObject(idx + 1));
|
|
508
492
|
return;
|
|
509
493
|
}
|
|
510
494
|
if (typeof row.name !== 'string' || !row.name) {
|
|
511
|
-
reasons_1.push(
|
|
495
|
+
reasons_1.push(words().documentRowNoName(idx + 1));
|
|
512
496
|
return;
|
|
513
497
|
}
|
|
514
498
|
var hasServerId = typeof row.ai_documentid === 'number';
|
|
515
499
|
var hasContent = typeof row.content === 'string' && !!row.content;
|
|
516
500
|
if (!hasServerId && !hasContent) {
|
|
517
|
-
reasons_1.push(
|
|
518
|
-
"content nor a server document id");
|
|
501
|
+
reasons_1.push(words().documentRowNoContent(idx + 1, row.name));
|
|
519
502
|
}
|
|
520
503
|
});
|
|
521
504
|
return reasons_1.length ? invalidResult(undefined, reasons_1) : validResult();
|
|
@@ -526,26 +509,26 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
526
509
|
// Check if every pair has key & value
|
|
527
510
|
// assigned properly
|
|
528
511
|
if (!Array.isArray(value)) {
|
|
529
|
-
return invalidResult(
|
|
512
|
+
return invalidResult(words().notList);
|
|
530
513
|
}
|
|
531
514
|
if (!(value === null || value === void 0 ? void 0 : value.every(function (pair) {
|
|
532
515
|
return pair[field.fields[0]] !== '' && pair[field.fields[1]] !== '';
|
|
533
516
|
}))) {
|
|
534
517
|
valid = false;
|
|
535
|
-
reasons.push(
|
|
518
|
+
reasons.push(words().pairsNeedBothFields);
|
|
536
519
|
}
|
|
537
520
|
// Get a list of unique values
|
|
538
521
|
var uniqueValues = (0, uniqWith_1.default)(value, function (cur, prev) { return cur[field.fields[0]] === prev[field.fields[0]]; });
|
|
539
522
|
// Check if there are any duplicates
|
|
540
523
|
if ((0, size_1.default)(uniqueValues) !== (0, size_1.default)(value)) {
|
|
541
524
|
valid = false;
|
|
542
|
-
reasons.push(
|
|
525
|
+
reasons.push(words().pairsUniqueKeys);
|
|
543
526
|
}
|
|
544
527
|
return valid ? validResult() : invalidResult(undefined, reasons);
|
|
545
528
|
}
|
|
546
529
|
case 'class-connectors': {
|
|
547
530
|
if (!Array.isArray(value) || value.length === 0) {
|
|
548
|
-
return invalidResult(
|
|
531
|
+
return invalidResult(words().connectorRequired);
|
|
549
532
|
}
|
|
550
533
|
var valid = true;
|
|
551
534
|
var reasons = [];
|
|
@@ -555,35 +538,35 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
555
538
|
return !!pair.name && pair.name !== '' && !!pair.method && pair.method !== '';
|
|
556
539
|
}))) {
|
|
557
540
|
valid = false;
|
|
558
|
-
reasons.push(
|
|
541
|
+
reasons.push(words().connectorNameAndMethod);
|
|
559
542
|
}
|
|
560
543
|
// Get a list of unique values
|
|
561
544
|
var uniqueValues = (0, uniqWith_1.default)(value, function (cur, prev) { return cur.name === prev.name; });
|
|
562
545
|
// Check if there are any duplicates
|
|
563
546
|
if ((0, size_1.default)(uniqueValues) !== (0, size_1.default)(value)) {
|
|
564
547
|
valid = false;
|
|
565
|
-
reasons.push(
|
|
548
|
+
reasons.push(words().connectorNamesUnique);
|
|
566
549
|
}
|
|
567
550
|
return valid ? validResult() : invalidResult(undefined, reasons);
|
|
568
551
|
}
|
|
569
552
|
// Classes check
|
|
570
553
|
case 'class-array': {
|
|
571
554
|
if (!(Array.isArray(value) && value.length > 0)) {
|
|
572
|
-
return invalidResult(
|
|
555
|
+
return invalidResult(words().classRequired);
|
|
573
556
|
}
|
|
574
557
|
var valid = true;
|
|
575
558
|
var reasons = [];
|
|
576
559
|
// Check if the fields are not empty
|
|
577
560
|
if (!(value === null || value === void 0 ? void 0 : value.every(function (pair) { return !!pair.name && pair.name !== ''; }))) {
|
|
578
561
|
valid = false;
|
|
579
|
-
reasons.push(
|
|
562
|
+
reasons.push(words().classNeedsName);
|
|
580
563
|
}
|
|
581
564
|
// Get a list of unique values
|
|
582
565
|
var uniqueValues = (0, uniqWith_1.default)(value, function (cur, prev) { return "".concat(cur.prefix).concat(cur.name) === "".concat(prev.prefix).concat(prev.name); });
|
|
583
566
|
// Check if there are any duplicates
|
|
584
567
|
if ((0, size_1.default)(uniqueValues) !== (0, size_1.default)(value)) {
|
|
585
568
|
valid = false;
|
|
586
|
-
reasons.push(
|
|
569
|
+
reasons.push(words().classNamesUnique);
|
|
587
570
|
}
|
|
588
571
|
return valid ? validResult() : invalidResult(undefined, reasons);
|
|
589
572
|
}
|
|
@@ -607,10 +590,10 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
607
590
|
case 'multi-select':
|
|
608
591
|
case 'array':
|
|
609
592
|
case 'file-tree':
|
|
610
|
-
return resultFromBoolean(value && value.length > 0,
|
|
593
|
+
return resultFromBoolean(value && value.length > 0, words().atLeastOneValue);
|
|
611
594
|
case 'cron': {
|
|
612
595
|
if (!value) {
|
|
613
|
-
return invalidResult(
|
|
596
|
+
return invalidResult(words().cronRequired);
|
|
614
597
|
}
|
|
615
598
|
var expression = (0, exports.cronExpressionFromValue)(value);
|
|
616
599
|
// A value that is neither a cron string nor a schedule hash is INVALID,
|
|
@@ -618,15 +601,15 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
618
601
|
// passing it a hash threw a TypeError out of validation and took the
|
|
619
602
|
// whole form down through the host's error boundary.
|
|
620
603
|
if (expression === undefined) {
|
|
621
|
-
return invalidResult(
|
|
604
|
+
return invalidResult(words().cronInvalid);
|
|
622
605
|
}
|
|
623
|
-
return resultFromBoolean((0, cron_validator_1.isValidCron)(expression, { alias: true }),
|
|
606
|
+
return resultFromBoolean((0, cron_validator_1.isValidCron)(expression, { alias: true }), words().cronInvalid);
|
|
624
607
|
}
|
|
625
608
|
case 'date':
|
|
626
609
|
return resultFromBoolean(value !== undefined &&
|
|
627
610
|
value !== null &&
|
|
628
611
|
value !== '' &&
|
|
629
|
-
new Date(value).toString() !== 'Invalid Date',
|
|
612
|
+
new Date(value).toString() !== 'Invalid Date', words().dateInvalid);
|
|
630
613
|
case 'hash':
|
|
631
614
|
case 'free-hash': {
|
|
632
615
|
var parsedValue_1 = typeof value === 'object' ? value : (0, exports.maybeParseYaml)(value);
|
|
@@ -640,7 +623,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
640
623
|
}
|
|
641
624
|
return (0, exports.validateFieldWithResult)(fieldData.ui_type || fieldData.type, argValue, fieldData).isValid;
|
|
642
625
|
});
|
|
643
|
-
return resultFromBoolean(result,
|
|
626
|
+
return resultFromBoolean(result, words().hashArgumentsInvalid);
|
|
644
627
|
}
|
|
645
628
|
if (!parsedValue_1 || !(0, isPlainObject_1.default)(parsedValue_1)) {
|
|
646
629
|
return invalidResult(valueMustBe('hash'));
|
|
@@ -660,7 +643,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
660
643
|
return validResult();
|
|
661
644
|
}
|
|
662
645
|
if (!(0, isArray_1.default)(parsedValue)) {
|
|
663
|
-
return invalidResult(
|
|
646
|
+
return invalidResult(words().notList);
|
|
664
647
|
}
|
|
665
648
|
if ((field === null || field === void 0 ? void 0 : field.ui_element_type) || (field === null || field === void 0 ? void 0 : field.element_type)) {
|
|
666
649
|
for (var i = 0; i < parsedValue.length; i++) {
|
|
@@ -673,7 +656,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
673
656
|
// a null element.
|
|
674
657
|
(0, options_1.getListElementValue)(parsedValue[i]), field);
|
|
675
658
|
if (!itemResult.isValid) {
|
|
676
|
-
return withContext(itemResult,
|
|
659
|
+
return withContext(itemResult, words().listItemInvalid(i));
|
|
677
660
|
}
|
|
678
661
|
}
|
|
679
662
|
}
|
|
@@ -682,34 +665,34 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
682
665
|
case 'list-of-hashes': {
|
|
683
666
|
var parsedValue = (0, exports.maybeParseYaml)(value);
|
|
684
667
|
if (!parsedValue || !(0, isArray_1.default)(parsedValue)) {
|
|
685
|
-
return invalidResult(
|
|
668
|
+
return invalidResult(words().notListOfHashes);
|
|
686
669
|
}
|
|
687
670
|
for (var i = 0; i < parsedValue.length; i++) {
|
|
688
671
|
var item = parsedValue[i];
|
|
689
672
|
if (!(0, size_1.default)(item)) {
|
|
690
|
-
return invalidResult(
|
|
673
|
+
return invalidResult(words().hashEmptyAt(i));
|
|
691
674
|
}
|
|
692
675
|
var itemResult = (0, exports.validateFieldWithResult)('hash', item);
|
|
693
676
|
if (!itemResult.isValid) {
|
|
694
|
-
return withContext(itemResult,
|
|
677
|
+
return withContext(itemResult, words().hashInvalidAt(i));
|
|
695
678
|
}
|
|
696
679
|
}
|
|
697
680
|
return validResult();
|
|
698
681
|
}
|
|
699
682
|
case 'mapper-code': {
|
|
700
683
|
if (!value) {
|
|
701
|
-
return invalidResult(
|
|
684
|
+
return invalidResult(words().mapperCodeRequired);
|
|
702
685
|
}
|
|
703
686
|
// Split the value
|
|
704
687
|
var _s = value.split('::'), code = _s[0], method = _s[1];
|
|
705
688
|
// Both fields need to be strings & filled
|
|
706
689
|
var codeResult = (0, exports.validateFieldWithResult)('string', code);
|
|
707
690
|
if (!codeResult.isValid) {
|
|
708
|
-
return withContext(codeResult,
|
|
691
|
+
return withContext(codeResult, words().mapperCodeInvalid);
|
|
709
692
|
}
|
|
710
693
|
var methodResult = (0, exports.validateFieldWithResult)('string', method);
|
|
711
694
|
if (!methodResult.isValid) {
|
|
712
|
-
return withContext(methodResult,
|
|
695
|
+
return withContext(methodResult, words().mapperMethodInvalid);
|
|
713
696
|
}
|
|
714
697
|
return validResult();
|
|
715
698
|
}
|
|
@@ -718,19 +701,19 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
718
701
|
if ((varAction === null || varAction === void 0 ? void 0 : varAction.var_type) !== 'localvar' &&
|
|
719
702
|
(varAction === null || varAction === void 0 ? void 0 : varAction.var_type) !== 'globalvar' &&
|
|
720
703
|
(varAction === null || varAction === void 0 ? void 0 : varAction.var_type) !== 'autovar') {
|
|
721
|
-
return invalidResult(
|
|
704
|
+
return invalidResult(words().variableTypeInvalid);
|
|
722
705
|
}
|
|
723
706
|
var nameResult = (0, exports.validateFieldWithResult)('string', varAction.var_name, {
|
|
724
707
|
has_to_have_value: true,
|
|
725
708
|
});
|
|
726
709
|
if (!nameResult.isValid) {
|
|
727
|
-
return withContext(nameResult,
|
|
710
|
+
return withContext(nameResult, words().variableNameInvalid);
|
|
728
711
|
}
|
|
729
712
|
var actionResult = (0, exports.validateFieldWithResult)('string', varAction.action_type, {
|
|
730
713
|
has_to_have_value: true,
|
|
731
714
|
});
|
|
732
715
|
if (!actionResult.isValid) {
|
|
733
|
-
return withContext(actionResult,
|
|
716
|
+
return withContext(actionResult, words().variableActionTypeInvalid);
|
|
734
717
|
}
|
|
735
718
|
// If the action type is transaction, the transaction_action needs to be set
|
|
736
719
|
if (varAction.action_type === 'transaction') {
|
|
@@ -738,17 +721,17 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
738
721
|
has_to_have_value: true,
|
|
739
722
|
});
|
|
740
723
|
if (!transactionResult.isValid) {
|
|
741
|
-
return withContext(transactionResult,
|
|
724
|
+
return withContext(transactionResult, words().transactionActionInvalid);
|
|
742
725
|
}
|
|
743
726
|
return validResult();
|
|
744
727
|
}
|
|
745
728
|
// If the variable data is missing
|
|
746
729
|
if (!((_d = field === null || field === void 0 ? void 0 : field.variableData) === null || _d === void 0 ? void 0 : _d.value)) {
|
|
747
|
-
return invalidResult(
|
|
730
|
+
return invalidResult(words().variableDataMissing);
|
|
748
731
|
}
|
|
749
732
|
// Get the variable data
|
|
750
733
|
var variableData = __assign(__assign({}, value), field.variableData.value);
|
|
751
|
-
return withContext((0, exports.validateFieldWithResult)(varAction.action_type, variableData, field),
|
|
734
|
+
return withContext((0, exports.validateFieldWithResult)(varAction.action_type, variableData, field), words().variableActionInvalid);
|
|
752
735
|
}
|
|
753
736
|
case 'type-selector':
|
|
754
737
|
case 'data-provider':
|
|
@@ -761,11 +744,11 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
761
744
|
case 'create': {
|
|
762
745
|
var newValue = (0, providerValue_1.maybeBuildOptionProvider)(value);
|
|
763
746
|
if (!newValue) {
|
|
764
|
-
return invalidResult(
|
|
747
|
+
return invalidResult(words().providerInvalid);
|
|
765
748
|
}
|
|
766
749
|
// Api call only supports requests / response
|
|
767
750
|
if (type === 'api-call' && !value.supports_request) {
|
|
768
|
-
return invalidResult(
|
|
751
|
+
return invalidResult(words().apiCallNeedsRequests);
|
|
769
752
|
}
|
|
770
753
|
// If the provider is from FSM variables, it needs pass this
|
|
771
754
|
if ((field === null || field === void 0 ? void 0 : field.isVariable) &&
|
|
@@ -776,41 +759,41 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
776
759
|
newValue.supports_request ||
|
|
777
760
|
newValue.supports_messages ||
|
|
778
761
|
newValue.transaction_management)) {
|
|
779
|
-
return invalidResult(
|
|
762
|
+
return invalidResult(words().variableProviderNeedsAction);
|
|
780
763
|
}
|
|
781
764
|
// Send message only supports messages
|
|
782
765
|
if (type === 'send-message' &&
|
|
783
766
|
(!newValue.supports_messages || !newValue.message_id || !newValue.message)) {
|
|
784
|
-
return invalidResult(
|
|
767
|
+
return invalidResult(words().sendMessageProviderIncomplete);
|
|
785
768
|
}
|
|
786
769
|
if (newValue.message_id) {
|
|
787
770
|
var messageIdResult = (0, exports.validateFieldWithResult)('string', newValue.message_id);
|
|
788
771
|
if (!messageIdResult.isValid) {
|
|
789
|
-
return withContext(messageIdResult,
|
|
772
|
+
return withContext(messageIdResult, words().messageIdInvalid);
|
|
790
773
|
}
|
|
791
774
|
if (!newValue.message) {
|
|
792
|
-
return invalidResult(
|
|
775
|
+
return invalidResult(words().messageContentMissing);
|
|
793
776
|
}
|
|
794
777
|
var messageResult = (0, exports.validateFieldWithResult)(newValue.message.type, newValue.message.value);
|
|
795
778
|
if (!messageResult.isValid) {
|
|
796
|
-
return withContext(messageResult,
|
|
779
|
+
return withContext(messageResult, words().messageContentInvalid);
|
|
797
780
|
}
|
|
798
781
|
}
|
|
799
782
|
if (newValue.use_args) {
|
|
800
783
|
if (((_e = newValue.args) === null || _e === void 0 ? void 0 : _e.type) !== 'nothing') {
|
|
801
784
|
if (!newValue.args) {
|
|
802
|
-
return invalidResult(
|
|
785
|
+
return invalidResult(words().argumentsMissing);
|
|
803
786
|
}
|
|
804
787
|
var argsResult = (0, exports.validateFieldWithResult)(newValue.args.type === 'hash' ? 'system-options' : newValue.args.type, newValue.args.value);
|
|
805
788
|
if (!argsResult.isValid) {
|
|
806
|
-
return withContext(argsResult,
|
|
789
|
+
return withContext(argsResult, words().argumentsInvalid);
|
|
807
790
|
}
|
|
808
791
|
}
|
|
809
792
|
}
|
|
810
793
|
if ((type === 'search-single' || type === 'search') &&
|
|
811
794
|
(0, size_1.default)(newValue.search_args) !== 0 &&
|
|
812
795
|
!(0, exports.validateFieldWithResult)('system-options-with-operators', newValue.search_args).isValid) {
|
|
813
|
-
return invalidResult(
|
|
796
|
+
return invalidResult(words().searchArgumentsInvalid);
|
|
814
797
|
}
|
|
815
798
|
var isUpdateOrCreate = type === 'update' || type === 'create';
|
|
816
799
|
if (isUpdateOrCreate) {
|
|
@@ -821,66 +804,66 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
821
804
|
((0, size_1.default)(newValue["".concat(type, "_args_freeform")]) === 0 ||
|
|
822
805
|
!(0, exports.validateFieldWithResult)('list-of-hashes', newValue["".concat(type, "_args_freeform")]).isValid);
|
|
823
806
|
if ("".concat(type, "_args") in newValue && areNormalArgsInvalid && areFreeFormArgsInvalid) {
|
|
824
|
-
return invalidResult(
|
|
807
|
+
return invalidResult(words().updateCreateArgumentsInvalid);
|
|
825
808
|
}
|
|
826
809
|
if ("".concat(type, "_args_freeform") in newValue && areFreeFormArgsInvalid && areNormalArgsInvalid) {
|
|
827
|
-
return invalidResult(
|
|
810
|
+
return invalidResult(words().updateCreateArgumentsInvalid);
|
|
828
811
|
}
|
|
829
812
|
}
|
|
830
813
|
if ((newValue === null || newValue === void 0 ? void 0 : newValue.type) === 'factory') {
|
|
831
814
|
if (newValue.optionsChanged) {
|
|
832
|
-
return invalidResult(
|
|
815
|
+
return invalidResult(words().factoryOptionsNotSaved);
|
|
833
816
|
}
|
|
834
817
|
var options = true;
|
|
835
818
|
if (newValue.options) {
|
|
836
819
|
options = (0, exports.validateFieldWithResult)('system-options', newValue.options).isValid;
|
|
837
820
|
}
|
|
838
821
|
// Type path and name are required
|
|
839
|
-
return resultFromBoolean(!!(newValue.type && newValue.name && options),
|
|
822
|
+
return resultFromBoolean(!!(newValue.type && newValue.name && options), words().factoryIncomplete);
|
|
840
823
|
}
|
|
841
824
|
if (newValue.record_requires_search_options && newValue.searchOptionsChanged) {
|
|
842
|
-
return invalidResult(
|
|
825
|
+
return invalidResult(words().searchOptionsNotSaved);
|
|
843
826
|
}
|
|
844
827
|
if (newValue.search_options &&
|
|
845
828
|
!(0, exports.validateFieldWithResult)('system-options', newValue.search_options).isValid) {
|
|
846
|
-
return invalidResult(
|
|
829
|
+
return invalidResult(words().searchOptionsInvalid);
|
|
847
830
|
}
|
|
848
|
-
return resultFromBoolean(!!(newValue.type && newValue.name),
|
|
831
|
+
return resultFromBoolean(!!(newValue.type && newValue.name), words().providerTypeAndName);
|
|
849
832
|
}
|
|
850
833
|
case 'context-selector': {
|
|
851
834
|
if ((0, lodash_1.isString)(value)) {
|
|
852
835
|
var cont = value.split(':');
|
|
853
836
|
var contextResult = (0, exports.validateFieldWithResult)('string', cont[0]);
|
|
854
837
|
if (!contextResult.isValid) {
|
|
855
|
-
return withContext(contextResult,
|
|
838
|
+
return withContext(contextResult, words().contextPrefixInvalid);
|
|
856
839
|
}
|
|
857
840
|
var nameResult = (0, exports.validateFieldWithResult)('string', cont[1]);
|
|
858
841
|
if (!nameResult.isValid) {
|
|
859
|
-
return withContext(nameResult,
|
|
842
|
+
return withContext(nameResult, words().contextNameInvalid);
|
|
860
843
|
}
|
|
861
844
|
return validResult();
|
|
862
845
|
}
|
|
863
|
-
return resultFromBoolean(!!(value === null || value === void 0 ? void 0 : value.iface_kind) && !!(value === null || value === void 0 ? void 0 : value.name),
|
|
846
|
+
return resultFromBoolean(!!(value === null || value === void 0 ? void 0 : value.iface_kind) && !!(value === null || value === void 0 ? void 0 : value.name), words().contextSelectorIncomplete);
|
|
864
847
|
}
|
|
865
848
|
case 'service-event': {
|
|
866
849
|
var typeResult = (0, exports.validateFieldWithResult)('type-selector', value);
|
|
867
850
|
if (!typeResult.isValid) {
|
|
868
|
-
return withContext(typeResult,
|
|
851
|
+
return withContext(typeResult, words().serviceEventTypeInvalid);
|
|
869
852
|
}
|
|
870
853
|
if (!(0, size_1.default)(value.handlers) ||
|
|
871
854
|
!(0, every_1.default)(value.handlers, function (handler) { return (handler.type === 'fsm' || handler.type === 'method') && handler.value; })) {
|
|
872
|
-
return invalidResult(
|
|
855
|
+
return invalidResult(words().serviceEventHandlersInvalid);
|
|
873
856
|
}
|
|
874
857
|
return validResult();
|
|
875
858
|
}
|
|
876
859
|
case 'service-events': {
|
|
877
860
|
if (!(0, isArray_1.default)(value) || !(0, size_1.default)(value)) {
|
|
878
|
-
return invalidResult(
|
|
861
|
+
return invalidResult(words().serviceEventRequired);
|
|
879
862
|
}
|
|
880
863
|
for (var i = 0; i < value.length; i++) {
|
|
881
864
|
var serviceEventResult = (0, exports.validateFieldWithResult)('service-event', value[i]);
|
|
882
865
|
if (!serviceEventResult.isValid) {
|
|
883
|
-
return withContext(serviceEventResult,
|
|
866
|
+
return withContext(serviceEventResult, words().serviceEventInvalid(i));
|
|
884
867
|
}
|
|
885
868
|
}
|
|
886
869
|
return validResult();
|
|
@@ -889,27 +872,27 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
889
872
|
if (!(0, exports.validateFieldWithResult)('string', value === null || value === void 0 ? void 0 : value.name).isValid ||
|
|
890
873
|
!(0, exports.validateFieldWithResult)('string', value === null || value === void 0 ? void 0 : value['rest-method']).isValid ||
|
|
891
874
|
!(0, exports.validateFieldWithResult)('string', value === null || value === void 0 ? void 0 : value.auth).isValid) {
|
|
892
|
-
return invalidResult(
|
|
875
|
+
return invalidResult(words().webhookIncomplete);
|
|
893
876
|
}
|
|
894
877
|
if (value.handler) {
|
|
895
878
|
if (value.handler.type !== 'fsm' && value.handler.type !== 'method') {
|
|
896
|
-
return invalidResult(
|
|
879
|
+
return invalidResult(words().webhookHandlerTypeInvalid);
|
|
897
880
|
}
|
|
898
881
|
var handlerResult = (0, exports.validateFieldWithResult)('string', value.handler.value);
|
|
899
882
|
if (!handlerResult.isValid) {
|
|
900
|
-
return withContext(handlerResult,
|
|
883
|
+
return withContext(handlerResult, words().webhookHandlerValueInvalid);
|
|
901
884
|
}
|
|
902
885
|
}
|
|
903
886
|
return validResult();
|
|
904
887
|
}
|
|
905
888
|
case 'service-webhooks': {
|
|
906
889
|
if (!(0, isArray_1.default)(value) || !(0, size_1.default)(value)) {
|
|
907
|
-
return invalidResult(
|
|
890
|
+
return invalidResult(words().webhookRequired);
|
|
908
891
|
}
|
|
909
892
|
for (var i = 0; i < value.length; i++) {
|
|
910
893
|
var webhookResult = (0, exports.validateFieldWithResult)('service-webhook', value[i]);
|
|
911
894
|
if (!webhookResult.isValid) {
|
|
912
|
-
return withContext(webhookResult,
|
|
895
|
+
return withContext(webhookResult, words().serviceWebhookInvalid(i));
|
|
913
896
|
}
|
|
914
897
|
}
|
|
915
898
|
return validResult();
|
|
@@ -937,7 +920,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
937
920
|
parsedData = js_yaml_1.default.load(value);
|
|
938
921
|
}
|
|
939
922
|
catch (e) {
|
|
940
|
-
return invalidResult(
|
|
923
|
+
return invalidResult(words().notYaml);
|
|
941
924
|
}
|
|
942
925
|
}
|
|
943
926
|
/* A FALSY value is not an ABSENT one. `null`, `0`, `false` and `""` are
|
|
@@ -955,7 +938,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
955
938
|
because that is the rule for a REQUIRED text field — a different
|
|
956
939
|
question from whether an untyped field may hold a blank string. */
|
|
957
940
|
if (parsedData === undefined) {
|
|
958
|
-
return invalidResult(
|
|
941
|
+
return invalidResult(words().valueEmpty);
|
|
959
942
|
}
|
|
960
943
|
if (parsedData === null || parsedData === '') {
|
|
961
944
|
return validResult();
|
|
@@ -967,23 +950,23 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
967
950
|
"1" against it — "Value must be an integer", on a value that is one.
|
|
968
951
|
The author saw their field go invalid on the first character they
|
|
969
952
|
typed. */
|
|
970
|
-
return withContext((0, exports.validateFieldWithResult)((0, exports.getTypeFromValue)(parsedData), parsedData),
|
|
953
|
+
return withContext((0, exports.validateFieldWithResult)((0, exports.getTypeFromValue)(parsedData), parsedData), words().autoTypeInvalid);
|
|
971
954
|
}
|
|
972
955
|
case 'processor': {
|
|
973
956
|
if (!value || !value['processor-input-type'] || !value['processor-output-type']) {
|
|
974
|
-
return invalidResult(
|
|
957
|
+
return invalidResult(words().processorTypesRequired);
|
|
975
958
|
}
|
|
976
959
|
// Validate the input and output types
|
|
977
960
|
if (value === null || value === void 0 ? void 0 : value['processor-input-type']) {
|
|
978
961
|
var inputResult = (0, exports.validateFieldWithResult)('type-selector', value === null || value === void 0 ? void 0 : value['processor-input-type']);
|
|
979
962
|
if (!inputResult.isValid) {
|
|
980
|
-
return withContext(inputResult,
|
|
963
|
+
return withContext(inputResult, words().processorInputInvalid);
|
|
981
964
|
}
|
|
982
965
|
}
|
|
983
966
|
if (value === null || value === void 0 ? void 0 : value['processor-output-type']) {
|
|
984
967
|
var outputResult = (0, exports.validateFieldWithResult)('type-selector', value === null || value === void 0 ? void 0 : value['processor-output-type']);
|
|
985
968
|
if (!outputResult.isValid) {
|
|
986
|
-
return withContext(outputResult,
|
|
969
|
+
return withContext(outputResult, words().processorOutputInvalid);
|
|
987
970
|
}
|
|
988
971
|
}
|
|
989
972
|
return validResult();
|
|
@@ -993,23 +976,23 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
993
976
|
// Each mapping must have an outputPath (the target field being mapped)
|
|
994
977
|
// and either an inputPath (source field) or options configured
|
|
995
978
|
if (!(0, isArray_1.default)(value)) {
|
|
996
|
-
return canBeNull ? validResult() : invalidResult(
|
|
979
|
+
return canBeNull ? validResult() : invalidResult(words().processorMappingsNotList);
|
|
997
980
|
}
|
|
998
981
|
for (var i = 0; i < value.length; i++) {
|
|
999
982
|
var mapping = value[i];
|
|
1000
983
|
if (!mapping || !(0, isPlainObject_1.default)(mapping)) {
|
|
1001
|
-
return invalidResult(
|
|
984
|
+
return invalidResult(words().mappingInvalidAt(i));
|
|
1002
985
|
}
|
|
1003
986
|
// outputPath is always required - it identifies which output field is being mapped
|
|
1004
987
|
var outputPathResult = (0, exports.validateFieldWithResult)('string', mapping.outputPath);
|
|
1005
988
|
if (!outputPathResult.isValid) {
|
|
1006
|
-
return withContext(outputPathResult,
|
|
989
|
+
return withContext(outputPathResult, words().mappingOutputPathInvalid(i));
|
|
1007
990
|
}
|
|
1008
991
|
// A mapping must have either an inputPath or options (or both)
|
|
1009
992
|
var hasInputPath = mapping.inputPath && mapping.inputPath !== '';
|
|
1010
993
|
var hasOptions = mapping.options && (0, size_1.default)(mapping.options) > 0;
|
|
1011
994
|
if (!hasInputPath && !hasOptions) {
|
|
1012
|
-
return invalidResult(
|
|
995
|
+
return invalidResult(words().mappingNeedsInput(String(mapping.outputPath)));
|
|
1013
996
|
}
|
|
1014
997
|
}
|
|
1015
998
|
return validResult();
|
|
@@ -1022,12 +1005,12 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1022
1005
|
// "<connection>" — all tools from a connection
|
|
1023
1006
|
// "<connection>/<tool>" — a specific tool from a connection
|
|
1024
1007
|
if (!(0, isArray_1.default)(value)) {
|
|
1025
|
-
return canBeNull ? validResult() : invalidResult(
|
|
1008
|
+
return canBeNull ? validResult() : invalidResult(words().toolCatalogNotList);
|
|
1026
1009
|
}
|
|
1027
1010
|
for (var i = 0; i < value.length; i++) {
|
|
1028
1011
|
var selector = value[i];
|
|
1029
1012
|
if (typeof selector !== 'string' || selector.length === 0) {
|
|
1030
|
-
return invalidResult(
|
|
1013
|
+
return invalidResult(words().toolSelectorAt(i));
|
|
1031
1014
|
}
|
|
1032
1015
|
}
|
|
1033
1016
|
return validResult();
|
|
@@ -1035,67 +1018,67 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1035
1018
|
case 'fsm-list': {
|
|
1036
1019
|
// users call FSMs Qogs: this is said to them
|
|
1037
1020
|
if (!(0, isArray_1.default)(value)) {
|
|
1038
|
-
return invalidResult(
|
|
1021
|
+
return invalidResult(words().qogListNotArray);
|
|
1039
1022
|
}
|
|
1040
1023
|
for (var i = 0; i < value.length; i++) {
|
|
1041
1024
|
var itemResult = (0, exports.validateFieldWithResult)('string', (_f = value[i]) === null || _f === void 0 ? void 0 : _f.name);
|
|
1042
1025
|
if (!itemResult.isValid) {
|
|
1043
|
-
return withContext(itemResult,
|
|
1026
|
+
return withContext(itemResult, words().qogEntryNameInvalid(i));
|
|
1044
1027
|
}
|
|
1045
1028
|
}
|
|
1046
1029
|
return validResult();
|
|
1047
1030
|
}
|
|
1048
1031
|
case 'api-manager': {
|
|
1049
1032
|
if (!value) {
|
|
1050
|
-
return invalidResult(
|
|
1033
|
+
return invalidResult(words().apiManagerMissing);
|
|
1051
1034
|
}
|
|
1052
1035
|
var factoryResult = (0, exports.validateFieldWithResult)('string', value.factory);
|
|
1053
1036
|
if (!factoryResult.isValid) {
|
|
1054
|
-
return withContext(factoryResult,
|
|
1037
|
+
return withContext(factoryResult, words().apiManagerFactoryInvalid);
|
|
1055
1038
|
}
|
|
1056
1039
|
var endpointsResult = (0, exports.validateFieldWithResult)('api-endpoints', value.endpoints);
|
|
1057
1040
|
if (!endpointsResult.isValid) {
|
|
1058
|
-
return withContext(endpointsResult,
|
|
1041
|
+
return withContext(endpointsResult, words().apiManagerEndpointsInvalid);
|
|
1059
1042
|
}
|
|
1060
1043
|
return validResult();
|
|
1061
1044
|
}
|
|
1062
1045
|
case 'api-endpoints': {
|
|
1063
1046
|
if (!(0, isArray_1.default)(value) || !(0, size_1.default)(value)) {
|
|
1064
|
-
return invalidResult(
|
|
1047
|
+
return invalidResult(words().apiEndpointRequired);
|
|
1065
1048
|
}
|
|
1066
1049
|
for (var i = 0; i < value.length; i++) {
|
|
1067
1050
|
var endpointResult = (0, exports.validateFieldWithResult)('string', (_g = value[i]) === null || _g === void 0 ? void 0 : _g.value);
|
|
1068
1051
|
if (!endpointResult.isValid) {
|
|
1069
|
-
return withContext(endpointResult,
|
|
1052
|
+
return withContext(endpointResult, words().endpointValueInvalid(i));
|
|
1070
1053
|
}
|
|
1071
1054
|
var authorizationResult = (0, exports.validateFieldWithResult)('api-endpoint-authorization', (_h = value[i]) === null || _h === void 0 ? void 0 : _h.authorization, undefined, true);
|
|
1072
1055
|
if (!authorizationResult.isValid) {
|
|
1073
|
-
return withContext(authorizationResult,
|
|
1056
|
+
return withContext(authorizationResult, words().endpointAuthorizationInvalid(i));
|
|
1074
1057
|
}
|
|
1075
1058
|
}
|
|
1076
1059
|
return validResult();
|
|
1077
1060
|
}
|
|
1078
1061
|
case 'api-endpoint-authorization': {
|
|
1079
1062
|
if (!value) {
|
|
1080
|
-
return canBeNull ? validResult() : invalidResult(
|
|
1063
|
+
return canBeNull ? validResult() : invalidResult(words().authorizationMissing);
|
|
1081
1064
|
}
|
|
1082
1065
|
if (typeof value !== 'object' || (0, isArray_1.default)(value)) {
|
|
1083
|
-
return invalidResult(
|
|
1066
|
+
return invalidResult(words().authorizationNotObject);
|
|
1084
1067
|
}
|
|
1085
1068
|
if (value.mode !== undefined && !['merge', 'replace'].includes(value.mode)) {
|
|
1086
|
-
return invalidResult(
|
|
1069
|
+
return invalidResult(words().authorizationMode);
|
|
1087
1070
|
}
|
|
1088
1071
|
if (value.allow_anonymous !== undefined && typeof value.allow_anonymous !== 'boolean') {
|
|
1089
|
-
return invalidResult(
|
|
1072
|
+
return invalidResult(words().authorizationAllowAnonymous);
|
|
1090
1073
|
}
|
|
1091
1074
|
if (value.roles !== undefined) {
|
|
1092
1075
|
if (!(0, isArray_1.default)(value.roles)) {
|
|
1093
|
-
return invalidResult(
|
|
1076
|
+
return invalidResult(words().authorizationRolesNotList);
|
|
1094
1077
|
}
|
|
1095
1078
|
for (var i = 0; i < value.roles.length; i++) {
|
|
1096
1079
|
var roleResult = (0, exports.validateFieldWithResult)('string', value.roles[i]);
|
|
1097
1080
|
if (!roleResult.isValid) {
|
|
1098
|
-
return withContext(roleResult,
|
|
1081
|
+
return withContext(roleResult, words().authorizationRoleInvalid(i));
|
|
1099
1082
|
}
|
|
1100
1083
|
}
|
|
1101
1084
|
}
|
|
@@ -1110,7 +1093,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1110
1093
|
if (optionSchema === void 0) { optionSchema = {}; }
|
|
1111
1094
|
if (!options || (0, size_1.default)(options) === 0) {
|
|
1112
1095
|
if (!canBeNull) {
|
|
1113
|
-
return invalidResult(
|
|
1096
|
+
return invalidResult(words().optionsRequired);
|
|
1114
1097
|
}
|
|
1115
1098
|
return validResult();
|
|
1116
1099
|
}
|
|
@@ -1118,7 +1101,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1118
1101
|
var unresolvedRequiredOption = (0, exports.getUnresolvedRequiredOptions)(optionSchema, options)[0];
|
|
1119
1102
|
if (unresolvedRequiredOption) {
|
|
1120
1103
|
return unresolvedRequiredOption.validation
|
|
1121
|
-
? withContext(unresolvedRequiredOption.validation,
|
|
1104
|
+
? withContext(unresolvedRequiredOption.validation, words().optionInvalid(unresolvedRequiredOption.name))
|
|
1122
1105
|
: invalidResult((0, exports.getUnresolvedRequiredOptionReason)(unresolvedRequiredOption, optionSchema));
|
|
1123
1106
|
}
|
|
1124
1107
|
for (var _i = 0, _e = Object.keys(options); _i < _e.length; _i++) {
|
|
@@ -1156,7 +1139,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1156
1139
|
? (0, exports.validateFieldWithResult)((0, exports.getTypeFromValue)(optionData), optionData)
|
|
1157
1140
|
: (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
1141
|
if (!optionResult.isValid) {
|
|
1159
|
-
return withContext(optionResult,
|
|
1142
|
+
return withContext(optionResult, words().optionInvalid(option));
|
|
1160
1143
|
}
|
|
1161
1144
|
}
|
|
1162
1145
|
return validResult();
|
|
@@ -1165,7 +1148,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1165
1148
|
for (var i = 0; i < value.length; i++) {
|
|
1166
1149
|
var optionResult = getIsValid(value[i], field === null || field === void 0 ? void 0 : field.optionSchema);
|
|
1167
1150
|
if (!optionResult.isValid) {
|
|
1168
|
-
return withContext(optionResult,
|
|
1151
|
+
return withContext(optionResult, words().optionSetInvalid(i));
|
|
1169
1152
|
}
|
|
1170
1153
|
}
|
|
1171
1154
|
return validResult();
|
|
@@ -1178,7 +1161,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1178
1161
|
if (canBeNull) {
|
|
1179
1162
|
return validResult();
|
|
1180
1163
|
}
|
|
1181
|
-
return invalidResult(
|
|
1164
|
+
return invalidResult(words().optionsWithOperatorsRequired);
|
|
1182
1165
|
}
|
|
1183
1166
|
for (var _i = 0, _a = Object.keys(val); _i < _a.length; _i++) {
|
|
1184
1167
|
var option = _a[_i];
|
|
@@ -1187,11 +1170,11 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1187
1170
|
? (0, exports.validateFieldWithResult)((0, exports.getTypeFromValue)(optionData), optionData)
|
|
1188
1171
|
: (0, exports.validateFieldWithResult)(optionData.type, optionData.value);
|
|
1189
1172
|
if (!optionResult.isValid) {
|
|
1190
|
-
return withContext(optionResult,
|
|
1173
|
+
return withContext(optionResult, words().optionInvalid(option));
|
|
1191
1174
|
}
|
|
1192
1175
|
if (!optionData.op ||
|
|
1193
1176
|
!(0, common_1.fixOperatorValue)(optionData.op).every(function (operator) { return (0, exports.validateFieldWithResult)('string', operator).isValid; })) {
|
|
1194
|
-
return invalidResult(
|
|
1177
|
+
return invalidResult(words().operatorsInvalid(option));
|
|
1195
1178
|
}
|
|
1196
1179
|
}
|
|
1197
1180
|
return validResult();
|
|
@@ -1200,7 +1183,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1200
1183
|
for (var i = 0; i < value.length; i++) {
|
|
1201
1184
|
var optionResult = isValid(value[i]);
|
|
1202
1185
|
if (!optionResult.isValid) {
|
|
1203
|
-
return withContext(optionResult,
|
|
1186
|
+
return withContext(optionResult, words().optionSetInvalid(i));
|
|
1204
1187
|
}
|
|
1205
1188
|
}
|
|
1206
1189
|
return validResult();
|
|
@@ -1209,15 +1192,15 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1209
1192
|
}
|
|
1210
1193
|
case 'byte-size': {
|
|
1211
1194
|
if (typeof value !== 'string')
|
|
1212
|
-
return invalidResult(
|
|
1195
|
+
return invalidResult(words().byteSizeNotText);
|
|
1213
1196
|
var _t = (0, common_1.splitByteSize)(value), bytes = _t[0], sizeUnit = _t[1];
|
|
1214
1197
|
var bytesResult = (0, exports.validateFieldWithResult)('number', bytes);
|
|
1215
1198
|
if (!bytesResult.isValid) {
|
|
1216
|
-
return withContext(bytesResult,
|
|
1199
|
+
return withContext(bytesResult, words().byteSizeNumberInvalid);
|
|
1217
1200
|
}
|
|
1218
1201
|
var sizeResult = (0, exports.validateFieldWithResult)('string', sizeUnit);
|
|
1219
1202
|
if (!sizeResult.isValid) {
|
|
1220
|
-
return withContext(sizeResult,
|
|
1203
|
+
return withContext(sizeResult, words().byteSizeUnitInvalid);
|
|
1221
1204
|
}
|
|
1222
1205
|
return validResult();
|
|
1223
1206
|
}
|
|
@@ -1226,7 +1209,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1226
1209
|
// so the stored value validates as an int.
|
|
1227
1210
|
var msResult = (0, exports.validateFieldWithResult)('int', value);
|
|
1228
1211
|
if (!msResult.isValid) {
|
|
1229
|
-
return withContext(msResult,
|
|
1212
|
+
return withContext(msResult, words().timeoutMilliseconds);
|
|
1230
1213
|
}
|
|
1231
1214
|
return validResult();
|
|
1232
1215
|
}
|
|
@@ -1234,11 +1217,11 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1234
1217
|
case 'uri': {
|
|
1235
1218
|
var protocolResult = (0, exports.validateFieldWithResult)('string', (0, common_1.getProtocol)(value));
|
|
1236
1219
|
if (!protocolResult.isValid) {
|
|
1237
|
-
return withContext(protocolResult,
|
|
1220
|
+
return withContext(protocolResult, words().urlProtocolInvalid);
|
|
1238
1221
|
}
|
|
1239
1222
|
var addressResult = (0, exports.validateFieldWithResult)('string', (0, common_1.getAddress)(value));
|
|
1240
1223
|
if (!addressResult.isValid) {
|
|
1241
|
-
return withContext(addressResult,
|
|
1224
|
+
return withContext(addressResult, words().urlAddressInvalid);
|
|
1242
1225
|
}
|
|
1243
1226
|
return validResult();
|
|
1244
1227
|
}
|
|
@@ -1246,10 +1229,10 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1246
1229
|
// The minimal NEW_FIELD.md shape check, so malformed definitions can't
|
|
1247
1230
|
// silently save through FormEngine.
|
|
1248
1231
|
if (!(0, isPlainObject_1.default)(value)) {
|
|
1249
|
-
return invalidResult(
|
|
1232
|
+
return invalidResult(words().schemaDefinitionNotObject);
|
|
1250
1233
|
}
|
|
1251
1234
|
if (!(0, isPlainObject_1.default)(value.schema)) {
|
|
1252
|
-
return invalidResult(
|
|
1235
|
+
return invalidResult(words().schemaDefinitionNoSchema);
|
|
1253
1236
|
}
|
|
1254
1237
|
return validResult();
|
|
1255
1238
|
}
|
|
@@ -1271,10 +1254,10 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1271
1254
|
// the field's own "show invalid only" filter listed a different set of
|
|
1272
1255
|
// rows on a fast machine than on a slow one.
|
|
1273
1256
|
if (!castedValue_1) {
|
|
1274
|
-
return invalidResult(
|
|
1257
|
+
return invalidResult(words().expressionEmpty);
|
|
1275
1258
|
}
|
|
1276
1259
|
if (!((_j = castedValue_1.value) === null || _j === void 0 ? void 0 : _j.exp)) {
|
|
1277
|
-
return invalidResult(
|
|
1260
|
+
return invalidResult((0, reqraftLabels_1.reqraftLabels)().expressions.noOperationYet(false));
|
|
1278
1261
|
}
|
|
1279
1262
|
// Everything past this point needs the expression's definition, which
|
|
1280
1263
|
// only the catalogue can supply. Until it loads there is nothing to check
|
|
@@ -1286,7 +1269,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1286
1269
|
// Get the expression definition from the catalogue - a lone template's as the lone value it is (`asLoneValue`)
|
|
1287
1270
|
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
1271
|
if (!expressionDefinition_1) {
|
|
1289
|
-
return invalidResult(
|
|
1272
|
+
return invalidResult(words().noSuchOperation(String((_k = castedValue_1.value) === null || _k === void 0 ? void 0 : _k.exp)));
|
|
1290
1273
|
}
|
|
1291
1274
|
// If the expression has no required args, we can consider it valid
|
|
1292
1275
|
var hasRequiredArgs = (_l = expressionDefinition_1.args) === null || _l === void 0 ? void 0 : _l.some(function (arg) { return arg.required; });
|
|
@@ -1296,7 +1279,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1296
1279
|
// If there are no args provided but the expression requires some (normal expressions require at least 1 arg
|
|
1297
1280
|
// because we checked for required args earlier), or min_args is set
|
|
1298
1281
|
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(
|
|
1282
|
+
return invalidResult(words().notEnoughArguments);
|
|
1300
1283
|
}
|
|
1301
1284
|
// Now we need to validate each argument, either as a normal value or as a sub-expression
|
|
1302
1285
|
var args = (_q = (_p = castedValue_1.value) === null || _p === void 0 ? void 0 : _p.args) !== null && _q !== void 0 ? _q : [];
|
|
@@ -1306,7 +1289,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1306
1289
|
var definition = expressionDefinition_1.varargs
|
|
1307
1290
|
? expressionDefinition_1.args[0]
|
|
1308
1291
|
: 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 :
|
|
1292
|
+
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
1293
|
});
|
|
1311
1294
|
var _loop_1 = function (index) {
|
|
1312
1295
|
var argValue = args[index];
|
|
@@ -1322,10 +1305,11 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1322
1305
|
/* Which operand, where its name alone does not say: every operand of a call taking any number of
|
|
1323
1306
|
them is "Value" (qlip build 20261008-083118: "which "value" is the message mentioning"). Said by
|
|
1324
1307
|
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 (David, qorus#646), as the operands that join it will be.
|
|
1326
|
-
|
|
1308
|
+
can take more (David, qorus#646), as the operands that join it will be. The words say the position
|
|
1309
|
+
their own way ("the 2nd"); it is given only where it is said. */
|
|
1310
|
+
var position = expressionDefinition_1.varargs ||
|
|
1327
1311
|
argLabels.some(function (label, other) { return other !== index && label === argLabel; })
|
|
1328
|
-
?
|
|
1312
|
+
? index + 1
|
|
1329
1313
|
: undefined;
|
|
1330
1314
|
/* An explicit null is a VALUE, and DPQL says so: `null` is a literal
|
|
1331
1315
|
that parses, serializes and round-trips like any other.
|
|
@@ -1353,7 +1337,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1353
1337
|
has_to_have_value: argDefinition === null || argDefinition === void 0 ? void 0 : argDefinition.required,
|
|
1354
1338
|
});
|
|
1355
1339
|
if (!result_1.isValid) {
|
|
1356
|
-
return { value: withContext(result_1,
|
|
1340
|
+
return { value: withContext(result_1, words().operandExpressionHasError(argLabel, position)) };
|
|
1357
1341
|
}
|
|
1358
1342
|
return "continue";
|
|
1359
1343
|
}
|
|
@@ -1376,9 +1360,9 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1376
1360
|
// an operand not filled in yet says what to do; one that is wrong says which and why (David's
|
|
1377
1361
|
// review of qorus#646: "Value for argument 1 ("Value") is invalid: Missing value" while building)
|
|
1378
1362
|
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:
|
|
1363
|
+
return { value: __assign(__assign({}, invalidResult(words().enterOperand(argLabel, position))), { missingOperand: true }) };
|
|
1380
1364
|
}
|
|
1381
|
-
return { value: withContext(result,
|
|
1365
|
+
return { value: withContext(result, words().operandInvalid(argLabel, position)) };
|
|
1382
1366
|
}
|
|
1383
1367
|
};
|
|
1384
1368
|
for (var index = 0; index < args.length; index++) {
|
|
@@ -1389,7 +1373,7 @@ var _validateField = function (type, value, field, canBeNull) {
|
|
|
1389
1373
|
return validResult();
|
|
1390
1374
|
}
|
|
1391
1375
|
case 'nothing':
|
|
1392
|
-
return invalidResult(
|
|
1376
|
+
return invalidResult(words().nothingNotValid);
|
|
1393
1377
|
default:
|
|
1394
1378
|
return validResult();
|
|
1395
1379
|
}
|
|
@@ -1419,6 +1403,9 @@ exports.readArgValue = readArgValue;
|
|
|
1419
1403
|
exports.validateFieldWithResult = (0, lodash_1.memoize)(exports._validateField, function (type, value, field, canBeNull) {
|
|
1420
1404
|
return "".concat(type, "-").concat(JSON.stringify(value), "-").concat(JSON.stringify(field), "-").concat(canBeNull);
|
|
1421
1405
|
});
|
|
1406
|
+
/* A reason kept is worded as it was when it was first asked for: when the host gives other words, the kept reasons
|
|
1407
|
+
are dropped, and the next asking words them again. */
|
|
1408
|
+
(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
1409
|
var validateField = function (type, value, field, canBeNull) {
|
|
1423
1410
|
return (0, exports.validateFieldWithResult)(type, value, field, canBeNull).isValid;
|
|
1424
1411
|
};
|
|
@@ -1526,13 +1513,13 @@ var getUnresolvedRequiredOptionReason = function (_a, optionSchema) {
|
|
|
1526
1513
|
var name = _a.name, reason = _a.reason;
|
|
1527
1514
|
switch (reason) {
|
|
1528
1515
|
case 'dependency':
|
|
1529
|
-
return
|
|
1516
|
+
return words().optionDependenciesNotFulfilled(name);
|
|
1530
1517
|
case 'invalid':
|
|
1531
|
-
return
|
|
1518
|
+
return words().optionInvalid(name);
|
|
1532
1519
|
default:
|
|
1533
1520
|
return ((_b = optionSchema === null || optionSchema === void 0 ? void 0 : optionSchema[name]) === null || _b === void 0 ? void 0 : _b.required)
|
|
1534
|
-
?
|
|
1535
|
-
:
|
|
1521
|
+
? words().optionRequired(name)
|
|
1522
|
+
: words().optionRequiresValue(name);
|
|
1536
1523
|
}
|
|
1537
1524
|
};
|
|
1538
1525
|
exports.getUnresolvedRequiredOptionReason = getUnresolvedRequiredOptionReason;
|