@toshicloud/sdk 0.5.1 → 0.7.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 (48) hide show
  1. package/README.md +39 -455
  2. package/dist/client.d.ts +76 -6
  3. package/dist/client.js +20 -4
  4. package/dist/gen/toshi/permission_pb.d.ts +12 -0
  5. package/dist/gen/toshi/permission_pb.js +14 -2
  6. package/dist/gen/toshi/workspace/v1/connections_pb.d.ts +358 -29
  7. package/dist/gen/toshi/workspace/v1/connections_pb.js +112 -24
  8. package/dist/gen/toshi/workspace/v1/domains_pb.d.ts +26 -26
  9. package/dist/gen/toshi/workspace/v1/domains_pb.js +4 -4
  10. package/dist/gen/toshi/workspace/v1/{channels_pb.d.ts → endpoints_pb.d.ts} +945 -822
  11. package/dist/gen/toshi/workspace/v1/endpoints_pb.js +488 -0
  12. package/dist/gen/toshi/workspace/v1/grants_pb.d.ts +10 -10
  13. package/dist/gen/toshi/workspace/v1/grants_pb.js +3 -3
  14. package/dist/gen/toshi/workspace/v1/hostjobs_pb.d.ts +62 -24
  15. package/dist/gen/toshi/workspace/v1/hostjobs_pb.js +1 -1
  16. package/dist/gen/toshi/workspace/v1/hosts_pb.d.ts +110 -36
  17. package/dist/gen/toshi/workspace/v1/hosts_pb.js +1 -1
  18. package/dist/gen/toshi/workspace/v1/model_credentials_pb.d.ts +654 -0
  19. package/dist/gen/toshi/workspace/v1/model_credentials_pb.js +110 -0
  20. package/dist/gen/toshi/workspace/v1/recordings_pb.d.ts +21 -2
  21. package/dist/gen/toshi/workspace/v1/recordings_pb.js +1 -1
  22. package/dist/gen/toshi/workspace/v1/roles_pb.d.ts +1 -1
  23. package/dist/gen/toshi/workspace/v1/roles_pb.js +1 -1
  24. package/dist/gen/toshi/workspace/v1/secrets_pb.d.ts +19 -2
  25. package/dist/gen/toshi/workspace/v1/secrets_pb.js +1 -1
  26. package/dist/gen/toshi/workspace/v1/triggers_pb.d.ts +28 -28
  27. package/dist/gen/toshi/workspace/v1/triggers_pb.js +6 -6
  28. package/dist/gen/toshi/workspace/v1/webhook_pb.d.ts +202 -202
  29. package/dist/gen/toshi/workspace/v1/webhook_pb.js +46 -46
  30. package/dist/gen/toshi/workspace/v1/workloads_pb.d.ts +579 -30
  31. package/dist/gen/toshi/workspace/v1/workloads_pb.js +85 -55
  32. package/dist/gen/toshi/workspace/v1/workspace_pb.d.ts +991 -123
  33. package/dist/gen/toshi/workspace/v1/workspace_pb.js +294 -102
  34. package/dist/gen/toshi/workspace/v1/workspace_service_pb.d.ts +390 -8
  35. package/dist/gen/toshi/workspace/v1/workspace_service_pb.js +75 -50
  36. package/dist/index.d.ts +2 -1
  37. package/dist/index.js +2 -1
  38. package/dist/retry.js +38 -22
  39. package/dist/test/alarms.d.ts +29 -0
  40. package/dist/test/alarms.js +144 -0
  41. package/dist/test/fake.js +31 -0
  42. package/dist/test/index.d.ts +12 -2
  43. package/dist/test/index.js +12 -2
  44. package/dist/test/procedures.js +40 -34
  45. package/dist/version.d.ts +1 -1
  46. package/dist/version.js +1 -1
  47. package/package.json +1 -1
  48. package/dist/gen/toshi/workspace/v1/channels_pb.js +0 -483
package/dist/client.js CHANGED
@@ -4,7 +4,7 @@ import { executeCommand } from "./execute.js";
4
4
  import { AccountService } from "./gen/toshi/workspace/v1/account_pb.js";
5
5
  import { ArtifactService, ArtifactUploadService } from "./gen/toshi/workspace/v1/artifacts_pb.js";
6
6
  import { AuditEventService } from "./gen/toshi/workspace/v1/audit_events_pb.js";
7
- import { ChannelService } from "./gen/toshi/workspace/v1/channels_pb.js";
7
+ import { EndpointService } from "./gen/toshi/workspace/v1/endpoints_pb.js";
8
8
  import { ConnectionService } from "./gen/toshi/workspace/v1/connections_pb.js";
9
9
  import { DiscoveryService } from "./gen/toshi/workspace/v1/discovery_pb.js";
10
10
  import { DisplayService } from "./gen/toshi/workspace/v1/display_pb.js";
@@ -14,6 +14,7 @@ import { GrantService } from "./gen/toshi/workspace/v1/grants_pb.js";
14
14
  import { ImageService } from "./gen/toshi/workspace/v1/images_pb.js";
15
15
  import { HostJobService } from "./gen/toshi/workspace/v1/hostjobs_pb.js";
16
16
  import { HostService } from "./gen/toshi/workspace/v1/hosts_pb.js";
17
+ import { ModelCredentialService } from "./gen/toshi/workspace/v1/model_credentials_pb.js";
17
18
  import { ProductService } from "./gen/toshi/workspace/v1/products_pb.js";
18
19
  import { ProjectService } from "./gen/toshi/workspace/v1/projects_pb.js";
19
20
  import { RecordingService } from "./gen/toshi/workspace/v1/recordings_pb.js";
