@codemation/host 0.0.15 → 0.0.18
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 +11 -0
- package/LICENSE +37 -0
- package/dist/{AppConfigFactory-DmHOpg8O.d.ts → AppConfigFactory-Co4STjwt.d.ts} +5 -3
- package/dist/{AppConfigFactory-DWIz2hy-.js → AppConfigFactory-DxoZ4v8r.js} +40 -3
- package/dist/AppConfigFactory-DxoZ4v8r.js.map +1 -0
- package/dist/{AppContainerFactory-B5eRpvAa.js → AppContainerFactory-z9aUDFiJ.js} +275 -105
- package/dist/AppContainerFactory-z9aUDFiJ.js.map +1 -0
- package/dist/{CodemationConfig-D2ULNkec.d.ts → CodemationConfig-COs4GcOE.d.ts} +18 -10
- package/dist/{CodemationConfigNormalizer-CBLxXaRV.d.ts → CodemationConfigNormalizer-B7w1JA_2.d.ts} +2 -2
- package/dist/{CodemationConsumerConfigLoader-BBzAr6L_.js → CodemationConsumerConfigLoader-C_ISRrpI.js} +28 -7
- package/dist/CodemationConsumerConfigLoader-C_ISRrpI.js.map +1 -0
- package/dist/{CodemationConsumerConfigLoader-BLvzcfb7.d.ts → CodemationConsumerConfigLoader-OlXKw-us.d.ts} +6 -2
- package/dist/CodemationPluginListMerger-CGwOTdZ7.js +57 -0
- package/dist/CodemationPluginListMerger-CGwOTdZ7.js.map +1 -0
- package/dist/{CodemationPluginListMerger-B0-e4CJ6.d.ts → CodemationPluginListMerger-_ZIiOQxB.d.ts} +79 -117
- package/dist/{CredentialServices-BeuMtqYA.d.ts → CredentialServices-D3VTczpC.d.ts} +3 -3
- package/dist/PublicFrontendBootstrap-p7mS8aWG.d.ts +50 -0
- package/dist/{FrontendAppConfigFactory-Bj-DZNlt.d.ts → PublicFrontendBootstrapFactory-CE4oGogq.d.ts} +19 -4
- package/dist/{FrontendAppConfigJsonCodec-nOCQI0ag.js → PublicFrontendBootstrapJsonCodec-BdiVGG5R.js} +76 -2
- package/dist/PublicFrontendBootstrapJsonCodec-BdiVGG5R.js.map +1 -0
- package/dist/PublicFrontendBootstrapJsonCodec-DjkkKXcq.d.ts +35 -0
- package/dist/client.d.ts +3 -3
- package/dist/client.js +2 -2
- package/dist/consumer.d.ts +4 -4
- package/dist/consumer.js +1 -1
- package/dist/credentials.d.ts +3 -3
- package/dist/devServerSidecar.d.ts +1 -1
- package/dist/{index-CkiptHb-.d.ts → index-DbYzycTC.d.ts} +215 -71
- package/dist/index.d.ts +150 -13
- package/dist/index.js +94 -8
- package/dist/index.js.map +1 -0
- package/dist/nextServer.d.ts +30 -9
- package/dist/nextServer.js +4 -4
- package/dist/{persistenceServer-DVeWUbc3.js → persistenceServer-C4L1uMKn.js} +2 -2
- package/dist/{persistenceServer-DVeWUbc3.js.map → persistenceServer-C4L1uMKn.js.map} +1 -1
- package/dist/{persistenceServer-CaehMh3M.d.ts → persistenceServer-Cr-zCuEr.d.ts} +2 -2
- package/dist/persistenceServer.d.ts +5 -5
- package/dist/persistenceServer.js +2 -2
- package/dist/{server-Dyo8qh4k.d.ts → server-B6k53aZj.d.ts} +14 -19
- package/dist/{server-C65z_kqm.js → server-DDVXr7BN.js} +42 -25
- package/dist/server-DDVXr7BN.js.map +1 -0
- package/dist/server.d.ts +11 -11
- package/dist/server.js +7 -7
- package/package.json +9 -6
- package/playwright.scaffolded-dev.config.ts +46 -0
- package/src/application/dev/BootRuntimeSummary.types.ts +2 -0
- package/src/application/dev/DevBootstrapSummaryAssembler.ts +1 -0
- package/src/application/dev/DevBootstrapSummaryJson.types.ts +6 -0
- package/src/bootstrap/AppContainerFactory.ts +101 -6
- package/src/bootstrap/runtime/AppConfigFactory.ts +22 -2
- package/src/client.ts +4 -0
- package/src/index.ts +21 -5
- package/src/infrastructure/config/CodemationPluginRegistrar.ts +6 -0
- package/src/infrastructure/di/HandlesCommandRegistry.ts +1 -10
- package/src/infrastructure/di/HandlesQueryRegistry.ts +1 -10
- package/src/nextServer.ts +4 -0
- package/src/presentation/config/AppConfig.ts +6 -0
- package/src/presentation/config/CodemationAuthoring.types.ts +169 -0
- package/src/presentation/config/CodemationPackageManifest.ts +1 -7
- package/src/presentation/config/CodemationPlugin.ts +45 -8
- package/src/presentation/config/CodemationPluginListMerger.ts +30 -26
- package/src/presentation/frontend/CodemationFrontendAuthSnapshotFactory.ts +7 -0
- package/src/presentation/frontend/InternalAuthBootstrap.ts +12 -0
- package/src/presentation/frontend/InternalAuthBootstrapFactory.ts +26 -0
- package/src/presentation/frontend/InternalAuthBootstrapJsonCodec.ts +49 -0
- package/src/presentation/frontend/PublicFrontendBootstrap.ts +12 -0
- package/src/presentation/frontend/PublicFrontendBootstrapFactory.ts +23 -0
- package/src/presentation/frontend/PublicFrontendBootstrapJsonCodec.ts +48 -0
- package/src/presentation/http/ApiPaths.ts +10 -0
- package/src/presentation/http/hono/HonoHttpAnonymousRoutePolicyRegistry.ts +3 -0
- package/src/presentation/http/hono/registrars/BootstrapHonoApiRouteRegistrar.ts +32 -0
- package/src/presentation/http/routeHandlers/InternalAuthBootstrapHttpRouteHandler.ts +18 -0
- package/src/presentation/http/routeHandlers/PublicFrontendBootstrapHttpRouteHandler.ts +18 -0
- package/src/presentation/server/CodemationConsumerConfigLoader.ts +28 -6
- package/src/presentation/server/CodemationPluginDiscovery.ts +59 -28
- package/src/server.ts +6 -0
- package/dist/AppConfigFactory-DWIz2hy-.js.map +0 -1
- package/dist/AppContainerFactory-B5eRpvAa.js.map +0 -1
- package/dist/CodemationConsumerConfigLoader-BBzAr6L_.js.map +0 -1
- package/dist/CodemationPluginListMerger-DrVOw9KP.js +0 -57
- package/dist/CodemationPluginListMerger-DrVOw9KP.js.map +0 -1
- package/dist/FrontendAppConfig-D50wjj_n.d.ts +0 -27
- package/dist/FrontendAppConfigJsonCodec-1_L7H_Qo.d.ts +0 -20
- package/dist/FrontendAppConfigJsonCodec-nOCQI0ag.js.map +0 -1
- package/dist/server-C65z_kqm.js.map +0 -1
|
@@ -22,12 +22,52 @@ import {
|
|
|
22
22
|
WorkflowRepositoryWebhookTriggerMatcher,
|
|
23
23
|
} from "@codemation/core/bootstrap";
|
|
24
24
|
import { AIAgentConnectionWorkflowExpander, ConnectionCredentialNodeConfigFactory } from "@codemation/core-nodes";
|
|
25
|
-
import
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
import {
|
|
26
|
+
CreateCredentialInstanceCommandHandler,
|
|
27
|
+
DeleteCredentialInstanceCommandHandler,
|
|
28
|
+
TestCredentialInstanceCommandHandler,
|
|
29
|
+
UpdateCredentialInstanceCommandHandler,
|
|
30
|
+
UpsertCredentialBindingCommandHandler,
|
|
31
|
+
} from "../application/commands/CredentialCommandHandlers";
|
|
32
|
+
import {
|
|
33
|
+
AcceptUserInviteCommandHandler,
|
|
34
|
+
InviteUserCommandHandler,
|
|
35
|
+
RegenerateUserInviteCommandHandler,
|
|
36
|
+
UpdateUserAccountStatusCommandHandler,
|
|
37
|
+
UpsertLocalBootstrapUserCommandHandler,
|
|
38
|
+
} from "../application/commands/UserAccountCommandHandlers";
|
|
39
|
+
import {
|
|
40
|
+
CopyRunToWorkflowDebuggerCommandHandler,
|
|
41
|
+
HandleWebhookInvocationCommandHandler,
|
|
42
|
+
ReplaceMutableRunWorkflowSnapshotCommandHandler,
|
|
43
|
+
ReplaceWorkflowDebuggerOverlayCommandHandler,
|
|
44
|
+
ReplayWorkflowNodeCommandHandler,
|
|
45
|
+
SetPinnedNodeInputCommandHandler,
|
|
46
|
+
SetWorkflowActivationCommandHandler,
|
|
47
|
+
StartWorkflowRunCommandHandler,
|
|
48
|
+
UploadOverlayPinnedBinaryCommandHandler,
|
|
49
|
+
} from "../application/commands/WorkflowCommandHandlers";
|
|
50
|
+
import {
|
|
51
|
+
GetCredentialFieldEnvStatusQueryHandler,
|
|
52
|
+
GetCredentialInstanceQueryHandler,
|
|
53
|
+
GetCredentialInstanceWithSecretsQueryHandler,
|
|
54
|
+
GetWorkflowCredentialHealthQueryHandler,
|
|
55
|
+
ListCredentialInstancesQueryHandler,
|
|
56
|
+
ListCredentialTypesQueryHandler,
|
|
57
|
+
} from "../application/queries/CredentialQueryHandlers";
|
|
58
|
+
import {
|
|
59
|
+
ListUserAccountsQueryHandler,
|
|
60
|
+
VerifyUserInviteQueryHandler,
|
|
61
|
+
} from "../application/queries/UserAccountQueryHandlers";
|
|
62
|
+
import {
|
|
63
|
+
GetRunBinaryAttachmentQueryHandler,
|
|
64
|
+
GetRunStateQueryHandler,
|
|
65
|
+
GetWorkflowDebuggerOverlayQueryHandler,
|
|
66
|
+
GetWorkflowDetailQueryHandler,
|
|
67
|
+
GetWorkflowOverlayBinaryAttachmentQueryHandler,
|
|
68
|
+
GetWorkflowSummariesQueryHandler,
|
|
69
|
+
ListWorkflowRunsQueryHandler,
|
|
70
|
+
} from "../application/queries/WorkflowQueryHandlers";
|
|
31
71
|
import { OpenAiApiKeyCredentialHealthTester } from "../infrastructure/credentials/OpenAiApiKeyCredentialHealthTester";
|
|
32
72
|
import { OpenAiApiKeyCredentialTypeFactory } from "../infrastructure/credentials/OpenAiApiKeyCredentialTypeFactory";
|
|
33
73
|
import { CodemationPluginRegistrar } from "../infrastructure/config/CodemationPluginRegistrar";
|
|
@@ -61,10 +101,15 @@ import { WorkflowPolicyUiPresentationFactory } from "../application/mapping/Work
|
|
|
61
101
|
import { WorkflowWebsocketServer } from "../presentation/websocket/WorkflowWebsocketServer";
|
|
62
102
|
import { CodemationFrontendAuthSnapshotFactory } from "../presentation/frontend/CodemationFrontendAuthSnapshotFactory";
|
|
63
103
|
import { FrontendAppConfigFactory } from "../presentation/frontend/FrontendAppConfigFactory";
|
|
104
|
+
import { InternalAuthBootstrapFactory } from "../presentation/frontend/InternalAuthBootstrapFactory";
|
|
105
|
+
import { PublicFrontendBootstrapFactory } from "../presentation/frontend/PublicFrontendBootstrapFactory";
|
|
64
106
|
import { DevBootstrapSummaryHttpRouteHandler } from "../presentation/http/routeHandlers/DevBootstrapSummaryHttpRouteHandler";
|
|
107
|
+
import { InternalAuthBootstrapHttpRouteHandler } from "../presentation/http/routeHandlers/InternalAuthBootstrapHttpRouteHandler";
|
|
108
|
+
import { PublicFrontendBootstrapHttpRouteHandler } from "../presentation/http/routeHandlers/PublicFrontendBootstrapHttpRouteHandler";
|
|
65
109
|
import { WhitelabelLogoHttpRouteHandler } from "../presentation/http/routeHandlers/WhitelabelLogoHttpRouteHandler";
|
|
66
110
|
import { CodemationHonoApiApp } from "../presentation/http/hono/CodemationHonoApiAppFactory";
|
|
67
111
|
import { BinaryHonoApiRouteRegistrar } from "../presentation/http/hono/registrars/BinaryHonoApiRouteRegistrar";
|
|
112
|
+
import { BootstrapHonoApiRouteRegistrar } from "../presentation/http/hono/registrars/BootstrapHonoApiRouteRegistrar";
|
|
68
113
|
import { CredentialHonoApiRouteRegistrar } from "../presentation/http/hono/registrars/CredentialHonoApiRouteRegistrar";
|
|
69
114
|
import { DevHonoApiRouteRegistrar } from "../presentation/http/hono/registrars/DevHonoApiRouteRegistrar";
|
|
70
115
|
import { OAuth2HonoApiRouteRegistrar } from "../presentation/http/hono/registrars/OAuth2HonoApiRouteRegistrar";
|
|
@@ -124,8 +169,47 @@ type PrismaOwnership = Readonly<{
|
|
|
124
169
|
}>;
|
|
125
170
|
|
|
126
171
|
export class AppContainerFactory {
|
|
172
|
+
private static readonly queryHandlers = [
|
|
173
|
+
GetCredentialFieldEnvStatusQueryHandler,
|
|
174
|
+
GetCredentialInstanceQueryHandler,
|
|
175
|
+
GetCredentialInstanceWithSecretsQueryHandler,
|
|
176
|
+
GetWorkflowCredentialHealthQueryHandler,
|
|
177
|
+
ListCredentialInstancesQueryHandler,
|
|
178
|
+
ListCredentialTypesQueryHandler,
|
|
179
|
+
ListUserAccountsQueryHandler,
|
|
180
|
+
VerifyUserInviteQueryHandler,
|
|
181
|
+
GetRunBinaryAttachmentQueryHandler,
|
|
182
|
+
GetRunStateQueryHandler,
|
|
183
|
+
GetWorkflowDebuggerOverlayQueryHandler,
|
|
184
|
+
GetWorkflowDetailQueryHandler,
|
|
185
|
+
GetWorkflowOverlayBinaryAttachmentQueryHandler,
|
|
186
|
+
GetWorkflowSummariesQueryHandler,
|
|
187
|
+
ListWorkflowRunsQueryHandler,
|
|
188
|
+
] as const;
|
|
189
|
+
private static readonly commandHandlers = [
|
|
190
|
+
CreateCredentialInstanceCommandHandler,
|
|
191
|
+
DeleteCredentialInstanceCommandHandler,
|
|
192
|
+
TestCredentialInstanceCommandHandler,
|
|
193
|
+
UpdateCredentialInstanceCommandHandler,
|
|
194
|
+
UpsertCredentialBindingCommandHandler,
|
|
195
|
+
AcceptUserInviteCommandHandler,
|
|
196
|
+
InviteUserCommandHandler,
|
|
197
|
+
RegenerateUserInviteCommandHandler,
|
|
198
|
+
UpdateUserAccountStatusCommandHandler,
|
|
199
|
+
UpsertLocalBootstrapUserCommandHandler,
|
|
200
|
+
CopyRunToWorkflowDebuggerCommandHandler,
|
|
201
|
+
HandleWebhookInvocationCommandHandler,
|
|
202
|
+
ReplaceMutableRunWorkflowSnapshotCommandHandler,
|
|
203
|
+
ReplaceWorkflowDebuggerOverlayCommandHandler,
|
|
204
|
+
ReplayWorkflowNodeCommandHandler,
|
|
205
|
+
SetPinnedNodeInputCommandHandler,
|
|
206
|
+
SetWorkflowActivationCommandHandler,
|
|
207
|
+
StartWorkflowRunCommandHandler,
|
|
208
|
+
UploadOverlayPinnedBinaryCommandHandler,
|
|
209
|
+
] as const;
|
|
127
210
|
private static readonly honoRouteRegistrars = [
|
|
128
211
|
BinaryHonoApiRouteRegistrar,
|
|
212
|
+
BootstrapHonoApiRouteRegistrar,
|
|
129
213
|
CredentialHonoApiRouteRegistrar,
|
|
130
214
|
DevHonoApiRouteRegistrar,
|
|
131
215
|
OAuth2HonoApiRouteRegistrar,
|
|
@@ -327,6 +411,8 @@ export class AppContainerFactory {
|
|
|
327
411
|
container.register(OAuth2ConnectService, { useClass: OAuth2ConnectService });
|
|
328
412
|
container.register(CodemationFrontendAuthSnapshotFactory, { useClass: CodemationFrontendAuthSnapshotFactory });
|
|
329
413
|
container.register(FrontendAppConfigFactory, { useClass: FrontendAppConfigFactory });
|
|
414
|
+
container.register(PublicFrontendBootstrapFactory, { useClass: PublicFrontendBootstrapFactory });
|
|
415
|
+
container.register(InternalAuthBootstrapFactory, { useClass: InternalAuthBootstrapFactory });
|
|
330
416
|
container.register(DatabaseMigrations, { useClass: DatabaseMigrations });
|
|
331
417
|
container.register(FrontendRuntime, { useClass: FrontendRuntime });
|
|
332
418
|
container.register(WorkerRuntime, { useClass: WorkerRuntime });
|
|
@@ -397,6 +483,12 @@ export class AppContainerFactory {
|
|
|
397
483
|
container.register(InMemoryQueryBus, { useClass: InMemoryQueryBus });
|
|
398
484
|
container.register(InMemoryCommandBus, { useClass: InMemoryCommandBus });
|
|
399
485
|
container.register(InMemoryDomainEventBus, { useClass: InMemoryDomainEventBus });
|
|
486
|
+
for (const handler of AppContainerFactory.queryHandlers) {
|
|
487
|
+
container.register(ApplicationTokens.QueryHandler, { useClass: handler });
|
|
488
|
+
}
|
|
489
|
+
for (const handler of AppContainerFactory.commandHandlers) {
|
|
490
|
+
container.register(ApplicationTokens.CommandHandler, { useClass: handler });
|
|
491
|
+
}
|
|
400
492
|
container.register(ApplicationTokens.QueryBus, {
|
|
401
493
|
useFactory: instanceCachingFactory((dependencyContainer) => dependencyContainer.resolve(InMemoryQueryBus)),
|
|
402
494
|
});
|
|
@@ -411,6 +503,8 @@ export class AppContainerFactory {
|
|
|
411
503
|
private registerApplicationServicesAndRoutes(container: Container): void {
|
|
412
504
|
container.register(DevBootstrapSummaryAssembler, { useClass: DevBootstrapSummaryAssembler });
|
|
413
505
|
container.register(DevBootstrapSummaryHttpRouteHandler, { useClass: DevBootstrapSummaryHttpRouteHandler });
|
|
506
|
+
container.register(PublicFrontendBootstrapHttpRouteHandler, { useClass: PublicFrontendBootstrapHttpRouteHandler });
|
|
507
|
+
container.register(InternalAuthBootstrapHttpRouteHandler, { useClass: InternalAuthBootstrapHttpRouteHandler });
|
|
414
508
|
container.register(WhitelabelLogoHttpRouteHandler, { useClass: WhitelabelLogoHttpRouteHandler });
|
|
415
509
|
for (const registrar of AppContainerFactory.honoRouteRegistrars) {
|
|
416
510
|
container.register(ApplicationTokens.HonoApiRouteRegistrar, { useClass: registrar });
|
|
@@ -561,6 +655,7 @@ export class AppContainerFactory {
|
|
|
561
655
|
return {
|
|
562
656
|
databasePersistence: appConfig.persistence,
|
|
563
657
|
eventBusKind: appConfig.eventing.kind,
|
|
658
|
+
plugins: appConfig.pluginLoadSummary ?? [],
|
|
564
659
|
queuePrefix: appConfig.scheduler.queuePrefix ?? appConfig.eventing.queuePrefix ?? "codemation",
|
|
565
660
|
schedulerKind: appConfig.scheduler.kind,
|
|
566
661
|
redisUrl: appConfig.scheduler.redisUrl ?? appConfig.eventing.redisUrl,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CoreTokens } from "@codemation/core";
|
|
2
|
-
import type { AppConfig } from "../../presentation/config/AppConfig";
|
|
2
|
+
import type { AppConfig, AppPluginLoadSummary } from "../../presentation/config/AppConfig";
|
|
3
|
+
import { CodemationPluginPackageMetadata } from "../../presentation/config/CodemationPlugin";
|
|
3
4
|
import type { NormalizedCodemationConfig } from "../../presentation/config/CodemationConfigNormalizer";
|
|
4
5
|
import type {
|
|
5
6
|
CodemationApplicationRuntimeConfig,
|
|
@@ -10,6 +11,8 @@ import type {
|
|
|
10
11
|
import path from "node:path";
|
|
11
12
|
|
|
12
13
|
export class AppConfigFactory {
|
|
14
|
+
private readonly pluginPackageMetadata = new CodemationPluginPackageMetadata();
|
|
15
|
+
|
|
13
16
|
create(
|
|
14
17
|
args: Readonly<{
|
|
15
18
|
repoRoot: string;
|
|
@@ -30,6 +33,7 @@ export class AppConfigFactory {
|
|
|
30
33
|
const hasConfiguredCredentialSessionServiceRegistration = args.config.containerRegistrations.some(
|
|
31
34
|
(entry) => entry.token === CoreTokens.CredentialSessionService,
|
|
32
35
|
);
|
|
36
|
+
const plugins = [...(args.config.plugins ?? [])];
|
|
33
37
|
|
|
34
38
|
return {
|
|
35
39
|
consumerRoot: args.consumerRoot,
|
|
@@ -39,7 +43,8 @@ export class AppConfigFactory {
|
|
|
39
43
|
workflows: [...(args.config.workflows ?? [])],
|
|
40
44
|
containerRegistrations: [...args.config.containerRegistrations],
|
|
41
45
|
credentialTypes: [...(args.config.credentialTypes ?? [])],
|
|
42
|
-
plugins
|
|
46
|
+
plugins,
|
|
47
|
+
pluginLoadSummary: this.createConfiguredPluginLoadSummary(plugins),
|
|
43
48
|
hasConfiguredCredentialSessionServiceRegistration,
|
|
44
49
|
log: args.config.log,
|
|
45
50
|
engineExecutionLimits: runtimeConfig.engineExecutionLimits,
|
|
@@ -65,6 +70,21 @@ export class AppConfigFactory {
|
|
|
65
70
|
};
|
|
66
71
|
}
|
|
67
72
|
|
|
73
|
+
private createConfiguredPluginLoadSummary(plugins: AppConfig["plugins"]): AppConfig["pluginLoadSummary"] {
|
|
74
|
+
const summaries: AppPluginLoadSummary[] = [];
|
|
75
|
+
for (const plugin of plugins) {
|
|
76
|
+
const packageName = this.pluginPackageMetadata.readPackageName(plugin);
|
|
77
|
+
if (!packageName) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
summaries.push({
|
|
81
|
+
packageName,
|
|
82
|
+
source: "configured",
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return summaries;
|
|
86
|
+
}
|
|
87
|
+
|
|
68
88
|
private resolvePersistence(
|
|
69
89
|
runtimeConfig: CodemationApplicationRuntimeConfig,
|
|
70
90
|
env: NodeJS.ProcessEnv,
|
package/src/client.ts
CHANGED
|
@@ -6,5 +6,9 @@ export type {
|
|
|
6
6
|
CodemationFrontendAuthProviderSnapshot,
|
|
7
7
|
CodemationFrontendAuthSnapshot,
|
|
8
8
|
} from "./presentation/frontend/CodemationFrontendAuthSnapshot";
|
|
9
|
+
export type { InternalAuthBootstrap } from "./presentation/frontend/InternalAuthBootstrap";
|
|
10
|
+
export type { PublicFrontendBootstrap } from "./presentation/frontend/PublicFrontendBootstrap";
|
|
9
11
|
export { CodemationFrontendAuthSnapshotJsonCodec } from "./presentation/frontend/CodemationFrontendAuthSnapshotJsonCodec";
|
|
10
12
|
export { FrontendAppConfigJsonCodec } from "./presentation/frontend/FrontendAppConfigJsonCodec";
|
|
13
|
+
export { InternalAuthBootstrapJsonCodec } from "./presentation/frontend/InternalAuthBootstrapJsonCodec";
|
|
14
|
+
export { PublicFrontendBootstrapJsonCodec } from "./presentation/frontend/PublicFrontendBootstrapJsonCodec";
|
package/src/index.ts
CHANGED
|
@@ -10,9 +10,10 @@ export { FrontendRuntime } from "./bootstrap/runtime/FrontendRuntime";
|
|
|
10
10
|
export { WorkerRuntime } from "./bootstrap/runtime/WorkerRuntime";
|
|
11
11
|
export { AppConfigFactory } from "./bootstrap/runtime/AppConfigFactory";
|
|
12
12
|
export { ApplicationTokens } from "./applicationTokens";
|
|
13
|
+
export { workflow } from "@codemation/core-nodes";
|
|
13
14
|
export { CodemationBootstrapRequest } from "./bootstrap/CodemationBootstrapRequest";
|
|
14
15
|
export type { CodemationWhitelabelConfig } from "./presentation/config/CodemationWhitelabelConfig";
|
|
15
|
-
export type { AppConfig } from "./presentation/config/AppConfig";
|
|
16
|
+
export type { AppConfig, AppPluginLoadSummary } from "./presentation/config/AppConfig";
|
|
16
17
|
export type {
|
|
17
18
|
CodemationAuthConfig,
|
|
18
19
|
CodemationAuthKind,
|
|
@@ -34,6 +35,13 @@ export type {
|
|
|
34
35
|
CodemationSchedulerConfig,
|
|
35
36
|
CodemationSchedulerKind,
|
|
36
37
|
} from "./presentation/config/CodemationConfig";
|
|
38
|
+
export type {
|
|
39
|
+
DefineCodemationAppOptions,
|
|
40
|
+
DefinePluginOptions,
|
|
41
|
+
FriendlyCodemationDatabaseConfig,
|
|
42
|
+
FriendlyCodemationExecutionConfig,
|
|
43
|
+
} from "./presentation/config/CodemationAuthoring.types";
|
|
44
|
+
export { defineCodemationApp, definePlugin } from "./presentation/config/CodemationAuthoring.types";
|
|
37
45
|
export type {
|
|
38
46
|
CodemationAppContext,
|
|
39
47
|
CodemationRegistrationContextBase,
|
|
@@ -48,19 +56,27 @@ export type {
|
|
|
48
56
|
CodemationLogLevelName,
|
|
49
57
|
CodemationLogRule,
|
|
50
58
|
} from "./presentation/config/CodemationLogConfig";
|
|
59
|
+
export type { CodemationPackageManifest } from "./presentation/config/CodemationPackageManifest";
|
|
51
60
|
export type {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
CodemationPlugin,
|
|
62
|
+
CodemationPluginConfig,
|
|
63
|
+
CodemationPluginContext,
|
|
64
|
+
} from "./presentation/config/CodemationPlugin";
|
|
65
|
+
export { CodemationPluginPackageMetadata } from "./presentation/config/CodemationPlugin";
|
|
56
66
|
export { CodemationPluginListMerger } from "./presentation/config/CodemationPluginListMerger";
|
|
57
67
|
export type { CodemationWorkflowDiscovery } from "./presentation/config/CodemationWorkflowDiscovery";
|
|
68
|
+
export type { InternalAuthBootstrap } from "./presentation/frontend/InternalAuthBootstrap";
|
|
69
|
+
export type { PublicFrontendBootstrap } from "./presentation/frontend/PublicFrontendBootstrap";
|
|
58
70
|
export {
|
|
59
71
|
ApiPaths,
|
|
60
72
|
CodemationFrontendAuthSnapshotFactory,
|
|
61
73
|
CodemationFrontendAuthSnapshotJsonCodec,
|
|
62
74
|
FrontendAppConfigFactory,
|
|
63
75
|
FrontendAppConfigJsonCodec,
|
|
76
|
+
InternalAuthBootstrapFactory,
|
|
77
|
+
InternalAuthBootstrapJsonCodec,
|
|
78
|
+
PublicFrontendBootstrapFactory,
|
|
79
|
+
PublicFrontendBootstrapJsonCodec,
|
|
64
80
|
CodemationConsumerConfigLoader,
|
|
65
81
|
CodemationPostgresPrismaClientFactory,
|
|
66
82
|
CodemationServerGateway,
|
|
@@ -15,6 +15,12 @@ export class CodemationPluginRegistrar {
|
|
|
15
15
|
}>,
|
|
16
16
|
): Promise<void> {
|
|
17
17
|
for (const plugin of args.plugins) {
|
|
18
|
+
for (const credentialType of plugin.credentialTypes ?? []) {
|
|
19
|
+
args.registerCredentialType(credentialType);
|
|
20
|
+
}
|
|
21
|
+
if (!plugin.register) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
18
24
|
await plugin.register({
|
|
19
25
|
container: args.container,
|
|
20
26
|
appConfig: args.appConfig,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { injectable
|
|
1
|
+
import { injectable } from "@codemation/core";
|
|
2
2
|
import type { Command } from "../../application/bus/Command";
|
|
3
|
-
import type { CommandHandler } from "../../application/bus/CommandHandler";
|
|
4
|
-
import { ApplicationTokens } from "../../applicationTokens";
|
|
5
3
|
|
|
6
4
|
type AbstractType<TInstance> = abstract new (...args: any[]) => TInstance;
|
|
7
|
-
type ConcreteType<TInstance> = new (...args: any[]) => TInstance;
|
|
8
5
|
|
|
9
6
|
export const commandHandlerMetadataKey = Symbol.for("codemation.infrastructure.di.CommandHandler");
|
|
10
7
|
|
|
@@ -13,12 +10,6 @@ export class HandlesCommand {
|
|
|
13
10
|
return (target) => {
|
|
14
11
|
Reflect.defineMetadata(commandHandlerMetadataKey, commandType, target);
|
|
15
12
|
injectable()(target as never);
|
|
16
|
-
registry([
|
|
17
|
-
{
|
|
18
|
-
token: ApplicationTokens.CommandHandler,
|
|
19
|
-
useClass: target as unknown as ConcreteType<CommandHandler<Command<unknown>, unknown>>,
|
|
20
|
-
},
|
|
21
|
-
])(target as never);
|
|
22
13
|
};
|
|
23
14
|
}
|
|
24
15
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { injectable
|
|
1
|
+
import { injectable } from "@codemation/core";
|
|
2
2
|
import type { Query } from "../../application/bus/Query";
|
|
3
|
-
import type { QueryHandler } from "../../application/bus/QueryHandler";
|
|
4
|
-
import { ApplicationTokens } from "../../applicationTokens";
|
|
5
3
|
|
|
6
4
|
type AbstractType<TInstance> = abstract new (...args: any[]) => TInstance;
|
|
7
|
-
type ConcreteType<TInstance> = new (...args: any[]) => TInstance;
|
|
8
5
|
|
|
9
6
|
export const queryHandlerMetadataKey = Symbol.for("codemation.infrastructure.di.QueryHandler");
|
|
10
7
|
|
|
@@ -13,12 +10,6 @@ export class HandlesQuery {
|
|
|
13
10
|
return (target) => {
|
|
14
11
|
Reflect.defineMetadata(queryHandlerMetadataKey, queryType, target);
|
|
15
12
|
injectable()(target as never);
|
|
16
|
-
registry([
|
|
17
|
-
{
|
|
18
|
-
token: ApplicationTokens.QueryHandler,
|
|
19
|
-
useClass: target as unknown as ConcreteType<QueryHandler<Query<unknown>, unknown>>,
|
|
20
|
-
},
|
|
21
|
-
])(target as never);
|
|
22
13
|
};
|
|
23
14
|
}
|
|
24
15
|
}
|
package/src/nextServer.ts
CHANGED
|
@@ -27,7 +27,11 @@ export type {
|
|
|
27
27
|
CodemationFrontendAuthSnapshot,
|
|
28
28
|
} from "./presentation/frontend/CodemationFrontendAuthSnapshot";
|
|
29
29
|
export type { FrontendAppConfig } from "./presentation/frontend/FrontendAppConfig";
|
|
30
|
+
export type { InternalAuthBootstrap } from "./presentation/frontend/InternalAuthBootstrap";
|
|
31
|
+
export type { PublicFrontendBootstrap } from "./presentation/frontend/PublicFrontendBootstrap";
|
|
30
32
|
export { FrontendAppConfigFactory } from "./presentation/frontend/FrontendAppConfigFactory";
|
|
33
|
+
export { InternalAuthBootstrapFactory } from "./presentation/frontend/InternalAuthBootstrapFactory";
|
|
34
|
+
export { PublicFrontendBootstrapFactory } from "./presentation/frontend/PublicFrontendBootstrapFactory";
|
|
31
35
|
export { CredentialBindingService, CredentialInstanceService } from "./domain/credentials/CredentialServices";
|
|
32
36
|
export { RequestToWebhookItemMapper } from "./infrastructure/webhooks/RequestToWebhookItemMapper";
|
|
33
37
|
export { CodemationHonoApiApp } from "./presentation/http/hono/CodemationHonoApiAppFactory";
|
|
@@ -16,6 +16,11 @@ export type AppPersistenceConfig =
|
|
|
16
16
|
| Readonly<{ kind: "postgresql"; databaseUrl: string }>
|
|
17
17
|
| Readonly<{ kind: "pglite"; dataDir: string }>;
|
|
18
18
|
|
|
19
|
+
export type AppPluginLoadSummary = Readonly<{
|
|
20
|
+
packageName: string;
|
|
21
|
+
source: "configured" | "discovered";
|
|
22
|
+
}>;
|
|
23
|
+
|
|
19
24
|
export interface AppConfig {
|
|
20
25
|
readonly consumerRoot: string;
|
|
21
26
|
readonly repoRoot: string;
|
|
@@ -25,6 +30,7 @@ export interface AppConfig {
|
|
|
25
30
|
readonly containerRegistrations: ReadonlyArray<CodemationContainerRegistration<unknown>>;
|
|
26
31
|
readonly credentialTypes: ReadonlyArray<AnyCredentialType>;
|
|
27
32
|
readonly plugins: ReadonlyArray<CodemationPlugin>;
|
|
33
|
+
readonly pluginLoadSummary?: ReadonlyArray<AppPluginLoadSummary>;
|
|
28
34
|
readonly hasConfiguredCredentialSessionServiceRegistration: boolean;
|
|
29
35
|
readonly log?: CodemationLogConfig;
|
|
30
36
|
readonly engineExecutionLimits?: CodemationEngineExecutionLimitsConfig;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import type { AnyCredentialType, DefinedNode, WorkflowDefinition } from "@codemation/core";
|
|
2
|
+
import type { CodemationAppContext } from "./CodemationAppContext";
|
|
3
|
+
import type {
|
|
4
|
+
CodemationAppDefinition,
|
|
5
|
+
CodemationAppSchedulerConfig,
|
|
6
|
+
CodemationConfig,
|
|
7
|
+
CodemationDatabaseConfig,
|
|
8
|
+
} from "./CodemationConfig";
|
|
9
|
+
import type { CodemationPlugin, CodemationPluginContext } from "./CodemationPlugin";
|
|
10
|
+
import type { CodemationWhitelabelConfig } from "./CodemationWhitelabelConfig";
|
|
11
|
+
|
|
12
|
+
export interface FriendlyCodemationDatabaseConfig {
|
|
13
|
+
readonly kind: "postgresql" | "pglite";
|
|
14
|
+
readonly url?: string;
|
|
15
|
+
readonly dataDir?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface FriendlyCodemationExecutionConfig {
|
|
19
|
+
readonly mode?: "inline" | "queue";
|
|
20
|
+
readonly queuePrefix?: string;
|
|
21
|
+
readonly workerQueues?: ReadonlyArray<string>;
|
|
22
|
+
readonly redisUrl?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface DefineCodemationAppOptions extends Omit<
|
|
26
|
+
CodemationConfig,
|
|
27
|
+
"app" | "credentialTypes" | "register" | "whitelabel" | "auth"
|
|
28
|
+
> {
|
|
29
|
+
readonly name?: string;
|
|
30
|
+
readonly auth?: CodemationConfig["auth"];
|
|
31
|
+
readonly database?: FriendlyCodemationDatabaseConfig;
|
|
32
|
+
readonly execution?: FriendlyCodemationExecutionConfig;
|
|
33
|
+
readonly nodes?: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>>;
|
|
34
|
+
readonly credentialTypes?: ReadonlyArray<AnyCredentialType>;
|
|
35
|
+
readonly credentials?: ReadonlyArray<AnyCredentialType>;
|
|
36
|
+
readonly register?: (context: CodemationAppContext) => void;
|
|
37
|
+
readonly whitelabel?: CodemationWhitelabelConfig;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface DefinePluginOptions {
|
|
41
|
+
readonly name?: string;
|
|
42
|
+
readonly pluginPackageId?: string;
|
|
43
|
+
readonly nodes?: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>>;
|
|
44
|
+
readonly credentials?: ReadonlyArray<AnyCredentialType>;
|
|
45
|
+
readonly register?: (context: CodemationPluginContext) => void | Promise<void>;
|
|
46
|
+
readonly sandbox?: DefineCodemationAppOptions & Readonly<{ workflows?: ReadonlyArray<WorkflowDefinition> }>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
class CodemationAuthoringConfigFactory {
|
|
50
|
+
static createApp(options: DefineCodemationAppOptions): CodemationConfig {
|
|
51
|
+
const appDefinition = this.createAppDefinition(options);
|
|
52
|
+
const credentialTypes = [...(options.credentialTypes ?? []), ...(options.credentials ?? [])];
|
|
53
|
+
const register = this.composeAppRegister(options.register, options.nodes);
|
|
54
|
+
const { workflows, workflowDiscovery, plugins, runtime, log } = options;
|
|
55
|
+
return {
|
|
56
|
+
workflows,
|
|
57
|
+
workflowDiscovery,
|
|
58
|
+
plugins,
|
|
59
|
+
runtime,
|
|
60
|
+
log,
|
|
61
|
+
app: appDefinition,
|
|
62
|
+
credentialTypes,
|
|
63
|
+
register,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static createPlugin(
|
|
68
|
+
options: DefinePluginOptions,
|
|
69
|
+
): CodemationPlugin & Readonly<{ sandbox?: DefinePluginOptions["sandbox"] }> {
|
|
70
|
+
return {
|
|
71
|
+
pluginPackageId: options.pluginPackageId,
|
|
72
|
+
sandbox: options.sandbox,
|
|
73
|
+
async register(context: CodemationPluginContext): Promise<void> {
|
|
74
|
+
for (const nodeDefinition of options.nodes ?? []) {
|
|
75
|
+
nodeDefinition.register(context);
|
|
76
|
+
}
|
|
77
|
+
for (const credential of options.credentials ?? []) {
|
|
78
|
+
context.registerCredentialType(credential);
|
|
79
|
+
}
|
|
80
|
+
await options.register?.(context);
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private static createAppDefinition(options: DefineCodemationAppOptions): CodemationAppDefinition | undefined {
|
|
86
|
+
const scheduler = this.createSchedulerConfig(options.execution);
|
|
87
|
+
const database = this.createDatabaseConfig(options.database);
|
|
88
|
+
const whitelabel = this.createWhitelabel(options.name, options.whitelabel);
|
|
89
|
+
if (!options.auth && !database && !scheduler && !whitelabel) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
auth: options.auth,
|
|
94
|
+
database,
|
|
95
|
+
scheduler,
|
|
96
|
+
whitelabel,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
private static createDatabaseConfig(
|
|
101
|
+
database: FriendlyCodemationDatabaseConfig | undefined,
|
|
102
|
+
): CodemationDatabaseConfig | undefined {
|
|
103
|
+
if (!database) {
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
if (database.kind === "pglite") {
|
|
107
|
+
return {
|
|
108
|
+
kind: "pglite",
|
|
109
|
+
pgliteDataDir: database.dataDir,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
kind: "postgresql",
|
|
114
|
+
url: database.url,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private static createSchedulerConfig(
|
|
119
|
+
execution: FriendlyCodemationExecutionConfig | undefined,
|
|
120
|
+
): CodemationAppSchedulerConfig | undefined {
|
|
121
|
+
if (!execution) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
kind: execution.mode,
|
|
126
|
+
queuePrefix: execution.queuePrefix,
|
|
127
|
+
workerQueues: execution.workerQueues,
|
|
128
|
+
redisUrl: execution.redisUrl,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
private static createWhitelabel(
|
|
133
|
+
name: string | undefined,
|
|
134
|
+
whitelabel: CodemationWhitelabelConfig | undefined,
|
|
135
|
+
): CodemationWhitelabelConfig | undefined {
|
|
136
|
+
if (!name && !whitelabel) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
productName: name ?? whitelabel?.productName,
|
|
141
|
+
logoPath: whitelabel?.logoPath,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
private static composeAppRegister(
|
|
146
|
+
register: ((context: CodemationAppContext) => void) | undefined,
|
|
147
|
+
nodes: ReadonlyArray<DefinedNode<string, Record<string, unknown>, unknown, unknown>> | undefined,
|
|
148
|
+
): ((context: CodemationAppContext) => void) | undefined {
|
|
149
|
+
if (!register && (!nodes || nodes.length === 0)) {
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
return (context: CodemationAppContext) => {
|
|
153
|
+
for (const nodeDefinition of nodes ?? []) {
|
|
154
|
+
nodeDefinition.register(context);
|
|
155
|
+
}
|
|
156
|
+
register?.(context);
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function defineCodemationApp(options: DefineCodemationAppOptions): CodemationConfig {
|
|
162
|
+
return CodemationAuthoringConfigFactory.createApp(options);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function definePlugin(
|
|
166
|
+
options: DefinePluginOptions,
|
|
167
|
+
): CodemationPlugin & Readonly<{ sandbox?: DefinePluginOptions["sandbox"] }> {
|
|
168
|
+
return CodemationAuthoringConfigFactory.createPlugin(options);
|
|
169
|
+
}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
export interface CodemationPluginPackageManifest {
|
|
2
|
-
readonly kind: "plugin";
|
|
3
|
-
readonly entry: string;
|
|
4
|
-
readonly exportName?: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
1
|
export interface CodemationPackageManifest {
|
|
8
|
-
readonly plugin?:
|
|
2
|
+
readonly plugin?: string;
|
|
9
3
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { Container } from "@codemation/core";
|
|
1
|
+
import type { AnyCredentialType, Container } from "@codemation/core";
|
|
2
2
|
import type { LoggerFactory } from "../../application/logging/Logger";
|
|
3
3
|
import type { AppConfig } from "./AppConfig";
|
|
4
4
|
import type { CodemationRegistrationContextBase } from "./CodemationAppContext";
|
|
5
|
+
import type { CodemationConfig } from "./CodemationConfig";
|
|
5
6
|
|
|
6
7
|
export interface CodemationPluginContext extends CodemationRegistrationContextBase {
|
|
7
8
|
readonly container: Container;
|
|
@@ -9,12 +10,48 @@ export interface CodemationPluginContext extends CodemationRegistrationContextBa
|
|
|
9
10
|
readonly loggerFactory: LoggerFactory;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export interface
|
|
13
|
-
/**
|
|
14
|
-
* Optional npm package name for this plugin (e.g. `"@codemation/core-nodes-gmail"`).
|
|
15
|
-
* When set, the host merges configured and discovered plugin lists by this id so the same package is not
|
|
16
|
-
* registered twice when separate module graphs load duplicate class instances (different `constructor` values).
|
|
17
|
-
*/
|
|
13
|
+
export interface CodemationPluginConfig {
|
|
18
14
|
readonly pluginPackageId?: string;
|
|
19
|
-
|
|
15
|
+
readonly credentialTypes?: ReadonlyArray<AnyCredentialType>;
|
|
16
|
+
readonly register?: (context: CodemationPluginContext) => void | Promise<void>;
|
|
17
|
+
readonly sandbox?: CodemationConfig;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type CodemationPlugin = CodemationPluginConfig;
|
|
21
|
+
|
|
22
|
+
const definePlugin = <TConfig extends CodemationPluginConfig>(config: TConfig): TConfig => config;
|
|
23
|
+
|
|
24
|
+
export { definePlugin };
|
|
25
|
+
|
|
26
|
+
export class CodemationPluginPackageMetadata {
|
|
27
|
+
private static readonly packageNameSymbol = Symbol.for("@codemation/plugin-package-name");
|
|
28
|
+
|
|
29
|
+
attachPackageName(plugin: CodemationPlugin, packageName: string): CodemationPlugin {
|
|
30
|
+
if (packageName.trim().length === 0) {
|
|
31
|
+
return plugin;
|
|
32
|
+
}
|
|
33
|
+
const mutablePlugin = plugin as CodemationPlugin & {
|
|
34
|
+
[CodemationPluginPackageMetadata.packageNameSymbol]?: string;
|
|
35
|
+
};
|
|
36
|
+
const existingPackageName = mutablePlugin[CodemationPluginPackageMetadata.packageNameSymbol];
|
|
37
|
+
if (existingPackageName === packageName) {
|
|
38
|
+
return plugin;
|
|
39
|
+
}
|
|
40
|
+
Object.defineProperty(mutablePlugin, CodemationPluginPackageMetadata.packageNameSymbol, {
|
|
41
|
+
configurable: true,
|
|
42
|
+
enumerable: false,
|
|
43
|
+
value: packageName,
|
|
44
|
+
writable: true,
|
|
45
|
+
});
|
|
46
|
+
return plugin;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
readPackageName(plugin: CodemationPlugin): string | undefined {
|
|
50
|
+
const packageName = (
|
|
51
|
+
plugin as CodemationPlugin & {
|
|
52
|
+
[CodemationPluginPackageMetadata.packageNameSymbol]?: unknown;
|
|
53
|
+
}
|
|
54
|
+
)[CodemationPluginPackageMetadata.packageNameSymbol];
|
|
55
|
+
return typeof packageName === "string" && packageName.trim().length > 0 ? packageName : undefined;
|
|
56
|
+
}
|
|
20
57
|
}
|