@viamrobotics/sdk 0.13.0 → 0.14.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.
@@ -8,6 +8,11 @@ interface Status {
8
8
  type ValueOf<T> = T[keyof T];
9
9
  export declare const PowerMode: pb.PowerModeMap;
10
10
  export type PowerMode = ValueOf<typeof pb.PowerMode>;
11
+ export interface Tick {
12
+ pinName: string;
13
+ high: boolean;
14
+ time: number;
15
+ }
11
16
  export type Duration = PBDuration.AsObject;
12
17
  /**
13
18
  * Represents a physical general purpose compute board that contains various
@@ -78,6 +83,13 @@ export interface Board extends Resource {
78
83
  * @param digitalInterruptName - The name of the digital interrupt.
79
84
  */
80
85
  getDigitalInterruptValue(digitalInterruptName: string, extra?: StructType): Promise<number>;
86
+ /**
87
+ * Stream digital interrupt ticks on the board.
88
+ *
89
+ * @param interrupts - Names of the interrupts to stream.
90
+ * @param queue - Array to put the ticks in.
91
+ */
92
+ streamTicks(interrupts: string[], queue: Tick[], extra?: StructType): Promise<void>;
81
93
  /**
82
94
  * Set power mode of the board.
83
95
  *
@@ -1,7 +1,7 @@
1
1
  import type { RobotClient } from '../../robot';
2
2
  import type { Options, StructType } from '../../types';
3
3
  import pb from '../../gen/component/board/v1/board_pb';
4
- import type { Board, Duration, PowerMode } from './board';
4
+ import type { Board, Duration, PowerMode, Tick } from './board';
5
5
  /**
6
6
  * A gRPC-web client for the Board component.
7
7
  *
@@ -33,6 +33,7 @@ export declare class BoardClient implements Board {
33
33
  readAnalogReader(analogReader: string, extra?: {}): Promise<number>;
34
34
  writeAnalog(pin: string, value: number, extra?: {}): Promise<void>;
35
35
  getDigitalInterruptValue(digitalInteruptName: string, extra?: {}): Promise<number>;
36
+ streamTicks(interrupts: string[], queue: Tick[], extra?: {}): Promise<void>;
36
37
  setPowerMode(name: string, powerMode: PowerMode, duration?: Duration, extra?: {}): Promise<void>;
37
38
  doCommand(command: StructType): Promise<StructType>;
38
39
  }
@@ -1,2 +1,2 @@
1
- export { type Board, type Duration, PowerMode } from './board/board';
1
+ export { type Board, type Duration, PowerMode, type Tick } from './board/board';
2
2
  export { BoardClient } from './board/client';
@@ -162,9 +162,32 @@ export class TrainingJobMetadata extends jspb.Message {
162
162
  getRequest(): SubmitTrainingJobRequest | undefined;
163
163
  setRequest(value?: SubmitTrainingJobRequest): void;
164
164
 
165
+ getId(): string;
166
+ setId(value: string): void;
167
+
168
+ getDatasetId(): string;
169
+ setDatasetId(value: string): void;
170
+
171
+ getOrganizationId(): string;
172
+ setOrganizationId(value: string): void;
173
+
174
+ getModelName(): string;
175
+ setModelName(value: string): void;
176
+
177
+ getModelVersion(): string;
178
+ setModelVersion(value: string): void;
179
+
180
+ getModelType(): ModelTypeMap[keyof ModelTypeMap];
181
+ setModelType(value: ModelTypeMap[keyof ModelTypeMap]): void;
182
+
165
183
  getStatus(): TrainingStatusMap[keyof TrainingStatusMap];
166
184
  setStatus(value: TrainingStatusMap[keyof TrainingStatusMap]): void;
167
185
 
186
+ hasErrorStatus(): boolean;
187
+ clearErrorStatus(): void;
188
+ getErrorStatus(): google_rpc_status_pb.Status | undefined;
189
+ setErrorStatus(value?: google_rpc_status_pb.Status): void;
190
+
168
191
  hasCreatedOn(): boolean;
169
192
  clearCreatedOn(): void;
170
193
  getCreatedOn(): google_protobuf_timestamp_pb.Timestamp | undefined;
@@ -175,17 +198,6 @@ export class TrainingJobMetadata extends jspb.Message {
175
198
  getLastModified(): google_protobuf_timestamp_pb.Timestamp | undefined;
176
199
  setLastModified(value?: google_protobuf_timestamp_pb.Timestamp): void;
177
200
 
178
- getSyncedModelId(): string;
179
- setSyncedModelId(value: string): void;
180
-
181
- getId(): string;
182
- setId(value: string): void;
183
-
184
- hasErrorStatus(): boolean;
185
- clearErrorStatus(): void;
186
- getErrorStatus(): google_rpc_status_pb.Status | undefined;
187
- setErrorStatus(value?: google_rpc_status_pb.Status): void;
188
-
189
201
  hasTrainingStarted(): boolean;
190
202
  clearTrainingStarted(): void;
191
203
  getTrainingStarted(): google_protobuf_timestamp_pb.Timestamp | undefined;
@@ -196,6 +208,14 @@ export class TrainingJobMetadata extends jspb.Message {
196
208
  getTrainingEnded(): google_protobuf_timestamp_pb.Timestamp | undefined;
197
209
  setTrainingEnded(value?: google_protobuf_timestamp_pb.Timestamp): void;
198
210
 
211
+ getSyncedModelId(): string;
212
+ setSyncedModelId(value: string): void;
213
+
214
+ clearTagsList(): void;
215
+ getTagsList(): Array<string>;
216
+ setTagsList(value: Array<string>): void;
217
+ addTags(value: string, index?: number): string;
218
+
199
219
  serializeBinary(): Uint8Array;
200
220
  toObject(includeInstance?: boolean): TrainingJobMetadata.AsObject;
201
221
  static toObject(includeInstance: boolean, msg: TrainingJobMetadata): TrainingJobMetadata.AsObject;
@@ -209,14 +229,20 @@ export class TrainingJobMetadata extends jspb.Message {
209
229
  export namespace TrainingJobMetadata {
210
230
  export type AsObject = {
211
231
  request?: SubmitTrainingJobRequest.AsObject,
232
+ id: string,
233
+ datasetId: string,
234
+ organizationId: string,
235
+ modelName: string,
236
+ modelVersion: string,
237
+ modelType: ModelTypeMap[keyof ModelTypeMap],
212
238
  status: TrainingStatusMap[keyof TrainingStatusMap],
239
+ errorStatus?: google_rpc_status_pb.Status.AsObject,
213
240
  createdOn?: google_protobuf_timestamp_pb.Timestamp.AsObject,
214
241
  lastModified?: google_protobuf_timestamp_pb.Timestamp.AsObject,
215
- syncedModelId: string,
216
- id: string,
217
- errorStatus?: google_rpc_status_pb.Status.AsObject,
218
242
  trainingStarted?: google_protobuf_timestamp_pb.Timestamp.AsObject,
219
243
  trainingEnded?: google_protobuf_timestamp_pb.Timestamp.AsObject,
244
+ syncedModelId: string,
245
+ tagsList: Array<string>,
220
246
  }
221
247
  }
222
248
 
@@ -71,3 +71,55 @@ export namespace AcceptLegalResponse {
71
71
  }
72
72
  }
73
73
 
74
+ export class RegisterAuthApplicationRequest extends jspb.Message {
75
+ getApplicationName(): string;
76
+ setApplicationName(value: string): void;
77
+
78
+ getOrgId(): string;
79
+ setOrgId(value: string): void;
80
+
81
+ clearOriginUrisList(): void;
82
+ getOriginUrisList(): Array<string>;
83
+ setOriginUrisList(value: Array<string>): void;
84
+ addOriginUris(value: string, index?: number): string;
85
+
86
+ clearRedirectUrisList(): void;
87
+ getRedirectUrisList(): Array<string>;
88
+ setRedirectUrisList(value: Array<string>): void;
89
+ addRedirectUris(value: string, index?: number): string;
90
+
91
+ serializeBinary(): Uint8Array;
92
+ toObject(includeInstance?: boolean): RegisterAuthApplicationRequest.AsObject;
93
+ static toObject(includeInstance: boolean, msg: RegisterAuthApplicationRequest): RegisterAuthApplicationRequest.AsObject;
94
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
95
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
96
+ static serializeBinaryToWriter(message: RegisterAuthApplicationRequest, writer: jspb.BinaryWriter): void;
97
+ static deserializeBinary(bytes: Uint8Array): RegisterAuthApplicationRequest;
98
+ static deserializeBinaryFromReader(message: RegisterAuthApplicationRequest, reader: jspb.BinaryReader): RegisterAuthApplicationRequest;
99
+ }
100
+
101
+ export namespace RegisterAuthApplicationRequest {
102
+ export type AsObject = {
103
+ applicationName: string,
104
+ orgId: string,
105
+ originUrisList: Array<string>,
106
+ redirectUrisList: Array<string>,
107
+ }
108
+ }
109
+
110
+ export class RegisterAuthApplicationResponse extends jspb.Message {
111
+ serializeBinary(): Uint8Array;
112
+ toObject(includeInstance?: boolean): RegisterAuthApplicationResponse.AsObject;
113
+ static toObject(includeInstance: boolean, msg: RegisterAuthApplicationResponse): RegisterAuthApplicationResponse.AsObject;
114
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
115
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
116
+ static serializeBinaryToWriter(message: RegisterAuthApplicationResponse, writer: jspb.BinaryWriter): void;
117
+ static deserializeBinary(bytes: Uint8Array): RegisterAuthApplicationResponse;
118
+ static deserializeBinaryFromReader(message: RegisterAuthApplicationResponse, reader: jspb.BinaryReader): RegisterAuthApplicationResponse;
119
+ }
120
+
121
+ export namespace RegisterAuthApplicationResponse {
122
+ export type AsObject = {
123
+ }
124
+ }
125
+
@@ -22,10 +22,20 @@ type EndUserServiceAcceptLegal = {
22
22
  readonly responseType: typeof app_v1_end_user_pb.AcceptLegalResponse;
23
23
  };
24
24
 
25
+ type EndUserServiceRegisterAuthApplication = {
26
+ readonly methodName: string;
27
+ readonly service: typeof EndUserService;
28
+ readonly requestStream: false;
29
+ readonly responseStream: false;
30
+ readonly requestType: typeof app_v1_end_user_pb.RegisterAuthApplicationRequest;
31
+ readonly responseType: typeof app_v1_end_user_pb.RegisterAuthApplicationResponse;
32
+ };
33
+
25
34
  export class EndUserService {
26
35
  static readonly serviceName: string;
27
36
  static readonly IsLegalAccepted: EndUserServiceIsLegalAccepted;
28
37
  static readonly AcceptLegal: EndUserServiceAcceptLegal;
38
+ static readonly RegisterAuthApplication: EndUserServiceRegisterAuthApplication;
29
39
  }
30
40
 
31
41
  export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
@@ -78,5 +88,14 @@ export class EndUserServiceClient {
78
88
  requestMessage: app_v1_end_user_pb.AcceptLegalRequest,
79
89
  callback: (error: ServiceError|null, responseMessage: app_v1_end_user_pb.AcceptLegalResponse|null) => void
80
90
  ): UnaryResponse;
91
+ registerAuthApplication(
92
+ requestMessage: app_v1_end_user_pb.RegisterAuthApplicationRequest,
93
+ metadata: grpc.Metadata,
94
+ callback: (error: ServiceError|null, responseMessage: app_v1_end_user_pb.RegisterAuthApplicationResponse|null) => void
95
+ ): UnaryResponse;
96
+ registerAuthApplication(
97
+ requestMessage: app_v1_end_user_pb.RegisterAuthApplicationRequest,
98
+ callback: (error: ServiceError|null, responseMessage: app_v1_end_user_pb.RegisterAuthApplicationResponse|null) => void
99
+ ): UnaryResponse;
81
100
  }
82
101
 
@@ -175,6 +175,9 @@ export class CloudConfig extends jspb.Message {
175
175
  getLocationId(): string;
176
176
  setLocationId(value: string): void;
177
177
 
178
+ getMachineId(): string;
179
+ setMachineId(value: string): void;
180
+
178
181
  serializeBinary(): Uint8Array;
179
182
  toObject(includeInstance?: boolean): CloudConfig.AsObject;
180
183
  static toObject(includeInstance: boolean, msg: CloudConfig): CloudConfig.AsObject;
@@ -198,6 +201,7 @@ export namespace CloudConfig {
198
201
  locationSecretsList: Array<LocationSecret.AsObject>,
199
202
  primaryOrgId: string,
200
203
  locationId: string,
204
+ machineId: string,
201
205
  }
202
206
  }
203
207
 
@@ -19,6 +19,11 @@ export class ResourceName extends jspb.Message {
19
19
  getName(): string;
20
20
  setName(value: string): void;
21
21
 
22
+ hasMachinePartId(): boolean;
23
+ clearMachinePartId(): void;
24
+ getMachinePartId(): string;
25
+ setMachinePartId(value: string): void;
26
+
22
27
  serializeBinary(): Uint8Array;
23
28
  toObject(includeInstance?: boolean): ResourceName.AsObject;
24
29
  static toObject(includeInstance: boolean, msg: ResourceName): ResourceName.AsObject;
@@ -35,6 +40,7 @@ export namespace ResourceName {
35
40
  type: string,
36
41
  subtype: string,
37
42
  name: string,
43
+ machinePartId: string,
38
44
  }
39
45
  }
40
46
 
@@ -972,6 +972,12 @@ export class GetCloudMetadataResponse extends jspb.Message {
972
972
  getLocationId(): string;
973
973
  setLocationId(value: string): void;
974
974
 
975
+ getMachineId(): string;
976
+ setMachineId(value: string): void;
977
+
978
+ getMachinePartId(): string;
979
+ setMachinePartId(value: string): void;
980
+
975
981
  serializeBinary(): Uint8Array;
976
982
  toObject(includeInstance?: boolean): GetCloudMetadataResponse.AsObject;
977
983
  static toObject(includeInstance: boolean, msg: GetCloudMetadataResponse): GetCloudMetadataResponse.AsObject;
@@ -987,6 +993,8 @@ export namespace GetCloudMetadataResponse {
987
993
  robotPartId: string,
988
994
  primaryOrgId: string,
989
995
  locationId: string,
996
+ machineId: string,
997
+ machinePartId: string,
990
998
  }
991
999
  }
992
1000
 
package/dist/main.es.js CHANGED
@@ -8425,7 +8425,8 @@ var timestamp_pb$1 = {};
8425
8425
  namespace: e.Message.getFieldWithDefault(r, 1, ""),
8426
8426
  type: e.Message.getFieldWithDefault(r, 2, ""),
8427
8427
  subtype: e.Message.getFieldWithDefault(r, 3, ""),
8428
- name: e.Message.getFieldWithDefault(r, 4, "")
8428
+ name: e.Message.getFieldWithDefault(r, 4, ""),
8429
+ machinePartId: e.Message.getFieldWithDefault(r, 5, "")
8429
8430
  };
8430
8431
  return t && (i.$jspbMessageInstance = r), i;
8431
8432
  }), proto.viam.common.v1.ResourceName.deserializeBinary = function(t) {
@@ -8463,6 +8464,13 @@ var timestamp_pb$1 = {};
8463
8464
  );
8464
8465
  t.setName(l);
8465
8466
  break;
8467
+ case 5:
8468
+ var l = (
8469
+ /** @type {string} */
8470
+ r.readString()
8471
+ );
8472
+ t.setMachinePartId(l);
8473
+ break;
8466
8474
  default:
