@toshicloud/sdk 0.0.0-stage → 0.3.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 (45) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +250 -2
  3. package/dist/client.d.ts +153 -0
  4. package/dist/client.js +92 -0
  5. package/dist/errors.d.ts +28 -0
  6. package/dist/errors.js +77 -0
  7. package/dist/execute.d.ts +7 -0
  8. package/dist/execute.js +380 -0
  9. package/dist/gen/toshi/workspace/v1/artifacts_pb.d.ts +843 -0
  10. package/dist/gen/toshi/workspace/v1/artifacts_pb.js +96 -0
  11. package/dist/gen/toshi/workspace/v1/channels_pb.d.ts +2713 -0
  12. package/dist/gen/toshi/workspace/v1/channels_pb.js +336 -0
  13. package/dist/gen/toshi/workspace/v1/display_pb.d.ts +1166 -0
  14. package/dist/gen/toshi/workspace/v1/display_pb.js +214 -0
  15. package/dist/gen/toshi/workspace/v1/projects_pb.d.ts +1540 -0
  16. package/dist/gen/toshi/workspace/v1/projects_pb.js +207 -0
  17. package/dist/gen/toshi/workspace/v1/recordings_pb.d.ts +1024 -0
  18. package/dist/gen/toshi/workspace/v1/recordings_pb.js +201 -0
  19. package/dist/gen/toshi/workspace/v1/secrets_pb.d.ts +1214 -0
  20. package/dist/gen/toshi/workspace/v1/secrets_pb.js +182 -0
  21. package/dist/gen/toshi/workspace/v1/volumes_pb.d.ts +444 -0
  22. package/dist/gen/toshi/workspace/v1/volumes_pb.js +107 -0
  23. package/dist/gen/toshi/workspace/v1/webhook_pb.d.ts +1018 -0
  24. package/dist/gen/toshi/workspace/v1/webhook_pb.js +153 -0
  25. package/dist/gen/toshi/workspace/v1/workloads_pb.d.ts +2858 -0
  26. package/dist/gen/toshi/workspace/v1/workloads_pb.js +261 -0
  27. package/dist/gen/toshi/workspace/v1/workspace_pb.d.ts +5380 -0
  28. package/dist/gen/toshi/workspace/v1/workspace_pb.js +855 -0
  29. package/dist/index.d.ts +15 -0
  30. package/dist/index.js +14 -0
  31. package/dist/interceptors.d.ts +10 -0
  32. package/dist/interceptors.js +159 -0
  33. package/dist/output.d.ts +7 -0
  34. package/dist/output.js +77 -0
  35. package/dist/retry.d.ts +42 -0
  36. package/dist/retry.js +254 -0
  37. package/dist/run.d.ts +10 -0
  38. package/dist/run.js +175 -0
  39. package/dist/stream.d.ts +21 -0
  40. package/dist/stream.js +84 -0
  41. package/dist/wait.d.ts +13 -0
  42. package/dist/wait.js +41 -0
  43. package/dist/watch.d.ts +16 -0
  44. package/dist/watch.js +277 -0
  45. package/package.json +47 -4
