@toshicloud/sdk 0.3.0 → 0.3.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.
package/README.md CHANGED
@@ -73,16 +73,18 @@ server and any CA come from the caller.
73
73
  ### The client's shape
74
74
 
75
75
  The client has one field per Workspace API service: `project`, `secret`,
76
- `webhook`, `display`, `channel`, `recording`, `volume`, `artifact` and
77
- `artifactUpload`, each holding that service's generated client.
76
+ `webhook`, `display`, `channel`, `recording`, `volume`, `artifact`,
77
+ `artifactUpload`, `workspace`, `hostJob`, `host`, `token`, `auditEvent`,
78
+ `filler` and `storageProvider`, each holding that service's generated
79
+ client.
78
80
  `workload` holds `WorkloadService`'s calls, grouped by the type they
79
81
  name: `workload.jobs`, `workload.sandboxes` and `workload.services`, one
80
82
  method for each call (`create`, `get`, `list`, `update`, `delete`,
81
83
  `wait`, `watch`, and `cancel` on a job, `execute` on a sandbox, `start`,
82
84
  `stop`, `setMode`, `listRuns`, `wake`, `hold` and `release` on a service). The calls that
83
- span the three types sit on `workload` itself: `watchEvents` and
84
- `waitOperation`. `run` sits at the top of the client, as `toshi run`
85
- sits at the top of the CLI.
85
+ span the three types sit on `workload` itself: `listEvents`, `watchEvents`,
86
+ `getOperation` and `waitOperation`. `run` sits at the top of the client, as
87
+ `toshi run` sits at the top of the CLI.
86
88
 
