@jupiterone/integration-sdk-cli 8.4.1 → 8.4.4

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 (39) hide show
  1. package/dist/src/commands/document.js.map +1 -1
  2. package/dist/src/commands/neo4j.js +4 -2
  3. package/dist/src/commands/neo4j.js.map +1 -1
  4. package/dist/src/commands/visualize-types.js +1 -1
  5. package/dist/src/commands/visualize-types.js.map +1 -1
  6. package/dist/src/config.js +2 -1
  7. package/dist/src/config.js.map +1 -1
  8. package/dist/src/neo4j/neo4jGraphStore.js +25 -9
  9. package/dist/src/neo4j/neo4jGraphStore.js.map +1 -1
  10. package/dist/src/neo4j/neo4jUtilities.js +15 -13
  11. package/dist/src/neo4j/neo4jUtilities.js.map +1 -1
  12. package/dist/src/neo4j/uploadToNeo4j.js.map +1 -1
  13. package/dist/src/neo4j/wipeNeo4j.js.map +1 -1
  14. package/dist/src/visualization/generateVisualization.js +2 -2
  15. package/dist/src/visualization/generateVisualization.js.map +1 -1
  16. package/dist/src/visualization/retrieveIntegrationData.js.map +1 -1
  17. package/dist/src/visualization/utils.d.ts +1 -1
  18. package/dist/src/visualization/utils.js.map +1 -1
  19. package/dist/tsconfig.dist.tsbuildinfo +1 -1
  20. package/package.json +4 -4
  21. package/src/commands/document.ts +10 -9
  22. package/src/commands/neo4j.ts +16 -10
  23. package/src/commands/visualize-types.ts +7 -9
  24. package/src/config.ts +2 -1
  25. package/src/neo4j/README.md +15 -18
  26. package/src/neo4j/__tests__/neo4jGraphStore.test.ts +55 -53
  27. package/src/neo4j/__tests__/neo4jUtilities.test.ts +65 -9
  28. package/src/neo4j/index.ts +1 -1
  29. package/src/neo4j/neo4jGraphStore.ts +64 -29
  30. package/src/neo4j/neo4jUtilities.ts +17 -16
  31. package/src/neo4j/uploadToNeo4j.ts +5 -2
  32. package/src/neo4j/wipeNeo4j.ts +15 -11
  33. package/src/visualization/__tests__/createMappedRelationshipNodesAndEdges.test.ts +35 -49
  34. package/src/visualization/generateVisualization.ts +7 -12
  35. package/src/visualization/retrieveIntegrationData.ts +3 -5
  36. package/src/visualization/types/IntegrationData.ts +5 -1
  37. package/src/visualization/utils.ts +7 -4
  38. package/tsconfig.dist.json +1 -3
  39. package/tsconfig.json +1 -3
@@ -42,13 +42,11 @@ describe('#createMappedRelationshipNodesAndEdges', () => {
42
42
  },
43
43
  ];
44
44
 
45
- const {
46
- mappedRelationshipEdges,
47
- mappedRelationshipNodes,
48
- } = createMappedRelationshipNodesAndEdges({
49
- mappedRelationships,
50
- explicitEntities,
51
- });
45
+ const { mappedRelationshipEdges, mappedRelationshipNodes } =
46
+ createMappedRelationshipNodesAndEdges({
47
+ mappedRelationships,
48
+ explicitEntities,
49
+ });
52
50
 