@@ -26,8 +27,8 @@ import { VolumeService } from "./gen/toshi/workspace/v1/volumes_pb.js";
26
27
  import { WebhookService } from "./gen/toshi/workspace/v1/webhook_pb.js";
27
28
  import { WorkspaceService } from "./gen/toshi/workspace/v1/workspace_service_pb.js";
28
29
  import { CreatePreviewShareLinkRequestSchema, ListPreviewShareLinksRequestSchema, RevokePreviewShareLinkRequestSchema, StartSandboxRequestSchema, StopSandboxRequestSchema, } from "./gen/toshi/workspace/v1/workspace_pb.js";
29
- import { CancelJobRequestSchema, CreateJobRequestSchema, CreateSandboxRequestSchema, CreateServiceRequestSchema, DeleteJobRequestSchema, DeleteSandboxRequestSchema, DeleteServiceRequestSchema, GetJobRequestSchema, GetSandboxRequestSchema, GetServiceRequestSchema, ListJobsRequestSchema, ListSandboxesRequestSchema, ListServicesRequestSchema, UpdateJobRequestSchema, UpdateSandboxRequestSchema, UpdateServiceRequestSchema, WaitJobRequestSchema, WaitSandboxRequestSchema, WaitServiceRequestSchema, WatchJobsRequestSchema, WatchSandboxesRequestSchema, WatchServicesRequestSchema, WorkloadService, } from "./gen/toshi/workspace/v1/workloads_pb.js";
30
- import { ExecuteStartSchema, GetOperationRequestSchema, GetServiceRevisionRequestSchema, HoldServiceRequestSchema, ListEventsRequestSchema, ListServiceActivationsRequestSchema, ListServiceRevisionsRequestSchema, ListServiceRunsRequestSchema, ReleaseServiceRequestSchema, RollbackServiceRequestSchema, SetServiceModeRequestSchema, StartServiceRequestSchema, StopServiceRequestSchema, WaitOperationRequestSchema, WakeServiceRequestSchema, WatchEventsRequestSchema, WatchOutputRequestSchema, } from "./gen/toshi/workspace/v1/workspace_pb.js";
30
+ import { CancelJobRequestSchema, CreateJobRequestSchema, CreateSandboxRequestSchema, CreateServiceRequestSchema, DeleteJobRequestSchema, DeleteSandboxRequestSchema, DeleteServiceAlarmRequestSchema, DeleteServiceRequestSchema, EmitWorkloadEventRequestSchema, GetJobRequestSchema, GetSandboxRequestSchema, GetServiceAlarmRequestSchema, GetServiceRequestSchema, ListJobsRequestSchema, ListSandboxesRequestSchema, ListServiceAlarmsRequestSchema, ListServicesRequestSchema, PauseServiceAlarmRequestSchema, ResumeServiceAlarmRequestSchema, RunServiceAlarmNowRequestSchema, SetServiceAlarmRequestSchema, UpdateJobRequestSchema, UpdateSandboxRequestSchema, UpdateServiceRequestSchema, WaitJobRequestSchema, WaitSandboxRequestSchema, WaitServiceRequestSchema, WatchJobsRequestSchema, WatchSandboxesRequestSchema, WatchServicesRequestSchema, WorkloadService, } from "./gen/toshi/workspace/v1/workloads_pb.js";
31
+ import { AnswerServiceSignInRequestSchema, CancelServiceSignInRequestSchema, ExecuteStartSchema, GetOperationRequestSchema, GetServiceRevisionRequestSchema, GetServiceSignInStatusRequestSchema, HoldServiceRequestSchema, HoldWorkloadRequestSchema, ListEventsRequestSchema, ListServiceActivationsRequestSchema, ListServiceRevisionsRequestSchema, ListServiceRunsRequestSchema, ReleaseServiceRequestSchema, ReleaseWorkloadRequestSchema, RollbackServiceRequestSchema, SetServiceModeRequestSchema, StartServiceRequestSchema, StartServiceSignInRequestSchema, StopServiceRequestSchema, WaitOperationRequestSchema, WakeServiceRequestSchema, WatchEventsRequestSchema, WatchOutputRequestSchema, } from "./gen/toshi/workspace/v1/workspace_pb.js";
31
32
  import { openOutputWatch } from "./output.js";
32
33
  import { paginate } from "./paginate.js";
33
34
  import { authInterceptor, keyInterceptor, refusalInterceptor, retryInterceptor, scopeInterceptor, } from "./interceptors.js";
