@apso/cli 0.7.3 → 0.8.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/dist/autogen/index.d.ts +2 -0
- package/dist/autogen/index.js +3 -0
- package/dist/commands/server/new.d.ts +4 -1
- package/dist/commands/server/new.js +115 -22
- package/dist/commands/server/scaffold.d.ts +11 -0
- package/dist/commands/server/scaffold.js +213 -12
- package/dist/lib/api/client.d.ts +65 -0
- package/dist/lib/api/client.js +305 -0
- package/dist/lib/api/index.d.ts +8 -0
- package/dist/lib/api/index.js +22 -0
- package/dist/lib/api/services.d.ts +166 -0
- package/dist/lib/api/services.js +202 -0
- package/dist/lib/api/types.d.ts +212 -0
- package/dist/lib/api/types.js +7 -0
- package/dist/lib/apsorc-parser.d.ts +3 -0
- package/dist/lib/apsorc-parser.js +4 -0
- package/dist/lib/config/index.d.ts +8 -0
- package/dist/lib/config/index.js +17 -0
- package/dist/lib/config/manager.d.ts +127 -0
- package/dist/lib/config/manager.js +304 -0
- package/dist/lib/config/paths.d.ts +65 -0
- package/dist/lib/config/paths.js +127 -0
- package/dist/lib/config/types.d.ts +230 -0
- package/dist/lib/config/types.js +30 -0
- package/dist/lib/generators/base.d.ts +93 -0
- package/dist/lib/generators/base.js +90 -0
- package/dist/lib/generators/go.d.ts +37 -0
- package/dist/lib/generators/go.js +340 -0
- package/dist/lib/generators/index.d.ts +21 -0
- package/dist/lib/generators/index.js +51 -0
- package/dist/lib/generators/python.d.ts +21 -0
- package/dist/lib/generators/python.js +253 -0
- package/dist/lib/generators/typescript.d.ts +25 -0
- package/dist/lib/generators/typescript.js +373 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +9 -1
- package/dist/lib/templates/entities/entity-col-timestamp.eta +9 -2
- package/dist/lib/templates/entities/entity-col-timestamptz.eta +9 -2
- package/dist/lib/templates/entities/entity.eta +18 -5
- package/dist/lib/templates/go/dto/dto-col-array.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-boolean.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-date.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-decimal.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-enum.eta +8 -0
- package/dist/lib/templates/go/dto/dto-col-float.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-integer.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-json.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-jsonb.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-numeric.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-string.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-text.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-timestamp.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-timestamptz.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-uuid.eta +7 -0
- package/dist/lib/templates/go/dto/dto-col-varchar.eta +7 -0
- package/dist/lib/templates/go/dto/dto.eta +78 -0
- package/dist/lib/templates/go/enums.eta +44 -0
- package/dist/lib/templates/go/handlers/handler.eta +212 -0
- package/dist/lib/templates/go/header.eta +3 -0
- package/dist/lib/templates/go/index-module.eta +53 -0
- package/dist/lib/templates/go/middleware/auth.eta +101 -0
- package/dist/lib/templates/go/models/model-col-array.eta +1 -0
- package/dist/lib/templates/go/models/model-col-boolean.eta +1 -0
- package/dist/lib/templates/go/models/model-col-date.eta +1 -0
- package/dist/lib/templates/go/models/model-col-decimal.eta +1 -0
- package/dist/lib/templates/go/models/model-col-enum.eta +2 -0
- package/dist/lib/templates/go/models/model-col-float.eta +1 -0
- package/dist/lib/templates/go/models/model-col-integer.eta +1 -0
- package/dist/lib/templates/go/models/model-col-json.eta +1 -0
- package/dist/lib/templates/go/models/model-col-jsonb.eta +1 -0
- package/dist/lib/templates/go/models/model-col-numeric.eta +1 -0
- package/dist/lib/templates/go/models/model-col-string.eta +1 -0
- package/dist/lib/templates/go/models/model-col-text.eta +1 -0
- package/dist/lib/templates/go/models/model-col-timestamp.eta +1 -0
- package/dist/lib/templates/go/models/model-col-timestamptz.eta +1 -0
- package/dist/lib/templates/go/models/model-col-uuid.eta +1 -0
- package/dist/lib/templates/go/models/model-col-varchar.eta +1 -0
- package/dist/lib/templates/go/models/model.eta +53 -0
- package/dist/lib/templates/go/services/service.eta +190 -0
- package/dist/lib/templates/python/enums.eta +10 -0
- package/dist/lib/templates/python/header.eta +6 -0
- package/dist/lib/templates/python/index-module.eta +18 -0
- package/dist/lib/templates/python/models/model-col-array.eta +4 -0
- package/dist/lib/templates/python/models/model-col-boolean.eta +5 -0
- package/dist/lib/templates/python/models/model-col-date.eta +4 -0
- package/dist/lib/templates/python/models/model-col-decimal.eta +4 -0
- package/dist/lib/templates/python/models/model-col-enum.eta +16 -0
- package/dist/lib/templates/python/models/model-col-float.eta +5 -0
- package/dist/lib/templates/python/models/model-col-integer.eta +6 -0
- package/dist/lib/templates/python/models/model-col-json.eta +4 -0
- package/dist/lib/templates/python/models/model-col-jsonb.eta +4 -0
- package/dist/lib/templates/python/models/model-col-numeric.eta +4 -0
- package/dist/lib/templates/python/models/model-col-string.eta +6 -0
- package/dist/lib/templates/python/models/model-col-text.eta +6 -0
- package/dist/lib/templates/python/models/model-col-timestamp.eta +11 -0
- package/dist/lib/templates/python/models/model-col-timestamptz.eta +11 -0
- package/dist/lib/templates/python/models/model-col-uuid.eta +5 -0
- package/dist/lib/templates/python/models/model-col-varchar.eta +6 -0
- package/dist/lib/templates/python/models/model.eta +124 -0
- package/dist/lib/templates/python/routers/router.eta +206 -0
- package/dist/lib/templates/python/schemas/schema-col-array.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-boolean.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-date.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-decimal.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-enum.eta +6 -0
- package/dist/lib/templates/python/schemas/schema-col-float.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-integer.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-json.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-jsonb.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-numeric.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-string.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-text.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-timestamp.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-timestamptz.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-uuid.eta +1 -0
- package/dist/lib/templates/python/schemas/schema-col-varchar.eta +1 -0
- package/dist/lib/templates/python/schemas/schema.eta +87 -0
- package/dist/lib/templates/python/services/service.eta +163 -0
- package/dist/lib/templates/rest/controller-rest.eta +13 -12
- package/dist/lib/templates/rest/dto-rest.eta +173 -59
- package/dist/lib/templates/rest/service-rest.eta +50 -10
- package/dist/lib/types/generator.d.ts +241 -0
- package/dist/lib/types/generator.js +2 -0
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/utils/casing.d.ts +1 -0
- package/dist/lib/utils/casing.js +11 -1
- package/oclif.manifest.json +39 -3
- package/package.json +4 -2
- package/dist/lib/utils/relationships/parse.spec.d.ts +0 -1
- package/dist/lib/utils/relationships/parse.spec.js +0 -402
- package/dist/tests/templates/entities/types/array-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/array-template.spec.js +0 -82
- package/dist/tests/templates/entities/types/bigint-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/bigint-template.spec.js +0 -82
- package/dist/tests/templates/entities/types/boolean-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/boolean-template.spec.js +0 -77
- package/dist/tests/templates/entities/types/bytea-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/bytea-template.spec.js +0 -68
- package/dist/tests/templates/entities/types/char-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/char-template.spec.js +0 -68
- package/dist/tests/templates/entities/types/date-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/date-template.spec.js +0 -56
- package/dist/tests/templates/entities/types/decimal-field-validation.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/decimal-field-validation.spec.js +0 -100
- package/dist/tests/templates/entities/types/decimal-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/decimal-template.spec.js +0 -86
- package/dist/tests/templates/entities/types/double-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/double-template.spec.js +0 -70
- package/dist/tests/templates/entities/types/enum-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/enum-template.spec.js +0 -85
- package/dist/tests/templates/entities/types/float-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/float-template.spec.js +0 -70
- package/dist/tests/templates/entities/types/geometry-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/geometry-template.spec.js +0 -58
- package/dist/tests/templates/entities/types/inet-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/inet-template.spec.js +0 -69
- package/dist/tests/templates/entities/types/int4range-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/int4range-template.spec.js +0 -72
- package/dist/tests/templates/entities/types/integer-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/integer-template.spec.js +0 -79
- package/dist/tests/templates/entities/types/interval-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/interval-template.spec.js +0 -68
- package/dist/tests/templates/entities/types/json-plain-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/json-plain-template.spec.js +0 -54
- package/dist/tests/templates/entities/types/json-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/json-template.spec.js +0 -40
- package/dist/tests/templates/entities/types/jsonb-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/jsonb-template.spec.js +0 -40
- package/dist/tests/templates/entities/types/money-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/money-template.spec.js +0 -68
- package/dist/tests/templates/entities/types/numeric-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/numeric-template.spec.js +0 -84
- package/dist/tests/templates/entities/types/point-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/point-template.spec.js +0 -64
- package/dist/tests/templates/entities/types/polygon-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/polygon-template.spec.js +0 -70
- package/dist/tests/templates/entities/types/real-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/real-template.spec.js +0 -67
- package/dist/tests/templates/entities/types/serial-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/serial-template.spec.js +0 -113
- package/dist/tests/templates/entities/types/smallint-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/smallint-template.spec.js +0 -82
- package/dist/tests/templates/entities/types/string-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/string-template.spec.js +0 -111
- package/dist/tests/templates/entities/types/text-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/text-template.spec.js +0 -70
- package/dist/tests/templates/entities/types/time-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/time-template.spec.js +0 -68
- package/dist/tests/templates/entities/types/timestamp-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/timestamp-template.spec.js +0 -74
- package/dist/tests/templates/entities/types/timetz-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/timetz-template.spec.js +0 -68
- package/dist/tests/templates/entities/types/tsvector-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/tsvector-template.spec.js +0 -55
- package/dist/tests/templates/entities/types/uuid-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/uuid-template.spec.js +0 -82
- package/dist/tests/templates/entities/types/varchar-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/varchar-template.spec.js +0 -105
- package/dist/tests/templates/entities/types/xml-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/types/xml-template.spec.js +0 -55
- package/dist/tests/templates/entities/uuid-entity-template.spec.d.ts +0 -1
- package/dist/tests/templates/entities/uuid-entity-template.spec.js +0 -277
- package/dist/tests/utils/relationship-deduplication.spec.d.ts +0 -1
- package/dist/tests/utils/relationship-deduplication.spec.js +0 -98
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
<%~ includeFile('./header.eta') %>
|
|
2
2
|
|
|
3
|
-
import { ApiProperty } from '@nestjs/swagger';
|
|
3
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
4
|
+
import {
|
|
5
|
+
IsString,
|
|
6
|
+
IsNumber,
|
|
7
|
+
IsBoolean,
|
|
8
|
+
IsOptional,
|
|
9
|
+
IsNotEmpty,
|
|
10
|
+
IsUUID,
|
|
11
|
+
IsDate,
|
|
12
|
+
IsArray,
|
|
13
|
+
IsEnum,
|
|
14
|
+
IsObject,
|
|
15
|
+
ValidateNested,
|
|
16
|
+
} from 'class-validator';
|
|
17
|
+
import { Type } from 'class-transformer';
|
|
4
18
|
|
|
5
19
|
<% if (it.importEnums) { %>
|
|
6
20
|
import * as enums from '../../enums';
|
|
@@ -8,70 +22,170 @@ import * as enums from '../../enums';
|
|
|
8
22
|
|
|
9
23
|
export class <%= it.entityName %>Create {
|
|
10
24
|
<% if (it.addDefaultPKProperty && (it.primaryKeyType === 'uuid' || it.primaryKeyType === 'text')) { %>
|
|
25
|
+
@ApiPropertyOptional()
|
|
26
|
+
@IsOptional()
|
|
27
|
+
@IsUUID()
|
|
28
|
+
id?: string;
|
|
29
|
+
|
|
30
|
+
<% } -%>
|
|
31
|
+
<% it.columns.forEach((field) => { -%>
|
|
32
|
+
<% if (!field.required) { -%>
|
|
33
|
+
@ApiPropertyOptional()
|
|
34
|
+
@IsOptional()
|
|
35
|
+
<% } else { -%>
|
|
11
36
|
@ApiProperty()
|
|
12
|
-
|
|
13
|
-
<% }
|
|
14
|
-
<%
|
|
15
|
-
@
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<%= field.name
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<%= field.name
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<%= field.name
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
@IsNotEmpty()
|
|
38
|
+
<% } -%>
|
|
39
|
+
<% if (field.dataType.includes("Enum")) { -%>
|
|
40
|
+
@IsEnum(enums.<%= field.dataType %>)
|
|
41
|
+
<%= field.name %><%= field.required ? '' : '?' %>: enums.<%= field.dataType %>;
|
|
42
|
+
|
|
43
|
+
<% } else if (field.type === 'json' || field.type === 'json-plain') { -%>
|
|
44
|
+
@IsObject()
|
|
45
|
+
<%= field.name %><%= field.required ? '' : '?' %>: Record<string, any>;
|
|
46
|
+
|
|
47
|
+
<% } else if (field.type === 'timestamp' || field.type === 'timestamptz') { -%>
|
|
48
|
+
@IsDate()
|
|
49
|
+
@Type(() => Date)
|
|
50
|
+
<%= field.name %><%= field.required ? '' : '?' %>: Date;
|
|
51
|
+
|
|
52
|
+
<% } else if (field.type === 'uuid') { -%>
|
|
53
|
+
@IsUUID()
|
|
54
|
+
<%= field.name %><%= field.required ? '' : '?' %>: string;
|
|
55
|
+
|
|
56
|
+
<% } else if (field.type === 'geometry' || field.type === 'geography') { -%>
|
|
57
|
+
@IsObject()
|
|
58
|
+
<%= field.name %><%= field.required ? '' : '?' %>: any;
|
|
59
|
+
|
|
60
|
+
<% } else if (field.type === 'point') { -%>
|
|
61
|
+
@IsObject()
|
|
62
|
+
<%= field.name %><%= field.required ? '' : '?' %>: { x: number; y: number };
|
|
63
|
+
|
|
64
|
+
<% } else if (field.type === 'linestring' || field.type === 'multipoint') { -%>
|
|
65
|
+
@IsObject()
|
|
66
|
+
<%= field.name %><%= field.required ? '' : '?' %>: { coordinates: Array<{ x: number; y: number }> };
|
|
67
|
+
|
|
68
|
+
<% } else if (field.type === 'polygon' || field.type === 'multilinestring') { -%>
|
|
69
|
+
@IsObject()
|
|
70
|
+
<%= field.name %><%= field.required ? '' : '?' %>: { coordinates: Array<Array<{ x: number; y: number }>> };
|
|
71
|
+
|
|
72
|
+
<% } else if (field.type === 'multipolygon') { -%>
|
|
73
|
+
@IsObject()
|
|
74
|
+
<%= field.name %><%= field.required ? '' : '?' %>: { coordinates: Array<Array<Array<{ x: number; y: number }>>> };
|
|
75
|
+
|
|
76
|
+
<% } else if (field.type === 'geometrycollection') { -%>
|
|
77
|
+
@IsObject()
|
|
78
|
+
<%= field.name %><%= field.required ? '' : '?' %>: { geometries: Array<any> };
|
|
79
|
+
|
|
80
|
+
<% } else if (field.type === 'array') { -%>
|
|
81
|
+
@IsArray()
|
|
82
|
+
<%= field.name %><%= field.required ? '' : '?' %>: <%= field.dataType %>;
|
|
83
|
+
|
|
84
|
+
<% } else if (field.type === 'boolean') { -%>
|
|
85
|
+
@IsBoolean()
|
|
86
|
+
<%= field.name %><%= field.required ? '' : '?' %>: boolean;
|
|
87
|
+
|
|
88
|
+
<% } else if (field.type === 'integer' || field.type === 'float' || field.type === 'decimal' || field.type === 'numeric') { -%>
|
|
89
|
+
@IsNumber()
|
|
90
|
+
<%= field.name %><%= field.required ? '' : '?' %>: number;
|
|
91
|
+
|
|
92
|
+
<% } else { -%>
|
|
93
|
+
@IsString()
|
|
94
|
+
<%= field.name %><%= field.required ? '' : '?' %>: <%= field.dataType %>;
|
|
95
|
+
|
|
96
|
+
<% } -%>
|
|
97
|
+
<% }) -%>
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export class <%= it.entityName %>Update {
|
|
101
|
+
<% it.columns.forEach((field) => { -%>
|
|
102
|
+
@ApiPropertyOptional()
|
|
103
|
+
@IsOptional()
|
|
104
|
+
<% if (field.dataType.includes("Enum")) { -%>
|
|
105
|
+
@IsEnum(enums.<%= field.dataType %>)
|
|
106
|
+
<%= field.name %>?: enums.<%= field.dataType %>;
|
|
107
|
+
|
|
108
|
+
<% } else if (field.type === 'json' || field.type === 'json-plain') { -%>
|
|
109
|
+
@IsObject()
|
|
110
|
+
<%= field.name %>?: Record<string, any>;
|
|
111
|
+
|
|
112
|
+
<% } else if (field.type === 'timestamp' || field.type === 'timestamptz') { -%>
|
|
113
|
+
@IsDate()
|
|
114
|
+
@Type(() => Date)
|
|
115
|
+
<%= field.name %>?: Date;
|
|
116
|
+
|
|
117
|
+
<% } else if (field.type === 'uuid') { -%>
|
|
118
|
+
@IsUUID()
|
|
119
|
+
<%= field.name %>?: string;
|
|
120
|
+
|
|
121
|
+
<% } else if (field.type === 'geometry' || field.type === 'geography') { -%>
|
|
122
|
+
@IsObject()
|
|
123
|
+
<%= field.name %>?: any;
|
|
124
|
+
|
|
125
|
+
<% } else if (field.type === 'point') { -%>
|
|
126
|
+
@IsObject()
|
|
127
|
+
<%= field.name %>?: { x: number; y: number };
|
|
128
|
+
|
|
129
|
+
<% } else if (field.type === 'linestring' || field.type === 'multipoint') { -%>
|
|
130
|
+
@IsObject()
|
|
131
|
+
<%= field.name %>?: { coordinates: Array<{ x: number; y: number }> };
|
|
132
|
+
|
|
133
|
+
<% } else if (field.type === 'polygon' || field.type === 'multilinestring') { -%>
|
|
134
|
+
@IsObject()
|
|
135
|
+
<%= field.name %>?: { coordinates: Array<Array<{ x: number; y: number }>> };
|
|
136
|
+
|
|
137
|
+
<% } else if (field.type === 'multipolygon') { -%>
|
|
138
|
+
@IsObject()
|
|
139
|
+
<%= field.name %>?: { coordinates: Array<Array<Array<{ x: number; y: number }>>> };
|
|
140
|
+
|
|
141
|
+
<% } else if (field.type === 'geometrycollection') { -%>
|
|
142
|
+
@IsObject()
|
|
143
|
+
<%= field.name %>?: { geometries: Array<any> };
|
|
144
|
+
|
|
145
|
+
<% } else if (field.type === 'array') { -%>
|
|
146
|
+
@IsArray()
|
|
147
|
+
<%= field.name %>?: <%= field.dataType %>;
|
|
148
|
+
|
|
149
|
+
<% } else if (field.type === 'boolean') { -%>
|
|
150
|
+
@IsBoolean()
|
|
151
|
+
<%= field.name %>?: boolean;
|
|
152
|
+
|
|
153
|
+
<% } else if (field.type === 'integer' || field.type === 'float' || field.type === 'decimal' || field.type === 'numeric') { -%>
|
|
154
|
+
@IsNumber()
|
|
155
|
+
<%= field.name %>?: number;
|
|
156
|
+
|
|
157
|
+
<% } else { -%>
|
|
158
|
+
@IsString()
|
|
159
|
+
<%= field.name %>?: <%= field.dataType %>;
|
|
160
|
+
|
|
161
|
+
<% } -%>
|
|
162
|
+
<% }) -%>
|
|
163
|
+
}
|
|
39
164
|
|
|
40
165
|
export class <%= it.entityName %> {
|
|
41
166
|
<% if (it.addDefaultPKProperty) { %>
|
|
42
167
|
@ApiProperty()
|
|
43
168
|
id: <%= (it.primaryKeyType === 'uuid' || it.primaryKeyType === 'text') ? 'string' : 'number' %>;
|
|
44
|
-
|
|
45
|
-
<%
|
|
169
|
+
|
|
170
|
+
<% } -%>
|
|
171
|
+
<% it.columns.forEach((field) => { -%>
|
|
172
|
+
<% if (!field.required) { -%>
|
|
173
|
+
@ApiPropertyOptional()
|
|
174
|
+
<%= field.name %>?: <% if (field.dataType.includes("Enum")) { %>enums.<%= field.dataType %><% } else if (field.type === 'json' || field.type === 'json-plain') { %>Record<string, any><% } else if (field.type === 'timestamp' || field.type === 'timestamptz') { %>Date<% } else { %><%= field.dataType %><% } %>;
|
|
175
|
+
|
|
176
|
+
<% } else { -%>
|
|
46
177
|
@ApiProperty()
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<%= field.name %>: Date;
|
|
53
|
-
<%} else if (field.type === 'geometry' || field.type === 'geography') {%>
|
|
54
|
-
<%= field.name %>: any;
|
|
55
|
-
<%} else if (field.type === 'point') {%>
|
|
56
|
-
<%= field.name %>: { x: number, y: number };
|
|
57
|
-
<%} else if (field.type === 'linestring' || field.type === 'multipoint') {%>
|
|
58
|
-
<%= field.name %>: { coordinates: Array<{ x: number, y: number }> };
|
|
59
|
-
<%} else if (field.type === 'polygon' || field.type === 'multilinestring') {%>
|
|
60
|
-
<%= field.name %>: { coordinates: Array<Array<{ x: number, y: number }>> };
|
|
61
|
-
<%} else if (field.type === 'multipolygon') {%>
|
|
62
|
-
<%= field.name %>: { coordinates: Array<Array<Array<{ x: number, y: number }>>> };
|
|
63
|
-
<%} else if (field.type === 'geometrycollection') {%>
|
|
64
|
-
<%= field.name %>: { geometries: Array<any> };
|
|
65
|
-
<%} else {%>
|
|
66
|
-
<%= field.name %>: <%= field.dataType %>;
|
|
67
|
-
<% } %>
|
|
68
|
-
<% }) %>
|
|
69
|
-
<% if (it.createdAt) { %>
|
|
178
|
+
<%= field.name %>: <% if (field.dataType.includes("Enum")) { %>enums.<%= field.dataType %><% } else if (field.type === 'json' || field.type === 'json-plain') { %>Record<string, any><% } else if (field.type === 'timestamp' || field.type === 'timestamptz') { %>Date<% } else { %><%= field.dataType %><% } %>;
|
|
179
|
+
|
|
180
|
+
<% } -%>
|
|
181
|
+
<% }) -%>
|
|
182
|
+
<% if (it.createdAt) { -%>
|
|
70
183
|
@ApiProperty()
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<%
|
|
184
|
+
createdAt: Date;
|
|
185
|
+
|
|
186
|
+
<% } -%>
|
|
187
|
+
<% if (it.updatedAt) { -%>
|
|
74
188
|
@ApiProperty()
|
|
75
|
-
|
|
76
|
-
<% }
|
|
77
|
-
}
|
|
189
|
+
updatedAt: Date;
|
|
190
|
+
<% } -%>
|
|
191
|
+
}
|
|
@@ -1,25 +1,65 @@
|
|
|
1
1
|
<%~ includeFile('./header.eta') %>
|
|
2
2
|
|
|
3
|
-
import { Injectable } from "@nestjs/common";
|
|
3
|
+
import { Injectable, NotFoundException } from "@nestjs/common";
|
|
4
4
|
import { InjectRepository } from "@nestjs/typeorm";
|
|
5
5
|
import { TypeOrmCrudService } from "@nestjsx/crud-typeorm";
|
|
6
|
-
import { QueryOptions } from '@nestjsx/crud';
|
|
6
|
+
import { QueryOptions, CrudRequest } from '@nestjsx/crud';
|
|
7
7
|
import { ParsedRequestParams } from '@nestjsx/crud-request';
|
|
8
|
+
import { Repository, DeepPartial } from 'typeorm';
|
|
8
9
|
|
|
9
10
|
import {<%= it.entityName %>} from './<%= it.entityName%>.entity'
|
|
10
11
|
|
|
11
12
|
@Injectable()
|
|
12
13
|
export class <%= it.svcName %> extends TypeOrmCrudService<<%= it.entityName %>> {
|
|
13
|
-
constructor(@InjectRepository(<%= it.entityName %>) repo) {
|
|
14
|
+
constructor(@InjectRepository(<%= it.entityName %>) repo: Repository<<%= it.entityName %>>) {
|
|
14
15
|
super(repo);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Solves https://github.com/nestjsx/crud/issues/777
|
|
20
|
+
*/
|
|
21
|
+
getSelect(query: ParsedRequestParams, options: QueryOptions) {
|
|
22
|
+
return [...new Set(super.getSelect(query, options))]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Override updateOne to fix NestJS CRUD bug where PATCH causes INSERT instead of UPDATE.
|
|
27
|
+
* This properly fetches the existing entity, merges with the DTO, then saves.
|
|
28
|
+
*/
|
|
29
|
+
async updateOne(req: CrudRequest, dto: DeepPartial<<%= it.entityName %>>): Promise<<%= it.entityName %>> {
|
|
30
|
+
const id = req.parsed.paramsFilter?.find(f => f.field === 'id')?.value;
|
|
31
|
+
if (!id) {
|
|
32
|
+
throw new NotFoundException('<%= it.entityName %> ID not provided');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const existing = await this.repo.findOne({ where: { id } as any });
|
|
36
|
+
if (!existing) {
|
|
37
|
+
throw new NotFoundException('<%= it.entityName %> not found');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Merge existing entity with DTO and save
|
|
41
|
+
const merged = this.repo.merge(existing, dto as any);
|
|
42
|
+
return this.repo.save(merged);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Override replaceOne to fix NestJS CRUD bug where PUT causes INSERT instead of UPDATE.
|
|
47
|
+
* This properly fetches the existing entity, replaces it with the DTO, then saves.
|
|
48
|
+
*/
|
|
49
|
+
async replaceOne(req: CrudRequest, dto: DeepPartial<<%= it.entityName %>>): Promise<<%= it.entityName %>> {
|
|
50
|
+
const id = req.parsed.paramsFilter?.find(f => f.field === 'id')?.value;
|
|
51
|
+
if (!id) {
|
|
52
|
+
throw new NotFoundException('<%= it.entityName %> ID not provided');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const existing = await this.repo.findOne({ where: { id } as any });
|
|
56
|
+
if (!existing) {
|
|
57
|
+
throw new NotFoundException('<%= it.entityName %> not found');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Replace with DTO (keeping the ID) and save
|
|
61
|
+
const replaced = { ...dto, id: existing.id } as <%= it.entityName %>;
|
|
62
|
+
return this.repo.save(replaced);
|
|
63
|
+
}
|
|
24
64
|
}
|
|
25
65
|
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { Entity } from "./entity";
|
|
2
|
+
import { AuthConfig } from "./auth";
|
|
3
|
+
import { RelationshipMap, Relationship } from "./relationship";
|
|
4
|
+
/**
|
|
5
|
+
* Supported target languages for code generation
|
|
6
|
+
*/
|
|
7
|
+
export type TargetLanguage = "typescript" | "python" | "go";
|
|
8
|
+
/**
|
|
9
|
+
* Represents a file to be generated
|
|
10
|
+
*/
|
|
11
|
+
export interface GeneratedFile {
|
|
12
|
+
/**
|
|
13
|
+
* The relative path where the file should be created
|
|
14
|
+
*/
|
|
15
|
+
path: string;
|
|
16
|
+
/**
|
|
17
|
+
* The content of the file
|
|
18
|
+
*/
|
|
19
|
+
content: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Result of validating a configuration for a specific language
|
|
23
|
+
*/
|
|
24
|
+
export interface ValidationResult {
|
|
25
|
+
/**
|
|
26
|
+
* Whether the configuration is valid
|
|
27
|
+
*/
|
|
28
|
+
valid: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* List of validation errors, if any
|
|
31
|
+
*/
|
|
32
|
+
errors: string[];
|
|
33
|
+
/**
|
|
34
|
+
* List of validation warnings (non-fatal issues)
|
|
35
|
+
*/
|
|
36
|
+
warnings: string[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Language-specific configuration options
|
|
40
|
+
*/
|
|
41
|
+
export interface PythonLanguageConfig {
|
|
42
|
+
/**
|
|
43
|
+
* Python package name (snake_case)
|
|
44
|
+
*/
|
|
45
|
+
packageName?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to use async mode for SQLAlchemy
|
|
48
|
+
*/
|
|
49
|
+
asyncMode?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Database URL for connection
|
|
52
|
+
*/
|
|
53
|
+
databaseUrl?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface GoLanguageConfig {
|
|
56
|
+
/**
|
|
57
|
+
* Go module name (e.g., "github.com/user/project")
|
|
58
|
+
*/
|
|
59
|
+
moduleName?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Package name for the main module
|
|
62
|
+
*/
|
|
63
|
+
packageName?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Gin mode: "debug" | "release" | "test"
|
|
66
|
+
*/
|
|
67
|
+
ginMode?: "debug" | "release" | "test";
|
|
68
|
+
}
|
|
69
|
+
export interface TypeScriptLanguageConfig {
|
|
70
|
+
/**
|
|
71
|
+
* Whether to use strict TypeScript mode
|
|
72
|
+
*/
|
|
73
|
+
strictMode?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Union type of all language-specific configurations
|
|
77
|
+
*/
|
|
78
|
+
export type LanguageConfig = PythonLanguageConfig | GoLanguageConfig | TypeScriptLanguageConfig;
|
|
79
|
+
/**
|
|
80
|
+
* Extended configuration including language settings
|
|
81
|
+
*/
|
|
82
|
+
export interface GeneratorConfig {
|
|
83
|
+
/**
|
|
84
|
+
* Target language for code generation
|
|
85
|
+
*/
|
|
86
|
+
language: TargetLanguage;
|
|
87
|
+
/**
|
|
88
|
+
* Root folder for source code
|
|
89
|
+
*/
|
|
90
|
+
rootFolder: string;
|
|
91
|
+
/**
|
|
92
|
+
* API type: "rest" or "graphql"
|
|
93
|
+
*/
|
|
94
|
+
apiType: string;
|
|
95
|
+
/**
|
|
96
|
+
* All entities from the configuration
|
|
97
|
+
*/
|
|
98
|
+
entities: Entity[];
|
|
99
|
+
/**
|
|
100
|
+
* Relationship map for all entities
|
|
101
|
+
*/
|
|
102
|
+
relationshipMap: RelationshipMap;
|
|
103
|
+
/**
|
|
104
|
+
* Authentication configuration (optional)
|
|
105
|
+
*/
|
|
106
|
+
auth?: AuthConfig;
|
|
107
|
+
/**
|
|
108
|
+
* Language-specific configuration options
|
|
109
|
+
*/
|
|
110
|
+
languageConfig?: LanguageConfig;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Options for generating an entity
|
|
114
|
+
*/
|
|
115
|
+
export interface EntityGenerationOptions {
|
|
116
|
+
/**
|
|
117
|
+
* The entity definition
|
|
118
|
+
*/
|
|
119
|
+
entity: Entity;
|
|
120
|
+
/**
|
|
121
|
+
* Relationships for this entity
|
|
122
|
+
*/
|
|
123
|
+
relationships: Relationship[];
|
|
124
|
+
/**
|
|
125
|
+
* All entities (for cross-referencing)
|
|
126
|
+
*/
|
|
127
|
+
allEntities: Entity[];
|
|
128
|
+
/**
|
|
129
|
+
* API type being generated
|
|
130
|
+
*/
|
|
131
|
+
apiType: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Options for generating controllers/routers
|
|
135
|
+
*/
|
|
136
|
+
export interface ControllerGenerationOptions extends EntityGenerationOptions {
|
|
137
|
+
/**
|
|
138
|
+
* Relationship map for join queries
|
|
139
|
+
*/
|
|
140
|
+
relationshipMap: RelationshipMap;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Options for generating services
|
|
144
|
+
*/
|
|
145
|
+
export interface ServiceGenerationOptions extends EntityGenerationOptions {
|
|
146
|
+
/**
|
|
147
|
+
* Relationship map for service methods
|
|
148
|
+
*/
|
|
149
|
+
relationshipMap: RelationshipMap;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Options for generating DTOs/schemas
|
|
153
|
+
*/
|
|
154
|
+
export interface DtoGenerationOptions extends EntityGenerationOptions {
|
|
155
|
+
/**
|
|
156
|
+
* Include validation decorators/rules
|
|
157
|
+
*/
|
|
158
|
+
includeValidation?: boolean;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Options for generating migrations
|
|
162
|
+
*/
|
|
163
|
+
export interface MigrationGenerationOptions {
|
|
164
|
+
/**
|
|
165
|
+
* All entities to generate migrations for
|
|
166
|
+
*/
|
|
167
|
+
entities: Entity[];
|
|
168
|
+
/**
|
|
169
|
+
* Relationship map for foreign keys
|
|
170
|
+
*/
|
|
171
|
+
relationshipMap: RelationshipMap;
|
|
172
|
+
/**
|
|
173
|
+
* Migration name/version
|
|
174
|
+
*/
|
|
175
|
+
migrationName?: string;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Interface that all language-specific generators must implement
|
|
179
|
+
*/
|
|
180
|
+
export interface LanguageGenerator {
|
|
181
|
+
/**
|
|
182
|
+
* Get the target language this generator supports
|
|
183
|
+
*/
|
|
184
|
+
getLanguage(): TargetLanguage;
|
|
185
|
+
/**
|
|
186
|
+
* Get the file extension for generated files
|
|
187
|
+
*/
|
|
188
|
+
getFileExtension(): string;
|
|
189
|
+
/**
|
|
190
|
+
* Validate the configuration for this language
|
|
191
|
+
*/
|
|
192
|
+
validateConfig(config: GeneratorConfig): ValidationResult;
|
|
193
|
+
/**
|
|
194
|
+
* Generate entity/model files
|
|
195
|
+
*/
|
|
196
|
+
generateEntity(options: EntityGenerationOptions): Promise<GeneratedFile[]>;
|
|
197
|
+
/**
|
|
198
|
+
* Generate controller/router files
|
|
199
|
+
*/
|
|
200
|
+
generateController(options: ControllerGenerationOptions): Promise<GeneratedFile[]>;
|
|
201
|
+
/**
|
|
202
|
+
* Generate service files
|
|
203
|
+
*/
|
|
204
|
+
generateService(options: ServiceGenerationOptions): Promise<GeneratedFile[]>;
|
|
205
|
+
/**
|
|
206
|
+
* Generate DTO/schema files
|
|
207
|
+
*/
|
|
208
|
+
generateDto(options: DtoGenerationOptions): Promise<GeneratedFile[]>;
|
|
209
|
+
/**
|
|
210
|
+
* Generate module/router registration files
|
|
211
|
+
*/
|
|
212
|
+
generateModule(options: EntityGenerationOptions): Promise<GeneratedFile[]>;
|
|
213
|
+
/**
|
|
214
|
+
* Generate migration files
|
|
215
|
+
*/
|
|
216
|
+
generateMigration(options: MigrationGenerationOptions): Promise<GeneratedFile[]>;
|
|
217
|
+
/**
|
|
218
|
+
* Generate enum files for all entities
|
|
219
|
+
*/
|
|
220
|
+
generateEnums(entities: Entity[], apiType: string): Promise<GeneratedFile[]>;
|
|
221
|
+
/**
|
|
222
|
+
* Generate the index/main module file that ties everything together
|
|
223
|
+
*/
|
|
224
|
+
generateIndexModule(entities: Entity[], apiType: string): Promise<GeneratedFile[]>;
|
|
225
|
+
/**
|
|
226
|
+
* Generate guard files (auth, scope, etc.)
|
|
227
|
+
*/
|
|
228
|
+
generateGuards(entities: Entity[], auth?: AuthConfig): Promise<GeneratedFile[]>;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Factory function type for creating language generators
|
|
232
|
+
*/
|
|
233
|
+
export type GeneratorFactory = (config: GeneratorConfig) => LanguageGenerator;
|
|
234
|
+
/**
|
|
235
|
+
* Registry of available generators by language
|
|
236
|
+
*/
|
|
237
|
+
export interface GeneratorRegistry {
|
|
238
|
+
typescript: GeneratorFactory;
|
|
239
|
+
python?: GeneratorFactory;
|
|
240
|
+
go?: GeneratorFactory;
|
|
241
|
+
}
|
|
@@ -4,3 +4,4 @@ export { Index } from "./indices";
|
|
|
4
4
|
export { JSONValue } from "./json";
|
|
5
5
|
export { RelationshipType, Association, ApsorcRelationship, Relationship, RelationshipForTemplate, RelationshipMap, } from "./relationship";
|
|
6
6
|
export { AuthProviderType, BaseAuthConfig, DbSessionAuthConfig, JwtConfig, JwtClaimsMapping, JwtAuthConfig, ApiKeyAuthConfig, AuthConfig, AuthContext, DB_SESSION_AUTH_DEFAULTS, JWT_AUTH_DEFAULTS, API_KEY_AUTH_DEFAULTS, isDbSessionAuth, isJwtAuth, isApiKeyAuth, } from "./auth";
|
|
7
|
+
export { TargetLanguage, GeneratedFile, ValidationResult, PythonLanguageConfig, GoLanguageConfig, TypeScriptLanguageConfig, LanguageConfig, GeneratorConfig, EntityGenerationOptions, ControllerGenerationOptions, ServiceGenerationOptions, DtoGenerationOptions, MigrationGenerationOptions, LanguageGenerator, GeneratorFactory, GeneratorRegistry, } from "./generator";
|
package/dist/lib/utils/casing.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pascalCase = exports.snakeCase = exports.camelCase = void 0;
|
|
3
|
+
exports.kebabCase = exports.pascalCase = exports.snakeCase = exports.camelCase = void 0;
|
|
4
4
|
function camelCase(str) {
|
|
5
5
|
return (str
|
|
6
6
|
// Insert a space before all caps that are followed by lower case (for PascalCase)
|
|
@@ -24,3 +24,13 @@ function pascalCase(str) {
|
|
|
24
24
|
return c.charAt(0).toUpperCase() + c.slice(1);
|
|
25
25
|
}
|
|
26
26
|
exports.pascalCase = pascalCase;
|
|
27
|
+
function kebabCase(str) {
|
|
28
|
+
return str
|
|
29
|
+
// Insert a hyphen before all caps that are followed by lower case (for PascalCase)
|
|
30
|
+
.replace(/([\da-z])([A-Z])/g, "$1-$2")
|
|
31
|
+
// Replace all separators with hyphens
|
|
32
|
+
.replace(/[ _]+/g, "-")
|
|
33
|
+
// Lowercase the entire string
|
|
34
|
+
.toLowerCase();
|
|
35
|
+
}
|
|
36
|
+
exports.kebabCase = kebabCase;
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.8.2",
|
|
3
3
|
"commands": {
|
|
4
4
|
"server:new": {
|
|
5
5
|
"id": "server:new",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"pluginType": "core",
|
|
11
11
|
"aliases": [],
|
|
12
12
|
"examples": [
|
|
13
|
-
"$ apso server new --name TestProject"
|
|
13
|
+
"$ apso server new --name TestProject",
|
|
14
|
+
"$ apso server new --name TestProject --language python",
|
|
15
|
+
"$ apso server new --name TestProject --language go"
|
|
14
16
|
],
|
|
15
17
|
"flags": {
|
|
16
18
|
"name": {
|
|
@@ -26,6 +28,18 @@
|
|
|
26
28
|
"char": "t",
|
|
27
29
|
"description": "api type (rest or graphql)",
|
|
28
30
|
"multiple": false
|
|
31
|
+
},
|
|
32
|
+
"language": {
|
|
33
|
+
"name": "language",
|
|
34
|
+
"type": "option",
|
|
35
|
+
"char": "l",
|
|
36
|
+
"description": "target language (typescript, python, go)",
|
|
37
|
+
"multiple": false,
|
|
38
|
+
"options": [
|
|
39
|
+
"typescript",
|
|
40
|
+
"python",
|
|
41
|
+
"go"
|
|
42
|
+
]
|
|
29
43
|
}
|
|
30
44
|
},
|
|
31
45
|
"args": {
|
|
@@ -43,7 +57,11 @@
|
|
|
43
57
|
"pluginType": "core",
|
|
44
58
|
"aliases": [],
|
|
45
59
|
"examples": [
|
|
46
|
-
"$ apso server scaffold"
|
|
60
|
+
"$ apso server scaffold",
|
|
61
|
+
"$ apso server scaffold --skip-format",
|
|
62
|
+
"$ apso server scaffold --language typescript",
|
|
63
|
+
"$ apso server scaffold --language python",
|
|
64
|
+
"$ apso server scaffold --language go"
|
|
47
65
|
],
|
|
48
66
|
"flags": {
|
|
49
67
|
"help": {
|
|
@@ -52,6 +70,24 @@
|
|
|
52
70
|
"char": "h",
|
|
53
71
|
"description": "Show CLI help.",
|
|
54
72
|
"allowNo": false
|
|
73
|
+
},
|
|
74
|
+
"skip-format": {
|
|
75
|
+
"name": "skip-format",
|
|
76
|
+
"type": "boolean",
|
|
77
|
+
"description": "Skip the formatting step (useful when prettier is not available)",
|
|
78
|
+
"allowNo": false
|
|
79
|
+
},
|
|
80
|
+
"language": {
|
|
81
|
+
"name": "language",
|
|
82
|
+
"type": "option",
|
|
83
|
+
"char": "l",
|
|
84
|
+
"description": "Target language for code generation (typescript, python, go). If not specified, uses .apsorc config or prompts.",
|
|
85
|
+
"multiple": false,
|
|
86
|
+
"options": [
|
|
87
|
+
"typescript",
|
|
88
|
+
"python",
|
|
89
|
+
"go"
|
|
90
|
+
]
|
|
55
91
|
}
|
|
56
92
|
},
|
|
57
93
|
"args": {}
|