87
89
  ```ts
88
90
  const { jobs } = await toshi.workload.jobs.list({ pageSize: 10 });
@@ -107,6 +109,11 @@ from a server error.
107
109
  - `workload.jobs.wait(req)`, `workload.sandboxes.wait(req)` and
108
110
  `workload.services.wait(req)` ask again until the workload reaches the
109
111
  state; `workload.waitOperation(req)` asks until the operation is done.
112
+ - `workload.getOperation(req)` returns one operation by id: a call that
113
+ takes long hands one back, and this asks for it again.
114
+ - `workload.listEvents(req)` returns the events after a cursor, oldest
115
+ first, a page at a time, for a client that polls or catches up after
116
+ downtime; `workload.watchEvents(req)` is the live form.
110
117
  - `workload.jobs.watch(req)`, `workload.sandboxes.watch(req)`,
111
118
  `workload.services.watch(req)`, `workload.watchEvents(req)` and
112
119
  `workload.jobs.watchOutput(req)` resolve to a watch you read with
package/dist/client.d.ts CHANGED
@@ -1,17 +1,24 @@
1
1
  import type { MessageInitShape } from "@bufbuild/protobuf";
2
2
  import type { Client, Interceptor, Transport } from "@connectrpc/connect";
3
3
  import { ArtifactService, ArtifactUploadService } from "./gen/toshi/workspace/v1/artifacts_pb.js";
4
+ import { AuditEventService } from "./gen/toshi/workspace/v1/audit_events_pb.js";
4
5
  import { ChannelService } from "./gen/toshi/workspace/v1/channels_pb.js";
5
6
  import { DisplayService } from "./gen/toshi/workspace/v1/display_pb.js";
7
+ import { FillerService } from "./gen/toshi/workspace/v1/fillers_pb.js";
8
+ import { HostJobService } from "./gen/toshi/workspace/v1/hostjobs_pb.js";
9
+ import { HostService } from "./gen/toshi/workspace/v1/hosts_pb.js";
6
10
  import { ProjectService } from "./gen/toshi/workspace/v1/projects_pb.js";
7
11
  import { RecordingService } from "./gen/toshi/workspace/v1/recordings_pb.js";
8
12
  import { SecretService } from "./gen/toshi/workspace/v1/secrets_pb.js";
13
+ import { StorageProviderService } from "./gen/toshi/workspace/v1/storage_providers_pb.js";
14
+ import { TokenService } from "./gen/toshi/workspace/v1/tokens_pb.js";
9
15
  import { VolumeService } from "./gen/toshi/workspace/v1/volumes_pb.js";
10
16
  import { WebhookService } from "./gen/toshi/workspace/v1/webhook_pb.js";
17
+ import { WorkspaceService } from "./gen/toshi/workspace/v1/workspace_service_pb.js";
11
18
  import { CancelJobRequestSchema, CreateJobRequestSchema, CreateSandboxRequestSchema, CreateServiceRequestSchema, DeleteJobRequestSchema, DeleteSandboxRequestSchema, DeleteServiceRequestSchema, GetJobRequestSchema, GetSandboxRequestSchema, GetServiceRequestSchema, ListJobsRequestSchema, ListSandboxesRequestSchema, ListServicesRequestSchema, UpdateJobRequestSchema, UpdateSandboxRequestSchema, UpdateServiceRequestSchema, WaitJobRequestSchema, WaitSandboxRequestSchema, WaitServiceRequestSchema, WatchJobsRequestSchema, WatchSandboxesRequestSchema, WatchServicesRequestSchema } from "./gen/toshi/workspace/v1/workloads_pb.js";
12
19
  import type { CancelJobResponse, CreateJobResponse, CreateSandboxResponse, CreateServiceResponse, DeleteJobResponse, DeleteSandboxResponse, DeleteServiceResponse, GetJobResponse, GetSandboxResponse, GetServiceResponse, ListJobsResponse, ListSandboxesResponse, ListServicesResponse, UpdateJobResponse, UpdateSandboxResponse, UpdateServiceResponse, WaitJobResponse, WaitSandboxResponse, WaitServiceResponse, WatchJobsResponse, WatchSandboxesResponse, WatchServicesResponse } from "./gen/toshi/workspace/v1/workloads_pb.js";
13
- import { ExecuteStartSchema, HoldServiceRequestSchema, ListServiceRunsRequestSchema, ReleaseServiceRequestSchema, SetServiceModeRequestSchema, StartServiceRequestSchema, StopServiceRequestSchema, WaitOperationRequestSchema, WakeServiceRequestSchema, WatchEventsRequestSchema, WatchOutputRequestSchema } from "./gen/toshi/workspace/v1/workspace_pb.js";
14
- import type { HoldServiceResponse, Job, ListServiceRunsResponse, Operation, ReleaseServiceResponse, Sandbox, Service, SetServiceModeResponse, StartServiceResponse, StopServiceResponse, WakeServiceResponse, WatchEventsResponse, WatchOutputResponse } from "./gen/toshi/workspace/v1/workspace_pb.js";
20
+ import { ExecuteStartSchema, GetOperationRequestSchema, HoldServiceRequestSchema, ListEventsRequestSchema, ListServiceRunsRequestSchema, ReleaseServiceRequestSchema, SetServiceModeRequestSchema, StartServiceRequestSchema, StopServiceRequestSchema, WaitOperationRequestSchema, WakeServiceRequestSchema, WatchEventsRequestSchema, WatchOutputRequestSchema } from "./gen/toshi/workspace/v1/workspace_pb.js";
21
+ import type { GetOperationResponse, HoldServiceResponse, Job, ListEventsResponse, ListServiceRunsResponse, Operation, ReleaseServiceResponse, Sandbox, Service, SetServiceModeResponse, StartServiceResponse, StopServiceResponse, WakeServiceResponse, WatchEventsResponse, WatchOutputResponse } from "./gen/toshi/workspace/v1/workspace_pb.js";
15
22
  import type { RetryPolicy } from "./retry.js";
16
23
  /** How the client is configured; the caller builds the transport. */
17
24
  export interface ToshiOptions {
@@ -39,6 +46,13 @@ export interface ToshiClient {
39
46
  readonly artifact: Client<typeof ArtifactService>;
40
47
  readonly artifactUpload: Client<typeof ArtifactUploadService>;
41
48
  readonly workload: WorkloadClient;
49
+ readonly workspace: Client<typeof WorkspaceService>;
50
+ readonly hostJob: Client<typeof HostJobService>;
51
+ readonly host: Client<typeof HostService>;
52
+ readonly token: Client<typeof TokenService>;
53
+ readonly auditEvent: Client<typeof AuditEventService>;
54
+ readonly filler: Client<typeof FillerService>;
55
+ readonly storageProvider: Client<typeof StorageProviderService>;
42
56
  run(req: MessageInitShape<typeof CreateJobRequestSchema>, opts?: CallOptions): Promise<JobRun>;
43
57
  }
44
58
  /** WorkloadService's calls, grouped by the type they name. */
@@ -47,7 +61,11 @@ export interface WorkloadClient {
47
61
  readonly sandboxes: SandboxesClient;
48
62
  readonly services: ServicesClient;
49
63
  waitOperation(req: MessageInitShape<typeof WaitOperationRequestSchema>, opts?: CallOptions): Promise<Operation>;
64
+ /** Lists the events after a cursor, a page at a time; `watchEvents` is the live form. */
65
+ listEvents(req: MessageInitShape<typeof ListEventsRequestSchema>, opts?: CallOptions): Promise<ListEventsResponse>;
50
66
  watchEvents(req: MessageInitShape<typeof WatchEventsRequestSchema>, opts?: CallOptions): Promise<EventWatch>;
67
+ /** Returns one operation: the id a long call hands back, asked for again. */
68
+ getOperation(req: MessageInitShape<typeof GetOperationRequestSchema>, opts?: CallOptions): Promise<GetOperationResponse>;
51
69
  }
52
70
  /** A job's calls: one method for each of WorkloadService's job calls. */
53
71
  export interface JobsClient {
@@ -146,8 +164,8 @@ export interface JobRun extends AsyncIterable<OutputChunk> {
146
164
  * retry interceptors (auth outermost, retry innermost), one transport for every
147
165
  * client and helper.
148
166
  *
149
- * Since 0.2.0 the public contract is WorkloadService, not WorkspaceService: its
150
- * calls are grouped by the type they name under `workload`, and the generated
151
- * client is not handed out whole.
167
+ * Since 0.2.0 the workload calls are grouped by the type they name under
168
+ * `workload`; every other service, WorkspaceService's included, is handed out
169
+ * as one client.
152
170
  */
153
171
  export declare function createToshiClient(options: ToshiOptions): ToshiClient;
package/dist/client.js CHANGED
@@ -2,15 +2,22 @@ import { create } from "@bufbuild/protobuf";
2
2
  import { createClient } from "@connectrpc/connect";
3
3
  import { executeCommand } from "./execute.js";
4
4
  import { ArtifactService, ArtifactUploadService } from "./gen/toshi/workspace/v1/artifacts_pb.js";
5
+ import { AuditEventService } from "./gen/toshi/workspace/v1/audit_events_pb.js";
5
6
  import { ChannelService } from "./gen/toshi/workspace/v1/channels_pb.js";
6
7
  import { DisplayService } from "./gen/toshi/workspace/v1/display_pb.js";
8
+ import { FillerService } from "./gen/toshi/workspace/v1/fillers_pb.js";
9
+ import { HostJobService } from "./gen/toshi/workspace/v1/hostjobs_pb.js";
10
+ import { HostService } from "./gen/toshi/workspace/v1/hosts_pb.js";
7
11
  import { ProjectService } from "./gen/toshi/workspace/v1/projects_pb.js";
8
12
  import { RecordingService } from "./gen/toshi/workspace/v1/recordings_pb.js";
9
13
  import { SecretService } from "./gen/toshi/workspace/v1/secrets_pb.js";
14
+ import { StorageProviderService } from "./gen/toshi/workspace/v1/storage_providers_pb.js";
15
+ import { TokenService } from "./gen/toshi/workspace/v1/tokens_pb.js";
10
16
  import { VolumeService } from "./gen/toshi/workspace/v1/volumes_pb.js";
11
17
  import { WebhookService } from "./gen/toshi/workspace/v1/webhook_pb.js";
18
+ import { WorkspaceService } from "./gen/toshi/workspace/v1/workspace_service_pb.js";
12
19
  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";
13
- import { ExecuteStartSchema, HoldServiceRequestSchema, ListServiceRunsRequestSchema, ReleaseServiceRequestSchema, SetServiceModeRequestSchema, StartServiceRequestSchema, StopServiceRequestSchema, WaitOperationRequestSchema, WakeServiceRequestSchema, WatchEventsRequestSchema, WatchOutputRequestSchema, } from "./gen/toshi/workspace/v1/workspace_pb.js";
20
+ import { ExecuteStartSchema, GetOperationRequestSchema, HoldServiceRequestSchema, ListEventsRequestSchema, ListServiceRunsRequestSchema, ReleaseServiceRequestSchema, SetServiceModeRequestSchema, StartServiceRequestSchema, StopServiceRequestSchema, WaitOperationRequestSchema, WakeServiceRequestSchema, WatchEventsRequestSchema, WatchOutputRequestSchema, } from "./gen/toshi/workspace/v1/workspace_pb.js";
14
21
  import { openOutputWatch } from "./output.js";
15
22
  import { authInterceptor, keyInterceptor, retryInterceptor, scopeInterceptor } from "./interceptors.js";
16
23
  import { normalizeRetry } from "./retry.js";
@@ -22,9 +29,9 @@ import { waitJob, waitOperation, waitSandbox, waitService } from "./wait.js";
22
29
  * retry interceptors (auth outermost, retry innermost), one transport for every
23
30
  * client and helper.
24
31
  *
25
- * Since 0.2.0 the public contract is WorkloadService, not WorkspaceService: its
26
- * calls are grouped by the type they name under `workload`, and the generated
27
- * client is not handed out whole.
32
+ * Since 0.2.0 the workload calls are grouped by the type they name under
33
+ * `workload`; every other service, WorkspaceService's included, is handed out
34
+ * as one client.
28
35
  */
29
36
  export function createToshiClient(options) {
30
37
  const retry = normalizeRetry(options.retry);
@@ -85,8 +92,17 @@ export function createToshiClient(options) {
85
92
  listRuns: (req, opts) => workloadService.listServiceRuns(req, opts),
86
93
  },
87
94
  waitOperation: (req, opts) => waitOperation(workloadService, create(WaitOperationRequestSchema, req), opts),
95
+ listEvents: (req, opts) => workloadService.listEvents(req, opts),
88
96
  watchEvents: (req, opts) => openEventWatch(workloadService, retry, create(WatchEventsRequestSchema, req), opts),
97
+ getOperation: (req, opts) => workloadService.getOperation(req, opts),
89
98
  },
90
99
  run: (req, opts) => runJob(workloadService, retry, create(CreateJobRequestSchema, req), opts),
100
+ workspace: createClient(WorkspaceService, transport),
101
+ hostJob: createClient(HostJobService, transport),
102
+ host: createClient(HostService, transport),
103
+ token: createClient(TokenService, transport),
104
+ auditEvent: createClient(AuditEventService, transport),
105
+ filler: createClient(FillerService, transport),
106
+ storageProvider: createClient(StorageProviderService, transport),
91
107
  };
92
108
  }
@@ -0,0 +1,297 @@
1
+ import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
2
+ import type { Timestamp, TimestampJson } from "@bufbuild/protobuf/wkt";
3
+ import type { Message } from "@bufbuild/protobuf";
4
+ /**
5
+ * Describes the file toshi/workspace/v1/audit_events.proto.
6
+ */
7
+ export declare const file_toshi_workspace_v1_audit_events: GenFile;
8
+ /**
9
+ * AuditEvent is one append-only audit log entry.
10
+ *
11
+ * @generated from message toshi.workspace.v1.AuditEvent
12
+ */
13
+ export type AuditEvent = Message<"toshi.workspace.v1.AuditEvent"> & {
14
+ /**
15
+ * @generated from field: int64 id = 1;
16
+ */
17
+ id: bigint;
18
+ /**
19
+ * @generated from field: google.protobuf.Timestamp at = 2;
20
+ */
21
+ at?: Timestamp | undefined;
22
+ /**
23
+ * operator, session, token, workload, product, system or webhook.
24
+ *
25
+ * @generated from field: string actor_kind = 3;
26
+ */
27
+ actorKind: string;
28
+ /**
29
+ * The session's GitHub login; the API or product token's id (never its
30
+ * value); the workload as "<kind>:<id>"; or a system or webhook source
31
+ * name.
32
+ *
33
+ * @generated from field: string actor_id = 4;
34
+ */
35
+ actorId: string;
36
+ /**
37
+ * @generated from field: string action = 5;
38
+ */
39
+ action: string;
40
+ /**
41
+ * A "<kind>:<id>" string such as job:..., host:..., token:... or
42
+ * filler:....
43
+ *
44
+ * @generated from field: string target = 6;
45
+ */
46
+ target: string;
47
+ /**
48
+ * A JSON object whose keys depend on the action.
49
+ *
50
+ * @generated from field: string details_json = 7;
51
+ */
52
+ detailsJson: string;
53
+ /**
54
+ * @generated from field: string request_id = 8;
55
+ */
56
+ requestId: string;
57
+ };
58
+ /**
59
+ * AuditEvent is one append-only audit log entry.
60
+ *
61
+ * @generated from message toshi.workspace.v1.AuditEvent
62
+ */
63
+ export type AuditEventJson = {
64
+ /**
65
+ * @generated from field: int64 id = 1;
66
+ */
67
+ id?: string;
68
+ /**
69
+ * @generated from field: google.protobuf.Timestamp at = 2;
70
+ */
71
+ at?: TimestampJson;
72
+ /**
73
+ * operator, session, token, workload, product, system or webhook.
74
+ *
75
+ * @generated from field: string actor_kind = 3;
76
+ */
77
+ actorKind?: string;
78
+ /**
79
+ * The session's GitHub login; the API or product token's id (never its
80
+ * value); the workload as "<kind>:<id>"; or a system or webhook source
81
+ * name.
82
+ *
83
+ * @generated from field: string actor_id = 4;
84
+ */
85
+ actorId?: string;
86
+ /**
87
+ * @generated from field: string action = 5;
88
+ */
89
+ action?: string;
90
+ /**
91
+ * A "<kind>:<id>" string such as job:..., host:..., token:... or
92
+ * filler:....
93
+ *
94
+ * @generated from field: string target = 6;
95
+ */
96
+ target?: string;
97
+ /**
98
+ * A JSON object whose keys depend on the action.
99
+ *
100
+ * @generated from field: string details_json = 7;
101
+ */
102
+ detailsJson?: string;
103
+ /**
104
+ * @generated from field: string request_id = 8;
105
+ */
106
+ requestId?: string;
107
+ };
108
+ /**
109
+ * Describes the message toshi.workspace.v1.AuditEvent.
110
+ * Use `create(AuditEventSchema)` to create a new message.
111
+ */
112
+ export declare const AuditEventSchema: GenMessage<AuditEvent, {
113
+ jsonType: AuditEventJson;
114
+ }>;
115
+ /**
116
+ * ListAuditEventsRequest selects the audit events to return.
117
+ *
118
+ * @generated from message toshi.workspace.v1.ListAuditEventsRequest
119
+ */
120
+ export type ListAuditEventsRequest = Message<"toshi.workspace.v1.ListAuditEventsRequest"> & {
121
+ /**
122
+ * Only this action; empty matches every action.
123
+ *
124
+ * @generated from field: string action = 1;
125
+ */
126
+ action: string;
127
+ /**
128
+ * Only events at or after this time; unset is unbounded.
129
+ *
130
+ * @generated from field: google.protobuf.Timestamp since = 2;
131
+ */
132
+ since?: Timestamp | undefined;
133
+ /**
134
+ * The most events in one page; zero lets the server choose.
135
+ *
136
+ * @generated from field: int32 page_size = 3;
137
+ */
138
+ pageSize: number;
139
+ /**
140
+ * Only events whose actor_id is exactly this: the id without the kind (a
141
+ * token id, a GitHub login or user id, a source name). Empty matches
142
+ * every actor.
143
+ *
144
+ * @generated from field: string actor = 4;
145
+ */
146
+ actor: string;
147
+ /**
148
+ * Only events whose action is one of these; empty matches every action.
149
+ * Setting both action and actions fails with INVALID_ARGUMENT, and so do
150
+ * an empty entry and more than 100 entries.
151
+ *
152
+ * @generated from field: repeated string actions = 5;
153
+ */
154
+ actions: string[];
155
+ /**
156
+ * Only events whose target is exactly this, in full: "<kind>:<id>", for
157
+ * example "job:<id>". Empty matches every target.
158
+ *
159
+ * @generated from field: string target = 6;
160
+ */
161
+ target: string;
162
+ /**
163
+ * From an earlier response's next_page_token; empty for the first page.
164
+ *
165
+ * @generated from field: string page_token = 7;
166
+ */
167
+ pageToken: string;
168
+ };
169
+ /**
170
+ * ListAuditEventsRequest selects the audit events to return.
171
+ *
172
+ * @generated from message toshi.workspace.v1.ListAuditEventsRequest
173
+ */
174
+ export type ListAuditEventsRequestJson = {
175
+ /**
176
+ * Only this action; empty matches every action.
177
+ *
178
+ * @generated from field: string action = 1;
179
+ */
180
+ action?: string;
181
+ /**
182
+ * Only events at or after this time; unset is unbounded.
183
+ *
184
+ * @generated from field: google.protobuf.Timestamp since = 2;
185
+ */
186
+ since?: TimestampJson;
187
+ /**
188
+ * The most events in one page; zero lets the server choose.
189
+ *
190
+ * @generated from field: int32 page_size = 3;
191
+ */
192
+ pageSize?: number;
193
+ /**
194
+ * Only events whose actor_id is exactly this: the id without the kind (a
195
+ * token id, a GitHub login or user id, a source name). Empty matches
196
+ * every actor.
197
+ *
198
+ * @generated from field: string actor = 4;
199
+ */
200
+ actor?: string;
201
+ /**
202
+ * Only events whose action is one of these; empty matches every action.
203
+ * Setting both action and actions fails with INVALID_ARGUMENT, and so do
204
+ * an empty entry and more than 100 entries.
205
+ *
206
+ * @generated from field: repeated string actions = 5;
207
+ */
208
+ actions?: string[];
209
+ /**
210
+ * Only events whose target is exactly this, in full: "<kind>:<id>", for
211
+ * example "job:<id>". Empty matches every target.
212
+ *
213
+ * @generated from field: string target = 6;
214
+ */
215
+ target?: string;
216
+ /**
217
+ * From an earlier response's next_page_token; empty for the first page.
218
+ *
219
+ * @generated from field: string page_token = 7;
220
+ */
221
+ pageToken?: string;
222
+ };
223
+ /**
224
+ * Describes the message toshi.workspace.v1.ListAuditEventsRequest.
225
+ * Use `create(ListAuditEventsRequestSchema)` to create a new message.
226
+ */
227
+ export declare const ListAuditEventsRequestSchema: GenMessage<ListAuditEventsRequest, {
228
+ jsonType: ListAuditEventsRequestJson;
229
+ }>;
230
+ /**
231
+ * @generated from message toshi.workspace.v1.ListAuditEventsResponse
232
+ */
233
+ export type ListAuditEventsResponse = Message<"toshi.workspace.v1.ListAuditEventsResponse"> & {
234
+ /**
235
+ * Newest first.
236
+ *
237
+ * @generated from field: repeated toshi.workspace.v1.AuditEvent events = 1;
238
+ */
239
+ events: AuditEvent[];
240
+ /**
241
+ * Empty on the last page.
242
+ *
243
+ * @generated from field: string next_page_token = 2;
244
+ */
245
+ nextPageToken: string;
246
+ };
247
+ /**
248
+ * @generated from message toshi.workspace.v1.ListAuditEventsResponse
249
+ */
250
+ export type ListAuditEventsResponseJson = {
251
+ /**
252
+ * Newest first.
253
+ *
254
+ * @generated from field: repeated toshi.workspace.v1.AuditEvent events = 1;
255
+ */
256
+ events?: AuditEventJson[];
257
+ /**
258
+ * Empty on the last page.
259
+ *
260
+ * @generated from field: string next_page_token = 2;
261
+ */
262
+ nextPageToken?: string;
263
+ };
264
+ /**
265
+ * Describes the message toshi.workspace.v1.ListAuditEventsResponse.
266
+ * Use `create(ListAuditEventsResponseSchema)` to create a new message.
267
+ */
268
+ export declare const ListAuditEventsResponseSchema: GenMessage<ListAuditEventsResponse, {
269
+ jsonType: ListAuditEventsResponseJson;
270
+ }>;
271
+ /**
272
+ * AuditEventService reads the workspace's audit log: what its members, its
273
+ * tokens, the operator and the control plane did in it.
274
+ *
275
+ * A workspace's API token acts on its own workspace; a dashboard session
276
+ * names one of its workspaces in the Toshi-Workspace header. A
277
+ * token limited to a project or an environment is refused with
278
+ * PERMISSION_DENIED. A suspended workspace reads its audit log, and so does
279
+ * a closed one during its read-only period.
280
+ *
281
+ * @generated from service toshi.workspace.v1.AuditEventService
282
+ */
283
+ export declare const AuditEventService: GenService<{
284
+ /**
285
+ * ListAuditEvents returns the workspace's audit events that match every
286
+ * filter field that is set, newest first.
287
+ *
288
+ * A page holds 100 events when page_size is zero, and 1000 at most.
289
+ *
290
+ * @generated from rpc toshi.workspace.v1.AuditEventService.ListAuditEvents
291
+ */
292
+ listAuditEvents: {
293
+ methodKind: "unary";
294
+ input: typeof ListAuditEventsRequestSchema;
295
+ output: typeof ListAuditEventsResponseSchema;
296
+ };
297
+ }>;
@@ -0,0 +1,37 @@
1
+ // @generated by protoc-gen-es v2.16.0 with parameter "target=ts,json_types=true,import_extension=js"
2
+ // @generated from file toshi/workspace/v1/audit_events.proto (package toshi.workspace.v1, syntax proto3)
3
+ /* eslint-disable */
4
+ import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
5
+ import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
6
+ /**
7
+ * Describes the file toshi/workspace/v1/audit_events.proto.
8
+ */
9
+ export const file_toshi_workspace_v1_audit_events = /*@__PURE__*/ fileDesc("CiV0b3NoaS93b3Jrc3BhY2UvdjEvYXVkaXRfZXZlbnRzLnByb3RvEhJ0b3NoaS53b3Jrc3BhY2UudjEisAEKCkF1ZGl0RXZlbnQSCgoCaWQYASABKAMSJgoCYXQYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhIKCmFjdG9yX2tpbmQYAyABKAkSEAoIYWN0b3JfaWQYBCABKAkSDgoGYWN0aW9uGAUgASgJEg4KBnRhcmdldBgGIAEoCRIUCgxkZXRhaWxzX2pzb24YByABKAkSEgoKcmVxdWVzdF9pZBgIIAEoCSKqAQoWTGlzdEF1ZGl0RXZlbnRzUmVxdWVzdBIOCgZhY3Rpb24YASABKAkSKQoFc2luY2UYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhEKCXBhZ2Vfc2l6ZRgDIAEoBRINCgVhY3RvchgEIAEoCRIPCgdhY3Rpb25zGAUgAygJEg4KBnRhcmdldBgGIAEoCRISCgpwYWdlX3Rva2VuGAcgASgJImIKF0xpc3RBdWRpdEV2ZW50c1Jlc3BvbnNlEi4KBmV2ZW50cxgBIAMoCzIeLnRvc2hpLndvcmtzcGFjZS52MS5BdWRpdEV2ZW50EhcKD25leHRfcGFnZV90b2tlbhgCIAEoCTJ/ChFBdWRpdEV2ZW50U2VydmljZRJqCg9MaXN0QXVkaXRFdmVudHMSKi50b3NoaS53b3Jrc3BhY2UudjEuTGlzdEF1ZGl0RXZlbnRzUmVxdWVzdBorLnRvc2hpLndvcmtzcGFjZS52MS5MaXN0QXVkaXRFdmVudHNSZXNwb25zZUItWitnaXRodWIuY29tL3Rvc2hpY2xvdWQvdG9zaGktYXBpL3dvcmtzcGFjZXYxYgZwcm90bzM", [file_google_protobuf_timestamp]);
10
+ /**
11
+ * Describes the message toshi.workspace.v1.AuditEvent.
12
+ * Use `create(AuditEventSchema)` to create a new message.
13
+ */
14
+ export const AuditEventSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_audit_events, 0);
15
+ /**
16
+ * Describes the message toshi.workspace.v1.ListAuditEventsRequest.
17
+ * Use `create(ListAuditEventsRequestSchema)` to create a new message.
18
+ */
19
+ export const ListAuditEventsRequestSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_audit_events, 1);
20
+ /**
21
+ * Describes the message toshi.workspace.v1.ListAuditEventsResponse.
22
+ * Use `create(ListAuditEventsResponseSchema)` to create a new message.
23
+ */
24
+ export const ListAuditEventsResponseSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_audit_events, 2);
25
+ /**
26
+ * AuditEventService reads the workspace's audit log: what its members, its
27
+ * tokens, the operator and the control plane did in it.
28
+ *
29
+ * A workspace's API token acts on its own workspace; a dashboard session
30
+ * names one of its workspaces in the Toshi-Workspace header. A
31
+ * token limited to a project or an environment is refused with
32
+ * PERMISSION_DENIED. A suspended workspace reads its audit log, and so does
33
+ * a closed one during its read-only period.
34
+ *
35
+ * @generated from service toshi.workspace.v1.AuditEventService
36
+ */
37
+ export const AuditEventService = /*@__PURE__*/ serviceDesc(file_toshi_workspace_v1_audit_events, 0);