@midnight-ntwrk/credential-model 0.1.0-rc2 → 0.2.0-rc1
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 +19 -0
- package/README.md +50 -52
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +5 -38
- package/dist/types.d.ts.map +1 -1
- package/dist/validation.d.ts +3 -4
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +51 -133
- package/dist/validation.js.map +1 -1
- package/package.json +4 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this package are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.2.0 - 2026-09-18
|
|
6
|
+
|
|
7
|
+
- Accept untyped credential-family input through an assertion boundary and
|
|
8
|
+
report field-specific `CredentialModelError` failures.
|
|
9
|
+
- Enforce SemVer 2.0 syntax for family and schema versions, including strict
|
|
10
|
+
prerelease and build identifiers.
|
|
11
|
+
- Preserve literal inference for source-authored definitions and expand the
|
|
12
|
+
descriptor validation matrix.
|
|
13
|
+
- BREAKING: reduce the public API to generic credential-family, schema, and
|
|
14
|
+
claim metadata with its validation helper.
|
|
15
|
+
- Add optional human-readable names and descriptions to family and schema
|
|
16
|
+
descriptors.
|
|
17
|
+
- Remove capability and proof-artifact descriptors, package-composition
|
|
18
|
+
manifests, codec ports, and their validators.
|
|
19
|
+
- Remove semantic profile, deployment assembly, provider catalog, runtime family
|
|
20
|
+
discovery, and aggregate business-decision APIs. Applications and credential
|
|
21
|
+
family repositories own those concerns outside this core package.
|
|
22
|
+
- Remove error codes used only by the retired high-level resolvers.
|
|
23
|
+
|
|
5
24
|
## 0.1.0-rc1 - 2026-07-26
|
|
6
25
|
|
|
7
26
|
- Add protocol-neutral credential-family definitions.
|
package/README.md
CHANGED
|
@@ -4,18 +4,9 @@
|
|
|
4
4
|
> Package class: `dist`
|
|
5
5
|
> Release stage: `supported`
|
|
6
6
|
|
|
7
|
-
Protocol-neutral TypeScript
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
The package provides:
|
|
12
|
-
|
|
13
|
-
- schema and claim descriptors;
|
|
14
|
-
- holder-binding, status, proof, and presentation capability descriptors;
|
|
15
|
-
- credential and presentation codec ports;
|
|
16
|
-
- proof-artifact requirements;
|
|
17
|
-
- bounded package composition manifests;
|
|
18
|
-
- validation helpers and family-neutral errors.
|
|
7
|
+
Protocol-neutral TypeScript metadata for describing and validating a credential
|
|
8
|
+
family and its claim schema. The package does not describe runtime composition,
|
|
9
|
+
deployment, proof artifacts, or encoding.
|
|
19
10
|
|
|
20
11
|
## Install
|
|
21
12
|
|
|
@@ -26,41 +17,32 @@ pnpm add @midnight-ntwrk/credential-model@rc
|
|
|
26
17
|
The first public release line is pre-1.0. Pin an exact version when a
|
|
27
18
|
credential-family repository requires reproducible builds.
|
|
28
19
|
|
|
29
|
-
##
|
|
20
|
+
## Public API
|
|
30
21
|
|
|
31
|
-
|
|
32
|
-
import {
|
|
33
|
-
defineCredentialFamily,
|
|
34
|
-
type CredentialCodec,
|
|
35
|
-
type PresentationCodec,
|
|
36
|
-
} from "@midnight-ntwrk/credential-model";
|
|
22
|
+
The package exports:
|
|
37
23
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
- credential-family, schema, and claim descriptors;
|
|
25
|
+
- `defineCredentialFamily(...)`;
|
|
26
|
+
- `assertCredentialFamilyDefinition(value: unknown)`, which narrows valid input
|
|
27
|
+
to `CredentialFamilyDefinition`;
|
|
28
|
+
- `CredentialModelError` and the bounded validation error-code union.
|
|
41
29
|
|
|
42
|
-
|
|
43
|
-
employeeId: string;
|
|
44
|
-
}
|
|
30
|
+
It has zero runtime dependencies.
|
|
45
31
|
|
|
46
|
-
|
|
47
|
-
mediaType: "application/json",
|
|
48
|
-
encode: JSON.stringify,
|
|
49
|
-
decode: (value) => JSON.parse(value) as EmployeeCredential,
|
|
50
|
-
};
|
|
32
|
+
## Define a family
|
|
51
33
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
encode: JSON.stringify,
|
|
55
|
-
decode: (value) => JSON.parse(value) as EmployeePresentation,
|
|
56
|
-
};
|
|
34
|
+
```ts
|
|
35
|
+
import { defineCredentialFamily } from "@midnight-ntwrk/credential-model";
|
|
57
36
|
|
|
58
37
|
export const employeeFamily = defineCredentialFamily({
|
|
59
38
|
id: "example.employee",
|
|
60
39
|
version: "0.1.0",
|
|
40
|
+
name: "Employee credential",
|
|
41
|
+
description: "Identifies an employee within an organization.",
|
|
61
42
|
schema: {
|
|
62
43
|
id: "urn:example:employee",
|
|
63
44
|
version: "1.0.0",
|
|
45
|
+
name: "Employee credential schema",
|
|
64
46
|
credentialTypes: ["VerifiableCredential", "EmployeeCredential"],
|
|
65
47
|
claims: [
|
|
66
48
|
{
|
|
@@ -71,27 +53,43 @@ export const employeeFamily = defineCredentialFamily({
|
|
|
71
53
|
},
|
|
72
54
|
],
|
|
73
55
|
},
|
|
74
|
-
capabilities: [],
|
|
75
|
-
artifacts: [],
|
|
76
|
-
composition: {
|
|
77
|
-
formatVersion: 1,
|
|
78
|
-
packages: [],
|
|
79
|
-
},
|
|
80
|
-
credentialCodec,
|
|
81
|
-
presentationCodec,
|
|
82
56
|
});
|
|
83
57
|
```
|
|
84
58
|
|
|
85
|
-
`defineCredentialFamily` validates descriptor identifiers, semantic
|
|
86
|
-
|
|
87
|
-
|
|
59
|
+
`defineCredentialFamily(...)` validates descriptor identifiers, semantic
|
|
60
|
+
versions, optional display metadata, credential types, claim paths, disclosure
|
|
61
|
+
modes, required flags, and unique claim IDs. Versions follow SemVer 2.0 syntax.
|
|
62
|
+
The helper preserves the inferred type of source-authored definitions.
|
|
63
|
+
|
|
64
|
+
Use the assertion function for JSON, configuration, or other untyped input:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import {
|
|
68
|
+
assertCredentialFamilyDefinition,
|
|
69
|
+
type CredentialFamilyDefinition,
|
|
70
|
+
} from "@midnight-ntwrk/credential-model";
|
|
71
|
+
|
|
72
|
+
export const parseFamily = (value: unknown): CredentialFamilyDefinition => {
|
|
73
|
+
assertCredentialFamilyDefinition(value);
|
|
74
|
+
return value;
|
|
75
|
+
};
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Invalid input throws `CredentialModelError` with a stable error code and field
|
|
79
|
+
path. Validation is structural; applications remain responsible for policy and
|
|
80
|
+
business constraints beyond the generic descriptor model.
|
|
88
81
|
|
|
89
82
|
## Boundaries
|
|
90
83
|
|
|
91
|
-
This package
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
This package does not define codecs, credential or presentation payloads,
|
|
85
|
+
capabilities, proof artifacts, package composition, providers, deployments,
|
|
86
|
+
proof execution, status storage, DID resolution, exchange protocols, sessions,
|
|
87
|
+
display rendering, or business decisions. Credential-family repositories and
|
|
88
|
+
applications own those concerns.
|
|
89
|
+
|
|
90
|
+
Removed runtime and composition APIs have no compatibility shim. Consumers
|
|
91
|
+
should keep concrete configuration and behavior in their owning repository and
|
|
92
|
+
use this package only for generic family and claim-schema metadata.
|
|
95
93
|
|
|
96
94
|
## Compatibility and support
|
|
97
95
|
|
|
@@ -101,8 +99,8 @@ separate packages that depend on this model.
|
|
|
101
99
|
releases remain backward compatible within their minor line.
|
|
102
100
|
- Release candidates are supported only until a newer release candidate or
|
|
103
101
|
stable version in the same minor line is published.
|
|
104
|
-
- Deprecations, migrations, and known limitations are recorded in this
|
|
105
|
-
|
|
102
|
+
- Deprecations, migrations, and known limitations are recorded in this README
|
|
103
|
+
and [`CHANGELOG.md`](./CHANGELOG.md).
|
|
106
104
|
|
|
107
105
|
Technical ownership belongs to `@midnightntwrk/ex-identus`. Release operations
|
|
108
106
|
belong to `@midnightntwrk/mn-sre`. Security reports follow the repository
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type CredentialModelErrorCode = "INVALID_IDENTIFIER" | "INVALID_VERSION" | "INVALID_DESCRIPTOR" | "DUPLICATE_ID"
|
|
1
|
+
export type CredentialModelErrorCode = "INVALID_IDENTIFIER" | "INVALID_VERSION" | "INVALID_DESCRIPTOR" | "DUPLICATE_ID";
|
|
2
2
|
export declare class CredentialModelError extends Error {
|
|
3
3
|
readonly code: CredentialModelErrorCode;
|
|
4
4
|
readonly path: string;
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAChC,oBAAoB,GACpB,iBAAiB,GACjB,oBAAoB,GACpB,cAAc,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAChC,oBAAoB,GACpB,iBAAiB,GACjB,oBAAoB,GACpB,cAAc,CAAC;AAEnB,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAGpB,IAAI,EAAE,wBAAwB,EAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM;CAOlB"}
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAMA,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpC,IAAI,CAA2B;IAC/B,IAAI,CAAS;IAEtB,YACE,IAA8B,EAC9B,IAAY,EACZ,OAAe;QAEf,KAAK,CAAC,GAAG,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { CredentialModelError, type CredentialModelErrorCode, } from "./errors.js";
|
|
2
|
-
export type { ClaimDisclosure,
|
|
3
|
-
export {
|
|
2
|
+
export type { ClaimDisclosure, CredentialClaimDescriptor, CredentialFamilyDefinition, CredentialSchemaDescriptor, } from "./types.js";
|
|
3
|
+
export { assertCredentialFamilyDefinition, defineCredentialFamily, } from "./validation.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,KAAK,wBAAwB,GAC9B,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,KAAK,wBAAwB,GAC9B,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gCAAgC,EAChC,sBAAsB,GACvB,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { CredentialModelError, } from "./errors.js";
|
|
2
|
-
export {
|
|
2
|
+
export { assertCredentialFamilyDefinition, defineCredentialFamily, } from "./validation.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,GAErB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,GAErB,MAAM,aAAa,CAAC;AAOrB,OAAO,EACL,gCAAgC,EAChC,sBAAsB,GACvB,MAAM,iBAAiB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export type ClaimDisclosure = "public" | "selective" | "committed" | "predicate-only";
|
|
2
|
-
export type CredentialCapabilityKind = "holder-binding" | "status" | "proof" | "presentation";
|
|
3
2
|
export interface CredentialClaimDescriptor {
|
|
4
3
|
readonly id: string;
|
|
5
4
|
readonly path: readonly [string, ...string[]];
|
|
@@ -10,48 +9,16 @@ export interface CredentialClaimDescriptor {
|
|
|
10
9
|
export interface CredentialSchemaDescriptor {
|
|
11
10
|
readonly id: string;
|
|
12
11
|
readonly version: string;
|
|
12
|
+
readonly name?: string;
|
|
13
|
+
readonly description?: string;
|
|
13
14
|
readonly credentialTypes: readonly [string, ...string[]];
|
|
14
15
|
readonly claims: readonly CredentialClaimDescriptor[];
|
|
15
16
|
}
|
|
16
|
-
export interface
|
|
17
|
-
readonly id: string;
|
|
18
|
-
readonly kind: CredentialCapabilityKind;
|
|
19
|
-
readonly version?: string;
|
|
20
|
-
readonly required: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface ProofArtifactRequirement {
|
|
23
|
-
readonly id: string;
|
|
24
|
-
readonly mediaType: string;
|
|
25
|
-
readonly purpose: "prover" | "verifier" | "circuit" | "metadata";
|
|
26
|
-
readonly optional?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface CredentialPackageRequirement {
|
|
29
|
-
readonly name: string;
|
|
30
|
-
readonly version: string;
|
|
31
|
-
readonly exports?: readonly string[];
|
|
32
|
-
}
|
|
33
|
-
export interface CredentialCompositionManifest {
|
|
34
|
-
readonly formatVersion: 1;
|
|
35
|
-
readonly packages: readonly CredentialPackageRequirement[];
|
|
36
|
-
}
|
|
37
|
-
export interface CredentialCodec<TCredential, TEncoded = unknown> {
|
|
38
|
-
readonly mediaType: string;
|
|
39
|
-
encode(credential: TCredential): TEncoded;
|
|
40
|
-
decode(encoded: TEncoded): TCredential;
|
|
41
|
-
}
|
|
42
|
-
export interface PresentationCodec<TPresentation, TEncoded = unknown> {
|
|
43
|
-
readonly mediaType: string;
|
|
44
|
-
encode(presentation: TPresentation): TEncoded;
|
|
45
|
-
decode(encoded: TEncoded): TPresentation;
|
|
46
|
-
}
|
|
47
|
-
export interface CredentialFamilyDefinition<TCredential, TPresentation, TEncodedCredential = unknown, TEncodedPresentation = unknown> {
|
|
17
|
+
export interface CredentialFamilyDefinition {
|
|
48
18
|
readonly id: string;
|
|
49
19
|
readonly version: string;
|
|
20
|
+
readonly name?: string;
|
|
21
|
+
readonly description?: string;
|
|
50
22
|
readonly schema: CredentialSchemaDescriptor;
|
|
51
|
-
readonly capabilities: readonly CredentialCapabilityDescriptor[];
|
|
52
|
-
readonly artifacts: readonly ProofArtifactRequirement[];
|
|
53
|
-
readonly composition: CredentialCompositionManifest;
|
|
54
|
-
readonly credentialCodec: CredentialCodec<TCredential, TEncodedCredential>;
|
|
55
|
-
readonly presentationCodec: PresentationCodec<TPresentation, TEncodedPresentation>;
|
|
56
23
|
}
|
|
57
24
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR,WAAW,GACX,WAAW,GACX,gBAAgB,CAAC;AAErB,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR,WAAW,GACX,WAAW,GACX,gBAAgB,CAAC;AAErB,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IAC9C,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,SAAS,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IACzD,QAAQ,CAAC,MAAM,EAAE,SAAS,yBAAyB,EAAE,CAAC;CACvD;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;CAC7C"}
|
package/dist/validation.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const defineCredentialFamily: <TCredential, TPresentation, TEncodedCredential = unknown, TEncodedPresentation = unknown>(definition: CredentialFamilyDefinition<TCredential, TPresentation, TEncodedCredential, TEncodedPresentation>) => CredentialFamilyDefinition<TCredential, TPresentation, TEncodedCredential, TEncodedPresentation>;
|
|
1
|
+
import type { CredentialFamilyDefinition } from "./types.js";
|
|
2
|
+
export declare function assertCredentialFamilyDefinition(definition: unknown): asserts definition is CredentialFamilyDefinition;
|
|
3
|
+
export declare const defineCredentialFamily: <const Definition extends CredentialFamilyDefinition>(definition: Definition) => Definition;
|
|
5
4
|
//# sourceMappingURL=validation.d.ts.map
|
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AA4E7D,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,UAAU,IAAI,0BAA0B,CA2ElD;AAED,eAAO,MAAM,sBAAsB,GACjC,KAAK,CAAC,UAAU,SAAS,0BAA0B,EAEnD,YAAY,UAAU,KACrB,UAGF,CAAC"}
|
package/dist/validation.js
CHANGED
|
@@ -1,168 +1,86 @@
|
|
|
1
1
|
import { CredentialModelError } from "./errors.js";
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
2
|
+
const numericIdentifier = String.raw `(?:0|[1-9]\d*)`;
|
|
3
|
+
const nonNumericIdentifier = String.raw `(?:\d*[A-Za-z-][0-9A-Za-z-]*)`;
|
|
4
|
+
const prereleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`;
|
|
5
|
+
const semanticVersionPattern = new RegExp(`^${numericIdentifier}[.]${numericIdentifier}[.]${numericIdentifier}` +
|
|
6
|
+
`(?:-${prereleaseIdentifier}(?:[.]${prereleaseIdentifier})*)?` +
|
|
7
|
+
`(?:[+][0-9A-Za-z-]+(?:[.][0-9A-Za-z-]+)*)?$`, "u");
|
|
5
8
|
const claimDisclosures = new Set([
|
|
6
9
|
"public",
|
|
7
10
|
"selective",
|
|
8
11
|
"committed",
|
|
9
12
|
"predicate-only",
|
|
10
13
|
]);
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const artifactPurposes = new Set([
|
|
18
|
-
"prover",
|
|
19
|
-
"verifier",
|
|
20
|
-
"circuit",
|
|
21
|
-
"metadata",
|
|
22
|
-
]);
|
|
23
|
-
const assertIdentifier = (value, path) => {
|
|
14
|
+
function assertRecord(value, path, message = "must be an object") {
|
|
15
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
16
|
+
throw new CredentialModelError("INVALID_DESCRIPTOR", path, message);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function assertIdentifier(value, path) {
|
|
24
20
|
if (typeof value !== "string" || value.trim() !== value || value.length === 0) {
|
|
25
21
|
throw new CredentialModelError("INVALID_IDENTIFIER", path, "must be a non-empty trimmed string");
|
|
26
22
|
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (typeof value !== "string" ||
|
|
23
|
+
}
|
|
24
|
+
function assertVersion(value, path) {
|
|
25
|
+
if (typeof value !== "string" ||
|
|
26
|
+
value.trim() !== value ||
|
|
27
|
+
!semanticVersionPattern.test(value)) {
|
|
30
28
|
throw new CredentialModelError("INVALID_VERSION", path, "must be a semantic version");
|
|
31
29
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
throw new CredentialModelError("INVALID_DESCRIPTOR", `${path}[${index}]`, "must be an object");
|
|
38
|
-
}
|
|
39
|
-
const identified = value;
|
|
40
|
-
assertIdentifier(identified.id, `${path}[${index}].id`);
|
|
41
|
-
if (ids.has(identified.id)) {
|
|
42
|
-
throw new CredentialModelError("DUPLICATE_ID", `${path}[${index}].id`, `duplicates '${identified.id}'`);
|
|
43
|
-
}
|
|
44
|
-
ids.add(identified.id);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
export const assertCredentialCompositionManifest = (manifest) => {
|
|
48
|
-
if (typeof manifest !== "object" ||
|
|
49
|
-
manifest === null ||
|
|
50
|
-
manifest.formatVersion !== 1 ||
|
|
51
|
-
!Array.isArray(manifest.packages)) {
|
|
52
|
-
throw new CredentialModelError("INVALID_DESCRIPTOR", "composition", "must use formatVersion 1 and declare a packages array");
|
|
53
|
-
}
|
|
54
|
-
const packageNames = new Set();
|
|
55
|
-
for (const [index, requirement] of manifest.packages.entries()) {
|
|
56
|
-
const requirementPath = `composition.packages[${index}]`;
|
|
57
|
-
if (typeof requirement !== "object" || requirement === null) {
|
|
58
|
-
throw new CredentialModelError("INVALID_PACKAGE_REQUIREMENT", requirementPath, "must be an object");
|
|
59
|
-
}
|
|
60
|
-
if (typeof requirement.name !== "string" ||
|
|
61
|
-
!packageNamePattern.test(requirement.name)) {
|
|
62
|
-
throw new CredentialModelError("INVALID_PACKAGE_REQUIREMENT", `${requirementPath}.name`, "must be a valid npm package name");
|
|
63
|
-
}
|
|
64
|
-
if (/^(?:file|link|workspace|git|https?):/u.test(requirement.version) ||
|
|
65
|
-
!packageVersionPattern.test(requirement.version)) {
|
|
66
|
-
throw new CredentialModelError("INVALID_PACKAGE_REQUIREMENT", `${requirementPath}.version`, "must be a registry-resolvable exact or bounded semantic version");
|
|
67
|
-
}
|
|
68
|
-
if (packageNames.has(requirement.name)) {
|
|
69
|
-
throw new CredentialModelError("DUPLICATE_ID", `${requirementPath}.name`, `duplicates '${requirement.name}'`);
|
|
70
|
-
}
|
|
71
|
-
packageNames.add(requirement.name);
|
|
72
|
-
if (requirement.exports !== undefined &&
|
|
73
|
-
!Array.isArray(requirement.exports)) {
|
|
74
|
-
throw new CredentialModelError("INVALID_PACKAGE_REQUIREMENT", `${requirementPath}.exports`, "must be an array of explicit package export paths");
|
|
75
|
-
}
|
|
76
|
-
for (const [exportIndex, exportPath] of (requirement.exports ?? []).entries()) {
|
|
77
|
-
assertIdentifier(exportPath, `${requirementPath}.exports[${exportIndex}]`);
|
|
78
|
-
if (exportPath !== "." && !exportPath.startsWith("./")) {
|
|
79
|
-
throw new CredentialModelError("INVALID_PACKAGE_REQUIREMENT", `${requirementPath}.exports[${exportIndex}]`, "must be '.' or an explicit package subpath starting with './'");
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
export const assertCredentialFamilyDefinition = (definition) => {
|
|
85
|
-
if (typeof definition !== "object" ||
|
|
86
|
-
definition === null ||
|
|
87
|
-
typeof definition.schema !== "object" ||
|
|
88
|
-
definition.schema === null) {
|
|
89
|
-
throw new CredentialModelError("INVALID_DESCRIPTOR", "definition", "must declare a credential schema");
|
|
30
|
+
}
|
|
31
|
+
function assertOptionalText(value, path) {
|
|
32
|
+
if (value !== undefined &&
|
|
33
|
+
(typeof value !== "string" || value.trim() !== value || value.length === 0)) {
|
|
34
|
+
throw new CredentialModelError("INVALID_DESCRIPTOR", path, "must be a non-empty trimmed string when present");
|
|
90
35
|
}
|
|
36
|
+
}
|
|
37
|
+
export function assertCredentialFamilyDefinition(definition) {
|
|
38
|
+
assertRecord(definition, "definition");
|
|
91
39
|
assertIdentifier(definition.id, "id");
|
|
92
40
|
assertVersion(definition.version, "version");
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
41
|
+
assertOptionalText(definition.name, "name");
|
|
42
|
+
assertOptionalText(definition.description, "description");
|
|
43
|
+
assertRecord(definition.schema, "schema", "must declare a credential schema");
|
|
44
|
+
const schema = definition.schema;
|
|
45
|
+
assertIdentifier(schema.id, "schema.id");
|
|
46
|
+
assertVersion(schema.version, "schema.version");
|
|
47
|
+
assertOptionalText(schema.name, "schema.name");
|
|
48
|
+
assertOptionalText(schema.description, "schema.description");
|
|
49
|
+
if (!Array.isArray(schema.credentialTypes) || schema.credentialTypes.length === 0) {
|
|
97
50
|
throw new CredentialModelError("INVALID_DESCRIPTOR", "schema.credentialTypes", "must contain at least one credential type");
|
|
98
51
|
}
|
|
99
|
-
for (const [index, credentialType] of
|
|
52
|
+
for (const [index, credentialType] of schema.credentialTypes.entries()) {
|
|
100
53
|
assertIdentifier(credentialType, `schema.credentialTypes[${index}]`);
|
|
101
54
|
}
|
|
102
|
-
if (!Array.isArray(
|
|
55
|
+
if (!Array.isArray(schema.claims)) {
|
|
103
56
|
throw new CredentialModelError("INVALID_DESCRIPTOR", "schema.claims", "must be an array");
|
|
104
57
|
}
|
|
105
|
-
|
|
106
|
-
for (const [index, claim] of
|
|
58
|
+
const claimIds = new Set();
|
|
59
|
+
for (const [index, claim] of schema.claims.entries()) {
|
|
60
|
+
const claimPath = `schema.claims[${index}]`;
|
|
61
|
+
assertRecord(claim, claimPath);
|
|
62
|
+
assertIdentifier(claim.id, `${claimPath}.id`);
|
|
63
|
+
if (claimIds.has(claim.id)) {
|
|
64
|
+
throw new CredentialModelError("DUPLICATE_ID", `${claimPath}.id`, `duplicates '${claim.id}'`);
|
|
65
|
+
}
|
|
66
|
+
claimIds.add(claim.id);
|
|
107
67
|
if (!claimDisclosures.has(claim.disclosure)) {
|
|
108
|
-
throw new CredentialModelError("INVALID_DESCRIPTOR",
|
|
68
|
+
throw new CredentialModelError("INVALID_DESCRIPTOR", `${claimPath}.disclosure`, "must be public, selective, committed, or predicate-only");
|
|
109
69
|
}
|
|
110
70
|
if (typeof claim.required !== "boolean") {
|
|
111
|
-
throw new CredentialModelError("INVALID_DESCRIPTOR",
|
|
71
|
+
throw new CredentialModelError("INVALID_DESCRIPTOR", `${claimPath}.required`, "must be a boolean");
|
|
112
72
|
}
|
|
113
73
|
if (claim.valueType !== undefined) {
|
|
114
|
-
assertIdentifier(claim.valueType,
|
|
74
|
+
assertIdentifier(claim.valueType, `${claimPath}.valueType`);
|
|
115
75
|
}
|
|
116
76
|
if (!Array.isArray(claim.path) || claim.path.length === 0) {
|
|
117
|
-
throw new CredentialModelError("INVALID_DESCRIPTOR",
|
|
77
|
+
throw new CredentialModelError("INVALID_DESCRIPTOR", `${claimPath}.path`, "must contain at least one path segment");
|
|
118
78
|
}
|
|
119
79
|
for (const [pathIndex, segment] of claim.path.entries()) {
|
|
120
|
-
assertIdentifier(segment,
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (!Array.isArray(definition.capabilities) ||
|
|
124
|
-
!Array.isArray(definition.artifacts)) {
|
|
125
|
-
throw new CredentialModelError("INVALID_DESCRIPTOR", "definition", "capabilities and artifacts must be arrays");
|
|
126
|
-
}
|
|
127
|
-
assertUniqueIds(definition.capabilities, "capabilities");
|
|
128
|
-
assertUniqueIds(definition.artifacts, "artifacts");
|
|
129
|
-
for (const [index, capability] of definition.capabilities.entries()) {
|
|
130
|
-
if (!capabilityKinds.has(capability.kind)) {
|
|
131
|
-
throw new CredentialModelError("INVALID_DESCRIPTOR", `capabilities[${index}].kind`, "must be holder-binding, status, proof, or presentation");
|
|
132
|
-
}
|
|
133
|
-
if (typeof capability.required !== "boolean") {
|
|
134
|
-
throw new CredentialModelError("INVALID_DESCRIPTOR", `capabilities[${index}].required`, "must be a boolean");
|
|
135
|
-
}
|
|
136
|
-
if (capability.version !== undefined) {
|
|
137
|
-
assertVersion(capability.version, `capabilities[${index}].version`);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
for (const [index, artifact] of definition.artifacts.entries()) {
|
|
141
|
-
assertIdentifier(artifact.mediaType, `artifacts[${index}].mediaType`);
|
|
142
|
-
if (!artifactPurposes.has(artifact.purpose)) {
|
|
143
|
-
throw new CredentialModelError("INVALID_DESCRIPTOR", `artifacts[${index}].purpose`, "must be prover, verifier, circuit, or metadata");
|
|
144
|
-
}
|
|
145
|
-
if (artifact.optional !== undefined &&
|
|
146
|
-
typeof artifact.optional !== "boolean") {
|
|
147
|
-
throw new CredentialModelError("INVALID_DESCRIPTOR", `artifacts[${index}].optional`, "must be a boolean when present");
|
|
80
|
+
assertIdentifier(segment, `${claimPath}.path[${pathIndex}]`);
|
|
148
81
|
}
|
|
149
82
|
}
|
|
150
|
-
|
|
151
|
-
for (const [name, codec] of [
|
|
152
|
-
["credentialCodec", definition.credentialCodec],
|
|
153
|
-
["presentationCodec", definition.presentationCodec],
|
|
154
|
-
]) {
|
|
155
|
-
if (typeof codec !== "object" ||
|
|
156
|
-
codec === null ||
|
|
157
|
-
typeof codec.mediaType !== "string" ||
|
|
158
|
-
codec.mediaType.trim() !== codec.mediaType ||
|
|
159
|
-
codec.mediaType.length === 0 ||
|
|
160
|
-
typeof codec.encode !== "function" ||
|
|
161
|
-
typeof codec.decode !== "function") {
|
|
162
|
-
throw new CredentialModelError("INVALID_CODEC", name, "must declare a media type and encode/decode functions");
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
};
|
|
83
|
+
}
|
|
166
84
|
export const defineCredentialFamily = (definition) => {
|
|
167
85
|
assertCredentialFamilyDefinition(definition);
|
|
168
86
|
return definition;
|
package/dist/validation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA,gBAAgB,CAAC;AACrD,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA,+BAA+B,CAAC;AACvE,MAAM,oBAAoB,GAAG,MAAM,iBAAiB,IAAI,oBAAoB,GAAG,CAAC;AAChF,MAAM,s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,EAAE,CAAC;YAClC,gBAAgB,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,SAAS,YAAY,CAAC,CAAC;QAC9D,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1D,MAAM,IAAI,oBAAoB,CAC5B,oBAAoB,EACpB,GAAG,SAAS,OAAO,EACnB,wCAAwC,CACzC,CAAC;QACJ,CAAC;QACD,KAAK,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;YACxD,gBAAgB,CAAC,OAAO,EAAE,GAAG,SAAS,SAAS,SAAS,GAAG,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAGpC,UAAsB,EACV,EAAE;IACd,gCAAgC,CAAC,UAAU,CAAC,CAAC;IAC7C,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midnight-ntwrk/credential-model",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-rc1",
|
|
4
4
|
"description": "Protocol-neutral credential-family contracts for Midnight verifiable credentials",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"private": false,
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": ">=24",
|
|
28
|
-
"pnpm": ">=10"
|
|
28
|
+
"pnpm": ">=10.34.5"
|
|
29
29
|
},
|
|
30
30
|
"main": "dist/index.js",
|
|
31
31
|
"module": "dist/index.js",
|
|
@@ -43,19 +43,12 @@
|
|
|
43
43
|
"CHANGELOG.md",
|
|
44
44
|
"package.json"
|
|
45
45
|
],
|
|
46
|
-
"midnight": {
|
|
47
|
-
"maturity": "core",
|
|
48
|
-
"packageClass": "dist",
|
|
49
|
-
"releaseStage": "supported"
|
|
50
|
-
},
|
|
51
46
|
"scripts": {
|
|
52
47
|
"build": "rm -rf dist .cache && tsc -b tsconfig.build.json --force",
|
|
53
|
-
"test": "vitest run
|
|
54
|
-
"test:ci": "vitest run --config vitest.config.ts",
|
|
48
|
+
"test": "vitest run",
|
|
55
49
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
56
50
|
"lint": "eslint \"src/**/*.ts\"",
|
|
57
51
|
"lint:fix": "eslint \"src/**/*.ts\" --fix",
|
|
58
|
-
"clean": "rm -rf dist coverage .cache *.tsbuildinfo"
|
|
59
|
-
"all": "pnpm run lint && pnpm run typecheck && pnpm run build && pnpm run test:ci"
|
|
52
|
+
"clean": "rm -rf dist coverage .cache .turbo *.tsbuildinfo"
|
|
60
53
|
}
|
|
61
54
|
}
|