@@ -62,7 +63,7 @@ export function createToshiClient(options) {
62
63
  secret: createClient(SecretService, transport),
63
64
  webhook: createClient(WebhookService, transport),
64
65
  display: createClient(DisplayService, transport),
65
- channel: createClient(ChannelService, transport),
66
+ endpoint: createClient(EndpointService, transport),
66
67
  recording: createClient(RecordingService, transport),
67
68
  volume: createClient(VolumeService, transport),
68
69
  artifact: createClient(ArtifactService, transport),
@@ -118,11 +119,25 @@ export function createToshiClient(options) {
118
119
  getRevision: (req, opts) => workloadService.getServiceRevision(req, opts),
119
120
  rollback: (req, opts) => workloadService.rollbackService(req, opts),
120
121
  listActivations: (req, opts) => workloadService.listServiceActivations(req, opts),
122
+ setAlarm: (req, opts) => workloadService.setServiceAlarm(req, opts),
123
+ getAlarm: (req, opts) => workloadService.getServiceAlarm(req, opts),
124
+ listAlarms: (req, opts) => workloadService.listServiceAlarms(req, opts),
125
+ deleteAlarm: (req, opts) => workloadService.deleteServiceAlarm(req, opts),
126
+ pauseAlarm: (req, opts) => workloadService.pauseServiceAlarm(req, opts),
127
+ resumeAlarm: (req, opts) => workloadService.resumeServiceAlarm(req, opts),
128
+ runAlarmNow: (req, opts) => workloadService.runServiceAlarmNow(req, opts),
129
+ startSignIn: (req, opts) => workloadService.startServiceSignIn(req, opts),
130
+ answerSignIn: (req, opts) => workloadService.answerServiceSignIn(req, opts),
131
+ cancelSignIn: (req, opts) => workloadService.cancelServiceSignIn(req, opts),
132
+ getSignInStatus: (req, opts) => workloadService.getServiceSignInStatus(req, opts),
121
133
  },
122
134
  waitOperation: (req, opts) => waitOperation(workloadService, create(WaitOperationRequestSchema, req), opts),
123
135
  listEvents: (req, opts) => workloadService.listEvents(req, opts),
124
136
  allEvents: (req, opts) => paginate(req, workloadService.listEvents, (resp) => resp.events, opts),
125
137
  watchEvents: (req, opts) => openEventWatch(workloadService, retry, create(WatchEventsRequestSchema, req), opts),
138
+ emitEvent: (req, opts) => workloadService.emitWorkloadEvent(req, opts),
139
+ holdWorkload: (req, opts) => workloadService.holdWorkload(req, opts),
140
+ releaseWorkload: (req, opts) => workloadService.releaseWorkload(req, opts),
126
141
  getOperation: (req, opts) => workloadService.getOperation(req, opts),
127
142
  },
128
143
  run: (req, opts) => runJob(workloadService, retry, create(CreateJobRequestSchema, req), opts),
@@ -142,5 +157,6 @@ export function createToshiClient(options) {
142
157
  account: createClient(AccountService, transport),
143
158
  image: createClient(ImageService, transport),
144
159
  domain: createClient(DomainService, transport),
160
+ modelCredential: createClient(ModelCredentialService, transport),
145
161
  };
146
162
  }
@@ -232,6 +232,18 @@ export declare const by_field: GenExtension<MethodOptions, boolean>;
232
232
  * @generated from extension: toshi.MCP mcp = 51005;
233
233
  */
234
234
  export declare const mcp: GenExtension<MethodOptions, MCP>;
235
+ /**
236
+ * own marks a call a member may make for what is their own with
237
+ * membership alone. A caller who holds a role in the workspace but not the
238
+ * method's permission is admitted for their own resources only: the
239
+ * handler refuses any other resource, as the permission check would, with
240
+ * PERMISSION_MISSING, and a list holds only the caller's own. A caller
241
+ * with the permission is admitted as usual. A call that acts for no
242
+ * person needs the permission.
243
+ *
244
+ * @generated from extension: bool own = 51006;
245
+ */
246
+ export declare const own: GenExtension<MethodOptions, boolean>;
235
247
  /**
236
248
  * field_permission names what a caller needs to change the field through
237
249
  * the mask of an update call marked by_field: a field group of its own,
@@ -6,7 +6,7 @@ import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt";
6
6
  /**
7
7
  * Describes the file toshi/permission.proto.
8
8
  */
9
- export const file_toshi_permission = /*@__PURE__*/ fileDesc("ChZ0b3NoaS9wZXJtaXNzaW9uLnByb3RvEgV0b3NoaSInCgVBdWRpdBIOCgZhY3Rpb24YASABKAkSDgoGdGFyZ2V0GAIgASgJIrYBCgNNQ1ASFgoJcmVhZF9vbmx5GAEgASgISACIAQESGAoLZGVzdHJ1Y3RpdmUYAiABKAhIAYgBARIXCgppZGVtcG90ZW50GAMgASgISAKIAQESFwoKb3Blbl93b3JsZBgEIAEoCEgDiAEBEg8KB2V4Y2x1ZGUYBSABKAhCDAoKX3JlYWRfb25seUIOCgxfZGVzdHJ1Y3RpdmVCDQoLX2lkZW1wb3RlbnRCDQoLX29wZW5fd29ybGQ6QAoKcGVybWlzc2lvbhIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLiOAyABKAlSCnBlcm1pc3Npb246NgoFc2NvcGUSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxi5jgMgASgJUgVzY29wZTpECgVhdWRpdBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLqOAyABKAsyDC50b3NoaS5BdWRpdFIFYXVkaXQ6OwoIYnlfZmllbGQSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxi8jgMgASgIUgdieUZpZWxkOj4KA21jcBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGL2OAyABKAsyCi50b3NoaS5NQ1BSA21jcDpKChBmaWVsZF9wZXJtaXNzaW9uEh0uZ29vZ2xlLnByb3RvYnVmLkZpZWxkT3B0aW9ucxi7jgMgASgJUg9maWVsZFBlcm1pc3Npb25CHlocZ28udG9zaGljbG91ZC5pby9hcGkvdG9zaGlwYmIGcHJvdG8z", [file_google_protobuf_descriptor]);
9
+ export const file_toshi_permission = /*@__PURE__*/ fileDesc("ChZ0b3NoaS9wZXJtaXNzaW9uLnByb3RvEgV0b3NoaSInCgVBdWRpdBIOCgZhY3Rpb24YASABKAkSDgoGdGFyZ2V0GAIgASgJIrYBCgNNQ1ASFgoJcmVhZF9vbmx5GAEgASgISACIAQESGAoLZGVzdHJ1Y3RpdmUYAiABKAhIAYgBARIXCgppZGVtcG90ZW50GAMgASgISAKIAQESFwoKb3Blbl93b3JsZBgEIAEoCEgDiAEBEg8KB2V4Y2x1ZGUYBSABKAhCDAoKX3JlYWRfb25seUIOCgxfZGVzdHJ1Y3RpdmVCDQoLX2lkZW1wb3RlbnRCDQoLX29wZW5fd29ybGQ6QAoKcGVybWlzc2lvbhIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLiOAyABKAlSCnBlcm1pc3Npb246NgoFc2NvcGUSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxi5jgMgASgJUgVzY29wZTpECgVhdWRpdBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLqOAyABKAsyDC50b3NoaS5BdWRpdFIFYXVkaXQ6OwoIYnlfZmllbGQSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxi8jgMgASgIUgdieUZpZWxkOj4KA21jcBIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGL2OAyABKAsyCi50b3NoaS5NQ1BSA21jcDoyCgNvd24SHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxi+jgMgASgIUgNvd246SgoQZmllbGRfcGVybWlzc2lvbhIdLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE9wdGlvbnMYu44DIAEoCVIPZmllbGRQZXJtaXNzaW9uQh5aHGdvLnRvc2hpY2xvdWQuaW8vYXBpL3Rvc2hpcGJiBnByb3RvMw", [file_google_protobuf_descriptor]);
10
10
  /**
11
11
  * Describes the message toshi.Audit.
12
12
  * Use `create(AuditSchema)` to create a new message.
@@ -82,6 +82,18 @@ export const by_field = /*@__PURE__*/ extDesc(file_toshi_permission, 3);
82
82
  * @generated from extension: toshi.MCP mcp = 51005;
