@toshicloud/sdk 0.4.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 +102 -19
  2. package/dist/client.d.ts +40 -4
  3. package/dist/client.js +35 -4
  4. package/dist/errors.d.ts +99 -0
  5. package/dist/errors.js +208 -0
  6. package/dist/gen/toshi/permission_pb.d.ts +244 -0
  7. package/dist/gen/toshi/permission_pb.js +94 -0
  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 +10 -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 +12 -1
  14. package/dist/gen/toshi/workspace/v1/channels_pb.d.ts +1194 -21
  15. package/dist/gen/toshi/workspace/v1/channels_pb.js +186 -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 +924 -0
  19. package/dist/gen/toshi/workspace/v1/discovery_pb.js +231 -0
  20. package/dist/gen/toshi/workspace/v1/display_pb.d.ts +198 -15
  21. package/dist/gen/toshi/workspace/v1/display_pb.js +53 -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 +2 -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 +11 -5
  30. package/dist/gen/toshi/workspace/v1/hosts_pb.d.ts +196 -7
  31. package/dist/gen/toshi/workspace/v1/hosts_pb.js +13 -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 +506 -0
  35. package/dist/gen/toshi/workspace/v1/products_pb.js +60 -0
  36. package/dist/gen/toshi/workspace/v1/projects_pb.d.ts +1474 -99
  37. package/dist/gen/toshi/workspace/v1/projects_pb.js +151 -33
  38. package/dist/gen/toshi/workspace/v1/recordings_pb.d.ts +181 -14
  39. package/dist/gen/toshi/workspace/v1/recordings_pb.js +55 -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 +43 -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 +2 -1
  46. package/dist/gen/toshi/workspace/v1/tokens_pb.d.ts +434 -5
  47. package/dist/gen/toshi/workspace/v1/tokens_pb.js +66 -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 +170 -11
  52. package/dist/gen/toshi/workspace/v1/webhook_pb.d.ts +66 -8
  53. package/dist/gen/toshi/workspace/v1/webhook_pb.js +5 -4
  54. package/dist/gen/toshi/workspace/v1/workloads_pb.d.ts +2043 -54
  55. package/dist/gen/toshi/workspace/v1/workloads_pb.js +205 -54
  56. package/dist/gen/toshi/workspace/v1/workspace_pb.d.ts +6292 -939
  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 +192 -74
  60. package/dist/index.d.ts +10 -1
  61. package/dist/index.js +10 -1
  62. package/dist/interceptors.d.ts +11 -1
  63. package/dist/interceptors.js +38 -4
  64. package/dist/retry.d.ts +18 -0
  65. package/dist/retry.js +228 -22
  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,924 @@
