@living-architecture/riviere-cli 0.3.6 → 0.3.7

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/bin.js CHANGED
@@ -7489,6 +7489,33 @@ function componentsByType(graph, type) {
7489
7489
  return findAllComponents(graph, (c) => c.type === type);
7490
7490
  }
7491
7491
 
7492
+ // ../riviere-query/dist/event-types.js
7493
+ var Entity = class {
7494
+ name;
7495
+ domain;
7496
+ operations;
7497
+ states;
7498
+ transitions;
7499
+ businessRules;
7500
+ constructor(name, domain2, operations, states, transitions, businessRules) {
7501
+ this.name = name;
7502
+ this.domain = domain2;
7503
+ this.operations = operations;
7504
+ this.states = states;
7505
+ this.transitions = transitions;
7506
+ this.businessRules = businessRules;
7507
+ }
7508
+ hasStates() {
7509
+ return this.states.length > 0;
7510
+ }
7511
+ hasBusinessRules() {
7512
+ return this.businessRules.length > 0;
7513
+ }
7514
+ firstOperationId() {
7515
+ return this.operations[0]?.id;
7516
+ }
7517
+ };
7518
+
7492
7519
  // ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/classic/external.js
7493
7520
  var external_exports = {};
7494
7521
  __export(external_exports, {
@@ -21077,13 +21104,17 @@ function queryEntities(graph, domainName) {
21077
21104
  for (const op of filtered) {
21078
21105
  const key = `${op.domain}:${op.entity}`;
21079
21106
  const existing = entityMap.get(key);
21080
- if (existing) {
21107
+ if (existing !== void 0) {
21081
21108
  entityMap.set(key, { ...existing, operations: [...existing.operations, op] });
21082
21109
  } else {
21083
- entityMap.set(key, { name: parseEntityName(op.entity), domain: parseDomainName(op.domain), operations: [op] });
21110
+ entityMap.set(key, { name: op.entity, domain: op.domain, operations: [op] });
21084
21111
  }
21085
21112
  }
21086
- return Array.from(entityMap.values());
21113
+ return Array.from(entityMap.values()).sort((a, b) => a.name.localeCompare(b.name)).map((partial2) => createEntity(graph, partial2));
21114
+ }
21115
+ function createEntity(graph, partial2) {
21116
+ const sortedOperations = [...partial2.operations].sort((a, b) => a.operationName.localeCompare(b.operationName));
21117
+ return new Entity(parseEntityName(partial2.name), parseDomainName(partial2.domain), sortedOperations, statesForEntity(graph, partial2.name), transitionsForEntity(graph, partial2.name), businessRulesForEntity(graph, partial2.name));
21087
21118
  }
21088
21119
  function businessRulesForEntity(graph, entityName) {
21089
21120
  const operations = operationsForEntity(graph, entityName);
package/dist/index.js CHANGED
@@ -7488,6 +7488,33 @@ function componentsByType(graph, type) {
7488
7488
  return findAllComponents(graph, (c) => c.type === type);
7489
7489
  }
7490
7490
 
7491
+ // ../riviere-query/dist/event-types.js
7492
+ var Entity = class {
7493
+ name;
7494
+ domain;
7495
+ operations;
7496
+ states;
7497
+ transitions;
7498
+ businessRules;
7499
+ constructor(name, domain2, operations, states, transitions, businessRules) {
7500
+ this.name = name;
7501
+ this.domain = domain2;
7502
+ this.operations = operations;
7503
+ this.states = states;
7504
+ this.transitions = transitions;
7505
+ this.businessRules = businessRules;
7506
+ }
7507
+ hasStates() {
7508
+ return this.states.length > 0;
7509
+ }
7510
+ hasBusinessRules() {
7511
+ return this.businessRules.length > 0;
7512
+ }
7513
+ firstOperationId() {
7514
+ return this.operations[0]?.id;
7515
+ }
7516
+ };
7517
+
7491
7518
  // ../../node_modules/.pnpm/zod@4.2.1/node_modules/zod/v4/classic/external.js
7492
7519
  var external_exports = {};
7493
7520
  __export(external_exports, {
@@ -21076,13 +21103,17 @@ function queryEntities(graph, domainName) {
21076
21103
  for (const op of filtered) {
21077
21104
  const key = `${op.domain}:${op.entity}`;
21078
21105
  const existing = entityMap.get(key);
21079
- if (existing) {
21106
+ if (existing !== void 0) {
21080
21107
  entityMap.set(key, { ...existing, operations: [...existing.operations, op] });
21081
21108
  } else {
21082
- entityMap.set(key, { name: parseEntityName(op.entity), domain: parseDomainName(op.domain), operations: [op] });
21109
+ entityMap.set(key, { name: op.entity, domain: op.domain, operations: [op] });
21083
21110
  }
21084
21111
  }
21085
- return Array.from(entityMap.values());
21112
+ return Array.from(entityMap.values()).sort((a, b) => a.name.localeCompare(b.name)).map((partial2) => createEntity(graph, partial2));
21113
+ }
21114
+ function createEntity(graph, partial2) {
21115
+ const sortedOperations = [...partial2.operations].sort((a, b) => a.operationName.localeCompare(b.operationName));
21116
+ return new Entity(parseEntityName(partial2.name), parseDomainName(partial2.domain), sortedOperations, statesForEntity(graph, partial2.name), transitionsForEntity(graph, partial2.name), businessRulesForEntity(graph, partial2.name));
21086
21117
  }
21087
21118
  function businessRulesForEntity(graph, entityName) {
21088
21119
  const operations = operationsForEntity(graph, entityName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@living-architecture/riviere-cli",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -27,8 +27,8 @@
27
27
  "dependencies": {
28
28
  "commander": "^14.0.2",
29
29
  "tslib": "^2.3.0",
30
- "@living-architecture/riviere-query": "0.2.8",
31
- "@living-architecture/riviere-builder": "0.2.9",
32
- "@living-architecture/riviere-schema": "0.2.6"
30
+ "@living-architecture/riviere-builder": "0.2.10",
31
+ "@living-architecture/riviere-schema": "0.2.6",
32
+ "@living-architecture/riviere-query": "0.2.9"
33
33
  }
34
34
  }