@simway/spica 0.0.0-stage → 0.1.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/LICENSE +190 -0
- package/dist/admValidator.d.ts +28 -0
- package/dist/admValidator.d.ts.map +1 -0
- package/dist/admValidator.js +233 -0
- package/dist/admValidator.js.map +1 -0
- package/dist/contractProjector.d.ts +23 -0
- package/dist/contractProjector.d.ts.map +1 -0
- package/dist/contractProjector.js +269 -0
- package/dist/contractProjector.js.map +1 -0
- package/dist/dddCrewParser.d.ts +11 -0
- package/dist/dddCrewParser.d.ts.map +1 -0
- package/dist/dddCrewParser.js +519 -0
- package/dist/dddCrewParser.js.map +1 -0
- package/dist/dddCrewProjector.d.ts +16 -0
- package/dist/dddCrewProjector.d.ts.map +1 -0
- package/dist/dddCrewProjector.js +227 -0
- package/dist/dddCrewProjector.js.map +1 -0
- package/dist/defaultTemplate.d.ts +3 -0
- package/dist/defaultTemplate.d.ts.map +1 -0
- package/dist/defaultTemplate.js +1442 -0
- package/dist/defaultTemplate.js.map +1 -0
- package/dist/excalidrawProjector.d.ts +56 -0
- package/dist/excalidrawProjector.d.ts.map +1 -0
- package/dist/excalidrawProjector.js +235 -0
- package/dist/excalidrawProjector.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/openApiProjector.d.ts +17 -0
- package/dist/openApiProjector.d.ts.map +1 -0
- package/dist/openApiProjector.js +298 -0
- package/dist/openApiProjector.js.map +1 -0
- package/dist/schema.d.ts +670 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +296 -0
- package/dist/schema.js.map +1 -0
- package/dist/templates/aggregate-design-canvas-v1.1.excalidraw.json +1441 -0
- package/package.json +24 -3
- package/README.md +0 -3
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projects a validated AstRoot into a pure OpenAPI 3.0.3 specification object.
|
|
3
|
+
* Maps creation commands, mutation commands, and entity query projections deterministically.
|
|
4
|
+
*/
|
|
5
|
+
export function projectOpenApi3Spec(model) {
|
|
6
|
+
const paths = {};
|
|
7
|
+
const schemas = {};
|
|
8
|
+
// Standard Error Envelope Schemas
|
|
9
|
+
schemas["InvariantViolation"] = {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
error: { type: "string", example: "INVARIANT_VIOLATION" },
|
|
13
|
+
message: { type: "string", example: "Business rule violation" },
|
|
14
|
+
rule: { type: "string", example: "RuleName" }
|
|
15
|
+
},
|
|
16
|
+
required: ["error", "message"]
|
|
17
|
+
};
|
|
18
|
+
schemas["AggregateNotFound"] = {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
error: { type: "string", example: "AGGREGATE_NOT_FOUND" },
|
|
22
|
+
message: { type: "string", example: "Target aggregate instance was not found" },
|
|
23
|
+
aggregate: { type: "string", example: "AggregateName" },
|
|
24
|
+
id: { type: "string", example: "123e4567-e89b-12d3-a456-426614174000" }
|
|
25
|
+
},
|
|
26
|
+
required: ["error", "message", "aggregate", "id"]
|
|
27
|
+
};
|
|
28
|
+
for (const agg of model.aggregates) {
|
|
29
|
+
const pluralPath = toPluralKebab(agg.name);
|
|
30
|
+
const tag = agg.name;
|
|
31
|
+
// 1. Generate EntityNode Schemas for this AggregateNode
|
|
32
|
+
for (const entity of agg.entities ?? []) {
|
|
33
|
+
schemas[entity.name] = entityToOpenApiSchema(entity);
|
|
34
|
+
}
|
|
35
|
+
// 2. Query Endpoint: GET /api/{plural}/{id}
|
|
36
|
+
const queryPath = `/api/${pluralPath}/{id}`;
|
|
37
|
+
if (!paths[queryPath]) {
|
|
38
|
+
paths[queryPath] = {};
|
|
39
|
+
}
|
|
40
|
+
paths[queryPath]["get"] = {
|
|
41
|
+
tags: [tag],
|
|
42
|
+
summary: `Get ${agg.name} by ID`,
|
|
43
|
+
description: `Retrieves the current state projection of ${agg.name} aggregate instance.`,
|
|
44
|
+
operationId: `get${agg.name}ById`,
|
|
45
|
+
parameters: [
|
|
46
|
+
{
|
|
47
|
+
name: "id",
|
|
48
|
+
in: "path",
|
|
49
|
+
required: true,
|
|
50
|
+
description: `Unique identifier of the ${agg.name}`,
|
|
51
|
+
schema: { type: "string" }
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
responses: {
|
|
55
|
+
"200": {
|
|
56
|
+
description: `${agg.name} aggregate state retrieved successfully`,
|
|
57
|
+
content: {
|
|
58
|
+
"application/json": {
|
|
59
|
+
schema: {
|
|
60
|
+
$ref: `#/components/schemas/${agg.rootEntity}`
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"404": {
|
|
66
|
+
description: `${agg.name} not found`,
|
|
67
|
+
content: {
|
|
68
|
+
"application/json": {
|
|
69
|
+
schema: {
|
|
70
|
+
$ref: "#/components/schemas/AggregateNotFound"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
// 3. CommandNode Endpoints
|
|
78
|
+
for (const cmd of agg.commands ?? []) {
|
|
79
|
+
const isCreation = cmd.isCreation || (!cmd.requiredState && cmd.targetState);
|
|
80
|
+
const reqSchemaName = `${cmd.name}Request`;
|
|
81
|
+
schemas[reqSchemaName] = commandToRequestSchema(cmd);
|
|
82
|
+
if (isCreation) {
|
|
83
|
+
// Creation CommandNode: POST /api/{plural}
|
|
84
|
+
const createPath = `/api/${pluralPath}`;
|
|
85
|
+
if (!paths[createPath]) {
|
|
86
|
+
paths[createPath] = {};
|
|
87
|
+
}
|
|
88
|
+
const requestBody = buildRequestBody(cmd, reqSchemaName);
|
|
89
|
+
paths[createPath]["post"] = {
|
|
90
|
+
tags: [tag],
|
|
91
|
+
summary: cmd.name,
|
|
92
|
+
description: `Creates a new ${agg.name} aggregate instance in state '${cmd.targetState || "Active"}'.`,
|
|
93
|
+
operationId: cmd.name,
|
|
94
|
+
...(requestBody ? { requestBody } : {}),
|
|
95
|
+
responses: {
|
|
96
|
+
"201": {
|
|
97
|
+
description: `${agg.name} created successfully`,
|
|
98
|
+
content: {
|
|
99
|
+
"application/json": {
|
|
100
|
+
schema: {
|
|
101
|
+
$ref: `#/components/schemas/${agg.rootEntity}`
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"400": {
|
|
107
|
+
description: "Invalid creation parameters or invariant violation",
|
|
108
|
+
content: {
|
|
109
|
+
"application/json": {
|
|
110
|
+
schema: {
|
|
111
|
+
$ref: "#/components/schemas/InvariantViolation"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
// Mutation CommandNode: POST /api/{plural}/{id}/{action}
|
|
121
|
+
const actionKebab = toKebabCase(cmd.name);
|
|
122
|
+
const actionPath = `/api/${pluralPath}/{id}/${actionKebab}`;
|
|
123
|
+
if (!paths[actionPath]) {
|
|
124
|
+
paths[actionPath] = {};
|
|
125
|
+
}
|
|
126
|
+
const requestBody = buildRequestBody(cmd, reqSchemaName);
|
|
127
|
+
paths[actionPath]["post"] = {
|
|
128
|
+
tags: [tag],
|
|
129
|
+
summary: cmd.name,
|
|
130
|
+
description: `Executes '${cmd.name}' on ${agg.name}. Requires state: '${cmd.requiredState}'. Transitions to: '${cmd.targetState || cmd.requiredState}'.`,
|
|
131
|
+
operationId: cmd.name,
|
|
132
|
+
parameters: [
|
|
133
|
+
{
|
|
134
|
+
name: "id",
|
|
135
|
+
in: "path",
|
|
136
|
+
required: true,
|
|
137
|
+
description: `Unique identifier of the ${agg.name}`,
|
|
138
|
+
schema: { type: "string" }
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
...(requestBody ? { requestBody } : {}),
|
|
142
|
+
responses: {
|
|
143
|
+
"200": {
|
|
144
|
+
description: `${cmd.name} executed successfully`,
|
|
145
|
+
content: {
|
|
146
|
+
"application/json": {
|
|
147
|
+
schema: {
|
|
148
|
+
$ref: `#/components/schemas/${agg.rootEntity}`
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"400": {
|
|
154
|
+
description: "Invalid state transition or invariant violation",
|
|
155
|
+
content: {
|
|
156
|
+
"application/json": {
|
|
157
|
+
schema: {
|
|
158
|
+
$ref: "#/components/schemas/InvariantViolation"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"404": {
|
|
164
|
+
description: `${agg.name} not found`,
|
|
165
|
+
content: {
|
|
166
|
+
"application/json": {
|
|
167
|
+
schema: {
|
|
168
|
+
$ref: "#/components/schemas/AggregateNotFound"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
openapi: "3.0.3",
|
|
180
|
+
info: {
|
|
181
|
+
title: model.systemName || model.domainName,
|
|
182
|
+
version: model.virgoVersion,
|
|
183
|
+
description: model.systemDescription || `API specification for ${model.domainName} domain.`
|
|
184
|
+
},
|
|
185
|
+
paths,
|
|
186
|
+
components: {
|
|
187
|
+
schemas
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function entityToOpenApiSchema(entity) {
|
|
192
|
+
const properties = {};
|
|
193
|
+
const required = [];
|
|
194
|
+
for (const field of entity.fields) {
|
|
195
|
+
properties[field.name] = fieldToPropertySchema(field);
|
|
196
|
+
if (field.required) {
|
|
197
|
+
required.push(field.name);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
type: "object",
|
|
202
|
+
properties,
|
|
203
|
+
...(required.length > 0 ? { required } : {})
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
function commandToRequestSchema(cmd) {
|
|
207
|
+
const properties = {};
|
|
208
|
+
const required = [];
|
|
209
|
+
for (const param of cmd.parameters || []) {
|
|
210
|
+
properties[param.name] = fieldToPropertySchema(param);
|
|
211
|
+
if (param.required) {
|
|
212
|
+
required.push(param.name);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
type: "object",
|
|
217
|
+
properties,
|
|
218
|
+
...(required.length > 0 ? { required } : {})
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function fieldToPropertySchema(field) {
|
|
222
|
+
let baseSchema;
|
|
223
|
+
switch (field.type.toLowerCase()) {
|
|
224
|
+
case "string":
|
|
225
|
+
baseSchema = { type: "string" };
|
|
226
|
+
break;
|
|
227
|
+
case "number":
|
|
228
|
+
baseSchema = { type: "number" };
|
|
229
|
+
break;
|
|
230
|
+
case "integer":
|
|
231
|
+
baseSchema = { type: "integer" };
|
|
232
|
+
break;
|
|
233
|
+
case "boolean":
|
|
234
|
+
baseSchema = { type: "boolean" };
|
|
235
|
+
break;
|
|
236
|
+
case "date":
|
|
237
|
+
baseSchema = { type: "string", format: "date" };
|
|
238
|
+
break;
|
|
239
|
+
case "datetime":
|
|
240
|
+
baseSchema = { type: "string", format: "date-time" };
|
|
241
|
+
break;
|
|
242
|
+
default:
|
|
243
|
+
baseSchema = { type: "string" };
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
if (field.description) {
|
|
247
|
+
baseSchema.description = field.description;
|
|
248
|
+
}
|
|
249
|
+
if (field.isList) {
|
|
250
|
+
return {
|
|
251
|
+
type: "array",
|
|
252
|
+
items: baseSchema
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
return baseSchema;
|
|
256
|
+
}
|
|
257
|
+
function buildRequestBody(cmd, schemaName) {
|
|
258
|
+
if (!cmd.parameters || cmd.parameters.length === 0) {
|
|
259
|
+
return undefined;
|
|
260
|
+
}
|
|
261
|
+
return {
|
|
262
|
+
required: true,
|
|
263
|
+
content: {
|
|
264
|
+
"application/json": {
|
|
265
|
+
schema: {
|
|
266
|
+
$ref: `#/components/schemas/${schemaName}`
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Converts PascalCase string into kebab-case.
|
|
274
|
+
* e.g. "RegisterPatron" -> "register-patron", "PayFee" -> "pay-fee"
|
|
275
|
+
*/
|
|
276
|
+
export function toKebabCase(str) {
|
|
277
|
+
if (!str)
|
|
278
|
+
return "";
|
|
279
|
+
return String(str)
|
|
280
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1-$2")
|
|
281
|
+
.replace(/[\s_]+/g, "-")
|
|
282
|
+
.toLowerCase();
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Converts PascalCase AggregateNode Name into pluralized kebab-case.
|
|
286
|
+
* e.g. "Patron" -> "patrons", "BookCopy" -> "book-copies", "Hold" -> "holds"
|
|
287
|
+
*/
|
|
288
|
+
export function toPluralKebab(name) {
|
|
289
|
+
const kebab = toKebabCase(name);
|
|
290
|
+
if (kebab.endsWith("y") && !kebab.endsWith("ey") && !kebab.endsWith("ay")) {
|
|
291
|
+
return `${kebab.slice(0, -1)}ies`;
|
|
292
|
+
}
|
|
293
|
+
if (kebab.endsWith("s") || kebab.endsWith("ch") || kebab.endsWith("sh")) {
|
|
294
|
+
return `${kebab}es`;
|
|
295
|
+
}
|
|
296
|
+
return `${kebab}s`;
|
|
297
|
+
}
|
|
298
|
+
//# sourceMappingURL=openApiProjector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openApiProjector.js","sourceRoot":"","sources":["../src/openApiProjector.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,MAAM,KAAK,GAAw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