@x12i/memorix-service 3.8.0 → 3.9.2
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/dist/app.d.ts.map +1 -1
- package/dist/app.js +4 -0
- package/dist/app.js.map +1 -1
- package/dist/caller-identity.d.ts.map +1 -1
- package/dist/caller-identity.js +2 -0
- package/dist/caller-identity.js.map +1 -1
- package/dist/datasource-backfill.d.ts +37 -0
- package/dist/datasource-backfill.d.ts.map +1 -0
- package/dist/datasource-backfill.js +202 -0
- package/dist/datasource-backfill.js.map +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +5 -0
- package/dist/errors.js.map +1 -1
- package/dist/markdown-backfill.d.ts +23 -0
- package/dist/markdown-backfill.d.ts.map +1 -0
- package/dist/markdown-backfill.js +122 -0
- package/dist/markdown-backfill.js.map +1 -0
- package/dist/openapi/openapi.json +325 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +1 -0
- package/dist/platform.js.map +1 -1
- package/dist/routes/data.d.ts.map +1 -1
- package/dist/routes/data.js +212 -3
- package/dist/routes/data.js.map +1 -1
- package/dist/routes/datasource-backfill.d.ts +4 -0
- package/dist/routes/datasource-backfill.d.ts.map +1 -0
- package/dist/routes/datasource-backfill.js +15 -0
- package/dist/routes/datasource-backfill.js.map +1 -0
- package/dist/routes/markdown-backfill.d.ts +4 -0
- package/dist/routes/markdown-backfill.d.ts.map +1 -0
- package/dist/routes/markdown-backfill.js +15 -0
- package/dist/routes/markdown-backfill.js.map +1 -0
- package/openapi/openapi.json +325 -0
- package/package.json +4 -4
package/openapi/openapi.json
CHANGED
|
@@ -2218,6 +2218,259 @@
|
|
|
2218
2218
|
}
|
|
2219
2219
|
}
|
|
2220
2220
|
},
|
|
2221
|
+
"/api/admin/markdown/backfill": {
|
|
2222
|
+
"post": {
|
|
2223
|
+
"operationId": "adminMarkdownBackfill",
|
|
2224
|
+
"summary": "Fill missing _markdown from data on current heads",
|
|
2225
|
+
"description": "Admin repair. Dry-run is the default. Sets source json with generatedFrom data. Skips rows that already have _markdown. Does not change revision, data, or _system.modifiedAt. confirm must be true. includeHistory must stay false.",
|
|
2226
|
+
"tags": ["Admin"],
|
|
2227
|
+
"parameters": [
|
|
2228
|
+
{ "$ref": "#/components/parameters/XMemorixCaller" },
|
|
2229
|
+
{ "$ref": "#/components/parameters/XMemorixOrgId" },
|
|
2230
|
+
{ "$ref": "#/components/parameters/XMemorixAgentIds" }
|
|
2231
|
+
],
|
|
2232
|
+
"requestBody": {
|
|
2233
|
+
"required": true,
|
|
2234
|
+
"content": {
|
|
2235
|
+
"application/json": {
|
|
2236
|
+
"schema": {
|
|
2237
|
+
"type": "object",
|
|
2238
|
+
"required": ["confirm"],
|
|
2239
|
+
"properties": {
|
|
2240
|
+
"confirm": { "type": "boolean" },
|
|
2241
|
+
"dryRun": { "type": "boolean", "default": true },
|
|
2242
|
+
"includeHistory": { "type": "boolean", "enum": [false] }
|
|
2243
|
+
},
|
|
2244
|
+
"additionalProperties": false
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
},
|
|
2249
|
+
"responses": {
|
|
2250
|
+
"200": {
|
|
2251
|
+
"description": "Backfill counts",
|
|
2252
|
+
"content": {
|
|
2253
|
+
"application/json": {
|
|
2254
|
+
"schema": {
|
|
2255
|
+
"type": "object",
|
|
2256
|
+
"required": ["dryRun", "scanned", "wouldFill", "alreadyPresent", "skippedTooLarge", "skippedInvalid"],
|
|
2257
|
+
"properties": {
|
|
2258
|
+
"dryRun": { "type": "boolean" },
|
|
2259
|
+
"scanned": { "type": "integer" },
|
|
2260
|
+
"wouldFill": { "type": "integer" },
|
|
2261
|
+
"alreadyPresent": { "type": "integer" },
|
|
2262
|
+
"skippedTooLarge": { "type": "integer" },
|
|
2263
|
+
"skippedInvalid": { "type": "integer" }
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
},
|
|
2269
|
+
"400": {
|
|
2270
|
+
"description": "confirm was not true, or includeHistory was requested",
|
|
2271
|
+
"content": {
|
|
2272
|
+
"application/json": {
|
|
2273
|
+
"schema": { "$ref": "#/components/schemas/ErrorEnvelope" }
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
},
|
|
2277
|
+
"503": {
|
|
2278
|
+
"description": "Mongo is not connected",
|
|
2279
|
+
"content": {
|
|
2280
|
+
"application/json": {
|
|
2281
|
+
"schema": { "$ref": "#/components/schemas/ErrorEnvelope" }
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
},
|
|
2288
|
+
"/api/admin/datasource/backfill": {
|
|
2289
|
+
"post": {
|
|
2290
|
+
"operationId": "adminDatasourceBackfill",
|
|
2291
|
+
"summary": "Stamp _system._datasource on current heads without a content write",
|
|
2292
|
+
"description": "Admin repair. Dry-run is the default. Does not change revision, data, or _system.modifiedAt. confirm must be true. includeHistory must stay false.",
|
|
2293
|
+
"tags": ["Admin"],
|
|
2294
|
+
"parameters": [
|
|
2295
|
+
{ "$ref": "#/components/parameters/XMemorixCaller" },
|
|
2296
|
+
{ "$ref": "#/components/parameters/XMemorixOrgId" },
|
|
2297
|
+
{ "$ref": "#/components/parameters/XMemorixAgentIds" }
|
|
2298
|
+
],
|
|
2299
|
+
"requestBody": {
|
|
2300
|
+
"required": true,
|
|
2301
|
+
"content": {
|
|
2302
|
+
"application/json": {
|
|
2303
|
+
"schema": {
|
|
2304
|
+
"type": "object",
|
|
2305
|
+
"required": ["confirm", "rules", "unmatched"],
|
|
2306
|
+
"properties": {
|
|
2307
|
+
"confirm": { "type": "boolean" },
|
|
2308
|
+
"dryRun": { "type": "boolean", "default": true },
|
|
2309
|
+
"overwriteBackfill": { "type": "boolean", "default": true },
|
|
2310
|
+
"includeHistory": { "type": "boolean", "default": false },
|
|
2311
|
+
"rules": {
|
|
2312
|
+
"type": "array",
|
|
2313
|
+
"items": {
|
|
2314
|
+
"type": "object",
|
|
2315
|
+
"required": ["id", "match", "datasource"],
|
|
2316
|
+
"properties": {
|
|
2317
|
+
"id": { "type": "string" },
|
|
2318
|
+
"match": {
|
|
2319
|
+
"type": "object",
|
|
2320
|
+
"properties": {
|
|
2321
|
+
"orgId": { "type": "string" },
|
|
2322
|
+
"agentIds": { "type": "array", "items": { "type": "string" } },
|
|
2323
|
+
"objectType": { "type": "string" },
|
|
2324
|
+
"contentType": { "type": "string" }
|
|
2325
|
+
}
|
|
2326
|
+
},
|
|
2327
|
+
"datasource": {
|
|
2328
|
+
"type": "object",
|
|
2329
|
+
"description": "Do not send basis or recordedAt. Memorix adds basis backfill and recordedAt.",
|
|
2330
|
+
"required": ["service", "ingress"],
|
|
2331
|
+
"properties": {
|
|
2332
|
+
"service": { "type": "string" },
|
|
2333
|
+
"origin": { "type": "string" },
|
|
2334
|
+
"channel": { "type": "string" },
|
|
2335
|
+
"ingress": { "type": "string" }
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
},
|
|
2341
|
+
"unmatched": {
|
|
2342
|
+
"type": "object",
|
|
2343
|
+
"description": "Required. Applied when no rule matches. Do not send basis or recordedAt.",
|
|
2344
|
+
"required": ["service", "ingress"],
|
|
2345
|
+
"properties": {
|
|
2346
|
+
"service": { "type": "string" },
|
|
2347
|
+
"ingress": { "type": "string" }
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
},
|
|
2355
|
+
"responses": {
|
|
2356
|
+
"200": {
|
|
2357
|
+
"description": "Backfill counts. dryRun true changes nothing.",
|
|
2358
|
+
"content": {
|
|
2359
|
+
"application/json": {
|
|
2360
|
+
"schema": {
|
|
2361
|
+
"type": "object",
|
|
2362
|
+
"required": ["dryRun", "scanned", "wouldStamp", "alreadyStamped", "unattributed", "byRule"],
|
|
2363
|
+
"properties": {
|
|
2364
|
+
"dryRun": { "type": "boolean" },
|
|
2365
|
+
"scanned": { "type": "integer" },
|
|
2366
|
+
"wouldStamp": { "type": "integer" },
|
|
2367
|
+
"alreadyStamped": { "type": "integer" },
|
|
2368
|
+
"unattributed": { "type": "integer" },
|
|
2369
|
+
"byRule": { "type": "object", "additionalProperties": { "type": "integer" } }
|
|
2370
|
+
}
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
},
|
|
2375
|
+
"400": {
|
|
2376
|
+
"description": "confirm is not true, includeHistory is true, or the body is invalid",
|
|
2377
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } }
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
},
|
|
2382
|
+
"/api/data/datasource": {
|
|
2383
|
+
"post": {
|
|
2384
|
+
"operationId": "dataSetDatasource",
|
|
2385
|
+
"summary": "Set _system._datasource on existing content",
|
|
2386
|
+
"description": "MX-SYS-02. service is x-memorix-caller. Send recordId plus expectedRevision, or filter plus confirm true for one page. datasource may declare origin, channel, originRecordId, originAt, and ingress. Do not send service, basis, or recordedAt.",
|
|
2387
|
+
"tags": ["Data"],
|
|
2388
|
+
"parameters": [
|
|
2389
|
+
{ "$ref": "#/components/parameters/XMemorixCaller" },
|
|
2390
|
+
{ "$ref": "#/components/parameters/XMemorixOrgId" },
|
|
2391
|
+
{ "$ref": "#/components/parameters/XMemorixAgentIds" }
|
|
2392
|
+
],
|
|
2393
|
+
"requestBody": {
|
|
2394
|
+
"required": true,
|
|
2395
|
+
"content": {
|
|
2396
|
+
"application/json": {
|
|
2397
|
+
"schema": {
|
|
2398
|
+
"type": "object",
|
|
2399
|
+
"required": ["objectType", "contentType"],
|
|
2400
|
+
"properties": {
|
|
2401
|
+
"objectType": { "type": "string" },
|
|
2402
|
+
"contentType": { "type": "string" },
|
|
2403
|
+
"recordId": { "type": "string" },
|
|
2404
|
+
"expectedRevision": { "type": "integer", "minimum": 1 },
|
|
2405
|
+
"discriminatorValue": { "type": "string" },
|
|
2406
|
+
"filter": {},
|
|
2407
|
+
"confirm": { "type": "boolean" },
|
|
2408
|
+
"limit": { "type": "integer", "minimum": 1, "maximum": 200 },
|
|
2409
|
+
"cursor": { "type": "string" },
|
|
2410
|
+
"datasource": {
|
|
2411
|
+
"type": "object",
|
|
2412
|
+
"properties": {
|
|
2413
|
+
"origin": { "type": "string", "nullable": true },
|
|
2414
|
+
"channel": { "type": "string", "nullable": true },
|
|
2415
|
+
"originRecordId": { "type": "string", "nullable": true },
|
|
2416
|
+
"originAt": { "type": "string", "format": "date-time", "nullable": true },
|
|
2417
|
+
"ingress": {
|
|
2418
|
+
"type": "string",
|
|
2419
|
+
"enum": ["push", "import", "sync", "derive", "migrate", "manual", "replicate"]
|
|
2420
|
+
}
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
},
|
|
2428
|
+
"responses": {
|
|
2429
|
+
"200": { "description": "Datasource stamped. Revision increments." },
|
|
2430
|
+
"400": { "description": "Missing target, invalid declaration, or filter without confirm" },
|
|
2431
|
+
"404": { "description": "Record not found" },
|
|
2432
|
+
"409": { "description": "Stale revision" }
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
},
|
|
2436
|
+
"/api/data/content/move-fields": {
|
|
2437
|
+
"post": {
|
|
2438
|
+
"operationId": "dataMoveContentFields",
|
|
2439
|
+
"summary": "Move top-level keys between data and _metadata",
|
|
2440
|
+
"description": "data is content. _metadata is producer context and is not rendered into JSON markdown. toMetadata moves keys out of data. toData moves keys back into data. One record, exact revision.",
|
|
2441
|
+
"tags": ["Data"],
|
|
2442
|
+
"parameters": [
|
|
2443
|
+
{ "$ref": "#/components/parameters/XMemorixCaller" },
|
|
2444
|
+
{ "$ref": "#/components/parameters/XMemorixOrgId" },
|
|
2445
|
+
{ "$ref": "#/components/parameters/XMemorixAgentIds" }
|
|
2446
|
+
],
|
|
2447
|
+
"requestBody": {
|
|
2448
|
+
"required": true,
|
|
2449
|
+
"content": {
|
|
2450
|
+
"application/json": {
|
|
2451
|
+
"schema": {
|
|
2452
|
+
"type": "object",
|
|
2453
|
+
"required": ["objectType", "contentType", "recordId", "expectedRevision"],
|
|
2454
|
+
"properties": {
|
|
2455
|
+
"objectType": { "type": "string" },
|
|
2456
|
+
"contentType": { "type": "string" },
|
|
2457
|
+
"recordId": { "type": "string" },
|
|
2458
|
+
"expectedRevision": { "type": "integer", "minimum": 1 },
|
|
2459
|
+
"discriminatorValue": { "type": "string" },
|
|
2460
|
+
"toMetadata": { "type": "array", "items": { "type": "string" } },
|
|
2461
|
+
"toData": { "type": "array", "items": { "type": "string" } }
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
},
|
|
2467
|
+
"responses": {
|
|
2468
|
+
"200": { "description": "Keys moved and revision bumped" },
|
|
2469
|
+
"400": { "description": "Invalid keys, missing source key, or data/metadata conflict" },
|
|
2470
|
+
"409": { "description": "Stale revision" }
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
},
|
|
2221
2474
|
"/api/data/content": {
|
|
2222
2475
|
"get": {
|
|
2223
2476
|
"operationId": "dataGetContent",
|
|
@@ -2274,6 +2527,14 @@
|
|
|
2274
2527
|
"type": "string"
|
|
2275
2528
|
}
|
|
2276
2529
|
},
|
|
2530
|
+
{
|
|
2531
|
+
"name": "include",
|
|
2532
|
+
"in": "query",
|
|
2533
|
+
"schema": {
|
|
2534
|
+
"type": "string"
|
|
2535
|
+
},
|
|
2536
|
+
"description": "JSON object. {\"markdown\":true} returns root _markdown on get and list. Omitted by default. _audit is returned whenever stored and is not part of this flag."
|
|
2537
|
+
},
|
|
2277
2538
|
{
|
|
2278
2539
|
"name": "cursor",
|
|
2279
2540
|
"in": "query",
|
|
@@ -2558,6 +2819,21 @@
|
|
|
2558
2819
|
"record": {
|
|
2559
2820
|
"$ref": "#/components/schemas/MemorixRecordV2"
|
|
2560
2821
|
},
|
|
2822
|
+
"datasource": {
|
|
2823
|
+
"description": "Optional document source declaration. Memorix sets service from x-memorix-caller. Do not send service, basis, or recordedAt. record._system._datasource is ignored.",
|
|
2824
|
+
"type": "object",
|
|
2825
|
+
"properties": {
|
|
2826
|
+
"origin": { "type": "string", "nullable": true },
|
|
2827
|
+
"channel": { "type": "string", "nullable": true },
|
|
2828
|
+
"originRecordId": { "type": "string", "nullable": true },
|
|
2829
|
+
"originAt": { "type": "string", "format": "date-time", "nullable": true },
|
|
2830
|
+
"ingress": {
|
|
2831
|
+
"type": "string",
|
|
2832
|
+
"enum": ["push", "import", "sync", "derive", "migrate", "manual", "replicate"]
|
|
2833
|
+
}
|
|
2834
|
+
},
|
|
2835
|
+
"additionalProperties": true
|
|
2836
|
+
},
|
|
2561
2837
|
"precondition": {
|
|
2562
2838
|
"$ref": "#/components/schemas/WritePrecondition"
|
|
2563
2839
|
},
|
|
@@ -13992,11 +14268,60 @@
|
|
|
13992
14268
|
"provenance": {
|
|
13993
14269
|
"type": "object",
|
|
13994
14270
|
"additionalProperties": true
|
|
14271
|
+
},
|
|
14272
|
+
"_datasource": {
|
|
14273
|
+
"$ref": "#/components/schemas/DatasourceStamp"
|
|
13995
14274
|
}
|
|
13996
14275
|
}
|
|
14276
|
+
},
|
|
14277
|
+
"_markdown": {
|
|
14278
|
+
"$ref": "#/components/schemas/RecordMarkdown"
|
|
14279
|
+
},
|
|
14280
|
+
"_audit": {
|
|
14281
|
+
"type": "object",
|
|
14282
|
+
"description": "Optional audit of this record, not of its content and not _markdown.metadata. Returned on get, list, and query whenever stored. Not an include flag. Not rendered into JSON markdown. provider, model, and reasoningEffort are required when the object is present. Other keys stay open, including verdict.",
|
|
14283
|
+
"required": ["provider", "model", "reasoningEffort"],
|
|
14284
|
+
"properties": {
|
|
14285
|
+
"provider": { "type": "string", "minLength": 1 },
|
|
14286
|
+
"model": { "type": "string", "minLength": 1 },
|
|
14287
|
+
"reasoningEffort": { "type": "string", "minLength": 1 }
|
|
14288
|
+
},
|
|
14289
|
+
"additionalProperties": true
|
|
13997
14290
|
}
|
|
13998
14291
|
}
|
|
13999
14292
|
},
|
|
14293
|
+
"RecordMarkdown": {
|
|
14294
|
+
"type": "object",
|
|
14295
|
+
"description": "Original text beside data. Omitted from get and list unless the include query asks for markdown. Clients may send source ai or content. source json is filled by Memorix from data.",
|
|
14296
|
+
"required": ["content", "source"],
|
|
14297
|
+
"properties": {
|
|
14298
|
+
"content": { "type": "string" },
|
|
14299
|
+
"source": { "type": "string", "enum": ["ai", "json", "content"] },
|
|
14300
|
+
"metadata": { "type": "object", "additionalProperties": true }
|
|
14301
|
+
},
|
|
14302
|
+
"additionalProperties": true
|
|
14303
|
+
},
|
|
14304
|
+
"DatasourceStamp": {
|
|
14305
|
+
"type": "object",
|
|
14306
|
+
"description": "Memorix-owned document source. Not part of data. Absent on records written before MX-SYS-02.",
|
|
14307
|
+
"required": ["service", "ingress", "basis", "recordedAt"],
|
|
14308
|
+
"properties": {
|
|
14309
|
+
"service": { "type": "string" },
|
|
14310
|
+
"ingress": {
|
|
14311
|
+
"type": "string",
|
|
14312
|
+
"enum": ["push", "import", "sync", "derive", "migrate", "manual", "replicate", "unknown"]
|
|
14313
|
+
},
|
|
14314
|
+
"basis": {
|
|
14315
|
+
"type": "string",
|
|
14316
|
+
"enum": ["declared", "caller", "preserved", "backfill"]
|
|
14317
|
+
},
|
|
14318
|
+
"recordedAt": { "type": "string", "format": "date-time" },
|
|
14319
|
+
"origin": { "type": "string" },
|
|
14320
|
+
"channel": { "type": "string" },
|
|
14321
|
+
"originRecordId": { "type": "string" },
|
|
14322
|
+
"originAt": { "type": "string", "format": "date-time" }
|
|
14323
|
+
}
|
|
14324
|
+
},
|
|
14000
14325
|
"PublicationMember": {
|
|
14001
14326
|
"type": "object",
|
|
14002
14327
|
"required": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x12i/memorix-service",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.2",
|
|
4
4
|
"description": "Memorix production service composition root — one versioned API over accepted packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"@x12i/funcx": "^4.12.0",
|
|
48
48
|
"@x12i/magit": "2.14.0",
|
|
49
49
|
"@x12i/memorix-connector-sdk": "^1.3.0",
|
|
50
|
-
"@x12i/memorix-data": "^3.0.
|
|
50
|
+
"@x12i/memorix-data": "^3.0.11",
|
|
51
51
|
"@x12i/memorix-data-journey": "^3.1.0",
|
|
52
|
-
"@x12i/memorix-format": "^3.0.
|
|
52
|
+
"@x12i/memorix-format": "^3.0.7",
|
|
53
53
|
"@x12i/memorix-intelligence": "^3.0.2",
|
|
54
54
|
"@x12i/memorix-mapping": "^3.0.2",
|
|
55
55
|
"@x12i/memorix-memory": "^3.2.1",
|
|
56
56
|
"@x12i/memorix-metadata": "^3.3.0",
|
|
57
57
|
"@x12i/memorix-metadata-runtime": "^3.2.0",
|
|
58
|
-
"@x12i/memorix-pipeline": "^3.3.
|
|
58
|
+
"@x12i/memorix-pipeline": "^3.3.1",
|
|
59
59
|
"@x12i/memorix-pipeline-runtime": "^3.1.1",
|
|
60
60
|
"@x12i/memorix-relationship-store": "^3.0.5",
|
|
61
61
|
"@x12i/memorix-relationships": "^3.1.0",
|