@jupiterone/integration-sdk-runtime 8.1.0 → 8.1.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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Entity, Relationship, GraphObjectIteratee } from '@jupiterone/integration-sdk-core';
|
|
2
2
|
import { WalkDirectoryIterateeInput } from '../../fileSystem';
|
|
3
|
-
interface
|
|
3
|
+
interface BaseIterateCollectionIndexParams<GraphObject> {
|
|
4
4
|
type: string;
|
|
5
5
|
iteratee: GraphObjectIteratee<GraphObject>;
|
|
6
6
|
}
|
|
7
|
-
export declare function iterateEntityTypeIndex<T extends Entity = Entity>({ type, iteratee, }:
|
|
8
|
-
export declare function iterateRelationshipTypeIndex<T extends Relationship = Relationship>({ type, iteratee }:
|
|
7
|
+
export declare function iterateEntityTypeIndex<T extends Entity = Entity>({ type, iteratee, }: BaseIterateCollectionIndexParams<T>): Promise<void>;
|
|
8
|
+
export declare function iterateRelationshipTypeIndex<T extends Relationship = Relationship>({ type, iteratee }: BaseIterateCollectionIndexParams<T>): Promise<void>;
|
|
9
9
|
export declare function readGraphObjectFile<T>({ filePath, }: WalkDirectoryIterateeInput): Promise<T>;
|
|
10
10
|
export {};
|
|
@@ -4,39 +4,31 @@ exports.readGraphObjectFile = exports.iterateRelationshipTypeIndex = exports.ite
|
|
|
4
4
|
const integration_sdk_core_1 = require("@jupiterone/integration-sdk-core");
|
|
5
5
|
const fileSystem_1 = require("../../fileSystem");
|
|
6
6
|
const path_1 = require("./path");
|
|
7
|
-
|
|
7
|
+
const __1 = require("../..");
|
|
8
|
+
async function iterateCollectionTypeIndex({ type, collectionType, iteratee, }) {
|
|
8
9
|
const path = path_1.buildIndexDirectoryPath({
|
|
9
|
-
collectionType
|
|
10
|
+
collectionType,
|
|
10
11
|
type,
|
|
11
12
|
});
|
|
12
|
-
await
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
await __1.iterateParsedGraphFiles(async (data) => {
|
|
14
|
+
for (const graphObj of data[collectionType] || []) {
|
|
15
|
+
await iteratee(graphObj);
|
|
16
|
+
}
|
|
17
|
+
}, path);
|
|
18
|
+
}
|
|
19
|
+
async function iterateEntityTypeIndex({ type, iteratee, }) {
|
|
20
|
+
await iterateCollectionTypeIndex({
|
|
21
|
+
type,
|
|
22
|
+
iteratee,
|
|
23
|
+
collectionType: 'entities',
|
|
22
24
|
});
|
|
23
25
|
}
|
|
24
26
|
exports.iterateEntityTypeIndex = iterateEntityTypeIndex;
|
|
25
27
|
async function iterateRelationshipTypeIndex({ type, iteratee }) {
|
|
26
|
-
|
|
27
|
-
collectionType: 'relationships',
|
|
28
|
+
await iterateCollectionTypeIndex({
|
|
28
29
|
type,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
path,
|
|
32
|
-
iteratee: async (input) => {
|
|
33
|
-
const object = await readGraphObjectFile(input);
|
|
34
|
-
if (isObjectFlushedRelationshipData(object)) {
|
|
35
|
-
for (const relationship of object.relationships) {
|
|
36
|
-
await iteratee(relationship);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
30
|
+
iteratee,
|
|
31
|
+
collectionType: 'relationships',
|
|
40
32
|
});
|
|
41
33
|
}
|
|
42
34
|
exports.iterateRelationshipTypeIndex = iterateRelationshipTypeIndex;
|
|
@@ -54,10 +46,4 @@ async function readGraphObjectFile({ filePath, }) {
|
|
|
54
46
|
}
|
|
55
47
|
}
|
|
56
48
|
exports.readGraphObjectFile = readGraphObjectFile;
|
|
57
|
-
function isObjectFlushedEntityData(object) {
|
|
58
|
-
return Array.isArray(object === null || object === void 0 ? void 0 : object.entities);
|
|
59
|
-
}
|
|
60
|
-
function isObjectFlushedRelationshipData(object) {
|
|
61
|
-
return Array.isArray(object === null || object === void 0 ? void 0 : object.relationships);
|
|
62
|
-
}
|
|
63
49
|
//# sourceMappingURL=indices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indices.js","sourceRoot":"","sources":["../../../../src/storage/FileSystemGraphObjectStore/indices.ts"],"names":[],"mappings":";;;AAAA,2EAK0C;
|
|
1
|
+
{"version":3,"file":"indices.js","sourceRoot":"","sources":["../../../../src/storage/FileSystemGraphObjectStore/indices.ts"],"names":[],"mappings":";;;AAAA,2EAK0C;AAC1C,iDAAgF;AAEhF,iCAAiD;AACjD,6BAAgD;AAYhD,KAAK,UAAU,0BAA0B,CAAkC,EACzE,IAAI,EACJ,cAAc,EACd,QAAQ,GACwB;IAChC,MAAM,IAAI,GAAG,8BAAuB,CAAC;QACnC,cAAc;QACd,IAAI;KACL,CAAC,CAAC;IAEH,MAAM,2BAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAC3C,KAAK,MAAM,QAAQ,IAAK,IAAI,CAAC,cAAc,CAAS,IAAI,EAAE,EAAE;YAC1D,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;SAC1B;IACH,CAAC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC;AAEM,KAAK,UAAU,sBAAsB,CAA4B,EACtE,IAAI,EACJ,QAAQ,GAC4B;IACpC,MAAM,0BAA0B,CAAC;QAC/B,IAAI;QACJ,QAAQ;QACR,cAAc,EAAE,UAAU;KAC3B,CAAC,CAAC;AACL,CAAC;AATD,wDASC;AAEM,KAAK,UAAU,4BAA4B,CAEhD,EAAE,IAAI,EAAE,QAAQ,EAAuC;IACvD,MAAM,0BAA0B,CAAC;QAC/B,IAAI;QACJ,QAAQ;QACR,cAAc,EAAE,eAAe;KAChC,CAAC,CAAC;AACL,CAAC;AARD,oEAQC;AAEM,KAAK,UAAU,mBAAmB,CAAI,EAC3C,QAAQ,GACmB;IAC3B,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,6BAAgB,CAAI,QAAQ,CAAC,CAAC;QACrD,OAAO,QAAQ,CAAC;KACjB;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,IAAI,uCAAgB,CAAC;YACzB,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,uCAAuC,QAAQ,GAAG;YAC3D,KAAK,EAAE,GAAG;SACX,CAAC,CAAC;KACJ;AACH,CAAC;AAbD,kDAaC"}
|
|
@@ -536,16 +536,6 @@
|
|
|
536
536
|
"signature": "8b8a5205fd70247ed6dd3c4047e4ac7a0b17a54e4476d640a52d0b7bf143dd8b",
|
|
537
537
|
"affectsGlobalScope": false
|
|
538
538
|
},
|
|
539
|
-
"../src/storage/FileSystemGraphObjectStore/indices.ts": {
|
|
540
|
-
"version": "af14c5ece808923cfce9ddddae4ad6ef21880dff14bfc89c55a32441b68b6f48",
|
|
541
|
-
"signature": "eb465aa8cdaaa81e04d72b4115264f859f17b3101cbc299cac9c0515ae2d9e14",
|
|
542
|
-
"affectsGlobalScope": false
|
|
543
|
-
},
|
|
544
|
-
"../src/fileSystem.ts": {
|
|
545
|
-
"version": "4df970c15cc984d04fd609a3a28c23803c1da06027384a07951b8feabbf87c47",
|
|
546
|
-
"signature": "e14e5f96610764820fc3cc80d76549dac5802e38a3dd56b49b092c934948626f",
|
|
547
|
-
"affectsGlobalScope": false
|
|
548
|
-
},
|
|
549
539
|
"../../../node_modules/axios/index.d.ts": {
|
|
550
540
|
"version": "3154a026075044aa102298fe9e6a7a14aaa26a06270680c7478a1765af8ffb09",
|
|
551
541
|
"signature": "3154a026075044aa102298fe9e6a7a14aaa26a06270680c7478a1765af8ffb09",
|
|
@@ -1106,6 +1096,16 @@
|
|
|
1106
1096
|
"signature": "72e05c0e4a793c75030c6de014d00bf479269f32f5e894d32cfb145a6c10ff9a",
|
|
1107
1097
|
"affectsGlobalScope": false
|
|
1108
1098
|
},
|
|
1099
|
+
"../src/storage/FileSystemGraphObjectStore/indices.ts": {
|
|
1100
|
+
"version": "e07c5222f01b93e9db2ad0eccbbfa0e6a1950f2042a6a317401e33e29c89c93b",
|
|
1101
|
+
"signature": "f543da357c92860b4b0cd486adb9785c3f2a1d9b7fb2dd9ad10ca2301925a235",
|
|
1102
|
+
"affectsGlobalScope": false
|
|
1103
|
+
},
|
|
1104
|
+
"../src/fileSystem.ts": {
|
|
1105
|
+
"version": "4df970c15cc984d04fd609a3a28c23803c1da06027384a07951b8feabbf87c47",
|
|
1106
|
+
"signature": "e14e5f96610764820fc3cc80d76549dac5802e38a3dd56b49b092c934948626f",
|
|
1107
|
+
"affectsGlobalScope": false
|
|
1108
|
+
},
|
|
1109
1109
|
"../src/execution/collection.ts": {
|
|
1110
1110
|
"version": "30b2f66d651ab1b8cae077091c7850b31a3b0cac56da7758cc9ae560f4e085b6",
|
|
1111
1111
|
"signature": "37adbeb2cfd6bac7927011a44b0e152137c37cd9250a8ee92d14ccdb8fab4c77",
|
|
@@ -3830,8 +3830,8 @@
|
|
|
3830
3830
|
"../../../node_modules/@types/node/util.d.ts",
|
|
3831
3831
|
"../../integration-sdk-core/dist/src/index.d.ts",
|
|
3832
3832
|
"../src/fileSystem.ts",
|
|
3833
|
-
"../src/
|
|
3834
|
-
"../src/storage/
|
|
3833
|
+
"../src/index.ts",
|
|
3834
|
+
"../src/storage/FileSystemGraphObjectStore/path.ts"
|
|
3835
3835
|
],
|
|
3836
3836
|
"../src/storage/FileSystemGraphObjectStore/path.ts": [
|
|
3837
3837
|
"../../../node_modules/@types/graceful-fs/index.d.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupiterone/integration-sdk-runtime",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.1",
|
|
4
4
|
"description": "The SDK for developing JupiterOne integrations",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"prepack": "yarn build:dist"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@jupiterone/integration-sdk-core": "^8.1.
|
|
27
|
+
"@jupiterone/integration-sdk-core": "^8.1.1",
|
|
28
28
|
"@lifeomic/alpha": "^1.4.0",
|
|
29
29
|
"@lifeomic/attempt": "^3.0.0",
|
|
30
30
|
"async-sema": "^3.1.0",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"uuid": "^7.0.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@jupiterone/integration-sdk-private-test-utils": "^8.1.
|
|
46
|
+
"@jupiterone/integration-sdk-private-test-utils": "^8.1.1",
|
|
47
47
|
"@types/uuid": "^7.0.2",
|
|
48
48
|
"get-port": "^5.1.1",
|
|
49
49
|
"memfs": "^3.2.0",
|
|
50
50
|
"ts-node": "^9.1.0",
|
|
51
51
|
"wait-for-expect": "^3.0.2"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "a0b05062979e1d7bd6318cebe34332be376c0b85"
|
|
54
54
|
}
|