eventmodeler 0.4.4 → 0.4.6

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.
@@ -0,0 +1,282 @@
1
+ export interface ModelInfo {
2
+ modelId: string;
3
+ name: string;
4
+ updatedAt: number;
5
+ permission: string;
6
+ }
7
+ export declare function listModels(): Promise<ModelInfo[]>;
8
+ export declare function listSlices(modelId: string, format?: OutputFormat, chapterFilter?: string): Promise<string>;
9
+ export declare function listEvents(modelId: string, format?: OutputFormat): Promise<string>;
10
+ export declare function listCommands(modelId: string, format?: OutputFormat): Promise<string>;
11
+ export declare function listChapters(modelId: string, format?: OutputFormat): Promise<string>;
12
+ export declare function listActors(modelId: string, format?: OutputFormat): Promise<string>;
13
+ export interface SearchResult {
14
+ type: string;
15
+ id: string;
16
+ name: string;
17
+ chapterId?: string;
18
+ chapterName?: string;
19
+ sliceId?: string;
20
+ sliceName?: string;
21
+ sliceStatus?: string;
22
+ parentChapterId?: string;
23
+ parentChapterName?: string;
24
+ }
25
+ export interface SearchResponse {
26
+ query: string;
27
+ count: number;
28
+ results: SearchResult[];
29
+ }
30
+ export declare function search(modelId: string, term: string): Promise<SearchResponse>;
31
+ export interface ModelSummary {
32
+ modelName: string;
33
+ slices: {
34
+ total: number;
35
+ byStatus: {
36
+ created: number;
37
+ inProgress: number;
38
+ blocked: number;
39
+ done: number;
40
+ };
41
+ byType: {
42
+ stateChange: number;
43
+ automation: number;
44
+ stateView: number;
45
+ unknown: number;
46
+ };
47
+ };
48
+ events: number;
49
+ commands: number;
50
+ readModels: number;
51
+ screens: number;
52
+ processors: number;
53
+ chapters: number;
54
+ aggregates: number;
55
+ actors: number;
56
+ flows: number;
57
+ scenarios: number;
58
+ }
59
+ export declare function getSummary(modelId: string): Promise<ModelSummary>;
60
+ export type SliceStatus = 'created' | 'in-progress' | 'blocked' | 'done';
61
+ export declare function markSliceStatus(modelId: string, sliceName: string, status: SliceStatus): Promise<{
62
+ success: boolean;
63
+ }>;
64
+ export interface FieldInput {
65
+ name: string;
66
+ fieldType: string;
67
+ isList?: boolean;
68
+ isOptional?: boolean;
69
+ isGenerated?: boolean;
70
+ isUserInput?: boolean;
71
+ subfields?: FieldInput[];
72
+ }
73
+ export declare function addField(modelId: string, elementName: string, field: FieldInput): Promise<{
74
+ success: boolean;
75
+ }>;
76
+ export declare function removeField(modelId: string, elementName: string, fieldName: string): Promise<{
77
+ success: boolean;
78
+ }>;
79
+ export interface FieldUpdates {
80
+ name?: string;
81
+ fieldType?: string;
82
+ isList?: boolean;
83
+ isOptional?: boolean;
84
+ isGenerated?: boolean;
85
+ isUserInput?: boolean;
86
+ }
87
+ export declare function updateField(modelId: string, elementName: string, fieldName: string, updates: FieldUpdates): Promise<{
88
+ success: boolean;
89
+ }>;
90
+ export interface FieldMappingInput {
91
+ from: string;
92
+ to: string;
93
+ }
94
+ export declare function mapFields(modelId: string, sourceName: string, targetName: string, mappings: FieldMappingInput[]): Promise<{
95
+ success: boolean;
96
+ }>;
97
+ export interface ScenarioInput {
98
+ name: string;
99
+ description?: string;
100
+ given?: Array<{
101
+ event: string;
102
+ fieldValues?: Record<string, unknown>;
103
+ }>;
104
+ when?: {
105
+ command?: {
106
+ command: string;
107
+ fieldValues?: Record<string, unknown>;
108
+ };
109
+ events?: Array<{
110
+ event: string;
111
+ fieldValues?: Record<string, unknown>;
112
+ }>;
113
+ };
114
+ then: {
115
+ type: 'events' | 'error' | 'command' | 'readModelAssertion' | 'noCommand';
116
+ events?: Array<{
117
+ event: string;
118
+ fieldValues?: Record<string, unknown>;
119
+ }>;
120
+ errorMessage?: string;
121
+ errorType?: string;
122
+ command?: {
123
+ command: string;
124
+ fieldValues?: Record<string, unknown>;
125
+ };
126
+ readModelAssertion?: {
127
+ readModel: string;
128
+ givenEvents?: Array<{
129
+ event: string;
130
+ fieldValues?: Record<string, unknown>;
131
+ }>;
132
+ expectedFieldValues?: Record<string, unknown>;
133
+ };
134
+ };
135
+ }
136
+ export declare function createScenario(modelId: string, sliceName: string, scenario: ScenarioInput): Promise<{
137
+ success: boolean;
138
+ scenarioId: string;
139
+ }>;
140
+ export declare function removeScenario(modelId: string, scenarioName: string, sliceName?: string): Promise<{
141
+ success: boolean;
142
+ }>;
143
+ export declare function createFlow(modelId: string, fromName: string, toName: string): Promise<{
144
+ success: boolean;
145
+ }>;
146
+ export interface CompoundFieldInput {
147
+ name: string;
148
+ fieldType: string;
149
+ isList?: boolean;
150
+ isOptional?: boolean;
151
+ isGenerated?: boolean;
152
+ isUserInput?: boolean;
153
+ subfields?: CompoundFieldInput[];
154
+ }
155
+ export interface StateChangeSliceInput {
156
+ sliceName: string;
157
+ after?: string;
158
+ before?: string;
159
+ screen: {
160
+ name: string;
161
+ fields: CompoundFieldInput[];
162
+ };
163
+ command: {
164
+ name: string;
165
+ fields: CompoundFieldInput[];
166
+ };
167
+ event: {
168
+ name: string;
169
+ fields: CompoundFieldInput[];
170
+ };
171
+ }
172
+ export interface StateChangeSliceResult {
173
+ success: boolean;
174
+ sliceId: string;
175
+ screenId: string;
176
+ commandId: string;
177
+ eventId: string;
178
+ screenToCommandMappings: number;
179
+ commandToEventMappings: number;
180
+ }
181
+ export declare function createStateChangeSlice(modelId: string, input: StateChangeSliceInput): Promise<StateChangeSliceResult>;
182
+ export interface AutomationSliceInput {
183
+ sliceName: string;
184
+ after?: string;
185
+ before?: string;
186
+ readModel: {
187
+ name: string;
188
+ fields: CompoundFieldInput[];
189
+ };
190
+ processor: {
191
+ name: string;
192
+ };
193
+ command: {
194
+ name: string;
195
+ fields: CompoundFieldInput[];
196
+ };
197
+ event: {
198
+ name: string;
199
+ fields: CompoundFieldInput[];
200
+ };
201
+ }
202
+ export interface AutomationSliceResult {
203
+ success: boolean;
204
+ sliceId: string;
205
+ readModelId: string;
206
+ processorId: string;
207
+ commandId: string;
208
+ eventId: string;
209
+ readModelToCommandMappings: number;
210
+ commandToEventMappings: number;
211
+ }
212
+ export declare function createAutomationSlice(modelId: string, input: AutomationSliceInput): Promise<AutomationSliceResult>;
213
+ export interface StateViewSliceInput {
214
+ sliceName: string;
215
+ after?: string;
216
+ before?: string;
217
+ readModel: {
218
+ name: string;
219
+ fields: CompoundFieldInput[];
220
+ };
221
+ }
222
+ export interface StateViewSliceResult {
223
+ success: boolean;
224
+ sliceId: string;
225
+ readModelId: string;
226
+ }
227
+ export declare function createStateViewSlice(modelId: string, input: StateViewSliceInput): Promise<StateViewSliceResult>;
228
+ export type OutputFormat = 'xml' | 'json';
229
+ export declare function showSlice(modelId: string, sliceName: string, format?: OutputFormat): Promise<string>;
230
+ export declare function showEvent(modelId: string, eventName: string, format?: OutputFormat): Promise<string>;
231
+ export declare function showCommand(modelId: string, commandName: string, format?: OutputFormat): Promise<string>;
232
+ export declare function showChapter(modelId: string, chapterName: string, format?: OutputFormat): Promise<string>;
233
+ export declare function showActor(modelId: string, actorName: string, format?: OutputFormat): Promise<string>;
234
+ export declare function exportJson(modelId: string): Promise<string>;
235
+ export declare function codegenSlice(modelId: string, sliceName: string): Promise<string>;
236
+ export interface CodegenChapterEventsField {
237
+ name: string;
238
+ type: string;
239
+ list?: boolean;
240
+ generated?: boolean;
241
+ optional?: boolean;
242
+ userInput?: boolean;
243
+ subfields?: CodegenChapterEventsField[];
244
+ }
245
+ export interface CodegenChapterEventsChapter {
246
+ id: string;
247
+ name: string;
248
+ parent?: CodegenChapterEventsChapter | null;
249
+ }
250
+ export interface CodegenChapterEventsSlice {
251
+ id: string;
252
+ name: string;
253
+ sliceType: string;
254
+ }
255
+ export interface CodegenChapterEventsEvent {
256
+ id: string;
257
+ name: string;
258
+ fields: CodegenChapterEventsField[];
259
+ aggregate?: string;
260
+ sourceSlices: string[];
261
+ }
262
+ export interface CodegenChapterEventsResponse {
263
+ chapter: CodegenChapterEventsChapter | null;
264
+ sliceCount: number;
265
+ eventCount: number;
266
+ slices: CodegenChapterEventsSlice[];
267
+ events: CodegenChapterEventsEvent[];
268
+ }
269
+ export declare function codegenEvents(modelId: string, chapterName?: string): Promise<CodegenChapterEventsResponse>;
270
+ export declare function listAggregates(modelId: string, format?: OutputFormat): Promise<string>;
271
+ export declare function listReadModels(modelId: string, format?: OutputFormat): Promise<string>;
272
+ export declare function listScreens(modelId: string, format?: OutputFormat): Promise<string>;
273
+ export declare function listProcessors(modelId: string, format?: OutputFormat): Promise<string>;
274
+ export declare function showElementCompleteness(modelId: string, elementName: string, format?: OutputFormat): Promise<string>;
275
+ export declare function showInformationCompleteness(modelId: string, format?: OutputFormat, sliceName?: string, chapterName?: string): Promise<string>;
276
+ export declare function showAggregateCompleteness(modelId: string, aggregateName: string, format?: OutputFormat): Promise<string>;
277
+ export declare function showReadModel(modelId: string, name: string, format?: OutputFormat): Promise<string>;
278
+ export declare function showScreen(modelId: string, name: string, format?: OutputFormat): Promise<string>;
279
+ export declare function showProcessor(modelId: string, name: string, format?: OutputFormat): Promise<string>;
280
+ export declare function showAggregate(modelId: string, name: string, format?: OutputFormat): Promise<string>;
281
+ export declare function showScenario(modelId: string, name: string, format?: OutputFormat): Promise<string>;
282
+ export declare function listScenarios(modelId: string, format?: OutputFormat): Promise<string>;
@@ -0,0 +1,320 @@
1
+ // API client — thin wrappers that call backend CLI endpoints.
2
+ // The backend does all the heavy lifting (name resolution, data denormalization).
3
+ import { getBackendUrl } from '../lib/config.js';
4
+ import { getValidAccessToken } from '../lib/auth.js';
5
+ // =============================================================================
6
+ // HTTP Client for CLI endpoints
7
+ // =============================================================================
8
+ /**
9
+ * Handle HTTP error responses with user-friendly messages.
10
+ * Tries to extract error detail from response body, falls back to status-based messages.
11
+ */
12
+ async function handleHttpError(response, path) {
13
+ const text = await response.text().catch(() => '');
14
+ const errorDetail = extractErrorDetail(text);
15
+ switch (response.status) {
16
+ case 401:
17
+ throw new Error(`Authentication required. Run 'eventmodeler login' to authenticate.` +
18
+ (errorDetail ? `\n\nOriginal error: ${errorDetail}` : ''));
19
+ case 403:
20
+ throw new Error(`Permission denied. You may not have access to this model, or you need editor permission for this action.` +
21
+ (errorDetail ? `\n\nOriginal error: ${errorDetail}` : ''));
22
+ case 404:
23
+ throw new Error(errorDetail || `Not found: ${path}`);
24
+ default:
25
+ throw new Error(errorDetail || `HTTP ${response.status}: ${response.statusText}`);
26
+ }
27
+ }
28
+ const GENERIC_ERROR_MESSAGES = new Set([
29
+ 'internal server error',
30
+ 'bad request',
31
+ 'unauthorized',
32
+ 'forbidden',
33
+ 'not found',
34
+ ]);
35
+ function isGenericErrorMessage(value) {
36
+ return GENERIC_ERROR_MESSAGES.has(value.trim().toLowerCase());
37
+ }
38
+ function toStringValue(value) {
39
+ return typeof value === 'string' ? value.trim() : '';
40
+ }
41
+ function collectCandidateMessages(node, out) {
42
+ if (!node || typeof node !== 'object')
43
+ return;
44
+ const obj = node;
45
+ // Prefer richer fields before generic "error".
46
+ for (const key of ['message', 'detail', 'reason', 'description', 'title', 'error']) {
47
+ const value = toStringValue(obj[key]);
48
+ if (value)
49
+ out.push(value);
50
+ }
51
+ const errors = obj.errors;
52
+ if (Array.isArray(errors)) {
53
+ for (const entry of errors) {
54
+ if (typeof entry === 'string') {
55
+ const value = entry.trim();
56
+ if (value)
57
+ out.push(value);
58
+ }
59
+ else if (entry && typeof entry === 'object') {
60
+ collectCandidateMessages(entry, out);
61
+ }
62
+ }
63
+ }
64
+ const cause = obj.cause;
65
+ if (cause && typeof cause === 'object') {
66
+ collectCandidateMessages(cause, out);
67
+ }
68
+ }
69
+ function extractErrorDetail(text) {
70
+ const body = text.trim();
71
+ if (!body)
72
+ return '';
73
+ try {
74
+ const parsed = JSON.parse(body);
75
+ if (typeof parsed === 'string') {
76
+ return parsed.trim();
77
+ }
78
+ const candidates = [];
79
+ collectCandidateMessages(parsed, candidates);
80
+ if (candidates.length > 0) {
81
+ const specific = candidates.find((value) => !isGenericErrorMessage(value));
82
+ return specific ?? candidates[0];
83
+ }
84
+ }
85
+ catch {
86
+ // Not JSON. Fall back to plain text below.
87
+ }
88
+ // Avoid dumping entire HTML pages from reverse proxies.
89
+ if (body.startsWith('<')) {
90
+ const title = body.match(/<title>([^<]+)<\/title>/i)?.[1]?.trim();
91
+ return title && !isGenericErrorMessage(title) ? title : '';
92
+ }
93
+ return body;
94
+ }
95
+ async function cliGet(path, params) {
96
+ const backendUrl = getBackendUrl();
97
+ const accessToken = await getValidAccessToken();
98
+ // Build query string manually using encodeURIComponent (uses %20 for spaces, not +)
99
+ const queryParts = Object.entries(params)
100
+ .filter(([_, value]) => value !== undefined)
101
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
102
+ const queryString = queryParts.length > 0 ? `?${queryParts.join('&')}` : '';
103
+ const fullUrl = `${backendUrl}${path}${queryString}`;
104
+ const response = await fetch(fullUrl, {
105
+ method: 'GET',
106
+ headers: {
107
+ Accept: 'application/json',
108
+ ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
109
+ },
110
+ });
111
+ if (!response.ok) {
112
+ await handleHttpError(response, path);
113
+ }
114
+ const text = await response.text();
115
+ if (!text.trim()) {
116
+ throw new Error(`Empty response from ${path}`);
117
+ }
118
+ try {
119
+ return JSON.parse(text);
120
+ }
121
+ catch (error) {
122
+ const message = error instanceof Error ? error.message : String(error);
123
+ const snippet = text.slice(0, 200);
124
+ throw new Error(`Invalid JSON from ${path}: ${message}. Body: ${snippet}`);
125
+ }
126
+ }
127
+ async function cliPost(path, body) {
128
+ const backendUrl = getBackendUrl();
129
+ const accessToken = await getValidAccessToken();
130
+ const response = await fetch(`${backendUrl}${path}`, {
131
+ method: 'POST',
132
+ headers: {
133
+ 'Content-Type': 'application/json',
134
+ Accept: 'application/json',
135
+ ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
136
+ },
137
+ body: JSON.stringify(body),
138
+ });
139
+ if (!response.ok) {
140
+ await handleHttpError(response, path);
141
+ }
142
+ const text = await response.text();
143
+ if (!text.trim()) {
144
+ throw new Error(`Empty response from ${path}`);
145
+ }
146
+ try {
147
+ return JSON.parse(text);
148
+ }
149
+ catch (error) {
150
+ const message = error instanceof Error ? error.message : String(error);
151
+ const snippet = text.slice(0, 200);
152
+ throw new Error(`Invalid JSON from ${path}: ${message}. Body: ${snippet}`);
153
+ }
154
+ }
155
+ export async function listModels() {
156
+ return cliGet('/cli/list-models', {});
157
+ }
158
+ // =============================================================================
159
+ // Query Functions (read-only, return denormalized data)
160
+ // =============================================================================
161
+ export async function listSlices(modelId, format = 'xml', chapterFilter) {
162
+ const params = { modelId };
163
+ if (chapterFilter)
164
+ params.chapter = chapterFilter;
165
+ return cliGetText('/cli/list-slices', params, format);
166
+ }
167
+ export async function listEvents(modelId, format = 'xml') {
168
+ return cliGetText('/cli/list-events', { modelId }, format);
169
+ }
170
+ export async function listCommands(modelId, format = 'xml') {
171
+ return cliGetText('/cli/list-commands', { modelId }, format);
172
+ }
173
+ export async function listChapters(modelId, format = 'xml') {
174
+ return cliGetText('/cli/list-chapters', { modelId }, format);
175
+ }
176
+ export async function listActors(modelId, format = 'xml') {
177
+ return cliGetText('/cli/list-actors', { modelId }, format);
178
+ }
179
+ export async function search(modelId, term) {
180
+ return cliGet('/cli/search', { modelId, term });
181
+ }
182
+ export async function getSummary(modelId) {
183
+ return cliGet('/cli/summary', { modelId });
184
+ }
185
+ export async function markSliceStatus(modelId, sliceName, status) {
186
+ return cliPost('/cli/mark-slice-status', { modelId, sliceName, status });
187
+ }
188
+ export async function addField(modelId, elementName, field) {
189
+ return cliPost('/cli/add-field', { modelId, elementName, field });
190
+ }
191
+ export async function removeField(modelId, elementName, fieldName) {
192
+ return cliPost('/cli/remove-field', { modelId, elementName, fieldName });
193
+ }
194
+ export async function updateField(modelId, elementName, fieldName, updates) {
195
+ return cliPost('/cli/update-field', { modelId, elementName, fieldName, updates });
196
+ }
197
+ export async function mapFields(modelId, sourceName, targetName, mappings) {
198
+ return cliPost('/cli/map-fields', { modelId, sourceName, targetName, mappings });
199
+ }
200
+ export async function createScenario(modelId, sliceName, scenario) {
201
+ return cliPost('/cli/create-scenario', { modelId, sliceName, scenario });
202
+ }
203
+ export async function removeScenario(modelId, scenarioName, sliceName) {
204
+ return cliPost('/cli/remove-scenario', { modelId, scenarioName, sliceName });
205
+ }
206
+ export async function createFlow(modelId, fromName, toName) {
207
+ return cliPost('/cli/create-flow', { modelId, fromName, toName });
208
+ }
209
+ export async function createStateChangeSlice(modelId, input) {
210
+ return cliPost('/cli/create-state-change-slice', { modelId, ...input });
211
+ }
212
+ export async function createAutomationSlice(modelId, input) {
213
+ return cliPost('/cli/create-automation-slice', { modelId, ...input });
214
+ }
215
+ export async function createStateViewSlice(modelId, input) {
216
+ return cliPost('/cli/create-state-view-slice', { modelId, ...input });
217
+ }
218
+ // =============================================================================
219
+ // View Functions (read-only, return formatted XML/JSON strings)
220
+ // =============================================================================
221
+ // Maps format to Accept header media type for content negotiation with the backend
222
+ function formatToMediaType(format) {
223
+ return format === 'xml' ? 'application/xml' : 'application/json';
224
+ }
225
+ // Helper for view queries that return text (XML or JSON string).
226
+ // Uses Accept header for content negotiation instead of a format query param.
227
+ async function cliGetText(path, params, format) {
228
+ const backendUrl = getBackendUrl();
229
+ const accessToken = await getValidAccessToken();
230
+ // Build query string manually using encodeURIComponent (uses %20 for spaces, not +)
231
+ // Some servers don't decode + as space in query parameters
232
+ const queryParts = Object.entries(params)
233
+ .filter(([_, value]) => value !== undefined)
234
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
235
+ const queryString = queryParts.length > 0 ? `?${queryParts.join('&')}` : '';
236
+ const fullUrl = `${backendUrl}${path}${queryString}`;
237
+ const response = await fetch(fullUrl, {
238
+ method: 'GET',
239
+ headers: {
240
+ Accept: formatToMediaType(format),
241
+ ...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
242
+ },
243
+ });
244
+ if (!response.ok) {
245
+ await handleHttpError(response, path);
246
+ }
247
+ const text = await response.text();
248
+ return text.trimEnd();
249
+ }
250
+ export async function showSlice(modelId, sliceName, format = 'xml') {
251
+ return cliGetText('/cli/show-slice', { modelId, name: sliceName }, format);
252
+ }
253
+ export async function showEvent(modelId, eventName, format = 'xml') {
254
+ return cliGetText('/cli/show-event', { modelId, name: eventName }, format);
255
+ }
256
+ export async function showCommand(modelId, commandName, format = 'xml') {
257
+ return cliGetText('/cli/show-command', { modelId, name: commandName }, format);
258
+ }
259
+ export async function showChapter(modelId, chapterName, format = 'xml') {
260
+ return cliGetText('/cli/show-chapter', { modelId, name: chapterName }, format);
261
+ }
262
+ export async function showActor(modelId, actorName, format = 'xml') {
263
+ return cliGetText('/cli/show-actor', { modelId, name: actorName }, format);
264
+ }
265
+ export async function exportJson(modelId) {
266
+ return cliGetText('/cli/export-json', { modelId });
267
+ }
268
+ export async function codegenSlice(modelId, sliceName) {
269
+ return cliGetText('/cli/codegen-slice', { modelId, name: sliceName });
270
+ }
271
+ export async function codegenEvents(modelId, chapterName) {
272
+ const params = { modelId };
273
+ if (chapterName)
274
+ params.chapter = chapterName;
275
+ return cliGet('/cli/codegen-events', params);
276
+ }
277
+ export async function listAggregates(modelId, format = 'xml') {
278
+ return cliGetText('/cli/list-aggregates', { modelId }, format);
279
+ }
280
+ export async function listReadModels(modelId, format = 'xml') {
281
+ return cliGetText('/cli/list-readmodels', { modelId }, format);
282
+ }
283
+ export async function listScreens(modelId, format = 'xml') {
284
+ return cliGetText('/cli/list-screens', { modelId }, format);
285
+ }
286
+ export async function listProcessors(modelId, format = 'xml') {
287
+ return cliGetText('/cli/list-processors', { modelId }, format);
288
+ }
289
+ export async function showElementCompleteness(modelId, elementName, format = 'xml') {
290
+ return cliGetText('/cli/show-element-completeness', { modelId, name: elementName }, format);
291
+ }
292
+ export async function showInformationCompleteness(modelId, format = 'xml', sliceName, chapterName) {
293
+ const params = { modelId };
294
+ if (sliceName)
295
+ params.sliceName = sliceName;
296
+ if (chapterName)
297
+ params.chapterName = chapterName;
298
+ return cliGetText('/cli/show-information-completeness', params, format);
299
+ }
300
+ export async function showAggregateCompleteness(modelId, aggregateName, format = 'xml') {
301
+ return cliGetText('/cli/show-aggregate-completeness', { modelId, name: aggregateName }, format);
302
+ }
303
+ export async function showReadModel(modelId, name, format = 'xml') {
304
+ return cliGetText('/cli/show-readmodel', { modelId, name }, format);
305
+ }
306
+ export async function showScreen(modelId, name, format = 'xml') {
307
+ return cliGetText('/cli/show-screen', { modelId, name }, format);
308
+ }
309
+ export async function showProcessor(modelId, name, format = 'xml') {
310
+ return cliGetText('/cli/show-processor', { modelId, name }, format);
311
+ }
312
+ export async function showAggregate(modelId, name, format = 'xml') {
313
+ return cliGetText('/cli/show-aggregate', { modelId, name }, format);
314
+ }
315
+ export async function showScenario(modelId, name, format = 'xml') {
316
+ return cliGetText('/cli/show-scenario', { modelId, name }, format);
317
+ }
318
+ export async function listScenarios(modelId, format = 'xml') {
319
+ return cliGetText('/cli/list-scenarios', { modelId }, format);
320
+ }