@dronedeploy/rocos-js-sdk 3.1.7 → 4.0.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.
package/README.md CHANGED
@@ -19,6 +19,11 @@ yarn add @dronedeploy/rocos-js-sdk rxjs@^7
19
19
 
20
20
  ## What's new
21
21
 
22
+ ### 4.0.0
23
+
24
+ * **BREAKING:** The default telemetry `transport` is now `'connect'` (the Connect protocol) instead of `'grpc-web'`. Consumers that do not set `transport` explicitly will switch to Connect automatically. If your backend or proxy only supports gRPC-web, restore the previous behaviour with `transport: 'grpc-web'`.
25
+ * The `'grpc-web'` telemetry transport is deprecated and will be removed in a future release. Selecting it now logs a one-time deprecation warning.
26
+
22
27
  ### 3.1.2
23
28
 
24
29
  * Use the optional `fetch` implementation for the gRPC-web transport too, so a custom `fetch` can be supplied consistently across transports.
@@ -3,7 +3,7 @@ import { TelemetryAckStatus, TelemetryQueryRequest, TelemetryRequest } from '../
3
3
  import { TelemetryStreamAbstract } from './TelemetryStreamAbstract';
4
4
  /**
5
5
  * Connect-protocol telemetry receive stream. Mirrors TelemetryStream (grpc-web) but uses
6
- * @connectrpc/connect. Selected when config.transport === 'connect'.
6
+ * @connectrpc/connect. The default transport, selected unless config.transport === 'grpc-web'.
7
7
  *
8
8
  * The shared TelemetryStreamAbstract is typed with the protobuf-ts message types, while the
9
9
  * Connect client uses @bufbuild/protobuf types. Both serialise to identical protobuf wire
@@ -11,7 +11,7 @@ const TelemetryStreamAbstract_1 = require("./TelemetryStreamAbstract");
11
11
  const connect_web_1 = require("@connectrpc/connect-web");
12
12
  /**
13
13
  * Connect-protocol telemetry receive stream. Mirrors TelemetryStream (grpc-web) but uses
14
- * @connectrpc/connect. Selected when config.transport === 'connect'.
14
+ * @connectrpc/connect. The default transport, selected unless config.transport === 'grpc-web'.
15
15
  *
16
16
  * The shared TelemetryStreamAbstract is typed with the protobuf-ts message types, while the
17
17
  * Connect client uses @bufbuild/protobuf types. Both serialise to identical protobuf wire
@@ -1,5 +1,5 @@
1
1
  import { IStreamOptions } from './IStreamOptions';
2
- export type TelemetryTransport = 'grpc-web' | 'connect';
2
+ export type TelemetryTransport = 'connect' | 'grpc-web';
3
3
  export interface IStreamConfig {
4
4
  url: string;
5
5
  token: string;
@@ -21,7 +21,14 @@ export interface Panorama {
21
21
  pos: Vector3;
22
22
  };
23
23
  data: {
24
- path: string;
24
+ /**
25
+ * Conventional location of the panorama image. Optional: it is not read by the SDK
26
+ * (nor required by the server), and a placeholder panorama may be created before the
27
+ * image exists.
28
+ */
29
+ path?: string;
30
+ /** The panorama node carries arbitrary data beyond the conventional fields above. */
31
+ [key: string]: unknown;
25
32
  };
26
33
  }
