@ixo/domain.md 0.3.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/LICENSE +201 -0
- package/NOTICE +6 -0
- package/README.md +30 -0
- package/assets/domain-md.schema.json +1103 -0
- package/assets/oracle-capsule-jcs-vectors.json +57 -0
- package/assets/oracle-capsule-manifest-contract.md +72 -0
- package/assets/oracle-capsule-source-lock.schema.json +45 -0
- package/assets/oracle-capsule.schema.json +265 -0
- package/assets/rules.json +275 -0
- package/assets/spec.md +1434 -0
- package/assets/template-manifest.schema.json +57 -0
- package/dist/capsule/index.d.ts +75 -0
- package/dist/capsule/index.js +20 -0
- package/dist/capsule/index.js.map +1 -0
- package/dist/chunk-BYBC2TSS.js +597 -0
- package/dist/chunk-BYBC2TSS.js.map +1 -0
- package/dist/chunk-G7PZJYAJ.js +31826 -0
- package/dist/chunk-G7PZJYAJ.js.map +1 -0
- package/dist/chunk-R6QZRNEX.js +164 -0
- package/dist/chunk-R6QZRNEX.js.map +1 -0
- package/dist/chunk-T3STBWXP.js +46 -0
- package/dist/chunk-T3STBWXP.js.map +1 -0
- package/dist/chunk-W7MRQP7I.js +862 -0
- package/dist/chunk-W7MRQP7I.js.map +1 -0
- package/dist/chunk-XDIWMZVF.js +1150 -0
- package/dist/chunk-XDIWMZVF.js.map +1 -0
- package/dist/cli-KcUIQEiE.d.ts +171 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +400 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/dist/resolver-B3mwnjJq.d.ts +96 -0
- package/dist/spec.d.ts +20 -0
- package/dist/spec.js +23 -0
- package/dist/spec.js.map +1 -0
- package/dist/templates/index.d.ts +7 -0
- package/dist/templates/index.js +24 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/workers-Dr8B8a2O.d.ts +19 -0
- package/dist/workers.d.ts +3 -0
- package/dist/workers.js +31 -0
- package/dist/workers.js.map +1 -0
- package/package.json +97 -0
- package/src/capsule/canonical.ts +74 -0
- package/src/capsule/index.ts +10 -0
- package/src/capsule/json.ts +373 -0
- package/src/capsule/types.ts +63 -0
- package/src/capsule/validate.ts +551 -0
- package/src/cli.ts +405 -0
- package/src/compiled-validators.d.ts +7 -0
- package/src/compiled-validators.js +32512 -0
- package/src/constants.ts +250 -0
- package/src/diff.ts +111 -0
- package/src/export.ts +28 -0
- package/src/index.ts +36 -0
- package/src/lint.ts +42 -0
- package/src/parser.ts +174 -0
- package/src/sarif.ts +49 -0
- package/src/semantic.ts +1156 -0
- package/src/spec.ts +48 -0
- package/src/templates/errors.ts +3 -0
- package/src/templates/index.ts +11 -0
- package/src/templates/manifest.ts +94 -0
- package/src/templates/render.ts +435 -0
- package/src/templates/resolver.ts +200 -0
- package/src/templates/types.ts +98 -0
- package/src/types.ts +195 -0
- package/src/workers.ts +6 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "urn:ixo:domain-md:template-manifest-schema:1.0.0-rc.3",
|
|
4
|
+
"title": "domain.md protocol template manifest",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["version", "kind", "protocol", "protocol_version", "bundles"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"version": { "const": "1.0.0-rc.3" },
|
|
9
|
+
"kind": { "const": "domain.md/template-manifest" },
|
|
10
|
+
"protocol": { "type": "string", "pattern": "^did:[a-z0-9]+:[^\\s]+$" },
|
|
11
|
+
"protocol_version": { "type": "string", "minLength": 1 },
|
|
12
|
+
"bundles": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"minItems": 1,
|
|
15
|
+
"items": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"required": ["derived_type", "bundle_version", "files"],
|
|
18
|
+
"properties": {
|
|
19
|
+
"derived_type": {
|
|
20
|
+
"enum": ["dao", "organisation", "project", "asset", "deed", "investment", "oracle", "service", "dataset", "device", "place", "portfolio", "marketplace", "pod", "claim_collection", "custom"]
|
|
21
|
+
},
|
|
22
|
+
"bundle_version": { "type": "string", "minLength": 1 },
|
|
23
|
+
"files": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"minItems": 1,
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"required": ["role", "path", "media_type", "max_bytes", "required"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"role": {
|
|
31
|
+
"enum": ["domain.md", "description", "changelog", "manifest", "playbook", "schema", "resource", "policy", "supporting"]
|
|
32
|
+
},
|
|
33
|
+
"path": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"pattern": "^templates/[a-z0-9][a-z0-9_-]*/(?:[a-zA-Z0-9._-]+/)*[a-zA-Z0-9._-]+\\.tmpl$"
|
|
36
|
+
},
|
|
37
|
+
"media_type": { "enum": ["text/markdown", "application/yaml", "application/json", "text/plain"] },
|
|
38
|
+
"max_bytes": { "type": "integer", "minimum": 1, "maximum": 2097152 },
|
|
39
|
+
"uri": { "type": "string", "pattern": "^(https|ipfs)://[^\\s]+$" },
|
|
40
|
+
"cid": { "type": ["string", "null"], "pattern": "^b[a-z2-7]{10,}$" },
|
|
41
|
+
"sha256": { "type": ["string", "null"], "pattern": "^[a-f0-9]{64}$" },
|
|
42
|
+
"required": { "type": "boolean" }
|
|
43
|
+
},
|
|
44
|
+
"anyOf": [
|
|
45
|
+
{ "required": ["cid"], "properties": { "cid": { "type": "string" } } },
|
|
46
|
+
{ "required": ["sha256"], "properties": { "sha256": { "type": "string" } } }
|
|
47
|
+
],
|
|
48
|
+
"additionalProperties": false
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"additionalProperties": false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"additionalProperties": false
|
|
57
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { F as Finding, u as SourceLocation } from '../cli-KcUIQEiE.js';
|
|
2
|
+
|
|
3
|
+
type JsonPrimitive = null | boolean | number | string;
|
|
4
|
+
type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
interface StrictJsonOptions {
|
|
8
|
+
sourceName?: string;
|
|
9
|
+
maxBytes?: number;
|
|
10
|
+
maxDepth?: number;
|
|
11
|
+
maxNodes?: number;
|
|
12
|
+
maxScalarLength?: number;
|
|
13
|
+
}
|
|
14
|
+
interface StrictJsonDocument {
|
|
15
|
+
value: JsonValue;
|
|
16
|
+
raw: string;
|
|
17
|
+
sourceName: string;
|
|
18
|
+
locations: ReadonlyMap<string, SourceLocation>;
|
|
19
|
+
}
|
|
20
|
+
interface StrictJsonResult {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
document?: StrictJsonDocument;
|
|
23
|
+
findings: Finding[];
|
|
24
|
+
}
|
|
25
|
+
type CapsuleExternalCheckCategory = 'identity' | 'authorization' | 'time' | 'privacy' | 'review' | 'distribution' | 'signer';
|
|
26
|
+
interface CapsuleExternalCheck {
|
|
27
|
+
code: string;
|
|
28
|
+
category: CapsuleExternalCheckCategory;
|
|
29
|
+
reason: string;
|
|
30
|
+
}
|
|
31
|
+
interface CapsuleValidationOptions extends StrictJsonOptions {
|
|
32
|
+
expectedIdentity?: {
|
|
33
|
+
cid: string;
|
|
34
|
+
sha256: string;
|
|
35
|
+
bytes?: number;
|
|
36
|
+
};
|
|
37
|
+
sourceLock?: string | Uint8Array;
|
|
38
|
+
lockedFiles?: Readonly<Record<string, string | Uint8Array>>;
|
|
39
|
+
}
|
|
40
|
+
interface CapsuleValidationReport {
|
|
41
|
+
tool: '@ixo/domain.md';
|
|
42
|
+
contract: 'ixo.earth/oracle-capsule/v0alpha1';
|
|
43
|
+
sourceName: string;
|
|
44
|
+
status: 'static-pass' | 'fail';
|
|
45
|
+
ok: boolean;
|
|
46
|
+
findings: Finding[];
|
|
47
|
+
externalChecksRequired: CapsuleExternalCheck[];
|
|
48
|
+
manifest?: JsonValue;
|
|
49
|
+
}
|
|
50
|
+
interface JcsGoldenVector {
|
|
51
|
+
name: string;
|
|
52
|
+
input: string;
|
|
53
|
+
canonical?: string;
|
|
54
|
+
sha256?: string;
|
|
55
|
+
errorCode?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare class CapsuleCanonicalizationError extends Error {
|
|
59
|
+
readonly code = "capsule-canonicalization";
|
|
60
|
+
}
|
|
61
|
+
/** RFC 8785 JCS serialization for already parsed I-JSON-compatible values. */
|
|
62
|
+
declare function canonicalizeCapsuleJson(value: JsonValue): string;
|
|
63
|
+
declare function capsuleJcsSha256(value: JsonValue): string;
|
|
64
|
+
/**
|
|
65
|
+
* Release digests omit only metadata.release_digest, the one self-referential
|
|
66
|
+
* field. Exact fetched-byte SHA/CID verification remains a separate operation.
|
|
67
|
+
*/
|
|
68
|
+
declare function oracleCapsuleReleaseProjection(value: JsonValue): JsonValue;
|
|
69
|
+
declare function oracleCapsuleReleaseDigest(value: JsonValue): string;
|
|
70
|
+
|
|
71
|
+
declare function parseCapsuleJson(input: string | Uint8Array, options?: StrictJsonOptions): StrictJsonResult;
|
|
72
|
+
|
|
73
|
+
declare function validateOracleCapsule(input: string | Uint8Array, options?: CapsuleValidationOptions): CapsuleValidationReport;
|
|
74
|
+
|
|
75
|
+
export { CapsuleCanonicalizationError, type CapsuleExternalCheck, type CapsuleExternalCheckCategory, type CapsuleValidationOptions, type CapsuleValidationReport, type JcsGoldenVector, type JsonPrimitive, type JsonValue, type StrictJsonDocument, type StrictJsonOptions, type StrictJsonResult, canonicalizeCapsuleJson, capsuleJcsSha256, oracleCapsuleReleaseDigest, oracleCapsuleReleaseProjection, parseCapsuleJson, validateOracleCapsule };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CapsuleCanonicalizationError,
|
|
3
|
+
canonicalizeCapsuleJson,
|
|
4
|
+
capsuleJcsSha256,
|
|
5
|
+
oracleCapsuleReleaseDigest,
|
|
6
|
+
oracleCapsuleReleaseProjection,
|
|
7
|
+
parseCapsuleJson,
|
|
8
|
+
validateOracleCapsule
|
|
9
|
+
} from "../chunk-W7MRQP7I.js";
|
|
10
|
+
import "../chunk-G7PZJYAJ.js";
|
|
11
|
+
export {
|
|
12
|
+
CapsuleCanonicalizationError,
|
|
13
|
+
canonicalizeCapsuleJson,
|
|
14
|
+
capsuleJcsSha256,
|
|
15
|
+
oracleCapsuleReleaseDigest,
|
|
16
|
+
oracleCapsuleReleaseProjection,
|
|
17
|
+
parseCapsuleJson,
|
|
18
|
+
validateOracleCapsule
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|