@kottera/tera-web 0.0.0-stage → 0.1.0-rc.2

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.
@@ -0,0 +1,148 @@
1
+ // Code generated by cmd/internal/genwebtypes from sdk/plugin/webui/schema/v1/; DO NOT EDIT.
2
+ // Regenerate with `make web-types` (ADR-162 D4 item 1).
3
+ /**
4
+ * Every type this module declares, mapped to the repository path of the schema
5
+ * it was generated from.
6
+ */
7
+ export const KIT_SCHEMAS = {
8
+ KitErrorCode: "sdk/plugin/webui/schema/v1/error-code.json",
9
+ KitError: "sdk/plugin/webui/schema/v1/error.json",
10
+ KitFeedEventReauthenticate: "sdk/plugin/webui/schema/v1/feed.event.reauthenticate.json",
11
+ KitInvokeResponse: "sdk/plugin/webui/schema/v1/invoke.response.json",
12
+ KitMeResponse: "sdk/plugin/webui/schema/v1/me.response.json",
13
+ KitUploadResponse: "sdk/plugin/webui/schema/v1/upload.response.json",
14
+ };
15
+ /** The prefix every kit route is served under (ADR-162 D3). */
16
+ export const KIT_ROUTE_PREFIX = "/tera/v1/";
17
+ /** tera's own sign-out path, which `GET /tera/v1/me` answers as signout_path. */
18
+ export const KIT_SIGNOUT_PATH = "/_tera/signout";
19
+ /** The kit's route table (ADR-162 D3), as sdk/plugin/webui declares it. */
20
+ export const KIT_ROUTE_TABLE = {
21
+ prefix: "/tera/v1/",
22
+ signout_path: "/_tera/signout",
23
+ same_origin: "A route marked same_origin refuses a request unless it is same-origin: when the request carries Sec-Fetch-Site, that header must be same-origin; when it does not, its Origin must equal the request's own (scheme http or https, and the Host the request was sent to). The refusal is 403 cross_origin.",
24
+ public: "None. Every route under the prefix refuses a request with no verified caller, 401 unauthenticated, before anything else is decided. Only the app's assets, outside the prefix, are served to an anonymous request.",
25
+ error: {
26
+ media_type: "application/json",
27
+ schema: "https://kottera.dev/schemas/plugin/webui/error/v1",
28
+ description: "Every failure of every route: the kit's own refusal, under one of the error-code vocabulary, or a verb's refusal passed through as the verb gave it.",
29
+ },
30
+ routes: [
31
+ {
32
+ name: "me",
33
+ method: "GET",
34
+ path: "/tera/v1/me",
35
+ summary: "Who is signed in, and where to send them to sign out.",
36
+ same_origin: false,
37
+ response: {
38
+ media_type: "application/json",
39
+ schema: "https://kottera.dev/schemas/plugin/webui/me.response/v1",
40
+ description: "The signed-in person.",
41
+ },
42
+ },
43
+ {
44
+ name: "invoke",
45
+ method: "POST",
46
+ path: "/tera/v1/invoke/{capability}",
47
+ summary: "Invoke one capability as the person, with the request body as its params. tera decides it on the person's token; the kit vets nothing.",
48
+ same_origin: true,
49
+ path_params: [
50
+ {
51
+ name: "capability",
52
+ description: "The capability to invoke, e.g. work_order.get.",
53
+ required: true,
54
+ },
55
+ ],
56
+ request: {
57
+ media_type: "application/json",
58
+ description: "The capability's params. For a work_order.* verb, valid against sdk/workorder/schema/v1/<verb>.params.json.",
59
+ },
60
+ response: {
61
+ media_type: "application/json",
62
+ schema: "https://kottera.dev/schemas/plugin/webui/invoke.response/v1",
63
+ description: "The verb's reply envelope, HTTP 200 whenever the verb ran, refusals included.",
64
+ },
65
+ },
66
+ {
67
+ name: "feed",
68
+ method: "GET",
69
+ path: "/tera/v1/feeds/{feed}",
70
+ summary: "Open a feed as the person: server-sent events carrying feed records and status frames verbatim.",
71
+ same_origin: false,
72
+ path_params: [
73
+ {
74
+ name: "feed",
75
+ description: "The feed's name.",
76
+ required: true,
77
+ },
78
+ ],
79
+ query: [
80
+ {
81
+ name: "topics",
82
+ description: "Selects a subset of the topics the person may subscribe to; each occurrence may be a comma-separated list. Widening is refused.",
83
+ repeated: true,
84
+ },
85
+ {
86
+ name: "backfill",
87
+ description: "Precede the live stream with the stored history of the run the connection selected.",
88
+ values: [
89
+ "all",
90
+ ],
91
+ },
92
+ ],
93
+ response: {
94
+ media_type: "text/event-stream",
95
+ description: "A stream of the events below, until the person's token expires or either side closes it. Any other feed frame (a heartbeat, a batch, a type this kit does not know) is relayed verbatim as an unnamed event, read by its own type.",
96
+ },
97
+ events: [
98
+ {
99
+ name: "record",
100
+ schema: "https://kottera.dev/schemas/feed/frame.record/v1",
101
+ description: "A feed record frame, verbatim.",
102
+ },
103
+ {
104
+ name: "status",
105
+ schema: "https://kottera.dev/schemas/feed/frame.status/v1",
106
+ description: "A feed status frame, verbatim; loss is reported here and nowhere else.",
107
+ },
108
+ {
109
+ name: "reauthenticate",
110
+ schema: "https://kottera.dev/schemas/plugin/webui/feed.event.reauthenticate/v1",
111
+ description: "The last event of a stream closed because the person's token expired. Reconnect at once.",
112
+ },
113
+ ],
114
+ },
115
+ {
116
+ name: "upload",
117
+ method: "POST",
118
+ path: "/tera/v1/uploads",
119
+ summary: "Upload one file as the person (ADR-123): the kit streams the body once, digesting it, then authorizes and stores it.",
120
+ same_origin: true,
121
+ headers: [
122
+ {
123
+ name: "Content-Type",
124
+ description: "The file's media type.",
125
+ required: true,
126
+ },
127
+ {
128
+ name: "Tera-Upload-Filename",
129
+ description: "The file's name, percent-encoded UTF-8.",
130
+ required: true,
131
+ },
132
+ {
133
+ name: "Tera-Upload-Description",
134
+ description: "A description of the file, percent-encoded UTF-8.",
135
+ },
136
+ ],
137
+ request: {
138
+ media_type: "application/octet-stream",
139
+ description: "The file's bytes, any media type. The body is read against its declared Content-Length, capped by the 33554432-byte (32 MiB) bound on an input artifact; a body with no declared length is held to the cap. A declaration over the cap is refused before the body is read, and a body is refused at the first byte past its bound, never after it is read whole.",
140
+ },
141
+ response: {
142
+ media_type: "application/json",
143
+ schema: "https://kottera.dev/schemas/plugin/webui/upload.response/v1",
144
+ description: "The staged artifact.",
145
+ },
146
+ },
147
+ ],
148
+ };
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The vocabulary of the event types within the `workorder` payload.
3
+ *
4
+ * Every member the daemon writes. A later level adds members and removes none (ADR-143 D3); how a consumer reads an unknown member is ADR-143 D13's.
5
+ *
6
+ * Schema: sdk/workorder/schema/events/v1/event-kind.workorder.json
7
+ */
8
+ export type WorkOrderEventKind = "cohort.set" | "off_tera.wake" | "relation.set" | "relation.removed" | "off_tera.taken" | "off_tera.progress" | "off_tera.reposted" | "off_tera.late_report" | "off_tera.checks_started" | "created" | "transitioned" | "acknowledged" | "retention_expired" | "edited" | "seat.reclaimed" | "claim.overdue" | "claim.unreadable" | "subject_claim.overridden" | "seat.cooling" | "seat.credential_held" | "member_credential.requested" | "member_credential.settled" | "seat.acquired" | "seat.runner_released" | "seat.meters_voided" | "step.binding" | "session.terminated" | "postcondition.verdict" | "parked_run.unreadable" | "parked_run.reclaimed" | "dispatch.settled_unobserved" | "parked_run.parked" | "parked_run.resumed" | "resume.refused" | "dispatch.salvaged" | "workspace.retired" | "dispatch.routed" | "session.lost" | "activity_partition.pinned" | "session.continuity" | "session.context_compacted" | "upstream.answer_forwarded" | "invocation.checkpoint" | "invocation.guidance" | "invocation.guidance.ack" | "invocation.reply" | "invocation.checkpoint.unreadable" | "invocation.guidance.unreadable" | "config_pin.unreadable" | "config_pin.repinned" | "type.followed" | "observation.scrubbed" | "observation.secret-shape-redacted" | "observation.promoted" | "observation.refuted" | "observation.purged" | "conversation.input_barrier" | "walk_resume.fell_back" | "store.ahead_of_binary" | "artifact.published" | "history.dropped" | "history.archived" | "seat.work_order_released" | "step.settled_late" | "step.reattached" | "relay.unrebuilt";
9
+ /**
10
+ * `workorder` event payload (event/workorder).
11
+ *
12
+ * The payload published on every topic of the `workorder` family, generated from github.com/kottera/sdk/workorder.Envelope.
13
+ *
14
+ * Schema: sdk/workorder/schema/events/v1/payload.workorder.json
15
+ */
16
+ export type WorkOrderEventPayload = {
17
+ /** The event row's primary key: monotonic across every Work Order, and the replay cursor (ADR-078 D3). */
18
+ id: number;
19
+ /** The owning Work Order's UUIDv7. */
20
+ work_order_id: string;
21
+ /** The owning Work Order's namespaced type key (<vault>/work-order-types/<stem>); absent only on an event with no Work Order row (ADR-142 D3). */
22
+ work_order_type?: string;
23
+ /** The event timestamp, RFC 3339 with nanosecond precision, UTC. */
24
+ ts: string;
25
+ /** Who caused the event, as stored. The shape written is an EventActor; a row written before a field existed lacks that key. */
26
+ actor?: unknown;
27
+ /** The event's type within the family; a member of the event-kind vocabulary, and a value this version does not know is kept verbatim (ADR-143 D13). */
28
+ kind: string;
29
+ /** The state before the transition; absent on created. */
30
+ from_state?: string;
31
+ /** The state after the transition. */
32
+ to_state?: string;
33
+ /** The optional human-readable reason for the transition. */
34
+ reason?: string;
35
+ /** The per-event payload as stored, whose shape the event kind decides. */
36
+ payload?: unknown;
37
+ /** The persisted-schema marker of the envelope. */
38
+ schema_version: string;
39
+ };
40
+ /**
41
+ * Every type this module declares, mapped to the repository path of the schema
42
+ * it was generated from.
43
+ */
44
+ export declare const WORK_ORDER_EVENT_SCHEMAS: {
45
+ readonly WorkOrderEventKind: "sdk/workorder/schema/events/v1/event-kind.workorder.json";
46
+ readonly WorkOrderEventPayload: "sdk/workorder/schema/events/v1/payload.workorder.json";
47
+ };
@@ -0,0 +1,10 @@
1
+ // Code generated by cmd/internal/genwebtypes from sdk/workorder/schema/events/v1/; DO NOT EDIT.
2
+ // Regenerate with `make web-types` (ADR-162 D4 item 1).
3
+ /**
4
+ * Every type this module declares, mapped to the repository path of the schema
5
+ * it was generated from.
6
+ */
7
+ export const WORK_ORDER_EVENT_SCHEMAS = {
8
+ WorkOrderEventKind: "sdk/workorder/schema/events/v1/event-kind.workorder.json",
9
+ WorkOrderEventPayload: "sdk/workorder/schema/events/v1/payload.workorder.json",
10
+ };