@oronts/vendure-data-hub-plugin 0.1.1 → 0.1.3
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/CHANGELOG.md +17 -0
- package/README.md +6 -2
- package/dashboard/gql/gql.ts +6 -6
- package/dashboard/gql/graphql.ts +9 -4
- package/dashboard/hooks/api/use-pipeline-runs.ts +1 -0
- package/dashboard/hooks/api/use-queues.ts +1 -0
- package/dist/dashboard/components/common/ConnectionConfigEditor.tsx +589 -0
- package/dist/dashboard/components/common/HeadersEditor.tsx +90 -0
- package/dist/dashboard/components/common/ValidationFeedback.tsx +17 -0
- package/dist/dashboard/components/common/index.ts +10 -0
- package/dist/dashboard/components/pipelines/PipelineEditor.tsx +504 -0
- package/dist/dashboard/components/pipelines/PipelineExport.tsx +63 -0
- package/dist/dashboard/components/pipelines/PipelineImport.tsx +87 -0
- package/dist/dashboard/components/pipelines/ReactFlowPipelineEditor.tsx +539 -0
- package/dist/dashboard/components/pipelines/shared/NodePropertiesPanel.tsx +146 -0
- package/dist/dashboard/components/pipelines/shared/PipelineNode.tsx +155 -0
- package/dist/dashboard/components/pipelines/shared/PipelineSettingsPanel.tsx +392 -0
- package/dist/dashboard/components/pipelines/shared/StepListItem.tsx +144 -0
- package/dist/dashboard/components/pipelines/shared/index.ts +33 -0
- package/dist/dashboard/components/pipelines/shared/visual-node-config.ts +169 -0
- package/dist/dashboard/components/shared/LoadMoreButton.tsx +18 -0
- package/dist/dashboard/components/shared/entity-selector/EntitySelector.tsx +59 -0
- package/dist/dashboard/components/shared/entity-selector/index.ts +1 -0
- package/dist/dashboard/components/shared/error-boundary/ErrorBoundary.tsx +90 -0
- package/dist/dashboard/components/shared/error-boundary/index.ts +1 -0
- package/dist/dashboard/components/shared/feedback/EmptyState.tsx +36 -0
- package/dist/dashboard/components/shared/feedback/ErrorState.tsx +69 -0
- package/dist/dashboard/components/shared/feedback/LoadingState.tsx +104 -0
- package/dist/dashboard/components/shared/feedback/ValidationErrorDisplay.tsx +29 -0
- package/dist/dashboard/components/shared/feedback/index.ts +4 -0
- package/dist/dashboard/components/shared/file-dropzone/FileDropzone.tsx +167 -0
- package/dist/dashboard/components/shared/file-dropzone/index.ts +1 -0
- package/dist/dashboard/components/shared/filter-conditions-editor/FilterConditionsEditor.tsx +226 -0
- package/dist/dashboard/components/shared/filter-conditions-editor/index.ts +1 -0
- package/dist/dashboard/components/shared/index.ts +45 -0
- package/dist/dashboard/components/shared/schema-form/SchemaFormRenderer.tsx +248 -0
- package/dist/dashboard/components/shared/schema-form/fields/BooleanField.tsx +26 -0
- package/dist/dashboard/components/shared/schema-form/fields/FieldWrapper.tsx +28 -0
- package/dist/dashboard/components/shared/schema-form/fields/FileUploadField.tsx +171 -0
- package/dist/dashboard/components/shared/schema-form/fields/JsonField.tsx +132 -0
- package/dist/dashboard/components/shared/schema-form/fields/NumberField.tsx +33 -0
- package/dist/dashboard/components/shared/schema-form/fields/SelectField.tsx +70 -0
- package/dist/dashboard/components/shared/schema-form/fields/StringField.tsx +36 -0
- package/dist/dashboard/components/shared/schema-form/fields/TextareaField.tsx +31 -0
- package/dist/dashboard/components/shared/schema-form/fields/index.ts +23 -0
- package/dist/dashboard/components/shared/schema-form/index.ts +2 -0
- package/dist/dashboard/components/shared/schema-form/utils.ts +3 -0
- package/dist/dashboard/components/shared/selectable-card/SelectableCard.tsx +65 -0
- package/dist/dashboard/components/shared/selectable-card/index.ts +1 -0
- package/dist/dashboard/components/shared/stat-card/StatCard.tsx +121 -0
- package/dist/dashboard/components/shared/stat-card/index.ts +1 -0
- package/dist/dashboard/components/shared/step-config/AdapterRequiredWarning.tsx +25 -0
- package/dist/dashboard/components/shared/step-config/AdapterSelector.tsx +109 -0
- package/dist/dashboard/components/shared/step-config/AdvancedEditors.tsx +634 -0
- package/dist/dashboard/components/shared/step-config/EnrichConfigComponent.tsx +295 -0
- package/dist/dashboard/components/shared/step-config/ExtractTestResults.tsx +143 -0
- package/dist/dashboard/components/shared/step-config/GateConfigComponent.tsx +127 -0
- package/dist/dashboard/components/shared/step-config/LoadTestResults.tsx +104 -0
- package/dist/dashboard/components/shared/step-config/OperatorCard.tsx +266 -0
- package/dist/dashboard/components/shared/step-config/OperatorCheatSheetButton.tsx +54 -0
- package/dist/dashboard/components/shared/step-config/OperatorFieldInput.tsx +209 -0
- package/dist/dashboard/components/shared/step-config/RetrySettingsComponent.tsx +111 -0
- package/dist/dashboard/components/shared/step-config/RouteConfigComponent.tsx +125 -0
- package/dist/dashboard/components/shared/step-config/StepConfigPanel.tsx +564 -0
- package/dist/dashboard/components/shared/step-config/StepTester.tsx +165 -0
- package/dist/dashboard/components/shared/step-config/TestResultContainer.tsx +57 -0
- package/dist/dashboard/components/shared/step-config/TransformTestResults.tsx +130 -0
- package/dist/dashboard/components/shared/step-config/ValidateConfigComponent.tsx +334 -0
- package/dist/dashboard/components/shared/step-config/index.ts +29 -0
- package/dist/dashboard/components/shared/step-config/step-test-handlers.ts +297 -0
- package/dist/dashboard/components/shared/trigger-config/TriggerForm.tsx +478 -0
- package/dist/dashboard/components/shared/trigger-config/index.ts +1 -0
- package/dist/dashboard/components/shared/triggers-panel/TriggersPanel.tsx +281 -0
- package/dist/dashboard/components/shared/triggers-panel/index.ts +1 -0
- package/dist/dashboard/components/shared/wizard/ConfigurationNameCard.tsx +59 -0
- package/dist/dashboard/components/shared/wizard/SummaryCard.tsx +53 -0
- package/dist/dashboard/components/shared/wizard/WizardFooter.tsx +47 -0
- package/dist/dashboard/components/shared/wizard/WizardProgressBar.tsx +78 -0
- package/dist/dashboard/components/shared/wizard/index.ts +4 -0
- package/dist/dashboard/components/shared/wizard-trigger/TriggerSchemaFields.tsx +128 -0
- package/dist/dashboard/components/shared/wizard-trigger/TriggerSelector.tsx +33 -0
- package/dist/dashboard/components/shared/wizard-trigger/index.ts +2 -0
- package/dist/dashboard/components/templates/TemplateGallery.tsx +210 -0
- package/dist/dashboard/components/templates/TemplatePreview.tsx +214 -0
- package/dist/dashboard/components/templates/index.ts +4 -0
- package/dist/dashboard/components/wizards/export-wizard/DestinationStep.tsx +207 -0
- package/dist/dashboard/components/wizards/export-wizard/ExportWizard.tsx +221 -0
- package/dist/dashboard/components/wizards/export-wizard/FieldsStep.tsx +159 -0
- package/dist/dashboard/components/wizards/export-wizard/FormatStep.tsx +246 -0
- package/dist/dashboard/components/wizards/export-wizard/ReviewStep.tsx +231 -0
- package/dist/dashboard/components/wizards/export-wizard/SourceStep.tsx +154 -0
- package/dist/dashboard/components/wizards/export-wizard/TriggerStep.tsx +234 -0
- package/dist/dashboard/components/wizards/export-wizard/constants.ts +73 -0
- package/dist/dashboard/components/wizards/export-wizard/index.ts +2 -0
- package/dist/dashboard/components/wizards/export-wizard/types.ts +39 -0
- package/dist/dashboard/components/wizards/import-wizard/ImportWizard.tsx +350 -0
- package/dist/dashboard/components/wizards/import-wizard/MappingStep.tsx +286 -0
- package/dist/dashboard/components/wizards/import-wizard/PreviewStep.tsx +79 -0
- package/dist/dashboard/components/wizards/import-wizard/ReviewStep.tsx +266 -0
- package/dist/dashboard/components/wizards/import-wizard/SourceStep.tsx +537 -0
- package/dist/dashboard/components/wizards/import-wizard/StrategyStep.tsx +328 -0
- package/dist/dashboard/components/wizards/import-wizard/TargetStep.tsx +76 -0
- package/dist/dashboard/components/wizards/import-wizard/TemplateStep.tsx +116 -0
- package/dist/dashboard/components/wizards/import-wizard/TransformStep.tsx +666 -0
- package/dist/dashboard/components/wizards/import-wizard/TriggerStep.tsx +51 -0
- package/dist/dashboard/components/wizards/import-wizard/constants.ts +104 -0
- package/dist/dashboard/components/wizards/import-wizard/index.ts +3 -0
- package/dist/dashboard/components/wizards/import-wizard/types.ts +35 -0
- package/dist/dashboard/components/wizards/index.ts +7 -0
- package/dist/dashboard/components/wizards/shared/WizardStepContainer.tsx +27 -0
- package/dist/dashboard/components/wizards/shared/constants.ts +16 -0
- package/dist/dashboard/components/wizards/shared/index.ts +10 -0
- package/dist/dashboard/constants/colors.ts +25 -0
- package/dist/dashboard/constants/connection-defaults.ts +7 -0
- package/dist/dashboard/constants/connection-types.ts +1 -0
- package/dist/dashboard/constants/defaults.ts +18 -0
- package/dist/dashboard/constants/editor.ts +69 -0
- package/dist/dashboard/constants/enum-maps.ts +18 -0
- package/dist/dashboard/constants/fallbacks.ts +44 -0
- package/dist/dashboard/constants/file-format-registry.ts +206 -0
- package/dist/dashboard/constants/index.ts +24 -0
- package/dist/dashboard/constants/navigation.ts +29 -0
- package/dist/dashboard/constants/permissions.ts +41 -0
- package/dist/dashboard/constants/placeholders.ts +77 -0
- package/dist/dashboard/constants/routes.ts +12 -0
- package/dist/dashboard/constants/run-status.ts +1 -0
- package/dist/dashboard/constants/sentinel-values.ts +12 -0
- package/dist/dashboard/constants/step-configs.ts +9 -0
- package/dist/dashboard/constants/step-mappings.ts +170 -0
- package/dist/dashboard/constants/steps.ts +37 -0
- package/dist/dashboard/constants/toast-messages.ts +149 -0
- package/dist/dashboard/constants/triggers.ts +5 -0
- package/dist/dashboard/constants/ui-config.ts +139 -0
- package/dist/dashboard/constants/ui-dimensions.ts +145 -0
- package/dist/dashboard/constants/ui-states.ts +28 -0
- package/dist/dashboard/constants/ui-types.ts +85 -0
- package/dist/dashboard/constants/validation-patterns.ts +26 -0
- package/dist/dashboard/gql/gql.ts +370 -0
- package/dist/dashboard/gql/graphql.ts +10383 -0
- package/dist/dashboard/gql/index.ts +1 -0
- package/dist/dashboard/hooks/api/index.ts +115 -0
- package/dist/dashboard/hooks/api/mutation-helpers.ts +34 -0
- package/dist/dashboard/hooks/api/use-adapters.ts +92 -0
- package/dist/dashboard/hooks/api/use-config-options.ts +513 -0
- package/dist/dashboard/hooks/api/use-connections.ts +84 -0
- package/dist/dashboard/hooks/api/use-entity-field-schemas.ts +99 -0
- package/dist/dashboard/hooks/api/use-entity-loaders.ts +45 -0
- package/dist/dashboard/hooks/api/use-hooks.ts +68 -0
- package/dist/dashboard/hooks/api/use-logs.ts +102 -0
- package/dist/dashboard/hooks/api/use-pipeline-runs.ts +222 -0
- package/dist/dashboard/hooks/api/use-pipelines.ts +279 -0
- package/dist/dashboard/hooks/api/use-queues.ts +142 -0
- package/dist/dashboard/hooks/api/use-secrets.ts +75 -0
- package/dist/dashboard/hooks/api/use-settings.ts +55 -0
- package/dist/dashboard/hooks/api/use-step-tester.ts +79 -0
- package/dist/dashboard/hooks/index.ts +13 -0
- package/dist/dashboard/hooks/use-adapter-catalog.ts +253 -0
- package/dist/dashboard/hooks/use-export-templates.ts +80 -0
- package/dist/dashboard/hooks/use-import-templates.ts +139 -0
- package/dist/dashboard/hooks/use-load-more.ts +29 -0
- package/dist/dashboard/hooks/use-stable-keys.ts +54 -0
- package/dist/dashboard/hooks/use-trigger-types.ts +100 -0
- package/dist/dashboard/hooks/use-wizard-navigation.ts +128 -0
- package/dist/dashboard/index.tsx +55 -0
- package/dist/dashboard/routes/adapters/AdapterCard.tsx +102 -0
- package/dist/dashboard/routes/adapters/AdapterConstants.tsx +20 -0
- package/dist/dashboard/routes/adapters/AdapterDetail.tsx +208 -0
- package/dist/dashboard/routes/adapters/AdapterTypeSection.tsx +105 -0
- package/dist/dashboard/routes/adapters/AdaptersPage.tsx +276 -0
- package/dist/dashboard/routes/adapters/AdaptersTable.tsx +107 -0
- package/dist/dashboard/routes/adapters/index.ts +1 -0
- package/dist/dashboard/routes/connections/ConnectionDetail.tsx +218 -0
- package/dist/dashboard/routes/connections/ConnectionsList.tsx +34 -0
- package/dist/dashboard/routes/connections/index.ts +2 -0
- package/dist/dashboard/routes/hooks/Hooks.tsx +425 -0
- package/dist/dashboard/routes/hooks/hook-stages.ts +52 -0
- package/dist/dashboard/routes/hooks/index.ts +1 -0
- package/dist/dashboard/routes/index.ts +8 -0
- package/dist/dashboard/routes/logs/Logs.tsx +93 -0
- package/dist/dashboard/routes/logs/components/LogDetailDrawer.tsx +118 -0
- package/dist/dashboard/routes/logs/components/LogExplorerTab.tsx +367 -0
- package/dist/dashboard/routes/logs/components/LogLevelBadge.tsx +34 -0
- package/dist/dashboard/routes/logs/components/LogTableRow.tsx +70 -0
- package/dist/dashboard/routes/logs/components/LogsOverviewTab.tsx +178 -0
- package/dist/dashboard/routes/logs/components/RealtimeLogTab.tsx +122 -0
- package/dist/dashboard/routes/logs/index.ts +1 -0
- package/dist/dashboard/routes/pipelines/ErrorAuditList.tsx +39 -0
- package/dist/dashboard/routes/pipelines/ExportWizardPage.tsx +96 -0
- package/dist/dashboard/routes/pipelines/ImportWizardPage.tsx +104 -0
- package/dist/dashboard/routes/pipelines/PipelineDetail.tsx +211 -0
- package/dist/dashboard/routes/pipelines/PipelineRunsBlock.tsx +377 -0
- package/dist/dashboard/routes/pipelines/PipelinesList.tsx +87 -0
- package/dist/dashboard/routes/pipelines/RetryPatchHelper.tsx +51 -0
- package/dist/dashboard/routes/pipelines/RunDetailsPanel.tsx +238 -0
- package/dist/dashboard/routes/pipelines/RunErrorsList.tsx +116 -0
- package/dist/dashboard/routes/pipelines/StepCounters.tsx +24 -0
- package/dist/dashboard/routes/pipelines/StepSummaryTable.tsx +36 -0
- package/dist/dashboard/routes/pipelines/components/DryRunDialog.tsx +341 -0
- package/dist/dashboard/routes/pipelines/components/PipelineActionButtons.tsx +201 -0
- package/dist/dashboard/routes/pipelines/components/PipelineEditorToggle.tsx +116 -0
- package/dist/dashboard/routes/pipelines/components/PipelineFormFields.tsx +156 -0
- package/dist/dashboard/routes/pipelines/components/PipelineWebhookInfo.tsx +111 -0
- package/dist/dashboard/routes/pipelines/components/ReviewActionsPanel.tsx +342 -0
- package/dist/dashboard/routes/pipelines/components/ValidationPanel.tsx +121 -0
- package/dist/dashboard/routes/pipelines/components/VersionHistoryDialog.tsx +131 -0
- package/dist/dashboard/routes/pipelines/components/index.ts +25 -0
- package/dist/dashboard/routes/pipelines/hooks/index.ts +1 -0
- package/dist/dashboard/routes/pipelines/hooks/use-pipeline-validation.ts +114 -0
- package/dist/dashboard/routes/pipelines/index.ts +4 -0
- package/dist/dashboard/routes/pipelines/utils/index.ts +1 -0
- package/dist/dashboard/routes/pipelines/utils/pipeline-conversion.ts +261 -0
- package/dist/dashboard/routes/queues/ConsumersTable.tsx +134 -0
- package/dist/dashboard/routes/queues/DeadLettersTable.tsx +118 -0
- package/dist/dashboard/routes/queues/FailedRunsTable.tsx +74 -0
- package/dist/dashboard/routes/queues/QueuesPage.tsx +290 -0
- package/dist/dashboard/routes/queues/index.ts +1 -0
- package/dist/dashboard/routes/queues/types.ts +22 -0
- package/dist/dashboard/routes/secrets/SecretDetail.tsx +278 -0
- package/dist/dashboard/routes/secrets/SecretsList.tsx +34 -0
- package/dist/dashboard/routes/secrets/index.ts +2 -0
- package/dist/dashboard/routes/settings/Settings.tsx +343 -0
- package/dist/dashboard/routes/settings/index.ts +1 -0
- package/dist/dashboard/types/index.ts +89 -0
- package/dist/dashboard/types/pipeline.ts +51 -0
- package/dist/dashboard/types/ui-types.ts +400 -0
- package/dist/dashboard/types/wizard.ts +235 -0
- package/dist/dashboard/utils/adapter-grouping.ts +43 -0
- package/dist/dashboard/utils/column-analysis.ts +11 -0
- package/dist/dashboard/utils/field-preparation.ts +31 -0
- package/dist/dashboard/utils/form-validation.ts +373 -0
- package/dist/dashboard/utils/formatters.ts +92 -0
- package/dist/dashboard/utils/icon-resolver.ts +35 -0
- package/dist/dashboard/utils/index.ts +60 -0
- package/dist/dashboard/utils/query-key-factory.ts +54 -0
- package/dist/dashboard/utils/step-helpers.ts +32 -0
- package/dist/dashboard/utils/string-helpers.ts +4 -0
- package/dist/dashboard/utils/template-helpers.ts +26 -0
- package/dist/dashboard/utils/trigger-sync.ts +138 -0
- package/dist/dashboard/utils/wizard-to-pipeline.ts +569 -0
- package/dist/shared/types/adapter-config.types.d.ts +254 -11
- package/dist/shared/types/adapter-config.types.d.ts.map +1 -1
- package/dist/shared/types/index.d.ts +1 -1
- package/dist/shared/types/index.d.ts.map +1 -1
- package/dist/shared/types/index.js.map +1 -1
- package/dist/shared/utils/error.d.ts +5 -0
- package/dist/shared/utils/error.d.ts.map +1 -1
- package/dist/shared/utils/error.js +11 -0
- package/dist/shared/utils/error.js.map +1 -1
- package/dist/src/api/schema/pipeline.schema.d.ts +1 -1
- package/dist/src/api/schema/pipeline.schema.d.ts.map +1 -1
- package/dist/src/api/schema/pipeline.schema.js +2 -0
- package/dist/src/api/schema/pipeline.schema.js.map +1 -1
- package/dist/src/bootstrap/initialization.d.ts.map +1 -1
- package/dist/src/bootstrap/initialization.js +6 -0
- package/dist/src/bootstrap/initialization.js.map +1 -1
- package/dist/src/entities/data/error-record.entity.d.ts +1 -0
- package/dist/src/entities/data/error-record.entity.d.ts.map +1 -1
- package/dist/src/entities/data/error-record.entity.js +4 -0
- package/dist/src/entities/data/error-record.entity.js.map +1 -1
- package/dist/src/gql/generated.d.ts +5 -0
- package/dist/src/gql/generated.d.ts.map +1 -1
- package/dist/src/gql/generated.js.map +1 -1
- package/dist/src/loaders/inventory/inventory.loader.d.ts.map +1 -1
- package/dist/src/loaders/inventory/inventory.loader.js +1 -2
- package/dist/src/loaders/inventory/inventory.loader.js.map +1 -1
- package/dist/src/runtime/executor-types.d.ts +3 -2
- package/dist/src/runtime/executor-types.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/asset-handler.js +1 -1
- package/dist/src/runtime/executors/loaders/asset-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/asset-import-handler.js +1 -1
- package/dist/src/runtime/executors/loaders/asset-import-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/channel-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/channel-handler.js +14 -1
- package/dist/src/runtime/executors/loaders/channel-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/collection-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/collection-handler.js +22 -3
- package/dist/src/runtime/executors/loaders/collection-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/customer-group-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/customer-group-handler.js +8 -1
- package/dist/src/runtime/executors/loaders/customer-group-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/customer-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/customer-handler.js +33 -2
- package/dist/src/runtime/executors/loaders/customer-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/facet-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/facet-handler.js +34 -2
- package/dist/src/runtime/executors/loaders/facet-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/graphql-mutation-handler.js +1 -1
- package/dist/src/runtime/executors/loaders/graphql-mutation-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/inventory-adjust-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/inventory-adjust-handler.js +8 -1
- package/dist/src/runtime/executors/loaders/inventory-adjust-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/inventory-handler.js +3 -3
- package/dist/src/runtime/executors/loaders/inventory-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/loader-handler-registry.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/loader-handler-registry.js +35 -10
- package/dist/src/runtime/executors/loaders/loader-handler-registry.js.map +1 -1
- package/dist/src/runtime/executors/loaders/order-handler.d.ts +1 -1
- package/dist/src/runtime/executors/loaders/order-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/order-handler.js +7 -4
- package/dist/src/runtime/executors/loaders/order-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/payment-method-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/payment-method-handler.js +14 -1
- package/dist/src/runtime/executors/loaders/payment-method-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/product-handler.d.ts +6 -0
- package/dist/src/runtime/executors/loaders/product-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/product-handler.js +31 -13
- package/dist/src/runtime/executors/loaders/product-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/promotion-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/promotion-handler.js +21 -2
- package/dist/src/runtime/executors/loaders/promotion-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/rest-handler.js +1 -1
- package/dist/src/runtime/executors/loaders/rest-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/shared-lookups.d.ts +28 -1
- package/dist/src/runtime/executors/loaders/shared-lookups.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/shared-lookups.js +136 -0
- package/dist/src/runtime/executors/loaders/shared-lookups.js.map +1 -1
- package/dist/src/runtime/executors/loaders/shipping-method-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/shipping-method-handler.js +8 -1
- package/dist/src/runtime/executors/loaders/shipping-method-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/stock-location-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/stock-location-handler.js +8 -1
- package/dist/src/runtime/executors/loaders/stock-location-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/tax-rate-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/tax-rate-handler.js +14 -1
- package/dist/src/runtime/executors/loaders/tax-rate-handler.js.map +1 -1
- package/dist/src/runtime/executors/loaders/types.d.ts +2 -0
- package/dist/src/runtime/executors/loaders/types.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/variant-handler.d.ts +24 -2
- package/dist/src/runtime/executors/loaders/variant-handler.d.ts.map +1 -1
- package/dist/src/runtime/executors/loaders/variant-handler.js +190 -44
- package/dist/src/runtime/executors/loaders/variant-handler.js.map +1 -1
- package/dist/src/runtime/executors/sink-handler-registry.js +2 -2
- package/dist/src/runtime/executors/sink-handler-registry.js.map +1 -1
- package/dist/src/services/data/record-error.service.d.ts +1 -1
- package/dist/src/services/data/record-error.service.d.ts.map +1 -1
- package/dist/src/services/data/record-error.service.js +4 -1
- package/dist/src/services/data/record-error.service.js.map +1 -1
- package/dist/src/services/logger/execution-logger.d.ts +1 -1
- package/dist/src/services/logger/execution-logger.d.ts.map +1 -1
- package/dist/src/services/logger/execution-logger.js +8 -4
- package/dist/src/services/logger/execution-logger.js.map +1 -1
- package/dist/src/services/pipeline/pipeline-runner.service.d.ts.map +1 -1
- package/dist/src/services/pipeline/pipeline-runner.service.js +3 -3
- package/dist/src/services/pipeline/pipeline-runner.service.js.map +1 -1
- package/dist/src/utils/error.utils.d.ts +1 -1
- package/dist/src/utils/error.utils.d.ts.map +1 -1
- package/dist/src/utils/error.utils.js +2 -1
- package/dist/src/utils/error.utils.js.map +1 -1
- package/dist/src/utils/url-security.utils.d.ts +5 -3
- package/dist/src/utils/url-security.utils.d.ts.map +1 -1
- package/dist/src/utils/url-security.utils.js +20 -4
- package/dist/src/utils/url-security.utils.js.map +1 -1
- package/docs/reference/loaders.md +39 -2
- package/package.json +2 -2
- package/shared/types/adapter-config.types.ts +278 -9
- package/shared/types/index.ts +13 -0
- package/shared/utils/error.ts +11 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCallback, useMemo } from 'react';
|
|
3
|
+
import {
|
|
4
|
+
Card,
|
|
5
|
+
CardContent,
|
|
6
|
+
CardHeader,
|
|
7
|
+
CardTitle,
|
|
8
|
+
Label,
|
|
9
|
+
Input,
|
|
10
|
+
Switch,
|
|
11
|
+
Select,
|
|
12
|
+
SelectContent,
|
|
13
|
+
SelectItem,
|
|
14
|
+
SelectTrigger,
|
|
15
|
+
SelectValue,
|
|
16
|
+
Button,
|
|
17
|
+
Badge,
|
|
18
|
+
} from '@vendure/dashboard';
|
|
19
|
+
import { Trash2, Calendar } from 'lucide-react';
|
|
20
|
+
import type { PipelineTrigger, TriggerType, TriggerFormProps } from '../../../types';
|
|
21
|
+
import { SELECT_WIDTHS } from '../../../constants';
|
|
22
|
+
import {
|
|
23
|
+
useConfigOptions,
|
|
24
|
+
useTriggerTypes,
|
|
25
|
+
useTriggerIconResolver,
|
|
26
|
+
type TypedOptionValue,
|
|
27
|
+
type ConfigOptionValue,
|
|
28
|
+
type ConnectionSchemaField,
|
|
29
|
+
} from '../../../hooks';
|
|
30
|
+
import { screamingSnakeToKebab } from '../../../../shared/utils/string-case';
|
|
31
|
+
import { getNestedValue } from '../../../../shared/utils/object-path';
|
|
32
|
+
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// Nested path helpers
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
|
|
37
|
+
/** Set a value on a trigger object using a dot-notation path, preserving existing nested values */
|
|
38
|
+
function setNestedValue(trigger: PipelineTrigger, path: string, value: unknown): PipelineTrigger {
|
|
39
|
+
const parts = path.split('.');
|
|
40
|
+
if (parts.length === 1) {
|
|
41
|
+
return { ...trigger, [parts[0]]: value };
|
|
42
|
+
}
|
|
43
|
+
// For nested paths like 'message.queueType', merge into the nested object
|
|
44
|
+
const rootKey = parts[0];
|
|
45
|
+
const nestedKey = parts.slice(1).join('.');
|
|
46
|
+
const existingNested = (trigger as Record<string, unknown>)[rootKey];
|
|
47
|
+
const nestedObj = typeof existingNested === 'object' && existingNested != null
|
|
48
|
+
? { ...existingNested as Record<string, unknown> }
|
|
49
|
+
: {};
|
|
50
|
+
|
|
51
|
+
if (nestedKey.includes('.')) {
|
|
52
|
+
// Recursive for deeper nesting (unlikely but safe)
|
|
53
|
+
setDeep(nestedObj, nestedKey, value);
|
|
54
|
+
} else {
|
|
55
|
+
nestedObj[nestedKey] = value;
|
|
56
|
+
}
|
|
57
|
+
return { ...trigger, [rootKey]: nestedObj };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function setDeep(obj: Record<string, unknown>, path: string, value: unknown): void {
|
|
61
|
+
const parts = path.split('.');
|
|
62
|
+
let current = obj;
|
|
63
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
64
|
+
const key = parts[i];
|
|
65
|
+
if (typeof current[key] !== 'object' || current[key] == null) {
|
|
66
|
+
current[key] = {};
|
|
67
|
+
}
|
|
68
|
+
current = current[key] as Record<string, unknown>;
|
|
69
|
+
}
|
|
70
|
+
current[parts[parts.length - 1]] = value;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
// Option resolution
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
|
|
77
|
+
type ConfigOptionsData = Record<string, ConfigOptionValue[] | unknown>;
|
|
78
|
+
|
|
79
|
+
/** Resolve optionsRef to the actual option list from configOptions data */
|
|
80
|
+
function resolveOptions(
|
|
81
|
+
field: ConnectionSchemaField,
|
|
82
|
+
configData: ConfigOptionsData | undefined,
|
|
83
|
+
fallbacks: Record<string, ConfigOptionValue[]>,
|
|
84
|
+
): ConfigOptionValue[] {
|
|
85
|
+
// Static options on the field itself take priority
|
|
86
|
+
if (field.options && field.options.length > 0) {
|
|
87
|
+
return field.options.map(o => ({ value: o.value, label: o.label }));
|
|
88
|
+
}
|
|
89
|
+
if (!field.optionsRef) return [];
|
|
90
|
+
|
|
91
|
+
const ref = field.optionsRef;
|
|
92
|
+
const backendOptions = configData?.[ref];
|
|
93
|
+
if (Array.isArray(backendOptions) && backendOptions.length > 0) {
|
|
94
|
+
return (backendOptions as ConfigOptionValue[]).filter(o => o.value !== '');
|
|
95
|
+
}
|
|
96
|
+
return (fallbacks[ref] ?? []).filter(o => o.value !== '');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
// Schema-driven field renderer
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
|
|
103
|
+
function SchemaDrivenFields({
|
|
104
|
+
trigger,
|
|
105
|
+
schema,
|
|
106
|
+
configData,
|
|
107
|
+
secretCodes,
|
|
108
|
+
onChange,
|
|
109
|
+
readOnly,
|
|
110
|
+
}: {
|
|
111
|
+
trigger: PipelineTrigger;
|
|
112
|
+
schema: TypedOptionValue;
|
|
113
|
+
configData: ConfigOptionsData | undefined;
|
|
114
|
+
secretCodes: string[];
|
|
115
|
+
onChange: (trigger: PipelineTrigger) => void;
|
|
116
|
+
readOnly: boolean;
|
|
117
|
+
}) {
|
|
118
|
+
if (schema.fields.length === 0) return null;
|
|
119
|
+
|
|
120
|
+
const keyMap = schema.configKeyMap ?? {};
|
|
121
|
+
const triggerRecord = trigger as Record<string, unknown>;
|
|
122
|
+
|
|
123
|
+
const optionFallbacks: Record<string, ConfigOptionValue[]> = {};
|
|
124
|
+
|
|
125
|
+
const handleFieldChange = (field: ConnectionSchemaField, rawValue: unknown) => {
|
|
126
|
+
const pipelinePath = (keyMap as Record<string, string>)[field.key] ?? field.key;
|
|
127
|
+
const fieldType = field.type.toLowerCase();
|
|
128
|
+
|
|
129
|
+
let value = rawValue;
|
|
130
|
+
if (fieldType === 'number') {
|
|
131
|
+
const parsed = Number(rawValue);
|
|
132
|
+
value = Number.isFinite(parsed) ? parsed : field.defaultValue ?? 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
onChange(setNestedValue(trigger, pipelinePath, value));
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const getFieldValue = (field: ConnectionSchemaField): unknown => {
|
|
139
|
+
const pipelinePath = (keyMap as Record<string, string>)[field.key] ?? field.key;
|
|
140
|
+
return getNestedValue(triggerRecord, pipelinePath);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/** Secret-type fields are hidden when the trigger has no authentication configured */
|
|
144
|
+
const isSecretFieldVisible = (field: ConnectionSchemaField): boolean => {
|
|
145
|
+
if (field.type.toLowerCase() !== 'secret') return true;
|
|
146
|
+
const auth = triggerRecord['authentication'];
|
|
147
|
+
return auth != null && auth !== '' && auth !== 'NONE';
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const typeSuffix = screamingSnakeToKebab(trigger.type);
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<div className="space-y-4 border-t pt-4" data-testid={`datahub-triggerform-field-${typeSuffix}`}>
|
|
154
|
+
{schema.fields.map(field => {
|
|
155
|
+
if (!isSecretFieldVisible(field)) return null;
|
|
156
|
+
|
|
157
|
+
const fieldType = field.type.toLowerCase();
|
|
158
|
+
const currentValue = getFieldValue(field);
|
|
159
|
+
const options = resolveOptions(field, configData, optionFallbacks);
|
|
160
|
+
|
|
161
|
+
// String field with optionsRef='cronPresets' renders a side-by-side presets picker
|
|
162
|
+
if (fieldType === 'string' && field.optionsRef === 'cronPresets') {
|
|
163
|
+
return (
|
|
164
|
+
<div key={field.key} className="space-y-2">
|
|
165
|
+
<Label>{field.label}{field.required ? ' *' : ''}</Label>
|
|
166
|
+
<div className="flex gap-2">
|
|
167
|
+
<Input
|
|
168
|
+
value={String(currentValue ?? '')}
|
|
169
|
+
onChange={(e) => handleFieldChange(field, e.target.value)}
|
|
170
|
+
placeholder={field.placeholder ?? undefined}
|
|
171
|
+
disabled={readOnly}
|
|
172
|
+
className="font-mono"
|
|
173
|
+
/>
|
|
174
|
+
<Select
|
|
175
|
+
value=""
|
|
176
|
+
onValueChange={(v) => handleFieldChange(field, v)}
|
|
177
|
+
disabled={readOnly}
|
|
178
|
+
>
|
|
179
|
+
<SelectTrigger className={SELECT_WIDTHS.TRIGGER_TYPE}>
|
|
180
|
+
<Calendar className="h-4 w-4 mr-2" />
|
|
181
|
+
<span>Presets</span>
|
|
182
|
+
</SelectTrigger>
|
|
183
|
+
<SelectContent>
|
|
184
|
+
{options.map((p) => (
|
|
185
|
+
<SelectItem key={p.value} value={p.value}>
|
|
186
|
+
{p.label}
|
|
187
|
+
</SelectItem>
|
|
188
|
+
))}
|
|
189
|
+
</SelectContent>
|
|
190
|
+
</Select>
|
|
191
|
+
</div>
|
|
192
|
+
{field.description && (
|
|
193
|
+
<p className="text-xs text-muted-foreground">{field.description}</p>
|
|
194
|
+
)}
|
|
195
|
+
</div>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Select fields (with optionsRef or static options)
|
|
200
|
+
if (fieldType === 'select') {
|
|
201
|
+
const selectValue = String(currentValue ?? field.defaultValue ?? '');
|
|
202
|
+
const hasCategories = options.some(o => o.category);
|
|
203
|
+
|
|
204
|
+
if (hasCategories) {
|
|
205
|
+
// Group options by category (e.g. vendureEvents)
|
|
206
|
+
const grouped: Record<string, ConfigOptionValue[]> = {};
|
|
207
|
+
for (const opt of options) {
|
|
208
|
+
const cat = opt.category || 'Other';
|
|
209
|
+
if (!grouped[cat]) grouped[cat] = [];
|
|
210
|
+
grouped[cat].push(opt);
|
|
211
|
+
}
|
|
212
|
+
return (
|
|
213
|
+
<div key={field.key} className="space-y-2">
|
|
214
|
+
<Label>{field.label}{field.required ? ' *' : ''}</Label>
|
|
215
|
+
<Select
|
|
216
|
+
value={selectValue}
|
|
217
|
+
onValueChange={(v) => handleFieldChange(field, v)}
|
|
218
|
+
disabled={readOnly}
|
|
219
|
+
>
|
|
220
|
+
<SelectTrigger>
|
|
221
|
+
<SelectValue placeholder={field.placeholder ?? `Select ${field.label}`} />
|
|
222
|
+
</SelectTrigger>
|
|
223
|
+
<SelectContent>
|
|
224
|
+
{Object.entries(grouped).map(([category, catOptions]) => (
|
|
225
|
+
<React.Fragment key={category}>
|
|
226
|
+
<div className="px-2 py-1 text-xs font-semibold text-muted-foreground">
|
|
227
|
+
{category}
|
|
228
|
+
</div>
|
|
229
|
+
{catOptions.map((opt) => (
|
|
230
|
+
<SelectItem key={opt.value} value={opt.value}>
|
|
231
|
+
{opt.label}
|
|
232
|
+
</SelectItem>
|
|
233
|
+
))}
|
|
234
|
+
</React.Fragment>
|
|
235
|
+
))}
|
|
236
|
+
</SelectContent>
|
|
237
|
+
</Select>
|
|
238
|
+
{field.description && (
|
|
239
|
+
<p className="text-xs text-muted-foreground">{field.description}</p>
|
|
240
|
+
)}
|
|
241
|
+
</div>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return (
|
|
246
|
+
<div key={field.key} className="space-y-2">
|
|
247
|
+
<Label>{field.label}{field.required ? ' *' : ''}</Label>
|
|
248
|
+
<Select
|
|
249
|
+
value={selectValue}
|
|
250
|
+
onValueChange={(v) => handleFieldChange(field, v)}
|
|
251
|
+
disabled={readOnly}
|
|
252
|
+
>
|
|
253
|
+
<SelectTrigger>
|
|
254
|
+
<SelectValue placeholder={field.placeholder ?? `Select ${field.label}`} />
|
|
255
|
+
</SelectTrigger>
|
|
256
|
+
<SelectContent>
|
|
257
|
+
{options.map((opt) => (
|
|
258
|
+
<SelectItem key={opt.value} value={opt.value}>
|
|
259
|
+
<div className="flex flex-col">
|
|
260
|
+
<span>{opt.label}</span>
|
|
261
|
+
{opt.description && (
|
|
262
|
+
<span className="text-xs text-muted-foreground">{opt.description}</span>
|
|
263
|
+
)}
|
|
264
|
+
</div>
|
|
265
|
+
</SelectItem>
|
|
266
|
+
))}
|
|
267
|
+
</SelectContent>
|
|
268
|
+
</Select>
|
|
269
|
+
{field.description && (
|
|
270
|
+
<p className="text-xs text-muted-foreground">{field.description}</p>
|
|
271
|
+
)}
|
|
272
|
+
</div>
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Secret reference fields (select from secretCodes prop)
|
|
277
|
+
if (fieldType === 'secret') {
|
|
278
|
+
return (
|
|
279
|
+
<div key={field.key} className="space-y-2">
|
|
280
|
+
<Label>{field.label}{field.required ? ' *' : ''}</Label>
|
|
281
|
+
<Select
|
|
282
|
+
value={String(currentValue ?? '')}
|
|
283
|
+
onValueChange={(v) => handleFieldChange(field, v)}
|
|
284
|
+
disabled={readOnly}
|
|
285
|
+
>
|
|
286
|
+
<SelectTrigger>
|
|
287
|
+
<SelectValue placeholder={field.placeholder ?? 'Select secret...'} />
|
|
288
|
+
</SelectTrigger>
|
|
289
|
+
<SelectContent>
|
|
290
|
+
{secretCodes.map((code) => (
|
|
291
|
+
<SelectItem key={code} value={code}>
|
|
292
|
+
{code}
|
|
293
|
+
</SelectItem>
|
|
294
|
+
))}
|
|
295
|
+
</SelectContent>
|
|
296
|
+
</Select>
|
|
297
|
+
{field.description && (
|
|
298
|
+
<p className="text-xs text-muted-foreground">{field.description}</p>
|
|
299
|
+
)}
|
|
300
|
+
</div>
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Number fields
|
|
305
|
+
if (fieldType === 'number') {
|
|
306
|
+
const numValue = currentValue != null ? Number(currentValue) : (field.defaultValue as number ?? 0);
|
|
307
|
+
return (
|
|
308
|
+
<div key={field.key} className="space-y-2">
|
|
309
|
+
<Label>{field.label}{field.required ? ' *' : ''}</Label>
|
|
310
|
+
<Input
|
|
311
|
+
type="number"
|
|
312
|
+
value={numValue}
|
|
313
|
+
onChange={(e) => handleFieldChange(field, e.target.value)}
|
|
314
|
+
placeholder={field.placeholder ?? undefined}
|
|
315
|
+
disabled={readOnly}
|
|
316
|
+
/>
|
|
317
|
+
{field.description && (
|
|
318
|
+
<p className="text-xs text-muted-foreground">{field.description}</p>
|
|
319
|
+
)}
|
|
320
|
+
</div>
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Boolean fields
|
|
325
|
+
if (fieldType === 'boolean') {
|
|
326
|
+
const boolValue = currentValue != null ? Boolean(currentValue) : (field.defaultValue as boolean ?? false);
|
|
327
|
+
return (
|
|
328
|
+
<div key={field.key} className="flex items-center gap-2">
|
|
329
|
+
<Switch
|
|
330
|
+
checked={boolValue}
|
|
331
|
+
onCheckedChange={(checked) => handleFieldChange(field, checked)}
|
|
332
|
+
disabled={readOnly}
|
|
333
|
+
/>
|
|
334
|
+
<Label>{field.label}</Label>
|
|
335
|
+
</div>
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Default: string/text input
|
|
340
|
+
return (
|
|
341
|
+
<div key={field.key} className="space-y-2">
|
|
342
|
+
<Label>{field.label}{field.required ? ' *' : ''}</Label>
|
|
343
|
+
<Input
|
|
344
|
+
value={String(currentValue ?? '')}
|
|
345
|
+
onChange={(e) => handleFieldChange(field, e.target.value)}
|
|
346
|
+
placeholder={field.placeholder ?? undefined}
|
|
347
|
+
disabled={readOnly}
|
|
348
|
+
/>
|
|
349
|
+
{field.description && (
|
|
350
|
+
<p className="text-xs text-muted-foreground">{field.description}</p>
|
|
351
|
+
)}
|
|
352
|
+
</div>
|
|
353
|
+
);
|
|
354
|
+
})}
|
|
355
|
+
</div>
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// ---------------------------------------------------------------------------
|
|
360
|
+
// TriggerForm
|
|
361
|
+
// ---------------------------------------------------------------------------
|
|
362
|
+
|
|
363
|
+
export function TriggerForm({
|
|
364
|
+
trigger,
|
|
365
|
+
onChange,
|
|
366
|
+
onRemove,
|
|
367
|
+
readOnly = false,
|
|
368
|
+
secretCodes = [],
|
|
369
|
+
compact = false,
|
|
370
|
+
}: TriggerFormProps) {
|
|
371
|
+
const { data: configData } = useConfigOptions();
|
|
372
|
+
const { configList, triggerSchemas } = useTriggerTypes();
|
|
373
|
+
const resolveTriggerIcon = useTriggerIconResolver();
|
|
374
|
+
|
|
375
|
+
const currentSchema = useMemo(
|
|
376
|
+
() => triggerSchemas.find(s => s.value === trigger.type),
|
|
377
|
+
[triggerSchemas, trigger.type],
|
|
378
|
+
);
|
|
379
|
+
|
|
380
|
+
const handleChange = useCallback(<K extends keyof PipelineTrigger>(
|
|
381
|
+
key: K,
|
|
382
|
+
value: PipelineTrigger[K]
|
|
383
|
+
) => {
|
|
384
|
+
onChange({ ...trigger, [key]: value });
|
|
385
|
+
}, [trigger, onChange]);
|
|
386
|
+
|
|
387
|
+
const TriggerIcon = resolveTriggerIcon(trigger.type);
|
|
388
|
+
|
|
389
|
+
const formContent = (
|
|
390
|
+
<>
|
|
391
|
+
{!compact && (
|
|
392
|
+
<div className="flex items-center justify-between">
|
|
393
|
+
<Label htmlFor="trigger-enabled">Enabled</Label>
|
|
394
|
+
<Switch
|
|
395
|
+
id="trigger-enabled"
|
|
396
|
+
checked={trigger.enabled !== false}
|
|
397
|
+
onCheckedChange={(checked) => handleChange('enabled', checked)}
|
|
398
|
+
disabled={readOnly}
|
|
399
|
+
/>
|
|
400
|
+
</div>
|
|
401
|
+
)}
|
|
402
|
+
|
|
403
|
+
<div className="space-y-2" data-testid="datahub-triggerform-field-type">
|
|
404
|
+
<Label>Trigger Type</Label>
|
|
405
|
+
<Select
|
|
406
|
+
value={trigger.type}
|
|
407
|
+
onValueChange={(v) => handleChange('type', v as TriggerType)}
|
|
408
|
+
disabled={readOnly}
|
|
409
|
+
>
|
|
410
|
+
<SelectTrigger>
|
|
411
|
+
<SelectValue />
|
|
412
|
+
</SelectTrigger>
|
|
413
|
+
<SelectContent>
|
|
414
|
+
{configList.map((config) => {
|
|
415
|
+
const Icon = resolveTriggerIcon(config.type);
|
|
416
|
+
return (
|
|
417
|
+
<SelectItem key={config.type} value={config.type}>
|
|
418
|
+
<span className="flex items-center gap-2">
|
|
419
|
+
<Icon className="h-4 w-4" />
|
|
420
|
+
{config.label}
|
|
421
|
+
</span>
|
|
422
|
+
</SelectItem>
|
|
423
|
+
);
|
|
424
|
+
})}
|
|
425
|
+
</SelectContent>
|
|
426
|
+
</Select>
|
|
427
|
+
</div>
|
|
428
|
+
|
|
429
|
+
{currentSchema && currentSchema.fields.length > 0 && (
|
|
430
|
+
<SchemaDrivenFields
|
|
431
|
+
trigger={trigger}
|
|
432
|
+
schema={currentSchema}
|
|
433
|
+
configData={configData as unknown as ConfigOptionsData}
|
|
434
|
+
secretCodes={secretCodes}
|
|
435
|
+
onChange={onChange}
|
|
436
|
+
readOnly={readOnly}
|
|
437
|
+
/>
|
|
438
|
+
)}
|
|
439
|
+
</>
|
|
440
|
+
);
|
|
441
|
+
|
|
442
|
+
if (compact) {
|
|
443
|
+
return <div className="space-y-4" data-testid="datahub-triggerform-form">{formContent}</div>;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
return (
|
|
447
|
+
<Card data-testid="datahub-triggerform-form">
|
|
448
|
+
<CardHeader className="pb-3">
|
|
449
|
+
<div className="flex items-center justify-between">
|
|
450
|
+
<CardTitle className="text-sm flex items-center gap-2">
|
|
451
|
+
<TriggerIcon className="h-4 w-4" />
|
|
452
|
+
Trigger Configuration
|
|
453
|
+
{trigger.enabled !== false && (
|
|
454
|
+
<Badge variant="secondary" className="text-xs">
|
|
455
|
+
Active
|
|
456
|
+
</Badge>
|
|
457
|
+
)}
|
|
458
|
+
</CardTitle>
|
|
459
|
+
{onRemove && !readOnly && (
|
|
460
|
+
<Button
|
|
461
|
+
variant="ghost"
|
|
462
|
+
size="sm"
|
|
463
|
+
onClick={onRemove}
|
|
464
|
+
className="text-destructive hover:text-destructive"
|
|
465
|
+
aria-label="Remove trigger"
|
|
466
|
+
data-testid="datahub-trigger-remove-btn"
|
|
467
|
+
>
|
|
468
|
+
<Trash2 className="h-4 w-4" />
|
|
469
|
+
</Button>
|
|
470
|
+
)}
|
|
471
|
+
</div>
|
|
472
|
+
</CardHeader>
|
|
473
|
+
<CardContent className="space-y-4">
|
|
474
|
+
{formContent}
|
|
475
|
+
</CardContent>
|
|
476
|
+
</Card>
|
|
477
|
+
);
|
|
478
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TriggerForm } from './TriggerForm';
|