Skip to content

Commit 652b319

Browse files
authored
Fixes private definitions (#216)
1 parent 6d92288 commit 652b319

9 files changed

+19
-104
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"scripts": {
66
"dev": "vite --host",
7+
"prebuild": "./prebuild_script.sh",
78
"build": "vite build",
89
"build-check": "vue-tsc --noEmit && vite build",
910
"preview": "vite preview",

prebuild_script.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
for definition in "Entity" "Observable" "Indicator"; do
2+
filename="src/definitions/private/private"$definition"Definitions.js"
3+
if [ ! -f $filename ];
4+
then
5+
upper_definition=$(echo $definition | tr '[:lower:]' '[:upper:]')
6+
echo "export const "PRIVATE_$upper_definition"_TYPES = []" >> $filename
7+
fi
8+
done

src/definitions/entityDefinitions.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { PRIVATE_ENTITY_TYPES } from "@/definitions/private/privateEntityDefinitions.js";
2+
13
export const ENTITY_TYPES = [
24
{
35
name: "Investigation",
@@ -430,4 +432,4 @@ export const ENTITY_TYPES = [
430432
}
431433
];
432434

433-
import("@/definitions/private/privateEntityDefinitions.js").catch(e => Promise.reject("Module " + modulePath + " not found.")).then(module => { ENTITY_TYPES.push(...module.ENTITY_TYPES); })
435+
ENTITY_TYPES.push(...PRIVATE_ENTITY_TYPES);

src/definitions/indicatorDefinitions.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { PRIVATE_INDICATOR_TYPES } from "@/definitions/private/privateIndicatorDefinitions.js";
2+
13
export const DIAMOND_MODEL = ["adversary", "capability", "infrastructure", "victim"];
24
export const QUERY_TYPES = ["opensearch", "osquery", "sql", "splunk", "censys", "shodan"];
35

@@ -251,4 +253,4 @@ export const INDICATOR_TYPES = [
251253
}
252254
];
253255

254-
import("@/definitions/private/privateIndicatorDefinitions.js").catch(e => Promise.reject("Module " + modulePath + " not found.")).then(module => { INDICATOR_TYPES.push(...module.INDICATOR_TYPES); })
256+
INDICATOR_TYPES.push(...PRIVATE_INDICATOR_TYPES);

src/definitions/observableDefinitions.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { PRIVATE_OBSERVABLE_TYPES } from "@/definitions/private/privateObservableDefinitions.js";
2+
13
export const OBSERVABLE_TYPES = [
24
{
35
name: "Generic observable",
@@ -288,4 +290,5 @@ export const OBSERVABLE_TYPES = [
288290
icon: "mdi-bank"
289291
}
290292
];
291-
import("@/definitions/private/privateObservableDefinitions.js").catch(e => Promise.reject("Module " + modulePath + " not found.")).then(module => { OBSERVABLE_TYPES.push(...module.OBSERVABLE_TYPES); })
293+
294+
OBSERVABLE_TYPES.push(...PRIVATE_OBSERVABLE_TYPES);

src/definitions/private/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
*
22
!.gitignore
33
!README.md
4-
!*.sample

src/definitions/private/privateEntityDefinitions.js.sample

-34
This file was deleted.

src/definitions/private/privateIndicatorDefinitions.js.sample

-34
This file was deleted.

src/definitions/private/privateObservableDefinitions.js.sample

-32
This file was deleted.

0 commit comments

Comments
 (0)