@viamrobotics/sdk 0.6.0-rc.0 → 0.6.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,14 +8,24 @@ export type FilterOptions = Partial<pb.Filter.AsObject> & {
8
8
  tags?: string[];
9
9
  };
10
10
  type TabularData = {
11
- data?: googleStructPb.Struct.AsObject;
12
- metadataIndex: number;
11
+ data?: {
12
+ [key: string]: googleStructPb.JavaScriptValue;
13
+ };
14
+ metadata?: pb.CaptureMetadata.AsObject;
13
15
  timeRequested?: Date;
14
16
  timeReceived?: Date;
15
17
  };
16
18
  export declare class DataClient {
17
19
  private service;
18
20
  constructor(serviceHost: string, grpcOptions: RpcOptions);
21
+ /**
22
+ * Filter and download tabular data. The returned metadata might be empty if
23
+ * the metadata index of the data is out of the bounds of the returned
24
+ * metadata list.
25
+ *
26
+ * @param filter - Optional `pb.Filter` specifying tabular data to retrieve.
27
+ * No `filter` implies all tabular data.
28
+ */
19
29
  tabularDataByFilter(filter?: pb.Filter): Promise<TabularData[]>;
20
30
  binaryDataByFilter(filter?: pb.Filter): Promise<pb.BinaryData.AsObject[]>;
21
31
  binaryDataByIds(ids: BinaryID[]): Promise<pb.BinaryData.AsObject[]>;
package/dist/main.es.js CHANGED
@@ -50544,6 +50544,14 @@ class DataClient {
50544
50544
  constructor(e, n) {
50545
50545
  this.service = new DataServiceClient_1(e, n);
50546
50546
  }
50547
+ /**
50548
+ * Filter and download tabular data. The returned metadata might be empty if
50549
+ * the metadata index of the data is out of the bounds of the returned
50550
+ * metadata list.
50551
+ *
50552
+ * @param filter - Optional `pb.Filter` specifying tabular data to retrieve.
50553
+ * No `filter` implies all tabular data.
50554
+ */
50547
50555
  async tabularDataByFilter(e) {
50548
50556
  const { service: n } = this;
50549
50557
  let s = "";
@@ -50555,12 +50563,17 @@ class DataClient {
50555
50563
  const t = await promisify(n.tabularDataByFilter.bind(n), p), o = t.getDataList();
50556
50564
  if (!o || o.length === 0)
50557
50565
  break;
50566
+ const r = t.getMetadataList().length;
50558
50567
  l.push(
50559
- ...o.map((r) => ({
50560
- ...r.toObject(),
50561
- timeRequested: r.getTimeRequested()?.toDate(),
50562
- timeReceived: r.getTimeReceived()?.toDate()
50563
- }))
50568
+ ...o.map((u) => {
50569
+ const c = u.getMetadataIndex(), d = r !== 0 && c >= r ? new data_pb.CaptureMetadata().toObject() : t.getMetadataList()[c]?.toObject();
50570
+ return {
50571
+ data: u.getData()?.toJavaScript(),
50572
+ metadata: d,
50573
+ timeRequested: u.getTimeRequested()?.toDate(),
50574
+ timeReceived: u.getTimeReceived()?.toDate()
50575
+ };
50576
+ })
50564
50577
  ), s = t.getLast();
50565
50578
  }
50566
50579
  return l;
@@ -54438,7 +54451,7 @@ const concatArrayU8 = (i) => {
54438
54451
  for (const l of i)
54439
54452
  n.set(l, s), s += l.length;
54440
54453
  return n;
54441
- }, version = "0.6.0-rc.0";
54454
+ }, version = "0.6.0";
54442
54455
  export {
54443
54456
  ArmClient,
54444
54457
  BaseClient,