@openvtc/trust-tasks 0.27.8 → 0.28.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +164 -0
  2. package/README.md +9 -0
  3. package/dist/_runtime/codes.d.ts +22 -3
  4. package/dist/_runtime/codes.d.ts.map +1 -1
  5. package/dist/_runtime/codes.js +26 -19
  6. package/dist/_runtime/codes.js.map +1 -1
  7. package/dist/_runtime/document.d.ts +1 -1
  8. package/dist/_runtime/document.js +1 -1
  9. package/dist/_runtime/extends.d.ts +16 -7
  10. package/dist/_runtime/extends.d.ts.map +1 -1
  11. package/dist/_runtime/extends.js +44 -35
  12. package/dist/_runtime/extends.js.map +1 -1
  13. package/dist/_runtime/index.d.ts +1 -0
  14. package/dist/_runtime/index.d.ts.map +1 -1
  15. package/dist/_runtime/index.js +1 -0
  16. package/dist/_runtime/index.js.map +1 -1
  17. package/dist/_runtime/type-uri.d.ts +96 -0
  18. package/dist/_runtime/type-uri.d.ts.map +1 -0
  19. package/dist/_runtime/type-uri.js +194 -0
  20. package/dist/_runtime/type-uri.js.map +1 -0
  21. package/dist/_shared/components.d.ts +39 -0
  22. package/dist/_shared/components.d.ts.map +1 -1
  23. package/dist/index.d.ts +3778 -1257
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +3778 -1257
  26. package/dist/index.js.map +1 -1
  27. package/dist/policy/_shared/0.4/policy.d.ts +16 -0
  28. package/dist/policy/_shared/0.4/policy.d.ts.map +1 -0
  29. package/dist/policy/_shared/0.4/policy.js +6 -0
  30. package/dist/policy/_shared/0.4/policy.js.map +1 -0
  31. package/dist/policy/evaluate/0.1/payload.d.ts +4 -4
  32. package/dist/policy/evaluate/0.1/payload.js +1 -1
  33. package/dist/policy/evaluate/0.2/payload.d.ts +4 -4
  34. package/dist/policy/evaluate/0.2/payload.js +1 -1
  35. package/dist/policy/evaluate/0.3/payload.d.ts +13 -2
  36. package/dist/policy/evaluate/0.3/payload.d.ts.map +1 -1
  37. package/dist/policy/evaluate/0.3/payload.js +1 -1
  38. package/dist/policy/evaluate/0.3/payload.js.map +1 -1
  39. package/dist/policy/evaluate/0.4/payload.d.ts +1416 -0
  40. package/dist/policy/evaluate/0.4/payload.d.ts.map +1 -0
  41. package/dist/policy/evaluate/0.4/payload.js +899 -0
  42. package/dist/policy/evaluate/0.4/payload.js.map +1 -0
  43. package/dist/trust-task-error/0.1/payload.d.ts +2 -2
  44. package/dist/trust-task-error/0.1/payload.js +1 -1
  45. package/dist/trust-task-error/0.2/payload.d.ts +2 -2
  46. package/dist/trust-task-error/0.2/payload.js +1 -1
  47. package/dist/trust-task-error/0.3/payload.d.ts +2 -2
  48. package/dist/trust-task-error/0.3/payload.js +1 -1
  49. package/dist/trust-task-error/0.4/payload.d.ts +2 -2
  50. package/dist/trust-task-error/0.4/payload.js +1 -1
  51. package/dist/trust-task-error/0.5/payload.d.ts +7 -1
  52. package/dist/trust-task-error/0.5/payload.d.ts.map +1 -1
  53. package/dist/trust-task-error/0.5/payload.js +1 -1
  54. package/dist/trust-task-error/0.5/payload.js.map +1 -1
  55. package/dist/trust-task-error/0.6/payload.d.ts +199 -0
  56. package/dist/trust-task-error/0.6/payload.d.ts.map +1 -0
  57. package/dist/trust-task-error/0.6/payload.js +126 -0
  58. package/dist/trust-task-error/0.6/payload.js.map +1 -0
  59. package/package.json +1 -1
  60. package/src/_runtime/codes.ts +27 -21
  61. package/src/_runtime/document.ts +1 -1
  62. package/src/_runtime/extends.ts +50 -40
  63. package/src/_runtime/index.ts +14 -0
  64. package/src/_runtime/type-uri.ts +252 -0
  65. package/src/_shared/components.ts +39 -0
  66. package/src/index.ts +3778 -1257
  67. package/src/policy/_shared/0.4/policy.ts +17 -0
  68. package/src/policy/evaluate/0.1/payload.ts +5 -5
  69. package/src/policy/evaluate/0.2/payload.ts +5 -5
  70. package/src/policy/evaluate/0.3/payload.ts +14 -3
  71. package/src/policy/evaluate/0.4/payload.ts +944 -0
  72. package/src/trust-task-error/0.1/payload.ts +3 -3
  73. package/src/trust-task-error/0.2/payload.ts +3 -3
  74. package/src/trust-task-error/0.3/payload.ts +3 -3
  75. package/src/trust-task-error/0.4/payload.ts +3 -3
  76. package/src/trust-task-error/0.5/payload.ts +8 -2
  77. package/src/trust-task-error/0.6/payload.ts +195 -0
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * The canonical error-response payload per SPEC.md §8.2.
8
8
  *