8467
8475
  r.skipField();
8468
8476
  break;
@@ -8486,6 +8494,10 @@ var timestamp_pb$1 = {};
8486
8494
  ), i = t.getName(), i.length > 0 && r.writeString(
8487
8495
  4,
8488
8496
  i
8497
+ ), i = /** @type {string} */
8498
+ e.Message.getField(t, 5), i != null && r.writeString(
8499
+ 5,
8500
+ i
8489
8501
  );
8490
8502
  }, proto.viam.common.v1.ResourceName.prototype.getNamespace = function() {
8491
8503
  return (
@@ -8515,6 +8527,17 @@ var timestamp_pb$1 = {};
8515
8527
  );
8516
8528
  }, proto.viam.common.v1.ResourceName.prototype.setName = function(t) {
8517
8529
  return e.Message.setProto3StringField(this, 4, t);
8530
+ }, proto.viam.common.v1.ResourceName.prototype.getMachinePartId = function() {
8531
+ return (
8532
+ /** @type {string} */
8533
+ e.Message.getFieldWithDefault(this, 5, "")
8534
+ );
8535
+ }, proto.viam.common.v1.ResourceName.prototype.setMachinePartId = function(t) {
8536
+ return e.Message.setField(this, 5, t);
8537
+ }, proto.viam.common.v1.ResourceName.prototype.clearMachinePartId = function() {
8538
+ return e.Message.setField(this, 5, void 0);
8539
+ }, proto.viam.common.v1.ResourceName.prototype.hasMachinePartId = function() {
8540
+ return e.Message.getField(this, 5) != null;
8518
8541
  }, e.Message.GENERATE_TO_OBJECT && (proto.viam.common.v1.BoardStatus.prototype.toObject = function(t) {
8519
8542
  return proto.viam.common.v1.BoardStatus.toObject(t, this);
8520
8543
  }, proto.viam.common.v1.BoardStatus.toObject = function(t, r) {
@@ -13230,7 +13253,9 @@ var duration_pb$1 = {};
13230
13253
  var c = {
13231
13254
  robotPartId: e.Message.getFieldWithDefault(l, 1, ""),
13232
13255
  primaryOrgId: e.Message.getFieldWithDefault(l, 2, ""),
13233
- locationId: e.Message.getFieldWithDefault(l, 3, "")
13256
+ locationId: e.Message.getFieldWithDefault(l, 3, ""),
13257
+ machineId: e.Message.getFieldWithDefault(l, 4, ""),
13258
+ machinePartId: e.Message.getFieldWithDefault(l, 5, "")
13234
13259
  };
13235
13260
  return i && (c.$jspbMessageInstance = l), c;
13236
13261
  }), proto.viam.robot.v1.GetCloudMetadataResponse.deserializeBinary = function(i) {
@@ -13261,6 +13286,20 @@ var duration_pb$1 = {};
13261
13286
  );
