@openvtc/trust-tasks 0.2.60 → 0.4.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/dist/_framework/0.3/framework.d.ts +13 -0
- package/dist/_framework/0.3/framework.d.ts.map +1 -0
- package/dist/_framework/0.3/framework.js +6 -0
- package/dist/_framework/0.3/framework.js.map +1 -0
- package/dist/_runtime/document.d.ts +48 -3
- package/dist/_runtime/document.d.ts.map +1 -1
- package/dist/_runtime/document.js +40 -5
- package/dist/_runtime/document.js.map +1 -1
- package/dist/_runtime/index.d.ts +1 -1
- package/dist/_runtime/index.d.ts.map +1 -1
- package/dist/_runtime/index.js.map +1 -1
- package/dist/audit/list/0.1/payload.d.ts +11 -9
- package/dist/audit/list/0.1/payload.d.ts.map +1 -1
- package/dist/audit/list/0.1/payload.js.map +1 -1
- package/dist/audit/verify/0.1/payload.d.ts +6 -5
- package/dist/audit/verify/0.1/payload.d.ts.map +1 -1
- package/dist/audit/verify/0.1/payload.js.map +1 -1
- package/dist/chat/message/0.1/payload.d.ts +11 -9
- package/dist/chat/message/0.1/payload.d.ts.map +1 -1
- package/dist/chat/message/0.1/payload.js.map +1 -1
- package/dist/consent/request/1.0/payload.d.ts +6 -5
- package/dist/consent/request/1.0/payload.d.ts.map +1 -1
- package/dist/consent/request/1.0/payload.js.map +1 -1
- package/dist/credentials/_shared/0.2/credentials.d.ts +15 -0
- package/dist/credentials/_shared/0.2/credentials.d.ts.map +1 -0
- package/dist/credentials/_shared/0.2/credentials.js +6 -0
- package/dist/credentials/_shared/0.2/credentials.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/policy/evaluate/0.3/payload.d.ts +6 -5
- package/dist/policy/evaluate/0.3/payload.d.ts.map +1 -1
- package/dist/policy/evaluate/0.3/payload.js.map +1 -1
- package/dist/task-consent/decision/0.1/payload.d.ts +11 -9
- package/dist/task-consent/decision/0.1/payload.d.ts.map +1 -1
- package/dist/task-consent/decision/0.1/payload.js.map +1 -1
- package/dist/task-consent/granted/0.1/payload.d.ts +6 -5
- package/dist/task-consent/granted/0.1/payload.d.ts.map +1 -1
- package/dist/task-consent/granted/0.1/payload.js.map +1 -1
- package/dist/task-consent/request/0.1/payload.d.ts +6 -5
- package/dist/task-consent/request/0.1/payload.d.ts.map +1 -1
- package/dist/task-consent/request/0.1/payload.js.map +1 -1
- package/dist/trust-task-error/0.3/payload.d.ts +60 -0
- package/dist/trust-task-error/0.3/payload.d.ts.map +1 -0
- package/dist/trust-task-error/0.3/payload.js +18 -0
- package/dist/trust-task-error/0.3/payload.js.map +1 -0
- package/dist/vta/credentials/issue/0.1/payload.d.ts +2 -0
- package/dist/vta/credentials/issue/0.1/payload.d.ts.map +1 -1
- package/dist/vta/credentials/issue/0.1/payload.js.map +1 -1
- package/dist/vta/credentials/issue/0.2/payload.d.ts +94 -0
- package/dist/vta/credentials/issue/0.2/payload.d.ts.map +1 -0
- package/dist/vta/credentials/issue/0.2/payload.js +31 -0
- package/dist/vta/credentials/issue/0.2/payload.js.map +1 -0
- package/dist/vtc/relationships/request/0.1/payload.d.ts +65 -0
- package/dist/vtc/relationships/request/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/relationships/request/0.1/payload.js +31 -0
- package/dist/vtc/relationships/request/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_framework/0.3/framework.ts +13 -0
- package/src/_runtime/document.ts +80 -6
- package/src/_runtime/index.ts +1 -0
- package/src/audit/list/0.1/payload.ts +12 -9
- package/src/audit/verify/0.1/payload.ts +7 -5
- package/src/chat/message/0.1/payload.ts +12 -9
- package/src/consent/request/1.0/payload.ts +7 -5
- package/src/credentials/_shared/0.2/credentials.ts +15 -0
- package/src/index.ts +5 -0
- package/src/policy/evaluate/0.3/payload.ts +6 -5
- package/src/task-consent/decision/0.1/payload.ts +11 -9
- package/src/task-consent/granted/0.1/payload.ts +7 -5
- package/src/task-consent/request/0.1/payload.ts +7 -5
- package/src/trust-task-error/0.3/payload.ts +80 -0
- package/src/vta/credentials/issue/0.1/payload.ts +2 -0
- package/src/vta/credentials/issue/0.2/payload.ts +101 -0
- package/src/vtc/relationships/request/0.1/payload.ts +71 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/trust-task-error/0.3/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The canonical error-response payload per SPEC.md §8.2.
|
|
8
|
+
*/
|
|
9
|
+
export interface TrustTaskErrorPayload {
|
|
10
|
+
/**
|
|
11
|
+
* Short identifier for the failure category. MUST be either a framework standard code (SPEC.md §8.3) or an extended code namespaced by the originating spec's slug (SPEC.md §8.5, e.g. 'acl/grant:role_not_recognized').
|
|
12
|
+
*/
|
|
13
|
+
code: (
|
|
14
|
+
| (
|
|
15
|
+
| "malformedRequest"
|
|
16
|
+
| "unsupportedType"
|
|
17
|
+
| "unsupportedVersion"
|
|
18
|
+
| "expired"
|
|
19
|
+
| "proofRequired"
|
|
20
|
+
| "proofInvalid"
|
|
21
|
+
| "permissionDenied"
|
|
22
|
+
| "wrongRecipient"
|
|
23
|
+
| "identityMismatch"
|
|
24
|
+
| "taskFailed"
|
|
25
|
+
| "unavailable"
|
|
26
|
+
| "internalError"
|
|
27
|
+
)
|
|
28
|
+
| {
|
|
29
|
+
[k: string]: unknown | undefined;
|
|
30
|
+
}
|
|
31
|
+
) &
|
|
32
|
+
string;
|
|
33
|
+
/**
|
|
34
|
+
* Identifies the Trust Task document this error reports on. RECOMMENDED on every error response, and REQUIRED in practice for any error a third party may later be asked to rely on: threadId correlates the exchange only for a party that saw the request, so without this an error retained as evidence names neither the task it terminated nor the instance.
|
|
35
|
+
*/
|
|
36
|
+
inResponseTo?: {
|
|
37
|
+
/**
|
|
38
|
+
* The Type URI of the document being reported on, including any #request or #response fragment it carried. This is what tells a consumer which specification's semantics apply to an extended code, and which specification declared the requirement that was breached.
|
|
39
|
+
*/
|
|
40
|
+
typeUri: string;
|
|
41
|
+
/**
|
|
42
|
+
* The id of the specific document being reported on (SPEC §4.3). Globally unique and never reused, so it names one instance where threadId names an exchange. Omit only where echoing it would disclose more than the error already does.
|
|
43
|
+
*/
|
|
44
|
+
id?: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Human-readable description of the error. Non-normative; intended for logs and operator UI.
|
|
48
|
+
*/
|
|
49
|
+
message?: string;
|
|
50
|
+
/**
|
|
51
|
+
* true if the producer of the original document MAY retry; false if retrying with the same document is not expected to succeed.
|
|
52
|
+
*/
|
|
53
|
+
retryable: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* RFC 3339 timestamp before which the producer SHOULD NOT retry. Meaningful only when retryable is true.
|
|
56
|
+
*/
|
|
57
|
+
retryAfter?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Optional task-specific extension data. Per-spec error code declarations may pin the shape via a JSON Schema fragment.
|
|
60
|
+
*/
|
|
61
|
+
details?: {};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Trust Task type URI. */
|
|
65
|
+
export const TYPE_URI = "https://trusttasks.org/spec/trust-task-error/0.3" as const;
|
|
66
|
+
|
|
67
|
+
/** Stable alias for this specification's request payload shape. */
|
|
68
|
+
export type Payload = TrustTaskErrorPayload;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
72
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
73
|
+
* per-specification and cannot be derived from the document alone.
|
|
74
|
+
*/
|
|
75
|
+
export const SPEC = {
|
|
76
|
+
typeUri: TYPE_URI,
|
|
77
|
+
isBearer: false,
|
|
78
|
+
isProofRequired: false,
|
|
79
|
+
isRecipientRequired: true,
|
|
80
|
+
} as const;
|
|
@@ -39,6 +39,8 @@ export interface Ext {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* The success response to a vta/credentials/issue request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vta/credentials/issue/0.1#response.
|
|
42
|
+
*
|
|
43
|
+
* This is the credentials/_shared IssuedCredential shape — same members, same required set — plus `supersedes` and `ext`. It states them inline rather than `$ref`-ing the shared definition because that definition sets `additionalProperties: false`, which under `allOf` would reject the two extra members. The shared CredentialId is still referenced. Keep the two in step by hand if either changes.
|
|
42
44
|
*/
|
|
43
45
|
export interface VTACredentialsIssueResponsePayload {
|
|
44
46
|
credentialId: CredentialId;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/credentials/issue/0.2/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The success response to a vta/credentials/issue request. Carried in a Trust Task document whose type is https://trusttasks.org/spec/vta/credentials/issue/0.1#response.
|
|
8
|
+
*
|
|
9
|
+
* Composed from the shared IssuedCredential rather than restating it: that definition is the issuance receipt every issuer returns, and duplicating it here let the two drift silently. `unevaluatedProperties` closes the object after the `allOf` is applied, which is what makes the composition possible at all — `additionalProperties` is evaluated per-subschema against the whole object and would reject `supersedes` and `ext`.
|
|
10
|
+
*/
|
|
11
|
+
export type VTACredentialsIssueResponsePayload = IssuedCredentialBase;
|
|
12
|
+
/**
|
|
13
|
+
* Stable identifier for an issued credential — the handle for revocation and audit. Opaque to the holder: it MUST be echoed verbatim when revoking and MUST NOT be parsed.
|
|
14
|
+
*/
|
|
15
|
+
export type CredentialId = string;
|
|
16
|
+
|
|
17
|
+
export interface VTACredentialsIssuePayload {
|
|
18
|
+
/**
|
|
19
|
+
* DID of the credential's subject/holder (becomes credentialSubject.id).
|
|
20
|
+
*/
|
|
21
|
+
holder: string;
|
|
22
|
+
/**
|
|
23
|
+
* The scoped claims to attest — the share's scope. Opaque to the framework; non-empty.
|
|
24
|
+
*/
|
|
25
|
+
claims: {};
|
|
26
|
+
/**
|
|
27
|
+
* Additional credential type beyond VerifiableCredential (e.g. ScopedShareCredential). Some values name a claims profile defined by this specification (e.g. GovernancePolicyCredential), which constrains the shape of `claims`.
|
|
28
|
+
*/
|
|
29
|
+
credentialType?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Credential lifetime in seconds from issuance. The issuer MAY cap this.
|
|
32
|
+
*/
|
|
33
|
+
validitySeconds: number;
|
|
34
|
+
/**
|
|
35
|
+
* Optional human-readable rationale, recorded for audit.
|
|
36
|
+
*/
|
|
37
|
+
purpose?: string;
|
|
38
|
+
ext?: Ext;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
42
|
+
*/
|
|
43
|
+
export interface Ext {
|
|
44
|
+
[k: string]: unknown | undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The members of an issuance receipt, deliberately left **open** so a consuming specification can `$ref` it under `allOf` and add its own, then close the result with `unevaluatedProperties: false`.
|
|
48
|
+
*
|
|
49
|
+
* A closure inside this definition would defeat that. Both `additionalProperties` and `unevaluatedProperties` are evaluated against the whole instance from within the subschema that declares them, and neither can see members the *outer* schema matched — so either one here rejects the consumer's extras. Only an `unevaluatedProperties` at the outer level sees everything the composition matched. Use `IssuedCredential` where a closed standalone shape is wanted.
|
|
50
|
+
*/
|
|
51
|
+
export interface IssuedCredentialBase {
|
|
52
|
+
credentialId: CredentialId;
|
|
53
|
+
/**
|
|
54
|
+
* The issued Verifiable Credential (W3C VC Data Model 2.0), signed by the issuer's key. Opaque to the framework.
|
|
55
|
+
*/
|
|
56
|
+
credential: {};
|
|
57
|
+
/**
|
|
58
|
+
* When the credential was minted.
|
|
59
|
+
*/
|
|
60
|
+
issuedAt?: string;
|
|
61
|
+
/**
|
|
62
|
+
* When the credential's validUntil falls due.
|
|
63
|
+
*/
|
|
64
|
+
expiresAt: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Trust Task type URI. */
|
|
68
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vta/credentials/issue/0.2" as const;
|
|
69
|
+
|
|
70
|
+
/** Stable alias for this specification's request payload shape. */
|
|
71
|
+
export type Payload = VTACredentialsIssueResponsePayload;
|
|
72
|
+
|
|
73
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
74
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/credentials/issue/0.2#response" as const;
|
|
75
|
+
|
|
76
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
77
|
+
export type Response = VTACredentialsIssueResponsePayload;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
81
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
82
|
+
* per-specification and cannot be derived from the document alone.
|
|
83
|
+
*/
|
|
84
|
+
export const SPEC = {
|
|
85
|
+
typeUri: TYPE_URI,
|
|
86
|
+
isBearer: false,
|
|
87
|
+
isProofRequired: true,
|
|
88
|
+
isRecipientRequired: true,
|
|
89
|
+
} as const;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
93
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
94
|
+
* parties (§7.3 item 5).
|
|
95
|
+
*/
|
|
96
|
+
export const RESPONSE_SPEC = {
|
|
97
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
98
|
+
isBearer: false,
|
|
99
|
+
isProofRequired: true,
|
|
100
|
+
isRecipientRequired: true,
|
|
101
|
+
} as const;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/relationships/request/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A member asks another member to issue them a Verifiable Relationship Credential. Everything here is a hint: the issuing member decides, and declines with a trust-task-error carrying `vtc/relationships/request:declined` rather than a bespoke rejection message.
|
|
8
|
+
*/
|
|
9
|
+
export interface VTCRelationshipsRequestPayload {
|
|
10
|
+
/**
|
|
11
|
+
* Why the requester is asking, in their own words, for the issuing member to weigh. A hint and not a term — the issuing member is under no obligation to honour it, and MUST NOT treat its absence as a defect. Free text reaching a human, so a producer SHOULD keep it to what it is willing to have quoted back.
|
|
12
|
+
*/
|
|
13
|
+
reason?: string;
|
|
14
|
+
ext?: Ext;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.
|
|
18
|
+
*/
|
|
19
|
+
export interface Ext {
|
|
20
|
+
[k: string]: unknown | undefined;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The issued credential. Returned only where the issuing member agreed; a decline is a trust-task-error, not a response with an empty field.
|
|
24
|
+
*/
|
|
25
|
+
export interface VTCRelationshipsRequestResponsePayload {
|
|
26
|
+
/**
|
|
27
|
+
* A signed W3C Verifiable Relationship Credential (opaque here). Its issuer MUST be the issuing member — the party that signed this response — and its credentialSubject.id MUST name the requester. The same shape `vtc/relationships/publish` accepts, so a requester can lodge it with the community unchanged.
|
|
28
|
+
*/
|
|
29
|
+
vrc: {};
|
|
30
|
+
/**
|
|
31
|
+
* SHA-256 of the returned VRC, for out-of-band integrity checks. Matches the digest `vtc/relationships/publish` reports once the credential is lodged, so the two can be tied together without re-hashing.
|
|
32
|
+
*/
|
|
33
|
+
vrcSha256?: string;
|
|
34
|
+
ext?: Ext;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Trust Task type URI. */
|
|
38
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/relationships/request/0.1" as const;
|
|
39
|
+
|
|
40
|
+
/** Stable alias for this specification's request payload shape. */
|
|
41
|
+
export type Payload = VTCRelationshipsRequestPayload;
|
|
42
|
+
|
|
43
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
44
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/relationships/request/0.1#response" as const;
|
|
45
|
+
|
|
46
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
47
|
+
export type Response = VTCRelationshipsRequestResponsePayload;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
51
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
52
|
+
* per-specification and cannot be derived from the document alone.
|
|
53
|
+
*/
|
|
54
|
+
export const SPEC = {
|
|
55
|
+
typeUri: TYPE_URI,
|
|
56
|
+
isBearer: false,
|
|
57
|
+
isProofRequired: true,
|
|
58
|
+
isRecipientRequired: true,
|
|
59
|
+
} as const;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
63
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
64
|
+
* parties (§7.3 item 5).
|
|
65
|
+
*/
|
|
66
|
+
export const RESPONSE_SPEC = {
|
|
67
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
68
|
+
isBearer: false,
|
|
69
|
+
isProofRequired: true,
|
|
70
|
+
isRecipientRequired: true,
|
|
71
|
+
} as const;
|