@viamrobotics/sdk 0.38.1 → 0.40.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 (37) hide show
  1. package/dist/api-version.d.ts +1 -1
  2. package/dist/app/app-client.d.ts +651 -12
  3. package/dist/app/billing-client.d.ts +54 -0
  4. package/dist/app/data-client.d.ts +336 -10
  5. package/dist/app/ml-training-client.d.ts +94 -0
  6. package/dist/components/arm/arm.d.ts +82 -7
  7. package/dist/components/base/base.d.ts +106 -4
  8. package/dist/components/board/board.d.ts +119 -2
  9. package/dist/components/button/button.d.ts +12 -1
  10. package/dist/components/camera/camera.d.ts +51 -2
  11. package/dist/components/encoder/encoder.d.ts +36 -2
  12. package/dist/components/gantry/gantry.d.ts +84 -6
  13. package/dist/components/generic/generic.d.ts +16 -1
  14. package/dist/components/gripper/gripper.d.ts +62 -5
  15. package/dist/components/input-controller/input-controller.d.ts +36 -2
  16. package/dist/components/motor/motor.d.ts +108 -4
  17. package/dist/components/movement-sensor/movement-sensor.d.ts +114 -10
  18. package/dist/components/power-sensor/power-sensor.d.ts +54 -4
  19. package/dist/components/sensor/sensor.d.ts +12 -1
  20. package/dist/components/servo/servo.d.ts +54 -4
  21. package/dist/components/switch/switch.d.ts +49 -3
  22. package/dist/gen/app/data/v1/data_pb.d.ts +81 -0
  23. package/dist/gen/app/v1/app_pb.d.ts +45 -0
  24. package/dist/gen/app/v1/billing_connect.d.ts +23 -1
  25. package/dist/gen/app/v1/billing_pb.d.ts +91 -0
  26. package/dist/main.d.ts +1 -0
  27. package/dist/main.es.js +5940 -4409
  28. package/dist/main.umd.js +7 -7
  29. package/dist/robot/client.d.ts +28 -2
  30. package/dist/robot/robot.d.ts +80 -8
  31. package/dist/services/data-manager/client.d.ts +32 -0
  32. package/dist/services/ml-model/client.d.ts +13 -0
  33. package/dist/services/ml-model/index.d.ts +2 -0
  34. package/dist/services/ml-model/ml-model.d.ts +7 -0
  35. package/dist/services/vision/vision.d.ts +77 -0
  36. package/dist/types.d.ts +9 -0
  37. package/package.json +1 -1
@@ -2,18 +2,19 @@ import type { JsonValue } from '@bufbuild/protobuf';
2
2
  import { Struct } from '@bufbuild/protobuf';
3
3
  import { type Transport } from '@connectrpc/connect';
4
4
  import { PackageType } from '../gen/app/packages/v1/packages_pb';
5
- import { APIKeyWithAuthorizations, Authorization, AuthorizedPermissions, CreateKeyFromExistingKeyAuthorizationsResponse, CreateKeyResponse, CreateModuleResponse, Fragment, FragmentVisibility, GetRobotPartLogsResponse, GetRobotPartResponse, ListOrganizationMembersResponse, Location, LocationAuth, Model, Module, Organization, OrganizationIdentity, OrganizationInvite, OrgDetails, RegistryItem, RegistryItemStatus, Robot, RobotPart, RobotPartHistoryEntry, RotateKeyResponse, RoverRentalRobot, Visibility } from '../gen/app/v1/app_pb';
5
+ import { APIKeyWithAuthorizations, Authorization, AuthorizedPermissions, CreateKeyFromExistingKeyAuthorizationsResponse, CreateKeyResponse, CreateModuleResponse, Fragment, FragmentVisibility, GetAppContentResponse, GetRobotPartLogsResponse, GetRobotPartResponse, ListOrganizationMembersResponse, Location, LocationAuth, Model, Module, Organization, OrganizationIdentity, OrganizationInvite, OrgDetails, RegistryItem, RegistryItemStatus, Robot, RobotPart, RobotPartHistoryEntry, RotateKeyResponse, RoverRentalRobot, Visibility } from '../gen/app/v1/app_pb';
6
6
  import type { LogEntry } from '../gen/common/v1/common_pb';
7
7
  /**
8
8
  * Creates an Authorization object from auth details.
9
9
  *
10
10
  * @param organizationId The ID of the organization to create the role under
11
- * @param entityId The ID of the entity the role belongs to (e.g., a user ID)
11
+ * @param entityId The ID of the entity the role belongs to (for example a user
12
+ * ID)
12
13
  * @param role The role to add ("owner" or "operator")
13
14
  * @param resourceType The type of resource to create the role for ("robot",
14
15
  * "location", or "organization")
15
- * @param identityType The type of identity that the identity ID is (e.g., an
16
- * api-key)
16
+ * @param identityType The type of identity that the identity ID is (for example
17
+ * an api-key)
17
18
  * @param resourceId The ID of the resource the role is being created for
18
19
  */
19
20
  export declare const createAuth: (organizationId: string, entityId: string, role: string, resourceType: string, identityType: string, resourceId: string) => Authorization;