9
- * @deprecated superseded by trust-task-error/0.5
9
+ * @deprecated superseded by trust-task-error/0.6
10
10
  */
11
11
  export interface TrustTaskErrorPayload {
12
12
  /**
@@ -67,12 +67,12 @@ export const EXTENDS: string | null = null;
67
67
  * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
68
68
  * Versions").
69
69
  */
70
- export const DEPRECATION: string | null = "superseded by trust-task-error/0.5";
70
+ export const DEPRECATION: string | null = "superseded by trust-task-error/0.6";
71
71
 
72
72
  /**
73
73
  * Stable alias for this specification's request payload shape.
74
74
  *
75
- * @deprecated superseded by trust-task-error/0.5
75
+ * @deprecated superseded by trust-task-error/0.6
76
76
  */
77
77
  export type Payload = TrustTaskErrorPayload;
78
78
 
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * The canonical error-response payload per SPEC.md §8.2.
8
8
  *
9
- * @deprecated superseded by trust-task-error/0.5
9
+ * @deprecated superseded by trust-task-error/0.6
10
10
  */
11
11
  export interface TrustTaskErrorPayload {
12
12
  /**
@@ -67,12 +67,12 @@ export const EXTENDS: string | null = null;
67
67
  * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
68
68
  * Versions").
69
69
  */
70
- export const DEPRECATION: string | null = "superseded by trust-task-error/0.5";
70
+ export const DEPRECATION: string | null = "superseded by trust-task-error/0.6";
71
71
 
72
72
  /**
73
73
  * Stable alias for this specification's request payload shape.
74
74
  *
75
- * @deprecated superseded by trust-task-error/0.5
75
+ * @deprecated superseded by trust-task-error/0.6
76
76
  */
77
77
  export type Payload = TrustTaskErrorPayload;
78
78
 
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * The canonical error-response payload per SPEC.md §8.2.
8
8
  *
9
- * @deprecated superseded by trust-task-error/0.5
9
+ * @deprecated superseded by trust-task-error/0.6
10
10
  */
11
11
  export interface TrustTaskErrorPayload {
12
12
  /**
@@ -80,12 +80,12 @@ export const EXTENDS: string | null = null;
80
80
  * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
81
81
  * Versions").
82
82
  */
83
- export const DEPRECATION: string | null = "superseded by trust-task-error/0.5";
83
+ export const DEPRECATION: string | null = "superseded by trust-task-error/0.6";
84
84
 
85
85
  /**
86
86
  * Stable alias for this specification's request payload shape.
87
87
  *
88
- * @deprecated superseded by trust-task-error/0.5
88
+ * @deprecated superseded by trust-task-error/0.6
89
89
  */
90
90
  export type Payload = TrustTaskErrorPayload;
91
91
 
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * The canonical error-response payload per SPEC.md §8.2.
8
8
  *
9
- * @deprecated superseded by trust-task-error/0.5
9
+ * @deprecated superseded by trust-task-error/0.6
10
10
  */
11
11
  export interface TrustTaskErrorPayload {
12
12
  /**
@@ -81,12 +81,12 @@ export const EXTENDS: string | null = null;
81
81
  * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
82
82
  * Versions").
83
83
  */
84
- export const DEPRECATION: string | null = "superseded by trust-task-error/0.5";
84
+ export const DEPRECATION: string | null = "superseded by trust-task-error/0.6";
85
85
 
86
86
  /**
87
87
  * Stable alias for this specification's request payload shape.
88
88
  *
89
- * @deprecated superseded by trust-task-error/0.5
89
+ * @deprecated superseded by trust-task-error/0.6
90
90
  */
91
91
  export type Payload = TrustTaskErrorPayload;
92
92
 
@@ -5,6 +5,8 @@
5
5
 
6
6
  /**
7
7
  * The canonical error-response payload per SPEC.md §8.2.
8
+ *
9
+ * @deprecated superseded by trust-task-error/0.6
8
10
  */
9
11
  export interface TrustTaskErrorPayload {
10
12
  /**
@@ -80,9 +82,13 @@ export const EXTENDS: string | null = null;
80
82
  * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
81
83
  * Versions").
82
84
  */
83
- export const DEPRECATION: string | null = null;
85
+ export const DEPRECATION: string | null = "superseded by trust-task-error/0.6";
84
86
 
85
- /** Stable alias for this specification's request payload shape. */
87
+ /**
88
+ * Stable alias for this specification's request payload shape.
89
+ *
90
+ * @deprecated superseded by trust-task-error/0.6
91
+ */
86
92
  export type Payload = TrustTaskErrorPayload;
87
93
 
88
94
  /**
@@ -0,0 +1,195 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/trust-task-error/0.6/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:roleNotRecognized').
12
+ */
13
+ code: (
14
+ | (
15
+ | "malformedRequest"
16
+ | "unsupportedType"
17
+ | "unsupportedVersion"
18
+ | "expired"
19
+ | "proofRequired"
20
+ | "proofInvalid"
21
+ | "permissionDenied"
22
+ | "wrongRecipient"
23
+ | "identityMismatch"
24
+ | "idConflict"
25
+ | "cancelled"
26
+ | "taskFailed"
27
+ | "unavailable"
28
+ | "internalError"
29
+ | "unsupportedExtension"
30
+ | "indeterminate"
31
+ )
32
+ | {
33
+ [k: string]: unknown | undefined;
34
+ }
35
+ ) &
36
+ string;
37
+ /**
38
+ * 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.
39
+ */
40
+ inResponseTo?: {
41
+ /**
42
+ * 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.
43
+ */
44
+ typeUri: string;
45
+ /**
46
+ * 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.
47
+ */
48
+ id?: string;
49
+ };
50
+ /**
51
+ * Human-readable description of the error. Non-normative; intended for logs and operator UI.
52
+ */
53
+ message?: string;
54
+ /**
55
+ * true if the producer of the original document MAY retry; false if retrying with the same document is not expected to succeed.
56
+ */
57
+ retryable: boolean;
58
+ /**
59
+ * RFC 3339 timestamp before which the producer SHOULD NOT retry. Meaningful only when retryable is true.
60
+ */
61
+ retryAfter?: string;
62
+ /**
63
+ * Optional task-specific extension data. Per-spec error code declarations may pin the shape via a JSON Schema fragment.
64
+ */
65
+ details?: {};
66
+ }
67
+
68
+ /** Trust Task type URI. */
69
+ export const TYPE_URI = "https://trusttasks.org/spec/trust-task-error/0.6" as const;
70
+
71
+ /**
72
+ * The earlier version of this specification that this one declares it
73
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
74
+ * `null`. Only the direct declaration — follow the chain with
75
+ * `extendsChain` / `readForSpec`.
76
+ */
77
+ export const EXTENDS: string | null = "0.5";
78
+
79
+ /**
80
+ * Why this version is deprecated, or `null` while it is current. A
81
+ * superseded or retired version is still supported, and is withdrawn from
82
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
83
+ * Versions").
84
+ */
85
+ export const DEPRECATION: string | null = null;
86
+
87
+ /** Stable alias for this specification's request payload shape. */
88
+ export type Payload = TrustTaskErrorPayload;
89
+
90
+ /**
91
+ * This specification's payload schema, as a value.
92
+ *
93
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
94
+ * rather than only as a `.json` file because TypeScript types are erased
95
+ * at runtime: without a schema a consumer has nothing to validate, and
96
+ * every REQUIRED payload member is optional in practice. Cross-file
97
+ * `$ref`s are already inlined, so it needs no resolver.
98
+ */
99
+ export const PAYLOAD_SCHEMA = {
100
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
101
+ "$id": "https://trusttasks.org/spec/trust-task-error/0.6",
102
+ "title": "Trust Task Error — payload",
103
+ "description": "The canonical error-response payload per SPEC.md §8.2.",
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": [
107
+ "code",
108
+ "retryable"
109
+ ],
110
+ "properties": {
111
+ "code": {
112
+ "type": "string",
113
+ "description": "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:roleNotRecognized').",
114
+ "anyOf": [
115
+ {
116
+ "enum": [
117
+ "malformedRequest",
118
+ "unsupportedType",
119
+ "unsupportedVersion",
120
+ "expired",
121
+ "proofRequired",
122
+ "proofInvalid",
123
+ "permissionDenied",
124
+ "wrongRecipient",
125
+ "identityMismatch",
126
+ "idConflict",
127
+ "cancelled",
128
+ "taskFailed",
129
+ "unavailable",
130
+ "internalError",
131
+ "unsupportedExtension",
132
+ "indeterminate"
133
+ ]
134
+ },
135
+ {
136
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*(/[a-z][a-z0-9]*(-[a-z0-9]+)*)*:[a-z][a-zA-Z0-9_]*$"
137
+ }
138
+ ]
139
+ },
140
+ "inResponseTo": {
141
+ "type": "object",
142
+ "additionalProperties": false,
143
+ "required": [
144
+ "typeUri"
145
+ ],
146
+ "description": "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.",
147
+ "properties": {
148
+ "typeUri": {
149
+ "type": "string",
150
+ "format": "uri",
151
+ "minLength": 1,
152
+ "description": "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."
153
+ },
154
+ "id": {
155
+ "type": "string",
156
+ "minLength": 1,
157
+ "description": "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."
158
+ }
159
+ }
160
+ },
161
+ "message": {
162
+ "type": "string",
163
+ "maxLength": 1024,
164
+ "description": "Human-readable description of the error. Non-normative; intended for logs and operator UI."
165
+ },
166
+ "retryable": {
167
+ "type": "boolean",
168
+ "description": "true if the producer of the original document MAY retry; false if retrying with the same document is not expected to succeed."
169
+ },
170
+ "retryAfter": {
171
+ "type": "string",
172
+ "format": "date-time",
173
+ "description": "RFC 3339 timestamp before which the producer SHOULD NOT retry. Meaningful only when retryable is true."
174
+ },
175
+ "details": {
176
+ "type": "object",
177
+ "description": "Optional task-specific extension data. Per-spec error code declarations may pin the shape via a JSON Schema fragment."
178
+ }
179
+ }
180
+ } as const;
181
+
182
+ /**
183
+ * SPEC.md §7.2 policy for the request variant, from this specification's
184
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
185
+ * per-specification and cannot be derived from the document alone, and
186
+ * item 2 needs the schema this carries.
187
+ */
188
+ export const SPEC = {
189
+ typeUri: TYPE_URI,
190
+ isBearer: false,
191
+ isProofRequired: false,
192
+ isRecipientRequired: true,
193
+ isIssuedAtRequired: false,
194
+ payloadSchema: PAYLOAD_SCHEMA,
195
+ } as const;