@toshicloud/sdk 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +102 -19
  2. package/dist/client.d.ts +40 -4
  3. package/dist/client.js +35 -4
  4. package/dist/errors.d.ts +99 -0
  5. package/dist/errors.js +208 -0
  6. package/dist/gen/toshi/permission_pb.d.ts +244 -0
  7. package/dist/gen/toshi/permission_pb.js +94 -0
  8. package/dist/gen/toshi/workspace/v1/account_pb.d.ts +590 -0
  9. package/dist/gen/toshi/workspace/v1/account_pb.js +75 -0
  10. package/dist/gen/toshi/workspace/v1/artifacts_pb.d.ts +14 -8
  11. package/dist/gen/toshi/workspace/v1/artifacts_pb.js +10 -7
  12. package/dist/gen/toshi/workspace/v1/audit_events_pb.d.ts +191 -6
  13. package/dist/gen/toshi/workspace/v1/audit_events_pb.js +12 -1
  14. package/dist/gen/toshi/workspace/v1/channels_pb.d.ts +1194 -21
  15. package/dist/gen/toshi/workspace/v1/channels_pb.js +186 -39
  16. package/dist/gen/toshi/workspace/v1/connections_pb.d.ts +1481 -0
  17. package/dist/gen/toshi/workspace/v1/connections_pb.js +208 -0
  18. package/dist/gen/toshi/workspace/v1/discovery_pb.d.ts +924 -0
  19. package/dist/gen/toshi/workspace/v1/discovery_pb.js +231 -0
  20. package/dist/gen/toshi/workspace/v1/display_pb.d.ts +198 -15
  21. package/dist/gen/toshi/workspace/v1/display_pb.js +53 -2
  22. package/dist/gen/toshi/workspace/v1/domains_pb.d.ts +864 -0
  23. package/dist/gen/toshi/workspace/v1/domains_pb.js +152 -0
  24. package/dist/gen/toshi/workspace/v1/fillers_pb.d.ts +12 -4
  25. package/dist/gen/toshi/workspace/v1/fillers_pb.js +2 -1
  26. package/dist/gen/toshi/workspace/v1/grants_pb.d.ts +1297 -0
  27. package/dist/gen/toshi/workspace/v1/grants_pb.js +271 -0
  28. package/dist/gen/toshi/workspace/v1/hostjobs_pb.d.ts +315 -15
  29. package/dist/gen/toshi/workspace/v1/hostjobs_pb.js +11 -5
  30. package/dist/gen/toshi/workspace/v1/hosts_pb.d.ts +196 -7
  31. package/dist/gen/toshi/workspace/v1/hosts_pb.js +13 -7
  32. package/dist/gen/toshi/workspace/v1/images_pb.d.ts +1463 -0
  33. package/dist/gen/toshi/workspace/v1/images_pb.js +263 -0
  34. package/dist/gen/toshi/workspace/v1/products_pb.d.ts +506 -0
  35. package/dist/gen/toshi/workspace/v1/products_pb.js +60 -0
  36. package/dist/gen/toshi/workspace/v1/projects_pb.d.ts +1474 -99
  37. package/dist/gen/toshi/workspace/v1/projects_pb.js +151 -33
  38. package/dist/gen/toshi/workspace/v1/recordings_pb.d.ts +181 -14
  39. package/dist/gen/toshi/workspace/v1/recordings_pb.js +55 -14
  40. package/dist/gen/toshi/workspace/v1/roles_pb.d.ts +1994 -0
  41. package/dist/gen/toshi/workspace/v1/roles_pb.js +355 -0
  42. package/dist/gen/toshi/workspace/v1/secrets_pb.d.ts +314 -8
  43. package/dist/gen/toshi/workspace/v1/secrets_pb.js +43 -18
  44. package/dist/gen/toshi/workspace/v1/storage_providers_pb.d.ts +14 -0
  45. package/dist/gen/toshi/workspace/v1/storage_providers_pb.js +2 -1
  46. package/dist/gen/toshi/workspace/v1/tokens_pb.d.ts +434 -5
  47. package/dist/gen/toshi/workspace/v1/tokens_pb.js +66 -8
  48. package/dist/gen/toshi/workspace/v1/triggers_pb.d.ts +1099 -0
  49. package/dist/gen/toshi/workspace/v1/triggers_pb.js +185 -0
  50. package/dist/gen/toshi/workspace/v1/volumes_pb.d.ts +1052 -33
  51. package/dist/gen/toshi/workspace/v1/volumes_pb.js +170 -11
  52. package/dist/gen/toshi/workspace/v1/webhook_pb.d.ts +66 -8
  53. package/dist/gen/toshi/workspace/v1/webhook_pb.js +5 -4
  54. package/dist/gen/toshi/workspace/v1/workloads_pb.d.ts +2043 -54
  55. package/dist/gen/toshi/workspace/v1/workloads_pb.js +205 -54
  56. package/dist/gen/toshi/workspace/v1/workspace_pb.d.ts +6292 -939
  57. package/dist/gen/toshi/workspace/v1/workspace_pb.js +801 -88
  58. package/dist/gen/toshi/workspace/v1/workspace_service_pb.d.ts +2176 -630
  59. package/dist/gen/toshi/workspace/v1/workspace_service_pb.js +192 -74
  60. package/dist/index.d.ts +10 -1
  61. package/dist/index.js +10 -1
  62. package/dist/interceptors.d.ts +11 -1
  63. package/dist/interceptors.js +38 -4
  64. package/dist/retry.d.ts +18 -0
  65. package/dist/retry.js +228 -22
  66. package/dist/test/procedures.js +100 -5
  67. package/dist/version.d.ts +1 -1
  68. package/dist/version.js +1 -1
  69. package/dist/wait.d.ts +4 -0
  70. package/dist/wait.js +24 -1
  71. package/package.json +3 -2