@@ -40,7 +41,16 @@ export declare class AppClient {
40
41
  private client;
41
42
  constructor(transport: Transport);
42
43
  /**
43
- * Obain a user's ID from their email address.
44
+ * Obtain a user's ID from their email address. Internal use only.
45
+ *
46
+ * @example
47
+ *
48
+ * ```ts
49
+ * // This method is used internally only. To obtain a user's ID, use the listOrganizationsByUser method.
50
+ * const members = await appClient.listOrganizationMembers(
51
+ * '<YOUR-ORGANIZATION-ID>'
52
+ * );
53
+ * ```
44
54
  *
45
55
  * @param email The email address of the user
46
56
  * @returns The user's ID
@@ -56,18 +66,33 @@ export declare class AppClient {
56
66
  /**
57
67
  * List all organizations.
58
68
  *
69
+ * @example
70
+ *
71
+ * ```ts
72
+ * const organizations = await appClient.listOrganizations();
73
+ * ```
74
+ *
59
75
  * @returns The organization list
60
76
  */
61
77
  listOrganizations(): Promise<Organization[]>;
62
78
  /**
63
79
  * List all organizations with access to a particular location.
64
80
  *
81
+ * @example
82
+ *
83
+ * ```ts
84
+ * const organizations =
85
+ * await appClient.getOrganizationsWithAccessToLocation(
86
+ * '<YOUR-LOCATION-ID>'
87
+ * );
88
+ * ```
89
+ *
65
90
  * @param locationId The ID of the location to query
66
91
  * @returns The list of locations with access to the requested location
67
92
  */
68
93
  getOrganizationsWithAccessToLocation(locationId: string): Promise<OrganizationIdentity[]>;
69
94
  /**
70
- * List all organizations associated with a user.
95
+ * List all organizations associated with a user. Internal use only.
71
96
  *
72
97
  * @param userId The ID of the user to query
73
98
  * @returns The list of locations the requested user has access to
@@ -76,6 +101,14 @@ export declare class AppClient {
76
101
  /**
77
102
  * Get details about an organization.
78
103
  *
104
+ * @example
105
+ *
106
+ * ```ts
107
+ * const organization = await appClient.getOrganization(
108
+ * '<YOUR-ORGANIZATION-ID>'
109
+ * );
110
+ * ```
111
+ *
79
112
  * @param organizationId The ID of the organization
80
113
  * @returns Details about the organization, if it exists
81
114
  */
@@ -83,6 +116,13 @@ export declare class AppClient {
83
116
  /**
84
117
  * Find out if an organization namespace is available.
85
118
  *
119
+ * @example
120
+ *
121
+ * ```ts
122
+ * const isAvailable =
123
+ * await appClient.getOrganizationNamespaceAvailability('name');
124
+ * ```
125
+ *
86
126
  * @param namespace The namespace to query for availability
87
127
  * @returns A boolean indicating whether or not the namespace is available
88
128
  */
@@ -90,6 +130,15 @@ export declare class AppClient {
90
130
  /**
91
131
  * Updates organization details.
92
132
  *
133
+ * @example
134
+ *
135
+ * ```ts
136
+ * const organization = await appClient.updateOrganization(
137
+ * '<YOUR-ORGANIZATION-ID>',
138
+ * 'newName'
139
+ * );
140
+ * ```
141
+ *
93
142
  * @param organizationId The id of the organization to update
94
143
  * @param name Optional name to update the organization with
95
144
  * @param publicNamespace Optional namespace to update the organization with
@@ -101,12 +150,26 @@ export declare class AppClient {
101
150
  /**
102
151
  * Deletes an organization.
103
152
  *
153
+ * @example
154
+ *
155
+ * ```ts
156
+ * await appClient.deleteOrganization('<YOUR-ORGANIZATION-ID>');
157
+ * ```
158
+ *
104
159
  * @param organizationId The id of the organization to delete
105
160
  */
106
161
  deleteOrganization(organizationId: string): Promise<void>;
107
162
  /**
108
163
  * Lists organization memebers and outstanding invites.
109
164
  *
165
+ * @example
166
+ *
167
+ * ```ts
168
+ * const members = await appClient.listOrganizationMembers(
169
+ * '<YOUR-ORGANIZATION-ID>'
170
+ * );
171
+ * ```
172
+ *
110
173
  * @param organizationId The id of the organization to query
111
174
  * @returns An object containing organization members, pending invites, and
112
175
  * org ID
@@ -115,6 +178,27 @@ export declare class AppClient {
115
178
  /**
116
179
  * Creates a new invitation to join an organization.
117
180
  *
181
+ * @example
182
+ *
183
+ * ```ts
184
+ * const auth = new VIAM.appApi.Authorization({
185
+ * authorizationType: 'role',
186
+ * authorizationId: 'organization_operator',
187
+ * organizationId: '<YOUR-ORGANIZATION-ID>',
188
+ * resourceId: '<YOUR-RESOURCE-ID>', // The resource to grant access to
189
+ * resourceType: 'organization', // The type of resource to grant access to
190
+ * identityId: '<YOUR-USER-ID>', // The user id of the user to grant access to (optional)
191
+ * roleId: 'owner', // The role to grant access to
192
+ * identityType: 'user',
193
+ * });
194
+ *
195
+ * const invite = await appClient.createOrganizationInvite(
196
+ * '<YOUR-ORGANIZATION-ID>',
197
+ * 'youremail@email.com',
198
+ * [auth]
199
+ * );
200
+ * ```
201
+ *
118
202
  * @param organizationId The id of the organization to create the invite for
119
203
  * @param email The email address of the user to generate an invite for
120
204
  * @param authorizations The authorizations to associate with the new invite
@@ -126,6 +210,27 @@ export declare class AppClient {
126
210
  /**
127
211
  * Updates authorizations for an existing org invite.
128
212
  *
213
+ * @example
214
+ *
215
+ * ```ts
216
+ * const auth = new VIAM.appApi.Authorization({
217
+ * authorizationType: 'role',
218
+ * authorizationId: 'organization_operator',
219
+ * organizationId: '<YOUR-ORGANIZATION-ID>',
220
+ * resourceId: '<YOUR-RESOURCE-ID>', // The resource to grant access to
221
+ * resourceType: 'organization', // The type of resource to grant access to
222
+ * identityId: '<YOUR-USER-ID>', // The user id of the user to grant access to (optional)
223
+ * roleId: 'owner', // The role to grant access to
224
+ * identityType: 'user',
225
+ * });
226
+ * const invite = await appClient.updateOrganizationInviteAuthorizations(
227
+ * '<YOUR-ORGANIZATION-ID>',
228
+ * 'youremail@email.com',
229
+ * [auth],
230
+ * []
231
+ * );
232
+ * ```
233
+ *
129
234
  * @param organizationId The id of the organization
130
235
  * @param email The email address associated with the invite
131
236
  * @param addAuthsList List of authorizations to add to the invite
@@ -136,6 +241,15 @@ export declare class AppClient {
136
241
  /**
137
242
  * Removes a member from an organization.
138
243
  *
244
+ * @example
245
+ *
246
+ * ```ts
247
+ * await appClient.deleteOrganizationMember(
248
+ * '<YOUR-ORGANIZATION-ID>',
249
+ * '<YOUR-USER-ID>'
250
+ * );
251
+ * ```
252
+ *
139
253
  * @param organizationId The ID of the organization
140
254
  * @param userId The ID of the user
141
255
  */
@@ -143,6 +257,15 @@ export declare class AppClient {
143
257
  /**
144
258
  * Deletes a pending organization invite.
145
259
  *
260
+ * @example
261
+ *
262
+ * ```ts
263
+ * await appClient.deleteOrganizationInvite(
264
+ * '<YOUR-ORGANIZATION-ID>',
265
+ * 'youremail@email.com'
266
+ * );
267
+ * ```
268
+ *
146
269
  * @param organizationId The ID of the organization
147
270
  * @param email The email associated with the invite to delete
148
271
  */
@@ -150,6 +273,15 @@ export declare class AppClient {
150
273
  /**
151
274
  * Resends a pending organization invite.
152
275
  *
276
+ * @example
277
+ *
278
+ * ```ts
279
+ * const invite = await appClient.resendOrganizationInvite(
280
+ * '<YOUR-ORGANIZATION-ID>',
281
+ * 'youremail@email.com'
282
+ * );
283
+ * ```
284
+ *
153
285
  * @param organizationId The ID of the organization
154
286
  * @param email The email associated with the invite to resend
155
287
  * @returns The invite
@@ -158,6 +290,15 @@ export declare class AppClient {
158
290
  /**
159
291
  * Creates a new location.
160
292
  *
293
+ * @example
294
+ *
295
+ * ```ts
296
+ * const location = await appClient.createLocation(
297
+ * '<YOUR-ORGANIZATION-ID>',
298
+ * 'name'
299
+ * );
300
+ * ```
301
+ *
161
302
  * @param organizationId The ID of the organization to create the location
162
303
  * under
163
304
  * @param name The name of the location to create
@@ -169,6 +310,12 @@ export declare class AppClient {
169
310
  /**
170
311
  * Looks up a location.
171
312
  *
313
+ * @example
314
+ *
315
+ * ```ts
316
+ * const location = await appClient.getLocation('<YOUR-LOCATION-ID>');
317
+ * ```
318
+ *
172
319
  * @param locId The ID of the location to query.
173
320
  * @returns The location object
174
321
  */
@@ -176,6 +323,15 @@ export declare class AppClient {
176
323
  /**
177
324
  * Updates location details.
178
325
  *
326
+ * @example
327
+ *
328
+ * ```ts
329
+ * const location = await appClient.updateLocation(
330
+ * '<YOUR-LOCATION-ID>',
331
+ * 'newName'
332
+ * );
333
+ * ```
334
+ *
179
335
  * @param locId The ID of the location to update
180
336
  * @param name Optional string to update the location's name to
181
337
  * @param parentLocId Optional string to update the location's parent location
@@ -187,12 +343,26 @@ export declare class AppClient {
187
343
  /**
188
344
  * Deletes a location
189
345
  *
346
+ * @example
347
+ *
348
+ * ```ts
349
+ * await appClient.deleteLocation('<YOUR-LOCATION-ID>');
350
+ * ```
351
+ *
190
352
  * @param locId The ID of the location to delete
191
353
  */
192
354
  deleteLocation(locId: string): Promise<void>;
193
355
  /**
194
356
  * Lists all locations under an organization.
195
357
  *
358
+ * @example
359
+ *
360
+ * ```ts
361
+ * const locations = await appClient.listLocations(
362
+ * '<YOUR-ORGANIZATION-ID>'
363
+ * );
364
+ * ```
365
+ *
196
366
  * @param organizationId The ID of the organization to query
197
367
  * @returns A list of locations under the organization
198
368
  */
@@ -200,6 +370,15 @@ export declare class AppClient {
200
370
  /**
201
371
  * Shares a location with another organization
202
372
  *
373
+ * @example
374
+ *
375
+ * ```ts
376
+ * await appClient.shareLocation(
377
+ * '<OTHER-ORGANIZATION-ID>',
378
+ * '<YOUR-LOCATION-ID>'
379
+ * );
380
+ * ```
381
+ *
203
382
  * @param organizationId The ID of the organization to share with
204
383
  * @param locId The ID of the location to share
205
384
  */
@@ -207,6 +386,15 @@ export declare class AppClient {
207
386
  /**
208
387
  * Unshares a location with an organization
209
388
  *
389
+ * @example
390
+ *
391
+ * ```ts
392
+ * await appClient.unshareLocation(
393
+ * '<OTHER-ORGANIZATION-ID>',
394
+ * '<YOUR-LOCATION-ID>'
395
+ * );
396
+ * ```
397
+ *
210
398
  * @param organizationId The ID of the organization to unshare with
211
399
  * @param locId The ID of the location to unshare
212
400
  */
@@ -214,6 +402,14 @@ export declare class AppClient {
214
402
  /**
215
403
  * Get a location's `LocationAuth` (location secret(s)).
216
404
  *
405
+ * @example
406
+ *
407
+ * ```ts
408
+ * const locationAuth = await appClient.locationAuth(
409
+ * '<YOUR-LOCATION-ID>'
410
+ * );
411
+ * ```
412
+ *
217
413
  * @param locId The ID of the location to retrieve `LocationAuth` from.
218
414
  * @returns The `LocationAuth` for the requested location.
219
415
  */
@@ -221,6 +417,14 @@ export declare class AppClient {
221
417
  /**
222
418
  * Create a location secret (`LocationAuth`).
223
419
  *
420
+ * @example
421
+ *
422
+ * ```ts
423
+ * const locationAuth = await appClient.createLocationSecret(
424
+ * '<YOUR-LOCATION-ID>'
425
+ * );
426
+ * ```
427
+ *
224
428
  * @param locId The ID of the location to create a `LocationAuth` for
225
429
  * @returns The newly created `LocationAuth`
226
430
  */
@@ -228,6 +432,15 @@ export declare class AppClient {
228
432
  /**
229
433
  * Deletes a location secret (`LocationAuth`).
230
434
  *
435
+ * @example
436
+ *
437
+ * ```ts
438
+ * await appClient.deleteLocationSecret(
439
+ * '<YOUR-LOCATION-ID>',
440
+ * '<YOUR-SECRET-ID>'
441
+ * );
442
+ * ```
443
+ *
231
444
  * @param locId The ID of the location to delete the `LocationAuth` from
232
445
  * @param secretId The ID of the location secret to delete
233
446
  */
@@ -235,6 +448,12 @@ export declare class AppClient {
235
448
  /**
236
449
  * Queries a robot by its ID.
237
450
  *
451
+ * @example
452
+ *
453
+ * ```ts
454
+ * const robot = await appClient.getRobot('<YOUR-ROBOT-ID>');
455
+ * ```
456
+ *
238
457
  * @param id The ID of the robot
239
458
  * @returns The `Robot` object
240
459
  */
@@ -242,6 +461,14 @@ export declare class AppClient {
242
461
  /**
243
462
  * Returns a list of rover rental robots for an organization.
244
463
  *
464
+ * @example
465
+ *
466
+ * ```ts
467
+ * const roverRentalRobots = await appClient.getRoverRentalRobots(
468
+ * '<YOUR-ORGANIZATION-ID>'
469
+ * );
470
+ * ```
471
+ *
245
472
  * @param orgId The ID of the organization to query
246
473
  * @returns The list of `RoverRentalRobot` objects
247
474
  */
@@ -249,6 +476,12 @@ export declare class AppClient {
249
476
  /**
250
477
  * Returns a list of parts for a given robot
251
478
  *
479
+ * @example
480
+ *
481
+ * ```ts
482
+ * const robotParts = await appClient.getRobotParts('<YOUR-ROBOT-ID>');
483
+ * ```
484
+ *
252
485
  * @param robotId The ID of the robot to query
253
486
  * @returns The list of `RobotPart` objects associated with the robot
254
487
  */
@@ -256,6 +489,12 @@ export declare class AppClient {
256
489
  /**
257
490
  * Queries a specific robot part by ID.
258
491
  *
492
+ * @example
493
+ *
494
+ * ```ts
495
+ * const robotPart = await appClient.getRobotPart('<YOUR-ROBOT-PART-ID>');
496
+ * ```
497
+ *
259
498
  * @param id The ID of the requested robot part
260
499
  * @returns The robot part and a its json config
261
500
  */
@@ -264,6 +503,14 @@ export declare class AppClient {
264
503
  * Get a page of log entries for a specific robot part. Logs are sorted by
265
504
  * descending time (newest first).
266
505
  *
506
+ * @example
507
+ *
508
+ * ```ts
509
+ * const robotPartLogs = await appClient.getRobotPartLogs(
510
+ * '<YOUR-ROBOT-PART-ID>'
511
+ * );
512
+ * ```
513
+ *
267
514
  * @param id The ID of the requested robot part
268
515
  * @param filter Optional string to filter logs on
269
516
  * @param levels Optional array of log levels to return. Defaults to returning
@@ -278,6 +525,14 @@ export declare class AppClient {
278
525
  * Get a stream of log entries for a specific robot part. Logs are sorted by
279
526
  * descending time (newest first).
280
527
  *
528
+ * @example
529
+ *
530
+ * ```ts
531
+ * const robotPartLogs = await appClient.tailRobotPartLogs(
532
+ * '<YOUR-ROBOT-PART-ID>'
533
+ * );
534
+ * ```
535
+ *
281
536
  * @param id The ID of the requested robot part
282
537
  * @param queue A queue to put the log entries into
283
538
  * @param filter Optional string to filter logs on
@@ -288,6 +543,14 @@ export declare class AppClient {
288
543
  /**
289
544
  * Get a list containing the history of a robot part.
290
545
  *
546
+ * @example
547
+ *
548
+ * ```ts
549
+ * const robotPartHistory = await appClient.getRobotPartHistory(
550
+ * '<YOUR-ROBOT-PART-ID>'
551
+ * );
552
+ * ```
553
+ *
291
554
  * @param id The ID of the requested robot part
292
555
  * @returns The list of the robot part's history
293
556
  */
@@ -295,6 +558,15 @@ export declare class AppClient {
295
558
  /**
296
559
  * Updates a robot part based on its ID.
297
560
  *
561
+ * @example
562
+ *
563
+ * ```ts
564
+ * const robotPart = await appClient.updateRobotPart(
565
+ * '<YOUR-ROBOT-PART-ID>',
566
+ * 'newName'
567
+ * );
568
+ * ```
569
+ *
298
570
  * @param id The ID of the requested robot part
299
571
  * @param name The new name of the robot part
300
572
  * @param robotConfig The new config for the robot part
@@ -304,6 +576,15 @@ export declare class AppClient {
304
576
  /**
305
577
  * Creates a new robot part.
306
578
  *
579
+ * @example
580
+ *
581
+ * ```ts
582
+ * const robotPartId = await appClient.newRobotPart(
583
+ * '<YOUR-ROBOT-ID>',
584
+ * 'newPart'
585
+ * );
586
+ * ```
587
+ *
307
588
  * @param robotId The ID of the robot to create a part for
308
589
  * @param partName The name for the new robot part
309
590
  * @returns The ID of the newly-created robot part
@@ -312,12 +593,25 @@ export declare class AppClient {
312
593
  /**
313
594
  * Deletes a robot part.
314
595
  *
596
+ * @example
597
+ *
598
+ * ```ts
599
+ * await appClient.deleteRobotPart('<YOUR-ROBOT-PART-ID>');
600
+ * ```
601
+ *
315
602
  * @param partId The ID of the part to delete
316
603
  */
317
604
  deleteRobotPart(partId: string): Promise<void>;
318
605
  /**
319
606
  * Gets a list of a robot's API keys.
320
607
  *
608
+ * @example
609
+ *
610
+ * ```ts
611
+ * const robotAPIKeys =
612
+ * await appClient.getRobotAPIKeys('<YOUR-ROBOT-ID>');
613
+ * ```
614
+ *
321
615
  * @param robotId The ID of the robot to get API keys for
322
616
  * @returns A list of the robot's API keys
323
617
  */
@@ -325,18 +619,38 @@ export declare class AppClient {
325
619
  /**
326
620
  * Marks a robot part as the main part.
327
621
  *
622
+ * @example
623
+ *
624
+ * ```ts
625
+ * await appClient.markPartAsMain('<YOUR-ROBOT-PART-ID>');
626
+ * ```
627
+ *
328
628
  * @param partId The ID of the part to mark as main
329
629
  */
330
630
  markPartAsMain(partId: string): Promise<void>;
331
631
  /**
332
632
  * Marks a robot part for restart.
333
633
  *
634
+ * @example
635
+ *
636
+ * ```ts
637
+ * await appClient.markPartForRestart('<YOUR-ROBOT-PART-ID>');
638
+ * ```
639
+ *
334
640
  * @param partId The ID of the part to mark for restart
335
641
  */
336
642
  markPartForRestart(partId: string): Promise<void>;
337
643
  /**
338
644
  * Creates a new secret for a robot part.
339
645
  *
646
+ * @example
647
+ *
648
+ * ```ts
649
+ * const robotPart = await appClient.createRobotPartSecret(
650
+ * '<YOUR-ROBOT-PART-ID>'
651
+ * );
652
+ * ```
653
+ *
340
654
  * @param partId The ID of the part to create a secret for
341
655
  * @returns The robot part object
342
656
  */
@@ -344,6 +658,15 @@ export declare class AppClient {
344
658
  /**
345
659
  * Deletes a robot secret from a robot part.
346
660
  *
661
+ * @example
662
+ *
663
+ * ```ts
664
+ * await appClient.deleteRobotPartSecret(
665
+ * '<YOUR-ROBOT-PART-ID>',
666
+ * '<YOUR-SECRET-ID>'
667
+ * );
668
+ * ```
669
+ *
347
670
  * @param partId The ID of the part to delete a secret from
348
671
  * @param secretId The ID of the secret to delete
349
672
  */
@@ -351,6 +674,12 @@ export declare class AppClient {
351
674
  /**
352
675
  * Lists all robots in a location.
353
676
  *
677
+ * @example
678
+ *
679
+ * ```ts
680
+ * const robots = await appClient.listRobots('<YOUR-LOCATION-ID>');
681
+ * ```
682
+ *
354
683
  * @param locId The ID of the location to list robots for
355
684
  * @returns The list of robot objects
356
685
  */
@@ -358,16 +687,36 @@ export declare class AppClient {
358
687
  /**
359
688
  * Creates a new robot.
360
689
  *
690
+ * @example
691
+ *
692
+ * ```ts
693
+ * const robotId = await appClient.newRobot(
694
+ * '<YOUR-LOCATION-ID>',
695
+ * 'newRobot'
696
+ * );
697
+ * ```
698
+ *
361
699
  * @param locId The ID of the location to create the robot in
362
700
  * @param name The name of the new robot
363
701
  * @returns The new robot's ID
364
702
  */
365
703
  newRobot(locId: string, name: string): Promise<string>;
366
704
  /**
367
- * Updates an existing robot's name and/or location.
705
+ * Change the name of an existing machine. You can only change the name of the
706
+ * machine, not the location.
707
+ *
708
+ * @example
709
+ *
710
+ * ```ts
711
+ * const robot = await appClient.updateRobot(
712
+ * '<YOUR-ROBOT-ID>',
713
+ * '<YOUR-LOCATION-ID>',
714
+ * 'newName'
715
+ * );
716
+ * ```
368
717
  *
369
718
  * @param robotId The ID of the robot to update
370
- * @param locId The ID of the location to move the robot to
719
+ * @param locId The ID of the location where the robot is
371
720
  * @param name The name to update the robot to
372
721
  * @returns The newly-modified robot object
373
722
  */
@@ -375,12 +724,26 @@ export declare class AppClient {
375
724
  /**
376
725
  * Deletes a robot.
377
726
  *
727
+ * @example
728
+ *
729
+ * ```ts
730
+ * await appClient.deleteRobot('<YOUR-ROBOT-ID>');
731
+ * ```
732
+ *
378
733
  * @param id The ID of the robot to delete
379
734
  */
380
735
  deleteRobot(id: string): Promise<void>;
381
736
  /**
382
737
  * Lists all fragments within an organization.
383
738
  *
739
+ * @example
740
+ *
741
+ * ```ts
742
+ * const fragments = await appClient.listFragments(
743
+ * '<YOUR-ORGANIZATION-ID>'
744
+ * );
745
+ * ```
746
+ *
384
747
  * @param organizationId The ID of the organization to list fragments for
385
748
  * @param publicOnly Optional, deprecated boolean. Use fragmentVisibilities
386
749
  * instead. If true then only public fragments will be listed. Defaults to
@@ -396,6 +759,14 @@ export declare class AppClient {
396
759
  /**
397
760
  * Looks up a fragment by ID.
398
761
  *
762
+ * @example
763
+ *
764
+ * ```ts
765
+ * const fragment = await appClient.getFragment(
766
+ * '12a12ab1-1234-5678-abcd-abcd01234567'
767
+ * );
768
+ * ```
769
+ *
399
770
  * @param id The ID of the fragment to look up
400
771
  * @returns The requested fragment
401
772
  */
@@ -403,6 +774,15 @@ export declare class AppClient {
403
774
  /**
404
775
  * Creates a new fragment.
405
776
  *
777
+ * @example
778
+ *
779
+ * ```ts
780
+ * const fragment = await appClient.createFragment(
781
+ * '<YOUR-ORGANIZATION-ID>',
782
+ * 'newFragment'
783
+ * );
784
+ * ```
785
+ *
406
786
  * @param organizationId The ID of the organization to create the fragment
407
787
  * under
408
788
  * @param name The name of the new fragment
@@ -413,6 +793,15 @@ export declare class AppClient {
413
793
  /**
414
794
  * Updates an existing fragment.
415
795
  *
796
+ * @example
797
+ *
798
+ * ```ts
799
+ * const fragment = await appClient.updateFragment(
800
+ * '12a12ab1-1234-5678-abcd-abcd01234567',
801
+ * 'better_name'
802
+ * );
803
+ * ```
804
+ *
416
805
  * @param id The ID of the fragment to update
417
806
  * @param name The name to update the fragment to
418
807
  * @param config The config to update the fragment to
@@ -430,10 +819,24 @@ export declare class AppClient {
430
819
  /**
431
820
  * Deletes a fragment.
432
821
  *
822
+ * @example
823
+ *
824
+ * ```ts
825
+ * await appClient.deleteFragment('12a12ab1-1234-5678-abcd-abcd01234567');
826
+ * ```
827
+ *
433
828
  * @param id The ID of the fragment to delete
434
829
  */
435
830
  deleteFragment(id: string): Promise<void>;
436
831
  /**
832
+ * @example
833
+ *
834
+ * ```ts
835
+ * const fragments = await appClient.listMachineFragments(
836
+ * '<YOUR-MACHINE-ID>'
837
+ * );
838
+ * ```
839
+ *
437
840
  * @param machineId The machine ID used to filter fragments defined in a
438
841
  * machine's parts. Also returns any fragments nested within the fragments
439
842
  * defined in parts.
@@ -447,8 +850,21 @@ export declare class AppClient {
447
850
  /**
448
851
  * Add a role under an organization.
449
852
  *
853
+ * @example
854
+ *
855
+ * ```ts
856
+ * await appClient.addRole(
857
+ * '<YOUR-ORGANIZATION-ID>',
858
+ * '<YOUR-USER-ID>',
859
+ * 'owner',
860
+ * 'robot',
861
+ * '<YOUR-ROBOT-ID>'
862
+ * );
863
+ * ```
864
+ *
450
865
  * @param organizationId The ID of the organization to create the role under
451
- * @param entityId The ID of the entity the role belongs to (e.g., a user ID)
866
+ * @param entityId The ID of the entity the role belongs to (for example a
867
+ * user ID)
452
868
  * @param role The role to add ("owner" or "operator")
453
869
  * @param resourceType The type of resource to create the role for ("robot",
454
870
  * "location", or "organization")
@@ -458,8 +874,21 @@ export declare class AppClient {
458
874
  /**
459
875
  * Removes a role from an organization.
460
876
  *
877
+ * @example
878
+ *
879
+ * ```ts
880
+ * await appClient.removeRole(
881
+ * '<YOUR-ORGANIZATION-ID>',
882
+ * '<YOUR-USER-ID>',
883
+ * 'owner',
884
+ * 'robot',
885
+ * '<YOUR-ROBOT-ID>'
886
+ * );
887
+ * ```
888
+ *
461
889
  * @param organizationId The ID of the organization to remove the role from
462
- * @param entityId The ID of the entity the role belongs to (e.g., a user ID)
890
+ * @param entityId The ID of the entity the role belongs to (for example a
891
+ * user ID)
463
892
  * @param role The role to remove ("owner" or "operator")
464
893
  * @param resourceType The type of resource to remove the role from ("robot",
465
894
  * "location", or "organization")
@@ -469,8 +898,31 @@ export declare class AppClient {
469
898
  /**
470
899
  * Changes an existing role.
471
900
  *
472
- * @param oldAuth The existing authorization
473
- * @param newAuth The new authorization
901
+ * @example
902
+ *
903
+ * ```ts
904
+ * const oldAuth = new VIAM.appApi.Authorization({
905
+ * authorizationType: 'role',
906
+ * authorizationId: 'organization_owner',
907
+ * organizationId: '<YOUR-ORGANIZATION-ID>',
908
+ * resourceId: '<YOUR-RESOURCE-ID>', // The resource to grant access to
909
+ * resourceType: 'organization', // The type of resource to grant access to
910
+ * identityId: '<USER-ID>', // The user id of the user to grant access to (optional)
911
+ * roleId: 'owner', // The role to grant access to
912
+ * identityType: 'user',
913
+ * });
914
+ * const newAuth = new VIAM.appApi.Authorization({
915
+ * authorizationType: 'role',
916
+ * authorizationId: 'organization_operator',
917
+ * organizationId: '<YOUR-ORGANIZATION-ID>',
918
+ * resourceId: '<YOUR-RESOURCE-ID>', // The resource to grant access to
919
+ * resourceType: 'organization', // The type of resource to grant access To
920
+ * identityId: '<USER-ID>', // The user id of the user to grant access to (optional)
921
+ * roleId: 'operator', // The role to grant access to
922
+ * identityType: 'user',
923
+ * });
924
+ * await appClient.changeRole(oldAuth, newAuth);
925
+ * ```
474
926
  */
475
927
  changeRole(oldAuthorization: Authorization, newAuthorization: Authorization): Promise<void>;
476
928
  /**
@@ -492,6 +944,14 @@ export declare class AppClient {
492
944
  /**
493
945
  * Get an item from the registry.
494
946
  *
947
+ * @example
948
+ *
949
+ * ```ts
950
+ * const registryItem = await appClient.getRegistryItem(
951
+ * '<YOUR-REGISTRY-ITEM-ID>'
952
+ * );
953
+ * ```
954
+ *
495
955
  * @param itemId The ID of the item to get
496
956
  * @returns The requested item
497
957
  */
@@ -499,6 +959,16 @@ export declare class AppClient {
499
959
  /**
500
960
  * Create a new registry item.
501
961
  *
962
+ * @example
963
+ *
964
+ * ```ts
965
+ * await appClient.createRegistryItem(
966
+ * '<YOUR-ORGANIZATION-ID>',
967
+ * 'newRegistryItemName',
968
+ * 5
969
+ * );
970
+ * ```
971
+ *
502
972
  * @param organizationId The ID of the organization to create the registry
503
973
  * item under
504
974
  * @param name The name of the registry item
@@ -508,6 +978,17 @@ export declare class AppClient {
508
978
  /**
509
979
  * Update an existing registry item.
510
980
  *
981
+ * @example
982
+ *
983
+ * ```ts
984
+ * await appClient.updateRegistryItem(
985
+ * '<YOUR-REGISTRY-ITEM-ID>',
986
+ * 5, // Package: ML Model
987
+ * 'new description',
988
+ * 1 // Private
989
+ * );
990
+ * ```
991
+ *
511
992
  * @param itemId The ID of the registry item to update
512
993
  * @param type The PackageType to update the item to
513
994
  * @param description A description of the item
@@ -517,6 +998,18 @@ export declare class AppClient {
517
998
  /**
518
999
  * List all registry items for an organization.
519
1000
  *
1001
+ * @example
1002
+ *
1003
+ * ```ts
1004
+ * const registryItems = await appClient.listRegistryItems(
1005
+ * '<YOUR-ORGANIZATION-ID>',
1006
+ * [], // All package types
1007
+ * [1], // Private packages
1008
+ * [],
1009
+ * [1] // Active packages
1010
+ * );
1011
+ * ```
1012
+ *
520
1013
  * @param organizationId The ID of the organization to query registry items
521
1014
  * for
522
1015
  * @param types A list of types to query. If empty, will not filter on type
@@ -535,12 +1028,27 @@ export declare class AppClient {
535
1028
  /**
536
1029
  * Deletes a registry item.
537
1030
  *
1031
+ * @example
1032
+ *
1033
+ * ```ts
1034
+ * await appClient.deleteRegistryItem('<YOUR-REGISTRY-ITEM-ID>');
1035
+ * ```
1036
+ *
538
1037
  * @param itemId The ID of the item to delete
539
1038
  */
540
1039
  deleteRegistryItem(itemId: string): Promise<void>;
541
1040
  /**
542
1041
  * Creates a new module.
543
1042
  *
1043
+ * @example
1044
+ *
1045
+ * ```ts
1046
+ * const module = await appClient.createModule(
1047
+ * '<YOUR-ORGANIZATION-ID>',
1048
+ * 'newModule'
1049
+ * );
1050
+ * ```
1051
+ *
544
1052
  * @param organizationId The ID of the organization to create the module under
545
1053
  * @param name The name of the module
546
1054
  * @returns The module ID and a URL to its detail page
@@ -549,6 +1057,19 @@ export declare class AppClient {
549
1057
  /**
550
1058
  * Updates an existing module.
551
1059
  *
1060
+ * @example
1061
+ *
1062
+ * ```ts
1063
+ * const module = await appClient.updateModule(
1064
+ * '<YOUR-MODULE-ID>',
1065
+ * 1,
1066
+ * 'https://example.com',
1067
+ * 'new description',
1068
+ * [{ model: 'namespace:group:model1', api: 'rdk:component:generic' }],
1069
+ * 'entrypoint'
1070
+ * );
1071
+ * ```
1072
+ *
552
1073
  * @param moduleId The ID of the module to update
553
1074
  * @param visibility The visibility to set for the module
554
1075
  * @param url The url to reference for documentation, code, etc.
@@ -561,6 +1082,12 @@ export declare class AppClient {
561
1082
  /**
562
1083
  * Looks up a particular module.
563
1084
  *
1085
+ * @example
1086
+ *
1087
+ * ```ts
1088
+ * const module = await appClient.getModule('<YOUR-MODULE-ID>');
1089
+ * ```
1090
+ *
564
1091
  * @param moduleId The ID of the module
565
1092
  * @returns The requested module
566
1093
  */
@@ -568,6 +1095,12 @@ export declare class AppClient {
568
1095
  /**
569
1096
  * Lists all modules for an organization.
570
1097
  *
1098
+ * @example
1099
+ *
1100
+ * ```ts
1101
+ * const modules = await appClient.listModules('<YOUR-ORGANIZATION-ID>');
1102
+ * ```
1103
+ *
571
1104
  * @param organizationId The ID of the organization to query
572
1105
  * @returns The organization's modules
573
1106
  */
@@ -584,12 +1117,24 @@ export declare class AppClient {
584
1117
  /**
585
1118
  * Deletes an existing API key.
586
1119
  *
1120
+ * @example
1121
+ *
1122
+ * ```ts
1123
+ * await appClient.deleteKey('<YOUR-KEY-ID>');
1124
+ * ```
1125
+ *
587
1126
  * @param id The ID of the key to delete
588
1127
  */
589
1128
  deleteKey(id: string): Promise<import("../gen/app/v1/app_pb").DeleteKeyResponse>;
590
1129
  /**
591
1130
  * List all API keys for an organization.
592
1131
  *
1132
+ * @example
1133
+ *
1134
+ * ```ts
1135
+ * const keys = await appClient.listKeys('<YOUR-ORGANIZATION-ID>');
1136
+ * ```
1137
+ *
593
1138
  * @param orgId The ID of the organization to query
594
1139
  * @returns The list of API keys
595
1140
  */
@@ -597,6 +1142,12 @@ export declare class AppClient {
597
1142
  /**
598
1143
  * Rotates an existing API key.
599
1144
  *
1145
+ * @example
1146
+ *
1147
+ * ```ts
1148
+ * const key = await appClient.rotateKey('<YOUR-KEY-ID>');
1149
+ * ```
1150
+ *
600
1151
  * @param id The ID of the key to rotate
601
1152
  * @returns The updated key and ID
602
1153
  */
@@ -604,13 +1155,47 @@ export declare class AppClient {
604
1155
  /**
605
1156
  * Creates a new key with an existing key's authorizations
606
1157
  *
1158
+ * @example
1159
+ *
1160
+ * ```ts
1161
+ * const key =
1162
+ * await appClient.createKeyFromExistingKeyAuthorizations(
1163
+ * '<YOUR-KEY-ID>'
1164
+ * );
1165
+ * ```
1166
+ *
607
1167
  * @param id The ID of the key to duplicate
608
1168
  * @returns The new key and ID
609
1169
  */
610
1170
  createKeyFromExistingKeyAuthorizations(id: string): Promise<CreateKeyFromExistingKeyAuthorizationsResponse>;
1171
+ /**
1172
+ * Retrieves the app content for an organization.
1173
+ *
1174
+ * @example
1175
+ *
1176
+ * ```ts
1177
+ * const appContent = await appClient.getAppContent(
1178
+ * '<YOUR-PUBLIC-NAMESPACE>',
1179
+ * '<YOUR-APP-NAME>'
1180
+ * );
1181
+ * ```
1182
+ *
1183
+ * @param publicNamespace The public namespace of the organization
1184
+ * @param name The name of the app
1185
+ * @returns The blob path and entrypoint of the app content
1186
+ */
1187
+ getAppContent(publicNamespace: string, name: string): Promise<GetAppContentResponse>;
611
1188
  /**
612
1189
  * Retrieves user-defined metadata for an organization.
613
1190
  *
1191
+ * @example
1192
+ *
1193
+ * ```ts
1194
+ * const metadata = await appClient.getOrganizationMetadata(
1195
+ * '<YOUR-ORGANIZATION-ID>'
1196
+ * );
1197
+ * ```
1198
+ *
614
1199
  * @param id The ID of the organization
615
1200
  * @returns The metadata associated with the organization
616
1201
  */
@@ -618,6 +1203,14 @@ export declare class AppClient {
618
1203
  /**
619
1204
  * Updates user-defined metadata for an organization.
620
1205
  *
1206
+ * @example
1207
+ *
1208
+ * ```ts
1209
+ * await appClient.updateOrganizationMetadata('<YOUR-ORGANIZATION-ID>', {
1210
+ * key: 'value',
1211
+ * });
1212
+ * ```
1213
+ *
621
1214
  * @param id The ID of the organization
622
1215
  * @param data The metadata to update
623
1216
  */
@@ -625,6 +1218,14 @@ export declare class AppClient {
625
1218
  /**
626
1219
  * Retrieves user-defined metadata for a location.
627
1220
  *
1221
+ * @example
1222
+ *
1223
+ * ```ts
1224
+ * const metadata = await appClient.getLocationMetadata(
1225
+ * '<YOUR-LOCATION-ID>'
1226
+ * );
1227
+ * ```
1228
+ *
628
1229
  * @param id The ID of the location
629
1230
  * @returns The metadata associated with the location
630
1231
  */
@@ -632,6 +1233,14 @@ export declare class AppClient {
632
1233
  /**
633
1234
  * Updates user-defined metadata for a location.
634
1235
  *
1236
+ * @example
1237
+ *
1238
+ * ```ts
1239
+ * await appClient.updateLocationMetadata('<YOUR-LOCATION-ID>', {
1240
+ * key: 'value',
1241
+ * });
1242
+ * ```
1243
+ *
635
1244
  * @param id The ID of the location
636
1245
  * @param data The metadata to update
637
1246
  */
@@ -639,6 +1248,12 @@ export declare class AppClient {
639
1248
  /**
640
1249
  * Retrieves user-defined metadata for a robot.
641
1250
  *
1251
+ * @example
1252
+ *
1253
+ * ```ts
1254
+ * const metadata = await appClient.getRobotMetadata('<YOUR-ROBOT-ID>');
1255
+ * ```
1256
+ *
642
1257
  * @param id The ID of the robot
643
1258
  * @returns The metadata associated with the robot
644
1259
  */
@@ -646,6 +1261,14 @@ export declare class AppClient {
646
1261
  /**
647
1262
  * Updates user-defined metadata for a robot.
648
1263
  *
1264
+ * @example
1265
+ *
1266
+ * ```ts
1267
+ * await appClient.updateRobotMetadata('<YOUR-ROBOT-ID>', {
1268
+ * key: 'value',
1269
+ * });
1270
+ * ```
1271
+ *
649
1272
  * @param id The ID of the robot
650
1273
  * @param data The metadata to update
651
1274
  */
@@ -653,6 +1276,14 @@ export declare class AppClient {
653
1276
  /**
654
1277
  * Retrieves user-defined metadata for a robot part.
655
1278
  *
1279
+ * @example
1280
+ *
1281
+ * ```ts
1282
+ * const metadata = await appClient.getRobotPartMetadata(
1283
+ * '<YOUR-ROBOT-PART-ID>'
1284
+ * );
1285
+ * ```
1286
+ *
656
1287
  * @param id The ID of the robot part
657
1288
  * @returns The metadata associated with the robot part
658
1289
  */
@@ -660,6 +1291,14 @@ export declare class AppClient {
660
1291
  /**
661
1292
  * Updates user-defined metadata for a robot part.
662
1293
  *
1294
+ * @example
1295
+ *
1296
+ * ```ts
1297
+ * await appClient.updateRobotPartMetadata('<YOUR-ROBOT-PART-ID>', {
1298
+ * key: 'value',
1299
+ * });
1300
+ * ```
1301
+ *
663
1302
  * @param id The ID of the robot part
664
1303
  * @param data The metadata to update
665
1304
  */