@@ -0,0 +1,1018 @@
1
+ import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
2
+ import type { FieldMask, FieldMaskJson, Timestamp, TimestampJson } from "@bufbuild/protobuf/wkt";
3
+ import type { Message } from "@bufbuild/protobuf";
4
+ /**
5
+ * Describes the file toshi/workspace/v1/webhook.proto.
6
+ */
7
+ export declare const file_toshi_workspace_v1_webhook: GenFile;
8
+ /**
9
+ * @generated from message toshi.workspace.v1.WebhookEndpoint
10
+ */
11
+ export type WebhookEndpoint = Message<"toshi.workspace.v1.WebhookEndpoint"> & {
12
+ /**
13
+ * Assigned by the server; unique within the workspace.
14
+ *
15
+ * @generated from field: string id = 1;
16
+ */
17
+ id: string;
18
+ /**
19
+ * An https URL with a host and no user or password, at most 2048 bytes.
20
+ *
21
+ * @generated from field: string url = 2;
22
+ */
23
+ url: string;
24
+ /**
25
+ * The event names the endpoint is owed, each a name (job.state_changed)
26
+ * or a prefix ending in ".*" (job.*); at most 64. Empty keeps every
27
+ * event.
28
+ *
29
+ * @generated from field: repeated string events = 3;
30
+ */
31
+ events: string[];
32
+ /**
33
+ * @generated from field: bool enabled = 4;
34
+ */
35
+ enabled: boolean;
36
+ /**
37
+ * The position in the workspace's event log the endpoint has read up to,
38
+ * an Event's cursor.
39
+ *
40
+ * @generated from field: string cursor = 5;
41
+ */
42
+ cursor: string;
43
+ /**
44
+ * When the secret the last rotation replaced stops signing; unset when
45
+ * no such secret signs.
46
+ *
47
+ * @generated from field: google.protobuf.Timestamp previous_secret_expires_at = 6;
48
+ */
49
+ previousSecretExpiresAt?: Timestamp | undefined;
50
+ /**
51
+ * @generated from field: google.protobuf.Timestamp created_at = 7;
52
+ */
53
+ createdAt?: Timestamp | undefined;
54
+ /**
55
+ * @generated from field: google.protobuf.Timestamp updated_at = 8;
56
+ */
57
+ updatedAt?: Timestamp | undefined;
58
+ };
59
+ /**
60
+ * @generated from message toshi.workspace.v1.WebhookEndpoint
61
+ */
62
+ export type WebhookEndpointJson = {
63
+ /**
64
+ * Assigned by the server; unique within the workspace.
65
+ *
66
+ * @generated from field: string id = 1;
67
+ */
68
+ id?: string;
69
+ /**
70
+ * An https URL with a host and no user or password, at most 2048 bytes.
71
+ *
72
+ * @generated from field: string url = 2;
73
+ */
74
+ url?: string;
75
+ /**
76
+ * The event names the endpoint is owed, each a name (job.state_changed)
77
+ * or a prefix ending in ".*" (job.*); at most 64. Empty keeps every
78
+ * event.
79
+ *
80
+ * @generated from field: repeated string events = 3;
81
+ */
82
+ events?: string[];
83
+ /**
84
+ * @generated from field: bool enabled = 4;
85
+ */
86
+ enabled?: boolean;
87
+ /**
88
+ * The position in the workspace's event log the endpoint has read up to,
89
+ * an Event's cursor.
90
+ *
91
+ * @generated from field: string cursor = 5;
92
+ */
93
+ cursor?: string;
94
+ /**
95
+ * When the secret the last rotation replaced stops signing; unset when
96
+ * no such secret signs.
97
+ *
98
+ * @generated from field: google.protobuf.Timestamp previous_secret_expires_at = 6;
99
+ */
100
+ previousSecretExpiresAt?: TimestampJson;
101
+ /**
102
+ * @generated from field: google.protobuf.Timestamp created_at = 7;
103
+ */
104
+ createdAt?: TimestampJson;
105
+ /**
106
+ * @generated from field: google.protobuf.Timestamp updated_at = 8;
107
+ */
108
+ updatedAt?: TimestampJson;
109
+ };
110
+ /**
111
+ * Describes the message toshi.workspace.v1.WebhookEndpoint.
112
+ * Use `create(WebhookEndpointSchema)` to create a new message.
113
+ */
114
+ export declare const WebhookEndpointSchema: GenMessage<WebhookEndpoint, {
115
+ jsonType: WebhookEndpointJson;
116
+ }>;
117
+ /**
118
+ * WebhookDelivery is one event owed to one endpoint.
119
+ *
120
+ * @generated from message toshi.workspace.v1.WebhookDelivery
121
+ */
122
+ export type WebhookDelivery = Message<"toshi.workspace.v1.WebhookDelivery"> & {
123
+ /**
124
+ * @generated from field: string event_id = 1;
125
+ */
126
+ eventId: string;
127
+ /**
128
+ * The event's cursor.
129
+ *
130
+ * @generated from field: string cursor = 2;
131
+ */
132
+ cursor: string;
133
+ /**
134
+ * @generated from field: string workload_id = 3;
135
+ */
136
+ workloadId: string;
137
+ /**
138
+ * @generated from field: toshi.workspace.v1.WebhookDeliveryState state = 4;
139
+ */
140
+ state: WebhookDeliveryState;
141
+ /**
142
+ * Tries since the delivery was last due.
143
+ *
144
+ * @generated from field: int32 tries = 5;
145
+ */
146
+ tries: number;
147
+ /**
148
+ * When it may next be tried; set while it is pending.
149
+ *
150
+ * @generated from field: google.protobuf.Timestamp next_try_at = 6;
151
+ */
152
+ nextTryAt?: Timestamp | undefined;
153
+ /**
154
+ * The last try's HTTP status; 0 when no answer came or none was tried.
155
+ *
156
+ * @generated from field: int32 last_status = 7;
157
+ */
158
+ lastStatus: number;
159
+ /**
160
+ * The last try's error, which never carries the URL.
161
+ *
162
+ * @generated from field: string last_error = 8;
163
+ */
164
+ lastError: string;
165
+ /**
166
+ * @generated from field: google.protobuf.Timestamp due_at = 9;
167
+ */
168
+ dueAt?: Timestamp | undefined;
169
+ /**
170
+ * When it was delivered or given up.
171
+ *
172
+ * @generated from field: google.protobuf.Timestamp done_at = 10;
173
+ */
174
+ doneAt?: Timestamp | undefined;
175
+ };
176
+ /**
177
+ * WebhookDelivery is one event owed to one endpoint.
178
+ *
179
+ * @generated from message toshi.workspace.v1.WebhookDelivery
180
+ */
181
+ export type WebhookDeliveryJson = {
182
+ /**
183
+ * @generated from field: string event_id = 1;
184
+ */
185
+ eventId?: string;
186
+ /**
187
+ * The event's cursor.
188
+ *
189
+ * @generated from field: string cursor = 2;
190
+ */
191
+ cursor?: string;
192
+ /**
193
+ * @generated from field: string workload_id = 3;
194
+ */
195
+ workloadId?: string;
196
+ /**
197
+ * @generated from field: toshi.workspace.v1.WebhookDeliveryState state = 4;
198
+ */
199
+ state?: WebhookDeliveryStateJson;
200
+ /**
201
+ * Tries since the delivery was last due.
202
+ *
203
+ * @generated from field: int32 tries = 5;
204
+ */
205
+ tries?: number;
206
+ /**
207
+ * When it may next be tried; set while it is pending.
208
+ *
209
+ * @generated from field: google.protobuf.Timestamp next_try_at = 6;
210
+ */
211
+ nextTryAt?: TimestampJson;
212
+ /**
213
+ * The last try's HTTP status; 0 when no answer came or none was tried.
214
+ *
215
+ * @generated from field: int32 last_status = 7;
216
+ */
217
+ lastStatus?: number;
218
+ /**
219
+ * The last try's error, which never carries the URL.
220
+ *
221
+ * @generated from field: string last_error = 8;
222
+ */
223
+ lastError?: string;
224
+ /**
225
+ * @generated from field: google.protobuf.Timestamp due_at = 9;
226
+ */
227
+ dueAt?: TimestampJson;
228
+ /**
229
+ * When it was delivered or given up.
230
+ *
231
+ * @generated from field: google.protobuf.Timestamp done_at = 10;
232
+ */
233
+ doneAt?: TimestampJson;
234
+ };
235
+ /**
236
+ * Describes the message toshi.workspace.v1.WebhookDelivery.
237
+ * Use `create(WebhookDeliverySchema)` to create a new message.
238
+ */
239
+ export declare const WebhookDeliverySchema: GenMessage<WebhookDelivery, {
240
+ jsonType: WebhookDeliveryJson;
241
+ }>;
242
+ /**
243
+ * @generated from message toshi.workspace.v1.CreateWebhookEndpointRequest
244
+ */
245
+ export type CreateWebhookEndpointRequest = Message<"toshi.workspace.v1.CreateWebhookEndpointRequest"> & {
246
+ /**
247
+ * @generated from field: string url = 1;
248
+ */
249
+ url: string;
250
+ /**
251
+ * @generated from field: repeated string events = 2;
252
+ */
253
+ events: string[];
254
+ /**
255
+ * Set to make the endpoint disabled.
256
+ *
257
+ * @generated from field: bool disabled = 3;
258
+ */
259
+ disabled: boolean;
260
+ /**
261
+ * @generated from field: string request_key = 4;
262
+ */
263
+ requestKey: string;
264
+ };
265
+ /**
266
+ * @generated from message toshi.workspace.v1.CreateWebhookEndpointRequest
267
+ */
268
+ export type CreateWebhookEndpointRequestJson = {
269
+ /**
270
+ * @generated from field: string url = 1;
271
+ */
272
+ url?: string;
273
+ /**
274
+ * @generated from field: repeated string events = 2;
275
+ */
276
+ events?: string[];
277
+ /**
278
+ * Set to make the endpoint disabled.
279
+ *
280
+ * @generated from field: bool disabled = 3;
281
+ */
282
+ disabled?: boolean;
283
+ /**
284
+ * @generated from field: string request_key = 4;
285
+ */
286
+ requestKey?: string;
287
+ };
288
+ /**
289
+ * Describes the message toshi.workspace.v1.CreateWebhookEndpointRequest.
290
+ * Use `create(CreateWebhookEndpointRequestSchema)` to create a new message.
291
+ */
292
+ export declare const CreateWebhookEndpointRequestSchema: GenMessage<CreateWebhookEndpointRequest, {
293
+ jsonType: CreateWebhookEndpointRequestJson;
294
+ }>;
295
+ /**
296
+ * @generated from message toshi.workspace.v1.CreateWebhookEndpointResponse
297
+ */
298
+ export type CreateWebhookEndpointResponse = Message<"toshi.workspace.v1.CreateWebhookEndpointResponse"> & {
299
+ /**
300
+ * @generated from field: toshi.workspace.v1.WebhookEndpoint endpoint = 1;
301
+ */
302
+ endpoint?: WebhookEndpoint | undefined;
303
+ /**
304
+ * whsec_ and the base64 of 32 random bytes. No other answer carries it.
305
+ *
306
+ * @generated from field: string secret = 2;
307
+ */
308
+ secret: string;
309
+ };
310
+ /**
311
+ * @generated from message toshi.workspace.v1.CreateWebhookEndpointResponse
312
+ */
313
+ export type CreateWebhookEndpointResponseJson = {
314
+ /**
315
+ * @generated from field: toshi.workspace.v1.WebhookEndpoint endpoint = 1;
316
+ */
317
+ endpoint?: WebhookEndpointJson;
318
+ /**
319
+ * whsec_ and the base64 of 32 random bytes. No other answer carries it.
320
+ *
321
+ * @generated from field: string secret = 2;
322
+ */
323
+ secret?: string;
324
+ };
325
+ /**
326
+ * Describes the message toshi.workspace.v1.CreateWebhookEndpointResponse.
327
+ * Use `create(CreateWebhookEndpointResponseSchema)` to create a new message.
328
+ */
329
+ export declare const CreateWebhookEndpointResponseSchema: GenMessage<CreateWebhookEndpointResponse, {
330
+ jsonType: CreateWebhookEndpointResponseJson;
331
+ }>;
332
+ /**
333
+ * @generated from message toshi.workspace.v1.GetWebhookEndpointRequest
334
+ */
335
+ export type GetWebhookEndpointRequest = Message<"toshi.workspace.v1.GetWebhookEndpointRequest"> & {
336
+ /**
337
+ * @generated from field: string id = 1;
338
+ */
339
+ id: string;
340
+ };
341
+ /**
342
+ * @generated from message toshi.workspace.v1.GetWebhookEndpointRequest
343
+ */
344
+ export type GetWebhookEndpointRequestJson = {
345
+ /**
346
+ * @generated from field: string id = 1;
347
+ */
348
+ id?: string;
349
+ };
350
+ /**
351
+ * Describes the message toshi.workspace.v1.GetWebhookEndpointRequest.
352
+ * Use `create(GetWebhookEndpointRequestSchema)` to create a new message.
353
+ */
354
+ export declare const GetWebhookEndpointRequestSchema: GenMessage<GetWebhookEndpointRequest, {
355
+ jsonType: GetWebhookEndpointRequestJson;
356
+ }>;
357
+ /**
358
+ * @generated from message toshi.workspace.v1.GetWebhookEndpointResponse
359
+ */
360
+ export type GetWebhookEndpointResponse = Message<"toshi.workspace.v1.GetWebhookEndpointResponse"> & {
361
+ /**
362
+ * @generated from field: toshi.workspace.v1.WebhookEndpoint endpoint = 1;
363
+ */
364
+ endpoint?: WebhookEndpoint | undefined;
365
+ };
366
+ /**
367
+ * @generated from message toshi.workspace.v1.GetWebhookEndpointResponse
368
+ */
369
+ export type GetWebhookEndpointResponseJson = {
370
+ /**
371
+ * @generated from field: toshi.workspace.v1.WebhookEndpoint endpoint = 1;
372
+ */
373
+ endpoint?: WebhookEndpointJson;
374
+ };
375
+ /**
376
+ * Describes the message toshi.workspace.v1.GetWebhookEndpointResponse.
377
+ * Use `create(GetWebhookEndpointResponseSchema)` to create a new message.
378
+ */
379
+ export declare const GetWebhookEndpointResponseSchema: GenMessage<GetWebhookEndpointResponse, {
380
+ jsonType: GetWebhookEndpointResponseJson;
381
+ }>;
382
+ /**
383
+ * @generated from message toshi.workspace.v1.ListWebhookEndpointsRequest
384
+ */
385
+ export type ListWebhookEndpointsRequest = Message<"toshi.workspace.v1.ListWebhookEndpointsRequest"> & {
386
+ /**
387
+ * The most endpoints in one page; zero lets the server choose.
388
+ *
389
+ * @generated from field: int32 page_size = 1;
390
+ */
391
+ pageSize: number;
392
+ /**
393
+ * From an earlier response's next_page_token; empty for the first page.
394
+ *
395
+ * @generated from field: string page_token = 2;
396
+ */
397
+ pageToken: string;
398
+ };
399
+ /**
400
+ * @generated from message toshi.workspace.v1.ListWebhookEndpointsRequest
401
+ */
402
+ export type ListWebhookEndpointsRequestJson = {
403
+ /**
404
+ * The most endpoints in one page; zero lets the server choose.
405
+ *
406
+ * @generated from field: int32 page_size = 1;
407
+ */
408
+ pageSize?: number;
409
+ /**
410
+ * From an earlier response's next_page_token; empty for the first page.
411
+ *
412
+ * @generated from field: string page_token = 2;
413
+ */
414
+ pageToken?: string;
415
+ };
416
+ /**
417
+ * Describes the message toshi.workspace.v1.ListWebhookEndpointsRequest.
418
+ * Use `create(ListWebhookEndpointsRequestSchema)` to create a new message.
419
+ */
420
+ export declare const ListWebhookEndpointsRequestSchema: GenMessage<ListWebhookEndpointsRequest, {
421
+ jsonType: ListWebhookEndpointsRequestJson;
422
+ }>;
423
+ /**
424
+ * @generated from message toshi.workspace.v1.ListWebhookEndpointsResponse
425
+ */
426
+ export type ListWebhookEndpointsResponse = Message<"toshi.workspace.v1.ListWebhookEndpointsResponse"> & {
427
+ /**
428
+ * @generated from field: repeated toshi.workspace.v1.WebhookEndpoint endpoints = 1;
429
+ */
430
+ endpoints: WebhookEndpoint[];
431
+ /**
432
+ * Empty on the last page.
433
+ *
434
+ * @generated from field: string next_page_token = 2;
435
+ */
436
+ nextPageToken: string;
437
+ };
438
+ /**
439
+ * @generated from message toshi.workspace.v1.ListWebhookEndpointsResponse
440
+ */
441
+ export type ListWebhookEndpointsResponseJson = {
442
+ /**
443
+ * @generated from field: repeated toshi.workspace.v1.WebhookEndpoint endpoints = 1;
444
+ */
445
+ endpoints?: WebhookEndpointJson[];
446
+ /**
447
+ * Empty on the last page.
448
+ *
449
+ * @generated from field: string next_page_token = 2;
450
+ */
451
+ nextPageToken?: string;
452
+ };
453
+ /**
454
+ * Describes the message toshi.workspace.v1.ListWebhookEndpointsResponse.
455
+ * Use `create(ListWebhookEndpointsResponseSchema)` to create a new message.
456
+ */
457
+ export declare const ListWebhookEndpointsResponseSchema: GenMessage<ListWebhookEndpointsResponse, {
458
+ jsonType: ListWebhookEndpointsResponseJson;
459
+ }>;
460
+ /**
461
+ * @generated from message toshi.workspace.v1.UpdateWebhookEndpointRequest
462
+ */
463
+ export type UpdateWebhookEndpointRequest = Message<"toshi.workspace.v1.UpdateWebhookEndpointRequest"> & {
464
+ /**
465
+ * @generated from field: string id = 1;
466
+ */
467
+ id: string;
468
+ /**
469
+ * Carries the new values of the fields update_mask names.
470
+ *
471
+ * @generated from field: toshi.workspace.v1.WebhookEndpoint endpoint = 2;
472
+ */
473
+ endpoint?: WebhookEndpoint | undefined;
474
+ /**
475
+ * One or more of url, events and enabled.
476
+ *
477
+ * @generated from field: google.protobuf.FieldMask update_mask = 3;
478
+ */
479
+ updateMask?: FieldMask | undefined;
480
+ /**
481
+ * @generated from field: string request_key = 4;
482
+ */
483
+ requestKey: string;
484
+ };
485
+ /**
486
+ * @generated from message toshi.workspace.v1.UpdateWebhookEndpointRequest
487
+ */
488
+ export type UpdateWebhookEndpointRequestJson = {
489
+ /**
490
+ * @generated from field: string id = 1;
491
+ */
492
+ id?: string;
493
+ /**
494
+ * Carries the new values of the fields update_mask names.
495
+ *
496
+ * @generated from field: toshi.workspace.v1.WebhookEndpoint endpoint = 2;
497
+ */
498
+ endpoint?: WebhookEndpointJson;
499
+ /**
500
+ * One or more of url, events and enabled.
501
+ *
502
+ * @generated from field: google.protobuf.FieldMask update_mask = 3;
503
+ */
504
+ updateMask?: FieldMaskJson;
505
+ /**
506
+ * @generated from field: string request_key = 4;
507
+ */
508
+ requestKey?: string;
509
+ };
510
+ /**
511
+ * Describes the message toshi.workspace.v1.UpdateWebhookEndpointRequest.
512
+ * Use `create(UpdateWebhookEndpointRequestSchema)` to create a new message.
513
+ */
514
+ export declare const UpdateWebhookEndpointRequestSchema: GenMessage<UpdateWebhookEndpointRequest, {
515
+ jsonType: UpdateWebhookEndpointRequestJson;
516
+ }>;
517
+ /**
518
+ * @generated from message toshi.workspace.v1.UpdateWebhookEndpointResponse
519
+ */
520
+ export type UpdateWebhookEndpointResponse = Message<"toshi.workspace.v1.UpdateWebhookEndpointResponse"> & {
521
+ /**
522
+ * @generated from field: toshi.workspace.v1.WebhookEndpoint endpoint = 1;
523
+ */
524
+ endpoint?: WebhookEndpoint | undefined;
525
+ };
526
+ /**
527
+ * @generated from message toshi.workspace.v1.UpdateWebhookEndpointResponse
528
+ */
529
+ export type UpdateWebhookEndpointResponseJson = {
530
+ /**
531
+ * @generated from field: toshi.workspace.v1.WebhookEndpoint endpoint = 1;
532
+ */
533
+ endpoint?: WebhookEndpointJson;
534
+ };
535
+ /**
536
+ * Describes the message toshi.workspace.v1.UpdateWebhookEndpointResponse.
537
+ * Use `create(UpdateWebhookEndpointResponseSchema)` to create a new message.
538
+ */
539
+ export declare const UpdateWebhookEndpointResponseSchema: GenMessage<UpdateWebhookEndpointResponse, {
540
+ jsonType: UpdateWebhookEndpointResponseJson;
541
+ }>;
542
+ /**
543
+ * @generated from message toshi.workspace.v1.DeleteWebhookEndpointRequest
544
+ */
545
+ export type DeleteWebhookEndpointRequest = Message<"toshi.workspace.v1.DeleteWebhookEndpointRequest"> & {
546
+ /**
547
+ * @generated from field: string id = 1;
548
+ */
549
+ id: string;
550
+ /**
551
+ * @generated from field: string request_key = 2;
552
+ */
553
+ requestKey: string;
554
+ };
555
+ /**
556
+ * @generated from message toshi.workspace.v1.DeleteWebhookEndpointRequest
557
+ */
558
+ export type DeleteWebhookEndpointRequestJson = {
559
+ /**
560
+ * @generated from field: string id = 1;
561
+ */
562
+ id?: string;
563
+ /**
564
+ * @generated from field: string request_key = 2;
565
+ */
566
+ requestKey?: string;
567
+ };
568
+ /**
569
+ * Describes the message toshi.workspace.v1.DeleteWebhookEndpointRequest.
570
+ * Use `create(DeleteWebhookEndpointRequestSchema)` to create a new message.
571
+ */
572
+ export declare const DeleteWebhookEndpointRequestSchema: GenMessage<DeleteWebhookEndpointRequest, {
573
+ jsonType: DeleteWebhookEndpointRequestJson;
574
+ }>;
575
+ /**
576
+ * @generated from message toshi.workspace.v1.DeleteWebhookEndpointResponse
577
+ */
578
+ export type DeleteWebhookEndpointResponse = Message<"toshi.workspace.v1.DeleteWebhookEndpointResponse"> & {};
579
+ /**
580
+ * @generated from message toshi.workspace.v1.DeleteWebhookEndpointResponse
581
+ */
582
+ export type DeleteWebhookEndpointResponseJson = {};
583
+ /**
584
+ * Describes the message toshi.workspace.v1.DeleteWebhookEndpointResponse.
585
+ * Use `create(DeleteWebhookEndpointResponseSchema)` to create a new message.
586
+ */
587
+ export declare const DeleteWebhookEndpointResponseSchema: GenMessage<DeleteWebhookEndpointResponse, {
588
+ jsonType: DeleteWebhookEndpointResponseJson;
589
+ }>;
590
+ /**
591
+ * @generated from message toshi.workspace.v1.RotateWebhookEndpointSecretRequest
592
+ */
593
+ export type RotateWebhookEndpointSecretRequest = Message<"toshi.workspace.v1.RotateWebhookEndpointSecretRequest"> & {
594
+ /**
595
+ * @generated from field: string id = 1;
596
+ */
597
+ id: string;
598
+ /**
599
+ * @generated from field: string request_key = 2;
600
+ */
601
+ requestKey: string;
602
+ };
603
+ /**
604
+ * @generated from message toshi.workspace.v1.RotateWebhookEndpointSecretRequest
605
+ */
606
+ export type RotateWebhookEndpointSecretRequestJson = {
607
+ /**
608
+ * @generated from field: string id = 1;
609
+ */
610
+ id?: string;
611
+ /**
612
+ * @generated from field: string request_key = 2;
613
+ */
614
+ requestKey?: string;
615
+ };
616
+ /**
617
+ * Describes the message toshi.workspace.v1.RotateWebhookEndpointSecretRequest.
618
+ * Use `create(RotateWebhookEndpointSecretRequestSchema)` to create a new message.
619
+ */
620
+ export declare const RotateWebhookEndpointSecretRequestSchema: GenMessage<RotateWebhookEndpointSecretRequest, {
621
+ jsonType: RotateWebhookEndpointSecretRequestJson;
622
+ }>;
623
+ /**
624
+ * @generated from message toshi.workspace.v1.RotateWebhookEndpointSecretResponse
625
+ */
626
+ export type RotateWebhookEndpointSecretResponse = Message<"toshi.workspace.v1.RotateWebhookEndpointSecretResponse"> & {
627
+ /**
628
+ * @generated from field: toshi.workspace.v1.WebhookEndpoint endpoint = 1;
629
+ */
630
+ endpoint?: WebhookEndpoint | undefined;
631
+ /**
632
+ * The new secret, as CreateWebhookEndpointResponse's.
633
+ *
634
+ * @generated from field: string secret = 2;
635
+ */
636
+ secret: string;
637
+ };
638
+ /**
639
+ * @generated from message toshi.workspace.v1.RotateWebhookEndpointSecretResponse
640
+ */
641
+ export type RotateWebhookEndpointSecretResponseJson = {
642
+ /**
643
+ * @generated from field: toshi.workspace.v1.WebhookEndpoint endpoint = 1;
644
+ */
645
+ endpoint?: WebhookEndpointJson;
646
+ /**
647
+ * The new secret, as CreateWebhookEndpointResponse's.
648
+ *
649
+ * @generated from field: string secret = 2;
650
+ */
651
+ secret?: string;
652
+ };
653
+ /**
654
+ * Describes the message toshi.workspace.v1.RotateWebhookEndpointSecretResponse.
655
+ * Use `create(RotateWebhookEndpointSecretResponseSchema)` to create a new message.
656
+ */
657
+ export declare const RotateWebhookEndpointSecretResponseSchema: GenMessage<RotateWebhookEndpointSecretResponse, {
658
+ jsonType: RotateWebhookEndpointSecretResponseJson;
659
+ }>;
660
+ /**
661
+ * @generated from message toshi.workspace.v1.ListWebhookDeliveriesRequest
662
+ */
663
+ export type ListWebhookDeliveriesRequest = Message<"toshi.workspace.v1.ListWebhookDeliveriesRequest"> & {
664
+ /**
665
+ * @generated from field: string endpoint_id = 1;
666
+ */
667
+ endpointId: string;
668
+ /**
669
+ * From an earlier response's next_page_token, or a delivery's cursor:
670
+ * the deliveries of the events after that position. Empty starts at the
671
+ * oldest.
672
+ *
673
+ * @generated from field: string page_token = 2;
674
+ */
675
+ pageToken: string;
676
+ /**
677
+ * The most deliveries in one page; zero lets the server choose.
678
+ *
679
+ * @generated from field: int32 page_size = 3;
680
+ */
681
+ pageSize: number;
682
+ };
683
+ /**
684
+ * @generated from message toshi.workspace.v1.ListWebhookDeliveriesRequest
685
+ */
686
+ export type ListWebhookDeliveriesRequestJson = {
687
+ /**
688
+ * @generated from field: string endpoint_id = 1;
689
+ */
690
+ endpointId?: string;
691
+ /**
692
+ * From an earlier response's next_page_token, or a delivery's cursor:
693
+ * the deliveries of the events after that position. Empty starts at the
694
+ * oldest.
695
+ *
696
+ * @generated from field: string page_token = 2;
697
+ */
698
+ pageToken?: string;
699
+ /**
700
+ * The most deliveries in one page; zero lets the server choose.
701
+ *
702
+ * @generated from field: int32 page_size = 3;
703
+ */
704
+ pageSize?: number;
705
+ };
706
+ /**
707
+ * Describes the message toshi.workspace.v1.ListWebhookDeliveriesRequest.
708
+ * Use `create(ListWebhookDeliveriesRequestSchema)` to create a new message.
709
+ */
710
+ export declare const ListWebhookDeliveriesRequestSchema: GenMessage<ListWebhookDeliveriesRequest, {
711
+ jsonType: ListWebhookDeliveriesRequestJson;
712
+ }>;
713
+ /**
714
+ * @generated from message toshi.workspace.v1.ListWebhookDeliveriesResponse
715
+ */
716
+ export type ListWebhookDeliveriesResponse = Message<"toshi.workspace.v1.ListWebhookDeliveriesResponse"> & {
717
+ /**
718
+ * @generated from field: repeated toshi.workspace.v1.WebhookDelivery deliveries = 1;
719
+ */
720
+ deliveries: WebhookDelivery[];
721
+ /**
722
+ * Empty on the last page.
723
+ *
724
+ * @generated from field: string next_page_token = 2;
725
+ */
726
+ nextPageToken: string;
727
+ };
728
+ /**
729
+ * @generated from message toshi.workspace.v1.ListWebhookDeliveriesResponse
730
+ */
731
+ export type ListWebhookDeliveriesResponseJson = {
732
+ /**
733
+ * @generated from field: repeated toshi.workspace.v1.WebhookDelivery deliveries = 1;
734
+ */
735
+ deliveries?: WebhookDeliveryJson[];
736
+ /**
737
+ * Empty on the last page.
738
+ *
739
+ * @generated from field: string next_page_token = 2;
740
+ */
741
+ nextPageToken?: string;
742
+ };
743
+ /**
744
+ * Describes the message toshi.workspace.v1.ListWebhookDeliveriesResponse.
745
+ * Use `create(ListWebhookDeliveriesResponseSchema)` to create a new message.
746
+ */
747
+ export declare const ListWebhookDeliveriesResponseSchema: GenMessage<ListWebhookDeliveriesResponse, {
748
+ jsonType: ListWebhookDeliveriesResponseJson;
749
+ }>;
750
+ /**
751
+ * @generated from message toshi.workspace.v1.ReplayWebhookEventsRequest
752
+ */
753
+ export type ReplayWebhookEventsRequest = Message<"toshi.workspace.v1.ReplayWebhookEventsRequest"> & {
754
+ /**
755
+ * @generated from field: string endpoint_id = 1;
756
+ */
757
+ endpointId: string;
758
+ /**
759
+ * Events after this cursor; empty starts at the oldest event the log
760
+ * keeps. A cursor older than that event fails with OUT_OF_RANGE.
761
+ *
762
+ * @generated from field: string cursor = 2;
763
+ */
764
+ cursor: string;
765
+ /**
766
+ * @generated from field: string request_key = 3;
767
+ */
768
+ requestKey: string;
769
+ };
770
+ /**
771
+ * @generated from message toshi.workspace.v1.ReplayWebhookEventsRequest
772
+ */
773
+ export type ReplayWebhookEventsRequestJson = {
774
+ /**
775
+ * @generated from field: string endpoint_id = 1;
776
+ */
777
+ endpointId?: string;
778
+ /**
779
+ * Events after this cursor; empty starts at the oldest event the log
780
+ * keeps. A cursor older than that event fails with OUT_OF_RANGE.
781
+ *
782
+ * @generated from field: string cursor = 2;
783
+ */
784
+ cursor?: string;
785
+ /**
786
+ * @generated from field: string request_key = 3;
787
+ */
788
+ requestKey?: string;
789
+ };
790
+ /**
791
+ * Describes the message toshi.workspace.v1.ReplayWebhookEventsRequest.
792
+ * Use `create(ReplayWebhookEventsRequestSchema)` to create a new message.
793
+ */
794
+ export declare const ReplayWebhookEventsRequestSchema: GenMessage<ReplayWebhookEventsRequest, {
795
+ jsonType: ReplayWebhookEventsRequestJson;
796
+ }>;
797
+ /**
798
+ * @generated from message toshi.workspace.v1.ReplayWebhookEventsResponse
799
+ */
800
+ export type ReplayWebhookEventsResponse = Message<"toshi.workspace.v1.ReplayWebhookEventsResponse"> & {
801
+ /**
802
+ * How many deliveries were made due again.
803
+ *
804
+ * @generated from field: int32 replayed = 1;
805
+ */
806
+ replayed: number;
807
+ /**
808
+ * The cursor of the last event looked at, or the cursor asked for when
809
+ * there were none: pass it to the next call while more is set.
810
+ *
811
+ * @generated from field: string cursor = 2;
812
+ */
813
+ cursor: string;
814
+ /**
815
+ * Set when events up to the endpoint's own cursor remain after cursor.
816
+ *
817
+ * @generated from field: bool more = 3;
818
+ */
819
+ more: boolean;
820
+ };
821
+ /**
822
+ * @generated from message toshi.workspace.v1.ReplayWebhookEventsResponse
823
+ */
824
+ export type ReplayWebhookEventsResponseJson = {
825
+ /**
826
+ * How many deliveries were made due again.
827
+ *
828
+ * @generated from field: int32 replayed = 1;
829
+ */
830
+ replayed?: number;
831
+ /**
832
+ * The cursor of the last event looked at, or the cursor asked for when
833
+ * there were none: pass it to the next call while more is set.
834
+ *
835
+ * @generated from field: string cursor = 2;
836
+ */
837
+ cursor?: string;
838
+ /**
839
+ * Set when events up to the endpoint's own cursor remain after cursor.
840
+ *
841
+ * @generated from field: bool more = 3;
842
+ */
843
+ more?: boolean;
844
+ };
845
+ /**
846
+ * Describes the message toshi.workspace.v1.ReplayWebhookEventsResponse.
847
+ * Use `create(ReplayWebhookEventsResponseSchema)` to create a new message.
848
+ */
849
+ export declare const ReplayWebhookEventsResponseSchema: GenMessage<ReplayWebhookEventsResponse, {
850
+ jsonType: ReplayWebhookEventsResponseJson;
851
+ }>;
852
+ /**
853
+ * @generated from enum toshi.workspace.v1.WebhookDeliveryState
854
+ */
855
+ export declare enum WebhookDeliveryState {
856
+ /**
857
+ * @generated from enum value: WEBHOOK_DELIVERY_STATE_UNSPECIFIED = 0;
858
+ */
859
+ UNSPECIFIED = 0,
860
+ /**
861
+ * Owed: waiting for its next try, or being tried.
862
+ *
863
+ * @generated from enum value: WEBHOOK_DELIVERY_STATE_PENDING = 1;
864
+ */
865
+ PENDING = 1,
866
+ /**
867
+ * A try had a 2xx answer.
868
+ *
869
+ * @generated from enum value: WEBHOOK_DELIVERY_STATE_DELIVERED = 2;
870
+ */
871
+ DELIVERED = 2,
872
+ /**
873
+ * Every try failed until the sender gave up.
874
+ *
875
+ * @generated from enum value: WEBHOOK_DELIVERY_STATE_DEAD = 3;
876
+ */
877
+ DEAD = 3
878
+ }
879
+ /**
880
+ * @generated from enum toshi.workspace.v1.WebhookDeliveryState
881
+ */
882
+ export type WebhookDeliveryStateJson = "WEBHOOK_DELIVERY_STATE_UNSPECIFIED" | "WEBHOOK_DELIVERY_STATE_PENDING" | "WEBHOOK_DELIVERY_STATE_DELIVERED" | "WEBHOOK_DELIVERY_STATE_DEAD";
883
+ /**
884
+ * Describes the enum toshi.workspace.v1.WebhookDeliveryState.
885
+ */
886
+ export declare const WebhookDeliveryStateSchema: GenEnum<WebhookDeliveryState, WebhookDeliveryStateJson>;
887
+ /**
888
+ * WebhookService manages a workspace's webhook endpoints: the URLs its
889
+ * events are POSTed to, signed per Standard Webhooks. The caller's credential
890
+ * names the workspace, as for WorkloadService. An endpoint belongs to the
891
+ * workspace, not to a project or environment, and is owed the events of all
892
+ * of them; no request names either. An endpoint of another workspace is
893
+ * NOT_FOUND.
894
+ *
895
+ * Every mutating call takes a request_key, with WorkloadService's rule: a
896
+ * retry with the same key and the same payload returns what the first
897
+ * call returned and changes nothing; the same key with a different payload
898
+ * fails with FAILED_PRECONDITION; an empty key means no retry protection.
899
+ *
900
+ * An endpoint's signing secret is in the answer to the call that made it,
901
+ * CreateWebhookEndpoint or RotateWebhookEndpointSecret, and in no other
902
+ * answer. A retry of that call returns the same secret while it is the
903
+ * endpoint's newest; once the endpoint is rotated again or deleted, the
904
+ * retry fails with FAILED_PRECONDITION and changes nothing.
905
+ *
906
+ * @generated from service toshi.workspace.v1.WebhookService
907
+ */
908
+ export declare const WebhookService: GenService<{
909
+ /**
910
+ * CreateWebhookEndpoint makes an endpoint and its signing secret. The
911
+ * endpoint is owed the events written after it, from its cursor on. The
912
+ * control plane must hold a keyring to seal the secret; without one the
913
+ * call fails with FAILED_PRECONDITION.
914
+ *
915
+ * @generated from rpc toshi.workspace.v1.WebhookService.CreateWebhookEndpoint
916
+ */
917
+ createWebhookEndpoint: {
918
+ methodKind: "unary";
919
+ input: typeof CreateWebhookEndpointRequestSchema;
920
+ output: typeof CreateWebhookEndpointResponseSchema;
921
+ };
922
+ /**
923
+ * GetWebhookEndpoint returns one endpoint. An unknown ID fails with
924
+ * NOT_FOUND.
925
+ *
926
+ * @generated from rpc toshi.workspace.v1.WebhookService.GetWebhookEndpoint
927
+ */
928
+ getWebhookEndpoint: {
929
+ methodKind: "unary";
930
+ input: typeof GetWebhookEndpointRequestSchema;
931
+ output: typeof GetWebhookEndpointResponseSchema;
932
+ };
933
+ /**
934
+ * ListWebhookEndpoints returns the workspace's endpoints in ID order.
935
+ *
936
+ * A page holds 100 endpoints when page_size is zero, and 1000 at most.
937
+ *
938
+ * @generated from rpc toshi.workspace.v1.WebhookService.ListWebhookEndpoints
939
+ */
940
+ listWebhookEndpoints: {
941
+ methodKind: "unary";
942
+ input: typeof ListWebhookEndpointsRequestSchema;
943
+ output: typeof ListWebhookEndpointsResponseSchema;
944
+ };
945
+ /**
946
+ * UpdateWebhookEndpoint sets the fields update_mask names: url, events,
947
+ * enabled. A disabled endpoint is owed no new event and no try starts;
948
+ * the events written before the disable stay owed, enabling it again
949
+ * owes none written while it was disabled, and a try already under way
950
+ * finishes within its claim, which holds a delivery for one minute.
951
+ *
952
+ * @generated from rpc toshi.workspace.v1.WebhookService.UpdateWebhookEndpoint
953
+ */
954
+ updateWebhookEndpoint: {
955
+ methodKind: "unary";
956
+ input: typeof UpdateWebhookEndpointRequestSchema;
957
+ output: typeof UpdateWebhookEndpointResponseSchema;
958
+ };
959
+ /**
960
+ * DeleteWebhookEndpoint deletes an endpoint and its deliveries.
961
+ *
962
+ * @generated from rpc toshi.workspace.v1.WebhookService.DeleteWebhookEndpoint
963
+ */
964
+ deleteWebhookEndpoint: {
965
+ methodKind: "unary";
966
+ input: typeof DeleteWebhookEndpointRequestSchema;
967
+ output: typeof DeleteWebhookEndpointResponseSchema;
968
+ };
969
+ /**
970
+ * RotateWebhookEndpointSecret makes the endpoint a new signing secret and
971
+ * returns it. For the next 24 hours each try that starts after the
972
+ * rotation is signed with the new secret and the one it replaced, so a
973
+ * receiver can move to the new one in that window; after it, with the
974
+ * new one only. A try under way when the rotation is made is signed with
975
+ * the replaced secret alone. A rotation while the
976
+ * previous secret's window is still open fails with FAILED_PRECONDITION.
977
+ *
978
+ * @generated from rpc toshi.workspace.v1.WebhookService.RotateWebhookEndpointSecret
979
+ */
980
+ rotateWebhookEndpointSecret: {
981
+ methodKind: "unary";
982
+ input: typeof RotateWebhookEndpointSecretRequestSchema;
983
+ output: typeof RotateWebhookEndpointSecretResponseSchema;
984
+ };
985
+ /**
986
+ * ListWebhookDeliveries returns an endpoint's deliveries in event order,
987
+ * a page at a time.
988
+ *
989
+ * A page holds 50 deliveries when page_size is zero, and 500 at most.
990
+ *
991
+ * @generated from rpc toshi.workspace.v1.WebhookService.ListWebhookDeliveries
992
+ */
993
+ listWebhookDeliveries: {
994
+ methodKind: "unary";
995
+ input: typeof ListWebhookDeliveriesRequestSchema;
996
+ output: typeof ListWebhookDeliveriesResponseSchema;
997
+ };
998
+ /**
999
+ * ReplayWebhookEvents makes the endpoint owed again the events after
1000
+ * cursor that its filter keeps now, up to its own cursor, at most 500 per
1001
+ * call. That includes events delivered or given up before, events written
1002
+ * while it was disabled and events written before it was made. Each is
1003
+ * due now and tried on the retry schedule from its first try; an event
1004
+ * still pending at the endpoint is left as it is. A workload's events stay
1005
+ * one at a time at the endpoint: an older event sent again is not due
1006
+ * before the latest next try among the newer ones that have been tried
1007
+ * and are still pending, the end of that try under way or backoff, and
1008
+ * then goes before it; it does not wait for the newer ones to be
1009
+ * delivered. A disabled endpoint fails with FAILED_PRECONDITION.
1010
+ *
1011
+ * @generated from rpc toshi.workspace.v1.WebhookService.ReplayWebhookEvents
1012
+ */
1013
+ replayWebhookEvents: {
1014
+ methodKind: "unary";
1015
+ input: typeof ReplayWebhookEventsRequestSchema;
1016
+ output: typeof ReplayWebhookEventsResponseSchema;
1017
+ };
1018
+ }>;