@viamrobotics/sdk 0.78.0 → 0.79.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.
@@ -1 +1 @@
1
- export declare const apiVersion = "v0.1.601";
1
+ export declare const apiVersion = "v0.1.603";
@@ -2,7 +2,7 @@ import type { JsonObject, JsonValue } from '@bufbuild/protobuf';
2
2
  import { Struct } from '@bufbuild/protobuf';
3
3
  import { type Transport } from '@connectrpc/connect';
4
4
  import { type PackageType } from '../gen/app/packages/v1/packages_pb';
5
- import { Authorization, AuthorizedPermissions, type AllowedLoginMethods, type APIKeyWithAuthorizations, type CreateKeyFromExistingKeyAuthorizationsResponse, type CreateKeyResponse, type CreateModuleResponse, type CreateOAuthAppUserResponse, type Fragment, type FragmentImportList, type FragmentVisibility, type GetAppBrandingResponse, type GetAppContentResponse, type GetRobotPartByNameAndLocationResponse, type GetRobotPartLogsResponse, type GetRobotPartResponse, type ListOrganizationMembersResponse, type Location, type LocationAuth, type LocationSummary, type Model, type Module, type Organization, type OrganizationIdentity, type OrganizationInvite, type OrgDetails, type RegistryItem, type RegistryItemBilling, type RegistryItemStatus, type Robot, type RobotPart, type RobotPartHistoryEntry, type RotateKeyResponse, type RoverRentalRobot, type Visibility } from '../gen/app/v1/app_pb';
5
+ import { Authorization, AuthorizedPermissions, type AllowedLoginMethods, type APIKeyWithAuthorizations, type ConfigPropertyChangeResult, type CreateKeyFromExistingKeyAuthorizationsResponse, type CreateKeyResponse, type CreateModuleResponse, type CreateOAuthAppUserResponse, type Fragment, type FragmentImportList, type FragmentVisibility, type GetAppBrandingResponse, type GetAppContentResponse, type GetRobotPartByNameAndLocationResponse, type GetRobotPartLogsResponse, type GetRobotPartResponse, type ListOrganizationMembersResponse, type Location, type LocationAuth, type LocationSummary, type Model, type Module, type Organization, type OrganizationIdentity, type OrganizationInvite, type OrgDetails, type RegistryItem, type RegistryItemBilling, type RegistryItemStatus, type Robot, type RobotPart, type RobotPartHistoryEntry, type RotateKeyResponse, type RoverRentalRobot, type 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.
@@ -642,6 +642,30 @@ export declare class AppClient {
642
642
  * @returns The updated robot part
643
643
  */
644
644
  updateRobotPart(id: string, name: string, robotConfig: Struct): Promise<RobotPart | undefined>;
645
+ /**
646
+ * Sets individual properties in a robot part's config. Each change is written where the property
647
+ * comes from: the part config, a fragment mod or variable, or a new fragment mod.
648
+ *
649
+ * @example
650
+ *
651
+ * ```ts
652
+ * const results = await appClient.setConfigProperty('<YOUR-ROBOT-PART-ID>', [
653
+ * { path: 'components.my-arm.attributes.speed', value: 50 },
654
+ * ]);
655
+ * ```
656
+ *
657
+ * For more information, see [App
658
+ * API](https://docs.viam.com/reference/apis/fleet/#setconfigproperty).
659
+ *
660
+ * @param robotPartId The ID of the robot part to update
661
+ * @param propertyChanges The properties to set, each a path into the config (for example
662
+ * "components.my-arm.frame") and the value to set it to. Changes are applied in order.
663
+ * @returns The result of each change, in the same order as the requested changes
664
+ */
665
+ setConfigProperty(robotPartId: string, propertyChanges: {
666
+ path: string;
667
+ value: JsonValue;
668
+ }[]): Promise<ConfigPropertyChangeResult[]>;
645
669
  /**
646
670
  * Creates a new robot part.
647
671
  *
@@ -46,7 +46,8 @@ export declare class BillingClient {
46
46
  * const invoicesSummary = await billing.getInvoicesSummary('<organization-id>');
47
47
  * ```
48
48
  *
49
- * For more information, see [Billing API](https://docs.viam.com/reference/apis/billing-client/).
49
+ * For more information, see [Billing
50
+ * API](https://docs.viam.com/reference/apis/billing-client/#getinvoicessummary).
50
51
  *
51
52
  * @param orgId - The organization ID.
52
53
  */
@@ -1,4 +1,5 @@
1
1
  import type { Transport } from '@connectrpc/connect';
2
+ import { type RobotClient } from '../robot';
2
3
  import { AppClient } from './app-client';
3
4
  import { BillingClient } from './billing-client';
4
5
  import { DataClient } from './data-client';
@@ -26,6 +27,6 @@ export declare class ViamClient {
26
27
  readonly billingClient: BillingClient;
27
28
  constructor(transport: Transport, credentials: Credentials);
28
29
  getRobotSecretFromHost(host: string): Promise<string | undefined>;
29
- connectToMachine({ host, id }: ViamClientMachineConnectionOpts): Promise<import("../robot").RobotClient>;
30
+ connectToMachine({ host, id, }: ViamClientMachineConnectionOpts): Promise<RobotClient>;
30
31
  }
31
32
  export {};
@@ -4,10 +4,9 @@ export type Credentials = Credential | AccessToken;
4
4
  /** A credential that can be exchanged to obtain an access token */
5
5
  export interface Credential {
6
6
  authEntity: string;
7
- type: CredentialType;
7
+ type: 'api-key';
8
8
  payload: string;
9
9
  }
10
- export type CredentialType = 'api-key' | 'robot-secret';
11
10
  /** An access token used to access protected resources. */
12
11
  export interface AccessToken {
13
12
  type: 'access-token';
@@ -15,4 +14,4 @@ export interface AccessToken {
15
14
  }
16
15
  export declare const isCredential: (object: Credentials | undefined) => object is Credential;
17
16
  /** Initialize an authenticated transport that can access protected resources. */
18
- export declare const createViamTransport: (serviceHost: string, credential: Credential | AccessToken) => Promise<Transport>;
17
+ export declare const createViamTransport: (serviceHost: string, credential: Credentials) => Promise<Transport>;
@@ -117,7 +117,8 @@ export interface Board extends Resource {
117
117
  * const freq = await board.getPWMFrequency('15');
118
118
  * ```
119
119
  *
120
- * For more information, see [Board API](https://docs.viam.com/reference/apis/components/board/).
120
+ * For more information, see [Board
121
+ * API](https://docs.viam.com/reference/apis/components/board/#pwmfrequency).
121
122
  *
122
123
  * @param pin - The pin.
123
124
  */
@@ -30,6 +30,13 @@ export declare enum ModelType {
30
30
  * @generated from enum value: MODEL_TYPE_OBJECT_DETECTION = 3;
31
31
  */
32
32
  OBJECT_DETECTION = 3,
33
+
34
+ /**
35
+ * A policy that controls a robot.
36
+ *
37
+ * @generated from enum value: MODEL_TYPE_ROBOT_POLICY = 4;
38
+ */
39
+ ROBOT_POLICY = 4,
33
40
  }
34
41
 
35
42
  /**
@@ -847,25 +847,37 @@ export declare class AuthConfig extends Message<AuthConfig> {
847
847
  }
848
848
 
849
849
  /**
850
- * A UserPermission describes a User and the permissions granted to
851
- * that user.
850
+ * A UserPermission describes the Users a set of permissions is granted to.
852
851
  *
853
852
  * @generated from message viam.app.v1.UserPermission
854
853
  */
855
854
  export declare class UserPermission extends Message<UserPermission> {
856
855
  /**
857
- * user is the User this UserPermission applies to. A User can only be
858
- * listed in a single UserPermission for a set of UserPermissions.
856
+ * users are the Users these permissions apply to. A User can be listed in
857
+ * only one UserPermission for a set of UserPermissions, counting both users
858
+ * and user.
859
859
  *
860
- * @generated from field: viam.app.v1.User user = 1;
860
+ * @generated from field: repeated viam.app.v1.User users = 3;
861
861
  */
862
- user?: User;
862
+ users: User[];
863
863
 
864
864
  /**
865
+ * permissions are the methods these Users may invoke, by resource. A User
866
+ * named here with no permissions may invoke nothing.
867
+ *
865
868
  * @generated from field: repeated viam.app.v1.Permission permissions = 2;
866
869
  */
867
870
  permissions: Permission[];
868
871
 
872
+ /**
873
+ * user is a single User these permissions apply to. Superseded by users:
874
+ * prefer users in new writers, and expect readers to ignore user when users
875
+ * is set.
876
+ *
877
+ * @generated from field: viam.app.v1.User user = 1;
878
+ */
879
+ user?: User;
880
+
869
881
  constructor(data?: PartialMessage<UserPermission>);
870
882
 
871
883
  static readonly runtime: typeof proto3;
package/dist/main.d.ts CHANGED
@@ -10,8 +10,8 @@ export { RobotClient as Client, createRobotClient, RobotClient, type CloudMetada
10
10
  */
11
11
  export * as robotApi from './gen/robot/v1/robot_pb';
12
12
  export { createViamClient, type ViamClient, type ViamClientOptions } from './app/viam-client';
13
- export { type AccessToken, type Credential, type Credentials, type CredentialType, } from './app/viam-transport';
14
- export { type BinaryDataCaptureUploadOptions, type BinaryID, type DataClient, DatasetType, type FilterOptions, type GetSequenceDatasetExportResponse, type IndexableCollection, type Sequence, SequenceDatasetExportStatus, type SequenceResourceFilter, } from './app/data-client';
13
+ export { type AccessToken, type Credential, type Credentials } from './app/viam-transport';
14
+ export { DatasetType, SequenceDatasetExportStatus, type BinaryDataCaptureUploadOptions, type BinaryID, type DataClient, type FilterOptions, type GetSequenceDatasetExportResponse, type IndexableCollection, type Sequence, type SequenceResourceFilter, } from './app/data-client';
15
15
  /**
16
16
  * Raw Protobuf interfaces for Data.
17
17
  *
@@ -62,10 +62,10 @@ export { type BillingClient } from './app/billing-client';
62
62
  * @group Raw Protobufs
63
63
  */
64
64
  export * as billingApi from './gen/app/v1/billing_pb';
65
+ export { AudioCodec, type AudioCodecType, type AudioProperties } from './audio-common';
65
66
  export { ArmClient, ArmJointPositions, type Arm } from './components/arm';
66
- export { AudioInClient, type AudioIn, type AudioChunk } from './components/audioin';
67
+ export { AudioInClient, type AudioChunk, type AudioIn } from './components/audioin';
67
68
  export { AudioOutClient, type AudioOut } from './components/audioout';
68
- export { AudioCodec, type AudioCodecType, type AudioProperties } from './audio-common';
69
69
  /**
70
70
  * Raw Protobuf interfaces for an Arm component.
71
71
  *
@@ -256,7 +256,7 @@ export { DataManagerClient, type DataManager } from './services/data-manager';
256
256
  * @group Raw Protobufs
257
257
  */
258
258
  export * as dataManagerApi from './gen/service/datamanager/v1/data_manager_pb';
259
- export { NavigationClient, type Costmap, GoalState, type GoalStatus, type Location, MapType, type NavError, NavErrorCode, NavMode, type NavigateRouteOptions, type Plan, type Position, type Progress, type Properties, type Route, type RouteProgress, type Status, type Velocity, type Waypoint, type Zone, } from './services/navigation';
259
+ export { GoalState, MapType, NavErrorCode, NavigationClient, NavMode, type Costmap, type GoalStatus, type Location, type NavError, type NavigateRouteOptions, type Plan, type Position, type Progress, type Properties, type Route, type RouteProgress, type Status, type Velocity, type Waypoint, type Zone, } from './services/navigation';
260
260
  /**
261
261
  * Raw Protobuf interfaces for a Navigation service.
262
262
  *