@codemation/host 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/{PrismaMigrationDeployer-B7cHGrXP.js → AppConfigFactory-DWIz2hy-.js} +104 -58
- package/dist/AppConfigFactory-DWIz2hy-.js.map +1 -0
- package/dist/{client-Yh7-CQud.d.ts → AppConfigFactory-DmHOpg8O.d.ts} +52 -31
- package/dist/{CodemationFrontendBootstrapRequest-CNEk-C4D.js → AppContainerFactory-B5eRpvAa.js} +3269 -3374
- package/dist/AppContainerFactory-B5eRpvAa.js.map +1 -0
- package/dist/{CodemationWhitelabelConfig-DgbjgtrR.d.ts → CodemationAuthConfig-Bh2cCNCI.d.ts} +32 -2
- package/dist/{CodemationConfig-XCkSV2dj.d.ts → CodemationConfig-D2ULNkec.d.ts} +53 -49
- package/dist/CodemationConfigNormalizer-CBLxXaRV.d.ts +9 -0
- package/dist/{CodemationConsumerConfigLoader-scS_RQMy.js → CodemationConsumerConfigLoader-BBzAr6L_.js} +128 -3
- package/dist/CodemationConsumerConfigLoader-BBzAr6L_.js.map +1 -0
- package/dist/{CodemationConsumerConfigLoader-Dmm2TzAA.d.ts → CodemationConsumerConfigLoader-BLvzcfb7.d.ts} +4 -4
- package/dist/CodemationPluginListMerger-B0-e4CJ6.d.ts +391 -0
- package/dist/{CodemationPluginListMerger-BNmaoXQL.js → CodemationPluginListMerger-DrVOw9KP.js} +18 -10
- package/dist/CodemationPluginListMerger-DrVOw9KP.js.map +1 -0
- package/dist/{CredentialServices-DpDpm8mL.d.ts → CredentialServices-BeuMtqYA.d.ts} +3 -3
- package/dist/{CredentialServices-BKBGe7l3.js → CredentialServices-DNb3CZwW.js} +3 -3
- package/dist/CredentialServices-DNb3CZwW.js.map +1 -0
- package/dist/FrontendAppConfig-D50wjj_n.d.ts +27 -0
- package/dist/{WorkflowViewContracts-DCLpTn25.d.ts → FrontendAppConfigFactory-Bj-DZNlt.d.ts} +29 -2
- package/dist/FrontendAppConfigJsonCodec-1_L7H_Qo.d.ts +20 -0
- package/dist/FrontendAppConfigJsonCodec-nOCQI0ag.js +84 -0
- package/dist/FrontendAppConfigJsonCodec-nOCQI0ag.js.map +1 -0
- package/dist/{LogLevelPolicy-4cq9z0TI.d.ts → LogLevelPolicy-BS_NlAOg.d.ts} +2 -2
- package/dist/{ServerLoggerFactory-BRHxIDS7.js → ServerLoggerFactory-BltIIDfQ.js} +4 -129
- package/dist/ServerLoggerFactory-BltIIDfQ.js.map +1 -0
- package/dist/client.d.ts +5 -3
- package/dist/client.js +2 -1
- package/dist/client.js.map +1 -1
- package/dist/consumer.d.ts +5 -4
- package/dist/consumer.js +4 -4
- package/dist/credentials.d.ts +4 -4
- package/dist/credentials.js +3 -3
- package/dist/devServerSidecar.d.ts +1 -1
- package/dist/{index-Bs4F1IsC.d.ts → index-CkiptHb-.d.ts} +19 -20
- package/dist/index.d.ts +14 -19
- package/dist/index.js +12 -11
- package/dist/nextServer.d.ts +244 -9
- package/dist/nextServer.js +8 -8
- package/dist/persistenceServer-CaehMh3M.d.ts +9 -0
- package/dist/{persistenceServer-8tcM2S48.js → persistenceServer-DVeWUbc3.js} +2 -2
- package/dist/{persistenceServer-8tcM2S48.js.map → persistenceServer-DVeWUbc3.js.map} +1 -1
- package/dist/persistenceServer.d.ts +7 -6
- package/dist/persistenceServer.js +4 -4
- package/dist/{server-Dd65rNm6.js → server-C65z_kqm.js} +47 -17
- package/dist/server-C65z_kqm.js.map +1 -0
- package/dist/{server-BBdsATju.d.ts → server-Dyo8qh4k.d.ts} +23 -4
- package/dist/server.d.ts +12 -9
- package/dist/server.js +11 -10
- package/package.json +6 -6
- package/src/application/commands/WorkflowCommandHandlers.ts +9 -0
- package/src/application/dev/BootRuntimeSnapshotHolder.ts +2 -2
- package/src/application/dev/BootRuntimeSummary.types.ts +2 -2
- package/src/application/queries/WorkflowQueryHandlers.ts +7 -0
- package/src/applicationTokens.ts +1 -1
- package/src/bootstrap/AppContainerFactory.ts +584 -0
- package/src/bootstrap/{PreparedCodemationRuntime.ts → AppContainerLifecycle.ts} +3 -8
- package/src/bootstrap/runtime/AppConfigFactory.ts +155 -30
- package/src/bootstrap/runtime/DatabaseMigrations.ts +18 -0
- package/src/bootstrap/runtime/FrontendRuntime.ts +44 -0
- package/src/bootstrap/runtime/WorkerRuntime.ts +55 -0
- package/src/client.ts +7 -0
- package/src/index.ts +15 -5
- package/src/infrastructure/persistence/PrismaMigrationDeployer.ts +2 -2
- package/src/infrastructure/persistence/SchedulerPersistenceCompatibilityValidator.ts +2 -2
- package/src/infrastructure/scheduler/WorkerRuntimeScheduler.ts +16 -0
- package/src/infrastructure/scheduler/bullmq/BullmqNodeExecutionScheduler.ts +47 -0
- package/src/infrastructure/scheduler/bullmq/BullmqScheduler.ts +33 -0
- package/src/infrastructure/scheduler/bullmq/BullmqWorker.ts +48 -0
- package/src/infrastructure/scheduler/bullmq/RedisConnectionOptionsFactory.ts +48 -0
- package/src/nextServer.ts +12 -3
- package/src/persistenceServer.ts +2 -2
- package/src/presentation/config/AppConfig.ts +25 -1
- package/src/presentation/frontend/CodemationFrontendAuthSnapshot.ts +14 -0
- package/src/presentation/frontend/CodemationFrontendAuthSnapshotFactory.ts +84 -0
- package/src/presentation/frontend/CodemationFrontendAuthSnapshotJsonCodec.ts +58 -0
- package/src/presentation/frontend/FrontendAppConfig.ts +10 -0
- package/src/presentation/frontend/FrontendAppConfigFactory.ts +26 -0
- package/src/presentation/frontend/FrontendAppConfigJsonCodec.ts +58 -0
- package/src/presentation/http/CodemationServerGatewayFactory.ts +22 -16
- package/src/presentation/server/AppConfigLoader.ts +39 -0
- package/src/presentation/server/CodemationConsumerAppResolver.ts +2 -2
- package/src/presentation/server/CodemationConsumerConfigLoader.ts +3 -2
- package/src/server.ts +7 -0
- package/vitest.shared.ts +0 -4
- package/dist/CodemationConsumerConfigLoader-scS_RQMy.js.map +0 -1
- package/dist/CodemationFrontendBootstrapRequest-CNEk-C4D.js.map +0 -1
- package/dist/CodemationPluginListMerger-BNmaoXQL.js.map +0 -1
- package/dist/CodemationPluginListMerger-BRYqEk0y.d.ts +0 -793
- package/dist/CredentialServices-BKBGe7l3.js.map +0 -1
- package/dist/PrismaMigrationDeployer-B7cHGrXP.js.map +0 -1
- package/dist/ServerLoggerFactory-BRHxIDS7.js.map +0 -1
- package/dist/persistenceServer-DPSj_-oU.d.ts +0 -37
- package/dist/server-Dd65rNm6.js.map +0 -1
- package/src/bootstrap/CodemationContainerFactory.ts +0 -310
- package/src/bootstrap/CodemationFrontendBootstrapRequest.ts +0 -16
- package/src/bootstrap/CodemationWorkerBootstrapRequest.ts +0 -19
- package/src/bootstrap/PreparedCodemationRuntimeFactory.ts +0 -308
- package/src/bootstrap/boot/CliRuntimeBootService.ts +0 -27
- package/src/bootstrap/boot/FrontendRuntimeBootService.ts +0 -86
- package/src/bootstrap/boot/WorkerRuntimeBootService.ts +0 -64
- package/src/bootstrap/runtime/ResolvedImplementationSelectionFactory.ts +0 -118
- package/src/codemationApplication.ts +0 -311
- package/src/infrastructure/credentials/FrameworkBuiltinCredentialTypesRegistrar.ts +0 -21
- package/src/infrastructure/persistence/DatabasePersistenceResolver.ts +0 -91
- package/src/infrastructure/runtime/WorkerRuntimeScheduler.ts +0 -35
- package/src/presentation/config/CodemationApplicationFacade.ts +0 -5
- /package/dist/{decorate-B-N_5S4p.js → decorate-B0PP651O.js} +0 -0
- /package/dist/{decorateParam-BTcc3KNk.js → decorateParam-DrsXNPuw.js} +0 -0
|
@@ -1,57 +1,182 @@
|
|
|
1
|
+
import { CoreTokens } from "@codemation/core";
|
|
1
2
|
import type { AppConfig } from "../../presentation/config/AppConfig";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import type { NormalizedCodemationConfig } from "../../presentation/config/CodemationConfigNormalizer";
|
|
4
|
+
import type {
|
|
5
|
+
CodemationApplicationRuntimeConfig,
|
|
6
|
+
CodemationDatabaseKind,
|
|
7
|
+
CodemationEventBusKind,
|
|
8
|
+
CodemationSchedulerKind,
|
|
9
|
+
} from "../../presentation/config/CodemationConfig";
|
|
10
|
+
import path from "node:path";
|
|
6
11
|
|
|
7
12
|
export class AppConfigFactory {
|
|
8
|
-
constructor(
|
|
9
|
-
private readonly implementationSelectionFactory: ResolvedImplementationSelectionFactory = new ResolvedImplementationSelectionFactory(),
|
|
10
|
-
) {}
|
|
11
|
-
|
|
12
13
|
create(
|
|
13
14
|
args: Readonly<{
|
|
14
15
|
repoRoot: string;
|
|
15
16
|
consumerRoot: string;
|
|
16
17
|
env: NodeJS.ProcessEnv;
|
|
18
|
+
config: NormalizedCodemationConfig;
|
|
17
19
|
workflowSources: ReadonlyArray<string>;
|
|
18
|
-
runtimeConfig: CodemationApplicationRuntimeConfig;
|
|
19
|
-
authConfig: CodemationAuthConfig | undefined;
|
|
20
|
-
whitelabelConfig: CodemationWhitelabelConfig;
|
|
21
20
|
}>,
|
|
22
21
|
): AppConfig {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const workerQueues =
|
|
29
|
-
const queuePrefix =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
const runtimeConfig = args.config.runtime ?? {};
|
|
23
|
+
const persistence = this.resolvePersistence(runtimeConfig, args.env, args.consumerRoot);
|
|
24
|
+
const redisUrl = runtimeConfig.eventBus?.redisUrl ?? args.env.REDIS_URL;
|
|
25
|
+
const schedulerKind = this.resolveSchedulerKind(runtimeConfig, args.env, redisUrl);
|
|
26
|
+
const eventBusKind = this.resolveEventBusKind(runtimeConfig, args.env, schedulerKind, redisUrl);
|
|
27
|
+
const workerQueues = runtimeConfig.scheduler?.workerQueues ?? [];
|
|
28
|
+
const queuePrefix =
|
|
29
|
+
runtimeConfig.scheduler?.queuePrefix ?? runtimeConfig.eventBus?.queuePrefix ?? args.env.QUEUE_PREFIX;
|
|
30
|
+
const hasConfiguredCredentialSessionServiceRegistration = args.config.containerRegistrations.some(
|
|
31
|
+
(entry) => entry.token === CoreTokens.CredentialSessionService,
|
|
32
|
+
);
|
|
34
33
|
|
|
35
34
|
return {
|
|
36
35
|
consumerRoot: args.consumerRoot,
|
|
37
36
|
repoRoot: args.repoRoot,
|
|
38
37
|
env: args.env,
|
|
39
38
|
workflowSources: [...args.workflowSources],
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
workflows: [...(args.config.workflows ?? [])],
|
|
40
|
+
containerRegistrations: [...args.config.containerRegistrations],
|
|
41
|
+
credentialTypes: [...(args.config.credentialTypes ?? [])],
|
|
42
|
+
plugins: [...(args.config.plugins ?? [])],
|
|
43
|
+
hasConfiguredCredentialSessionServiceRegistration,
|
|
44
|
+
log: args.config.log,
|
|
45
|
+
engineExecutionLimits: runtimeConfig.engineExecutionLimits,
|
|
46
|
+
databaseUrl:
|
|
47
|
+
persistence.kind === "postgresql" ? persistence.databaseUrl : runtimeConfig.database?.url?.trim() || undefined,
|
|
48
|
+
database: runtimeConfig.database,
|
|
49
|
+
persistence,
|
|
42
50
|
scheduler: {
|
|
43
|
-
kind:
|
|
51
|
+
kind: schedulerKind,
|
|
44
52
|
queuePrefix,
|
|
45
53
|
workerQueues,
|
|
46
|
-
redisUrl
|
|
54
|
+
redisUrl,
|
|
47
55
|
},
|
|
48
56
|
eventing: {
|
|
49
|
-
kind:
|
|
57
|
+
kind: eventBusKind,
|
|
50
58
|
queuePrefix,
|
|
51
|
-
redisUrl
|
|
59
|
+
redisUrl,
|
|
52
60
|
},
|
|
53
|
-
auth: args.
|
|
54
|
-
whitelabel: args.
|
|
61
|
+
auth: args.config.auth,
|
|
62
|
+
whitelabel: args.config.whitelabel ?? {},
|
|
63
|
+
webSocketPort: this.resolveWebSocketPort(args.env),
|
|
64
|
+
webSocketBindHost: args.env.CODEMATION_WS_BIND_HOST ?? "0.0.0.0",
|
|
55
65
|
};
|
|
56
66
|
}
|
|
67
|
+
|
|
68
|
+
private resolvePersistence(
|
|
69
|
+
runtimeConfig: CodemationApplicationRuntimeConfig,
|
|
70
|
+
env: NodeJS.ProcessEnv,
|
|
71
|
+
consumerRoot: string,
|
|
72
|
+
): AppConfig["persistence"] {
|
|
73
|
+
const database = runtimeConfig.database;
|
|
74
|
+
if (!database) {
|
|
75
|
+
return { kind: "none" };
|
|
76
|
+
}
|
|
77
|
+
const kind = this.resolveDatabaseKind(database.kind, database.url, env);
|
|
78
|
+
if (kind === "postgresql") {
|
|
79
|
+
const databaseUrl = database.url?.trim() ?? "";
|
|
80
|
+
if (!databaseUrl) {
|
|
81
|
+
throw new Error('runtime.database.kind is "postgresql" but no database URL was set (runtime.database.url).');
|
|
82
|
+
}
|
|
83
|
+
if (!databaseUrl.startsWith("postgresql://") && !databaseUrl.startsWith("postgres://")) {
|
|
84
|
+
throw new Error(
|
|
85
|
+
`runtime.database.url must be a postgresql:// or postgres:// URL when kind is postgresql. Received: ${databaseUrl}`,
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
return { kind: "postgresql", databaseUrl };
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
kind: "pglite",
|
|
92
|
+
dataDir: this.resolvePgliteDataDir(database.pgliteDataDir, env, consumerRoot),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
private resolveDatabaseKind(
|
|
97
|
+
configuredKind: CodemationDatabaseKind | undefined,
|
|
98
|
+
databaseUrl: string | undefined,
|
|
99
|
+
env: NodeJS.ProcessEnv,
|
|
100
|
+
): CodemationDatabaseKind {
|
|
101
|
+
const kindFromEnv = env.CODEMATION_DATABASE_KIND?.trim();
|
|
102
|
+
if (kindFromEnv === "postgresql" || kindFromEnv === "pglite") {
|
|
103
|
+
return kindFromEnv;
|
|
104
|
+
}
|
|
105
|
+
if (configuredKind) {
|
|
106
|
+
return configuredKind;
|
|
107
|
+
}
|
|
108
|
+
const trimmedUrl = databaseUrl?.trim();
|
|
109
|
+
if (trimmedUrl && (trimmedUrl.startsWith("postgresql://") || trimmedUrl.startsWith("postgres://"))) {
|
|
110
|
+
return "postgresql";
|
|
111
|
+
}
|
|
112
|
+
return "pglite";
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
private resolvePgliteDataDir(
|
|
116
|
+
configuredPath: string | undefined,
|
|
117
|
+
env: NodeJS.ProcessEnv,
|
|
118
|
+
consumerRoot: string,
|
|
119
|
+
): string {
|
|
120
|
+
const envPath = env.CODEMATION_PGLITE_DATA_DIR?.trim();
|
|
121
|
+
if (envPath && envPath.length > 0) {
|
|
122
|
+
return path.isAbsolute(envPath) ? envPath : path.resolve(consumerRoot, envPath);
|
|
123
|
+
}
|
|
124
|
+
const trimmedConfiguredPath = configuredPath?.trim();
|
|
125
|
+
if (trimmedConfiguredPath && trimmedConfiguredPath.length > 0) {
|
|
126
|
+
return path.isAbsolute(trimmedConfiguredPath)
|
|
127
|
+
? trimmedConfiguredPath
|
|
128
|
+
: path.resolve(consumerRoot, trimmedConfiguredPath);
|
|
129
|
+
}
|
|
130
|
+
return path.resolve(consumerRoot, ".codemation", "pglite");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
private resolveSchedulerKind(
|
|
134
|
+
runtimeConfig: CodemationApplicationRuntimeConfig,
|
|
135
|
+
env: NodeJS.ProcessEnv,
|
|
136
|
+
redisUrl: string | undefined,
|
|
137
|
+
): CodemationSchedulerKind {
|
|
138
|
+
const configuredKind = runtimeConfig.scheduler?.kind ?? this.readSchedulerKind(env.CODEMATION_SCHEDULER);
|
|
139
|
+
if (configuredKind) {
|
|
140
|
+
return configuredKind;
|
|
141
|
+
}
|
|
142
|
+
return redisUrl ? "bullmq" : "local";
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
private resolveEventBusKind(
|
|
146
|
+
runtimeConfig: CodemationApplicationRuntimeConfig,
|
|
147
|
+
env: NodeJS.ProcessEnv,
|
|
148
|
+
schedulerKind: CodemationSchedulerKind,
|
|
149
|
+
redisUrl: string | undefined,
|
|
150
|
+
): CodemationEventBusKind {
|
|
151
|
+
const configuredKind = runtimeConfig.eventBus?.kind ?? this.readEventBusKind(env.CODEMATION_EVENT_BUS);
|
|
152
|
+
if (configuredKind) {
|
|
153
|
+
return configuredKind;
|
|
154
|
+
}
|
|
155
|
+
if (schedulerKind === "bullmq") {
|
|
156
|
+
return "redis";
|
|
157
|
+
}
|
|
158
|
+
return redisUrl ? "redis" : "memory";
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
private readSchedulerKind(value: string | undefined): CodemationSchedulerKind | undefined {
|
|
162
|
+
if (value === "local" || value === "bullmq") {
|
|
163
|
+
return value;
|
|
164
|
+
}
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
private readEventBusKind(value: string | undefined): CodemationEventBusKind | undefined {
|
|
169
|
+
if (value === "memory" || value === "redis") {
|
|
170
|
+
return value;
|
|
171
|
+
}
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
private resolveWebSocketPort(env: NodeJS.ProcessEnv): number {
|
|
176
|
+
const configuredPort = Number(env.CODEMATION_WS_PORT ?? 3001);
|
|
177
|
+
if (Number.isNaN(configuredPort) || configuredPort <= 0) {
|
|
178
|
+
return 3001;
|
|
179
|
+
}
|
|
180
|
+
return configuredPort;
|
|
181
|
+
}
|
|
57
182
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { inject, injectable } from "@codemation/core";
|
|
2
|
+
import { ApplicationTokens } from "../../applicationTokens";
|
|
3
|
+
import type { AppConfig } from "../../presentation/config/AppConfig";
|
|
4
|
+
import { PrismaMigrationDeployer } from "../../infrastructure/persistence/PrismaMigrationDeployer";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export class DatabaseMigrations {
|
|
8
|
+
constructor(
|
|
9
|
+
@inject(ApplicationTokens.AppConfig)
|
|
10
|
+
private readonly appConfig: AppConfig,
|
|
11
|
+
@inject(PrismaMigrationDeployer)
|
|
12
|
+
private readonly prismaMigrationDeployer: PrismaMigrationDeployer,
|
|
13
|
+
) {}
|
|
14
|
+
|
|
15
|
+
async migrate(): Promise<void> {
|
|
16
|
+
await this.prismaMigrationDeployer.deployPersistence(this.appConfig.persistence, this.appConfig.env);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CoreTokens, inject, injectable, type WorkflowRepository } from "@codemation/core";
|
|
2
|
+
import { Engine } from "@codemation/core/bootstrap";
|
|
3
|
+
import { ApplicationTokens } from "../../applicationTokens";
|
|
4
|
+
import type { AppConfig } from "../../presentation/config/AppConfig";
|
|
5
|
+
import { RuntimeWorkflowActivationPolicy } from "../../infrastructure/persistence/RuntimeWorkflowActivationPolicy";
|
|
6
|
+
import { WorkflowRunEventWebsocketRelay } from "../../application/websocket/WorkflowRunEventWebsocketRelay";
|
|
7
|
+
import { WorkflowWebsocketServer } from "../../presentation/websocket/WorkflowWebsocketServer";
|
|
8
|
+
import { DatabaseMigrations } from "./DatabaseMigrations";
|
|
9
|
+
import type { WorkflowActivationRepository } from "../../domain/workflows/WorkflowActivationRepository";
|
|
10
|
+
|
|
11
|
+
@injectable()
|
|
12
|
+
export class FrontendRuntime {
|
|
13
|
+
constructor(
|
|
14
|
+
@inject(ApplicationTokens.AppConfig)
|
|
15
|
+
private readonly appConfig: AppConfig,
|
|
16
|
+
@inject(DatabaseMigrations)
|
|
17
|
+
private readonly databaseMigrations: DatabaseMigrations,
|
|
18
|
+
@inject(RuntimeWorkflowActivationPolicy)
|
|
19
|
+
private readonly runtimeWorkflowActivationPolicy: RuntimeWorkflowActivationPolicy,
|
|
20
|
+
@inject(ApplicationTokens.WorkflowActivationRepository)
|
|
21
|
+
private readonly workflowActivationRepository: WorkflowActivationRepository,
|
|
22
|
+
@inject(CoreTokens.WorkflowRepository)
|
|
23
|
+
private readonly workflowRepository: WorkflowRepository,
|
|
24
|
+
@inject(WorkflowWebsocketServer)
|
|
25
|
+
private readonly workflowWebsocketServer: WorkflowWebsocketServer,
|
|
26
|
+
@inject(WorkflowRunEventWebsocketRelay)
|
|
27
|
+
private readonly workflowRunEventWebsocketRelay: WorkflowRunEventWebsocketRelay,
|
|
28
|
+
@inject(Engine)
|
|
29
|
+
private readonly engine: Engine,
|
|
30
|
+
) {}
|
|
31
|
+
|
|
32
|
+
async start(args?: Readonly<{ skipPresentationServers?: boolean }>): Promise<void> {
|
|
33
|
+
if (this.appConfig.env.CODEMATION_SKIP_STARTUP_MIGRATIONS !== "true") {
|
|
34
|
+
await this.databaseMigrations.migrate();
|
|
35
|
+
}
|
|
36
|
+
await this.runtimeWorkflowActivationPolicy.hydrateFromRepository(this.workflowActivationRepository);
|
|
37
|
+
if (args?.skipPresentationServers === true) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
await this.engine.start([...this.workflowRepository.list()]);
|
|
41
|
+
await this.workflowWebsocketServer.start();
|
|
42
|
+
await this.workflowRunEventWebsocketRelay.start();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { WorkflowRepository } from "@codemation/core";
|
|
2
|
+
import { CoreTokens, inject, injectable } from "@codemation/core";
|
|
3
|
+
import { Engine } from "@codemation/core/bootstrap";
|
|
4
|
+
import { ApplicationTokens } from "../../applicationTokens";
|
|
5
|
+
import type { AppConfig } from "../../presentation/config/AppConfig";
|
|
6
|
+
import type {
|
|
7
|
+
WorkerRuntimeHandle,
|
|
8
|
+
WorkerRuntimeScheduler,
|
|
9
|
+
} from "../../infrastructure/scheduler/WorkerRuntimeScheduler";
|
|
10
|
+
import { RuntimeWorkflowActivationPolicy } from "../../infrastructure/persistence/RuntimeWorkflowActivationPolicy";
|
|
11
|
+
import type { WorkflowActivationRepository } from "../../domain/workflows/WorkflowActivationRepository";
|
|
12
|
+
import { DatabaseMigrations } from "./DatabaseMigrations";
|
|
13
|
+
import { AppContainerLifecycle } from "../AppContainerLifecycle";
|
|
14
|
+
|
|
15
|
+
@injectable()
|
|
16
|
+
export class WorkerRuntime {
|
|
17
|
+
constructor(
|
|
18
|
+
@inject(ApplicationTokens.AppConfig)
|
|
19
|
+
private readonly appConfig: AppConfig,
|
|
20
|
+
@inject(DatabaseMigrations)
|
|
21
|
+
private readonly databaseMigrations: DatabaseMigrations,
|
|
22
|
+
@inject(RuntimeWorkflowActivationPolicy)
|
|
23
|
+
private readonly runtimeWorkflowActivationPolicy: RuntimeWorkflowActivationPolicy,
|
|
24
|
+
@inject(ApplicationTokens.WorkflowActivationRepository)
|
|
25
|
+
private readonly workflowActivationRepository: WorkflowActivationRepository,
|
|
26
|
+
@inject(CoreTokens.WorkflowRepository)
|
|
27
|
+
private readonly workflowRepository: WorkflowRepository,
|
|
28
|
+
@inject(Engine)
|
|
29
|
+
private readonly engine: Engine,
|
|
30
|
+
@inject(ApplicationTokens.WorkerRuntimeScheduler)
|
|
31
|
+
private readonly scheduler: WorkerRuntimeScheduler,
|
|
32
|
+
@inject(AppContainerLifecycle)
|
|
33
|
+
private readonly lifecycle: AppContainerLifecycle,
|
|
34
|
+
) {}
|
|
35
|
+
|
|
36
|
+
async start(queues: ReadonlyArray<string>): Promise<WorkerRuntimeHandle> {
|
|
37
|
+
if (this.appConfig.env.CODEMATION_SKIP_STARTUP_MIGRATIONS !== "true") {
|
|
38
|
+
await this.databaseMigrations.migrate();
|
|
39
|
+
}
|
|
40
|
+
await this.runtimeWorkflowActivationPolicy.hydrateFromRepository(this.workflowActivationRepository);
|
|
41
|
+
const workflows = [...this.workflowRepository.list()];
|
|
42
|
+
await this.engine.start(workflows);
|
|
43
|
+
const worker = this.scheduler.createWorker({
|
|
44
|
+
queues,
|
|
45
|
+
requestHandler: this.engine,
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
stop: async () => {
|
|
49
|
+
await worker.stop();
|
|
50
|
+
await this.scheduler.close();
|
|
51
|
+
await this.lifecycle.stop({ stopWebsocketServer: false });
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
package/src/client.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
export type { Logger, LoggerFactory } from "./application/logging/Logger";
|
|
2
2
|
export { BrowserLoggerFactory } from "./infrastructure/logging/BrowserLoggerFactory";
|
|
3
3
|
export type { CodemationWhitelabelConfig } from "./presentation/config/CodemationWhitelabelConfig";
|
|
4
|
+
export type { FrontendAppConfig } from "./presentation/frontend/FrontendAppConfig";
|
|
5
|
+
export type {
|
|
6
|
+
CodemationFrontendAuthProviderSnapshot,
|
|
7
|
+
CodemationFrontendAuthSnapshot,
|
|
8
|
+
} from "./presentation/frontend/CodemationFrontendAuthSnapshot";
|
|
9
|
+
export { CodemationFrontendAuthSnapshotJsonCodec } from "./presentation/frontend/CodemationFrontendAuthSnapshotJsonCodec";
|
|
10
|
+
export { FrontendAppConfigJsonCodec } from "./presentation/frontend/FrontendAppConfigJsonCodec";
|
package/src/index.ts
CHANGED
|
@@ -3,15 +3,16 @@ export type { QueryBus } from "./application/bus/QueryBus";
|
|
|
3
3
|
export { ListUserAccountsQuery } from "./application/queries/ListUserAccountsQuery";
|
|
4
4
|
export { UpsertLocalBootstrapUserCommand } from "./application/commands/UpsertLocalBootstrapUserCommand";
|
|
5
5
|
export type { UpsertLocalBootstrapUserResultDto } from "./application/contracts/userDirectoryContracts.types";
|
|
6
|
-
export {
|
|
7
|
-
export
|
|
6
|
+
export { AppContainerFactory } from "./bootstrap/AppContainerFactory";
|
|
7
|
+
export { AppContainerLifecycle } from "./bootstrap/AppContainerLifecycle";
|
|
8
|
+
export { DatabaseMigrations } from "./bootstrap/runtime/DatabaseMigrations";
|
|
9
|
+
export { FrontendRuntime } from "./bootstrap/runtime/FrontendRuntime";
|
|
10
|
+
export { WorkerRuntime } from "./bootstrap/runtime/WorkerRuntime";
|
|
11
|
+
export { AppConfigFactory } from "./bootstrap/runtime/AppConfigFactory";
|
|
8
12
|
export { ApplicationTokens } from "./applicationTokens";
|
|
9
13
|
export { CodemationBootstrapRequest } from "./bootstrap/CodemationBootstrapRequest";
|
|
10
|
-
export { CodemationFrontendBootstrapRequest } from "./bootstrap/CodemationFrontendBootstrapRequest";
|
|
11
|
-
export { CodemationWorkerBootstrapRequest } from "./bootstrap/CodemationWorkerBootstrapRequest";
|
|
12
14
|
export type { CodemationWhitelabelConfig } from "./presentation/config/CodemationWhitelabelConfig";
|
|
13
15
|
export type { AppConfig } from "./presentation/config/AppConfig";
|
|
14
|
-
export type { CodemationApplicationFacade } from "./presentation/config/CodemationApplicationFacade";
|
|
15
16
|
export type {
|
|
16
17
|
CodemationAuthConfig,
|
|
17
18
|
CodemationAuthKind,
|
|
@@ -37,6 +38,11 @@ export type {
|
|
|
37
38
|
CodemationAppContext,
|
|
38
39
|
CodemationRegistrationContextBase,
|
|
39
40
|
} from "./presentation/config/CodemationAppContext";
|
|
41
|
+
export type {
|
|
42
|
+
CodemationFrontendAuthProviderSnapshot,
|
|
43
|
+
CodemationFrontendAuthSnapshot,
|
|
44
|
+
} from "./presentation/frontend/CodemationFrontendAuthSnapshot";
|
|
45
|
+
export type { FrontendAppConfig } from "./presentation/frontend/FrontendAppConfig";
|
|
40
46
|
export type {
|
|
41
47
|
CodemationLogConfig,
|
|
42
48
|
CodemationLogLevelName,
|
|
@@ -51,6 +57,10 @@ export { CodemationPluginListMerger } from "./presentation/config/CodemationPlug
|
|
|
51
57
|
export type { CodemationWorkflowDiscovery } from "./presentation/config/CodemationWorkflowDiscovery";
|
|
52
58
|
export {
|
|
53
59
|
ApiPaths,
|
|
60
|
+
CodemationFrontendAuthSnapshotFactory,
|
|
61
|
+
CodemationFrontendAuthSnapshotJsonCodec,
|
|
62
|
+
FrontendAppConfigFactory,
|
|
63
|
+
FrontendAppConfigJsonCodec,
|
|
54
64
|
CodemationConsumerConfigLoader,
|
|
55
65
|
CodemationPostgresPrismaClientFactory,
|
|
56
66
|
CodemationServerGateway,
|
|
@@ -7,7 +7,7 @@ import { mkdir } from "node:fs/promises";
|
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
|
-
import type {
|
|
10
|
+
import type { AppPersistenceConfig } from "../../presentation/config/AppConfig";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Runs `prisma migrate deploy` against TCP PostgreSQL or against a PGlite data directory
|
|
@@ -17,7 +17,7 @@ import type { ResolvedDatabasePersistence } from "./DatabasePersistenceResolver"
|
|
|
17
17
|
export class PrismaMigrationDeployer {
|
|
18
18
|
private readonly require = createRequire(import.meta.url);
|
|
19
19
|
|
|
20
|
-
async deployPersistence(persistence:
|
|
20
|
+
async deployPersistence(persistence: AppPersistenceConfig, env?: Readonly<NodeJS.ProcessEnv>): Promise<void> {
|
|
21
21
|
if (persistence.kind === "none") {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AppPersistenceConfig } from "../../presentation/config/AppConfig";
|
|
2
2
|
import type { CodemationSchedulerKind } from "../../presentation/config/CodemationConfig";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Ensures scheduler and database selections are compatible (e.g. BullMQ requires shared TCP PostgreSQL).
|
|
6
6
|
*/
|
|
7
7
|
export class SchedulerPersistenceCompatibilityValidator {
|
|
8
|
-
validate(args: Readonly<{ schedulerKind: CodemationSchedulerKind; persistence:
|
|
8
|
+
validate(args: Readonly<{ schedulerKind: CodemationSchedulerKind; persistence: AppPersistenceConfig }>): void {
|
|
9
9
|
if (args.schedulerKind === "bullmq" && args.persistence.kind === "none") {
|
|
10
10
|
throw new Error(
|
|
11
11
|
"BullMQ requires PostgreSQL persistence. Configure runtime.database with a postgresql URL (embedded PGlite is not compatible with BullMQ).",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NodeExecutionRequestHandler, NodeExecutionScheduler } from "@codemation/core";
|
|
2
|
+
|
|
3
|
+
export type WorkerRuntimeHandle = Readonly<{
|
|
4
|
+
stop: () => Promise<void>;
|
|
5
|
+
}>;
|
|
6
|
+
|
|
7
|
+
export interface WorkerRuntimeScheduler extends NodeExecutionScheduler {
|
|
8
|
+
createWorker(
|
|
9
|
+
args: Readonly<{
|
|
10
|
+
queues: ReadonlyArray<string>;
|
|
11
|
+
requestHandler: NodeExecutionRequestHandler;
|
|
12
|
+
}>,
|
|
13
|
+
): WorkerRuntimeHandle;
|
|
14
|
+
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { NodeExecutionRequest, NodeExecutionScheduler } from "@codemation/core";
|
|
2
|
+
import { Queue } from "bullmq";
|
|
3
|
+
import type { RedisConnectionConfig } from "./RedisConnectionOptionsFactory";
|
|
4
|
+
import { RedisConnectionOptionsFactory } from "./RedisConnectionOptionsFactory";
|
|
5
|
+
|
|
6
|
+
type QueueName = string;
|
|
7
|
+
|
|
8
|
+
export class BullmqNodeExecutionScheduler implements NodeExecutionScheduler {
|
|
9
|
+
private readonly connection: Readonly<Record<string, unknown>>;
|
|
10
|
+
private readonly queuesByName = new Map<QueueName, Queue>();
|
|
11
|
+
|
|
12
|
+
constructor(
|
|
13
|
+
connection: RedisConnectionConfig,
|
|
14
|
+
private readonly queuePrefix: string = "codemation",
|
|
15
|
+
) {
|
|
16
|
+
this.connection = RedisConnectionOptionsFactory.fromConfig(connection);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async enqueue(request: NodeExecutionRequest): Promise<{ receiptId: string }> {
|
|
20
|
+
const logical = request.queue ?? "default";
|
|
21
|
+
const queueName = `${this.queuePrefix}.${logical}`;
|
|
22
|
+
const queue = this.getOrCreateQueue(queueName);
|
|
23
|
+
const jobId = `${request.runId}__${request.activationId}`;
|
|
24
|
+
await queue.add("node-execution", { kind: "nodeExecution", request } as const, {
|
|
25
|
+
jobId,
|
|
26
|
+
removeOnComplete: true,
|
|
27
|
+
removeOnFail: true,
|
|
28
|
+
});
|
|
29
|
+
return { receiptId: jobId };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async close(): Promise<void> {
|
|
33
|
+
const queues = [...this.queuesByName.values()];
|
|
34
|
+
this.queuesByName.clear();
|
|
35
|
+
await Promise.all(queues.map((queue) => queue.close()));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private getOrCreateQueue(name: QueueName): Queue {
|
|
39
|
+
const existing = this.queuesByName.get(name);
|
|
40
|
+
if (existing) {
|
|
41
|
+
return existing;
|
|
42
|
+
}
|
|
43
|
+
const queue = new Queue(name, { connection: this.connection as never });
|
|
44
|
+
this.queuesByName.set(name, queue);
|
|
45
|
+
return queue;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { NodeExecutionRequest, NodeExecutionRequestHandler } from "@codemation/core";
|
|
2
|
+
import type { WorkerRuntimeScheduler } from "../WorkerRuntimeScheduler";
|
|
3
|
+
import type { RedisConnectionConfig } from "./RedisConnectionOptionsFactory";
|
|
4
|
+
import { BullmqNodeExecutionScheduler } from "./BullmqNodeExecutionScheduler";
|
|
5
|
+
import { BullmqWorker } from "./BullmqWorker";
|
|
6
|
+
|
|
7
|
+
export class BullmqScheduler implements WorkerRuntimeScheduler {
|
|
8
|
+
private readonly scheduler: BullmqNodeExecutionScheduler;
|
|
9
|
+
|
|
10
|
+
constructor(
|
|
11
|
+
private readonly connection: RedisConnectionConfig,
|
|
12
|
+
private readonly queuePrefix: string = "codemation",
|
|
13
|
+
) {
|
|
14
|
+
this.scheduler = new BullmqNodeExecutionScheduler(connection, queuePrefix);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async enqueue(request: NodeExecutionRequest): Promise<{ receiptId: string }> {
|
|
18
|
+
return await this.scheduler.enqueue(request);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async close(): Promise<void> {
|
|
22
|
+
await this.scheduler.close();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
createWorker(
|
|
26
|
+
args: Readonly<{
|
|
27
|
+
queues: ReadonlyArray<string>;
|
|
28
|
+
requestHandler: NodeExecutionRequestHandler;
|
|
29
|
+
}>,
|
|
30
|
+
): BullmqWorker {
|
|
31
|
+
return new BullmqWorker(this.connection, args.queues, this.queuePrefix, args.requestHandler);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { NodeExecutionRequest, NodeExecutionRequestHandler } from "@codemation/core";
|
|
2
|
+
import type { Job } from "bullmq";
|
|
3
|
+
import { Worker } from "bullmq";
|
|
4
|
+
import type { RedisConnectionConfig } from "./RedisConnectionOptionsFactory";
|
|
5
|
+
import { RedisConnectionOptionsFactory } from "./RedisConnectionOptionsFactory";
|
|
6
|
+
|
|
7
|
+
type NodeExecutionJobData = Readonly<{
|
|
8
|
+
kind: "nodeExecution";
|
|
9
|
+
request: NodeExecutionRequest;
|
|
10
|
+
}>;
|
|
11
|
+
|
|
12
|
+
export class BullmqWorker {
|
|
13
|
+
private readonly connection: Readonly<Record<string, unknown>>;
|
|
14
|
+
private readonly workers: Worker[] = [];
|
|
15
|
+
|
|
16
|
+
constructor(
|
|
17
|
+
connection: RedisConnectionConfig,
|
|
18
|
+
queues: ReadonlyArray<string>,
|
|
19
|
+
queuePrefix: string,
|
|
20
|
+
private readonly requestHandler: NodeExecutionRequestHandler,
|
|
21
|
+
) {
|
|
22
|
+
this.connection = RedisConnectionOptionsFactory.fromConfig(connection);
|
|
23
|
+
for (const queue of queues) {
|
|
24
|
+
const queueName = `${queuePrefix}.${queue}`;
|
|
25
|
+
this.workers.push(
|
|
26
|
+
new Worker(queueName, async (job: Job) => await this.processJob(queueName, job), {
|
|
27
|
+
connection: this.connection as never,
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async waitUntilReady(): Promise<void> {
|
|
34
|
+
await Promise.all(this.workers.map((worker) => worker.waitUntilReady()));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async stop(): Promise<void> {
|
|
38
|
+
await Promise.all(this.workers.map((worker) => worker.close()));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
private async processJob(queueName: string, job: Job): Promise<void> {
|
|
42
|
+
const data = job.data as NodeExecutionJobData;
|
|
43
|
+
if (!data || data.kind !== "nodeExecution") {
|
|
44
|
+
throw new Error(`Unexpected job payload for queue ${queueName}`);
|
|
45
|
+
}
|
|
46
|
+
await this.requestHandler.handleNodeExecutionRequest(data.request);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type RedisConnectionConfig =
|
|
2
|
+
| Readonly<{ url: string }>
|
|
3
|
+
| Readonly<{
|
|
4
|
+
host: string;
|
|
5
|
+
port: number;
|
|
6
|
+
username?: string;
|
|
7
|
+
password?: string;
|
|
8
|
+
db?: number;
|
|
9
|
+
tls?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
|
|
12
|
+
export class RedisConnectionOptionsFactory {
|
|
13
|
+
private static readonly bullMqIoredisDefaults = {
|
|
14
|
+
maxRetriesPerRequest: null,
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
static fromConfig(cfg: RedisConnectionConfig): Readonly<Record<string, unknown>> {
|
|
18
|
+
if ("url" in cfg) {
|
|
19
|
+
return this.fromUrl(cfg.url);
|
|
20
|
+
}
|
|
21
|
+
const { host, port, username, password, db, tls } = cfg;
|
|
22
|
+
return {
|
|
23
|
+
...this.bullMqIoredisDefaults,
|
|
24
|
+
host,
|
|
25
|
+
port,
|
|
26
|
+
...(username ? { username } : {}),
|
|
27
|
+
...(password ? { password } : {}),
|
|
28
|
+
...(typeof db === "number" ? { db } : {}),
|
|
29
|
+
...(tls ? { tls: {} } : {}),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static fromUrl(redisUrl: string): Readonly<Record<string, unknown>> {
|
|
34
|
+
const url = new URL(redisUrl);
|
|
35
|
+
if (url.protocol !== "redis:" && url.protocol !== "rediss:") {
|
|
36
|
+
throw new Error(`Unsupported redis URL protocol: ${url.protocol}`);
|
|
37
|
+
}
|
|
38
|
+
const db = url.pathname && url.pathname !== "/" ? Number(url.pathname.slice(1)) : undefined;
|
|
39
|
+
return this.fromConfig({
|
|
40
|
+
host: url.hostname,
|
|
41
|
+
port: url.port ? Number(url.port) : 6379,
|
|
42
|
+
username: url.username || undefined,
|
|
43
|
+
password: url.password || undefined,
|
|
44
|
+
db: typeof db === "number" && !Number.isNaN(db) ? db : undefined,
|
|
45
|
+
tls: url.protocol === "rediss:",
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
package/src/nextServer.ts
CHANGED
|
@@ -14,11 +14,20 @@ export { WorkflowDefinitionMapper } from "./application/mapping/WorkflowDefiniti
|
|
|
14
14
|
export { WorkflowPolicyUiPresentationFactory } from "./application/mapping/WorkflowPolicyUiPresentationFactory";
|
|
15
15
|
export { WorkflowRunRetentionPruneScheduler } from "./application/runs/WorkflowRunRetentionPruneScheduler";
|
|
16
16
|
export { ApplicationTokens } from "./applicationTokens";
|
|
17
|
-
export {
|
|
17
|
+
export { AppContainerFactory } from "./bootstrap/AppContainerFactory";
|
|
18
|
+
export { AppContainerLifecycle } from "./bootstrap/AppContainerLifecycle";
|
|
19
|
+
export { DatabaseMigrations } from "./bootstrap/runtime/DatabaseMigrations";
|
|
20
|
+
export { FrontendRuntime } from "./bootstrap/runtime/FrontendRuntime";
|
|
21
|
+
export { WorkerRuntime } from "./bootstrap/runtime/WorkerRuntime";
|
|
22
|
+
export { AppConfigFactory } from "./bootstrap/runtime/AppConfigFactory";
|
|
18
23
|
export { CodemationBootstrapRequest } from "./bootstrap/CodemationBootstrapRequest";
|
|
19
|
-
export { CodemationFrontendBootstrapRequest } from "./bootstrap/CodemationFrontendBootstrapRequest";
|
|
20
|
-
export { CodemationWorkerBootstrapRequest } from "./bootstrap/CodemationWorkerBootstrapRequest";
|
|
21
24
|
export { CodemationPluginListMerger } from "./presentation/config/CodemationPluginListMerger";
|
|
25
|
+
export type {
|
|
26
|
+
CodemationFrontendAuthProviderSnapshot,
|
|
27
|
+
CodemationFrontendAuthSnapshot,
|
|
28
|
+
} from "./presentation/frontend/CodemationFrontendAuthSnapshot";
|
|
29
|
+
export type { FrontendAppConfig } from "./presentation/frontend/FrontendAppConfig";
|
|
30
|
+
export { FrontendAppConfigFactory } from "./presentation/frontend/FrontendAppConfigFactory";
|
|
22
31
|
export { CredentialBindingService, CredentialInstanceService } from "./domain/credentials/CredentialServices";
|
|
23
32
|
export { RequestToWebhookItemMapper } from "./infrastructure/webhooks/RequestToWebhookItemMapper";
|
|
24
33
|
export { CodemationHonoApiApp } from "./presentation/http/hono/CodemationHonoApiAppFactory";
|
package/src/persistenceServer.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { CodemationPostgresPrismaClientFactory } from "./infrastructure/persistence/CodemationPostgresPrismaClientFactory";
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
2
|
+
export type { AppPersistenceConfig } from "./presentation/config/AppConfig";
|
|
3
|
+
export { AppConfigFactory } from "./bootstrap/runtime/AppConfigFactory";
|
|
4
4
|
export { PrismaMigrationDeployer } from "./infrastructure/persistence/PrismaMigrationDeployer";
|
|
5
5
|
export { PrismaClient } from "./infrastructure/persistence/generated/prisma-client/client.js";
|