@x12i/memorix-service 3.0.1 → 3.0.3
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 +6 -2
- package/dist/app.d.ts +1 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +10 -24
- package/dist/app.js.map +1 -1
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Remote apps should **call** this service over HTTP — not reinvent wiring by in
|
|
|
7
7
|
## Install / run
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install @x12i/memorix-service@3.0.
|
|
10
|
+
npm install @x12i/memorix-service@3.0.3 # composition library / CLI
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Prefer the monorepo stack (service + Studio + ops-source):
|
|
@@ -26,8 +26,12 @@ MEMORIX_SERVICE_MODE=dev npm run dev # metadata in-memory; durable routes 503
|
|
|
26
26
|
|
|
27
27
|
| | |
|
|
28
28
|
|--|--|
|
|
29
|
-
| Default port | **5100** (`MEMORIX_SERVICE_PORT`) |
|
|
29
|
+
| Default port | **5100** (`MEMORIX_SERVICE_PORT`, zone `memorix`) |
|
|
30
30
|
| OpenAPI | `GET /api/openapi.json` |
|
|
31
|
+
| Live view | `GET /_live` (`@x12i/core-service` → `@x12i/api-live-view`) |
|
|
32
|
+
| Health | `GET /health` |
|
|
33
|
+
|
|
34
|
+
Compliance: this process uses **`@x12i/core-service`** (zone port, health, live view, correlation-id).
|
|
31
35
|
|
|
32
36
|
## Library exports
|
|
33
37
|
|
package/dist/app.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type CreateMemorixServiceAppOptions = PlatformDeps & {
|
|
|
7
7
|
export declare function createMemorixServiceApp(opts: CreateMemorixServiceAppOptions): Promise<{
|
|
8
8
|
app: FastifyInstance;
|
|
9
9
|
platform: MemorixPlatform;
|
|
10
|
+
port: number;
|
|
10
11
|
}>;
|
|
11
12
|
export type StartMemorixServiceOptions = CreateMemorixServiceAppOptions & {
|
|
12
13
|
port?: number;
|
package/dist/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAIA,OAAO,OAAO,EAAE,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAIxD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAevB,MAAM,MAAM,8BAA8B,GAAG,YAAY,GAAG;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,8BAA8B,GACnC,OAAO,CAAC;IAAE,GAAG,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,eAAe,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAIA,OAAO,OAAO,EAAE,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAIxD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAevB,MAAM,MAAM,8BAA8B,GAAG,YAAY,GAAG;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,8BAA8B,GACnC,OAAO,CAAC;IAAE,GAAG,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAsD5E;AAED,MAAM,MAAM,0BAA0B,GAAG,8BAA8B,GAAG;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,0BAA0B;;;;;GAM7E"}
|
package/dist/app.js
CHANGED
|
@@ -4,7 +4,7 @@ import { dirname, resolve } from "node:path";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import Fastify from "fastify";
|
|
6
6
|
import cors from "@fastify/cors";
|
|
7
|
-
import {
|
|
7
|
+
import { attachCoreFastify } from "@x12i/core-service/fastify";
|
|
8
8
|
import { mapErrorToHttp, redactSecrets } from "./errors.js";
|
|
9
9
|
import { createMemorixPlatform, } from "./platform.js";
|
|
10
10
|
import { resolveScope } from "./request-scope.js";
|
|
@@ -23,25 +23,16 @@ export async function createMemorixServiceApp(opts) {
|
|
|
23
23
|
const platform = opts.platform ?? (await createMemorixPlatform(opts));
|
|
24
24
|
const app = Fastify({ logger: opts.logger ?? false });
|
|
25
25
|
await app.register(cors, { origin: true });
|
|
26
|
-
|
|
27
|
-
const correlationId = (typeof req.headers["x-correlation-id"] === "string" &&
|
|
28
|
-
req.headers["x-correlation-id"]) ||
|
|
29
|
-
randomUUID();
|
|
30
|
-
req.correlationId = correlationId;
|
|
31
|
-
reply.header("x-correlation-id", correlationId);
|
|
32
|
-
});
|
|
33
|
-
const port = Number(process.env.MEMORIX_SERVICE_PORT ?? 5100);
|
|
34
|
-
await attachFastifyLiveView(app, {
|
|
26
|
+
const core = await attachCoreFastify(app, {
|
|
35
27
|
ring: memorixLiveRing,
|
|
36
|
-
|
|
28
|
+
identity: {
|
|
37
29
|
id: "@x12i/memorix-service",
|
|
38
30
|
title: "Memorix Service",
|
|
39
31
|
kind: "api",
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
docsUrl: `http://127.0.0.1:${port}/api/openapi.json`,
|
|
32
|
+
zoneId: "memorix",
|
|
33
|
+
portKey: "service",
|
|
34
|
+
portEnv: "MEMORIX_SERVICE_PORT",
|
|
35
|
+
docsPath: "/api/openapi.json",
|
|
45
36
|
description: "Sole HTTP composition root",
|
|
46
37
|
},
|
|
47
38
|
getHealth: async () => ({
|
|
@@ -56,11 +47,6 @@ export async function createMemorixServiceApp(opts) {
|
|
|
56
47
|
mapped.body.error = redactSecrets(mapped.body.error);
|
|
57
48
|
return reply.code(mapped.status).send(mapped.body);
|
|
58
49
|
});
|
|
59
|
-
app.get("/health", async () => ({
|
|
60
|
-
ok: true,
|
|
61
|
-
service: "@x12i/memorix-service",
|
|
62
|
-
mode: platform.mode,
|
|
63
|
-
}));
|
|
64
50
|
app.get("/api/openapi.json", async (_req, reply) => {
|
|
65
51
|
const path = resolve(__dirname, "../openapi/openapi.json");
|
|
66
52
|
const body = readFileSync(path, "utf8");
|
|
@@ -79,11 +65,11 @@ export async function createMemorixServiceApp(opts) {
|
|
|
79
65
|
await registerWorkflowRoutes(app, platform);
|
|
80
66
|
await registerIntelligenceRoutes(app, platform);
|
|
81
67
|
await registerDataJourneyRoutes(app, platform);
|
|
82
|
-
return { app, platform };
|
|
68
|
+
return { app, platform, port: core.port };
|
|
83
69
|
}
|
|
84
70
|
export async function startMemorixServiceHttp(opts) {
|
|
85
|
-
const { app, platform } = await createMemorixServiceApp(opts);
|
|
86
|
-
const port = opts.port ??
|
|
71
|
+
const { app, platform, port: corePort } = await createMemorixServiceApp(opts);
|
|
72
|
+
const port = opts.port ?? corePort;
|
|
87
73
|
const host = opts.host ?? "127.0.0.1";
|
|
88
74
|
await app.listen({ port, host });
|
|
89
75
|
return { app, platform, port, host };
|
package/dist/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OA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EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;AAC5C,CAAC;AAOD,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,IAAgC;IAC5E,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAC9E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,WAAW,CAAC;IACtC,MAAM,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACjC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACvC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x12i/memorix-service",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Memorix production service composition root — one versioned API over accepted packages (Phase 10 / G10).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,18 +32,19 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@fastify/cors": "^10.0.1",
|
|
35
|
-
"@x12i/
|
|
35
|
+
"@x12i/core-service": "^1.0.0",
|
|
36
|
+
"@x12i/memorix-data": "^3.0.2",
|
|
36
37
|
"@x12i/api-live-view": "^1.0.2",
|
|
37
|
-
"@x12i/memorix-data-journey": "^3.0.
|
|
38
|
-
"@x12i/memorix-format": "^3.0.
|
|
39
|
-
"@x12i/memorix-intelligence": "^3.0.
|
|
40
|
-
"@x12i/memorix-mapping": "^3.0.
|
|
41
|
-
"@x12i/memorix-memory": "^3.0.
|
|
42
|
-
"@x12i/memorix-metadata": "^3.0.
|
|
43
|
-
"@x12i/memorix-metadata-runtime": "^3.0.
|
|
44
|
-
"@x12i/memorix-pipeline": "^3.0.
|
|
45
|
-
"@x12i/memorix-relationship-store": "^3.0.
|
|
46
|
-
"@x12i/memorix-relationships": "^3.0.
|
|
38
|
+
"@x12i/memorix-data-journey": "^3.0.2",
|
|
39
|
+
"@x12i/memorix-format": "^3.0.2",
|
|
40
|
+
"@x12i/memorix-intelligence": "^3.0.2",
|
|
41
|
+
"@x12i/memorix-mapping": "^3.0.2",
|
|
42
|
+
"@x12i/memorix-memory": "^3.0.2",
|
|
43
|
+
"@x12i/memorix-metadata": "^3.0.2",
|
|
44
|
+
"@x12i/memorix-metadata-runtime": "^3.0.2",
|
|
45
|
+
"@x12i/memorix-pipeline": "^3.0.2",
|
|
46
|
+
"@x12i/memorix-relationship-store": "^3.0.2",
|
|
47
|
+
"@x12i/memorix-relationships": "^3.0.2",
|
|
47
48
|
"fastify": "^5.1.0",
|
|
48
49
|
"mongodb": "^6.21.0"
|
|
49
50
|
},
|