@toshicloud/sdk 0.4.0 → 0.5.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 (38) hide show
  1. package/README.md +44 -3
  2. package/dist/client.d.ts +7 -2
  3. package/dist/client.js +9 -3
  4. package/dist/errors.d.ts +47 -0
  5. package/dist/errors.js +136 -0
  6. package/dist/gen/toshi/permission_pb.d.ts +39 -0
  7. package/dist/gen/toshi/permission_pb.js +42 -0
  8. package/dist/gen/toshi/workspace/v1/artifacts_pb.d.ts +1 -1
  9. package/dist/gen/toshi/workspace/v1/artifacts_pb.js +3 -2
  10. package/dist/gen/toshi/workspace/v1/audit_events_pb.js +2 -1
  11. package/dist/gen/toshi/workspace/v1/channels_pb.js +2 -1
  12. package/dist/gen/toshi/workspace/v1/discovery_pb.d.ts +676 -0
  13. package/dist/gen/toshi/workspace/v1/discovery_pb.js +182 -0
  14. package/dist/gen/toshi/workspace/v1/display_pb.js +2 -1
  15. package/dist/gen/toshi/workspace/v1/fillers_pb.js +2 -1
  16. package/dist/gen/toshi/workspace/v1/hostjobs_pb.js +2 -1
  17. package/dist/gen/toshi/workspace/v1/hosts_pb.js +2 -1
  18. package/dist/gen/toshi/workspace/v1/products_pb.d.ts +703 -0
  19. package/dist/gen/toshi/workspace/v1/products_pb.js +106 -0
  20. package/dist/gen/toshi/workspace/v1/projects_pb.js +2 -1
  21. package/dist/gen/toshi/workspace/v1/recordings_pb.js +2 -1
  22. package/dist/gen/toshi/workspace/v1/secrets_pb.js +2 -1
  23. package/dist/gen/toshi/workspace/v1/storage_providers_pb.js +2 -1
  24. package/dist/gen/toshi/workspace/v1/tokens_pb.js +2 -1
  25. package/dist/gen/toshi/workspace/v1/volumes_pb.js +2 -1
  26. package/dist/gen/toshi/workspace/v1/webhook_pb.js +2 -1
  27. package/dist/gen/toshi/workspace/v1/workloads_pb.js +2 -1
  28. package/dist/gen/toshi/workspace/v1/workspace_pb.d.ts +2 -2
  29. package/dist/gen/toshi/workspace/v1/workspace_pb.js +1 -1
  30. package/dist/gen/toshi/workspace/v1/workspace_service_pb.js +2 -1
  31. package/dist/index.d.ts +3 -1
  32. package/dist/index.js +3 -1
  33. package/dist/interceptors.d.ts +6 -0
  34. package/dist/interceptors.js +29 -0
  35. package/dist/retry.js +4 -0
  36. package/dist/version.d.ts +1 -1
  37. package/dist/version.js +1 -1
  38. package/package.json +1 -1
