@x12i/memorix-descriptors 0.1.0 → 1.1.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/README.md +386 -41
- package/dist/admin/create-admin.d.ts +5 -2
- package/dist/admin/create-admin.d.ts.map +1 -1
- package/dist/admin/create-admin.js +19 -4
- package/dist/admin/create-admin.js.map +1 -1
- package/dist/audit/log.d.ts +17 -0
- package/dist/audit/log.d.ts.map +1 -0
- package/dist/audit/log.js +12 -0
- package/dist/audit/log.js.map +1 -0
- package/dist/catalog/ensure-catalogs.d.ts +3 -0
- package/dist/catalog/ensure-catalogs.d.ts.map +1 -0
- package/dist/catalog/ensure-catalogs.js +32 -0
- package/dist/catalog/ensure-catalogs.js.map +1 -0
- package/dist/catalox/client.d.ts.map +1 -1
- package/dist/catalox/client.js +22 -1
- package/dist/catalox/client.js.map +1 -1
- package/dist/catalox/version.d.ts +8 -0
- package/dist/catalox/version.d.ts.map +1 -0
- package/dist/catalox/version.js +33 -0
- package/dist/catalox/version.js.map +1 -0
- package/dist/cli/index.js +319 -89
- package/dist/cli/index.js.map +1 -1
- package/dist/collections/mongo-create.d.ts +6 -0
- package/dist/collections/mongo-create.d.ts.map +1 -0
- package/dist/collections/mongo-create.js +20 -0
- package/dist/collections/mongo-create.js.map +1 -0
- package/dist/collections/resolve.d.ts +1 -2
- package/dist/collections/resolve.d.ts.map +1 -1
- package/dist/collections/resolve.js +24 -19
- package/dist/collections/resolve.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/mutations/common.d.ts +4 -1
- package/dist/mutations/common.d.ts.map +1 -1
- package/dist/mutations/common.js +5 -2
- package/dist/mutations/common.js.map +1 -1
- package/dist/mutations/content-type.d.ts.map +1 -1
- package/dist/mutations/content-type.js +24 -17
- package/dist/mutations/content-type.js.map +1 -1
- package/dist/mutations/entity.d.ts.map +1 -1
- package/dist/mutations/entity.js +30 -30
- package/dist/mutations/entity.js.map +1 -1
- package/dist/mutations/execute.d.ts +19 -0
- package/dist/mutations/execute.d.ts.map +1 -0
- package/dist/mutations/execute.js +131 -0
- package/dist/mutations/execute.js.map +1 -0
- package/dist/mutations/item.d.ts.map +1 -1
- package/dist/mutations/item.js +23 -17
- package/dist/mutations/item.js.map +1 -1
- package/dist/mutations/list.d.ts.map +1 -1
- package/dist/mutations/list.js +23 -17
- package/dist/mutations/list.js.map +1 -1
- package/dist/mutations/mapping.d.ts.map +1 -1
- package/dist/mutations/mapping.js +23 -17
- package/dist/mutations/mapping.js.map +1 -1
- package/dist/mutations/property.d.ts.map +1 -1
- package/dist/mutations/property.js +25 -36
- package/dist/mutations/property.js.map +1 -1
- package/dist/mutations/relation.d.ts.map +1 -1
- package/dist/mutations/relation.js +23 -26
- package/dist/mutations/relation.js.map +1 -1
- package/dist/mutations/rename-entity.d.ts +11 -0
- package/dist/mutations/rename-entity.d.ts.map +1 -0
- package/dist/mutations/rename-entity.js +181 -0
- package/dist/mutations/rename-entity.js.map +1 -0
- package/dist/reconcile/index.d.ts +8 -0
- package/dist/reconcile/index.d.ts.map +1 -1
- package/dist/reconcile/index.js +67 -2
- package/dist/reconcile/index.js.map +1 -1
- package/dist/tests/fixtures.d.ts +54 -0
- package/dist/tests/fixtures.d.ts.map +1 -0
- package/dist/tests/fixtures.js +79 -0
- package/dist/tests/fixtures.js.map +1 -0
- package/dist/tests/helpers/live.d.ts +7 -0
- package/dist/tests/helpers/live.d.ts.map +1 -0
- package/dist/tests/helpers/live.js +31 -0
- package/dist/tests/helpers/live.js.map +1 -0
- package/dist/tests/integrity.test.d.ts +2 -0
- package/dist/tests/integrity.test.d.ts.map +1 -0
- package/dist/tests/integrity.test.js +49 -0
- package/dist/tests/integrity.test.js.map +1 -0
- package/dist/tests/live/catalox.live.test.d.ts +2 -0
- package/dist/tests/live/catalox.live.test.d.ts.map +1 -0
- package/dist/tests/live/catalox.live.test.js +110 -0
- package/dist/tests/live/catalox.live.test.js.map +1 -0
- package/dist/tests/mutations.test.d.ts +2 -0
- package/dist/tests/mutations.test.d.ts.map +1 -0
- package/dist/tests/mutations.test.js +99 -0
- package/dist/tests/mutations.test.js.map +1 -0
- package/dist/tests/seeds.test.d.ts +2 -0
- package/dist/tests/seeds.test.d.ts.map +1 -0
- package/dist/tests/seeds.test.js +57 -0
- package/dist/tests/seeds.test.js.map +1 -0
- package/dist/tests/setup.d.ts +2 -0
- package/dist/tests/setup.d.ts.map +1 -0
- package/dist/tests/setup.js +6 -0
- package/dist/tests/setup.js.map +1 -0
- package/dist/tests/validation.test.js +3 -62
- package/dist/tests/validation.test.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -2,95 +2,440 @@
|
|
|
2
2
|
|
|
3
3
|
Write-side control plane for Memorix entity, list, and item descriptors — plus content types, collections, relations, and completion mappings — stored in Catalox and consumed by `@x12i/memorix-retrieval`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Role in the ecosystem
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Hosts (Explorer Admin, CI, CLI, internal tools)
|
|
9
|
+
│
|
|
10
|
+
▼
|
|
11
|
+
@x12i/memorix-descriptors ← validate, mutate, seed, reconcile (this package)
|
|
12
|
+
│
|
|
13
|
+
├─ write ──► @x12i/catalox (descriptor catalogs)
|
|
14
|
+
│
|
|
15
|
+
└─ read / inventory ──► @x12i/memorix-retrieval (+ optional @x12i/xronox)
|
|
16
|
+
```
|
|
6
17
|
|
|
7
18
|
| Concern | Package |
|
|
8
19
|
|--------|---------|
|
|
9
|
-
| Load descriptors, compose lists/items, graph,
|
|
20
|
+
| Load descriptors, compose lists/items, graph, runtime reads | `@x12i/memorix-retrieval` |
|
|
10
21
|
| Create/update/delete descriptors and mappings in Catalox | `@x12i/memorix-descriptors` |
|
|
22
|
+
| Write Memorix payload documents to Mongo | `@x12i/memorix-completion` |
|
|
23
|
+
|
|
24
|
+
Canonical contracts: [`docs/MEMORIX-CATALOX-CONTRACTS.md`](docs/MEMORIX-CATALOX-CONTRACTS.md), [`docs/MEMORIX-DATABASE-CONVENTIONS.md`](docs/MEMORIX-DATABASE-CONVENTIONS.md).
|
|
11
25
|
|
|
12
|
-
|
|
26
|
+
---
|
|
13
27
|
|
|
14
28
|
## Install
|
|
15
29
|
|
|
16
30
|
```bash
|
|
17
|
-
npm install @x12i/memorix-descriptors @x12i/catalox @x12i/memorix-retrieval
|
|
31
|
+
npm install @x12i/memorix-descriptors @x12i/catalox @x12i/memorix-retrieval
|
|
32
|
+
# Optional, for Mongo inventory / reconcile:
|
|
33
|
+
npm install @x12i/xronox
|
|
18
34
|
```
|
|
19
35
|
|
|
36
|
+
Peer dependencies: `@x12i/catalox` ≥5, `@x12i/memorix-retrieval` ≥1.6, `@x12i/xronox` ≥3.9 (optional).
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
20
40
|
## Bootstrap
|
|
21
41
|
|
|
42
|
+
### From a bound Catalox client
|
|
43
|
+
|
|
22
44
|
```typescript
|
|
23
45
|
import { bindCataloxContext, createCataloxFromEnv } from "@x12i/catalox/firebase";
|
|
24
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
createMemorixDescriptorAdmin,
|
|
48
|
+
resolveMemorixAppId,
|
|
49
|
+
} from "@x12i/memorix-descriptors";
|
|
25
50
|
|
|
26
51
|
const { catalox } = createCataloxFromEnv();
|
|
27
52
|
const bound = bindCataloxContext(catalox, {
|
|
28
|
-
appId: resolveMemorixAppId(),
|
|
53
|
+
appId: resolveMemorixAppId(), // CATALOX_APP_ID → MEMORIX_APP_ID → "memorix"
|
|
29
54
|
actor: { type: "service", id: "memorix-descriptors" },
|
|
30
55
|
superAdmin: true,
|
|
31
56
|
});
|
|
32
57
|
|
|
33
|
-
const admin = createMemorixDescriptorAdmin({
|
|
58
|
+
const admin = createMemorixDescriptorAdmin({
|
|
59
|
+
catalox: bound,
|
|
60
|
+
processEnv: process.env,
|
|
61
|
+
});
|
|
34
62
|
```
|
|
35
63
|
|
|
36
|
-
|
|
64
|
+
### From environment
|
|
37
65
|
|
|
38
66
|
```typescript
|
|
39
67
|
import { createMemorixDescriptorAdminFromEnv } from "@x12i/memorix-descriptors";
|
|
40
68
|
|
|
41
69
|
const admin = await createMemorixDescriptorAdminFromEnv();
|
|
70
|
+
// Uses GOOGLE_SERVICE_ACCOUNT_BASE64 / ADC for Catalox
|
|
71
|
+
// Uses MONGO_URI + Xronox when set (for reconcile / ensureCollection)
|
|
42
72
|
```
|
|
43
73
|
|
|
44
|
-
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Memorix targets
|
|
77
|
+
|
|
78
|
+
Descriptors are scoped to a **target** (Mongo database role):
|
|
79
|
+
|
|
80
|
+
| Target | Default DB | Identity field | Typical use |
|
|
81
|
+
|--------|------------|----------------|-------------|
|
|
82
|
+
| `entity` | `memorix-entities` | `entityId` | Stable domain objects (assets, groups) |
|
|
83
|
+
| `event` | `memorix-events` | `eventId` | Detections, timeline (vulnerabilities) |
|
|
84
|
+
| `knowledge` | `memorix-knowledge` | `knowledgeId` | Narratives, playbooks, curated facts |
|
|
85
|
+
|
|
86
|
+
This package accepts `target: "knowledge"` on entity descriptors and mappings. Full ecosystem support (retrieval discovery, Xronox presets, env keys) is coordinated via a separate contract bump across packages.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Catalox catalogs
|
|
91
|
+
|
|
92
|
+
Do not introduce parallel catalog ids (per contracts).
|
|
93
|
+
|
|
94
|
+
| Catalog id | Descriptor type | Managed by |
|
|
95
|
+
|------------|-----------------|------------|
|
|
96
|
+
| `memorix-entity-descriptors` | Entity descriptor | ✅ |
|
|
97
|
+
| `memorix-list-descriptors` | List descriptor (entity + workspace) | ✅ |
|
|
98
|
+
| `memorix-item-descriptors` | Item descriptor | ✅ |
|
|
99
|
+
| `memorix-completion-mappings` | Completion source → target maps | ✅ (optional catalog; missing catalog is treated as empty) |
|
|
100
|
+
|
|
101
|
+
App id: `memorix` (override via `CATALOX_APP_ID` / `MEMORIX_APP_ID`).
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## `MemorixDescriptorAdmin` API
|
|
106
|
+
|
|
107
|
+
All mutating methods accept `DescriptorMutationOptions` and return `DescriptorMutationResult<T>`.
|
|
108
|
+
|
|
109
|
+
### Mutation options
|
|
110
|
+
|
|
111
|
+
| Option | Description |
|
|
112
|
+
|--------|-------------|
|
|
113
|
+
| `dryRun` | Validate + build projected graph; no Catalox write |
|
|
114
|
+
| `skipMongo` | Skip collection inventory / ensure steps |
|
|
115
|
+
| `scope` | Catalox seed scope (`domains`, `agents`) merged into item data |
|
|
116
|
+
| `allowCreateCollection` | When `true` and Xronox is configured, report `create-required` for missing collections (does not move data) |
|
|
117
|
+
| `cascade` | Property/relation removal updates list/item field sets (default `true`) |
|
|
118
|
+
| `force` | Hard delete / ignore default list-item guards |
|
|
119
|
+
| `mode` | `soft` \| `hard` for `removeEntityDescriptor` |
|
|
120
|
+
| `reason` | Reserved for audit trail (not persisted yet) |
|
|
121
|
+
| `expectedVersion` | Reserved for optimistic concurrency (not enforced yet) |
|
|
122
|
+
|
|
123
|
+
### Mutation result
|
|
45
124
|
|
|
46
125
|
```typescript
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
console.log(result.cataloxWrites, result.integrity);
|
|
126
|
+
{
|
|
127
|
+
ok: boolean; // false if validation/integrity errors on the projected graph
|
|
128
|
+
dryRun: boolean;
|
|
129
|
+
data?: T;
|
|
130
|
+
warnings: string[];
|
|
131
|
+
errors: Array<{ code: string; message: string; path?: string }>;
|
|
132
|
+
cataloxWrites: Array<{ catalogId; itemId; action: "create"|"update"|"delete" }>;
|
|
133
|
+
mongoActions?: Array<{ action; database; collection }>;
|
|
134
|
+
integrity: DescriptorIntegrityReport;
|
|
135
|
+
rollbackPlan?: CataloxWriteAction[]; // reserved — not populated on failed writes yet
|
|
136
|
+
}
|
|
60
137
|
```
|
|
61
138
|
|
|
139
|
+
Every mutation validates against a **projected** full descriptor graph (in-memory) before writing.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### Integrity & graph
|
|
144
|
+
|
|
145
|
+
| Method | Description |
|
|
146
|
+
|--------|-------------|
|
|
147
|
+
| `validateMemorixDescriptors()` | Load all catalogs + run referential integrity |
|
|
148
|
+
| `getDescriptorGraph()` | Nodes/edges: entities, lists, items, mappings, relations |
|
|
149
|
+
| `getDescriptorGraphMermaid()` | Mermaid diagram string |
|
|
150
|
+
| `loadSnapshot()` | Raw `DescriptorSnapshot` from Catalox |
|
|
151
|
+
|
|
152
|
+
**Integrity checks include:** default list/item ids exist; list fields ⊆ entity properties with `humanReadable: true`; item fields human-readable; content types on properties/lists/items; relation targets; mapping `targetCollection` / `entityType`; forbidden `process.env` in descriptor JSON; dangling relation references.
|
|
153
|
+
|
|
154
|
+
Also exported: `validateDescriptorSnapshot`, `buildDescriptorGraph`, `descriptorGraphToMermaid`.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
### Entity descriptors
|
|
159
|
+
|
|
160
|
+
| Method | Description |
|
|
161
|
+
|--------|-------------|
|
|
162
|
+
| `registerEntityDescriptor(input)` | Create entity + default `{entity}-main-list` + `{entity}-detail-item` (atomic logical transaction) |
|
|
163
|
+
| `updateEntityDescriptor(entityName, patch)` | Patch defaults, identity, content types, etc. **Cannot** rename `entityName` / `id` |
|
|
164
|
+
| `removeEntityDescriptor(entityName, options?)` | `soft` (default): deprecated flags; `hard` + `force`: delete entity + default list/item |
|
|
165
|
+
|
|
166
|
+
`registerEntityDescriptor` input: `entityName`, `target`, `collectionPrefix`, `canonicalContentType`, optional `identity`, `initialProperties`, `scope`.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### Content types & collections
|
|
171
|
+
|
|
172
|
+
Content types live under `entityDescriptor.contentTypes` (each resolves to a Mongo collection).
|
|
173
|
+
|
|
174
|
+
| Method | Description |
|
|
175
|
+
|--------|-------------|
|
|
176
|
+
| `addContentType(entityName, input)` | Add key; at most one `isCanonical: true` |
|
|
177
|
+
| `updateContentType(entityName, key, patch)` | Patch postfix, collection, canonical flag, etc. |
|
|
178
|
+
| `removeContentType(entityName, key)` | Fails if referenced by properties, lists, items, relations, or sole canonical |
|
|
179
|
+
| `resolveCollection(entityName, contentTypeKey)` | Same resolution order as retrieval (explicit → env → `{prefix}-{postfix}`) |
|
|
180
|
+
| `ensureCollection(entityName, contentTypeKey)` | Inventory via Xronox `listCollections` |
|
|
181
|
+
| `planCollectionRename(entityName, contentTypeKey, newName)` | Migration plan only (no data move) |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
### Properties
|
|
186
|
+
|
|
187
|
+
| Method | Description |
|
|
188
|
+
|--------|-------------|
|
|
189
|
+
| `addProperty(entityName, key, property, options?)` | Validates `source.contentType`; optional `addToDefaultList` / `addToDefaultItem` |
|
|
190
|
+
| `updateProperty(entityName, key, patch)` | Merge patch |
|
|
191
|
+
| `removeProperty(entityName, key, options?)` | Cascades out of list `fields[]` and item `sections[].fields[]` unless `cascade: false`; fails if used in relation join paths |
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
### List descriptors
|
|
196
|
+
|
|
197
|
+
| Method | Description |
|
|
198
|
+
|--------|-------------|
|
|
199
|
+
| `createListDescriptor(input)` | Entity list (`kind` omitted or `"entity"`) or workspace list (`kind: "workspace"`) |
|
|
200
|
+
| `updateListDescriptor(id, patch)` | |
|
|
201
|
+
| `removeListDescriptor(id)` | Blocked if still entity default unless `force` |
|
|
202
|
+
| `setEntityDefaultList(entityName, listDescriptorId)` | Wire `defaultListDescriptorId` with referential checks |
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### Item descriptors
|
|
207
|
+
|
|
208
|
+
| Method | Description |
|
|
209
|
+
|--------|-------------|
|
|
210
|
+
| `createItemDescriptor(input)` | |
|
|
211
|
+
| `updateItemDescriptor(id, patch)` | |
|
|
212
|
+
| `removeItemDescriptor(id)` | Blocked if still entity default unless `force` |
|
|
213
|
+
| `setEntityDefaultItem(entityName, itemDescriptorId)` | |
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### Relations
|
|
218
|
+
|
|
219
|
+
Relations live on the **source** entity descriptor under `relations`.
|
|
220
|
+
|
|
221
|
+
| Method | Description |
|
|
222
|
+
|--------|-------------|
|
|
223
|
+
| `addRelation(sourceEntity, relationKey, descriptor)` | Validates target entity + content types |
|
|
224
|
+
| `updateRelation(sourceEntity, relationKey, patch)` | |
|
|
225
|
+
| `removeRelation(sourceEntity, relationKey, options?)` | Cascades `includeRelations` on list/item unless `cascade: false` |
|
|
226
|
+
|
|
227
|
+
`RelationInput`: `targetEntity`, `type`, `source`/`target` `{ contentType, path }`, optional `defaultMode`, `defaultArrayProperty`, `targetFields`.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
### Completion mappings
|
|
232
|
+
|
|
233
|
+
| Method | Description |
|
|
234
|
+
|--------|-------------|
|
|
235
|
+
| `registerMapping(input)` | Cross-validates `entityType`, `target`, `targetCollection`, field paths |
|
|
236
|
+
| `updateMapping(id, patch)` | |
|
|
237
|
+
| `removeMapping(id)` | |
|
|
238
|
+
|
|
239
|
+
Shape: `MemorixCompletionMapping` (see `src/types/index.ts` and `MEMORIX-DATABASE-CONVENTIONS.md`).
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
### Seed import / export
|
|
244
|
+
|
|
245
|
+
Compatible with `@x12i/memorix-retrieval` `catalox-seeds/inputs/` layout:
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
catalox-seeds/inputs/
|
|
249
|
+
entity-descriptors/*.json
|
|
250
|
+
list-descriptors/*.json
|
|
251
|
+
item-descriptors/*.json
|
|
252
|
+
mapping-descriptors/*.json # optional
|
|
253
|
+
scope.json
|
|
254
|
+
manifest.json # written on export
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
| Method | Description |
|
|
258
|
+
|--------|-------------|
|
|
259
|
+
| `buildDescriptorSeedManifest(scope?)` | Build manifest from current Catalox snapshot |
|
|
260
|
+
| `exportDescriptorSeedInputs(dir, scope?)` | Write inputs layout to disk |
|
|
261
|
+
| `importDescriptorSeedInputs(dir, { dryRun?, scope? })` | Validate + upsert |
|
|
262
|
+
| `applyDescriptorSeedManifest(manifest, { dryRun?, force? })` | Upsert manifest items (scope merged into data) |
|
|
263
|
+
|
|
264
|
+
Uses `mergeSeedItemScopeIntoUpsertData` from `@x12i/memorix-retrieval` for apply shape.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
### Mongo reconciliation
|
|
269
|
+
|
|
270
|
+
| Method | Description |
|
|
271
|
+
|--------|-------------|
|
|
272
|
+
| `reconcileDescriptorsWithMongo()` | Uses `buildMemorixCollectionInventory` from retrieval |
|
|
273
|
+
|
|
274
|
+
Returns `inventory` + `suggestions`:
|
|
275
|
+
|
|
276
|
+
- `ensure-collection` — declared in descriptors, missing in Mongo
|
|
277
|
+
- `empty-declared-collection` — declared but zero documents
|
|
278
|
+
- `create-descriptor-for-orphan` — Mongo collection with no descriptor
|
|
279
|
+
|
|
280
|
+
Descriptors in Catalox remain schema truth; orphans are **suggestions** only (`autoRegisterOrphans` not implemented).
|
|
281
|
+
|
|
282
|
+
Requires `MONGO_URI` and Xronox when calling `createMemorixDescriptorAdminFromEnv`.
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
62
286
|
## CLI
|
|
63
287
|
|
|
288
|
+
Binary: `memorix-descriptors` (after `npm run build`).
|
|
289
|
+
|
|
290
|
+
| Command | Status |
|
|
291
|
+
|---------|--------|
|
|
292
|
+
| `validate` | ✅ |
|
|
293
|
+
| `reconcile` | ✅ (needs Xronox / `MONGO_URI`) |
|
|
294
|
+
| `graph [--format mermaid]` | ✅ |
|
|
295
|
+
| `entity register --file <json> [--dry-run]` | ✅ |
|
|
296
|
+
| `content-type add <entity> <key> --postfix <p> [--dry-run]` | ✅ |
|
|
297
|
+
| `list create --file <json> [--dry-run]` | ✅ |
|
|
298
|
+
| `list update <id> --file <json> [--dry-run]` | ✅ |
|
|
299
|
+
| `item update <id> --file <json> [--dry-run]` | ✅ |
|
|
300
|
+
| `mapping register --file <json> [--dry-run]` | ✅ |
|
|
301
|
+
| `seed export <dir>` | ✅ |
|
|
302
|
+
| `seed import <dir> [--dry-run]` | ✅ |
|
|
303
|
+
|
|
304
|
+
**Library-only today** (use `MemorixDescriptorAdmin` directly): entity update/remove, property CRUD, content-type update/remove, list/item create/remove, relation CRUD, mapping update/remove, `ensureCollection`, etc.
|
|
305
|
+
|
|
64
306
|
```bash
|
|
65
307
|
npx memorix-descriptors validate
|
|
66
|
-
npx memorix-descriptors reconcile
|
|
67
308
|
npx memorix-descriptors graph --format mermaid
|
|
68
309
|
npx memorix-descriptors entity register --file ./new-entity.json --dry-run
|
|
69
310
|
npx memorix-descriptors seed export ./catalox-seeds/inputs
|
|
70
311
|
npx memorix-descriptors seed import ./catalox-seeds/inputs --dry-run
|
|
71
312
|
```
|
|
72
313
|
|
|
73
|
-
|
|
314
|
+
---
|
|
74
315
|
|
|
75
|
-
|
|
76
|
-
|-----------|---------|
|
|
77
|
-
| `memorix-entity-descriptors` | Entity schema root |
|
|
78
|
-
| `memorix-list-descriptors` | Tabular views |
|
|
79
|
-
| `memorix-item-descriptors` | Record detail layouts |
|
|
80
|
-
| `memorix-completion-mappings` | Source → Memorix payload maps |
|
|
316
|
+
## Explorer / host integration
|
|
81
317
|
|
|
82
|
-
|
|
318
|
+
| UI surface | API |
|
|
319
|
+
|------------|-----|
|
|
320
|
+
| Entity graph canvas | `getDescriptorGraph`, `reconcileDescriptorsWithMongo` |
|
|
321
|
+
| Add entity wizard | `registerEntityDescriptor` |
|
|
322
|
+
| Column / field editor | `addProperty`, `updateListDescriptor` |
|
|
323
|
+
| Detail layout editor | `updateItemDescriptor` |
|
|
324
|
+
| Collection health | `reconcileDescriptorsWithMongo` |
|
|
325
|
+
| Mapping editor | `registerMapping` |
|
|
326
|
+
| Knowledge tab | Filter entities where `target === "knowledge"` |
|
|
83
327
|
|
|
84
|
-
|
|
85
|
-
- **Phase 2:** list/item/relation hardening, cascade rules
|
|
86
|
-
- **Phase 3:** mapping catalog + Mongo reconcile
|
|
87
|
-
- **Phase 4:** knowledge target contract bump across ecosystem
|
|
88
|
-
- **Phase 5:** rename/migrate, audit log, CI seed validation
|
|
328
|
+
Hosts should **read** via `@x12i/memorix-retrieval` and **write** only through this package.
|
|
89
329
|
|
|
90
|
-
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Validation utilities (exported)
|
|
333
|
+
|
|
334
|
+
Re-exported / extended validators (aligned with retrieval rules, plus `knowledge` target):
|
|
91
335
|
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
336
|
+
- `validateMemorixEntityDescriptor`, `validateMemorixListDescriptor`, `validateMemorixEntityListDescriptor`, `validateMemorixItemDescriptor`
|
|
337
|
+
- `validatePropertyDescriptor`, `assertListFieldsHumanReadable`
|
|
338
|
+
- `defaultListDescriptorId`, `defaultItemDescriptorId`, `singularizeEntityName`, `isKebabCase`
|
|
339
|
+
- `DescriptorValidationError`
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## Environment variables
|
|
344
|
+
|
|
345
|
+
See [`.env.example`](.env.example).
|
|
346
|
+
|
|
347
|
+
| Variable | Purpose |
|
|
348
|
+
|----------|---------|
|
|
349
|
+
| `GOOGLE_SERVICE_ACCOUNT_BASE64` | Catalox / Firestore (recommended) |
|
|
350
|
+
| `FIREBASE_PROJECT_ID`, `FIRESTORE_DATABASE_ID` | Firestore |
|
|
351
|
+
| `CATALOX_APP_ID` / `MEMORIX_APP_ID` | App namespace (default `memorix`) |
|
|
352
|
+
| `MONGO_URI` | Xronox for reconcile / `ensureCollection` |
|
|
353
|
+
| `MEMORIX_ENTITIES_DB`, `MEMORIX_EVENTS_DB`, `MEMORIX_KNOWLEDGE_DB` | DB names |
|
|
354
|
+
| `MEMORIX_*_COLLECTION_<ENTITY>` | Per-entity collection overrides |
|
|
355
|
+
| `FIRESTORE_LIVE_TESTS=1` | Enable live integration tests |
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
## Tests
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
npm test # unit tests only (no Firestore)
|
|
363
|
+
npm run test:live # integration tests (reads .env, needs FIRESTORE_LIVE_TESTS=1)
|
|
364
|
+
npm run test:all # both
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Live tests: Firestore connectivity, validate deployed graph, load smoke entity (`MEMORIX_SMOKE_ENTITY`, default `assets`), catalog listing, graph, collection resolve, dry-run `addProperty`. Reconcile live test requires `MONGO_URI`.
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## Gap analysis (spec vs implementation)
|
|
372
|
+
|
|
373
|
+
### Implemented ✅
|
|
374
|
+
|
|
375
|
+
| Area | Coverage |
|
|
376
|
+
|------|----------|
|
|
377
|
+
| Bootstrap | `createMemorixDescriptorAdmin`, `createMemorixDescriptorAdminFromEnv` |
|
|
378
|
+
| Entity lifecycle | Register (atomic list+item), update, soft/hard remove |
|
|
379
|
+
| Content types | Add, update, remove with referential guards |
|
|
380
|
+
| Collections | Resolve, ensure (inventory), rename **plan** |
|
|
381
|
+
| Properties | Add, update, remove with list/item cascade |
|
|
382
|
+
| List / item descriptors | Full CRUD + set default list/item |
|
|
383
|
+
| Relations | Add, update, remove with list/item cascade |
|
|
384
|
+
| Mappings | CRUD + cross-validation (`memorix-completion-mappings`) |
|
|
385
|
+
| Integrity engine | Full-graph validation, dangling refs, forbidden patterns |
|
|
386
|
+
| Descriptor graph | Build + Mermaid export |
|
|
387
|
+
| Seeds | Export/import/manifest; compatible with retrieval inputs layout |
|
|
388
|
+
| Reconcile | Inventory + suggestions; `autoRegisterOrphans`, `allowCreateCollection` (native Mongo `createCollection`) |
|
|
389
|
+
| Dry-run | All mutations |
|
|
390
|
+
| Targets | `entity`, `event`, `knowledge` in types and entity validation |
|
|
391
|
+
| Transactions | `executeCataloxWrites` — compensating rollback on mid-batch Catalox failure; `rollbackPlan` on success |
|
|
392
|
+
| Audit | JSONL via `MEMORIX_DESCRIPTORS_AUDIT_LOG` or per-mutation `reason` |
|
|
393
|
+
| Concurrency | `expectedVersion` optimistic check on Catalox updates |
|
|
394
|
+
| Rename | `renameEntityDescriptor(from, to)` with optional deprecated source |
|
|
395
|
+
| Catalog bootstrap | `ensureMemorixDescriptorCatalogs` on `createMemorixDescriptorAdminFromEnv` |
|
|
396
|
+
| CLI | Full CRUD for entity, content-type, property, list, item, relation, mapping + reconcile flags |
|
|
397
|
+
| CI seeds | `npm run validate:seeds` + GitHub workflow |
|
|
398
|
+
| Tests | Unit + live Catalox suite |
|
|
399
|
+
|
|
400
|
+
### Partial ⚠️
|
|
401
|
+
|
|
402
|
+
| Item | Notes |
|
|
403
|
+
|------|------|
|
|
404
|
+
| Mutation `ok` vs `graphValid` | `ok` = Catalox write succeeded; `graphValid` = projected snapshot passes integrity (legacy graphs may differ) |
|
|
405
|
+
| `ensureCollection` via Xronox | Still inventory-only when using Xronox adapter; reconcile/create uses native `mongodb` driver |
|
|
406
|
+
| Completion mappings catalog | Gracefully empty if catalog not seeded in Catalox yet |
|
|
407
|
+
| Retrieval seed npm scripts | Still owned by `@x12i/memorix-retrieval`; this package provides equivalent CLI `seed` commands |
|
|
408
|
+
| Impact report command | Use `validateMemorixDescriptors` + dry-run `removeEntityDescriptor` |
|
|
409
|
+
|
|
410
|
+
### Not implemented yet ❌
|
|
411
|
+
|
|
412
|
+
| Item | Notes |
|
|
413
|
+
|------|------|
|
|
414
|
+
| Standalone `impact-report` CLI subcommand | Compose validation + dry-run helpers manually today |
|
|
415
|
+
|
|
416
|
+
### Explicit non-goals (v1)
|
|
417
|
+
|
|
418
|
+
- Writing Memorix **payload** documents (stays in `@x12i/memorix-completion`)
|
|
419
|
+
- Replacing Catalox storage or building Explorer UI
|
|
420
|
+
- Runtime list/item composition (stays in `@x12i/memorix-retrieval`)
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
## Implementation status by phase
|
|
425
|
+
|
|
426
|
+
| Phase | Focus | Status |
|
|
427
|
+
|-------|--------|--------|
|
|
428
|
+
| **1** | Bootstrap, validation, entity/content/property CRUD, seeds, dry-run | ✅ Done |
|
|
429
|
+
| **2** | List/item/relation CRUD, cascades, graph | ✅ Done |
|
|
430
|
+
| **3** | Mappings catalog, Mongo reconcile | ✅ Done |
|
|
431
|
+
| **4** | Knowledge target across ecosystem | ✅ Descriptors + retrieval inventory/graph |
|
|
432
|
+
| **5** | Rename/migrate, audit, rollback, CLI parity, CI seeds | ✅ Done (impact-report CLI optional) |
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Related packages
|
|
95
437
|
|
|
96
|
-
|
|
438
|
+
- **@x12i/memorix-retrieval** — read/composition layer (discover, fetchList, fetchItem, collection inventory)
|
|
439
|
+
- **@x12i/catalox** — descriptor storage and native catalog APIs
|
|
440
|
+
- **@x12i/memorix-completion** — Memorix payload document writes (not descriptors)
|
|
441
|
+
- **@x12i/xronox** — optional Mongo inventory for reconcile and `ensureCollection`
|
|
@@ -2,6 +2,7 @@ import type { XronoxLike } from "@x12i/memorix-retrieval";
|
|
|
2
2
|
import type { CataloxBoundClient } from "../catalox/client.js";
|
|
3
3
|
import type { ContentTypeInput, DescriptorMutationOptions, MemorixCompletionMapping, PropertyInput, RegisterEntityDescriptorInput } from "../types/index.js";
|
|
4
4
|
import { registerEntityDescriptor, removeEntityDescriptor, updateEntityDescriptor } from "../mutations/entity.js";
|
|
5
|
+
import { renameEntityDescriptor } from "../mutations/rename-entity.js";
|
|
5
6
|
import { addContentType, ensureCollection, planCollectionRename, removeContentType, resolveCollection, updateContentType } from "../mutations/content-type.js";
|
|
6
7
|
import { addProperty, removeProperty, updateProperty } from "../mutations/property.js";
|
|
7
8
|
import { createListDescriptor, removeListDescriptor, setEntityDefaultList, updateListDescriptor } from "../mutations/list.js";
|
|
@@ -9,7 +10,7 @@ import { createItemDescriptor, removeItemDescriptor, setEntityDefaultItem, updat
|
|
|
9
10
|
import { addRelation, removeRelation, updateRelation, type RelationInput } from "../mutations/relation.js";
|
|
10
11
|
import { registerMapping, removeMapping, updateMapping } from "../mutations/mapping.js";
|
|
11
12
|
import { applyDescriptorSeedManifest, importDescriptorSeedInputs, type DescriptorSeedManifest } from "../seeds/index.js";
|
|
12
|
-
import {
|
|
13
|
+
import { type ReconcileDescriptorsOptions, type ReconcileDescriptorsResult } from "../reconcile/index.js";
|
|
13
14
|
export type CreateMemorixDescriptorAdminOptions = {
|
|
14
15
|
catalox: CataloxBoundClient;
|
|
15
16
|
xronox?: XronoxLike;
|
|
@@ -25,6 +26,7 @@ export type MemorixDescriptorAdmin = {
|
|
|
25
26
|
registerEntityDescriptor(input: RegisterEntityDescriptorInput, options?: DescriptorMutationOptions): ReturnType<typeof registerEntityDescriptor>;
|
|
26
27
|
updateEntityDescriptor(entityName: string, patch: Partial<Record<string, unknown>>, options?: DescriptorMutationOptions): ReturnType<typeof updateEntityDescriptor>;
|
|
27
28
|
removeEntityDescriptor(entityName: string, options?: DescriptorMutationOptions): ReturnType<typeof removeEntityDescriptor>;
|
|
29
|
+
renameEntityDescriptor(from: string, to: string, options?: import("../mutations/rename-entity.js").RenameEntityDescriptorOptions): ReturnType<typeof renameEntityDescriptor>;
|
|
28
30
|
addContentType(entityName: string, input: ContentTypeInput, options?: DescriptorMutationOptions): ReturnType<typeof addContentType>;
|
|
29
31
|
updateContentType(entityName: string, key: string, patch: Partial<ContentTypeInput>, options?: DescriptorMutationOptions): ReturnType<typeof updateContentType>;
|
|
30
32
|
removeContentType(entityName: string, key: string, options?: DescriptorMutationOptions): ReturnType<typeof removeContentType>;
|
|
@@ -61,7 +63,8 @@ export type MemorixDescriptorAdmin = {
|
|
|
61
63
|
dryRun?: boolean;
|
|
62
64
|
force?: boolean;
|
|
63
65
|
}): ReturnType<typeof applyDescriptorSeedManifest>;
|
|
64
|
-
reconcileDescriptorsWithMongo():
|
|
66
|
+
reconcileDescriptorsWithMongo(options?: Omit<ReconcileDescriptorsOptions, "catalox" | "appId" | "processEnv" | "xronox">): Promise<ReconcileDescriptorsResult>;
|
|
67
|
+
ensureMemorixDescriptorCatalogs(): Promise<string[]>;
|
|
65
68
|
loadSnapshot(): Promise<import("../types/index.js").DescriptorSnapshot>;
|
|
66
69
|
};
|
|
67
70
|
export declare function createMemorixDescriptorAdmin(options: CreateMemorixDescriptorAdminOptions): MemorixDescriptorAdmin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-admin.d.ts","sourceRoot":"","sources":["../../src/admin/create-admin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EACzB,wBAAwB,EACxB,aAAa,EACb,6BAA6B,EAC9B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACd,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,EACd,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,2BAA2B,EAG3B,0BAA0B,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"create-admin.d.ts","sourceRoot":"","sources":["../../src/admin/create-admin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EACzB,wBAAwB,EACxB,aAAa,EACb,6BAA6B,EAC9B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,sBAA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0CAA+C,GACvD,OAAO,CAAC,sBAAsB,CAAC,CAgCjC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { resolveMemorixAppId } from "../catalog/ids.js";
|
|
2
2
|
import { loadDescriptorSnapshot } from "../store/snapshot.js";
|
|
3
3
|
import { registerEntityDescriptor, removeEntityDescriptor, updateEntityDescriptor, } from "../mutations/entity.js";
|
|
4
|
+
import { renameEntityDescriptor } from "../mutations/rename-entity.js";
|
|
5
|
+
import { ensureMemorixDescriptorCatalogs } from "../catalog/ensure-catalogs.js";
|
|
4
6
|
import { addContentType, ensureCollection, planCollectionRename, removeContentType, resolveCollection, updateContentType, } from "../mutations/content-type.js";
|
|
5
7
|
import { addProperty, removeProperty, updateProperty, } from "../mutations/property.js";
|
|
6
8
|
import { createListDescriptor, removeListDescriptor, setEntityDefaultList, updateListDescriptor, } from "../mutations/list.js";
|
|
@@ -10,7 +12,7 @@ import { registerMapping, removeMapping, updateMapping, } from "../mutations/map
|
|
|
10
12
|
import { validateMemorixDescriptors } from "../integrity/validate.js";
|
|
11
13
|
import { buildDescriptorGraph, descriptorGraphToMermaid } from "../integrity/graph.js";
|
|
12
14
|
import { applyDescriptorSeedManifest, buildDescriptorSeedManifest, exportDescriptorSeedInputsFromCatalox, importDescriptorSeedInputs, } from "../seeds/index.js";
|
|
13
|
-
import { reconcileDescriptorsWithMongo } from "../reconcile/index.js";
|
|
15
|
+
import { reconcileDescriptorsWithMongo, } from "../reconcile/index.js";
|
|
14
16
|
import { validateMemorixEntityDescriptor } from "../validation/descriptor-validation.js";
|
|
15
17
|
export function createMemorixDescriptorAdmin(options) {
|
|
16
18
|
const processEnv = options.processEnv ?? process.env;
|
|
@@ -33,6 +35,7 @@ export function createMemorixDescriptorAdmin(options) {
|
|
|
33
35
|
registerEntityDescriptor: (input, mutationOptions) => registerEntityDescriptor(ctx, input, mutationOptions),
|
|
34
36
|
updateEntityDescriptor: (entityName, patch, mutationOptions) => updateEntityDescriptor(ctx, entityName, patch, mutationOptions),
|
|
35
37
|
removeEntityDescriptor: (entityName, mutationOptions) => removeEntityDescriptor(ctx, entityName, mutationOptions),
|
|
38
|
+
renameEntityDescriptor: (from, to, mutationOptions) => renameEntityDescriptor(ctx, from, to, mutationOptions),
|
|
36
39
|
addContentType: (entityName, input, mutationOptions) => addContentType(ctx, entityName, input, mutationOptions),
|
|
37
40
|
updateContentType: (entityName, key, patch, mutationOptions) => updateContentType(ctx, entityName, key, patch, mutationOptions),
|
|
38
41
|
removeContentType: (entityName, key, mutationOptions) => removeContentType(ctx, entityName, key, mutationOptions),
|
|
@@ -69,7 +72,14 @@ export function createMemorixDescriptorAdmin(options) {
|
|
|
69
72
|
exportDescriptorSeedInputs: (dir, scope) => exportDescriptorSeedInputsFromCatalox(catalox, dir, scope),
|
|
70
73
|
importDescriptorSeedInputs: (dir, importOptions) => importDescriptorSeedInputs(catalox, dir, importOptions),
|
|
71
74
|
applyDescriptorSeedManifest: (manifest, applyOptions) => applyDescriptorSeedManifest(catalox, manifest, applyOptions),
|
|
72
|
-
reconcileDescriptorsWithMongo: () => reconcileDescriptorsWithMongo({
|
|
75
|
+
reconcileDescriptorsWithMongo: (reconcileOptions) => reconcileDescriptorsWithMongo({
|
|
76
|
+
catalox,
|
|
77
|
+
appId,
|
|
78
|
+
processEnv,
|
|
79
|
+
xronox: options.xronox,
|
|
80
|
+
...reconcileOptions,
|
|
81
|
+
}),
|
|
82
|
+
ensureMemorixDescriptorCatalogs: () => ensureMemorixDescriptorCatalogs(catalox),
|
|
73
83
|
};
|
|
74
84
|
}
|
|
75
85
|
export async function createMemorixDescriptorAdminFromEnv(options = {}) {
|
|
@@ -83,7 +93,8 @@ export async function createMemorixDescriptorAdminFromEnv(options = {}) {
|
|
|
83
93
|
superAdmin: true,
|
|
84
94
|
});
|
|
85
95
|
let xronox = options.xronox;
|
|
86
|
-
|
|
96
|
+
const mongoUri = processEnv.MONGO_URI?.trim();
|
|
97
|
+
if (!xronox && mongoUri) {
|
|
87
98
|
try {
|
|
88
99
|
const { createMemorixXronoxFromEnv } = await import("@x12i/memorix-retrieval");
|
|
89
100
|
xronox = await createMemorixXronoxFromEnv({ processEnv });
|
|
@@ -92,11 +103,15 @@ export async function createMemorixDescriptorAdminFromEnv(options = {}) {
|
|
|
92
103
|
xronox = undefined;
|
|
93
104
|
}
|
|
94
105
|
}
|
|
95
|
-
|
|
106
|
+
const admin = createMemorixDescriptorAdmin({
|
|
96
107
|
catalox: bound,
|
|
97
108
|
xronox,
|
|
98
109
|
appId,
|
|
99
110
|
processEnv,
|
|
100
111
|
});
|
|
112
|
+
if (processEnv.MEMORIX_ENSURE_DESCRIPTOR_CATALOGS === "1") {
|
|
113
|
+
await admin.ensureMemorixDescriptorCatalogs();
|
|
114
|
+
}
|
|
115
|
+
return admin;
|
|
101
116
|
}
|
|
102
117
|
//# sourceMappingURL=create-admin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-admin.js","sourceRoot":"","sources":["../../src/admin/create-admin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAS9D,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,GAEf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,qCAAqC,EACrC,0BAA0B,GAE3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"create-admin.js","sourceRoot":"","sources":["../../src/admin/create-admin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAS9D,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,GAEf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,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