53
51
  expect(mappedRelationshipEdges).toEqual([
54
52
  {
@@ -71,13 +69,11 @@ describe('#createMappedRelationshipNodesAndEdges', () => {
71
69
  },
72
70
  ];
73
71
 
74
- const {
75
- mappedRelationshipEdges,
76
- mappedRelationshipNodes,
77
- } = createMappedRelationshipNodesAndEdges({
78
- mappedRelationships,
79
- explicitEntities,
80
- });
72
+ const { mappedRelationshipEdges, mappedRelationshipNodes } =
73
+ createMappedRelationshipNodesAndEdges({
74
+ mappedRelationships,
75
+ explicitEntities,
76
+ });
81
77
 
82
78
  expect(mappedRelationshipEdges).toEqual([
83
79
  {
@@ -110,13 +106,11 @@ describe('#createMappedRelationshipNodesAndEdges', () => {
110
106
  },
111
107
  ];
112
108
 
113
- const {
114
- mappedRelationshipEdges,
115
- mappedRelationshipNodes,
116
- } = createMappedRelationshipNodesAndEdges({
117
- mappedRelationships,
118
- explicitEntities,
119
- });
109
+ const { mappedRelationshipEdges, mappedRelationshipNodes } =
110
+ createMappedRelationshipNodesAndEdges({
111
+ mappedRelationships,
112
+ explicitEntities,
113
+ });
120
114
 
121
115
  expect(mappedRelationshipEdges).toEqual([
122
116
  {
@@ -184,13 +178,11 @@ describe('#createMappedRelationshipNodesAndEdges', () => {
184
178
  },
185
179
  ];
186
180
 
187
- const {
188
- mappedRelationshipEdges,
189
- mappedRelationshipNodes,
190
- } = createMappedRelationshipNodesAndEdges({
191
- mappedRelationships,
192
- explicitEntities,
193
- });
181
+ const { mappedRelationshipEdges, mappedRelationshipNodes } =
182
+ createMappedRelationshipNodesAndEdges({
183
+ mappedRelationships,
184
+ explicitEntities,
185
+ });
194
186
 
195
187
  expect(mappedRelationshipEdges).toEqual([
196
188
  {
@@ -264,13 +256,11 @@ describe('#createMappedRelationshipNodesAndEdges', () => {
264
256
  },
265
257
  ];
266
258
 
267
- const {
268
- mappedRelationshipEdges,
269
- mappedRelationshipNodes,
270
- } = createMappedRelationshipNodesAndEdges({
271
- mappedRelationships,
272
- explicitEntities,
273
- });
259
+ const { mappedRelationshipEdges, mappedRelationshipNodes } =
260
+ createMappedRelationshipNodesAndEdges({
261
+ mappedRelationships,
262
+ explicitEntities,
263
+ });
274
264
 
275
265
  expect(mappedRelationshipEdges).toEqual([
276
266
  {
@@ -328,13 +318,11 @@ describe('#createMappedRelationshipNodesAndEdges', () => {
328
318
  },
329
319
  ];
330
320
 
331
- const {
332
- mappedRelationshipEdges,
333
- mappedRelationshipNodes,
334
- } = createMappedRelationshipNodesAndEdges({
335
- mappedRelationships,
336
- explicitEntities,
337
- });
321
+ const { mappedRelationshipEdges, mappedRelationshipNodes } =
322
+ createMappedRelationshipNodesAndEdges({
323
+ mappedRelationships,
324
+ explicitEntities,
325
+ });
338
326
 
339
327
  expect(mappedRelationshipEdges).toEqual([
340
328
  {
@@ -389,13 +377,11 @@ describe('#createMappedRelationshipNodesAndEdges', () => {
389
377
  },
390
378
  ];
391
379
 
392
- const {
393
- mappedRelationshipEdges,
394
- mappedRelationshipNodes,
395
- } = createMappedRelationshipNodesAndEdges({
396
- mappedRelationships,
397
- explicitEntities,
398
- });
380
+ const { mappedRelationshipEdges, mappedRelationshipNodes } =
381
+ createMappedRelationshipNodesAndEdges({
382
+ mappedRelationships,
383
+ explicitEntities,
384
+ });
399
385
 
400
386
  expect(mappedRelationshipEdges).toEqual([
401
387
  {
@@ -28,11 +28,8 @@ export async function generateVisualization(
28
28
  log.warn(`Unable to find any files under path: ${graphDataPath}`);
29
29
  }
30
30
 
31
- const {
32
- entities,
33
- relationships,
34
- mappedRelationships,
35
- } = await retrieveIntegrationData(entitiesAndRelationshipPaths);
31
+ const { entities, relationships, mappedRelationships } =
32
+ await retrieveIntegrationData(entitiesAndRelationshipPaths);
36
33
 
37
34
  const nodeDataSets = entities.map((entity) => ({
38
35
  id: getNodeIdFromEntity(entity, []),
@@ -47,13 +44,11 @@ export async function generateVisualization(
47
44
  }),
48
45
  );
49
46
 
50
- const {
51
- mappedRelationshipEdges,
52
- mappedRelationshipNodes,
53
- } = createMappedRelationshipNodesAndEdges({
54
- mappedRelationships,
55
- explicitEntities: entities,
56
- });
47
+ const { mappedRelationshipEdges, mappedRelationshipNodes } =
48
+ createMappedRelationshipNodesAndEdges({
49
+ mappedRelationships,
50
+ explicitEntities: entities,
51
+ });
57
52
 
58
53
  await writeFileToPath({
59
54
  path: visualizationOutputPath,
@@ -18,11 +18,9 @@ export async function retrieveIntegrationData(
18
18
  const mappedRelationships: MappedRelationship[] = [];
19
19
 
20
20
  const entitiesAndRelationships = await Promise.all(
21
- entitiesAndRelationshipPaths.map(
22
- async (path): Promise<any> => {
23
- return await readJsonFromPath<any>(path);
24
- },
25
- ),
21
+ entitiesAndRelationshipPaths.map(async (path): Promise<any> => {
22
+ return await readJsonFromPath<any>(path);
23
+ }),
26
24
  );
27
25
 
28
26
  for (const item of entitiesAndRelationships) {
@@ -1,4 +1,8 @@
1
- import { Entity, ExplicitRelationship, MappedRelationship } from '@jupiterone/integration-sdk-core';
1
+ import {
2
+ Entity,
3
+ ExplicitRelationship,
4
+ MappedRelationship,
5
+ } from '@jupiterone/integration-sdk-core';
2
6
 
3
7
  export interface IntegrationData {
4
8
  entities: Entity[];
@@ -1,18 +1,21 @@
1
1
  import { v4 as uuid } from 'uuid';
2
- import { Entity } from "@jupiterone/integration-sdk-core";
2
+ import { Entity } from '@jupiterone/integration-sdk-core';
3
3
 
4
4
  export type NodeEntity = Partial<Entity> & { nodeId: string };
5
5
 
6
6
  /**
7
7
  * The nodeId should map back to _key, which ought to be globally unique.
8
8
  * Entities set their node ID once, and return if available.
9
- *
9
+ *
10
10
  * If nodeId is not set, first check that the _key isn't already a nodeId for another entity.
11
11
  * Duplicates will break vis.js, so we will set nodeId to a UUID (this makes isNodeDuplicate(nodeEntity) === true)
12
- *
12
+ *
13
13
  * If node is not a duplicate, return either the entity _key, or, if unavailable, return a new UUID.
14
14
  */
15
- export function getNodeIdFromEntity(entity: Partial<NodeEntity>, existingEntities: NodeEntity[]): string {
15
+ export function getNodeIdFromEntity(
16
+ entity: Partial<NodeEntity>,
17
+ existingEntities: NodeEntity[],
18
+ ): string {
16
19
  if (entity.nodeId !== undefined) {
17
20
  return entity.nodeId;
18
21
  }
@@ -3,9 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "sourceMap": true
5
5
  },
6
- "include": [
7
- "src"
8
- ],
6
+ "include": ["src"],
9
7
  "exclude": [
10
8
  "**/dist/*",
11
9
  "**/*.test.ts",
package/tsconfig.json CHANGED
@@ -3,9 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "outDir": "dist"
5
5
  },
6
- "exclude": [
7
- "**/dist/*"
8
- ],
6
+ "exclude": ["**/dist/*"],
9
7
  "references": [
10
8
  { "path": "../integration-sdk-core" },
11
9
  { "path": "../integration-sdk-runtime" },