@dronedeploy/rocos-js-sdk 3.0.1-alpha.14 → 3.0.1-alpha.16
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/IRocosSDK.d.ts +2 -2
- package/cjs/RocosSDK.d.ts +7 -6
- package/cjs/RocosSDK.js +11 -10
- package/cjs/constants/api.d.ts +4 -6
- package/cjs/constants/api.js +6 -8
- package/cjs/models/RocosError.d.ts +1 -0
- package/cjs/models/RocosError.js +1 -0
- package/cjs/models/ServiceEnum.d.ts +2 -1
- package/cjs/models/ServiceEnum.js +1 -0
- 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/device-credentials/DeviceCredentials.d.ts +46 -0
- package/cjs/models/device-credentials/DeviceCredentials.js +2 -0
- package/cjs/models/index.d.ts +1 -1
- package/cjs/models/index.js +1 -1
- package/cjs/node/RocosSDKNode.d.ts +2 -1
- package/cjs/node/RocosSDKNode.js +6 -3
- package/cjs/services/DeviceCredentialsService.d.ts +15 -0
- package/cjs/services/DeviceCredentialsService.js +50 -0
- package/cjs/services/MapService.d.ts +1 -1
- package/cjs/services/MapService.js +1 -1
- package/cjs/services/ProfileService.d.ts +2 -1
- package/cjs/services/ProfileService.js +9 -3
- package/cjs/services/TelemetryService.d.ts +10 -1
- package/cjs/services/TelemetryService.js +27 -5
- package/cjs/services/index.d.ts +1 -1
- package/cjs/services/index.js +1 -1
- package/esm/IRocosSDK.d.ts +2 -2
- package/esm/RocosSDK.d.ts +7 -6
- package/esm/RocosSDK.js +12 -11
- package/esm/constants/api.d.ts +4 -6
- package/esm/constants/api.js +4 -6
- package/esm/models/RocosError.d.ts +1 -0
- package/esm/models/RocosError.js +1 -0
- package/esm/models/ServiceEnum.d.ts +2 -1
- package/esm/models/ServiceEnum.js +1 -0
- 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/device-credentials/DeviceCredentials.d.ts +46 -0
- package/esm/models/device-credentials/DeviceCredentials.js +1 -0
- package/esm/models/index.d.ts +1 -1
- package/esm/models/index.js +1 -1
- package/esm/node/RocosSDKNode.d.ts +2 -1
- package/esm/node/RocosSDKNode.js +7 -4
- package/esm/services/DeviceCredentialsService.d.ts +15 -0
- package/esm/services/DeviceCredentialsService.js +46 -0
- package/esm/services/MapService.d.ts +1 -1
- package/esm/services/MapService.js +1 -1
- package/esm/services/ProfileService.d.ts +2 -1
- package/esm/services/ProfileService.js +9 -3
- package/esm/services/TelemetryService.d.ts +10 -1
- package/esm/services/TelemetryService.js +28 -6
- package/esm/services/index.d.ts +1 -1
- package/esm/services/index.js +1 -1
- package/package.json +1 -2
- package/cjs/models/CallsignStatus.d.ts +0 -6
- package/cjs/models/CallsignStatus.js +0 -10
- package/cjs/services/FunctionService.d.ts +0 -68
- package/cjs/services/FunctionService.js +0 -103
- package/esm/models/CallsignStatus.d.ts +0 -6
- package/esm/models/CallsignStatus.js +0 -7
- package/esm/services/FunctionService.d.ts +0 -68
- package/esm/services/FunctionService.js +0 -99
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, DeviceCredentialsService, 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;
|
@@ -28,6 +27,7 @@ export declare abstract class IRocosSDK {
|
|
28
27
|
abstract getSpotProvisionerService(): SpotProvisioningService | SpotProvisioningServiceNode;
|
29
28
|
abstract getIntegrationService(): IntegrationService;
|
30
29
|
abstract getEvaluatorService(): EvaluatorService;
|
30
|
+
abstract getDeviceCredentialsService(): DeviceCredentialsService;
|
31
31
|
abstract cleanup(): Promise<boolean>;
|
32
32
|
abstract enableDebugMode(on: boolean): void;
|
33
33
|
abstract setDebugLevel(level: IDebugLevel): void;
|
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, DeviceCredentialsService, 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';
|
@@ -19,7 +19,7 @@ export declare class RocosSDK implements IRocosSDK {
|
|
19
19
|
*/
|
20
20
|
getService<T extends IBaseService>(name: ServiceEnum): T;
|
21
21
|
/**
|
22
|
-
*
|
22
|
+
* Gets the authentication service.
|
23
23
|
*/
|
24
24
|
getAuthService(): AuthService;
|
25
25
|
/**
|
@@ -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
|
*/
|
@@ -130,6 +126,11 @@ export declare class RocosSDK implements IRocosSDK {
|
|
130
126
|
* @returns EvaluatorService
|
131
127
|
*/
|
132
128
|
getEvaluatorService(): EvaluatorService;
|
129
|
+
/**
|
130
|
+
* Gets the device credentials service.
|
131
|
+
* @returns DeviceCredentialsService
|
132
|
+
*/
|
133
|
+
getDeviceCredentialsService(): DeviceCredentialsService;
|
133
134
|
get platformTimeOffset(): number;
|
134
135
|
get platformTime(): number;
|
135
136
|
/**
|
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;
|
@@ -107,13 +104,16 @@ class RocosSDK {
|
|
107
104
|
case models_1.ServiceEnum.EVALUATOR:
|
108
105
|
this.services[name] = new services_1.EvaluatorService(config);
|
109
106
|
break;
|
107
|
+
case models_1.ServiceEnum.DEVICE_CREDENTIALS:
|
108
|
+
this.services[name] = new services_1.DeviceCredentialsService(config);
|
109
|
+
break;
|
110
110
|
}
|
111
111
|
}
|
112
112
|
this.logger.debug(`Found service ${name}.`);
|
113
113
|
return this.services[name];
|
114
114
|
}
|
115
115
|
/**
|
116
|
-
*
|
116
|
+
* Gets the authentication service.
|
117
117
|
*/
|
118
118
|
getAuthService() {
|
119
119
|
return this.getService(models_1.ServiceEnum.AUTH);
|
@@ -178,12 +178,6 @@ class RocosSDK {
|
|
178
178
|
getDashboardService() {
|
179
179
|
return this.getService(models_1.ServiceEnum.DASHBOARD);
|
180
180
|
}
|
181
|
-
/**
|
182
|
-
* Gets the function service
|
183
|
-
*/
|
184
|
-
getFunctionService() {
|
185
|
-
return this.getService(models_1.ServiceEnum.FUNCTION);
|
186
|
-
}
|
187
181
|
/**
|
188
182
|
* Gets the stream service
|
189
183
|
*/
|
@@ -276,6 +270,13 @@ class RocosSDK {
|
|
276
270
|
getEvaluatorService() {
|
277
271
|
return this.getService(models_1.ServiceEnum.EVALUATOR);
|
278
272
|
}
|
273
|
+
/**
|
274
|
+
* Gets the device credentials service.
|
275
|
+
* @returns DeviceCredentialsService
|
276
|
+
*/
|
277
|
+
getDeviceCredentialsService() {
|
278
|
+
return this.getService(models_1.ServiceEnum.DEVICE_CREDENTIALS);
|
279
|
+
}
|
279
280
|
get platformTimeOffset() {
|
280
281
|
return services_1.PlatFormTimeService.getInstance(this.getTimeSyncerService())?.platformTimeOffset;
|
281
282
|
}
|
package/cjs/constants/api.d.ts
CHANGED
@@ -82,8 +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
|
+
export declare const API_PROJECT_DEFINITION_EXPORT = "https://{url}/import-export/projects/{projectId}/robot-definitions/{definitionId}/export";
|
86
|
+
export declare const API_PROJECT_DEFINITION_IMPORT = "https://{url}/import-export/projects/{projectId}/robot-definitions/import";
|
87
87
|
export declare const API_PROJECT_GROUP_TYPE_URL = "https://{url}/projects/{projectId}/config-groups/{type}";
|
88
88
|
export declare const API_PROJECT_GROUP_TYPE_ID_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}";
|
89
89
|
export declare const API_PROJECT_GROUP_TYPE_PUBLISH_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/publish";
|
@@ -91,10 +91,6 @@ export declare const API_PROJECT_GROUP_TYPE_CONFIG_URL = "https://{url}/projects
|
|
91
91
|
export declare const API_PROJECT_GROUP_TYPE_VERSION_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{version}";
|
92
92
|
export declare const API_PROJECT_GROUP_TYPE_OWNER_ID_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/owner/{ownerId}";
|
93
93
|
export declare const API_PROJECT_GROUP_TYPE_OWNER_OVERRIDE_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{ownerId}/override";
|
94
|
-
export declare const API_PROJECT_FUNCTION_URL = "https://{url}/projects/{projectId}/functions";
|
95
|
-
export declare const API_PROJECT_FUNCTION_ID_URL = "https://{url}/projects/{projectId}/functions/{functionId}";
|
96
|
-
export declare const API_PROJECT_FUNCTION_RUN_URL = "https://{url}/projects/{projectId}/functions/{functionId}/run";
|
97
|
-
export declare const API_PROJECT_FUNCTION_POD_URL = "https://{url}/projects/{projectId}/functions/{functionId}/pods";
|
98
94
|
export declare const API_PROJECT_EXPORT_URL = "https://{url}/projects/{projectId}/export-jobs";
|
99
95
|
export declare const API_PROJECT_STREAM_URL = "https://{url}/projects/{projectId}/streams";
|
100
96
|
export declare const API_PROJECT_STREAM_ID_URL = "https://{url}/projects/{projectId}/streams/{streamId}";
|
@@ -135,3 +131,5 @@ export declare const API_PROJECT_WORKFLOW_ID_URL = "https://{url}/projects/{proj
|
|
135
131
|
export declare const API_PROJECT_WORKFLOW_ASSET_URL = "https://{url}/projects/{projectId}/automate/flows/{workflowId}/assets";
|
136
132
|
export declare const API_PROJECT_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments";
|
137
133
|
export declare const API_LINKED_PROJECT_URL = "https://{url}/linked-projects/{linkedProjectId}";
|
134
|
+
export declare const API_DEVICE_CREDENTIALS_URL = "https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials";
|
135
|
+
export declare const API_DEVICE_CREDENTIALS_AUTH_URL = "https://{url}/device-credentials/auth";
|
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_DEVICE_CREDENTIALS_AUTH_URL = exports.API_DEVICE_CREDENTIALS_URL = 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,8 +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
|
+
exports.API_PROJECT_DEFINITION_EXPORT = 'https://{url}/import-export/projects/{projectId}/robot-definitions/{definitionId}/export';
|
91
|
+
exports.API_PROJECT_DEFINITION_IMPORT = 'https://{url}/import-export/projects/{projectId}/robot-definitions/import';
|
92
92
|
exports.API_PROJECT_GROUP_TYPE_URL = 'https://{url}/projects/{projectId}/config-groups/{type}';
|
93
93
|
exports.API_PROJECT_GROUP_TYPE_ID_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}';
|
94
94
|
exports.API_PROJECT_GROUP_TYPE_PUBLISH_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/publish';
|
@@ -96,10 +96,6 @@ exports.API_PROJECT_GROUP_TYPE_CONFIG_URL = 'https://{url}/projects/{projectId}/
|
|
96
96
|
exports.API_PROJECT_GROUP_TYPE_VERSION_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{version}';
|
97
97
|
exports.API_PROJECT_GROUP_TYPE_OWNER_ID_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/owner/{ownerId}';
|
98
98
|
exports.API_PROJECT_GROUP_TYPE_OWNER_OVERRIDE_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{ownerId}/override';
|
99
|
-
exports.API_PROJECT_FUNCTION_URL = 'https://{url}/projects/{projectId}/functions';
|
100
|
-
exports.API_PROJECT_FUNCTION_ID_URL = 'https://{url}/projects/{projectId}/functions/{functionId}';
|
101
|
-
exports.API_PROJECT_FUNCTION_RUN_URL = 'https://{url}/projects/{projectId}/functions/{functionId}/run';
|
102
|
-
exports.API_PROJECT_FUNCTION_POD_URL = 'https://{url}/projects/{projectId}/functions/{functionId}/pods';
|
103
99
|
exports.API_PROJECT_EXPORT_URL = 'https://{url}/projects/{projectId}/export-jobs';
|
104
100
|
exports.API_PROJECT_STREAM_URL = 'https://{url}/projects/{projectId}/streams';
|
105
101
|
exports.API_PROJECT_STREAM_ID_URL = 'https://{url}/projects/{projectId}/streams/{streamId}';
|
@@ -140,3 +136,5 @@ exports.API_PROJECT_WORKFLOW_ID_URL = 'https://{url}/projects/{projectId}/automa
|
|
140
136
|
exports.API_PROJECT_WORKFLOW_ASSET_URL = 'https://{url}/projects/{projectId}/automate/flows/{workflowId}/assets';
|
141
137
|
exports.API_PROJECT_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments';
|
142
138
|
exports.API_LINKED_PROJECT_URL = 'https://{url}/linked-projects/{linkedProjectId}';
|
139
|
+
exports.API_DEVICE_CREDENTIALS_URL = 'https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials';
|
140
|
+
exports.API_DEVICE_CREDENTIALS_AUTH_URL = 'https://{url}/device-credentials/auth';
|
package/cjs/models/RocosError.js
CHANGED
@@ -27,6 +27,7 @@ exports.errorCodes = {
|
|
27
27
|
MAPS_SERVICE_ERROR: 'MAPS_SERVICE_ERROR',
|
28
28
|
EVALUATOR_SERVICE_ERROR: 'EVALUATOR_SERVICE_ERROR',
|
29
29
|
WEBRTC_SERVICE_ERROR: 'WEBRTC_SERVICE_ERROR',
|
30
|
+
DEVICE_CREDENTIALS_SERVICE_ERROR: 'DEVICE_CREDENTIALS_SERVICE_ERROR',
|
30
31
|
};
|
31
32
|
class RocosError extends Error {
|
32
33
|
constructor(err, code, statusCode) {
|
@@ -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;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
export interface DeviceCredentials {
|
2
|
+
[component: string]: {
|
3
|
+
[system: string]: DeviceCredential;
|
4
|
+
};
|
5
|
+
}
|
6
|
+
export interface DeviceCredential {
|
7
|
+
/**
|
8
|
+
* Device ID or username
|
9
|
+
*/
|
10
|
+
id: string;
|
11
|
+
/**
|
12
|
+
* Device secret or password
|
13
|
+
*/
|
14
|
+
key: string;
|
15
|
+
}
|
16
|
+
export interface DeviceCredentialCreate {
|
17
|
+
/**
|
18
|
+
* Will automatically be generated if not provided
|
19
|
+
*/
|
20
|
+
id?: string;
|
21
|
+
/**
|
22
|
+
* Will automatically be generated if not provided
|
23
|
+
*/
|
24
|
+
key?: string;
|
25
|
+
/**
|
26
|
+
* The agent component the credentials are for e.g. dji, spot, etc.
|
27
|
+
*/
|
28
|
+
component: string;
|
29
|
+
/**
|
30
|
+
* The system the credentials are for e.g. mqtt, rtmp, etc.
|
31
|
+
*/
|
32
|
+
system: string;
|
33
|
+
}
|
34
|
+
export interface DeviceCredentialAuth extends DeviceCredential {
|
35
|
+
/**
|
36
|
+
* The agent component the credentials are for e.g. dji, spot, etc.
|
37
|
+
*/
|
38
|
+
component: string;
|
39
|
+
/**
|
40
|
+
* The system the credentials are for e.g. mqtt, rtmp, etc.
|
41
|
+
*/
|
42
|
+
system: string;
|
43
|
+
}
|
44
|
+
export interface DeviceCredentialAuthResult {
|
45
|
+
result: 'allow' | 'deny';
|
46
|
+
}
|
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);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { EvaluatorService, ScheduleService } from '../services';
|
1
|
+
import { DeviceCredentialsService, EvaluatorService, ScheduleService } from '../services';
|
2
2
|
import { IBaseService, ServiceEnum } from '../models';
|
3
3
|
import { CallerServiceNode } from '../services/CallerServiceNode';
|
4
4
|
import { CommandServiceNode } from '../services/CommandServiceNode';
|
@@ -48,4 +48,5 @@ export declare class RocosSDKNode extends RocosSDK {
|
|
48
48
|
* @deprecated Not supported in Node.js
|
49
49
|
*/
|
50
50
|
getRTPWebRTCService(): never;
|
51
|
+
getDeviceCredentialsService(): DeviceCredentialsService;
|
51
52
|
}
|
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;
|
@@ -84,6 +81,9 @@ class RocosSDKNode extends RocosSDK_1.RocosSDK {
|
|
84
81
|
case models_1.ServiceEnum.MAP:
|
85
82
|
this.services[name] = new services_1.MapService(config);
|
86
83
|
break;
|
84
|
+
case models_1.ServiceEnum.DEVICE_CREDENTIALS:
|
85
|
+
this.services[name] = new services_1.DeviceCredentialsService(config);
|
86
|
+
break;
|
87
87
|
}
|
88
88
|
}
|
89
89
|
this.logger.debug(`Found service ${name}.`);
|
@@ -146,5 +146,8 @@ class RocosSDKNode extends RocosSDK_1.RocosSDK {
|
|
146
146
|
getRTPWebRTCService() {
|
147
147
|
throw new Error('WebRTC service is not supported in NodeJS');
|
148
148
|
}
|
149
|
+
getDeviceCredentialsService() {
|
150
|
+
return this.getService(models_1.ServiceEnum.DEVICE_CREDENTIALS);
|
151
|
+
}
|
149
152
|
}
|
150
153
|
exports.RocosSDKNode = RocosSDKNode;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { DeviceCredentialAuth, DeviceCredentialAuthResult, DeviceCredentialCreate, DeviceCredentials } from '../models/device-credentials/DeviceCredentials';
|
2
|
+
import { IBaseService, IRocosSDKConfig, RocosError } from '../models';
|
3
|
+
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
4
|
+
/**
|
5
|
+
* Manage external devices authenticating with the platform
|
6
|
+
*/
|
7
|
+
export declare class DeviceCredentialsService extends BaseServiceAbstract implements IBaseService {
|
8
|
+
constructor(config: IRocosSDKConfig);
|
9
|
+
getStatus(): boolean;
|
10
|
+
protected getError(e: Error): RocosError;
|
11
|
+
list(projectId: string, callsign: string): Promise<DeviceCredentials>;
|
12
|
+
create(projectId: string, callsign: string, credentials: DeviceCredentialCreate): Promise<DeviceCredentialCreate>;
|
13
|
+
delete(projectId: string, callsign: string, component: string, system: string): Promise<void>;
|
14
|
+
auth(credentials: DeviceCredentialAuth): Promise<DeviceCredentialAuthResult>;
|
15
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.DeviceCredentialsService = void 0;
|
4
|
+
const api_1 = require("../constants/api");
|
5
|
+
const models_1 = require("../models");
|
6
|
+
const BaseServiceAbstract_1 = require("./BaseServiceAbstract");
|
7
|
+
const RocosLogger_1 = require("../logger/RocosLogger");
|
8
|
+
const formatServiceUrl_1 = require("../helpers/formatServiceUrl");
|
9
|
+
/**
|
10
|
+
* Manage external devices authenticating with the platform
|
11
|
+
*/
|
12
|
+
class DeviceCredentialsService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
13
|
+
constructor(config) {
|
14
|
+
super(config);
|
15
|
+
this.logger = RocosLogger_1.RocosLogger.getInstance(`DeviceCredentials(${this.config.url})`);
|
16
|
+
}
|
17
|
+
getStatus() {
|
18
|
+
return true;
|
19
|
+
}
|
20
|
+
getError(e) {
|
21
|
+
return new models_1.RocosError(e, models_1.errorCodes.DEVICE_CREDENTIALS_SERVICE_ERROR);
|
22
|
+
}
|
23
|
+
list(projectId, callsign) {
|
24
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_DEVICE_CREDENTIALS_URL, {
|
25
|
+
url: this.config.url,
|
26
|
+
projectId,
|
27
|
+
callsign,
|
28
|
+
}, this.config.insecure), 'Failed to get device credentials.');
|
29
|
+
}
|
30
|
+
create(projectId, callsign, credentials) {
|
31
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_DEVICE_CREDENTIALS_URL, {
|
32
|
+
url: this.config.url,
|
33
|
+
projectId,
|
34
|
+
callsign,
|
35
|
+
}, this.config.insecure), credentials, 'Failed to create device credentials.');
|
36
|
+
}
|
37
|
+
delete(projectId, callsign, component, system) {
|
38
|
+
return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_DEVICE_CREDENTIALS_URL, {
|
39
|
+
url: this.config.url,
|
40
|
+
projectId,
|
41
|
+
callsign,
|
42
|
+
}, this.config.insecure), 'Failed to delete device credentials.', { component, system });
|
43
|
+
}
|
44
|
+
auth(credentials) {
|
45
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_DEVICE_CREDENTIALS_AUTH_URL, {
|
46
|
+
url: this.config.url,
|
47
|
+
}, this.config.insecure), credentials, 'Failed to delete device credentials.');
|
48
|
+
}
|
49
|
+
}
|
50
|
+
exports.DeviceCredentialsService = DeviceCredentialsService;
|
@@ -2,7 +2,7 @@ import { IBaseService, IRocosSDKConfig, Map, RocosError } from '../models';
|
|
2
2
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
3
3
|
import { Observation } from '../models/maps/Panorama';
|
4
4
|
/**
|
5
|
-
*
|
5
|
+
* Maps service for managing robot maps in the cloud and on robots
|
6
6
|
*/
|
7
7
|
export declare class MapService extends BaseServiceAbstract implements IBaseService {
|
8
8
|
constructor(config: IRocosSDKConfig);
|
@@ -7,7 +7,7 @@ const BaseServiceAbstract_1 = require("./BaseServiceAbstract");
|
|
7
7
|
const RocosLogger_1 = require("../logger/RocosLogger");
|
8
8
|
const formatServiceUrl_1 = require("../helpers/formatServiceUrl");
|
9
9
|
/**
|
10
|
-
*
|
10
|
+
* Maps service for managing robot maps in the cloud and on robots
|
11
11
|
*/
|
12
12
|
class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
13
13
|
constructor(config) {
|
@@ -249,10 +249,11 @@ export declare class ProfileService extends BaseServiceAbstract implements IBase
|
|
249
249
|
* @param projectId - Project Id
|
250
250
|
* @param profileData - Robot definition data
|
251
251
|
* @param newName - Optional new name for the robot definition. If not provided, the name from the imported definition will be used.
|
252
|
+
* @param newDescription - Optional new description for the robot definition. If not provided, the description from the imported definition will be used.
|
252
253
|
*
|
253
254
|
* @see export
|
254
255
|
*/
|
255
|
-
import(projectId: string, profileData:
|
256
|
+
import(projectId: string, profileData: Blob | File, newName?: string, newDescription?: string): Promise<{
|
256
257
|
profileId: string;
|
257
258
|
}>;
|
258
259
|
/**
|
@@ -367,14 +367,20 @@ class ProfileService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
367
367
|
* @param projectId - Project Id
|
368
368
|
* @param profileData - Robot definition data
|
369
369
|
* @param newName - Optional new name for the robot definition. If not provided, the name from the imported definition will be used.
|
370
|
+
* @param newDescription - Optional new description for the robot definition. If not provided, the description from the imported definition will be used.
|
370
371
|
*
|
371
372
|
* @see export
|
372
373
|
*/
|
373
|
-
async import(projectId, profileData, newName) {
|
374
|
+
async import(projectId, profileData, newName, newDescription) {
|
375
|
+
const formData = new FormData();
|
374
376
|
if (newName) {
|
375
|
-
|
377
|
+
formData.append('name', newName);
|
376
378
|
}
|
377
|
-
|
379
|
+
if (newDescription) {
|
380
|
+
formData.append('description', newDescription);
|
381
|
+
}
|
382
|
+
formData.append('file', profileData);
|
383
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_DEFINITION_IMPORT, { url: this.config.url, projectId }, this.config.insecure), formData, `Failed to import robot definition for ${projectId}.`);
|
378
384
|
}
|
379
385
|
/**
|
380
386
|
* Update gamepads for a robot definition
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Observable } from 'rxjs';
|
2
|
-
import { CallsignStatus, IRocosSDKConfig, IRocosTelemetryMessage, IStreamStatusMessage, ITelemetryStream, ITelemetryStreamConfig, ITelemetrySubscriptionParams, ITelemetrySubscriptions } from '../models';
|
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
5
|
private statusSubscription;
|
@@ -34,6 +34,15 @@ export declare class TelemetryService extends BaseStreamService<ITelemetryStream
|
|
34
34
|
* @param intervalMs optionally override the interval to check for heartbeats (in ms). Default 2000ms
|
35
35
|
*/
|
36
36
|
getRobotStatusChanges(projectId: string, callsign: string, heartbeatTimeoutMs?: number, intervalMs?: number): Observable<CallsignStatus>;
|
37
|
+
/**
|
38
|
+
* Subscribes to the given telemetry and checks we receive one at least emission every `heartbeatTimeoutMs` (default 5s)
|
39
|
+
* @param projectId
|
40
|
+
* @param callsign
|
41
|
+
* @param source the telemetry source to monitor
|
42
|
+
* @param heartbeatTimeoutMs optionally override the deadline for telemetry emissions (in ms). Default 5000ms
|
43
|
+
* @param intervalMs optionally override the interval to check for telemetry emissions (in ms). Default 2000ms
|
44
|
+
*/
|
45
|
+
monitorTelemetryWithTimeout(projectId: string, callsign: string, source: string, heartbeatTimeoutMs?: number, intervalMs?: number): Observable<TelemetryMonitorStatus>;
|
37
46
|
protected initStream(stream: ITelemetryStream): Promise<void>;
|
38
47
|
private buildScope;
|
39
48
|
private createStream;
|