@x12i/static-memorix-explorer-api 1.0.0 → 1.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.
- package/README.md +150 -16
- package/dist/config.js +1 -1
- package/dist/engine/identity.js +11 -9
- package/dist/engine/write.js +48 -4
- package/dist/routes/index.js +57 -7
- package/dist/server.js +42 -20
- package/guides/demo-app.md +524 -0
- package/guides/managing-json-files.md +310 -0
- package/guides/running-the-service.md +171 -0
- package/guides/using-the-api.md +265 -0
- package/mocks/data/admin/snapshots.json +52 -0
- package/mocks/data/assets/analysis.json +14 -0
- package/mocks/data/assets/decisions.json +14 -0
- package/mocks/data/assets/events.json +4 -0
- package/mocks/data/assets/snapshots.json +49 -0
- package/mocks/data/findings/analysis.json +4 -0
- package/mocks/data/findings/decisions.json +4 -0
- package/mocks/data/findings/events.json +3 -0
- package/mocks/data/findings/snapshots.json +21 -0
- package/mocks/data/marketing/snapshots.json +75 -0
- package/mocks/data/memory/memory.json +31 -0
- package/mocks/data/product/snapshots.json +84 -0
- package/mocks/data/system/inventory.json +8 -0
- package/mocks/data/users/snapshots.json +5 -0
- package/mocks/demo.html +828 -0
- package/mocks/metadata/agents.json +7 -0
- package/mocks/metadata/lists/assets-default.json +22 -0
- package/mocks/metadata/lists/backlog.json +10 -0
- package/mocks/metadata/lists/findings-default.json +9 -0
- package/mocks/metadata/lists/my-plate.json +10 -0
- package/mocks/metadata/lists/this-week.json +10 -0
- package/mocks/metadata/narratives/admin.json +7 -0
- package/mocks/metadata/narratives/assets.json +17 -0
- package/mocks/metadata/narratives/findings.json +7 -0
- package/mocks/metadata/narratives/marketing.json +17 -0
- package/mocks/metadata/narratives/product.json +12 -0
- package/mocks/metadata/object-types/admin.json +6 -0
- package/mocks/metadata/object-types/assets.json +9 -0
- package/mocks/metadata/object-types/findings.json +8 -0
- package/mocks/metadata/object-types/marketing.json +6 -0
- package/mocks/metadata/object-types/memory.json +6 -0
- package/mocks/metadata/object-types/product.json +6 -0
- package/mocks/metadata/object-types/users.json +13 -0
- package/mocks/metadata/write-descriptors/admin-task-write.json +20 -0
- package/mocks/metadata/write-descriptors/assets-analysis-write.json +14 -0
- package/mocks/metadata/write-descriptors/marketing-task-write.json +20 -0
- package/mocks/metadata/write-descriptors/memory-write.json +14 -0
- package/mocks/metadata/write-descriptors/product-task-write.json +20 -0
- package/package.json +5 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "assets-default",
|
|
3
|
+
"entity": "assets",
|
|
4
|
+
"entityName": "assets",
|
|
5
|
+
"baseContentType": "snapshots",
|
|
6
|
+
"fields": [
|
|
7
|
+
"recordId",
|
|
8
|
+
"entityId",
|
|
9
|
+
"severity",
|
|
10
|
+
"status"
|
|
11
|
+
],
|
|
12
|
+
"extensions": [
|
|
13
|
+
"analysis",
|
|
14
|
+
"decisions"
|
|
15
|
+
],
|
|
16
|
+
"sort": {
|
|
17
|
+
"severity": -1,
|
|
18
|
+
"entityId": 1
|
|
19
|
+
},
|
|
20
|
+
"query": {},
|
|
21
|
+
"listId": "assets-default"
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"has-vulns": {
|
|
3
|
+
"key": "has-vulns",
|
|
4
|
+
"label": "Has Vulnerabilities",
|
|
5
|
+
"description": "Asset carries at least one known vulnerability."
|
|
6
|
+
},
|
|
7
|
+
"exposed-public": {
|
|
8
|
+
"key": "exposed-public",
|
|
9
|
+
"label": "Exposed Publicly",
|
|
10
|
+
"description": "Asset is reachable from the public internet."
|
|
11
|
+
},
|
|
12
|
+
"critical-owner": {
|
|
13
|
+
"key": "critical-owner",
|
|
14
|
+
"label": "Critical Owner",
|
|
15
|
+
"description": "Owned by a business-critical team."
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"blog-content": {
|
|
3
|
+
"key": "blog-content",
|
|
4
|
+
"label": "Blog Content",
|
|
5
|
+
"description": "Writing and publishing blog posts."
|
|
6
|
+
},
|
|
7
|
+
"website-refresh": {
|
|
8
|
+
"key": "website-refresh",
|
|
9
|
+
"label": "Website Refresh",
|
|
10
|
+
"description": "Content for the redesigned site."
|
|
11
|
+
},
|
|
12
|
+
"launch-prep": {
|
|
13
|
+
"key": "launch-prep",
|
|
14
|
+
"label": "Launch Prep",
|
|
15
|
+
"description": "Launch week content and outreach."
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"website-refresh": {
|
|
3
|
+
"key": "website-refresh",
|
|
4
|
+
"label": "Website Refresh",
|
|
5
|
+
"description": "Redesigning the public-facing site."
|
|
6
|
+
},
|
|
7
|
+
"launch-prep": {
|
|
8
|
+
"key": "launch-prep",
|
|
9
|
+
"label": "Launch Prep",
|
|
10
|
+
"description": "Getting ready for public launch."
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "assets",
|
|
3
|
+
"summary": "Infrastructure assets discovered and analyzed by Memorix.",
|
|
4
|
+
"catalogRelations": [
|
|
5
|
+
{ "sourceProperty": "linkedAssetId", "targetObject": "assets", "targetProperty": "recordId", "relationType": "self-link" },
|
|
6
|
+
{ "sourceProperty": "ownerId", "targetObject": "agents", "targetProperty": "id", "relationType": "ownership" }
|
|
7
|
+
],
|
|
8
|
+
"rootPropertyCatalog": []
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "findings",
|
|
3
|
+
"summary": "Security findings surfaced from analysis pipelines.",
|
|
4
|
+
"catalogRelations": [
|
|
5
|
+
{ "sourceProperty": "assetId", "targetObject": "assets", "targetProperty": "recordId", "relationType": "belongs-to" }
|
|
6
|
+
],
|
|
7
|
+
"rootPropertyCatalog": []
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "users",
|
|
3
|
+
"summary": "People who can be assigned to tasks.",
|
|
4
|
+
"catalogRelations": [
|
|
5
|
+
{
|
|
6
|
+
"sourceProperty": "assigneeId",
|
|
7
|
+
"targetObject": "product",
|
|
8
|
+
"targetProperty": "recordId",
|
|
9
|
+
"relationType": "assigned-to"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"rootPropertyCatalog": []
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"writeDescriptorId": "admin-task-write",
|
|
3
|
+
"targetCollection": "admin/snapshots",
|
|
4
|
+
"schema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["recordId", "title"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"recordId": { "type": "string" },
|
|
9
|
+
"title": { "type": "string" },
|
|
10
|
+
"status": { "type": "string" },
|
|
11
|
+
"priority": { "type": "string" },
|
|
12
|
+
"owner": { "type": "string" },
|
|
13
|
+
"area": { "type": "string" },
|
|
14
|
+
"assigneeId": { "type": "string" },
|
|
15
|
+
"dueDate": { "type": "string" },
|
|
16
|
+
"notes": { "type": "string" },
|
|
17
|
+
"chat": { "type": "array" }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"writeDescriptorId": "assets-analysis-write",
|
|
3
|
+
"targetCollection": "assets/analysis",
|
|
4
|
+
"schema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["recordId"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"recordId": { "type": "string" },
|
|
9
|
+
"analysisType": { "type": "string" },
|
|
10
|
+
"score": { "type": "number" },
|
|
11
|
+
"notes": { "type": "array" }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"writeDescriptorId": "marketing-task-write",
|
|
3
|
+
"targetCollection": "marketing/snapshots",
|
|
4
|
+
"schema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["recordId", "title"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"recordId": { "type": "string" },
|
|
9
|
+
"title": { "type": "string" },
|
|
10
|
+
"status": { "type": "string" },
|
|
11
|
+
"priority": { "type": "string" },
|
|
12
|
+
"owner": { "type": "string" },
|
|
13
|
+
"area": { "type": "string" },
|
|
14
|
+
"assigneeId": { "type": "string" },
|
|
15
|
+
"dueDate": { "type": "string" },
|
|
16
|
+
"notes": { "type": "string" },
|
|
17
|
+
"chat": { "type": "array" }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"writeDescriptorId": "memory-write",
|
|
3
|
+
"targetCollection": "memory/memory",
|
|
4
|
+
"schema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["memoryId"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"memoryId": { "type": "string" },
|
|
9
|
+
"kind": { "type": "string" },
|
|
10
|
+
"summary": { "type": "string" },
|
|
11
|
+
"createdAt": { "type": "string" }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"writeDescriptorId": "product-task-write",
|
|
3
|
+
"targetCollection": "product/snapshots",
|
|
4
|
+
"schema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["recordId", "title"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"recordId": { "type": "string" },
|
|
9
|
+
"title": { "type": "string" },
|
|
10
|
+
"status": { "type": "string" },
|
|
11
|
+
"priority": { "type": "string" },
|
|
12
|
+
"owner": { "type": "string" },
|
|
13
|
+
"area": { "type": "string" },
|
|
14
|
+
"assigneeId": { "type": "string" },
|
|
15
|
+
"dueDate": { "type": "string" },
|
|
16
|
+
"notes": { "type": "string" },
|
|
17
|
+
"chat": { "type": "array" }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x12i/static-memorix-explorer-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Static mock server providing full API parity for the Memorix Explorer API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/server.js",
|
|
@@ -19,17 +19,20 @@
|
|
|
19
19
|
"build": "tsc -p tsconfig.json",
|
|
20
20
|
"start": "node dist/server.js",
|
|
21
21
|
"dev": "node --experimental-strip-types server.ts",
|
|
22
|
+
"test": "npm run build && node --test tests/*.test.mjs",
|
|
22
23
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
23
24
|
"prepack": "npm run build",
|
|
24
25
|
"postpack": "true"
|
|
25
26
|
},
|
|
26
27
|
"files": [
|
|
27
28
|
"dist",
|
|
29
|
+
"mocks",
|
|
30
|
+
"guides",
|
|
28
31
|
"LICENSE",
|
|
29
32
|
"README.md"
|
|
30
33
|
],
|
|
31
34
|
"dependencies": {
|
|
32
|
-
"fastify": "^
|
|
35
|
+
"fastify": "^5.10.0",
|
|
33
36
|
"mingo": "^6.4.12"
|
|
34
37
|
},
|
|
35
38
|
"devDependencies": {
|