83
83
  */
84
84
  export const mcp = /*@__PURE__*/ extDesc(file_toshi_permission, 4);
85
+ /**
86
+ * own marks a call a member may make for what is their own with
87
+ * membership alone. A caller who holds a role in the workspace but not the
88
+ * method's permission is admitted for their own resources only: the
89
+ * handler refuses any other resource, as the permission check would, with
90
+ * PERMISSION_MISSING, and a list holds only the caller's own. A caller
91
+ * with the permission is admitted as usual. A call that acts for no
92
+ * person needs the permission.
93
+ *
94
+ * @generated from extension: bool own = 51006;
95
+ */
96
+ export const own = /*@__PURE__*/ extDesc(file_toshi_permission, 5);
85
97
  /**
86
98
  * field_permission names what a caller needs to change the field through
87
99
  * the mask of an update call marked by_field: a field group of its own,
@@ -91,4 +103,4 @@ export const mcp = /*@__PURE__*/ extDesc(file_toshi_permission, 4);
91
103
  *
92
104
  * @generated from extension: string field_permission = 51003;
93
105
  */
94
- export const field_permission = /*@__PURE__*/ extDesc(file_toshi_permission, 5);
106
+ export const field_permission = /*@__PURE__*/ extDesc(file_toshi_permission, 6);
@@ -1,5 +1,6 @@
1
1
  import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
2
2
  import type { Duration, DurationJson, FieldMask, FieldMaskJson, Timestamp, TimestampJson } from "@bufbuild/protobuf/wkt";
3
+ import type { DomainRecord, DomainRecordJson } from "./domains_pb.js";
3
4
  import type { Message } from "@bufbuild/protobuf";
4
5
  /**
5
6
  * Describes the file toshi/workspace/v1/connections.proto.
@@ -20,15 +21,15 @@ export type Connection = Message<"toshi.workspace.v1.Connection"> & {
20
21
  */
21
22
  kind: ConnectionKind;
22
23
  /**
23
- * Unique among the workspace's WEBHOOK connections; for GITHUB, the
24
- * login of the account the App is installed on.
24
+ * Unique among the workspace's live connections of its kind, WEBHOOK or
25
+ * MAIL; for GITHUB, the login of the account the App is installed on.
25
26
  *
26
27
  * @generated from field: string name = 3;
27
28
  */
28
29
  name: string;
29
30
  /**
30
- * The project and environment a WEBHOOK connection's events belong to;
31
- * empty for GITHUB, whose events belong to their repository's project.
31
+ * The project and environment a WEBHOOK or MAIL connection's events belong
32
+ * to; empty for GITHUB, whose events belong to their repository's project.
32
33
  *
33
34
  * @generated from field: string project = 4;
34
35
  */
