@xiangyang9999/my-text 1.0.0 → 1.0.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/README.md CHANGED
@@ -1,44 +1,50 @@
1
1
  # @xiangyang9999/my-text
2
2
 
3
- 文本版本:`1.0.0`
4
- 更新时间:`2026-09-21T09:37:17.619Z`
3
+ 文本版本:`1.0.2`
4
+ 更新时间:`2026-09-21T11:41:46.479Z`
5
5
 
6
6
  ## 内容
7
7
 
8
- <pre>gq "def hashes = g.V(1793616L)
9
- .hasLabel('Artifact')
10
- .has('storageId','product-uat-storage')
11
- .out('ArtifactHasComponents')
12
- .hasId(16299944L)
13
- .dedup()
14
- .hasLabel('Component')
15
- .has('name','jaxen')
16
- .has('purl','pkg:maven/jaxen/jaxen@1.1.4')
17
- .values('sha1sum')
18
- .toList();
19
-
20
- if (hashes.size() != 1) {
21
- return 'STOP: 未取得唯一的目标组件SHA-1,请勿写数据';
22
- }
8
+ <pre>gq "def db = g.getGraph();
23
9
 
24
- def candidate = hashes[0].toString();
25
- if (!(candidate ==~ /[0-9a-fA-F]{40}/)) {
26
- return 'STOP: SHA-1格式不符合预期,请勿写数据';
10
+ if (!(db instanceof org.janusgraph.core.JanusGraph)) {
11
+ return [status:'STOP', graphClass:db.getClass().getName()];
27
12
  }
28
13
 
29
- [
30
- candidateUuid: candidate,
31
- currentComponent: g.V(16299944L)
32
- .valueMap(true,'uuid','name','purl','sha1sum','created','lastUpdated')
33
- .toList(),
34
- uuidLookupMatches: g.V()
35
- .has('uuid',candidate)
36
- .limit(10)
37
- .project('id','label','uuidValues','info')
38
- .by(__.id())
39
- .by(__.label())
40
- .by(__.values('uuid').fold())
41
- .by(__.valueMap('name','purl','sha1sum'))
42
- .toList()
43
- ]"
14
+ def tx = db.buildTransaction()
15
+ .readOnly()
16
+ .checkExternalVertexExistence(true)
17
+ .checkInternalVertexExistence(true)
18
+ .skipDBCacheRead()
19
+ .start();
20
+
21
+ try {
22
+ def q = tx.traversal();
23
+
24
+ def artifactIds = q.V(1793616L)
25
+ .hasLabel('Artifact')
26
+ .has('storageId','product-uat-storage')
27
+ .id().toList();
28
+
29
+ def components = q.V(16299944L).toList();
30
+
31
+ def details = components.collect { v -&gt;
32
+ [
33
+ id: v.id(),
34
+ label: v.label(),
35
+ uuidValues: v.values('uuid').toList(),
36
+ nameValues: v.values('name').toList(),
37
+ purlValues: v.values('purl').toList(),
38
+ sha1Values: v.values('sha1sum').toList()
39
+ ]
40
+ };
41
+
42
+ return [
43
+ artifactIds: artifactIds,
44
+ checkedComponentCount: components.size(),
45
+ componentDetails: details
46
+ ];
47
+ } finally {
48
+ tx.rollback();
49
+ }"
44
50
  </pre>
package/content.txt CHANGED
@@ -1,36 +1,42 @@
1
- gq "def hashes = g.V(1793616L)
2
- .hasLabel('Artifact')
3
- .has('storageId','product-uat-storage')
4
- .out('ArtifactHasComponents')
5
- .hasId(16299944L)
6
- .dedup()
7
- .hasLabel('Component')
8
- .has('name','jaxen')
9
- .has('purl','pkg:maven/jaxen/jaxen@1.1.4')
10
- .values('sha1sum')
11
- .toList();
1
+ gq "def db = g.getGraph();
12
2
 
13
- if (hashes.size() != 1) {
14
- return 'STOP: 未取得唯一的目标组件SHA-1,请勿写数据';
3
+ if (!(db instanceof org.janusgraph.core.JanusGraph)) {
4
+ return [status:'STOP', graphClass:db.getClass().getName()];
15
5
  }
16
6
 
17
- def candidate = hashes[0].toString();
18
- if (!(candidate ==~ /[0-9a-fA-F]{40}/)) {
19
- return 'STOP: SHA-1格式不符合预期,请勿写数据';
20
- }
7
+ def tx = db.buildTransaction()
8
+ .readOnly()
9
+ .checkExternalVertexExistence(true)
10
+ .checkInternalVertexExistence(true)
11
+ .skipDBCacheRead()
12
+ .start();
13
+
14
+ try {
15
+ def q = tx.traversal();
16
+
17
+ def artifactIds = q.V(1793616L)
18
+ .hasLabel('Artifact')
19
+ .has('storageId','product-uat-storage')
20
+ .id().toList();
21
+
22
+ def components = q.V(16299944L).toList();
23
+
24
+ def details = components.collect { v ->
25
+ [
26
+ id: v.id(),
27
+ label: v.label(),
28
+ uuidValues: v.values('uuid').toList(),
29
+ nameValues: v.values('name').toList(),
30
+ purlValues: v.values('purl').toList(),
31
+ sha1Values: v.values('sha1sum').toList()
32
+ ]
33
+ };
21
34
 
22
- [
23
- candidateUuid: candidate,
24
- currentComponent: g.V(16299944L)
25
- .valueMap(true,'uuid','name','purl','sha1sum','created','lastUpdated')
26
- .toList(),
27
- uuidLookupMatches: g.V()
28
- .has('uuid',candidate)
29
- .limit(10)
30
- .project('id','label','uuidValues','info')
31
- .by(__.id())
32
- .by(__.label())
33
- .by(__.values('uuid').fold())
34
- .by(__.valueMap('name','purl','sha1sum'))
35
- .toList()
36
- ]"
35
+ return [
36
+ artifactIds: artifactIds,
37
+ checkedComponentCount: components.size(),
38
+ componentDetails: details
39
+ ];
40
+ } finally {
41
+ tx.rollback();
42
+ }"
package/metadata.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "package": "@xiangyang9999/my-text",
3
- "version": "1.0.0",
4
- "updatedAt": "2026-09-21T09:37:17.619Z",
5
- "bytes": 940,
6
- "sha256": "3bd8a9f1b1d15745fcd5b085fd10858d70dcdd9008bec2a8d9752769c5ccb109"
3
+ "version": "1.0.2",
4
+ "updatedAt": "2026-09-21T11:41:46.479Z",
5
+ "bytes": 944,
6
+ "sha256": "3e64d4aa6760a08de3903ea69884c2ec5e62f11ad70a66f42a0f27b22a3cca83"
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xiangyang9999/my-text",
3
- "version": "1.0.0",
4
- "description": "Text channel updated at 2026-09-21T09:37:17.619Z",
3
+ "version": "1.0.2",
4
+ "description": "Text channel updated at 2026-09-21T11:41:46.479Z",
5
5
  "files": [
6
6
  "content.txt",
7
7
  "metadata.json",