@toshicloud/sdk 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +82 -40
  2. package/dist/client.d.ts +33 -2
  3. package/dist/client.js +28 -3
  4. package/dist/errors.d.ts +74 -22
  5. package/dist/errors.js +99 -27
  6. package/dist/gen/toshi/permission_pb.d.ts +207 -2
  7. package/dist/gen/toshi/permission_pb.js +54 -2
  8. package/dist/gen/toshi/workspace/v1/account_pb.d.ts +590 -0
  9. package/dist/gen/toshi/workspace/v1/account_pb.js +75 -0
  10. package/dist/gen/toshi/workspace/v1/artifacts_pb.d.ts +14 -8
  11. package/dist/gen/toshi/workspace/v1/artifacts_pb.js +9 -7
  12. package/dist/gen/toshi/workspace/v1/audit_events_pb.d.ts +191 -6
  13. package/dist/gen/toshi/workspace/v1/audit_events_pb.js +11 -1
  14. package/dist/gen/toshi/workspace/v1/channels_pb.d.ts +1194 -21
  15. package/dist/gen/toshi/workspace/v1/channels_pb.js +185 -39
  16. package/dist/gen/toshi/workspace/v1/connections_pb.d.ts +1481 -0
  17. package/dist/gen/toshi/workspace/v1/connections_pb.js +208 -0
  18. package/dist/gen/toshi/workspace/v1/discovery_pb.d.ts +291 -43
  19. package/dist/gen/toshi/workspace/v1/discovery_pb.js +79 -30
  20. package/dist/gen/toshi/workspace/v1/display_pb.d.ts +198 -15
  21. package/dist/gen/toshi/workspace/v1/display_pb.js +52 -2
  22. package/dist/gen/toshi/workspace/v1/domains_pb.d.ts +864 -0
  23. package/dist/gen/toshi/workspace/v1/domains_pb.js +152 -0
  24. package/dist/gen/toshi/workspace/v1/fillers_pb.d.ts +12 -4
  25. package/dist/gen/toshi/workspace/v1/fillers_pb.js +1 -1
  26. package/dist/gen/toshi/workspace/v1/grants_pb.d.ts +1297 -0
  27. package/dist/gen/toshi/workspace/v1/grants_pb.js +271 -0
  28. package/dist/gen/toshi/workspace/v1/hostjobs_pb.d.ts +315 -15
  29. package/dist/gen/toshi/workspace/v1/hostjobs_pb.js +10 -5
  30. package/dist/gen/toshi/workspace/v1/hosts_pb.d.ts +196 -7
  31. package/dist/gen/toshi/workspace/v1/hosts_pb.js +12 -7
  32. package/dist/gen/toshi/workspace/v1/images_pb.d.ts +1463 -0
  33. package/dist/gen/toshi/workspace/v1/images_pb.js +263 -0
  34. package/dist/gen/toshi/workspace/v1/products_pb.d.ts +99 -296
  35. package/dist/gen/toshi/workspace/v1/products_pb.js +7 -53
  36. package/dist/gen/toshi/workspace/v1/projects_pb.d.ts +1474 -99
  37. package/dist/gen/toshi/workspace/v1/projects_pb.js +150 -33
  38. package/dist/gen/toshi/workspace/v1/recordings_pb.d.ts +181 -14
  39. package/dist/gen/toshi/workspace/v1/recordings_pb.js +54 -14
  40. package/dist/gen/toshi/workspace/v1/roles_pb.d.ts +1994 -0
  41. package/dist/gen/toshi/workspace/v1/roles_pb.js +355 -0
  42. package/dist/gen/toshi/workspace/v1/secrets_pb.d.ts +314 -8
  43. package/dist/gen/toshi/workspace/v1/secrets_pb.js +42 -18
  44. package/dist/gen/toshi/workspace/v1/storage_providers_pb.d.ts +14 -0
  45. package/dist/gen/toshi/workspace/v1/storage_providers_pb.js +1 -1
  46. package/dist/gen/toshi/workspace/v1/tokens_pb.d.ts +434 -5
  47. package/dist/gen/toshi/workspace/v1/tokens_pb.js +65 -8
  48. package/dist/gen/toshi/workspace/v1/triggers_pb.d.ts +1099 -0
  49. package/dist/gen/toshi/workspace/v1/triggers_pb.js +185 -0
  50. package/dist/gen/toshi/workspace/v1/volumes_pb.d.ts +1052 -33
  51. package/dist/gen/toshi/workspace/v1/volumes_pb.js +169 -11
  52. package/dist/gen/toshi/workspace/v1/webhook_pb.d.ts +66 -8
  53. package/dist/gen/toshi/workspace/v1/webhook_pb.js +4 -4
  54. package/dist/gen/toshi/workspace/v1/workloads_pb.d.ts +2043 -54
  55. package/dist/gen/toshi/workspace/v1/workloads_pb.js +204 -54
  56. package/dist/gen/toshi/workspace/v1/workspace_pb.d.ts +6290 -937
  57. package/dist/gen/toshi/workspace/v1/workspace_pb.js +801 -88
  58. package/dist/gen/toshi/workspace/v1/workspace_service_pb.d.ts +2176 -630
  59. package/dist/gen/toshi/workspace/v1/workspace_service_pb.js +191 -74
  60. package/dist/index.d.ts +8 -1
  61. package/dist/index.js +8 -1
  62. package/dist/interceptors.d.ts +6 -2
  63. package/dist/interceptors.js +13 -8
  64. package/dist/retry.d.ts +18 -0
  65. package/dist/retry.js +225 -23
  66. package/dist/test/procedures.js +100 -5
  67. package/dist/version.d.ts +1 -1
  68. package/dist/version.js +1 -1
  69. package/dist/wait.d.ts +4 -0
  70. package/dist/wait.js +24 -1
  71. package/package.json +3 -2
