@leaflow/sdk 0.0.0-dev.429.gf6440ec → 0.0.0-dev.433.g7e48b8f

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 (88) hide show
  1. package/dist/canopy/v1/generated/models.d.ts +209 -9
  2. package/dist/canopy/v1/generated/models.js +27 -1
  3. package/dist/canopy/v1/generated/schemas.zod.d.ts +1 -1
  4. package/dist/canopy/v1/generated/schemas.zod.js +3 -1
  5. package/dist/canopy/v1/generated/validators/aPIKeyUsageListResponseBody.zod.d.ts +9 -0
  6. package/dist/canopy/v1/generated/validators/aPIKeyUsageResource.zod.d.ts +9 -0
  7. package/dist/canopy/v1/generated/validators/aPIKeyUsageResource.zod.js +5 -0
  8. package/dist/canopy/v1/generated/validators/audioCapabilities.zod.d.ts +51 -0
  9. package/dist/canopy/v1/generated/validators/audioCapabilities.zod.js +67 -0
  10. package/dist/canopy/v1/generated/validators/cursorPageRequestResource.zod.d.ts +10 -1
  11. package/dist/canopy/v1/generated/validators/endpointCapabilities.zod.d.ts +37 -0
  12. package/dist/canopy/v1/generated/validators/endpointCapabilities.zod.js +20 -0
  13. package/dist/canopy/v1/generated/validators/imageCapabilities.zod.d.ts +52 -0
  14. package/dist/canopy/v1/generated/validators/imageCapabilities.zod.js +69 -0
  15. package/dist/canopy/v1/generated/validators/mediaUsage.zod.d.ts +52 -0
  16. package/dist/canopy/v1/generated/validators/mediaUsage.zod.js +61 -0
  17. package/dist/canopy/v1/generated/validators/model.zod.d.ts +50 -0
  18. package/dist/canopy/v1/generated/validators/modelBilling.zod.d.ts +8 -1
  19. package/dist/canopy/v1/generated/validators/modelBilling.zod.js +2 -2
  20. package/dist/canopy/v1/generated/validators/modelCapabilities.zod.d.ts +37 -0
  21. package/dist/canopy/v1/generated/validators/modelEndpoint.zod.d.ts +13 -0
  22. package/dist/canopy/v1/generated/validators/modelEndpoint.zod.js +13 -0
  23. package/dist/canopy/v1/generated/validators/modelList.zod.d.ts +50 -0
  24. package/dist/canopy/v1/generated/validators/modelListResponseBody.zod.d.ts +58 -1
  25. package/dist/canopy/v1/generated/validators/modelMeter.zod.d.ts +8 -1
  26. package/dist/canopy/v1/generated/validators/modelMeter.zod.js +21 -2
  27. package/dist/canopy/v1/generated/validators/modelParameter.zod.d.ts +58 -0
  28. package/dist/canopy/v1/generated/validators/modelParameter.zod.js +57 -0
  29. package/dist/canopy/v1/generated/validators/modelResource.zod.d.ts +58 -1
  30. package/dist/canopy/v1/generated/validators/modelUsageListResponseBody.zod.d.ts +9 -0
  31. package/dist/canopy/v1/generated/validators/modelUsageResource.zod.d.ts +9 -0
  32. package/dist/canopy/v1/generated/validators/modelUsageResource.zod.js +5 -0
  33. package/dist/canopy/v1/generated/validators/requestResource.zod.d.ts +10 -1
  34. package/dist/canopy/v1/generated/validators/requestResource.zod.js +8 -1
  35. package/dist/canopy/v1/generated/validators/totalsResource.zod.d.ts +9 -0
  36. package/dist/canopy/v1/generated/validators/totalsResource.zod.js +5 -0
  37. package/dist/canopy/v1/generated/validators/usageBucketResource.zod.d.ts +9 -0
  38. package/dist/canopy/v1/generated/validators/usageBucketResource.zod.js +5 -0
  39. package/dist/canopy/v1/generated/validators/usageTimelineResponseBody.zod.d.ts +9 -0
  40. package/dist/canopy/v1/generated/validators/videoCapabilities.zod.d.ts +51 -0
  41. package/dist/canopy/v1/generated/validators/videoCapabilities.zod.js +69 -0
  42. package/dist/eventbus/v1/generated/functions.d.ts +336 -0
  43. package/dist/eventbus/v1/generated/functions.js +214 -0
  44. package/dist/eventbus/v1/generated/models.d.ts +364 -0
  45. package/dist/eventbus/v1/generated/models.js +8 -0
  46. package/dist/eventbus/v1/generated/schemas.zod.d.ts +138 -0
  47. package/dist/eventbus/v1/generated/schemas.zod.js +163 -0
  48. package/dist/eventbus/v1/generated/validators/createEventRequest.zod.d.ts +50 -0
  49. package/dist/eventbus/v1/generated/validators/createEventRequest.zod.js +59 -0
  50. package/dist/eventbus/v1/generated/validators/createVersionRequest.zod.d.ts +46 -0
  51. package/dist/eventbus/v1/generated/validators/createVersionRequest.zod.js +47 -0
  52. package/dist/eventbus/v1/generated/validators/cursorPagination.zod.d.ts +45 -0
  53. package/dist/eventbus/v1/generated/validators/cursorPagination.zod.js +45 -0
  54. package/dist/eventbus/v1/generated/validators/error.zod.d.ts +56 -0
  55. package/dist/eventbus/v1/generated/validators/error.zod.js +45 -0
  56. package/dist/eventbus/v1/generated/validators/errorStatus.zod.d.ts +54 -0
  57. package/dist/eventbus/v1/generated/validators/errorStatus.zod.js +69 -0
  58. package/dist/eventbus/v1/generated/validators/eventDetail.zod.d.ts +65 -0
  59. package/dist/eventbus/v1/generated/validators/eventDetail.zod.js +62 -0
  60. package/dist/eventbus/v1/generated/validators/eventList.zod.d.ts +58 -0
  61. package/dist/eventbus/v1/generated/validators/eventList.zod.js +50 -0
  62. package/dist/eventbus/v1/generated/validators/eventResource.zod.d.ts +55 -0
  63. package/dist/eventbus/v1/generated/validators/eventResource.zod.js +60 -0
  64. package/dist/eventbus/v1/generated/validators/eventStatus.zod.d.ts +45 -0
  65. package/dist/eventbus/v1/generated/validators/eventStatus.zod.js +42 -0
  66. package/dist/eventbus/v1/generated/validators/eventVersion.zod.d.ts +51 -0
  67. package/dist/eventbus/v1/generated/validators/eventVersion.zod.js +53 -0
  68. package/dist/eventbus/v1/generated/validators/fieldViolation.zod.d.ts +45 -0
  69. package/dist/eventbus/v1/generated/validators/fieldViolation.zod.js +48 -0
  70. package/dist/eventbus/v1/generated/validators/listEventsParams.zod.d.ts +55 -0
  71. package/dist/eventbus/v1/generated/validators/listEventsParams.zod.js +57 -0
  72. package/dist/eventbus/v1/generated/validators/offsetPagination.zod.d.ts +47 -0
  73. package/dist/eventbus/v1/generated/validators/offsetPagination.zod.js +47 -0
  74. package/dist/eventbus/v1/generated/validators/publishRequest.zod.d.ts +49 -0
  75. package/dist/eventbus/v1/generated/validators/publishRequest.zod.js +55 -0
  76. package/dist/eventbus/v1/generated/validators/publishResponse.zod.d.ts +47 -0
  77. package/dist/eventbus/v1/generated/validators/publishResponse.zod.js +47 -0
  78. package/dist/eventbus/v1/generated/validators/realtimeTicket.zod.d.ts +46 -0
  79. package/dist/eventbus/v1/generated/validators/realtimeTicket.zod.js +46 -0
  80. package/dist/eventbus/v1/generated/validators/updateEventRequest.zod.d.ts +51 -0
  81. package/dist/eventbus/v1/generated/validators/updateEventRequest.zod.js +54 -0
  82. package/dist/eventbus/v1/index.d.ts +3 -0
  83. package/dist/eventbus/v1/index.js +3 -0
  84. package/dist/index.d.ts +1 -0
  85. package/dist/index.js +1 -0
  86. package/dist/routes.d.ts +64 -0
  87. package/dist/routes.js +72 -0
  88. package/package.json +1 -1
