@viamrobotics/sdk 0.26.1 → 0.27.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.
@@ -9,10 +9,9 @@ export declare class BaseChannel {
9
9
  private closedReason;
10
10
  protected maxDataChannelSize: number;
11
11
  constructor(peerConn: RTCPeerConnection, dataChannel: RTCDataChannel);
12
- close(): void;
13
12
  isClosed(): boolean;
14
13
  isClosedReason(): Error | undefined;
15
- protected closeWithReason(err?: Error): void;
14
+ closeWithReason(err: Error): void;
16
15
  private onChannelOpen;
17
16
  private onChannelClose;
18
17
  private onChannelError;
@@ -22,7 +22,7 @@ export declare class SignalingExchange {
22
22
  constructor(signalingClient: PromiseClient<typeof SignalingService>, callOpts: CallOptions, pc: RTCPeerConnection, dc: RTCDataChannel, dialOpts?: DialWebRTCOptions | undefined);
23
23
  doExchange(): Promise<ClientChannel>;
24
24
  private setup;
25
- terminate(): void;
25
+ terminate(err: Error): void;
26
26
  private processCallResponses;
27
27
  private handleInitError;
28
28
  private handleInitResponse;
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import type { DataManager } from './data-manager';
@@ -6,7 +7,8 @@ export declare class DataManagerClient implements DataManager {
6
7
  private client;
7
8
  private readonly name;
8
9
  private readonly options;
10
+ callOptions: CallOptions;
9
11
  constructor(client: RobotClient, name: string, options?: Options);
10
- sync(extra?: {}): Promise<void>;
11
- doCommand(command: Struct): Promise<JsonValue>;
12
+ sync(extra?: {}, callOptions?: CallOptions): Promise<void>;
13
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
12
14
  }
@@ -1,4 +1,5 @@
1
1
  import type { JsonValue, Struct } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import type { Generic } from './generic';
@@ -11,6 +12,7 @@ export declare class GenericClient implements Generic {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- doCommand(command: Struct): Promise<JsonValue>;
17
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
16
18
  }
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { RobotClient } from '../../robot';
3
4
  import type { GeoGeometry, GeoPoint, Geometry, Options, Pose, PoseInFrame, ResourceName, Transform, WorldState } from '../../types';
4
5
  import type { Motion } from './motion';
@@ -12,13 +13,14 @@ export declare class MotionClient implements Motion {
12
13
  private client;
13
14
  private readonly name;
14
15
  private readonly options;
16
+ callOptions: CallOptions;
15
17
  constructor(client: RobotClient, name: string, options?: Options);
16
- move(destination: PoseInFrame, componentName: ResourceName, worldState?: WorldState, constraints?: Constraints, extra?: {}): Promise<boolean>;
17
- moveOnMap(destination: Pose, componentName: ResourceName, slamServiceName: ResourceName, motionConfig?: MotionConfiguration, obstacles?: Geometry[], extra?: {}): Promise<string>;
18
- moveOnGlobe(destination: GeoPoint, componentName: ResourceName, movementSensorName: ResourceName, heading?: number, obstaclesList?: GeoGeometry[], motionConfig?: MotionConfiguration, boundingRegionsList?: GeoGeometry[], extra?: {}): Promise<string>;
19
- stopPlan(componentName: ResourceName, extra?: {}): Promise<null>;
20
- getPlan(componentName: ResourceName, lastPlanOnly?: boolean, executionId?: string, extra?: {}): Promise<import("../../gen/service/motion/v1/motion_pb").GetPlanResponse>;
21
- listPlanStatuses(onlyActivePlans?: boolean, extra?: {}): Promise<import("../../gen/service/motion/v1/motion_pb").ListPlanStatusesResponse>;
22
- getPose(componentName: ResourceName, destinationFrame: string, supplementalTransforms: Transform[], extra?: {}): Promise<import("../../gen/common/v1/common_pb").PoseInFrame>;
23
- doCommand(command: Struct): Promise<JsonValue>;
18
+ move(destination: PoseInFrame, componentName: ResourceName, worldState?: WorldState, constraints?: Constraints, extra?: {}, callOptions?: CallOptions): Promise<boolean>;
19
+ moveOnMap(destination: Pose, componentName: ResourceName, slamServiceName: ResourceName, motionConfig?: MotionConfiguration, obstacles?: Geometry[], extra?: {}, callOptions?: CallOptions): Promise<string>;
20
+ moveOnGlobe(destination: GeoPoint, componentName: ResourceName, movementSensorName: ResourceName, heading?: number, obstaclesList?: GeoGeometry[], motionConfig?: MotionConfiguration, boundingRegionsList?: GeoGeometry[], extra?: {}, callOptions?: CallOptions): Promise<string>;
21
+ stopPlan(componentName: ResourceName, extra?: {}, callOptions?: CallOptions): Promise<null>;
22
+ getPlan(componentName: ResourceName, lastPlanOnly?: boolean, executionId?: string, extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/motion/v1/motion_pb").GetPlanResponse>;
23
+ listPlanStatuses(onlyActivePlans?: boolean, extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/motion/v1/motion_pb").ListPlanStatusesResponse>;
24
+ getPose(componentName: ResourceName, destinationFrame: string, supplementalTransforms: Transform[], extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").PoseInFrame>;
25
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
24
26
  }
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import { RobotClient } from '../../robot';
3
4
  import type { GeoPoint, Options } from '../../types';
4
5
  import type { Navigation } from './navigation';
@@ -12,15 +13,16 @@ export declare class NavigationClient implements Navigation {
12
13
  private client;
13
14
  private readonly name;
14
15
  private readonly options;
16
+ callOptions: CallOptions;
15
17
  constructor(client: RobotClient, name: string, options?: Options);
16
- getMode(extra?: {}): Promise<import("../../gen/service/navigation/v1/navigation_pb").Mode>;
17
- setMode(mode: Mode, extra?: {}): Promise<void>;
18
- getLocation(extra?: {}): Promise<import("../../gen/service/navigation/v1/navigation_pb").GetLocationResponse>;
19
- getWayPoints(extra?: {}): Promise<import("../../gen/service/navigation/v1/navigation_pb").Waypoint[]>;
20
- addWayPoint(location: GeoPoint, extra?: {}): Promise<void>;
21
- removeWayPoint(id: string, extra?: {}): Promise<void>;
22
- getObstacles(extra?: {}): Promise<import("../../gen/common/v1/common_pb").GeoGeometry[]>;
23
- getPaths(extra?: {}): Promise<import("../../gen/service/navigation/v1/navigation_pb").Path[]>;
24
- getProperties(): Promise<import("../../gen/service/navigation/v1/navigation_pb").GetPropertiesResponse>;
25
- doCommand(command: Struct): Promise<JsonValue>;
18
+ getMode(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/navigation/v1/navigation_pb").Mode>;
19
+ setMode(mode: Mode, extra?: {}, callOptions?: CallOptions): Promise<void>;
20
+ getLocation(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/navigation/v1/navigation_pb").GetLocationResponse>;
21
+ getWayPoints(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/navigation/v1/navigation_pb").Waypoint[]>;
22
+ addWayPoint(location: GeoPoint, extra?: {}, callOptions?: CallOptions): Promise<void>;
23
+ removeWayPoint(id: string, extra?: {}, callOptions?: CallOptions): Promise<void>;
24
+ getObstacles(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").GeoGeometry[]>;
25
+ getPaths(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/navigation/v1/navigation_pb").Path[]>;
26
+ getProperties(callOptions?: CallOptions): Promise<import("../../gen/service/navigation/v1/navigation_pb").GetPropertiesResponse>;
27
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
26
28
  }
@@ -1,4 +1,5 @@
1
1
  import type { JsonValue, Struct } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import { RobotClient } from '../../robot';
3
4
  import type { Options } from '../../types';
4
5
  import type { Slam } from './slam';
@@ -11,10 +12,11 @@ export declare class SlamClient implements Slam {
11
12
  private client;
12
13
  private readonly name;
13
14
  private readonly options;
15
+ callOptions: CallOptions;
14
16
  constructor(client: RobotClient, name: string, options?: Options);
15
- getPosition(): Promise<import("../../gen/service/slam/v1/slam_pb").GetPositionResponse>;
16
- getPointCloudMap: (returnEditedMap?: boolean) => Promise<Uint8Array>;
17
- getInternalState: () => Promise<Uint8Array>;
18
- getProperties(): Promise<import("../../gen/service/slam/v1/slam_pb").GetPropertiesResponse>;
19
- doCommand(command: Struct): Promise<JsonValue>;
17
+ getPosition(callOptions?: CallOptions): Promise<import("../../gen/service/slam/v1/slam_pb").GetPositionResponse>;
18
+ getPointCloudMap: (returnEditedMap?: boolean, callOptions?: CallOptions) => Promise<Uint8Array>;
19
+ getInternalState: (callOptions?: CallOptions) => Promise<Uint8Array>;
20
+ getProperties(callOptions?: CallOptions): Promise<import("../../gen/service/slam/v1/slam_pb").GetPropertiesResponse>;
21
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
20
22
  }
@@ -1,4 +1,5 @@
1
1
  import { Struct, type JsonValue } from '@bufbuild/protobuf';
2
+ import type { CallOptions } from '@connectrpc/connect';
2
3
  import type { MimeType } from '../../main';
3
4
  import type { RobotClient } from '../../robot';
4
5
  import type { Options } from '../../types';
@@ -13,22 +14,23 @@ export declare class VisionClient implements Vision {
13
14
  private client;
14
15
  private readonly name;
15
16
  private readonly options;
17
+ callOptions: CallOptions;
16
18
  constructor(client: RobotClient, name: string, options?: Options);
17
- getDetectionsFromCamera(cameraName: string, extra?: {}): Promise<import("../../gen/service/vision/v1/vision_pb").Detection[]>;
18
- getDetections(image: Uint8Array, width: number, height: number, mimeType: MimeType, extra?: {}): Promise<import("../../gen/service/vision/v1/vision_pb").Detection[]>;
19
- getClassificationsFromCamera(cameraName: string, count: number, extra?: {}): Promise<import("../../gen/service/vision/v1/vision_pb").Classification[]>;
20
- getClassifications(image: Uint8Array, width: number, height: number, mimeType: MimeType, count: number, extra?: {}): Promise<import("../../gen/service/vision/v1/vision_pb").Classification[]>;
21
- getObjectPointClouds(cameraName: string, extra?: {}): Promise<import("../../gen/common/v1/common_pb").PointCloudObject[]>;
22
- getProperties(extra?: {}): Promise<{
19
+ getDetectionsFromCamera(cameraName: string, extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/vision/v1/vision_pb").Detection[]>;
20
+ getDetections(image: Uint8Array, width: number, height: number, mimeType: MimeType, extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/vision/v1/vision_pb").Detection[]>;
21
+ getClassificationsFromCamera(cameraName: string, count: number, extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/vision/v1/vision_pb").Classification[]>;
22
+ getClassifications(image: Uint8Array, width: number, height: number, mimeType: MimeType, count: number, extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/service/vision/v1/vision_pb").Classification[]>;
23
+ getObjectPointClouds(cameraName: string, extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/common/v1/common_pb").PointCloudObject[]>;
24
+ getProperties(extra?: {}, callOptions?: CallOptions): Promise<{
23
25
  classificationsSupported: boolean;
24
26
  detectionsSupported: boolean;
25
27
  objectPointCloudsSupported: boolean;
26
28
  }>;
27
- captureAllFromCamera(cameraName: string, { returnImage, returnClassifications, returnDetections, returnObjectPointClouds, }: CaptureAllOptions, extra?: {}): Promise<{
29
+ captureAllFromCamera(cameraName: string, { returnImage, returnClassifications, returnDetections, returnObjectPointClouds, }: CaptureAllOptions, extra?: {}, callOptions?: CallOptions): Promise<{
28
30
  image: import("../../gen/component/camera/v1/camera_pb").Image | undefined;
29
31
  classifications: import("../../gen/service/vision/v1/vision_pb").Classification[];
30
32
  detections: import("../../gen/service/vision/v1/vision_pb").Detection[];
31
33
  objectPointClouds: import("../../gen/common/v1/common_pb").PointCloudObject[];
32
34
  }>;
33
- doCommand(command: Struct): Promise<JsonValue>;
35
+ doCommand(command: Struct, callOptions?: CallOptions): Promise<JsonValue>;
34
36
  }
package/dist/utils.d.ts CHANGED
@@ -5,5 +5,9 @@ import type { Options } from './types';
5
5
  export declare const clientHeaders: Headers;
6
6
  type doCommand = (request: PartialMessage<DoCommandRequest>, options?: CallOptions) => Promise<DoCommandResponse>;
7
7
  /** Send/Receive an arbitrary command using a resource client */
8
- export declare const doCommandFromClient: (doCommander: doCommand, name: string, command: Struct, options?: Options) => Promise<JsonValue>;
8
+ export declare const doCommandFromClient: (doCommander: doCommand, name: string, command: Struct, options?: Options, callOptions?: CallOptions) => Promise<JsonValue>;
9
+ export declare const enableDebugLogging: (key?: string, opts?: CallOptions) => CallOptions;
10
+ export declare const disableDebugLogging: (opts: CallOptions) => void;
11
+ export declare const addMetadata: (key: string, value: string, opts?: CallOptions) => CallOptions;
12
+ export declare const deleteMetadata: (opts: CallOptions, key: string) => void;
9
13
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/sdk",
3
- "version": "0.26.1",
3
+ "version": "0.27.0",
4
4
  "description": "",
5
5
  "main": "./dist/main.umd.js",
6
6
  "module": "./dist/main.es.js",