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