@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.
Files changed (49) hide show
  1. package/README.md +150 -16
  2. package/dist/config.js +1 -1
  3. package/dist/engine/identity.js +11 -9
  4. package/dist/engine/write.js +48 -4
  5. package/dist/routes/index.js +57 -7
  6. package/dist/server.js +42 -20
  7. package/guides/demo-app.md +524 -0
  8. package/guides/managing-json-files.md +310 -0
  9. package/guides/running-the-service.md +171 -0
  10. package/guides/using-the-api.md +265 -0
  11. package/mocks/data/admin/snapshots.json +52 -0
  12. package/mocks/data/assets/analysis.json +14 -0
  13. package/mocks/data/assets/decisions.json +14 -0
  14. package/mocks/data/assets/events.json +4 -0
  15. package/mocks/data/assets/snapshots.json +49 -0
  16. package/mocks/data/findings/analysis.json +4 -0
  17. package/mocks/data/findings/decisions.json +4 -0
  18. package/mocks/data/findings/events.json +3 -0
  19. package/mocks/data/findings/snapshots.json +21 -0
  20. package/mocks/data/marketing/snapshots.json +75 -0
  21. package/mocks/data/memory/memory.json +31 -0
  22. package/mocks/data/product/snapshots.json +84 -0
  23. package/mocks/data/system/inventory.json +8 -0
  24. package/mocks/data/users/snapshots.json +5 -0
  25. package/mocks/demo.html +828 -0
  26. package/mocks/metadata/agents.json +7 -0
  27. package/mocks/metadata/lists/assets-default.json +22 -0
  28. package/mocks/metadata/lists/backlog.json +10 -0
  29. package/mocks/metadata/lists/findings-default.json +9 -0
  30. package/mocks/metadata/lists/my-plate.json +10 -0
  31. package/mocks/metadata/lists/this-week.json +10 -0
  32. package/mocks/metadata/narratives/admin.json +7 -0
  33. package/mocks/metadata/narratives/assets.json +17 -0
  34. package/mocks/metadata/narratives/findings.json +7 -0
  35. package/mocks/metadata/narratives/marketing.json +17 -0
  36. package/mocks/metadata/narratives/product.json +12 -0
  37. package/mocks/metadata/object-types/admin.json +6 -0
  38. package/mocks/metadata/object-types/assets.json +9 -0
  39. package/mocks/metadata/object-types/findings.json +8 -0
  40. package/mocks/metadata/object-types/marketing.json +6 -0
  41. package/mocks/metadata/object-types/memory.json +6 -0
  42. package/mocks/metadata/object-types/product.json +6 -0
  43. package/mocks/metadata/object-types/users.json +13 -0
  44. package/mocks/metadata/write-descriptors/admin-task-write.json +20 -0
  45. package/mocks/metadata/write-descriptors/assets-analysis-write.json +14 -0
  46. package/mocks/metadata/write-descriptors/marketing-task-write.json +20 -0
  47. package/mocks/metadata/write-descriptors/memory-write.json +14 -0
  48. package/mocks/metadata/write-descriptors/product-task-write.json +20 -0
  49. package/package.json +5 -2
@@ -0,0 +1,7 @@
1
+ {
2
+ "agents": [
3
+ { "id": "agent-1", "name": "Discovery Agent", "role": "ingestion" },
4
+ { "id": "agent-2", "name": "Analysis Agent", "role": "enrichment" },
5
+ { "id": "agent-3", "name": "Decision Agent", "role": "remediation" }
6
+ ]
7
+ }
@@ -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,10 @@
1
+ {
2
+ "id": "backlog",
3
+ "entity": "product",
4
+ "entityName": "product",
5
+ "baseContentType": "snapshots",
6
+ "fields": ["recordId", "title", "status", "priority", "owner", "dueDate"],
7
+ "sort": {},
8
+ "query": {},
9
+ "listId": "backlog"
10
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "id": "findings-default",
3
+ "entity": "findings",
4
+ "entityName": "findings",
5
+ "baseContentType": "snapshots",
6
+ "fields": ["recordId", "entityId", "severity", "status"],
7
+ "sort": { "severity": -1 },
8
+ "query": {}
9
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "my-plate",
3
+ "entity": "product",
4
+ "entityName": "product",
5
+ "baseContentType": "snapshots",
6
+ "fields": ["recordId", "title", "status", "priority", "owner", "dueDate"],
7
+ "sort": { "priority": -1 },
8
+ "query": {},
9
+ "listId": "my-plate"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "this-week",
3
+ "entity": "product",
4
+ "entityName": "product",
5
+ "baseContentType": "snapshots",
6
+ "fields": ["recordId", "title", "status", "priority", "owner", "dueDate"],
7
+ "sort": { "dueDate": 1 },
8
+ "query": {},
9
+ "listId": "this-week"
10
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "q1-review": {
3
+ "key": "q1-review",
4
+ "label": "Q1 Review",
5
+ "description": "Reconciling first quarter expenses and contracts."
6
+ }
7
+ }
@@ -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,7 @@
1
+ {
2
+ "high-severity": {
3
+ "key": "high-severity",
4
+ "label": "High Severity",
5
+ "description": "Finding scored at high severity."
6
+ }
7
+ }
@@ -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,6 @@
1
+ {
2
+ "name": "admin",
3
+ "summary": "Keeping the lights on.",
4
+ "catalogRelations": [],
5
+ "rootPropertyCatalog": []
6
+ }
@@ -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,6 @@
1
+ {
2
+ "name": "marketing",
3
+ "summary": "Getting people to see the thing.",
4
+ "catalogRelations": [],
5
+ "rootPropertyCatalog": []
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "memory",
3
+ "summary": "The fourth tier of data alongside entities, events, and knowledge. Memory collections are keyed by memoryId.",
4
+ "catalogRelations": [],
5
+ "rootPropertyCatalog": []
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "product",
3
+ "summary": "Building the thing.",
4
+ "catalogRelations": [],
5
+ "rootPropertyCatalog": []
6
+ }
@@ -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.0.0",
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": "^4.28.1",
35
+ "fastify": "^5.10.0",
33
36
  "mingo": "^6.4.12"
34
37
  },
35
38
  "devDependencies": {