@x12i/static-memorix 2.0.0
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/LICENSE +21 -0
- package/README.md +431 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.js +278 -0
- package/dist/config.d.ts +39 -0
- package/dist/config.js +109 -0
- package/dist/engine/aliases.d.ts +32 -0
- package/dist/engine/aliases.js +74 -0
- package/dist/engine/associations.d.ts +26 -0
- package/dist/engine/associations.js +60 -0
- package/dist/engine/identity.d.ts +22 -0
- package/dist/engine/identity.js +50 -0
- package/dist/engine/inventory.d.ts +29 -0
- package/dist/engine/inventory.js +133 -0
- package/dist/engine/lists.d.ts +18 -0
- package/dist/engine/lists.js +62 -0
- package/dist/engine/narratives.d.ts +16 -0
- package/dist/engine/narratives.js +67 -0
- package/dist/engine/objectTypes.d.ts +11 -0
- package/dist/engine/objectTypes.js +71 -0
- package/dist/engine/query.d.ts +38 -0
- package/dist/engine/query.js +191 -0
- package/dist/engine/records.d.ts +23 -0
- package/dist/engine/records.js +152 -0
- package/dist/engine/snapshots.d.ts +17 -0
- package/dist/engine/snapshots.js +110 -0
- package/dist/engine/write.d.ts +30 -0
- package/dist/engine/write.js +163 -0
- package/dist/routes/helpers.d.ts +4 -0
- package/dist/routes/helpers.js +29 -0
- package/dist/routes/index.d.ts +2 -0
- package/dist/routes/index.js +402 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.js +130 -0
- package/dist/storage/InMemoryStore.d.ts +31 -0
- package/dist/storage/InMemoryStore.js +242 -0
- package/dist/storage/fs.d.ts +6 -0
- package/dist/storage/fs.js +54 -0
- package/dist/types.d.ts +88 -0
- package/dist/types.js +37 -0
- package/guides/demo-app.md +527 -0
- package/guides/managing-json-files.md +384 -0
- package/guides/running-the-service.md +269 -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 +67 -0
|
@@ -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
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@x12i/static-memorix",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Static mock server providing full API parity for the Memorix Explorer API.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/server.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/server.d.ts",
|
|
10
|
+
"import": "./dist/server.js"
|
|
11
|
+
},
|
|
12
|
+
"./config": {
|
|
13
|
+
"types": "./dist/config.d.ts",
|
|
14
|
+
"import": "./dist/config.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"bin": {
|
|
18
|
+
"static-memorix": "dist/cli.js",
|
|
19
|
+
"memorix-explorer": "dist/cli.js"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc -p tsconfig.json",
|
|
23
|
+
"start": "node dist/cli.js",
|
|
24
|
+
"dev": "node --experimental-strip-types cli.ts",
|
|
25
|
+
"test": "npm run build && node --test tests/*.test.mjs",
|
|
26
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
27
|
+
"prepack": "npm run build",
|
|
28
|
+
"postpack": "true"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"mocks",
|
|
33
|
+
"guides",
|
|
34
|
+
"LICENSE",
|
|
35
|
+
"README.md"
|
|
36
|
+
],
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"fastify": "^5.10.0",
|
|
39
|
+
"mingo": "^6.4.12"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^20.14.0",
|
|
43
|
+
"typescript": "^5.5.0"
|
|
44
|
+
},
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/x12i/static-memorix.git"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://github.com/x12i/static-memorix#readme",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/x12i/static-memorix/issues"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"mock",
|
|
56
|
+
"api",
|
|
57
|
+
"memorix",
|
|
58
|
+
"explorer",
|
|
59
|
+
"fastify",
|
|
60
|
+
"test-server",
|
|
61
|
+
"development-tools",
|
|
62
|
+
"static"
|
|
63
|
+
],
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=20.0.0"
|
|
66
|
+
}
|
|
67
|
+
}
|