@@ -89,7 +89,9 @@ export type Artifact = Message<"toshi.workspace.v1.Artifact"> & {
89
89
  completedAt?: Timestamp | undefined;
90
90
  /**
91
91
  * The kind of workload that uploaded it, as its token named: job or
92
- * sandbox. workload_id and execution_id are that workload's.
92
+ * sandbox. workload_id and execution_id are that workload's. A CI
93
+ * job runs no workload, and its token names the kind job with the
94
+ * host job's own id: its artifacts' workload_id is that id.
93
95
  *
94
96
  * @generated from field: string workload_kind = 16;
95
97
  */
@@ -178,7 +180,9 @@ export type ArtifactJson = {
178
180
  completedAt?: TimestampJson;
179
181
  /**
180
182
  * The kind of workload that uploaded it, as its token named: job or
181
- * sandbox. workload_id and execution_id are that workload's.
183
+ * sandbox. workload_id and execution_id are that workload's. A CI
184
+ * job runs no workload, and its token names the kind job with the
185
+ * host job's own id: its artifacts' workload_id is that id.
182
186
  *
183
187
  * @generated from field: string workload_kind = 16;
184
188
  */
@@ -755,12 +759,14 @@ export declare const GetArtifactDownloadURLResponseSchema: GenMessage<GetArtifac
755
759
  /**
756
760
  * ArtifactUploadService is how a job uploads what it recorded:
757
761
  * it reserves an artifact, uploads each part to a presigned URL, and
758
- * completes the upload. The caller is the workload itself: every call
759
- * carries a workload identity token for the audience
760
- * "toshi:artifacts", and the tenant, project, environment, workload and
761
- * execution of the artifact are the token's claims, never the request's.
762
- * A token of another audience, a display token, an expired token, or one
763
- * that names no workload is refused with UNAUTHENTICATED. A workspace that
762
+ * completes the upload. The caller is the workload itself, with a
763
+ * workload identity token for the audience "toshi:artifacts", or a host
764
+ * storing a recording's strip, with that strip's upload token for the
765
+ * audience "toshi:recordings". The workspace, project, environment,
766
+ * workload and execution of the artifact are the token's claims, or the
767
+ * recording's, never the request's. Another token, a display token, an
768
+ * expired token, or one that names no workload is refused with
769
+ * UNAUTHENTICATED. A workspace that
764
770
  * is suspended or being deleted is refused with FAILED_PRECONDITION.
765
771
  *
766
772
  * The data key and the presigned URLs are the only values either call
@@ -3,11 +3,12 @@
3
3
  /* eslint-disable */
4
4
  import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
5
5
  import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
6
+ import { file_toshi_permission } from "../../permission_pb.js";
6
7
  import { file_toshi_workspace_v1_recordings } from "./recordings_pb.js";
7
8
  /**
8
9
  * Describes the file toshi/workspace/v1/artifacts.proto.
9
10
  */
10
- export const file_toshi_workspace_v1_artifacts = /*@__PURE__*/ fileDesc("CiJ0b3NoaS93b3Jrc3BhY2UvdjEvYXJ0aWZhY3RzLnByb3RvEhJ0b3NoaS53b3Jrc3BhY2UudjEi9wIKCEFydGlmYWN0EgoKAmlkGAEgASgJEhIKCnByb2plY3RfaWQYAiABKAkSFgoOZW52aXJvbm1lbnRfaWQYAyABKAkSEwoLd29ya2xvYWRfaWQYBCABKAkSFAoMZXhlY3V0aW9uX2lkGAUgASgJEgwKBGtpbmQYBiABKAkSDAoEbmFtZRgHIAEoCRIUCgxjb250ZW50X3R5cGUYCCABKAkSEgoKcGFydF9jb3VudBgJIAEoAxISCgpwYXJ0X3NpemVzGAogAygDEhIKCmluZGV4X3NpemUYCyABKAMSDQoFc3RhdGUYDCABKAkSEgoKZW5jcnlwdGlvbhgNIAEoCRIuCgp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ioudG9zaGkud29ya3NwYWNlLnYxLkNvbXBsZXRlVXBsb2FkUmVzcG9uc2Uy2AIKD0FydGlmYWN0U2VydmljZRJkCg1MaXN0QXJ0aWZhY3RzEigudG9zaGkud29ya3NwYWNlLnYxLkxpc3RBcnRpZmFjdHNSZXF1ZXN0GikudG9zaGkud29ya3NwYWNlLnYxLkxpc3RBcnRpZmFjdHNSZXNwb25zZRJeCgtHZXRBcnRpZmFjdBImLnRvc2hpLndvcmtzcGFjZS52MS5HZXRBcnRpZmFjdFJlcXVlc3QaJy50b3NoaS53b3Jrc3BhY2UudjEuR2V0QXJ0aWZhY3RSZXNwb25zZRJ/ChZHZXRBcnRpZmFjdERvd25sb2FkVVJMEjEudG9zaGkud29ya3NwYWNlLnYxLkdldEFydGlmYWN0RG93bmxvYWRVUkxSZXF1ZXN0GjIudG9zaGkud29ya3NwYWNlLnYxLkdldEFydGlmYWN0RG93bmxvYWRVUkxSZXNwb25zZUItWitnaXRodWIuY29tL3Rvc2hpY2xvdWQvdG9zaGktYXBpL3dvcmtzcGFjZXYxYgZwcm90bzM", [file_google_protobuf_timestamp, file_toshi_workspace_v1_recordings]);
11
+ export const file_toshi_workspace_v1_artifacts = /*@__PURE__*/ fileDesc("CiJ0b3NoaS93b3Jrc3BhY2UvdjEvYXJ0aWZhY3RzLnByb3RvEhJ0b3NoaS53b3Jrc3BhY2UudjEi9wIKCEFydGlmYWN0EgoKAmlkGAEgASgJEhIKCnByb2plY3RfaWQYAiABKAkSFgoOZW52aXJvbm1lbnRfaWQYAyABKAkSEwoLd29ya2xvYWRfaWQYBCABKAkSFAoMZXhlY3V0aW9uX2lkGAUgASgJEgwKBGtpbmQYBiABKAkSDAoEbmFtZRgHIAEoCRIUCgxjb250ZW50X3R5cGUYCCABKAkSEgoKcGFydF9jb3VudBgJIAEoAxISCgpwYXJ0X3NpemVzGAogAygDEhIKCmluZGV4X3NpemUYCyABKAMSDQoFc3RhdGUYDCABKAkSEgoKZW5jcnlwdGlvbhgN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mVkEh1hcnRpZmFjdDpyZXNwb25zZS5hcnRpZmFjdF9pZOrzGAIoARKZAQoOQ29tcGxldGVVcGxvYWQSKS50b3NoaS53b3Jrc3BhY2UudjEuQ29tcGxldGVVcGxvYWRSZXF1ZXN0GioudG9zaGkud29ya3NwYWNlLnYxLkNvbXBsZXRlVXBsb2FkUmVzcG9uc2UiMMLzGA9hcnRpZmFjdHMud3JpdGXS8xgTChFhcnRpZmFjdC51cGxvYWRlZOrzGAIoATLZAwoPQXJ0aWZhY3RTZXJ2aWNlEocBCg1MaXN0QXJ0aWZhY3RzEigudG9zaGkud29ya3NwYWNlLnYxLkxpc3RBcnRpZmFjdHNSZXF1ZXN0GikudG9zaGkud29ya3NwYWNlLnYxLkxpc3RBcnRpZmFjdHNSZXNwb25zZSIhwvMYDmFydGlmYWN0cy5yZWFkyvMYC2Vudmlyb25tZW50EoEBCgtHZXRBcnRpZmFjdBImLnRvc2hpLndvcmtzcGFjZS52MS5HZXRBcnRpZmFjdFJlcXVlc3QaJy50b3NoaS53b3Jrc3BhY2UudjEuR2V0QXJ0aWZhY3RSZXNwb25zZSIhwvMYDmFydGlmYWN0cy5yZWFkyvMYC2Vudmlyb25tZW50ErcBChZHZXRBcnRpZmFjdERvd25sb2FkVVJMEjEudG9zaGkud29ya3NwYWNlLnYxLkdldEFydGlmYWN0RG93bmxvYWRVUkxSZXF1ZXN0GjIudG9zaGkud29ya3NwYWNlLnYxLkdldEFydGlmYWN0RG93bmxvYWRVUkxSZXNwb25zZSI2wvMYDmFydGlmYWN0cy5yZWFkyvMYC2Vudmlyb25tZW500vMYEQoPYXJ0aWZhY3Qudmlld2VkQiJaIGdvLnRvc2hpY2xvdWQuaW8vYXBpL3dvcmtzcGFjZXYxYgZwcm90bzM", [file_google_protobuf_timestamp, file_toshi_permission, file_toshi_workspace_v1_recordings]);
11
12
  /**
12
13
  * Describes the message toshi.workspace.v1.Artifact.
13
14
  * Use `create(ArtifactSchema)` to create a new message.
@@ -71,12 +72,14 @@ export const GetArtifactDownloadURLResponseSchema = /*@__PURE__*/ messageDesc(fi
71
72
  /**
72
73
  * ArtifactUploadService is how a job uploads what it recorded:
73
74
  * it reserves an artifact, uploads each part to a presigned URL, and
74
- * completes the upload. The caller is the workload itself: every call
75
- * carries a workload identity token for the audience
76
- * "toshi:artifacts", and the tenant, project, environment, workload and
77
- * execution of the artifact are the token's claims, never the request's.
78
- * A token of another audience, a display token, an expired token, or one
79
- * that names no workload is refused with UNAUTHENTICATED. A workspace that
75
+ * completes the upload. The caller is the workload itself, with a
76
+ * workload identity token for the audience "toshi:artifacts", or a host
77
+ * storing a recording's strip, with that strip's upload token for the
78
+ * audience "toshi:recordings". The workspace, project, environment,
79
+ * workload and execution of the artifact are the token's claims, or the
80
+ * recording's, never the request's. Another token, a display token, an
81
+ * expired token, or one that names no workload is refused with
82
+ * UNAUTHENTICATED. A workspace that
80
83
  * is suspended or being deleted is refused with FAILED_PRECONDITION.
81
84
  *
82
85
  * The data key and the presigned URLs are the only values either call
@@ -26,9 +26,9 @@ export type AuditEvent = Message<"toshi.workspace.v1.AuditEvent"> & {
26
26
  */
27
27
  actorKind: string;
28
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.
29
+ * The session's user id, which stays the same across renames and identity
30
+ * providers; the API or product token's id (never its value); the workload
31
+ * as "<kind>:<id>"; or a system or webhook source name.
32
32
  *
33
33
  * @generated from field: string actor_id = 4;
34
34
  */
@@ -54,6 +54,43 @@ export type AuditEvent = Message<"toshi.workspace.v1.AuditEvent"> & {
54
54
  * @generated from field: string request_id = 8;
55
55
  */
56
56
  requestId: string;
57
+ /**
58
+ * The permission the call needed, for an event a Workspace API call
59
+ * records; empty otherwise.
60
+ *
61
+ * @generated from field: string permission = 9;
62
+ */
63
+ permission: string;
64
+ /**
65
+ * Where the call acted, as "project:<id>" or
66
+ * "project:<id>/environment:<id>"; empty for the whole workspace and for
67
+ * an event no call records.
68
+ *
69
+ * @generated from field: string scope = 10;
70
+ */
71
+ scope: string;
72
+ /**
73
+ * "ok", or the reason the call was refused: PERMISSION_MISSING,
74
+ * OUTSIDE_LIMIT or PRODUCT_UNAVAILABLE.
75
+ * Empty for an event no call records.
76
+ *
77
+ * @generated from field: string outcome = 11;
78
+ */
79
+ outcome: string;
80
+ /**
81
+ * The id of the token the call was made with (never its value); empty for
82
+ * a session and for an event no call records.
83
+ *
84
+ * @generated from field: string token_id = 12;
85
+ */
86
+ tokenId: string;
87
+ /**
88
+ * A session actor's login or name as it was when the event was recorded;
89
+ * empty for the other actors, and once the workspace is purged.
90
+ *
91
+ * @generated from field: string actor_name = 13;
92
+ */
93
+ actorName: string;
57
94
  };
58
95
  /**
59
96
  * AuditEvent is one append-only audit log entry.
@@ -76,9 +113,9 @@ export type AuditEventJson = {
76
113
  */
77
114
  actorKind?: string;
78
115
  /**
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.
116
+ * The session's user id, which stays the same across renames and identity
117
+ * providers; the API or product token's id (never its value); the workload
118
+ * as "<kind>:<id>"; or a system or webhook source name.
82
119
  *
83
120
  * @generated from field: string actor_id = 4;
84
121
  */
@@ -104,6 +141,43 @@ export type AuditEventJson = {
104
141
  * @generated from field: string request_id = 8;
105
142
  */
106
143
  requestId?: string;
144
+ /**
145
+ * The permission the call needed, for an event a Workspace API call
146
+ * records; empty otherwise.
147
+ *
148
+ * @generated from field: string permission = 9;
149
+ */
150
+ permission?: string;
151
+ /**
152
+ * Where the call acted, as "project:<id>" or
153
+ * "project:<id>/environment:<id>"; empty for the whole workspace and for
154
+ * an event no call records.
155
+ *
156
+ * @generated from field: string scope = 10;
157
+ */
158
+ scope?: string;
159
+ /**
160
+ * "ok", or the reason the call was refused: PERMISSION_MISSING,
161
+ * OUTSIDE_LIMIT or PRODUCT_UNAVAILABLE.
162
+ * Empty for an event no call records.
163
+ *
164
+ * @generated from field: string outcome = 11;
165
+ */
166
+ outcome?: string;
167
+ /**
168
+ * The id of the token the call was made with (never its value); empty for
169
+ * a session and for an event no call records.
170
+ *
171
+ * @generated from field: string token_id = 12;
172
+ */
173
+ tokenId?: string;
174
+ /**
175
+ * A session actor's login or name as it was when the event was recorded;
176
+ * empty for the other actors, and once the workspace is purged.
177
+ *
178
+ * @generated from field: string actor_name = 13;
179
+ */
180
+ actorName?: string;
107
181
  };
108
182
  /**
109
183
  * Describes the message toshi.workspace.v1.AuditEvent.
@@ -165,6 +239,14 @@ export type ListAuditEventsRequest = Message<"toshi.workspace.v1.ListAuditEvents
165
239
  * @generated from field: string page_token = 7;
166
240
  */
167
241
  pageToken: string;
242
+ /**
243
+ * Only the events of calls with this outcome: "ok", or the reason a call
244
+ * was refused, such as PERMISSION_MISSING. Empty matches every event, a
245
+ * call's or not.
246
+ *
247
+ * @generated from field: string outcome = 8;
248
+ */
249
+ outcome: string;
168
250
  };
169
251
  /**
170
252
  * ListAuditEventsRequest selects the audit events to return.
@@ -219,6 +301,14 @@ export type ListAuditEventsRequestJson = {
219
301
  * @generated from field: string page_token = 7;
220
302
  */
221
303
  pageToken?: string;
304
+ /**
305
+ * Only the events of calls with this outcome: "ok", or the reason a call
306
+ * was refused, such as PERMISSION_MISSING. Empty matches every event, a
307
+ * call's or not.
308
+ *
309
+ * @generated from field: string outcome = 8;
310
+ */
311
+ outcome?: string;
222
312
  };
223
313
  /**
224
314
  * Describes the message toshi.workspace.v1.ListAuditEventsRequest.
@@ -268,6 +358,80 @@ export type ListAuditEventsResponseJson = {
268
358
  export declare const ListAuditEventsResponseSchema: GenMessage<ListAuditEventsResponse, {
269
359
  jsonType: ListAuditEventsResponseJson;
270
360
  }>;
361
+ /**
362
+ * @generated from message toshi.workspace.v1.ExportAuditEventsRequest
363
+ */
364
+ export type ExportAuditEventsRequest = Message<"toshi.workspace.v1.ExportAuditEventsRequest"> & {
365
+ /**
366
+ * @generated from field: google.protobuf.Timestamp since = 1;
367
+ */
368
+ since?: Timestamp | undefined;
369
+ /**
370
+ * @generated from field: google.protobuf.Timestamp until = 2;
371
+ */
372
+ until?: Timestamp | undefined;
373
+ /**
374
+ * @generated from field: string cursor = 3;
375
+ */
376
+ cursor: string;
377
+ };
378
+ /**
379
+ * @generated from message toshi.workspace.v1.ExportAuditEventsRequest
380
+ */
381
+ export type ExportAuditEventsRequestJson = {
382
+ /**
383
+ * @generated from field: google.protobuf.Timestamp since = 1;
384
+ */
385
+ since?: TimestampJson;
386
+ /**
387
+ * @generated from field: google.protobuf.Timestamp until = 2;
388
+ */
389
+ until?: TimestampJson;
390
+ /**
391
+ * @generated from field: string cursor = 3;
392
+ */
393
+ cursor?: string;
394
+ };
395
+ /**
396
+ * Describes the message toshi.workspace.v1.ExportAuditEventsRequest.
397
+ * Use `create(ExportAuditEventsRequestSchema)` to create a new message.
398
+ */
399
+ export declare const ExportAuditEventsRequestSchema: GenMessage<ExportAuditEventsRequest, {
400
+ jsonType: ExportAuditEventsRequestJson;
401
+ }>;
402
+ /**
403
+ * @generated from message toshi.workspace.v1.ExportAuditEventsResponse
404
+ */
405
+ export type ExportAuditEventsResponse = Message<"toshi.workspace.v1.ExportAuditEventsResponse"> & {
406
+ /**
407
+ * @generated from field: bytes data = 1;
408
+ */
409
+ data: Uint8Array;
410
+ /**
411
+ * @generated from field: string cursor = 2;
412
+ */
413
+ cursor: string;
414
+ };
415
+ /**
416
+ * @generated from message toshi.workspace.v1.ExportAuditEventsResponse
417
+ */
418
+ export type ExportAuditEventsResponseJson = {
419
+ /**
420
+ * @generated from field: bytes data = 1;
421
+ */
422
+ data?: string;
423
+ /**
424
+ * @generated from field: string cursor = 2;
425
+ */
426
+ cursor?: string;
427
+ };
428
+ /**
429
+ * Describes the message toshi.workspace.v1.ExportAuditEventsResponse.
430
+ * Use `create(ExportAuditEventsResponseSchema)` to create a new message.
431
+ */
432
+ export declare const ExportAuditEventsResponseSchema: GenMessage<ExportAuditEventsResponse, {
433
+ jsonType: ExportAuditEventsResponseJson;
434
+ }>;
271
435
  /**
272
436
  * AuditEventService reads the workspace's audit log: what its members, its
273
437
  * tokens, the operator and the control plane did in it.
@@ -294,4 +458,25 @@ export declare const AuditEventService: GenService<{
294
458
  input: typeof ListAuditEventsRequestSchema;
295
459
  output: typeof ListAuditEventsResponseSchema;
296
460
  };
461
+ /**
462
+ * ExportAuditEvents streams the audit log as JSON lines, oldest first,
463
+ * without a row cap. The first line is {"header":{"since":...,"until":...,
464
+ * "retention_boundary":...|null,"crossed":true|false}}, followed by one
465
+ * AuditEvent per line. The plan must include audit export or the call fails
466
+ * with PERMISSION_DENIED.
467
+ *
468
+ * Since is required; until defaults to now. Since must be before until,
469
+ * else INVALID_ARGUMENT. A cursor from a previous response resumes after
470
+ * its last row, sending the header again. A malformed cursor or one from
471
+ * another range fails with INVALID_ARGUMENT; a resume cursor at or behind
472
+ * the retention boundary fails with OUT_OF_RANGE. When resuming without an
473
+ * until, the cursor keeps the original range's until.
474
+ *
475
+ * @generated from rpc toshi.workspace.v1.AuditEventService.ExportAuditEvents
476
+ */
477
+ exportAuditEvents: {
478
+ methodKind: "server_streaming";
479
+ input: typeof ExportAuditEventsRequestSchema;
480
+ output: typeof ExportAuditEventsResponseSchema;
481
+ };
297
482
  }>;