@@ -0,0 +1,364 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Event Bus API
5
+ * Event definitions, versions, publishing, and realtime access.
6
+ *
7
+ * ## Authentication
8
+ *
9
+ * Every request carries a scoped token; see the `bearerAuth` security scheme. Neither the path
10
+ * nor the headers carry a `project_id`: the current project is determined by the token.
11
+ *
12
+ * ## Definitions and messages
13
+ *
14
+ * An event is a definition: a name, a description, and one or more versions. A version carries a
15
+ * JSON Schema that every published payload must satisfy. Messages are not stored here and are
16
+ * not part of the event definition.
17
+ *
18
+ * A project event belongs to the current project. A global event has no `project_id`; it is
19
+ * defined by a platform service and is read-only in this API. Global events are listed alongside
20
+ * the project's own events.
21
+ *
22
+ * A version number never changes meaning. Adding optional properties is allowed within a version;
23
+ * a breaking change creates a new version. Publishing without a version uses the highest active
24
+ * version.
25
+ *
26
+ * ## Publishing
27
+ *
28
+ * Publishing returns the identity of the message and does not wait for consumers. Messages are
29
+ * not stored and are not replayed: a consumer that connects later does not receive earlier
30
+ * messages. Consumers receive messages through the realtime API or the platform's service API.
31
+ *
32
+ * ## Realtime
33
+ *
34
+ * Create a ticket, connect to the returned URL with the ticket, and authenticate the connection
35
+ * with a scoped token. A ticket is single-use and short-lived. The connection ends when the
36
+ * token expires unless it is refreshed with a new scoped token for the same user and project.
37
+ * OpenAPI spec version: 1.0.0
38
+ */
39
+ export interface FieldViolation {
40
+ /** The path to the rejected field in the request body, such as `items[2].price_id`. */
41
+ field: string;
42
+ /** Why the field was rejected, such as `REQUIRED` or `OUT_OF_RANGE`. */
43
+ reason?: string;
44
+ }
45
+ /**
46
+ * Values that belong to `reason`, one set per reason. Clients use them to fill in
47
+ * localized text and never parse `message` to obtain them. Keys are documented per
48
+ * reason; a key that has appeared once keeps appearing.
49
+ */
50
+ export type ErrorStatusMetadata = {
51
+ [key: string]: string;
52
+ };
53
+ export interface ErrorStatus {
54
+ /** The HTTP status code of the response. */
55
+ code: number;
56
+ /** The canonical name of the status, such as `INVALID_ARGUMENT` or `UNAVAILABLE`. */
57
+ status: string;
58
+ /**
59
+ * A description of the failure for developers. It is always English and is not meant
60
+ * to be shown to end users as is.
61
+ */
62
+ message: string;
63
+ /**
64
+ * A stable machine-readable code identifying the failure. Clients branch on this value
65
+ * and render their own text; it does not change once published.
66
+ */
67
+ reason?: string;
68
+ /**
69
+ * Values that belong to `reason`, one set per reason. Clients use them to fill in
70
+ * localized text and never parse `message` to obtain them. Keys are documented per
71
+ * reason; a key that has appeared once keeps appearing.
72
+ */
73
+ metadata?: ErrorStatusMetadata;
74
+ /**
75
+ * Request fields rejected by the request's constraints. Present on validation
76
+ * failures; one request may violate several fields.
77
+ */
78
+ field_violations?: FieldViolation[];
79
+ /**
80
+ * How long the client should wait before retrying, as a duration string such as
81
+ * `30s`. Present only when waiting can succeed.
82
+ */
83
+ retry_delay?: string;
84
+ /**
85
+ * The identifier of the request in the service's logs. Quote it when reporting a
86
+ * failure.
87
+ */
88
+ request_id?: string;
89
+ }
90
+ /**
91
+ * A failed request. The envelope follows the Google REST error format: `code` is the HTTP
92
+ * status, `status` is its canonical name, and `reason` is the stable machine-readable code
93
+ * that identifies the failure.
94
+ */
95
+ export interface Error {
96
+ error: ErrorStatus;
97
+ }
98
+ /**
99
+ * `active` accepts new messages. `archived` keeps existing versions readable but rejects new
100
+ * messages.
101
+ */
102
+ export type EventStatus = (typeof EventStatus)[keyof typeof EventStatus];
103
+ export declare const EventStatus: {
104
+ readonly active: "active";
105
+ readonly archived: "archived";
106
+ };
107
+ export interface EventResource {
108
+ /**
109
+ * The full event name
110
+ * @maxLength 128
111
+ */
112
+ name: string;
113
+ /**
114
+ * The owning project; absent for a global event
115
+ * @nullable
116
+ */
117
+ project_id?: string | null;
118
+ /**
119
+ * What the event means, for developers
120
+ * @maxLength 1024
121
+ */
122
+ description: string;
123
+ status: EventStatus;
124
+ /**
125
+ * Free-form labels for grouping
126
+ * @items.maxLength 64
127
+ */
128
+ tags?: string[];
129
+ /** The highest active version; absent when the event has none */
130
+ latest_version?: number;
131
+ }
132
+ /**
133
+ * `active` versions accept new messages. `archived` versions stay readable but reject new
134
+ * messages.
135
+ */
136
+ export type EventVersionStatus = (typeof EventVersionStatus)[keyof typeof EventVersionStatus];
137
+ export declare const EventVersionStatus: {
138
+ readonly active: "active";
139
+ readonly archived: "archived";
140
+ };
141
+ /**
142
+ * The JSON Schema every payload of this version must satisfy
143
+ */
144
+ export type EventVersionSchema = {
145
+ [key: string]: unknown;
146
+ };
147
+ /**
148
+ * An example payload that satisfies the schema
149
+ */
150
+ export type EventVersionDataExample = {
151
+ [key: string]: unknown;
152
+ };
153
+ export interface EventVersion {
154
+ /**
155
+ * The version number, starting at 1
156
+ * @minimum 1
157
+ */
158
+ version: number;
159
+ /** The JSON Schema every payload of this version must satisfy */
160
+ schema: EventVersionSchema;
161
+ /** An example payload that satisfies the schema */
162
+ data_example?: EventVersionDataExample;
163
+ /**
164
+ * `active` versions accept new messages. `archived` versions stay readable but reject new
165
+ * messages.
166
+ */
167
+ status: EventVersionStatus;
168
+ /** A stable hash of the schema's shape */
169
+ schema_hash: string;
170
+ }
171
+ export interface EventDetail {
172
+ /**
173
+ * The full event name
174
+ * @maxLength 128
175
+ */
176
+ name: string;
177
+ /**
178
+ * The owning project; absent for a global event
179
+ * @nullable
180
+ */
181
+ project_id?: string | null;
182
+ /**
183
+ * What the event means, for developers
184
+ * @maxLength 1024
185
+ */
186
+ description: string;
187
+ status: EventStatus;
188
+ /**
189
+ * Free-form labels for grouping
190
+ * @items.maxLength 64
191
+ */
192
+ tags?: string[];
193
+ /** The highest active version; absent when the event has none */
194
+ latest_version?: number;
195
+ /** Every version, newest first */
196
+ versions: EventVersion[];
197
+ }
198
+ export interface EventList {
199
+ items: EventResource[];
200
+ /**
201
+ * The number of events matching the filters
202
+ * @minimum 0
203
+ */
204
+ total_count: number;
205
+ /** @minimum 1 */
206
+ page: number;
207
+ /** @minimum 1 */
208
+ page_size: number;
209
+ }
210
+ /**
211
+ * The JSON Schema for version 1
212
+ */
213
+ export type CreateEventRequestSchema = {
214
+ [key: string]: unknown;
215
+ };
216
+ /**
217
+ * An example payload that satisfies the schema
218
+ */
219
+ export type CreateEventRequestDataExample = {
220
+ [key: string]: unknown;
221
+ };
222
+ export interface CreateEventRequest {
223
+ /**
224
+ * The full event name; its first segment is the namespace
225
+ * @maxLength 128
226
+ * @pattern ^[a-z](?:[a-z0-9_]*[a-z0-9])?(?:\.[a-z](?:[a-z0-9_]*[a-z0-9])?){2,}$
227
+ */
228
+ name: string;
229
+ /**
230
+ * What the event means, for developers
231
+ * @maxLength 1024
232
+ */
233
+ description?: string;
234
+ /** The JSON Schema for version 1 */
235
+ schema: CreateEventRequestSchema;
236
+ /** An example payload that satisfies the schema */
237
+ data_example?: CreateEventRequestDataExample;
238
+ }
239
+ /**
240
+ * The JSON Schema for this version
241
+ */
242
+ export type CreateVersionRequestSchema = {
243
+ [key: string]: unknown;
244
+ };
245
+ /**
246
+ * An example payload that satisfies the schema
247
+ */
248
+ export type CreateVersionRequestDataExample = {
249
+ [key: string]: unknown;
250
+ };
251
+ export interface CreateVersionRequest {
252
+ /**
253
+ * The new version number, greater than every existing version
254
+ * @minimum 1
255
+ */
256
+ version: number;
257
+ /** The JSON Schema for this version */
258
+ schema: CreateVersionRequestSchema;
259
+ /** An example payload that satisfies the schema */
260
+ data_example?: CreateVersionRequestDataExample;
261
+ }
262
+ export interface UpdateEventRequest {
263
+ /**
264
+ * The new description
265
+ * @maxLength 1024
266
+ */
267
+ description?: string;
268
+ /**
269
+ * The complete new tag list; an empty list removes every tag
270
+ * @items.maxLength 64
271
+ */
272
+ tags?: string[];
273
+ status?: EventStatus;
274
+ }
275
+ /**
276
+ * The message payload
277
+ */
278
+ export type PublishRequestData = {
279
+ [key: string]: unknown;
280
+ };
281
+ export interface PublishRequest {
282
+ /**
283
+ * The version to validate against; zero selects the highest active version
284
+ * @minimum 0
285
+ */
286
+ version?: number;
287
+ /**
288
+ * The ordering key. Messages with the same key reach an individual consumer in publication
289
+ * order. Defaults to the project id when absent.
290
+ * @maxLength 256
291
+ */
292
+ key?: string;
293
+ /** The message payload */
294
+ data: PublishRequestData;
295
+ }
296
+ export interface PublishResponse {
297
+ /** The message identity; consumers use it to discard duplicates */
298
+ id: string;
299
+ /** The event name */
300
+ event: string;
301
+ /**
302
+ * The version the payload was validated against
303
+ * @minimum 1
304
+ */
305
+ version: number;
306
+ /** When the message was accepted, in UTC RFC 3339 */
307
+ created_at: string;
308
+ }
309
+ export interface RealtimeTicket {
310
+ /** The WebSocket URL to connect to */
311
+ url: string;
312
+ /** The ticket to present when connecting */
313
+ ticket: string;
314
+ /** When the ticket expires, in UTC RFC 3339 */
315
+ expires_at: string;
316
+ }
317
+ /**
318
+ * Pagination metadata for stable numbered pages. total_count is returned only when the operation can determine it without an unbounded scan.
319
+ */
320
+ export interface OffsetPagination {
321
+ /** @minimum 1 */
322
+ page: number;
323
+ /** @minimum 1 */
324
+ page_size: number;
325
+ /** @minimum 0 */
326
+ total_count?: number;
327
+ }
328
+ /**
329
+ * Pagination metadata for keyset traversal. Pass next_cursor as cursor to read the following page; null means there is no following page.
330
+ */
331
+ export interface CursorPagination {
332
+ /** @minimum 1 */
333
+ page_size: number;
334
+ /** @nullable */
335
+ next_cursor?: string | null;
336
+ }
337
+ export type ListEventsParams = {
338
+ /**
339
+ * 1-based page number. Defaults to 1.
340
+ * @minimum 1
341
+ * @maximum 2147483647
342
+ */
343
+ page?: number;
344
+ /**
345
+ * Items per page. Defaults to 50; at most 200.
346
+ * @minimum 1
347
+ * @maximum 200
348
+ */
349
+ page_size?: number;
350
+ /**
351
+ * Return only events in this namespace; omit for all namespaces
352
+ * @maxLength 64
353
+ */
354
+ namespace?: string;
355
+ /**
356
+ * Match the event name or description, case-insensitively
357
+ * @maxLength 128
358
+ */
359
+ keyword?: string;
360
+ /**
361
+ * Include archived events; defaults to false
362
+ */
363
+ include_archived?: boolean;
364
+ };
@@ -0,0 +1,8 @@
1
+ export const EventStatus = {
2
+ active: "active",
3
+ archived: "archived",
4
+ };
5
+ export const EventVersionStatus = {
6
+ active: "active",
7
+ archived: "archived",
8
+ };
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Event Bus API
5
+ * Event definitions, versions, publishing, and realtime access.
6
+ *
7
+ * ## Authentication
8
+ *
9
+ * Every request carries a scoped token; see the `bearerAuth` security scheme. Neither the path
10
+ * nor the headers carry a `project_id`: the current project is determined by the token.
11
+ *
12
+ * ## Definitions and messages
13
+ *
14
+ * An event is a definition: a name, a description, and one or more versions. A version carries a
15
+ * JSON Schema that every published payload must satisfy. Messages are not stored here and are
16
+ * not part of the event definition.
17
+ *
18
+ * A project event belongs to the current project. A global event has no `project_id`; it is
19
+ * defined by a platform service and is read-only in this API. Global events are listed alongside
20
+ * the project's own events.
21
+ *
22
+ * A version number never changes meaning. Adding optional properties is allowed within a version;
23
+ * a breaking change creates a new version. Publishing without a version uses the highest active
24
+ * version.
25
+ *
26
+ * ## Publishing
27
+ *
28
+ * Publishing returns the identity of the message and does not wait for consumers. Messages are
29
+ * not stored and are not replayed: a consumer that connects later does not receive earlier
30
+ * messages. Consumers receive messages through the realtime API or the platform's service API.
31
+ *
32
+ * ## Realtime
33
+ *
34
+ * Create a ticket, connect to the returned URL with the ticket, and authenticate the connection
35
+ * with a scoped token. A ticket is single-use and short-lived. The connection ends when the
36
+ * token expires unless it is refreshed with a new scoped token for the same user and project.
37
+ * OpenAPI spec version: 1.0.0
38
+ */
39
+ import * as zod from "zod";
40
+ /**
41
+ * Returns the global events visible to the project and the project's own events. Ordered by
42
+ * name.
43
+ * @summary List event definitions
44
+ */
45
+ export declare const listEventsQueryPageDefault = 1;
46
+ export declare const listEventsQueryPageMax = 2147483647;
47
+ export declare const listEventsQueryPageSizeDefault = 50;
48
+ export declare const listEventsQueryPageSizeMax = 200;
49
+ export declare const listEventsQueryNamespaceMax = 64;
50
+ export declare const listEventsQueryKeywordMax = 128;
51
+ export declare const listEventsQueryIncludeArchivedDefault = false;
52
+ export declare const ListEventsQueryParams: zod.ZodObject<{
53
+ page: zod.ZodDefault<zod.ZodInt>;
54
+ page_size: zod.ZodDefault<zod.ZodInt>;
55
+ namespace: zod.ZodOptional<zod.ZodString>;
56
+ keyword: zod.ZodOptional<zod.ZodString>;
57
+ include_archived: zod.ZodDefault<zod.ZodBoolean>;
58
+ }, zod.z.core.$strict>;
59
+ /**
60
+ * Creates a project event with its first version. The name is unique within the project. The
61
+ * first segment of the name is the event's namespace and must not be a platform namespace.
62
+ * @summary Create an event definition
63
+ */
64
+ export declare const CreateEventBody: zod.ZodObject<{
65
+ name: zod.ZodString;
66
+ description: zod.ZodOptional<zod.ZodString>;
67
+ schema: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
68
+ data_example: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
69
+ }, zod.z.core.$strict>;
70
+ /**
71
+ * Returns the event and every version, newest first.
72
+ * @summary Get an event definition
73
+ */
74
+ export declare const getEventPathEventNameMax = 128;
75
+ export declare const getEventPathEventNameRegExp: RegExp;
76
+ export declare const GetEventParams: zod.ZodObject<{
77
+ eventName: zod.ZodString;
78
+ }, zod.z.core.$strict>;
79
+ /**
80
+ * Changes the description, tags, or status. Only the fields present in the request are
81
+ * changed. An archived event stops accepting new messages; existing versions remain readable.
82
+ * @summary Update an event definition
83
+ */
84
+ export declare const updateEventPathEventNameMax = 128;
85
+ export declare const updateEventPathEventNameRegExp: RegExp;
86
+ export declare const UpdateEventParams: zod.ZodObject<{
87
+ eventName: zod.ZodString;
88
+ }, zod.z.core.$strict>;
89
+ export declare const UpdateEventBody: zod.ZodObject<{
90
+ description: zod.ZodOptional<zod.ZodString>;
91
+ tags: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
92
+ status: zod.ZodOptional<zod.ZodEnum<{
93
+ active: "active";
94
+ archived: "archived";
95
+ }>>;
96
+ }, zod.z.core.$strict>;
97
+ /**
98
+ * Adds a version to an existing event. The version number must be greater than every existing
99
+ * version. A version number's schema may gain optional properties, but it may not remove or
100
+ * change existing ones; use a new version for a breaking change.
101
+ * @summary Add an event version
102
+ */
103
+ export declare const createEventVersionPathEventNameMax = 128;
104
+ export declare const createEventVersionPathEventNameRegExp: RegExp;
105
+ export declare const CreateEventVersionParams: zod.ZodObject<{
106
+ eventName: zod.ZodString;
107
+ }, zod.z.core.$strict>;
108
+ export declare const CreateEventVersionBody: zod.ZodObject<{
109
+ version: zod.ZodInt;
110
+ schema: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
111
+ data_example: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnknown>>;
112
+ }, zod.z.core.$strict>;
113
+ /**
114
+ * Returns one version of an event.
115
+ * @summary Get an event version
116
+ */
117
+ export declare const getEventVersionPathEventNameMax = 128;
118
+ export declare const getEventVersionPathEventNameRegExp: RegExp;
119
+ export declare const GetEventVersionParams: zod.ZodObject<{
120
+ eventName: zod.ZodString;
121
+ version: zod.ZodInt;
122
+ }, zod.z.core.$strict>;
123
+ /**
124
+ * Validates the payload against the selected version and publishes the message. The response
125
+ * carries the message identity; it does not mean a consumer received it. A version of zero
126
+ * selects the highest active version.
127
+ * @summary Publish an event message
128
+ */
129
+ export declare const publishEventPathEventNameMax = 128;
130
+ export declare const publishEventPathEventNameRegExp: RegExp;
131
+ export declare const PublishEventParams: zod.ZodObject<{
132
+ eventName: zod.ZodString;
133
+ }, zod.z.core.$strict>;
134
+ export declare const PublishEventBody: zod.ZodObject<{
135
+ version: zod.ZodDefault<zod.ZodInt>;
136
+ key: zod.ZodOptional<zod.ZodString>;
137
+ data: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
138
+ }, zod.z.core.$strict>;
@@ -0,0 +1,163 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Event Bus API
5
+ * Event definitions, versions, publishing, and realtime access.
6
+ *
7
+ * ## Authentication
8
+ *
9
+ * Every request carries a scoped token; see the `bearerAuth` security scheme. Neither the path
10
+ * nor the headers carry a `project_id`: the current project is determined by the token.
11
+ *
12
+ * ## Definitions and messages
13
+ *
14
+ * An event is a definition: a name, a description, and one or more versions. A version carries a
15
+ * JSON Schema that every published payload must satisfy. Messages are not stored here and are
16
+ * not part of the event definition.
17
+ *
18
+ * A project event belongs to the current project. A global event has no `project_id`; it is
19
+ * defined by a platform service and is read-only in this API. Global events are listed alongside
20
+ * the project's own events.
21
+ *
22
+ * A version number never changes meaning. Adding optional properties is allowed within a version;
23
+ * a breaking change creates a new version. Publishing without a version uses the highest active
24
+ * version.
25
+ *
26
+ * ## Publishing
27
+ *
28
+ * Publishing returns the identity of the message and does not wait for consumers. Messages are
29
+ * not stored and are not replayed: a consumer that connects later does not receive earlier
30
+ * messages. Consumers receive messages through the realtime API or the platform's service API.
31
+ *
32
+ * ## Realtime
33
+ *
34
+ * Create a ticket, connect to the returned URL with the ticket, and authenticate the connection
35
+ * with a scoped token. A ticket is single-use and short-lived. The connection ends when the
36
+ * token expires unless it is refreshed with a new scoped token for the same user and project.
37
+ * OpenAPI spec version: 1.0.0
38
+ */
39
+ import * as zod from "zod";
40
+ import { CreateEventRequest } from "./validators/createEventRequest.zod.js";
41
+ import { CreateVersionRequest } from "./validators/createVersionRequest.zod.js";
42
+ import { PublishRequest } from "./validators/publishRequest.zod.js";
43
+ import { UpdateEventRequest } from "./validators/updateEventRequest.zod.js";
44
+ /**
45
+ * Returns the global events visible to the project and the project's own events. Ordered by
46
+ * name.
47
+ * @summary List event definitions
48
+ */
49
+ export const listEventsQueryPageDefault = 1;
50
+ export const listEventsQueryPageMax = 2147483647;
51
+ export const listEventsQueryPageSizeDefault = 50;
52
+ export const listEventsQueryPageSizeMax = 200;
53
+ export const listEventsQueryNamespaceMax = 64;
54
+ export const listEventsQueryKeywordMax = 128;
55
+ export const listEventsQueryIncludeArchivedDefault = false;
56
+ export const ListEventsQueryParams = zod.strictObject({
57
+ page: zod
58
+ .int()
59
+ .min(1)
60
+ .max(listEventsQueryPageMax)
61
+ .default(listEventsQueryPageDefault)
62
+ .describe("1-based page number. Defaults to 1."),
63
+ page_size: zod
64
+ .int()
65
+ .min(1)
66
+ .max(listEventsQueryPageSizeMax)
67
+ .default(listEventsQueryPageSizeDefault)
68
+ .describe("Items per page. Defaults to 50; at most 200."),
69
+ namespace: zod
70
+ .string()
71
+ .max(listEventsQueryNamespaceMax)
72
+ .optional()
73
+ .describe("Return only events in this namespace; omit for all namespaces"),
74
+ keyword: zod
75
+ .string()
76
+ .max(listEventsQueryKeywordMax)
77
+ .optional()
78
+ .describe("Match the event name or description, case-insensitively"),
79
+ include_archived: zod
80
+ .boolean()
81
+ .default(listEventsQueryIncludeArchivedDefault)
82
+ .describe("Include archived events; defaults to false"),
83
+ });
84
+ /**
85
+ * Creates a project event with its first version. The name is unique within the project. The
86
+ * first segment of the name is the event's namespace and must not be a platform namespace.
87
+ * @summary Create an event definition
88
+ */
89
+ export const CreateEventBody = CreateEventRequest;
90
+ /**
91
+ * Returns the event and every version, newest first.
92
+ * @summary Get an event definition
93
+ */
94
+ export const getEventPathEventNameMax = 128;
95
+ export const getEventPathEventNameRegExp = new RegExp("^[a-z](?:[a-z0-9_]*[a-z0-9])?(?:\\.[a-z](?:[a-z0-9_]*[a-z0-9])?){2,}$");
96
+ export const GetEventParams = zod.strictObject({
97
+ eventName: zod
98
+ .string()
99
+ .max(getEventPathEventNameMax)
100
+ .regex(getEventPathEventNameRegExp)
101
+ .describe("The event's full name, such as `acme.order.created`"),
102
+ });
103
+ /**
104
+ * Changes the description, tags, or status. Only the fields present in the request are
105
+ * changed. An archived event stops accepting new messages; existing versions remain readable.
106
+ * @summary Update an event definition
107
+ */
108
+ export const updateEventPathEventNameMax = 128;
109
+ export const updateEventPathEventNameRegExp = new RegExp("^[a-z](?:[a-z0-9_]*[a-z0-9])?(?:\\.[a-z](?:[a-z0-9_]*[a-z0-9])?){2,}$");
110
+ export const UpdateEventParams = zod.strictObject({
111
+ eventName: zod
112
+ .string()
113
+ .max(updateEventPathEventNameMax)
114
+ .regex(updateEventPathEventNameRegExp)
115
+ .describe("The event's full name, such as `acme.order.created`"),
116
+ });
117
+ export const UpdateEventBody = UpdateEventRequest;
118
+ /**
119
+ * Adds a version to an existing event. The version number must be greater than every existing
120
+ * version. A version number's schema may gain optional properties, but it may not remove or
121
+ * change existing ones; use a new version for a breaking change.
122
+ * @summary Add an event version
123
+ */
124
+ export const createEventVersionPathEventNameMax = 128;
125
+ export const createEventVersionPathEventNameRegExp = new RegExp("^[a-z](?:[a-z0-9_]*[a-z0-9])?(?:\\.[a-z](?:[a-z0-9_]*[a-z0-9])?){2,}$");
126
+ export const CreateEventVersionParams = zod.strictObject({
127
+ eventName: zod
128
+ .string()
129
+ .max(createEventVersionPathEventNameMax)
130
+ .regex(createEventVersionPathEventNameRegExp)
131
+ .describe("The event's full name, such as `acme.order.created`"),
132
+ });
133
+ export const CreateEventVersionBody = CreateVersionRequest;
134
+ /**
135
+ * Returns one version of an event.
136
+ * @summary Get an event version
137
+ */
138
+ export const getEventVersionPathEventNameMax = 128;
139
+ export const getEventVersionPathEventNameRegExp = new RegExp("^[a-z](?:[a-z0-9_]*[a-z0-9])?(?:\\.[a-z](?:[a-z0-9_]*[a-z0-9])?){2,}$");
140
+ export const GetEventVersionParams = zod.strictObject({
141
+ eventName: zod
142
+ .string()
143
+ .max(getEventVersionPathEventNameMax)
144
+ .regex(getEventVersionPathEventNameRegExp)
145
+ .describe("The event's full name, such as `acme.order.created`"),
146
+ version: zod.int().min(1).describe("The version number, starting at 1"),
147
+ });
148
+ /**
149
+ * Validates the payload against the selected version and publishes the message. The response
150
+ * carries the message identity; it does not mean a consumer received it. A version of zero
151
+ * selects the highest active version.
152
+ * @summary Publish an event message
153
+ */
154
+ export const publishEventPathEventNameMax = 128;
155
+ export const publishEventPathEventNameRegExp = new RegExp("^[a-z](?:[a-z0-9_]*[a-z0-9])?(?:\\.[a-z](?:[a-z0-9_]*[a-z0-9])?){2,}$");
156
+ export const PublishEventParams = zod.strictObject({
157
+ eventName: zod
158
+ .string()
159
+ .max(publishEventPathEventNameMax)
160
+ .regex(publishEventPathEventNameRegExp)
161
+ .describe("The event's full name, such as `acme.order.created`"),
162
+ });
163
+ export const PublishEventBody = PublishRequest;