@@ -64,8 +65,8 @@ export type Connection = Message<"toshi.workspace.v1.Connection"> & {
64
65
  /**
65
66
  * The inbound address a WEBHOOK connection's sender POSTs to: the
66
67
  * deployment's public address and /ingress/ with the connection's
67
- * address token. Empty for GITHUB, and when the deployment names no
68
- * public address.
68
+ * address token. Empty for GITHUB and MAIL, and when the deployment names
69
+ * no public address.
69
70
  *
70
71
  * @generated from field: string ingress_url = 11;
71
72
  */
@@ -100,6 +101,13 @@ export type Connection = Message<"toshi.workspace.v1.Connection"> & {
100
101
  * @generated from field: string manifest_origin = 15;
101
102
  */
102
103
  manifestOrigin: string;
104
+ /**
105
+ * Where a MAIL connection receives mail and where it sends it; unset for
106
+ * the other kinds.
107
+ *
108
+ * @generated from field: toshi.workspace.v1.MailConnection mail = 16;
109
+ */
110
+ mail?: MailConnection | undefined;
103
111
  };
104
112
  /**
105
113
  * Connection is one source of a workspace's events.
@@ -116,15 +124,15 @@ export type ConnectionJson = {
116
124
  */
117
125
  kind?: ConnectionKindJson;
118
126
  /**
119
- * Unique among the workspace's WEBHOOK connections; for GITHUB, the
120
- * login of the account the App is installed on.
127
+ * Unique among the workspace's live connections of its kind, WEBHOOK or
128
+ * MAIL; for GITHUB, the login of the account the App is installed on.
121
129
  *
122
130
  * @generated from field: string name = 3;
123
131
  */
124
132
  name?: string;
125
133
  /**
126
- * The project and environment a WEBHOOK connection's events belong to;
127
- * empty for GITHUB, whose events belong to their repository's project.
134
+ * The project and environment a WEBHOOK or MAIL connection's events belong
135
+ * to; empty for GITHUB, whose events belong to their repository's project.
128
136
  *
129
137
  * @generated from field: string project = 4;
130
138
  */
@@ -160,8 +168,8 @@ export type ConnectionJson = {
160
168
  /**
161
169
  * The inbound address a WEBHOOK connection's sender POSTs to: the
162
170
  * deployment's public address and /ingress/ with the connection's
163
- * address token. Empty for GITHUB, and when the deployment names no
164
- * public address.
171
+ * address token. Empty for GITHUB and MAIL, and when the deployment names
172
+ * no public address.
165
173
  *
166
174
  * @generated from field: string ingress_url = 11;
167
175
  */
@@ -196,6 +204,13 @@ export type ConnectionJson = {
196
204
  * @generated from field: string manifest_origin = 15;
197
205
  */
198
206
  manifestOrigin?: string;
207
+ /**
208
+ * Where a MAIL connection receives mail and where it sends it; unset for
209
+ * the other kinds.
210
+ *
211
+ * @generated from field: toshi.workspace.v1.MailConnection mail = 16;
212
+ */
213
+ mail?: MailConnectionJson;
199
214
  };
200
215
  /**
201
216
  * Describes the message toshi.workspace.v1.Connection.
@@ -204,6 +219,200 @@ export type ConnectionJson = {
204
219
  export declare const ConnectionSchema: GenMessage<Connection, {
205
220
  jsonType: ConnectionJson;
206
221
  }>;
222
+ /**
223
+ * MailConnection is where a MAIL connection receives mail and where it
224
+ * sends it.
225
+ *
226
+ * @generated from message toshi.workspace.v1.MailConnection
227
+ */
228
+ export type MailConnection = Message<"toshi.workspace.v1.MailConnection"> & {
229
+ /**
230
+ * Output only. The lowercase address mail is received at: the connection's
231
+ * name at its custom domain, or at the workspace's name under the
232
+ * deployment's inbound mail domain when no custom domain is set.
233
+ *
234
+ * @generated from field: string address = 1;
235
+ */
236
+ address: string;
237
+ /**
238
+ * The service, by its ID, whose event endpoint the mail goes to.
239
+ *
240
+ * @generated from field: string service = 2;
241
+ */
242
+ service: string;
243
+ /**
244
+ * The name of that service's event endpoint.
245
+ *
246
+ * @generated from field: string endpoint = 3;
247
+ */
248
+ endpoint: string;
249
+ /**
250
+ * Output only. The mail provider that receives for the address, such as
251
+ * "ses".
252
+ *
253
+ * @generated from field: string provider = 4;
254
+ */
255
+ provider: string;
256
+ /**
257
+ * A custom mail domain, lowercase in ASCII. Empty uses the deployment's
258
+ * inbound mail domain.
259
+ *
260
+ * @generated from field: string domain = 5;
261
+ */
262
+ domain: string;
263
+ /**
264
+ * Output only. The custom domain's checks and required DNS records; unset
265
+ * when the connection uses the deployment's inbound mail domain.
266
+ *
267
+ * @generated from field: toshi.workspace.v1.MailDomainStatus domain_status = 6;
268
+ */
269
+ domainStatus?: MailDomainStatus | undefined;
270
+ };
271
+ /**
272
+ * MailConnection is where a MAIL connection receives mail and where it
273
+ * sends it.
274
+ *
275
+ * @generated from message toshi.workspace.v1.MailConnection
276
+ */
277
+ export type MailConnectionJson = {
278
+ /**
279
+ * Output only. The lowercase address mail is received at: the connection's
280
+ * name at its custom domain, or at the workspace's name under the
281
+ * deployment's inbound mail domain when no custom domain is set.
282
+ *
283
+ * @generated from field: string address = 1;
284
+ */
285
+ address?: string;
286
+ /**
287
+ * The service, by its ID, whose event endpoint the mail goes to.
288
+ *
289
+ * @generated from field: string service = 2;
290
+ */
291
+ service?: string;
292
+ /**
293
+ * The name of that service's event endpoint.
294
+ *
295
+ * @generated from field: string endpoint = 3;
296
+ */
297
+ endpoint?: string;
298
+ /**
299
+ * Output only. The mail provider that receives for the address, such as
300
+ * "ses".
301
+ *
302
+ * @generated from field: string provider = 4;
303
+ */
304
+ provider?: string;
305
+ /**
306
+ * A custom mail domain, lowercase in ASCII. Empty uses the deployment's
307
+ * inbound mail domain.
308
+ *
309
+ * @generated from field: string domain = 5;
310
+ */
311
+ domain?: string;
312
+ /**
313
+ * Output only. The custom domain's checks and required DNS records; unset
314
+ * when the connection uses the deployment's inbound mail domain.
315
+ *
316
+ * @generated from field: toshi.workspace.v1.MailDomainStatus domain_status = 6;
317
+ */
318
+ domainStatus?: MailDomainStatusJson;
319
+ };
320
+ /**
321
+ * Describes the message toshi.workspace.v1.MailConnection.
322
+ * Use `create(MailConnectionSchema)` to create a new message.
323
+ */
324
+ export declare const MailConnectionSchema: GenMessage<MailConnection, {
325
+ jsonType: MailConnectionJson;
326
+ }>;
327
+ /**
328
+ * MailDomainStatus describes the checks and DNS records of a custom domain.
329
+ *
330
+ * @generated from message toshi.workspace.v1.MailDomainStatus
331
+ */
332
+ export type MailDomainStatus = Message<"toshi.workspace.v1.MailDomainStatus"> & {
333
+ /**
334
+ * @generated from field: toshi.workspace.v1.MailDomainState state = 1;
335
+ */
336
+ state: MailDomainState;
337
+ /**
338
+ * @generated from field: toshi.workspace.v1.MailDomainCheck ownership = 2;
339
+ */
340
+ ownership: MailDomainCheck;
341
+ /**
342
+ * @generated from field: toshi.workspace.v1.MailDomainCheck mx = 3;
343
+ */
344
+ mx: MailDomainCheck;
345
+ /**
346
+ * @generated from field: toshi.workspace.v1.MailDomainCheck provider = 4;
347
+ */
348
+ provider: MailDomainCheck;
349
+ /**
350
+ * The ownership TXT, inbound MX and provider records, in that order.
351
+ *
352
+ * @generated from field: repeated toshi.workspace.v1.DomainRecord records = 5;
353
+ */
354
+ records: DomainRecord[];
355
+ /**
356
+ * Why the domain is not ready, or why the last lookup failed.
357
+ *
358
+ * @generated from field: string reason = 6;
359
+ */
360
+ reason: string;
361
+ /**
362
+ * Unset until the first check.
363
+ *
364
+ * @generated from field: google.protobuf.Timestamp checked_at = 7;
365
+ */
366
+ checkedAt?: Timestamp | undefined;
367
+ };
368
+ /**
369
+ * MailDomainStatus describes the checks and DNS records of a custom domain.
370
+ *
371
+ * @generated from message toshi.workspace.v1.MailDomainStatus
372
+ */
373
+ export type MailDomainStatusJson = {
374
+ /**
375
+ * @generated from field: toshi.workspace.v1.MailDomainState state = 1;
376
+ */
377
+ state?: MailDomainStateJson;
378
+ /**
379
+ * @generated from field: toshi.workspace.v1.MailDomainCheck ownership = 2;
380
+ */
381
+ ownership?: MailDomainCheckJson;
382
+ /**
383
+ * @generated from field: toshi.workspace.v1.MailDomainCheck mx = 3;
384
+ */
385
+ mx?: MailDomainCheckJson;
386
+ /**
387
+ * @generated from field: toshi.workspace.v1.MailDomainCheck provider = 4;
388
+ */
389
+ provider?: MailDomainCheckJson;
390
+ /**
391
+ * The ownership TXT, inbound MX and provider records, in that order.
392
+ *
393
+ * @generated from field: repeated toshi.workspace.v1.DomainRecord records = 5;
394
+ */
395
+ records?: DomainRecordJson[];
396
+ /**
397
+ * Why the domain is not ready, or why the last lookup failed.
398
+ *
399
+ * @generated from field: string reason = 6;
400
+ */
401
+ reason?: string;
402
+ /**
403
+ * Unset until the first check.
404
+ *
405
+ * @generated from field: google.protobuf.Timestamp checked_at = 7;
406
+ */
407
+ checkedAt?: TimestampJson;
408
+ };
409
+ /**
410
+ * Describes the message toshi.workspace.v1.MailDomainStatus.
411
+ * Use `create(MailDomainStatusSchema)` to create a new message.
412
+ */
413
+ export declare const MailDomainStatusSchema: GenMessage<MailDomainStatus, {
414
+ jsonType: MailDomainStatusJson;
415
+ }>;
207
416
  /**
208
417
  * ConnectionTarget is the URL a WEBHOOK connection's deliveries are posted
209
418
  * to: each delivery's event, as the event log would hold it, signed as
@@ -410,7 +619,8 @@ export declare const GetConnectionResponseSchema: GenMessage<GetConnectionRespon
410
619
  */
411
620
  export type CreateConnectionRequest = Message<"toshi.workspace.v1.CreateConnectionRequest"> & {
412
621
  /**
413
- * WEBHOOK; no other kind is created here.
622
+ * The kind to create: WEBHOOK or MAIL. Installing the GitHub App creates
623
+ * a GITHUB connection.
414
624
  *
415
625
  * @generated from field: toshi.workspace.v1.ConnectionKind kind = 1;
416
626
  */
@@ -422,6 +632,10 @@ export type CreateConnectionRequest = Message<"toshi.workspace.v1.CreateConnecti
422
632
  */
423
633
  name: string;
424
634
  /**
635
+ * The project and environment the connection's events belong to. Both
636
+ * are required for WEBHOOK. For MAIL they are optional, and when set must
637
+ * be the service's.
638
+ *
425
639
  * @generated from field: string project = 3;
426
640
  */
427
641
  project: string;
@@ -433,13 +647,22 @@ export type CreateConnectionRequest = Message<"toshi.workspace.v1.CreateConnecti
433
647
  * @generated from field: string request_key = 5;
434
648
  */
435
649
  requestKey: string;
650
+ /**
651
+ * The mail address and where its mail goes, for a MAIL connection; unset
652
+ * for WEBHOOK. service and endpoint are required; address and provider are
653
+ * output only, and ignored on input.
654
+ *
655
+ * @generated from field: toshi.workspace.v1.MailConnection mail = 6;
656
+ */
657
+ mail?: MailConnection | undefined;
436
658
  };
437
659
  /**
438
660
  * @generated from message toshi.workspace.v1.CreateConnectionRequest
439
661
  */
440
662
  export type CreateConnectionRequestJson = {
441
663
  /**
442
- * WEBHOOK; no other kind is created here.
664
+ * The kind to create: WEBHOOK or MAIL. Installing the GitHub App creates
665
+ * a GITHUB connection.
443
666
  *
444
667
  * @generated from field: toshi.workspace.v1.ConnectionKind kind = 1;
445
668
  */
@@ -451,6 +674,10 @@ export type CreateConnectionRequestJson = {
451
674
  */
452
675
  name?: string;
453
676
  /**
677
+ * The project and environment the connection's events belong to. Both
678
+ * are required for WEBHOOK. For MAIL they are optional, and when set must
679
+ * be the service's.
680
+ *
454
681
  * @generated from field: string project = 3;
455
682
  */
456
683
  project?: string;
@@ -462,6 +689,14 @@ export type CreateConnectionRequestJson = {
462
689
  * @generated from field: string request_key = 5;
463
690
  */
464
691
  requestKey?: string;
692
+ /**
693
+ * The mail address and where its mail goes, for a MAIL connection; unset
694
+ * for WEBHOOK. service and endpoint are required; address and provider are
695
+ * output only, and ignored on input.
696
+ *
697
+ * @generated from field: toshi.workspace.v1.MailConnection mail = 6;
698
+ */
699
+ mail?: MailConnectionJson;
465
700
  };
466
701
  /**
467
702
  * Describes the message toshi.workspace.v1.CreateConnectionRequest.
@@ -480,7 +715,8 @@ export type CreateConnectionResponse = Message<"toshi.workspace.v1.CreateConnect
480
715
  connection?: Connection | undefined;
481
716
  /**
482
717
  * The signing secret in its whsec_ form, for the sender to sign its
483
- * requests with. Shown only in this answer and an identical retry's.
718
+ * requests with; empty for a MAIL connection. Shown only in this answer
719
+ * and an identical retry's.
484
720
  *
485
721
  * @generated from field: string secret = 2;
486
722
  */
@@ -496,7 +732,8 @@ export type CreateConnectionResponseJson = {
496
732
  connection?: ConnectionJson;
497
733
  /**
498
734
  * The signing secret in its whsec_ form, for the sender to sign its
499
- * requests with. Shown only in this answer and an identical retry's.
735
+ * requests with; empty for a MAIL connection. Shown only in this answer
736
+ * and an identical retry's.
500
737
  *
501
738
  * @generated from field: string secret = 2;
502
739
  */
@@ -1266,18 +1503,102 @@ export declare enum ConnectionKind {
1266
1503
  *
1267
1504
  * @generated from enum value: CONNECTION_KIND_WEBHOOK = 2;
1268
1505
  */
1269
- WEBHOOK = 2
1506
+ WEBHOOK = 2,
1507
+ /**
1508
+ * An inbound mail address. The deployment's mail provider receives the
1509
+ * messages; each is stored as a receipt before it goes to a service's
1510
+ * event endpoint.
1511
+ *
1512
+ * @generated from enum value: CONNECTION_KIND_MAIL = 3;
1513
+ */
1514
+ MAIL = 3
1270
1515
  }
1271
1516
  /**
1272
1517
  * ConnectionKind is the kind of source a connection receives events from.
1273
1518
  *
1274
1519
  * @generated from enum toshi.workspace.v1.ConnectionKind
1275
1520
  */
1276
- export type ConnectionKindJson = "CONNECTION_KIND_UNSPECIFIED" | "CONNECTION_KIND_GITHUB" | "CONNECTION_KIND_WEBHOOK";
1521
+ export type ConnectionKindJson = "CONNECTION_KIND_UNSPECIFIED" | "CONNECTION_KIND_GITHUB" | "CONNECTION_KIND_WEBHOOK" | "CONNECTION_KIND_MAIL";
1277
1522
  /**
1278
1523
  * Describes the enum toshi.workspace.v1.ConnectionKind.
1279
1524
  */
1280
1525
  export declare const ConnectionKindSchema: GenEnum<ConnectionKind, ConnectionKindJson>;
1526
+ /**
1527
+ * MailDomainState is whether a connection's custom mail domain receives mail.
1528
+ *
1529
+ * @generated from enum toshi.workspace.v1.MailDomainState
1530
+ */
1531
+ export declare enum MailDomainState {
1532
+ /**
1533
+ * No custom domain is set.
1534
+ *
1535
+ * @generated from enum value: MAIL_DOMAIN_STATE_UNSPECIFIED = 0;
1536
+ */
1537
+ UNSPECIFIED = 0,
1538
+ /**
1539
+ * The domain has not yet passed all checks, or another workspace holds it.
1540
+ *
1541
+ * @generated from enum value: MAIL_DOMAIN_STATE_PENDING = 1;
1542
+ */
1543
+ PENDING = 1,
1544
+ /**
1545
+ * The ownership, MX and provider checks all pass.
1546
+ *
1547
+ * @generated from enum value: MAIL_DOMAIN_STATE_READY = 2;
1548
+ */
1549
+ READY = 2,
1550
+ /**
1551
+ * A previously ready domain no longer passes all checks.
1552
+ *
1553
+ * @generated from enum value: MAIL_DOMAIN_STATE_FAILING = 3;
1554
+ */
1555
+ FAILING = 3
1556
+ }
1557
+ /**
1558
+ * MailDomainState is whether a connection's custom mail domain receives mail.
1559
+ *
1560
+ * @generated from enum toshi.workspace.v1.MailDomainState
1561
+ */
1562
+ export type MailDomainStateJson = "MAIL_DOMAIN_STATE_UNSPECIFIED" | "MAIL_DOMAIN_STATE_PENDING" | "MAIL_DOMAIN_STATE_READY" | "MAIL_DOMAIN_STATE_FAILING";
1563
+ /**
1564
+ * Describes the enum toshi.workspace.v1.MailDomainState.
1565
+ */
1566
+ export declare const MailDomainStateSchema: GenEnum<MailDomainState, MailDomainStateJson>;
1567
+ /**
1568
+ * MailDomainCheck is the result of one custom mail domain check.
1569
+ *
1570
+ * @generated from enum toshi.workspace.v1.MailDomainCheck
1571
+ */
1572
+ export declare enum MailDomainCheck {
1573
+ /**
1574
+ * The check has not run yet.
1575
+ *
1576
+ * @generated from enum value: MAIL_DOMAIN_CHECK_UNSPECIFIED = 0;
1577
+ */
1578
+ UNSPECIFIED = 0,
1579
+ /**
1580
+ * The check passed.
1581
+ *
1582
+ * @generated from enum value: MAIL_DOMAIN_CHECK_PASSED = 1;
1583
+ */
1584
+ PASSED = 1,
1585
+ /**
1586
+ * The check failed.
1587
+ *
1588
+ * @generated from enum value: MAIL_DOMAIN_CHECK_FAILED = 2;
1589
+ */
1590
+ FAILED = 2
1591
+ }
1592
+ /**
1593
+ * MailDomainCheck is the result of one custom mail domain check.
1594
+ *
1595
+ * @generated from enum toshi.workspace.v1.MailDomainCheck
1596
+ */
1597
+ export type MailDomainCheckJson = "MAIL_DOMAIN_CHECK_UNSPECIFIED" | "MAIL_DOMAIN_CHECK_PASSED" | "MAIL_DOMAIN_CHECK_FAILED";
1598
+ /**
1599
+ * Describes the enum toshi.workspace.v1.MailDomainCheck.
1600
+ */
1601
+ export declare const MailDomainCheckSchema: GenEnum<MailDomainCheck, MailDomainCheckJson>;
1281
1602
  /**
1282
1603
  * ConnectionDeliveryState is where a WEBHOOK connection's delivery stands.
1283
1604
  *
@@ -1330,7 +1651,10 @@ export declare const ConnectionDeliveryStateSchema: GenEnum<ConnectionDeliverySt
1330
1651
  * GITHUB, which installing the App creates and removing it deletes; the
1331
1652
  * calls here list it and cannot create or delete it. A WEBHOOK connection
1332
1653
  * receives events from a sender that signs its requests as Standard
1333
- * Webhooks does, with a secret the connection keeps.
1654
+ * Webhooks does, with a secret the connection keeps. A MAIL connection
1655
+ * receives mail at an address the deployment's inbound mail provider
1656
+ * serves; each message is stored as a receipt before it goes to a
1657
+ * service's event endpoint.
1334
1658
  *
1335
1659
  * The caller's credential names the workspace, as for WorkloadService.
1336
1660
  * CreateConnection and RotateConnectionSecret require a request_key, which
@@ -1367,11 +1691,15 @@ export declare const ConnectionService: GenService<{
1367
1691
  output: typeof GetConnectionResponseSchema;
1368
1692
  };
1369
1693
  /**
1370
- * CreateConnection creates a WEBHOOK connection whose events belong to a
1371
- * project's environment, and returns it with its signing secret. A kind
1372
- * other than WEBHOOK fails with INVALID_ARGUMENT, a name a live
1373
- * connection of the workspace has with ALREADY_EXISTS, and an
1374
- * environment the project does not have with NOT_FOUND.
1694
+ * CreateConnection creates a WEBHOOK or MAIL connection. A WEBHOOK
1695
+ * connection's events belong to a project's environment, and the call
1696
+ * returns it with its signing secret. A MAIL connection receives mail at
1697
+ * an address the deployment's inbound mail provider serves and sends each
1698
+ * message to a service's event endpoint; it has no secret. A kind other
1699
+ * than WEBHOOK or MAIL fails with INVALID_ARGUMENT, as does a missing
1700
+ * required field, a name a live connection of the workspace has with
1701
+ * ALREADY_EXISTS, and an environment the project does not have with
1702
+ * NOT_FOUND.
1375
1703
  *
1376
1704
  * @generated from rpc toshi.workspace.v1.ConnectionService.CreateConnection
1377
1705
  */
@@ -1381,11 +1709,12 @@ export declare const ConnectionService: GenService<{
1381
1709
  output: typeof CreateConnectionResponseSchema;
1382
1710
  };
1383
1711
  /**
1384
- * DeleteConnection deletes a WEBHOOK connection: its events are no longer
1385
- * received. A GITHUB connection fails with FAILED_PRECONDITION, as only
1386
- * removing the GitHub App deletes it, as does one that live triggers match
1387
- * events from, naming them as project/name, and one the workspace does
1388
- * not have with NOT_FOUND.
1712
+ * DeleteConnection deletes a WEBHOOK or MAIL connection: its events are no
1713
+ * longer received, and a mail connection's address takes no more mail. A
1714
+ * GITHUB connection fails with FAILED_PRECONDITION, as only removing the
1715
+ * GitHub App deletes it, as does one that live triggers match events from,
1716
+ * naming them as project/name, and one the workspace does not have with
1717
+ * NOT_FOUND.
1389
1718
  *
1390
1719
  * @generated from rpc toshi.workspace.v1.ConnectionService.DeleteConnection
1391
1720
  */