@codemation/host 0.1.7 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/{AppConfigFactory-ByT1D8dM.js → AppConfigFactory-CqKWXqOm.js} +2 -2
- package/dist/{AppConfigFactory-ByT1D8dM.js.map → AppConfigFactory-CqKWXqOm.js.map} +1 -1
- package/dist/{AppConfigFactory-BBEn2B-i.d.ts → AppConfigFactory-j1Mc-dIX.d.ts} +3 -3
- package/dist/{AppContainerFactory-CeKsjo8L.js → AppContainerFactory-CcSGFNLW.js} +53 -16
- package/dist/AppContainerFactory-CcSGFNLW.js.map +1 -0
- package/dist/{CodemationConfig-9PkOBCh-.d.ts → CodemationAppContext-Vtn0U2Ga.d.ts} +80 -80
- package/dist/CodemationAuthoring.types-CXubuYvd.d.ts +196 -0
- package/dist/CodemationAuthoring.types-SxVJ1qu5.js +86 -0
- package/dist/CodemationAuthoring.types-SxVJ1qu5.js.map +1 -0
- package/dist/{CodemationConfigNormalizer-DIc-LYqW.d.ts → CodemationConfigNormalizer-kJmyHNDp.d.ts} +2 -2
- package/dist/{CodemationConsumerConfigLoader-CeW4bnOg.d.ts → CodemationConsumerConfigLoader-BvTE-7tX.d.ts} +2 -2
- package/dist/{CodemationConsumerConfigLoader-D6LFSlp5.js → CodemationConsumerConfigLoader-DovlxZNb.js} +2 -2
- package/dist/{CodemationConsumerConfigLoader-D6LFSlp5.js.map → CodemationConsumerConfigLoader-DovlxZNb.js.map} +1 -1
- package/dist/{CodemationPluginListMerger-Cv7CaM5_.d.ts → CodemationPluginListMerger-DegwsxrS.d.ts} +6 -6
- package/dist/{CodemationPluginListMerger-CGwOTdZ7.js → CodemationPluginListMerger-_lZaa6gO.js} +1 -1
- package/dist/{CodemationPluginListMerger-CGwOTdZ7.js.map → CodemationPluginListMerger-_lZaa6gO.js.map} +1 -1
- package/dist/{CodemationAuthConfig-7hEfICPf.d.ts → CodemationWhitelabelConfig-D5rYcLlj.d.ts} +33 -33
- package/dist/{ConsoleLogger-ClPU7jtc.js → ConsoleLogger-DuStfHe0.js} +1 -1
- package/dist/{ConsoleLogger-ClPU7jtc.js.map → ConsoleLogger-DuStfHe0.js.map} +1 -1
- package/dist/{CredentialServices-xVxVA9Tq.js → CredentialServices-BPKUF8Xs.js} +42 -8
- package/dist/CredentialServices-BPKUF8Xs.js.map +1 -0
- package/dist/{CredentialServices-Dp_jXTJo.d.ts → CredentialServices-GlBk2nL7.d.ts} +14 -5
- package/dist/{LogLevelPolicy-9IcPGZFk.d.ts → LogLevelPolicy-CkiJAH75.d.ts} +2 -2
- package/dist/{PublicFrontendBootstrap-DCniMBGu.d.ts → PublicFrontendBootstrap-ci0Vwxrb.d.ts} +2 -2
- package/dist/{PublicFrontendBootstrapFactory-SQVHMxLg.d.ts → PublicFrontendBootstrapFactory-r61MeSpZ.d.ts} +4 -4
- package/dist/{PublicFrontendBootstrapJsonCodec-BdiVGG5R.js → PublicFrontendBootstrapJsonCodec-BZgQ_FnW.js} +1 -1
- package/dist/{PublicFrontendBootstrapJsonCodec-BdiVGG5R.js.map → PublicFrontendBootstrapJsonCodec-BZgQ_FnW.js.map} +1 -1
- package/dist/{PublicFrontendBootstrapJsonCodec-BE0mhe1v.d.ts → PublicFrontendBootstrapJsonCodec-Ja0GQgpp.d.ts} +2 -2
- package/dist/{ServerLoggerFactory-BltIIDfQ.js → ServerLoggerFactory-CsNW5qhz.js} +4 -4
- package/dist/{ServerLoggerFactory-BltIIDfQ.js.map → ServerLoggerFactory-CsNW5qhz.js.map} +1 -1
- package/dist/authoring.d.ts +5 -0
- package/dist/authoring.js +4 -0
- package/dist/client.d.ts +4 -4
- package/dist/client.js +2 -2
- package/dist/consumer.d.ts +5 -5
- package/dist/consumer.js +5 -5
- package/dist/credentials.d.ts +4 -4
- package/dist/credentials.js +3 -3
- package/dist/devServerSidecar.d.ts +1 -1
- package/dist/{index-CLRTQLAp.d.ts → index-SKC6oys-.d.ts} +9 -1
- package/dist/index.d.ts +14 -203
- package/dist/index.js +14 -98
- package/dist/nextServer.d.ts +12 -11
- package/dist/nextServer.js +8 -8
- package/dist/{persistenceServer-Dv7fg_Jf.d.ts → persistenceServer-D89nDslh.d.ts} +2 -2
- package/dist/{persistenceServer-DMvIOGW8.js → persistenceServer-DKbFDxoS.js} +2 -2
- package/dist/{persistenceServer-DMvIOGW8.js.map → persistenceServer-DKbFDxoS.js.map} +1 -1
- package/dist/persistenceServer.d.ts +6 -6
- package/dist/persistenceServer.js +3 -3
- package/dist/{server-CioY8PP3.js → server-CFpgKuVE.js} +5 -5
- package/dist/{server-CioY8PP3.js.map → server-CFpgKuVE.js.map} +1 -1
- package/dist/{server-C5oqDnZQ.d.ts → server-CUo7My6x.d.ts} +5 -5
- package/dist/server.d.ts +11 -11
- package/dist/server.js +11 -11
- package/package.json +14 -7
- package/src/application/commands/StartWorkflowRunCommandHandler.ts +64 -2
- package/src/authoring.ts +31 -0
- package/src/domain/credentials/CredentialInstanceService.ts +8 -1
- package/src/domain/credentials/CredentialOAuth2ScopeResolver.ts +61 -0
- package/src/domain/credentials/CredentialServices.ts +1 -0
- package/src/domain/credentials/OAuth2ConnectServiceFactory.ts +9 -2
- package/dist/AppContainerFactory-CeKsjo8L.js.map +0 -1
- package/dist/CredentialServices-xVxVA9Tq.js.map +0 -1
- package/dist/index.js.map +0 -1
- /package/dist/{decorate-B0PP651O.js → decorate-Dq0XLibd.js} +0 -0
- /package/dist/{decorateParam-DrsXNPuw.js → decorateParam-D7WPDFAf.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import "./
|
|
9
|
-
import
|
|
10
|
-
import { r as
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import "./index-SKC6oys-.js";
|
|
2
|
+
import { a as defineCodemationApp, i as FriendlyCodemationExecutionConfig, n as DefinePluginOptions, o as definePlugin, r as FriendlyCodemationDatabaseConfig, s as workflow, t as DefineCodemationAppOptions } from "./CodemationAuthoring.types-CXubuYvd.js";
|
|
3
|
+
import { S as CodemationWorkflowDiscovery, _ as CodemationEngineExecutionLimitsConfig, a as AppPluginLoadSummary, b as CodemationSchedulerConfig, c as CodemationPluginContext, d as CodemationAppSchedulerConfig, f as CodemationAppSchedulerKind, g as CodemationDatabaseKind, h as CodemationDatabaseConfig, l as CodemationPluginPackageMetadata, m as CodemationConfig, n as CodemationRegistrationContextBase, o as CodemationPlugin, p as CodemationApplicationRuntimeConfig, r as AppConfig, s as CodemationPluginConfig, t as CodemationAppContext, u as CodemationAppDefinition, v as CodemationEventBusConfig, w as CodemationClassToken, x as CodemationSchedulerKind, y as CodemationEventBusKind } from "./CodemationAppContext-Vtn0U2Ga.js";
|
|
4
|
+
import { a as CodemationAuthConfig, c as CodemationAuthOidcProviderConfig, i as CodemationLogRule, n as CodemationLogConfig, o as CodemationAuthKind, r as CodemationLogLevelName, s as CodemationAuthOAuthProviderConfig, t as CodemationWhitelabelConfig } from "./CodemationWhitelabelConfig-D5rYcLlj.js";
|
|
5
|
+
import { a as CodemationFrontendAuthSnapshot, i as CodemationFrontendAuthProviderSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-ci0Vwxrb.js";
|
|
6
|
+
import { i as CodemationFrontendAuthSnapshotJsonCodec, n as InternalAuthBootstrapJsonCodec, r as FrontendAppConfigJsonCodec, t as PublicFrontendBootstrapJsonCodec } from "./PublicFrontendBootstrapJsonCodec-Ja0GQgpp.js";
|
|
7
|
+
import "./CodemationConfigNormalizer-kJmyHNDp.js";
|
|
8
|
+
import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-BvTE-7tX.js";
|
|
9
|
+
import "./CredentialServices-GlBk2nL7.js";
|
|
10
|
+
import { _ as Command, c as WorkerRuntime, d as AppContainerLifecycle, f as AppContainerFactory, g as CommandBus, h as Query, l as FrontendRuntime, m as QueryBus, n as CodemationBootstrapRequest, r as ApplicationTokens, t as CodemationPluginListMerger, u as DatabaseMigrations } from "./CodemationPluginListMerger-DegwsxrS.js";
|
|
11
|
+
import { r as PrismaDatabaseClient, t as AppConfigFactory } from "./AppConfigFactory-j1Mc-dIX.js";
|
|
12
|
+
import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-D89nDslh.js";
|
|
13
|
+
import { c as CodemationServerGateway, l as ApiPaths } from "./server-CUo7My6x.js";
|
|
14
|
+
import { i as CodemationFrontendAuthSnapshotFactory, n as InternalAuthBootstrapFactory, r as FrontendAppConfigFactory, t as PublicFrontendBootstrapFactory } from "./PublicFrontendBootstrapFactory-r61MeSpZ.js";
|
|
15
15
|
|
|
16
16
|
//#region src/application/contracts/userDirectoryContracts.types.d.ts
|
|
17
17
|
type UserAccountStatus = "invited" | "active" | "inactive";
|
|
@@ -38,195 +38,6 @@ declare class UpsertLocalBootstrapUserCommand extends Command<UpsertLocalBootstr
|
|
|
38
38
|
constructor(email: string, password: string);
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
|
-
//#region ../core-nodes/src/nodes/aggregate.d.ts
|
|
42
|
-
declare class Aggregate<TIn = unknown, TOut = unknown> implements RunnableNodeConfig<TIn, TOut> {
|
|
43
|
-
readonly name: string;
|
|
44
|
-
readonly aggregate: (items: Items<TIn>, ctx: NodeExecutionContext<Aggregate<TIn, TOut>>) => TOut | Promise<TOut>;
|
|
45
|
-
readonly id?: string | undefined;
|
|
46
|
-
readonly kind: "node";
|
|
47
|
-
readonly type: TypeToken<unknown>;
|
|
48
|
-
readonly execution: {
|
|
49
|
-
readonly hint: "local";
|
|
50
|
-
};
|
|
51
|
-
readonly icon: "lucide:layers";
|
|
52
|
-
constructor(name: string, aggregate: (items: Items<TIn>, ctx: NodeExecutionContext<Aggregate<TIn, TOut>>) => TOut | Promise<TOut>, id?: string | undefined);
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region ../core-nodes/src/nodes/filter.d.ts
|
|
56
|
-
declare class Filter<TIn = unknown> implements RunnableNodeConfig<TIn, TIn> {
|
|
57
|
-
readonly name: string;
|
|
58
|
-
readonly predicate: (item: Item<TIn>, index: number, items: Items<TIn>, ctx: NodeExecutionContext<Filter<TIn>>) => boolean;
|
|
59
|
-
readonly id?: string | undefined;
|
|
60
|
-
readonly kind: "node";
|
|
61
|
-
readonly type: TypeToken<unknown>;
|
|
62
|
-
readonly execution: {
|
|
63
|
-
readonly hint: "local";
|
|
64
|
-
};
|
|
65
|
-
readonly icon: "lucide:filter";
|
|
66
|
-
constructor(name: string, predicate: (item: Item<TIn>, index: number, items: Items<TIn>, ctx: NodeExecutionContext<Filter<TIn>>) => boolean, id?: string | undefined);
|
|
67
|
-
}
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region ../core-nodes/src/nodes/split.d.ts
|
|
70
|
-
declare class Split<TIn = unknown, TElem = unknown> implements RunnableNodeConfig<TIn, TElem> {
|
|
71
|
-
readonly name: string;
|
|
72
|
-
readonly getElements: (item: Item<TIn>, ctx: NodeExecutionContext<Split<TIn, TElem>>) => readonly TElem[];
|
|
73
|
-
readonly id?: string | undefined;
|
|
74
|
-
readonly kind: "node";
|
|
75
|
-
readonly type: TypeToken<unknown>;
|
|
76
|
-
readonly execution: {
|
|
77
|
-
readonly hint: "local";
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* When splitting yields zero items for a batch, downstream single-input nodes still run once with an empty batch.
|
|
81
|
-
* Mirrors {@link MapData}'s empty-output behavior.
|
|
82
|
-
*/
|
|
83
|
-
readonly continueWhenEmptyOutput: true;
|
|
84
|
-
readonly icon: "lucide:ungroup";
|
|
85
|
-
constructor(name: string, getElements: (item: Item<TIn>, ctx: NodeExecutionContext<Split<TIn, TElem>>) => readonly TElem[], id?: string | undefined);
|
|
86
|
-
}
|
|
87
|
-
//#endregion
|
|
88
|
-
//#region ../core-nodes/src/nodes/merge.d.ts
|
|
89
|
-
type MergeMode = "passThrough" | "append" | "mergeByPosition";
|
|
90
|
-
//#endregion
|
|
91
|
-
//#region ../core-nodes/src/workflowAuthoring/WorkflowAuthoringOptions.types.d.ts
|
|
92
|
-
type WorkflowAgentPrompt<TCurrentJson> = string | ((item: TCurrentJson) => string);
|
|
93
|
-
interface WorkflowAgentOptions<TCurrentJson, TOutputSchema extends z.ZodTypeAny | undefined = undefined> {
|
|
94
|
-
readonly prompt: WorkflowAgentPrompt<TCurrentJson>;
|
|
95
|
-
readonly model: string | ChatModelConfig;
|
|
96
|
-
readonly tools?: ReadonlyArray<ToolConfig>;
|
|
97
|
-
readonly outputSchema?: TOutputSchema;
|
|
98
|
-
readonly retryPolicy?: RunnableNodeConfig["retryPolicy"];
|
|
99
|
-
readonly guardrails?: AgentGuardrailConfig;
|
|
100
|
-
readonly id?: string;
|
|
101
|
-
}
|
|
102
|
-
//#endregion
|
|
103
|
-
//#region ../core-nodes/src/workflowAuthoring/WorkflowBranchBuilder.types.d.ts
|
|
104
|
-
declare class WorkflowBranchBuilder<TCurrentJson> {
|
|
105
|
-
private readonly steps;
|
|
106
|
-
constructor(steps?: ReadonlyArray<AnyRunnableNodeConfig>);
|
|
107
|
-
then<TOutputJson, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson>>(config: TConfig): WorkflowBranchBuilder<RunnableNodeOutputJson<TConfig>>;
|
|
108
|
-
map<TNextJson>(mapper: (item: TCurrentJson) => TNextJson): WorkflowBranchBuilder<TNextJson>;
|
|
109
|
-
map<TNextJson>(name: string, mapper: (item: TCurrentJson) => TNextJson, id?: string): WorkflowBranchBuilder<TNextJson>;
|
|
110
|
-
wait(duration: number | string): WorkflowBranchBuilder<TCurrentJson>;
|
|
111
|
-
wait(name: string, duration: number | string, id?: string): WorkflowBranchBuilder<TCurrentJson>;
|
|
112
|
-
split<TElem>(getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[]): WorkflowBranchBuilder<TElem>;
|
|
113
|
-
split<TElem>(name: string, getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[], id?: string): WorkflowBranchBuilder<TElem>;
|
|
114
|
-
filter(predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean): WorkflowBranchBuilder<TCurrentJson>;
|
|
115
|
-
filter(name: string, predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean, id?: string): WorkflowBranchBuilder<TCurrentJson>;
|
|
116
|
-
aggregate<TOut>(aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>): WorkflowBranchBuilder<TOut>;
|
|
117
|
-
aggregate<TOut>(name: string, aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>, id?: string): WorkflowBranchBuilder<TOut>;
|
|
118
|
-
agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowBranchBuilder<z.output<TOutputSchema>>;
|
|
119
|
-
agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowBranchBuilder<Record<string, unknown>>;
|
|
120
|
-
agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowBranchBuilder<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
|
|
121
|
-
node<TConfig extends Record<string, unknown>, TOutputJson>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson> | string, config: TConfig, name?: string, id?: string): WorkflowBranchBuilder<TOutputJson>;
|
|
122
|
-
getSteps(): ReadonlyArray<AnyRunnableNodeConfig>;
|
|
123
|
-
}
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region ../core-nodes/src/workflowAuthoring/WorkflowChain.types.d.ts
|
|
126
|
-
type BranchCallback<TCurrentJson, TNextJson> = (branch: WorkflowBranchBuilder<TCurrentJson>) => WorkflowBranchBuilder<TNextJson>;
|
|
127
|
-
type RouteBranchCallback<TCurrentJson, TNextJson> = (branch: WorkflowChain<TCurrentJson>) => WorkflowChain<TNextJson>;
|
|
128
|
-
declare class WorkflowChain<TCurrentJson> {
|
|
129
|
-
private readonly chain;
|
|
130
|
-
constructor(chain: ChainCursor<TCurrentJson>);
|
|
131
|
-
then<TOutputJson, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson>>(config: TConfig): WorkflowChain<RunnableNodeOutputJson<TConfig>>;
|
|
132
|
-
map<TNextJson>(mapper: (item: TCurrentJson) => TNextJson): WorkflowChain<TNextJson>;
|
|
133
|
-
map<TNextJson>(name: string, mapper: (item: TCurrentJson) => TNextJson, id?: string): WorkflowChain<TNextJson>;
|
|
134
|
-
wait(duration: number | string): WorkflowChain<TCurrentJson>;
|
|
135
|
-
wait(name: string, duration: number | string, id?: string): WorkflowChain<TCurrentJson>;
|
|
136
|
-
split<TElem>(getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[]): WorkflowChain<TElem>;
|
|
137
|
-
split<TElem>(name: string, getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[], id?: string): WorkflowChain<TElem>;
|
|
138
|
-
filter(predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean): WorkflowChain<TCurrentJson>;
|
|
139
|
-
filter(name: string, predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean, id?: string): WorkflowChain<TCurrentJson>;
|
|
140
|
-
aggregate<TOut>(aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>): WorkflowChain<TOut>;
|
|
141
|
-
aggregate<TOut>(name: string, aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>, id?: string): WorkflowChain<TOut>;
|
|
142
|
-
merge(): WorkflowChain<TCurrentJson>;
|
|
143
|
-
merge(cfg: Readonly<{
|
|
144
|
-
mode: MergeMode;
|
|
145
|
-
prefer?: ReadonlyArray<string>;
|
|
146
|
-
}>, id?: string): WorkflowChain<TCurrentJson>;
|
|
147
|
-
merge(name: string, cfg?: Readonly<{
|
|
148
|
-
mode: MergeMode;
|
|
149
|
-
prefer?: ReadonlyArray<string>;
|
|
150
|
-
}>, id?: string): WorkflowChain<TCurrentJson>;
|
|
151
|
-
if<TBranchJson>(predicate: (item: TCurrentJson) => boolean, branches: Readonly<{
|
|
152
|
-
true?: BranchCallback<TCurrentJson, TBranchJson>;
|
|
153
|
-
false?: BranchCallback<TCurrentJson, TBranchJson>;
|
|
154
|
-
}>): WorkflowChain<TBranchJson>;
|
|
155
|
-
if<TBranchJson>(name: string, predicate: (item: TCurrentJson) => boolean, branches: Readonly<{
|
|
156
|
-
true?: BranchCallback<TCurrentJson, TBranchJson>;
|
|
157
|
-
false?: BranchCallback<TCurrentJson, TBranchJson>;
|
|
158
|
-
}>): WorkflowChain<TBranchJson>;
|
|
159
|
-
route<TBranchJson>(branches: Readonly<Record<string, RouteBranchCallback<TCurrentJson, TBranchJson> | undefined>>): WorkflowChain<TBranchJson>;
|
|
160
|
-
switch<TBranchJson>(cfg: Readonly<{
|
|
161
|
-
cases: readonly string[];
|
|
162
|
-
defaultCase: string;
|
|
163
|
-
resolveCaseKey: (item: TCurrentJson) => string | Promise<string>;
|
|
164
|
-
branches: Readonly<Record<string, RouteBranchCallback<TCurrentJson, TBranchJson> | undefined>>;
|
|
165
|
-
}>): WorkflowChain<TBranchJson>;
|
|
166
|
-
switch<TBranchJson>(name: string, cfg: Readonly<{
|
|
167
|
-
cases: readonly string[];
|
|
168
|
-
defaultCase: string;
|
|
169
|
-
resolveCaseKey: (item: TCurrentJson) => string | Promise<string>;
|
|
170
|
-
branches: Readonly<Record<string, RouteBranchCallback<TCurrentJson, TBranchJson> | undefined>>;
|
|
171
|
-
}>, id?: string): WorkflowChain<TBranchJson>;
|
|
172
|
-
agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowChain<z.output<TOutputSchema>>;
|
|
173
|
-
agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowChain<Record<string, unknown>>;
|
|
174
|
-
agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowChain<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
|
|
175
|
-
node<TConfig extends Record<string, unknown>, TOutputJson>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson> | string, config: TConfig, name?: string, id?: string): WorkflowChain<TOutputJson>;
|
|
176
|
-
build(): WorkflowDefinition;
|
|
177
|
-
}
|
|
178
|
-
//#endregion
|
|
179
|
-
//#region ../core-nodes/src/workflowAuthoring/WorkflowAuthoringBuilder.types.d.ts
|
|
180
|
-
declare class WorkflowAuthoringBuilder {
|
|
181
|
-
private readonly id;
|
|
182
|
-
private readonly workflowName;
|
|
183
|
-
constructor(id: string, workflowName?: string);
|
|
184
|
-
name(name: string): WorkflowAuthoringBuilder;
|
|
185
|
-
manualTrigger<TOutputJson>(defaultItems: TOutputJson | ReadonlyArray<TOutputJson>): WorkflowChain<TOutputJson>;
|
|
186
|
-
manualTrigger<TOutputJson>(name: string, defaultItems?: TOutputJson | ReadonlyArray<TOutputJson>, id?: string): WorkflowChain<TOutputJson>;
|
|
187
|
-
}
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region ../core-nodes/src/workflowAuthoring.types.d.ts
|
|
190
|
-
declare function workflow(id: string): WorkflowAuthoringBuilder;
|
|
191
|
-
//#endregion
|
|
192
|
-
//#region src/presentation/config/CodemationAuthoring.types.d.ts
|
|
193
|
-
interface FriendlyCodemationDatabaseConfig {
|
|
194
|
-
readonly kind: "postgresql" | "sqlite";
|
|
195
|
-
readonly url?: string;
|
|
196
|
-
readonly filePath?: string;
|
|
197
|
-
}
|
|
198
|
-
interface FriendlyCodemationExecutionConfig {
|
|
199
|
-
readonly mode?: "inline" | "queue";
|
|
200
|
-
readonly queuePrefix?: string;
|
|
201
|
-
readonly workerQueues?: ReadonlyArray<string>;
|
|
202
|
-
readonly redisUrl?: string;
|
|
203
|
-
}
|
|
204
|
-
interface DefineCodemationAppOptions extends Omit<CodemationConfig, "app" | "credentialTypes" | "register" | "whitelabel" | "auth"> {
|
|
205
|
-
readonly name?: string;
|
|
206
|
-
readonly auth?: CodemationConfig["auth"];
|
|
207
|
-
readonly database?: FriendlyCodemationDatabaseConfig;
|
|
208
|
-
readonly execution?: FriendlyCodemationExecutionConfig;
|
|
209
|
-
readonly nodes?: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>>;
|
|
210
|
-
readonly credentialTypes?: ReadonlyArray<AnyCredentialType>;
|
|
211
|
-
readonly credentials?: ReadonlyArray<AnyCredentialType>;
|
|
212
|
-
readonly register?: (context: CodemationAppContext) => void;
|
|
213
|
-
readonly whitelabel?: CodemationWhitelabelConfig;
|
|
214
|
-
}
|
|
215
|
-
interface DefinePluginOptions {
|
|
216
|
-
readonly name?: string;
|
|
217
|
-
readonly pluginPackageId?: string;
|
|
218
|
-
readonly nodes?: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>>;
|
|
219
|
-
readonly credentials?: ReadonlyArray<AnyCredentialType>;
|
|
220
|
-
readonly register?: (context: CodemationPluginContext) => void | Promise<void>;
|
|
221
|
-
readonly sandbox?: DefineCodemationAppOptions & Readonly<{
|
|
222
|
-
workflows?: ReadonlyArray<WorkflowDefinition>;
|
|
223
|
-
}>;
|
|
224
|
-
}
|
|
225
|
-
declare function defineCodemationApp(options: DefineCodemationAppOptions): CodemationConfig;
|
|
226
|
-
declare function definePlugin(options: DefinePluginOptions): CodemationPlugin & Readonly<{
|
|
227
|
-
sandbox?: DefinePluginOptions["sandbox"];
|
|
228
|
-
}>;
|
|
229
|
-
//#endregion
|
|
230
41
|
//#region src/presentation/config/CodemationPackageManifest.d.ts
|
|
231
42
|
interface CodemationPackageManifest {
|
|
232
43
|
readonly plugin?: string;
|
package/dist/index.js
CHANGED
|
@@ -1,100 +1,16 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import { t as
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
1
|
+
import { n as definePlugin, t as defineCodemationApp } from "./CodemationAuthoring.types-SxVJ1qu5.js";
|
|
2
|
+
import "./ConsoleLogger-DuStfHe0.js";
|
|
3
|
+
import { i as CodemationFrontendAuthSnapshotJsonCodec, n as InternalAuthBootstrapJsonCodec, r as FrontendAppConfigJsonCodec, t as PublicFrontendBootstrapJsonCodec } from "./PublicFrontendBootstrapJsonCodec-BZgQ_FnW.js";
|
|
4
|
+
import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-DovlxZNb.js";
|
|
5
|
+
import "./ServerLoggerFactory-CsNW5qhz.js";
|
|
6
|
+
import "./decorateParam-D7WPDFAf.js";
|
|
7
|
+
import "./decorate-Dq0XLibd.js";
|
|
8
|
+
import { d as ApplicationTokens } from "./CredentialServices-BPKUF8Xs.js";
|
|
9
|
+
import { E as ListUserAccountsQuery, T as UpsertLocalBootstrapUserCommand, _ as CodemationFrontendAuthSnapshotFactory, a as AppContainerLifecycle, g as FrontendAppConfigFactory, h as InternalAuthBootstrapFactory, i as DatabaseMigrations, m as PublicFrontendBootstrapFactory, n as WorkerRuntime, r as FrontendRuntime, t as AppContainerFactory, y as ApiPaths } from "./AppContainerFactory-CcSGFNLW.js";
|
|
10
|
+
import { n as CodemationPluginPackageMetadata, t as AppConfigFactory } from "./AppConfigFactory-CqKWXqOm.js";
|
|
11
|
+
import { n as CodemationBootstrapRequest, t as CodemationPluginListMerger } from "./CodemationPluginListMerger-_lZaa6gO.js";
|
|
12
|
+
import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-DKbFDxoS.js";
|
|
13
|
+
import { r as CodemationServerGateway } from "./server-CFpgKuVE.js";
|
|
13
14
|
import { workflow } from "@codemation/core-nodes";
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
var CodemationAuthoringConfigFactory = class {
|
|
17
|
-
static createApp(options) {
|
|
18
|
-
const appDefinition = this.createAppDefinition(options);
|
|
19
|
-
const credentialTypes = [...options.credentialTypes ?? [], ...options.credentials ?? []];
|
|
20
|
-
const register = this.composeAppRegister(options.register, options.nodes);
|
|
21
|
-
const { workflows, workflowDiscovery, plugins, runtime, log } = options;
|
|
22
|
-
return {
|
|
23
|
-
workflows,
|
|
24
|
-
workflowDiscovery,
|
|
25
|
-
plugins,
|
|
26
|
-
runtime,
|
|
27
|
-
log,
|
|
28
|
-
app: appDefinition,
|
|
29
|
-
credentialTypes,
|
|
30
|
-
register
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
static createPlugin(options) {
|
|
34
|
-
return {
|
|
35
|
-
pluginPackageId: options.pluginPackageId,
|
|
36
|
-
sandbox: options.sandbox,
|
|
37
|
-
async register(context) {
|
|
38
|
-
for (const nodeDefinition of options.nodes ?? []) nodeDefinition.register(context);
|
|
39
|
-
for (const credential of options.credentials ?? []) context.registerCredentialType(credential);
|
|
40
|
-
await options.register?.(context);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
static createAppDefinition(options) {
|
|
45
|
-
const scheduler = this.createSchedulerConfig(options.execution);
|
|
46
|
-
const database = this.createDatabaseConfig(options.database);
|
|
47
|
-
const whitelabel = this.createWhitelabel(options.name, options.whitelabel);
|
|
48
|
-
if (!options.auth && !database && !scheduler && !whitelabel) return;
|
|
49
|
-
return {
|
|
50
|
-
auth: options.auth,
|
|
51
|
-
database,
|
|
52
|
-
scheduler,
|
|
53
|
-
whitelabel
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
static createDatabaseConfig(database) {
|
|
57
|
-
if (!database) return;
|
|
58
|
-
if (database.kind === "sqlite") return {
|
|
59
|
-
kind: "sqlite",
|
|
60
|
-
sqliteFilePath: database.filePath
|
|
61
|
-
};
|
|
62
|
-
return {
|
|
63
|
-
kind: "postgresql",
|
|
64
|
-
url: database.url
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
static createSchedulerConfig(execution) {
|
|
68
|
-
if (!execution) return;
|
|
69
|
-
return {
|
|
70
|
-
kind: execution.mode,
|
|
71
|
-
queuePrefix: execution.queuePrefix,
|
|
72
|
-
workerQueues: execution.workerQueues,
|
|
73
|
-
redisUrl: execution.redisUrl
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
static createWhitelabel(name, whitelabel) {
|
|
77
|
-
if (!name && !whitelabel) return;
|
|
78
|
-
return {
|
|
79
|
-
productName: name ?? whitelabel?.productName,
|
|
80
|
-
logoPath: whitelabel?.logoPath
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
static composeAppRegister(register, nodes) {
|
|
84
|
-
if (!register && (!nodes || nodes.length === 0)) return;
|
|
85
|
-
return (context) => {
|
|
86
|
-
for (const nodeDefinition of nodes ?? []) nodeDefinition.register(context);
|
|
87
|
-
register?.(context);
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
function defineCodemationApp(options) {
|
|
92
|
-
return CodemationAuthoringConfigFactory.createApp(options);
|
|
93
|
-
}
|
|
94
|
-
function definePlugin(options) {
|
|
95
|
-
return CodemationAuthoringConfigFactory.createPlugin(options);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
//#endregion
|
|
99
|
-
export { ApiPaths, AppConfigFactory, AppContainerFactory, AppContainerLifecycle, ApplicationTokens, CodemationBootstrapRequest, CodemationConsumerConfigLoader, CodemationFrontendAuthSnapshotFactory, CodemationFrontendAuthSnapshotJsonCodec, CodemationPluginListMerger, CodemationPluginPackageMetadata, CodemationPostgresPrismaClientFactory, CodemationServerGateway, DatabaseMigrations, FrontendAppConfigFactory, FrontendAppConfigJsonCodec, FrontendRuntime, InternalAuthBootstrapFactory, InternalAuthBootstrapJsonCodec, ListUserAccountsQuery, PublicFrontendBootstrapFactory, PublicFrontendBootstrapJsonCodec, UpsertLocalBootstrapUserCommand, WorkerRuntime, defineCodemationApp, definePlugin, workflow };
|
|
100
|
-
//# sourceMappingURL=index.js.map
|
|
16
|
+
export { ApiPaths, AppConfigFactory, AppContainerFactory, AppContainerLifecycle, ApplicationTokens, CodemationBootstrapRequest, CodemationConsumerConfigLoader, CodemationFrontendAuthSnapshotFactory, CodemationFrontendAuthSnapshotJsonCodec, CodemationPluginListMerger, CodemationPluginPackageMetadata, CodemationPostgresPrismaClientFactory, CodemationServerGateway, DatabaseMigrations, FrontendAppConfigFactory, FrontendAppConfigJsonCodec, FrontendRuntime, InternalAuthBootstrapFactory, InternalAuthBootstrapJsonCodec, ListUserAccountsQuery, PublicFrontendBootstrapFactory, PublicFrontendBootstrapJsonCodec, UpsertLocalBootstrapUserCommand, WorkerRuntime, defineCodemationApp, definePlugin, workflow };
|
package/dist/nextServer.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "./CodemationConfigNormalizer-
|
|
7
|
-
import { a as CredentialInstanceService, c as
|
|
8
|
-
import { a as WorkflowDebuggerOverlayRepository, c as WorkerRuntime, d as AppContainerLifecycle, f as AppContainerFactory, g as CommandBus, i as HonoApiRouteRegistrar, l as FrontendRuntime, m as QueryBus, n as CodemationBootstrapRequest, o as WorkflowRunRepository, p as WorkflowWebsocketServer, r as ApplicationTokens, s as SessionVerifier, t as CodemationPluginListMerger, u as DatabaseMigrations } from "./CodemationPluginListMerger-
|
|
9
|
-
import { t as AppConfigFactory } from "./AppConfigFactory-
|
|
10
|
-
import { a as WorkflowDto, n as InternalAuthBootstrapFactory, o as WorkflowSummary, r as FrontendAppConfigFactory, t as PublicFrontendBootstrapFactory } from "./PublicFrontendBootstrapFactory-
|
|
1
|
+
import { A as RunIdFactory, D as Item, E as BinaryAttachment, F as BinaryStorage, J as WebhookInvocationMatch, N as WorkflowDefinition$1, S as CredentialTypeDefinition, T as ActivationIdFactory, et as Clock, g as CredentialOAuth2AuthDefinition, q as WorkflowActivationPolicy, t as RunIntentService } from "./index-SKC6oys-.js";
|
|
2
|
+
import { r as AppConfig } from "./CodemationAppContext-Vtn0U2Ga.js";
|
|
3
|
+
import { l as Logger, u as LoggerFactory } from "./CodemationWhitelabelConfig-D5rYcLlj.js";
|
|
4
|
+
import { t as LogLevelPolicy } from "./LogLevelPolicy-CkiJAH75.js";
|
|
5
|
+
import { a as CodemationFrontendAuthSnapshot, i as CodemationFrontendAuthProviderSnapshot, n as InternalAuthBootstrap, r as FrontendAppConfig, t as PublicFrontendBootstrap } from "./PublicFrontendBootstrap-ci0Vwxrb.js";
|
|
6
|
+
import "./CodemationConfigNormalizer-kJmyHNDp.js";
|
|
7
|
+
import { a as CredentialInstanceService, c as CredentialSecretCipher, i as CredentialBindingService, l as CredentialFieldEnvOverlayService, o as CredentialOAuth2ScopeResolver, r as CredentialRuntimeMaterialService, s as CredentialMaterialResolver, t as CredentialStore, u as CredentialTypeRegistryImpl } from "./CredentialServices-GlBk2nL7.js";
|
|
8
|
+
import { a as WorkflowDebuggerOverlayRepository, c as WorkerRuntime, d as AppContainerLifecycle, f as AppContainerFactory, g as CommandBus, i as HonoApiRouteRegistrar, l as FrontendRuntime, m as QueryBus, n as CodemationBootstrapRequest, o as WorkflowRunRepository, p as WorkflowWebsocketServer, r as ApplicationTokens, s as SessionVerifier, t as CodemationPluginListMerger, u as DatabaseMigrations } from "./CodemationPluginListMerger-DegwsxrS.js";
|
|
9
|
+
import { t as AppConfigFactory } from "./AppConfigFactory-j1Mc-dIX.js";
|
|
10
|
+
import { a as WorkflowDto, n as InternalAuthBootstrapFactory, o as WorkflowSummary, r as FrontendAppConfigFactory, t as PublicFrontendBootstrapFactory } from "./PublicFrontendBootstrapFactory-r61MeSpZ.js";
|
|
11
11
|
import { Hono } from "hono";
|
|
12
12
|
import { NodeDefinition, WorkflowDefinition } from "@codemation/core/browser";
|
|
13
13
|
|
|
@@ -262,10 +262,11 @@ declare class OAuth2ConnectService {
|
|
|
262
262
|
private readonly credentialFieldEnvOverlayService;
|
|
263
263
|
private readonly credentialMaterialResolver;
|
|
264
264
|
private readonly credentialSecretCipher;
|
|
265
|
+
private readonly credentialOAuth2ScopeResolver;
|
|
265
266
|
private readonly oauth2ProviderRegistry;
|
|
266
267
|
private readonly appConfig;
|
|
267
268
|
private static readonly stateTtlMs;
|
|
268
|
-
constructor(credentialStore: CredentialStore, credentialInstanceService: CredentialInstanceService, credentialTypeRegistry: CredentialTypeRegistryImpl, credentialRuntimeMaterialService: CredentialRuntimeMaterialService, credentialFieldEnvOverlayService: CredentialFieldEnvOverlayService, credentialMaterialResolver: CredentialMaterialResolver, credentialSecretCipher: CredentialSecretCipher, oauth2ProviderRegistry: OAuth2ProviderRegistry, appConfig: AppConfig);
|
|
269
|
+
constructor(credentialStore: CredentialStore, credentialInstanceService: CredentialInstanceService, credentialTypeRegistry: CredentialTypeRegistryImpl, credentialRuntimeMaterialService: CredentialRuntimeMaterialService, credentialFieldEnvOverlayService: CredentialFieldEnvOverlayService, credentialMaterialResolver: CredentialMaterialResolver, credentialSecretCipher: CredentialSecretCipher, credentialOAuth2ScopeResolver: CredentialOAuth2ScopeResolver, oauth2ProviderRegistry: OAuth2ProviderRegistry, appConfig: AppConfig);
|
|
269
270
|
createAuthRedirect(instanceId: string, requestOrigin: string): Promise<OAuth2AuthRedirectResult>;
|
|
270
271
|
handleCallback(args: Readonly<{
|
|
271
272
|
code?: string | null;
|
package/dist/nextServer.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./ConsoleLogger-
|
|
2
|
-
import { a as FilteringLogger, i as PerformanceLogPolicy, n as PerformanceLogPolicyFactory, o as LogLevelPolicyFactory, r as performanceLogPolicyFactory, s as logLevelPolicyFactory, t as ServerLoggerFactory } from "./ServerLoggerFactory-
|
|
3
|
-
import { n as __decorateMetadata, t as __decorateParam } from "./decorateParam-
|
|
4
|
-
import { t as __decorate } from "./decorate-
|
|
5
|
-
import { a as CredentialInstanceService,
|
|
6
|
-
import { a as AppContainerLifecycle, b as WorkflowDefinitionMapper, c as RequestToWebhookItemMapper, d as CredentialHttpRouteHandler, f as CodemationHonoApiApp, g as FrontendAppConfigFactory, h as InternalAuthBootstrapFactory, i as DatabaseMigrations, l as RunHttpRouteHandler, m as PublicFrontendBootstrapFactory, n as WorkerRuntime, o as WorkflowHttpRouteHandler, p as BinaryHttpRouteHandler, r as FrontendRuntime, s as WebhookHttpRouteHandler, t as AppContainerFactory, u as OAuth2HttpRouteHandler, v as WorkflowWebsocketServer, w as RunBinaryAttachmentLookupService, x as WorkflowPolicyUiPresentationFactory } from "./AppContainerFactory-
|
|
7
|
-
import { t as AppConfigFactory } from "./AppConfigFactory-
|
|
8
|
-
import { n as CodemationBootstrapRequest, t as CodemationPluginListMerger } from "./CodemationPluginListMerger-
|
|
1
|
+
import "./ConsoleLogger-DuStfHe0.js";
|
|
2
|
+
import { a as FilteringLogger, i as PerformanceLogPolicy, n as PerformanceLogPolicyFactory, o as LogLevelPolicyFactory, r as performanceLogPolicyFactory, s as logLevelPolicyFactory, t as ServerLoggerFactory } from "./ServerLoggerFactory-CsNW5qhz.js";
|
|
3
|
+
import { n as __decorateMetadata, t as __decorateParam } from "./decorateParam-D7WPDFAf.js";
|
|
4
|
+
import { t as __decorate } from "./decorate-Dq0XLibd.js";
|
|
5
|
+
import { a as CredentialInstanceService, d as ApplicationTokens, i as CredentialBindingService } from "./CredentialServices-BPKUF8Xs.js";
|
|
6
|
+
import { a as AppContainerLifecycle, b as WorkflowDefinitionMapper, c as RequestToWebhookItemMapper, d as CredentialHttpRouteHandler, f as CodemationHonoApiApp, g as FrontendAppConfigFactory, h as InternalAuthBootstrapFactory, i as DatabaseMigrations, l as RunHttpRouteHandler, m as PublicFrontendBootstrapFactory, n as WorkerRuntime, o as WorkflowHttpRouteHandler, p as BinaryHttpRouteHandler, r as FrontendRuntime, s as WebhookHttpRouteHandler, t as AppContainerFactory, u as OAuth2HttpRouteHandler, v as WorkflowWebsocketServer, w as RunBinaryAttachmentLookupService, x as WorkflowPolicyUiPresentationFactory } from "./AppContainerFactory-CcSGFNLW.js";
|
|
7
|
+
import { t as AppConfigFactory } from "./AppConfigFactory-CqKWXqOm.js";
|
|
8
|
+
import { n as CodemationBootstrapRequest, t as CodemationPluginListMerger } from "./CodemationPluginListMerger-_lZaa6gO.js";
|
|
9
9
|
import { CoreTokens, inject, injectable } from "@codemation/core";
|
|
10
10
|
|
|
11
11
|
//#region src/application/runs/WorkflowRunRetentionPruneScheduler.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as PrismaClient } from "./AppConfigFactory-
|
|
1
|
+
import { i as PrismaClient } from "./AppConfigFactory-j1Mc-dIX.js";
|
|
2
2
|
|
|
3
3
|
//#region src/infrastructure/persistence/CodemationPostgresPrismaClientFactory.d.ts
|
|
4
4
|
declare class CodemationPostgresPrismaClientFactory {
|
|
@@ -6,4 +6,4 @@ declare class CodemationPostgresPrismaClientFactory {
|
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
8
|
export { CodemationPostgresPrismaClientFactory as t };
|
|
9
|
-
//# sourceMappingURL=persistenceServer-
|
|
9
|
+
//# sourceMappingURL=persistenceServer-D89nDslh.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __toESM } from "./chunk-7V6ThxGB.js";
|
|
2
|
-
import { i as require_client } from "./AppConfigFactory-
|
|
2
|
+
import { i as require_client } from "./AppConfigFactory-CqKWXqOm.js";
|
|
3
3
|
import { PrismaPg } from "@prisma/adapter-pg";
|
|
4
4
|
|
|
5
5
|
//#region src/infrastructure/persistence/CodemationPostgresPrismaClientFactory.ts
|
|
@@ -12,4 +12,4 @@ var CodemationPostgresPrismaClientFactory = class {
|
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
export { CodemationPostgresPrismaClientFactory as t };
|
|
15
|
-
//# sourceMappingURL=persistenceServer-
|
|
15
|
+
//# sourceMappingURL=persistenceServer-DKbFDxoS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistenceServer-
|
|
1
|
+
{"version":3,"file":"persistenceServer-DKbFDxoS.js","names":["PrismaClient"],"sources":["../src/infrastructure/persistence/CodemationPostgresPrismaClientFactory.ts"],"sourcesContent":["import { PrismaPg } from \"@prisma/adapter-pg\";\nimport { PrismaClient } from \"./generated/prisma-postgresql-client/client.js\";\n\nexport class CodemationPostgresPrismaClientFactory {\n static create(databaseUrl: string): PrismaClient {\n const adapter = new PrismaPg({ connectionString: databaseUrl });\n return new PrismaClient({ adapter });\n }\n}\n"],"mappings":";;;;;;AAGA,IAAa,wCAAb,MAAmD;CACjD,OAAO,OAAO,aAAmC;AAE/C,SAAO,IAAIA,2BAAa,EAAE,SADV,IAAI,SAAS,EAAE,kBAAkB,aAAa,CAAC,EAC5B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
4
|
-
import "./CodemationConfigNormalizer-
|
|
5
|
-
import { n as PrismaMigrationDeployer, r as PrismaDatabaseClient, t as AppConfigFactory } from "./AppConfigFactory-
|
|
6
|
-
import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-
|
|
1
|
+
import "./index-SKC6oys-.js";
|
|
2
|
+
import { i as AppPersistenceConfig } from "./CodemationAppContext-Vtn0U2Ga.js";
|
|
3
|
+
import "./CodemationWhitelabelConfig-D5rYcLlj.js";
|
|
4
|
+
import "./CodemationConfigNormalizer-kJmyHNDp.js";
|
|
5
|
+
import { n as PrismaMigrationDeployer, r as PrismaDatabaseClient, t as AppConfigFactory } from "./AppConfigFactory-j1Mc-dIX.js";
|
|
6
|
+
import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-D89nDslh.js";
|
|
7
7
|
export { AppConfigFactory, AppPersistenceConfig, CodemationPostgresPrismaClientFactory, PrismaDatabaseClient as PrismaClient, PrismaMigrationDeployer };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./decorate-
|
|
2
|
-
import { r as PrismaMigrationDeployer, t as AppConfigFactory } from "./AppConfigFactory-
|
|
3
|
-
import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-
|
|
1
|
+
import "./decorate-Dq0XLibd.js";
|
|
2
|
+
import { r as PrismaMigrationDeployer, t as AppConfigFactory } from "./AppConfigFactory-CqKWXqOm.js";
|
|
3
|
+
import { t as CodemationPostgresPrismaClientFactory } from "./persistenceServer-DKbFDxoS.js";
|
|
4
4
|
|
|
5
5
|
export { AppConfigFactory, CodemationPostgresPrismaClientFactory, PrismaMigrationDeployer };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as CodemationConfigNormalizer, t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-
|
|
2
|
-
import {
|
|
3
|
-
import { C as GetWorkflowDetailQuery, S as GetWorkflowSummariesQuery, a as AppContainerLifecycle, b as WorkflowDefinitionMapper, f as CodemationHonoApiApp, r as FrontendRuntime, t as AppContainerFactory } from "./AppContainerFactory-
|
|
4
|
-
import { n as CodemationPluginPackageMetadata, t as AppConfigFactory } from "./AppConfigFactory-
|
|
1
|
+
import { a as CodemationConfigNormalizer, t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-DovlxZNb.js";
|
|
2
|
+
import { d as ApplicationTokens } from "./CredentialServices-BPKUF8Xs.js";
|
|
3
|
+
import { C as GetWorkflowDetailQuery, S as GetWorkflowSummariesQuery, a as AppContainerLifecycle, b as WorkflowDefinitionMapper, f as CodemationHonoApiApp, r as FrontendRuntime, t as AppContainerFactory } from "./AppContainerFactory-CcSGFNLW.js";
|
|
4
|
+
import { n as CodemationPluginPackageMetadata, t as AppConfigFactory } from "./AppConfigFactory-CqKWXqOm.js";
|
|
5
5
|
import { readFile, readdir } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { pathToFileURL } from "node:url";
|
|
@@ -218,4 +218,4 @@ var CodemationPluginDiscovery = class {
|
|
|
218
218
|
|
|
219
219
|
//#endregion
|
|
220
220
|
export { AppConfigLoader as n, CodemationServerGateway as r, CodemationPluginDiscovery as t };
|
|
221
|
-
//# sourceMappingURL=server-
|
|
221
|
+
//# sourceMappingURL=server-CFpgKuVE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-CioY8PP3.js","names":["config: CodemationConfig","consumerRoot: string","configSource?: string","workflowSources: ReadonlyArray<string>","env?: Readonly<NodeJS.ProcessEnv>","consumerConfigLoader: CodemationConsumerConfigLoader","appConfigFactory: AppConfigFactory","discoveredPackages: CodemationDiscoveredPluginPackage[]","resolvedPackages: CodemationResolvedPluginPackage[]","packageRoots: string[]"],"sources":["../src/presentation/http/CodemationServerGatewayFactory.ts","../src/presentation/server/AppConfigLoader.ts","../src/presentation/server/CodemationPluginDiscovery.ts"],"sourcesContent":["import { accessSync } from \"node:fs\";\nimport path from \"node:path\";\nimport type { QueryBus } from \"../../application/bus/QueryBus\";\nimport type { WorkflowDto, WorkflowSummary } from \"../../application/contracts/WorkflowViewContracts\";\nimport { WorkflowDefinitionMapper } from \"../../application/mapping/WorkflowDefinitionMapper\";\nimport { GetWorkflowDetailQuery } from \"../../application/queries/GetWorkflowDetailQuery\";\nimport { GetWorkflowSummariesQuery } from \"../../application/queries/GetWorkflowSummariesQuery\";\nimport { ApplicationTokens } from \"../../applicationTokens\";\nimport { AppContainerFactory } from \"../../bootstrap/AppContainerFactory\";\nimport { AppContainerLifecycle } from \"../../bootstrap/AppContainerLifecycle\";\nimport { FrontendRuntime } from \"../../bootstrap/runtime/FrontendRuntime\";\nimport { AppConfigFactory } from \"../../bootstrap/runtime/AppConfigFactory\";\nimport type { CodemationConfig } from \"../config/CodemationConfig\";\nimport { CodemationConfigNormalizer } from \"../config/CodemationConfigNormalizer\";\nimport { CodemationHonoApiApp } from \"./hono/CodemationHonoApiAppFactory\";\n\ntype ServerGatewayContext = Readonly<{\n container: import(\"@codemation/core\").Container;\n httpApi: CodemationHonoApiApp;\n queryBus: QueryBus;\n workflowDefinitionMapper: WorkflowDefinitionMapper;\n}>;\n\nexport class CodemationServerGateway {\n private static readonly contextsByConfig = new WeakMap<object, Promise<ServerGatewayContext>>();\n\n constructor(\n private readonly config: CodemationConfig,\n private readonly consumerRoot: string,\n private readonly configSource?: string,\n private readonly workflowSources: ReadonlyArray<string> = [],\n private readonly env?: Readonly<NodeJS.ProcessEnv>,\n ) {}\n\n async dispatch(request: Request): Promise<Response> {\n return await (await this.getContext()).httpApi.fetch(request);\n }\n\n async prepare(): Promise<void> {\n await this.getContext();\n }\n\n async close(): Promise<void> {\n const cachedContext = CodemationServerGateway.contextsByConfig.get(this.config as object);\n if (!cachedContext) {\n return;\n }\n CodemationServerGateway.contextsByConfig.delete(this.config as object);\n await (await cachedContext).container.resolve(AppContainerLifecycle).stop();\n }\n\n async loadWorkflowSummaries(): Promise<ReadonlyArray<WorkflowSummary>> {\n const context = await this.getContext();\n const workflows = await context.queryBus.execute(new GetWorkflowSummariesQuery());\n return workflows.map((workflow) => context.workflowDefinitionMapper.toSummary(workflow));\n }\n\n async loadWorkflowDetail(workflowId: string): Promise<WorkflowDto> {\n const context = await this.getContext();\n const workflow = await context.queryBus.execute(new GetWorkflowDetailQuery(workflowId));\n if (!workflow) {\n throw new Error(`Unknown workflowId: ${workflowId}`);\n }\n return await context.workflowDefinitionMapper.map(workflow);\n }\n\n private getContext(): Promise<ServerGatewayContext> {\n const cachedContext = CodemationServerGateway.contextsByConfig.get(this.config as object);\n if (cachedContext) {\n return cachedContext;\n }\n const nextContext = this.createContext();\n CodemationServerGateway.contextsByConfig.set(this.config as object, nextContext);\n return nextContext;\n }\n\n private async createContext(): Promise<ServerGatewayContext> {\n const repoRoot = this.detectWorkspaceRoot(this.consumerRoot);\n // This gateway is the config/env boundary that materializes AppConfig from raw inputs.\n // eslint-disable-next-line no-restricted-properties\n const env = this.env ?? process.env;\n const appConfig = new AppConfigFactory().create({\n repoRoot,\n consumerRoot: this.consumerRoot,\n env,\n config: new CodemationConfigNormalizer().normalize(this.config),\n workflowSources: this.resolveWorkflowSources(),\n });\n const container = await new AppContainerFactory().create({\n appConfig,\n sharedWorkflowWebsocketServer: null,\n });\n await container.resolve(FrontendRuntime).start();\n return {\n container,\n httpApi: container.resolve(CodemationHonoApiApp),\n queryBus: container.resolve(ApplicationTokens.QueryBus),\n workflowDefinitionMapper: container.resolve(WorkflowDefinitionMapper),\n };\n }\n\n private resolveWorkflowSources(): ReadonlyArray<string> {\n if (this.workflowSources.length > 0) {\n return [...this.workflowSources];\n }\n if (!this.configSource || !this.config.workflows || this.config.workflows.length === 0) {\n return [];\n }\n return [this.configSource];\n }\n private detectWorkspaceRoot(startDirectory: string): string {\n let currentDirectory = path.resolve(startDirectory);\n while (true) {\n try {\n accessSync(path.resolve(currentDirectory, \"pnpm-workspace.yaml\"));\n return currentDirectory;\n } catch {\n const parentDirectory = path.dirname(currentDirectory);\n if (parentDirectory === currentDirectory) {\n return startDirectory;\n }\n currentDirectory = parentDirectory;\n }\n }\n }\n}\n","import type { AppConfig } from \"../config/AppConfig\";\nimport { CodemationConsumerConfigLoader } from \"./CodemationConsumerConfigLoader\";\nimport { AppConfigFactory } from \"../../bootstrap/runtime/AppConfigFactory\";\n\nexport type AppConfigLoadResult = Readonly<{\n appConfig: AppConfig;\n bootstrapSource: string | null;\n}>;\n\nexport class AppConfigLoader {\n constructor(\n private readonly consumerConfigLoader: CodemationConsumerConfigLoader = new CodemationConsumerConfigLoader(),\n private readonly appConfigFactory: AppConfigFactory = new AppConfigFactory(),\n ) {}\n\n async load(\n args: Readonly<{\n consumerRoot: string;\n repoRoot: string;\n env: NodeJS.ProcessEnv;\n configPathOverride?: string;\n }>,\n ): Promise<AppConfigLoadResult> {\n const resolution = await this.consumerConfigLoader.load({\n consumerRoot: args.consumerRoot,\n configPathOverride: args.configPathOverride,\n });\n return {\n appConfig: this.appConfigFactory.create({\n repoRoot: args.repoRoot,\n consumerRoot: args.consumerRoot,\n env: args.env,\n config: resolution.config,\n workflowSources: resolution.workflowSources,\n }),\n bootstrapSource: resolution.bootstrapSource,\n };\n }\n}\n","import type { CodemationPackageManifest } from \"../config/CodemationPackageManifest\";\nimport { CodemationPluginPackageMetadata, type CodemationPlugin } from \"../config/CodemationPlugin\";\nimport { readFile, readdir } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n\nexport type CodemationDiscoveredPluginPackage = Readonly<{\n packageName: string;\n packageRoot: string;\n pluginEntry: string;\n developmentEntry?: string;\n}>;\n\nexport type CodemationResolvedPluginPackage = Readonly<\n CodemationDiscoveredPluginPackage & {\n plugin: CodemationPlugin;\n }\n>;\n\ntype PackageJsonShape = Readonly<{\n codemation?: CodemationPackageManifest;\n name?: string;\n exports?: Readonly<Record<string, unknown>>;\n}>;\n\nexport class CodemationPluginDiscovery {\n private readonly pluginPackageMetadata = new CodemationPluginPackageMetadata();\n\n async discover(consumerRoot: string): Promise<ReadonlyArray<CodemationDiscoveredPluginPackage>> {\n const nodeModulesRoot = path.resolve(consumerRoot, \"node_modules\");\n const packageRoots = await this.collectPackageRoots(nodeModulesRoot);\n const discoveredPackages: CodemationDiscoveredPluginPackage[] = [];\n for (const packageRoot of packageRoots) {\n const packageJson = await this.readPackageJson(path.resolve(packageRoot, \"package.json\"));\n const pluginManifest = packageJson.codemation?.plugin;\n if (!packageJson.name || typeof pluginManifest !== \"string\" || pluginManifest.trim().length === 0) {\n continue;\n }\n discoveredPackages.push({\n packageName: packageJson.name,\n packageRoot,\n pluginEntry: pluginManifest,\n developmentEntry: await this.resolveDevelopmentPluginEntry(packageRoot),\n });\n }\n return discoveredPackages.sort((left, right) => left.packageName.localeCompare(right.packageName));\n }\n\n async resolvePlugins(consumerRoot: string): Promise<ReadonlyArray<CodemationResolvedPluginPackage>> {\n const discoveredPackages = await this.discover(consumerRoot);\n return await this.resolveDiscoveredPackages(discoveredPackages);\n }\n\n async resolveDiscoveredPackages(\n discoveredPackages: ReadonlyArray<CodemationDiscoveredPluginPackage>,\n ): Promise<ReadonlyArray<CodemationResolvedPluginPackage>> {\n const resolvedPackages: CodemationResolvedPluginPackage[] = [];\n for (const discoveredPackage of discoveredPackages) {\n resolvedPackages.push({\n ...discoveredPackage,\n plugin: await this.loadPlugin(discoveredPackage),\n });\n }\n return resolvedPackages;\n }\n\n private async collectPackageRoots(nodeModulesRoot: string): Promise<ReadonlyArray<string>> {\n try {\n const entries = await readdir(nodeModulesRoot, { withFileTypes: true });\n const packageRoots: string[] = [];\n for (const entry of entries) {\n if (!entry.isDirectory() && !entry.isSymbolicLink()) {\n continue;\n }\n if (entry.name.startsWith(\"@\")) {\n const scopedEntries = await readdir(path.resolve(nodeModulesRoot, entry.name), { withFileTypes: true });\n for (const scopedEntry of scopedEntries) {\n if (scopedEntry.isDirectory() || scopedEntry.isSymbolicLink()) {\n packageRoots.push(path.resolve(nodeModulesRoot, entry.name, scopedEntry.name));\n }\n }\n continue;\n }\n packageRoots.push(path.resolve(nodeModulesRoot, entry.name));\n }\n return packageRoots;\n } catch {\n return [];\n }\n }\n\n private async readPackageJson(packageJsonPath: string): Promise<PackageJsonShape> {\n try {\n const rawPackageJson = await readFile(packageJsonPath, \"utf8\");\n return JSON.parse(rawPackageJson) as PackageJsonShape;\n } catch {\n return {};\n }\n }\n\n private async loadPlugin(discoveredPackage: CodemationDiscoveredPluginPackage): Promise<CodemationPlugin> {\n const pluginModulePath = path.resolve(discoveredPackage.packageRoot, this.resolvePluginEntry(discoveredPackage));\n const importedModule = (await import(\n /* webpackIgnore: true */ this.resolvePluginModuleSpecifier(pluginModulePath)\n )) as Record<string, unknown>;\n const exportedValue = importedModule.default;\n const plugin = this.resolvePluginValue(exportedValue);\n if (!plugin) {\n throw new Error(`Plugin package \"${discoveredPackage.packageName}\" did not default-export a Codemation plugin.`);\n }\n return this.pluginPackageMetadata.attachPackageName(plugin, discoveredPackage.packageName);\n }\n\n private resolvePluginValue(value: unknown): CodemationPlugin | null {\n if (this.isPluginConfig(value)) {\n return value;\n }\n return null;\n }\n\n private isPluginConfig(value: unknown): value is CodemationPlugin {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return false;\n }\n const pluginValue = value as {\n credentialTypes?: unknown;\n register?: unknown;\n sandbox?: unknown;\n };\n if (pluginValue.register !== undefined && typeof pluginValue.register !== \"function\") {\n return false;\n }\n if (pluginValue.credentialTypes !== undefined && !Array.isArray(pluginValue.credentialTypes)) {\n return false;\n }\n return (\n pluginValue.register !== undefined ||\n pluginValue.credentialTypes !== undefined ||\n pluginValue.sandbox !== undefined ||\n Object.keys(pluginValue).length === 0\n );\n }\n\n private resolvePluginEntry(discoveredPackage: CodemationDiscoveredPluginPackage): string {\n const preferSource =\n process.env.CODEMATION_PREFER_PLUGIN_SOURCE_ENTRY === \"true\" &&\n typeof discoveredPackage.developmentEntry === \"string\" &&\n discoveredPackage.developmentEntry.trim().length > 0;\n const selectedEntry = preferSource ? discoveredPackage.developmentEntry : discoveredPackage.pluginEntry;\n return selectedEntry;\n }\n\n private async resolveDevelopmentPluginEntry(packageRoot: string): Promise<string | undefined> {\n const candidates = [\n path.resolve(packageRoot, \"codemation.plugin.ts\"),\n path.resolve(packageRoot, \"codemation.plugin.js\"),\n path.resolve(packageRoot, \"src\", \"codemation.plugin.ts\"),\n path.resolve(packageRoot, \"src\", \"codemation.plugin.js\"),\n ];\n for (const candidate of candidates) {\n if (await this.exists(candidate)) {\n return path.relative(packageRoot, candidate);\n }\n }\n return undefined;\n }\n\n private async exists(filePath: string): Promise<boolean> {\n try {\n await readFile(filePath, \"utf8\");\n return true;\n } catch {\n return false;\n }\n }\n\n private resolvePluginModuleSpecifier(pluginModulePath: string): string {\n return pathToFileURL(pluginModulePath).href;\n }\n}\n"],"mappings":";;;;;;;;;;AAuBA,IAAa,0BAAb,MAAa,wBAAwB;CACnC,OAAwB,mCAAmB,IAAI,SAAgD;CAE/F,YACE,AAAiBA,QACjB,AAAiBC,cACjB,AAAiBC,cACjB,AAAiBC,kBAAyC,EAAE,EAC5D,AAAiBC,KACjB;EALiB;EACA;EACA;EACA;EACA;;CAGnB,MAAM,SAAS,SAAqC;AAClD,SAAO,OAAO,MAAM,KAAK,YAAY,EAAE,QAAQ,MAAM,QAAQ;;CAG/D,MAAM,UAAyB;AAC7B,QAAM,KAAK,YAAY;;CAGzB,MAAM,QAAuB;EAC3B,MAAM,gBAAgB,wBAAwB,iBAAiB,IAAI,KAAK,OAAiB;AACzF,MAAI,CAAC,cACH;AAEF,0BAAwB,iBAAiB,OAAO,KAAK,OAAiB;AACtE,SAAO,MAAM,eAAe,UAAU,QAAQ,sBAAsB,CAAC,MAAM;;CAG7E,MAAM,wBAAiE;EACrE,MAAM,UAAU,MAAM,KAAK,YAAY;AAEvC,UADkB,MAAM,QAAQ,SAAS,QAAQ,IAAI,2BAA2B,CAAC,EAChE,KAAK,aAAa,QAAQ,yBAAyB,UAAU,SAAS,CA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,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"server-CFpgKuVE.js","names":["config: CodemationConfig","consumerRoot: string","configSource?: string","workflowSources: ReadonlyArray<string>","env?: Readonly<NodeJS.ProcessEnv>","consumerConfigLoader: CodemationConsumerConfigLoader","appConfigFactory: AppConfigFactory","discoveredPackages: CodemationDiscoveredPluginPackage[]","resolvedPackages: CodemationResolvedPluginPackage[]","packageRoots: string[]"],"sources":["../src/presentation/http/CodemationServerGatewayFactory.ts","../src/presentation/server/AppConfigLoader.ts","../src/presentation/server/CodemationPluginDiscovery.ts"],"sourcesContent":["import { accessSync } from \"node:fs\";\nimport path from \"node:path\";\nimport type { QueryBus } from \"../../application/bus/QueryBus\";\nimport type { WorkflowDto, WorkflowSummary } from \"../../application/contracts/WorkflowViewContracts\";\nimport { WorkflowDefinitionMapper } from \"../../application/mapping/WorkflowDefinitionMapper\";\nimport { GetWorkflowDetailQuery } from \"../../application/queries/GetWorkflowDetailQuery\";\nimport { GetWorkflowSummariesQuery } from \"../../application/queries/GetWorkflowSummariesQuery\";\nimport { ApplicationTokens } from \"../../applicationTokens\";\nimport { AppContainerFactory } from \"../../bootstrap/AppContainerFactory\";\nimport { AppContainerLifecycle } from \"../../bootstrap/AppContainerLifecycle\";\nimport { FrontendRuntime } from \"../../bootstrap/runtime/FrontendRuntime\";\nimport { AppConfigFactory } from \"../../bootstrap/runtime/AppConfigFactory\";\nimport type { CodemationConfig } from \"../config/CodemationConfig\";\nimport { CodemationConfigNormalizer } from \"../config/CodemationConfigNormalizer\";\nimport { CodemationHonoApiApp } from \"./hono/CodemationHonoApiAppFactory\";\n\ntype ServerGatewayContext = Readonly<{\n container: import(\"@codemation/core\").Container;\n httpApi: CodemationHonoApiApp;\n queryBus: QueryBus;\n workflowDefinitionMapper: WorkflowDefinitionMapper;\n}>;\n\nexport class CodemationServerGateway {\n private static readonly contextsByConfig = new WeakMap<object, Promise<ServerGatewayContext>>();\n\n constructor(\n private readonly config: CodemationConfig,\n private readonly consumerRoot: string,\n private readonly configSource?: string,\n private readonly workflowSources: ReadonlyArray<string> = [],\n private readonly env?: Readonly<NodeJS.ProcessEnv>,\n ) {}\n\n async dispatch(request: Request): Promise<Response> {\n return await (await this.getContext()).httpApi.fetch(request);\n }\n\n async prepare(): Promise<void> {\n await this.getContext();\n }\n\n async close(): Promise<void> {\n const cachedContext = CodemationServerGateway.contextsByConfig.get(this.config as object);\n if (!cachedContext) {\n return;\n }\n CodemationServerGateway.contextsByConfig.delete(this.config as object);\n await (await cachedContext).container.resolve(AppContainerLifecycle).stop();\n }\n\n async loadWorkflowSummaries(): Promise<ReadonlyArray<WorkflowSummary>> {\n const context = await this.getContext();\n const workflows = await context.queryBus.execute(new GetWorkflowSummariesQuery());\n return workflows.map((workflow) => context.workflowDefinitionMapper.toSummary(workflow));\n }\n\n async loadWorkflowDetail(workflowId: string): Promise<WorkflowDto> {\n const context = await this.getContext();\n const workflow = await context.queryBus.execute(new GetWorkflowDetailQuery(workflowId));\n if (!workflow) {\n throw new Error(`Unknown workflowId: ${workflowId}`);\n }\n return await context.workflowDefinitionMapper.map(workflow);\n }\n\n private getContext(): Promise<ServerGatewayContext> {\n const cachedContext = CodemationServerGateway.contextsByConfig.get(this.config as object);\n if (cachedContext) {\n return cachedContext;\n }\n const nextContext = this.createContext();\n CodemationServerGateway.contextsByConfig.set(this.config as object, nextContext);\n return nextContext;\n }\n\n private async createContext(): Promise<ServerGatewayContext> {\n const repoRoot = this.detectWorkspaceRoot(this.consumerRoot);\n // This gateway is the config/env boundary that materializes AppConfig from raw inputs.\n // eslint-disable-next-line no-restricted-properties\n const env = this.env ?? process.env;\n const appConfig = new AppConfigFactory().create({\n repoRoot,\n consumerRoot: this.consumerRoot,\n env,\n config: new CodemationConfigNormalizer().normalize(this.config),\n workflowSources: this.resolveWorkflowSources(),\n });\n const container = await new AppContainerFactory().create({\n appConfig,\n sharedWorkflowWebsocketServer: null,\n });\n await container.resolve(FrontendRuntime).start();\n return {\n container,\n httpApi: container.resolve(CodemationHonoApiApp),\n queryBus: container.resolve(ApplicationTokens.QueryBus),\n workflowDefinitionMapper: container.resolve(WorkflowDefinitionMapper),\n };\n }\n\n private resolveWorkflowSources(): ReadonlyArray<string> {\n if (this.workflowSources.length > 0) {\n return [...this.workflowSources];\n }\n if (!this.configSource || !this.config.workflows || this.config.workflows.length === 0) {\n return [];\n }\n return [this.configSource];\n }\n private detectWorkspaceRoot(startDirectory: string): string {\n let currentDirectory = path.resolve(startDirectory);\n while (true) {\n try {\n accessSync(path.resolve(currentDirectory, \"pnpm-workspace.yaml\"));\n return currentDirectory;\n } catch {\n const parentDirectory = path.dirname(currentDirectory);\n if (parentDirectory === currentDirectory) {\n return startDirectory;\n }\n currentDirectory = parentDirectory;\n }\n }\n }\n}\n","import type { AppConfig } from \"../config/AppConfig\";\nimport { CodemationConsumerConfigLoader } from \"./CodemationConsumerConfigLoader\";\nimport { AppConfigFactory } from \"../../bootstrap/runtime/AppConfigFactory\";\n\nexport type AppConfigLoadResult = Readonly<{\n appConfig: AppConfig;\n bootstrapSource: string | null;\n}>;\n\nexport class AppConfigLoader {\n constructor(\n private readonly consumerConfigLoader: CodemationConsumerConfigLoader = new CodemationConsumerConfigLoader(),\n private readonly appConfigFactory: AppConfigFactory = new AppConfigFactory(),\n ) {}\n\n async load(\n args: Readonly<{\n consumerRoot: string;\n repoRoot: string;\n env: NodeJS.ProcessEnv;\n configPathOverride?: string;\n }>,\n ): Promise<AppConfigLoadResult> {\n const resolution = await this.consumerConfigLoader.load({\n consumerRoot: args.consumerRoot,\n configPathOverride: args.configPathOverride,\n });\n return {\n appConfig: this.appConfigFactory.create({\n repoRoot: args.repoRoot,\n consumerRoot: args.consumerRoot,\n env: args.env,\n config: resolution.config,\n workflowSources: resolution.workflowSources,\n }),\n bootstrapSource: resolution.bootstrapSource,\n };\n }\n}\n","import type { CodemationPackageManifest } from \"../config/CodemationPackageManifest\";\nimport { CodemationPluginPackageMetadata, type CodemationPlugin } from \"../config/CodemationPlugin\";\nimport { readFile, readdir } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n\nexport type CodemationDiscoveredPluginPackage = Readonly<{\n packageName: string;\n packageRoot: string;\n pluginEntry: string;\n developmentEntry?: string;\n}>;\n\nexport type CodemationResolvedPluginPackage = Readonly<\n CodemationDiscoveredPluginPackage & {\n plugin: CodemationPlugin;\n }\n>;\n\ntype PackageJsonShape = Readonly<{\n codemation?: CodemationPackageManifest;\n name?: string;\n exports?: Readonly<Record<string, unknown>>;\n}>;\n\nexport class CodemationPluginDiscovery {\n private readonly pluginPackageMetadata = new CodemationPluginPackageMetadata();\n\n async discover(consumerRoot: string): Promise<ReadonlyArray<CodemationDiscoveredPluginPackage>> {\n const nodeModulesRoot = path.resolve(consumerRoot, \"node_modules\");\n const packageRoots = await this.collectPackageRoots(nodeModulesRoot);\n const discoveredPackages: CodemationDiscoveredPluginPackage[] = [];\n for (const packageRoot of packageRoots) {\n const packageJson = await this.readPackageJson(path.resolve(packageRoot, \"package.json\"));\n const pluginManifest = packageJson.codemation?.plugin;\n if (!packageJson.name || typeof pluginManifest !== \"string\" || pluginManifest.trim().length === 0) {\n continue;\n }\n discoveredPackages.push({\n packageName: packageJson.name,\n packageRoot,\n pluginEntry: pluginManifest,\n developmentEntry: await this.resolveDevelopmentPluginEntry(packageRoot),\n });\n }\n return discoveredPackages.sort((left, right) => left.packageName.localeCompare(right.packageName));\n }\n\n async resolvePlugins(consumerRoot: string): Promise<ReadonlyArray<CodemationResolvedPluginPackage>> {\n const discoveredPackages = await this.discover(consumerRoot);\n return await this.resolveDiscoveredPackages(discoveredPackages);\n }\n\n async resolveDiscoveredPackages(\n discoveredPackages: ReadonlyArray<CodemationDiscoveredPluginPackage>,\n ): Promise<ReadonlyArray<CodemationResolvedPluginPackage>> {\n const resolvedPackages: CodemationResolvedPluginPackage[] = [];\n for (const discoveredPackage of discoveredPackages) {\n resolvedPackages.push({\n ...discoveredPackage,\n plugin: await this.loadPlugin(discoveredPackage),\n });\n }\n return resolvedPackages;\n }\n\n private async collectPackageRoots(nodeModulesRoot: string): Promise<ReadonlyArray<string>> {\n try {\n const entries = await readdir(nodeModulesRoot, { withFileTypes: true });\n const packageRoots: string[] = [];\n for (const entry of entries) {\n if (!entry.isDirectory() && !entry.isSymbolicLink()) {\n continue;\n }\n if (entry.name.startsWith(\"@\")) {\n const scopedEntries = await readdir(path.resolve(nodeModulesRoot, entry.name), { withFileTypes: true });\n for (const scopedEntry of scopedEntries) {\n if (scopedEntry.isDirectory() || scopedEntry.isSymbolicLink()) {\n packageRoots.push(path.resolve(nodeModulesRoot, entry.name, scopedEntry.name));\n }\n }\n continue;\n }\n packageRoots.push(path.resolve(nodeModulesRoot, entry.name));\n }\n return packageRoots;\n } catch {\n return [];\n }\n }\n\n private async readPackageJson(packageJsonPath: string): Promise<PackageJsonShape> {\n try {\n const rawPackageJson = await readFile(packageJsonPath, \"utf8\");\n return JSON.parse(rawPackageJson) as PackageJsonShape;\n } catch {\n return {};\n }\n }\n\n private async loadPlugin(discoveredPackage: CodemationDiscoveredPluginPackage): Promise<CodemationPlugin> {\n const pluginModulePath = path.resolve(discoveredPackage.packageRoot, this.resolvePluginEntry(discoveredPackage));\n const importedModule = (await import(\n /* webpackIgnore: true */ this.resolvePluginModuleSpecifier(pluginModulePath)\n )) as Record<string, unknown>;\n const exportedValue = importedModule.default;\n const plugin = this.resolvePluginValue(exportedValue);\n if (!plugin) {\n throw new Error(`Plugin package \"${discoveredPackage.packageName}\" did not default-export a Codemation plugin.`);\n }\n return this.pluginPackageMetadata.attachPackageName(plugin, discoveredPackage.packageName);\n }\n\n private resolvePluginValue(value: unknown): CodemationPlugin | null {\n if (this.isPluginConfig(value)) {\n return value;\n }\n return null;\n }\n\n private isPluginConfig(value: unknown): value is CodemationPlugin {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return false;\n }\n const pluginValue = value as {\n credentialTypes?: unknown;\n register?: unknown;\n sandbox?: unknown;\n };\n if (pluginValue.register !== undefined && typeof pluginValue.register !== \"function\") {\n return false;\n }\n if (pluginValue.credentialTypes !== undefined && !Array.isArray(pluginValue.credentialTypes)) {\n return false;\n }\n return (\n pluginValue.register !== undefined ||\n pluginValue.credentialTypes !== undefined ||\n pluginValue.sandbox !== undefined ||\n Object.keys(pluginValue).length === 0\n );\n }\n\n private resolvePluginEntry(discoveredPackage: CodemationDiscoveredPluginPackage): string {\n const preferSource =\n process.env.CODEMATION_PREFER_PLUGIN_SOURCE_ENTRY === \"true\" &&\n typeof discoveredPackage.developmentEntry === \"string\" &&\n discoveredPackage.developmentEntry.trim().length > 0;\n const selectedEntry = preferSource ? discoveredPackage.developmentEntry : discoveredPackage.pluginEntry;\n return selectedEntry;\n }\n\n private async resolveDevelopmentPluginEntry(packageRoot: string): Promise<string | undefined> {\n const candidates = [\n path.resolve(packageRoot, \"codemation.plugin.ts\"),\n path.resolve(packageRoot, \"codemation.plugin.js\"),\n path.resolve(packageRoot, \"src\", \"codemation.plugin.ts\"),\n path.resolve(packageRoot, \"src\", \"codemation.plugin.js\"),\n ];\n for (const candidate of candidates) {\n if (await this.exists(candidate)) {\n return path.relative(packageRoot, candidate);\n }\n }\n return undefined;\n }\n\n private async exists(filePath: string): Promise<boolean> {\n try {\n await readFile(filePath, \"utf8\");\n return true;\n } catch {\n return false;\n }\n }\n\n private resolvePluginModuleSpecifier(pluginModulePath: string): string {\n return pathToFileURL(pluginModulePath).href;\n }\n}\n"],"mappings":";;;;;;;;;;AAuBA,IAAa,0BAAb,MAAa,wBAAwB;CACnC,OAAwB,mCAAmB,IAAI,SAAgD;CAE/F,YACE,AAAiBA,QACjB,AAAiBC,cACjB,AAAiBC,cACjB,AAAiBC,kBAAyC,EAAE,EAC5D,AAAiBC,KACjB;EALiB;EACA;EACA;EACA;EACA;;CAGnB,MAAM,SAAS,SAAqC;AAClD,SAAO,OAAO,MAAM,KAAK,YAAY,EAAE,QAAQ,MAAM,QAAQ;;CAG/D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