@x12i/memorix-client-api 0.0.0-stage → 0.16.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/HANDOVER.md +97 -0
- package/dist/app.d.ts +64 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +412 -0
- package/dist/app.js.map +1 -0
- package/dist/authix.d.ts +9 -0
- package/dist/authix.d.ts.map +1 -0
- package/dist/authix.js +26 -0
- package/dist/authix.js.map +1 -0
- package/dist/catalog.d.ts +160 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +371 -0
- package/dist/catalog.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +102 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +33 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +109 -0
- package/dist/config.js.map +1 -0
- package/dist/derived.d.ts +2 -0
- package/dist/derived.d.ts.map +1 -0
- package/dist/derived.js +35 -0
- package/dist/derived.js.map +1 -0
- package/dist/errors.d.ts +11 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +21 -0
- package/dist/errors.js.map +1 -0
- package/dist/fetch.d.ts +17 -0
- package/dist/fetch.d.ts.map +1 -0
- package/dist/fetch.js +741 -0
- package/dist/fetch.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/live-ops-nav.d.ts +2 -0
- package/dist/live-ops-nav.d.ts.map +1 -0
- package/dist/live-ops-nav.js +42 -0
- package/dist/live-ops-nav.js.map +1 -0
- package/dist/live.d.ts +20 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +8 -0
- package/dist/live.js.map +1 -0
- package/dist/markdown.d.ts +19 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +102 -0
- package/dist/markdown.js.map +1 -0
- package/dist/peers.d.ts +51 -0
- package/dist/peers.d.ts.map +1 -0
- package/dist/peers.js +127 -0
- package/dist/peers.js.map +1 -0
- package/dist/processed.d.ts +22 -0
- package/dist/processed.d.ts.map +1 -0
- package/dist/processed.js +397 -0
- package/dist/processed.js.map +1 -0
- package/dist/project.d.ts +25 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +76 -0
- package/dist/project.js.map +1 -0
- package/dist/reads-live-routes.d.ts +4 -0
- package/dist/reads-live-routes.d.ts.map +1 -0
- package/dist/reads-live-routes.js +56 -0
- package/dist/reads-live-routes.js.map +1 -0
- package/dist/reads-live-ui.d.ts +3 -0
- package/dist/reads-live-ui.d.ts.map +1 -0
- package/dist/reads-live-ui.js +204 -0
- package/dist/reads-live-ui.js.map +1 -0
- package/dist/reads-ring.d.ts +29 -0
- package/dist/reads-ring.d.ts.map +1 -0
- package/dist/reads-ring.js +44 -0
- package/dist/reads-ring.js.map +1 -0
- package/dist/refs.d.ts +24 -0
- package/dist/refs.d.ts.map +1 -0
- package/dist/refs.js +354 -0
- package/dist/refs.js.map +1 -0
- package/dist/request-countex.d.ts +53 -0
- package/dist/request-countex.d.ts.map +1 -0
- package/dist/request-countex.js +171 -0
- package/dist/request-countex.js.map +1 -0
- package/dist/scope.d.ts +13 -0
- package/dist/scope.d.ts.map +1 -0
- package/dist/scope.js +46 -0
- package/dist/scope.js.map +1 -0
- package/dist/scoper.d.ts +75 -0
- package/dist/scoper.d.ts.map +1 -0
- package/dist/scoper.js +475 -0
- package/dist/scoper.js.map +1 -0
- package/dist/shaped-refs.d.ts +23 -0
- package/dist/shaped-refs.d.ts.map +1 -0
- package/dist/shaped-refs.js +395 -0
- package/dist/shaped-refs.js.map +1 -0
- package/dist/skills.d.ts +102 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +609 -0
- package/dist/skills.js.map +1 -0
- package/dist/story.d.ts +43 -0
- package/dist/story.d.ts.map +1 -0
- package/dist/story.js +121 -0
- package/dist/story.js.map +1 -0
- package/dist/upstream.d.ts +13 -0
- package/dist/upstream.d.ts.map +1 -0
- package/dist/upstream.js +58 -0
- package/dist/upstream.js.map +1 -0
- package/openapi/openapi.json +480 -0
- package/package.json +60 -6
- package/README.md +0 -3
package/HANDOVER.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Handover — move `memorix-client-api`
|
|
2
|
+
|
|
3
|
+
Move this whole directory into the new monorepo. Nothing else in the Memorix repo goes with it. The folder has no `file:` dependency and does not import Memorix engines. Subject reads go to Memorix over HTTP through `@x12i/memorix-client`. Function overrides open the assistants database only when `ASSISTANT_MONGO_URI` or `MONGO_URI` is set, and only while functions are hosted here.
|
|
4
|
+
|
|
5
|
+
## What this process is
|
|
6
|
+
|
|
7
|
+
A read API for smart clients (web apps and other product UIs). Every `/api/v1` call sends:
|
|
8
|
+
|
|
9
|
+
| Header | Role |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `x-memorix-org-id` | Data universe. In header mode the caller sends it. In Authix mode it is taken from the token, and this header only chooses among orgs the token already lists. |
|
|
12
|
+
| `x-memorix-agent-ids` | Comma-separated agents from the API call. Descriptors come from their effective metadata. |
|
|
13
|
+
| `Authorization` | Authix bearer token. Required only when `MEMORIX_AUTH=authix`. |
|
|
14
|
+
| `x-memorix-caller` | Calling app id |
|
|
15
|
+
|
|
16
|
+
It forwards the resolved org, the agents, and the caller to Memorix. The browser should call this process, not `memorix-service`.
|
|
17
|
+
|
|
18
|
+
Contract: [`openapi/openapi.json`](openapi/openapi.json).
|
|
19
|
+
|
|
20
|
+
## Run
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install
|
|
24
|
+
npm run dev
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Nothing is required. This process listens on **0.0.0.0:5120** (every network interface) and calls Memorix at **http://127.0.0.1:5100**. Other machines use this host's address, for example `http://10.6.0.16:5120`. Browsers on other origins are allowed.
|
|
28
|
+
|
|
29
|
+
The listen port comes from `attachCoreFastify` (`MEMORIX_CLIENT_API_PORT`, default 5120). Operators on the host use `/_live` (status, docs, counters, traffic) and `/_live/reads` (org and agents). Request logging stays off.
|
|
30
|
+
|
|
31
|
+
| Env | Default | Role |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| `MEMORIX_SERVICE_URL` or `MEMORIX_URL` | `http://127.0.0.1:5100` | Memorix host. When unset, host is `127.0.0.1` and the port is `MEMORIX_SERVICE_PORT`. |
|
|
34
|
+
| `MEMORIX_SERVICE_HOST` | `127.0.0.1` | Used only when the URL is unset. |
|
|
35
|
+
| `MEMORIX_SERVICE_PORT` | `5100` | Memorix port when the URL is unset. |
|
|
36
|
+
| `MEMORIX_CLIENT_API_PORT` | `5120` | Port this process listens on. |
|
|
37
|
+
| `HOST` | `0.0.0.0` | Bind address for this process. |
|
|
38
|
+
| `MEMORIX_AUTH` | `header` | `header` takes the org from `x-memorix-org-id`. `authix` takes it from `Authorization: Bearer` via `@x12i/authix-sdk`. |
|
|
39
|
+
| `MGC_MCP_URL` | | MGC MCP endpoint. Wins over the source service URL. |
|
|
40
|
+
| `MGC_SOURCE_SERVICE_URL` or `MGC_URL` | | MGC source host. This process calls `{url}/mcp` when `MGC_MCP_URL` is unset. When both are unset, it reads `genericConnectors.mcpUrl` from Memorix. |
|
|
41
|
+
| `SCOPER_REASONER` | scripted, or ai-dispatcher when `OPENROUTER_API_KEY` is set | Reasoner for the hosted `@x12i/memorix-scoper@2.3.0`. |
|
|
42
|
+
| `SCOPER_AI_MODEL` | `openai/gpt-6-luna` | Model when the reasoner is `ai-dispatcher`. Peer `@x12i/ai-dispatcher@^2.4.1`. |
|
|
43
|
+
| `SCOPER_FUNCTIONS_DIR` | | Pagx directory of saved query and scope functions, passed to `createScoper({ functions })`. |
|
|
44
|
+
| `SCOPER_FUNCTIONS_PACKAGE` | | Parent package name for that directory. |
|
|
45
|
+
| `SCOPER_FUNCTIONS_LEARN` | off | `true` asks the coder to write a function on a miss. Needs `@x12i/coder-dispatcher`. |
|
|
46
|
+
| `SCOPER_MODE` | `auto` | `auto` hosts Scoper here unless `SCOPER_URL` is healthy and `2.3.x`. `external` requires that peer. `embedded` does not probe. |
|
|
47
|
+
| `SCOPER_URL` | | Base URL of a Scoper peer. Proxied for the process lifetime when selected. |
|
|
48
|
+
| `SKILLS_MODE` | `auto` | `auto` probes skill-api and hosts agent functions here when that probe fails. `external` requires the peer. `embedded` does not probe. |
|
|
49
|
+
| `SKILL_API_URL` | `http://127.0.0.1:7180` in `auto` | Skill-api base. A selected peer answers list, run, save, and delete. |
|
|
50
|
+
| `SKILLS_PACK_DIR` | | Pack directory with `functions/catalog.json` and `functions/run.mjs`. Used when functions are hosted here. |
|
|
51
|
+
| `AGENTS_DIR` | | Agents root. A folder named for the agent, or the first pack with functions, is the catalog. |
|
|
52
|
+
| `MEMORIX_AGENT_IDS` | | Content agents that use the process pack. `PROCESS_AGENT_ID` is the fallback. |
|
|
53
|
+
| `ASSISTANT_MONGO_URI` or `MONGO_URI` | | Assistants database for function overrides. Unset: pack functions run, save returns `503`. Not opened when skill-api is the peer. |
|
|
54
|
+
| `AUTHIX_APP_ID` | | Required with `MEMORIX_AUTH=authix`. |
|
|
55
|
+
| `AUTHIX_APP_SECRET_KEY` | | Required with `MEMORIX_AUTH=authix`. |
|
|
56
|
+
| `AUTHIX_INTROSPECT_URL` | | Optional revocation check, for example `http://127.0.0.1:3100/v1/tokens/introspect`. |
|
|
57
|
+
|
|
58
|
+
The monorepo root `.env` sets `MEMORIX_AUTH=authix` with `AUTHIX_APP_ID` and `AUTHIX_APP_SECRET_KEY`. That file is not committed. Callers then send `Authorization: Bearer <token>` for app `memorix-api`. The org comes from `scope.organizationIds` on the token. See the repo README. `MEMORIX_AUTH=header` needs no Authix process. Agents still come from `x-memorix-agent-ids` on each call. Subject reads do not open a database. They go to the Memorix host over HTTP through `@x12i/memorix-client`. Function overrides open Mongo only when `ASSISTANT_MONGO_URI` or `MONGO_URI` is set.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm test
|
|
62
|
+
npm run typecheck
|
|
63
|
+
npm run build && npm start
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## What must already be on the Memorix host
|
|
67
|
+
|
|
68
|
+
These stay in the Memorix repo. This API calls them over HTTP.
|
|
69
|
+
|
|
70
|
+
- `GET /api/metadata/kinds/object-types` — object types, content types, `fields`, optional `leading`, optional `derived`.
|
|
71
|
+
- `GET /api/data/subjects/*` — directory only: `{ recordId, objectType, dataCategory, contentTypes }`. The wildcard keeps record ids that contain `/`.
|
|
72
|
+
- `POST /api/data/compose` with `explicit: true` and `include: { markdown: true }` — full instances, including stored `_markdown` when requested.
|
|
73
|
+
- `POST /api/data/compose/data/list` with `include: { markdown: true }` — page by `leadingContentType`. When markdown is requested, each instance is `{ data, revision, _markdown? }` instead of raw `.data`.
|
|
74
|
+
- `GET /api/data/content` — resolves `refersTo` ids while projecting json and markdown. The filter is `recordId in [...]`, then a declared identifier field such as `data.displayName` or `data.cveId`. The same route serves Nexum snapshots (`objectType=content`, `contentType=snapshots`) and every other content read forwarded by `GET /api/v1/memorix/*`. Processed subjects also list this route for every catalog content type except `relationships` and keep the distinct record ids whose datasource basis is `caller` or `preserved`. `declared` and `backfill` rows are not subjects. `checking` stays true until each included collection returns no `nextCursor`. A new `rule.id` drops the kept answer. `count=true` settles a collection only when the body is `{ count }` and that count matches the kept row count. A content page or `409` does not. `400` `ROUTE_UNKNOWN_CONTENT_TYPE` means that pair is absent. A single-record read of a discriminated content type that sends `discriminatorValue` or a discriminator `eq` filter is answered here from a `recordId in [...]` list on that content type, because the Memorix single get ignores `filter` and takes no discriminator. See `UPSTREAM-REQUESTS.md`.
|
|
75
|
+
- `POST /api/data/compose/data` — connected Nexum content. Each `sourceRefs` id is composed to content-type `.data`.
|
|
76
|
+
- `GET /api/knowledge/status`, `GET /api/knowledge/entities`, `POST /api/knowledge/query` — Nexum canvas. The explore process can be down; snapshot reads still work. Memorix reaches explore at `MEMORIX_NEXUM_EXPLORE_URL`, then `NEXUM_API_URL`, then `http://127.0.0.1:8080`. When it cannot connect, status reports `upstreamOk: false` and the other two return Memorix `500` `INTERNAL_ERROR` `fetch failed`. This API turns that into `502` `NEXUM_UPSTREAM_UNREACHABLE`. To restore it, start explore on the Memorix host or fix that env var, then restart Memorix.
|
|
77
|
+
- `GET` and `POST /mcp/nexum` — memorix-nexum JSON-RPC. This API proxies it at `/api/v1/mcp/nexum`.
|
|
78
|
+
- Other Memorix `GET /api/*` reads listed in the repo README (publications, relationships, memory, pipelines, analytics, metadata, connectors, jobs, hooks, data-journey, workflow, operations, intelligence). This process forwards them. It does not forward writes.
|
|
79
|
+
- MGC `GET` and `POST /mcp` when `MGC_MCP_URL`, `MGC_SOURCE_SERVICE_URL`, or `genericConnectors.mcpUrl` is set.
|
|
80
|
+
|
|
81
|
+
`ContentTypeSpec.leading` is optional. At most one content type per object type may set it. When none is set, this API uses the first content type that is not `relationships` and reports `leadingSource: "default"`. A query `leadingContentType` overrides that and reports `leadingSource: "request"`.
|
|
82
|
+
|
|
83
|
+
## What the responses guarantee
|
|
84
|
+
|
|
85
|
+
- Every content instance includes `descriptor.fields` for that content type (object-type fields whose `contentType` matches, plus fields that omit `contentType`).
|
|
86
|
+
- `descriptorCoverage` is `complete`, `partial`, or `none`. `none` means the metadata declared no fields for that content type. Reads still return the data.
|
|
87
|
+
- `undeclaredPaths` lists `.data` keys that have no `data.<key>` field. Ingest on Memorix stays free-form; this API does not reject those keys.
|
|
88
|
+
- `representation=json|markdown|both` (default `both`). Stored `_markdown` with source `ai` or `content` is returned as stored. Stored source `json`, and data with no stored markdown, is rendered from `.data` with source `rendered`. Prose is not parsed back into fields.
|
|
89
|
+
- A field with `refersTo.objectType` and no `shapes` is a record id or a list of them. `json.data` and rendered markdown replace those ids with `{ recordId, objectType, contentType, data }`. A path `data.<key>` is expanded at every `<key>` in the payload. A longer path is expanded only there. Lookup is `recordId` on the referred object type, then string identifier fields on its leading content type (`displayName`, `title`, `name`, `id`, or a name ending in `Id`). An unmatched id stays a string. At most 200 distinct ids are loaded per referred object type on a response. When a render replaces ids, `markdown.metadata.generatedFrom` is `references`.
|
|
90
|
+
- A field may also keep `mixed` and `shapes` (`name`, `grammar`, `sourceProperty`, `resolvesTo`). `POST /api/v1/refs/resolve` with `{ values }` classifies strings by those grammars. `value` loads the reserved record. `paired-<sourceProperty>` joins the sibling subject that publishes `matchProperty`. A `{value}` template joins a batch subject that publishes `sourceProperty` or `displayName` / `title` / `name`. On its own, it is looked up on the object types named by sibling `value` shapes, and across the catalog only when it has none. A field with `shapes` is not expanded by `listRecords` or `getRecord`. `GET /api/v1/records/{id}` remains the subject directory.
|
|
91
|
+
- A content type keeps optional `presentation` (`label`, `order`, `tab`, `values[]`) and `origin` (`producer`, `use`, `record`) when the pack stamps them in `contentTypes[]` of `GET /api/metadata/kinds/object-types`. They are display metadata. This API does not read them for any decision and does not require them. Malformed pieces are dropped by `catalogFromKinds`.
|
|
92
|
+
- An object type keeps `functions` (`id`, `question`, `page`, `composes`, `pageStory`, `reads`, optional `template` and `kind` of `spine` or `threads`). `template` matches `data.template` and `presentation.values[].value` on content type `story`. A malformed function is dropped. `GET /api/v1/memorix/metadata/effective` and `metadata/raw` forward `objectTypes[].functions` unchanged. A content read with `recordId` and an `eq` filter on `data.template` returns the highest `revision`, including when that path is not the catalog discriminator. Story stays content type `story`.
|
|
93
|
+
- List pages use the Memorix cursor: `pageInfo.nextCursor` and `limit` (1–200, default 50). Filter and sort apply to the leading content type only.
|
|
94
|
+
|
|
95
|
+
## After the move
|
|
96
|
+
|
|
97
|
+
Point `MEMORIX_SERVICE_URL` at the Memorix host. Publish this package from the new repo when you want other apps to embed the server. Keep pinning the host routes above. Do not copy `memorix-data`. Do not open Mongo to read subjects. The assistants database is only the function-override collection.
|
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type FastifyInstance } from "fastify";
|
|
2
|
+
import { type ScoperReasonerKind } from "./config.js";
|
|
3
|
+
import type { PeerChoice } from "./peers.js";
|
|
4
|
+
import { createScoperHost, type ScoperHost } from "./scoper.js";
|
|
5
|
+
import { type EmbeddedSkillsOptions, type SkillsHost } from "./skills.js";
|
|
6
|
+
export type ClientApiAuth = {
|
|
7
|
+
mode: "header";
|
|
8
|
+
} | {
|
|
9
|
+
mode: "authix";
|
|
10
|
+
verify: (token: string) => Promise<{
|
|
11
|
+
organizationIds: string[];
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
export type ClientApiOptions = {
|
|
15
|
+
memorixUrl: string;
|
|
16
|
+
fetchImpl?: typeof fetch;
|
|
17
|
+
/** Default `header`: org comes from `x-memorix-org-id`. */
|
|
18
|
+
auth?: ClientApiAuth;
|
|
19
|
+
/** Listen port. Default `MEMORIX_CLIENT_API_PORT` or 5120. */
|
|
20
|
+
port?: number;
|
|
21
|
+
/**
|
|
22
|
+
* MGC source MCP URL. `null` leaves `/api/v1/mcp/mgc` unconfigured.
|
|
23
|
+
* Omit to use `MGC_MCP_URL` / `MGC_SOURCE_SERVICE_URL`, then Memorix `GET /api/connectors`.
|
|
24
|
+
*/
|
|
25
|
+
mgcMcpUrl?: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Scoper 2.3.0 hosted in this process. The library default is the scripted reasoner
|
|
28
|
+
* and no saved functions. The CLI passes the process env.
|
|
29
|
+
*/
|
|
30
|
+
scoper?: {
|
|
31
|
+
reasoner?: ScoperReasonerKind;
|
|
32
|
+
functionsDir?: string;
|
|
33
|
+
functionsPackage?: string;
|
|
34
|
+
learnFunctions?: boolean;
|
|
35
|
+
env?: NodeJS.ProcessEnv;
|
|
36
|
+
/** Already chosen for this process. `external` does not build a Scoper. */
|
|
37
|
+
peer?: PeerChoice;
|
|
38
|
+
/** Test double. When set, this process does not build a Scoper. */
|
|
39
|
+
host?: ScoperHost;
|
|
40
|
+
/** Fetch used to proxy an external Scoper. */
|
|
41
|
+
fetchImpl?: typeof fetch;
|
|
42
|
+
/** Embedded host factory. Tests use this to prove an external peer does not build one. */
|
|
43
|
+
createHost?: typeof createScoperHost;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Agent functions. `external` proxies skill-api. Otherwise this process hosts them.
|
|
47
|
+
* Omitted means an embedded host with no pack and no override database.
|
|
48
|
+
*/
|
|
49
|
+
skills?: {
|
|
50
|
+
peer?: PeerChoice;
|
|
51
|
+
host?: SkillsHost;
|
|
52
|
+
fetchImpl?: typeof fetch;
|
|
53
|
+
packDir?: string;
|
|
54
|
+
agentsDir?: string;
|
|
55
|
+
contentAgentIds?: string[];
|
|
56
|
+
mongoUri?: string;
|
|
57
|
+
createClient?: EmbeddedSkillsOptions["createClient"];
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export type ClientApi = FastifyInstance & {
|
|
61
|
+
port: number;
|
|
62
|
+
};
|
|
63
|
+
export declare function createClientApi(options: ClientApiOptions): Promise<ClientApi>;
|
|
64
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAGA,OAAgB,EAAE,KAAK,eAAe,EAAuB,MAAM,SAAS,CAAC;AAW7E,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAStE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAkD,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAChH,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EAChB,MAAM,aAAa,CAAC;AAQrB,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,eAAe,EAAE,MAAM,EAAE,C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AE,CAAC;AAsH3D,wBAAsB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAoUnF"}
|
package/dist/app.js
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import Fastify from "fastify";
|
|
5
|
+
import { attachCoreFastify } from "@x12i/core-service/fastify";
|
|
6
|
+
import { catalogFromKinds, findContentType, findObjectType, } from "./catalog.js";
|
|
7
|
+
import { contentTypeIsDerived } from "./derived.js";
|
|
8
|
+
import { resolveApiPort } from "./config.js";
|
|
9
|
+
import { ApiError, UpstreamError } from "./errors.js";
|
|
10
|
+
import { registerFetchRoutes } from "./fetch.js";
|
|
11
|
+
import { clientApiLiveRing, memorixFetch } from "./live.js";
|
|
12
|
+
import { withClientApiLiveNav } from "./live-ops-nav.js";
|
|
13
|
+
import { registerProcessedRoutes } from "./processed.js";
|
|
14
|
+
import { projectContents } from "./project.js";
|
|
15
|
+
import { collectReferenceTargets, loadResolvedReferences, mergeReferenceTargets } from "./refs.js";
|
|
16
|
+
import { registerReadsLive } from "./reads-live-routes.js";
|
|
17
|
+
import { createScoperHost, createExternalScoperHost, registerScoperRoutes } from "./scoper.js";
|
|
18
|
+
import { createEmbeddedSkillsHost, createExternalSkillsHost, registerSkillRoutes, } from "./skills.js";
|
|
19
|
+
import { attachRequestCountex, registerRequestStatsRoute } from "./request-countex.js";
|
|
20
|
+
import { registerRefRoutes } from "./shaped-refs.js";
|
|
21
|
+
import { orgFromToken, scopeBody, scopeFromHeaders } from "./scope.js";
|
|
22
|
+
import { asRecord, createUpstream, subjectDirectoryPath } from "./upstream.js";
|
|
23
|
+
const openApiPath = resolve(dirname(fileURLToPath(import.meta.url)), "../openapi/openapi.json");
|
|
24
|
+
function queryOf(req) {
|
|
25
|
+
return (req.query ?? {});
|
|
26
|
+
}
|
|
27
|
+
function representationOf(raw) {
|
|
28
|
+
if (raw === undefined || raw === "" || raw === "both")
|
|
29
|
+
return "both";
|
|
30
|
+
if (raw === "json" || raw === "markdown")
|
|
31
|
+
return raw;
|
|
32
|
+
throw new ApiError(400, "VALIDATION", "representation must be json, markdown, or both");
|
|
33
|
+
}
|
|
34
|
+
function csv(raw) {
|
|
35
|
+
if (typeof raw !== "string" || !raw.trim())
|
|
36
|
+
return undefined;
|
|
37
|
+
const items = raw.split(",").map((item) => item.trim()).filter(Boolean);
|
|
38
|
+
return items.length > 0 ? items : undefined;
|
|
39
|
+
}
|
|
40
|
+
function jsonQuery(raw, name) {
|
|
41
|
+
if (raw === undefined || raw === "")
|
|
42
|
+
return undefined;
|
|
43
|
+
if (typeof raw !== "string")
|
|
44
|
+
return raw;
|
|
45
|
+
try {
|
|
46
|
+
return JSON.parse(raw);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
throw new ApiError(400, "VALIDATION", `${name} must be JSON`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function limitOf(raw) {
|
|
53
|
+
if (raw === undefined || raw === "")
|
|
54
|
+
return 50;
|
|
55
|
+
const limit = Number(raw);
|
|
56
|
+
if (!Number.isFinite(limit)) {
|
|
57
|
+
throw new ApiError(400, "VALIDATION", "limit must be a number");
|
|
58
|
+
}
|
|
59
|
+
return Math.min(Math.max(Math.trunc(limit), 1), 200);
|
|
60
|
+
}
|
|
61
|
+
function wildcard(req) {
|
|
62
|
+
const params = req.params;
|
|
63
|
+
return (params["*"] ?? params.path ?? "").trim();
|
|
64
|
+
}
|
|
65
|
+
function fieldsByType(objectType, contentTypes) {
|
|
66
|
+
const map = new Map();
|
|
67
|
+
for (const contentType of contentTypes) {
|
|
68
|
+
map.set(contentType, objectType ? (findContentType(objectType, contentType)?.fields ?? []) : []);
|
|
69
|
+
}
|
|
70
|
+
return map;
|
|
71
|
+
}
|
|
72
|
+
async function projectRead(upstream, scope, catalog, contents, fieldMap, representation, shape) {
|
|
73
|
+
const targets = collectReferenceTargets(contents, fieldMap, shape);
|
|
74
|
+
const resolved = await loadResolvedReferences(upstream, scope, catalog, targets);
|
|
75
|
+
return projectContents(contents, fieldMap, representation, shape, resolved);
|
|
76
|
+
}
|
|
77
|
+
async function loadCatalog(upstream, scope) {
|
|
78
|
+
const body = await upstream.get("/api/metadata/kinds/object-types", scope);
|
|
79
|
+
return catalogFromKinds(body);
|
|
80
|
+
}
|
|
81
|
+
async function loadSubject(upstream, scope, recordId) {
|
|
82
|
+
const body = asRecord(await upstream.get(subjectDirectoryPath(recordId), scope));
|
|
83
|
+
if (!body || typeof body.recordId !== "string" || typeof body.objectType !== "string") {
|
|
84
|
+
throw new ApiError(502, "UPSTREAM", "Subject directory response is missing recordId or objectType");
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
recordId: body.recordId,
|
|
88
|
+
objectType: body.objectType,
|
|
89
|
+
dataCategory: typeof body.dataCategory === "string" ? body.dataCategory : "",
|
|
90
|
+
contentTypes: Array.isArray(body.contentTypes)
|
|
91
|
+
? body.contentTypes.filter((item) => typeof item === "string")
|
|
92
|
+
: [],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function contentTypeViews(objectType, ids) {
|
|
96
|
+
return ids.map((id) => {
|
|
97
|
+
const known = objectType ? findContentType(objectType, id) : null;
|
|
98
|
+
if (known)
|
|
99
|
+
return known;
|
|
100
|
+
return {
|
|
101
|
+
id,
|
|
102
|
+
required: false,
|
|
103
|
+
leading: false,
|
|
104
|
+
described: false,
|
|
105
|
+
derived: contentTypeIsDerived(id),
|
|
106
|
+
fields: [],
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function bearerToken(headerValue) {
|
|
111
|
+
const raw = Array.isArray(headerValue) ? headerValue[0] : headerValue;
|
|
112
|
+
if (!raw)
|
|
113
|
+
return "";
|
|
114
|
+
const match = /^Bearer\s+(\S+)\s*$/i.exec(raw.trim());
|
|
115
|
+
return match?.[1] ?? "";
|
|
116
|
+
}
|
|
117
|
+
export async function createClientApi(options) {
|
|
118
|
+
const upstream = createUpstream(options.memorixUrl, options.fetchImpl ?? memorixFetch);
|
|
119
|
+
const auth = options.auth ?? { mode: "header" };
|
|
120
|
+
const scoperPeer = options.scoper?.peer;
|
|
121
|
+
const scoperHost = options.scoper?.host ??
|
|
122
|
+
(scoperPeer?.mode === "external"
|
|
123
|
+
? createExternalScoperHost(scoperPeer, options.scoper?.fetchImpl ?? fetch)
|
|
124
|
+
: await (options.scoper?.createHost ?? createScoperHost)({
|
|
125
|
+
memorixUrl: options.memorixUrl,
|
|
126
|
+
reasoner: options.scoper?.reasoner ?? "scripted",
|
|
127
|
+
functionsDir: options.scoper?.functionsDir,
|
|
128
|
+
functionsPackage: options.scoper?.functionsPackage,
|
|
129
|
+
learnFunctions: options.scoper?.learnFunctions,
|
|
130
|
+
env: options.scoper?.env,
|
|
131
|
+
peer: scoperPeer,
|
|
132
|
+
}));
|
|
133
|
+
const skillsPeer = options.skills?.peer;
|
|
134
|
+
const skillsHost = options.skills?.host ??
|
|
135
|
+
(skillsPeer?.mode === "external"
|
|
136
|
+
? createExternalSkillsHost({
|
|
137
|
+
peer: skillsPeer,
|
|
138
|
+
fetchImpl: options.skills?.fetchImpl ?? fetch,
|
|
139
|
+
})
|
|
140
|
+
: createEmbeddedSkillsHost({
|
|
141
|
+
memorixUrl: options.memorixUrl,
|
|
142
|
+
peer: skillsPeer,
|
|
143
|
+
packDir: options.skills?.packDir,
|
|
144
|
+
agentsDir: options.skills?.agentsDir,
|
|
145
|
+
contentAgentIds: options.skills?.contentAgentIds,
|
|
146
|
+
mongoUri: options.skills?.mongoUri,
|
|
147
|
+
createClient: options.skills?.createClient,
|
|
148
|
+
}));
|
|
149
|
+
const app = Fastify({
|
|
150
|
+
logger: false,
|
|
151
|
+
disableRequestLogging: true,
|
|
152
|
+
});
|
|
153
|
+
app.addHook("onRequest", async (req, reply) => {
|
|
154
|
+
const origin = req.headers.origin;
|
|
155
|
+
if (typeof origin === "string" && origin) {
|
|
156
|
+
reply.header("access-control-allow-origin", origin);
|
|
157
|
+
reply.header("vary", "Origin");
|
|
158
|
+
reply.header("access-control-allow-headers", "content-type, authorization, x-memorix-org-id, x-memorix-agent-ids, x-memorix-caller, x-trace-id");
|
|
159
|
+
reply.header("access-control-allow-methods", "GET, POST, PUT, DELETE, OPTIONS");
|
|
160
|
+
}
|
|
161
|
+
if (req.method === "OPTIONS") {
|
|
162
|
+
await reply.code(204).send();
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
async function scopeFor(req) {
|
|
166
|
+
if (auth.mode === "header") {
|
|
167
|
+
const scope = scopeFromHeaders(req.headers);
|
|
168
|
+
req.clientScope = scope;
|
|
169
|
+
return scope;
|
|
170
|
+
}
|
|
171
|
+
const token = bearerToken(req.headers.authorization);
|
|
172
|
+
if (!token)
|
|
173
|
+
throw new ApiError(401, "UNAUTHORIZED", "Authorization bearer token is required");
|
|
174
|
+
let organizationIds;
|
|
175
|
+
try {
|
|
176
|
+
organizationIds = (await auth.verify(token)).organizationIds;
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
if (err instanceof ApiError)
|
|
180
|
+
throw err;
|
|
181
|
+
const message = err instanceof Error ? err.message : "invalid token";
|
|
182
|
+
throw new ApiError(401, "UNAUTHORIZED", message);
|
|
183
|
+
}
|
|
184
|
+
const requested = req.headers["x-memorix-org-id"];
|
|
185
|
+
const requestedOrg = (Array.isArray(requested) ? requested[0] : requested)?.trim() ?? "";
|
|
186
|
+
const scope = scopeFromHeaders(req.headers, orgFromToken(organizationIds, requestedOrg));
|
|
187
|
+
req.clientScope = scope;
|
|
188
|
+
return scope;
|
|
189
|
+
}
|
|
190
|
+
app.setErrorHandler((err, _req, reply) => {
|
|
191
|
+
if (err instanceof ApiError) {
|
|
192
|
+
return reply.status(err.statusCode).send({
|
|
193
|
+
error: { code: err.code, message: err.message },
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
if (err instanceof UpstreamError) {
|
|
197
|
+
return reply.status(err.statusCode).send(err.body ?? { error: { code: "UPSTREAM", message: err.message } });
|
|
198
|
+
}
|
|
199
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
200
|
+
return reply.status(500).send({ error: { code: "INTERNAL", message } });
|
|
201
|
+
});
|
|
202
|
+
const core = await attachCoreFastify(app, {
|
|
203
|
+
// 5120 is outside the memorix zone, so the published port is passed in.
|
|
204
|
+
port: options.port ?? resolveApiPort(),
|
|
205
|
+
ring: clientApiLiveRing,
|
|
206
|
+
identity: {
|
|
207
|
+
id: "@x12i/memorix-client-api",
|
|
208
|
+
title: "Memorix Client API",
|
|
209
|
+
kind: "api",
|
|
210
|
+
zoneId: "memorix",
|
|
211
|
+
portKey: "service",
|
|
212
|
+
portEnv: "MEMORIX_CLIENT_API_PORT",
|
|
213
|
+
docsPath: "/api/openapi.json",
|
|
214
|
+
description: "Read API over Memorix: catalog, records, functions, Nexum, Scoper, and MCP · /_live/reads",
|
|
215
|
+
},
|
|
216
|
+
getHealth: async () => ({
|
|
217
|
+
ok: true,
|
|
218
|
+
service: "@x12i/memorix-client-api",
|
|
219
|
+
auth: auth.mode,
|
|
220
|
+
skills: {
|
|
221
|
+
mode: skillsHost.info.mode,
|
|
222
|
+
source: skillsHost.info.source,
|
|
223
|
+
version: skillsHost.info.version,
|
|
224
|
+
...(skillsHost.info.baseUrl ? { baseUrl: skillsHost.info.baseUrl } : {}),
|
|
225
|
+
},
|
|
226
|
+
scoper: {
|
|
227
|
+
version: scoperHost.info.version,
|
|
228
|
+
reasoner: scoperHost.info.reasoner,
|
|
229
|
+
functions: scoperHost.info.functions,
|
|
230
|
+
mode: scoperHost.info.mode ?? "embedded",
|
|
231
|
+
source: scoperHost.info.source ?? "@x12i/memorix-scoper",
|
|
232
|
+
...(scoperHost.info.baseUrl ? { baseUrl: scoperHost.info.baseUrl } : {}),
|
|
233
|
+
},
|
|
234
|
+
}),
|
|
235
|
+
});
|
|
236
|
+
if (core.live) {
|
|
237
|
+
const readUi = core.live.readUiHtml.bind(core.live);
|
|
238
|
+
core.live.readUiHtml = () => withClientApiLiveNav(readUi());
|
|
239
|
+
}
|
|
240
|
+
const requestStats = attachRequestCountex(app);
|
|
241
|
+
registerRequestStatsRoute(app, requestStats);
|
|
242
|
+
registerReadsLive(app);
|
|
243
|
+
const openApi = JSON.parse(readFileSync(openApiPath, "utf8"));
|
|
244
|
+
app.get("/api/openapi.json", async (_req, reply) => {
|
|
245
|
+
return reply.type("application/json").send(openApi);
|
|
246
|
+
});
|
|
247
|
+
app.get("/api/v1/catalog", async (req) => {
|
|
248
|
+
const scope = await scopeFor(req);
|
|
249
|
+
return { scope: scopeBody(scope), objectTypes: await loadCatalog(upstream, scope) };
|
|
250
|
+
});
|
|
251
|
+
app.get("/api/v1/object-types/:objectType", async (req) => {
|
|
252
|
+
const scope = await scopeFor(req);
|
|
253
|
+
const { objectType: id } = req.params;
|
|
254
|
+
const objectType = findObjectType(await loadCatalog(upstream, scope), id);
|
|
255
|
+
if (!objectType)
|
|
256
|
+
throw new ApiError(404, "READ_NOT_FOUND", `Unknown object type ${id}`);
|
|
257
|
+
return { scope: scopeBody(scope), objectType };
|
|
258
|
+
});
|
|
259
|
+
app.get("/api/v1/object-types/:objectType/content-types", async (req) => {
|
|
260
|
+
const scope = await scopeFor(req);
|
|
261
|
+
const { objectType: id } = req.params;
|
|
262
|
+
const objectType = findObjectType(await loadCatalog(upstream, scope), id);
|
|
263
|
+
if (!objectType)
|
|
264
|
+
throw new ApiError(404, "READ_NOT_FOUND", `Unknown object type ${id}`);
|
|
265
|
+
return {
|
|
266
|
+
scope: scopeBody(scope),
|
|
267
|
+
objectType: objectType.id,
|
|
268
|
+
leadingContentType: objectType.leadingContentType,
|
|
269
|
+
leadingSource: objectType.leadingSource,
|
|
270
|
+
contentTypes: objectType.contentTypes,
|
|
271
|
+
};
|
|
272
|
+
});
|
|
273
|
+
app.get("/api/v1/object-types/:objectType/content-types/:contentType", async (req) => {
|
|
274
|
+
const scope = await scopeFor(req);
|
|
275
|
+
const { objectType: id, contentType } = req.params;
|
|
276
|
+
const objectType = findObjectType(await loadCatalog(upstream, scope), id);
|
|
277
|
+
if (!objectType)
|
|
278
|
+
throw new ApiError(404, "READ_NOT_FOUND", `Unknown object type ${id}`);
|
|
279
|
+
const view = findContentType(objectType, contentType);
|
|
280
|
+
if (!view)
|
|
281
|
+
throw new ApiError(404, "READ_NOT_FOUND", `Unknown content type ${contentType}`);
|
|
282
|
+
return { scope: scopeBody(scope), objectType: objectType.id, contentType: view };
|
|
283
|
+
});
|
|
284
|
+
app.get("/api/v1/object-types/:objectType/records", async (req) => {
|
|
285
|
+
const scope = await scopeFor(req);
|
|
286
|
+
const { objectType: id } = req.params;
|
|
287
|
+
const query = queryOf(req);
|
|
288
|
+
const catalog = await loadCatalog(upstream, scope);
|
|
289
|
+
const objectType = findObjectType(catalog, id);
|
|
290
|
+
if (!objectType)
|
|
291
|
+
throw new ApiError(404, "READ_NOT_FOUND", `Unknown object type ${id}`);
|
|
292
|
+
const leadingContentType = typeof query.leadingContentType === "string" && query.leadingContentType.trim()
|
|
293
|
+
? query.leadingContentType.trim()
|
|
294
|
+
: objectType.leadingContentType;
|
|
295
|
+
if (!leadingContentType) {
|
|
296
|
+
throw new ApiError(400, "VALIDATION", `Object type ${id} has no content type to page by`);
|
|
297
|
+
}
|
|
298
|
+
if (!findContentType(objectType, leadingContentType)) {
|
|
299
|
+
throw new ApiError(400, "VALIDATION", `Unknown leading content type ${leadingContentType}`);
|
|
300
|
+
}
|
|
301
|
+
const requested = csv(query.contentTypes) ?? objectType.contentTypes.map((ct) => ct.id);
|
|
302
|
+
const contentTypes = requested.filter((ct) => ct !== "relationships");
|
|
303
|
+
const representation = representationOf(query.representation);
|
|
304
|
+
const limit = limitOf(query.limit);
|
|
305
|
+
const listed = asRecord(await upstream.post("/api/data/compose/data/list", scope, {
|
|
306
|
+
objectType: id,
|
|
307
|
+
leadingContentType,
|
|
308
|
+
contentTypes,
|
|
309
|
+
filter: jsonQuery(query.filter, "filter"),
|
|
310
|
+
sort: jsonQuery(query.sort, "sort"),
|
|
311
|
+
limit,
|
|
312
|
+
cursor: typeof query.cursor === "string" ? query.cursor : undefined,
|
|
313
|
+
...(representation === "json" ? {} : { include: { markdown: true } }),
|
|
314
|
+
}));
|
|
315
|
+
const items = Array.isArray(listed?.items) ? listed.items : [];
|
|
316
|
+
const pageInfo = asRecord(listed?.pageInfo);
|
|
317
|
+
const shape = representation === "json" ? "data" : "envelope";
|
|
318
|
+
const fieldMap = fieldsByType(objectType, contentTypes);
|
|
319
|
+
const rows = items.map((item) => {
|
|
320
|
+
const row = asRecord(item);
|
|
321
|
+
return {
|
|
322
|
+
recordId: typeof row?.recordId === "string" ? row.recordId : "",
|
|
323
|
+
contents: asRecord(row?.contents),
|
|
324
|
+
};
|
|
325
|
+
});
|
|
326
|
+
const targets = new Map();
|
|
327
|
+
for (const row of rows)
|
|
328
|
+
mergeReferenceTargets(targets, collectReferenceTargets(row.contents, fieldMap, shape));
|
|
329
|
+
const resolved = await loadResolvedReferences(upstream, scope, catalog, targets);
|
|
330
|
+
return {
|
|
331
|
+
scope: scopeBody(scope),
|
|
332
|
+
objectType: id,
|
|
333
|
+
leadingContentType,
|
|
334
|
+
leadingSource: query.leadingContentType && String(query.leadingContentType).trim()
|
|
335
|
+
? "request"
|
|
336
|
+
: objectType.leadingSource,
|
|
337
|
+
items: rows.map((row) => ({
|
|
338
|
+
recordId: row.recordId,
|
|
339
|
+
contents: projectContents(row.contents, fieldMap, representation, shape, resolved),
|
|
340
|
+
})),
|
|
341
|
+
pageInfo: {
|
|
342
|
+
nextCursor: typeof pageInfo?.nextCursor === "string" ? pageInfo.nextCursor : null,
|
|
343
|
+
limit: typeof pageInfo?.limit === "number" ? pageInfo.limit : limit,
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
});
|
|
347
|
+
app.get("/api/v1/records/*", async (req) => {
|
|
348
|
+
const scope = await scopeFor(req);
|
|
349
|
+
const raw = wildcard(req);
|
|
350
|
+
const catalogOnly = raw.endsWith("/content-types");
|
|
351
|
+
const recordId = (catalogOnly ? raw.slice(0, -"/content-types".length) : raw).replace(/\/$/, "");
|
|
352
|
+
if (!recordId)
|
|
353
|
+
throw new ApiError(400, "VALIDATION", "recordId required");
|
|
354
|
+
const subject = await loadSubject(upstream, scope, recordId);
|
|
355
|
+
const query = queryOf(req);
|
|
356
|
+
if (typeof query.objectType === "string" && query.objectType && query.objectType !== subject.objectType) {
|
|
357
|
+
throw new ApiError(404, "READ_NOT_FOUND", "Requested objectType does not match directory");
|
|
358
|
+
}
|
|
359
|
+
const catalog = await loadCatalog(upstream, scope);
|
|
360
|
+
const objectType = findObjectType(catalog, subject.objectType);
|
|
361
|
+
if (catalogOnly) {
|
|
362
|
+
return {
|
|
363
|
+
scope: scopeBody(scope),
|
|
364
|
+
recordId: subject.recordId,
|
|
365
|
+
objectType: subject.objectType,
|
|
366
|
+
dataCategory: subject.dataCategory,
|
|
367
|
+
leadingContentType: objectType?.leadingContentType ?? null,
|
|
368
|
+
leadingSource: objectType?.leadingSource ?? "default",
|
|
369
|
+
contentTypes: contentTypeViews(objectType, subject.contentTypes),
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
const requested = csv(query.contentTypes);
|
|
373
|
+
const contentTypes = (requested ?? subject.contentTypes).filter((ct) => ct !== "relationships");
|
|
374
|
+
const representation = representationOf(query.representation);
|
|
375
|
+
let contents = {};
|
|
376
|
+
let dataCategory = subject.dataCategory;
|
|
377
|
+
if (contentTypes.length > 0) {
|
|
378
|
+
const composed = asRecord(await upstream.post("/api/data/compose", scope, {
|
|
379
|
+
explicit: true,
|
|
380
|
+
recordId: subject.recordId,
|
|
381
|
+
contentTypes,
|
|
382
|
+
...(representation === "json" ? {} : { include: { markdown: true } }),
|
|
383
|
+
}));
|
|
384
|
+
if (typeof composed?.dataCategory === "string")
|
|
385
|
+
dataCategory = composed.dataCategory;
|
|
386
|
+
const composition = asRecord(composed?.composition);
|
|
387
|
+
contents = asRecord(composition?.contents);
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
scope: scopeBody(scope),
|
|
391
|
+
recordId: subject.recordId,
|
|
392
|
+
objectType: subject.objectType,
|
|
393
|
+
dataCategory,
|
|
394
|
+
contentTypes,
|
|
395
|
+
contents: await projectRead(upstream, scope, catalog, contents, fieldsByType(objectType, contentTypes), representation, "record"),
|
|
396
|
+
};
|
|
397
|
+
});
|
|
398
|
+
registerProcessedRoutes(app, { upstream, scopeFor, loadCatalog });
|
|
399
|
+
registerRefRoutes(app, { upstream, scopeFor, loadCatalog });
|
|
400
|
+
registerFetchRoutes(app, {
|
|
401
|
+
upstream,
|
|
402
|
+
memorixUrl: options.memorixUrl,
|
|
403
|
+
fetchImpl: options.fetchImpl ?? memorixFetch,
|
|
404
|
+
scopeFor,
|
|
405
|
+
loadCatalog,
|
|
406
|
+
mgcMcpUrl: options.mgcMcpUrl,
|
|
407
|
+
});
|
|
408
|
+
registerSkillRoutes(app, { host: skillsHost, scopeFor });
|
|
409
|
+
registerScoperRoutes(app, { host: scoperHost, scopeFor });
|
|
410
|
+
return Object.assign(app, { port: core.port });
|
|
411
|
+
}
|
|
412
|
+
//# sourceMappingURL=app.js.map
|
package/dist/app.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,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,OAAO,OAAsD,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,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CACzB,QAAQ,EACR,KAAK,EACL,OAAO,EACP,QAAQ,EACR,YAAY,CAAC,UAAU,EAAE,YAAY,CAAC,EACtC,cAAc,EACd,QAAQ,CACT;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,uBAAuB,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;IAClE,iBAAiB,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;IAE5D,mBAAmB,CAAC,GAAG,EAAE;QACvB,QAAQ;QACR,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,YAAY;QAC5C,QAAQ;QACR,WAAW;QACX,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAC,CAAC;IACH,mBAAmB,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzD,oBAAoB,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE1D,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAc,CAAC;AAC9D,CAAC"}
|
package/dist/authix.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AuthMode } from "./config.js";
|
|
2
|
+
type Env = Record<string, string | undefined>;
|
|
3
|
+
export type TokenOrganizations = {
|
|
4
|
+
organizationIds: string[];
|
|
5
|
+
};
|
|
6
|
+
export declare function createAuthixOrgResolver(env?: Env): Promise<(token: string) => Promise<TokenOrganizations>>;
|
|
7
|
+
export declare function authLabel(mode: AuthMode): string;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=authix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authix.d.ts","sourceRoot":"","sources":["../src/authix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAE9C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAiBF,wBAAsB,uBAAuB,CAC3C,GAAG,GAAE,GAAiB,GACrB,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAqBzD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAEhD"}
|