@viamrobotics/sdk 0.79.0 → 0.79.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.
- package/dist/api-version.d.ts +1 -1
- package/dist/components/power-sensor/client.d.ts +2 -0
- package/dist/components/power-sensor/power-sensor.d.ts +33 -0
- package/dist/components/powersensor.d.ts +1 -1
- package/dist/gen/app/v1/app_pb.d.ts +8 -0
- package/dist/gen/app/v1/billing_pb.d.ts +5 -0
- package/dist/gen/app/v1/robot_pb.d.ts +34 -0
- package/dist/gen/component/powersensor/v1/powersensor_connect.d.ts +23 -1
- package/dist/gen/component/powersensor/v1/powersensor_pb.d.ts +118 -0
- package/dist/gen/robot/v1/robot_pb.d.ts +34 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.es.js +3869 -3757
- package/dist/main.umd.js +9 -9
- package/dist/robot/robot.d.ts +1 -0
- package/package.json +2 -2
package/dist/api-version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const apiVersion = "v0.1.
|
|
1
|
+
export declare const apiVersion = "v0.1.607";
|
|
@@ -17,6 +17,8 @@ export declare class PowerSensorClient implements PowerSensor {
|
|
|
17
17
|
getVoltage(extra?: {}, callOptions?: CallOptions): Promise<readonly [number, boolean]>;
|
|
18
18
|
getCurrent(extra?: {}, callOptions?: CallOptions): Promise<readonly [number, boolean]>;
|
|
19
19
|
getPower(extra?: {}, callOptions?: CallOptions): Promise<number>;
|
|
20
|
+
getBatteryPercent(extra?: {}, callOptions?: CallOptions): Promise<number>;
|
|
21
|
+
getProperties(extra?: {}, callOptions?: CallOptions): Promise<import("../../gen/component/powersensor/v1/powersensor_pb").GetPropertiesResponse>;
|
|
20
22
|
getReadings(extra?: {}, callOptions?: CallOptions): Promise<Record<string, JsonValue>>;
|
|
21
23
|
getStatus(callOptions?: CallOptions): Promise<JsonValue>;
|
|
22
24
|
doCommand(command: Struct | Record<string, JsonValue>, callOptions?: CallOptions): Promise<JsonValue>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { JsonValue, Struct } from '@bufbuild/protobuf';
|
|
2
|
+
import * as powerSensorApi from '../../gen/component/powersensor/v1/powersensor_pb';
|
|
2
3
|
import type { Sensor } from '../sensor';
|
|
4
|
+
export type PowerSensorProperties = powerSensorApi.GetPropertiesResponse;
|
|
5
|
+
export declare const PowerSensorProperties: typeof powerSensorApi.GetPropertiesResponse;
|
|
3
6
|
/** Represents any sensor that reports voltage, current, and/or power */
|
|
4
7
|
export interface PowerSensor extends Sensor {
|
|
5
8
|
/**
|
|
@@ -44,6 +47,36 @@ export interface PowerSensor extends Sensor {
|
|
|
44
47
|
* API](https://docs.viam.com/reference/apis/components/power-sensor/#getpower).
|
|
45
48
|
*/
|
|
46
49
|
getPower(extra?: Struct): Promise<number>;
|
|
50
|
+
/**
|
|
51
|
+
* Get the remaining battery charge as a percentage from 0 to 100.
|
|
52
|
+
*
|
|
53
|
+
* Check `isBatteryPercentSupported` from {@link getProperties} first.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
*
|
|
57
|
+
* ```ts
|
|
58
|
+
* const powerSensor = new VIAM.PowerSensorClient(machine, 'my_power_sensor');
|
|
59
|
+
* const percent = await powerSensor.getBatteryPercent();
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* For more information, see [Power Sensor
|
|
63
|
+
* API](https://docs.viam.com/reference/apis/components/power-sensor/#getbatterypercent).
|
|
64
|
+
*/
|
|
65
|
+
getBatteryPercent(extra?: Struct): Promise<number>;
|
|
66
|
+
/**
|
|
67
|
+
* Get the properties of the power sensor, such as whether it supports {@link getBatteryPercent}.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* const powerSensor = new VIAM.PowerSensorClient(machine, 'my_power_sensor');
|
|
73
|
+
* const { isBatteryPercentSupported } = await powerSensor.getProperties();
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* For more information, see [Power Sensor
|
|
77
|
+
* API](https://docs.viam.com/reference/apis/components/power-sensor/#getproperties).
|
|
78
|
+
*/
|
|
79
|
+
getProperties(extra?: Struct): Promise<PowerSensorProperties>;
|
|
47
80
|
/**
|
|
48
81
|
* Return the readings of a sensor.
|
|
49
82
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export { PowerSensorProperties, type PowerSensor } from './power-sensor/power-sensor';
|
|
2
2
|
export { PowerSensorClient } from './power-sensor/client';
|
|
@@ -8080,6 +8080,14 @@ export declare class Model extends Message<Model> {
|
|
|
8080
8080
|
*/
|
|
8081
8081
|
supportedHardware: string[];
|
|
8082
8082
|
|
|
8083
|
+
/**
|
|
8084
|
+
* The full set of co-equal APIs this model serves. The `api` field is always one of these and is
|
|
8085
|
+
* retained for tooling that predates `apis`; new code should read `apis`.
|
|
8086
|
+
*
|
|
8087
|
+
* @generated from field: repeated string apis = 6;
|
|
8088
|
+
*/
|
|
8089
|
+
apis: string[];
|
|
8090
|
+
|
|
8083
8091
|
constructor(data?: PartialMessage<Model>);
|
|
8084
8092
|
|
|
8085
8093
|
static readonly runtime: typeof proto3;
|
|
@@ -178,6 +178,11 @@ export declare enum UsageCostType {
|
|
|
178
178
|
* @generated from enum value: USAGE_COST_TYPE_SIMULATION_COMPUTE = 28;
|
|
179
179
|
*/
|
|
180
180
|
SIMULATION_COMPUTE = 28,
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* @generated from enum value: USAGE_COST_TYPE_AI_USAGE = 29;
|
|
184
|
+
*/
|
|
185
|
+
AI_USAGE = 29,
|
|
181
186
|
}
|
|
182
187
|
|
|
183
188
|
/**
|
|
@@ -2038,6 +2038,11 @@ export declare class MaintenanceConfig extends Message<MaintenanceConfig> {
|
|
|
2038
2038
|
*/
|
|
2039
2039
|
maintenanceAllowedKey: string;
|
|
2040
2040
|
|
|
2041
|
+
/**
|
|
2042
|
+
* @generated from field: viam.app.v1.FollowPartRef follow_part = 3;
|
|
2043
|
+
*/
|
|
2044
|
+
followPart?: FollowPartRef;
|
|
2045
|
+
|
|
2041
2046
|
constructor(data?: PartialMessage<MaintenanceConfig>);
|
|
2042
2047
|
|
|
2043
2048
|
static readonly runtime: typeof proto3;
|
|
@@ -2053,3 +2058,32 @@ export declare class MaintenanceConfig extends Message<MaintenanceConfig> {
|
|
|
2053
2058
|
static equals(a: MaintenanceConfig | PlainMessage<MaintenanceConfig> | undefined, b: MaintenanceConfig | PlainMessage<MaintenanceConfig> | undefined): boolean;
|
|
2054
2059
|
}
|
|
2055
2060
|
|
|
2061
|
+
/**
|
|
2062
|
+
* @generated from message viam.app.v1.FollowPartRef
|
|
2063
|
+
*/
|
|
2064
|
+
export declare class FollowPartRef extends Message<FollowPartRef> {
|
|
2065
|
+
/**
|
|
2066
|
+
* @generated from field: string address = 1;
|
|
2067
|
+
*/
|
|
2068
|
+
address: string;
|
|
2069
|
+
|
|
2070
|
+
/**
|
|
2071
|
+
* @generated from field: viam.app.v1.RemoteAuth auth = 2;
|
|
2072
|
+
*/
|
|
2073
|
+
auth?: RemoteAuth;
|
|
2074
|
+
|
|
2075
|
+
constructor(data?: PartialMessage<FollowPartRef>);
|
|
2076
|
+
|
|
2077
|
+
static readonly runtime: typeof proto3;
|
|
2078
|
+
static readonly typeName = "viam.app.v1.FollowPartRef";
|
|
2079
|
+
static readonly fields: FieldList;
|
|
2080
|
+
|
|
2081
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FollowPartRef;
|
|
2082
|
+
|
|
2083
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): FollowPartRef;
|
|
2084
|
+
|
|
2085
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): FollowPartRef;
|
|
2086
|
+
|
|
2087
|
+
static equals(a: FollowPartRef | PlainMessage<FollowPartRef> | undefined, b: FollowPartRef | PlainMessage<FollowPartRef> | undefined): boolean;
|
|
2088
|
+
}
|
|
2089
|
+
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
// @ts-nocheck
|
|
5
5
|
|
|
6
|
-
import { GetCurrentRequest, GetCurrentResponse, GetPowerRequest, GetPowerResponse, GetVoltageRequest, GetVoltageResponse } from "./powersensor_pb.js";
|
|
6
|
+
import { GetBatteryPercentRequest, GetBatteryPercentResponse, GetCurrentRequest, GetCurrentResponse, GetPowerRequest, GetPowerResponse, GetPropertiesRequest, GetPropertiesResponse, GetVoltageRequest, GetVoltageResponse } from "./powersensor_pb.js";
|
|
7
7
|
import { MethodKind } from "@bufbuild/protobuf";
|
|
8
8
|
import { DoCommandRequest, DoCommandResponse, GetReadingsRequest, GetReadingsResponse, GetStatusRequest, GetStatusResponse } from "../../../common/v1/common_pb.js";
|
|
9
9
|
|
|
@@ -48,6 +48,28 @@ export declare const PowerSensorService: {
|
|
|
48
48
|
readonly O: typeof GetPowerResponse,
|
|
49
49
|
readonly kind: MethodKind.Unary,
|
|
50
50
|
},
|
|
51
|
+
/**
|
|
52
|
+
* GetBatteryPercent returns the remaining charge of the battery the power sensor monitors
|
|
53
|
+
*
|
|
54
|
+
* @generated from rpc viam.component.powersensor.v1.PowerSensorService.GetBatteryPercent
|
|
55
|
+
*/
|
|
56
|
+
readonly getBatteryPercent: {
|
|
57
|
+
readonly name: "GetBatteryPercent",
|
|
58
|
+
readonly I: typeof GetBatteryPercentRequest,
|
|
59
|
+
readonly O: typeof GetBatteryPercentResponse,
|
|
60
|
+
readonly kind: MethodKind.Unary,
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* GetProperties returns the properties of a power sensor
|
|
64
|
+
*
|
|
65
|
+
* @generated from rpc viam.component.powersensor.v1.PowerSensorService.GetProperties
|
|
66
|
+
*/
|
|
67
|
+
readonly getProperties: {
|
|
68
|
+
readonly name: "GetProperties",
|
|
69
|
+
readonly I: typeof GetPropertiesRequest,
|
|
70
|
+
readonly O: typeof GetPropertiesResponse,
|
|
71
|
+
readonly kind: MethodKind.Unary,
|
|
72
|
+
},
|
|
51
73
|
/**
|
|
52
74
|
* GetReadings returns the readings of a sensor of the underlying robot.
|
|
53
75
|
*
|
|
@@ -197,3 +197,121 @@ export declare class GetPowerResponse extends Message<GetPowerResponse> {
|
|
|
197
197
|
static equals(a: GetPowerResponse | PlainMessage<GetPowerResponse> | undefined, b: GetPowerResponse | PlainMessage<GetPowerResponse> | undefined): boolean;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
+
/**
|
|
201
|
+
* @generated from message viam.component.powersensor.v1.GetBatteryPercentRequest
|
|
202
|
+
*/
|
|
203
|
+
export declare class GetBatteryPercentRequest extends Message<GetBatteryPercentRequest> {
|
|
204
|
+
/**
|
|
205
|
+
* Name of a power sensor
|
|
206
|
+
*
|
|
207
|
+
* @generated from field: string name = 1;
|
|
208
|
+
*/
|
|
209
|
+
name: string;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Additional arguments to the method
|
|
213
|
+
*
|
|
214
|
+
* @generated from field: google.protobuf.Struct extra = 99;
|
|
215
|
+
*/
|
|
216
|
+
extra?: Struct;
|
|
217
|
+
|
|
218
|
+
constructor(data?: PartialMessage<GetBatteryPercentRequest>);
|
|
219
|
+
|
|
220
|
+
static readonly runtime: typeof proto3;
|
|
221
|
+
static readonly typeName = "viam.component.powersensor.v1.GetBatteryPercentRequest";
|
|
222
|
+
static readonly fields: FieldList;
|
|
223
|
+
|
|
224
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetBatteryPercentRequest;
|
|
225
|
+
|
|
226
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetBatteryPercentRequest;
|
|
227
|
+
|
|
228
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetBatteryPercentRequest;
|
|
229
|
+
|
|
230
|
+
static equals(a: GetBatteryPercentRequest | PlainMessage<GetBatteryPercentRequest> | undefined, b: GetBatteryPercentRequest | PlainMessage<GetBatteryPercentRequest> | undefined): boolean;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @generated from message viam.component.powersensor.v1.GetBatteryPercentResponse
|
|
235
|
+
*/
|
|
236
|
+
export declare class GetBatteryPercentResponse extends Message<GetBatteryPercentResponse> {
|
|
237
|
+
/**
|
|
238
|
+
* Remaining battery charge, from 0 to 100
|
|
239
|
+
*
|
|
240
|
+
* @generated from field: double percent = 1;
|
|
241
|
+
*/
|
|
242
|
+
percent: number;
|
|
243
|
+
|
|
244
|
+
constructor(data?: PartialMessage<GetBatteryPercentResponse>);
|
|
245
|
+
|
|
246
|
+
static readonly runtime: typeof proto3;
|
|
247
|
+
static readonly typeName = "viam.component.powersensor.v1.GetBatteryPercentResponse";
|
|
248
|
+
static readonly fields: FieldList;
|
|
249
|
+
|
|
250
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetBatteryPercentResponse;
|
|
251
|
+
|
|
252
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetBatteryPercentResponse;
|
|
253
|
+
|
|
254
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetBatteryPercentResponse;
|
|
255
|
+
|
|
256
|
+
static equals(a: GetBatteryPercentResponse | PlainMessage<GetBatteryPercentResponse> | undefined, b: GetBatteryPercentResponse | PlainMessage<GetBatteryPercentResponse> | undefined): boolean;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @generated from message viam.component.powersensor.v1.GetPropertiesRequest
|
|
261
|
+
*/
|
|
262
|
+
export declare class GetPropertiesRequest extends Message<GetPropertiesRequest> {
|
|
263
|
+
/**
|
|
264
|
+
* Name of a power sensor
|
|
265
|
+
*
|
|
266
|
+
* @generated from field: string name = 1;
|
|
267
|
+
*/
|
|
268
|
+
name: string;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Additional arguments to the method
|
|
272
|
+
*
|
|
273
|
+
* @generated from field: google.protobuf.Struct extra = 99;
|
|
274
|
+
*/
|
|
275
|
+
extra?: Struct;
|
|
276
|
+
|
|
277
|
+
constructor(data?: PartialMessage<GetPropertiesRequest>);
|
|
278
|
+
|
|
279
|
+
static readonly runtime: typeof proto3;
|
|
280
|
+
static readonly typeName = "viam.component.powersensor.v1.GetPropertiesRequest";
|
|
281
|
+
static readonly fields: FieldList;
|
|
282
|
+
|
|
283
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetPropertiesRequest;
|
|
284
|
+
|
|
285
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetPropertiesRequest;
|
|
286
|
+
|
|
287
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetPropertiesRequest;
|
|
288
|
+
|
|
289
|
+
static equals(a: GetPropertiesRequest | PlainMessage<GetPropertiesRequest> | undefined, b: GetPropertiesRequest | PlainMessage<GetPropertiesRequest> | undefined): boolean;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @generated from message viam.component.powersensor.v1.GetPropertiesResponse
|
|
294
|
+
*/
|
|
295
|
+
export declare class GetPropertiesResponse extends Message<GetPropertiesResponse> {
|
|
296
|
+
/**
|
|
297
|
+
* Whether the power sensor supports GetBatteryPercent
|
|
298
|
+
*
|
|
299
|
+
* @generated from field: bool is_battery_percent_supported = 1;
|
|
300
|
+
*/
|
|
301
|
+
isBatteryPercentSupported: boolean;
|
|
302
|
+
|
|
303
|
+
constructor(data?: PartialMessage<GetPropertiesResponse>);
|
|
304
|
+
|
|
305
|
+
static readonly runtime: typeof proto3;
|
|
306
|
+
static readonly typeName = "viam.component.powersensor.v1.GetPropertiesResponse";
|
|
307
|
+
static readonly fields: FieldList;
|
|
308
|
+
|
|
309
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetPropertiesResponse;
|
|
310
|
+
|
|
311
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetPropertiesResponse;
|
|
312
|
+
|
|
313
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetPropertiesResponse;
|
|
314
|
+
|
|
315
|
+
static equals(a: GetPropertiesResponse | PlainMessage<GetPropertiesResponse> | undefined, b: GetPropertiesResponse | PlainMessage<GetPropertiesResponse> | undefined): boolean;
|
|
316
|
+
}
|
|
317
|
+
|
|
@@ -1549,6 +1549,11 @@ export declare class GetMachineStatusResponse extends Message<GetMachineStatusRe
|
|
|
1549
1549
|
*/
|
|
1550
1550
|
packages: PackageStatus[];
|
|
1551
1551
|
|
|
1552
|
+
/**
|
|
1553
|
+
* @generated from field: viam.robot.v1.MaintenanceStatus maintenance_status = 7;
|
|
1554
|
+
*/
|
|
1555
|
+
maintenanceStatus?: MaintenanceStatus;
|
|
1556
|
+
|
|
1552
1557
|
constructor(data?: PartialMessage<GetMachineStatusResponse>);
|
|
1553
1558
|
|
|
1554
1559
|
static readonly runtime: typeof proto3;
|
|
@@ -1589,6 +1594,35 @@ export declare enum GetMachineStatusResponse_State {
|
|
|
1589
1594
|
RUNNING = 2,
|
|
1590
1595
|
}
|
|
1591
1596
|
|
|
1597
|
+
/**
|
|
1598
|
+
* @generated from message viam.robot.v1.MaintenanceStatus
|
|
1599
|
+
*/
|
|
1600
|
+
export declare class MaintenanceStatus extends Message<MaintenanceStatus> {
|
|
1601
|
+
/**
|
|
1602
|
+
* @generated from field: bool allowed = 1;
|
|
1603
|
+
*/
|
|
1604
|
+
allowed: boolean;
|
|
1605
|
+
|
|
1606
|
+
/**
|
|
1607
|
+
* @generated from field: string reason = 2;
|
|
1608
|
+
*/
|
|
1609
|
+
reason: string;
|
|
1610
|
+
|
|
1611
|
+
constructor(data?: PartialMessage<MaintenanceStatus>);
|
|
1612
|
+
|
|
1613
|
+
static readonly runtime: typeof proto3;
|
|
1614
|
+
static readonly typeName = "viam.robot.v1.MaintenanceStatus";
|
|
1615
|
+
static readonly fields: FieldList;
|
|
1616
|
+
|
|
1617
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MaintenanceStatus;
|
|
1618
|
+
|
|
1619
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MaintenanceStatus;
|
|
1620
|
+
|
|
1621
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MaintenanceStatus;
|
|
1622
|
+
|
|
1623
|
+
static equals(a: MaintenanceStatus | PlainMessage<MaintenanceStatus> | undefined, b: MaintenanceStatus | PlainMessage<MaintenanceStatus> | undefined): boolean;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1592
1626
|
/**
|
|
1593
1627
|
* @generated from message viam.robot.v1.JobStatus
|
|
1594
1628
|
*/
|
package/dist/main.d.ts
CHANGED
|
@@ -166,7 +166,7 @@ export { MovementSensorAccuracy, MovementSensorClient, MovementSensorPosition, M
|
|
|
166
166
|
* @group Raw Protobufs
|
|
167
167
|
*/
|
|
168
168
|
export * as movementSensorApi from './gen/component/movementsensor/v1/movementsensor_pb';
|
|
169
|
-
export { PowerSensorClient, type PowerSensor } from './components/powersensor';
|
|
169
|
+
export { PowerSensorClient, PowerSensorProperties, type PowerSensor, } from './components/powersensor';
|
|
170
170
|
/**
|
|
171
171
|
* Raw Protobuf interfaces for a PowerSensor component.
|
|
172
172
|
*
|