@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,45 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useQuery } from '@tanstack/react-query';
|
|
3
|
+
import { api } from '@vendure/dashboard';
|
|
4
|
+
import { graphql } from '../../gql';
|
|
5
|
+
import { createQueryKeys } from '../../utils/query-key-factory';
|
|
6
|
+
import { CACHE_TIMES } from '../../constants';
|
|
7
|
+
|
|
8
|
+
const base = createQueryKeys('entity-loaders');
|
|
9
|
+
const entityLoaderKeys = {
|
|
10
|
+
...base,
|
|
11
|
+
supported: () => [...base.all, 'supported'] as const,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const supportedEntitiesDocument = graphql(`
|
|
15
|
+
query DataHubSupportedEntitiesApi {
|
|
16
|
+
dataHubSupportedEntities {
|
|
17
|
+
code
|
|
18
|
+
name
|
|
19
|
+
description
|
|
20
|
+
supportedOperations
|
|
21
|
+
adapterCode
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`);
|
|
25
|
+
|
|
26
|
+
export function useEntityLoaders() {
|
|
27
|
+
const { data: entities, ...rest } = useQuery({
|
|
28
|
+
queryKey: entityLoaderKeys.supported(),
|
|
29
|
+
queryFn: () => api.query(supportedEntitiesDocument).then(res => res.dataHubSupportedEntities),
|
|
30
|
+
staleTime: CACHE_TIMES.ADAPTER_CATALOG,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const getLoaderAdapterCode = useCallback(
|
|
34
|
+
(entityType: string): string | undefined => {
|
|
35
|
+
return entities?.find(e => e.code === entityType)?.adapterCode;
|
|
36
|
+
},
|
|
37
|
+
[entities],
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
...rest,
|
|
42
|
+
entities: entities ?? [],
|
|
43
|
+
getLoaderAdapterCode,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { api } from '@vendure/dashboard';
|
|
3
|
+
import { graphql } from '../../gql';
|
|
4
|
+
import { createMutationErrorHandler } from './mutation-helpers';
|
|
5
|
+
import { createQueryKeys } from '../../utils/query-key-factory';
|
|
6
|
+
import { POLLING_INTERVALS } from '../../constants';
|
|
7
|
+
import type { JsonObject } from '../../types';
|
|
8
|
+
|
|
9
|
+
const base = createQueryKeys('pipelineHooks');
|
|
10
|
+
const hookKeys = {
|
|
11
|
+
...base,
|
|
12
|
+
events: (limit?: number) => [...base.all, 'events', limit] as const,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const hooksDocument = graphql(`
|
|
16
|
+
query DataHubPipelineHooksApi($pipelineId: ID!) {
|
|
17
|
+
dataHubPipelineHooks(pipelineId: $pipelineId)
|
|
18
|
+
}
|
|
19
|
+
`);
|
|
20
|
+
|
|
21
|
+
const hookTestDocument = graphql(`
|
|
22
|
+
mutation RunDataHubHookTestApi($pipelineId: ID!, $stage: String!, $payload: JSON) {
|
|
23
|
+
runDataHubHookTest(pipelineId: $pipelineId, stage: $stage, payload: $payload)
|
|
24
|
+
}
|
|
25
|
+
`);
|
|
26
|
+
|
|
27
|
+
const eventsDocument = graphql(`
|
|
28
|
+
query DataHubEventsApi($limit: Int) {
|
|
29
|
+
dataHubEvents(limit: $limit) {
|
|
30
|
+
name
|
|
31
|
+
createdAt
|
|
32
|
+
payload
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`);
|
|
36
|
+
|
|
37
|
+
export function usePipelineHooks(pipelineId: string | undefined) {
|
|
38
|
+
return useQuery({
|
|
39
|
+
queryKey: hookKeys.detail(pipelineId ?? ''),
|
|
40
|
+
queryFn: () =>
|
|
41
|
+
api.query(hooksDocument, { pipelineId: pipelineId! }).then((res) => res.dataHubPipelineHooks),
|
|
42
|
+
enabled: !!pipelineId,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function useEvents(limit: number = 50) {
|
|
47
|
+
return useQuery({
|
|
48
|
+
queryKey: hookKeys.events(limit),
|
|
49
|
+
queryFn: () => api.query(eventsDocument, { limit }).then((res) => res.dataHubEvents),
|
|
50
|
+
refetchInterval: POLLING_INTERVALS.EVENTS,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function useTestHook() {
|
|
55
|
+
return useMutation({
|
|
56
|
+
mutationFn: ({
|
|
57
|
+
pipelineId,
|
|
58
|
+
stage,
|
|
59
|
+
payload,
|
|
60
|
+
}: {
|
|
61
|
+
pipelineId: string;
|
|
62
|
+
stage: string;
|
|
63
|
+
payload?: JsonObject;
|
|
64
|
+
}) =>
|
|
65
|
+
api.mutate(hookTestDocument, { pipelineId, stage, payload }).then((res) => res.runDataHubHookTest),
|
|
66
|
+
onError: createMutationErrorHandler('test hook'),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { api } from '@vendure/dashboard';
|
|
3
|
+
import { graphql } from '../../gql';
|
|
4
|
+
import { createQueryKeys } from '../../utils/query-key-factory';
|
|
5
|
+
import { POLLING_INTERVALS } from '../../constants';
|
|
6
|
+
import type { DataHubLogListOptions } from '../../types';
|
|
7
|
+
|
|
8
|
+
const base = createQueryKeys('logs');
|
|
9
|
+
const logKeys = {
|
|
10
|
+
...base,
|
|
11
|
+
list: (options?: DataHubLogListOptions) => [...base.lists(), options] as const,
|
|
12
|
+
stats: (pipelineId?: string) => [...base.all, 'stats', pipelineId] as const,
|
|
13
|
+
recent: (limit?: number) => [...base.all, 'recent', limit] as const,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const logsDocument = graphql(`
|
|
17
|
+
query DataHubLogsApi($options: DataHubLogListOptions) {
|
|
18
|
+
dataHubLogs(options: $options) {
|
|
19
|
+
items {
|
|
20
|
+
id
|
|
21
|
+
createdAt
|
|
22
|
+
level
|
|
23
|
+
message
|
|
24
|
+
stepKey
|
|
25
|
+
context
|
|
26
|
+
metadata
|
|
27
|
+
pipelineId
|
|
28
|
+
pipeline {
|
|
29
|
+
id
|
|
30
|
+
code
|
|
31
|
+
name
|
|
32
|
+
}
|
|
33
|
+
runId
|
|
34
|
+
durationMs
|
|
35
|
+
recordsProcessed
|
|
36
|
+
recordsFailed
|
|
37
|
+
}
|
|
38
|
+
totalItems
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`);
|
|
42
|
+
|
|
43
|
+
const logStatsDocument = graphql(`
|
|
44
|
+
query DataHubLogStatsApi($pipelineId: ID) {
|
|
45
|
+
dataHubLogStats(pipelineId: $pipelineId) {
|
|
46
|
+
total
|
|
47
|
+
byLevel {
|
|
48
|
+
DEBUG
|
|
49
|
+
INFO
|
|
50
|
+
WARN
|
|
51
|
+
ERROR
|
|
52
|
+
}
|
|
53
|
+
errorsToday
|
|
54
|
+
warningsToday
|
|
55
|
+
avgDurationMs
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`);
|
|
59
|
+
|
|
60
|
+
const recentLogsDocument = graphql(`
|
|
61
|
+
query DataHubRecentLogsApi($limit: Int) {
|
|
62
|
+
dataHubRecentLogs(limit: $limit) {
|
|
63
|
+
id
|
|
64
|
+
createdAt
|
|
65
|
+
level
|
|
66
|
+
message
|
|
67
|
+
stepKey
|
|
68
|
+
pipelineId
|
|
69
|
+
pipeline {
|
|
70
|
+
id
|
|
71
|
+
code
|
|
72
|
+
name
|
|
73
|
+
}
|
|
74
|
+
runId
|
|
75
|
+
durationMs
|
|
76
|
+
recordsProcessed
|
|
77
|
+
recordsFailed
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`);
|
|
81
|
+
|
|
82
|
+
export function useLogs(options?: DataHubLogListOptions) {
|
|
83
|
+
return useQuery({
|
|
84
|
+
queryKey: logKeys.list(options),
|
|
85
|
+
queryFn: () => api.query(logsDocument, { options }).then((res) => res.dataHubLogs),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function useLogStats(pipelineId?: string) {
|
|
90
|
+
return useQuery({
|
|
91
|
+
queryKey: logKeys.stats(pipelineId),
|
|
92
|
+
queryFn: () => api.query(logStatsDocument, { pipelineId }).then((res) => res.dataHubLogStats),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function useRecentLogs(limit: number = 10, options?: { refetchInterval?: number | false }) {
|
|
97
|
+
return useQuery({
|
|
98
|
+
queryKey: logKeys.recent(limit),
|
|
99
|
+
queryFn: () => api.query(recentLogsDocument, { limit }).then((res) => res.dataHubRecentLogs),
|
|
100
|
+
refetchInterval: options?.refetchInterval ?? POLLING_INTERVALS.LIVE_LOGS,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { api } from '@vendure/dashboard';
|
|
3
|
+
import { graphql } from '../../gql';
|
|
4
|
+
import { createMutationErrorHandler } from './mutation-helpers';
|
|
5
|
+
import { createQueryKeys } from '../../utils/query-key-factory';
|
|
6
|
+
import { POLLING_INTERVALS, RUN_STATUS } from '../../constants';
|
|
7
|
+
import { queueKeys } from './use-queues';
|
|
8
|
+
import type { DataHubPipelineRunListOptions, JsonObject } from '../../types';
|
|
9
|
+
|
|
10
|
+
const base = createQueryKeys('pipelineRuns');
|
|
11
|
+
export const runKeys = {
|
|
12
|
+
...base,
|
|
13
|
+
list: (pipelineId?: string, options?: DataHubPipelineRunListOptions) =>
|
|
14
|
+
[...base.lists(), pipelineId, options] as const,
|
|
15
|
+
errors: (runId: string) => [...base.all, 'errors', runId] as const,
|
|
16
|
+
errorAudits: (errorId: string) => [...base.all, 'errorAudits', errorId] as const,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const runsListDocument = graphql(`
|
|
20
|
+
query DataHubPipelineRunsApi($pipelineId: ID, $options: DataHubPipelineRunListOptions) {
|
|
21
|
+
dataHubPipelineRuns(pipelineId: $pipelineId, options: $options) {
|
|
22
|
+
items {
|
|
23
|
+
id
|
|
24
|
+
status
|
|
25
|
+
startedAt
|
|
26
|
+
finishedAt
|
|
27
|
+
metrics
|
|
28
|
+
}
|
|
29
|
+
totalItems
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`);
|
|
33
|
+
|
|
34
|
+
const runDetailDocument = graphql(`
|
|
35
|
+
query DataHubPipelineRunDetailApi($id: ID!) {
|
|
36
|
+
dataHubPipelineRun(id: $id) {
|
|
37
|
+
id
|
|
38
|
+
status
|
|
39
|
+
startedAt
|
|
40
|
+
finishedAt
|
|
41
|
+
metrics
|
|
42
|
+
error
|
|
43
|
+
startedByUserId
|
|
44
|
+
pipeline {
|
|
45
|
+
id
|
|
46
|
+
code
|
|
47
|
+
name
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`);
|
|
52
|
+
|
|
53
|
+
const runErrorsDocument = graphql(`
|
|
54
|
+
query DataHubRunErrorsApi($runId: ID!) {
|
|
55
|
+
dataHubRunErrors(runId: $runId) {
|
|
56
|
+
id
|
|
57
|
+
stepKey
|
|
58
|
+
message
|
|
59
|
+
payload
|
|
60
|
+
stackTrace
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`);
|
|
64
|
+
|
|
65
|
+
const cancelRunDocument = graphql(`
|
|
66
|
+
mutation CancelDataHubPipelineRunApi($id: ID!) {
|
|
67
|
+
cancelDataHubPipelineRun(id: $id) {
|
|
68
|
+
id
|
|
69
|
+
status
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`);
|
|
73
|
+
|
|
74
|
+
const retryErrorDocument = graphql(`
|
|
75
|
+
mutation RetryDataHubRecordApi($errorId: ID!, $patch: JSON) {
|
|
76
|
+
retryDataHubRecord(errorId: $errorId, patch: $patch)
|
|
77
|
+
}
|
|
78
|
+
`);
|
|
79
|
+
|
|
80
|
+
const approveGateDocument = graphql(`
|
|
81
|
+
mutation ApproveDataHubGateApi($runId: ID!, $stepKey: String!) {
|
|
82
|
+
approveDataHubGate(runId: $runId, stepKey: $stepKey) {
|
|
83
|
+
success
|
|
84
|
+
message
|
|
85
|
+
run {
|
|
86
|
+
id
|
|
87
|
+
status
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
`);
|
|
92
|
+
|
|
93
|
+
const rejectGateDocument = graphql(`
|
|
94
|
+
mutation RejectDataHubGateApi($runId: ID!, $stepKey: String!) {
|
|
95
|
+
rejectDataHubGate(runId: $runId, stepKey: $stepKey) {
|
|
96
|
+
success
|
|
97
|
+
message
|
|
98
|
+
run {
|
|
99
|
+
id
|
|
100
|
+
status
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`);
|
|
105
|
+
|
|
106
|
+
const errorAuditsDocument = graphql(`
|
|
107
|
+
query DataHubRecordRetryAuditsApi($errorId: ID!) {
|
|
108
|
+
dataHubRecordRetryAudits(errorId: $errorId) {
|
|
109
|
+
id
|
|
110
|
+
createdAt
|
|
111
|
+
userId
|
|
112
|
+
previousPayload
|
|
113
|
+
patch
|
|
114
|
+
resultingPayload
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`);
|
|
118
|
+
|
|
119
|
+
export function usePipelineRuns(pipelineId?: string, options?: DataHubPipelineRunListOptions) {
|
|
120
|
+
return useQuery({
|
|
121
|
+
queryKey: runKeys.list(pipelineId, options),
|
|
122
|
+
queryFn: () =>
|
|
123
|
+
api
|
|
124
|
+
.query(runsListDocument, { pipelineId, options })
|
|
125
|
+
.then((res) => res.dataHubPipelineRuns),
|
|
126
|
+
refetchInterval: POLLING_INTERVALS.PIPELINE_RUNS,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function usePipelineRun(id: string | undefined) {
|
|
131
|
+
return useQuery({
|
|
132
|
+
queryKey: runKeys.detail(id ?? ''),
|
|
133
|
+
queryFn: () =>
|
|
134
|
+
api.query(runDetailDocument, { id: id! }).then((res) => res.dataHubPipelineRun),
|
|
135
|
+
enabled: !!id,
|
|
136
|
+
refetchInterval: (query) => {
|
|
137
|
+
const status = query.state.data?.status;
|
|
138
|
+
return status === RUN_STATUS.RUNNING || status === RUN_STATUS.PENDING || status === RUN_STATUS.PAUSED
|
|
139
|
+
? POLLING_INTERVALS.ACTIVE_RUN : false;
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function useRunErrors(runId: string | undefined) {
|
|
145
|
+
return useQuery({
|
|
146
|
+
queryKey: runKeys.errors(runId ?? ''),
|
|
147
|
+
queryFn: () =>
|
|
148
|
+
api.query(runErrorsDocument, { runId: runId! }).then((res) => res.dataHubRunErrors),
|
|
149
|
+
enabled: !!runId,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function useErrorAudits(errorId: string | undefined) {
|
|
154
|
+
return useQuery({
|
|
155
|
+
queryKey: runKeys.errorAudits(errorId ?? ''),
|
|
156
|
+
queryFn: () =>
|
|
157
|
+
api.query(errorAuditsDocument, { errorId: errorId! }).then((res) => res.dataHubRecordRetryAudits),
|
|
158
|
+
enabled: !!errorId,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function useCancelRun() {
|
|
163
|
+
const queryClient = useQueryClient();
|
|
164
|
+
|
|
165
|
+
return useMutation({
|
|
166
|
+
mutationFn: (id: string) =>
|
|
167
|
+
api.mutate(cancelRunDocument, { id }).then((res) => res.cancelDataHubPipelineRun),
|
|
168
|
+
onSuccess: (data) => {
|
|
169
|
+
queryClient.invalidateQueries({ queryKey: runKeys.lists() });
|
|
170
|
+
if (data?.id) {
|
|
171
|
+
queryClient.invalidateQueries({ queryKey: runKeys.detail(String(data.id)) });
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
onError: createMutationErrorHandler('cancel pipeline run'),
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function useRetryError() {
|
|
179
|
+
const queryClient = useQueryClient();
|
|
180
|
+
|
|
181
|
+
return useMutation({
|
|
182
|
+
mutationFn: ({ errorId, patch }: { errorId: string; patch?: JsonObject }) =>
|
|
183
|
+
api.mutate(retryErrorDocument, { errorId, patch }).then((res) => res.retryDataHubRecord),
|
|
184
|
+
onSuccess: () => {
|
|
185
|
+
queryClient.invalidateQueries({ queryKey: runKeys.all });
|
|
186
|
+
queryClient.invalidateQueries({ queryKey: queueKeys.all });
|
|
187
|
+
},
|
|
188
|
+
onError: createMutationErrorHandler('retry record'),
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function useApproveGate() {
|
|
193
|
+
const queryClient = useQueryClient();
|
|
194
|
+
|
|
195
|
+
return useMutation({
|
|
196
|
+
mutationFn: ({ runId, stepKey }: { runId: string; stepKey: string }) =>
|
|
197
|
+
api.mutate(approveGateDocument, { runId, stepKey }).then((res) => res.approveDataHubGate),
|
|
198
|
+
onSuccess: (data) => {
|
|
199
|
+
queryClient.invalidateQueries({ queryKey: runKeys.lists() });
|
|
200
|
+
if (data?.run?.id) {
|
|
201
|
+
queryClient.invalidateQueries({ queryKey: runKeys.detail(String(data.run.id)) });
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
onError: createMutationErrorHandler('approve gate'),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function useRejectGate() {
|
|
209
|
+
const queryClient = useQueryClient();
|
|
210
|
+
|
|
211
|
+
return useMutation({
|
|
212
|
+
mutationFn: ({ runId, stepKey }: { runId: string; stepKey: string }) =>
|
|
213
|
+
api.mutate(rejectGateDocument, { runId, stepKey }).then((res) => res.rejectDataHubGate),
|
|
214
|
+
onSuccess: (data) => {
|
|
215
|
+
queryClient.invalidateQueries({ queryKey: runKeys.lists() });
|
|
216
|
+
if (data?.run?.id) {
|
|
217
|
+
queryClient.invalidateQueries({ queryKey: runKeys.detail(String(data.run.id)) });
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
onError: createMutationErrorHandler('reject gate'),
|
|
221
|
+
});
|
|
222
|
+
}
|