@x12i/memorix-format 3.0.0 → 3.0.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/CHANGELOG.md +8 -0
- package/README.md +33 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@x12i/memorix-format`
|
|
2
2
|
|
|
3
3
|
Canonical **memorix-record/2** validation, migration, and CLI for Memorix.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|---|---|
|
|
7
|
-
| `validateMemorixRecordV2`, CLI `validate-v2` / `migrate-to-v2` | **Current** SoT for platform work |
|
|
8
|
-
| Present-envelope helpers | Migration/compat only |
|
|
9
|
-
|
|
10
|
-
Object types belong in **agent metadata**, not in this package.
|
|
5
|
+
Object / content **types** belong in agent metadata — this package is the **envelope** SoT (shape of every stored subject content document), not product vocabulary.
|
|
11
6
|
|
|
12
7
|
## Install
|
|
13
8
|
|
|
14
9
|
```bash
|
|
15
|
-
npm install @x12i/memorix-format
|
|
10
|
+
npm install @x12i/memorix-format@3.0.2
|
|
16
11
|
```
|
|
17
12
|
|
|
13
|
+
| Audience | Use this package? |
|
|
14
|
+
|----------|-------------------|
|
|
15
|
+
| Remote app | Optional — validate offline / in CI |
|
|
16
|
+
| Platform / writers / pipelines | **Yes** |
|
|
17
|
+
|
|
18
|
+
## API status
|
|
19
|
+
|
|
20
|
+
| API | Status |
|
|
21
|
+
|-----|--------|
|
|
22
|
+
| `validateMemorixRecordV2`, CLI `validate-v2` / `migrate-to-v2` | **Current** SoT for platform work |
|
|
23
|
+
| Present-envelope helpers | Migration / compat only |
|
|
24
|
+
|
|
25
|
+
**Exports:** `.` · `./validate` · `./profiles` · `./types` · `./v2`
|
|
26
|
+
|
|
18
27
|
## Quick V2 example
|
|
19
28
|
|
|
20
29
|
```json
|
|
@@ -46,15 +55,24 @@ npx memorix-format migrate-to-v2 ./present.json \
|
|
|
46
55
|
--object-type=work-items --content-type=snapshots --data-category=entity
|
|
47
56
|
```
|
|
48
57
|
|
|
49
|
-
|
|
58
|
+
```ts
|
|
59
|
+
import { validateMemorixRecordV2 } from "@x12i/memorix-format/v2";
|
|
50
60
|
|
|
51
|
-
|
|
52
|
-
|
|
61
|
+
const result = validateMemorixRecordV2(doc);
|
|
62
|
+
if (!result.ok) throw new Error(result.errors.join("; "));
|
|
63
|
+
```
|
|
53
64
|
|
|
54
|
-
|
|
65
|
+
## Hard rules (format)
|
|
55
66
|
|
|
56
|
-
V2 rejects copied related-record payloads
|
|
67
|
+
- V2 rejects **copied** related-record payloads in the document.
|
|
68
|
+
- Authoritative navigation between subjects is **four-field relationship links** (`@x12i/memorix-relationships`), not embedded `associated*`.
|
|
57
69
|
|
|
58
|
-
|
|
70
|
+
## Docs
|
|
59
71
|
|
|
60
|
-
|
|
72
|
+
- [`docs/memorix-record-v2.md`](./docs/memorix-record-v2.md) · [`meta/`](./meta/)
|
|
73
|
+
- Ebook: [Format for Dummies](../new-ebooks/01-format-for-dummies/)
|
|
74
|
+
- Hub: [https://ebooks.memorix.x12i.com](https://ebooks.memorix.x12i.com)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm test
|
|
78
|
+
```
|
package/package.json
CHANGED