@@ -3,10 +3,11 @@
3
3
  /* eslint-disable */
4
4
  import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
5
5
  import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
6
+ import { file_toshi_permission } from "../../permission_pb.js";
6
7
  /**
7
8
  * Describes the file toshi/workspace/v1/audit_events.proto.
8
9
  */
9
- export const file_toshi_workspace_v1_audit_events = /*@__PURE__*/ fileDesc("CiV0b3NoaS93b3Jrc3BhY2UvdjEvYXVkaXRfZXZlbnRzLnByb3RvEhJ0b3NoaS53b3Jrc3BhY2UudjEisAEKCkF1ZGl0RXZlbnQSCgoCaWQYASABKAMSJgoCYXQYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhIKCmFjdG9yX2tpbmQYAyABKAkSEAoIYWN0b3JfaWQYBCABKAkSDgoGYWN0aW9uGAUgASgJEg4KBnRhcmdldBgGIAEoCRIUCgxkZXRhaWxzX2pzb24YByABKAkSEgoKcmVxdWVzdF9pZBgIIAEoCSKqAQoWTGlzdEF1ZGl0RXZlbnRzUmVxdWVzdBIOCgZhY3Rpb24YASABKAkSKQoFc2luY2UYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhEKCXBhZ2Vfc2l6ZRgDIAEoBRINCgVhY3RvchgEIAEoCRIPCgdhY3Rpb25zGAUgAygJEg4KBnRhcmdldBgGIAEoCRISCgpwYWdlX3Rva2VuGAcgASgJImIKF0xpc3RBdWRpdEV2ZW50c1Jlc3BvbnNlEi4KBmV2ZW50cxgBIAMoCzIeLnRvc2hpLndvcmtzcGFjZS52MS5BdWRpdEV2ZW50EhcKD25leHRfcGFnZV90b2tlbhgCIAEoCTJ/ChFBdWRpdEV2ZW50U2VydmljZRJqCg9MaXN0QXVkaXRFdmVudHMSKi50b3NoaS53b3Jrc3BhY2UudjEuTGlzdEF1ZGl0RXZlbnRzUmVxdWVzdBorLnRvc2hpLndvcmtzcGFjZS52MS5MaXN0QXVkaXRFdmVudHNSZXNwb25zZUItWitnaXRodWIuY29tL3Rvc2hpY2xvdWQvdG9zaGktYXBpL3dvcmtzcGFjZXYxYgZwcm90bzM", [file_google_protobuf_timestamp]);
10
+ export const file_toshi_workspace_v1_audit_events = /*@__PURE__*/ fileDesc("CiV0b3NoaS93b3Jrc3BhY2UvdjEvYXVkaXRfZXZlbnRzLnByb3RvEhJ0b3NoaS53b3Jrc3BhY2UudjEiigIKCkF1ZGl0RXZlbnQSCgoCaWQYASABKAMSJgoCYXQYAiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEhIKCmFjdG9yX2tpbmQYAyABKAkSEAoIYWN0b3JfaWQYBCABKAkSDgoGYWN0aW9uGAUgASgJE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ZS52MS5FeHBvcnRBdWRpdEV2ZW50c1JlcXVlc3QaLS50b3NoaS53b3Jrc3BhY2UudjEuRXhwb3J0QXVkaXRFdmVudHNSZXNwb25zZSI+wvMYCmF1ZGl0LnJlYWTS8xgsChVhdWRpdF9ldmVudHMuZXhwb3J0ZWQSE3dvcmtzcGFjZTp3b3Jrc3BhY2UwAUIiWiBnby50b3NoaWNsb3VkLmlvL2FwaS93b3Jrc3BhY2V2MWIGcHJvdG8z", [file_google_protobuf_timestamp, file_toshi_permission]);
10
11
  /**
11
12
  * Describes the message toshi.workspace.v1.AuditEvent.
12
13
  * Use `create(AuditEventSchema)` to create a new message.
@@ -22,6 +23,16 @@ export const ListAuditEventsRequestSchema = /*@__PURE__*/ messageDesc(file_toshi
22
23
  * Use `create(ListAuditEventsResponseSchema)` to create a new message.
23
24
  */
24
25
  export const ListAuditEventsResponseSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_audit_events, 2);
26
+ /**
27
+ * Describes the message toshi.workspace.v1.ExportAuditEventsRequest.
28
+ * Use `create(ExportAuditEventsRequestSchema)` to create a new message.
29
+ */
30
+ export const ExportAuditEventsRequestSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_audit_events, 3);
31
+ /**
32
+ * Describes the message toshi.workspace.v1.ExportAuditEventsResponse.
33
+ * Use `create(ExportAuditEventsResponseSchema)` to create a new message.
34
+ */
35
+ export const ExportAuditEventsResponseSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_audit_events, 4);
25
36
  /**
26
37
  * AuditEventService reads the workspace's audit log: what its members, its
27
38
  * tokens, the operator and the control plane did in it.