@jupiterone/integration-sdk-cli 11.0.0 → 11.0.3
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/src/commands/visualize-types.d.ts +1 -1
- package/dist/src/utils/generateVisHTML.d.ts +1 -1
- package/dist/src/utils/getSortedJupiterOneTypes.d.ts +1 -0
- package/dist/src/utils/getSortedJupiterOneTypes.js +20 -5
- package/dist/src/utils/getSortedJupiterOneTypes.js.map +1 -1
- package/dist/src/visualization/createMappedRelationshipNodesAndEdges.d.ts +1 -1
- package/dist/tsconfig.dist.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/commands/visualize-types.ts +1 -1
- package/src/utils/generateVisHTML.ts +1 -1
- package/src/utils/getSortedJupiterOneTypes.test.ts +64 -1
- package/src/utils/getSortedJupiterOneTypes.ts +21 -10
- package/src/visualization/__tests__/generateVisHTML.test.ts +1 -1
- package/src/visualization/createMappedRelationshipNodesAndEdges.ts +1 -1
- package/src/visualization/generateDependencyVisualization.ts +1 -1
- package/src/visualization/generateVisualization.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupiterone/integration-sdk-cli",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.3",
|
|
4
4
|
"description": "The SDK for developing JupiterOne integrations",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@jupiterone/data-model": "^0.54.0",
|
|
28
|
-
"@jupiterone/integration-sdk-core": "^11.0.
|
|
29
|
-
"@jupiterone/integration-sdk-runtime": "^11.0.
|
|
28
|
+
"@jupiterone/integration-sdk-core": "^11.0.3",
|
|
29
|
+
"@jupiterone/integration-sdk-runtime": "^11.0.3",
|
|
30
30
|
"chalk": "^4",
|
|
31
31
|
"commander": "^9.4.0",
|
|
32
32
|
"fs-extra": "^10.1.0",
|
|
@@ -40,11 +40,10 @@
|
|
|
40
40
|
"plop": "^3.1.2",
|
|
41
41
|
"runtypes": "5.1.0",
|
|
42
42
|
"upath": "^1.2.0",
|
|
43
|
-
"url-exists": "^1.0.3"
|
|
44
|
-
"vis": "^4.21.0-EOL"
|
|
43
|
+
"url-exists": "^1.0.3"
|
|
45
44
|
},
|
|
46
45
|
"devDependencies": {
|
|
47
|
-
"@jupiterone/integration-sdk-private-test-utils": "^11.0.
|
|
46
|
+
"@jupiterone/integration-sdk-private-test-utils": "^11.0.3",
|
|
48
47
|
"@pollyjs/adapter-node-http": "^6.0.5",
|
|
49
48
|
"@pollyjs/core": "^6.0.5",
|
|
50
49
|
"@pollyjs/persister-fs": "^6.0.5",
|
|
@@ -54,7 +53,8 @@
|
|
|
54
53
|
"@types/lodash": "^4.14.158",
|
|
55
54
|
"@types/vis": "^4.21.20",
|
|
56
55
|
"memfs": "^3.2.0",
|
|
57
|
-
"neo-forgery": "^2.0.0"
|
|
56
|
+
"neo-forgery": "^2.0.0",
|
|
57
|
+
"vis": "^4.21.0-EOL"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "56969b96de598bbf0cc0299aec264f488d14d4b1"
|
|
60
60
|
}
|
|
@@ -6,8 +6,11 @@ import {
|
|
|
6
6
|
StepMappedRelationshipMetadata,
|
|
7
7
|
StepRelationshipMetadata,
|
|
8
8
|
} from '@jupiterone/integration-sdk-core';
|
|
9
|
-
import { collectGraphObjectMetadataFromSteps } from './getSortedJupiterOneTypes';
|
|
10
9
|
import { randomUUID as uuid } from 'crypto';
|
|
10
|
+
import {
|
|
11
|
+
alphabetizeMetadataProperties,
|
|
12
|
+
collectGraphObjectMetadataFromSteps,
|
|
13
|
+
} from './getSortedJupiterOneTypes';
|
|
11
14
|
|
|
12
15
|
function createIntegrationStep({
|
|
13
16
|
entities = [],
|
|
@@ -214,3 +217,63 @@ describe('collectGraphObjectMetadataFromSteps', () => {
|
|
|
214
217
|
});
|
|
215
218
|
});
|
|
216
219
|
});
|
|
220
|
+
|
|
221
|
+
describe('alphabetizeMetadataProperties', () => {
|
|
222
|
+
it('should correctly sort an array of StepRelationshipMetadata', () => {
|
|
223
|
+
const { relationships } = alphabetizeMetadataProperties(
|
|
224
|
+
collectGraphObjectMetadataFromSteps([
|
|
225
|
+
createIntegrationStep({
|
|
226
|
+
relationships: [
|
|
227
|
+
{
|
|
228
|
+
_type: 'aws_account_has_service',
|
|
229
|
+
sourceType: 'aws_account',
|
|
230
|
+
_class: RelationshipClass.HAS,
|
|
231
|
+
targetType: 'aws_waf',
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
}),
|
|
235
|
+
createIntegrationStep({
|
|
236
|
+
relationships: [
|
|
237
|
+
{
|
|
238
|
+
_type: 'aws_account_owns_service',
|
|
239
|
+
sourceType: 'aws_account',
|
|
240
|
+
_class: RelationshipClass.OWNS,
|
|
241
|
+
targetType: 'aws_apigateway',
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
}),
|
|
245
|
+
createIntegrationStep({
|
|
246
|
+
relationships: [
|
|
247
|
+
{
|
|
248
|
+
_type: 'aws_account_has_service',
|
|
249
|
+
sourceType: 'aws_account',
|
|
250
|
+
_class: RelationshipClass.HAS,
|
|
251
|
+
targetType: 'aws_apigateway',
|
|
252
|
+
},
|
|
253
|
+
],
|
|
254
|
+
}),
|
|
255
|
+
]),
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
expect(relationships).toEqual([
|
|
259
|
+
{
|
|
260
|
+
_type: 'aws_account_has_service',
|
|
261
|
+
sourceType: 'aws_account',
|
|
262
|
+
_class: 'HAS',
|
|
263
|
+
targetType: 'aws_apigateway',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
_type: 'aws_account_owns_service',
|
|
267
|
+
sourceType: 'aws_account',
|
|
268
|
+
_class: 'OWNS',
|
|
269
|
+
targetType: 'aws_apigateway',
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
_type: 'aws_account_has_service',
|
|
273
|
+
sourceType: 'aws_account',
|
|
274
|
+
_class: 'HAS',
|
|
275
|
+
targetType: 'aws_waf',
|
|
276
|
+
},
|
|
277
|
+
]);
|
|
278
|
+
});
|
|
279
|
+
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { loadConfig } from '../config';
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
import { buildStepDependencyGraph } from '@jupiterone/integration-sdk-runtime';
|
|
4
1
|
import {
|
|
5
2
|
IntegrationStepExecutionContext,
|
|
6
3
|
Step,
|
|
7
|
-
StepGraphObjectMetadataProperties,
|
|
8
4
|
StepEntityMetadata,
|
|
9
|
-
|
|
5
|
+
StepGraphObjectMetadataProperties,
|
|
10
6
|
StepMappedRelationshipMetadata,
|
|
7
|
+
StepRelationshipMetadata,
|
|
11
8
|
} from '@jupiterone/integration-sdk-core';
|
|
9
|
+
import { buildStepDependencyGraph } from '@jupiterone/integration-sdk-runtime';
|
|
10
|
+
import * as path from 'path';
|
|
11
|
+
import { loadConfig } from '../config';
|
|
12
12
|
|
|
13
13
|
export interface TypesCommandArgs {
|
|
14
14
|
projectPath: string;
|
|
@@ -57,15 +57,26 @@ function alphabetizeEntityMetadataPropertyByTypeCompareFn(
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function alphabetizeRelationshipMetadataPropertyByTypeCompareFn(
|
|
60
|
-
a: StepRelationshipMetadata,
|
|
61
|
-
b: StepRelationshipMetadata,
|
|
60
|
+
a: StepRelationshipMetadata | StepMappedRelationshipMetadata,
|
|
61
|
+
b: StepRelationshipMetadata | StepMappedRelationshipMetadata,
|
|
62
62
|
): number {
|
|
63
|
-
if (a.
|
|
64
|
-
if (a.
|
|
63
|
+
if (a.sourceType > b.sourceType) return 1;
|
|
64
|
+
if (a.sourceType < b.sourceType) return -1;
|
|
65
|
+
|
|
66
|
+
if (a.targetType > b.targetType) return 1;
|
|
67
|
+
if (a.targetType < b.targetType) return -1;
|
|
68
|
+
|
|
69
|
+
if (a._class > b._class) return 1;
|
|
70
|
+
if (a._class < b._class) return -1;
|
|
71
|
+
|
|
72
|
+
if ('direction' in a && 'direction' in b) {
|
|
73
|
+
if (a.direction > b.direction) return 1;
|
|
74
|
+
if (a.direction < b.direction) return -1;
|
|
75
|
+
}
|
|
65
76
|
return 0;
|
|
66
77
|
}
|
|
67
78
|
|
|
68
|
-
function alphabetizeMetadataProperties(
|
|
79
|
+
export function alphabetizeMetadataProperties(
|
|
69
80
|
metadata: StepGraphObjectMetadataProperties,
|
|
70
81
|
): StepGraphObjectMetadataProperties {
|
|
71
82
|
return {
|
|
@@ -5,7 +5,7 @@ import * as path from 'path';
|
|
|
5
5
|
|
|
6
6
|
import { generateVisHTML } from '../utils/generateVisHTML';
|
|
7
7
|
|
|
8
|
-
import { Node, Edge } from 'vis';
|
|
8
|
+
import type { Node, Edge } from 'vis';
|
|
9
9
|
|
|
10
10
|
// Color list to denote which steps have more direct dependencies.
|
|
11
11
|
// Starting from cooler colors to warmer colors.
|