tasker-engine 1.0.1 → 1.0.2
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.
- checksums.yaml +4 -4
- data/README.md +2 -5
- data/app/models/tasker/task.rb +0 -10
- data/config/routes.rb +3 -3
- data/docs/AUTH.md +1 -40
- data/docs/DEVELOPER_GUIDE.md +2 -3
- data/docs/OVERVIEW.md +0 -4
- data/docs/Tasker/Analysis/RuntimeGraphAnalyzer.html +1 -1
- data/docs/Tasker/Analysis/TemplateGraphAnalyzer.html +1 -1
- data/docs/Tasker/Analysis.html +1 -1
- data/docs/Tasker/AnalyticsController.html +1 -1
- data/docs/Tasker/AnalyticsService/BottleneckAnalytics.html +1 -1
- data/docs/Tasker/AnalyticsService/PerformanceAnalytics.html +1 -1
- data/docs/Tasker/AnalyticsService.html +1 -1
- data/docs/Tasker/AnnotationType.html +1 -1
- data/docs/Tasker/AnnotationTypeSerializer.html +1 -1
- data/docs/Tasker/ApplicationController.html +2 -2
- data/docs/Tasker/ApplicationJob.html +1 -1
- data/docs/Tasker/ApplicationRecord.html +1 -1
- data/docs/Tasker/Authentication/AuthenticationError.html +1 -1
- data/docs/Tasker/Authentication/ConfigurationError.html +1 -1
- data/docs/Tasker/Authentication/Coordinator.html +1 -1
- data/docs/Tasker/Authentication/Interface.html +1 -1
- data/docs/Tasker/Authentication/InterfaceError.html +1 -1
- data/docs/Tasker/Authentication/NoneAuthenticator.html +1 -1
- data/docs/Tasker/Authentication.html +1 -1
- data/docs/Tasker/Authorization/AuthorizationError.html +1 -1
- data/docs/Tasker/Authorization/BaseCoordinator.html +1 -1
- data/docs/Tasker/Authorization/ConfigurationError.html +1 -1
- data/docs/Tasker/Authorization/ResourceConstants/ACTIONS.html +10 -10
- data/docs/Tasker/Authorization/ResourceConstants/RESOURCES.html +8 -13
- data/docs/Tasker/Authorization/ResourceConstants.html +1 -1
- data/docs/Tasker/Authorization/ResourceRegistry.html +33 -40
- data/docs/Tasker/Authorization/UnauthorizedError.html +1 -1
- data/docs/Tasker/Authorization.html +1 -1
- data/docs/Tasker/CacheCapabilities.html +1 -1
- data/docs/Tasker/CacheStrategy.html +1 -1
- data/docs/Tasker/Concerns/Authenticatable.html +1 -1
- data/docs/Tasker/Concerns/Authorizable/AdminStatusChecker.html +1 -1
- data/docs/Tasker/Concerns/Authorizable.html +1 -1
- data/docs/Tasker/Concerns/ControllerAuthorizable.html +1 -1
- data/docs/Tasker/Concerns/EventPublisher.html +1 -1
- data/docs/Tasker/Concerns/IdempotentStateTransitions.html +1 -1
- data/docs/Tasker/Concerns/StateMachineBase/ClassMethods.html +1 -1
- data/docs/Tasker/Concerns/StateMachineBase/StateMachineBase/ClassMethods.html +1 -1
- data/docs/Tasker/Concerns/StateMachineBase/StateMachineBase.html +1 -1
- data/docs/Tasker/Concerns/StateMachineBase.html +1 -1
- data/docs/Tasker/Concerns/StructuredLogging.html +1 -1
- data/docs/Tasker/Concerns.html +1 -1
- data/docs/Tasker/Configuration/ConfigurationProxy.html +1 -1
- data/docs/Tasker/Configuration/TelemetryConfigurationProxy.html +1 -1
- data/docs/Tasker/Configuration.html +1 -1
- data/docs/Tasker/ConfigurationError.html +1 -1
- data/docs/Tasker/ConfiguredTask.html +1 -1
- data/docs/Tasker/Constants/EventDefinitions.html +1 -1
- data/docs/Tasker/Constants/ObservabilityEvents/Step.html +1 -1
- data/docs/Tasker/Constants/ObservabilityEvents/Task.html +1 -1
- data/docs/Tasker/Constants/ObservabilityEvents.html +1 -1
- data/docs/Tasker/Constants/RegistryEvents.html +1 -1
- data/docs/Tasker/Constants/StepEvents.html +1 -1
- data/docs/Tasker/Constants/TaskEvents.html +1 -1
- data/docs/Tasker/Constants/TaskExecution/ExecutionStatus.html +1 -1
- data/docs/Tasker/Constants/TaskExecution/HealthStatus.html +1 -1
- data/docs/Tasker/Constants/TaskExecution/RecommendedAction.html +1 -1
- data/docs/Tasker/Constants/TaskExecution.html +1 -1
- data/docs/Tasker/Constants/TaskFinalization/ErrorMessages.html +1 -1
- data/docs/Tasker/Constants/TaskFinalization/PendingReasons.html +1 -1
- data/docs/Tasker/Constants/TaskFinalization/ReenqueueReasons.html +1 -1
- data/docs/Tasker/Constants/TaskFinalization.html +1 -1
- data/docs/Tasker/Constants/TaskStatuses.html +1 -1
- data/docs/Tasker/Constants/TestEvents.html +1 -1
- data/docs/Tasker/Constants/WorkflowEvents.html +1 -1
- data/docs/Tasker/Constants/WorkflowStepStatuses.html +1 -1
- data/docs/Tasker/Constants.html +1 -1
- data/docs/Tasker/DependentSystem.html +1 -1
- data/docs/Tasker/DependentSystemObjectMap.html +1 -1
- data/docs/Tasker/DetectorRegistry.html +1 -1
- data/docs/Tasker/Engine.html +1 -1
- data/docs/Tasker/Error.html +1 -1
- data/docs/Tasker/Events/Catalog/CatalogPrinter.html +1 -1
- data/docs/Tasker/Events/Catalog/CustomEventRegistrar.html +1 -1
- data/docs/Tasker/Events/Catalog/ExamplePayloadGenerator.html +1 -1
- data/docs/Tasker/Events/Catalog.html +1 -1
- data/docs/Tasker/Events/CustomRegistry.html +1 -1
- data/docs/Tasker/Events/DefinitionLoader.html +1 -1
- data/docs/Tasker/Events/EventPayloadBuilder/ErrorInfoExtractor.html +1 -1
- data/docs/Tasker/Events/EventPayloadBuilder/StepPayloadBuilder.html +1 -1
- data/docs/Tasker/Events/EventPayloadBuilder.html +1 -1
- data/docs/Tasker/Events/Publisher.html +1 -1
- data/docs/Tasker/Events/Subscribers/BaseSubscriber/ErrorCategorizer/ErrorTypeClassifier.html +1 -1
- data/docs/Tasker/Events/Subscribers/BaseSubscriber/ErrorCategorizer.html +1 -1
- data/docs/Tasker/Events/Subscribers/BaseSubscriber/MetricTagsExtractor.html +1 -1
- data/docs/Tasker/Events/Subscribers/BaseSubscriber.html +1 -1
- data/docs/Tasker/Events/Subscribers/MetricsSubscriber.html +1 -1
- data/docs/Tasker/Events/Subscribers/TelemetrySubscriber.html +1 -1
- data/docs/Tasker/Events/Subscribers.html +1 -1
- data/docs/Tasker/Events/SubscriptionLoader.html +1 -1
- data/docs/Tasker/Events.html +1 -1
- data/docs/Tasker/EventsGenerator.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedAnalyticsMetrics/AnalyticsMetrics.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedAnalyticsMetrics.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedDependencyLevels.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSlowestSteps/SlowestStep.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSlowestSteps.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSlowestTasks/SlowestTask.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSlowestTasks.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedStepReadinessStatus.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSystemHealthCounts/HealthMetrics.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedSystemHealthCounts.html +1 -1
- data/docs/Tasker/Functions/FunctionBasedTaskExecutionContext.html +1 -1
- data/docs/Tasker/Functions/FunctionWrapper.html +1 -1
- data/docs/Tasker/Functions.html +1 -1
- data/docs/Tasker/Generators/AuthenticatorGenerator/UsageInstructionsFormatter.html +1 -1
- data/docs/Tasker/Generators/AuthenticatorGenerator.html +1 -1
- data/docs/Tasker/Generators/AuthorizationCoordinatorGenerator.html +1 -1
- data/docs/Tasker/Generators/SubscriberGenerator.html +1 -1
- data/docs/Tasker/Generators/TaskHandlerGenerator.html +1 -1
- data/docs/Tasker/Generators.html +1 -1
- data/docs/Tasker/GraphQLTypes/AnnotationType.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseArgument.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseConnection.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseEdge.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseEnum.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseField.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseInputObject.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseInterface.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseObject.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseScalar.html +1 -1
- data/docs/Tasker/GraphQLTypes/BaseUnion.html +1 -1
- data/docs/Tasker/GraphQLTypes/DependentSystemObjectMapType.html +1 -1
- data/docs/Tasker/GraphQLTypes/DependentSystemType.html +1 -1
- data/docs/Tasker/GraphQLTypes/MutationType.html +1 -1
- data/docs/Tasker/GraphQLTypes/NamedStepType.html +1 -1
- data/docs/Tasker/GraphQLTypes/NamedTaskType.html +1 -1
- data/docs/Tasker/GraphQLTypes/NamedTasksNamedStepType.html +1 -1
- data/docs/Tasker/GraphQLTypes/NodeType.html +1 -1
- data/docs/Tasker/GraphQLTypes/QueryType.html +1 -1
- data/docs/Tasker/GraphQLTypes/TaskAnnotationType.html +1 -1
- data/docs/Tasker/GraphQLTypes/TaskInterface.html +1 -1
- data/docs/Tasker/GraphQLTypes/TaskType.html +1 -1
- data/docs/Tasker/GraphQLTypes/WorkflowStepType.html +1 -1
- data/docs/Tasker/GraphQLTypes.html +1 -1
- data/docs/Tasker/GraphqlController.html +1 -1
- data/docs/Tasker/HandlerFactory.html +1 -1
- data/docs/Tasker/HandlerSerializer.html +1 -1
- data/docs/Tasker/HandlersController.html +1 -1
- data/docs/Tasker/HashIdentityStrategy.html +1 -1
- data/docs/Tasker/Health/ReadinessChecker.html +1 -1
- data/docs/Tasker/Health/StatusChecker.html +1 -1
- data/docs/Tasker/Health.html +1 -1
- data/docs/Tasker/HealthController.html +1 -1
- data/docs/Tasker/IdentityStrategy.html +1 -1
- data/docs/Tasker/InvalidTaskHandlerConfig.html +1 -1
- data/docs/Tasker/Logging/CorrelationIdGenerator.html +1 -1
- data/docs/Tasker/Logging.html +1 -1
- data/docs/Tasker/MetricsController.html +1 -1
- data/docs/Tasker/MetricsExportJob.html +1 -1
- data/docs/Tasker/Mutations/BaseMutation.html +1 -1
- data/docs/Tasker/Mutations/CancelStep.html +1 -1
- data/docs/Tasker/Mutations/CancelTask.html +1 -1
- data/docs/Tasker/Mutations/CreateTask.html +1 -1
- data/docs/Tasker/Mutations/UpdateStep.html +1 -1
- data/docs/Tasker/Mutations/UpdateTask.html +1 -1
- data/docs/Tasker/Mutations.html +1 -1
- data/docs/Tasker/NamedStep.html +1 -1
- data/docs/Tasker/NamedTask.html +1 -1
- data/docs/Tasker/NamedTasksNamedStep.html +1 -1
- data/docs/Tasker/Orchestration/BackoffCalculator.html +1 -1
- data/docs/Tasker/Orchestration/ConnectionBuilder/ConfigValidator.html +1 -1
- data/docs/Tasker/Orchestration/ConnectionBuilder.html +1 -1
- data/docs/Tasker/Orchestration/ConnectionPoolIntelligence.html +1 -1
- data/docs/Tasker/Orchestration/Coordinator.html +1 -1
- data/docs/Tasker/Orchestration/FutureStateAnalyzer.html +1 -1
- data/docs/Tasker/Orchestration/PluginIntegration.html +1 -1
- data/docs/Tasker/Orchestration/ResponseProcessor.html +1 -1
- data/docs/Tasker/Orchestration/RetryHeaderParser.html +1 -1
- data/docs/Tasker/Orchestration/StepExecutor.html +1 -1
- data/docs/Tasker/Orchestration/StepSequenceFactory.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/BlockageChecker.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/ContextManager.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/DelayCalculator.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/FinalizationDecisionMaker.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/FinalizationProcessor.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/ReasonDeterminer.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/ReenqueueManager.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer/UnclearStateHandler.html +1 -1
- data/docs/Tasker/Orchestration/TaskFinalizer.html +1 -1
- data/docs/Tasker/Orchestration/TaskInitializer.html +1 -1
- data/docs/Tasker/Orchestration/TaskReenqueuer.html +1 -1
- data/docs/Tasker/Orchestration/ViableStepDiscovery.html +1 -1
- data/docs/Tasker/Orchestration/WorkflowCoordinator.html +1 -1
- data/docs/Tasker/Orchestration.html +1 -1
- data/docs/Tasker/PageSort/PageSortParamsBuilder.html +1 -1
- data/docs/Tasker/PageSort.html +1 -1
- data/docs/Tasker/PermanentError.html +1 -1
- data/docs/Tasker/ProceduralError.html +1 -1
- data/docs/Tasker/Queries/AllAnnotationTypes.html +1 -1
- data/docs/Tasker/Queries/AllTasks.html +1 -1
- data/docs/Tasker/Queries/BaseQuery.html +1 -1
- data/docs/Tasker/Queries/Helpers.html +1 -1
- data/docs/Tasker/Queries/OneStep.html +1 -1
- data/docs/Tasker/Queries/OneTask.html +1 -1
- data/docs/Tasker/Queries/TasksByAnnotation.html +1 -1
- data/docs/Tasker/Queries/TasksByStatus.html +1 -1
- data/docs/Tasker/Queries.html +1 -1
- data/docs/Tasker/Railtie.html +1 -1
- data/docs/Tasker/Registry/BaseRegistry.html +1 -1
- data/docs/Tasker/Registry/EventPublisher.html +1 -1
- data/docs/Tasker/Registry/InterfaceValidator.html +1 -1
- data/docs/Tasker/Registry/RegistrationError.html +1 -1
- data/docs/Tasker/Registry/RegistryError.html +1 -1
- data/docs/Tasker/Registry/StatisticsCollector.html +1 -1
- data/docs/Tasker/Registry/SubscriberRegistry.html +1 -1
- data/docs/Tasker/Registry/ValidationError.html +1 -1
- data/docs/Tasker/Registry.html +1 -1
- data/docs/Tasker/RetryableError.html +1 -1
- data/docs/Tasker/StateMachine/Compatibility.html +1 -1
- data/docs/Tasker/StateMachine/InvalidStateTransition.html +1 -1
- data/docs/Tasker/StateMachine/StepStateMachine.html +1 -1
- data/docs/Tasker/StateMachine/TaskStateMachine.html +1 -1
- data/docs/Tasker/StateMachine.html +1 -1
- data/docs/Tasker/StepDagRelationship.html +1 -1
- data/docs/Tasker/StepHandler/Api/Config.html +1 -1
- data/docs/Tasker/StepHandler/Api.html +1 -1
- data/docs/Tasker/StepHandler/AutomaticEventPublishing.html +1 -1
- data/docs/Tasker/StepHandler/Base.html +1 -1
- data/docs/Tasker/StepHandler.html +1 -1
- data/docs/Tasker/StepReadinessStatus.html +1 -1
- data/docs/Tasker/Task.html +76 -183
- data/docs/Tasker/TaskAnnotation.html +1 -1
- data/docs/Tasker/TaskAnnotationSerializer.html +1 -1
- data/docs/Tasker/TaskBuilder/StepNameValidator.html +1 -1
- data/docs/Tasker/TaskBuilder/StepTemplateDefiner.html +1 -1
- data/docs/Tasker/TaskBuilder.html +1 -1
- data/docs/Tasker/TaskExecutionContext.html +1 -1
- data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner/ClassBasedEventRegistrar.html +1 -1
- data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner/YamlEventRegistrar.html +1 -1
- data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner.html +1 -1
- data/docs/Tasker/TaskHandler/ClassMethods.html +1 -1
- data/docs/Tasker/TaskHandler/InstanceMethods.html +1 -1
- data/docs/Tasker/TaskHandler/StepGroup.html +1 -1
- data/docs/Tasker/TaskHandler.html +1 -1
- data/docs/Tasker/TaskNamespace.html +1 -1
- data/docs/Tasker/TaskRunnerJob.html +1 -1
- data/docs/Tasker/TaskSerializer.html +1 -1
- data/docs/Tasker/TaskTransition.html +1 -1
- data/docs/Tasker/TaskerRailsSchema/InvalidObjectTypeError.html +1 -1
- data/docs/Tasker/TaskerRailsSchema/TypeResolutionError.html +1 -1
- data/docs/Tasker/TaskerRailsSchema/UnknownInterfaceError.html +1 -1
- data/docs/Tasker/TaskerRailsSchema.html +1 -1
- data/docs/Tasker/TasksController.html +1 -1
- data/docs/Tasker/Telemetry/EventMapping.html +1 -1
- data/docs/Tasker/Telemetry/EventRouter.html +1 -1
- data/docs/Tasker/Telemetry/Events/ExportEvents.html +1 -1
- data/docs/Tasker/Telemetry/Events.html +1 -1
- data/docs/Tasker/Telemetry/ExportCoordinator.html +1 -1
- data/docs/Tasker/Telemetry/IntelligentCacheManager.html +1 -1
- data/docs/Tasker/Telemetry/LogBackend.html +1 -1
- data/docs/Tasker/Telemetry/MetricTypes/Counter.html +1 -1
- data/docs/Tasker/Telemetry/MetricTypes/Gauge.html +1 -1
- data/docs/Tasker/Telemetry/MetricTypes/Histogram.html +1 -1
- data/docs/Tasker/Telemetry/MetricTypes.html +1 -1
- data/docs/Tasker/Telemetry/MetricsBackend.html +1 -1
- data/docs/Tasker/Telemetry/MetricsExportService.html +1 -1
- data/docs/Tasker/Telemetry/PluginRegistry.html +1 -1
- data/docs/Tasker/Telemetry/Plugins/BaseExporter.html +1 -1
- data/docs/Tasker/Telemetry/Plugins/CsvExporter.html +1 -1
- data/docs/Tasker/Telemetry/Plugins/JsonExporter.html +1 -1
- data/docs/Tasker/Telemetry/Plugins.html +1 -1
- data/docs/Tasker/Telemetry/PrometheusExporter.html +1 -1
- data/docs/Tasker/Telemetry/TraceBackend.html +1 -1
- data/docs/Tasker/Telemetry.html +1 -1
- data/docs/Tasker/Types/AuthConfig.html +1 -1
- data/docs/Tasker/Types/BackoffConfig.html +1 -1
- data/docs/Tasker/Types/BaseConfig.html +1 -1
- data/docs/Tasker/Types/CacheConfig.html +1 -1
- data/docs/Tasker/Types/DatabaseConfig.html +1 -1
- data/docs/Tasker/Types/DependencyGraph.html +1 -1
- data/docs/Tasker/Types/DependencyGraphConfig.html +1 -1
- data/docs/Tasker/Types/EngineConfig.html +1 -1
- data/docs/Tasker/Types/ExecutionConfig.html +1 -1
- data/docs/Tasker/Types/GraphEdge.html +1 -1
- data/docs/Tasker/Types/GraphMetadata.html +1 -1
- data/docs/Tasker/Types/GraphNode.html +1 -1
- data/docs/Tasker/Types/HealthConfig.html +1 -1
- data/docs/Tasker/Types/StepSequence.html +1 -1
- data/docs/Tasker/Types/StepTemplate.html +1 -1
- data/docs/Tasker/Types/TaskRequest.html +1 -1
- data/docs/Tasker/Types/TelemetryConfig.html +1 -1
- data/docs/Tasker/Types.html +1 -1
- data/docs/Tasker/WorkflowStep/StepFinder.html +1 -1
- data/docs/Tasker/WorkflowStep.html +1 -1
- data/docs/Tasker/WorkflowStepEdge.html +1 -1
- data/docs/Tasker/WorkflowStepSerializer.html +1 -1
- data/docs/Tasker/WorkflowStepTransition/TransitionDescriptionFormatter.html +1 -1
- data/docs/Tasker/WorkflowStepTransition.html +1 -1
- data/docs/Tasker/WorkflowStepsController.html +1 -1
- data/docs/Tasker.html +5 -5
- data/docs/_index.html +21 -77
- data/docs/class_list.html +1 -1
- data/docs/file.README.html +3 -7
- data/docs/index.html +3 -7
- data/docs/method_list.html +1105 -1433
- data/docs/top-level-namespace.html +1 -1
- data/lib/generators/tasker/templates/authorization_coordinator.rb.erb +0 -13
- data/lib/generators/tasker/templates/authorization_coordinator_spec.rb.erb +1 -7
- data/lib/tasker/authorization/resource_constants.rb +1 -2
- data/lib/tasker/authorization/resource_registry.rb +0 -7
- data/lib/tasker/version.rb +1 -1
- metadata +2 -9
- data/app/controllers/tasker/task_diagrams_controller.rb +0 -30
- data/app/models/tasker/diagram/edge.rb +0 -106
- data/app/models/tasker/diagram/flowchart.rb +0 -137
- data/app/models/tasker/diagram/node.rb +0 -99
- data/app/models/tasker/task_diagram.rb +0 -332
- data/app/views/tasker/task/_diagram.html.erb +0 -32
- data/docs/TASK_DIAGRAM.md +0 -252
@@ -100,7 +100,7 @@
|
|
100
100
|
</div>
|
101
101
|
|
102
102
|
<div id="footer">
|
103
|
-
Generated on Thu Jul 3
|
103
|
+
Generated on Thu Jul 3 20:27:32 2025 by
|
104
104
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
105
105
|
0.9.37 (ruby-3.2.4).
|
106
106
|
</div>
|
@@ -28,8 +28,6 @@ class <%= @coordinator_class_name %> < Tasker::Authorization::BaseCoordinator
|
|
28
28
|
authorize_task(action, context)
|
29
29
|
when Tasker::Authorization::ResourceConstants::RESOURCES::WORKFLOW_STEP
|
30
30
|
authorize_workflow_step(action, context)
|
31
|
-
when Tasker::Authorization::ResourceConstants::RESOURCES::TASK_DIAGRAM
|
32
|
-
authorize_task_diagram(action, context)
|
33
31
|
when Tasker::Authorization::ResourceConstants::RESOURCES::HEALTH_STATUS
|
34
32
|
authorize_system_status(action, context)
|
35
33
|
else
|
@@ -70,17 +68,6 @@ class <%= @coordinator_class_name %> < Tasker::Authorization::BaseCoordinator
|
|
70
68
|
end
|
71
69
|
end
|
72
70
|
|
73
|
-
# Authorize task diagram operations
|
74
|
-
def authorize_task_diagram(action, context)
|
75
|
-
case action
|
76
|
-
when :index, :show
|
77
|
-
# TODO: Implement your diagram access logic
|
78
|
-
user.has_tasker_permission?("tasker.task_diagram:#{action}")
|
79
|
-
else
|
80
|
-
false
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
71
|
# Authorize system status operations
|
85
72
|
def authorize_system_status(action, context)
|
86
73
|
case action
|
@@ -20,8 +20,7 @@ RSpec.describe <%= @coordinator_class_name %>, type: :model do
|
|
20
20
|
permissions: [
|
21
21
|
'tasker.task:index',
|
22
22
|
'tasker.task:show',
|
23
|
-
'tasker.workflow_step:index'
|
24
|
-
'tasker.task_diagram:index'
|
23
|
+
'tasker.workflow_step:index'
|
25
24
|
],
|
26
25
|
roles: ['user'],
|
27
26
|
admin: false
|
@@ -55,7 +54,6 @@ RSpec.describe <%= @coordinator_class_name %>, type: :model do
|
|
55
54
|
expect { coordinator.authorize!('tasker.task', :index) }.not_to raise_error
|
56
55
|
expect { coordinator.authorize!('tasker.task', :create) }.not_to raise_error
|
57
56
|
expect { coordinator.authorize!('tasker.workflow_step', :update) }.not_to raise_error
|
58
|
-
expect { coordinator.authorize!('tasker.task_diagram', :show) }.not_to raise_error
|
59
57
|
end
|
60
58
|
end
|
61
59
|
|
@@ -66,7 +64,6 @@ RSpec.describe <%= @coordinator_class_name %>, type: :model do
|
|
66
64
|
expect { coordinator.authorize!('tasker.task', :index) }.not_to raise_error
|
67
65
|
expect { coordinator.authorize!('tasker.task', :show) }.not_to raise_error
|
68
66
|
expect { coordinator.authorize!('tasker.workflow_step', :index) }.not_to raise_error
|
69
|
-
expect { coordinator.authorize!('tasker.task_diagram', :index) }.not_to raise_error
|
70
67
|
end
|
71
68
|
|
72
69
|
it 'denies access to forbidden resources' do
|
@@ -82,7 +79,6 @@ RSpec.describe <%= @coordinator_class_name %>, type: :model do
|
|
82
79
|
it 'denies all operations' do
|
83
80
|
expect { coordinator.authorize!('tasker.task', :index) }.to raise_error(Tasker::Authorization::UnauthorizedError)
|
84
81
|
expect { coordinator.authorize!('tasker.workflow_step', :show) }.to raise_error(Tasker::Authorization::UnauthorizedError)
|
85
|
-
expect { coordinator.authorize!('tasker.task_diagram', :show) }.to raise_error(Tasker::Authorization::UnauthorizedError)
|
86
82
|
end
|
87
83
|
end
|
88
84
|
end
|
@@ -95,7 +91,6 @@ RSpec.describe <%= @coordinator_class_name %>, type: :model do
|
|
95
91
|
expect(coordinator.can?('tasker.task', :index)).to be true
|
96
92
|
expect(coordinator.can?('tasker.task', :create)).to be true
|
97
93
|
expect(coordinator.can?('tasker.workflow_step', :update)).to be true
|
98
|
-
expect(coordinator.can?('tasker.task_diagram', :show)).to be true
|
99
94
|
end
|
100
95
|
end
|
101
96
|
|
@@ -106,7 +101,6 @@ RSpec.describe <%= @coordinator_class_name %>, type: :model do
|
|
106
101
|
expect(coordinator.can?('tasker.task', :index)).to be true
|
107
102
|
expect(coordinator.can?('tasker.task', :show)).to be true
|
108
103
|
expect(coordinator.can?('tasker.workflow_step', :index)).to be true
|
109
|
-
expect(coordinator.can?('tasker.task_diagram', :index)).to be true
|
110
104
|
end
|
111
105
|
|
112
106
|
it 'returns false for forbidden operations' do
|
@@ -16,7 +16,6 @@ module Tasker
|
|
16
16
|
module RESOURCES
|
17
17
|
TASK = 'tasker.task'
|
18
18
|
WORKFLOW_STEP = 'tasker.workflow_step'
|
19
|
-
TASK_DIAGRAM = 'tasker.task_diagram'
|
20
19
|
HEALTH_STATUS = 'tasker.health_status'
|
21
20
|
HANDLER = 'tasker.handler'
|
22
21
|
METRICS = 'tasker.metrics'
|
@@ -26,7 +25,7 @@ module Tasker
|
|
26
25
|
#
|
27
26
|
# @return [Array<String>] All defined resource names
|
28
27
|
def self.all
|
29
|
-
[TASK, WORKFLOW_STEP,
|
28
|
+
[TASK, WORKFLOW_STEP, HEALTH_STATUS, HANDLER, METRICS, ANALYTICS]
|
30
29
|
end
|
31
30
|
|
32
31
|
# Check if a resource constant is defined
|
@@ -48,13 +48,6 @@ module Tasker
|
|
48
48
|
],
|
49
49
|
description: 'Individual workflow steps'
|
50
50
|
},
|
51
|
-
ResourceConstants::RESOURCES::TASK_DIAGRAM => {
|
52
|
-
actions: [
|
53
|
-
ResourceConstants::ACTIONS::INDEX,
|
54
|
-
ResourceConstants::ACTIONS::SHOW
|
55
|
-
],
|
56
|
-
description: 'Task workflow diagrams'
|
57
|
-
},
|
58
51
|
ResourceConstants::RESOURCES::HEALTH_STATUS => {
|
59
52
|
actions: [
|
60
53
|
ResourceConstants::ACTIONS::INDEX
|
data/lib/tasker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tasker-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logger
|
@@ -336,7 +336,6 @@ files:
|
|
336
336
|
- app/controllers/tasker/health_controller.rb
|
337
337
|
- app/controllers/tasker/metrics_controller.rb
|
338
338
|
- app/controllers/tasker/page_sort.rb
|
339
|
-
- app/controllers/tasker/task_diagrams_controller.rb
|
340
339
|
- app/controllers/tasker/tasks_controller.rb
|
341
340
|
- app/controllers/tasker/workflow_steps_controller.rb
|
342
341
|
- app/graphql/examples/all_tasks.graphql
|
@@ -387,9 +386,6 @@ files:
|
|
387
386
|
- app/models/tasker/application_record.rb
|
388
387
|
- app/models/tasker/dependent_system.rb
|
389
388
|
- app/models/tasker/dependent_system_object_map.rb
|
390
|
-
- app/models/tasker/diagram/edge.rb
|
391
|
-
- app/models/tasker/diagram/flowchart.rb
|
392
|
-
- app/models/tasker/diagram/node.rb
|
393
389
|
- app/models/tasker/named_step.rb
|
394
390
|
- app/models/tasker/named_task.rb
|
395
391
|
- app/models/tasker/named_tasks_named_step.rb
|
@@ -397,7 +393,6 @@ files:
|
|
397
393
|
- app/models/tasker/step_readiness_status.rb
|
398
394
|
- app/models/tasker/task.rb
|
399
395
|
- app/models/tasker/task_annotation.rb
|
400
|
-
- app/models/tasker/task_diagram.rb
|
401
396
|
- app/models/tasker/task_execution_context.rb
|
402
397
|
- app/models/tasker/task_namespace.rb
|
403
398
|
- app/models/tasker/task_transition.rb
|
@@ -410,7 +405,6 @@ files:
|
|
410
405
|
- app/serializers/tasker/task_serializer.rb
|
411
406
|
- app/serializers/tasker/workflow_step_serializer.rb
|
412
407
|
- app/services/tasker/analytics_service.rb
|
413
|
-
- app/views/tasker/task/_diagram.html.erb
|
414
408
|
- config/initializers/dry_struct.rb
|
415
409
|
- config/initializers/statesman.rb
|
416
410
|
- config/initializers/tasker_orchestration.rb
|
@@ -446,7 +440,6 @@ files:
|
|
446
440
|
- docs/REST_API.md
|
447
441
|
- docs/ROADMAP.md
|
448
442
|
- docs/SQL_FUNCTIONS.md
|
449
|
-
- docs/TASK_DIAGRAM.md
|
450
443
|
- docs/TASK_EXECUTION_CONTROL_FLOW.md
|
451
444
|
- docs/TELEMETRY.md
|
452
445
|
- docs/TROUBLESHOOTING.md
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# typed: false
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require_dependency 'tasker/application_controller'
|
5
|
-
|
6
|
-
module Tasker
|
7
|
-
class TaskDiagramsController < ApplicationController
|
8
|
-
include ActionController::MimeResponds
|
9
|
-
|
10
|
-
before_action :set_full_task, only: %i[index]
|
11
|
-
|
12
|
-
# GET /tasks/1/task_diagrams
|
13
|
-
def index
|
14
|
-
respond_to do |format|
|
15
|
-
format.html { render(html: @task.diagram(request.base_url).to_html.html_safe) }
|
16
|
-
format.json { render(json: @task.diagram(request.base_url).to_json, status: :ok) }
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def set_full_task
|
23
|
-
@task = query_base.find(params[:task_id])
|
24
|
-
end
|
25
|
-
|
26
|
-
def query_base
|
27
|
-
Tasker::Task.with_all_associated
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,106 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Tasker
|
4
|
-
module Diagram
|
5
|
-
# Represents an edge (connection) between nodes in a flowchart diagram
|
6
|
-
class Edge
|
7
|
-
# @return [String] The ID of the source node
|
8
|
-
attr_accessor :source_id
|
9
|
-
|
10
|
-
# @return [String] The ID of the target node
|
11
|
-
attr_accessor :target_id
|
12
|
-
|
13
|
-
# @return [String] The label to display on the edge
|
14
|
-
attr_accessor :label
|
15
|
-
|
16
|
-
# @return [String] The type of edge (e.g., 'solid', 'dashed')
|
17
|
-
attr_accessor :type
|
18
|
-
|
19
|
-
# @return [String] Direction of the arrow (e.g., 'forward', 'back', 'both', 'none')
|
20
|
-
attr_accessor :direction
|
21
|
-
|
22
|
-
# @return [Hash] Additional attributes for the edge
|
23
|
-
attr_accessor :attributes
|
24
|
-
|
25
|
-
# Define constants for style mappings
|
26
|
-
EDGE_STYLES = {
|
27
|
-
'dashed' => '--',
|
28
|
-
'thick' => '==',
|
29
|
-
'dotted' => '-.-',
|
30
|
-
'solid' => '--' # Default
|
31
|
-
}.freeze
|
32
|
-
|
33
|
-
ARROW_STYLES = {
|
34
|
-
'back' => '<',
|
35
|
-
'both' => '<>',
|
36
|
-
'none' => '',
|
37
|
-
'forward' => '>' # Default
|
38
|
-
}.freeze
|
39
|
-
|
40
|
-
# Creates a new diagram edge
|
41
|
-
#
|
42
|
-
# @param source_id [String] The ID of the source node
|
43
|
-
# @param target_id [String] The ID of the target node
|
44
|
-
# @param label [String] The label to display on the edge
|
45
|
-
# @param type [String] The type of edge (default: 'solid')
|
46
|
-
# @param direction [String] Direction of the arrow (default: 'forward')
|
47
|
-
# @param attributes [Hash] Additional attributes for the edge
|
48
|
-
# @return [Edge] A new diagram edge
|
49
|
-
def initialize(source_id:, target_id:, label: '', type: 'solid', direction: 'forward', attributes: {})
|
50
|
-
@source_id = source_id
|
51
|
-
@target_id = target_id
|
52
|
-
@label = label
|
53
|
-
@type = type
|
54
|
-
@direction = direction
|
55
|
-
@attributes = attributes
|
56
|
-
end
|
57
|
-
|
58
|
-
# Convert the edge to a hash representation
|
59
|
-
#
|
60
|
-
# @return [Hash] Hash representation of the edge
|
61
|
-
def to_h
|
62
|
-
{
|
63
|
-
source_id: source_id,
|
64
|
-
target_id: target_id,
|
65
|
-
label: label,
|
66
|
-
type: type,
|
67
|
-
direction: direction,
|
68
|
-
attributes: attributes
|
69
|
-
}.compact
|
70
|
-
end
|
71
|
-
|
72
|
-
# Convert the edge to a JSON string
|
73
|
-
#
|
74
|
-
# @return [String] JSON representation of the edge
|
75
|
-
def to_json(*)
|
76
|
-
to_h.to_json(*)
|
77
|
-
end
|
78
|
-
|
79
|
-
# Generate Mermaid diagram syntax for this edge
|
80
|
-
#
|
81
|
-
# @return [String] Mermaid syntax for the edge
|
82
|
-
def to_mermaid
|
83
|
-
# For labeled edges, use the |label| syntax instead of adding a separate text label
|
84
|
-
if label&.present? # rubocop:disable Lint/RedundantSafeNavigation
|
85
|
-
"#{source_id} -->|\"#{escape_mermaid_text(label)}\"| #{target_id}"
|
86
|
-
else
|
87
|
-
"#{source_id} --> #{target_id}"
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
private
|
92
|
-
|
93
|
-
# Escape special characters in Mermaid text
|
94
|
-
#
|
95
|
-
# @param text [String] The text to escape
|
96
|
-
# @return [String] Escaped text safe for Mermaid diagrams
|
97
|
-
def escape_mermaid_text(text)
|
98
|
-
# Handle nil values
|
99
|
-
return '' if text.nil?
|
100
|
-
|
101
|
-
# Replace instances of " with ' to avoid breaking the Mermaid syntax
|
102
|
-
text.to_s.tr('"', "'")
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
@@ -1,137 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Tasker
|
4
|
-
module Diagram
|
5
|
-
# Represents a flowchart diagram with nodes and edges
|
6
|
-
class Flowchart
|
7
|
-
# @return [Array<Tasker::Diagram::Node>] The nodes in the flowchart
|
8
|
-
attr_accessor :nodes
|
9
|
-
|
10
|
-
# @return [Array<Tasker::Diagram::Edge>] The edges in the flowchart
|
11
|
-
attr_accessor :edges
|
12
|
-
|
13
|
-
# @return [String] The direction of the flowchart (TD: top-down, LR: left-right, etc.)
|
14
|
-
attr_accessor :direction
|
15
|
-
|
16
|
-
# @return [String] The title of the flowchart
|
17
|
-
attr_accessor :title
|
18
|
-
|
19
|
-
# @return [Hash] Additional attributes for the flowchart
|
20
|
-
attr_accessor :attributes
|
21
|
-
|
22
|
-
# Creates a new flowchart diagram
|
23
|
-
#
|
24
|
-
# @param nodes [Array<Tasker::Diagram::Node>] The nodes in the flowchart
|
25
|
-
# @param edges [Array<Tasker::Diagram::Edge>] The edges in the flowchart
|
26
|
-
# @param direction [String] The direction of the flowchart (default: 'TD')
|
27
|
-
# @param title [String, nil] The title of the flowchart
|
28
|
-
# @param attributes [Hash] Additional attributes for the flowchart
|
29
|
-
# @return [Flowchart] A new flowchart diagram
|
30
|
-
def initialize(nodes: [], edges: [], direction: 'TD', title: nil, attributes: {})
|
31
|
-
@nodes = nodes
|
32
|
-
@edges = edges
|
33
|
-
@direction = direction
|
34
|
-
@title = title
|
35
|
-
@attributes = attributes
|
36
|
-
end
|
37
|
-
|
38
|
-
# Add a node to the flowchart
|
39
|
-
#
|
40
|
-
# @param node [Tasker::Diagram::Node] The node to add
|
41
|
-
# @return [Tasker::Diagram::Node] The added node
|
42
|
-
def add_node(node)
|
43
|
-
@nodes << node
|
44
|
-
node
|
45
|
-
end
|
46
|
-
|
47
|
-
# Add an edge to the flowchart
|
48
|
-
#
|
49
|
-
# @param edge [Tasker::Diagram::Edge] The edge to add
|
50
|
-
# @return [Tasker::Diagram::Edge] The added edge
|
51
|
-
def add_edge(edge)
|
52
|
-
@edges << edge
|
53
|
-
edge
|
54
|
-
end
|
55
|
-
|
56
|
-
# Find a node by its ID
|
57
|
-
#
|
58
|
-
# @param id [String] The ID of the node to find
|
59
|
-
# @return [Tasker::Diagram::Node, nil] The node with the given ID, or nil if not found
|
60
|
-
def find_node(id)
|
61
|
-
@nodes.find { |node| node.id == id }
|
62
|
-
end
|
63
|
-
|
64
|
-
# Find all edges connected to a node
|
65
|
-
#
|
66
|
-
# @param node_id [String] The ID of the node
|
67
|
-
# @param direction [Symbol] :outgoing, :incoming, or :both (default: :both)
|
68
|
-
# @return [Array<Tasker::Diagram::Edge>] The edges connected to the node
|
69
|
-
def find_edges_for_node(node_id, direction = :both)
|
70
|
-
case direction
|
71
|
-
when :outgoing
|
72
|
-
@edges.select { |edge| edge.source_id == node_id }
|
73
|
-
when :incoming
|
74
|
-
@edges.select { |edge| edge.target_id == node_id }
|
75
|
-
else
|
76
|
-
@edges.select { |edge| edge.source_id == node_id || edge.target_id == node_id }
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
# Convert the flowchart to a hash representation
|
81
|
-
#
|
82
|
-
# @return [Hash] Hash representation of the flowchart
|
83
|
-
def to_h
|
84
|
-
{
|
85
|
-
nodes: nodes.map(&:to_h),
|
86
|
-
edges: edges.map(&:to_h),
|
87
|
-
direction: direction,
|
88
|
-
title: title,
|
89
|
-
attributes: attributes
|
90
|
-
}.compact
|
91
|
-
end
|
92
|
-
|
93
|
-
# Convert the flowchart to a JSON string
|
94
|
-
#
|
95
|
-
# @return [String] JSON representation of the flowchart
|
96
|
-
def to_json(*)
|
97
|
-
to_h.to_json(*)
|
98
|
-
end
|
99
|
-
|
100
|
-
# Generate Mermaid diagram syntax for this flowchart
|
101
|
-
#
|
102
|
-
# @return [String] Mermaid syntax for the flowchart
|
103
|
-
def to_mermaid
|
104
|
-
lines = []
|
105
|
-
|
106
|
-
# Add the flowchart definition
|
107
|
-
lines << "graph #{direction}"
|
108
|
-
|
109
|
-
# Use a subgraph with title if title is present
|
110
|
-
if title
|
111
|
-
lines << "subgraph \"#{title}\""
|
112
|
-
indent = ' '
|
113
|
-
else
|
114
|
-
indent = ''
|
115
|
-
end
|
116
|
-
|
117
|
-
# Add all nodes
|
118
|
-
nodes.each do |node|
|
119
|
-
node.to_mermaid.each do |line|
|
120
|
-
lines << "#{indent}#{line}"
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
# Add all edges
|
125
|
-
edges.each do |edge|
|
126
|
-
lines << "#{indent}#{edge.to_mermaid}"
|
127
|
-
end
|
128
|
-
|
129
|
-
# Close the subgraph if we have a title
|
130
|
-
lines << 'end' if title
|
131
|
-
|
132
|
-
# Join all lines with newlines
|
133
|
-
lines.join("\n")
|
134
|
-
end
|
135
|
-
end
|
136
|
-
end
|
137
|
-
end
|
@@ -1,99 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Tasker
|
4
|
-
module Diagram
|
5
|
-
# Represents a node in a flowchart diagram
|
6
|
-
class Node
|
7
|
-
# @return [String] The unique identifier for this node
|
8
|
-
attr_accessor :id
|
9
|
-
|
10
|
-
# @return [String] The display label for this node
|
11
|
-
attr_accessor :label
|
12
|
-
|
13
|
-
# @return [String] The shape of the node (e.g., 'box', 'circle', 'diamond')
|
14
|
-
attr_accessor :shape
|
15
|
-
|
16
|
-
# @return [String] CSS styling for the node
|
17
|
-
attr_accessor :style
|
18
|
-
|
19
|
-
# @return [String, nil] URL to link to when clicking the node
|
20
|
-
attr_accessor :url
|
21
|
-
|
22
|
-
# @return [Hash] Additional attributes for the node
|
23
|
-
attr_accessor :attributes
|
24
|
-
|
25
|
-
# Creates a new diagram node
|
26
|
-
#
|
27
|
-
# @param id [String] The unique identifier for this node
|
28
|
-
# @param label [String] The display label for this node
|
29
|
-
# @param shape [String] The shape of the node (default: 'box')
|
30
|
-
# @param style [String, nil] CSS styling for the node
|
31
|
-
# @param url [String, nil] URL to link to when clicking the node
|
32
|
-
# @param attributes [Hash] Additional attributes for the node
|
33
|
-
# @return [Node] A new diagram node
|
34
|
-
def initialize(id:, label:, shape: 'box', style: nil, url: nil, attributes: {})
|
35
|
-
@id = id
|
36
|
-
@label = label
|
37
|
-
@shape = shape
|
38
|
-
@style = style
|
39
|
-
@url = url
|
40
|
-
@attributes = attributes
|
41
|
-
end
|
42
|
-
|
43
|
-
# Convert the node to a hash representation
|
44
|
-
#
|
45
|
-
# @return [Hash] Hash representation of the node
|
46
|
-
def to_h
|
47
|
-
{
|
48
|
-
id: id,
|
49
|
-
label: label,
|
50
|
-
shape: shape,
|
51
|
-
style: style,
|
52
|
-
url: url,
|
53
|
-
attributes: attributes
|
54
|
-
}.compact
|
55
|
-
end
|
56
|
-
|
57
|
-
# Convert the node to a JSON string
|
58
|
-
#
|
59
|
-
# @return [String] JSON representation of the node
|
60
|
-
def to_json(*)
|
61
|
-
to_h.to_json(*)
|
62
|
-
end
|
63
|
-
|
64
|
-
# Generate Mermaid diagram syntax for this node
|
65
|
-
#
|
66
|
-
# @return [Array<String>] Array of Mermaid syntax lines for the node
|
67
|
-
def to_mermaid
|
68
|
-
# Use HTML line breaks in the label
|
69
|
-
formatted_label = escape_mermaid_text(label).gsub("\n", '<br/>')
|
70
|
-
|
71
|
-
# Basic node definition
|
72
|
-
node_def = "#{id}[\"#{formatted_label}\"]"
|
73
|
-
|
74
|
-
# Add URL link if present
|
75
|
-
click_def = url ? "click #{id} \"#{escape_mermaid_text(url)}\"" : nil
|
76
|
-
|
77
|
-
# Add style definition if present
|
78
|
-
style_def = style ? "style #{id} #{style}" : nil
|
79
|
-
|
80
|
-
# Return node definition and optional click and style definitions
|
81
|
-
[node_def, click_def, style_def].compact
|
82
|
-
end
|
83
|
-
|
84
|
-
private
|
85
|
-
|
86
|
-
# Escape special characters in Mermaid text
|
87
|
-
#
|
88
|
-
# @param text [String] The text to escape
|
89
|
-
# @return [String] Escaped text safe for Mermaid diagrams
|
90
|
-
def escape_mermaid_text(text)
|
91
|
-
# Handle nil values
|
92
|
-
return '' if text.nil?
|
93
|
-
|
94
|
-
# Replace instances of " with ' to avoid breaking the Mermaid syntax
|
95
|
-
text.to_s.tr('"', "'")
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|