@toshicloud/sdk 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +102 -19
  2. package/dist/client.d.ts +40 -4
  3. package/dist/client.js +35 -4
  4. package/dist/errors.d.ts +99 -0
  5. package/dist/errors.js +208 -0
  6. package/dist/gen/toshi/permission_pb.d.ts +244 -0
  7. package/dist/gen/toshi/permission_pb.js +94 -0
  8. package/dist/gen/toshi/workspace/v1/account_pb.d.ts +590 -0
  9. package/dist/gen/toshi/workspace/v1/account_pb.js +75 -0
  10. package/dist/gen/toshi/workspace/v1/artifacts_pb.d.ts +14 -8
  11. package/dist/gen/toshi/workspace/v1/artifacts_pb.js +10 -7
  12. package/dist/gen/toshi/workspace/v1/audit_events_pb.d.ts +191 -6
  13. package/dist/gen/toshi/workspace/v1/audit_events_pb.js +12 -1
  14. package/dist/gen/toshi/workspace/v1/channels_pb.d.ts +1194 -21
  15. package/dist/gen/toshi/workspace/v1/channels_pb.js +186 -39
  16. package/dist/gen/toshi/workspace/v1/connections_pb.d.ts +1481 -0
  17. package/dist/gen/toshi/workspace/v1/connections_pb.js +208 -0
  18. package/dist/gen/toshi/workspace/v1/discovery_pb.d.ts +924 -0
  19. package/dist/gen/toshi/workspace/v1/discovery_pb.js +231 -0
  20. package/dist/gen/toshi/workspace/v1/display_pb.d.ts +198 -15
  21. package/dist/gen/toshi/workspace/v1/display_pb.js +53 -2
  22. package/dist/gen/toshi/workspace/v1/domains_pb.d.ts +864 -0
  23. package/dist/gen/toshi/workspace/v1/domains_pb.js +152 -0
  24. package/dist/gen/toshi/workspace/v1/fillers_pb.d.ts +12 -4
  25. package/dist/gen/toshi/workspace/v1/fillers_pb.js +2 -1
  26. package/dist/gen/toshi/workspace/v1/grants_pb.d.ts +1297 -0
  27. package/dist/gen/toshi/workspace/v1/grants_pb.js +271 -0
  28. package/dist/gen/toshi/workspace/v1/hostjobs_pb.d.ts +315 -15
  29. package/dist/gen/toshi/workspace/v1/hostjobs_pb.js +11 -5
  30. package/dist/gen/toshi/workspace/v1/hosts_pb.d.ts +196 -7
  31. package/dist/gen/toshi/workspace/v1/hosts_pb.js +13 -7
  32. package/dist/gen/toshi/workspace/v1/images_pb.d.ts +1463 -0
  33. package/dist/gen/toshi/workspace/v1/images_pb.js +263 -0
  34. package/dist/gen/toshi/workspace/v1/products_pb.d.ts +506 -0
  35. package/dist/gen/toshi/workspace/v1/products_pb.js +60 -0
  36. package/dist/gen/toshi/workspace/v1/projects_pb.d.ts +1474 -99
  37. package/dist/gen/toshi/workspace/v1/projects_pb.js +151 -33
  38. package/dist/gen/toshi/workspace/v1/recordings_pb.d.ts +181 -14
  39. package/dist/gen/toshi/workspace/v1/recordings_pb.js +55 -14
  40. package/dist/gen/toshi/workspace/v1/roles_pb.d.ts +1994 -0
  41. package/dist/gen/toshi/workspace/v1/roles_pb.js +355 -0
  42. package/dist/gen/toshi/workspace/v1/secrets_pb.d.ts +314 -8
  43. package/dist/gen/toshi/workspace/v1/secrets_pb.js +43 -18
  44. package/dist/gen/toshi/workspace/v1/storage_providers_pb.d.ts +14 -0
  45. package/dist/gen/toshi/workspace/v1/storage_providers_pb.js +2 -1
  46. package/dist/gen/toshi/workspace/v1/tokens_pb.d.ts +434 -5
  47. package/dist/gen/toshi/workspace/v1/tokens_pb.js +66 -8
  48. package/dist/gen/toshi/workspace/v1/triggers_pb.d.ts +1099 -0
  49. package/dist/gen/toshi/workspace/v1/triggers_pb.js +185 -0
  50. package/dist/gen/toshi/workspace/v1/volumes_pb.d.ts +1052 -33
  51. package/dist/gen/toshi/workspace/v1/volumes_pb.js +170 -11
  52. package/dist/gen/toshi/workspace/v1/webhook_pb.d.ts +66 -8
  53. package/dist/gen/toshi/workspace/v1/webhook_pb.js +5 -4
  54. package/dist/gen/toshi/workspace/v1/workloads_pb.d.ts +2043 -54
  55. package/dist/gen/toshi/workspace/v1/workloads_pb.js +205 -54
  56. package/dist/gen/toshi/workspace/v1/workspace_pb.d.ts +6292 -939
  57. package/dist/gen/toshi/workspace/v1/workspace_pb.js +801 -88
  58. package/dist/gen/toshi/workspace/v1/workspace_service_pb.d.ts +2176 -630
  59. package/dist/gen/toshi/workspace/v1/workspace_service_pb.js +192 -74
  60. package/dist/index.d.ts +10 -1
  61. package/dist/index.js +10 -1
  62. package/dist/interceptors.d.ts +11 -1
  63. package/dist/interceptors.js +38 -4
  64. package/dist/retry.d.ts +18 -0
  65. package/dist/retry.js +228 -22
  66. package/dist/test/procedures.js +100 -5
  67. package/dist/version.d.ts +1 -1
  68. package/dist/version.js +1 -1
  69. package/dist/wait.d.ts +4 -0
  70. package/dist/wait.js +24 -1
  71. package/package.json +3 -2
