@yaks/api 0.0.0-stage → 0.2.36
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/LICENSE +202 -0
- package/README.md +956 -2
- package/_dist/actor.d.ts +59 -0
- package/_dist/actor.d.ts.map +1 -0
- package/_dist/address.d.ts +33 -0
- package/_dist/address.d.ts.map +1 -0
- package/_dist/asset.d.ts +15 -0
- package/_dist/asset.d.ts.map +1 -0
- package/_dist/batches.d.ts +4 -0
- package/_dist/batches.d.ts.map +1 -0
- package/_dist/body.d.ts +7 -0
- package/_dist/body.d.ts.map +1 -0
- package/_dist/deno.d.ts +38 -0
- package/_dist/deno.d.ts.map +1 -0
- package/_dist/doors.d.ts +134 -0
- package/_dist/doors.d.ts.map +1 -0
- package/_dist/graph.d.ts +17 -0
- package/_dist/graph.d.ts.map +1 -0
- package/_dist/headers.d.ts +5 -0
- package/_dist/headers.d.ts.map +1 -0
- package/_dist/log.d.ts +253 -0
- package/_dist/log.d.ts.map +1 -0
- package/_dist/mod.d.ts +71 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/publish.d.ts +7 -0
- package/_dist/publish.d.ts.map +1 -0
- package/_dist/reached.d.ts +145 -0
- package/_dist/reached.d.ts.map +1 -0
- package/_dist/receipts.d.ts +153 -0
- package/_dist/receipts.d.ts.map +1 -0
- package/_dist/refuse.d.ts +51 -0
- package/_dist/refuse.d.ts.map +1 -0
- package/_dist/relay.d.ts +3 -0
- package/_dist/relay.d.ts.map +1 -0
- package/_dist/request.d.ts +79 -0
- package/_dist/request.d.ts.map +1 -0
- package/_dist/requests.d.ts +7 -0
- package/_dist/requests.d.ts.map +1 -0
- package/_dist/route.d.ts +71 -0
- package/_dist/route.d.ts.map +1 -0
- package/_dist/routed.d.ts +33 -0
- package/_dist/routed.d.ts.map +1 -0
- package/_dist/routes.d.ts +46 -0
- package/_dist/routes.d.ts.map +1 -0
- package/_dist/save.d.ts +6 -0
- package/_dist/save.d.ts.map +1 -0
- package/_dist/socket.d.ts +73 -0
- package/_dist/socket.d.ts.map +1 -0
- package/_dist/subs.d.ts +134 -0
- package/_dist/subs.d.ts.map +1 -0
- package/_dist/timing.d.ts +8 -0
- package/_dist/timing.d.ts.map +1 -0
- package/_dist/tools.d.ts +80 -0
- package/_dist/tools.d.ts.map +1 -0
- package/_dist/vocab.d.ts +6 -0
- package/_dist/vocab.d.ts.map +1 -0
- package/access.js +32 -0
- package/access.js.map +1 -0
- package/access.ts +42 -0
- package/actor.js +75 -0
- package/actor.js.map +1 -0
- package/actor.ts +106 -0
- package/address.js +42 -0
- package/address.js.map +1 -0
- package/address.ts +49 -0
- package/admission.js +71 -0
- package/admission.js.map +1 -0
- package/admission.ts +64 -0
- package/asset.js +37 -0
- package/asset.js.map +1 -0
- package/asset.ts +47 -0
- package/batches.js +92 -0
- package/batches.js.map +1 -0
- package/batches.ts +96 -0
- package/body.js +51 -0
- package/body.js.map +1 -0
- package/body.ts +82 -0
- package/deno.js +88 -0
- package/deno.js.map +1 -0
- package/deno.json +1 -0
- package/deno.ts +150 -0
- package/doors.js +435 -0
- package/doors.js.map +1 -0
- package/doors.ts +570 -0
- package/graph.js +12 -0
- package/graph.js.map +1 -0
- package/graph.ts +23 -0
- package/headers.js +5 -0
- package/headers.js.map +1 -0
- package/headers.ts +9 -0
- package/interest.js +224 -0
- package/interest.js.map +1 -0
- package/interest.ts +264 -0
- package/log.js +1011 -0
- package/log.js.map +1 -0
- package/log.ts +1035 -0
- package/mod.js +69 -0
- package/mod.js.map +1 -0
- package/mod.ts +142 -0
- package/package.json +75 -4
- package/peer_query.js +164 -0
- package/peer_query.js.map +1 -0
- package/peer_query.ts +158 -0
- package/publish.js +7 -0
- package/publish.js.map +1 -0
- package/publish.ts +16 -0
- package/reached.js +456 -0
- package/reached.js.map +1 -0
- package/reached.ts +549 -0
- package/receipts.js +543 -0
- package/receipts.js.map +1 -0
- package/receipts.ts +749 -0
- package/refuse.js +120 -0
- package/refuse.js.map +1 -0
- package/refuse.ts +179 -0
- package/relay.js +249 -0
- package/relay.js.map +1 -0
- package/relay.ts +284 -0
- package/request.js +218 -0
- package/request.js.map +1 -0
- package/request.ts +235 -0
- package/requests.js +250 -0
- package/requests.js.map +1 -0
- package/requests.ts +257 -0
- package/route.js +139 -0
- package/route.js.map +1 -0
- package/route.ts +228 -0
- package/routed.js +25 -0
- package/routed.js.map +1 -0
- package/routed.ts +53 -0
- package/routes.js +154 -0
- package/routes.js.map +1 -0
- package/routes.ts +201 -0
- package/save.js +341 -0
- package/save.js.map +1 -0
- package/save.ts +393 -0
- package/socket.js +398 -0
- package/socket.js.map +1 -0
- package/socket.ts +496 -0
- package/subs.js +2295 -0
- package/subs.js.map +1 -0
- package/subs.ts +2979 -0
- package/timing.js +17 -0
- package/timing.js.map +1 -0
- package/timing.ts +26 -0
- package/tools.js +251 -0
- package/tools.js.map +1 -0
- package/tools.ts +315 -0
- package/vocab.js +18 -0
- package/vocab.js.map +1 -0
- package/vocab.json +93 -0
- package/vocab.ts +18 -0
package/vocab.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "urn:uuid:958f3df3-cf9f-497d-8df3-b17c62f5eac1",
|
|
3
|
+
"$vocabulary": {
|
|
4
|
+
"https://yak.sh/vocab/core": true
|
|
5
|
+
},
|
|
6
|
+
"title": "api",
|
|
7
|
+
"$defs": {
|
|
8
|
+
"request": {
|
|
9
|
+
"$id": "urn:uuid:719919a9-dbfa-493e-a382-c1f0f9d8f621",
|
|
10
|
+
"component": true,
|
|
11
|
+
"journal": false,
|
|
12
|
+
"type": "object",
|
|
13
|
+
"description": "An HTTP request as the server that answered it records it. The entity's id is the one the caller was answered with, in the x-request-id header, so a person holding a failed answer can name its record. Only a request that broke is written: one answered with a status of 500 or over.",
|
|
14
|
+
"properties": {
|
|
15
|
+
"method": {
|
|
16
|
+
"$id": "urn:uuid:2fd01bbc-9f32-4252-b22c-b0ceb7320592",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"stamped": true,
|
|
19
|
+
"description": "the HTTP method: GET, POST, PUT, \u2026"
|
|
20
|
+
},
|
|
21
|
+
"url": {
|
|
22
|
+
"$id": "urn:uuid:22a30a9c-8562-4467-bd33-0678d1345dbf",
|
|
23
|
+
"type": "string",
|
|
24
|
+
"stamped": true,
|
|
25
|
+
"description": "the address asked for, without its query string"
|
|
26
|
+
},
|
|
27
|
+
"route": {
|
|
28
|
+
"$id": "urn:uuid:425c5676-dc71-4636-bf9d-52aad202f170",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"stamped": true,
|
|
31
|
+
"description": "the route that answered it, as the server names its routes (`/apply`, `/blob/*`); absent when no route claimed the address"
|
|
32
|
+
},
|
|
33
|
+
"status": {
|
|
34
|
+
"$id": "urn:uuid:d43eb5ae-fa3d-46ed-ab9e-2bf776c614cf",
|
|
35
|
+
"type": "integer",
|
|
36
|
+
"stamped": true,
|
|
37
|
+
"description": "the HTTP status it was answered with"
|
|
38
|
+
},
|
|
39
|
+
"ms": {
|
|
40
|
+
"$id": "urn:uuid:f8e5bd21-5045-4887-9f4e-e0f0619d0555",
|
|
41
|
+
"type": "number",
|
|
42
|
+
"stamped": true,
|
|
43
|
+
"description": "milliseconds from its arrival until the answer's head was ready"
|
|
44
|
+
},
|
|
45
|
+
"agent": {
|
|
46
|
+
"$id": "urn:uuid:b86033ba-1686-49cf-acb0-96261a60a811",
|
|
47
|
+
"type": "string",
|
|
48
|
+
"stamped": true,
|
|
49
|
+
"description": "what sent it, from its User-Agent header: a browser, its major version and the operating system (`Chrome 141 on macOS`), or any other program's name and version (`curl 8.5.0`)"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"serve": {
|
|
54
|
+
"tool": true,
|
|
55
|
+
"surfaces": [
|
|
56
|
+
"cli"
|
|
57
|
+
],
|
|
58
|
+
"roles": [
|
|
59
|
+
"web"
|
|
60
|
+
],
|
|
61
|
+
"title": "Answer HTTP for this graph",
|
|
62
|
+
"description": "Listen on a TCP port and answer HTTP requests for this graph: POST /apply, GET or POST /query, the /ws subscription socket, POST /mcp, and every route the loaded plugins add. The port and network interface come from the configuration that opened the graph unless these arguments override them. This call does not return while the server is up. It returns when the server stops: it stops taking requests, closes its sockets and lets the requests in flight finish for the grace, then returns either way. Its result reports where it listened and for how long; while it runs, its execution state stays 'running', which is how the record of a server that is still up differs from one that has stopped.",
|
|
63
|
+
"input": {
|
|
64
|
+
"port": {
|
|
65
|
+
"type": "number",
|
|
66
|
+
"description": "the TCP port to listen on, instead of the configured one"
|
|
67
|
+
},
|
|
68
|
+
"hostname": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"description": "the network interface to bind, instead of the configured one"
|
|
71
|
+
},
|
|
72
|
+
"share": {
|
|
73
|
+
"type": "boolean",
|
|
74
|
+
"description": "share the port with another server started with share, so a replacement can answer before the one it replaces stops (Linux; Deno needs --unstable-net). Without it a taken port is refused"
|
|
75
|
+
},
|
|
76
|
+
"ready": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "a file to write this process's pid to once the port is bound, removed when the server stops"
|
|
79
|
+
},
|
|
80
|
+
"grace": {
|
|
81
|
+
"type": "number",
|
|
82
|
+
"description": "seconds a stopping server lets requests in flight finish before it stops anyway (default 10)"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"kinds": {
|
|
88
|
+
"request": {
|
|
89
|
+
"$id": "urn:uuid:719919a9-dbfa-493e-a382-c1f0f9d8f621",
|
|
90
|
+
"description": "An HTTP request as the server that answered it records it. The entity's id is the one the caller was answered with, in the x-request-id header, so a person holding a failed answer can name its record. Only a request that broke is written: one answered with a status of 500 or over."
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
package/vocab.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// The vocabulary, and only that: the module exported as `@yaks/api/vocab`.
|
|
2
|
+
// `request` records failed HTTP answers, and belongs to the answering server;
|
|
3
|
+
// a keyed write's receipt is no graph row but the write log's (./log.ts). The
|
|
4
|
+
// tool `serve` in ./tools.ts, because listening on a port is something
|
|
5
|
+
// somebody asks a graph to do, and a thing you can ask a graph to do is a tool.
|
|
6
|
+
import type { VocabDoc } from 'jsr:@yaks/vocab@0.2.36'
|
|
7
|
+
import doc from './vocab.json' with { type: 'json' }
|
|
8
|
+
import manifest from './package.json' with { type: 'json' }
|
|
9
|
+
|
|
10
|
+
/** The components and the tool this plugin declares. */
|
|
11
|
+
export let apiDoc: VocabDoc = doc
|
|
12
|
+
|
|
13
|
+
/** What this package is: its manifest's description, the one place it is
|
|
14
|
+
* written, which a host stamps on each document here. */
|
|
15
|
+
export let description: string = manifest.description
|
|
16
|
+
|
|
17
|
+
/** Every document this plugin declares. */
|
|
18
|
+
export let docs: VocabDoc[] = [apiDoc]
|