eventmodeler 0.6.0 → 0.6.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/index.js +7133 -34
- package/package.json +5 -4
- package/dist/api/client-config.js +0 -10
- package/dist/api/generated/client/client.gen.js +0 -235
- package/dist/api/generated/client/index.js +0 -6
- package/dist/api/generated/client/types.gen.js +0 -2
- package/dist/api/generated/client/utils.gen.js +0 -228
- package/dist/api/generated/client.gen.js +0 -4
- package/dist/api/generated/core/auth.gen.js +0 -14
- package/dist/api/generated/core/bodySerializer.gen.js +0 -57
- package/dist/api/generated/core/params.gen.js +0 -100
- package/dist/api/generated/core/pathSerializer.gen.js +0 -106
- package/dist/api/generated/core/queryKeySerializer.gen.js +0 -92
- package/dist/api/generated/core/serverSentEvents.gen.js +0 -133
- package/dist/api/generated/core/types.gen.js +0 -2
- package/dist/api/generated/core/utils.gen.js +0 -87
- package/dist/api/generated/index.js +0 -2
- package/dist/api/generated/sdk.gen.js +0 -4222
- package/dist/api/generated/types.gen.js +0 -2
- package/dist/api/generated/zod.gen.js +0 -7217
- package/dist/commands/add.js +0 -315
- package/dist/commands/auth.js +0 -14
- package/dist/commands/create.js +0 -192
- package/dist/commands/design.js +0 -108
- package/dist/commands/guide.js +0 -15
- package/dist/commands/init.js +0 -21
- package/dist/commands/list-schemas.js +0 -177
- package/dist/commands/list.js +0 -39
- package/dist/commands/loop.js +0 -101
- package/dist/commands/map.js +0 -40
- package/dist/commands/mark.js +0 -27
- package/dist/commands/move.js +0 -35
- package/dist/commands/remove.js +0 -170
- package/dist/commands/rename.js +0 -53
- package/dist/commands/resize.js +0 -30
- package/dist/commands/search.js +0 -14
- package/dist/commands/set.js +0 -199
- package/dist/commands/show-schemas.js +0 -259
- package/dist/commands/show.js +0 -56
- package/dist/commands/summary.js +0 -13
- package/dist/commands/update.js +0 -240
- package/dist/lib/auth.js +0 -331
- package/dist/lib/config.js +0 -80
- package/dist/lib/excalidraw-schema.js +0 -66
- package/dist/lib/globals.js +0 -8
- package/dist/lib/model.js +0 -11
- package/dist/lib/project-config.js +0 -103
- package/dist/lib/resolve.js +0 -59
- package/dist/lib/scenario.js +0 -15
- package/dist/slices/add-scenario/index.js +0 -103
- package/dist/slices/guide/guides/codegen.js +0 -339
- package/dist/slices/guide/guides/connect-slices.js +0 -202
- package/dist/slices/guide/guides/create-slices.js +0 -273
- package/dist/slices/guide/guides/explore.js +0 -238
- package/dist/slices/guide/guides/information-flow.js +0 -304
- package/dist/slices/guide/guides/scenarios.js +0 -214
- package/dist/slices/guide/index.js +0 -40
- package/dist/slices/help/index.js +0 -96
- package/dist/slices/help/topics/build-codegen.js +0 -109
- package/dist/slices/help/topics/build-slice.js +0 -147
- package/dist/slices/help/topics/check-completeness.js +0 -57
- package/dist/slices/help/topics/connect-slices.js +0 -99
- package/dist/slices/help/topics/explore-model.js +0 -112
- package/dist/slices/help/topics/json-reference.js +0 -188
- package/dist/slices/help/topics/linked-copies.js +0 -89
- package/dist/slices/help/topics/manipulate-canvas.js +0 -150
- package/dist/slices/help/topics/write-scenarios.js +0 -162
- package/dist/slices/init/index.js +0 -86
- package/dist/slices/init/loop.js +0 -60
- package/dist/slices/login/index.js +0 -20
- package/dist/slices/logout/index.js +0 -14
- package/dist/slices/open-app/index.js +0 -36
- package/dist/slices/whoami/index.js +0 -19
package/dist/commands/resize.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { getGlobalId } from '../lib/globals';
|
|
2
|
-
import { requireModelId } from '../lib/model';
|
|
3
|
-
import { resolve, unwrap, elementIdKey } from '../lib/resolve';
|
|
4
|
-
import * as sdk from '../api/generated/sdk.gen';
|
|
5
|
-
const RESIZE_MAP = {
|
|
6
|
-
slice: sdk.resizeSlice,
|
|
7
|
-
aggregate: sdk.resizeAggregate,
|
|
8
|
-
actor: sdk.resizeActor,
|
|
9
|
-
chapter: sdk.resizeChapter,
|
|
10
|
-
context: sdk.resizeContext,
|
|
11
|
-
swimlane: sdk.resizeSwimLane,
|
|
12
|
-
};
|
|
13
|
-
export function registerResizeCommands(program) {
|
|
14
|
-
program.command('resize <type> [name]')
|
|
15
|
-
.description('Resize an element')
|
|
16
|
-
.requiredOption('--x <n>', 'X coordinate', Number)
|
|
17
|
-
.requiredOption('--y <n>', 'Y coordinate', Number)
|
|
18
|
-
.requiredOption('--width <n>', 'Width', Number)
|
|
19
|
-
.requiredOption('--height <n>', 'Height', Number)
|
|
20
|
-
.action(async (type, name, opts, cmd) => {
|
|
21
|
-
const modelId = requireModelId();
|
|
22
|
-
const fn = RESIZE_MAP[type];
|
|
23
|
-
if (!fn)
|
|
24
|
-
throw new Error(`Unknown type: ${type}. Valid types: ${Object.keys(RESIZE_MAP).join(', ')}`);
|
|
25
|
-
const id = await resolve(modelId, type, name ?? '', getGlobalId());
|
|
26
|
-
const key = elementIdKey(type);
|
|
27
|
-
unwrap(await fn({ body: { modelId, [key]: id, x: opts.x, y: opts.y, width: opts.width, height: opts.height } }));
|
|
28
|
-
console.log(`Resized ${type}.`);
|
|
29
|
-
});
|
|
30
|
-
}
|
package/dist/commands/search.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { requireModelId } from '../lib/model';
|
|
2
|
-
import { unwrap, out } from '../lib/resolve';
|
|
3
|
-
import * as sdk from '../api/generated/sdk.gen';
|
|
4
|
-
import { SEARCH_HELP } from './list-schemas';
|
|
5
|
-
export function registerSearchCommands(program) {
|
|
6
|
-
program.command('search <term...>')
|
|
7
|
-
.description('Search elements by name')
|
|
8
|
-
.addHelpText('after', SEARCH_HELP)
|
|
9
|
-
.action(async (terms) => {
|
|
10
|
-
const modelId = requireModelId();
|
|
11
|
-
const search = terms.join(' ');
|
|
12
|
-
out(unwrap(await sdk.search({ path: { modelId }, query: { search } })));
|
|
13
|
-
});
|
|
14
|
-
}
|
package/dist/commands/set.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { getGlobalId } from '../lib/globals';
|
|
2
|
-
import { requireModelId } from '../lib/model';
|
|
3
|
-
import { resolve, unwrap } from '../lib/resolve';
|
|
4
|
-
import { resolveScenarioId } from '../lib/scenario';
|
|
5
|
-
import * as sdk from '../api/generated/sdk.gen';
|
|
6
|
-
const SET_FIELD_VALUE_MAP = {
|
|
7
|
-
event: sdk.setScenarioEventFieldValue,
|
|
8
|
-
command: sdk.setScenarioCommandFieldValue,
|
|
9
|
-
readmodel: sdk.setScenarioReadModelFieldValue,
|
|
10
|
-
};
|
|
11
|
-
const SET_FIELD_LIST_VALUES_MAP = {
|
|
12
|
-
event: sdk.setScenarioEventFieldListValues,
|
|
13
|
-
command: sdk.setScenarioCommandFieldListValues,
|
|
14
|
-
readmodel: sdk.setScenarioReadModelFieldListValues,
|
|
15
|
-
};
|
|
16
|
-
const SET_FIELD_CUSTOM_VALUE_MAP = {
|
|
17
|
-
event: sdk.setScenarioEventFieldCustomValue,
|
|
18
|
-
command: sdk.setScenarioCommandFieldCustomValue,
|
|
19
|
-
readmodel: sdk.setScenarioReadModelFieldCustomValue,
|
|
20
|
-
};
|
|
21
|
-
const SET_FIELD_CUSTOM_LIST_VALUES_MAP = {
|
|
22
|
-
event: sdk.setScenarioEventFieldCustomListValues,
|
|
23
|
-
command: sdk.setScenarioCommandFieldCustomListValues,
|
|
24
|
-
readmodel: sdk.setScenarioReadModelFieldCustomListValues,
|
|
25
|
-
};
|
|
26
|
-
function collectListValue(value, previous) {
|
|
27
|
-
return [...previous, value];
|
|
28
|
-
}
|
|
29
|
-
export function registerSetCommands(program) {
|
|
30
|
-
const set = program.command('set').description('Set values on elements');
|
|
31
|
-
// set example --scenario <name> --entry <entryId> --type event|command|readmodel --field <name>
|
|
32
|
-
// Primitive scalar: --value <val>
|
|
33
|
-
// Primitive list: --value <v> [--value <v> ...] or --values <csv>
|
|
34
|
-
// Custom (any shape): --json '<obj or array>'
|
|
35
|
-
// Primitive list is auto-detected when --values is given or --value is repeated.
|
|
36
|
-
// Custom mode is auto-detected from --json (object → scalar, array → list).
|
|
37
|
-
set.command('example')
|
|
38
|
-
.description('Set a field example value on a scenario entry (primitive or Custom)')
|
|
39
|
-
.requiredOption('--scenario <name>', 'Scenario name')
|
|
40
|
-
.requiredOption('--entry <entryId>', 'Entry ID (from show output)')
|
|
41
|
-
.requiredOption('--type <type>', 'Entry type: event, command, or readmodel')
|
|
42
|
-
.requiredOption('--field <name>', 'Field name')
|
|
43
|
-
.option('--value <val>', 'Primitive value (repeat for list-typed fields)', collectListValue, [])
|
|
44
|
-
.option('--values <csv>', 'Comma-separated values for a primitive list-typed field')
|
|
45
|
-
.option('--json <json>', 'JSON for a Custom-typed field (object for scalar, array of objects for list)')
|
|
46
|
-
.addHelpText('after', `
|
|
47
|
-
Pick the input flag based on the field's type and shape — discover both via:
|
|
48
|
-
show element <elementName>
|
|
49
|
-
|
|
50
|
-
Primitive scalar field:
|
|
51
|
-
--value "42"
|
|
52
|
-
Primitive list field (any of):
|
|
53
|
-
--value "a" --value "b"
|
|
54
|
-
--values "a,b,c"
|
|
55
|
-
Custom scalar field (object tree):
|
|
56
|
-
--json '{ "city": "NYC", "zip": "10001" }'
|
|
57
|
-
Custom list field (array of objects):
|
|
58
|
-
--json '[{"sku":"a","qty":"2"},{"sku":"b","qty":"1"}]'
|
|
59
|
-
|
|
60
|
-
Inside a Custom tree, primitive leaves MUST be JSON strings ("42", "true", ISO dates).
|
|
61
|
-
Nested Custom subfields nest as inner objects/arrays.
|
|
62
|
-
|
|
63
|
-
Tip: to set many fields / many entries at once, use 'add scenario' which takes
|
|
64
|
-
a single JSON spec covering the whole given/when/then.
|
|
65
|
-
`)
|
|
66
|
-
.action(async (opts) => {
|
|
67
|
-
const modelId = requireModelId();
|
|
68
|
-
const scenarioId = await resolveScenarioId(modelId, opts.scenario, getGlobalId());
|
|
69
|
-
const collected = opts.value;
|
|
70
|
-
const csvProvided = opts.values !== undefined;
|
|
71
|
-
const jsonProvided = opts.json !== undefined;
|
|
72
|
-
if (jsonProvided && (csvProvided || collected.length > 0)) {
|
|
73
|
-
throw new Error('Use either --json (Custom) or --value/--values (primitive), not both.');
|
|
74
|
-
}
|
|
75
|
-
if (!jsonProvided && !csvProvided && collected.length === 0) {
|
|
76
|
-
throw new Error('Provide --value (repeatable), --values <csv>, or --json <tree>.');
|
|
77
|
-
}
|
|
78
|
-
if (jsonProvided) {
|
|
79
|
-
let parsed;
|
|
80
|
-
try {
|
|
81
|
-
parsed = JSON.parse(opts.json);
|
|
82
|
-
}
|
|
83
|
-
catch (e) {
|
|
84
|
-
throw new Error(`--json must be valid JSON: ${e.message}`);
|
|
85
|
-
}
|
|
86
|
-
if (Array.isArray(parsed)) {
|
|
87
|
-
const fn = SET_FIELD_CUSTOM_LIST_VALUES_MAP[opts.type];
|
|
88
|
-
if (!fn)
|
|
89
|
-
throw new Error(`Cannot set Custom list examples on type: ${opts.type}. Use event, command, or readmodel.`);
|
|
90
|
-
for (const item of parsed) {
|
|
91
|
-
if (item === null || typeof item !== 'object' || Array.isArray(item)) {
|
|
92
|
-
throw new Error('--json array items must be objects (one per list entry).');
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
unwrap(await fn({
|
|
96
|
-
body: { modelId, scenarioId, entryId: opts.entry, fieldName: opts.field, items: parsed }
|
|
97
|
-
}));
|
|
98
|
-
console.log(`Set "${opts.field}" = ${parsed.length} Custom item(s).`);
|
|
99
|
-
}
|
|
100
|
-
else if (parsed !== null && typeof parsed === 'object') {
|
|
101
|
-
const fn = SET_FIELD_CUSTOM_VALUE_MAP[opts.type];
|
|
102
|
-
if (!fn)
|
|
103
|
-
throw new Error(`Cannot set Custom examples on type: ${opts.type}. Use event, command, or readmodel.`);
|
|
104
|
-
unwrap(await fn({
|
|
105
|
-
body: { modelId, scenarioId, entryId: opts.entry, fieldName: opts.field, value: parsed }
|
|
106
|
-
}));
|
|
107
|
-
console.log(`Set "${opts.field}" = Custom value.`);
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
throw new Error('--json must be an object (Custom scalar) or array of objects (Custom list).');
|
|
111
|
-
}
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const isList = csvProvided || collected.length > 1;
|
|
115
|
-
if (isList) {
|
|
116
|
-
const fn = SET_FIELD_LIST_VALUES_MAP[opts.type];
|
|
117
|
-
if (!fn)
|
|
118
|
-
throw new Error(`Cannot set list examples on type: ${opts.type}. Use event, command, or readmodel.`);
|
|
119
|
-
const values = csvProvided
|
|
120
|
-
? String(opts.values).split(',').map((s) => s.trim())
|
|
121
|
-
: collected;
|
|
122
|
-
unwrap(await fn({
|
|
123
|
-
body: { modelId, scenarioId, entryId: opts.entry, fieldName: opts.field, values }
|
|
124
|
-
}));
|
|
125
|
-
console.log(`Set "${opts.field}" = [${values.map((v) => `"${v}"`).join(', ')}].`);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
const fn = SET_FIELD_VALUE_MAP[opts.type];
|
|
129
|
-
if (!fn)
|
|
130
|
-
throw new Error(`Cannot set examples on type: ${opts.type}. Use event, command, or readmodel.`);
|
|
131
|
-
const value = collected[0];
|
|
132
|
-
unwrap(await fn({
|
|
133
|
-
body: { modelId, scenarioId, entryId: opts.entry, fieldName: opts.field, value: String(value) }
|
|
134
|
-
}));
|
|
135
|
-
console.log(`Set "${opts.field}" = "${value}".`);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
// set description --scenario <name> --text <description>
|
|
139
|
-
set.command('description')
|
|
140
|
-
.description('Set a scenario description')
|
|
141
|
-
.requiredOption('--scenario <name>', 'Scenario name')
|
|
142
|
-
.requiredOption('--text <description>', 'Description text')
|
|
143
|
-
.action(async (opts) => {
|
|
144
|
-
const modelId = requireModelId();
|
|
145
|
-
const scenarioId = await resolveScenarioId(modelId, opts.scenario, getGlobalId());
|
|
146
|
-
unwrap(await sdk.redescribeScenario({
|
|
147
|
-
body: { modelId, scenarioId, description: opts.text }
|
|
148
|
-
}));
|
|
149
|
-
console.log(`Set description on scenario.`);
|
|
150
|
-
});
|
|
151
|
-
// reorder entry --scenario <name> --section given|when|then --entry <entryId> --position <n>
|
|
152
|
-
const REORDER_ENTRY_MAP = {
|
|
153
|
-
given: sdk.reorderScenarioGivenEntry,
|
|
154
|
-
when: sdk.reorderScenarioWhenEntry,
|
|
155
|
-
then: sdk.reorderScenarioThenEntry,
|
|
156
|
-
};
|
|
157
|
-
set.command('position')
|
|
158
|
-
.description('Reorder a scenario entry within its section')
|
|
159
|
-
.requiredOption('--scenario <name>', 'Scenario name')
|
|
160
|
-
.requiredOption('--section <section>', 'Section: given, when, or then')
|
|
161
|
-
.requiredOption('--entry <entryId>', 'Entry ID (from show output)')
|
|
162
|
-
.requiredOption('--position <n>', 'New position (0-based)', parseInt)
|
|
163
|
-
.action(async (opts) => {
|
|
164
|
-
const modelId = requireModelId();
|
|
165
|
-
const scenarioId = await resolveScenarioId(modelId, opts.scenario, getGlobalId());
|
|
166
|
-
const fn = REORDER_ENTRY_MAP[opts.section];
|
|
167
|
-
if (!fn)
|
|
168
|
-
throw new Error(`Unknown section: ${opts.section}. Use given, when, or then.`);
|
|
169
|
-
unwrap(await fn({
|
|
170
|
-
body: { modelId, scenarioId, entryId: opts.entry, position: opts.position }
|
|
171
|
-
}));
|
|
172
|
-
console.log(`Moved entry to position ${opts.position}.`);
|
|
173
|
-
});
|
|
174
|
-
// set aggregate-id [aggregateName] --field-name <name> --field-type <type>
|
|
175
|
-
set.command('aggregate-id [aggregateName]')
|
|
176
|
-
.description('Set the ID field on an aggregate')
|
|
177
|
-
.requiredOption('--field-name <name>', 'ID field name')
|
|
178
|
-
.option('--field-type <type>', 'ID field type', 'UUID')
|
|
179
|
-
.action(async (aggregateName, opts) => {
|
|
180
|
-
const modelId = requireModelId();
|
|
181
|
-
const aggregateId = await resolve(modelId, 'aggregate', aggregateName ?? '', getGlobalId());
|
|
182
|
-
unwrap(await sdk.setAggregateIdField({
|
|
183
|
-
body: { modelId, aggregateId, aggregateIdFieldName: opts.fieldName, aggregateIdFieldType: opts.fieldType }
|
|
184
|
-
}));
|
|
185
|
-
console.log(`Set aggregate ID field to "${opts.fieldName}: ${opts.fieldType}".`);
|
|
186
|
-
});
|
|
187
|
-
// set note-description [noteName] --text <description>
|
|
188
|
-
set.command('note-description [noteName]')
|
|
189
|
-
.description('Set a note description')
|
|
190
|
-
.requiredOption('--text <description>', 'Description text')
|
|
191
|
-
.action(async (noteName, opts) => {
|
|
192
|
-
const modelId = requireModelId();
|
|
193
|
-
const noteId = await resolve(modelId, 'note', noteName ?? '', getGlobalId());
|
|
194
|
-
unwrap(await sdk.redescribeNote({
|
|
195
|
-
body: { modelId, noteId, description: opts.text }
|
|
196
|
-
}));
|
|
197
|
-
console.log('Set note description.');
|
|
198
|
-
});
|
|
199
|
-
}
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
// Response shapes for show-* commands, pulled from the backend ReadModels.
|
|
2
|
-
// Attached to each command's --help so agents can consume without out-of-band docs.
|
|
3
|
-
const FIELD_VIEW = `FieldView:
|
|
4
|
-
{
|
|
5
|
-
"fieldId": "<uuid>",
|
|
6
|
-
"name": "customerId",
|
|
7
|
-
"fieldType": "UUID" | "String" | "Int" | "Long" | "Double"
|
|
8
|
-
| "Decimal" | "Boolean" | "Date" | "DateTime" | "Custom",
|
|
9
|
-
"isList": false,
|
|
10
|
-
"isOptional": false,
|
|
11
|
-
"isGenerated": false,
|
|
12
|
-
"isUserInput": false, // screens only
|
|
13
|
-
"subfields": [FieldView, ...] // non-empty only when fieldType = "Custom"
|
|
14
|
-
}`;
|
|
15
|
-
const MAPPING_VIEW = `MappingView:
|
|
16
|
-
{ "sourceFieldName": "customerId", "targetFieldName": "customerId" }`;
|
|
17
|
-
const FLOW_VIEW = `FlowView:
|
|
18
|
-
{
|
|
19
|
-
"flowId": "<uuid>",
|
|
20
|
-
"flowType": "screen->command" | "command->event" | "event->readmodel"
|
|
21
|
-
| "readmodel->screen" | "readmodel->processor"
|
|
22
|
-
| "processor->command" | "command->external-event"
|
|
23
|
-
| "external-event->processor",
|
|
24
|
-
"sourceName": "OrderForm",
|
|
25
|
-
"sourceId": "<uuid>",
|
|
26
|
-
"targetName": "PlaceOrder",
|
|
27
|
-
"targetId": "<uuid>",
|
|
28
|
-
"direction": "forward" | "reverse",
|
|
29
|
-
"mappings": [MappingView, ...]
|
|
30
|
-
}`;
|
|
31
|
-
const SCENARIO_ENTRY_VIEW = `ScenarioEntryView:
|
|
32
|
-
{
|
|
33
|
-
"entryId": "<uuid>",
|
|
34
|
-
"entryType": "event" | "command" | "readmodel" | ...,
|
|
35
|
-
"elementName": "OrderPlaced",
|
|
36
|
-
"fieldValues": { "customerId": "abc-123", "tags": ["a", "b"], ... }
|
|
37
|
-
// string for scalar fields, array for fields marked isList=true
|
|
38
|
-
}`;
|
|
39
|
-
const SCENARIO_VIEW = `ScenarioView:
|
|
40
|
-
{
|
|
41
|
-
"scenarioId": "<uuid>",
|
|
42
|
-
"name": "happy path",
|
|
43
|
-
"description": "A customer places a valid order",
|
|
44
|
-
"given": [ScenarioEntryView, ...],
|
|
45
|
-
"when": [ScenarioEntryView, ...],
|
|
46
|
-
"then": [ScenarioEntryView, ...]
|
|
47
|
-
}`;
|
|
48
|
-
const ELEMENT_VIEW_IN_SLICE = `ElementView (as returned inside slices):
|
|
49
|
-
{
|
|
50
|
-
"elementId": "<uuid>",
|
|
51
|
-
"elementType": "screen" | "command" | "event" | "readmodel"
|
|
52
|
-
| "processor" | "external-event",
|
|
53
|
-
"name": "PlaceOrder",
|
|
54
|
-
"x": 0, "y": 0, "width": 0, "height": 0,
|
|
55
|
-
"fields": [FieldView, ...],
|
|
56
|
-
"linkedCopy": false, // true = visual proxy; real element lives elsewhere
|
|
57
|
-
"originalId": "<uuid>", // only when linkedCopy = true
|
|
58
|
-
"originalSlice": "Place Order" // only when linkedCopy = true
|
|
59
|
-
}`;
|
|
60
|
-
const SLICE_VIEW = `SliceView:
|
|
61
|
-
{
|
|
62
|
-
"sliceId": "<uuid>",
|
|
63
|
-
"name": "Place Order",
|
|
64
|
-
"status": "created" | "planned" | "in-progress" | "blocked" | "done",
|
|
65
|
-
"x": 0, "y": 0, "width": 0, "height": 0,
|
|
66
|
-
"aggregate": { "aggregateId": "<uuid>", "name": "Order" } | null,
|
|
67
|
-
"elements": [ElementView, ...],
|
|
68
|
-
"flows": [FlowView, ...],
|
|
69
|
-
"scenarios": [ScenarioView, ...]
|
|
70
|
-
}`;
|
|
71
|
-
const CHAPTER_VIEW = `ChapterView:
|
|
72
|
-
{
|
|
73
|
-
"chapterId": "<uuid>",
|
|
74
|
-
"name": "User Onboarding",
|
|
75
|
-
"x": 0, "y": 0, "width": 0, "height": 0,
|
|
76
|
-
"chapters": [ChapterView, ...], // nested chapters
|
|
77
|
-
"slices": [SliceView, ...],
|
|
78
|
-
"uncontained": [ElementView, ...] // elements in the chapter but outside any slice
|
|
79
|
-
}`;
|
|
80
|
-
const CONTEXT_VIEW = `ContextView:
|
|
81
|
-
{
|
|
82
|
-
"contextId": "<uuid>",
|
|
83
|
-
"name": "Orders",
|
|
84
|
-
"x": 0, "y": 0, "width": 0, "height": 0,
|
|
85
|
-
"chapters": [ChapterView, ...],
|
|
86
|
-
"slices": [SliceView, ...],
|
|
87
|
-
"uncontained": [ElementView, ...]
|
|
88
|
-
}`;
|
|
89
|
-
// show slice → SliceView (with nested ElementView/FlowView/ScenarioView)
|
|
90
|
-
export const SHOW_SLICE_HELP = `
|
|
91
|
-
Response (JSON on stdout):
|
|
92
|
-
|
|
93
|
-
${SLICE_VIEW}
|
|
94
|
-
|
|
95
|
-
${ELEMENT_VIEW_IN_SLICE}
|
|
96
|
-
|
|
97
|
-
${FIELD_VIEW}
|
|
98
|
-
|
|
99
|
-
${FLOW_VIEW}
|
|
100
|
-
|
|
101
|
-
${MAPPING_VIEW}
|
|
102
|
-
|
|
103
|
-
${SCENARIO_VIEW}
|
|
104
|
-
|
|
105
|
-
${SCENARIO_ENTRY_VIEW}
|
|
106
|
-
`;
|
|
107
|
-
// show chapter → ChapterView
|
|
108
|
-
export const SHOW_CHAPTER_HELP = `
|
|
109
|
-
Response (JSON on stdout):
|
|
110
|
-
|
|
111
|
-
${CHAPTER_VIEW}
|
|
112
|
-
|
|
113
|
-
${SLICE_VIEW}
|
|
114
|
-
|
|
115
|
-
${ELEMENT_VIEW_IN_SLICE}
|
|
116
|
-
|
|
117
|
-
${FIELD_VIEW}
|
|
118
|
-
|
|
119
|
-
${FLOW_VIEW}
|
|
120
|
-
|
|
121
|
-
${MAPPING_VIEW}
|
|
122
|
-
|
|
123
|
-
${SCENARIO_VIEW}
|
|
124
|
-
|
|
125
|
-
${SCENARIO_ENTRY_VIEW}
|
|
126
|
-
`;
|
|
127
|
-
// show context → ContextView
|
|
128
|
-
export const SHOW_CONTEXT_HELP = `
|
|
129
|
-
Response (JSON on stdout):
|
|
130
|
-
|
|
131
|
-
${CONTEXT_VIEW}
|
|
132
|
-
|
|
133
|
-
${CHAPTER_VIEW}
|
|
134
|
-
|
|
135
|
-
${SLICE_VIEW}
|
|
136
|
-
|
|
137
|
-
${ELEMENT_VIEW_IN_SLICE}
|
|
138
|
-
|
|
139
|
-
${FIELD_VIEW}
|
|
140
|
-
|
|
141
|
-
${FLOW_VIEW}
|
|
142
|
-
|
|
143
|
-
${MAPPING_VIEW}
|
|
144
|
-
|
|
145
|
-
${SCENARIO_VIEW}
|
|
146
|
-
|
|
147
|
-
${SCENARIO_ENTRY_VIEW}
|
|
148
|
-
`;
|
|
149
|
-
// show model → ModelView
|
|
150
|
-
export const SHOW_MODEL_HELP = `
|
|
151
|
-
Response (JSON on stdout):
|
|
152
|
-
|
|
153
|
-
ModelView:
|
|
154
|
-
{
|
|
155
|
-
"modelId": "<uuid>",
|
|
156
|
-
"modelName": "My Model",
|
|
157
|
-
"contexts": [ContextView, ...],
|
|
158
|
-
"chapters": [ChapterView, ...], // chapters not inside any context
|
|
159
|
-
"slices": [SliceView, ...], // slices not inside any chapter
|
|
160
|
-
"uncontained": [ElementView, ...] // elements outside every container
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
${CONTEXT_VIEW}
|
|
164
|
-
|
|
165
|
-
${CHAPTER_VIEW}
|
|
166
|
-
|
|
167
|
-
${SLICE_VIEW}
|
|
168
|
-
|
|
169
|
-
${ELEMENT_VIEW_IN_SLICE}
|
|
170
|
-
|
|
171
|
-
${FIELD_VIEW}
|
|
172
|
-
|
|
173
|
-
${FLOW_VIEW}
|
|
174
|
-
|
|
175
|
-
${MAPPING_VIEW}
|
|
176
|
-
|
|
177
|
-
${SCENARIO_VIEW}
|
|
178
|
-
|
|
179
|
-
${SCENARIO_ENTRY_VIEW}
|
|
180
|
-
`;
|
|
181
|
-
// show <element> → richer element response with cross-slice context
|
|
182
|
-
export const SHOW_ELEMENT_HELP = `
|
|
183
|
-
Response (JSON on stdout):
|
|
184
|
-
|
|
185
|
-
ShowElementView:
|
|
186
|
-
{
|
|
187
|
-
"elementId": "<uuid>",
|
|
188
|
-
"elementType": "screen" | "command" | "event" | "readmodel"
|
|
189
|
-
| "processor" | "external-event",
|
|
190
|
-
"name": "OrderPlaced",
|
|
191
|
-
"x": 0, "y": 0, "width": 0, "height": 0,
|
|
192
|
-
"fields": [FieldEntry, ...],
|
|
193
|
-
"linkedCopy": false,
|
|
194
|
-
"originalId": "<uuid>", // only when linkedCopy = true
|
|
195
|
-
"copies": [CopyEntry, ...], // all visual proxies of this element
|
|
196
|
-
"appearsInSlices": [SliceEntry, ...], // slices this element belongs to
|
|
197
|
-
"inboundFlows": [FlowEntry, ...], // flows pointing at this element
|
|
198
|
-
"outboundFlows": [FlowEntry, ...] // flows leaving this element
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
FieldEntry:
|
|
202
|
-
{
|
|
203
|
-
"fieldId": "<uuid>",
|
|
204
|
-
"name": "customerId",
|
|
205
|
-
"fieldType": "UUID" | "String" | "Int" | "Long" | "Double"
|
|
206
|
-
| "Decimal" | "Boolean" | "Date" | "DateTime" | "Custom",
|
|
207
|
-
"isList": false,
|
|
208
|
-
"isOptional": false,
|
|
209
|
-
"isGenerated": false,
|
|
210
|
-
"isUserInput": false,
|
|
211
|
-
"subfields": [FieldEntry, ...]
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
CopyEntry:
|
|
215
|
-
{
|
|
216
|
-
"copyId": "<uuid>",
|
|
217
|
-
"x": 0, "y": 0,
|
|
218
|
-
"sliceName": "Place Order" | null
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
SliceEntry:
|
|
222
|
-
{ "sliceId": "<uuid>", "sliceName": "Place Order" }
|
|
223
|
-
|
|
224
|
-
FlowEntry:
|
|
225
|
-
{
|
|
226
|
-
"flowId": "<uuid>",
|
|
227
|
-
"flowType": "screen->command" | "command->event" | ...,
|
|
228
|
-
"sourceName": "OrderForm",
|
|
229
|
-
"sourceId": "<uuid>",
|
|
230
|
-
"targetName": "PlaceOrder",
|
|
231
|
-
"targetId": "<uuid>",
|
|
232
|
-
"mappings": [{ "sourceFieldName": "customerId", "targetFieldName": "customerId" }, ...]
|
|
233
|
-
}
|
|
234
|
-
`;
|
|
235
|
-
// show completeness → model-level coverage report
|
|
236
|
-
export const SHOW_COMPLETENESS_HELP = `
|
|
237
|
-
Response (JSON on stdout):
|
|
238
|
-
|
|
239
|
-
CompletenessReport:
|
|
240
|
-
{
|
|
241
|
-
"modelId": "<uuid>",
|
|
242
|
-
"complete": 0, // count of fields with full traceability
|
|
243
|
-
"incomplete": 0, // count of fields missing mappings
|
|
244
|
-
"total": 0,
|
|
245
|
-
"incompleteElements": [IncompleteElement, ...]
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
IncompleteElement:
|
|
249
|
-
{
|
|
250
|
-
"elementId": "<uuid>",
|
|
251
|
-
"elementName": "PlaceOrder",
|
|
252
|
-
"elementType": "command" | "event" | "readmodel" | "screen" | "processor" | "external-event",
|
|
253
|
-
"unmappedFields": ["fieldName", ...],
|
|
254
|
-
"missingAggregateIdField": {
|
|
255
|
-
"aggregateName": "Order",
|
|
256
|
-
"expectedField": "orderId"
|
|
257
|
-
} | null
|
|
258
|
-
}
|
|
259
|
-
`;
|
package/dist/commands/show.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { getGlobalId } from '../lib/globals';
|
|
2
|
-
import { requireModelId } from '../lib/model';
|
|
3
|
-
import { resolve, unwrap, out } from '../lib/resolve';
|
|
4
|
-
import * as sdk from '../api/generated/sdk.gen';
|
|
5
|
-
import { SHOW_MODEL_HELP, SHOW_CONTEXT_HELP, SHOW_CHAPTER_HELP, SHOW_SLICE_HELP, SHOW_ELEMENT_HELP, SHOW_COMPLETENESS_HELP, } from './show-schemas';
|
|
6
|
-
export function registerShowCommands(program) {
|
|
7
|
-
const show = program.command('show').description('Show detailed information');
|
|
8
|
-
show.command('model')
|
|
9
|
-
.description('Show full model hierarchy')
|
|
10
|
-
.addHelpText('after', SHOW_MODEL_HELP)
|
|
11
|
-
.action(async () => {
|
|
12
|
-
const modelId = requireModelId();
|
|
13
|
-
out(unwrap(await sdk.showModel({ path: { modelId } })));
|
|
14
|
-
});
|
|
15
|
-
show.command('context [name]')
|
|
16
|
-
.description('Show context with contained chapters and slices')
|
|
17
|
-
.addHelpText('after', SHOW_CONTEXT_HELP)
|
|
18
|
-
.action(async (name, cmd) => {
|
|
19
|
-
const modelId = requireModelId();
|
|
20
|
-
const contextId = await resolve(modelId, 'context', name ?? '', getGlobalId());
|
|
21
|
-
out(unwrap(await sdk.showContext({ path: { modelId, contextId } })));
|
|
22
|
-
});
|
|
23
|
-
show.command('chapter [name]')
|
|
24
|
-
.description('Show chapter with contained slices')
|
|
25
|
-
.addHelpText('after', SHOW_CHAPTER_HELP)
|
|
26
|
-
.action(async (name, cmd) => {
|
|
27
|
-
const modelId = requireModelId();
|
|
28
|
-
const chapterId = await resolve(modelId, 'chapter', name ?? '', getGlobalId());
|
|
29
|
-
out(unwrap(await sdk.showChapter({ path: { modelId, chapterId } })));
|
|
30
|
-
});
|
|
31
|
-
show.command('slice [name]')
|
|
32
|
-
.description('Show slice with all elements, flows, and scenarios')
|
|
33
|
-
.addHelpText('after', SHOW_SLICE_HELP)
|
|
34
|
-
.action(async (name, cmd) => {
|
|
35
|
-
const modelId = requireModelId();
|
|
36
|
-
const sliceId = await resolve(modelId, 'slice', name ?? '', getGlobalId());
|
|
37
|
-
out(unwrap(await sdk.showSlice({ path: { modelId, sliceId } })));
|
|
38
|
-
});
|
|
39
|
-
for (const type of ['event', 'command', 'readmodel', 'screen', 'processor', 'external-event']) {
|
|
40
|
-
show.command(`${type} [name]`)
|
|
41
|
-
.description(`Show ${type} detail with fields and flows`)
|
|
42
|
-
.addHelpText('after', SHOW_ELEMENT_HELP)
|
|
43
|
-
.action(async (name, cmd) => {
|
|
44
|
-
const modelId = requireModelId();
|
|
45
|
-
const elementId = await resolve(modelId, type, name ?? '', getGlobalId());
|
|
46
|
-
out(unwrap(await sdk.showElement({ path: { modelId, elementId } })));
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
show.command('completeness')
|
|
50
|
-
.description('Show completeness for the entire model')
|
|
51
|
-
.addHelpText('after', SHOW_COMPLETENESS_HELP)
|
|
52
|
-
.action(async () => {
|
|
53
|
-
const modelId = requireModelId();
|
|
54
|
-
out(unwrap(await sdk.showCompleteness({ path: { modelId } })));
|
|
55
|
-
});
|
|
56
|
-
}
|
package/dist/commands/summary.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { requireModelId } from '../lib/model';
|
|
2
|
-
import { unwrap, out } from '../lib/resolve';
|
|
3
|
-
import * as sdk from '../api/generated/sdk.gen';
|
|
4
|
-
import { SUMMARY_HELP } from './list-schemas';
|
|
5
|
-
export function registerSummaryCommands(program) {
|
|
6
|
-
program.command('summary')
|
|
7
|
-
.description('Show model summary')
|
|
8
|
-
.addHelpText('after', SUMMARY_HELP)
|
|
9
|
-
.action(async () => {
|
|
10
|
-
const modelId = requireModelId();
|
|
11
|
-
out(unwrap(await sdk.summary({ path: { modelId } })));
|
|
12
|
-
});
|
|
13
|
-
}
|