13262
13287
  i.setLocationId(d);
13263
13288
  break;
13289
+ case 4:
13290
+ var d = (
13291
+ /** @type {string} */
13292
+ l.readString()
13293
+ );
13294
+ i.setMachineId(d);
13295
+ break;
13296
+ case 5:
13297
+ var d = (
13298
+ /** @type {string} */
13299
+ l.readString()
13300
+ );
13301
+ i.setMachinePartId(d);
13302
+ break;
13264
13303
  default:
13265
13304
  l.skipField();
13266
13305
  break;
@@ -13281,6 +13320,12 @@ var duration_pb$1 = {};
13281
13320
  ), c = i.getLocationId(), c.length > 0 && l.writeString(
13282
13321
  3,
13283
13322
  c
13323
+ ), c = i.getMachineId(), c.length > 0 && l.writeString(
13324
+ 4,
13325
+ c
13326
+ ), c = i.getMachinePartId(), c.length > 0 && l.writeString(
13327
+ 5,
13328
+ c
13284
13329
  );
13285
13330
  }, proto.viam.robot.v1.GetCloudMetadataResponse.prototype.getRobotPartId = function() {
13286
13331
  return (
@@ -13303,6 +13348,20 @@ var duration_pb$1 = {};
13303
13348
  );
13304
13349
  }, proto.viam.robot.v1.GetCloudMetadataResponse.prototype.setLocationId = function(i) {
13305
13350
  return e.Message.setProto3StringField(this, 3, i);
13351
+ }, proto.viam.robot.v1.GetCloudMetadataResponse.prototype.getMachineId = function() {
13352
+ return (
13353
+ /** @type {string} */
13354
+ e.Message.getFieldWithDefault(this, 4, "")
13355
+ );
13356
+ }, proto.viam.robot.v1.GetCloudMetadataResponse.prototype.setMachineId = function(i) {
13357
+ return e.Message.setProto3StringField(this, 4, i);
13358
+ }, proto.viam.robot.v1.GetCloudMetadataResponse.prototype.getMachinePartId = function() {
13359
+ return (
13360
+ /** @type {string} */
13361
+ e.Message.getFieldWithDefault(this, 5, "")
13362
+ );
13363
+ }, proto.viam.robot.v1.GetCloudMetadataResponse.prototype.setMachinePartId = function(i) {
13364
+ return e.Message.setProto3StringField(this, 5, i);
13306
13365
  }, proto.viam.robot.v1.PeerConnectionType = {
13307
13366
  PEER_CONNECTION_TYPE_UNSPECIFIED: 0,
13308
13367
  PEER_CONNECTION_TYPE_GRPC: 1,
@@ -53280,6 +53339,42 @@ class BoardClient {
53280
53339
  const { boardService: g } = this, s = new pb$d.GetDigitalInterruptValueRequest();
53281
53340
  return s.setBoardName(this.name), s.setDigitalInterruptName(e), s.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(s), (await promisify(g.getDigitalInterruptValue.bind(g), s)).getValue();
53282
53341
  }
53342
+ async streamTicks(e, n, g = {}) {
53343
+ const s = new pb$d.StreamTicksRequest();
53344
+ s.setName(this.name), s.setPinNamesList(e), s.setExtra(struct_pb.Struct.fromJavaScript(g)), this.options.requestLogger?.(s);
53345
+ const p = this.client.streamTicks(s);
53346
+ return p.on("data", (u) => {
53347
+ const t = {
53348
+ pinName: u.getPinName(),
53349
+ high: u.getHigh(),
53350
+ time: u.getTime()
53351
+ };
53352
+ n.push(t);
53353
+ }), new Promise((u, t) => {
53354
+ p.on("status", (r) => {
53355
+ if (r.code !== 0) {
53356
+ const i = {
53357
+ message: r.details,
53358
+ code: r.code,
53359
+ metadata: r.metadata
53360
+ };
53361
+ t(i);
53362
+ }
53363
+ }), p.on("end", (r) => {
53364
+ if (r === void 0)
53365
+ t({ message: "Stream ended without a status code" });
53366
+ else if (r.code !== 0) {
53367
+ const i = {
53368
+ message: r.details,
53369
+ code: r.code,
53370
+ metadata: r.metadata
53371
+ };
53372
+ t(i);
53373
+ }
53374
+ u();
53375
+ });
53376
+ });
53377
+ }
53283
53378
  async setPowerMode(e, n, g, s = {}) {
53284
53379
  const { boardService: p } = this, u = new pb$d.SetPowerModeRequest();
53285
53380
  if (u.setName(e), u.setPowerMode(n), g) {
@@ -56414,7 +56509,7 @@ class GenericClient {
56414
56509
  return doCommandFromClient(n, this.name, e, this.options);
56415
56510
  }
56416
56511
  }
56417
- const version = "0.13.0";
56512
+ const version = "0.14.0";
56418
56513
  export {
56419
56514
  ArmClient,
56420
56515
  BaseClient,