@x12i/memorix-scoper-sdk 2.1.0 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x12i/memorix-scoper-sdk",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "Trusted Memorix Scoper data SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "tag": "latest"
23
23
  },
24
24
  "dependencies": {
25
- "@x12i/memorix-client": "^3.13.0",
25
+ "@x12i/memorix-client": "^3.13.1",
26
26
  "zod": "^3.25.76",
27
27
  "@x12i/memorix-scoper-contracts": "2.0.0"
28
28
  },
@@ -1,32 +0,0 @@
1
- export declare const NEXUM_PERSIST_CONTRACT = "memorix-nexum-persist/1";
2
- /**
3
- * Production decoder remains unavailable until these locked artifacts exist:
4
- * - docs/nexum-persistence-schema.md
5
- * - docs/fixtures/nexum-persist-roundtrip.json
6
- * Searched x12i org; neither file nor the string `memorix-nexum-persist` was found.
7
- */
8
- export declare const NEXUM_PERSIST_DECODER_AVAILABLE = false;
9
- export type MinimalNexumPersistRecord = {
10
- format?: string;
11
- recordId: string;
12
- objectType?: string;
13
- contentType?: string;
14
- data: {
15
- serviceId: string;
16
- contractVersion: typeof NEXUM_PERSIST_CONTRACT;
17
- [key: string]: unknown;
18
- };
19
- _system?: Record<string, unknown>;
20
- };
21
- export declare function assertNexumPersistDecoderAvailable(): void;
22
- /**
23
- * Structural envelope gate used only after normative schema is unlocked.
24
- * Does NOT invent domain fields. Currently blocked via assertNexumPersistDecoderAvailable().
25
- */
26
- export declare function decodeNexumPersist(raw: unknown): MinimalNexumPersistRecord;
27
- /**
28
- * @internal TEST/scaffold only — not a substitute for the missing normative schema.
29
- * Rejects unknown contract versions; does not claim full memorix-nexum-persist/1 compliance.
30
- */
31
- export declare function decodeNexumPersistEnvelopeUnchecked(raw: unknown): MinimalNexumPersistRecord;
32
- //# sourceMappingURL=decoders.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decoders.d.ts","sourceRoot":"","sources":["../src/decoders.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,QAAQ,CAAC;AAErD,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,OAAO,sBAAsB,CAAC;QAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF,wBAAgB,kCAAkC,IAAI,IAAI,CAczD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,yBAAyB,CAG1E;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CAAC,GAAG,EAAE,OAAO,GAAG,yBAAyB,CAoC3F"}
package/dist/decoders.js DELETED
@@ -1,65 +0,0 @@
1
- import { ScoperError } from "@x12i/memorix-scoper-contracts";
2
- export const NEXUM_PERSIST_CONTRACT = "memorix-nexum-persist/1";
3
- /**
4
- * Production decoder remains unavailable until these locked artifacts exist:
5
- * - docs/nexum-persistence-schema.md
6
- * - docs/fixtures/nexum-persist-roundtrip.json
7
- * Searched x12i org; neither file nor the string `memorix-nexum-persist` was found.
8
- */
9
- export const NEXUM_PERSIST_DECODER_AVAILABLE = false;
10
- export function assertNexumPersistDecoderAvailable() {
11
- if (!NEXUM_PERSIST_DECODER_AVAILABLE) {
12
- throw new ScoperError("UPSTREAM_CONTRACT_MISMATCH", "memorix-nexum-persist/1 decoder unavailable: normative schema/fixtures are not locked under contracts/upstream", {
13
- requiredArtifacts: [
14
- "docs/nexum-persistence-schema.md",
15
- "docs/fixtures/nexum-persist-roundtrip.json",
16
- ],
17
- contractId: NEXUM_PERSIST_CONTRACT,
18
- });
19
- }
20
- }
21
- /**
22
- * Structural envelope gate used only after normative schema is unlocked.
23
- * Does NOT invent domain fields. Currently blocked via assertNexumPersistDecoderAvailable().
24
- */
25
- export function decodeNexumPersist(raw) {
26
- assertNexumPersistDecoderAvailable();
27
- return decodeNexumPersistEnvelopeUnchecked(raw);
28
- }
29
- /**
30
- * @internal TEST/scaffold only — not a substitute for the missing normative schema.
31
- * Rejects unknown contract versions; does not claim full memorix-nexum-persist/1 compliance.
32
- */
33
- export function decodeNexumPersistEnvelopeUnchecked(raw) {
34
- if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
35
- throw new ScoperError("UPSTREAM_CONTRACT_MISMATCH", "Nexum persist record must be an object");
36
- }
37
- const rec = raw;
38
- const data = rec.data;
39
- if (!data || typeof data !== "object" || Array.isArray(data)) {
40
- throw new ScoperError("UPSTREAM_CONTRACT_MISMATCH", "Missing data object on Nexum persist record");
41
- }
42
- const d = data;
43
- const version = d.contractVersion;
44
- if (version !== NEXUM_PERSIST_CONTRACT) {
45
- throw new ScoperError("UNSUPPORTED_CONTRACT_VERSION", `Unsupported contractVersion: ${String(version)}`, { expected: NEXUM_PERSIST_CONTRACT, actual: version });
46
- }
47
- if (typeof d.serviceId !== "string" || !d.serviceId.trim()) {
48
- throw new ScoperError("UPSTREAM_CONTRACT_MISMATCH", "data.serviceId must be a non-empty string");
49
- }
50
- const recordId = String(rec.recordId ?? rec.id ?? "").trim();
51
- if (!recordId) {
52
- throw new ScoperError("UPSTREAM_CONTRACT_MISMATCH", "recordId is required");
53
- }
54
- return {
55
- format: typeof rec.format === "string" ? rec.format : undefined,
56
- recordId,
57
- objectType: typeof rec.objectType === "string" ? rec.objectType : undefined,
58
- contentType: typeof rec.contentType === "string" ? rec.contentType : undefined,
59
- data: d,
60
- _system: rec._system && typeof rec._system === "object" && !Array.isArray(rec._system)
61
- ? rec._system
62
- : undefined,
63
- };
64
- }
65
- //# sourceMappingURL=decoders.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decoders.js","sourceRoot":"","sources":["../src/decoders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,yBAAyB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,KAAK,CAAC;AAerD,MAAM,UAAU,kCAAkC;IAChD,IAAI,CAAC,+BAA+B,EAAE,CAAC;QACrC,MAAM,IAAI,WAAW,CACnB,4BAA4B,EAC5B,gHAAgH,EAChH;YACE,iBAAiB,EAAE;gBACjB,kCAAkC;gBAClC,4CAA4C;aAC7C;YACD,UAAU,EAAE,sBAAsB;SACnC,CACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC7C,kCAAkC,EAAE,CAAC;IACrC,OAAO,mCAAmC,CAAC,GAAG,CAAC,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mCAAmC,CAAC,GAAY;IAC9D,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,WAAW,CAAC,4BAA4B,EAAE,wCAAwC,CAAC,CAAC;IAChG,CAAC;IACD,MAAM,GAAG,GAAG,GAA8B,CAAC;IAC3C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACtB,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAA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