@dronedeploy/rocos-js-sdk 3.0.1-alpha.11 → 3.0.1-alpha.15
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/IRocosSDK.d.ts +1 -2
- package/cjs/RocosSDK.d.ts +4 -6
- package/cjs/RocosSDK.js +1 -9
- package/cjs/api/streams/caller/CallerStream.js +5 -2
- package/cjs/api/streams/caller/CallerStreamNode.js +2 -1
- package/cjs/api/streams/command/CommandStream.js +5 -2
- package/cjs/api/streams/command/CommandStreamNode.js +2 -1
- package/cjs/api/streams/control/ControlStream.js +5 -2
- package/cjs/api/streams/control/ControlStreamAbstract.d.ts +1 -1
- package/cjs/api/streams/control/ControlStreamNode.js +2 -1
- package/cjs/api/streams/fileAccessor/FileAccessorStream.js +4 -1
- package/cjs/api/streams/fileAccessor/FileAccessorStreamNode.js +3 -1
- package/cjs/api/streams/search/SearchStream.js +5 -2
- package/cjs/api/streams/search/SearchStreamNode.js +2 -1
- package/cjs/api/streams/telemetry/TelemetryStream.js +4 -1
- package/cjs/api/streams/telemetry/TelemetryStreamAbstract.d.ts +1 -1
- package/cjs/api/streams/telemetry/TelemetryStreamNode.js +2 -1
- package/cjs/api/streams/webRTCSignalling/WebRTCSignallingStream.js +5 -2
- package/cjs/constants/api.d.ts +2 -4
- package/cjs/constants/api.js +4 -6
- package/cjs/helpers/getUniqueConfigKey.d.ts +6 -2
- package/cjs/helpers/getUniqueConfigKey.js +7 -2
- package/cjs/models/TelemetryStatus.d.ts +12 -0
- package/cjs/models/TelemetryStatus.js +17 -0
- package/cjs/models/Token.d.ts +2 -2
- package/cjs/models/Token.js +5 -5
- package/cjs/models/index.d.ts +1 -1
- package/cjs/models/index.js +1 -1
- package/cjs/node/RocosSDKNode.js +0 -3
- package/cjs/services/ProfileService.d.ts +23 -0
- package/cjs/services/ProfileService.js +28 -0
- package/cjs/services/RTPWebRTCService.d.ts +1 -1
- package/cjs/services/RTPWebRTCService.js +4 -2
- package/cjs/services/TelemetryService.d.ts +10 -1
- package/cjs/services/TelemetryService.js +27 -5
- package/cjs/services/index.d.ts +0 -1
- package/cjs/services/index.js +0 -1
- package/cjs/store/RocosStore.d.ts +1 -2
- package/esm/IRocosSDK.d.ts +1 -2
- package/esm/RocosSDK.d.ts +4 -6
- package/esm/RocosSDK.js +2 -10
- package/esm/api/streams/caller/CallerStream.js +5 -2
- package/esm/api/streams/caller/CallerStreamNode.js +2 -1
- package/esm/api/streams/command/CommandStream.js +5 -2
- package/esm/api/streams/command/CommandStreamNode.js +2 -1
- package/esm/api/streams/control/ControlStream.js +5 -2
- package/esm/api/streams/control/ControlStreamAbstract.d.ts +1 -1
- package/esm/api/streams/control/ControlStreamNode.js +2 -1
- package/esm/api/streams/fileAccessor/FileAccessorStream.js +4 -1
- package/esm/api/streams/fileAccessor/FileAccessorStreamNode.js +3 -1
- package/esm/api/streams/search/SearchStream.js +5 -2
- package/esm/api/streams/search/SearchStreamNode.js +2 -1
- package/esm/api/streams/telemetry/TelemetryStream.js +4 -1
- package/esm/api/streams/telemetry/TelemetryStreamAbstract.d.ts +1 -1
- package/esm/api/streams/telemetry/TelemetryStreamNode.js +2 -1
- package/esm/api/streams/webRTCSignalling/WebRTCSignallingStream.js +5 -2
- package/esm/constants/api.d.ts +2 -4
- package/esm/constants/api.js +2 -4
- package/esm/helpers/getUniqueConfigKey.d.ts +6 -2
- package/esm/helpers/getUniqueConfigKey.js +7 -2
- package/esm/models/TelemetryStatus.d.ts +12 -0
- package/esm/models/TelemetryStatus.js +14 -0
- package/esm/models/Token.d.ts +2 -2
- package/esm/models/Token.js +5 -5
- package/esm/models/index.d.ts +1 -1
- package/esm/models/index.js +1 -1
- package/esm/node/RocosSDKNode.js +1 -4
- package/esm/services/ProfileService.d.ts +23 -0
- package/esm/services/ProfileService.js +29 -1
- package/esm/services/RTPWebRTCService.d.ts +1 -1
- package/esm/services/RTPWebRTCService.js +4 -2
- package/esm/services/TelemetryService.d.ts +10 -1
- package/esm/services/TelemetryService.js +28 -6
- package/esm/services/index.d.ts +0 -1
- package/esm/services/index.js +0 -1
- package/esm/store/RocosStore.d.ts +1 -2
- package/package.json +1 -2
- package/cjs/helpers/cleanObject.spec.d.ts +0 -1
- package/cjs/helpers/cleanObject.spec.js +0 -55
- package/cjs/helpers/flattenObject.spec.d.ts +0 -1
- package/cjs/helpers/flattenObject.spec.js +0 -31
- package/cjs/helpers/flattenOneOf.spec.d.ts +0 -1
- package/cjs/helpers/flattenOneOf.spec.js +0 -159
- package/cjs/helpers/formatServiceUrl.spec.d.ts +0 -1
- package/cjs/helpers/formatServiceUrl.spec.js +0 -18
- package/cjs/helpers/getSha256Hex.spec.d.ts +0 -1
- package/cjs/helpers/getSha256Hex.spec.js +0 -19
- package/cjs/helpers/getSha256HexNode.spec.d.ts +0 -1
- package/cjs/helpers/getSha256HexNode.spec.js +0 -10
- package/cjs/helpers/getURLSearchParams.spec.d.ts +0 -1
- package/cjs/helpers/getURLSearchParams.spec.js +0 -21
- package/cjs/helpers/nanosecondToMillisecond.spec.d.ts +0 -1
- package/cjs/helpers/nanosecondToMillisecond.spec.js +0 -22
- package/cjs/helpers/splitRobotTopic.spec.d.ts +0 -1
- package/cjs/helpers/splitRobotTopic.spec.js +0 -53
- package/cjs/helpers/standardDeviation.spec.d.ts +0 -1
- package/cjs/helpers/standardDeviation.spec.js +0 -13
- package/cjs/helpers/websandbox/frame/worker/manager.spec.d.ts +0 -4
- package/cjs/helpers/websandbox/frame/worker/manager.spec.js +0 -132
- package/cjs/models/CallsignStatus.d.ts +0 -6
- package/cjs/models/CallsignStatus.js +0 -10
- package/cjs/models/Token.spec.d.ts +0 -1
- package/cjs/models/Token.spec.js +0 -110
- package/cjs/services/AuthService.spec.d.ts +0 -1
- package/cjs/services/AuthService.spec.js +0 -165
- package/cjs/services/CallerService.spec.d.ts +0 -1
- package/cjs/services/CallerService.spec.js +0 -229
- package/cjs/services/FunctionService.d.ts +0 -68
- package/cjs/services/FunctionService.js +0 -103
- package/cjs/services/PlatformTimeService.spec.d.ts +0 -1
- package/cjs/services/PlatformTimeService.spec.js +0 -182
- package/cjs/services/RTPWebRTCService.spec.d.ts +0 -4
- package/cjs/services/RTPWebRTCService.spec.js +0 -171
- package/cjs/services/TelemetryService.spec.d.ts +0 -1
- package/cjs/services/TelemetryService.spec.js +0 -39
- package/esm/helpers/cleanObject.spec.d.ts +0 -1
- package/esm/helpers/cleanObject.spec.js +0 -53
- package/esm/helpers/flattenObject.spec.d.ts +0 -1
- package/esm/helpers/flattenObject.spec.js +0 -29
- package/esm/helpers/flattenOneOf.spec.d.ts +0 -1
- package/esm/helpers/flattenOneOf.spec.js +0 -157
- package/esm/helpers/formatServiceUrl.spec.d.ts +0 -1
- package/esm/helpers/formatServiceUrl.spec.js +0 -16
- package/esm/helpers/getSha256Hex.spec.d.ts +0 -1
- package/esm/helpers/getSha256Hex.spec.js +0 -14
- package/esm/helpers/getSha256HexNode.spec.d.ts +0 -1
- package/esm/helpers/getSha256HexNode.spec.js +0 -8
- package/esm/helpers/getURLSearchParams.spec.d.ts +0 -1
- package/esm/helpers/getURLSearchParams.spec.js +0 -19
- package/esm/helpers/nanosecondToMillisecond.spec.d.ts +0 -1
- package/esm/helpers/nanosecondToMillisecond.spec.js +0 -20
- package/esm/helpers/splitRobotTopic.spec.d.ts +0 -1
- package/esm/helpers/splitRobotTopic.spec.js +0 -51
- package/esm/helpers/standardDeviation.spec.d.ts +0 -1
- package/esm/helpers/standardDeviation.spec.js +0 -11
- package/esm/helpers/websandbox/frame/worker/manager.spec.d.ts +0 -4
- package/esm/helpers/websandbox/frame/worker/manager.spec.js +0 -127
- package/esm/models/CallsignStatus.d.ts +0 -6
- package/esm/models/CallsignStatus.js +0 -7
- package/esm/models/Token.spec.d.ts +0 -1
- package/esm/models/Token.spec.js +0 -108
- package/esm/services/AuthService.spec.d.ts +0 -1
- package/esm/services/AuthService.spec.js +0 -163
- package/esm/services/CallerService.spec.d.ts +0 -1
- package/esm/services/CallerService.spec.js +0 -227
- package/esm/services/FunctionService.d.ts +0 -68
- package/esm/services/FunctionService.js +0 -99
- package/esm/services/PlatformTimeService.spec.d.ts +0 -1
- package/esm/services/PlatformTimeService.spec.js +0 -180
- package/esm/services/RTPWebRTCService.spec.d.ts +0 -4
- package/esm/services/RTPWebRTCService.spec.js +0 -169
- package/esm/services/TelemetryService.spec.d.ts +0 -1
- package/esm/services/TelemetryService.spec.js +0 -37
package/cjs/IRocosSDK.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, EvaluatorService, EventService, FileAccessorService,
|
1
|
+
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RobotService, SearchService, SpotProvisioningService, SpotProvisioningServiceNode, StreamService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
2
2
|
import { IBaseService, IDebugLevel, ServiceEnum } from './models';
|
3
3
|
import { RTPWebRTCService } from './services/RTPWebRTCService';
|
4
4
|
export declare abstract class IRocosSDK {
|
@@ -14,7 +14,6 @@ export declare abstract class IRocosSDK {
|
|
14
14
|
abstract getSearchService(): SearchService;
|
15
15
|
abstract getConfigGroupService(): ConfigGroupService;
|
16
16
|
abstract getDashboardService(): DashboardService;
|
17
|
-
abstract getFunctionService(): FunctionService;
|
18
17
|
abstract getStreamService(): StreamService;
|
19
18
|
abstract getUserService(): UserService;
|
20
19
|
abstract getMapService(): MapService;
|
package/cjs/RocosSDK.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, EvaluatorService, EventService, FileAccessorService,
|
1
|
+
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, ScheduleService, SearchService, SpotProvisioningService, StreamService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
2
2
|
import { AuthorisedConfig, IBaseService, IDebugLevel, IRocosSDKConfig, ServiceEnum } from './models';
|
3
3
|
import { IRocosSDK } from './IRocosSDK';
|
4
4
|
import { Logger } from 'loglevel';
|
@@ -62,10 +62,6 @@ export declare class RocosSDK implements IRocosSDK {
|
|
62
62
|
* Gets the dashboard service
|
63
63
|
*/
|
64
64
|
getDashboardService(): DashboardService;
|
65
|
-
/**
|
66
|
-
* Gets the function service
|
67
|
-
*/
|
68
|
-
getFunctionService(): FunctionService;
|
69
65
|
/**
|
70
66
|
* Gets the stream service
|
71
67
|
*/
|
@@ -145,5 +141,7 @@ export declare class RocosSDK implements IRocosSDK {
|
|
145
141
|
*/
|
146
142
|
enableDebugMode(on: boolean): void;
|
147
143
|
setDebugLevel(level: IDebugLevel): void;
|
148
|
-
protected overrideConfig(service: ServiceEnum): AuthorisedConfig
|
144
|
+
protected overrideConfig(service: ServiceEnum): AuthorisedConfig & {
|
145
|
+
_parentConfig?: IRocosSDKConfig;
|
146
|
+
};
|
149
147
|
}
|
package/cjs/RocosSDK.js
CHANGED
@@ -62,9 +62,6 @@ class RocosSDK {
|
|
62
62
|
case models_1.ServiceEnum.DASHBOARD:
|
63
63
|
this.services[name] = new services_1.DashboardService(config);
|
64
64
|
break;
|
65
|
-
case models_1.ServiceEnum.FUNCTION:
|
66
|
-
this.services[name] = new services_1.FunctionService(config);
|
67
|
-
break;
|
68
65
|
case models_1.ServiceEnum.STREAM:
|
69
66
|
this.services[name] = new services_1.StreamService(config);
|
70
67
|
break;
|
@@ -178,12 +175,6 @@ class RocosSDK {
|
|
178
175
|
getDashboardService() {
|
179
176
|
return this.getService(models_1.ServiceEnum.DASHBOARD);
|
180
177
|
}
|
181
|
-
/**
|
182
|
-
* Gets the function service
|
183
|
-
*/
|
184
|
-
getFunctionService() {
|
185
|
-
return this.getService(models_1.ServiceEnum.FUNCTION);
|
186
|
-
}
|
187
178
|
/**
|
188
179
|
* Gets the stream service
|
189
180
|
*/
|
@@ -322,6 +313,7 @@ class RocosSDK {
|
|
322
313
|
return {
|
323
314
|
...config,
|
324
315
|
...this.config.overrides?.[service],
|
316
|
+
_parentConfig: this.config,
|
325
317
|
};
|
326
318
|
}
|
327
319
|
}
|
@@ -71,12 +71,15 @@ class CallerStream extends CallerStreamAbstract_1.CallerStreamAbstract {
|
|
71
71
|
return (0, stringToUint8Array_1.stringToUint8Array)(payload);
|
72
72
|
}
|
73
73
|
getMetadata(projectId, callsign, subsystem) {
|
74
|
-
|
75
|
-
'authorization': this.token,
|
74
|
+
const meta = {
|
76
75
|
'r-p': projectId,
|
77
76
|
'r-cs': callsign,
|
78
77
|
'r-s': subsystem ?? '',
|
79
78
|
};
|
79
|
+
if (this.token) {
|
80
|
+
meta.authorization = this.token;
|
81
|
+
}
|
82
|
+
return meta;
|
80
83
|
}
|
81
84
|
}
|
82
85
|
exports.CallerStream = CallerStream;
|
@@ -135,7 +135,8 @@ class CallerStreamNode extends CallerStreamAbstract_1.CallerStreamAbstract {
|
|
135
135
|
meta.add('r-p', projectId);
|
136
136
|
meta.add('r-cs', callsign);
|
137
137
|
meta.add('r-s', subsystem ?? '');
|
138
|
-
|
138
|
+
if (this.token)
|
139
|
+
meta.add('authorization', this.token);
|
139
140
|
return meta;
|
140
141
|
}
|
141
142
|
}
|
@@ -61,11 +61,14 @@ class CommandStream extends CommandStreamAbstract_1.CommandStreamAbstract {
|
|
61
61
|
});
|
62
62
|
}
|
63
63
|
getMetadata(projectId, callsign) {
|
64
|
-
|
65
|
-
'authorization': this.token,
|
64
|
+
const meta = {
|
66
65
|
'r-p': projectId,
|
67
66
|
'r-cs': callsign,
|
68
67
|
};
|
68
|
+
if (this.token) {
|
69
|
+
meta.authorization = this.token;
|
70
|
+
}
|
71
|
+
return meta;
|
69
72
|
}
|
70
73
|
}
|
71
74
|
exports.CommandStream = CommandStream;
|
@@ -84,12 +84,13 @@ class CommandStreamNode extends CommandStreamAbstract_1.CommandStreamAbstract {
|
|
84
84
|
}
|
85
85
|
getMetadata(projectId, callsign, subsystem) {
|
86
86
|
const meta = new grpc.Metadata();
|
87
|
-
meta.add('authorization', this.token);
|
88
87
|
meta.add('r-p', projectId);
|
89
88
|
meta.add('r-cs', callsign);
|
90
89
|
if (subsystem) {
|
91
90
|
meta.add('r-s', subsystem);
|
92
91
|
}
|
92
|
+
if (this.token)
|
93
|
+
meta.add('authorization', this.token);
|
93
94
|
return meta;
|
94
95
|
}
|
95
96
|
}
|
@@ -70,11 +70,14 @@ class ControlStream extends ControlStreamAbstract_1.ControlStreamAbstract {
|
|
70
70
|
return (0, stringToUint8Array_1.stringToUint8Array)(payload);
|
71
71
|
}
|
72
72
|
getMetadata(projectId, callsign) {
|
73
|
-
|
74
|
-
'authorization': this.token,
|
73
|
+
const meta = {
|
75
74
|
'r-p': projectId,
|
76
75
|
'r-cs': callsign,
|
77
76
|
};
|
77
|
+
if (this.token) {
|
78
|
+
meta.authorization = this.token;
|
79
|
+
}
|
80
|
+
return meta;
|
78
81
|
}
|
79
82
|
}
|
80
83
|
exports.ControlStream = ControlStream;
|
@@ -5,7 +5,7 @@ import { Logger } from 'loglevel';
|
|
5
5
|
export declare abstract class ControlStreamAbstract implements IControlStream {
|
6
6
|
identifier: string;
|
7
7
|
statusStream$: BehaviorSubject<SubscriberStatusEnum>;
|
8
|
-
protected token
|
8
|
+
protected token?: string;
|
9
9
|
private readonly scope;
|
10
10
|
protected url: string;
|
11
11
|
protected subscriberStatus: SubscriberStatusEnum;
|
@@ -91,9 +91,10 @@ class ControlStreamNode extends ControlStreamAbstract_1.ControlStreamAbstract {
|
|
91
91
|
}
|
92
92
|
getMetadata(projectId, callsign) {
|
93
93
|
const meta = new grpc.Metadata();
|
94
|
-
meta.add('authorization', this.token);
|
95
94
|
meta.add('r-p', projectId);
|
96
95
|
meta.add('r-cs', callsign);
|
96
|
+
if (this.token)
|
97
|
+
meta.add('authorization', this.token);
|
97
98
|
return meta;
|
98
99
|
}
|
99
100
|
}
|
@@ -51,7 +51,10 @@ class FileAccessorStream extends FileAccessorStreamAbstract_1.FileAccessorStream
|
|
51
51
|
throw new Error('Error in serverReqOp call');
|
52
52
|
}
|
53
53
|
getMetadata(projectId, callsign) {
|
54
|
-
const result = {
|
54
|
+
const result = {};
|
55
|
+
if (this.token) {
|
56
|
+
result.authorization = this.token;
|
57
|
+
}
|
55
58
|
if (projectId) {
|
56
59
|
result['r-p'] = projectId;
|
57
60
|
}
|
@@ -80,7 +80,9 @@ class FileAccessorStreamNode extends FileAccessorStreamAbstract_1.FileAccessorSt
|
|
80
80
|
}
|
81
81
|
getMetadata(projectId, callsign) {
|
82
82
|
const meta = new grpc.Metadata();
|
83
|
-
|
83
|
+
if (this.token) {
|
84
|
+
meta.add('authorization', this.token);
|
85
|
+
}
|
84
86
|
if (projectId) {
|
85
87
|
meta.add('r-p', projectId);
|
86
88
|
}
|
@@ -92,10 +92,13 @@ class SearchStream extends SearchStreamAbstract_1.SearchStreamAbstract {
|
|
92
92
|
return response;
|
93
93
|
}
|
94
94
|
getMetadata(projectId) {
|
95
|
-
|
96
|
-
'authorization': this.token,
|
95
|
+
const meta = {
|
97
96
|
'r-p': projectId,
|
98
97
|
};
|
98
|
+
if (this.token) {
|
99
|
+
meta.authorization = this.token;
|
100
|
+
}
|
101
|
+
return meta;
|
99
102
|
}
|
100
103
|
}
|
101
104
|
exports.SearchStream = SearchStream;
|
@@ -137,8 +137,9 @@ class SearchStreamNode extends SearchStreamAbstract_1.SearchStreamAbstract {
|
|
137
137
|
}
|
138
138
|
getMetadata(projectId) {
|
139
139
|
const meta = new grpc.Metadata();
|
140
|
-
meta.add('authorization', this.token);
|
141
140
|
meta.add('r-p', projectId);
|
141
|
+
if (this.token)
|
142
|
+
meta.add('authorization', this.token);
|
142
143
|
return meta;
|
143
144
|
}
|
144
145
|
}
|
@@ -65,7 +65,10 @@ class TelemetryStream extends TelemetryStreamAbstract_1.TelemetryStreamAbstract
|
|
65
65
|
}
|
66
66
|
}
|
67
67
|
getMetadata(projectId) {
|
68
|
-
const result = {
|
68
|
+
const result = {};
|
69
|
+
if (this.token) {
|
70
|
+
result.authorization = this.token;
|
71
|
+
}
|
69
72
|
if (projectId) {
|
70
73
|
result['r-p'] = projectId;
|
71
74
|
}
|
@@ -11,7 +11,7 @@ export declare abstract class TelemetryStreamAbstract implements ITelemetryStrea
|
|
11
11
|
protected projectId: string;
|
12
12
|
private callsignsLookup;
|
13
13
|
private sources;
|
14
|
-
protected token
|
14
|
+
protected token?: string;
|
15
15
|
private scope;
|
16
16
|
protected url: string;
|
17
17
|
private timerIntervalInSec;
|
@@ -129,10 +129,11 @@ class TelemetryStreamNode extends TelemetryStreamAbstract_1.TelemetryStreamAbstr
|
|
129
129
|
}
|
130
130
|
getMetaData() {
|
131
131
|
const meta = new grpc.Metadata();
|
132
|
-
meta.add('authorization', this.token);
|
133
132
|
meta.add('r-p', this.projectId);
|
134
133
|
meta.add('r-tid', (0, uuid_1.v4)());
|
135
134
|
meta.add('r-cs', 'rocos-js-sdk-agent');
|
135
|
+
if (this.token)
|
136
|
+
meta.add('authorization', this.token);
|
136
137
|
return meta;
|
137
138
|
}
|
138
139
|
requestTelemetry(req) {
|
@@ -80,10 +80,13 @@ class WebRTCSignallingStream extends WebRTCSignallingStreamAbstract_1.WebRTCSign
|
|
80
80
|
return this.webRTCOperatorclient.addIceCandidate(request, { meta: metadata }).response;
|
81
81
|
}
|
82
82
|
getMetadata(projectId) {
|
83
|
-
|
84
|
-
'authorization': this.token,
|
83
|
+
const meta = {
|
85
84
|
'r-p': projectId,
|
86
85
|
};
|
86
|
+
if (this.token) {
|
87
|
+
meta.authorization = this.token;
|
88
|
+
}
|
89
|
+
return meta;
|
87
90
|
}
|
88
91
|
}
|
89
92
|
exports.WebRTCSignallingStream = WebRTCSignallingStream;
|
package/cjs/constants/api.d.ts
CHANGED
@@ -82,6 +82,8 @@ export declare const API_PROJECT_DEFINITION_ACTION_URL = "https://{url}/projects
|
|
82
82
|
export declare const API_PROJECT_DEFINITION_BUTTON_URL = "https://{url}/projects/{projectId}/robot-definitions/{definitionId}/buttons";
|
83
83
|
export declare const API_PROJECT_DEFINITION_TRIGGER_URL = "https://{url}/projects/{projectId}/robot-definitions/{definitionId}/triggers";
|
84
84
|
export declare const API_PROJECT_DEFINITION_GAMEPAD_URL = "https://{url}/projects/{projectId}/robot-definitions/{definitionId}/gamepads";
|
85
|
+
export declare const API_PROJECT_DEFINITION_EXPORT = "https://{url}/projects/{projectId}/robot-definitions/{definitionId}/export";
|
86
|
+
export declare const API_PROJECT_DEFINITION_IMPORT = "https://{url}/projects/{projectId}/robot-definitions/import";
|
85
87
|
export declare const API_PROJECT_GROUP_TYPE_URL = "https://{url}/projects/{projectId}/config-groups/{type}";
|
86
88
|
export declare const API_PROJECT_GROUP_TYPE_ID_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}";
|
87
89
|
export declare const API_PROJECT_GROUP_TYPE_PUBLISH_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/publish";
|
@@ -89,10 +91,6 @@ export declare const API_PROJECT_GROUP_TYPE_CONFIG_URL = "https://{url}/projects
|
|
89
91
|
export declare const API_PROJECT_GROUP_TYPE_VERSION_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{version}";
|
90
92
|
export declare const API_PROJECT_GROUP_TYPE_OWNER_ID_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/owner/{ownerId}";
|
91
93
|
export declare const API_PROJECT_GROUP_TYPE_OWNER_OVERRIDE_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{ownerId}/override";
|
92
|
-
export declare const API_PROJECT_FUNCTION_URL = "https://{url}/projects/{projectId}/functions";
|
93
|
-
export declare const API_PROJECT_FUNCTION_ID_URL = "https://{url}/projects/{projectId}/functions/{functionId}";
|
94
|
-
export declare const API_PROJECT_FUNCTION_RUN_URL = "https://{url}/projects/{projectId}/functions/{functionId}/run";
|
95
|
-
export declare const API_PROJECT_FUNCTION_POD_URL = "https://{url}/projects/{projectId}/functions/{functionId}/pods";
|
96
94
|
export declare const API_PROJECT_EXPORT_URL = "https://{url}/projects/{projectId}/export-jobs";
|
97
95
|
export declare const API_PROJECT_STREAM_URL = "https://{url}/projects/{projectId}/streams";
|
98
96
|
export declare const API_PROJECT_STREAM_ID_URL = "https://{url}/projects/{projectId}/streams/{streamId}";
|
package/cjs/constants/api.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.API_PROJECT_ROBOT_REGISTER_URL = exports.API_PROJECT_ROBOT_DEFINITION_URL = exports.API_PROJECT_ROBOT_ATTRIBUTES_URL = exports.API_PROJECT_ROBOT_ID_URL = exports.API_PROJECT_ROBOT_URL = exports.API_PROJECT_MAPPED_ASSETS_PATH_URL = exports.API_PROJECT_MISSION_ASSET_PATH_URL = exports.API_PROJECT_MISSION_ASSETS_PATH_URL = exports.API_PROJECT_FLOW_ASSET_PATH_URL = exports.API_PROJECT_ROBOT_ASSET_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATION_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATIONS_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATION_PROVIDERS_PATH_URL = exports.API_PROJECT_ASSET_PROFILES_SYNC_DEFINITION_PATH_URL = exports.API_PROJECT_ASSET_ROBOTS_SYNC_DEFINITION_PATH_URL = exports.API_PROJECT_ASSET_PATH_URL = exports.API_PROJECT_ASSET_URL = exports.API_PROJECT_USERS_URL = exports.API_PROJECT_ID_URL = exports.API_PROJECT_URL = exports.API_ACCOUNT_PROJECT_APPLICATION_ID_URL = exports.API_ACCOUNT_PROJECT_APPLICATION_URL = exports.API_ACCOUNT_PROJECT_USER_ID_URL = exports.API_ACCOUNT_PROJECT_USER_URL = exports.API_ACCOUNT_PROJECT_ID_URL = exports.API_ACCOUNT_PROJECT_URL = exports.API_SERVER_TIME_URL = exports.API_ACCOUNT_INTEGRATION_TYPE_URL = exports.API_ACCOUNT_INTEGRATION_URL = exports.API_ACCOUNT_SETTINGS_URL = exports.API_AUTH_USER_ACCOUNT_USER_ID_URL = exports.API_AUTH_USER_ACCOUNT_USER_URL = exports.API_ACCOUNT_ACTIVATE_URL = exports.API_ACCOUNT_ID_URL = exports.API_ACCOUNT_URL = exports.API_USER_PAT_TOKEN_URL = exports.API_USER_PAT_URL = exports.API_USER_VERIFY_EMAIL_URL = exports.API_USER_INVITATION_CHECK_URL = exports.API_USER_INVITATION_ACCEPT_URL = exports.API_USER_INVITATION_URL = exports.API_USER_PASSWORD_FORGOT_URL = exports.API_USER_PASSWORD_RESET_URL = exports.API_OTP_AUTH_URL = exports.API_OTP_URL = exports.API_USER_TOKEN_URL = exports.API_USER_AUTH_URL = exports.API_USER_URL = exports.API_ADMIN_USER_INVITATION_URL = exports.API_APPLICATION_AUTH_URL = void 0;
|
4
|
-
exports.
|
5
|
-
exports.API_LINKED_PROJECT_URL = exports.API_PROJECT_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_WORKFLOW_ASSET_URL = exports.API_PROJECT_WORKFLOW_ID_URL = exports.API_PROJECT_WORKFLOW_URL = exports.API_OBSERVATION_KEYS_URL = exports.API_OBSERVATIONS_URL = exports.API_MAPS_PANORAMA_OBSERVATIONS_URL = exports.API_MAPS_GEOJSON_URL = exports.API_MAPS_DEPLOY_URL = exports.API_MAPS_COPY_URL = exports.API_MAP_ID_URL = exports.API_MAPS_MERGE_URL = exports.API_MAPS_DEPLOYED_URL = exports.API_MAPS_URL = exports.API_DD_INTEGRATION_ISSUES_URL = exports.API_DD_INTEGRATION_OVERLAYS_URL = exports.API_DD_INTEGRATION_PLAN_BY_ID_URL = exports.API_DD_INTEGRATION_PLANS_URL = exports.API_SPOTTY_URL = exports.API_PROJECT_SCHEDULES_URL = exports.API_SOURCE_ID_URL = exports.API_SOURCE_URL = exports.API_SOURCE_SCHEMA_URL = exports.API_TEMPLATE_EXPORTER_URL = exports.API_TEMPLATE_PROVISION_ID_URL = exports.API_TEMPLATE_PROVISION_URL = exports.API_TEMPLATE_DEPLOY_URL = exports.API_PROJECT_PROFILE_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_PROFILE_DASHBOARD_ID_URL = exports.API_PROJECT_PROFILE_DASHBOARD_URL = exports.API_PROJECT_CALLSIGN_STREAM_URL = exports.API_PROJECT_ROBOT_DASHBOARD_CUSTOM_WIDGET_URL =
|
4
|
+
exports.API_PROJECT_ROBOT_DASHBOARD_ID_URL = exports.API_PROJECT_ROBOT_DASHBOARD_URL = exports.API_PROJECT_STREAM_CALLSIGN_URL = exports.API_PROJECT_STREAM_DATA_URL = exports.API_PROJECT_STREAM_ID_URL = exports.API_PROJECT_STREAM_URL = exports.API_PROJECT_EXPORT_URL = exports.API_PROJECT_GROUP_TYPE_OWNER_OVERRIDE_URL = exports.API_PROJECT_GROUP_TYPE_OWNER_ID_URL = exports.API_PROJECT_GROUP_TYPE_VERSION_URL = exports.API_PROJECT_GROUP_TYPE_CONFIG_URL = exports.API_PROJECT_GROUP_TYPE_PUBLISH_URL = exports.API_PROJECT_GROUP_TYPE_ID_URL = exports.API_PROJECT_GROUP_TYPE_URL = exports.API_PROJECT_DEFINITION_IMPORT = exports.API_PROJECT_DEFINITION_EXPORT = exports.API_PROJECT_DEFINITION_GAMEPAD_URL = exports.API_PROJECT_DEFINITION_TRIGGER_URL = exports.API_PROJECT_DEFINITION_BUTTON_URL = exports.API_PROJECT_DEFINITION_ACTION_URL = exports.API_PROJECT_DEFINITION_EVENT_URL = exports.API_PROJECT_DEFINITION_COMMAND2_URL = exports.API_PROJECT_DEFINITION_COMMAND_URL = exports.API_PROJECT_DEFINITION_AGENT_URL = exports.API_PROJECT_DEFINITION_SETTING_URL = exports.API_PROJECT_DEFINITION_BLOB_URL = exports.API_PROJECT_DEFINITION_DASHBOARD_URL = exports.API_PROJECT_DEFINITION_COPY_URL = exports.API_PROJECT_DEFINITION_STREAM_URL = exports.API_PROJECT_DEFINITION_ID_URL = exports.API_PROJECT_DEFINITION_URL = exports.API_PROJECT_VROBOT_DEPLOY_URL = exports.API_PROJECT_VROBOT_DETAILS_URL = exports.API_PROJECT_COLLECTION_DOCS_URL = exports.API_PROJECT_COLLECTION_ID_URL = exports.API_PROJECT_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_DASHBOARD_WIDGET_URL = exports.API_PROJECT_DASHBOARD_ID_URL = exports.API_PROJECT_DASHBOARD_URL = exports.API_PROJECT_OPERATION_ID_URL = exports.API_PROJECT_OPERATION_URL = exports.API_PROJECT_ROBOT_GAMEPAD_URL = exports.API_PROJECT_ROBOT_TRIGGER_URL = exports.API_PROJECT_ROBOT_BUTTON_URL = exports.API_PROJECT_ROBOT_COMMAND2_URL = exports.API_PROJECT_ROBOT_COMMAND_URL = exports.API_PROJECT_ROBOT_AGENT_URL = exports.API_PROJECT_ROBOT_SETTING_URL = exports.API_PROJECT_ROBOT_EVENT_HISTORY_URL = exports.API_PROJECT_ROBOT_EVENT_URL = void 0;
|
5
|
+
exports.API_LINKED_PROJECT_URL = exports.API_PROJECT_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_WORKFLOW_ASSET_URL = exports.API_PROJECT_WORKFLOW_ID_URL = exports.API_PROJECT_WORKFLOW_URL = exports.API_OBSERVATION_KEYS_URL = exports.API_OBSERVATIONS_URL = exports.API_MAPS_PANORAMA_OBSERVATIONS_URL = exports.API_MAPS_GEOJSON_URL = exports.API_MAPS_DEPLOY_URL = exports.API_MAPS_COPY_URL = exports.API_MAP_ID_URL = exports.API_MAPS_MERGE_URL = exports.API_MAPS_DEPLOYED_URL = exports.API_MAPS_URL = exports.API_DD_INTEGRATION_ISSUES_URL = exports.API_DD_INTEGRATION_OVERLAYS_URL = exports.API_DD_INTEGRATION_PLAN_BY_ID_URL = exports.API_DD_INTEGRATION_PLANS_URL = exports.API_SPOTTY_URL = exports.API_PROJECT_SCHEDULES_URL = exports.API_SOURCE_ID_URL = exports.API_SOURCE_URL = exports.API_SOURCE_SCHEMA_URL = exports.API_TEMPLATE_EXPORTER_URL = exports.API_TEMPLATE_PROVISION_ID_URL = exports.API_TEMPLATE_PROVISION_URL = exports.API_TEMPLATE_DEPLOY_URL = exports.API_PROJECT_PROFILE_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_PROFILE_DASHBOARD_ID_URL = exports.API_PROJECT_PROFILE_DASHBOARD_URL = exports.API_PROJECT_CALLSIGN_STREAM_URL = exports.API_PROJECT_ROBOT_DASHBOARD_CUSTOM_WIDGET_URL = void 0;
|
6
6
|
exports.API_APPLICATION_AUTH_URL = 'https://{url}/applications/auth';
|
7
7
|
exports.API_ADMIN_USER_INVITATION_URL = 'https://{url}/admin/users/invitations';
|
8
8
|
exports.API_USER_URL = 'https://{url}/users';
|
@@ -87,6 +87,8 @@ exports.API_PROJECT_DEFINITION_ACTION_URL = 'https://{url}/projects/{projectId}/
|
|
87
87
|
exports.API_PROJECT_DEFINITION_BUTTON_URL = 'https://{url}/projects/{projectId}/robot-definitions/{definitionId}/buttons';
|
88
88
|
exports.API_PROJECT_DEFINITION_TRIGGER_URL = 'https://{url}/projects/{projectId}/robot-definitions/{definitionId}/triggers';
|
89
89
|
exports.API_PROJECT_DEFINITION_GAMEPAD_URL = 'https://{url}/projects/{projectId}/robot-definitions/{definitionId}/gamepads';
|
90
|
+
exports.API_PROJECT_DEFINITION_EXPORT = 'https://{url}/projects/{projectId}/robot-definitions/{definitionId}/export';
|
91
|
+
exports.API_PROJECT_DEFINITION_IMPORT = 'https://{url}/projects/{projectId}/robot-definitions/import';
|
90
92
|
exports.API_PROJECT_GROUP_TYPE_URL = 'https://{url}/projects/{projectId}/config-groups/{type}';
|
91
93
|
exports.API_PROJECT_GROUP_TYPE_ID_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}';
|
92
94
|
exports.API_PROJECT_GROUP_TYPE_PUBLISH_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/publish';
|
@@ -94,10 +96,6 @@ exports.API_PROJECT_GROUP_TYPE_CONFIG_URL = 'https://{url}/projects/{projectId}/
|
|
94
96
|
exports.API_PROJECT_GROUP_TYPE_VERSION_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{version}';
|
95
97
|
exports.API_PROJECT_GROUP_TYPE_OWNER_ID_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/owner/{ownerId}';
|
96
98
|
exports.API_PROJECT_GROUP_TYPE_OWNER_OVERRIDE_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{ownerId}/override';
|
97
|
-
exports.API_PROJECT_FUNCTION_URL = 'https://{url}/projects/{projectId}/functions';
|
98
|
-
exports.API_PROJECT_FUNCTION_ID_URL = 'https://{url}/projects/{projectId}/functions/{functionId}';
|
99
|
-
exports.API_PROJECT_FUNCTION_RUN_URL = 'https://{url}/projects/{projectId}/functions/{functionId}/run';
|
100
|
-
exports.API_PROJECT_FUNCTION_POD_URL = 'https://{url}/projects/{projectId}/functions/{functionId}/pods';
|
101
99
|
exports.API_PROJECT_EXPORT_URL = 'https://{url}/projects/{projectId}/export-jobs';
|
102
100
|
exports.API_PROJECT_STREAM_URL = 'https://{url}/projects/{projectId}/streams';
|
103
101
|
exports.API_PROJECT_STREAM_ID_URL = 'https://{url}/projects/{projectId}/streams/{streamId}';
|
@@ -1,7 +1,11 @@
|
|
1
|
-
import { IRocosSDKConfig } from '../models
|
1
|
+
import { IRocosSDKConfig } from '../models';
|
2
|
+
type ConfigWithParent = IRocosSDKConfig & {
|
3
|
+
_parentConfig?: ConfigWithParent;
|
4
|
+
};
|
2
5
|
/**
|
3
6
|
* Flattens and orders the sdk config props to make a unique key
|
4
7
|
*
|
5
8
|
* @param config - SDK config {@link IRocosSDKConfig}
|
6
9
|
*/
|
7
|
-
export declare const getUniqueConfigKey: (config:
|
10
|
+
export declare const getUniqueConfigKey: (config: ConfigWithParent) => string;
|
11
|
+
export {};
|
@@ -7,10 +7,15 @@ exports.getUniqueConfigKey = void 0;
|
|
7
7
|
* @param config - SDK config {@link IRocosSDKConfig}
|
8
8
|
*/
|
9
9
|
const getUniqueConfigKey = (config) => {
|
10
|
-
|
10
|
+
let rootConfig = config;
|
11
|
+
if (rootConfig._parentConfig) {
|
12
|
+
// assume there is only one level of nesting
|
13
|
+
rootConfig = rootConfig._parentConfig;
|
14
|
+
}
|
15
|
+
return Object.keys(rootConfig)
|
11
16
|
.sort()
|
12
17
|
.map((item) => {
|
13
|
-
return item !== 'token' ? `${item}:${
|
18
|
+
return item !== 'token' ? `${item}:${rootConfig[item]}` : false;
|
14
19
|
})
|
15
20
|
.filter(Boolean)
|
16
21
|
.join();
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export declare enum TelemetryMonitorStatus {
|
2
|
+
UNKNOWN = "unknown",
|
3
|
+
CONNECTED = "connected",
|
4
|
+
DISCONNECTED = "disconnected",
|
5
|
+
ERROR = "error"
|
6
|
+
}
|
7
|
+
export declare enum CallsignStatus {
|
8
|
+
UNKNOWN = "unknown",
|
9
|
+
ONLINE = "online",
|
10
|
+
OFFLINE = "offline",
|
11
|
+
ERROR = "error"
|
12
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CallsignStatus = exports.TelemetryMonitorStatus = void 0;
|
4
|
+
var TelemetryMonitorStatus;
|
5
|
+
(function (TelemetryMonitorStatus) {
|
6
|
+
TelemetryMonitorStatus["UNKNOWN"] = "unknown";
|
7
|
+
TelemetryMonitorStatus["CONNECTED"] = "connected";
|
8
|
+
TelemetryMonitorStatus["DISCONNECTED"] = "disconnected";
|
9
|
+
TelemetryMonitorStatus["ERROR"] = "error";
|
10
|
+
})(TelemetryMonitorStatus || (exports.TelemetryMonitorStatus = TelemetryMonitorStatus = {}));
|
11
|
+
var CallsignStatus;
|
12
|
+
(function (CallsignStatus) {
|
13
|
+
CallsignStatus["UNKNOWN"] = "unknown";
|
14
|
+
CallsignStatus["ONLINE"] = "online";
|
15
|
+
CallsignStatus["OFFLINE"] = "offline";
|
16
|
+
CallsignStatus["ERROR"] = "error";
|
17
|
+
})(CallsignStatus || (exports.CallsignStatus = CallsignStatus = {}));
|
package/cjs/models/Token.d.ts
CHANGED
@@ -31,10 +31,10 @@ export declare class Token implements IToken {
|
|
31
31
|
isExpiredIn(threshold?: number, unit?: 'minutes' | 'seconds' | 'hours'): boolean;
|
32
32
|
isExpired(): boolean;
|
33
33
|
private getJWTPayload;
|
34
|
-
/** Decode a
|
34
|
+
/** Decode a base64url string.
|
35
35
|
*
|
36
36
|
* Supports both Node.js and browser environments.
|
37
37
|
* @private
|
38
38
|
*/
|
39
|
-
private
|
39
|
+
private decodeBase64URL;
|
40
40
|
}
|
package/cjs/models/Token.js
CHANGED
@@ -54,7 +54,7 @@ class Token {
|
|
54
54
|
throw new Error('Invalid token, too many parts');
|
55
55
|
}
|
56
56
|
const [header, payload] = parts.slice(0, 2).map((part) => {
|
57
|
-
return JSON.parse(this.
|
57
|
+
return JSON.parse(this.decodeBase64URL(part));
|
58
58
|
});
|
59
59
|
if (typeof payload !== 'object') {
|
60
60
|
throw new Error('Invalid token, payload must be an object');
|
@@ -67,16 +67,16 @@ class Token {
|
|
67
67
|
}
|
68
68
|
return payload;
|
69
69
|
}
|
70
|
-
/** Decode a
|
70
|
+
/** Decode a base64url string.
|
71
71
|
*
|
72
72
|
* Supports both Node.js and browser environments.
|
73
73
|
* @private
|
74
74
|
*/
|
75
|
-
|
75
|
+
decodeBase64URL(base64String) {
|
76
76
|
if (enviroment_1.isNode) {
|
77
|
-
return Buffer.from(base64String, '
|
77
|
+
return Buffer.from(base64String, 'base64url').toString('utf-8');
|
78
78
|
}
|
79
|
-
return atob(base64String);
|
79
|
+
return atob(base64String.replace(/-/g, '+').replace(/_/g, '/'));
|
80
80
|
}
|
81
81
|
}
|
82
82
|
exports.Token = Token;
|
package/cjs/models/index.d.ts
CHANGED
@@ -33,7 +33,6 @@ export * from './integrations/Plan';
|
|
33
33
|
export * from './maps/Map';
|
34
34
|
export * from './maps/Panorama';
|
35
35
|
export * from './projects/ProjectUser';
|
36
|
-
export * from './CallsignStatus';
|
37
36
|
export * from './ExportDataQuery';
|
38
37
|
export * from './HttpError';
|
39
38
|
export * from './IBaseService';
|
@@ -73,6 +72,7 @@ export * from './Stream';
|
|
73
72
|
export * from './StreamOptions';
|
74
73
|
export * from './StreamSource';
|
75
74
|
export * from './SubscriberStatusEnum';
|
75
|
+
export * from './TelemetryStatus';
|
76
76
|
export * from './Token';
|
77
77
|
export * from './types';
|
78
78
|
export * from './Widget';
|
package/cjs/models/index.js
CHANGED
@@ -49,7 +49,6 @@ __exportStar(require("./integrations/Plan"), exports);
|
|
49
49
|
__exportStar(require("./maps/Map"), exports);
|
50
50
|
__exportStar(require("./maps/Panorama"), exports);
|
51
51
|
__exportStar(require("./projects/ProjectUser"), exports);
|
52
|
-
__exportStar(require("./CallsignStatus"), exports);
|
53
52
|
__exportStar(require("./ExportDataQuery"), exports);
|
54
53
|
__exportStar(require("./HttpError"), exports);
|
55
54
|
__exportStar(require("./IBaseService"), exports);
|
@@ -89,6 +88,7 @@ __exportStar(require("./Stream"), exports);
|
|
89
88
|
__exportStar(require("./StreamOptions"), exports);
|
90
89
|
__exportStar(require("./StreamSource"), exports);
|
91
90
|
__exportStar(require("./SubscriberStatusEnum"), exports);
|
91
|
+
__exportStar(require("./TelemetryStatus"), exports);
|
92
92
|
__exportStar(require("./Token"), exports);
|
93
93
|
__exportStar(require("./types"), exports);
|
94
94
|
__exportStar(require("./Widget"), exports);
|
package/cjs/node/RocosSDKNode.js
CHANGED
@@ -51,9 +51,6 @@ class RocosSDKNode extends RocosSDK_1.RocosSDK {
|
|
51
51
|
case models_1.ServiceEnum.DASHBOARD:
|
52
52
|
this.services[name] = new services_1.DashboardService(config);
|
53
53
|
break;
|
54
|
-
case models_1.ServiceEnum.FUNCTION:
|
55
|
-
this.services[name] = new services_1.FunctionService(config);
|
56
|
-
break;
|
57
54
|
case models_1.ServiceEnum.STREAM:
|
58
55
|
this.services[name] = new services_1.StreamService(config);
|
59
56
|
break;
|
@@ -232,6 +232,29 @@ export declare class ProfileService extends BaseServiceAbstract implements IBase
|
|
232
232
|
* @description - Renamed from robotDefGetGamepads
|
233
233
|
*/
|
234
234
|
getGamepads(projectId: string, definitionId: string): Promise<any>;
|
235
|
+
/** Export robot definition into JSON format
|
236
|
+
*
|
237
|
+
* Can be used to import robot definition into another project
|
238
|
+
*
|
239
|
+
* @param projectId - Project Id
|
240
|
+
* @param definitionId - Robot definition Id
|
241
|
+
*
|
242
|
+
* @see import
|
243
|
+
*/
|
244
|
+
export(projectId: string, definitionId: string): Promise<Record<string, unknown>>;
|
245
|
+
/** Import robot definition from JSON format
|
246
|
+
*
|
247
|
+
* Accepts a previously exported robot definition
|
248
|
+
*
|
249
|
+
* @param projectId - Project Id
|
250
|
+
* @param profileData - Robot definition data
|
251
|
+
* @param newName - Optional new name for the robot definition. If not provided, the name from the imported definition will be used.
|
252
|
+
*
|
253
|
+
* @see export
|
254
|
+
*/
|
255
|
+
import(projectId: string, profileData: Record<string, unknown>, newName?: string): Promise<{
|
256
|
+
profileId: string;
|
257
|
+
}>;
|
235
258
|
/**
|
236
259
|
* Update gamepads for a robot definition
|
237
260
|
*
|
@@ -348,6 +348,34 @@ class ProfileService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
348
348
|
async getGamepads(projectId, definitionId) {
|
349
349
|
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_DEFINITION_GAMEPAD_URL, { url: this.config.url, projectId, definitionId }, this.config.insecure), `Failed to get gamepads for ${projectId}, definitionId ${definitionId}.`);
|
350
350
|
}
|
351
|
+
/** Export robot definition into JSON format
|
352
|
+
*
|
353
|
+
* Can be used to import robot definition into another project
|
354
|
+
*
|
355
|
+
* @param projectId - Project Id
|
356
|
+
* @param definitionId - Robot definition Id
|
357
|
+
*
|
358
|
+
* @see import
|
359
|
+
*/
|
360
|
+
async export(projectId, definitionId) {
|
361
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_DEFINITION_EXPORT, { url: this.config.url, projectId, definitionId }, this.config.insecure), undefined, `Failed to export robot definition for ${projectId}, definitionId ${definitionId}.`);
|
362
|
+
}
|
363
|
+
/** Import robot definition from JSON format
|
364
|
+
*
|
365
|
+
* Accepts a previously exported robot definition
|
366
|
+
*
|
367
|
+
* @param projectId - Project Id
|
368
|
+
* @param profileData - Robot definition data
|
369
|
+
* @param newName - Optional new name for the robot definition. If not provided, the name from the imported definition will be used.
|
370
|
+
*
|
371
|
+
* @see export
|
372
|
+
*/
|
373
|
+
async import(projectId, profileData, newName) {
|
374
|
+
if (newName) {
|
375
|
+
profileData.name = newName;
|
376
|
+
}
|
377
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_DEFINITION_IMPORT, { url: this.config.url, projectId }, this.config.insecure), profileData, `Failed to import robot definition for ${projectId}.`);
|
378
|
+
}
|
351
379
|
/**
|
352
380
|
* Update gamepads for a robot definition
|
353
381
|
*
|
@@ -54,7 +54,7 @@ export declare class RTPWebRTCService extends BaseServiceAbstract implements IBa
|
|
54
54
|
*
|
55
55
|
* If `logLevel` is set to trace, the connection will emit all messages as events
|
56
56
|
*/
|
57
|
-
createPeerConnection(params: PeerConnectionParams): WebRTCConnection
|
57
|
+
createPeerConnection(params: PeerConnectionParams): Promise<WebRTCConnection>;
|
58
58
|
}
|
59
59
|
export declare class WebRTCConnection {
|
60
60
|
private pc?;
|
@@ -4,6 +4,7 @@ exports.WebRTCConnection = exports.RTPWebRTCService = exports.WebRTCEventType =
|
|
4
4
|
const models_1 = require("../models");
|
5
5
|
const rxjs_1 = require("rxjs");
|
6
6
|
const BaseServiceAbstract_1 = require("./BaseServiceAbstract");
|
7
|
+
const RocosStore_1 = require("../store/RocosStore");
|
7
8
|
const splitRobotTopic_1 = require("../helpers/splitRobotTopic");
|
8
9
|
var WebRTCEventType;
|
9
10
|
(function (WebRTCEventType) {
|
@@ -36,16 +37,17 @@ class RTPWebRTCService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
36
37
|
*
|
37
38
|
* If `logLevel` is set to trace, the connection will emit all messages as events
|
38
39
|
*/
|
39
|
-
createPeerConnection(params) {
|
40
|
+
async createPeerConnection(params) {
|
40
41
|
const isInsecure = this.config.insecure ?? false;
|
41
42
|
const port = this.config.port ?? (isInsecure ? 80 : 443);
|
43
|
+
const token = (await RocosStore_1.RocosStore.getSDKInstance(this.config).getAuthService().getToken()).value;
|
42
44
|
return new WebRTCConnection({
|
43
45
|
endpoint: {
|
44
46
|
host: this.config.url,
|
45
47
|
port,
|
46
48
|
insecure: isInsecure,
|
47
49
|
},
|
48
|
-
token
|
50
|
+
token,
|
49
51
|
projectId: params.projectId,
|
50
52
|
callsign: params.callsign,
|
51
53
|
logLevel: params.logLevel,
|