@openvtc/trust-tasks 0.28.3 → 0.28.4
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 +63 -0
- package/dist/_extends.d.ts.map +1 -1
- package/dist/_extends.js +2 -0
- package/dist/_extends.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/peer-check/ask/0.1/payload.d.ts +397 -0
- package/dist/peer-check/ask/0.1/payload.d.ts.map +1 -0
- package/dist/peer-check/ask/0.1/payload.js +235 -0
- package/dist/peer-check/ask/0.1/payload.js.map +1 -0
- package/dist/rooms/keys/act/0.1/payload.d.ts +4 -4
- package/dist/rooms/keys/act/0.1/payload.js +1 -1
- package/dist/rooms/keys/act/0.2/payload.d.ts +4 -4
- package/dist/rooms/keys/act/0.2/payload.js +1 -1
- package/dist/rooms/keys/act/0.3/payload.d.ts +4 -4
- package/dist/rooms/keys/act/0.3/payload.js +1 -1
- package/dist/rooms/keys/act/0.4/payload.d.ts +4 -4
- package/dist/rooms/keys/act/0.4/payload.js +1 -1
- package/dist/rooms/keys/act/0.5/payload.d.ts +4 -4
- package/dist/rooms/keys/act/0.5/payload.js +1 -1
- package/dist/rooms/keys/act/0.6/payload.d.ts +4 -4
- package/dist/rooms/keys/act/0.6/payload.js +1 -1
- package/dist/rooms/keys/act/0.7/payload.d.ts +4 -4
- package/dist/rooms/keys/act/0.7/payload.js +1 -1
- package/dist/rooms/keys/act/0.8/payload.d.ts +14 -2
- package/dist/rooms/keys/act/0.8/payload.d.ts.map +1 -1
- package/dist/rooms/keys/act/0.8/payload.js +1 -1
- package/dist/rooms/keys/act/0.8/payload.js.map +1 -1
- package/dist/rooms/keys/act/0.9/payload.d.ts +560 -0
- package/dist/rooms/keys/act/0.9/payload.d.ts.map +1 -0
- package/dist/rooms/keys/act/0.9/payload.js +319 -0
- package/dist/rooms/keys/act/0.9/payload.js.map +1 -0
- package/dist/vta/webvh/dids/update/1.0/payload.d.ts +14 -2
- package/dist/vta/webvh/dids/update/1.0/payload.d.ts.map +1 -1
- package/dist/vta/webvh/dids/update/1.0/payload.js +1 -1
- package/dist/vta/webvh/dids/update/1.0/payload.js.map +1 -1
- package/dist/vta/webvh/dids/update/1.1/payload.d.ts +511 -0
- package/dist/vta/webvh/dids/update/1.1/payload.d.ts.map +1 -0
- package/dist/vta/webvh/dids/update/1.1/payload.js +251 -0
- package/dist/vta/webvh/dids/update/1.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_extends.ts +2 -0
- package/src/index.ts +9 -0
- package/src/peer-check/ask/0.1/payload.ts +301 -0
- package/src/rooms/keys/act/0.1/payload.ts +5 -5
- package/src/rooms/keys/act/0.2/payload.ts +5 -5
- package/src/rooms/keys/act/0.3/payload.ts +5 -5
- package/src/rooms/keys/act/0.4/payload.ts +5 -5
- package/src/rooms/keys/act/0.5/payload.ts +5 -5
- package/src/rooms/keys/act/0.6/payload.ts +5 -5
- package/src/rooms/keys/act/0.7/payload.ts +5 -5
- package/src/rooms/keys/act/0.8/payload.ts +15 -3
- package/src/rooms/keys/act/0.9/payload.ts +396 -0
- package/src/vta/webvh/dids/update/1.0/payload.ts +15 -3
- package/src/vta/webvh/dids/update/1.1/payload.ts +351 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/peer-check/ask/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
import type { DigestMultibase } from "../../../_shared/components.js";
|
|
6
|
+
/**
|
|
7
|
+
* The request payload of peer-check/ask: a short yes-or-no question one party puts to another, with an unguessable challenge. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3. The asker is the `issuer`, the party being asked is the `recipient`, and the payload MUST carry `expiresAt`, the deadline for the answer. The envelope `expiresAt` keeps its framework meaning (SPEC §4.2): after it the responder does not prompt for the request.
|
|
8
|
+
*/
|
|
9
|
+
export interface PeerCheckAskPayload {
|
|
10
|
+
/**
|
|
11
|
+
* An unguessable value the asker generates for this one question: at least 128 bits from a cryptographically secure random source, encoded base64url without padding (22 to 86 characters). The responder echoes it unchanged in its answer.
|
|
12
|
+
*/
|
|
13
|
+
challenge: string;
|
|
14
|
+
/**
|
|
15
|
+
* What the asker wants confirmed, in one short sentence, for example "Did you just ask me to send you a one-time code?". It is asker-authored text the responder's device displays attributed to the asker, never as a statement the device itself vouches for.
|
|
16
|
+
*/
|
|
17
|
+
question: string;
|
|
18
|
+
/**
|
|
19
|
+
* OPTIONAL extra context from the asker. It is UNTRUSTED display text: the responder's device MUST render it as plain text, attributed to the asker and visually distinct from anything the device itself asserts, and MUST NOT interpret it as markup, a link, or an instruction.
|
|
20
|
+
*/
|
|
21
|
+
note?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The answer deadline. After this instant the pending question lapses: the responder does not prompt for it and the asker accepts no answer. It is the task's own deadline (SPEC §7.3 item 16); the envelope `expiresAt` bounds only acceptance of the request document.
|
|
24
|
+
*/
|
|
25
|
+
expiresAt: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The success-response payload: the responder's answer, signed by the responder. Failures use trust-task-error, not this shape. A responder that declines because it does not recognize the question answers with `decision: notConfirmed`; an error is for a document the responder could not act on at all.
|
|
29
|
+
*/
|
|
30
|
+
export interface PeerCheckAskResponsePayload {
|
|
31
|
+
/**
|
|
32
|
+
* The `challenge` of the request, echoed unchanged. The asker rejects an answer whose challenge it did not issue, or has already consumed.
|
|
33
|
+
*/
|
|
34
|
+
challenge: string;
|
|
35
|
+
/**
|
|
36
|
+
* The task digest (SPEC §4.9.3) of the request document this answers: multibase(multihash(H(JCS(request without its top-level proof)))). It binds the answer to the exact question, challenge, note, parties and deadline the responder was shown, so a yes given to one ask cannot be presented as a yes to another.
|
|
37
|
+
*/
|
|
38
|
+
requestDigest: DigestMultibase;
|
|
39
|
+
/**
|
|
40
|
+
* The responder's answer. `confirmed` means yes to the question as asked; `notConfirmed` means no.
|
|
41
|
+
*/
|
|
42
|
+
decision: "confirmed" | "notConfirmed";
|
|
43
|
+
/**
|
|
44
|
+
* When the responder gave the answer, RFC 3339. Informational for the asker; freshness is judged against the request's `payload.expiresAt` and the asker's own clock. It is the time of the user's answer; the envelope `issuedAt` is when the responder signed the document, which may be later.
|
|
45
|
+
*/
|
|
46
|
+
respondedAt: string;
|
|
47
|
+
/**
|
|
48
|
+
* OPTIONAL, and only with `decision: notConfirmed`, which the schema enforces; a document carrying it beside `confirmed` is invalid. `notRecognized` — the responder does not recognize what the question describes; `declined` — the responder recognizes it and says no; `other` — anything else. An enumeration rather than prose, so an asker never renders responder-authored text.
|
|
49
|
+
*/
|
|
50
|
+
notConfirmedReason?: "notRecognized" | "declined" | "other";
|
|
51
|
+
}
|
|
52
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
53
|
+
export type { DigestMultibase };
|
|
54
|
+
/** Trust Task type URI. */
|
|
55
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/peer-check/ask/0.1";
|
|
56
|
+
/**
|
|
57
|
+
* The earlier version of this specification that this one declares it
|
|
58
|
+
* extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
|
|
59
|
+
* `null`. Only the direct declaration — follow the chain with
|
|
60
|
+
* `extendsChain` / `readForSpec`.
|
|
61
|
+
*/
|
|
62
|
+
export declare const EXTENDS: string | null;
|
|
63
|
+
/**
|
|
64
|
+
* Why this version is deprecated, or `null` while it is current. A
|
|
65
|
+
* superseded or retired version is still supported, and is withdrawn from
|
|
66
|
+
* this package in a later scheduled batch (SPEC "Superseded and Withdrawn
|
|
67
|
+
* Versions").
|
|
68
|
+
*/
|
|
69
|
+
export declare const DEPRECATION: string | null;
|
|
70
|
+
/** Stable alias for this specification's request payload shape. */
|
|
71
|
+
export type Payload = PeerCheckAskPayload;
|
|
72
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
73
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/peer-check/ask/0.1#response";
|
|
74
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
75
|
+
export type Response = PeerCheckAskResponsePayload;
|
|
76
|
+
/**
|
|
77
|
+
* This specification's payload schema, as a value.
|
|
78
|
+
*
|
|
79
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
80
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
81
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
82
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
83
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
84
|
+
*/
|
|
85
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
86
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
87
|
+
readonly $id: "https://trusttasks.org/spec/peer-check/ask/0.1";
|
|
88
|
+
readonly title: "Peer Check — Ask — payload";
|
|
89
|
+
readonly description: "The request payload of peer-check/ask: a short yes-or-no question one party puts to another, with an unguessable challenge. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3. The asker is the `issuer`, the party being asked is the `recipient`, and the payload MUST carry `expiresAt`, the deadline for the answer. The envelope `expiresAt` keeps its framework meaning (SPEC §4.2): after it the responder does not prompt for the request.";
|
|
90
|
+
readonly type: "object";
|
|
91
|
+
readonly additionalProperties: false;
|
|
92
|
+
readonly required: readonly ["challenge", "question", "expiresAt"];
|
|
93
|
+
readonly properties: {
|
|
94
|
+
readonly challenge: {
|
|
95
|
+
readonly type: "string";
|
|
96
|
+
readonly pattern: "^[A-Za-z0-9_-]{22,86}$";
|
|
97
|
+
readonly description: "An unguessable value the asker generates for this one question: at least 128 bits from a cryptographically secure random source, encoded base64url without padding (22 to 86 characters). The responder echoes it unchanged in its answer.";
|
|
98
|
+
};
|
|
99
|
+
readonly question: {
|
|
100
|
+
readonly type: "string";
|
|
101
|
+
readonly minLength: 1;
|
|
102
|
+
readonly maxLength: 200;
|
|
103
|
+
readonly description: "What the asker wants confirmed, in one short sentence, for example \"Did you just ask me to send you a one-time code?\". It is asker-authored text the responder's device displays attributed to the asker, never as a statement the device itself vouches for.";
|
|
104
|
+
};
|
|
105
|
+
readonly note: {
|
|
106
|
+
readonly type: "string";
|
|
107
|
+
readonly minLength: 1;
|
|
108
|
+
readonly maxLength: 500;
|
|
109
|
+
readonly description: "OPTIONAL extra context from the asker. It is UNTRUSTED display text: the responder's device MUST render it as plain text, attributed to the asker and visually distinct from anything the device itself asserts, and MUST NOT interpret it as markup, a link, or an instruction.";
|
|
110
|
+
};
|
|
111
|
+
readonly expiresAt: {
|
|
112
|
+
readonly type: "string";
|
|
113
|
+
readonly format: "date-time";
|
|
114
|
+
readonly description: "The answer deadline. After this instant the pending question lapses: the responder does not prompt for it and the asker accepts no answer. It is the task's own deadline (SPEC §7.3 item 16); the envelope `expiresAt` bounds only acceptance of the request document.";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
readonly $defs: {
|
|
118
|
+
readonly Response: {
|
|
119
|
+
readonly $anchor: "response";
|
|
120
|
+
readonly title: "Peer Check Ask Response Payload";
|
|
121
|
+
readonly type: "object";
|
|
122
|
+
readonly additionalProperties: false;
|
|
123
|
+
readonly required: readonly ["challenge", "requestDigest", "decision", "respondedAt"];
|
|
124
|
+
readonly description: "The success-response payload: the responder's answer, signed by the responder. Failures use trust-task-error, not this shape. A responder that declines because it does not recognize the question answers with `decision: notConfirmed`; an error is for a document the responder could not act on at all.";
|
|
125
|
+
readonly dependentSchemas: {
|
|
126
|
+
readonly notConfirmedReason: {
|
|
127
|
+
readonly properties: {
|
|
128
|
+
readonly decision: {
|
|
129
|
+
readonly const: "notConfirmed";
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
readonly properties: {
|
|
135
|
+
readonly challenge: {
|
|
136
|
+
readonly type: "string";
|
|
137
|
+
readonly pattern: "^[A-Za-z0-9_-]{22,86}$";
|
|
138
|
+
readonly description: "The `challenge` of the request, echoed unchanged. The asker rejects an answer whose challenge it did not issue, or has already consumed.";
|
|
139
|
+
};
|
|
140
|
+
readonly requestDigest: {
|
|
141
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
142
|
+
readonly description: "The task digest (SPEC §4.9.3) of the request document this answers: multibase(multihash(H(JCS(request without its top-level proof)))). It binds the answer to the exact question, challenge, note, parties and deadline the responder was shown, so a yes given to one ask cannot be presented as a yes to another.";
|
|
143
|
+
};
|
|
144
|
+
readonly decision: {
|
|
145
|
+
readonly type: "string";
|
|
146
|
+
readonly enum: readonly ["confirmed", "notConfirmed"];
|
|
147
|
+
readonly description: "The responder's answer. `confirmed` means yes to the question as asked; `notConfirmed` means no.";
|
|
148
|
+
};
|
|
149
|
+
readonly respondedAt: {
|
|
150
|
+
readonly type: "string";
|
|
151
|
+
readonly format: "date-time";
|
|
152
|
+
readonly description: "When the responder gave the answer, RFC 3339. Informational for the asker; freshness is judged against the request's `payload.expiresAt` and the asker's own clock. It is the time of the user's answer; the envelope `issuedAt` is when the responder signed the document, which may be later.";
|
|
153
|
+
};
|
|
154
|
+
readonly notConfirmedReason: {
|
|
155
|
+
readonly type: "string";
|
|
156
|
+
readonly enum: readonly ["notRecognized", "declined", "other"];
|
|
157
|
+
readonly description: "OPTIONAL, and only with `decision: notConfirmed`, which the schema enforces; a document carrying it beside `confirmed` is invalid. `notRecognized` — the responder does not recognize what the question describes; `declined` — the responder recognizes it and says no; `other` — anything else. An enumeration rather than prose, so an asker never renders responder-authored text.";
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
readonly DigestMultibase: {
|
|
162
|
+
readonly title: "DigestMultibase";
|
|
163
|
+
readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
|
|
164
|
+
readonly type: "string";
|
|
165
|
+
readonly minLength: 16;
|
|
166
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
167
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
172
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
173
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
174
|
+
readonly $ref: "#/$defs/Response";
|
|
175
|
+
readonly $defs: {
|
|
176
|
+
readonly Response: {
|
|
177
|
+
readonly $anchor: "response";
|
|
178
|
+
readonly title: "Peer Check Ask Response Payload";
|
|
179
|
+
readonly type: "object";
|
|
180
|
+
readonly additionalProperties: false;
|
|
181
|
+
readonly required: readonly ["challenge", "requestDigest", "decision", "respondedAt"];
|
|
182
|
+
readonly description: "The success-response payload: the responder's answer, signed by the responder. Failures use trust-task-error, not this shape. A responder that declines because it does not recognize the question answers with `decision: notConfirmed`; an error is for a document the responder could not act on at all.";
|
|
183
|
+
readonly dependentSchemas: {
|
|
184
|
+
readonly notConfirmedReason: {
|
|
185
|
+
readonly properties: {
|
|
186
|
+
readonly decision: {
|
|
187
|
+
readonly const: "notConfirmed";
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
readonly properties: {
|
|
193
|
+
readonly challenge: {
|
|
194
|
+
readonly type: "string";
|
|
195
|
+
readonly pattern: "^[A-Za-z0-9_-]{22,86}$";
|
|
196
|
+
readonly description: "The `challenge` of the request, echoed unchanged. The asker rejects an answer whose challenge it did not issue, or has already consumed.";
|
|
197
|
+
};
|
|
198
|
+
readonly requestDigest: {
|
|
199
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
200
|
+
readonly description: "The task digest (SPEC §4.9.3) of the request document this answers: multibase(multihash(H(JCS(request without its top-level proof)))). It binds the answer to the exact question, challenge, note, parties and deadline the responder was shown, so a yes given to one ask cannot be presented as a yes to another.";
|
|
201
|
+
};
|
|
202
|
+
readonly decision: {
|
|
203
|
+
readonly type: "string";
|
|
204
|
+
readonly enum: readonly ["confirmed", "notConfirmed"];
|
|
205
|
+
readonly description: "The responder's answer. `confirmed` means yes to the question as asked; `notConfirmed` means no.";
|
|
206
|
+
};
|
|
207
|
+
readonly respondedAt: {
|
|
208
|
+
readonly type: "string";
|
|
209
|
+
readonly format: "date-time";
|
|
210
|
+
readonly description: "When the responder gave the answer, RFC 3339. Informational for the asker; freshness is judged against the request's `payload.expiresAt` and the asker's own clock. It is the time of the user's answer; the envelope `issuedAt` is when the responder signed the document, which may be later.";
|
|
211
|
+
};
|
|
212
|
+
readonly notConfirmedReason: {
|
|
213
|
+
readonly type: "string";
|
|
214
|
+
readonly enum: readonly ["notRecognized", "declined", "other"];
|
|
215
|
+
readonly description: "OPTIONAL, and only with `decision: notConfirmed`, which the schema enforces; a document carrying it beside `confirmed` is invalid. `notRecognized` — the responder does not recognize what the question describes; `declined` — the responder recognizes it and says no; `other` — anything else. An enumeration rather than prose, so an asker never renders responder-authored text.";
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
readonly DigestMultibase: {
|
|
220
|
+
readonly title: "DigestMultibase";
|
|
221
|
+
readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
|
|
222
|
+
readonly type: "string";
|
|
223
|
+
readonly minLength: 16;
|
|
224
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
225
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
231
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
232
|
+
* per-specification and cannot be derived from the document alone, and
|
|
233
|
+
* item 2 needs the schema this carries.
|
|
234
|
+
*/
|
|
235
|
+
export declare const SPEC: {
|
|
236
|
+
readonly typeUri: "https://trusttasks.org/spec/peer-check/ask/0.1";
|
|
237
|
+
readonly isBearer: false;
|
|
238
|
+
readonly isProofRequired: true;
|
|
239
|
+
readonly isRecipientRequired: true;
|
|
240
|
+
readonly isIssuedAtRequired: true;
|
|
241
|
+
readonly payloadSchema: {
|
|
242
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
243
|
+
readonly $id: "https://trusttasks.org/spec/peer-check/ask/0.1";
|
|
244
|
+
readonly title: "Peer Check — Ask — payload";
|
|
245
|
+
readonly description: "The request payload of peer-check/ask: a short yes-or-no question one party puts to another, with an unguessable challenge. The outer document members (id, type, issuer, recipient, issuedAt, expiresAt, proof) are owned by the framework — SPEC §6.3. The asker is the `issuer`, the party being asked is the `recipient`, and the payload MUST carry `expiresAt`, the deadline for the answer. The envelope `expiresAt` keeps its framework meaning (SPEC §4.2): after it the responder does not prompt for the request.";
|
|
246
|
+
readonly type: "object";
|
|
247
|
+
readonly additionalProperties: false;
|
|
248
|
+
readonly required: readonly ["challenge", "question", "expiresAt"];
|
|
249
|
+
readonly properties: {
|
|
250
|
+
readonly challenge: {
|
|
251
|
+
readonly type: "string";
|
|
252
|
+
readonly pattern: "^[A-Za-z0-9_-]{22,86}$";
|
|
253
|
+
readonly description: "An unguessable value the asker generates for this one question: at least 128 bits from a cryptographically secure random source, encoded base64url without padding (22 to 86 characters). The responder echoes it unchanged in its answer.";
|
|
254
|
+
};
|
|
255
|
+
readonly question: {
|
|
256
|
+
readonly type: "string";
|
|
257
|
+
readonly minLength: 1;
|
|
258
|
+
readonly maxLength: 200;
|
|
259
|
+
readonly description: "What the asker wants confirmed, in one short sentence, for example \"Did you just ask me to send you a one-time code?\". It is asker-authored text the responder's device displays attributed to the asker, never as a statement the device itself vouches for.";
|
|
260
|
+
};
|
|
261
|
+
readonly note: {
|
|
262
|
+
readonly type: "string";
|
|
263
|
+
readonly minLength: 1;
|
|
264
|
+
readonly maxLength: 500;
|
|
265
|
+
readonly description: "OPTIONAL extra context from the asker. It is UNTRUSTED display text: the responder's device MUST render it as plain text, attributed to the asker and visually distinct from anything the device itself asserts, and MUST NOT interpret it as markup, a link, or an instruction.";
|
|
266
|
+
};
|
|
267
|
+
readonly expiresAt: {
|
|
268
|
+
readonly type: "string";
|
|
269
|
+
readonly format: "date-time";
|
|
270
|
+
readonly description: "The answer deadline. After this instant the pending question lapses: the responder does not prompt for it and the asker accepts no answer. It is the task's own deadline (SPEC §7.3 item 16); the envelope `expiresAt` bounds only acceptance of the request document.";
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
readonly $defs: {
|
|
274
|
+
readonly Response: {
|
|
275
|
+
readonly $anchor: "response";
|
|
276
|
+
readonly title: "Peer Check Ask Response Payload";
|
|
277
|
+
readonly type: "object";
|
|
278
|
+
readonly additionalProperties: false;
|
|
279
|
+
readonly required: readonly ["challenge", "requestDigest", "decision", "respondedAt"];
|
|
280
|
+
readonly description: "The success-response payload: the responder's answer, signed by the responder. Failures use trust-task-error, not this shape. A responder that declines because it does not recognize the question answers with `decision: notConfirmed`; an error is for a document the responder could not act on at all.";
|
|
281
|
+
readonly dependentSchemas: {
|
|
282
|
+
readonly notConfirmedReason: {
|
|
283
|
+
readonly properties: {
|
|
284
|
+
readonly decision: {
|
|
285
|
+
readonly const: "notConfirmed";
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
readonly properties: {
|
|
291
|
+
readonly challenge: {
|
|
292
|
+
readonly type: "string";
|
|
293
|
+
readonly pattern: "^[A-Za-z0-9_-]{22,86}$";
|
|
294
|
+
readonly description: "The `challenge` of the request, echoed unchanged. The asker rejects an answer whose challenge it did not issue, or has already consumed.";
|
|
295
|
+
};
|
|
296
|
+
readonly requestDigest: {
|
|
297
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
298
|
+
readonly description: "The task digest (SPEC §4.9.3) of the request document this answers: multibase(multihash(H(JCS(request without its top-level proof)))). It binds the answer to the exact question, challenge, note, parties and deadline the responder was shown, so a yes given to one ask cannot be presented as a yes to another.";
|
|
299
|
+
};
|
|
300
|
+
readonly decision: {
|
|
301
|
+
readonly type: "string";
|
|
302
|
+
readonly enum: readonly ["confirmed", "notConfirmed"];
|
|
303
|
+
readonly description: "The responder's answer. `confirmed` means yes to the question as asked; `notConfirmed` means no.";
|
|
304
|
+
};
|
|
305
|
+
readonly respondedAt: {
|
|
306
|
+
readonly type: "string";
|
|
307
|
+
readonly format: "date-time";
|
|
308
|
+
readonly description: "When the responder gave the answer, RFC 3339. Informational for the asker; freshness is judged against the request's `payload.expiresAt` and the asker's own clock. It is the time of the user's answer; the envelope `issuedAt` is when the responder signed the document, which may be later.";
|
|
309
|
+
};
|
|
310
|
+
readonly notConfirmedReason: {
|
|
311
|
+
readonly type: "string";
|
|
312
|
+
readonly enum: readonly ["notRecognized", "declined", "other"];
|
|
313
|
+
readonly description: "OPTIONAL, and only with `decision: notConfirmed`, which the schema enforces; a document carrying it beside `confirmed` is invalid. `notRecognized` — the responder does not recognize what the question describes; `declined` — the responder recognizes it and says no; `other` — anything else. An enumeration rather than prose, so an asker never renders responder-authored text.";
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
readonly DigestMultibase: {
|
|
318
|
+
readonly title: "DigestMultibase";
|
|
319
|
+
readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
|
|
320
|
+
readonly type: "string";
|
|
321
|
+
readonly minLength: 16;
|
|
322
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
323
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
330
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
331
|
+
* parties (§7.3 item 5).
|
|
332
|
+
*/
|
|
333
|
+
export declare const RESPONSE_SPEC: {
|
|
334
|
+
readonly typeUri: "https://trusttasks.org/spec/peer-check/ask/0.1#response";
|
|
335
|
+
readonly isBearer: false;
|
|
336
|
+
readonly isProofRequired: true;
|
|
337
|
+
readonly isRecipientRequired: true;
|
|
338
|
+
readonly isIssuedAtRequired: true;
|
|
339
|
+
readonly payloadSchema: {
|
|
340
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
341
|
+
readonly $ref: "#/$defs/Response";
|
|
342
|
+
readonly $defs: {
|
|
343
|
+
readonly Response: {
|
|
344
|
+
readonly $anchor: "response";
|
|
345
|
+
readonly title: "Peer Check Ask Response Payload";
|
|
346
|
+
readonly type: "object";
|
|
347
|
+
readonly additionalProperties: false;
|
|
348
|
+
readonly required: readonly ["challenge", "requestDigest", "decision", "respondedAt"];
|
|
349
|
+
readonly description: "The success-response payload: the responder's answer, signed by the responder. Failures use trust-task-error, not this shape. A responder that declines because it does not recognize the question answers with `decision: notConfirmed`; an error is for a document the responder could not act on at all.";
|
|
350
|
+
readonly dependentSchemas: {
|
|
351
|
+
readonly notConfirmedReason: {
|
|
352
|
+
readonly properties: {
|
|
353
|
+
readonly decision: {
|
|
354
|
+
readonly const: "notConfirmed";
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
readonly properties: {
|
|
360
|
+
readonly challenge: {
|
|
361
|
+
readonly type: "string";
|
|
362
|
+
readonly pattern: "^[A-Za-z0-9_-]{22,86}$";
|
|
363
|
+
readonly description: "The `challenge` of the request, echoed unchanged. The asker rejects an answer whose challenge it did not issue, or has already consumed.";
|
|
364
|
+
};
|
|
365
|
+
readonly requestDigest: {
|
|
366
|
+
readonly $ref: "#/$defs/DigestMultibase";
|
|
367
|
+
readonly description: "The task digest (SPEC §4.9.3) of the request document this answers: multibase(multihash(H(JCS(request without its top-level proof)))). It binds the answer to the exact question, challenge, note, parties and deadline the responder was shown, so a yes given to one ask cannot be presented as a yes to another.";
|
|
368
|
+
};
|
|
369
|
+
readonly decision: {
|
|
370
|
+
readonly type: "string";
|
|
371
|
+
readonly enum: readonly ["confirmed", "notConfirmed"];
|
|
372
|
+
readonly description: "The responder's answer. `confirmed` means yes to the question as asked; `notConfirmed` means no.";
|
|
373
|
+
};
|
|
374
|
+
readonly respondedAt: {
|
|
375
|
+
readonly type: "string";
|
|
376
|
+
readonly format: "date-time";
|
|
377
|
+
readonly description: "When the responder gave the answer, RFC 3339. Informational for the asker; freshness is judged against the request's `payload.expiresAt` and the asker's own clock. It is the time of the user's answer; the envelope `issuedAt` is when the responder signed the document, which may be later.";
|
|
378
|
+
};
|
|
379
|
+
readonly notConfirmedReason: {
|
|
380
|
+
readonly type: "string";
|
|
381
|
+
readonly enum: readonly ["notRecognized", "declined", "other"];
|
|
382
|
+
readonly description: "OPTIONAL, and only with `decision: notConfirmed`, which the schema enforces; a document carrying it beside `confirmed` is invalid. `notRecognized` — the responder does not recognize what the question describes; `declined` — the responder recognizes it and says no; `other` — anything else. An enumeration rather than prose, so an asker never renders responder-authored text.";
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
readonly DigestMultibase: {
|
|
387
|
+
readonly title: "DigestMultibase";
|
|
388
|
+
readonly description: "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.";
|
|
389
|
+
readonly type: "string";
|
|
390
|
+
readonly minLength: 16;
|
|
391
|
+
readonly pattern: "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$";
|
|
392
|
+
readonly examples: readonly ["zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"];
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../src/peer-check/ask/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGtE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AACD;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,aAAa,EAAE,eAAe,CAAC;IAC/B;;OAEG;IACH,QAAQ,EAAE,WAAW,GAAG,cAAc,CAAC;IACvC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,kBAAkB,CAAC,EAAE,eAAe,GAAG,UAAU,GAAG,OAAO,CAAC;CAC7D;AAED,kHAAkH;AAClH,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,EAAG,gDAAyD,CAAC;AAElF;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,GAAG,IAAW,CAAC;AAE3C;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,GAAG,IAAW,CAAC;AAE/C,mEAAmE;AACnE,MAAM,MAAM,OAAO,GAAG,mBAAmB,CAAC;AAE1C,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,EAAG,yDAAkE,CAAC;AAEpG,4EAA4E;AAC5E,MAAM,MAAM,QAAQ,GAAG,2BAA2B,CAAC;AAEnD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuGjB,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsE1B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOP,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhB,CAAC"}
|