archgraph-argo 0.15.0 → 0.15.1
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.
|
@@ -22,6 +22,10 @@ const crypto = require('node:crypto');
|
|
|
22
22
|
|
|
23
23
|
const SYNC_PACKAGE_NAME = 'ArchGraph Sync';
|
|
24
24
|
const DIAGRAM_TYPE = 'Logical';
|
|
25
|
+
// Attributes/Operations "Show Compartments" (Elements tab) default unchecked: EA stores
|
|
26
|
+
// these in t_diagram.PDATA as HideAtts / HideOps (hide compartment = 1). Projected
|
|
27
|
+
// diagrams hide both compartments by default while preserving EA's other PDATA tokens.
|
|
28
|
+
const DIAGRAM_DISPLAY_DEFAULT = 'HideAtts=1;HideOps=1;';
|
|
25
29
|
const META_TABLE = 'kg_sync_meta'; // {kind,key,sha,payload} — Node export/reconcile store
|
|
26
30
|
const BUSY_TIMEOUT_MS = 15000;
|
|
27
31
|
const CHUNK = 200;
|
|
@@ -538,7 +542,7 @@ function syncGraphToQea(graph, qeaPath, opts) {
|
|
|
538
542
|
// it touches an open project and DROPS unknown tokens like schema_view_id — if we
|
|
539
543
|
// only matched by the token we would re-INSERT the same deterministic ea_guid and
|
|
540
544
|
// crash on t_diagram's UNIQUE(ea_guid) (projection failure: Neo4j ok, EA stale).
|
|
541
|
-
const existingDiags = db.prepare('SELECT Diagram_ID, Package_ID, Name, StyleEx, ea_guid FROM t_diagram WHERE Package_ID=?').all(syncId);
|
|
545
|
+
const existingDiags = db.prepare('SELECT Diagram_ID, Package_ID, Name, StyleEx, PDATA, ea_guid FROM t_diagram WHERE Package_ID=?').all(syncId);
|
|
542
546
|
const diagByView = new Map();
|
|
543
547
|
const diagByGuid = new Map();
|
|
544
548
|
for (const d of existingDiags) {
|
|
@@ -567,6 +571,7 @@ function syncGraphToQea(graph, qeaPath, opts) {
|
|
|
567
571
|
ParentID: parentObjectId,
|
|
568
572
|
Notes: '', // EA .qea 不保留多段 Notes;视图内容经 kg_sync_meta 保真
|
|
569
573
|
StyleEx: styleEx,
|
|
574
|
+
PDATA: DIAGRAM_DISPLAY_DEFAULT,
|
|
570
575
|
};
|
|
571
576
|
if (existing) {
|
|
572
577
|
diagViewRows.set(viewId, existing);
|
|
@@ -577,11 +582,17 @@ function syncGraphToQea(graph, qeaPath, opts) {
|
|
|
577
582
|
setStyleToken(existing.StyleEx, 'DLKO', '1'),
|
|
578
583
|
'schema_view_id=' + viewId
|
|
579
584
|
);
|
|
580
|
-
|
|
585
|
+
// Default Attributes/Operations compartments unchecked: force HideAtts=1 /
|
|
586
|
+
// HideOps=1 into PDATA while preserving EA's other display tokens.
|
|
587
|
+
const anchoredPdata = setStyleToken(
|
|
588
|
+
setStyleToken(existing.PDATA, 'HideAtts', '1'),
|
|
589
|
+
'HideOps', '1'
|
|
590
|
+
);
|
|
591
|
+
const changed = intended.Name !== (existing.Name || '') || (existing.StyleEx || '') !== anchoredStyleEx || (existing.PDATA || '') !== anchoredPdata;
|
|
581
592
|
if (DEBUG && changed) { console.error('DEBUG diagram chg', viewId, JSON.stringify({n:[intended.Name,(existing.Name||'')], style: !!parseStyleToken(existing.StyleEx,'schema_view_id')})); }
|
|
582
593
|
if (changed && !o.dryRun) {
|
|
583
|
-
db.prepare('UPDATE t_diagram SET Name=?, StyleEx=? WHERE Diagram_ID=?')
|
|
584
|
-
.run(intended.Name, anchoredStyleEx, Number(existing.Diagram_ID));
|
|
594
|
+
db.prepare('UPDATE t_diagram SET Name=?, StyleEx=?, PDATA=? WHERE Diagram_ID=?')
|
|
595
|
+
.run(intended.Name, anchoredStyleEx, anchoredPdata, Number(existing.Diagram_ID));
|
|
585
596
|
}
|
|
586
597
|
stats[changed ? 'updated' : 'skipped'].diagrams++;
|
|
587
598
|
} else {
|
|
@@ -592,7 +603,7 @@ function syncGraphToQea(graph, qeaPath, opts) {
|
|
|
592
603
|
const diagAliasToId = new Map();
|
|
593
604
|
if (!o.dryRun) {
|
|
594
605
|
if (newDiags.length > 0) {
|
|
595
|
-
insertMany(db, 't_diagram', ['Name', 'Diagram_Type', 'Package_ID', 'ParentID', 'StyleEx', 'ea_guid'], newDiags);
|
|
606
|
+
insertMany(db, 't_diagram', ['Name', 'Diagram_Type', 'Package_ID', 'ParentID', 'StyleEx', 'PDATA', 'ea_guid'], newDiags);
|
|
596
607
|
}
|
|
597
608
|
for (let i = 0; i < newDiags.length; i += 200) {
|
|
598
609
|
const part = newDiags.slice(i, i + 200);
|
package/package.json
CHANGED