1
+ import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
2
+ import type { Message } from "@bufbuild/protobuf";
3
+ /**
4
+ * Describes the file toshi/workspace/v1/discovery.proto.
5
+ */
6
+ export declare const file_toshi_workspace_v1_discovery: GenFile;
7
+ /**
8
+ * @generated from message toshi.workspace.v1.DiscoverRequest
9
+ */
10
+ export type DiscoverRequest = Message<"toshi.workspace.v1.DiscoverRequest"> & {
11
+ /**
12
+ * project names one of the workspace's projects: the permissions are the
13
+ * caller's in it. Empty is the whole workspace, or for a token limited to
14
+ * a project or environment, that part of it. A token limited to a project
15
+ * names no other.
16
+ *
17
+ * @generated from field: string project = 1;
18
+ */
19
+ project: string;
20
+ /**
21
+ * environment names an environment of project, and needs project.
22
+ *
23
+ * @generated from field: string environment = 2;
24
+ */
25
+ environment: string;
26
+ };
27
+ /**
28
+ * @generated from message toshi.workspace.v1.DiscoverRequest
29
+ */
30
+ export type DiscoverRequestJson = {
31
+ /**
32
+ * project names one of the workspace's projects: the permissions are the
33
+ * caller's in it. Empty is the whole workspace, or for a token limited to
34
+ * a project or environment, that part of it. A token limited to a project
35
+ * names no other.
36
+ *
37
+ * @generated from field: string project = 1;
38
+ */
39
+ project?: string;
40
+ /**
41
+ * environment names an environment of project, and needs project.
42
+ *
43
+ * @generated from field: string environment = 2;
44
+ */
45
+ environment?: string;
46
+ };
47
+ /**
48
+ * Describes the message toshi.workspace.v1.DiscoverRequest.
49
+ * Use `create(DiscoverRequestSchema)` to create a new message.
50
+ */
51
+ export declare const DiscoverRequestSchema: GenMessage<DiscoverRequest, {
52
+ jsonType: DiscoverRequestJson;
53
+ }>;
54
+ /**
55
+ * @generated from message toshi.workspace.v1.DiscoverResponse
56
+ */
57
+ export type DiscoverResponse = Message<"toshi.workspace.v1.DiscoverResponse"> & {
58
+ /**
59
+ * products are the products the build includes, by id.
60
+ *
61
+ * @generated from field: repeated toshi.workspace.v1.DiscoveredProduct products = 1;
62
+ */
63
+ products: DiscoveredProduct[];
64
+ /**
65
+ * permissions are the caller's, sorted: what its roles in the workspace
66
+ * give it at the request's project and environment. Each is
67
+ * "<area>.<level>", as this API's methods name them in their
68
+ * toshi.permission option, or a
69
+ * product's own, "<product id>.<level>".
70
+ *
71
+ * @generated from field: repeated string permissions = 2;
72
+ */
73
+ permissions: string[];
74
+ /**
75
+ * @generated from field: toshi.workspace.v1.APIVersions versions = 3;
76
+ */
77
+ versions?: APIVersions | undefined;
78
+ /**
79
+ * registry_address is the deployment's container registry as a client
80
+ * writes it in an image reference and logs in to it, such as
81
+ * "registry.example.com": a host name, with a port when it is not 443.
82
+ * Empty when the deployment runs no container registry.
83
+ *
84
+ * @generated from field: string registry_address = 4;
85
+ */
86
+ registryAddress: string;
87
+ /**
88
+ * calls are the Workspace API procedures the caller may make at the
89
+ * request's project and environment, sorted, such as
90
+ * "/toshi.workspace.v1.WorkloadService/CreateJob": those its credential
91
+ * takes whose permission its roles give it where the call acts, by the
92
+ * rule that admits a call. A call in a project or an environment is
93
+ * listed when the caller may make it at the request's project and
94
+ * environment, or with none named, anywhere. The workspace's state is
95
+ * not looked at: a suspended workspace lists writes it refuses.
96
+ *
97
+ * @generated from field: repeated string calls = 5;
98
+ */
99
+ calls: string[];
100
+ };
101
+ /**
102
+ * @generated from message toshi.workspace.v1.DiscoverResponse
103
+ */
104
+ export type DiscoverResponseJson = {
105
+ /**
106
+ * products are the products the build includes, by id.
107
+ *
108
+ * @generated from field: repeated toshi.workspace.v1.DiscoveredProduct products = 1;
109
+ */
110
+ products?: DiscoveredProductJson[];
111
+ /**
112
+ * permissions are the caller's, sorted: what its roles in the workspace
113
+ * give it at the request's project and environment. Each is
114
+ * "<area>.<level>", as this API's methods name them in their
115
+ * toshi.permission option, or a
116
+ * product's own, "<product id>.<level>".
117
+ *
118
+ * @generated from field: repeated string permissions = 2;
119
+ */
120
+ permissions?: string[];
121
+ /**
122
+ * @generated from field: toshi.workspace.v1.APIVersions versions = 3;
123
+ */
124
+ versions?: APIVersionsJson;
125
+ /**
126
+ * registry_address is the deployment's container registry as a client
127
+ * writes it in an image reference and logs in to it, such as
128
+ * "registry.example.com": a host name, with a port when it is not 443.
129
+ * Empty when the deployment runs no container registry.
130
+ *
131
+ * @generated from field: string registry_address = 4;
132
+ */
133
+ registryAddress?: string;
134
+ /**
135
+ * calls are the Workspace API procedures the caller may make at the
136
+ * request's project and environment, sorted, such as
137
+ * "/toshi.workspace.v1.WorkloadService/CreateJob": those its credential
138
+ * takes whose permission its roles give it where the call acts, by the
139
+ * rule that admits a call. A call in a project or an environment is
140
+ * listed when the caller may make it at the request's project and
141
+ * environment, or with none named, anywhere. The workspace's state is
142
+ * not looked at: a suspended workspace lists writes it refuses.
143
+ *
144
+ * @generated from field: repeated string calls = 5;
145
+ */
146
+ calls?: string[];
147
+ };
148
+ /**
149
+ * Describes the message toshi.workspace.v1.DiscoverResponse.
150
+ * Use `create(DiscoverResponseSchema)` to create a new message.
151
+ */
152
+ export declare const DiscoverResponseSchema: GenMessage<DiscoverResponse, {
153
+ jsonType: DiscoverResponseJson;
154
+ }>;
155
+ /**
156
+ * DiscoveredProduct is one product the build includes.
157
+ *
158
+ * @generated from message toshi.workspace.v1.DiscoveredProduct
159
+ */
160
+ export type DiscoveredProduct = Message<"toshi.workspace.v1.DiscoveredProduct"> & {
161
+ /**
162
+ * id names the product, such as "runners": its config section and the
163
+ * prefix of its features and permissions.
164
+ *
165
+ * @generated from field: string id = 1;
166
+ */
167
+ id: string;
168
+ /**
169
+ * @generated from field: string version = 2;
170
+ */
171
+ version: string;
172
+ /**
173
+ * docs is where the product's documentation lives: a path in the Toshi
174
+ * repository, or a URL.
175
+ *
176
+ * @generated from field: string docs = 3;
177
+ */
178
+ docs: string;
179
+ /**
180
+ * enabled reports whether the deployment's config turns the product on.
181
+ * A product that is off serves no calls.
182
+ *
183
+ * @generated from field: bool enabled = 4;
184
+ */
185
+ enabled: boolean;
186
+ /**
187
+ * features are the product's typed keys, by key.
188
+ *
189
+ * @generated from field: repeated toshi.workspace.v1.ProductFeature features = 5;
190
+ */
191
+ features: ProductFeature[];
192
+ /**
193
+ * state is where the product is in the deployment's lifecycle.
194
+ *
195
+ * @generated from field: toshi.workspace.v1.ProductState state = 6;
196
+ */
197
+ state: ProductState;
198
+ /**
199
+ * surfaces are what the product adds to Toshi: the path its API is
200
+ * served at.
201
+ *
202
+ * @generated from field: toshi.workspace.v1.DiscoveredSurfaces surfaces = 8;
203
+ */
204
+ surfaces?: DiscoveredSurfaces | undefined;
205
+ /**
206
+ * available reports whether the product is on for the workspace: the
207
+ * build includes it, the deployment's config, the workspace's plan and
208
+ * its settings all turn it on. A call to a product that is not available
209
+ * is refused with FAILED_PRECONDITION and the reason PRODUCT_UNAVAILABLE,
210
+ * whose metadata names the input that turned it off; the workspace's
211
+ * product settings show its plan's entitlement and its own setting.
212
+ *
213
+ * @generated from field: bool available = 10;
214
+ */
215
+ available: boolean;
216
+ /**
217
+ * stability is how mature the product is in this build.
218
+ *
219
+ * @generated from field: toshi.workspace.v1.ProductStability stability = 11;
220
+ */
221
+ stability: ProductStability;
222
+ /**
223
+ * removal_version is the version a deprecated product is removed in;
224
+ * empty for the other stabilities.
225
+ *
226
+ * @generated from field: string removal_version = 12;
227
+ */
228
+ removalVersion: string;
229
+ };
230
+ /**
231
+ * DiscoveredProduct is one product the build includes.
232
+ *
233
+ * @generated from message toshi.workspace.v1.DiscoveredProduct
234
+ */
235
+ export type DiscoveredProductJson = {
236
+ /**
237
+ * id names the product, such as "runners": its config section and the
238
+ * prefix of its features and permissions.
239
+ *
240
+ * @generated from field: string id = 1;
241
+ */
242
+ id?: string;
243
+ /**
244
+ * @generated from field: string version = 2;
245
+ */
246
+ version?: string;
247
+ /**
248
+ * docs is where the product's documentation lives: a path in the Toshi
249
+ * repository, or a URL.
250
+ *
251
+ * @generated from field: string docs = 3;
252
+ */
253
+ docs?: string;
254
+ /**
255
+ * enabled reports whether the deployment's config turns the product on.
256
+ * A product that is off serves no calls.
257
+ *
258
+ * @generated from field: bool enabled = 4;
259
+ */
260
+ enabled?: boolean;
261
+ /**
262
+ * features are the product's typed keys, by key.
263
+ *
264
+ * @generated from field: repeated toshi.workspace.v1.ProductFeature features = 5;
265
+ */
266
+ features?: ProductFeatureJson[];
267
+ /**
268
+ * state is where the product is in the deployment's lifecycle.
269
+ *
270
+ * @generated from field: toshi.workspace.v1.ProductState state = 6;
271
+ */
272
+ state?: ProductStateJson;
273
+ /**
274
+ * surfaces are what the product adds to Toshi: the path its API is
275
+ * served at.
276
+ *
277
+ * @generated from field: toshi.workspace.v1.DiscoveredSurfaces surfaces = 8;
278
+ */
279
+ surfaces?: DiscoveredSurfacesJson;
280
+ /**
281
+ * available reports whether the product is on for the workspace: the
282
+ * build includes it, the deployment's config, the workspace's plan and
283
+ * its settings all turn it on. A call to a product that is not available
284
+ * is refused with FAILED_PRECONDITION and the reason PRODUCT_UNAVAILABLE,
285
+ * whose metadata names the input that turned it off; the workspace's
286
+ * product settings show its plan's entitlement and its own setting.
287
+ *
288
+ * @generated from field: bool available = 10;
289
+ */
290
+ available?: boolean;
291
+ /**
292
+ * stability is how mature the product is in this build.
293
+ *
294
+ * @generated from field: toshi.workspace.v1.ProductStability stability = 11;
295
+ */
296
+ stability?: ProductStabilityJson;
297
+ /**
298
+ * removal_version is the version a deprecated product is removed in;
299
+ * empty for the other stabilities.
300
+ *
301
+ * @generated from field: string removal_version = 12;
302
+ */
303
+ removalVersion?: string;
304
+ };
305
+ /**
306
+ * Describes the message toshi.workspace.v1.DiscoveredProduct.
307
+ * Use `create(DiscoveredProductSchema)` to create a new message.
308
+ */
309
+ export declare const DiscoveredProductSchema: GenMessage<DiscoveredProduct, {
310
+ jsonType: DiscoveredProductJson;
311
+ }>;
312
+ /**
313
+ * DiscoveredSurfaces are what a product adds to Toshi, empty when it adds
314
+ * none. It mirrors products.proto's ProductSurfaces, field for field,
315
+ * because discovery.proto cannot import products.proto, which imports it.
316
+ *
317
+ * @generated from message toshi.workspace.v1.DiscoveredSurfaces
318
+ */
319
+ export type DiscoveredSurfaces = Message<"toshi.workspace.v1.DiscoveredSurfaces"> & {
320
+ /**
321
+ * api is the path the control plane serves the product's API at, such
322
+ * as "/runners/".
323
+ *
324
+ * @generated from field: string api = 1;
325
+ */
326
+ api: string;
327
+ };
328
+ /**
329
+ * DiscoveredSurfaces are what a product adds to Toshi, empty when it adds
330
+ * none. It mirrors products.proto's ProductSurfaces, field for field,
331
+ * because discovery.proto cannot import products.proto, which imports it.
332
+ *
333
+ * @generated from message toshi.workspace.v1.DiscoveredSurfaces
334
+ */
335
+ export type DiscoveredSurfacesJson = {
336
+ /**
337
+ * api is the path the control plane serves the product's API at, such
338
+ * as "/runners/".
339
+ *
340
+ * @generated from field: string api = 1;
341
+ */
342
+ api?: string;
343
+ };
344
+ /**
345
+ * Describes the message toshi.workspace.v1.DiscoveredSurfaces.
346
+ * Use `create(DiscoveredSurfacesSchema)` to create a new message.
347
+ */
348
+ export declare const DiscoveredSurfacesSchema: GenMessage<DiscoveredSurfaces, {
349
+ jsonType: DiscoveredSurfacesJson;
350
+ }>;
351
+ /**
352
+ * ProductFeature is a typed key a product declares.
353
+ *
354
+ * @generated from message toshi.workspace.v1.ProductFeature
355
+ */
356
+ export type ProductFeature = Message<"toshi.workspace.v1.ProductFeature"> & {
357
+ /**
358
+ * key is "<product id>.<name>".
359
+ *
360
+ * @generated from field: string key = 1;
361
+ */
362
+ key: string;
363
+ /**
364
+ * @generated from field: toshi.workspace.v1.ProductFeatureType type = 2;
365
+ */
366
+ type: ProductFeatureType;
367
+ /**
368
+ * values are an enum's values; empty for the other types.
369
+ *
370
+ * @generated from field: repeated string values = 3;
371
+ */
372
+ values: string[];
373
+ /**
374
+ * narrowable reports whether a workspace's settings may narrow the
375
+ * feature within its entitlement: turn it off, or set a lower limit.
376
+ *
377
+ * @generated from field: bool narrowable = 4;
378
+ */
379
+ narrowable: boolean;
380
+ /**
381
+ * entitlement is the most the workspace may have of the feature: the
382
+ * operator's override for the workspace, else its plan's value, else the
383
+ * value of the plan key it falls back to, else the feature's default
384
+ * (source). Unset when the config turns the product off or the build
385
+ * does not include it.
386
+ *
387
+ * @generated from field: toshi.workspace.v1.FeatureValue entitlement = 5;
388
+ */
389
+ entitlement?: FeatureValue | undefined;
390
+ /**
391
+ * setting is the workspace's own value of the feature, unset when it has
392
+ * none or when its entitlements leave the product, or this bool feature,
393
+ * out. A setting the entitlement no longer contains, after the plan or
394
+ * an override lowered it, is kept and not applied.
395
+ *
396
+ * @generated from field: toshi.workspace.v1.FeatureValue setting = 6;
397
+ */
398
+ setting?: FeatureValue | undefined;
399
+ /**
400
+ * effective is the value that applies: the setting when the feature is
401
+ * narrowable and the entitlement contains it, else the entitlement.
402
+ * Unset when the config turns the product off or the build does not
403
+ * include it.
404
+ *
405
+ * @generated from field: toshi.workspace.v1.FeatureValue effective = 7;
406
+ */
407
+ effective?: FeatureValue | undefined;
408
+ /**
409
+ * default_value is the feature's default in its product's manifest: the
410
+ * entitlement when no override, plan value or plan key gives one.
411
+ *
412
+ * @generated from field: toshi.workspace.v1.FeatureValue default_value = 8;
413
+ */
414
+ defaultValue?: FeatureValue | undefined;
415
+ /**
416
+ * max bounds a count, or both ends of a range: no value of the feature
417
+ * is higher. 0 bounds nothing.
418
+ *
419
+ * @generated from field: int64 max = 9;
420
+ */
421
+ max: bigint;
422
+ /**
423
+ * plan_key names the plan key a count falls back to, such as
424
+ * "preview_max_connections": a plan that sets the key and gives the
425
+ * feature no value of its own entitles the workspace to the key's value.
426
+ * Empty for a feature that falls back to none.
427
+ *
428
+ * @generated from field: string plan_key = 10;
429
+ */
430
+ planKey: string;
431
+ /**
432
+ * source says where the entitlement comes from. Unspecified when the
433
+ * config turns the product off.
434
+ *
435
+ * @generated from field: toshi.workspace.v1.FeatureSource source = 11;
436
+ */
437
+ source: FeatureSource;
438
+ };
439
+ /**
440
+ * ProductFeature is a typed key a product declares.
441
+ *
442
+ * @generated from message toshi.workspace.v1.ProductFeature
443
+ */
444
+ export type ProductFeatureJson = {
445
+ /**
446
+ * key is "<product id>.<name>".
447
+ *
448
+ * @generated from field: string key = 1;
449
+ */
450
+ key?: string;
451
+ /**
452
+ * @generated from field: toshi.workspace.v1.ProductFeatureType type = 2;
453
+ */
454
+ type?: ProductFeatureTypeJson;
455
+ /**
456
+ * values are an enum's values; empty for the other types.
457
+ *
458
+ * @generated from field: repeated string values = 3;
459
+ */
460
+ values?: string[];
461
+ /**
462
+ * narrowable reports whether a workspace's settings may narrow the
463
+ * feature within its entitlement: turn it off, or set a lower limit.
464
+ *
465
+ * @generated from field: bool narrowable = 4;
466
+ */
467
+ narrowable?: boolean;
468
+ /**
469
+ * entitlement is the most the workspace may have of the feature: the
470
+ * operator's override for the workspace, else its plan's value, else the
471
+ * value of the plan key it falls back to, else the feature's default
472
+ * (source). Unset when the config turns the product off or the build
473
+ * does not include it.
474
+ *
475
+ * @generated from field: toshi.workspace.v1.FeatureValue entitlement = 5;
476
+ */
477
+ entitlement?: FeatureValueJson;
478
+ /**
479
+ * setting is the workspace's own value of the feature, unset when it has
480
+ * none or when its entitlements leave the product, or this bool feature,
481
+ * out. A setting the entitlement no longer contains, after the plan or
482
+ * an override lowered it, is kept and not applied.
483
+ *
484
+ * @generated from field: toshi.workspace.v1.FeatureValue setting = 6;
485
+ */
486
+ setting?: FeatureValueJson;
487
+ /**
488
+ * effective is the value that applies: the setting when the feature is
489
+ * narrowable and the entitlement contains it, else the entitlement.
490
+ * Unset when the config turns the product off or the build does not
491
+ * include it.
492
+ *
493
+ * @generated from field: toshi.workspace.v1.FeatureValue effective = 7;
494
+ */
495
+ effective?: FeatureValueJson;
496
+ /**
497
+ * default_value is the feature's default in its product's manifest: the
498
+ * entitlement when no override, plan value or plan key gives one.
499
+ *
500
+ * @generated from field: toshi.workspace.v1.FeatureValue default_value = 8;
501
+ */
502
+ defaultValue?: FeatureValueJson;
503
+ /**
504
+ * max bounds a count, or both ends of a range: no value of the feature
505
+ * is higher. 0 bounds nothing.
506
+ *
507
+ * @generated from field: int64 max = 9;
508
+ */
509
+ max?: string;
510
+ /**
511
+ * plan_key names the plan key a count falls back to, such as
512
+ * "preview_max_connections": a plan that sets the key and gives the
513
+ * feature no value of its own entitles the workspace to the key's value.
514
+ * Empty for a feature that falls back to none.
515
+ *
516
+ * @generated from field: string plan_key = 10;
517
+ */
518
+ planKey?: string;
519
+ /**
520
+ * source says where the entitlement comes from. Unspecified when the
521
+ * config turns the product off.
522
+ *
523
+ * @generated from field: toshi.workspace.v1.FeatureSource source = 11;
524
+ */
525
+ source?: FeatureSourceJson;
526
+ };
527
+ /**
528
+ * Describes the message toshi.workspace.v1.ProductFeature.
529
+ * Use `create(ProductFeatureSchema)` to create a new message.
530
+ */
531
+ export declare const ProductFeatureSchema: GenMessage<ProductFeature, {
532
+ jsonType: ProductFeatureJson;
533
+ }>;
534
+ /**
535
+ * FeatureValue is a value of a feature, of the feature's type.
536
+ *
537
+ * @generated from message toshi.workspace.v1.FeatureValue
538
+ */
539
+ export type FeatureValue = Message<"toshi.workspace.v1.FeatureValue"> & {
540
+ /**
541
+ * @generated from oneof toshi.workspace.v1.FeatureValue.value
542
+ */
543
+ value: {
544
+ /**
545
+ * A bool feature's value.
546
+ *
547
+ * @generated from field: bool bool = 1;
548
+ */
549
+ value: boolean;
550
+ case: "bool";
551
+ } | {
552
+ /**
553
+ * A count feature's value, never negative.
554
+ *
555
+ * @generated from field: int64 count = 2;
556
+ */
557
+ value: bigint;
558
+ case: "count";
559
+ } | {
560
+ /**
561
+ * A range feature's value.
562
+ *
563
+ * @generated from field: toshi.workspace.v1.FeatureRange range = 3;
564
+ */
565
+ value: FeatureRange;
566
+ case: "range";
567
+ } | {
568
+ /**
569
+ * An enum feature's value, one of its values, or a string feature's.
570
+ *
571
+ * @generated from field: string text = 4;
572
+ */
573
+ value: string;
574
+ case: "text";
575
+ } | {
576
+ case: undefined;
577
+ value?: undefined;
578
+ };
579
+ };
580
+ /**
581
+ * FeatureValue is a value of a feature, of the feature's type.
582
+ *
583
+ * @generated from message toshi.workspace.v1.FeatureValue
584
+ */
585
+ export type FeatureValueJson = {
586
+ /**
587
+ * A bool feature's value.
588
+ *
589
+ * @generated from field: bool bool = 1;
590
+ */
591
+ bool?: boolean;
592
+ /**
593
+ * A count feature's value, never negative.
594
+ *
595
+ * @generated from field: int64 count = 2;
596
+ */
597
+ count?: string;
598
+ /**
599
+ * A range feature's value.
600
+ *
601
+ * @generated from field: toshi.workspace.v1.FeatureRange range = 3;
602
+ */
603
+ range?: FeatureRangeJson;
604
+ /**
605
+ * An enum feature's value, one of its values, or a string feature's.
606
+ *
607
+ * @generated from field: string text = 4;
608
+ */
609
+ text?: string;
610
+ };
611
+ /**
612
+ * Describes the message toshi.workspace.v1.FeatureValue.
613
+ * Use `create(FeatureValueSchema)` to create a new message.
614
+ */
615
+ export declare const FeatureValueSchema: GenMessage<FeatureValue, {
616
+ jsonType: FeatureValueJson;
617
+ }>;
618
+ /**
619
+ * FeatureRange is a range feature's value: from min to max, both included.
620
+ *
621
+ * @generated from message toshi.workspace.v1.FeatureRange
622
+ */
623
+ export type FeatureRange = Message<"toshi.workspace.v1.FeatureRange"> & {
624
+ /**
625
+ * @generated from field: int64 min = 1;
626
+ */
627
+ min: bigint;
628
+ /**
629
+ * @generated from field: int64 max = 2;
630
+ */
631
+ max: bigint;
632
+ };
633
+ /**
634
+ * FeatureRange is a range feature's value: from min to max, both included.
635
+ *
636
+ * @generated from message toshi.workspace.v1.FeatureRange
637
+ */
638
+ export type FeatureRangeJson = {
639
+ /**
640
+ * @generated from field: int64 min = 1;
641
+ */
642
+ min?: string;
643
+ /**
644
+ * @generated from field: int64 max = 2;
645
+ */
646
+ max?: string;
647
+ };
648
+ /**
649
+ * Describes the message toshi.workspace.v1.FeatureRange.
650
+ * Use `create(FeatureRangeSchema)` to create a new message.
651
+ */
652
+ export declare const FeatureRangeSchema: GenMessage<FeatureRange, {
653
+ jsonType: FeatureRangeJson;
654
+ }>;
655
+ /**
656
+ * APIVersions are the versions a client checks itself against.
657
+ *
658
+ * @generated from message toshi.workspace.v1.APIVersions
659
+ */
660
+ export type APIVersions = Message<"toshi.workspace.v1.APIVersions"> & {
661
+ /**
662
+ * api is the Toshi API's version, MAJOR.MINOR.PATCH: the version of the
663
+ * toshi-api module the SDKs are built from.
664
+ *
665
+ * @generated from field: string api = 1;
666
+ */
667
+ api: string;
668
+ /**
669
+ * control_plane is the control plane's release, as GetVersion returns it.
670
+ *
671
+ * @generated from field: string control_plane = 2;
672
+ */
673
+ controlPlane: string;
674
+ };
675
+ /**
676
+ * APIVersions are the versions a client checks itself against.
677
+ *
678
+ * @generated from message toshi.workspace.v1.APIVersions
679
+ */
680
+ export type APIVersionsJson = {
681
+ /**
682
+ * api is the Toshi API's version, MAJOR.MINOR.PATCH: the version of the
683
+ * toshi-api module the SDKs are built from.
684
+ *
685
+ * @generated from field: string api = 1;
686
+ */
687
+ api?: string;
688
+ /**
689
+ * control_plane is the control plane's release, as GetVersion returns it.
690
+ *
691
+ * @generated from field: string control_plane = 2;
692
+ */
693
+ controlPlane?: string;
694
+ };
695
+ /**
696
+ * Describes the message toshi.workspace.v1.APIVersions.
697
+ * Use `create(APIVersionsSchema)` to create a new message.
698
+ */
699
+ export declare const APIVersionsSchema: GenMessage<APIVersions, {
700
+ jsonType: APIVersionsJson;
701
+ }>;
702
+ /**
703
+ * ProductState is where a product is in the deployment's lifecycle. A
704
+ * product the config turns off goes from no new work through draining to
705
+ * stopped as its work ends, and back to enabled when the config turns it on
706
+ * again. None of the states deletes the product's data.
707
+ *
708
+ * @generated from enum toshi.workspace.v1.ProductState
709
+ */
710
+ export declare enum ProductState {
711
+ /**
712
+ * @generated from enum value: PRODUCT_STATE_UNSPECIFIED = 0;
713
+ */
714
+ UNSPECIFIED = 0,
715
+ /**
716
+ * The config turns the product on: it takes new work.
717
+ *
718
+ * @generated from enum value: PRODUCT_STATE_ENABLED = 1;
719
+ */
720
+ ENABLED = 1,
721
+ /**
722
+ * Turned off, with work it accepted that has not started: it takes no new
723
+ * work, and that work still runs.
724
+ *
725
+ * @generated from enum value: PRODUCT_STATE_NO_NEW_WORK = 2;
726
+ */
727
+ NO_NEW_WORK = 2,
728
+ /**
729
+ * Turned off, with its last work running: that work ends as it would
730
+ * have.
731
+ *
732
+ * @generated from enum value: PRODUCT_STATE_DRAINING = 3;
733
+ */
734
+ DRAINING = 3,
735
+ /**
736
+ * Turned off, with nothing left to finish.
737
+ *
738
+ * @generated from enum value: PRODUCT_STATE_STOPPED = 4;
739
+ */
740
+ STOPPED = 4
741
+ }
742
+ /**
743
+ * ProductState is where a product is in the deployment's lifecycle. A
744
+ * product the config turns off goes from no new work through draining to
745
+ * stopped as its work ends, and back to enabled when the config turns it on
746
+ * again. None of the states deletes the product's data.
747
+ *
748
+ * @generated from enum toshi.workspace.v1.ProductState
749
+ */
750
+ export type ProductStateJson = "PRODUCT_STATE_UNSPECIFIED" | "PRODUCT_STATE_ENABLED" | "PRODUCT_STATE_NO_NEW_WORK" | "PRODUCT_STATE_DRAINING" | "PRODUCT_STATE_STOPPED";
751
+ /**
752
+ * Describes the enum toshi.workspace.v1.ProductState.
753
+ */
754
+ export declare const ProductStateSchema: GenEnum<ProductState, ProductStateJson>;
755
+ /**
756
+ * ProductStability is how mature a product is. A deployment's
757
+ * products.min_stability turns off a product below it, as the operator's
758
+ * switch does.
759
+ *
760
+ * @generated from enum toshi.workspace.v1.ProductStability
761
+ */
762
+ export declare enum ProductStability {
763
+ /**
764
+ * @generated from enum value: PRODUCT_STABILITY_UNSPECIFIED = 0;
765
+ */
766
+ UNSPECIFIED = 0,
767
+ /**
768
+ * May change or go away in any release.
769
+ *
770
+ * @generated from enum value: PRODUCT_STABILITY_ALPHA = 1;
771
+ */
772
+ ALPHA = 1,
773
+ /**
774
+ * Complete; its configuration and API may still change between minor
775
+ * releases, with notice.
776
+ *
777
+ * @generated from enum value: PRODUCT_STABILITY_BETA = 2;
778
+ */
779
+ BETA = 2,
780
+ /**
781
+ * Changes only compatibly within a major version.
782
+ *
783
+ * @generated from enum value: PRODUCT_STABILITY_STABLE = 3;
784
+ */
785
+ STABLE = 3,
786
+ /**
787
+ * Works as it did until its removal version.
788
+ *
789
+ * @generated from enum value: PRODUCT_STABILITY_DEPRECATED = 4;
790
+ */
791
+ DEPRECATED = 4
792
+ }
793
+ /**
794
+ * ProductStability is how mature a product is. A deployment's
795
+ * products.min_stability turns off a product below it, as the operator's
796
+ * switch does.
797
+ *
798
+ * @generated from enum toshi.workspace.v1.ProductStability
799
+ */
800
+ export type ProductStabilityJson = "PRODUCT_STABILITY_UNSPECIFIED" | "PRODUCT_STABILITY_ALPHA" | "PRODUCT_STABILITY_BETA" | "PRODUCT_STABILITY_STABLE" | "PRODUCT_STABILITY_DEPRECATED";
801
+ /**
802
+ * Describes the enum toshi.workspace.v1.ProductStability.
803
+ */
804
+ export declare const ProductStabilitySchema: GenEnum<ProductStability, ProductStabilityJson>;
805
+ /**
806
+ * FeatureSource is where a workspace's entitlement to a feature comes from,
807
+ * the first that applies in this order: the operator's override, the
808
+ * value its plan gives the feature, the plan key the feature falls back
809
+ * to, and the feature's default.
810
+ *
811
+ * @generated from enum toshi.workspace.v1.FeatureSource
812
+ */
813
+ export declare enum FeatureSource {
814
+ /**
815
+ * @generated from enum value: FEATURE_SOURCE_UNSPECIFIED = 0;
816
+ */
817
+ UNSPECIFIED = 0,
818
+ /**
819
+ * The operator's override for the workspace.
820
+ *
821
+ * @generated from enum value: FEATURE_SOURCE_OVERRIDE = 1;
822
+ */
823
+ OVERRIDE = 1,
824
+ /**
825
+ * The value the workspace's plan gives the feature.
826
+ *
827
+ * @generated from enum value: FEATURE_SOURCE_PLAN = 2;
828
+ */
829
+ PLAN = 2,
830
+ /**
831
+ * The value of the plan key the feature falls back to, which the
832
+ * workspace's plan sets.
833
+ *
834
+ * @generated from enum value: FEATURE_SOURCE_PLAN_KEY = 3;
835
+ */
836
+ PLAN_KEY = 3,
837
+ /**
838
+ * The feature's default in its product's manifest.
839
+ *
840
+ * @generated from enum value: FEATURE_SOURCE_DEFAULT = 4;
841
+ */
842
+ DEFAULT = 4
843
+ }
844
+ /**
845
+ * FeatureSource is where a workspace's entitlement to a feature comes from,
846
+ * the first that applies in this order: the operator's override, the
847
+ * value its plan gives the feature, the plan key the feature falls back
848
+ * to, and the feature's default.
849
+ *
850
+ * @generated from enum toshi.workspace.v1.FeatureSource
851
+ */
852
+ export type FeatureSourceJson = "FEATURE_SOURCE_UNSPECIFIED" | "FEATURE_SOURCE_OVERRIDE" | "FEATURE_SOURCE_PLAN" | "FEATURE_SOURCE_PLAN_KEY" | "FEATURE_SOURCE_DEFAULT";
853
+ /**
854
+ * Describes the enum toshi.workspace.v1.FeatureSource.
855
+ */
856
+ export declare const FeatureSourceSchema: GenEnum<FeatureSource, FeatureSourceJson>;
857
+ /**
858
+ * ProductFeatureType is the type of a feature's value.
859
+ *
860
+ * @generated from enum toshi.workspace.v1.ProductFeatureType
861
+ */
862
+ export declare enum ProductFeatureType {
863
+ /**
864
+ * @generated from enum value: PRODUCT_FEATURE_TYPE_UNSPECIFIED = 0;
865
+ */
866
+ UNSPECIFIED = 0,
867
+ /**
868
+ * @generated from enum value: PRODUCT_FEATURE_TYPE_BOOL = 1;
869
+ */
870
+ BOOL = 1,
871
+ /**
872
+ * @generated from enum value: PRODUCT_FEATURE_TYPE_COUNT = 2;
873
+ */
874
+ COUNT = 2,
875
+ /**
876
+ * @generated from enum value: PRODUCT_FEATURE_TYPE_RANGE = 3;
877
+ */
878
+ RANGE = 3,
879
+ /**
880
+ * @generated from enum value: PRODUCT_FEATURE_TYPE_ENUM = 4;
881
+ */
882
+ ENUM = 4,
883
+ /**
884
+ * @generated from enum value: PRODUCT_FEATURE_TYPE_STRING = 5;
885
+ */
886
+ STRING = 5
887
+ }
888
+ /**
889
+ * ProductFeatureType is the type of a feature's value.
890
+ *
891
+ * @generated from enum toshi.workspace.v1.ProductFeatureType
892
+ */
893
+ export type ProductFeatureTypeJson = "PRODUCT_FEATURE_TYPE_UNSPECIFIED" | "PRODUCT_FEATURE_TYPE_BOOL" | "PRODUCT_FEATURE_TYPE_COUNT" | "PRODUCT_FEATURE_TYPE_RANGE" | "PRODUCT_FEATURE_TYPE_ENUM" | "PRODUCT_FEATURE_TYPE_STRING";
894
+ /**
895
+ * Describes the enum toshi.workspace.v1.ProductFeatureType.
896
+ */
897
+ export declare const ProductFeatureTypeSchema: GenEnum<ProductFeatureType, ProductFeatureTypeJson>;
898
+ /**
899
+ * DiscoveryService tells a client what this deployment serves and what the
900
+ * caller may do in the workspace, in one call: the products the build
901
+ * includes, where each is in the deployment's lifecycle and whether the
902
+ * workspace has it on, each feature's entitlement, setting and effective
903
+ * value, the caller's permissions and the versions of the API and the
904
+ * control plane. A client
905
+ * reads it to decide what to show and what to call.
906
+ *
907
+ * The caller's credential names the workspace, as for WorkloadService.
908
+ *
909
+ * @generated from service toshi.workspace.v1.DiscoveryService
910
+ */
911
+ export declare const DiscoveryService: GenService<{
912
+ /**
913
+ * Discover returns the products, the caller's permissions in the
914
+ * workspace, or in one of its projects or environments, and the
915
+ * versions. A suspended workspace answers it.
916
+ *
917
+ * @generated from rpc toshi.workspace.v1.DiscoveryService.Discover
918
+ */
919
+ discover: {
920
+ methodKind: "unary";
921
+ input: typeof DiscoverRequestSchema;
922
+ output: typeof DiscoverResponseSchema;
923
+ };
924
+ }>;