@@ -0,0 +1,590 @@
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/account.proto.
6
+ */
7
+ export declare const file_toshi_workspace_v1_account: GenFile;
8
+ /**
9
+ * Account is a Toshi user: a person who signs in through one or more
10
+ * identities.
11
+ *
12
+ * @generated from message toshi.workspace.v1.Account
13
+ */
14
+ export type Account = Message<"toshi.workspace.v1.Account"> & {
15
+ /**
16
+ * The user's id: the person a role grant names.
17
+ *
18
+ * @generated from field: string user_id = 1;
19
+ */
20
+ userId: string;
21
+ /**
22
+ * The name and email the user's latest sign-in reported; shown, never
23
+ * matched.
24
+ *
25
+ * @generated from field: string name = 2;
26
+ */
27
+ name: string;
28
+ /**
29
+ * @generated from field: string email = 3;
30
+ */
31
+ email: string;
32
+ /**
33
+ * @generated from field: google.protobuf.Timestamp created_at = 4;
34
+ */
35
+ createdAt?: Timestamp | undefined;
36
+ };
37
+ /**
38
+ * Account is a Toshi user: a person who signs in through one or more
39
+ * identities.
40
+ *
41
+ * @generated from message toshi.workspace.v1.Account
42
+ */
43
+ export type AccountJson = {
44
+ /**
45
+ * The user's id: the person a role grant names.
46
+ *
47
+ * @generated from field: string user_id = 1;
48
+ */
49
+ userId?: string;
50
+ /**
51
+ * The name and email the user's latest sign-in reported; shown, never
52
+ * matched.
53
+ *
54
+ * @generated from field: string name = 2;
55
+ */
56
+ name?: string;
57
+ /**
58
+ * @generated from field: string email = 3;
59
+ */
60
+ email?: string;
61
+ /**
62
+ * @generated from field: google.protobuf.Timestamp created_at = 4;
63
+ */
64
+ createdAt?: TimestampJson;
65
+ };
66
+ /**
67
+ * Describes the message toshi.workspace.v1.Account.
68
+ * Use `create(AccountSchema)` to create a new message.
69
+ */
70
+ export declare const AccountSchema: GenMessage<Account, {
71
+ jsonType: AccountJson;
72
+ }>;
73
+ /**
74
+ * Identity is a user's account at an identity provider.
75
+ *
76
+ * @generated from message toshi.workspace.v1.Identity
77
+ */
78
+ export type Identity = Message<"toshi.workspace.v1.Identity"> & {
79
+ /**
80
+ * "github", "local" for the control plane's local admin, or the OpenID
81
+ * Connect issuer URL. GET /auth/providers lists it as each sign-in
82
+ * provider entry's identity_provider, which joins an identity to the
83
+ * entries that sign it in, and WorkspaceSignIn.issuer is the same value.
84
+ *
85
+ * @generated from field: string provider = 1;
86
+ */
87
+ provider: string;
88
+ /**
89
+ * The account's stable id at the provider.
90
+ *
91
+ * @generated from field: string subject = 2;
92
+ */
93
+ subject: string;
94
+ /**
95
+ * The name the provider shows the account by, as of its latest sign-in.
96
+ *
97
+ * @generated from field: string login = 3;
98
+ */
99
+ login: string;
100
+ /**
101
+ * @generated from field: google.protobuf.Timestamp created_at = 4;
102
+ */
103
+ createdAt?: Timestamp | undefined;
104
+ /**
105
+ * @generated from field: google.protobuf.Timestamp last_sign_in_at = 5;
106
+ */
107
+ lastSignInAt?: Timestamp | undefined;
108
+ };
109
+ /**
110
+ * Identity is a user's account at an identity provider.
111
+ *
112
+ * @generated from message toshi.workspace.v1.Identity
113
+ */
114
+ export type IdentityJson = {
115
+ /**
116
+ * "github", "local" for the control plane's local admin, or the OpenID
117
+ * Connect issuer URL. GET /auth/providers lists it as each sign-in
118
+ * provider entry's identity_provider, which joins an identity to the
119
+ * entries that sign it in, and WorkspaceSignIn.issuer is the same value.
120
+ *
121
+ * @generated from field: string provider = 1;
122
+ */
123
+ provider?: string;
124
+ /**
125
+ * The account's stable id at the provider.
126
+ *
127
+ * @generated from field: string subject = 2;
128
+ */
129
+ subject?: string;
130
+ /**
131
+ * The name the provider shows the account by, as of its latest sign-in.
132
+ *
133
+ * @generated from field: string login = 3;
134
+ */
135
+ login?: string;
136
+ /**
137
+ * @generated from field: google.protobuf.Timestamp created_at = 4;
138
+ */
139
+ createdAt?: TimestampJson;
140
+ /**
141
+ * @generated from field: google.protobuf.Timestamp last_sign_in_at = 5;
142
+ */
143
+ lastSignInAt?: TimestampJson;
144
+ };
145
+ /**
146
+ * Describes the message toshi.workspace.v1.Identity.
147
+ * Use `create(IdentitySchema)` to create a new message.
148
+ */
149
+ export declare const IdentitySchema: GenMessage<Identity, {
150
+ jsonType: IdentityJson;
151
+ }>;
152
+ /**
153
+ * @generated from message toshi.workspace.v1.GetAccountRequest
154
+ */
155
+ export type GetAccountRequest = Message<"toshi.workspace.v1.GetAccountRequest"> & {};
156
+ /**
157
+ * @generated from message toshi.workspace.v1.GetAccountRequest
158
+ */
159
+ export type GetAccountRequestJson = {};
160
+ /**
161
+ * Describes the message toshi.workspace.v1.GetAccountRequest.
162
+ * Use `create(GetAccountRequestSchema)` to create a new message.
163
+ */
164
+ export declare const GetAccountRequestSchema: GenMessage<GetAccountRequest, {
165
+ jsonType: GetAccountRequestJson;
166
+ }>;
167
+ /**
168
+ * @generated from message toshi.workspace.v1.GetAccountResponse
169
+ */
170
+ export type GetAccountResponse = Message<"toshi.workspace.v1.GetAccountResponse"> & {
171
+ /**
172
+ * @generated from field: toshi.workspace.v1.Account account = 1;
173
+ */
174
+ account?: Account | undefined;
175
+ /**
176
+ * @generated from field: repeated toshi.workspace.v1.Identity identities = 2;
177
+ */
178
+ identities: Identity[];
179
+ /**
180
+ * The workspaces the user is a member of, sorted.
181
+ *
182
+ * @generated from field: repeated string workspaces = 3;
183
+ */
184
+ workspaces: string[];
185
+ /**
186
+ * The sign-ins the calling session or access token holds, oldest first:
187
+ * the one that opened it, then each step-up sign-in a session adds. GET
188
+ * /auth/session answers the same rows as signed_in_with.
189
+ *
190
+ * @generated from field: repeated toshi.workspace.v1.SignInProof signed_in_with = 4;
191
+ */
192
+ signedInWith: SignInProof[];
193
+ /**
194
+ * The page where a person installs the control plane's app on an
195
+ * organisation or user account at the code host. The install makes a
196
+ * workspace for that account; the person's next sign-in opens it, as its
197
+ * owner when they administer the account. This is how a person with no
198
+ * workspace gets one: no call here creates a workspace. Empty when the
199
+ * control plane has no app to install. GET /auth/session answers the same
200
+ * page as install_url.
201
+ *
202
+ * @generated from field: string install_url = 5;
203
+ */
204
+ installUrl: string;
205
+ /**
206
+ * The user's requests to join a workspace they are not a member of that
207
+ * wait for one of its admins, or that an admin declined less than a day
208
+ * ago, oldest first. A workspace admin finds the pending ones with
209
+ * RoleService.ListMembers at state PENDING and answers them with
210
+ * ApproveMember or DeclineMember. GET /auth/session answers the same rows
211
+ * as pending.
212
+ *
213
+ * @generated from field: repeated toshi.workspace.v1.JoinRequest pending = 6;
214
+ */
215
+ pending: JoinRequest[];
216
+ };
217
+ /**
218
+ * @generated from message toshi.workspace.v1.GetAccountResponse
219
+ */
220
+ export type GetAccountResponseJson = {
221
+ /**
222
+ * @generated from field: toshi.workspace.v1.Account account = 1;
223
+ */
224
+ account?: AccountJson;
225
+ /**
226
+ * @generated from field: repeated toshi.workspace.v1.Identity identities = 2;
227
+ */
228
+ identities?: IdentityJson[];
229
+ /**
230
+ * The workspaces the user is a member of, sorted.
231
+ *
232
+ * @generated from field: repeated string workspaces = 3;
233
+ */
234
+ workspaces?: string[];
235
+ /**
236
+ * The sign-ins the calling session or access token holds, oldest first:
237
+ * the one that opened it, then each step-up sign-in a session adds. GET
238
+ * /auth/session answers the same rows as signed_in_with.
239
+ *
240
+ * @generated from field: repeated toshi.workspace.v1.SignInProof signed_in_with = 4;
241
+ */
242
+ signedInWith?: SignInProofJson[];
243
+ /**
244
+ * The page where a person installs the control plane's app on an
245
+ * organisation or user account at the code host. The install makes a
246
+ * workspace for that account; the person's next sign-in opens it, as its
247
+ * owner when they administer the account. This is how a person with no
248
+ * workspace gets one: no call here creates a workspace. Empty when the
249
+ * control plane has no app to install. GET /auth/session answers the same
250
+ * page as install_url.
251
+ *
252
+ * @generated from field: string install_url = 5;
253
+ */
254
+ installUrl?: string;
255
+ /**
256
+ * The user's requests to join a workspace they are not a member of that
257
+ * wait for one of its admins, or that an admin declined less than a day
258
+ * ago, oldest first. A workspace admin finds the pending ones with
259
+ * RoleService.ListMembers at state PENDING and answers them with
260
+ * ApproveMember or DeclineMember. GET /auth/session answers the same rows
261
+ * as pending.
262
+ *
263
+ * @generated from field: repeated toshi.workspace.v1.JoinRequest pending = 6;
264
+ */
265
+ pending?: JoinRequestJson[];
266
+ };
267
+ /**
268
+ * Describes the message toshi.workspace.v1.GetAccountResponse.
269
+ * Use `create(GetAccountResponseSchema)` to create a new message.
270
+ */
271
+ export declare const GetAccountResponseSchema: GenMessage<GetAccountResponse, {
272
+ jsonType: GetAccountResponseJson;
273
+ }>;
274
+ /**
275
+ * JoinRequest is a person's request to join a workspace, made when a
276
+ * sign-in finds them in the workspace's account at the code host.
277
+ *
278
+ * @generated from message toshi.workspace.v1.JoinRequest
279
+ */
280
+ export type JoinRequest = Message<"toshi.workspace.v1.JoinRequest"> & {
281
+ /**
282
+ * The workspace's id and, when it has one, its name; else its id again.
283
+ *
284
+ * @generated from field: string workspace = 1;
285
+ */
286
+ workspace: string;
287
+ /**
288
+ * @generated from field: string name = 2;
289
+ */
290
+ name: string;
291
+ /**
292
+ * "pending" while it waits for an admin, "declined" once one declined it.
293
+ *
294
+ * @generated from field: string state = 3;
295
+ */
296
+ state: string;
297
+ /**
298
+ * When a declined request may be asked again: the person's next sign-in
299
+ * after it asks again. Unset while pending.
300
+ *
301
+ * @generated from field: google.protobuf.Timestamp retry_after = 4;
302
+ */
303
+ retryAfter?: Timestamp | undefined;
304
+ };
305
+ /**
306
+ * JoinRequest is a person's request to join a workspace, made when a
307
+ * sign-in finds them in the workspace's account at the code host.
308
+ *
309
+ * @generated from message toshi.workspace.v1.JoinRequest
310
+ */
311
+ export type JoinRequestJson = {
312
+ /**
313
+ * The workspace's id and, when it has one, its name; else its id again.
314
+ *
315
+ * @generated from field: string workspace = 1;
316
+ */
317
+ workspace?: string;
318
+ /**
319
+ * @generated from field: string name = 2;
320
+ */
321
+ name?: string;
322
+ /**
323
+ * "pending" while it waits for an admin, "declined" once one declined it.
324
+ *
325
+ * @generated from field: string state = 3;
326
+ */
327
+ state?: string;
328
+ /**
329
+ * When a declined request may be asked again: the person's next sign-in
330
+ * after it asks again. Unset while pending.
331
+ *
332
+ * @generated from field: google.protobuf.Timestamp retry_after = 4;
333
+ */
334
+ retryAfter?: TimestampJson;
335
+ };
336
+ /**
337
+ * Describes the message toshi.workspace.v1.JoinRequest.
338
+ * Use `create(JoinRequestSchema)` to create a new message.
339
+ */
340
+ export declare const JoinRequestSchema: GenMessage<JoinRequest, {
341
+ jsonType: JoinRequestJson;
342
+ }>;
343
+ /**
344
+ * SignInProof is one sign-in a session or access token holds.
345
+ *
346
+ * @generated from message toshi.workspace.v1.SignInProof
347
+ */
348
+ export type SignInProof = Message<"toshi.workspace.v1.SignInProof"> & {
349
+ /**
350
+ * The identity that signed in, as Identity names it.
351
+ *
352
+ * @generated from field: string provider = 1;
353
+ */
354
+ provider: string;
355
+ /**
356
+ * @generated from field: string subject = 2;
357
+ */
358
+ subject: string;
359
+ /**
360
+ * How it signed in: "github", "oidc" for an OpenID Connect issuer, or
361
+ * "local" for the control plane's local admin.
362
+ *
363
+ * @generated from field: string method = 3;
364
+ */
365
+ method: string;
366
+ /**
367
+ * @generated from field: google.protobuf.Timestamp authenticated_at = 4;
368
+ */
369
+ authenticatedAt?: Timestamp | undefined;
370
+ };
371
+ /**
372
+ * SignInProof is one sign-in a session or access token holds.
373
+ *
374
+ * @generated from message toshi.workspace.v1.SignInProof
375
+ */
376
+ export type SignInProofJson = {
377
+ /**
378
+ * The identity that signed in, as Identity names it.
379
+ *
380
+ * @generated from field: string provider = 1;
381
+ */
382
+ provider?: string;
383
+ /**
384
+ * @generated from field: string subject = 2;
385
+ */
386
+ subject?: string;
387
+ /**
388
+ * How it signed in: "github", "oidc" for an OpenID Connect issuer, or
389
+ * "local" for the control plane's local admin.
390
+ *
391
+ * @generated from field: string method = 3;
392
+ */
393
+ method?: string;
394
+ /**
395
+ * @generated from field: google.protobuf.Timestamp authenticated_at = 4;
396
+ */
397
+ authenticatedAt?: TimestampJson;
398
+ };
399
+ /**
400
+ * Describes the message toshi.workspace.v1.SignInProof.
401
+ * Use `create(SignInProofSchema)` to create a new message.
402
+ */
403
+ export declare const SignInProofSchema: GenMessage<SignInProof, {
404
+ jsonType: SignInProofJson;
405
+ }>;
406
+ /**
407
+ * @generated from message toshi.workspace.v1.ListIdentitiesRequest
408
+ */
409
+ export type ListIdentitiesRequest = Message<"toshi.workspace.v1.ListIdentitiesRequest"> & {};
410
+ /**
411
+ * @generated from message toshi.workspace.v1.ListIdentitiesRequest
412
+ */
413
+ export type ListIdentitiesRequestJson = {};
414
+ /**
415
+ * Describes the message toshi.workspace.v1.ListIdentitiesRequest.
416
+ * Use `create(ListIdentitiesRequestSchema)` to create a new message.
417
+ */
418
+ export declare const ListIdentitiesRequestSchema: GenMessage<ListIdentitiesRequest, {
419
+ jsonType: ListIdentitiesRequestJson;
420
+ }>;
421
+ /**
422
+ * @generated from message toshi.workspace.v1.ListIdentitiesResponse
423
+ */
424
+ export type ListIdentitiesResponse = Message<"toshi.workspace.v1.ListIdentitiesResponse"> & {
425
+ /**
426
+ * @generated from field: repeated toshi.workspace.v1.Identity identities = 1;
427
+ */
428
+ identities: Identity[];
429
+ };
430
+ /**
431
+ * @generated from message toshi.workspace.v1.ListIdentitiesResponse
432
+ */
433
+ export type ListIdentitiesResponseJson = {
434
+ /**
435
+ * @generated from field: repeated toshi.workspace.v1.Identity identities = 1;
436
+ */
437
+ identities?: IdentityJson[];
438
+ };
439
+ /**
440
+ * Describes the message toshi.workspace.v1.ListIdentitiesResponse.
441
+ * Use `create(ListIdentitiesResponseSchema)` to create a new message.
442
+ */
443
+ export declare const ListIdentitiesResponseSchema: GenMessage<ListIdentitiesResponse, {
444
+ jsonType: ListIdentitiesResponseJson;
445
+ }>;
446
+ /**
447
+ * @generated from message toshi.workspace.v1.UnlinkIdentityRequest
448
+ */
449
+ export type UnlinkIdentityRequest = Message<"toshi.workspace.v1.UnlinkIdentityRequest"> & {
450
+ /**
451
+ * The identity, as Identity names it.
452
+ *
453
+ * @generated from field: string provider = 1;
454
+ */
455
+ provider: string;
456
+ /**
457
+ * @generated from field: string subject = 2;
458
+ */
459
+ subject: string;
460
+ };
461
+ /**
462
+ * @generated from message toshi.workspace.v1.UnlinkIdentityRequest
463
+ */
464
+ export type UnlinkIdentityRequestJson = {
465
+ /**
466
+ * The identity, as Identity names it.
467
+ *
468
+ * @generated from field: string provider = 1;
469
+ */
470
+ provider?: string;
471
+ /**
472
+ * @generated from field: string subject = 2;
473
+ */
474
+ subject?: string;
475
+ };
476
+ /**
477
+ * Describes the message toshi.workspace.v1.UnlinkIdentityRequest.
478
+ * Use `create(UnlinkIdentityRequestSchema)` to create a new message.
479
+ */
480
+ export declare const UnlinkIdentityRequestSchema: GenMessage<UnlinkIdentityRequest, {
481
+ jsonType: UnlinkIdentityRequestJson;
482
+ }>;
483
+ /**
484
+ * @generated from message toshi.workspace.v1.UnlinkIdentityResponse
485
+ */
486
+ export type UnlinkIdentityResponse = Message<"toshi.workspace.v1.UnlinkIdentityResponse"> & {
487
+ /**
488
+ * The identity as it was when it was removed.
489
+ *
490
+ * @generated from field: toshi.workspace.v1.Identity identity = 1;
491
+ */
492
+ identity?: Identity | undefined;
493
+ /**
494
+ * How many dashboard sessions ended, and how many access-token grants
495
+ * were revoked with it.
496
+ *
497
+ * @generated from field: int32 sessions_ended = 2;
498
+ */
499
+ sessionsEnded: number;
500
+ /**
501
+ * @generated from field: int32 grants_revoked = 3;
502
+ */
503
+ grantsRevoked: number;
504
+ };
505
+ /**
506
+ * @generated from message toshi.workspace.v1.UnlinkIdentityResponse
507
+ */
508
+ export type UnlinkIdentityResponseJson = {
509
+ /**
510
+ * The identity as it was when it was removed.
511
+ *
512
+ * @generated from field: toshi.workspace.v1.Identity identity = 1;
513
+ */
514
+ identity?: IdentityJson;
515
+ /**
516
+ * How many dashboard sessions ended, and how many access-token grants
517
+ * were revoked with it.
518
+ *
519
+ * @generated from field: int32 sessions_ended = 2;
520
+ */
521
+ sessionsEnded?: number;
522
+ /**
523
+ * @generated from field: int32 grants_revoked = 3;
524
+ */
525
+ grantsRevoked?: number;
526
+ };
527
+ /**
528
+ * Describes the message toshi.workspace.v1.UnlinkIdentityResponse.
529
+ * Use `create(UnlinkIdentityResponseSchema)` to create a new message.
530
+ */
531
+ export declare const UnlinkIdentityResponseSchema: GenMessage<UnlinkIdentityResponse, {
532
+ jsonType: UnlinkIdentityResponseJson;
533
+ }>;
534
+ /**
535
+ * AccountService reads and changes the caller's own Toshi user: who they
536
+ * are, the identities they sign in with, and the workspaces they are a
537
+ * member of. Its calls are a person's: a dashboard session or a person's
538
+ * access token makes them, without the Toshi-Workspace header and without
539
+ * any role; a workspace token and the operator cannot. The permissions
540
+ * named here are not checked.
541
+ *
542
+ * An identity is added only by signing in through it while signed in, at
543
+ * POST /auth/<name>/link on the control plane, never by a
544
+ * call here and never by a matching email.
545
+ *
546
+ * @generated from service toshi.workspace.v1.AccountService
547
+ */
548
+ export declare const AccountService: GenService<{
549
+ /**
550
+ * GetAccount returns the caller's user, its identities, oldest first,
551
+ * the workspaces it is a member of, sorted, the sign-ins the calling
552
+ * session or access token holds, and where a person installs the app
553
+ * that makes a workspace.
554
+ *
555
+ * @generated from rpc toshi.workspace.v1.AccountService.GetAccount
556
+ */
557
+ getAccount: {
558
+ methodKind: "unary";
559
+ input: typeof GetAccountRequestSchema;
560
+ output: typeof GetAccountResponseSchema;
561
+ };
562
+ /**
563
+ * ListIdentities returns the caller's identities, oldest first.
564
+ *
565
+ * @generated from rpc toshi.workspace.v1.AccountService.ListIdentities
566
+ */
567
+ listIdentities: {
568
+ methodKind: "unary";
569
+ input: typeof ListIdentitiesRequestSchema;
570
+ output: typeof ListIdentitiesResponseSchema;
571
+ };
572
+ /**
573
+ * UnlinkIdentity removes one of the caller's identities, so it no longer
574
+ * signs in as the caller, and ends what was opened through it: its
575
+ * dashboard sessions, and its access tokens with their grants. The
576
+ * caller's other identities and their sessions are kept, and so are the
577
+ * caller's memberships and roles. An identity the caller does not have
578
+ * fails with NOT_FOUND; the caller's last identity with
579
+ * FAILED_PRECONDITION and the reason LAST_IDENTITY in a
580
+ * google.rpc.ErrorInfo detail. A session or token opened through the
581
+ * identity, the calling one included, stops working at its next call.
582
+ *
583
+ * @generated from rpc toshi.workspace.v1.AccountService.UnlinkIdentity
584
+ */
585
+ unlinkIdentity: {
586
+ methodKind: "unary";
587
+ input: typeof UnlinkIdentityRequestSchema;
588
+ output: typeof UnlinkIdentityResponseSchema;
589
+ };
590
+ }>;
@@ -0,0 +1,75 @@
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/account.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
+ import { file_toshi_permission } from "../../permission_pb.js";
7
+ /**
8
+ * Describes the file toshi/workspace/v1/account.proto.
9
+ */
10
+ export const file_toshi_workspace_v1_account = /*@__PURE__*/ fileDesc("CiB0b3NoaS93b3Jrc3BhY2UvdjEvYWNjb3VudC5wcm90bxISdG9zaGkud29ya3NwYWNlLnYxImcKB0FjY291bnQSDwoHdXNlcl9pZBgBIAEoCRIMCgRuYW1lGAIgASgJEg0KBWVtYWlsGAMgASgJEi4KCmNyZWF0ZWRfYXQYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wIqEBCghJZGVudGl0eRIQCghwcm92aWRlchgBIAEoCRIPCgdzdWJqZWN0GAIgASgJEg0KBWxvZ2luGAMgASgJEi4KCmNyZWF0ZWRfYXQYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEjMKD2xhc3Rfc2lnbl9pbl9hdBgFIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiEwoRR2V0QWNjb3VudFJlcXVlc3QiiAIKEkdldEFjY291bnRSZXNwb25zZRIsCgdhY2NvdW50GAEgASgLMhsudG9zaGkud29ya3NwYWNlLnYxLkFjY291bnQSMAoKaWRlbnRpdGllcxgCIAMoCzIcLnRvc2hpLndvcmtzcGFjZS52MS5JZGVudGl0eRISCgp3b3Jrc3BhY2VzGAMgAygJEjcKDnNpZ25lZF9pbl93aXRoGAQgAygLMh8udG9zaGkud29ya3NwYWNlLnYxLlNpZ25JblByb29mEhMKC2luc3RhbGxfdXJsGAUgASgJEjAKB3BlbmRpbmcYBiADKAsyHy50b3NoaS53b3Jrc3BhY2UudjEuSm9pblJlcXVlc3QibgoLSm9pblJlcXVlc3QSEQoJd29ya3NwYWNlGAEgASgJEgwKBG5hbWUYAiABKAkSDQoFc3RhdGUYAyABKAkSLwoLcmV0cnlfYWZ0ZXIYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wInYKC1NpZ25JblByb29mEhAKCHByb3ZpZGVyGAEgASgJEg8KB3N1YmplY3QYAiABKAkSDgoGbWV0aG9kGAMgASgJEjQKEGF1dGhlbnRpY2F0ZWRfYXQYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wIhcKFUxpc3RJZGVudGl0aWVzUmVxdWVzdCJKChZMaXN0SWRlbnRpdGllc1Jlc3BvbnNlEjAKCmlkZW50aXRpZXMYASADKAsyHC50b3NoaS53b3Jrc3BhY2UudjEuSWRlbnRpdHkiOgoVVW5saW5rSWRlbnRpdHlSZXF1ZXN0EhAKCHByb3ZpZGVyGAEgASgJEg8KB3N1YmplY3QYAiABKAkieAoWVW5saW5rSWRlbnRpdHlSZXNwb25zZRIuCghpZGVudGl0eRgBIAEoCzIcLnRvc2hpLndvcmtzcGFjZS52MS5JZGVudGl0eRIWCg5zZXNzaW9uc19lbmRlZBgCIAEoBRIWCg5ncmFudHNfcmV2b2tlZBgDIAEoBTLCAwoOQWNjb3VudFNlcnZpY2USegoKR2V0QWNjb3VudBIlLnRvc2hpLndvcmtzcGFjZS52MS5HZXRBY2NvdW50UmVxdWVzdBomLnRvc2hpLndvcmtzcGFjZS52MS5HZXRBY2NvdW50UmVzcG9uc2UiHcLzGAxtZW1iZXJzLnJlYWTK8xgJd29ya3NwYWNlEoYBCg5MaXN0SWRlbnRpdGllcxIpLnRvc2hpLndvcmtzcGFjZS52MS5MaXN0SWRlbnRpdGllc1JlcXVlc3QaKi50b3NoaS53b3Jrc3BhY2UudjEuTGlzdElkZW50aXRpZXNSZXNwb25zZSIdwvMYDG1lbWJlcnMucmVhZMrzGAl3b3Jrc3BhY2USqgEKDlVubGlua0lkZW50aXR5EikudG9zaGkud29ya3NwYWNlLnYxLlVubGlua0lkZW50aXR5UmVxdWVzdBoqLnRvc2hpLndvcmtzcGFjZS52MS5VbmxpbmtJZGVudGl0eVJlc3BvbnNlIkHC8xgNbWVtYmVycy53cml0ZcrzGAl3b3Jrc3BhY2XS8xgZChFpZGVudGl0eS51bmxpbmtlZBIEbm9uZerzGAIQAUIiWiBnby50b3NoaWNsb3VkLmlvL2FwaS93b3Jrc3BhY2V2MWIGcHJvdG8z", [file_google_protobuf_timestamp, file_toshi_permission]);
11
+ /**
12
+ * Describes the message toshi.workspace.v1.Account.
13
+ * Use `create(AccountSchema)` to create a new message.
14
+ */
15
+ export const AccountSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_account, 0);
16
+ /**
17
+ * Describes the message toshi.workspace.v1.Identity.
18
+ * Use `create(IdentitySchema)` to create a new message.
19
+ */
20
+ export const IdentitySchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_account, 1);
21
+ /**
22
+ * Describes the message toshi.workspace.v1.GetAccountRequest.
23
+ * Use `create(GetAccountRequestSchema)` to create a new message.
24
+ */
25
+ export const GetAccountRequestSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_account, 2);
26
+ /**
27
+ * Describes the message toshi.workspace.v1.GetAccountResponse.
28
+ * Use `create(GetAccountResponseSchema)` to create a new message.
29
+ */
30
+ export const GetAccountResponseSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_account, 3);
31
+ /**
32
+ * Describes the message toshi.workspace.v1.JoinRequest.
33
+ * Use `create(JoinRequestSchema)` to create a new message.
34
+ */
35
+ export const JoinRequestSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_account, 4);
36
+ /**
37
+ * Describes the message toshi.workspace.v1.SignInProof.
38
+ * Use `create(SignInProofSchema)` to create a new message.
39
+ */
40
+ export const SignInProofSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_account, 5);
41
+ /**
42
+ * Describes the message toshi.workspace.v1.ListIdentitiesRequest.
43
+ * Use `create(ListIdentitiesRequestSchema)` to create a new message.
44
+ */
45
+ export const ListIdentitiesRequestSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_account, 6);
46
+ /**
47
+ * Describes the message toshi.workspace.v1.ListIdentitiesResponse.
48
+ * Use `create(ListIdentitiesResponseSchema)` to create a new message.
49
+ */
50
+ export const ListIdentitiesResponseSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_account, 7);
51
+ /**
52
+ * Describes the message toshi.workspace.v1.UnlinkIdentityRequest.
53
+ * Use `create(UnlinkIdentityRequestSchema)` to create a new message.
54
+ */
55
+ export const UnlinkIdentityRequestSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_account, 8);
56
+ /**
57
+ * Describes the message toshi.workspace.v1.UnlinkIdentityResponse.
58
+ * Use `create(UnlinkIdentityResponseSchema)` to create a new message.
59
+ */
60
+ export const UnlinkIdentityResponseSchema = /*@__PURE__*/ messageDesc(file_toshi_workspace_v1_account, 9);
61
+ /**
62
+ * AccountService reads and changes the caller's own Toshi user: who they
63
+ * are, the identities they sign in with, and the workspaces they are a
64
+ * member of. Its calls are a person's: a dashboard session or a person's
65
+ * access token makes them, without the Toshi-Workspace header and without
66
+ * any role; a workspace token and the operator cannot. The permissions
67
+ * named here are not checked.
68
+ *
69
+ * An identity is added only by signing in through it while signed in, at
70
+ * POST /auth/<name>/link on the control plane, never by a
71
+ * call here and never by a matching email.
72
+ *
73
+ * @generated from service toshi.workspace.v1.AccountService
74
+ */
75
+ export const AccountService = /*@__PURE__*/ serviceDesc(file_toshi_workspace_v1_account, 0);