@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { B as Container, H as EngineExecutionLimitsPolicyConfig, N as WorkflowDefinition, V as TypeToken, s as AnyCredentialType } from "./index-SKC6oys-.js";
|
|
2
|
+
import { a as CodemationAuthConfig, n as CodemationLogConfig, t as CodemationWhitelabelConfig, u as LoggerFactory } from "./CodemationWhitelabelConfig-D5rYcLlj.js";
|
|
3
3
|
|
|
4
4
|
//#region src/presentation/config/CodemationClassToken.d.ts
|
|
5
5
|
type CodemationClassToken<TValue> = TypeToken<TValue> & (new (...args: never[]) => TValue);
|
|
@@ -19,6 +19,82 @@ interface CodemationFactoryRegistration<TValue> extends CodemationContainerRegis
|
|
|
19
19
|
}
|
|
20
20
|
type CodemationContainerRegistration<TValue = unknown> = CodemationValueRegistration<TValue> | CodemationClassRegistration<TValue> | CodemationFactoryRegistration<TValue>;
|
|
21
21
|
//#endregion
|
|
22
|
+
//#region src/presentation/config/CodemationWorkflowDiscovery.d.ts
|
|
23
|
+
interface CodemationWorkflowDiscovery {
|
|
24
|
+
readonly directories?: ReadonlyArray<string>;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/presentation/config/CodemationConfig.d.ts
|
|
28
|
+
type CodemationEventBusKind = "memory" | "redis";
|
|
29
|
+
type CodemationSchedulerKind = "local" | "bullmq";
|
|
30
|
+
type CodemationDatabaseKind = "postgresql" | "sqlite";
|
|
31
|
+
interface CodemationDatabaseConfig {
|
|
32
|
+
readonly kind?: CodemationDatabaseKind;
|
|
33
|
+
/** TCP PostgreSQL URL when `kind` is `postgresql` (or omitted with a postgres URL). */
|
|
34
|
+
readonly url?: string;
|
|
35
|
+
/** SQLite database file path when `kind` is `sqlite`. Relative paths resolve from the consumer app root. */
|
|
36
|
+
readonly sqliteFilePath?: string;
|
|
37
|
+
}
|
|
38
|
+
interface CodemationEventBusConfig {
|
|
39
|
+
readonly kind?: CodemationEventBusKind;
|
|
40
|
+
readonly redisUrl?: string;
|
|
41
|
+
readonly queuePrefix?: string;
|
|
42
|
+
}
|
|
43
|
+
interface CodemationSchedulerConfig {
|
|
44
|
+
readonly kind?: CodemationSchedulerKind;
|
|
45
|
+
readonly queuePrefix?: string;
|
|
46
|
+
readonly workerQueues?: ReadonlyArray<string>;
|
|
47
|
+
}
|
|
48
|
+
type CodemationAppSchedulerKind = "inline" | "queue";
|
|
49
|
+
interface CodemationAppSchedulerConfig {
|
|
50
|
+
readonly kind?: CodemationAppSchedulerKind;
|
|
51
|
+
readonly queuePrefix?: string;
|
|
52
|
+
readonly workerQueues?: ReadonlyArray<string>;
|
|
53
|
+
readonly redisUrl?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Optional overrides for engine execution limits (activation budget and subworkflow depth caps).
|
|
57
|
+
* Omitted fields keep framework defaults. Advanced users can bind `CoreTokens.EngineExecutionLimitsPolicy` for full control.
|
|
58
|
+
*/
|
|
59
|
+
type CodemationEngineExecutionLimitsConfig = Readonly<Partial<EngineExecutionLimitsPolicyConfig>>;
|
|
60
|
+
interface CodemationAppDefinition {
|
|
61
|
+
readonly frontendPort?: number;
|
|
62
|
+
readonly databaseUrl?: string;
|
|
63
|
+
readonly database?: CodemationDatabaseConfig;
|
|
64
|
+
readonly scheduler?: CodemationAppSchedulerConfig;
|
|
65
|
+
readonly auth?: CodemationAuthConfig;
|
|
66
|
+
readonly whitelabel?: CodemationWhitelabelConfig;
|
|
67
|
+
readonly log?: CodemationLogConfig;
|
|
68
|
+
readonly engineExecutionLimits?: CodemationEngineExecutionLimitsConfig;
|
|
69
|
+
}
|
|
70
|
+
interface CodemationApplicationRuntimeConfig {
|
|
71
|
+
readonly frontendPort?: number;
|
|
72
|
+
readonly database?: CodemationDatabaseConfig;
|
|
73
|
+
readonly eventBus?: CodemationEventBusConfig;
|
|
74
|
+
readonly scheduler?: CodemationSchedulerConfig;
|
|
75
|
+
/** Merged with engine defaults when building the execution limits policy (API + workers). */
|
|
76
|
+
readonly engineExecutionLimits?: CodemationEngineExecutionLimitsConfig;
|
|
77
|
+
}
|
|
78
|
+
interface CodemationConfig {
|
|
79
|
+
readonly app?: CodemationAppDefinition;
|
|
80
|
+
readonly register?: (context: CodemationAppContext) => void;
|
|
81
|
+
readonly runtime?: CodemationApplicationRuntimeConfig;
|
|
82
|
+
readonly workflows?: ReadonlyArray<WorkflowDefinition>;
|
|
83
|
+
readonly workflowDiscovery?: CodemationWorkflowDiscovery;
|
|
84
|
+
readonly plugins?: ReadonlyArray<CodemationPlugin>;
|
|
85
|
+
/** Consumer-defined `CredentialType` entries (see `@codemation/core`), applied when the host loads config. */
|
|
86
|
+
readonly credentialTypes?: ReadonlyArray<AnyCredentialType>;
|
|
87
|
+
/** Optional shell whitelabel (product name, logo path). */
|
|
88
|
+
readonly whitelabel?: CodemationWhitelabelConfig;
|
|
89
|
+
/** Required for production hosts; optional only when using development bypass (never in production). */
|
|
90
|
+
readonly auth?: CodemationAuthConfig;
|
|
91
|
+
/**
|
|
92
|
+
* Namespace-level log filters (first matching rule wins). Unmatched namespaces use `CODEMATION_LOG_LEVEL` / defaults.
|
|
93
|
+
* Omit to keep env-only behavior.
|
|
94
|
+
*/
|
|
95
|
+
readonly log?: CodemationLogConfig;
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
22
98
|
//#region src/presentation/config/CodemationPlugin.d.ts
|
|
23
99
|
interface CodemationPluginContext extends CodemationRegistrationContextBase {
|
|
24
100
|
readonly container: Container;
|
|
@@ -100,81 +176,5 @@ interface CodemationAppContext extends CodemationRegistrationContextBase {
|
|
|
100
176
|
discoverWorkflows(...directories: ReadonlyArray<string>): void;
|
|
101
177
|
}
|
|
102
178
|
//#endregion
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
readonly directories?: ReadonlyArray<string>;
|
|
106
|
-
}
|
|
107
|
-
//#endregion
|
|
108
|
-
//#region src/presentation/config/CodemationConfig.d.ts
|
|
109
|
-
type CodemationEventBusKind = "memory" | "redis";
|
|
110
|
-
type CodemationSchedulerKind = "local" | "bullmq";
|
|
111
|
-
type CodemationDatabaseKind = "postgresql" | "sqlite";
|
|
112
|
-
interface CodemationDatabaseConfig {
|
|
113
|
-
readonly kind?: CodemationDatabaseKind;
|
|
114
|
-
/** TCP PostgreSQL URL when `kind` is `postgresql` (or omitted with a postgres URL). */
|
|
115
|
-
readonly url?: string;
|
|
116
|
-
/** SQLite database file path when `kind` is `sqlite`. Relative paths resolve from the consumer app root. */
|
|
117
|
-
readonly sqliteFilePath?: string;
|
|
118
|
-
}
|
|
119
|
-
interface CodemationEventBusConfig {
|
|
120
|
-
readonly kind?: CodemationEventBusKind;
|
|
121
|
-
readonly redisUrl?: string;
|
|
122
|
-
readonly queuePrefix?: string;
|
|
123
|
-
}
|
|
124
|
-
interface CodemationSchedulerConfig {
|
|
125
|
-
readonly kind?: CodemationSchedulerKind;
|
|
126
|
-
readonly queuePrefix?: string;
|
|
127
|
-
readonly workerQueues?: ReadonlyArray<string>;
|
|
128
|
-
}
|
|
129
|
-
type CodemationAppSchedulerKind = "inline" | "queue";
|
|
130
|
-
interface CodemationAppSchedulerConfig {
|
|
131
|
-
readonly kind?: CodemationAppSchedulerKind;
|
|
132
|
-
readonly queuePrefix?: string;
|
|
133
|
-
readonly workerQueues?: ReadonlyArray<string>;
|
|
134
|
-
readonly redisUrl?: string;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Optional overrides for engine execution limits (activation budget and subworkflow depth caps).
|
|
138
|
-
* Omitted fields keep framework defaults. Advanced users can bind `CoreTokens.EngineExecutionLimitsPolicy` for full control.
|
|
139
|
-
*/
|
|
140
|
-
type CodemationEngineExecutionLimitsConfig = Readonly<Partial<EngineExecutionLimitsPolicyConfig>>;
|
|
141
|
-
interface CodemationAppDefinition {
|
|
142
|
-
readonly frontendPort?: number;
|
|
143
|
-
readonly databaseUrl?: string;
|
|
144
|
-
readonly database?: CodemationDatabaseConfig;
|
|
145
|
-
readonly scheduler?: CodemationAppSchedulerConfig;
|
|
146
|
-
readonly auth?: CodemationAuthConfig;
|
|
147
|
-
readonly whitelabel?: CodemationWhitelabelConfig;
|
|
148
|
-
readonly log?: CodemationLogConfig;
|
|
149
|
-
readonly engineExecutionLimits?: CodemationEngineExecutionLimitsConfig;
|
|
150
|
-
}
|
|
151
|
-
interface CodemationApplicationRuntimeConfig {
|
|
152
|
-
readonly frontendPort?: number;
|
|
153
|
-
readonly database?: CodemationDatabaseConfig;
|
|
154
|
-
readonly eventBus?: CodemationEventBusConfig;
|
|
155
|
-
readonly scheduler?: CodemationSchedulerConfig;
|
|
156
|
-
/** Merged with engine defaults when building the execution limits policy (API + workers). */
|
|
157
|
-
readonly engineExecutionLimits?: CodemationEngineExecutionLimitsConfig;
|
|
158
|
-
}
|
|
159
|
-
interface CodemationConfig {
|
|
160
|
-
readonly app?: CodemationAppDefinition;
|
|
161
|
-
readonly register?: (context: CodemationAppContext) => void;
|
|
162
|
-
readonly runtime?: CodemationApplicationRuntimeConfig;
|
|
163
|
-
readonly workflows?: ReadonlyArray<WorkflowDefinition>;
|
|
164
|
-
readonly workflowDiscovery?: CodemationWorkflowDiscovery;
|
|
165
|
-
readonly plugins?: ReadonlyArray<CodemationPlugin>;
|
|
166
|
-
/** Consumer-defined `CredentialType` entries (see `@codemation/core`), applied when the host loads config. */
|
|
167
|
-
readonly credentialTypes?: ReadonlyArray<AnyCredentialType>;
|
|
168
|
-
/** Optional shell whitelabel (product name, logo path). */
|
|
169
|
-
readonly whitelabel?: CodemationWhitelabelConfig;
|
|
170
|
-
/** Required for production hosts; optional only when using development bypass (never in production). */
|
|
171
|
-
readonly auth?: CodemationAuthConfig;
|
|
172
|
-
/**
|
|
173
|
-
* Namespace-level log filters (first matching rule wins). Unmatched namespaces use `CODEMATION_LOG_LEVEL` / defaults.
|
|
174
|
-
* Omit to keep env-only behavior.
|
|
175
|
-
*/
|
|
176
|
-
readonly log?: CodemationLogConfig;
|
|
177
|
-
}
|
|
178
|
-
//#endregion
|
|
179
|
-
export { CodemationContainerRegistration as C, CodemationPluginPackageMetadata as S, AppPersistenceConfig as _, CodemationConfig as a, CodemationPluginConfig as b, CodemationEngineExecutionLimitsConfig as c, CodemationSchedulerConfig as d, CodemationSchedulerKind as f, AppConfig as g, CodemationRegistrationContextBase as h, CodemationApplicationRuntimeConfig as i, CodemationEventBusConfig as l, CodemationAppContext as m, CodemationAppSchedulerConfig as n, CodemationDatabaseConfig as o, CodemationWorkflowDiscovery as p, CodemationAppSchedulerKind as r, CodemationDatabaseKind as s, CodemationAppDefinition as t, CodemationEventBusKind as u, AppPluginLoadSummary as v, CodemationClassToken as w, CodemationPluginContext as x, CodemationPlugin as y };
|
|
180
|
-
//# sourceMappingURL=CodemationConfig-9PkOBCh-.d.ts.map
|
|
179
|
+
export { CodemationContainerRegistration as C, CodemationWorkflowDiscovery as S, CodemationEngineExecutionLimitsConfig as _, AppPluginLoadSummary as a, CodemationSchedulerConfig as b, CodemationPluginContext as c, CodemationAppSchedulerConfig as d, CodemationAppSchedulerKind as f, CodemationDatabaseKind as g, CodemationDatabaseConfig as h, AppPersistenceConfig as i, CodemationPluginPackageMetadata as l, CodemationConfig as m, CodemationRegistrationContextBase as n, CodemationPlugin as o, CodemationApplicationRuntimeConfig as p, AppConfig as r, CodemationPluginConfig as s, CodemationAppContext as t, CodemationAppDefinition as u, CodemationEventBusConfig as v, CodemationClassToken as w, CodemationSchedulerKind as x, CodemationEventBusKind as y };
|
|
180
|
+
//# sourceMappingURL=CodemationAppContext-Vtn0U2Ga.d.ts.map
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { D as Item, G as ChainCursor, I as NodeExecutionContext, K as AnyRunnableNodeConfig, M as RunnableNodeOutputJson, N as WorkflowDefinition, O as Items, V as TypeToken, a as ToolConfig, i as ChatModelConfig, j as RunnableNodeConfig, o as DefinedNode, r as AgentGuardrailConfig, s as AnyCredentialType } from "./index-SKC6oys-.js";
|
|
2
|
+
import { c as CodemationPluginContext, m as CodemationConfig, o as CodemationPlugin, t as CodemationAppContext } from "./CodemationAppContext-Vtn0U2Ga.js";
|
|
3
|
+
import { t as CodemationWhitelabelConfig } from "./CodemationWhitelabelConfig-D5rYcLlj.js";
|
|
4
|
+
import { ZodType, z } from "zod";
|
|
5
|
+
|
|
6
|
+
//#region ../core-nodes/src/nodes/aggregate.d.ts
|
|
7
|
+
declare class Aggregate<TIn = unknown, TOut = unknown> implements RunnableNodeConfig<TIn, TOut> {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly aggregate: (items: Items<TIn>, ctx: NodeExecutionContext<Aggregate<TIn, TOut>>) => TOut | Promise<TOut>;
|
|
10
|
+
readonly id?: string | undefined;
|
|
11
|
+
readonly kind: "node";
|
|
12
|
+
readonly type: TypeToken<unknown>;
|
|
13
|
+
readonly execution: {
|
|
14
|
+
readonly hint: "local";
|
|
15
|
+
};
|
|
16
|
+
readonly icon: "lucide:layers";
|
|
17
|
+
constructor(name: string, aggregate: (items: Items<TIn>, ctx: NodeExecutionContext<Aggregate<TIn, TOut>>) => TOut | Promise<TOut>, id?: string | undefined);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ../core-nodes/src/nodes/filter.d.ts
|
|
21
|
+
declare class Filter<TIn = unknown> implements RunnableNodeConfig<TIn, TIn> {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly predicate: (item: Item<TIn>, index: number, items: Items<TIn>, ctx: NodeExecutionContext<Filter<TIn>>) => boolean;
|
|
24
|
+
readonly id?: string | undefined;
|
|
25
|
+
readonly kind: "node";
|
|
26
|
+
readonly type: TypeToken<unknown>;
|
|
27
|
+
readonly execution: {
|
|
28
|
+
readonly hint: "local";
|
|
29
|
+
};
|
|
30
|
+
readonly icon: "lucide:filter";
|
|
31
|
+
constructor(name: string, predicate: (item: Item<TIn>, index: number, items: Items<TIn>, ctx: NodeExecutionContext<Filter<TIn>>) => boolean, id?: string | undefined);
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region ../core-nodes/src/nodes/split.d.ts
|
|
35
|
+
declare class Split<TIn = unknown, TElem = unknown> implements RunnableNodeConfig<TIn, TElem> {
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly getElements: (item: Item<TIn>, ctx: NodeExecutionContext<Split<TIn, TElem>>) => readonly TElem[];
|
|
38
|
+
readonly id?: string | undefined;
|
|
39
|
+
readonly kind: "node";
|
|
40
|
+
readonly type: TypeToken<unknown>;
|
|
41
|
+
readonly execution: {
|
|
42
|
+
readonly hint: "local";
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* When splitting yields zero items for a batch, downstream single-input nodes still run once with an empty batch.
|
|
46
|
+
* Mirrors {@link MapData}'s empty-output behavior.
|
|
47
|
+
*/
|
|
48
|
+
readonly continueWhenEmptyOutput: true;
|
|
49
|
+
readonly icon: "lucide:ungroup";
|
|
50
|
+
constructor(name: string, getElements: (item: Item<TIn>, ctx: NodeExecutionContext<Split<TIn, TElem>>) => readonly TElem[], id?: string | undefined);
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region ../core-nodes/src/nodes/merge.d.ts
|
|
54
|
+
type MergeMode = "passThrough" | "append" | "mergeByPosition";
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region ../core-nodes/src/workflowAuthoring/WorkflowAuthoringOptions.types.d.ts
|
|
57
|
+
type WorkflowAgentPrompt<TCurrentJson> = string | ((item: TCurrentJson) => string);
|
|
58
|
+
interface WorkflowAgentOptions<TCurrentJson, TOutputSchema extends z.ZodTypeAny | undefined = undefined> {
|
|
59
|
+
readonly prompt: WorkflowAgentPrompt<TCurrentJson>;
|
|
60
|
+
readonly model: string | ChatModelConfig;
|
|
61
|
+
readonly tools?: ReadonlyArray<ToolConfig>;
|
|
62
|
+
readonly outputSchema?: TOutputSchema;
|
|
63
|
+
readonly retryPolicy?: RunnableNodeConfig["retryPolicy"];
|
|
64
|
+
readonly guardrails?: AgentGuardrailConfig;
|
|
65
|
+
readonly id?: string;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../core-nodes/src/workflowAuthoring/WorkflowBranchBuilder.types.d.ts
|
|
69
|
+
declare class WorkflowBranchBuilder<TCurrentJson> {
|
|
70
|
+
private readonly steps;
|
|
71
|
+
constructor(steps?: ReadonlyArray<AnyRunnableNodeConfig>);
|
|
72
|
+
then<TOutputJson, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson>>(config: TConfig): WorkflowBranchBuilder<RunnableNodeOutputJson<TConfig>>;
|
|
73
|
+
map<TNextJson>(mapper: (item: TCurrentJson) => TNextJson): WorkflowBranchBuilder<TNextJson>;
|
|
74
|
+
map<TNextJson>(name: string, mapper: (item: TCurrentJson) => TNextJson, id?: string): WorkflowBranchBuilder<TNextJson>;
|
|
75
|
+
wait(duration: number | string): WorkflowBranchBuilder<TCurrentJson>;
|
|
76
|
+
wait(name: string, duration: number | string, id?: string): WorkflowBranchBuilder<TCurrentJson>;
|
|
77
|
+
split<TElem>(getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[]): WorkflowBranchBuilder<TElem>;
|
|
78
|
+
split<TElem>(name: string, getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[], id?: string): WorkflowBranchBuilder<TElem>;
|
|
79
|
+
filter(predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean): WorkflowBranchBuilder<TCurrentJson>;
|
|
80
|
+
filter(name: string, predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean, id?: string): WorkflowBranchBuilder<TCurrentJson>;
|
|
81
|
+
aggregate<TOut>(aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>): WorkflowBranchBuilder<TOut>;
|
|
82
|
+
aggregate<TOut>(name: string, aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>, id?: string): WorkflowBranchBuilder<TOut>;
|
|
83
|
+
agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowBranchBuilder<z.output<TOutputSchema>>;
|
|
84
|
+
agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowBranchBuilder<Record<string, unknown>>;
|
|
85
|
+
agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowBranchBuilder<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
|
|
86
|
+
node<TConfig extends Record<string, unknown>, TOutputJson>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson> | string, config: TConfig, name?: string, id?: string): WorkflowBranchBuilder<TOutputJson>;
|
|
87
|
+
getSteps(): ReadonlyArray<AnyRunnableNodeConfig>;
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region ../core-nodes/src/workflowAuthoring/WorkflowChain.types.d.ts
|
|
91
|
+
type BranchCallback<TCurrentJson, TNextJson> = (branch: WorkflowBranchBuilder<TCurrentJson>) => WorkflowBranchBuilder<TNextJson>;
|
|
92
|
+
type RouteBranchCallback<TCurrentJson, TNextJson> = (branch: WorkflowChain<TCurrentJson>) => WorkflowChain<TNextJson>;
|
|
93
|
+
declare class WorkflowChain<TCurrentJson> {
|
|
94
|
+
private readonly chain;
|
|
95
|
+
constructor(chain: ChainCursor<TCurrentJson>);
|
|
96
|
+
then<TOutputJson, TConfig extends RunnableNodeConfig<TCurrentJson, TOutputJson>>(config: TConfig): WorkflowChain<RunnableNodeOutputJson<TConfig>>;
|
|
97
|
+
map<TNextJson>(mapper: (item: TCurrentJson) => TNextJson): WorkflowChain<TNextJson>;
|
|
98
|
+
map<TNextJson>(name: string, mapper: (item: TCurrentJson) => TNextJson, id?: string): WorkflowChain<TNextJson>;
|
|
99
|
+
wait(duration: number | string): WorkflowChain<TCurrentJson>;
|
|
100
|
+
wait(name: string, duration: number | string, id?: string): WorkflowChain<TCurrentJson>;
|
|
101
|
+
split<TElem>(getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[]): WorkflowChain<TElem>;
|
|
102
|
+
split<TElem>(name: string, getElements: (item: Item<TCurrentJson>, ctx: NodeExecutionContext<Split<TCurrentJson, TElem>>) => readonly TElem[], id?: string): WorkflowChain<TElem>;
|
|
103
|
+
filter(predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean): WorkflowChain<TCurrentJson>;
|
|
104
|
+
filter(name: string, predicate: (item: Item<TCurrentJson>, index: number, items: Items<TCurrentJson>, ctx: NodeExecutionContext<Filter<TCurrentJson>>) => boolean, id?: string): WorkflowChain<TCurrentJson>;
|
|
105
|
+
aggregate<TOut>(aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>): WorkflowChain<TOut>;
|
|
106
|
+
aggregate<TOut>(name: string, aggregateFn: (items: Items<TCurrentJson>, ctx: NodeExecutionContext<Aggregate<TCurrentJson, TOut>>) => TOut | Promise<TOut>, id?: string): WorkflowChain<TOut>;
|
|
107
|
+
merge(): WorkflowChain<TCurrentJson>;
|
|
108
|
+
merge(cfg: Readonly<{
|
|
109
|
+
mode: MergeMode;
|
|
110
|
+
prefer?: ReadonlyArray<string>;
|
|
111
|
+
}>, id?: string): WorkflowChain<TCurrentJson>;
|
|
112
|
+
merge(name: string, cfg?: Readonly<{
|
|
113
|
+
mode: MergeMode;
|
|
114
|
+
prefer?: ReadonlyArray<string>;
|
|
115
|
+
}>, id?: string): WorkflowChain<TCurrentJson>;
|
|
116
|
+
if<TBranchJson>(predicate: (item: TCurrentJson) => boolean, branches: Readonly<{
|
|
117
|
+
true?: BranchCallback<TCurrentJson, TBranchJson>;
|
|
118
|
+
false?: BranchCallback<TCurrentJson, TBranchJson>;
|
|
119
|
+
}>): WorkflowChain<TBranchJson>;
|
|
120
|
+
if<TBranchJson>(name: string, predicate: (item: TCurrentJson) => boolean, branches: Readonly<{
|
|
121
|
+
true?: BranchCallback<TCurrentJson, TBranchJson>;
|
|
122
|
+
false?: BranchCallback<TCurrentJson, TBranchJson>;
|
|
123
|
+
}>): WorkflowChain<TBranchJson>;
|
|
124
|
+
route<TBranchJson>(branches: Readonly<Record<string, RouteBranchCallback<TCurrentJson, TBranchJson> | undefined>>): WorkflowChain<TBranchJson>;
|
|
125
|
+
switch<TBranchJson>(cfg: Readonly<{
|
|
126
|
+
cases: readonly string[];
|
|
127
|
+
defaultCase: string;
|
|
128
|
+
resolveCaseKey: (item: TCurrentJson) => string | Promise<string>;
|
|
129
|
+
branches: Readonly<Record<string, RouteBranchCallback<TCurrentJson, TBranchJson> | undefined>>;
|
|
130
|
+
}>): WorkflowChain<TBranchJson>;
|
|
131
|
+
switch<TBranchJson>(name: string, cfg: Readonly<{
|
|
132
|
+
cases: readonly string[];
|
|
133
|
+
defaultCase: string;
|
|
134
|
+
resolveCaseKey: (item: TCurrentJson) => string | Promise<string>;
|
|
135
|
+
branches: Readonly<Record<string, RouteBranchCallback<TCurrentJson, TBranchJson> | undefined>>;
|
|
136
|
+
}>, id?: string): WorkflowChain<TBranchJson>;
|
|
137
|
+
agent<TOutputSchema extends z.ZodTypeAny>(options: WorkflowAgentOptions<TCurrentJson, TOutputSchema>): WorkflowChain<z.output<TOutputSchema>>;
|
|
138
|
+
agent(options: WorkflowAgentOptions<TCurrentJson, undefined>): WorkflowChain<Record<string, unknown>>;
|
|
139
|
+
agent<TOutputSchema extends z.ZodTypeAny>(name: string, options: WorkflowAgentOptions<TCurrentJson, TOutputSchema | undefined>): WorkflowChain<TOutputSchema extends z.ZodTypeAny ? z.output<TOutputSchema> : Record<string, unknown>>;
|
|
140
|
+
node<TConfig extends Record<string, unknown>, TOutputJson>(definitionOrKey: DefinedNode<string, TConfig, TCurrentJson, TOutputJson> | string, config: TConfig, name?: string, id?: string): WorkflowChain<TOutputJson>;
|
|
141
|
+
build(): WorkflowDefinition;
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region ../core-nodes/src/workflowAuthoring/WorkflowAuthoringBuilder.types.d.ts
|
|
145
|
+
declare class WorkflowAuthoringBuilder {
|
|
146
|
+
private readonly id;
|
|
147
|
+
private readonly workflowName;
|
|
148
|
+
constructor(id: string, workflowName?: string);
|
|
149
|
+
name(name: string): WorkflowAuthoringBuilder;
|
|
150
|
+
manualTrigger<TOutputJson>(defaultItems: TOutputJson | ReadonlyArray<TOutputJson>): WorkflowChain<TOutputJson>;
|
|
151
|
+
manualTrigger<TOutputJson>(name: string, defaultItems?: TOutputJson | ReadonlyArray<TOutputJson>, id?: string): WorkflowChain<TOutputJson>;
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region ../core-nodes/src/workflowAuthoring.types.d.ts
|
|
155
|
+
declare function workflow(id: string): WorkflowAuthoringBuilder;
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/presentation/config/CodemationAuthoring.types.d.ts
|
|
158
|
+
interface FriendlyCodemationDatabaseConfig {
|
|
159
|
+
readonly kind: "postgresql" | "sqlite";
|
|
160
|
+
readonly url?: string;
|
|
161
|
+
readonly filePath?: string;
|
|
162
|
+
}
|
|
163
|
+
interface FriendlyCodemationExecutionConfig {
|
|
164
|
+
readonly mode?: "inline" | "queue";
|
|
165
|
+
readonly queuePrefix?: string;
|
|
166
|
+
readonly workerQueues?: ReadonlyArray<string>;
|
|
167
|
+
readonly redisUrl?: string;
|
|
168
|
+
}
|
|
169
|
+
interface DefineCodemationAppOptions extends Omit<CodemationConfig, "app" | "credentialTypes" | "register" | "whitelabel" | "auth"> {
|
|
170
|
+
readonly name?: string;
|
|
171
|
+
readonly auth?: CodemationConfig["auth"];
|
|
172
|
+
readonly database?: FriendlyCodemationDatabaseConfig;
|
|
173
|
+
readonly execution?: FriendlyCodemationExecutionConfig;
|
|
174
|
+
readonly nodes?: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>>;
|
|
175
|
+
readonly credentialTypes?: ReadonlyArray<AnyCredentialType>;
|
|
176
|
+
readonly credentials?: ReadonlyArray<AnyCredentialType>;
|
|
177
|
+
readonly register?: (context: CodemationAppContext) => void;
|
|
178
|
+
readonly whitelabel?: CodemationWhitelabelConfig;
|
|
179
|
+
}
|
|
180
|
+
interface DefinePluginOptions {
|
|
181
|
+
readonly name?: string;
|
|
182
|
+
readonly pluginPackageId?: string;
|
|
183
|
+
readonly nodes?: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>>;
|
|
184
|
+
readonly credentials?: ReadonlyArray<AnyCredentialType>;
|
|
185
|
+
readonly register?: (context: CodemationPluginContext) => void | Promise<void>;
|
|
186
|
+
readonly sandbox?: DefineCodemationAppOptions & Readonly<{
|
|
187
|
+
workflows?: ReadonlyArray<WorkflowDefinition>;
|
|
188
|
+
}>;
|
|
189
|
+
}
|
|
190
|
+
declare function defineCodemationApp(options: DefineCodemationAppOptions): CodemationConfig;
|
|
191
|
+
declare function definePlugin(options: DefinePluginOptions): CodemationPlugin & Readonly<{
|
|
192
|
+
sandbox?: DefinePluginOptions["sandbox"];
|
|
193
|
+
}>;
|
|
194
|
+
//#endregion
|
|
195
|
+
export { defineCodemationApp as a, FriendlyCodemationExecutionConfig as i, DefinePluginOptions as n, definePlugin as o, FriendlyCodemationDatabaseConfig as r, workflow as s, DefineCodemationAppOptions as t };
|
|
196
|
+
//# sourceMappingURL=CodemationAuthoring.types-CXubuYvd.d.ts.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
//#region src/presentation/config/CodemationAuthoring.types.ts
|
|
2
|
+
var CodemationAuthoringConfigFactory = class {
|
|
3
|
+
static createApp(options) {
|
|
4
|
+
const appDefinition = this.createAppDefinition(options);
|
|
5
|
+
const credentialTypes = [...options.credentialTypes ?? [], ...options.credentials ?? []];
|
|
6
|
+
const register = this.composeAppRegister(options.register, options.nodes);
|
|
7
|
+
const { workflows, workflowDiscovery, plugins, runtime, log } = options;
|
|
8
|
+
return {
|
|
9
|
+
workflows,
|
|
10
|
+
workflowDiscovery,
|
|
11
|
+
plugins,
|
|
12
|
+
runtime,
|
|
13
|
+
log,
|
|
14
|
+
app: appDefinition,
|
|
15
|
+
credentialTypes,
|
|
16
|
+
register
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static createPlugin(options) {
|
|
20
|
+
return {
|
|
21
|
+
pluginPackageId: options.pluginPackageId,
|
|
22
|
+
sandbox: options.sandbox,
|
|
23
|
+
async register(context) {
|
|
24
|
+
for (const nodeDefinition of options.nodes ?? []) nodeDefinition.register(context);
|
|
25
|
+
for (const credential of options.credentials ?? []) context.registerCredentialType(credential);
|
|
26
|
+
await options.register?.(context);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static createAppDefinition(options) {
|
|
31
|
+
const scheduler = this.createSchedulerConfig(options.execution);
|
|
32
|
+
const database = this.createDatabaseConfig(options.database);
|
|
33
|
+
const whitelabel = this.createWhitelabel(options.name, options.whitelabel);
|
|
34
|
+
if (!options.auth && !database && !scheduler && !whitelabel) return;
|
|
35
|
+
return {
|
|
36
|
+
auth: options.auth,
|
|
37
|
+
database,
|
|
38
|
+
scheduler,
|
|
39
|
+
whitelabel
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
static createDatabaseConfig(database) {
|
|
43
|
+
if (!database) return;
|
|
44
|
+
if (database.kind === "sqlite") return {
|
|
45
|
+
kind: "sqlite",
|
|
46
|
+
sqliteFilePath: database.filePath
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
kind: "postgresql",
|
|
50
|
+
url: database.url
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
static createSchedulerConfig(execution) {
|
|
54
|
+
if (!execution) return;
|
|
55
|
+
return {
|
|
56
|
+
kind: execution.mode,
|
|
57
|
+
queuePrefix: execution.queuePrefix,
|
|
58
|
+
workerQueues: execution.workerQueues,
|
|
59
|
+
redisUrl: execution.redisUrl
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
static createWhitelabel(name, whitelabel) {
|
|
63
|
+
if (!name && !whitelabel) return;
|
|
64
|
+
return {
|
|
65
|
+
productName: name ?? whitelabel?.productName,
|
|
66
|
+
logoPath: whitelabel?.logoPath
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
static composeAppRegister(register, nodes) {
|
|
70
|
+
if (!register && (!nodes || nodes.length === 0)) return;
|
|
71
|
+
return (context) => {
|
|
72
|
+
for (const nodeDefinition of nodes ?? []) nodeDefinition.register(context);
|
|
73
|
+
register?.(context);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
function defineCodemationApp(options) {
|
|
78
|
+
return CodemationAuthoringConfigFactory.createApp(options);
|
|
79
|
+
}
|
|
80
|
+
function definePlugin(options) {
|
|
81
|
+
return CodemationAuthoringConfigFactory.createPlugin(options);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
export { definePlugin as n, defineCodemationApp as t };
|
|
86
|
+
//# sourceMappingURL=CodemationAuthoring.types-SxVJ1qu5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodemationAuthoring.types-SxVJ1qu5.js","names":[],"sources":["../src/presentation/config/CodemationAuthoring.types.ts"],"sourcesContent":["import type { AnyCredentialType, DefinedNode, WorkflowDefinition } from \"@codemation/core\";\nimport type { CodemationAppContext } from \"./CodemationAppContext\";\nimport type {\n CodemationAppDefinition,\n CodemationAppSchedulerConfig,\n CodemationConfig,\n CodemationDatabaseConfig,\n} from \"./CodemationConfig\";\nimport type { CodemationPlugin, CodemationPluginContext } from \"./CodemationPlugin\";\nimport type { CodemationWhitelabelConfig } from \"./CodemationWhitelabelConfig\";\n\nexport interface FriendlyCodemationDatabaseConfig {\n readonly kind: \"postgresql\" | \"sqlite\";\n readonly url?: string;\n readonly filePath?: string;\n}\n\nexport interface FriendlyCodemationExecutionConfig {\n readonly mode?: \"inline\" | \"queue\";\n readonly queuePrefix?: string;\n readonly workerQueues?: ReadonlyArray<string>;\n readonly redisUrl?: string;\n}\n\nexport interface DefineCodemationAppOptions extends Omit<\n CodemationConfig,\n \"app\" | \"credentialTypes\" | \"register\" | \"whitelabel\" | \"auth\"\n> {\n readonly name?: string;\n readonly auth?: CodemationConfig[\"auth\"];\n readonly database?: FriendlyCodemationDatabaseConfig;\n readonly execution?: FriendlyCodemationExecutionConfig;\n readonly nodes?: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>>;\n readonly credentialTypes?: ReadonlyArray<AnyCredentialType>;\n readonly credentials?: ReadonlyArray<AnyCredentialType>;\n readonly register?: (context: CodemationAppContext) => void;\n readonly whitelabel?: CodemationWhitelabelConfig;\n}\n\nexport interface DefinePluginOptions {\n readonly name?: string;\n readonly pluginPackageId?: string;\n readonly nodes?: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>>;\n readonly credentials?: ReadonlyArray<AnyCredentialType>;\n readonly register?: (context: CodemationPluginContext) => void | Promise<void>;\n readonly sandbox?: DefineCodemationAppOptions & Readonly<{ workflows?: ReadonlyArray<WorkflowDefinition> }>;\n}\n\nclass CodemationAuthoringConfigFactory {\n static createApp(options: DefineCodemationAppOptions): CodemationConfig {\n const appDefinition = this.createAppDefinition(options);\n const credentialTypes = [...(options.credentialTypes ?? []), ...(options.credentials ?? [])];\n const register = this.composeAppRegister(options.register, options.nodes);\n const { workflows, workflowDiscovery, plugins, runtime, log } = options;\n return {\n workflows,\n workflowDiscovery,\n plugins,\n runtime,\n log,\n app: appDefinition,\n credentialTypes,\n register,\n };\n }\n\n static createPlugin(\n options: DefinePluginOptions,\n ): CodemationPlugin & Readonly<{ sandbox?: DefinePluginOptions[\"sandbox\"] }> {\n return {\n pluginPackageId: options.pluginPackageId,\n sandbox: options.sandbox,\n async register(context: CodemationPluginContext): Promise<void> {\n for (const nodeDefinition of options.nodes ?? []) {\n nodeDefinition.register(context);\n }\n for (const credential of options.credentials ?? []) {\n context.registerCredentialType(credential);\n }\n await options.register?.(context);\n },\n };\n }\n\n private static createAppDefinition(options: DefineCodemationAppOptions): CodemationAppDefinition | undefined {\n const scheduler = this.createSchedulerConfig(options.execution);\n const database = this.createDatabaseConfig(options.database);\n const whitelabel = this.createWhitelabel(options.name, options.whitelabel);\n if (!options.auth && !database && !scheduler && !whitelabel) {\n return undefined;\n }\n return {\n auth: options.auth,\n database,\n scheduler,\n whitelabel,\n };\n }\n\n private static createDatabaseConfig(\n database: FriendlyCodemationDatabaseConfig | undefined,\n ): CodemationDatabaseConfig | undefined {\n if (!database) {\n return undefined;\n }\n if (database.kind === \"sqlite\") {\n return {\n kind: \"sqlite\",\n sqliteFilePath: database.filePath,\n };\n }\n return {\n kind: \"postgresql\",\n url: database.url,\n };\n }\n\n private static createSchedulerConfig(\n execution: FriendlyCodemationExecutionConfig | undefined,\n ): CodemationAppSchedulerConfig | undefined {\n if (!execution) {\n return undefined;\n }\n return {\n kind: execution.mode,\n queuePrefix: execution.queuePrefix,\n workerQueues: execution.workerQueues,\n redisUrl: execution.redisUrl,\n };\n }\n\n private static createWhitelabel(\n name: string | undefined,\n whitelabel: CodemationWhitelabelConfig | undefined,\n ): CodemationWhitelabelConfig | undefined {\n if (!name && !whitelabel) {\n return undefined;\n }\n return {\n productName: name ?? whitelabel?.productName,\n logoPath: whitelabel?.logoPath,\n };\n }\n\n private static composeAppRegister(\n register: ((context: CodemationAppContext) => void) | undefined,\n nodes: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>> | undefined,\n ): ((context: CodemationAppContext) => void) | undefined {\n if (!register && (!nodes || nodes.length === 0)) {\n return undefined;\n }\n return (context: CodemationAppContext) => {\n for (const nodeDefinition of nodes ?? []) {\n nodeDefinition.register(context);\n }\n register?.(context);\n };\n }\n}\n\nexport function defineCodemationApp(options: DefineCodemationAppOptions): CodemationConfig {\n return CodemationAuthoringConfigFactory.createApp(options);\n}\n\nexport function definePlugin(\n options: DefinePluginOptions,\n): CodemationPlugin & Readonly<{ sandbox?: DefinePluginOptions[\"sandbox\"] }> {\n return CodemationAuthoringConfigFactory.createPlugin(options);\n}\n"],"mappings":";AAgDA,IAAM,mCAAN,MAAuC;CACrC,OAAO,UAAU,SAAuD;EACtE,MAAM,gBAAgB,KAAK,oBAAoB,QAAQ;EACvD,MAAM,kBAAkB,CAAC,GAAI,QAAQ,mBAAmB,EAAE,EAAG,GAAI,QAAQ,eAAe,EAAE,CAAE;EAC5F,MAAM,WAAW,KAAK,mBAAmB,QAAQ,UAAU,QAAQ,MAAM;EACzE,MAAM,EAAE,WAAW,mBAAmB,SAAS,SAAS,QAAQ;AAChE,SAAO;GACL;GACA;GACA;GACA;GACA;GACA,KAAK;GACL;GACA;GACD;;CAGH,OAAO,aACL,SAC2E;AAC3E,SAAO;GACL,iBAAiB,QAAQ;GACzB,SAAS,QAAQ;GACjB,MAAM,SAAS,SAAiD;AAC9D,SAAK,MAAM,kBAAkB,QAAQ,SAAS,EAAE,CAC9C,gBAAe,SAAS,QAAQ;AAElC,SAAK,MAAM,cAAc,QAAQ,eAAe,EAAE,CAChD,SAAQ,uBAAuB,WAAW;AAE5C,UAAM,QAAQ,WAAW,QAAQ;;GAEpC;;CAGH,OAAe,oBAAoB,SAA0E;EAC3G,MAAM,YAAY,KAAK,sBAAsB,QAAQ,UAAU;EAC/D,MAAM,WAAW,KAAK,qBAAqB,QAAQ,SAAS;EAC5D,MAAM,aAAa,KAAK,iBAAiB,QAAQ,MAAM,QAAQ,WAAW;AAC1E,MAAI,CAAC,QAAQ,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC,WAC/C;AAEF,SAAO;GACL,MAAM,QAAQ;GACd;GACA;GACA;GACD;;CAGH,OAAe,qBACb,UACsC;AACtC,MAAI,CAAC,SACH;AAEF,MAAI,SAAS,SAAS,SACpB,QAAO;GACL,MAAM;GACN,gBAAgB,SAAS;GAC1B;AAEH,SAAO;GACL,MAAM;GACN,KAAK,SAAS;GACf;;CAGH,OAAe,sBACb,WAC0C;AAC1C,MAAI,CAAC,UACH;AAEF,SAAO;GACL,MAAM,UAAU;GAChB,aAAa,UAAU;GACvB,cAAc,UAAU;GACxB,UAAU,UAAU;GACrB;;CAGH,OAAe,iBACb,MACA,YACwC;AACxC,MAAI,CAAC,QAAQ,CAAC,WACZ;AAEF,SAAO;GACL,aAAa,QAAQ,YAAY;GACjC,UAAU,YAAY;GACvB;;CAGH,OAAe,mBACb,UACA,OACuD;AACvD,MAAI,CAAC,aAAa,CAAC,SAAS,MAAM,WAAW,GAC3C;AAEF,UAAQ,YAAkC;AACxC,QAAK,MAAM,kBAAkB,SAAS,EAAE,CACtC,gBAAe,SAAS,QAAQ;AAElC,cAAW,QAAQ;;;;AAKzB,SAAgB,oBAAoB,SAAuD;AACzF,QAAO,iCAAiC,UAAU,QAAQ;;AAG5D,SAAgB,aACd,SAC2E;AAC3E,QAAO,iCAAiC,aAAa,QAAQ"}
|
package/dist/{CodemationConfigNormalizer-DIc-LYqW.d.ts → CodemationConfigNormalizer-kJmyHNDp.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CodemationContainerRegistration,
|
|
1
|
+
import { C as CodemationContainerRegistration, m as CodemationConfig } from "./CodemationAppContext-Vtn0U2Ga.js";
|
|
2
2
|
|
|
3
3
|
//#region src/presentation/config/CodemationConfigNormalizer.d.ts
|
|
4
4
|
type NormalizedCodemationConfig = CodemationConfig & Readonly<{
|
|
@@ -6,4 +6,4 @@ type NormalizedCodemationConfig = CodemationConfig & Readonly<{
|
|
|
6
6
|
}>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { NormalizedCodemationConfig as t };
|
|
9
|
-
//# sourceMappingURL=CodemationConfigNormalizer-
|
|
9
|
+
//# sourceMappingURL=CodemationConfigNormalizer-kJmyHNDp.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as NormalizedCodemationConfig } from "./CodemationConfigNormalizer-
|
|
1
|
+
import { t as NormalizedCodemationConfig } from "./CodemationConfigNormalizer-kJmyHNDp.js";
|
|
2
2
|
|
|
3
3
|
//#region src/presentation/server/CodemationConsumerAppResolver.d.ts
|
|
4
4
|
type CodemationConsumerApp = Readonly<{
|
|
@@ -63,4 +63,4 @@ declare class CodemationConsumerConfigLoader {
|
|
|
63
63
|
}
|
|
64
64
|
//#endregion
|
|
65
65
|
export { CodemationConsumerAppResolver as i, CodemationConsumerConfigResolution as n, CodemationConsumerApp as r, CodemationConsumerConfigLoader as t };
|
|
66
|
-
//# sourceMappingURL=CodemationConsumerConfigLoader-
|
|
66
|
+
//# sourceMappingURL=CodemationConsumerConfigLoader-BvTE-7tX.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as logLevelPolicyFactory, t as ServerLoggerFactory } from "./ServerLoggerFactory-
|
|
1
|
+
import { s as logLevelPolicyFactory, t as ServerLoggerFactory } from "./ServerLoggerFactory-CsNW5qhz.js";
|
|
2
2
|
import { access, readdir, stat } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
@@ -490,4 +490,4 @@ var CodemationConsumerConfigLoader = class CodemationConsumerConfigLoader {
|
|
|
490
490
|
|
|
491
491
|
//#endregion
|
|
492
492
|
export { CodemationConfigNormalizer as a, CodemationConsumerAppResolver as i, WorkflowDiscoveryPathSegmentsComputer as n, WorkflowModulePathFinder as r, CodemationConsumerConfigLoader as t };
|
|
493
|
-
//# sourceMappingURL=CodemationConsumerConfigLoader-
|
|
493
|
+
//# sourceMappingURL=CodemationConsumerConfigLoader-DovlxZNb.js.map
|