eventmodeler 0.6.1 → 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.
Files changed (2) hide show
  1. package/dist/index.js +122 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1234,6 +1234,15 @@ var createClient = (config = {}) => {
1234
1234
  var client = createClient(createClientConfig(createConfig({ baseUrl: "http://localhost:8080" })));
1235
1235
 
1236
1236
  // src/api/generated/sdk.gen.ts
1237
+ var resizeSwimLane = (options) => (options.client ?? client).post({
1238
+ security: [{ scheme: "bearer", type: "http" }],
1239
+ url: "/api/swim-lanes/resize-swim-lane",
1240
+ ...options,
1241
+ headers: {
1242
+ "Content-Type": "application/json",
1243
+ ...options.headers
1244
+ }
1245
+ });
1237
1246
  var renameSwimLane = (options) => (options.client ?? client).post({
1238
1247
  security: [{ scheme: "bearer", type: "http" }],
1239
1248
  url: "/api/swim-lanes/rename-swim-lane",
@@ -1270,6 +1279,15 @@ var moveSwimLane = (options) => (options.client ?? client).post({
1270
1279
  ...options.headers
1271
1280
  }
1272
1281
  });
1282
+ var resizeSlice = (options) => (options.client ?? client).post({
1283
+ security: [{ scheme: "bearer", type: "http" }],
1284
+ url: "/api/slices/resize-slice",
1285
+ ...options,
1286
+ headers: {
1287
+ "Content-Type": "application/json",
1288
+ ...options.headers
1289
+ }
1290
+ });
1273
1291
  var renameSlice = (options) => (options.client ?? client).post({
1274
1292
  security: [{ scheme: "bearer", type: "http" }],
1275
1293
  url: "/api/slices/rename-slice",
@@ -3097,6 +3115,15 @@ var addEventField = (options) => (options.client ?? client).post({
3097
3115
  ...options.headers
3098
3116
  }
3099
3117
  });
3118
+ var resizeContext = (options) => (options.client ?? client).post({
3119
+ security: [{ scheme: "bearer", type: "http" }],
3120
+ url: "/api/contexts/resize-context",
3121
+ ...options,
3122
+ headers: {
3123
+ "Content-Type": "application/json",
3124
+ ...options.headers
3125
+ }
3126
+ });
3100
3127
  var renameContext = (options) => (options.client ?? client).post({
3101
3128
  security: [{ scheme: "bearer", type: "http" }],
3102
3129
  url: "/api/contexts/rename-context",
@@ -3367,6 +3394,15 @@ var addCommandField = (options) => (options.client ?? client).post({
3367
3394
  ...options.headers
3368
3395
  }
3369
3396
  });
3397
+ var resizeChapter = (options) => (options.client ?? client).post({
3398
+ security: [{ scheme: "bearer", type: "http" }],
3399
+ url: "/api/chapters/resize-chapter",
3400
+ ...options,
3401
+ headers: {
3402
+ "Content-Type": "application/json",
3403
+ ...options.headers
3404
+ }
3405
+ });
3370
3406
  var renameChapter = (options) => (options.client ?? client).post({
3371
3407
  security: [{ scheme: "bearer", type: "http" }],
3372
3408
  url: "/api/chapters/rename-chapter",
@@ -3412,6 +3448,15 @@ var setAggregateIdField = (options) => (options.client ?? client).post({
3412
3448
  ...options.headers
3413
3449
  }
3414
3450
  });
3451
+ var resizeAggregate = (options) => (options.client ?? client).post({
3452
+ security: [{ scheme: "bearer", type: "http" }],
3453
+ url: "/api/aggregates/resize-aggregate",
3454
+ ...options,
3455
+ headers: {
3456
+ "Content-Type": "application/json",
3457
+ ...options.headers
3458
+ }
3459
+ });
3415
3460
  var renameAggregate = (options) => (options.client ?? client).post({
3416
3461
  security: [{ scheme: "bearer", type: "http" }],
3417
3462
  url: "/api/aggregates/rename-aggregate",
@@ -3448,6 +3493,15 @@ var moveAggregate = (options) => (options.client ?? client).post({
3448
3493
  ...options.headers
3449
3494
  }
3450
3495
  });
3496
+ var resizeActor = (options) => (options.client ?? client).post({
3497
+ security: [{ scheme: "bearer", type: "http" }],
3498
+ url: "/api/actors/resize-actor",
3499
+ ...options,
3500
+ headers: {
3501
+ "Content-Type": "application/json",
3502
+ ...options.headers
3503
+ }
3504
+ });
3451
3505
  var renameActor = (options) => (options.client ?? client).post({
3452
3506
  security: [{ scheme: "bearer", type: "http" }],
3453
3507
  url: "/api/actors/rename-actor",
@@ -3524,6 +3578,36 @@ var listModels = (options) => (options?.client ?? client).get({
3524
3578
  url: "/api/models",
3525
3579
  ...options
3526
3580
  });
3581
+ var swimLanes = (options) => (options.client ?? client).get({
3582
+ security: [{ scheme: "bearer", type: "http" }],
3583
+ url: "/api/models/{modelId}/swim-lanes",
3584
+ ...options
3585
+ });
3586
+ var slices = (options) => (options.client ?? client).get({
3587
+ security: [{ scheme: "bearer", type: "http" }],
3588
+ url: "/api/models/{modelId}/slices",
3589
+ ...options
3590
+ });
3591
+ var contexts = (options) => (options.client ?? client).get({
3592
+ security: [{ scheme: "bearer", type: "http" }],
3593
+ url: "/api/models/{modelId}/contexts",
3594
+ ...options
3595
+ });
3596
+ var chapters = (options) => (options.client ?? client).get({
3597
+ security: [{ scheme: "bearer", type: "http" }],
3598
+ url: "/api/models/{modelId}/chapters",
3599
+ ...options
3600
+ });
3601
+ var aggregates = (options) => (options.client ?? client).get({
3602
+ security: [{ scheme: "bearer", type: "http" }],
3603
+ url: "/api/models/{modelId}/aggregates",
3604
+ ...options
3605
+ });
3606
+ var actors = (options) => (options.client ?? client).get({
3607
+ security: [{ scheme: "bearer", type: "http" }],
3608
+ url: "/api/models/{modelId}/actors",
3609
+ ...options
3610
+ });
3527
3611
  var listExternalEvents = (options) => (options.client ?? client).get({
3528
3612
  security: [{ scheme: "bearer", type: "http" }],
3529
3613
  url: "/api/external-event-stickies/{modelId}/external-event-list",
@@ -6194,6 +6278,43 @@ function registerMoveCommands(program) {
6194
6278
  });
6195
6279
  }
6196
6280
 
6281
+ // src/commands/resize.ts
6282
+ var RESIZE_TABLE = {
6283
+ slice: { resize: resizeSlice, list: slices, idKey: "sliceId" },
6284
+ swimlane: { resize: resizeSwimLane, list: swimLanes, idKey: "swimLaneId" },
6285
+ context: { resize: resizeContext, list: contexts, idKey: "contextId" },
6286
+ chapter: { resize: resizeChapter, list: chapters, idKey: "chapterId" },
6287
+ aggregate: { resize: resizeAggregate, list: aggregates, idKey: "aggregateId" },
6288
+ actor: { resize: resizeActor, list: actors, idKey: "actorId" }
6289
+ };
6290
+ function registerResizeCommands(program) {
6291
+ program.command("resize <type> [name]").description(`Resize an element. Types: ${Object.keys(RESIZE_TABLE).join(", ")}`).requiredOption("--width <n>", "New width", Number).requiredOption("--height <n>", "New height", Number).option("--x <n>", "Override X coordinate (defaults to current)", Number).option("--y <n>", "Override Y coordinate (defaults to current)", Number).action(async (type, name, opts) => {
6292
+ const entry = RESIZE_TABLE[type];
6293
+ if (!entry) {
6294
+ throw new Error(`Unknown type: ${type}. Valid types: ${Object.keys(RESIZE_TABLE).join(", ")}`);
6295
+ }
6296
+ const modelId = requireModelId();
6297
+ const id = await resolve2(modelId, type, name ?? "", getGlobalId());
6298
+ let x = opts.x;
6299
+ let y = opts.y;
6300
+ if (x === undefined || y === undefined) {
6301
+ const list = unwrap(await entry.list({ path: { modelId } }));
6302
+ const current = list.items.find((item) => String(item[entry.idKey]) === id);
6303
+ if (!current) {
6304
+ throw new Error(`${type} ${name ?? id} not found in current model state`);
6305
+ }
6306
+ if (x === undefined)
6307
+ x = Number(current.x);
6308
+ if (y === undefined)
6309
+ y = Number(current.y);
6310
+ }
6311
+ unwrap(await entry.resize({
6312
+ body: { modelId, [entry.idKey]: id, x, y, width: opts.width, height: opts.height }
6313
+ }));
6314
+ console.log(`Resized ${type} to ${opts.width}x${opts.height} at (${x}, ${y}).`);
6315
+ });
6316
+ }
6317
+
6197
6318
  // src/commands/create.ts
6198
6319
  import { randomUUID as randomUUID2 } from "node:crypto";
6199
6320
  var FLOW_DISPATCH = {
@@ -7021,6 +7142,7 @@ registerAddCommands(program);
7021
7142
  registerRemoveCommands(program);
7022
7143
  registerRenameCommands(program);
7023
7144
  registerMoveCommands(program);
7145
+ registerResizeCommands(program);
7024
7146
  registerCreateCommands(program);
7025
7147
  registerUpdateCommands(program);
7026
7148
  registerMapCommands(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eventmodeler",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "CLI tool for event modeling - explore, design, and generate code from your event models",
5
5
  "type": "module",
6
6
  "bin": {