@auto-engineer/server-generator-nestjs 0.20.0 → 0.21.2
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 +18 -0
- package/package.json +3 -3
- package/.turbo/turbo-build.log +0 -5
- package/.turbo/turbo-test.log +0 -13
- package/.turbo/turbo-type-check.log +0 -4
- package/dist/src/codegen/entity-consolidation.d.ts +0 -19
- package/dist/src/codegen/entity-consolidation.d.ts.map +0 -1
- package/dist/src/codegen/entity-consolidation.js +0 -134
- package/dist/src/codegen/entity-consolidation.js.map +0 -1
- package/dist/src/codegen/extract/commands.d.ts +0 -25
- package/dist/src/codegen/extract/commands.d.ts.map +0 -1
- package/dist/src/codegen/extract/commands.js +0 -67
- package/dist/src/codegen/extract/commands.js.map +0 -1
- package/dist/src/codegen/extract/data-sink.d.ts +0 -6
- package/dist/src/codegen/extract/data-sink.d.ts.map +0 -1
- package/dist/src/codegen/extract/data-sink.js +0 -78
- package/dist/src/codegen/extract/data-sink.js.map +0 -1
- package/dist/src/codegen/extract/events.d.ts +0 -10
- package/dist/src/codegen/extract/events.d.ts.map +0 -1
- package/dist/src/codegen/extract/events.js +0 -42
- package/dist/src/codegen/extract/events.js.map +0 -1
- package/dist/src/codegen/extract/fields.d.ts +0 -3
- package/dist/src/codegen/extract/fields.d.ts.map +0 -1
- package/dist/src/codegen/extract/fields.js +0 -9
- package/dist/src/codegen/extract/fields.js.map +0 -1
- package/dist/src/codegen/extract/graphql.d.ts +0 -14
- package/dist/src/codegen/extract/graphql.d.ts.map +0 -1
- package/dist/src/codegen/extract/graphql.js +0 -81
- package/dist/src/codegen/extract/graphql.js.map +0 -1
- package/dist/src/codegen/extract/gwt.d.ts +0 -6
- package/dist/src/codegen/extract/gwt.d.ts.map +0 -1
- package/dist/src/codegen/extract/gwt.js +0 -64
- package/dist/src/codegen/extract/gwt.js.map +0 -1
- package/dist/src/codegen/extract/imports.d.ts +0 -29
- package/dist/src/codegen/extract/imports.d.ts.map +0 -1
- package/dist/src/codegen/extract/imports.js +0 -55
- package/dist/src/codegen/extract/imports.js.map +0 -1
- package/dist/src/codegen/extract/index.d.ts +0 -10
- package/dist/src/codegen/extract/index.d.ts.map +0 -1
- package/dist/src/codegen/extract/index.js +0 -10
- package/dist/src/codegen/extract/index.js.map +0 -1
- package/dist/src/codegen/extract/messages.d.ts +0 -17
- package/dist/src/codegen/extract/messages.d.ts.map +0 -1
- package/dist/src/codegen/extract/messages.js +0 -172
- package/dist/src/codegen/extract/messages.js.map +0 -1
- package/dist/src/codegen/extract/projection.d.ts +0 -5
- package/dist/src/codegen/extract/projection.d.ts.map +0 -1
- package/dist/src/codegen/extract/projection.js +0 -44
- package/dist/src/codegen/extract/projection.js.map +0 -1
- package/dist/src/codegen/extract/query.d.ts +0 -14
- package/dist/src/codegen/extract/query.d.ts.map +0 -1
- package/dist/src/codegen/extract/query.js +0 -17
- package/dist/src/codegen/extract/query.js.map +0 -1
- package/dist/src/codegen/extract/states.d.ts +0 -5
- package/dist/src/codegen/extract/states.d.ts.map +0 -1
- package/dist/src/codegen/extract/states.js +0 -48
- package/dist/src/codegen/extract/states.js.map +0 -1
- package/dist/src/codegen/extract/step-converter.d.ts +0 -17
- package/dist/src/codegen/extract/step-converter.d.ts.map +0 -1
- package/dist/src/codegen/extract/step-converter.js +0 -82
- package/dist/src/codegen/extract/step-converter.js.map +0 -1
- package/dist/src/codegen/extract/step-types.d.ts +0 -29
- package/dist/src/codegen/extract/step-types.d.ts.map +0 -1
- package/dist/src/codegen/extract/step-types.js +0 -16
- package/dist/src/codegen/extract/step-types.js.map +0 -1
- package/dist/src/codegen/extract/type-helpers.d.ts +0 -13
- package/dist/src/codegen/extract/type-helpers.d.ts.map +0 -1
- package/dist/src/codegen/extract/type-helpers.js +0 -98
- package/dist/src/codegen/extract/type-helpers.js.map +0 -1
- package/dist/src/codegen/scaffoldFromSchema.d.ts +0 -9
- package/dist/src/codegen/scaffoldFromSchema.d.ts.map +0 -1
- package/dist/src/codegen/scaffoldFromSchema.js +0 -389
- package/dist/src/codegen/scaffoldFromSchema.js.map +0 -1
- package/dist/src/codegen/templates/command/command.ts.ejs +0 -16
- package/dist/src/codegen/templates/command/handler.specs.ts.ejs +0 -50
- package/dist/src/codegen/templates/command/handler.ts.ejs +0 -30
- package/dist/src/codegen/templates/command/input.ts.ejs +0 -23
- package/dist/src/codegen/templates/command/resolver.ts.ejs +0 -56
- package/dist/src/codegen/templates/entity/entity.ts.ejs +0 -35
- package/dist/src/codegen/templates/entity/index.ts.ejs +0 -6
- package/dist/src/codegen/templates/module/app-module.ts.ejs +0 -65
- package/dist/src/codegen/templates/module/domain-module.ts.ejs +0 -46
- package/dist/src/codegen/templates/query/handler.ts.ejs +0 -25
- package/dist/src/codegen/templates/query/query.ts.ejs +0 -1
- package/dist/src/codegen/templates/query/resolver.ts.ejs +0 -20
- package/dist/src/codegen/templates/query/type.ts.ejs +0 -24
- package/dist/src/codegen/types.d.ts +0 -38
- package/dist/src/codegen/types.d.ts.map +0 -1
- package/dist/src/codegen/types.js +0 -2
- package/dist/src/codegen/types.js.map +0 -1
- package/dist/src/codegen/utils/path.d.ts +0 -4
- package/dist/src/codegen/utils/path.d.ts.map +0 -1
- package/dist/src/codegen/utils/path.js +0 -18
- package/dist/src/codegen/utils/path.js.map +0 -1
- package/dist/src/commands/generate-server.d.ts +0 -28
- package/dist/src/commands/generate-server.d.ts.map +0 -1
- package/dist/src/commands/generate-server.js +0 -421
- package/dist/src/commands/generate-server.js.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +0 -1
- package/dist/src/shared/graphql-types.ts +0 -19
- package/dist/src/shared/main.ts +0 -27
- package/dist/src/shared/mikro-orm.config.ts +0 -18
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Module, Logger } from '@nestjs/common';
|
|
2
|
-
import { CqrsModule } from '@nestjs/cqrs';
|
|
3
|
-
import { GraphQLModule } from '@nestjs/graphql';
|
|
4
|
-
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
|
|
5
|
-
import { MikroOrmModule } from '@mikro-orm/nestjs';
|
|
6
|
-
import { SqliteDriver } from '@mikro-orm/sqlite';
|
|
7
|
-
import { Migrator } from '@mikro-orm/migrations';
|
|
8
|
-
import { join } from 'path';
|
|
9
|
-
import { ApolloServerPluginLandingPageLocalDefault } from '@apollo/server/plugin/landingPage/default';
|
|
10
|
-
|
|
11
|
-
<% for (const flow of flows) { -%>
|
|
12
|
-
import { <%= pascalCase(flow.name) %>Module } from './domain/<%= toKebabCase(flow.name) %>/<%= toKebabCase(flow.name) %>.module';
|
|
13
|
-
import { <%= pascalCase(flow.name) %>Entity } from './domain/<%= toKebabCase(flow.name) %>/entities';
|
|
14
|
-
<% } -%>
|
|
15
|
-
|
|
16
|
-
const domainModules = [
|
|
17
|
-
<% for (const flow of flows) { -%>
|
|
18
|
-
<%= pascalCase(flow.name) %>Module,
|
|
19
|
-
<% } -%>
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
const entities = [
|
|
23
|
-
<% for (const flow of flows) { -%>
|
|
24
|
-
<%= pascalCase(flow.name) %>Entity,
|
|
25
|
-
<% } -%>
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
@Module({
|
|
29
|
-
imports: [
|
|
30
|
-
...domainModules,
|
|
31
|
-
MikroOrmModule.forRoot({
|
|
32
|
-
entities,
|
|
33
|
-
dbName: process.env.NODE_ENV === 'test' ? ':memory:' : './db.sqlite',
|
|
34
|
-
driver: SqliteDriver,
|
|
35
|
-
allowGlobalContext: true,
|
|
36
|
-
debug: process.env.NODE_ENV !== 'production',
|
|
37
|
-
ensureDatabase: true,
|
|
38
|
-
extensions: [Migrator],
|
|
39
|
-
migrations: {
|
|
40
|
-
path: join(__dirname, 'migrations'),
|
|
41
|
-
glob: '!(*.d).{js,ts}',
|
|
42
|
-
transactional: true,
|
|
43
|
-
disableForeignKeys: false,
|
|
44
|
-
emit: 'ts',
|
|
45
|
-
},
|
|
46
|
-
}),
|
|
47
|
-
CqrsModule.forRoot(),
|
|
48
|
-
GraphQLModule.forRoot<ApolloDriverConfig>({
|
|
49
|
-
driver: ApolloDriver,
|
|
50
|
-
autoSchemaFile: join(process.cwd(), 'src/schema.gql'),
|
|
51
|
-
sortSchema: true,
|
|
52
|
-
playground: false,
|
|
53
|
-
introspection: true,
|
|
54
|
-
csrfPrevention: false,
|
|
55
|
-
plugins: [ApolloServerPluginLandingPageLocalDefault()],
|
|
56
|
-
}),
|
|
57
|
-
],
|
|
58
|
-
})
|
|
59
|
-
export class AppModule {
|
|
60
|
-
private readonly logger = new Logger(AppModule.name);
|
|
61
|
-
|
|
62
|
-
constructor() {
|
|
63
|
-
this.logger.log('✅ Application module initialized');
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
const moduleName = pascalCase(flowName) + 'Module';
|
|
3
|
-
const entityName = pascalCase(flowName) + 'Entity';
|
|
4
|
-
%>import { Module } from '@nestjs/common';
|
|
5
|
-
import { CqrsModule } from '@nestjs/cqrs';
|
|
6
|
-
import { MikroOrmModule } from '@mikro-orm/nestjs';
|
|
7
|
-
import { <%= entityName %> } from './entities/<%= toKebabCase(entityName) %>.entity';
|
|
8
|
-
<% for (const slice of slices) { -%>
|
|
9
|
-
<% if (slice.type === 'command') { -%>
|
|
10
|
-
import { <%= pascalCase(slice.name) %>Handler } from './<%= toKebabCase(slice.name) %>/<%= toKebabCase(slice.name) %>.handler';
|
|
11
|
-
import { <%= pascalCase(slice.name) %>Resolver } from './<%= toKebabCase(slice.name) %>/<%= toKebabCase(slice.name) %>.resolver';
|
|
12
|
-
<% } else if (slice.type === 'query') { -%>
|
|
13
|
-
import { <%= pascalCase(slice.name) %>Handler } from './<%= toKebabCase(slice.name) %>/<%= toKebabCase(slice.name) %>.handler';
|
|
14
|
-
import { <%= pascalCase(slice.name) %>Resolver } from './<%= toKebabCase(slice.name) %>/<%= toKebabCase(slice.name) %>.resolver';
|
|
15
|
-
<% } -%>
|
|
16
|
-
<% } -%>
|
|
17
|
-
|
|
18
|
-
const CommandHandlers = [
|
|
19
|
-
<% for (const slice of slices) { -%>
|
|
20
|
-
<% if (slice.type === 'command') { -%>
|
|
21
|
-
<%= pascalCase(slice.name) %>Handler,
|
|
22
|
-
<% } -%>
|
|
23
|
-
<% } -%>
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
const QueryHandlers = [
|
|
27
|
-
<% for (const slice of slices) { -%>
|
|
28
|
-
<% if (slice.type === 'query') { -%>
|
|
29
|
-
<%= pascalCase(slice.name) %>Handler,
|
|
30
|
-
<% } -%>
|
|
31
|
-
<% } -%>
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
const Resolvers = [
|
|
35
|
-
<% for (const slice of slices) { -%>
|
|
36
|
-
<% if (slice.type === 'command' || slice.type === 'query') { -%>
|
|
37
|
-
<%= pascalCase(slice.name) %>Resolver,
|
|
38
|
-
<% } -%>
|
|
39
|
-
<% } -%>
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
@Module({
|
|
43
|
-
imports: [CqrsModule, MikroOrmModule.forFeature([<%= entityName %>])],
|
|
44
|
-
providers: [...CommandHandlers, ...QueryHandlers, ...Resolvers],
|
|
45
|
-
})
|
|
46
|
-
export class <%= moduleName %> {}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
const entityName = pascalCase(flowName) + 'Entity';
|
|
3
|
-
const typeName = projectionType || pascalCase(sliceName) + 'State';
|
|
4
|
-
const isSingleton = projectionSingleton === true;
|
|
5
|
-
%>import { QueryHandler, IQueryHandler } from '@nestjs/cqrs';
|
|
6
|
-
import { InjectRepository } from '@mikro-orm/nestjs';
|
|
7
|
-
import { EntityRepository } from '@mikro-orm/core';
|
|
8
|
-
import { <%= pascalCase(sliceName) %>Query } from './<%= toKebabCase(sliceName) %>.query';
|
|
9
|
-
import { <%= entityName %> } from '../entities/<%= toKebabCase(entityName) %>.entity';
|
|
10
|
-
|
|
11
|
-
@QueryHandler(<%= pascalCase(sliceName) %>Query)
|
|
12
|
-
export class <%= pascalCase(sliceName) %>Handler implements IQueryHandler<<%= pascalCase(sliceName) %>Query> {
|
|
13
|
-
constructor(
|
|
14
|
-
@InjectRepository(<%= entityName %>)
|
|
15
|
-
private readonly repository: EntityRepository<<%= entityName %>>,
|
|
16
|
-
) {}
|
|
17
|
-
|
|
18
|
-
async execute(): Promise<<%= entityName %><%= isSingleton ? ' | null' : '[]' %>> {
|
|
19
|
-
<% if (isSingleton) { -%>
|
|
20
|
-
return this.repository.findOne({});
|
|
21
|
-
<% } else { -%>
|
|
22
|
-
return this.repository.findAll();
|
|
23
|
-
<% } -%>
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class <%= pascalCase(sliceName) %>Query {}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
const typeName = projectionType || pascalCase(sliceName) + 'State';
|
|
3
|
-
const queryName = camelCase(projectionName || sliceName);
|
|
4
|
-
const isSingleton = projectionSingleton === true;
|
|
5
|
-
%>import { Query, Resolver } from '@nestjs/graphql';
|
|
6
|
-
import { Injectable } from '@nestjs/common';
|
|
7
|
-
import { QueryBus } from '@nestjs/cqrs';
|
|
8
|
-
import { <%= pascalCase(sliceName) %>Query } from './<%= toKebabCase(sliceName) %>.query';
|
|
9
|
-
import { <%= typeName %> } from './<%= toKebabCase(sliceName) %>.type';
|
|
10
|
-
|
|
11
|
-
@Injectable()
|
|
12
|
-
@Resolver()
|
|
13
|
-
export class <%= pascalCase(sliceName) %>Resolver {
|
|
14
|
-
constructor(private readonly queryBus: QueryBus) {}
|
|
15
|
-
|
|
16
|
-
@Query(() => <%= isSingleton ? typeName : `[${typeName}]` %>)
|
|
17
|
-
async <%= queryName %>(): Promise<<%= typeName %><%= isSingleton ? ' | null' : '[]' %>> {
|
|
18
|
-
return this.queryBus.execute(new <%= pascalCase(sliceName) %>Query());
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
const state = states[0] || message;
|
|
3
|
-
if (!state || !state.fields) return '';
|
|
4
|
-
const usesID = state.fields.some(f => graphqlType(f.tsType) === 'ID');
|
|
5
|
-
const usesFloat = state.fields.some(f => fieldUsesFloat(f.tsType));
|
|
6
|
-
const usesJSON = state.fields.some(f => fieldUsesJSON(f.tsType));
|
|
7
|
-
const enumList = collectEnumNames(state.fields);
|
|
8
|
-
const typeName = projectionType || pascalCase(sliceName) + 'State';
|
|
9
|
-
%>import { ObjectType, Field<% if (usesID) { %>, ID<% } %><% if (usesFloat) { %>, Float<% } %> } from '@nestjs/graphql';
|
|
10
|
-
<% if (usesJSON) { -%>
|
|
11
|
-
import GraphQLJSON from 'graphql-type-json';
|
|
12
|
-
<% } -%>
|
|
13
|
-
<% if (enumList.length > 0) { -%>
|
|
14
|
-
import { <%= enumList.join(', ') %> } from '../entities';
|
|
15
|
-
<% } -%>
|
|
16
|
-
|
|
17
|
-
@ObjectType()
|
|
18
|
-
export class <%= typeName %> {
|
|
19
|
-
<% for (const field of state.fields) { -%>
|
|
20
|
-
@Field(() => <%= graphqlType(field.tsType) %><%= isNullable(field.tsType) ? ', { nullable: true }' : '' %>)
|
|
21
|
-
<%= field.name %><%= isNullable(field.tsType) ? '?' : '!' %>: <%= toTsFieldType(field.tsType) %><%= isNullable(field.tsType) ? ' | null' : '' %>;
|
|
22
|
-
|
|
23
|
-
<% } -%>
|
|
24
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { CommandExample, ErrorRef, EventExample, StateExample } from './extract/step-types';
|
|
2
|
-
export type { CommandExample, ErrorRef, EventExample, StateExample };
|
|
3
|
-
export interface Message {
|
|
4
|
-
type: string;
|
|
5
|
-
fields: Field[];
|
|
6
|
-
source?: 'when' | 'given' | 'then';
|
|
7
|
-
sourceFlowName?: string;
|
|
8
|
-
sourceSliceName?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface Field {
|
|
11
|
-
name: string;
|
|
12
|
-
tsType: string;
|
|
13
|
-
required: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface MessageDefinition {
|
|
16
|
-
type: 'command' | 'event' | 'state';
|
|
17
|
-
name: string;
|
|
18
|
-
fields?: Array<{
|
|
19
|
-
name: string;
|
|
20
|
-
type: string;
|
|
21
|
-
required?: boolean;
|
|
22
|
-
description?: string;
|
|
23
|
-
defaultValue?: unknown;
|
|
24
|
-
}>;
|
|
25
|
-
metadata?: unknown;
|
|
26
|
-
description?: string;
|
|
27
|
-
}
|
|
28
|
-
export interface GwtCondition {
|
|
29
|
-
given?: Array<EventExample | StateExample>;
|
|
30
|
-
when: CommandExample | EventExample[];
|
|
31
|
-
then: Array<EventExample | StateExample | CommandExample | {
|
|
32
|
-
errorType: string;
|
|
33
|
-
message?: string;
|
|
34
|
-
}>;
|
|
35
|
-
description?: string;
|
|
36
|
-
ruleDescription?: string;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/codegen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEjG,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAErE,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC,CAAC;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC,CAAC;IAC3C,IAAI,EAAE,cAAc,GAAG,YAAY,EAAE,CAAC;IACtC,IAAI,EAAE,KAAK,CAAC,YAAY,GAAG,YAAY,GAAG,cAAc,GAAG;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/codegen/types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/codegen/utils/path.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED,wBAAgB,aAAa,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAE3D;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpE"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'fs';
|
|
2
|
-
import { mkdir } from 'fs/promises';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
export function toKebabCase(str) {
|
|
5
|
-
return str
|
|
6
|
-
.replace(/([a-z])([A-Z])/g, '$1-$2')
|
|
7
|
-
.replace(/\s+/g, '-')
|
|
8
|
-
.toLowerCase();
|
|
9
|
-
}
|
|
10
|
-
export function ensureDirPath(...segments) {
|
|
11
|
-
return path.join(...segments);
|
|
12
|
-
}
|
|
13
|
-
export async function ensureDirExists(dirPath) {
|
|
14
|
-
if (!existsSync(dirPath)) {
|
|
15
|
-
await mkdir(dirPath, { recursive: true });
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=path.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../src/codegen/utils/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG;SACP,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC;SACnC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,WAAW,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAG,QAAkB;IACjD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAe;IACnD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,MAAM,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { type Command, type Event } from '@auto-engineer/message-bus';
|
|
2
|
-
export type GenerateServerCommand = Command<'GenerateServer', {
|
|
3
|
-
modelPath: string;
|
|
4
|
-
destination: string;
|
|
5
|
-
}>;
|
|
6
|
-
export type ServerGeneratedEvent = Event<'ServerGenerated', {
|
|
7
|
-
modelPath: string;
|
|
8
|
-
destination: string;
|
|
9
|
-
serverDir: string;
|
|
10
|
-
contextSchemaGraphQL?: string;
|
|
11
|
-
}>;
|
|
12
|
-
export type ServerGenerationFailedEvent = Event<'ServerGenerationFailed', {
|
|
13
|
-
modelPath: string;
|
|
14
|
-
destination: string;
|
|
15
|
-
error: string;
|
|
16
|
-
}>;
|
|
17
|
-
export type SliceGeneratedEvent = Event<'SliceGenerated', {
|
|
18
|
-
flowName: string;
|
|
19
|
-
sliceName: string;
|
|
20
|
-
sliceType: string;
|
|
21
|
-
schemaPath: string;
|
|
22
|
-
slicePath: string;
|
|
23
|
-
}>;
|
|
24
|
-
export type GenerateServerEvents = ServerGeneratedEvent | ServerGenerationFailedEvent | SliceGeneratedEvent;
|
|
25
|
-
export declare const commandHandler: import("@auto-engineer/message-bus").CommandHandler;
|
|
26
|
-
export declare function handleGenerateServerCommandInternal(command: GenerateServerCommand): Promise<GenerateServerEvents[]>;
|
|
27
|
-
export default commandHandler;
|
|
28
|
-
//# sourceMappingURL=generate-server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-server.d.ts","sourceRoot":"","sources":["../../../src/commands/generate-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAwB,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAsB5F,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,gBAAgB,EAChB;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CACF,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,KAAK,CACtC,iBAAiB,EACjB;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CACF,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAC7C,wBAAwB,EACxB;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CACF,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,KAAK,CACrC,gBAAgB,EAChB;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG,2BAA2B,GAAG,mBAAmB,CAAC;AAE5G,eAAO,MAAM,cAAc,qDA+BzB,CAAC;AAwKH,wBAAsB,mCAAmC,CACvD,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,EAAE,CAAC,CA2EjC;AAoND,eAAe,cAAc,CAAC"}
|