@@ -0,0 +1,1099 @@
1
+ import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
2
+ import type { Duration, DurationJson, FieldMask, FieldMaskJson, Timestamp, TimestampJson } from "@bufbuild/protobuf/wkt";
3
+ import type { Binding, BindingJson, Command, CommandJson } from "./workspace_pb.js";
4
+ import type { Message } from "@bufbuild/protobuf";
5
+ /**
6
+ * Describes the file toshi/workspace/v1/triggers.proto.
7
+ */
8
+ export declare const file_toshi_workspace_v1_triggers: GenFile;
9
+ /**
10
+ * Trigger binds the events of one connection to an action.
11
+ *
12
+ * @generated from message toshi.workspace.v1.Trigger
13
+ */
14
+ export type Trigger = Message<"toshi.workspace.v1.Trigger"> & {
15
+ /**
16
+ * Set by the server; ignored in a request. The workloads it makes carry it
17
+ * as the label toshi.trigger.
18
+ *
19
+ * @generated from field: string id = 1;
20
+ */
21
+ id: string;
22
+ /**
23
+ * Set by the server from the request; ignored in the trigger a request
24
+ * carries.
25
+ *
26
+ * @generated from field: string project = 2;
27
+ */
28
+ project: string;
29
+ /**
30
+ * As project.
31
+ *
32
+ * @generated from field: string environment = 3;
33
+ */
34
+ environment: string;
35
+ /**
36
+ * A lower-case DNS label, unique among the project's triggers that are not
37
+ * deleted.
38
+ *
39
+ * @generated from field: string name = 4;
40
+ */
41
+ name: string;
42
+ /**
43
+ * The id of the connection whose events it matches.
44
+ *
45
+ * @generated from field: string source = 5;
46
+ */
47
+ source: string;
48
+ /**
49
+ * The event names it matches, exactly; at least one.
50
+ *
51
+ * @generated from field: repeated string events = 6;
52
+ */
53
+ events: string[];
54
+ /**
55
+ * Further limits on a pull request event; unset matches every one.
56
+ *
57
+ * @generated from field: toshi.workspace.v1.TriggerFilter filter = 7;
58
+ */
59
+ filter?: TriggerFilter | undefined;
60
+ /**
61
+ * @generated from field: toshi.workspace.v1.TriggerAction action = 8;
62
+ */
63
+ action: TriggerAction;
64
+ /**
65
+ * What CREATE makes, or the service DELIVER delivers to; unset for
66
+ * DELETE.
67
+ *
68
+ * @generated from field: toshi.workspace.v1.TriggerTarget target = 9;
69
+ */
70
+ target?: TriggerTarget | undefined;
71
+ /**
72
+ * A template over the event's data that names the workload an event is
73
+ * about: `{path}` is the value at that dot-separated path of the data, a
74
+ * string or an integer, and every other character is itself. The
75
+ * workloads it makes carry the result as the label toshi.trigger.key.
76
+ * Unset for pull request events, it is `{repository.full_name}#{number}`;
77
+ * unset for any other event, a create fails with INVALID_ARGUMENT.
78
+ * DELIVER takes none.
79
+ *
80
+ * @generated from field: string key = 10;
81
+ */
82
+ key: string;
83
+ /**
84
+ * How long a workload it made may go without a request before it is
85
+ * removed; unset is 2 hours. DELIVER takes none.
86
+ *
87
+ * @generated from field: google.protobuf.Duration idle_timeout = 11;
88
+ */
89
+ idleTimeout?: Duration | undefined;
90
+ /**
91
+ * What it does with a pull request whose head repository is not its base
92
+ * repository. DELIVER takes none.
93
+ *
94
+ * @generated from field: toshi.workspace.v1.TriggerForks forks = 12;
95
+ */
96
+ forks: TriggerForks;
97
+ /**
98
+ * Set by the server; ignored in a request.
99
+ *
100
+ * @generated from field: google.protobuf.Timestamp created_at = 13;
101
+ */
102
+ createdAt?: Timestamp | undefined;
103
+ /**
104
+ * Set by the server; ignored in a request.
105
+ *
106
+ * @generated from field: google.protobuf.Timestamp updated_at = 14;
107
+ */
108
+ updatedAt?: Timestamp | undefined;
109
+ };
110
+ /**
111
+ * Trigger binds the events of one connection to an action.
112
+ *
113
+ * @generated from message toshi.workspace.v1.Trigger
114
+ */
115
+ export type TriggerJson = {
116
+ /**
117
+ * Set by the server; ignored in a request. The workloads it makes carry it
118
+ * as the label toshi.trigger.
119
+ *
120
+ * @generated from field: string id = 1;
121
+ */
122
+ id?: string;
123
+ /**
124
+ * Set by the server from the request; ignored in the trigger a request
125
+ * carries.
126
+ *
127
+ * @generated from field: string project = 2;
128
+ */
129
+ project?: string;
130
+ /**
131
+ * As project.
132
+ *
133
+ * @generated from field: string environment = 3;
134
+ */
135
+ environment?: string;
136
+ /**
137
+ * A lower-case DNS label, unique among the project's triggers that are not
138
+ * deleted.
139
+ *
140
+ * @generated from field: string name = 4;
141
+ */
142
+ name?: string;
143
+ /**
144
+ * The id of the connection whose events it matches.
145
+ *
146
+ * @generated from field: string source = 5;
147
+ */
148
+ source?: string;
149
+ /**
150
+ * The event names it matches, exactly; at least one.
151
+ *
152
+ * @generated from field: repeated string events = 6;
153
+ */
154
+ events?: string[];
155
+ /**
156
+ * Further limits on a pull request event; unset matches every one.
157
+ *
158
+ * @generated from field: toshi.workspace.v1.TriggerFilter filter = 7;
159
+ */
160
+ filter?: TriggerFilterJson;
161
+ /**
162
+ * @generated from field: toshi.workspace.v1.TriggerAction action = 8;
163
+ */
164
+ action?: TriggerActionJson;
165
+ /**
166
+ * What CREATE makes, or the service DELIVER delivers to; unset for
167
+ * DELETE.
168
+ *
169
+ * @generated from field: toshi.workspace.v1.TriggerTarget target = 9;
170
+ */
171
+ target?: TriggerTargetJson;
172
+ /**
173
+ * A template over the event's data that names the workload an event is
174
+ * about: `{path}` is the value at that dot-separated path of the data, a
175
+ * string or an integer, and every other character is itself. The
176
+ * workloads it makes carry the result as the label toshi.trigger.key.
177
+ * Unset for pull request events, it is `{repository.full_name}#{number}`;
178
+ * unset for any other event, a create fails with INVALID_ARGUMENT.
179
+ * DELIVER takes none.
180
+ *
181
+ * @generated from field: string key = 10;
182
+ */
183
+ key?: string;
184
+ /**
185
+ * How long a workload it made may go without a request before it is
186
+ * removed; unset is 2 hours. DELIVER takes none.
187
+ *
188
+ * @generated from field: google.protobuf.Duration idle_timeout = 11;
189
+ */
190
+ idleTimeout?: DurationJson;
191
+ /**
192
+ * What it does with a pull request whose head repository is not its base
193
+ * repository. DELIVER takes none.
194
+ *
195
+ * @generated from field: toshi.workspace.v1.TriggerForks forks = 12;
196
+ */
197
+ forks?: TriggerForksJson;
198
+ /**
199
+ * Set by the server; ignored in a request.
200
+ *
201
+ * @generated from field: google.protobuf.Timestamp created_at = 13;
202
+ */
203
+ createdAt?: TimestampJson;
204
+ /**
205
+ * Set by the server; ignored in a request.
206
+ *
207
+ * @generated from field: google.protobuf.Timestamp updated_at = 14;
208
+ */
209
+ updatedAt?: TimestampJson;
210
+ };
211
+ /**
212
+ * Describes the message toshi.workspace.v1.Trigger.
213
+ * Use `create(TriggerSchema)` to create a new message.
214
+ */
215
+ export declare const TriggerSchema: GenMessage<Trigger, {
216
+ jsonType: TriggerJson;
217
+ }>;
218
+ /**
219
+ * TriggerFilter limits the pull request events a trigger matches. Each
220
+ * list, when set, must hold the event's value; an empty list holds every
221
+ * value. An event that is not a pull request's is not filtered: it
222
+ * matches whatever the filter holds.
223
+ *
224
+ * @generated from message toshi.workspace.v1.TriggerFilter
225
+ */
226
+ export type TriggerFilter = Message<"toshi.workspace.v1.TriggerFilter"> & {
227
+ /**
228
+ * Base repositories, as owner/name.
229
+ *
230
+ * @generated from field: repeated string repositories = 1;
231
+ */
232
+ repositories: string[];
233
+ /**
234
+ * Base branches, by name.
235
+ *
236
+ * @generated from field: repeated string base_branches = 2;
237
+ */
238
+ baseBranches: string[];
239
+ };
240
+ /**
241
+ * TriggerFilter limits the pull request events a trigger matches. Each
242
+ * list, when set, must hold the event's value; an empty list holds every
243
+ * value. An event that is not a pull request's is not filtered: it
244
+ * matches whatever the filter holds.
245
+ *
246
+ * @generated from message toshi.workspace.v1.TriggerFilter
247
+ */
248
+ export type TriggerFilterJson = {
249
+ /**
250
+ * Base repositories, as owner/name.
251
+ *
252
+ * @generated from field: repeated string repositories = 1;
253
+ */
254
+ repositories?: string[];
255
+ /**
256
+ * Base branches, by name.
257
+ *
258
+ * @generated from field: repeated string base_branches = 2;
259
+ */
260
+ baseBranches?: string[];
261
+ };
262
+ /**
263
+ * Describes the message toshi.workspace.v1.TriggerFilter.
264
+ * Use `create(TriggerFilterSchema)` to create a new message.
265
+ */
266
+ export declare const TriggerFilterSchema: GenMessage<TriggerFilter, {
267
+ jsonType: TriggerFilterJson;
268
+ }>;
269
+ /**
270
+ * TriggerTarget is the workload a trigger's CREATE makes, or the service
271
+ * its DELIVER delivers to.
272
+ *
273
+ * @generated from message toshi.workspace.v1.TriggerTarget
274
+ */
275
+ export type TriggerTarget = Message<"toshi.workspace.v1.TriggerTarget"> & {
276
+ /**
277
+ * @generated from oneof toshi.workspace.v1.TriggerTarget.target
278
+ */
279
+ target: {
280
+ /**
281
+ * @generated from field: toshi.workspace.v1.TriggerSandbox sandbox = 1;
282
+ */
283
+ value: TriggerSandbox;
284
+ case: "sandbox";
285
+ } | {
286
+ /**
287
+ * @generated from field: toshi.workspace.v1.TriggerPreview preview = 2;
288
+ */
289
+ value: TriggerPreview;
290
+ case: "preview";
291
+ } | {
292
+ /**
293
+ * @generated from field: toshi.workspace.v1.TriggerServiceChannel service = 3;
294
+ */
295
+ value: TriggerServiceChannel;
296
+ case: "service";
297
+ } | {
298
+ case: undefined;
299
+ value?: undefined;
300
+ };
301
+ };
302
+ /**
303
+ * TriggerTarget is the workload a trigger's CREATE makes, or the service
304
+ * its DELIVER delivers to.
305
+ *
306
+ * @generated from message toshi.workspace.v1.TriggerTarget
307
+ */
308
+ export type TriggerTargetJson = {
309
+ /**
310
+ * @generated from field: toshi.workspace.v1.TriggerSandbox sandbox = 1;
311
+ */
312
+ sandbox?: TriggerSandboxJson;
313
+ /**
314
+ * @generated from field: toshi.workspace.v1.TriggerPreview preview = 2;
315
+ */
316
+ preview?: TriggerPreviewJson;
317
+ /**
318
+ * @generated from field: toshi.workspace.v1.TriggerServiceChannel service = 3;
319
+ */
320
+ service?: TriggerServiceChannelJson;
321
+ };
322
+ /**
323
+ * Describes the message toshi.workspace.v1.TriggerTarget.
324
+ * Use `create(TriggerTargetSchema)` to create a new message.
325
+ */
326
+ export declare const TriggerTargetSchema: GenMessage<TriggerTarget, {
327
+ jsonType: TriggerTargetJson;
328
+ }>;
329
+ /**
330
+ * TriggerServiceChannel is the event channel a trigger's DELIVER puts its
331
+ * events on.
332
+ *
333
+ * @generated from message toshi.workspace.v1.TriggerServiceChannel
334
+ */
335
+ export type TriggerServiceChannel = Message<"toshi.workspace.v1.TriggerServiceChannel"> & {
336
+ /**
337
+ * A service of the trigger's project and environment, by name. Required.
338
+ *
339
+ * @generated from field: string service = 1;
340
+ */
341
+ service: string;
342
+ /**
343
+ * The name of one of the service's event channels. Required.
344
+ *
345
+ * @generated from field: string channel = 2;
346
+ */
347
+ channel: string;
348
+ };
349
+ /**
350
+ * TriggerServiceChannel is the event channel a trigger's DELIVER puts its
351
+ * events on.
352
+ *
353
+ * @generated from message toshi.workspace.v1.TriggerServiceChannel
354
+ */
355
+ export type TriggerServiceChannelJson = {
356
+ /**
357
+ * A service of the trigger's project and environment, by name. Required.
358
+ *
359
+ * @generated from field: string service = 1;
360
+ */
361
+ service?: string;
362
+ /**
363
+ * The name of one of the service's event channels. Required.
364
+ *
365
+ * @generated from field: string channel = 2;
366
+ */
367
+ channel?: string;
368
+ };
369
+ /**
370
+ * Describes the message toshi.workspace.v1.TriggerServiceChannel.
371
+ * Use `create(TriggerServiceChannelSchema)` to create a new message.
372
+ */
373
+ export declare const TriggerServiceChannelSchema: GenMessage<TriggerServiceChannel, {
374
+ jsonType: TriggerServiceChannelJson;
375
+ }>;
376
+ /**
377
+ * TriggerPreview is a sandbox per pull request that the repository
378
+ * describes in the file `.toshi/preview.toml`. The file is read from the
379
+ * tip of the pull request's base branch for every event, never from its
380
+ * head, so a pull request cannot change its own size, time limit or
381
+ * bindings; a change to the file applies once it is merged. The sandbox
382
+ * clones the pull request's head commit before its setup runs. A missing
383
+ * or invalid file makes no sandbox: the trigger records the event as
384
+ * failed with the reason `no_template` or `invalid_template`. A trigger
385
+ * with a preview target takes only the pull request events of a GITHUB
386
+ * connection.
387
+ *
388
+ * @generated from message toshi.workspace.v1.TriggerPreview
389
+ */
390
+ export type TriggerPreview = Message<"toshi.workspace.v1.TriggerPreview"> & {};
391
+ /**
392
+ * TriggerPreview is a sandbox per pull request that the repository
393
+ * describes in the file `.toshi/preview.toml`. The file is read from the
394
+ * tip of the pull request's base branch for every event, never from its
395
+ * head, so a pull request cannot change its own size, time limit or
396
+ * bindings; a change to the file applies once it is merged. The sandbox
397
+ * clones the pull request's head commit before its setup runs. A missing
398
+ * or invalid file makes no sandbox: the trigger records the event as
399
+ * failed with the reason `no_template` or `invalid_template`. A trigger
400
+ * with a preview target takes only the pull request events of a GITHUB
401
+ * connection.
402
+ *
403
+ * @generated from message toshi.workspace.v1.TriggerPreview
404
+ */
405
+ export type TriggerPreviewJson = {};
406
+ /**
407
+ * Describes the message toshi.workspace.v1.TriggerPreview.
408
+ * Use `create(TriggerPreviewSchema)` to create a new message.
409
+ */
410
+ export declare const TriggerPreviewSchema: GenMessage<TriggerPreview, {
411
+ jsonType: TriggerPreviewJson;
412
+ }>;
413
+ /**
414
+ * TriggerSandbox is a sandbox a trigger makes.
415
+ *
416
+ * @generated from message toshi.workspace.v1.TriggerSandbox
417
+ */
418
+ export type TriggerSandbox = Message<"toshi.workspace.v1.TriggerSandbox"> & {
419
+ /**
420
+ * The runner size of its VM, which picks its image, for example
421
+ * "toshi-linux-2x". Required.
422
+ *
423
+ * @generated from field: string size = 1;
424
+ */
425
+ size: string;
426
+ /**
427
+ * How long it may run, in whole minutes; unset is 24 hours, or the plan's
428
+ * sandbox cap when shorter. It cannot be longer than the cap: a create or
429
+ * update past it is refused.
430
+ *
431
+ * @generated from field: google.protobuf.Duration max_duration = 2;
432
+ */
433
+ maxDuration?: Duration | undefined;
434
+ /**
435
+ * What in its workspace it uses, as SandboxSpec's bindings.
436
+ *
437
+ * @generated from field: repeated toshi.workspace.v1.Binding bindings = 3;
438
+ */
439
+ bindings: Binding[];
440
+ /**
441
+ * Runs first, to exit 0.
442
+ *
443
+ * @generated from field: toshi.workspace.v1.Command setup = 4;
444
+ */
445
+ setup?: Command | undefined;
446
+ /**
447
+ * Runs after setup and is kept running for the sandbox's life.
448
+ *
449
+ * @generated from field: toshi.workspace.v1.Command process = 5;
450
+ */
451
+ process?: Command | undefined;
452
+ /**
453
+ * The http channel whose link the trigger reports. Empty reports the
454
+ * first preview the sandbox serves, and a sandbox that serves none is
455
+ * ready with no link.
456
+ *
457
+ * @generated from field: string channel = 6;
458
+ */
459
+ channel: string;
460
+ /**
461
+ * The container image the sandbox runs, as a sandbox's spec names it
462
+ * (`registry/repository:tag` or `@sha256:` digest); a tag is resolved when
463
+ * each sandbox is made. Empty runs none.
464
+ *
465
+ * @generated from field: string container_image = 7;
466
+ */
467
+ containerImage: string;
468
+ };
469
+ /**
470
+ * TriggerSandbox is a sandbox a trigger makes.
471
+ *
472
+ * @generated from message toshi.workspace.v1.TriggerSandbox
473
+ */
474
+ export type TriggerSandboxJson = {
475
+ /**
476
+ * The runner size of its VM, which picks its image, for example
477
+ * "toshi-linux-2x". Required.
478
+ *
479
+ * @generated from field: string size = 1;
480
+ */
481
+ size?: string;
482
+ /**
483
+ * How long it may run, in whole minutes; unset is 24 hours, or the plan's
484
+ * sandbox cap when shorter. It cannot be longer than the cap: a create or
485
+ * update past it is refused.
486
+ *
487
+ * @generated from field: google.protobuf.Duration max_duration = 2;
488
+ */
489
+ maxDuration?: DurationJson;
490
+ /**
491
+ * What in its workspace it uses, as SandboxSpec's bindings.
492
+ *
493
+ * @generated from field: repeated toshi.workspace.v1.Binding bindings = 3;
494
+ */
495
+ bindings?: BindingJson[];
496
+ /**
497
+ * Runs first, to exit 0.
498
+ *
499
+ * @generated from field: toshi.workspace.v1.Command setup = 4;
500
+ */
501
+ setup?: CommandJson;
502
+ /**
503
+ * Runs after setup and is kept running for the sandbox's life.
504
+ *
505
+ * @generated from field: toshi.workspace.v1.Command process = 5;
506
+ */
507
+ process?: CommandJson;
508
+ /**
509
+ * The http channel whose link the trigger reports. Empty reports the
510
+ * first preview the sandbox serves, and a sandbox that serves none is
511
+ * ready with no link.
512
+ *
513
+ * @generated from field: string channel = 6;
514
+ */
515
+ channel?: string;
516
+ /**
517
+ * The container image the sandbox runs, as a sandbox's spec names it
518
+ * (`registry/repository:tag` or `@sha256:` digest); a tag is resolved when
519
+ * each sandbox is made. Empty runs none.
520
+ *
521
+ * @generated from field: string container_image = 7;
522
+ */
523
+ containerImage?: string;
524
+ };
525
+ /**
526
+ * Describes the message toshi.workspace.v1.TriggerSandbox.
527
+ * Use `create(TriggerSandboxSchema)` to create a new message.
528
+ */
529
+ export declare const TriggerSandboxSchema: GenMessage<TriggerSandbox, {
530
+ jsonType: TriggerSandboxJson;
531
+ }>;
532
+ /**
533
+ * @generated from message toshi.workspace.v1.CreateTriggerRequest
534
+ */
535
+ export type CreateTriggerRequest = Message<"toshi.workspace.v1.CreateTriggerRequest"> & {
536
+ /**
537
+ * @generated from field: string project = 1;
538
+ */
539
+ project: string;
540
+ /**
541
+ * @generated from field: string environment = 2;
542
+ */
543
+ environment: string;
544
+ /**
545
+ * The trigger; its id, project, environment and times are ignored.
546
+ *
547
+ * @generated from field: toshi.workspace.v1.Trigger trigger = 3;
548
+ */
549
+ trigger?: Trigger | undefined;
550
+ /**
551
+ * @generated from field: string request_key = 4;
552
+ */
553
+ requestKey: string;
554
+ };
555
+ /**
556
+ * @generated from message toshi.workspace.v1.CreateTriggerRequest
557
+ */
558
+ export type CreateTriggerRequestJson = {
559
+ /**
560
+ * @generated from field: string project = 1;
561
+ */
562
+ project?: string;
563
+ /**
564
+ * @generated from field: string environment = 2;
565
+ */
566
+ environment?: string;
567
+ /**
568
+ * The trigger; its id, project, environment and times are ignored.
569
+ *
570
+ * @generated from field: toshi.workspace.v1.Trigger trigger = 3;
571
+ */
572
+ trigger?: TriggerJson;
573
+ /**
574
+ * @generated from field: string request_key = 4;
575
+ */
576
+ requestKey?: string;
577
+ };
578
+ /**
579
+ * Describes the message toshi.workspace.v1.CreateTriggerRequest.
580
+ * Use `create(CreateTriggerRequestSchema)` to create a new message.
581
+ */
582
+ export declare const CreateTriggerRequestSchema: GenMessage<CreateTriggerRequest, {
583
+ jsonType: CreateTriggerRequestJson;
584
+ }>;
585
+ /**
586
+ * @generated from message toshi.workspace.v1.CreateTriggerResponse
587
+ */
588
+ export type CreateTriggerResponse = Message<"toshi.workspace.v1.CreateTriggerResponse"> & {
589
+ /**
590
+ * @generated from field: toshi.workspace.v1.Trigger trigger = 1;
591
+ */
592
+ trigger?: Trigger | undefined;
593
+ };
594
+ /**
595
+ * @generated from message toshi.workspace.v1.CreateTriggerResponse
596
+ */
597
+ export type CreateTriggerResponseJson = {
598
+ /**
599
+ * @generated from field: toshi.workspace.v1.Trigger trigger = 1;
600
+ */
601
+ trigger?: TriggerJson;
602
+ };
603
+ /**
604
+ * Describes the message toshi.workspace.v1.CreateTriggerResponse.
605
+ * Use `create(CreateTriggerResponseSchema)` to create a new message.
606
+ */
607
+ export declare const CreateTriggerResponseSchema: GenMessage<CreateTriggerResponse, {
608
+ jsonType: CreateTriggerResponseJson;
609
+ }>;
610
+ /**
611
+ * @generated from message toshi.workspace.v1.GetTriggerRequest
612
+ */
613
+ export type GetTriggerRequest = Message<"toshi.workspace.v1.GetTriggerRequest"> & {
614
+ /**
615
+ * @generated from field: string project = 1;
616
+ */
617
+ project: string;
618
+ /**
619
+ * @generated from field: string environment = 2;
620
+ */
621
+ environment: string;
622
+ /**
623
+ * @generated from field: string id = 3;
624
+ */
625
+ id: string;
626
+ };
627
+ /**
628
+ * @generated from message toshi.workspace.v1.GetTriggerRequest
629
+ */
630
+ export type GetTriggerRequestJson = {
631
+ /**
632
+ * @generated from field: string project = 1;
633
+ */
634
+ project?: string;
635
+ /**
636
+ * @generated from field: string environment = 2;
637
+ */
638
+ environment?: string;
639
+ /**
640
+ * @generated from field: string id = 3;
641
+ */
642
+ id?: string;
643
+ };
644
+ /**
645
+ * Describes the message toshi.workspace.v1.GetTriggerRequest.
646
+ * Use `create(GetTriggerRequestSchema)` to create a new message.
647
+ */
648
+ export declare const GetTriggerRequestSchema: GenMessage<GetTriggerRequest, {
649
+ jsonType: GetTriggerRequestJson;
650
+ }>;
651
+ /**
652
+ * @generated from message toshi.workspace.v1.GetTriggerResponse
653
+ */
654
+ export type GetTriggerResponse = Message<"toshi.workspace.v1.GetTriggerResponse"> & {
655
+ /**
656
+ * @generated from field: toshi.workspace.v1.Trigger trigger = 1;
657
+ */
658
+ trigger?: Trigger | undefined;
659
+ };
660
+ /**
661
+ * @generated from message toshi.workspace.v1.GetTriggerResponse
662
+ */
663
+ export type GetTriggerResponseJson = {
664
+ /**
665
+ * @generated from field: toshi.workspace.v1.Trigger trigger = 1;
666
+ */
667
+ trigger?: TriggerJson;
668
+ };
669
+ /**
670
+ * Describes the message toshi.workspace.v1.GetTriggerResponse.
671
+ * Use `create(GetTriggerResponseSchema)` to create a new message.
672
+ */
673
+ export declare const GetTriggerResponseSchema: GenMessage<GetTriggerResponse, {
674
+ jsonType: GetTriggerResponseJson;
675
+ }>;
676
+ /**
677
+ * @generated from message toshi.workspace.v1.ListTriggersRequest
678
+ */
679
+ export type ListTriggersRequest = Message<"toshi.workspace.v1.ListTriggersRequest"> & {
680
+ /**
681
+ * @generated from field: string project = 1;
682
+ */
683
+ project: string;
684
+ /**
685
+ * @generated from field: string environment = 2;
686
+ */
687
+ environment: string;
688
+ /**
689
+ * The most triggers in one page; zero lets the server choose.
690
+ *
691
+ * @generated from field: int32 page_size = 3;
692
+ */
693
+ pageSize: number;
694
+ /**
695
+ * From an earlier response's next_page_token; empty for the first page.
696
+ *
697
+ * @generated from field: string page_token = 4;
698
+ */
699
+ pageToken: string;
700
+ };
701
+ /**
702
+ * @generated from message toshi.workspace.v1.ListTriggersRequest
703
+ */
704
+ export type ListTriggersRequestJson = {
705
+ /**
706
+ * @generated from field: string project = 1;
707
+ */
708
+ project?: string;
709
+ /**
710
+ * @generated from field: string environment = 2;
711
+ */
712
+ environment?: string;
713
+ /**
714
+ * The most triggers in one page; zero lets the server choose.
715
+ *
716
+ * @generated from field: int32 page_size = 3;
717
+ */
718
+ pageSize?: number;
719
+ /**
720
+ * From an earlier response's next_page_token; empty for the first page.
721
+ *
722
+ * @generated from field: string page_token = 4;
723
+ */
724
+ pageToken?: string;
725
+ };
726
+ /**
727
+ * Describes the message toshi.workspace.v1.ListTriggersRequest.
728
+ * Use `create(ListTriggersRequestSchema)` to create a new message.
729
+ */
730
+ export declare const ListTriggersRequestSchema: GenMessage<ListTriggersRequest, {
731
+ jsonType: ListTriggersRequestJson;
732
+ }>;
733
+ /**
734
+ * @generated from message toshi.workspace.v1.ListTriggersResponse
735
+ */
736
+ export type ListTriggersResponse = Message<"toshi.workspace.v1.ListTriggersResponse"> & {
737
+ /**
738
+ * @generated from field: repeated toshi.workspace.v1.Trigger triggers = 1;
739
+ */
740
+ triggers: Trigger[];
741
+ /**
742
+ * Empty on the last page.
743
+ *
744
+ * @generated from field: string next_page_token = 2;
745
+ */
746
+ nextPageToken: string;
747
+ };
748
+ /**
749
+ * @generated from message toshi.workspace.v1.ListTriggersResponse
750
+ */
751
+ export type ListTriggersResponseJson = {
752
+ /**
753
+ * @generated from field: repeated toshi.workspace.v1.Trigger triggers = 1;
754
+ */
755
+ triggers?: TriggerJson[];
756
+ /**
757
+ * Empty on the last page.
758
+ *
759
+ * @generated from field: string next_page_token = 2;
760
+ */
761
+ nextPageToken?: string;
762
+ };
763
+ /**
764
+ * Describes the message toshi.workspace.v1.ListTriggersResponse.
765
+ * Use `create(ListTriggersResponseSchema)` to create a new message.
766
+ */
767
+ export declare const ListTriggersResponseSchema: GenMessage<ListTriggersResponse, {
768
+ jsonType: ListTriggersResponseJson;
769
+ }>;
770
+ /**
771
+ * @generated from message toshi.workspace.v1.UpdateTriggerRequest
772
+ */
773
+ export type UpdateTriggerRequest = Message<"toshi.workspace.v1.UpdateTriggerRequest"> & {
774
+ /**
775
+ * @generated from field: string project = 1;
776
+ */
777
+ project: string;
778
+ /**
779
+ * @generated from field: string environment = 2;
780
+ */
781
+ environment: string;
782
+ /**
783
+ * @generated from field: string id = 3;
784
+ */
785
+ id: string;
786
+ /**
787
+ * Carries the new values of the fields update_mask names.
788
+ *
789
+ * @generated from field: toshi.workspace.v1.Trigger trigger = 4;
790
+ */
791
+ trigger?: Trigger | undefined;
792
+ /**
793
+ * @generated from field: google.protobuf.FieldMask update_mask = 5;
794
+ */
795
+ updateMask?: FieldMask | undefined;
796
+ /**
797
+ * @generated from field: string request_key = 6;
798
+ */
799
+ requestKey: string;
800
+ };
801
+ /**
802
+ * @generated from message toshi.workspace.v1.UpdateTriggerRequest
803
+ */
804
+ export type UpdateTriggerRequestJson = {
805
+ /**
806
+ * @generated from field: string project = 1;
807
+ */
808
+ project?: string;
809
+ /**
810
+ * @generated from field: string environment = 2;
811
+ */
812
+ environment?: string;
813
+ /**
814
+ * @generated from field: string id = 3;
815
+ */
816
+ id?: string;
817
+ /**
818
+ * Carries the new values of the fields update_mask names.
819
+ *
820
+ * @generated from field: toshi.workspace.v1.Trigger trigger = 4;
821
+ */
822
+ trigger?: TriggerJson;
823
+ /**
824
+ * @generated from field: google.protobuf.FieldMask update_mask = 5;
825
+ */
826
+ updateMask?: FieldMaskJson;
827
+ /**
828
+ * @generated from field: string request_key = 6;
829
+ */
830
+ requestKey?: string;
831
+ };
832
+ /**
833
+ * Describes the message toshi.workspace.v1.UpdateTriggerRequest.
834
+ * Use `create(UpdateTriggerRequestSchema)` to create a new message.
835
+ */
836
+ export declare const UpdateTriggerRequestSchema: GenMessage<UpdateTriggerRequest, {
837
+ jsonType: UpdateTriggerRequestJson;
838
+ }>;
839
+ /**
840
+ * @generated from message toshi.workspace.v1.UpdateTriggerResponse
841
+ */
842
+ export type UpdateTriggerResponse = Message<"toshi.workspace.v1.UpdateTriggerResponse"> & {
843
+ /**
844
+ * @generated from field: toshi.workspace.v1.Trigger trigger = 1;
845
+ */
846
+ trigger?: Trigger | undefined;
847
+ };
848
+ /**
849
+ * @generated from message toshi.workspace.v1.UpdateTriggerResponse
850
+ */
851
+ export type UpdateTriggerResponseJson = {
852
+ /**
853
+ * @generated from field: toshi.workspace.v1.Trigger trigger = 1;
854
+ */
855
+ trigger?: TriggerJson;
856
+ };
857
+ /**
858
+ * Describes the message toshi.workspace.v1.UpdateTriggerResponse.
859
+ * Use `create(UpdateTriggerResponseSchema)` to create a new message.
860
+ */
861
+ export declare const UpdateTriggerResponseSchema: GenMessage<UpdateTriggerResponse, {
862
+ jsonType: UpdateTriggerResponseJson;
863
+ }>;
864
+ /**
865
+ * @generated from message toshi.workspace.v1.DeleteTriggerRequest
866
+ */
867
+ export type DeleteTriggerRequest = Message<"toshi.workspace.v1.DeleteTriggerRequest"> & {
868
+ /**
869
+ * @generated from field: string project = 1;
870
+ */
871
+ project: string;
872
+ /**
873
+ * @generated from field: string environment = 2;
874
+ */
875
+ environment: string;
876
+ /**
877
+ * @generated from field: string id = 3;
878
+ */
879
+ id: string;
880
+ /**
881
+ * @generated from field: string request_key = 4;
882
+ */
883
+ requestKey: string;
884
+ };
885
+ /**
886
+ * @generated from message toshi.workspace.v1.DeleteTriggerRequest
887
+ */
888
+ export type DeleteTriggerRequestJson = {
889
+ /**
890
+ * @generated from field: string project = 1;
891
+ */
892
+ project?: string;
893
+ /**
894
+ * @generated from field: string environment = 2;
895
+ */
896
+ environment?: string;
897
+ /**
898
+ * @generated from field: string id = 3;
899
+ */
900
+ id?: string;
901
+ /**
902
+ * @generated from field: string request_key = 4;
903
+ */
904
+ requestKey?: string;
905
+ };
906
+ /**
907
+ * Describes the message toshi.workspace.v1.DeleteTriggerRequest.
908
+ * Use `create(DeleteTriggerRequestSchema)` to create a new message.
909
+ */
910
+ export declare const DeleteTriggerRequestSchema: GenMessage<DeleteTriggerRequest, {
911
+ jsonType: DeleteTriggerRequestJson;
912
+ }>;
913
+ /**
914
+ * @generated from message toshi.workspace.v1.DeleteTriggerResponse
915
+ */
916
+ export type DeleteTriggerResponse = Message<"toshi.workspace.v1.DeleteTriggerResponse"> & {};
917
+ /**
918
+ * @generated from message toshi.workspace.v1.DeleteTriggerResponse
919
+ */
920
+ export type DeleteTriggerResponseJson = {};
921
+ /**
922
+ * Describes the message toshi.workspace.v1.DeleteTriggerResponse.
923
+ * Use `create(DeleteTriggerResponseSchema)` to create a new message.
924
+ */
925
+ export declare const DeleteTriggerResponseSchema: GenMessage<DeleteTriggerResponse, {
926
+ jsonType: DeleteTriggerResponseJson;
927
+ }>;
928
+ /**
929
+ * TriggerAction is what a trigger does with an event it matches.
930
+ *
931
+ * @generated from enum toshi.workspace.v1.TriggerAction
932
+ */
933
+ export declare enum TriggerAction {
934
+ /**
935
+ * @generated from enum value: TRIGGER_ACTION_UNSPECIFIED = 0;
936
+ */
937
+ UNSPECIFIED = 0,
938
+ /**
939
+ * Makes the target workload for the event's key, replacing the one the
940
+ * key had: the new one first, and the older ones are deleted once it runs
941
+ * or has failed. An event older than the newest one the key has seen
942
+ * changes nothing.
943
+ *
944
+ * @generated from enum value: TRIGGER_ACTION_CREATE = 1;
945
+ */
946
+ CREATE = 1,
947
+ /**
948
+ * Deletes the workloads the environment's CREATE triggers of the same
949
+ * source made for the event's key.
950
+ *
951
+ * @generated from enum value: TRIGGER_ACTION_DELETE = 2;
952
+ */
953
+ DELETE = 2,
954
+ /**
955
+ * Puts the event on the target service's event channel, which wakes the
956
+ * service if it sleeps and posts the event to it. The message's source
957
+ * is the trigger, and the event's id makes its request key, so an event
958
+ * is put on the channel once.
959
+ *
960
+ * @generated from enum value: TRIGGER_ACTION_DELIVER = 3;
961
+ */
962
+ DELIVER = 3
963
+ }
964
+ /**
965
+ * TriggerAction is what a trigger does with an event it matches.
966
+ *
967
+ * @generated from enum toshi.workspace.v1.TriggerAction
968
+ */
969
+ export type TriggerActionJson = "TRIGGER_ACTION_UNSPECIFIED" | "TRIGGER_ACTION_CREATE" | "TRIGGER_ACTION_DELETE" | "TRIGGER_ACTION_DELIVER";
970
+ /**
971
+ * Describes the enum toshi.workspace.v1.TriggerAction.
972
+ */
973
+ export declare const TriggerActionSchema: GenEnum<TriggerAction, TriggerActionJson>;
974
+ /**
975
+ * TriggerForks is what a trigger does with a pull request from a fork.
976
+ *
977
+ * @generated from enum toshi.workspace.v1.TriggerForks
978
+ */
979
+ export declare enum TriggerForks {
980
+ /**
981
+ * As LABEL.
982
+ *
983
+ * @generated from enum value: TRIGGER_FORKS_UNSPECIFIED = 0;
984
+ */
985
+ UNSPECIFIED = 0,
986
+ /**
987
+ * Nothing runs until a person with write access to the base repository
988
+ * adds the label toshi:preview to the pull request. What runs then has no
989
+ * bindings, and a new commit to the pull request removes it.
990
+ *
991
+ * @generated from enum value: TRIGGER_FORKS_LABEL = 1;
992
+ */
993
+ LABEL = 1,
994
+ /**
995
+ * Nothing runs for a fork.
996
+ *
997
+ * @generated from enum value: TRIGGER_FORKS_NEVER = 2;
998
+ */
999
+ NEVER = 2
1000
+ }
1001
+ /**
1002
+ * TriggerForks is what a trigger does with a pull request from a fork.
1003
+ *
1004
+ * @generated from enum toshi.workspace.v1.TriggerForks
1005
+ */
1006
+ export type TriggerForksJson = "TRIGGER_FORKS_UNSPECIFIED" | "TRIGGER_FORKS_LABEL" | "TRIGGER_FORKS_NEVER";
1007
+ /**
1008
+ * Describes the enum toshi.workspace.v1.TriggerForks.
1009
+ */
1010
+ export declare const TriggerForksSchema: GenEnum<TriggerForks, TriggerForksJson>;
1011
+ /**
1012
+ * TriggerService keeps a project's triggers: each binds the events one
1013
+ * connection brings to an action on the project's workloads. A trigger
1014
+ * matches an event on the events it names, the exact names, and on its
1015
+ * filter; nothing else of the event is read, and no code of the
1016
+ * workspace's runs in the control plane.
1017
+ *
1018
+ * A trigger belongs to a project and an environment, the environment its
1019
+ * workloads run in, and every call names both, as WorkloadService's do.
1020
+ * A trigger is owed the events written after it is created, from then
1021
+ * on; it never acts on an event written before it.
1022
+ *
1023
+ * CreateTrigger, UpdateTrigger and DeleteTrigger take a request_key, with
1024
+ * WorkloadService's rule: a retry with the same key and the same payload
1025
+ * returns what the first call returned and changes nothing; the same key
1026
+ * with a different payload fails with FAILED_PRECONDITION; an empty key
1027
+ * means no retry protection.
1028
+ *
1029
+ * @generated from service toshi.workspace.v1.TriggerService
1030
+ */
1031
+ export declare const TriggerService: GenService<{
1032
+ /**
1033
+ * CreateTrigger makes a trigger. A source that is not a connection of
1034
+ * the workspace fails with NOT_FOUND, and so does a WEBHOOK connection of
1035
+ * another project or environment. No events, an event name with the
1036
+ * reserved prefix `trigger.`, no target for the action CREATE, a key
1037
+ * that is not a template of the event data, a production environment for
1038
+ * pull request events, or a preview target whose source is not a GITHUB
1039
+ * connection or whose events are not all pull request events fails with
1040
+ * INVALID_ARGUMENT, and a name another
1041
+ * trigger of the project has with ALREADY_EXISTS.
1042
+ *
1043
+ * @generated from rpc toshi.workspace.v1.TriggerService.CreateTrigger
1044
+ */
1045
+ createTrigger: {
1046
+ methodKind: "unary";
1047
+ input: typeof CreateTriggerRequestSchema;
1048
+ output: typeof CreateTriggerResponseSchema;
1049
+ };
1050
+ /**
1051
+ * GetTrigger returns one trigger. One the project does not have, or one
1052
+ * deleted, is NOT_FOUND.
1053
+ *
1054
+ * @generated from rpc toshi.workspace.v1.TriggerService.GetTrigger
1055
+ */
1056
+ getTrigger: {
1057
+ methodKind: "unary";
1058
+ input: typeof GetTriggerRequestSchema;
1059
+ output: typeof GetTriggerResponseSchema;
1060
+ };
1061
+ /**
1062
+ * ListTriggers returns the triggers of the project's environment, in name
1063
+ * order.
1064
+ *
1065
+ * A page holds 100 triggers when page_size is zero, and 1000 at most.
1066
+ *
1067
+ * @generated from rpc toshi.workspace.v1.TriggerService.ListTriggers
1068
+ */
1069
+ listTriggers: {
1070
+ methodKind: "unary";
1071
+ input: typeof ListTriggersRequestSchema;
1072
+ output: typeof ListTriggersResponseSchema;
1073
+ };
1074
+ /**
1075
+ * UpdateTrigger sets the fields update_mask names: name, events, filter,
1076
+ * action, target, key, idle_timeout and forks. A trigger's source, project
1077
+ * and environment are fixed; a mask that names one fails with
1078
+ * INVALID_ARGUMENT, and the new values are checked as CreateTrigger's are.
1079
+ * The change applies to the events written after it.
1080
+ *
1081
+ * @generated from rpc toshi.workspace.v1.TriggerService.UpdateTrigger
1082
+ */
1083
+ updateTrigger: {
1084
+ methodKind: "unary";
1085
+ input: typeof UpdateTriggerRequestSchema;
1086
+ output: typeof UpdateTriggerResponseSchema;
1087
+ };
1088
+ /**
1089
+ * DeleteTrigger deletes a trigger: it acts on no further event, and the
1090
+ * evaluator's next pass removes the workloads it made.
1091
+ *
1092
+ * @generated from rpc toshi.workspace.v1.TriggerService.DeleteTrigger
1093
+ */
1094
+ deleteTrigger: {
1095
+ methodKind: "unary";
1096
+ input: typeof DeleteTriggerRequestSchema;
1097
+ output: typeof DeleteTriggerResponseSchema;
1098
+ };
1099
+ }>;