@@ -0,0 +1,703 @@
1
+ import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
2
+ import type { Timestamp, TimestampJson } from "@bufbuild/protobuf/wkt";
3
+ import type { FeatureValue, FeatureValueJson, ProductState, ProductStateJson, ProductSwitch, ProductSwitchJson } from "./discovery_pb.js";
4
+ import type { Message } from "@bufbuild/protobuf";
5
+ /**
6
+ * Describes the file toshi/workspace/v1/products.proto.
7
+ */
8
+ export declare const file_toshi_workspace_v1_products: GenFile;
9
+ /**
10
+ * @generated from message toshi.workspace.v1.ListProductsRequest
11
+ */
12
+ export type ListProductsRequest = Message<"toshi.workspace.v1.ListProductsRequest"> & {};
13
+ /**
14
+ * @generated from message toshi.workspace.v1.ListProductsRequest
15
+ */
16
+ export type ListProductsRequestJson = {};
17
+ /**
18
+ * Describes the message toshi.workspace.v1.ListProductsRequest.
19
+ * Use `create(ListProductsRequestSchema)` to create a new message.
20
+ */
21
+ export declare const ListProductsRequestSchema: GenMessage<ListProductsRequest, {
22
+ jsonType: ListProductsRequestJson;
23
+ }>;
24
+ /**
25
+ * @generated from message toshi.workspace.v1.ListProductsResponse
26
+ */
27
+ export type ListProductsResponse = Message<"toshi.workspace.v1.ListProductsResponse"> & {
28
+ /**
29
+ * products are the products the deployment includes, by id.
30
+ *
31
+ * @generated from field: repeated toshi.workspace.v1.ProductSettings products = 1;
32
+ */
33
+ products: ProductSettings[];
34
+ };
35
+ /**
36
+ * @generated from message toshi.workspace.v1.ListProductsResponse
37
+ */
38
+ export type ListProductsResponseJson = {
39
+ /**
40
+ * products are the products the deployment includes, by id.
41
+ *
42
+ * @generated from field: repeated toshi.workspace.v1.ProductSettings products = 1;
43
+ */
44
+ products?: ProductSettingsJson[];
45
+ };
46
+ /**
47
+ * Describes the message toshi.workspace.v1.ListProductsResponse.
48
+ * Use `create(ListProductsResponseSchema)` to create a new message.
49
+ */
50
+ export declare const ListProductsResponseSchema: GenMessage<ListProductsResponse, {
51
+ jsonType: ListProductsResponseJson;
52
+ }>;
53
+ /**
54
+ * @generated from message toshi.workspace.v1.UpdateProductRequest
55
+ */
56
+ export type UpdateProductRequest = Message<"toshi.workspace.v1.UpdateProductRequest"> & {
57
+ /**
58
+ * id names the product, such as "runners".
59
+ *
60
+ * @generated from field: string id = 1;
61
+ */
62
+ id: string;
63
+ /**
64
+ * enabled turns the product on or off for the workspace: it sets the
65
+ * product's own switch, the feature "<id>.enabled". Unset leaves it.
66
+ * Turning on a product the workspace's entitlements leave off is
67
+ * INVALID_ARGUMENT.
68
+ *
69
+ * @generated from field: optional bool enabled = 2;
70
+ */
71
+ enabled?: boolean | undefined;
72
+ /**
73
+ * settings are the features to set, by key ("<id>.<name>"), each to a
74
+ * value of the feature's type.
75
+ *
76
+ * @generated from field: map<string, toshi.workspace.v1.FeatureValue> settings = 3;
77
+ */
78
+ settings: {
79
+ [key: string]: FeatureValue;
80
+ };
81
+ /**
82
+ * clear are the keys of the features whose settings to remove: the
83
+ * entitlement applies again. A key that is also in settings, or that
84
+ * enabled sets, is INVALID_ARGUMENT.
85
+ *
86
+ * @generated from field: repeated string clear = 4;
87
+ */
88
+ clear: string[];
89
+ /**
90
+ * accepted_access is the access an outside product, one a catalog source
91
+ * offers, asks for, as its catalog entry lists it. Turning such a product
92
+ * on for the first time, or again after it was removed, installs it and
93
+ * grants it that access, and needs the same permissions here, in any
94
+ * order: any other list is FAILED_PRECONDITION with an ErrorInfo of reason
95
+ * ACCESS_NOT_ACCEPTED whose metadata "access" lists what the entry asks
96
+ * for. Only a caller who holds every permission it asks for may install
97
+ * it, a person or a workspace token; one who lacks one is
98
+ * PERMISSION_DENIED naming it. Ignored when the product is built in or
99
+ * already installed.
100
+ *
101
+ * @generated from field: repeated string accepted_access = 5;
102
+ */
103
+ acceptedAccess: string[];
104
+ };
105
+ /**
106
+ * @generated from message toshi.workspace.v1.UpdateProductRequest
107
+ */
108
+ export type UpdateProductRequestJson = {
109
+ /**
110
+ * id names the product, such as "runners".
111
+ *
112
+ * @generated from field: string id = 1;
113
+ */
114
+ id?: string;
115
+ /**
116
+ * enabled turns the product on or off for the workspace: it sets the
117
+ * product's own switch, the feature "<id>.enabled". Unset leaves it.
118
+ * Turning on a product the workspace's entitlements leave off is
119
+ * INVALID_ARGUMENT.
120
+ *
121
+ * @generated from field: optional bool enabled = 2;
122
+ */
123
+ enabled?: boolean;
124
+ /**
125
+ * settings are the features to set, by key ("<id>.<name>"), each to a
126
+ * value of the feature's type.
127
+ *
128
+ * @generated from field: map<string, toshi.workspace.v1.FeatureValue> settings = 3;
129
+ */
130
+ settings?: {
131
+ [key: string]: FeatureValueJson;
132
+ };
133
+ /**
134
+ * clear are the keys of the features whose settings to remove: the
135
+ * entitlement applies again. A key that is also in settings, or that
136
+ * enabled sets, is INVALID_ARGUMENT.
137
+ *
138
+ * @generated from field: repeated string clear = 4;
139
+ */
140
+ clear?: string[];
141
+ /**
142
+ * accepted_access is the access an outside product, one a catalog source
143
+ * offers, asks for, as its catalog entry lists it. Turning such a product
144
+ * on for the first time, or again after it was removed, installs it and
145
+ * grants it that access, and needs the same permissions here, in any
146
+ * order: any other list is FAILED_PRECONDITION with an ErrorInfo of reason
147
+ * ACCESS_NOT_ACCEPTED whose metadata "access" lists what the entry asks
148
+ * for. Only a caller who holds every permission it asks for may install
149
+ * it, a person or a workspace token; one who lacks one is
150
+ * PERMISSION_DENIED naming it. Ignored when the product is built in or
151
+ * already installed.
152
+ *
153
+ * @generated from field: repeated string accepted_access = 5;
154
+ */
155
+ acceptedAccess?: string[];
156
+ };
157
+ /**
158
+ * Describes the message toshi.workspace.v1.UpdateProductRequest.
159
+ * Use `create(UpdateProductRequestSchema)` to create a new message.
160
+ */
161
+ export declare const UpdateProductRequestSchema: GenMessage<UpdateProductRequest, {
162
+ jsonType: UpdateProductRequestJson;
163
+ }>;
164
+ /**
165
+ * @generated from message toshi.workspace.v1.UpdateProductResponse
166
+ */
167
+ export type UpdateProductResponse = Message<"toshi.workspace.v1.UpdateProductResponse"> & {
168
+ /**
169
+ * product is the product as the workspace has it after the change.
170
+ *
171
+ * @generated from field: toshi.workspace.v1.ProductSettings product = 1;
172
+ */
173
+ product?: ProductSettings | undefined;
174
+ /**
175
+ * installation_token is the token an outside product's installation calls
176
+ * the Workspace API with, "toshi_in_" and 46 characters. Only the call
177
+ * that installs the product returns it.
178
+ *
179
+ * @generated from field: string installation_token = 2;
180
+ */
181
+ installationToken: string;
182
+ };
183
+ /**
184
+ * @generated from message toshi.workspace.v1.UpdateProductResponse
185
+ */
186
+ export type UpdateProductResponseJson = {
187
+ /**
188
+ * product is the product as the workspace has it after the change.
189
+ *
190
+ * @generated from field: toshi.workspace.v1.ProductSettings product = 1;
191
+ */
192
+ product?: ProductSettingsJson;
193
+ /**
194
+ * installation_token is the token an outside product's installation calls
195
+ * the Workspace API with, "toshi_in_" and 46 characters. Only the call
196
+ * that installs the product returns it.
197
+ *
198
+ * @generated from field: string installation_token = 2;
199
+ */
200
+ installationToken?: string;
201
+ };
202
+ /**
203
+ * Describes the message toshi.workspace.v1.UpdateProductResponse.
204
+ * Use `create(UpdateProductResponseSchema)` to create a new message.
205
+ */
206
+ export declare const UpdateProductResponseSchema: GenMessage<UpdateProductResponse, {
207
+ jsonType: UpdateProductResponseJson;
208
+ }>;
209
+ /**
210
+ * @generated from message toshi.workspace.v1.RemoveProductRequest
211
+ */
212
+ export type RemoveProductRequest = Message<"toshi.workspace.v1.RemoveProductRequest"> & {
213
+ /**
214
+ * id names the outside product.
215
+ *
216
+ * @generated from field: string id = 1;
217
+ */
218
+ id: string;
219
+ };
220
+ /**
221
+ * @generated from message toshi.workspace.v1.RemoveProductRequest
222
+ */
223
+ export type RemoveProductRequestJson = {
224
+ /**
225
+ * id names the outside product.
226
+ *
227
+ * @generated from field: string id = 1;
228
+ */
229
+ id?: string;
230
+ };
231
+ /**
232
+ * Describes the message toshi.workspace.v1.RemoveProductRequest.
233
+ * Use `create(RemoveProductRequestSchema)` to create a new message.
234
+ */
235
+ export declare const RemoveProductRequestSchema: GenMessage<RemoveProductRequest, {
236
+ jsonType: RemoveProductRequestJson;
237
+ }>;
238
+ /**
239
+ * @generated from message toshi.workspace.v1.RemoveProductResponse
240
+ */
241
+ export type RemoveProductResponse = Message<"toshi.workspace.v1.RemoveProductResponse"> & {
242
+ /**
243
+ * product is the product as the workspace has it after the removal.
244
+ *
245
+ * @generated from field: toshi.workspace.v1.ProductSettings product = 1;
246
+ */
247
+ product?: ProductSettings | undefined;
248
+ };
249
+ /**
250
+ * @generated from message toshi.workspace.v1.RemoveProductResponse
251
+ */
252
+ export type RemoveProductResponseJson = {
253
+ /**
254
+ * product is the product as the workspace has it after the removal.
255
+ *
256
+ * @generated from field: toshi.workspace.v1.ProductSettings product = 1;
257
+ */
258
+ product?: ProductSettingsJson;
259
+ };
260
+ /**
261
+ * Describes the message toshi.workspace.v1.RemoveProductResponse.
262
+ * Use `create(RemoveProductResponseSchema)` to create a new message.
263
+ */
264
+ export declare const RemoveProductResponseSchema: GenMessage<RemoveProductResponse, {
265
+ jsonType: RemoveProductResponseJson;
266
+ }>;
267
+ /**
268
+ * ProductSettings is one product as the workspace has it.
269
+ *
270
+ * @generated from message toshi.workspace.v1.ProductSettings
271
+ */
272
+ export type ProductSettings = Message<"toshi.workspace.v1.ProductSettings"> & {
273
+ /**
274
+ * id names the product, such as "runners": its config section, the
275
+ * prefix of its features and its permissions.
276
+ *
277
+ * @generated from field: string id = 1;
278
+ */
279
+ id: string;
280
+ /**
281
+ * switch says whether the product is on for the workspace and, when it
282
+ * is off, which switch turned it off.
283
+ *
284
+ * @generated from field: toshi.workspace.v1.ProductSwitch switch = 2;
285
+ */
286
+ switch: ProductSwitch;
287
+ /**
288
+ * features are the product's features, in the order the product
289
+ * declares them.
290
+ *
291
+ * @generated from field: repeated toshi.workspace.v1.FeatureSetting features = 3;
292
+ */
293
+ features: FeatureSetting[];
294
+ /**
295
+ * state is where the product is in the deployment's lifecycle, as
296
+ * DiscoveryService.Discover reports it: a product the deployment's config
297
+ * turns off is winding down (no new work, draining) until its work ends,
298
+ * then stopped.
299
+ *
300
+ * @generated from field: toshi.workspace.v1.ProductState state = 4;
301
+ */
302
+ state: ProductState;
303
+ /**
304
+ * installation is the workspace's installation of an outside product, a
305
+ * removed one included; unset for a built-in product. Such a product
306
+ * declares no features, and its switch is ON while the installation is
307
+ * active and TURNED_OFF otherwise.
308
+ *
309
+ * @generated from field: toshi.workspace.v1.ProductInstallation installation = 5;
310
+ */
311
+ installation?: ProductInstallation | undefined;
312
+ };
313
+ /**
314
+ * ProductSettings is one product as the workspace has it.
315
+ *
316
+ * @generated from message toshi.workspace.v1.ProductSettings
317
+ */
318
+ export type ProductSettingsJson = {
319
+ /**
320
+ * id names the product, such as "runners": its config section, the
321
+ * prefix of its features and its permissions.
322
+ *
323
+ * @generated from field: string id = 1;
324
+ */
325
+ id?: string;
326
+ /**
327
+ * switch says whether the product is on for the workspace and, when it
328
+ * is off, which switch turned it off.
329
+ *
330
+ * @generated from field: toshi.workspace.v1.ProductSwitch switch = 2;
331
+ */
332
+ switch?: ProductSwitchJson;
333
+ /**
334
+ * features are the product's features, in the order the product
335
+ * declares them.
336
+ *
337
+ * @generated from field: repeated toshi.workspace.v1.FeatureSetting features = 3;
338
+ */
339
+ features?: FeatureSettingJson[];
340
+ /**
341
+ * state is where the product is in the deployment's lifecycle, as
342
+ * DiscoveryService.Discover reports it: a product the deployment's config
343
+ * turns off is winding down (no new work, draining) until its work ends,
344
+ * then stopped.
345
+ *
346
+ * @generated from field: toshi.workspace.v1.ProductState state = 4;
347
+ */
348
+ state?: ProductStateJson;
349
+ /**
350
+ * installation is the workspace's installation of an outside product, a
351
+ * removed one included; unset for a built-in product. Such a product
352
+ * declares no features, and its switch is ON while the installation is
353
+ * active and TURNED_OFF otherwise.
354
+ *
355
+ * @generated from field: toshi.workspace.v1.ProductInstallation installation = 5;
356
+ */
357
+ installation?: ProductInstallationJson;
358
+ };
359
+ /**
360
+ * Describes the message toshi.workspace.v1.ProductSettings.
361
+ * Use `create(ProductSettingsSchema)` to create a new message.
362
+ */
363
+ export declare const ProductSettingsSchema: GenMessage<ProductSettings, {
364
+ jsonType: ProductSettingsJson;
365
+ }>;
366
+ /**
367
+ * ProductInstallation is a workspace's installation of an outside product.
368
+ *
369
+ * @generated from message toshi.workspace.v1.ProductInstallation
370
+ */
371
+ export type ProductInstallation = Message<"toshi.workspace.v1.ProductInstallation"> & {
372
+ /**
373
+ * @generated from field: toshi.workspace.v1.InstallationState state = 1;
374
+ */
375
+ state: InstallationState;
376
+ /**
377
+ * version and publisher are the catalog entry's when it was installed.
378
+ *
379
+ * @generated from field: string version = 2;
380
+ */
381
+ version: string;
382
+ /**
383
+ * @generated from field: string publisher = 3;
384
+ */
385
+ publisher: string;
386
+ /**
387
+ * access are the permissions the workspace granted it, sorted.
388
+ *
389
+ * @generated from field: repeated string access = 4;
390
+ */
391
+ access: string[];
392
+ /**
393
+ * role_id names the role that holds the access, "Product <id>", granted to
394
+ * token_id, the installation's token.
395
+ *
396
+ * @generated from field: string role_id = 5;
397
+ */
398
+ roleId: string;
399
+ /**
400
+ * @generated from field: string token_id = 6;
401
+ */
402
+ tokenId: string;
403
+ /**
404
+ * installed_by names who installed it: "person:" and their GitHub user
405
+ * id, or "token:" and the workspace token's id.
406
+ *
407
+ * @generated from field: string installed_by = 7;
408
+ */
409
+ installedBy: string;
410
+ /**
411
+ * @generated from field: google.protobuf.Timestamp installed_at = 8;
412
+ */
413
+ installedAt?: Timestamp | undefined;
414
+ /**
415
+ * @generated from field: google.protobuf.Timestamp updated_at = 9;
416
+ */
417
+ updatedAt?: Timestamp | undefined;
418
+ };
419
+ /**
420
+ * ProductInstallation is a workspace's installation of an outside product.
421
+ *
422
+ * @generated from message toshi.workspace.v1.ProductInstallation
423
+ */
424
+ export type ProductInstallationJson = {
425
+ /**
426
+ * @generated from field: toshi.workspace.v1.InstallationState state = 1;
427
+ */
428
+ state?: InstallationStateJson;
429
+ /**
430
+ * version and publisher are the catalog entry's when it was installed.
431
+ *
432
+ * @generated from field: string version = 2;
433
+ */
434
+ version?: string;
435
+ /**
436
+ * @generated from field: string publisher = 3;
437
+ */
438
+ publisher?: string;
439
+ /**
440
+ * access are the permissions the workspace granted it, sorted.
441
+ *
442
+ * @generated from field: repeated string access = 4;
443
+ */
444
+ access?: string[];
445
+ /**
446
+ * role_id names the role that holds the access, "Product <id>", granted to
447
+ * token_id, the installation's token.
448
+ *
449
+ * @generated from field: string role_id = 5;
450
+ */
451
+ roleId?: string;
452
+ /**
453
+ * @generated from field: string token_id = 6;
454
+ */
455
+ tokenId?: string;
456
+ /**
457
+ * installed_by names who installed it: "person:" and their GitHub user
458
+ * id, or "token:" and the workspace token's id.
459
+ *
460
+ * @generated from field: string installed_by = 7;
461
+ */
462
+ installedBy?: string;
463
+ /**
464
+ * @generated from field: google.protobuf.Timestamp installed_at = 8;
465
+ */
466
+ installedAt?: TimestampJson;
467
+ /**
468
+ * @generated from field: google.protobuf.Timestamp updated_at = 9;
469
+ */
470
+ updatedAt?: TimestampJson;
471
+ };
472
+ /**
473
+ * Describes the message toshi.workspace.v1.ProductInstallation.
474
+ * Use `create(ProductInstallationSchema)` to create a new message.
475
+ */
476
+ export declare const ProductInstallationSchema: GenMessage<ProductInstallation, {
477
+ jsonType: ProductInstallationJson;
478
+ }>;
479
+ /**
480
+ * FeatureSetting is one feature of a product as the workspace has it.
481
+ *
482
+ * @generated from message toshi.workspace.v1.FeatureSetting
483
+ */
484
+ export type FeatureSetting = Message<"toshi.workspace.v1.FeatureSetting"> & {
485
+ /**
486
+ * key is "<product id>.<name>".
487
+ *
488
+ * @generated from field: string key = 1;
489
+ */
490
+ key: string;
491
+ /**
492
+ * narrowable reports whether the workspace's settings may narrow the
493
+ * feature. UpdateProduct refuses a setting of a feature that is not.
494
+ *
495
+ * @generated from field: bool narrowable = 2;
496
+ */
497
+ narrowable: boolean;
498
+ /**
499
+ * entitlement is the most the workspace may choose: the operator's
500
+ * override for the workspace, else its plan's value, else the feature's
501
+ * default.
502
+ *
503
+ * @generated from field: toshi.workspace.v1.FeatureValue entitlement = 3;
504
+ */
505
+ entitlement?: FeatureValue | undefined;
506
+ /**
507
+ * setting is the workspace's own choice; unset when it has none. A
508
+ * setting its entitlement no longer contains, after the plan or an
509
+ * override lowered it, is kept and not applied.
510
+ *
511
+ * @generated from field: toshi.workspace.v1.FeatureValue setting = 4;
512
+ */
513
+ setting?: FeatureValue | undefined;
514
+ /**
515
+ * effective is the value the product uses while it is on: the setting
516
+ * when the entitlement contains it, else the entitlement.
517
+ *
518
+ * @generated from field: toshi.workspace.v1.FeatureValue effective = 5;
519
+ */
520
+ effective?: FeatureValue | undefined;
521
+ /**
522
+ * changed_by names who made the setting, as the audit log names an
523
+ * actor, and changed_at when; both unset when the workspace has no
524
+ * setting.
525
+ *
526
+ * @generated from field: string changed_by = 6;
527
+ */
528
+ changedBy: string;
529
+ /**
530
+ * @generated from field: google.protobuf.Timestamp changed_at = 7;
531
+ */
532
+ changedAt?: Timestamp | undefined;
533
+ };
534
+ /**
535
+ * FeatureSetting is one feature of a product as the workspace has it.
536
+ *
537
+ * @generated from message toshi.workspace.v1.FeatureSetting
538
+ */
539
+ export type FeatureSettingJson = {
540
+ /**
541
+ * key is "<product id>.<name>".
542
+ *
543
+ * @generated from field: string key = 1;
544
+ */
545
+ key?: string;
546
+ /**
547
+ * narrowable reports whether the workspace's settings may narrow the
548
+ * feature. UpdateProduct refuses a setting of a feature that is not.
549
+ *
550
+ * @generated from field: bool narrowable = 2;
551
+ */
552
+ narrowable?: boolean;
553
+ /**
554
+ * entitlement is the most the workspace may choose: the operator's
555
+ * override for the workspace, else its plan's value, else the feature's
556
+ * default.
557
+ *
558
+ * @generated from field: toshi.workspace.v1.FeatureValue entitlement = 3;
559
+ */
560
+ entitlement?: FeatureValueJson;
561
+ /**
562
+ * setting is the workspace's own choice; unset when it has none. A
563
+ * setting its entitlement no longer contains, after the plan or an
564
+ * override lowered it, is kept and not applied.
565
+ *
566
+ * @generated from field: toshi.workspace.v1.FeatureValue setting = 4;
567
+ */
568
+ setting?: FeatureValueJson;
569
+ /**
570
+ * effective is the value the product uses while it is on: the setting
571
+ * when the entitlement contains it, else the entitlement.
572
+ *
573
+ * @generated from field: toshi.workspace.v1.FeatureValue effective = 5;
574
+ */
575
+ effective?: FeatureValueJson;
576
+ /**
577
+ * changed_by names who made the setting, as the audit log names an
578
+ * actor, and changed_at when; both unset when the workspace has no
579
+ * setting.
580
+ *
581
+ * @generated from field: string changed_by = 6;
582
+ */
583
+ changedBy?: string;
584
+ /**
585
+ * @generated from field: google.protobuf.Timestamp changed_at = 7;
586
+ */
587
+ changedAt?: TimestampJson;
588
+ };
589
+ /**
590
+ * Describes the message toshi.workspace.v1.FeatureSetting.
591
+ * Use `create(FeatureSettingSchema)` to create a new message.
592
+ */
593
+ export declare const FeatureSettingSchema: GenMessage<FeatureSetting, {
594
+ jsonType: FeatureSettingJson;
595
+ }>;
596
+ /**
597
+ * InstallationState is where an installation stands.
598
+ *
599
+ * @generated from enum toshi.workspace.v1.InstallationState
600
+ */
601
+ export declare enum InstallationState {
602
+ /**
603
+ * @generated from enum value: INSTALLATION_STATE_UNSPECIFIED = 0;
604
+ */
605
+ UNSPECIFIED = 0,
606
+ /**
607
+ * The product is on and its token works.
608
+ *
609
+ * @generated from enum value: INSTALLATION_STATE_ACTIVE = 1;
610
+ */
611
+ ACTIVE = 1,
612
+ /**
613
+ * The product is turned off: its token is refused and its webhook
614
+ * endpoints are paused until it is turned on again.
615
+ *
616
+ * @generated from enum value: INSTALLATION_STATE_SUSPENDED = 2;
617
+ */
618
+ SUSPENDED = 2,
619
+ /**
620
+ * Its token is revoked and its role deleted; turning it on installs it
621
+ * again.
622
+ *
623
+ * @generated from enum value: INSTALLATION_STATE_REMOVED = 3;
624
+ */
625
+ REMOVED = 3
626
+ }
627
+ /**
628
+ * InstallationState is where an installation stands.
629
+ *
630
+ * @generated from enum toshi.workspace.v1.InstallationState
631
+ */
632
+ export type InstallationStateJson = "INSTALLATION_STATE_UNSPECIFIED" | "INSTALLATION_STATE_ACTIVE" | "INSTALLATION_STATE_SUSPENDED" | "INSTALLATION_STATE_REMOVED";
633
+ /**
634
+ * Describes the enum toshi.workspace.v1.InstallationState.
635
+ */
636
+ export declare const InstallationStateSchema: GenEnum<InstallationState, InstallationStateJson>;
637
+ /**
638
+ * ProductService reads and changes the workspace's settings of its
639
+ * products. A product, such as Runners, declares features: typed keys such
640
+ * as "runners.enabled", the product's own switch, or a limit such as
641
+ * "previews.max_count". The workspace's entitlement to each feature comes
642
+ * from its plan and the operator's overrides, and it cannot change it. Its
643
+ * settings are its own choices within the entitlement: they only narrow it,
644
+ * turning a product or a feature off or setting a lower limit.
645
+ *
646
+ * The caller's credential names the workspace, as for WorkloadService.
647
+ *
648
+ * @generated from service toshi.workspace.v1.ProductService
649
+ */
650
+ export declare const ProductService: GenService<{
651
+ /**
652
+ * ListProducts returns the products the deployment includes, by id, each
653
+ * with its switch and its features: the entitlement, the workspace's
654
+ * setting if it has one, the effective value, and who changed the
655
+ * setting last and when; then the outside products the workspace has
656
+ * installed, by id, each with its installation.
657
+ *
658
+ * @generated from rpc toshi.workspace.v1.ProductService.ListProducts
659
+ */
660
+ listProducts: {
661
+ methodKind: "unary";
662
+ input: typeof ListProductsRequestSchema;
663
+ output: typeof ListProductsResponseSchema;
664
+ };
665
+ /**
666
+ * UpdateProduct changes the workspace's settings of one product in one
667
+ * call: it turns the product on or off, and sets or clears its features.
668
+ * The caller and the time of the call are recorded with each setting it
669
+ * sets. A setting only narrows the workspace's entitlement: a value wider
670
+ * than the entitlement, a key the product does not declare or that the
671
+ * workspace cannot narrow, or a value of another type than the key's is
672
+ * INVALID_ARGUMENT naming the key, and nothing is changed. A product the
673
+ * deployment does not include, built in or offered by a catalog source,
674
+ * is NOT_FOUND.
675
+ *
676
+ * An outside product, one a catalog source offers, has no settings but
677
+ * enabled: turning it on installs it (accepted_access) or resumes its
678
+ * installation, and turning it off suspends it.
679
+ *
680
+ * The product's calls follow the change from the next call on.
681
+ *
682
+ * @generated from rpc toshi.workspace.v1.ProductService.UpdateProduct
683
+ */
684
+ updateProduct: {
685
+ methodKind: "unary";
686
+ input: typeof UpdateProductRequestSchema;
687
+ output: typeof UpdateProductResponseSchema;
688
+ };
689
+ /**
690
+ * RemoveProduct removes the workspace's installation of an outside
691
+ * product: it revokes the installation's token, deletes the role that
692
+ * held its access and stops its webhook endpoints. The data the product
693
+ * stored in the workspace stays. A product that is not installed, or not
694
+ * an outside product, is NOT_FOUND.
695
+ *
696
+ * @generated from rpc toshi.workspace.v1.ProductService.RemoveProduct
697
+ */
698
+ removeProduct: {
699
+ methodKind: "unary";
700
+ input: typeof RemoveProductRequestSchema;
701
+ output: typeof RemoveProductResponseSchema;
702
+ };
703
+ }>;