27
34
  /**
@@ -2,6 +2,7 @@ import { Observable } from 'rxjs';
2
2
  import { CallsignStatus, IRocosSDKConfig, IRocosTelemetryMessage, IStreamStatusMessage, ITelemetryStream, ITelemetryStreamConfig, ITelemetrySubscriptionParams, ITelemetrySubscriptions, TelemetryMonitorStatus } from '../models';
3
3
  import { BaseStreamService } from './BaseStreamService';
4
4
  export declare class TelemetryService extends BaseStreamService<ITelemetryStream, ITelemetryStreamConfig> {
5
+ private static grpcWebDeprecationWarned;
5
6
  private statusSubscription;
6
7
  private changeStream$;
7
8
  private streamStatusSubject$;
@@ -177,10 +177,16 @@ class TelemetryService extends BaseStreamService_1.BaseStreamService {
177
177
  return newStream.stream;
178
178
  }
179
179
  getStream(config) {
180
- if (config.transport === 'connect') {
181
- return new TelemetryStreamConnect_1.TelemetryStreamConnect(config);
180
+ if (config.transport === 'grpc-web') {
181
+ if (!TelemetryService.grpcWebDeprecationWarned) {
182
+ TelemetryService.grpcWebDeprecationWarned = true;
183
+ this.logger.warn('The grpc-web telemetry transport is deprecated and will be removed in a future release. ' +
184
+ 'Switch to the Connect protocol by setting transport to "connect" (now the default).');
185
+ }
186
+ return new TelemetryStream_1.TelemetryStream(config);
182
187
  }
183
- return new TelemetryStream_1.TelemetryStream(config);
188
+ return new TelemetryStreamConnect_1.TelemetryStreamConnect(config);
184
189
  }
185
190
  }
186
191
  exports.TelemetryService = TelemetryService;
192
+ TelemetryService.grpcWebDeprecationWarned = false;
@@ -3,7 +3,7 @@ import { TelemetryAckStatus, TelemetryQueryRequest, TelemetryRequest } from '../
3
3
  import { TelemetryStreamAbstract } from './TelemetryStreamAbstract';
4
4
  /**
5
5
  * Connect-protocol telemetry receive stream. Mirrors TelemetryStream (grpc-web) but uses
6
- * @connectrpc/connect. Selected when config.transport === 'connect'.
6
+ * @connectrpc/connect. The default transport, selected unless config.transport === 'grpc-web'.
7
7
  *
8
8
  * The shared TelemetryStreamAbstract is typed with the protobuf-ts message types, while the
9
9
  * Connect client uses @bufbuild/protobuf types. Both serialise to identical protobuf wire
@@ -8,7 +8,7 @@ import { TelemetryStreamAbstract } from './TelemetryStreamAbstract';
8
8
  import { createConnectTransport } from '@connectrpc/connect-web';
9
9
  /**
10
10
  * Connect-protocol telemetry receive stream. Mirrors TelemetryStream (grpc-web) but uses
11
- * @connectrpc/connect. Selected when config.transport === 'connect'.
11
+ * @connectrpc/connect. The default transport, selected unless config.transport === 'grpc-web'.
12
12
  *
13
13
  * The shared TelemetryStreamAbstract is typed with the protobuf-ts message types, while the
14
14
  * Connect client uses @bufbuild/protobuf types. Both serialise to identical protobuf wire
@@ -1,5 +1,5 @@
1
1
  import { IStreamOptions } from './IStreamOptions';
2
- export type TelemetryTransport = 'grpc-web' | 'connect';
2
+ export type TelemetryTransport = 'connect' | 'grpc-web';
3
3
  export interface IStreamConfig {
4
4
  url: string;
5
5
  token: string;
@@ -21,7 +21,14 @@ export interface Panorama {
21
21
  pos: Vector3;
22
22
  };
23
23
  data: {
24
- path: string;
24
+ /**
25
+ * Conventional location of the panorama image. Optional: it is not read by the SDK
26
+ * (nor required by the server), and a placeholder panorama may be created before the
27
+ * image exists.
28
+ */
29
+ path?: string;
30
+ /** The panorama node carries arbitrary data beyond the conventional fields above. */
31
+ [key: string]: unknown;
25
32
  };
26
33
  }
27
34
  /**
@@ -2,6 +2,7 @@ import { Observable } from 'rxjs';
2
2
  import { CallsignStatus, IRocosSDKConfig, IRocosTelemetryMessage, IStreamStatusMessage, ITelemetryStream, ITelemetryStreamConfig, ITelemetrySubscriptionParams, ITelemetrySubscriptions, TelemetryMonitorStatus } from '../models';
3
3
  import { BaseStreamService } from './BaseStreamService';
4
4
  export declare class TelemetryService extends BaseStreamService<ITelemetryStream, ITelemetryStreamConfig> {
5
+ private static grpcWebDeprecationWarned;
5
6
  private statusSubscription;
6
7
  private changeStream$;
7
8
  private streamStatusSubject$;
@@ -174,9 +174,15 @@ export class TelemetryService extends BaseStreamService {
174
174
  return newStream.stream;
175
175
  }
176
176
  getStream(config) {
177
- if (config.transport === 'connect') {
178
- return new TelemetryStreamConnect(config);
177
+ if (config.transport === 'grpc-web') {
178
+ if (!TelemetryService.grpcWebDeprecationWarned) {
179
+ TelemetryService.grpcWebDeprecationWarned = true;
180
+ this.logger.warn('The grpc-web telemetry transport is deprecated and will be removed in a future release. ' +
181
+ 'Switch to the Connect protocol by setting transport to "connect" (now the default).');
182
+ }
183
+ return new TelemetryStream(config);
179
184
  }
180
- return new TelemetryStream(config);
185
+ return new TelemetryStreamConnect(config);
181
186
  }
182
187
  }
188
+ TelemetryService.grpcWebDeprecationWarned = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dronedeploy/rocos-js-sdk",
3
- "version": "3.1.7",
3
+ "version": "4.0.0",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",