├── tests
└── README.md
├── scripts
└── README.md
├── src
├── didact-cli
│ ├── README.md
│ ├── appsettings.Staging.json
│ ├── appsettings.Development.json
│ ├── appsettings.Production.json
│ ├── Constants
│ │ └── CliConstants.cs
│ ├── Settings
│ │ ├── VersionCommandSettings.cs
│ │ ├── TestCommandSettings.cs
│ │ ├── UiInstallCommandSettings.cs
│ │ └── EngineInstallCommandSettings.cs
│ ├── appsettings.json
│ ├── Commands
│ │ ├── TestCommand.cs
│ │ ├── VersionCommand.cs
│ │ ├── UiInstallCommand.cs
│ │ └── EngineInstallCommand.cs
│ ├── Services
│ │ ├── AppSettings.cs
│ │ ├── TypeResolver.cs
│ │ └── TypeRegistrar.cs
│ ├── Properties
│ │ └── launchsettings.json
│ ├── DidactCli.csproj
│ └── Program.cs
├── didact-core
│ ├── README.md
│ ├── Triggers
│ │ ├── ICronScheduleTrigger.cs
│ │ ├── ITrigger.cs
│ │ └── CronScheduleTrigger.cs
│ ├── Deployments
│ │ └── IDeploymentContext.cs
│ ├── Environments
│ │ └── IEnvironmentContext.cs
│ ├── Flows
│ │ ├── IFlowContext.cs
│ │ ├── IFlowLogger.cs
│ │ ├── IFlowConfigurationContext.cs
│ │ ├── IFlowRunContext.cs
│ │ ├── IFlowExecutionContext.cs
│ │ ├── IFlow.cs
│ │ └── IFlowConfigurator.cs
│ ├── Constants
│ │ └── Defaults.cs
│ ├── Plugins
│ │ └── IPluginRegistrar.cs
│ ├── DidactCore.csproj
│ └── SomeFlow.cs
├── didact-ui
│ ├── README.md
│ ├── nuxt-app
│ │ ├── public
│ │ │ ├── robots.txt
│ │ │ └── favicon.ico
│ │ ├── assets
│ │ │ └── css
│ │ │ │ └── main.css
│ │ ├── server
│ │ │ └── tsconfig.json
│ │ ├── .env.example
│ │ ├── tsconfig.json
│ │ ├── utils
│ │ │ ├── environment
│ │ │ │ └── index.ts
│ │ │ └── environment-variables
│ │ │ │ └── index.ts
│ │ ├── package.json
│ │ ├── README.md
│ │ ├── nuxt.config.ts
│ │ └── app.vue
│ └── dotnet-app
│ │ ├── appsettings.Staging.json
│ │ ├── appsettings.Production.json
│ │ ├── DidactUi.http
│ │ ├── appsettings.Development.json
│ │ ├── wwwroot
│ │ └── README.md
│ │ ├── Services
│ │ └── UiSettings.cs
│ │ ├── appsettings.json
│ │ ├── Constants
│ │ └── UiConstants.cs
│ │ ├── Exceptions
│ │ └── MissingEnvironmentVariableException.cs
│ │ ├── Controllers
│ │ └── EnvironmentVariablesController.cs
│ │ ├── DidactUi.csproj
│ │ ├── Properties
│ │ └── launchSettings.json
│ │ └── Program.cs
├── didact-engine
│ ├── README.md
│ ├── appsettings.Staging.json
│ ├── appsettings.Production.json
│ ├── Licensing
│ │ ├── LicenseChecker.cs
│ │ ├── FeatureValidator.cs
│ │ ├── LicensingService.cs
│ │ ├── didact-prod-license-server-encryption-key.pem
│ │ └── LicenseValidator.cs
│ ├── Engine
│ │ ├── EngineSettings.cs
│ │ ├── EngineContext.cs
│ │ ├── IEngineService.cs
│ │ ├── EngineDto.cs
│ │ ├── IEngineRepository.cs
│ │ ├── EngineTuningDto.cs
│ │ ├── EngineTuningContext.cs
│ │ ├── IEngineSupervisor.cs
│ │ ├── EngineRepository.cs
│ │ ├── EngineService.cs
│ │ └── EngineSupervisor.cs
│ ├── Plugins
│ │ ├── DeploymentPluginContext.cs
│ │ ├── ShadowCopyService.cs
│ │ ├── NoMatchedPluginException.cs
│ │ ├── MultipleMatchedPluginsException.cs
│ │ ├── PluginsModule.cs
│ │ ├── PluginsService.cs
│ │ ├── PluginAssemblyLoadContext.cs
│ │ ├── PluginDependencyInjector.cs
│ │ ├── IPluginContainer.cs
│ │ ├── IPluginDependencyInjector.cs
│ │ ├── IPluginContainers.cs
│ │ ├── PluginExecutionVersion.cs
│ │ ├── PluginContainers.cs
│ │ └── PluginContainer.cs
│ ├── Flows
│ │ ├── FlowRunRepository.cs
│ │ ├── FlowTypeNotFoundException.cs
│ │ ├── SaveFlowConfigurationsException.cs
│ │ ├── FlowExecutionContext.cs
│ │ ├── FlowConfigurator.cs
│ │ └── IFlowRepository.cs
│ ├── appsettings.Development.json
│ ├── Logging
│ │ ├── EngineLogDto.cs
│ │ ├── FlowRunLogDto.cs
│ │ ├── EngineLogChannel.cs
│ │ ├── FlowRunLogChannel.cs
│ │ ├── EngineLoggerModule.cs
│ │ └── FlowRunLoggerModule.cs
│ ├── appsettings.json
│ ├── Threading
│ │ ├── ThreadpoolService.cs
│ │ └── DidactThreadpoolTaskScheduler.cs
│ ├── Scheduler
│ │ ├── SchedulerService.cs
│ │ └── SchedulerModule.cs
│ ├── Modules
│ │ ├── IModule.cs
│ │ ├── ModuleContext.cs
│ │ └── ModuleSupervisor.cs
│ ├── Constants
│ │ ├── Defaults.cs
│ │ └── EngineConstants.cs
│ ├── Deployments
│ │ └── DeploymentsService.cs
│ ├── Workers
│ │ └── WorkersModule.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── Controllers
│ │ └── MaintenanceController.cs
│ ├── DidactEngine.csproj
│ └── Services
│ │ └── BackgroundServices
│ │ └── WorkerBackgroundService.cs
├── didact-primitives
│ ├── Constants
│ │ ├── Defaults.cs
│ │ ├── ExecutionModes.cs
│ │ ├── TriggerTypes.cs
│ │ ├── TriggerScopes.cs
│ │ ├── FlowRunEventTypes.cs
│ │ ├── BlockStates.cs
│ │ ├── FlowLibrarySourceTypes.cs
│ │ ├── FlowConfiguratorStates.cs
│ │ └── QueueTypes.cs
│ └── DidactPrimitives.csproj
├── didact-services
│ ├── Deployments
│ │ └── DeploymentContext.cs
│ ├── Environments
│ │ └── EnvironmentContext.cs
│ ├── Flows
│ │ ├── FlowContext.cs
│ │ └── IFlowRunRepository.cs
│ ├── FlowRuns
│ │ └── FlowRunContext.cs
│ ├── Workers
│ │ ├── IWorkerContext.cs
│ │ └── WorkerContext.cs
│ ├── DataModel
│ │ ├── Entities
│ │ │ ├── ScheduleType.cs
│ │ │ ├── TriggerScope.cs
│ │ │ ├── DeploymentType.cs
│ │ │ ├── QueueDirection.cs
│ │ │ ├── DeploymentStatus.cs
│ │ │ ├── FlowRunEventType.cs
│ │ │ ├── CronScheduleTrigger.cs
│ │ │ ├── DeploymentSourceType.cs
│ │ │ ├── Environment.cs
│ │ │ ├── DeploymentSourceFilesystem.cs
│ │ │ ├── TriggerType.cs
│ │ │ ├── State.cs
│ │ │ ├── ExecutionMode.cs
│ │ │ ├── FlowRunStateChangeEvent.cs
│ │ │ ├── HyperQueueItem.cs
│ │ │ ├── StrictQueueItem.cs
│ │ │ ├── Trigger.cs
│ │ │ ├── FlowRunEvent.cs
│ │ │ ├── FlowRunLogEvent.cs
│ │ │ ├── FlowVersion.cs
│ │ │ ├── Deployment.cs
│ │ │ ├── Engine.cs
│ │ │ ├── HyperQueue.cs
│ │ │ ├── StrictQueue.cs
│ │ │ ├── FlowSchedule.cs
│ │ │ ├── BlockRun.cs
│ │ │ ├── Flow.cs
│ │ │ ├── Organization.cs
│ │ │ └── FlowRun.cs
│ │ ├── Configurations
│ │ │ ├── StateConfiguration.cs
│ │ │ ├── StrictQueueConfiguration.cs
│ │ │ ├── HyperQueueConfiguration.cs
│ │ │ ├── TriggerTypeConfiguration.cs
│ │ │ ├── OrganizationConfiguration.cs
│ │ │ ├── ScheduleTypeConfiguration.cs
│ │ │ ├── FlowScheduleConfiguration.cs
│ │ │ ├── EngineConfiguration.cs
│ │ │ ├── FlowConfiguration.cs
│ │ │ ├── HyperQueueItemConfiguration.cs
│ │ │ ├── StrictQueueItemConfiguration.cs
│ │ │ ├── BlockRunConfiguration.cs
│ │ │ └── FlowRunConfiguration.cs
│ │ ├── Migrations
│ │ │ └── MigrationExtensions.cs
│ │ └── Contexts
│ │ │ └── DidactDbContext.cs
│ ├── DidactServices.csproj
│ ├── Constants
│ │ └── Constants.cs
│ └── HostAppEnvironments
│ │ └── HostAppEnvironmentService.cs
├── versions.json
└── Didact.sln
├── LICENSE.md
├── README.md
└── LICENSE-COMM.md
/tests/README.md:
--------------------------------------------------------------------------------
1 | # Tests
--------------------------------------------------------------------------------
/scripts/README.md:
--------------------------------------------------------------------------------
1 | # Scripts
--------------------------------------------------------------------------------
/src/didact-cli/README.md:
--------------------------------------------------------------------------------
1 | # Didact CLI
--------------------------------------------------------------------------------
/src/didact-core/README.md:
--------------------------------------------------------------------------------
1 | # Didact Core
--------------------------------------------------------------------------------
/src/didact-ui/README.md:
--------------------------------------------------------------------------------
1 | # Didact UI
--------------------------------------------------------------------------------
/src/didact-engine/README.md:
--------------------------------------------------------------------------------
1 | # Didact Engine
--------------------------------------------------------------------------------
/src/didact-engine/appsettings.Staging.json:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/didact-engine/appsettings.Production.json:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/didact-ui/nuxt-app/public/robots.txt:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/didact-cli/appsettings.Staging.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/didact-cli/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/didact-cli/appsettings.Production.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/src/didact-ui/nuxt-app/assets/css/main.css:
--------------------------------------------------------------------------------
1 | @import "tailwindcss";
--------------------------------------------------------------------------------
/src/didact-ui/dotnet-app/appsettings.Staging.json:
--------------------------------------------------------------------------------
1 | {
2 | "NuxtDevServerUrl": "http://localhost:3000"
3 | }
--------------------------------------------------------------------------------
/src/didact-ui/nuxt-app/server/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../.nuxt/tsconfig.server.json"
3 | }
4 |
--------------------------------------------------------------------------------
/src/didact-ui/dotnet-app/appsettings.Production.json:
--------------------------------------------------------------------------------
1 | {
2 | "NuxtDevServerUrl": "http://localhost:3000"
3 | }
--------------------------------------------------------------------------------
/src/didact-ui/nuxt-app/.env.example:
--------------------------------------------------------------------------------
1 | VITE_ENVIRONMENT_VARIABLES_DEV_BASE_URL = '' # The base URL for the containing dotnet web api.
--------------------------------------------------------------------------------
/src/didact-ui/nuxt-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DidactHQ/didact/HEAD/src/didact-ui/nuxt-app/public/favicon.ico
--------------------------------------------------------------------------------
/src/didact-cli/Constants/CliConstants.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCli.Constants
2 | {
3 | public static class CliConstants
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/src/didact-ui/nuxt-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | // https://nuxt.com/docs/guide/concepts/typescript
3 | "extends": "./.nuxt/tsconfig.json"
4 | }
5 |
--------------------------------------------------------------------------------
/src/didact-engine/Licensing/LicenseChecker.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Licensing
2 | {
3 | public class LicenseChecker
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/didact-engine/Licensing/FeatureValidator.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Licensing
2 | {
3 | public class FeatureValidator
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/didact-engine/Engine/EngineSettings.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Engine
2 | {
3 | public class EngineSettings
4 | {
5 | // TODO
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/didact-engine/Plugins/DeploymentPluginContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Plugins
2 | {
3 | public class DeploymentPluginContext
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/didact-engine/Flows/FlowRunRepository.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Flows
2 | {
3 | public class FlowRunRepository
4 | {
5 | // TODO Implement
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/didact-ui/dotnet-app/DidactUi.http:
--------------------------------------------------------------------------------
1 | @DidactUi_HostAddress = http://localhost:5289
2 |
3 | GET {{DidactUi_HostAddress}}/weatherforecast/
4 | Accept: application/json
5 |
6 | ###
7 |
--------------------------------------------------------------------------------
/src/didact-engine/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/didact-cli/Settings/VersionCommandSettings.cs:
--------------------------------------------------------------------------------
1 | using Spectre.Console.Cli;
2 |
3 | namespace DidactCli.Settings
4 | {
5 | public class VersionCommandSettings : CommandSettings
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/didact-core/Triggers/ICronScheduleTrigger.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Triggers
2 | {
3 | public interface ICronScheduleTrigger : ITrigger
4 | {
5 | string CronExpression { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/didact-primitives/Constants/Defaults.cs:
--------------------------------------------------------------------------------
1 | namespace DidactPrimitives.Constants
2 | {
3 | public static class Defaults
4 | {
5 | public const string DefaultEnvironmentName = "Default";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/didact-primitives/DidactPrimitives.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 | enable
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/didact-engine/Engine/EngineContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Engine
2 | {
3 | public class EngineContext
4 | {
5 | public long EngineId { get; set; }
6 |
7 | public Guid UniversalId { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/didact-primitives/Constants/ExecutionModes.cs:
--------------------------------------------------------------------------------
1 | namespace DidactPrimitives.Constants
2 | {
3 | public static class ExecutionModes
4 | {
5 | public const string Auto = "Auto";
6 | public const string Deferred = "Deferred";
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/didact-ui/dotnet-app/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "NuxtDevServerUrl": "http://localhost:3000"
9 | }
10 |
--------------------------------------------------------------------------------
/src/didact-ui/nuxt-app/utils/environment/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Determines if the single page app is currently running within the Nuxt dev server or not.
3 | * @returns
4 | */
5 | const isDev = () => {
6 | return import.meta.dev;
7 | }
8 |
9 | export { isDev }
--------------------------------------------------------------------------------
/src/didact-services/Deployments/DeploymentContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Deployments
2 | {
3 | public class DeploymentContext
4 | {
5 | public long DeploymentId { get; set; }
6 |
7 | public string? Name { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/didact-core/Deployments/IDeploymentContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Deployments
2 | {
3 | public interface IDeploymentContext
4 | {
5 | public long DeploymentId { get; set; }
6 |
7 | public string? Name { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/didact-core/Environments/IEnvironmentContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Environments
2 | {
3 | public interface IEnvironmentContext
4 | {
5 | public long EnvironmentId { get; set; }
6 |
7 | public string Name { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/didact-services/Environments/EnvironmentContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Environments
2 | {
3 | public class EnvironmentContext
4 | {
5 | public long EnvironmentId { get; set; }
6 |
7 | public string Name { get; set; } = null!;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/didact-ui/dotnet-app/wwwroot/README.md:
--------------------------------------------------------------------------------
1 | # Nuxt App
2 |
3 | The transpiled Nuxt app, where Didact UI is actually defined, goes into this folder.
4 |
5 | This dotnet host application is like a server-side wrapper around the Nuxt app. Together, they define the composite Didact UI application.
--------------------------------------------------------------------------------
/src/didact-core/Flows/IFlowContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Flows
2 | {
3 | public interface IFlowContext
4 | {
5 | public long FlowId { get; set; }
6 |
7 | public string? Name { get; set; }
8 |
9 | public string TypeName { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/didact-cli/Settings/TestCommandSettings.cs:
--------------------------------------------------------------------------------
1 | using Spectre.Console.Cli;
2 |
3 | namespace DidactCli.Settings
4 | {
5 | public class TestCommandSettings : CommandSettings
6 | {
7 | [CommandArgument(0, "[abcd]")]
8 | public string Version { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/didact-services/Flows/FlowContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Flows
2 | {
3 | public class FlowContext
4 | {
5 | public long FlowId { get; set; }
6 |
7 | public string? Name { get; set; }
8 |
9 | public string TypeName { get; set; } = null!;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/didact-ui/dotnet-app/Services/UiSettings.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 |
3 | namespace DidactUi.Services
4 | {
5 | public class UiSettings
6 | {
7 | [JsonPropertyName("didactEngineBaseUrl")]
8 | public string DidactEngineBaseUrl { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/didact-core/Flows/IFlowLogger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactCore.Flows
4 | {
5 | public interface IFlowLogger
6 | {
7 | void LogInformation(string message, params object[] args);
8 |
9 | void LogError(Exception ex, string message, params object[] args);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/didact-engine/Engine/IEngineService.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Engine
2 | {
3 | public interface IEngineService
4 | {
5 | EngineContext? EngineContext { get; }
6 |
7 | CancellationToken CancellationToken { get; }
8 |
9 | Task PollEngineShutdownAsync();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/didact-engine/Logging/EngineLogDto.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Logging
2 | {
3 | public class EngineLogDto
4 | {
5 | public string LogLevel { get; set; } = null!;
6 |
7 | public string Message { get; set; } = null!;
8 |
9 | public DateTime Timestamp { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/didact-engine/Logging/FlowRunLogDto.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Logging
2 | {
3 | public class FlowRunLogDto
4 | {
5 | public string LogLevel { get; set; } = null!;
6 |
7 | public string Message { get; set; } = null!;
8 |
9 | public DateTime Timestamp { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/versions.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://console.didact.dev/schema/versions.json",
3 | "platform": {
4 | "version": "v0",
5 | "componentVersions": {
6 | "ui": "v0",
7 | "engine": "v0",
8 | "cli": "v0",
9 | "core": "v0"
10 | },
11 | "componentVersionsHash": ""
12 | }
13 | }
--------------------------------------------------------------------------------
/src/didact-engine/Engine/EngineDto.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Engine
2 | {
3 | public class EngineDto
4 | {
5 | // TODO Implement
6 | public long EngineId { get; set; }
7 |
8 | public string UniqueName { get; set; } = null!;
9 |
10 | public string? Name { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/didact-cli/Settings/UiInstallCommandSettings.cs:
--------------------------------------------------------------------------------
1 | using Spectre.Console.Cli;
2 |
3 | namespace DidactCli.Settings
4 | {
5 | public class UiInstallCommandSettings : CommandSettings
6 | {
7 | [CommandOption("-p|--path ")]
8 | public string InstallationPath { get; set; } = null!;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/didact-ui/dotnet-app/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*",
9 | "NuxtDevServerUrl": "http://localhost:3000",
10 | "DidactConsole": {
11 | "BaseUrl": ""
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/didact-core/Triggers/ITrigger.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Triggers
2 | {
3 | public interface ITrigger
4 | {
5 | public string TriggerType { get; }
6 |
7 | public string TriggerScope { get; set; }
8 |
9 | public string? Name { get; set; }
10 |
11 | public string? Description { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/didact-engine/Licensing/LicensingService.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Licensing
2 | {
3 | public class LicensingService
4 | {
5 | private readonly ILogger _logger;
6 |
7 | public LicensingService(ILogger logger)
8 | {
9 | _logger = logger;
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/didact-engine/Engine/IEngineRepository.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace DidactCore.Engine
4 | {
5 | public interface IEngineRepository
6 | {
7 | Task CheckForEngineShutdownAsync();
8 |
9 | Task GetEngineAsync();
10 |
11 | Task GetEngineTuningAsync();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/didact-engine/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*",
9 | "ConnectionStrings": {
10 | "Didact": "Data Source=localhost;Initial Catalog=Didact;Integrated Security=true"
11 | },
12 | "Didact": {
13 | }
14 | }
--------------------------------------------------------------------------------
/src/didact-cli/Settings/EngineInstallCommandSettings.cs:
--------------------------------------------------------------------------------
1 | using Spectre.Console.Cli;
2 |
3 | namespace DidactCli.Settings
4 | {
5 | public class EngineInstallCommandSettings : CommandSettings
6 | {
7 | [CommandOption("-p|--path ")]
8 | // Add default path?
9 | public string InstallationPath { get; set; } = null!;
10 | }
11 | }
--------------------------------------------------------------------------------
/src/didact-primitives/Constants/TriggerTypes.cs:
--------------------------------------------------------------------------------
1 | namespace DidactPrimitives.Constants
2 | {
3 | public static class TriggerTypes
4 | {
5 | public const string API = "API";
6 | public const string UI = "UI";
7 | public const string CronSchedule = "CRON Schedule";
8 | public const string FlowRun = "Flow Run";
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/didact-primitives/Constants/TriggerScopes.cs:
--------------------------------------------------------------------------------
1 | namespace DidactPrimitives.Constants
2 | {
3 | public static class TriggerScopes
4 | {
5 | public const string Universal = "Universal";
6 | public const string Organization = "Organization";
7 | public const string Environment = "Environment";
8 | public const string Flow = "Flow";
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/didact-cli/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "MyCommand": "Debug"
6 | }
7 | },
8 | "DidactEngine": {
9 | "RuntimeEnvironmentVariablesFileName": "enginesettings.json"
10 | },
11 | "DidactUi": {
12 | "RuntimeEnvironmentVariablesFileName": "uisettings.json"
13 | },
14 | "TestSetting": "Hello worldddddd!"
15 | }
--------------------------------------------------------------------------------
/src/didact-cli/Commands/TestCommand.cs:
--------------------------------------------------------------------------------
1 | using DidactCli.Settings;
2 | using Spectre.Console.Cli;
3 |
4 | namespace DidactCli.Commands
5 | {
6 | public class TestCommand : Command
7 | {
8 | public override int Execute(CommandContext context, TestCommandSettings settings)
9 | {
10 | // Omitted
11 | return 0;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/didact-core/Flows/IFlowConfigurationContext.cs:
--------------------------------------------------------------------------------
1 | using DidactCore.Deployments;
2 | using DidactCore.Environments;
3 |
4 | namespace DidactCore.Flows
5 | {
6 | public interface IFlowConfigurationContext
7 | {
8 | IEnvironmentContext EnvironmentContext { get; }
9 |
10 | IDeploymentContext DeploymentContext { get; }
11 |
12 | IFlowConfigurator Configurator { get; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/didact-core/Flows/IFlowRunContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Flows
2 | {
3 | public interface IFlowRunContext
4 | {
5 | public long FlowRunId { get; set; }
6 |
7 | public long FlowVersionId { get; set; }
8 |
9 | public string FlowVersion { get; set; }
10 |
11 | public string? JsonPayload { get; set; }
12 |
13 | public int TimeoutSeconds { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/didact-ui/dotnet-app/Constants/UiConstants.cs:
--------------------------------------------------------------------------------
1 | namespace DidactUi.Constants
2 | {
3 | public static class UiConstants
4 | {
5 | public static class CorsPolicyNames
6 | {
7 | public const string Development = "DevelopmentCors";
8 | public const string Staging = "StagingCors";
9 | public const string Production = "ProductionCors";
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/didact-engine/Engine/EngineTuningDto.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Engine
2 | {
3 | public class EngineTuningDto
4 | {
5 | // TODO Implement
6 | public decimal ThreadFactor { get; set; }
7 |
8 | public decimal TaskFactor { get; set; }
9 |
10 | public int FlowRunCancellationCheckInterval { get; set; }
11 |
12 | public int EngineShutdownCheckInterval { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/didact-services/FlowRuns/FlowRunContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCore.Flows
2 | {
3 | public class FlowRunContext
4 | {
5 | public long FlowRunId { get; set; }
6 |
7 | public long FlowVersionId { get; set; }
8 |
9 | public string FlowVersion { get; set; } = null!;
10 |
11 | public string? JsonPayload { get; set; }
12 |
13 | public int TimeoutSeconds { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/didact-engine/Engine/EngineTuningContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Engine
2 | {
3 | public class EngineTuningContext
4 | {
5 | // TODO Implement
6 | public decimal ThreadFactor { get; set; }
7 |
8 | public decimal TaskFactor { get; set; }
9 |
10 | public int FlowRunCancellationCheckInterval { get; set; }
11 |
12 | public int EngineShutdownCheckInterval { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/didact-core/Constants/Defaults.cs:
--------------------------------------------------------------------------------
1 | using DidactPrimitives.Constants;
2 |
3 | namespace DidactCore.Constants
4 | {
5 | public static class Defaults
6 | {
7 | public const string DefaultFlowVersion = "1.0.0";
8 | public const string DefaultQueueType = QueueTypes.HyperQueue;
9 | public const string DefaultQueueName = "Default";
10 | public const string DefaultExecutionMode = ExecutionModes.Auto;
11 | }
12 | }
--------------------------------------------------------------------------------
/src/didact-core/Plugins/IPluginRegistrar.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace DidactCore.Plugins
4 | {
5 | public interface IPluginRegistrar
6 | {
7 | ///
8 | /// Registers plugin dependencies to be used in plugin-isolated dependency injection.
9 | ///
10 | ///
11 | IServiceCollection RegisterServices(IServiceCollection pluginServiceCollection);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/didact-engine/Logging/EngineLogChannel.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Channels;
2 |
3 | namespace DidactEngine.Logging
4 | {
5 | public class EngineLogChannel
6 | {
7 | private readonly Channel _channel;
8 |
9 | public Channel Channel => _channel;
10 |
11 | public EngineLogChannel()
12 | {
13 | _channel = System.Threading.Channels.Channel.CreateUnbounded();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/didact-engine/Logging/FlowRunLogChannel.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Channels;
2 |
3 | namespace DidactEngine.Logging
4 | {
5 | public class FlowRunLogChannel
6 | {
7 | private readonly Channel _channel;
8 |
9 | public Channel Channel => _channel;
10 |
11 | public FlowRunLogChannel()
12 | {
13 | _channel = System.Threading.Channels.Channel.CreateUnbounded();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/didact-engine/Licensing/didact-prod-license-server-encryption-key.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN PUBLIC KEY-----
2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArXcXnZQVLQiBEG2PwvdJ33vgk1UaqrvQ1+ZAr17IdhYSe1uuCZ4WTOfKT0u8P4HlcDKYq5KwegkBItR7uEhCu17gfGyJ/+nZzEddXSjAN97ar1e3yerr5SsVWKX5LRUtUOGrB8HpHgW5dSVvD8H1WJrvCdCH6NwxhMAZhiZgOMe2c5p4yyhz6HvzYydXlG7C+RH3da6FOAoYPFvzLX57WMZdYVRMtQ3kd28bxaa14HmqcSNsBbh3YOESUxKZH5spqv04xRUaJhI9CosgouoUTGdexremhnY+WkV2BYvXyUjTPPbWUS79F+Qrpi3He6MBl8Ud8pINW7XXf9jJ9HD1UQIDAQAB
3 | -----END PUBLIC KEY-----
--------------------------------------------------------------------------------
/src/didact-engine/Plugins/ShadowCopyService.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Plugins
2 | {
3 | public class ShadowCopyService
4 | {
5 | private readonly ILogger _logger;
6 |
7 | public ShadowCopyService(ILogger logger)
8 | {
9 | _logger = logger;
10 | }
11 |
12 | public async Task ShadowCopyDeployment(CancellationToken cancellationToken)
13 | {
14 | await Task.CompletedTask;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/didact-engine/Threading/ThreadpoolService.cs:
--------------------------------------------------------------------------------
1 | using DidactEngine.Constants;
2 |
3 | namespace DidactEngine.Threading
4 | {
5 | public class ThreadpoolService
6 | {
7 | public string ShutdownMode { get; private set; } = EngineConstants.ThreadpoolShutdownModes.Immediate;
8 |
9 | public decimal ThreadFactor { get; set; } = Defaults.DefaultThreadFactor;
10 |
11 | public CancellationToken CancellationToken { get; set; }
12 |
13 | public ThreadpoolService() { }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/didact-engine/Scheduler/SchedulerService.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Scheduler
2 | {
3 | public class SchedulerService
4 | {
5 | private readonly ILogger _logger;
6 |
7 | public SchedulerService(ILogger logger)
8 | {
9 | _logger = logger;
10 | }
11 |
12 | public async Task ScheduleAsync(CancellationToken cancellationToken)
13 | {
14 | // TODO Implement
15 | await Task.CompletedTask;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/didact-primitives/Constants/FlowRunEventTypes.cs:
--------------------------------------------------------------------------------
1 | namespace DidactPrimitives.Constants
2 | {
3 | public static class FlowRunEventTypes
4 | {
5 | public const string LogEvent = "Log Event";
6 | public const string StateChangeEvent = "State Change Event";
7 | public const string EngineEvent = "Engine Event";
8 | public const string SchedulerEvent = "Scheduler Event";
9 | public const string TriggerEvent = "Trigger Event";
10 | public const string BlockRunEvent = "Block Run Event";
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/didact-ui/dotnet-app/Exceptions/MissingEnvironmentVariableException.cs:
--------------------------------------------------------------------------------
1 | namespace DidactUi.Exceptions
2 | {
3 | [Serializable]
4 | public class MissingEnvironmentVariableException : Exception
5 | {
6 | public MissingEnvironmentVariableException()
7 | { }
8 |
9 | public MissingEnvironmentVariableException(string message) : base(message)
10 | { }
11 |
12 | public MissingEnvironmentVariableException(string message, Exception innerException) : base(message, innerException)
13 | { }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/didact-cli/Services/AppSettings.cs:
--------------------------------------------------------------------------------
1 | namespace DidactCli.Services
2 | {
3 | public class AppSettings
4 | {
5 | public string TestSetting { get; set; }
6 |
7 | public DidactEngine DidactEngine { get; set; }
8 |
9 | public DidactUi DidactUi { get; set; }
10 | }
11 |
12 | public class DidactEngine
13 | {
14 | public string RuntimeEnvironmentVariablesFileName { get; set; }
15 | }
16 |
17 | public class DidactUi
18 | {
19 | public string RuntimeEnvironmentVariablesFileName { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/src/didact-cli/Commands/VersionCommand.cs:
--------------------------------------------------------------------------------
1 | using DidactCli.Settings;
2 | using Spectre.Console;
3 | using Spectre.Console.Cli;
4 | using System.Reflection;
5 |
6 | namespace DidactCli.Commands
7 | {
8 | public class VersionCommand : Command
9 | {
10 | public override int Execute(CommandContext context, VersionCommandSettings settings)
11 | {
12 | var version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
13 | AnsiConsole.Write(version);
14 | return 0;
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/didact-primitives/Constants/BlockStates.cs:
--------------------------------------------------------------------------------
1 | namespace DidactPrimitives.Constants
2 | {
3 | public static class BlockStates
4 | {
5 | public const string Idle = "Idle";
6 | public const string Running = "Running";
7 | public const string Retrying = "Retrying";
8 | public const string Failing = "Failing";
9 | public const string Failed = "Failed";
10 | public const string Succeeded = "Succeeded";
11 | public const string Cancelled = "Cancelled";
12 | public const string Cancelling = "Cancelling";
13 | }
14 | }
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | # License
2 |
3 | ## Dual Licensing
4 |
5 | This is an open core product that is dual-licensed in the following way:
6 |
7 | - Any source code found under a directory with the word "commercial" or "comm" in the directory name is licensed under the COMM license.
8 | - All other source code is licensed under the AGPLv3 license.
9 |
10 | ## Forking, Modification, and Redistribution
11 |
12 | When forking, modifying, or redistributing this repository, please carefully read through the COMM license details. Source code that is licensed under the COMM license has certain restrictions.
--------------------------------------------------------------------------------
/src/didact-core/Flows/IFlowExecutionContext.cs:
--------------------------------------------------------------------------------
1 | using DidactCore.Deployments;
2 | using DidactCore.Environments;
3 | using System.Threading;
4 |
5 | namespace DidactCore.Flows
6 | {
7 | public interface IFlowExecutionContext
8 | {
9 | CancellationToken CancellationToken { get; }
10 |
11 | IFlowLogger Logger { get; }
12 |
13 | IEnvironmentContext EnvironmentContext { get; }
14 |
15 | IDeploymentContext DeploymentContext { get; }
16 |
17 | IFlowContext FlowContext { get; }
18 |
19 | IFlowRunContext FlowRunContext { get; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/didact-services/Workers/IWorkerContext.cs:
--------------------------------------------------------------------------------
1 | using DidactCore.Deployments;
2 | using DidactCore.Environments;
3 | using DidactCore.Flows;
4 |
5 | namespace DidactServices.Workers
6 | {
7 | public interface IWorkerContext
8 | {
9 | public IFlowContext FlowContext { get; init; }
10 |
11 | public IFlowRunContext FlowRunContext { get; init; }
12 |
13 | public IDeploymentContext DeploymentContext { get; init; }
14 |
15 | public IEnvironmentContext EnvironmentContext { get; init; }
16 |
17 | public IFlow? FlowInstance { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/didact-cli/Properties/launchsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "DidactCli Developement": {
4 | "commandName": "Project",
5 | "environmentVariables": {
6 | "DOTNET_ENVIRONMENT": "Development"
7 | }
8 | },
9 | "DidactCli Staging": {
10 | "commandName": "Project",
11 | "environmentVariables": {
12 | "DOTNET_ENVIRONMENT": "Staging"
13 | }
14 | },
15 | "DidactCli Production": {
16 | "commandName": "Project",
17 | "environmentVariables": {
18 | "DOTNET_ENVIRONMENT": "Production"
19 | }
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/didact-primitives/Constants/FlowLibrarySourceTypes.cs:
--------------------------------------------------------------------------------
1 | namespace DidactPrimitives.Constants
2 | {
3 | public static class FlowLibrarySourceTypes
4 | {
5 | public const string LocalFilesystem = "Local Filesystem";
6 | public const string NetworkLocation = "Network Location";
7 | public const string AzureBlobStorage = "Azure BLOB Storage";
8 | public const string AwsS3Storage = "AWS S3 Storage";
9 | public const string GitHubRepository = "GitHub Repository";
10 | public const string AzureDevopsRepository = "Azure Devops Repository";
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/didact-core/DidactCore.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 | enable
6 | CS8600;CS8602;CS8603
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/didact-primitives/Constants/FlowConfiguratorStates.cs:
--------------------------------------------------------------------------------
1 | namespace DidactPrimitives.Constants
2 | {
3 | public static class FlowConfiguratorStates
4 | {
5 | public const string FlowConfigurationUninitialized = "Flow Configuration Uninitialized";
6 | public const string FlowInstantiationSuccessful = "Flow Instantiation Successful";
7 | public const string FlowInstantiationFailed = "Flow Instantiation Failed";
8 | public const string FlowConfigurationSuccessful = "Flow Configuration Successful";
9 | public const string FlowConfigurationFailed = "Flow Configuration Failed";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/didact-engine/Modules/IModule.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Modules
2 | {
3 | public interface IModule
4 | {
5 | string Name { get; }
6 |
7 | bool Enabled { get; }
8 |
9 | ///
10 | /// The number of concurrent module s that can be created in the module supervisor.
11 | ///
12 | int Concurrency { get; }
13 |
14 | ///
15 | /// The delay from one module loop iteration to the next. The unit is milliseconds.
16 | ///
17 | int IntervalDelay { get; }
18 |
19 | Task ExecuteAsync(CancellationToken ct);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/didact-ui/nuxt-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nuxt-app",
3 | "private": true,
4 | "type": "module",
5 | "scripts": {
6 | "build": "nuxt build",
7 | "dev": "nuxt dev",
8 | "generate": "nuxt generate",
9 | "preview": "nuxt preview",
10 | "postinstall": "nuxt prepare"
11 | },
12 | "dependencies": {
13 | "@primeuix/themes": "^1.0.0",
14 | "@tailwindcss/vite": "^4.0.14",
15 | "axios": "^1.8.4",
16 | "nuxt": "^3.16.1",
17 | "primevue": "^4.3.2",
18 | "tailwindcss": "^4.0.14",
19 | "vue": "^3.5.13",
20 | "vue-router": "^4.5.0"
21 | },
22 | "devDependencies": {
23 | "@primevue/nuxt-module": "^4.3.2"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-core/Flows/IFlow.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace DidactCore.Flows
4 | {
5 | public interface IFlow
6 | {
7 | ///
8 | /// Asynchronously configures the Flow metadata.
9 | ///
10 | ///
11 | ///
12 | Task ConfigureAsync(IFlowConfigurationContext context);
13 |
14 | ///
15 | /// Asynchronously executes the Flow.
16 | ///
17 | ///
18 | ///
19 | Task ExecuteAsync(IFlowExecutionContext context);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/ScheduleType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class ScheduleType
6 | {
7 | public int ScheduleTypeId { get; set; }
8 |
9 | public string Name { get; set; } = null!;
10 |
11 | public string Description { get; set; } = null!;
12 |
13 | public DateTime Created { get; set; }
14 |
15 | public string CreatedBy { get; set; } = null!;
16 |
17 | public DateTime Updated { get; set; }
18 |
19 | public string UpdatedBy { get; set; } = null!;
20 |
21 | public bool Active { get; set; }
22 |
23 | public byte[] RowVersion { get; set; } = null!;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/TriggerScope.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class TriggerScope
6 | {
7 | public int TriggerScopeId { get; set; }
8 |
9 | public string Name { get; set; } = null!;
10 |
11 | public string Description { get; set; } = null!;
12 |
13 | public DateTime Created { get; set; }
14 |
15 | public string CreatedBy { get; set; } = null!;
16 |
17 | public DateTime Updated { get; set; }
18 |
19 | public string UpdatedBy { get; set; } = null!;
20 |
21 | public bool Active { get; set; }
22 |
23 | public byte[] RowVersion { get; set; } = null!;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/DeploymentType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class DeploymentType
6 | {
7 | public int DeploymentTypeId { get; set; }
8 |
9 | public string Name { get; set; } = null!;
10 |
11 | public string Description { get; set; } = null!;
12 |
13 | public DateTime Created { get; set; }
14 |
15 | public string CreatedBy { get; set; } = null!;
16 |
17 | public DateTime Updated { get; set; }
18 |
19 | public string UpdatedBy { get; set; } = null!;
20 |
21 | public bool Active { get; set; }
22 |
23 | public byte[] RowVersion { get; set; } = null!;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/QueueDirection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class QueueDirection
6 | {
7 | public int QueueDirectionId { get; set; }
8 |
9 | public string Name { get; set; } = null!;
10 |
11 | public string Description { get; set; } = null!;
12 |
13 | public DateTime Created { get; set; }
14 |
15 | public string CreatedBy { get; set; } = null!;
16 |
17 | public DateTime Updated { get; set; }
18 |
19 | public string UpdatedBy { get; set; } = null!;
20 |
21 | public bool Active { get; set; }
22 |
23 | public byte[] RowVersion { get; set; } = null!;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-engine/Modules/ModuleContext.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Modules
2 | {
3 | public sealed class ModuleContext
4 | {
5 | public IModule Module { get; }
6 |
7 | public CancellationToken CancellationToken { get; }
8 |
9 | public Guid Id { get; } = Guid.NewGuid();
10 |
11 | public int WorkerIndex { get; }
12 |
13 | public string Name => $"{Module.Name} module (index: {WorkerIndex} | id: {Id})";
14 |
15 | public ModuleContext(IModule module, int workerIndex, CancellationToken cancellationToken)
16 | {
17 | Module = module;
18 | WorkerIndex = workerIndex;
19 | CancellationToken = cancellationToken;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/DeploymentStatus.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class DeploymentStatus
6 | {
7 | public int DeploymentStatusId { get; set; }
8 |
9 | public string Name { get; set; } = null!;
10 |
11 | public string Description { get; set; } = null!;
12 |
13 | public DateTime Created { get; set; }
14 |
15 | public string CreatedBy { get; set; } = null!;
16 |
17 | public DateTime Updated { get; set; }
18 |
19 | public string UpdatedBy { get; set; } = null!;
20 |
21 | public bool Active { get; set; }
22 |
23 | public byte[] RowVersion { get; set; } = null!;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/FlowRunEventType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class FlowRunEventType
6 | {
7 | public int FlowRunEventTypeId { get; set; }
8 |
9 | public string Name { get; set; } = null!;
10 |
11 | public string Description { get; set; } = null!;
12 |
13 | public DateTime Created { get; set; }
14 |
15 | public string CreatedBy { get; set; } = null!;
16 |
17 | public DateTime Updated { get; set; }
18 |
19 | public string UpdatedBy { get; set; } = null!;
20 |
21 | public bool Active { get; set; }
22 |
23 | public byte[] RowVersion { get; set; } = null!;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/CronScheduleTrigger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class CronScheduleTrigger
6 | {
7 | public long CronScheduleTriggerId { get; set; }
8 |
9 | public long TriggerId { get; set; }
10 |
11 | public string CronExpression { get; set; } = null!;
12 |
13 | public DateTime Created { get; set; }
14 |
15 | public string CreatedBy { get; set; } = null!;
16 |
17 | public DateTime Updated { get; set; }
18 |
19 | public string UpdatedBy { get; set; } = null!;
20 |
21 | public bool Active { get; set; }
22 |
23 | public byte[] RowVersion { get; set; } = null!;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/DeploymentSourceType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class DeploymentSourceType
6 | {
7 | public int DeploymentSourceTypeId { get; set; }
8 |
9 | public string Name { get; set; } = null!;
10 |
11 | public string Description { get; set; } = null!;
12 |
13 | public DateTime Created { get; set; }
14 |
15 | public string CreatedBy { get; set; } = null!;
16 |
17 | public DateTime Updated { get; set; }
18 |
19 | public string UpdatedBy { get; set; } = null!;
20 |
21 | public bool Active { get; set; }
22 |
23 | public byte[] RowVersion { get; set; } = null!;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-engine/Flows/FlowTypeNotFoundException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace DidactCore.Flows
5 | {
6 | [Serializable]
7 | public class FlowTypeNotFoundException : Exception
8 | {
9 | public FlowTypeNotFoundException()
10 | {
11 | }
12 |
13 | public FlowTypeNotFoundException(string message) : base(message)
14 | {
15 | }
16 |
17 | public FlowTypeNotFoundException(string message, Exception innerException) : base(message, innerException)
18 | {
19 | }
20 |
21 | protected FlowTypeNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
22 | {
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-engine/Plugins/NoMatchedPluginException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace DidactEngine.Plugins
5 | {
6 | [Serializable]
7 | public class NoMatchedPluginException : Exception
8 | {
9 | public NoMatchedPluginException()
10 | {
11 | }
12 |
13 | public NoMatchedPluginException(string message) : base(message)
14 | {
15 | }
16 |
17 | public NoMatchedPluginException(string message, Exception innerException) : base(message, innerException)
18 | {
19 | }
20 |
21 | protected NoMatchedPluginException(SerializationInfo info, StreamingContext context) : base(info, context)
22 | {
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-engine/Constants/Defaults.cs:
--------------------------------------------------------------------------------
1 | namespace DidactEngine.Constants
2 | {
3 | public static class Defaults
4 | {
5 | public const decimal DefaultThreadFactor = 1;
6 |
7 | public static class DefaultModuleIntervalDelays
8 | {
9 | public const int Plugins = 120000;
10 | public const int Scheduler = 5000;
11 | public const int Workers = 0;
12 | public const int Licensing = 1800000;
13 | public const int EngineLogger = 0;
14 | public const int FlowRunLogger = 0;
15 | }
16 |
17 | public const int DefaultWorkersServiceDequeueIntervalDelay = 5000;
18 | public const int FlowRunCancellationPollingInterval = 60000;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/didact-services/DidactServices.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | net8.0
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/Environment.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class Environment
6 | {
7 | public long EnvironmentId { get; set; }
8 |
9 | public int OrganizationId { get; set; }
10 |
11 | public string Name { get; set; } = null!;
12 |
13 | public string? Description { get; set; }
14 |
15 | public DateTime Created { get; set; }
16 |
17 | public string CreatedBy { get; set; } = null!;
18 |
19 | public DateTime Updated { get; set; }
20 |
21 | public string UpdatedBy { get; set; } = null!;
22 |
23 | public bool Active { get; set; }
24 |
25 | public byte[] RowVersion { get; set; } = null!;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/didact-cli/Services/TypeResolver.cs:
--------------------------------------------------------------------------------
1 | using Spectre.Console.Cli;
2 |
3 | namespace DidactCli.Services;
4 |
5 | public sealed class TypeResolver : ITypeResolver, IDisposable
6 | {
7 | private readonly IServiceProvider _provider;
8 |
9 | public TypeResolver(IServiceProvider provider)
10 | {
11 | _provider = provider ?? throw new ArgumentNullException(nameof(provider));
12 | }
13 |
14 | public object Resolve(Type type)
15 | {
16 | if (type == null)
17 | {
18 | return null;
19 | }
20 |
21 | return _provider.GetService(type);
22 | }
23 |
24 | public void Dispose()
25 | {
26 | if (_provider is IDisposable disposable)
27 | {
28 | disposable.Dispose();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/src/didact-engine/Deployments/DeploymentsService.cs:
--------------------------------------------------------------------------------
1 | using DidactCore.Deployments;
2 |
3 | namespace DidactEngine.Deployments
4 | {
5 | public class DeploymentsService
6 | {
7 | private readonly ILogger _logger;
8 |
9 | public DeploymentsService(ILogger logger)
10 | {
11 | _logger = logger;
12 | }
13 |
14 | public async Task FetchMissingDeploymentsAsync(CancellationToken cancellationToken)
15 | {
16 | await Task.CompletedTask;
17 | }
18 |
19 | public async Task FetchDeploymentFromSourceAsync(IDeploymentContext deploymentContext, CancellationToken cancellationToken)
20 | {
21 | await Task.CompletedTask;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/didact-engine/Flows/SaveFlowConfigurationsException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace DidactCore.Exceptions
5 | {
6 | [Serializable]
7 | public class SaveFlowConfigurationsException : Exception
8 | {
9 | public SaveFlowConfigurationsException()
10 | {
11 | }
12 |
13 | public SaveFlowConfigurationsException(string message) : base(message)
14 | {
15 | }
16 |
17 | public SaveFlowConfigurationsException(string message, Exception innerException) : base(message, innerException)
18 | {
19 | }
20 |
21 | protected SaveFlowConfigurationsException(SerializationInfo info, StreamingContext context) : base(info, context)
22 | {
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-engine/Plugins/MultipleMatchedPluginsException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace DidactEngine.Plugins
5 | {
6 | [Serializable]
7 | public class MultipleMatchedPluginsException : Exception
8 | {
9 | public MultipleMatchedPluginsException()
10 | {
11 | }
12 |
13 | public MultipleMatchedPluginsException(string message) : base(message)
14 | {
15 | }
16 |
17 | public MultipleMatchedPluginsException(string message, Exception innerException) : base(message, innerException)
18 | {
19 | }
20 |
21 | protected MultipleMatchedPluginsException(SerializationInfo info, StreamingContext context) : base(info, context)
22 | {
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/didact-ui/dotnet-app/Controllers/EnvironmentVariablesController.cs:
--------------------------------------------------------------------------------
1 | using DidactUi.Services;
2 | using Microsoft.AspNetCore.Mvc;
3 |
4 | namespace DidactUi.Controllers
5 | {
6 | public class EnvironmentVariablesController : ControllerBase
7 | {
8 | private readonly ILogger _logger;
9 | private readonly UiSettings _uiSettings;
10 |
11 | public EnvironmentVariablesController(ILogger logger, UiSettings uiSettings)
12 | {
13 | _logger = logger;
14 | _uiSettings = uiSettings;
15 | }
16 |
17 | [HttpGet("environment-variables")]
18 | public IActionResult GetEnvironmentVariables()
19 | {
20 | return Ok(_uiSettings);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/DeploymentSourceFilesystem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class DeploymentSourceFilesystem
6 | {
7 | public long DeploymentSourceFilesystemId { get; set; }
8 |
9 | public long DeploymentId { get; set; }
10 |
11 | public long EnvironmentId { get; set; }
12 |
13 | public string FolderPath { get; set; } = null!;
14 |
15 | public DateTime Created { get; set; }
16 |
17 | public string CreatedBy { get; set; } = null!;
18 |
19 | public DateTime Updated { get; set; }
20 |
21 | public string UpdatedBy { get; set; } = null!;
22 |
23 | public bool Active { get; set; }
24 |
25 | public byte[] RowVersion { get; set; } = null!;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/TriggerType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace DidactServices.DataModel.Entities
5 | {
6 | public class TriggerType
7 | {
8 | public int TriggerTypeId { get; set; }
9 |
10 | public string Name { get; set; } = null!;
11 |
12 | public string Description { get; set; } = null!;
13 |
14 | public DateTime Created { get; set; }
15 |
16 | public string CreatedBy { get; set; } = null!;
17 |
18 | public DateTime Updated { get; set; }
19 |
20 | public string UpdatedBy { get; set; } = null!;
21 |
22 | public bool Active { get; set; }
23 |
24 | public byte[] RowVersion { get; set; } = null!;
25 |
26 | public virtual ICollection FlowRuns { get; } = new List();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/didact-engine/Engine/IEngineSupervisor.cs:
--------------------------------------------------------------------------------
1 | using DidactEngine.Plugins;
2 | using System;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace DidactCore.Engine
7 | {
8 | public interface IEngineSupervisor
9 | {
10 | long EngineId { get; set; }
11 |
12 | Guid EngineUniversalId { get; set; }
13 |
14 | EngineTuningDto EngineTuning { get; set; }
15 |
16 | string EngineState { get; set; }
17 |
18 | CancellationToken CancellationToken { get; set; }
19 |
20 | DateTime EngineStateUpdated { get; set; }
21 |
22 | IPluginContainers PluginContainers { get; set; }
23 |
24 | void SetEngineState(string engineState);
25 |
26 | Task CheckForEngineShutdownEventAsync();
27 |
28 | string GetEngineState();
29 |
30 | DateTime GetEngineStateUpdated();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/State.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace DidactServices.DataModel.Entities
5 | {
6 | public class State
7 | {
8 | public int StateId { get; set; }
9 |
10 | public string Name { get; set; } = null!;
11 |
12 | public string? Description { get; set; }
13 |
14 | public DateTime Created { get; set; }
15 |
16 | public string CreatedBy { get; set; } = null!;
17 |
18 | public DateTime Updated { get; set; }
19 |
20 | public string UpdatedBy { get; set; } = null!;
21 |
22 | public bool Active { get; set; }
23 |
24 | public byte[] RowVersion { get; set; } = null!;
25 |
26 | public virtual ICollection FlowRuns { get; } = new List();
27 |
28 | public virtual ICollection BlockRuns { get; } = new List();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/didact-engine/Scheduler/SchedulerModule.cs:
--------------------------------------------------------------------------------
1 | using DidactEngine.Constants;
2 | using DidactEngine.Modules;
3 |
4 | namespace DidactEngine.Scheduler
5 | {
6 | public class SchedulerModule : IModule
7 | {
8 | private readonly SchedulerService _schedulerService;
9 |
10 | public string Name => EngineConstants.ModuleNames.Scheduler;
11 |
12 | public bool Enabled { get; set; } = true;
13 |
14 | public int Concurrency { get; set; } = 1;
15 |
16 | public int IntervalDelay { get; set; } = Defaults.DefaultModuleIntervalDelays.Scheduler;
17 |
18 | public SchedulerModule(SchedulerService schedulerService)
19 | {
20 | _schedulerService = schedulerService;
21 | }
22 |
23 | public async Task ExecuteAsync(CancellationToken cancellationToken)
24 | {
25 | await _schedulerService.ScheduleAsync(cancellationToken);
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/ExecutionMode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace DidactServices.DataModel.Entities
5 | {
6 | public class ExecutionMode
7 | {
8 | public int ExecutionModeId { get; set; }
9 |
10 | public string Name { get; set; } = null!;
11 |
12 | public string? Description { get; set; }
13 |
14 | public DateTime Created { get; set; }
15 |
16 | public string CreatedBy { get; set; } = null!;
17 |
18 | public DateTime Updated { get; set; }
19 |
20 | public string UpdatedBy { get; set; } = null!;
21 |
22 | public bool Active { get; set; }
23 |
24 | public byte[] RowVersion { get; set; } = null!;
25 |
26 | public virtual ICollection Flows { get; } = new List();
27 |
28 | public virtual ICollection FlowRuns { get; } = new List();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/FlowRunStateChangeEvent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class FlowRunStateChangeEvent
6 | {
7 | public long FlowRunStateChangeEventId { get; set; }
8 |
9 | public long FlowRunEventId { get; set; }
10 |
11 | public long EnvironmentId { get; set; }
12 |
13 | public string PreviousState { get; set; } = null!;
14 |
15 | public string NewState { get; set; } = null!;
16 |
17 | public DateTime Timestamp { get; set; }
18 |
19 | public DateTime Created { get; set; }
20 |
21 | public string CreatedBy { get; set; } = null!;
22 |
23 | public DateTime Updated { get; set; }
24 |
25 | public string UpdatedBy { get; set; } = null!;
26 |
27 | public bool Active { get; set; }
28 |
29 | public byte[] RowVersion { get; set; } = null!;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/didact-engine/Workers/WorkersModule.cs:
--------------------------------------------------------------------------------
1 | using DidactEngine.Constants;
2 | using DidactEngine.Modules;
3 |
4 | namespace DidactEngine.Workers
5 | {
6 | public class WorkersModule : IModule
7 | {
8 | private readonly WorkersService _workersService;
9 |
10 | public string Name => EngineConstants.ModuleNames.Workers;
11 |
12 | public bool Enabled { get; set; } = true;
13 |
14 | public int Concurrency { get; set; } = Environment.ProcessorCount;
15 |
16 | public int IntervalDelay { get; set; } = Defaults.DefaultModuleIntervalDelays.Workers;
17 |
18 | public WorkersModule(WorkersService workersService)
19 | {
20 | _workersService = workersService;
21 | }
22 |
23 | public async Task ExecuteAsync(CancellationToken cancellationToken)
24 | {
25 | await _workersService.WorkAsyncOnThreadpool(cancellationToken);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/HyperQueueItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class HyperQueueItem
6 | {
7 | public long HyperQueueItemId { get; set; }
8 |
9 | public long EnvironmentId { get; set; }
10 |
11 | public int HyperQueueId { get; set; }
12 |
13 | public long FlowRunId { get; set; }
14 |
15 | public DateTime Created { get; set; }
16 |
17 | public string CreatedBy { get; set; } = null!;
18 |
19 | public DateTime Updated { get; set; }
20 |
21 | public string UpdatedBy { get; set; } = null!;
22 |
23 | public byte[] RowVersion { get; set; } = null!;
24 |
25 | public virtual Environment Environment { get; set; } = null!;
26 |
27 | public virtual HyperQueue HyperQueue { get; set; } = null!;
28 |
29 | public virtual FlowRun FlowRun { get; set; } = null!;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/StrictQueueItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class StrictQueueItem
6 | {
7 | public long StrictQueueItemId { get; set; }
8 |
9 | public long EnvironmentId { get; set; }
10 |
11 | public int StrictQueueId { get; set; }
12 |
13 | public long FlowRunId { get; set; }
14 |
15 | public DateTime Created { get; set; }
16 |
17 | public string CreatedBy { get; set; } = null!;
18 |
19 | public DateTime Updated { get; set; }
20 |
21 | public string UpdatedBy { get; set; } = null!;
22 |
23 | public byte[] RowVersion { get; set; } = null!;
24 |
25 | public virtual StrictQueue StrictQueue { get; set; } = null!;
26 |
27 | public virtual Environment Environment { get; set; } = null!;
28 |
29 | public virtual FlowRun FlowRun { get; set; } = null!;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/didact-services/Flows/IFlowRunRepository.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace DidactServices.Flows
4 | {
5 | public interface IFlowRunRepository
6 | {
7 | Task GetFlowRunAsync(long flowRunId);
8 |
9 | Task GetFlowRunByNameAsync(string name);
10 |
11 | Task GetFlowRunByDescriptionAsync(string description);
12 |
13 | Task CreateAndEnqueueFlowRunAsync(FlowRun flowRun);
14 |
15 | Task CreateAndExecuteFlowRunAsync(FlowRun flowRun);
16 |
17 | Task UpdateFlowRunAsync(long flowRunId, FlowRun flowRun);
18 |
19 | Task DeleteFlowRunAsync(long flowRunId);
20 |
21 | Task CheckIfFlowRunIsCancelledAsync(long flowRunId);
22 |
23 | Task CancelFlowRunAsync(long flowRunId);
24 |
25 | Task TimeoutFlowRunAsync(long flowRunId);
26 |
27 | Task FailFlowRunAsync(long flowRunId);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/didact-core/SomeFlow.cs:
--------------------------------------------------------------------------------
1 | using DidactCore.Flows;
2 | using DidactCore.Triggers;
3 | using System.Threading.Tasks;
4 |
5 | namespace DidactCore
6 | {
7 | public class SomeFlow : IFlow
8 | {
9 | public Task ConfigureAsync(IFlowConfigurationContext context)
10 | {
11 | context.Configurator
12 | .WithName("An example flow")
13 | .WithDescription("A sample flow")
14 | .AsVersion("1.0.0")
15 | .WithCronScheduleTrigger(new CronScheduleTrigger("test"));
16 |
17 | return Task.FromResult(context);
18 | }
19 |
20 | public async Task ExecuteAsync(IFlowExecutionContext context)
21 | {
22 | var logger = context.Logger;
23 | logger.LogInformation("Starting work...");
24 | await Task.Delay(100);
25 | logger.LogInformation("Work completed.");
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/Trigger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class Trigger
6 | {
7 | public long TriggerId { get; set; }
8 |
9 | public int TriggerTypeId { get; set; }
10 |
11 | public int TriggerScopeId { get; set; }
12 |
13 | public int? OrganizationId { get; set; }
14 |
15 | public long? EnvironmentId { get; set; }
16 |
17 | public long? FlowId { get; set; }
18 |
19 | public string? Name { get; set; }
20 |
21 | public string? Description { get; set; }
22 |
23 | public DateTime Created { get; set; }
24 |
25 | public string CreatedBy { get; set; } = null!;
26 |
27 | public DateTime Updated { get; set; }
28 |
29 | public string UpdatedBy { get; set; } = null!;
30 |
31 | public bool Active { get; set; }
32 |
33 | public byte[] RowVersion { get; set; } = null!;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/didact-engine/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/launchsettings.json",
3 | "iisSettings": {
4 | "windowsAuthentication": false,
5 | "anonymousAuthentication": true,
6 | "iisExpress": {
7 | "applicationUrl": "http://localhost:24358",
8 | "sslPort": 44329
9 | }
10 | },
11 | "profiles": {
12 | "DidactEngine": {
13 | "commandName": "Project",
14 | "dotnetRunMessages": true,
15 | "launchBrowser": true,
16 | "launchUrl": "swagger",
17 | "applicationUrl": "https://localhost:7098;http://localhost:5095",
18 | "environmentVariables": {
19 | "ASPNETCORE_ENVIRONMENT": "Development"
20 | }
21 | },
22 | "IIS Express": {
23 | "commandName": "IISExpress",
24 | "launchBrowser": true,
25 | "launchUrl": "swagger",
26 | "environmentVariables": {
27 | "ASPNETCORE_ENVIRONMENT": "Development"
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/didact-cli/Commands/UiInstallCommand.cs:
--------------------------------------------------------------------------------
1 | using DidactCli.Services;
2 | using DidactCli.Settings;
3 | using Microsoft.Extensions.Logging;
4 | using Spectre.Console;
5 | using Spectre.Console.Cli;
6 |
7 | namespace DidactCli.Commands
8 | {
9 | public class UiInstallCommand : Command
10 | {
11 | private readonly ILogger _logger;
12 | private readonly AppSettings _appSettings;
13 |
14 | public UiInstallCommand(ILogger logger, AppSettings appSettings)
15 | {
16 | _logger = logger;
17 | _appSettings = appSettings;
18 | }
19 |
20 | public override int Execute(CommandContext context, UiInstallCommandSettings settings)
21 | {
22 | _logger.LogInformation("Reading path...");
23 | _logger.LogInformation(_appSettings.TestSetting);
24 | AnsiConsole.WriteLine(settings.InstallationPath);
25 | return 0;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/FlowRunEvent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class FlowRunEvent
6 | {
7 | public long FlowRunEventId { get; set; }
8 |
9 | public long FlowRunId { get; set; }
10 |
11 | public int FlowRunEventTypeId { get; set; }
12 |
13 | public long EnvironmentId { get; set; }
14 |
15 | public DateTime Timestamp { get; set; }
16 |
17 | public DateTime Created { get; set; }
18 |
19 | public string CreatedBy { get; set; } = null!;
20 |
21 | public DateTime Updated { get; set; }
22 |
23 | public string UpdatedBy { get; set; } = null!;
24 |
25 | public byte[] RowVersion { get; set; } = null!;
26 |
27 | public virtual FlowRun FlowRun { get; set; } = null!;
28 |
29 | public virtual FlowRunEventType FlowRunEventType { get; set; } = null!;
30 |
31 | public virtual Environment Environment { get; set; } = null!;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/FlowRunLogEvent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class FlowRunLogEvent
6 | {
7 | public long FlowRunLogEventId { get; set; }
8 |
9 | public long FlowRunEventId { get; set; }
10 |
11 | public long EnvironmentId { get; set; }
12 |
13 | public string LogLevel { get; set; } = null!;
14 |
15 | public string Message { get; set; } = null!;
16 |
17 | public DateTime Timestamp { get; set; }
18 |
19 | public DateTime Created { get; set; }
20 |
21 | public string CreatedBy { get; set; } = null!;
22 |
23 | public DateTime Updated { get; set; }
24 |
25 | public string UpdatedBy { get; set; } = null!;
26 |
27 | public byte[] RowVersion { get; set; } = null!;
28 |
29 | public virtual FlowRunEvent FlowRunEvent { get; set; } = null!;
30 |
31 | public virtual Environment Environment { get; set; } = null!;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/didact-cli/Commands/EngineInstallCommand.cs:
--------------------------------------------------------------------------------
1 | using DidactCli.Services;
2 | using DidactCli.Settings;
3 | using Microsoft.Extensions.Logging;
4 | using Spectre.Console;
5 | using Spectre.Console.Cli;
6 |
7 | namespace DidactCli.Commands
8 | {
9 | public class EngineInstallCommand : Command
10 | {
11 | private readonly ILogger _logger;
12 | private readonly AppSettings _appSettings;
13 |
14 | public EngineInstallCommand(ILogger logger, AppSettings appSettings)
15 | {
16 | _logger = logger;
17 | _appSettings = appSettings;
18 | }
19 |
20 | public override int Execute(CommandContext context, EngineInstallCommandSettings settings)
21 | {
22 | _logger.LogInformation("Reading path...");
23 | _logger.LogInformation(_appSettings.TestSetting);
24 | AnsiConsole.WriteLine(settings.InstallationPath);
25 | return 0;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Configurations/StateConfiguration.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Metadata.Builders;
2 | using Microsoft.EntityFrameworkCore;
3 | using DidactServices.DataModel.Entities;
4 |
5 | namespace DidactServices.DataModel.Configurations
6 | {
7 | public partial class StateConfiguration : IEntityTypeConfiguration
8 | {
9 | public void Configure(EntityTypeBuilder entity)
10 | {
11 | //entity.ToTable(nameof(State));
12 | //entity.Property(e => e.Name).IsRequired().HasMaxLength(255);
13 | //entity.Property(e => e.CreatedBy).HasMaxLength(255);
14 | //entity.Property(e => e.LastUpdatedBy).HasMaxLength(255);
15 | //entity.Property(e => e.Active).IsRequired().HasDefaultValue(true);
16 | //entity.Property(e => e.RowVersion).IsRowVersion().IsConcurrencyToken();
17 |
18 | OnConfigurePartial(entity);
19 | }
20 |
21 | partial void OnConfigurePartial(EntityTypeBuilder entity);
22 | }
23 | }
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/FlowVersion.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace DidactServices.DataModel.Entities
5 | {
6 | public class FlowVersion
7 | {
8 | public long FlowVersionId { get; set; }
9 |
10 | public long FlowId { get; set; }
11 |
12 | public long EnvironmentId { get; set; }
13 |
14 | public string Version { get; set; } = null!;
15 |
16 | public DateTime Created { get; set; }
17 |
18 | public string CreatedBy { get; set; } = null!;
19 |
20 | public DateTime Updated { get; set; }
21 |
22 | public string UpdatedBy { get; set; } = null!;
23 |
24 | public bool Active { get; set; }
25 |
26 | public byte[] RowVersion { get; set; } = null!;
27 |
28 | public virtual Flow Flow { get; set; } = null!;
29 |
30 | public virtual Environment Environment { get; set; } = null!;
31 |
32 | public virtual ICollection FlowRuns { get; } = new List();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Configurations/StrictQueueConfiguration.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Metadata.Builders;
2 | using Microsoft.EntityFrameworkCore;
3 | using DidactServices.DataModel.Entities;
4 |
5 | namespace DidactServices.DataModel.Configurations
6 | {
7 | public partial class StrictQueueConfiguration : IEntityTypeConfiguration
8 | {
9 | public void Configure(EntityTypeBuilder entity)
10 | {
11 | entity.ToTable(nameof(StrictQueue));
12 | entity.Property(e => e.Name).IsRequired().HasMaxLength(255);
13 | entity.Property(e => e.CreatedBy).HasMaxLength(255);
14 | entity.Property(e => e.UpdatedBy).HasMaxLength(255);
15 | entity.Property(e => e.Active).IsRequired().HasDefaultValue(true);
16 | entity.Property(e => e.RowVersion).IsRowVersion().IsConcurrencyToken();
17 |
18 | OnConfigurePartial(entity);
19 | }
20 |
21 | partial void OnConfigurePartial(EntityTypeBuilder entity);
22 | }
23 | }
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/Deployment.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class Deployment
6 | {
7 | public long DeploymentId { get; set; }
8 |
9 | public int DeploymentTypeId { get; set; }
10 |
11 | public int DeploymentSourceTypeId { get; set; }
12 |
13 | public int DeploymentStatusId { get; set; }
14 |
15 | public long EnvironmentId { get; set; }
16 |
17 | public string? Name { get; set; }
18 |
19 | public string? Description { get; set; }
20 |
21 | public string Entrypoint { get; set; } = null!;
22 |
23 | public Guid PushId { get; set; }
24 |
25 | public DateTime Created { get; set; }
26 |
27 | public string CreatedBy { get; set; } = null!;
28 |
29 | public DateTime Updated { get; set; }
30 |
31 | public string UpdatedBy { get; set; } = null!;
32 |
33 | public bool Active { get; set; }
34 |
35 | public byte[] RowVersion { get; set; } = null!;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Entities/Engine.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DidactServices.DataModel.Entities
4 | {
5 | public class Engine
6 | {
7 | public long EngineId { get; set; }
8 |
9 | public long EnvironmentId { get; set; }
10 |
11 | public Guid UniversalId { get; set; }
12 |
13 | public string UniqueName { get; set; } = null!;
14 |
15 | public string? Name { get; set; }
16 |
17 | public int? LatestProcessId { get; set; }
18 |
19 | public DateTime LastHeartbeat { get; set; }
20 |
21 | public string? Description { get; set; }
22 |
23 | public DateTime Created { get; set; }
24 |
25 | public string CreatedBy { get; set; } = null!;
26 |
27 | public DateTime Updated { get; set; }
28 |
29 | public string UpdatedBy { get; set; } = null!;
30 |
31 | public bool Active { get; set; }
32 |
33 | public byte[] RowVersion { get; set; } = null!;
34 |
35 | public virtual Environment Environment { get; set; } = null!;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Configurations/HyperQueueConfiguration.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Metadata.Builders;
2 | using Microsoft.EntityFrameworkCore;
3 | using DidactServices.DataModel.Entities;
4 |
5 | namespace DidactServices.DataModel.Configurations
6 | {
7 | public partial class HyperQueueConfiguration : IEntityTypeConfiguration
8 | {
9 | public void Configure(EntityTypeBuilder entity)
10 | {
11 | //entity.ToTable(nameof(HyperQueue));
12 | //entity.Property(e => e.Name).IsRequired().HasMaxLength(255);
13 | //entity.Property(e => e.CreatedBy).HasMaxLength(255);
14 | //entity.Property(e => e.LastUpdatedBy).HasMaxLength(255);
15 | //entity.Property(e => e.Active).IsRequired().HasDefaultValue(true);
16 | //entity.Property(e => e.RowVersion).IsRowVersion().IsConcurrencyToken();
17 |
18 | OnConfigurePartial(entity);
19 | }
20 |
21 | partial void OnConfigurePartial(EntityTypeBuilder entity);
22 | }
23 | }
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Configurations/TriggerTypeConfiguration.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Metadata.Builders;
2 | using Microsoft.EntityFrameworkCore;
3 | using DidactServices.DataModel.Entities;
4 |
5 | namespace DidactServices.DataModel.Configurations
6 | {
7 | public partial class TriggerTypeConfiguration : IEntityTypeConfiguration
8 | {
9 | public void Configure(EntityTypeBuilder entity)
10 | {
11 | //entity.ToTable(nameof(TriggerType));
12 | //entity.Property(e => e.Name).IsRequired().HasMaxLength(255);
13 | //entity.Property(e => e.CreatedBy).HasMaxLength(255);
14 | //entity.Property(e => e.LastUpdatedBy).HasMaxLength(255);
15 | //entity.Property(e => e.Active).IsRequired().HasDefaultValue(true);
16 | //entity.Property(e => e.RowVersion).IsRowVersion().IsConcurrencyToken();
17 |
18 | OnConfigurePartial(entity);
19 | }
20 |
21 | partial void OnConfigurePartial(EntityTypeBuilder entity);
22 | }
23 | }
--------------------------------------------------------------------------------
/src/didact-engine/Engine/EngineRepository.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 | using System.Threading.Tasks;
3 |
4 | namespace DidactCore.Engine
5 | {
6 | public class EngineRepository : IEngineRepository
7 | {
8 | private readonly ILogger _logger;
9 |
10 | public EngineRepository(ILogger logger)
11 | {
12 | _logger = logger;
13 | }
14 |
15 | public async Task CheckForEngineShutdownAsync()
16 | {
17 | // TODO Implement
18 | await Task.CompletedTask;
19 | return false;
20 | }
21 |
22 | public async Task GetEngineAsync()
23 | {
24 | // TODO Implement
25 | await Task.CompletedTask;
26 | return new EngineDto();
27 | }
28 |
29 | public async Task GetEngineTuningAsync()
30 | {
31 | // TODO Implement
32 | await Task.CompletedTask;
33 | return new EngineTuningDto();
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Configurations/OrganizationConfiguration.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Metadata.Builders;
2 | using Microsoft.EntityFrameworkCore;
3 | using DidactServices.DataModel.Entities;
4 |
5 | namespace DidactServices.DataModel.Configurations
6 | {
7 | public partial class OrganizationConfiguration : IEntityTypeConfiguration
8 | {
9 | public void Configure(EntityTypeBuilder entity)
10 | {
11 | //entity.ToTable(nameof(Organization));
12 | //entity.Property(e => e.Name).IsRequired().HasMaxLength(255);
13 | //entity.Property(e => e.CreatedBy).HasMaxLength(255);
14 | //entity.Property(e => e.LastUpdatedBy).HasMaxLength(255);
15 | //entity.Property(e => e.Active).IsRequired().HasDefaultValue(true);
16 | //entity.Property(e => e.RowVersion).IsRowVersion().IsConcurrencyToken();
17 |
18 | OnConfigurePartial(entity);
19 | }
20 |
21 | partial void OnConfigurePartial(EntityTypeBuilder entity);
22 | }
23 | }
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Configurations/ScheduleTypeConfiguration.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Metadata.Builders;
2 | using Microsoft.EntityFrameworkCore;
3 | using DidactServices.DataModel.Entities;
4 |
5 | namespace DidactServices.DataModel.Configurations
6 | {
7 | public partial class ScheduleTypeConfiguration : IEntityTypeConfiguration
8 | {
9 | public void Configure(EntityTypeBuilder entity)
10 | {
11 | //entity.ToTable(nameof(ScheduleType));
12 | //entity.Property(e => e.Name).IsRequired().HasMaxLength(255);
13 | //entity.Property(e => e.CreatedBy).HasMaxLength(255);
14 | //entity.Property(e => e.LastUpdatedBy).HasMaxLength(255);
15 | //entity.Property(e => e.Active).IsRequired().HasDefaultValue(true);
16 | //entity.Property(e => e.RowVersion).IsRowVersion().IsConcurrencyToken();
17 |
18 | OnConfigurePartial(entity);
19 | }
20 |
21 | partial void OnConfigurePartial(EntityTypeBuilder entity);
22 | }
23 | }
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Migrations/MigrationExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore;
2 |
3 | namespace DidactServices.DataModel.Migrations
4 | {
5 | public static class MigrationExtensions
6 | {
7 | public static WebApplication MigrateDatabase(this WebApplication webApp)
8 | where T : DbContext
9 | {
10 | using (var scope = webApp.Services.CreateScope())
11 | using (var dbContext = scope.ServiceProvider.GetRequiredService())
12 | try
13 | {
14 | dbContext.Database.Migrate();
15 | }
16 | catch (Exception e)
17 | {
18 | scope.ServiceProvider
19 | .GetRequiredService>()
20 | .LogError(e, "Unhandled exception while applying migrations for {T}", typeof(T));
21 |
22 | Console.WriteLine(e);
23 |
24 | throw;
25 | }
26 |
27 | return webApp;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/didact-ui/nuxt-app/utils/environment-variables/index.ts:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 | import { isDev } from "../environment";
3 |
4 | const devBaseUrl: string = import.meta.env.VITE_ENVIRONMENT_VARIABLES_DEV_BASE_URL;
5 |
6 | interface EnvironmentVariables {
7 | didactEngineBaseUrl: string
8 | }
9 |
10 | /**
11 | * Determines the appropriate base URL for the runtime environment variables depending on how the single page app is currently running.
12 | * @returns
13 | */
14 | const getBaseUrlForEnvironmentVariables = () => {
15 | return isDev() ? devBaseUrl : '';
16 | }
17 |
18 | /**
19 | * Gets the dynamic set of runtime environment variables from the containing dotnet web api that serves this single page app.
20 | * @returns {EnvironmentVariables}
21 | */
22 | const getEnvironmentVariables = async () : Promise => {
23 | const baseUrl = getBaseUrlForEnvironmentVariables();
24 | const response = await axios.get(`${baseUrl}/environment-variables`);
25 | return response.data;
26 | }
27 |
28 | export { getEnvironmentVariables }
--------------------------------------------------------------------------------
/src/didact-services/DataModel/Configurations/FlowScheduleConfiguration.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.EntityFrameworkCore.Metadata.Builders;
2 | using Microsoft.EntityFrameworkCore;
3 | using DidactServices.DataModel.Entities;
4 |
5 | namespace DidactServices.DataModel.Configurations
6 | {
7 | public partial class FlowScheduleConfiguration : IEntityTypeConfiguration
8 | {
9 | public void Configure(EntityTypeBuilder entity)
10 | {
11 | //entity.ToTable(nameof(FlowSchedule));
12 | //entity.Property(e => e.CronExpression).IsRequired().HasMaxLength(255);
13 | //entity.Property(e => e.CreatedBy).HasMaxLength(255);
14 | //entity.Property(e => e.LastUpdatedBy).HasMaxLength(255);
15 | //entity.Property(e => e.Active).IsRequired().HasDefaultValue(true);
16 | //entity.Property(e => e.RowVersion).IsRowVersion().IsConcurrencyToken();
17 |
18 | OnConfigurePartial(entity);
19 | }
20 |
21 | partial void OnConfigurePartial(EntityTypeBuilder entity);
22 | }
23 | }
--------------------------------------------------------------------------------
/src/didact-services/Workers/WorkerContext.cs:
--------------------------------------------------------------------------------
1 | using DidactCore.Deployments;
2 | using DidactCore.Environments;
3 | using DidactCore.Flows;
4 |
5 | namespace DidactServices.Workers
6 | {
7 | public class WorkerContext : IWorkerContext
8 | {
9 | public IFlowContext FlowContext { get; init; }
10 |
11 | public IFlowRunContext FlowRunContext { get; init; }
12 |
13 | public IDeploymentContext DeploymentContext { get; init; }
14 |
15 | public IEnvironmentContext EnvironmentContext { get; init; }
16 |
17 | public IFlow? FlowInstance { get; set; }
18 |
19 | public WorkerContext(IFlowContext flowContext, IFlowRunContext flowRunContext,
20 | IDeploymentContext deploymentContext, IEnvironmentContext environmentContext, IFlow? flowInstance = null)
21 | {
22 | FlowContext = flowContext;
23 | FlowRunContext = flowRunContext;
24 | DeploymentContext = deploymentContext;
25 | EnvironmentContext = environmentContext;
26 | FlowInstance = flowInstance;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Didact
2 | The .NET job orchestrator that we've been missing.
3 |
4 | ## About
5 |
6 | This is the monorepo for Didact and it's primary components, namely:
7 | - Didact CLI
8 | - Didact Core
9 | - Didact Engine
10 | - Didact UI
11 |
12 | Originally, I had anticipated a polyrepo approach, but I have since decided against it. The older component repositories are archived, so please refer to this repository for the main platform components. I do still have some separate repositories such as the dedicated repository for the [Didact docsite](https://docs.didact.dev), please refer to the other repositories as necessary.
13 |
14 | ## Releases and Artifacts
15 |
16 | This repository will contain the platform releases and release artifacts for Didact, namely, the application binaries/executables. The CI/CD automations will also produce the associated NuGet packages and Docker images from here.
17 |
18 | ## Documentation
19 |
20 | Rather than create complex README files, I prefer to keep these shorter for now and instead refer you to the [Didact docsite](https://docs.didact.dev) for learning the platform.
--------------------------------------------------------------------------------
/src/didact-cli/Services/TypeRegistrar.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 | using Spectre.Console.Cli;
3 |
4 | namespace DidactCli.Services;
5 |
6 | public sealed class TypeRegistrar : ITypeRegistrar
7 | {
8 | private readonly IServiceCollection _builder;
9 |
10 | public TypeRegistrar(IServiceCollection builder)
11 | {
12 | _builder = builder;
13 | }
14 |
15 | public ITypeResolver Build()
16 | {
17 | return new TypeResolver(_builder.BuildServiceProvider());
18 | }
19 |
20 | public void Register(Type service, Type implementation)
21 | {
22 | _builder.AddSingleton(service, implementation);
23 | }
24 |
25 | public void RegisterInstance(Type service, object implementation)
26 | {
27 | _builder.AddSingleton(service, implementation);
28 | }
29 |
30 | public void RegisterLazy(Type service, Func