@jarenjs/contract 0.43.1
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/README.md +508 -0
- package/dist/types/adapters/fetch.d.ts +27 -0
- package/dist/types/adapters/node.d.ts +47 -0
- package/dist/types/app/binding.d.ts +122 -0
- package/dist/types/app/effect.d.ts +77 -0
- package/dist/types/app/index.d.ts +31 -0
- package/dist/types/app/subscription.d.ts +82 -0
- package/dist/types/bundle.d.ts +43 -0
- package/dist/types/cli.d.ts +15 -0
- package/dist/types/client/http.d.ts +242 -0
- package/dist/types/client/outcome.d.ts +289 -0
- package/dist/types/compat.d.ts +36 -0
- package/dist/types/compile.d.ts +196 -0
- package/dist/types/describe.d.ts +115 -0
- package/dist/types/diff.d.ts +91 -0
- package/dist/types/errors.d.ts +205 -0
- package/dist/types/http/dispatch.d.ts +148 -0
- package/dist/types/http/serve.d.ts +154 -0
- package/dist/types/http/wire.d.ts +334 -0
- package/dist/types/index.d.ts +39 -0
- package/dist/types/ledger.d.ts +207 -0
- package/dist/types/local/index.d.ts +127 -0
- package/dist/types/messages.d.ts +63 -0
- package/dist/types/path.d.ts +119 -0
- package/dist/types/pipeline.d.ts +157 -0
- package/dist/types/port/client.d.ts +142 -0
- package/dist/types/port/frame.d.ts +195 -0
- package/dist/types/port/serve.d.ts +102 -0
- package/dist/types/project/index.d.ts +34 -0
- package/dist/types/project/markdown.d.ts +28 -0
- package/dist/types/project/openapi.d.ts +102 -0
- package/dist/types/project/tools.d.ts +57 -0
- package/dist/types/project/typescript.d.ts +59 -0
- package/dist/types/public.d.ts +73 -0
- package/dist/types/revision.d.ts +36 -0
- package/dist/types/stream/client.d.ts +104 -0
- package/dist/types/stream/server.d.ts +106 -0
- package/dist/types/stream/sse.d.ts +62 -0
- package/docs/APP-INTEGRATION.md +301 -0
- package/docs/CONTRACT-FORMAT.md +1923 -0
- package/package.json +110 -0
- package/schemas/jaren-contract-port.draft-07.schema.json +241 -0
- package/schemas/jaren-contract-port.schema.json +241 -0
- package/schemas/jaren-contract.draft-07.schema.json +287 -0
- package/schemas/jaren-contract.schema.json +287 -0
- package/src/adapters/fetch.js +109 -0
- package/src/adapters/node.js +238 -0
- package/src/app/binding.js +426 -0
- package/src/app/effect.js +190 -0
- package/src/app/index.js +26 -0
- package/src/app/subscription.js +130 -0
- package/src/bundle.js +168 -0
- package/src/cli.js +264 -0
- package/src/client/http.js +1150 -0
- package/src/client/outcome.js +364 -0
- package/src/compat.js +62 -0
- package/src/compile.js +1162 -0
- package/src/describe.js +109 -0
- package/src/diff.js +610 -0
- package/src/errors.js +236 -0
- package/src/http/dispatch.js +1054 -0
- package/src/http/serve.js +301 -0
- package/src/http/wire.js +469 -0
- package/src/index.js +33 -0
- package/src/ledger.js +225 -0
- package/src/local/index.js +363 -0
- package/src/messages.js +68 -0
- package/src/path.js +471 -0
- package/src/pipeline.js +241 -0
- package/src/port/client.js +518 -0
- package/src/port/frame.js +196 -0
- package/src/port/serve.js +442 -0
- package/src/project/index.js +29 -0
- package/src/project/markdown.js +244 -0
- package/src/project/openapi.js +564 -0
- package/src/project/openapi.jslt.json +149 -0
- package/src/project/tools.js +139 -0
- package/src/project/typescript.js +152 -0
- package/src/project/typescript.jtlt.json +72 -0
- package/src/public.js +206 -0
- package/src/revision.js +90 -0
- package/src/stream/client.js +212 -0
- package/src/stream/server.js +306 -0
- package/src/stream/sse.js +67 -0
package/package.json
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jarenjs/contract",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.43.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"types": "./dist/types/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"bin": {
|
|
10
|
+
"jaren-contract": "./src/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/types/index.d.ts",
|
|
15
|
+
"default": "./src/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./http": {
|
|
18
|
+
"types": "./dist/types/http/serve.d.ts",
|
|
19
|
+
"default": "./src/http/serve.js"
|
|
20
|
+
},
|
|
21
|
+
"./fetch": {
|
|
22
|
+
"types": "./dist/types/adapters/fetch.d.ts",
|
|
23
|
+
"default": "./src/adapters/fetch.js"
|
|
24
|
+
},
|
|
25
|
+
"./node": {
|
|
26
|
+
"types": "./dist/types/adapters/node.d.ts",
|
|
27
|
+
"default": "./src/adapters/node.js"
|
|
28
|
+
},
|
|
29
|
+
"./ledger": {
|
|
30
|
+
"types": "./dist/types/ledger.d.ts",
|
|
31
|
+
"default": "./src/ledger.js"
|
|
32
|
+
},
|
|
33
|
+
"./diff": {
|
|
34
|
+
"types": "./dist/types/diff.d.ts",
|
|
35
|
+
"default": "./src/diff.js"
|
|
36
|
+
},
|
|
37
|
+
"./client": {
|
|
38
|
+
"types": "./dist/types/client/http.d.ts",
|
|
39
|
+
"default": "./src/client/http.js"
|
|
40
|
+
},
|
|
41
|
+
"./local": {
|
|
42
|
+
"types": "./dist/types/local/index.d.ts",
|
|
43
|
+
"default": "./src/local/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./port": {
|
|
46
|
+
"types": "./dist/types/port/serve.d.ts",
|
|
47
|
+
"default": "./src/port/serve.js"
|
|
48
|
+
},
|
|
49
|
+
"./stream": {
|
|
50
|
+
"types": "./dist/types/stream/server.d.ts",
|
|
51
|
+
"default": "./src/stream/server.js"
|
|
52
|
+
},
|
|
53
|
+
"./app": {
|
|
54
|
+
"types": "./dist/types/app/index.d.ts",
|
|
55
|
+
"default": "./src/app/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./project": {
|
|
58
|
+
"types": "./dist/types/project/index.d.ts",
|
|
59
|
+
"default": "./src/project/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./schemas/*": "./schemas/*",
|
|
62
|
+
"./package.json": "./package.json"
|
|
63
|
+
},
|
|
64
|
+
"files": [
|
|
65
|
+
"dist/types/",
|
|
66
|
+
"src/",
|
|
67
|
+
"docs/",
|
|
68
|
+
"schemas/"
|
|
69
|
+
],
|
|
70
|
+
"description": "Operation contracts for the Jaren suite: the jaren-contract document declares JSON-in/JSON-out operations with kind, policy and an HTTP binding, compiled once into per-operation validators, transport normalizers and a static-beats-variable path matcher, served over HTTP through a total dispatch pipeline with fetch and node adapters, in-process through the local binding and over MessagePort/Worker/BroadcastChannel through the port binding with collision-free request ids, called through clients that resolve JSON outcomes, bound to @jarenjs/app documents through generated task slots and one effect, and projected to a public subset, OpenAPI 3.1, TypeScript, Markdown and AI tool definitions with a jaren-contract CLI that checks them in CI",
|
|
71
|
+
"author": "joham",
|
|
72
|
+
"repository": {
|
|
73
|
+
"type": "git",
|
|
74
|
+
"url": "git+https://github.com/jklarenbeek/jarenjs.git",
|
|
75
|
+
"directory": "packages/contract"
|
|
76
|
+
},
|
|
77
|
+
"license": "MIT",
|
|
78
|
+
"engines": {
|
|
79
|
+
"node": ">=24"
|
|
80
|
+
},
|
|
81
|
+
"publishConfig": {
|
|
82
|
+
"access": "public",
|
|
83
|
+
"registry": "https://registry.npmjs.org/"
|
|
84
|
+
},
|
|
85
|
+
"keywords": [
|
|
86
|
+
"jaren",
|
|
87
|
+
"json",
|
|
88
|
+
"json-schema",
|
|
89
|
+
"contract",
|
|
90
|
+
"api",
|
|
91
|
+
"rest",
|
|
92
|
+
"router",
|
|
93
|
+
"openapi",
|
|
94
|
+
"typescript",
|
|
95
|
+
"idempotency",
|
|
96
|
+
"client",
|
|
97
|
+
"outcome"
|
|
98
|
+
],
|
|
99
|
+
"scripts": {
|
|
100
|
+
"build": "npm run build:types",
|
|
101
|
+
"build:types": "tsc -p tsconfig.json",
|
|
102
|
+
"prepack": "npm run build:types"
|
|
103
|
+
},
|
|
104
|
+
"dependencies": {
|
|
105
|
+
"@jarenjs/core": "^0.43.1",
|
|
106
|
+
"@jarenjs/json": "^0.43.1",
|
|
107
|
+
"@jarenjs/validate": "^0.43.1",
|
|
108
|
+
"@jarenjs/emit": "^0.43.1"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://jarenjs.dev/schemas/jaren-contract-port/0.1/draft-07",
|
|
4
|
+
"title": "Jaren contract port frame 0.1",
|
|
5
|
+
"description": "The frame grammar of the port binding (packages/contract/docs/CONTRACT-FORMAT.md §16): every message the binding puts on a MessagePort, Worker or BroadcastChannel is one of these six JSON-safe plain objects (request/response/cancel, and the stream family: subscribe/unsubscribe from a client, push events from a server), marked jaren: \"contract/0.1\" so contract traffic is distinguishable by shape from anything else sharing the channel. A request id is \"<clientId>:<seq>\" — the client id unique per client instance — so two clients on one channel can never cross-settle; the request members attempt and key are reserved and ignored by servers of this version.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "#/definitions/request"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"$ref": "#/definitions/response"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"$ref": "#/definitions/cancel"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"$ref": "#/definitions/subscribe"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"$ref": "#/definitions/unsubscribe"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"$ref": "#/definitions/push"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"definitions": {
|
|
27
|
+
"marker": {
|
|
28
|
+
"description": "The protocol and its version.",
|
|
29
|
+
"const": "contract/0.1"
|
|
30
|
+
},
|
|
31
|
+
"id": {
|
|
32
|
+
"description": "A request id: the client id (no colon), a colon, the per-client sequence number.",
|
|
33
|
+
"type": "string",
|
|
34
|
+
"pattern": "^[^:]+:[1-9][0-9]*$"
|
|
35
|
+
},
|
|
36
|
+
"request": {
|
|
37
|
+
"description": "A client's request: one operation invocation. input is the whole input object, or null for an input-less operation.",
|
|
38
|
+
"type": "object",
|
|
39
|
+
"required": [
|
|
40
|
+
"jaren",
|
|
41
|
+
"id",
|
|
42
|
+
"op",
|
|
43
|
+
"input"
|
|
44
|
+
],
|
|
45
|
+
"properties": {
|
|
46
|
+
"jaren": {
|
|
47
|
+
"$ref": "#/definitions/marker"
|
|
48
|
+
},
|
|
49
|
+
"id": {
|
|
50
|
+
"$ref": "#/definitions/id"
|
|
51
|
+
},
|
|
52
|
+
"op": {
|
|
53
|
+
"description": "The operation id, as declared in the contract.",
|
|
54
|
+
"type": "string",
|
|
55
|
+
"pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)*$"
|
|
56
|
+
},
|
|
57
|
+
"input": true,
|
|
58
|
+
"attempt": true,
|
|
59
|
+
"key": {
|
|
60
|
+
"description": "Reserved: an idempotency key. The port binding does not carry idempotency (capabilities say so); a server of this version ignores it.",
|
|
61
|
+
"type": "string"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"additionalProperties": false
|
|
65
|
+
},
|
|
66
|
+
"response": {
|
|
67
|
+
"description": "A server's answer to one request id, success or error, always carrying the server trace.",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"required": [
|
|
70
|
+
"jaren",
|
|
71
|
+
"id",
|
|
72
|
+
"ok",
|
|
73
|
+
"trace"
|
|
74
|
+
],
|
|
75
|
+
"properties": {
|
|
76
|
+
"jaren": {
|
|
77
|
+
"$ref": "#/definitions/marker"
|
|
78
|
+
},
|
|
79
|
+
"id": {
|
|
80
|
+
"$ref": "#/definitions/id"
|
|
81
|
+
},
|
|
82
|
+
"ok": {
|
|
83
|
+
"type": "boolean"
|
|
84
|
+
},
|
|
85
|
+
"value": true,
|
|
86
|
+
"error": {
|
|
87
|
+
"$ref": "#/definitions/error"
|
|
88
|
+
},
|
|
89
|
+
"trace": {
|
|
90
|
+
"description": "The server's per-request trace id (meta.trace on the client).",
|
|
91
|
+
"type": "string",
|
|
92
|
+
"minLength": 1
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"oneOf": [
|
|
96
|
+
{
|
|
97
|
+
"required": [
|
|
98
|
+
"value"
|
|
99
|
+
],
|
|
100
|
+
"properties": {
|
|
101
|
+
"ok": {
|
|
102
|
+
"const": true
|
|
103
|
+
},
|
|
104
|
+
"error": false
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"required": [
|
|
109
|
+
"error"
|
|
110
|
+
],
|
|
111
|
+
"properties": {
|
|
112
|
+
"ok": {
|
|
113
|
+
"const": false
|
|
114
|
+
},
|
|
115
|
+
"value": false
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"additionalProperties": false
|
|
120
|
+
},
|
|
121
|
+
"error": {
|
|
122
|
+
"description": "The error envelope of a failed response: a declared error code (lowercase) or a JC2xxx taxonomy/binding code; details present only when the failure carries some.",
|
|
123
|
+
"type": "object",
|
|
124
|
+
"required": [
|
|
125
|
+
"code",
|
|
126
|
+
"message"
|
|
127
|
+
],
|
|
128
|
+
"properties": {
|
|
129
|
+
"code": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"pattern": "^([a-z][a-z0-9-]*|JC[0-9]{4})$"
|
|
132
|
+
},
|
|
133
|
+
"message": {
|
|
134
|
+
"type": "string"
|
|
135
|
+
},
|
|
136
|
+
"details": true,
|
|
137
|
+
"retryable": {
|
|
138
|
+
"type": "boolean"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"additionalProperties": false
|
|
142
|
+
},
|
|
143
|
+
"cancel": {
|
|
144
|
+
"description": "A client's cancellation of one request id: aborts the server-side signal. An optimization — the id scoping is the guarantee — and never answered.",
|
|
145
|
+
"type": "object",
|
|
146
|
+
"required": [
|
|
147
|
+
"jaren",
|
|
148
|
+
"cancel"
|
|
149
|
+
],
|
|
150
|
+
"properties": {
|
|
151
|
+
"jaren": {
|
|
152
|
+
"$ref": "#/definitions/marker"
|
|
153
|
+
},
|
|
154
|
+
"cancel": {
|
|
155
|
+
"$ref": "#/definitions/id"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"additionalProperties": false
|
|
159
|
+
},
|
|
160
|
+
"subscribe": {
|
|
161
|
+
"description": "A client's subscription of one subscribe operation: opens a stream under the id. input is the whole input object, or null for an input-less operation; lastSeq, when present, asks to resume after that seq.",
|
|
162
|
+
"type": "object",
|
|
163
|
+
"required": [
|
|
164
|
+
"jaren",
|
|
165
|
+
"subscribe",
|
|
166
|
+
"op",
|
|
167
|
+
"input"
|
|
168
|
+
],
|
|
169
|
+
"properties": {
|
|
170
|
+
"jaren": {
|
|
171
|
+
"$ref": "#/definitions/marker"
|
|
172
|
+
},
|
|
173
|
+
"subscribe": {
|
|
174
|
+
"$ref": "#/definitions/id"
|
|
175
|
+
},
|
|
176
|
+
"op": {
|
|
177
|
+
"description": "The operation id, as declared in the contract.",
|
|
178
|
+
"type": "string",
|
|
179
|
+
"pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)*$"
|
|
180
|
+
},
|
|
181
|
+
"input": true,
|
|
182
|
+
"lastSeq": {
|
|
183
|
+
"description": "The last seq this client delivered; the server replays after it or answers a fresh snapshot with resumed: false.",
|
|
184
|
+
"type": "integer",
|
|
185
|
+
"minimum": 0
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"additionalProperties": false
|
|
189
|
+
},
|
|
190
|
+
"unsubscribe": {
|
|
191
|
+
"description": "A client's release of one stream id. Never answered.",
|
|
192
|
+
"type": "object",
|
|
193
|
+
"required": [
|
|
194
|
+
"jaren",
|
|
195
|
+
"unsubscribe"
|
|
196
|
+
],
|
|
197
|
+
"properties": {
|
|
198
|
+
"jaren": {
|
|
199
|
+
"$ref": "#/definitions/marker"
|
|
200
|
+
},
|
|
201
|
+
"unsubscribe": {
|
|
202
|
+
"$ref": "#/definitions/id"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"additionalProperties": false
|
|
206
|
+
},
|
|
207
|
+
"push": {
|
|
208
|
+
"description": "A server's stream event for one subscription id: snapshot data is { value, resumed }, patch data the LIVE emission { patch, seq }, error data the wire error record, end data { reason }. seq is the event's seq; error and end carry the last delivered one.",
|
|
209
|
+
"type": "object",
|
|
210
|
+
"required": [
|
|
211
|
+
"jaren",
|
|
212
|
+
"id",
|
|
213
|
+
"event",
|
|
214
|
+
"seq",
|
|
215
|
+
"data"
|
|
216
|
+
],
|
|
217
|
+
"properties": {
|
|
218
|
+
"jaren": {
|
|
219
|
+
"$ref": "#/definitions/marker"
|
|
220
|
+
},
|
|
221
|
+
"id": {
|
|
222
|
+
"$ref": "#/definitions/id"
|
|
223
|
+
},
|
|
224
|
+
"event": {
|
|
225
|
+
"enum": [
|
|
226
|
+
"snapshot",
|
|
227
|
+
"patch",
|
|
228
|
+
"error",
|
|
229
|
+
"end"
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
"seq": {
|
|
233
|
+
"type": "integer",
|
|
234
|
+
"minimum": 0
|
|
235
|
+
},
|
|
236
|
+
"data": true
|
|
237
|
+
},
|
|
238
|
+
"additionalProperties": false
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jarenjs.dev/schemas/jaren-contract-port/0.1",
|
|
4
|
+
"title": "Jaren contract port frame 0.1",
|
|
5
|
+
"description": "The frame grammar of the port binding (packages/contract/docs/CONTRACT-FORMAT.md §16): every message the binding puts on a MessagePort, Worker or BroadcastChannel is one of these six JSON-safe plain objects (request/response/cancel, and the stream family: subscribe/unsubscribe from a client, push events from a server), marked jaren: \"contract/0.1\" so contract traffic is distinguishable by shape from anything else sharing the channel. A request id is \"<clientId>:<seq>\" — the client id unique per client instance — so two clients on one channel can never cross-settle; the request members attempt and key are reserved and ignored by servers of this version.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "#/$defs/request"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"$ref": "#/$defs/response"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"$ref": "#/$defs/cancel"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"$ref": "#/$defs/subscribe"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"$ref": "#/$defs/unsubscribe"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"$ref": "#/$defs/push"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"$defs": {
|
|
27
|
+
"marker": {
|
|
28
|
+
"description": "The protocol and its version.",
|
|
29
|
+
"const": "contract/0.1"
|
|
30
|
+
},
|
|
31
|
+
"id": {
|
|
32
|
+
"description": "A request id: the client id (no colon), a colon, the per-client sequence number.",
|
|
33
|
+
"type": "string",
|
|
34
|
+
"pattern": "^[^:]+:[1-9][0-9]*$"
|
|
35
|
+
},
|
|
36
|
+
"request": {
|
|
37
|
+
"description": "A client's request: one operation invocation. input is the whole input object, or null for an input-less operation.",
|
|
38
|
+
"type": "object",
|
|
39
|
+
"required": [
|
|
40
|
+
"jaren",
|
|
41
|
+
"id",
|
|
42
|
+
"op",
|
|
43
|
+
"input"
|
|
44
|
+
],
|
|
45
|
+
"properties": {
|
|
46
|
+
"jaren": {
|
|
47
|
+
"$ref": "#/$defs/marker"
|
|
48
|
+
},
|
|
49
|
+
"id": {
|
|
50
|
+
"$ref": "#/$defs/id"
|
|
51
|
+
},
|
|
52
|
+
"op": {
|
|
53
|
+
"description": "The operation id, as declared in the contract.",
|
|
54
|
+
"type": "string",
|
|
55
|
+
"pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)*$"
|
|
56
|
+
},
|
|
57
|
+
"input": true,
|
|
58
|
+
"attempt": true,
|
|
59
|
+
"key": {
|
|
60
|
+
"description": "Reserved: an idempotency key. The port binding does not carry idempotency (capabilities say so); a server of this version ignores it.",
|
|
61
|
+
"type": "string"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"additionalProperties": false
|
|
65
|
+
},
|
|
66
|
+
"response": {
|
|
67
|
+
"description": "A server's answer to one request id, success or error, always carrying the server trace.",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"required": [
|
|
70
|
+
"jaren",
|
|
71
|
+
"id",
|
|
72
|
+
"ok",
|
|
73
|
+
"trace"
|
|
74
|
+
],
|
|
75
|
+
"properties": {
|
|
76
|
+
"jaren": {
|
|
77
|
+
"$ref": "#/$defs/marker"
|
|
78
|
+
},
|
|
79
|
+
"id": {
|
|
80
|
+
"$ref": "#/$defs/id"
|
|
81
|
+
},
|
|
82
|
+
"ok": {
|
|
83
|
+
"type": "boolean"
|
|
84
|
+
},
|
|
85
|
+
"value": true,
|
|
86
|
+
"error": {
|
|
87
|
+
"$ref": "#/$defs/error"
|
|
88
|
+
},
|
|
89
|
+
"trace": {
|
|
90
|
+
"description": "The server's per-request trace id (meta.trace on the client).",
|
|
91
|
+
"type": "string",
|
|
92
|
+
"minLength": 1
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"oneOf": [
|
|
96
|
+
{
|
|
97
|
+
"required": [
|
|
98
|
+
"value"
|
|
99
|
+
],
|
|
100
|
+
"properties": {
|
|
101
|
+
"ok": {
|
|
102
|
+
"const": true
|
|
103
|
+
},
|
|
104
|
+
"error": false
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"required": [
|
|
109
|
+
"error"
|
|
110
|
+
],
|
|
111
|
+
"properties": {
|
|
112
|
+
"ok": {
|
|
113
|
+
"const": false
|
|
114
|
+
},
|
|
115
|
+
"value": false
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"additionalProperties": false
|
|
120
|
+
},
|
|
121
|
+
"error": {
|
|
122
|
+
"description": "The error envelope of a failed response: a declared error code (lowercase) or a JC2xxx taxonomy/binding code; details present only when the failure carries some.",
|
|
123
|
+
"type": "object",
|
|
124
|
+
"required": [
|
|
125
|
+
"code",
|
|
126
|
+
"message"
|
|
127
|
+
],
|
|
128
|
+
"properties": {
|
|
129
|
+
"code": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"pattern": "^([a-z][a-z0-9-]*|JC[0-9]{4})$"
|
|
132
|
+
},
|
|
133
|
+
"message": {
|
|
134
|
+
"type": "string"
|
|
135
|
+
},
|
|
136
|
+
"details": true,
|
|
137
|
+
"retryable": {
|
|
138
|
+
"type": "boolean"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"additionalProperties": false
|
|
142
|
+
},
|
|
143
|
+
"cancel": {
|
|
144
|
+
"description": "A client's cancellation of one request id: aborts the server-side signal. An optimization — the id scoping is the guarantee — and never answered.",
|
|
145
|
+
"type": "object",
|
|
146
|
+
"required": [
|
|
147
|
+
"jaren",
|
|
148
|
+
"cancel"
|
|
149
|
+
],
|
|
150
|
+
"properties": {
|
|
151
|
+
"jaren": {
|
|
152
|
+
"$ref": "#/$defs/marker"
|
|
153
|
+
},
|
|
154
|
+
"cancel": {
|
|
155
|
+
"$ref": "#/$defs/id"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"additionalProperties": false
|
|
159
|
+
},
|
|
160
|
+
"subscribe": {
|
|
161
|
+
"description": "A client's subscription of one subscribe operation: opens a stream under the id. input is the whole input object, or null for an input-less operation; lastSeq, when present, asks to resume after that seq.",
|
|
162
|
+
"type": "object",
|
|
163
|
+
"required": [
|
|
164
|
+
"jaren",
|
|
165
|
+
"subscribe",
|
|
166
|
+
"op",
|
|
167
|
+
"input"
|
|
168
|
+
],
|
|
169
|
+
"properties": {
|
|
170
|
+
"jaren": {
|
|
171
|
+
"$ref": "#/$defs/marker"
|
|
172
|
+
},
|
|
173
|
+
"subscribe": {
|
|
174
|
+
"$ref": "#/$defs/id"
|
|
175
|
+
},
|
|
176
|
+
"op": {
|
|
177
|
+
"description": "The operation id, as declared in the contract.",
|
|
178
|
+
"type": "string",
|
|
179
|
+
"pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)*$"
|
|
180
|
+
},
|
|
181
|
+
"input": true,
|
|
182
|
+
"lastSeq": {
|
|
183
|
+
"description": "The last seq this client delivered; the server replays after it or answers a fresh snapshot with resumed: false.",
|
|
184
|
+
"type": "integer",
|
|
185
|
+
"minimum": 0
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"additionalProperties": false
|
|
189
|
+
},
|
|
190
|
+
"unsubscribe": {
|
|
191
|
+
"description": "A client's release of one stream id. Never answered.",
|
|
192
|
+
"type": "object",
|
|
193
|
+
"required": [
|
|
194
|
+
"jaren",
|
|
195
|
+
"unsubscribe"
|
|
196
|
+
],
|
|
197
|
+
"properties": {
|
|
198
|
+
"jaren": {
|
|
199
|
+
"$ref": "#/$defs/marker"
|
|
200
|
+
},
|
|
201
|
+
"unsubscribe": {
|
|
202
|
+
"$ref": "#/$defs/id"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"additionalProperties": false
|
|
206
|
+
},
|
|
207
|
+
"push": {
|
|
208
|
+
"description": "A server's stream event for one subscription id: snapshot data is { value, resumed }, patch data the LIVE emission { patch, seq }, error data the wire error record, end data { reason }. seq is the event's seq; error and end carry the last delivered one.",
|
|
209
|
+
"type": "object",
|
|
210
|
+
"required": [
|
|
211
|
+
"jaren",
|
|
212
|
+
"id",
|
|
213
|
+
"event",
|
|
214
|
+
"seq",
|
|
215
|
+
"data"
|
|
216
|
+
],
|
|
217
|
+
"properties": {
|
|
218
|
+
"jaren": {
|
|
219
|
+
"$ref": "#/$defs/marker"
|
|
220
|
+
},
|
|
221
|
+
"id": {
|
|
222
|
+
"$ref": "#/$defs/id"
|
|
223
|
+
},
|
|
224
|
+
"event": {
|
|
225
|
+
"enum": [
|
|
226
|
+
"snapshot",
|
|
227
|
+
"patch",
|
|
228
|
+
"error",
|
|
229
|
+
"end"
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
"seq": {
|
|
233
|
+
"type": "integer",
|
|
234
|
+
"minimum": 0
|
|
235
|
+
},
|
|
236
|
+
"data": true
|
|
237
|
+
},
|
|
238
|
+
"additionalProperties": false
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|