@dronedeploy/rocos-js-sdk 3.0.1-alpha.41 → 3.0.1-alpha.42
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/IRocosSDK.d.ts +2 -1
- package/cjs/RocosSDK.d.ts +5 -1
- package/cjs/RocosSDK.js +9 -0
- package/cjs/constants/api.d.ts +1 -0
- package/cjs/constants/api.js +4 -2
- package/cjs/models/RocosError.d.ts +1 -0
- package/cjs/models/RocosError.js +1 -0
- package/cjs/models/ServiceEnum.d.ts +1 -0
- package/cjs/models/ServiceEnum.js +1 -0
- package/cjs/node/RocosSDKNode.js +3 -0
- package/cjs/services/EnvironmentService.d.ts +22 -0
- package/cjs/services/EnvironmentService.js +40 -0
- package/cjs/services/index.d.ts +1 -0
- package/cjs/services/index.js +1 -0
- package/esm/IRocosSDK.d.ts +2 -1
- package/esm/RocosSDK.d.ts +5 -1
- package/esm/RocosSDK.js +10 -1
- package/esm/constants/api.d.ts +1 -0
- package/esm/constants/api.js +1 -0
- package/esm/models/RocosError.d.ts +1 -0
- package/esm/models/RocosError.js +1 -0
- package/esm/models/ServiceEnum.d.ts +1 -0
- package/esm/models/ServiceEnum.js +1 -0
- package/esm/node/RocosSDKNode.js +4 -1
- package/esm/services/EnvironmentService.d.ts +22 -0
- package/esm/services/EnvironmentService.js +36 -0
- package/esm/services/index.d.ts +1 -0
- package/esm/services/index.js +1 -0
- package/package.json +1 -1
package/cjs/IRocosSDK.d.ts
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, SearchService, SpotProvisioningService, SpotProvisioningServiceNode, StreamService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
1
|
+
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EnvironmentService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, SearchService, SpotProvisioningService, SpotProvisioningServiceNode, StreamService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
2
2
|
import { IBaseService, IDebugLevel, ServiceEnum } from './models';
|
3
3
|
export declare abstract class IRocosSDK {
|
4
4
|
abstract getService<T extends IBaseService>(name: ServiceEnum): T;
|
5
5
|
abstract getAuthService(): AuthService;
|
6
6
|
abstract getRobotService(): RobotService;
|
7
7
|
abstract getEventService(): EventService;
|
8
|
+
abstract getEnvironmentService(): EnvironmentService;
|
8
9
|
abstract getProjectService(): ProjectService;
|
9
10
|
abstract getTelemetryService(): TelemetryService;
|
10
11
|
abstract getCallerService(): CallerService;
|
package/cjs/RocosSDK.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, ScheduleService, SearchService, SpotProvisioningService, StreamService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
1
|
+
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EnvironmentService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, ScheduleService, SearchService, SpotProvisioningService, StreamService, TargetService, 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';
|
@@ -26,6 +26,10 @@ export declare class RocosSDK implements IRocosSDK {
|
|
26
26
|
* Gets the robot service.
|
27
27
|
*/
|
28
28
|
getRobotService(): RobotService;
|
29
|
+
/**
|
30
|
+
* Gets the event service.
|
31
|
+
*/
|
32
|
+
getEnvironmentService(): EnvironmentService;
|
29
33
|
/**
|
30
34
|
* Gets the event service.
|
31
35
|
*/
|
package/cjs/RocosSDK.js
CHANGED
@@ -38,6 +38,9 @@ class RocosSDK {
|
|
38
38
|
case models_1.ServiceEnum.ROBOT:
|
39
39
|
this.services[name] = new services_1.RobotService(config);
|
40
40
|
break;
|
41
|
+
case models_1.ServiceEnum.ENVIRONMENT:
|
42
|
+
this.services[name] = new services_1.EnvironmentService(config);
|
43
|
+
break;
|
41
44
|
case models_1.ServiceEnum.EVENT:
|
42
45
|
this.services[name] = new services_1.EventService(config);
|
43
46
|
break;
|
@@ -127,6 +130,12 @@ class RocosSDK {
|
|
127
130
|
getRobotService() {
|
128
131
|
return this.getService(models_1.ServiceEnum.ROBOT);
|
129
132
|
}
|
133
|
+
/**
|
134
|
+
* Gets the event service.
|
135
|
+
*/
|
136
|
+
getEnvironmentService() {
|
137
|
+
return this.getService(models_1.ServiceEnum.ENVIRONMENT);
|
138
|
+
}
|
130
139
|
/**
|
131
140
|
* Gets the event service.
|
132
141
|
*/
|
package/cjs/constants/api.d.ts
CHANGED
@@ -88,6 +88,7 @@ export declare const API_PROJECT_DEFINITION_TRIGGER_URL = "https://{url}/project
|
|
88
88
|
export declare const API_PROJECT_DEFINITION_GAMEPAD_URL = "https://{url}/projects/{projectId}/robot-definitions/{definitionId}/gamepads";
|
89
89
|
export declare const API_PROJECT_DEFINITION_EXPORT = "https://{url}/import-export/projects/{projectId}/robot-definitions/{definitionId}/export";
|
90
90
|
export declare const API_PROJECT_DEFINITION_IMPORT = "https://{url}/import-export/projects/{projectId}/robot-definitions/import";
|
91
|
+
export declare const API_PROJECT_ENVIRONMENT_URL = "https://{url}/graphs/projects/{projectId}/environments";
|
91
92
|
export declare const API_PROJECT_GROUP_TYPE_URL = "https://{url}/projects/{projectId}/config-groups/{type}";
|
92
93
|
export declare const API_PROJECT_GROUP_TYPE_ID_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}";
|
93
94
|
export declare const API_PROJECT_GROUP_TYPE_PUBLISH_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/publish";
|
package/cjs/constants/api.js
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.API_PROJECT_ROBOT_ATTRIBUTES_URL = exports.API_PROJECT_ROBOT_ID_URL = exports.API_PROJECT_ROBOT_URL = exports.API_PROJECT_MAPPED_ASSET_PATH_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_EXTERNAL_PROJECTS_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.
|
4
|
+
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_ENVIRONMENT_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_CONFIGS_CONNECTION_URL = exports.API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_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 = exports.API_PROJECT_ROBOT_REGISTER_URL = exports.API_PROJECT_ROBOT_DEFINITION_URL = void 0;
|
5
|
+
exports.API_DEVICE_CREDENTIALS_URL = exports.API_LINKED_PROJECT_URL = exports.API_PROJECT_WORKFLOW_AFFECTED_URL = exports.API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = exports.API_PROJECT_PROFILE_DEPLOYMENTS_URL = exports.API_PROJECT_ROBOT_DEPLOYMENTS_URL = exports.API_PROJECT_WORKFLOW_ASSET_URL = exports.API_PROJECT_WORKFLOW_ID_URL = exports.API_PROJECT_WORKFLOW_URL = exports.API_GRAPHS_ASSETS_URL = exports.API_GRAPHS_ASSETS_UPLOAD_URL = exports.API_GRAPHS_TARGETS_URL = exports.API_GRAPHS_TARGET_UPLOAD_URL = exports.API_GRAPHS_OBSERVATION_KEYS_URL = exports.API_GRAPHS_OBSERVATIONS_URL = exports.API_GRAPHS_PANORAMA_OBSERVATIONS_URL = exports.API_GRAPHS_PANORAMA = exports.API_GRAPHS_MAPS_GEOJSON_URL = exports.API_GRAPHS_MAPS_DEPLOY_URL = exports.API_GRAPHS_MAPS_COPY_URL = exports.API_GRAPHS_MAP_ID_URL = exports.API_GRAPHS_MAPS_MERGE_URL = exports.API_GRAPHS_MAPS_DEPLOYED_URL = exports.API_GRAPHS_MAPS_URL = exports.API_DD_INTEGRATION_LOCATIONS_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 = 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 = void 0;
|
6
|
+
exports.API_DEVICE_CREDENTIALS_AUTH_URL = void 0;
|
6
7
|
exports.API_APPLICATION_AUTH_URL = 'https://{url}/applications/auth';
|
7
8
|
exports.API_ADMIN_USER_INVITATION_URL = 'https://{url}/admin/users/invitations';
|
8
9
|
exports.API_USER_URL = 'https://{url}/users';
|
@@ -93,6 +94,7 @@ exports.API_PROJECT_DEFINITION_TRIGGER_URL = 'https://{url}/projects/{projectId}
|
|
93
94
|
exports.API_PROJECT_DEFINITION_GAMEPAD_URL = 'https://{url}/projects/{projectId}/robot-definitions/{definitionId}/gamepads';
|
94
95
|
exports.API_PROJECT_DEFINITION_EXPORT = 'https://{url}/import-export/projects/{projectId}/robot-definitions/{definitionId}/export';
|
95
96
|
exports.API_PROJECT_DEFINITION_IMPORT = 'https://{url}/import-export/projects/{projectId}/robot-definitions/import';
|
97
|
+
exports.API_PROJECT_ENVIRONMENT_URL = 'https://{url}/graphs/projects/{projectId}/environments';
|
96
98
|
exports.API_PROJECT_GROUP_TYPE_URL = 'https://{url}/projects/{projectId}/config-groups/{type}';
|
97
99
|
exports.API_PROJECT_GROUP_TYPE_ID_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}';
|
98
100
|
exports.API_PROJECT_GROUP_TYPE_PUBLISH_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/publish';
|
package/cjs/models/RocosError.js
CHANGED
@@ -29,6 +29,7 @@ exports.errorCodes = {
|
|
29
29
|
WEBRTC_SERVICE_ERROR: 'WEBRTC_SERVICE_ERROR',
|
30
30
|
DEVICE_CREDENTIALS_SERVICE_ERROR: 'DEVICE_CREDENTIALS_SERVICE_ERROR',
|
31
31
|
TARGET_SERVICE_ERROR: 'TARGET_SERVICE_ERROR',
|
32
|
+
ENVIRONMENT_SERVICE_ERROR: 'ENVIRONMENT_SERVICE_ERROR',
|
32
33
|
};
|
33
34
|
class RocosError extends Error {
|
34
35
|
constructor(err, code, statusCode) {
|
@@ -11,6 +11,7 @@ var ServiceEnum;
|
|
11
11
|
ServiceEnum["CONTROL"] = "control";
|
12
12
|
ServiceEnum["DASHBOARD"] = "dashboard";
|
13
13
|
ServiceEnum["DEVICE_CREDENTIALS"] = "device_credentials";
|
14
|
+
ServiceEnum["ENVIRONMENT"] = "environment";
|
14
15
|
ServiceEnum["EVENT"] = "event";
|
15
16
|
ServiceEnum["EVALUATOR"] = "evaluator";
|
16
17
|
ServiceEnum["FILE_ACCESSOR"] = "file_accessor";
|
package/cjs/node/RocosSDKNode.js
CHANGED
@@ -27,6 +27,9 @@ class RocosSDKNode extends RocosSDK_1.RocosSDK {
|
|
27
27
|
case models_1.ServiceEnum.ROBOT:
|
28
28
|
this.services[name] = new services_1.RobotService(config);
|
29
29
|
break;
|
30
|
+
case models_1.ServiceEnum.ENVIRONMENT:
|
31
|
+
this.services[name] = new services_1.EnvironmentService(config);
|
32
|
+
break;
|
30
33
|
case models_1.ServiceEnum.EVENT:
|
31
34
|
this.services[name] = new services_1.EventService(config);
|
32
35
|
break;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { IBaseService, IRocosSDKConfig, RocosError } from '../models';
|
2
|
+
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
3
|
+
/**
|
4
|
+
* Service responsible for saving and retrieving the project environment from Giraffe.
|
5
|
+
*/
|
6
|
+
export declare class EnvironmentService extends BaseServiceAbstract implements IBaseService {
|
7
|
+
constructor(config: IRocosSDKConfig);
|
8
|
+
protected getError(e: Error): RocosError;
|
9
|
+
getStatus(): boolean;
|
10
|
+
/**
|
11
|
+
* Get Environment
|
12
|
+
*
|
13
|
+
* @param projectId - Project Id
|
14
|
+
*/
|
15
|
+
get(projectId: string): Promise<unknown>;
|
16
|
+
/**
|
17
|
+
* Update Environment
|
18
|
+
*
|
19
|
+
* @param projectId - Project Id
|
20
|
+
*/
|
21
|
+
update(projectId: string, scene: unknown): Promise<void>;
|
22
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.EnvironmentService = void 0;
|
4
|
+
const models_1 = require("../models");
|
5
|
+
const api_1 = require("../constants/api");
|
6
|
+
const BaseServiceAbstract_1 = require("./BaseServiceAbstract");
|
7
|
+
const RocosLogger_1 = require("../logger/RocosLogger");
|
8
|
+
const formatServiceUrl_1 = require("../helpers/formatServiceUrl");
|
9
|
+
/**
|
10
|
+
* Service responsible for saving and retrieving the project environment from Giraffe.
|
11
|
+
*/
|
12
|
+
class EnvironmentService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
13
|
+
constructor(config) {
|
14
|
+
super(config);
|
15
|
+
this.logger = RocosLogger_1.RocosLogger.getInstance(`EnvironmentService(${this.config.url})`);
|
16
|
+
}
|
17
|
+
getError(e) {
|
18
|
+
return new models_1.RocosError(e, models_1.errorCodes.ENVIRONMENT_SERVICE_ERROR);
|
19
|
+
}
|
20
|
+
getStatus() {
|
21
|
+
return true;
|
22
|
+
}
|
23
|
+
/**
|
24
|
+
* Get Environment
|
25
|
+
*
|
26
|
+
* @param projectId - Project Id
|
27
|
+
*/
|
28
|
+
async get(projectId) {
|
29
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ENVIRONMENT_URL, { url: this.config.url, projectId }, this.config.insecure), `Failed to get environment for ${projectId}.`, undefined);
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* Update Environment
|
33
|
+
*
|
34
|
+
* @param projectId - Project Id
|
35
|
+
*/
|
36
|
+
async update(projectId, scene) {
|
37
|
+
return this.callPut((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ENVIRONMENT_URL, { url: this.config.url, projectId }, this.config.insecure), scene, `Failed to update environment for ${projectId}.`);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
exports.EnvironmentService = EnvironmentService;
|
package/cjs/services/index.d.ts
CHANGED
@@ -6,6 +6,7 @@ export * from './ConfigGroupService';
|
|
6
6
|
export * from './ControlService';
|
7
7
|
export * from './DashboardService';
|
8
8
|
export * from './DeviceCredentialsService';
|
9
|
+
export * from './EnvironmentService';
|
9
10
|
export * from './EvaluatorService';
|
10
11
|
export * from './EventService';
|
11
12
|
export * from './FileAccessorService';
|
package/cjs/services/index.js
CHANGED
@@ -22,6 +22,7 @@ __exportStar(require("./ConfigGroupService"), exports);
|
|
22
22
|
__exportStar(require("./ControlService"), exports);
|
23
23
|
__exportStar(require("./DashboardService"), exports);
|
24
24
|
__exportStar(require("./DeviceCredentialsService"), exports);
|
25
|
+
__exportStar(require("./EnvironmentService"), exports);
|
25
26
|
__exportStar(require("./EvaluatorService"), exports);
|
26
27
|
__exportStar(require("./EventService"), exports);
|
27
28
|
__exportStar(require("./FileAccessorService"), exports);
|
package/esm/IRocosSDK.d.ts
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, SearchService, SpotProvisioningService, SpotProvisioningServiceNode, StreamService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
1
|
+
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EnvironmentService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, SearchService, SpotProvisioningService, SpotProvisioningServiceNode, StreamService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
2
2
|
import { IBaseService, IDebugLevel, ServiceEnum } from './models';
|
3
3
|
export declare abstract class IRocosSDK {
|
4
4
|
abstract getService<T extends IBaseService>(name: ServiceEnum): T;
|
5
5
|
abstract getAuthService(): AuthService;
|
6
6
|
abstract getRobotService(): RobotService;
|
7
7
|
abstract getEventService(): EventService;
|
8
|
+
abstract getEnvironmentService(): EnvironmentService;
|
8
9
|
abstract getProjectService(): ProjectService;
|
9
10
|
abstract getTelemetryService(): TelemetryService;
|
10
11
|
abstract getCallerService(): CallerService;
|
package/esm/RocosSDK.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, ScheduleService, SearchService, SpotProvisioningService, StreamService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
|
1
|
+
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EnvironmentService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, ScheduleService, SearchService, SpotProvisioningService, StreamService, TargetService, 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';
|
@@ -26,6 +26,10 @@ export declare class RocosSDK implements IRocosSDK {
|
|
26
26
|
* Gets the robot service.
|
27
27
|
*/
|
28
28
|
getRobotService(): RobotService;
|
29
|
+
/**
|
30
|
+
* Gets the event service.
|
31
|
+
*/
|
32
|
+
getEnvironmentService(): EnvironmentService;
|
29
33
|
/**
|
30
34
|
* Gets the event service.
|
31
35
|
*/
|
package/esm/RocosSDK.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, PlatFormTimeService, ProfileService, ProjectService, RTPWebRTCService, RobotService, ScheduleService, SearchService, SpotProvisioningService, StreamService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService, } from './services';
|
1
|
+
import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, DeviceCredentialsService, EnvironmentService, EvaluatorService, EventService, FileAccessorService, IntegrationService, MapService, PlatFormTimeService, ProfileService, ProjectService, RTPWebRTCService, RobotService, ScheduleService, SearchService, SpotProvisioningService, StreamService, TargetService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService, } from './services';
|
2
2
|
import { ServiceEnum } from './models';
|
3
3
|
import { RocosLogger } from './logger/RocosLogger';
|
4
4
|
import { RocosStore } from './store/RocosStore';
|
@@ -35,6 +35,9 @@ export class RocosSDK {
|
|
35
35
|
case ServiceEnum.ROBOT:
|
36
36
|
this.services[name] = new RobotService(config);
|
37
37
|
break;
|
38
|
+
case ServiceEnum.ENVIRONMENT:
|
39
|
+
this.services[name] = new EnvironmentService(config);
|
40
|
+
break;
|
38
41
|
case ServiceEnum.EVENT:
|
39
42
|
this.services[name] = new EventService(config);
|
40
43
|
break;
|
@@ -124,6 +127,12 @@ export class RocosSDK {
|
|
124
127
|
getRobotService() {
|
125
128
|
return this.getService(ServiceEnum.ROBOT);
|
126
129
|
}
|
130
|
+
/**
|
131
|
+
* Gets the event service.
|
132
|
+
*/
|
133
|
+
getEnvironmentService() {
|
134
|
+
return this.getService(ServiceEnum.ENVIRONMENT);
|
135
|
+
}
|
127
136
|
/**
|
128
137
|
* Gets the event service.
|
129
138
|
*/
|
package/esm/constants/api.d.ts
CHANGED
@@ -88,6 +88,7 @@ export declare const API_PROJECT_DEFINITION_TRIGGER_URL = "https://{url}/project
|
|
88
88
|
export declare const API_PROJECT_DEFINITION_GAMEPAD_URL = "https://{url}/projects/{projectId}/robot-definitions/{definitionId}/gamepads";
|
89
89
|
export declare const API_PROJECT_DEFINITION_EXPORT = "https://{url}/import-export/projects/{projectId}/robot-definitions/{definitionId}/export";
|
90
90
|
export declare const API_PROJECT_DEFINITION_IMPORT = "https://{url}/import-export/projects/{projectId}/robot-definitions/import";
|
91
|
+
export declare const API_PROJECT_ENVIRONMENT_URL = "https://{url}/graphs/projects/{projectId}/environments";
|
91
92
|
export declare const API_PROJECT_GROUP_TYPE_URL = "https://{url}/projects/{projectId}/config-groups/{type}";
|
92
93
|
export declare const API_PROJECT_GROUP_TYPE_ID_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}";
|
93
94
|
export declare const API_PROJECT_GROUP_TYPE_PUBLISH_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/publish";
|
package/esm/constants/api.js
CHANGED
@@ -88,6 +88,7 @@ export const API_PROJECT_DEFINITION_TRIGGER_URL = 'https://{url}/projects/{proje
|
|
88
88
|
export const API_PROJECT_DEFINITION_GAMEPAD_URL = 'https://{url}/projects/{projectId}/robot-definitions/{definitionId}/gamepads';
|
89
89
|
export const API_PROJECT_DEFINITION_EXPORT = 'https://{url}/import-export/projects/{projectId}/robot-definitions/{definitionId}/export';
|
90
90
|
export const API_PROJECT_DEFINITION_IMPORT = 'https://{url}/import-export/projects/{projectId}/robot-definitions/import';
|
91
|
+
export const API_PROJECT_ENVIRONMENT_URL = 'https://{url}/graphs/projects/{projectId}/environments';
|
91
92
|
export const API_PROJECT_GROUP_TYPE_URL = 'https://{url}/projects/{projectId}/config-groups/{type}';
|
92
93
|
export const API_PROJECT_GROUP_TYPE_ID_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}';
|
93
94
|
export const API_PROJECT_GROUP_TYPE_PUBLISH_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/publish';
|
package/esm/models/RocosError.js
CHANGED
@@ -26,6 +26,7 @@ export const errorCodes = {
|
|
26
26
|
WEBRTC_SERVICE_ERROR: 'WEBRTC_SERVICE_ERROR',
|
27
27
|
DEVICE_CREDENTIALS_SERVICE_ERROR: 'DEVICE_CREDENTIALS_SERVICE_ERROR',
|
28
28
|
TARGET_SERVICE_ERROR: 'TARGET_SERVICE_ERROR',
|
29
|
+
ENVIRONMENT_SERVICE_ERROR: 'ENVIRONMENT_SERVICE_ERROR',
|
29
30
|
};
|
30
31
|
export class RocosError extends Error {
|
31
32
|
constructor(err, code, statusCode) {
|
@@ -8,6 +8,7 @@ export var ServiceEnum;
|
|
8
8
|
ServiceEnum["CONTROL"] = "control";
|
9
9
|
ServiceEnum["DASHBOARD"] = "dashboard";
|
10
10
|
ServiceEnum["DEVICE_CREDENTIALS"] = "device_credentials";
|
11
|
+
ServiceEnum["ENVIRONMENT"] = "environment";
|
11
12
|
ServiceEnum["EVENT"] = "event";
|
12
13
|
ServiceEnum["EVALUATOR"] = "evaluator";
|
13
14
|
ServiceEnum["FILE_ACCESSOR"] = "file_accessor";
|
package/esm/node/RocosSDKNode.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AssetStorageService, AuthService, ConfigGroupService, DashboardService, DeviceCredentialsService, EventService, IntegrationService, MapService, ProfileService, ProjectService, RobotService, ScheduleService, SpotProvisioningServiceNode, StreamService, TargetService, UserService, } from '../services';
|
1
|
+
import { AssetStorageService, AuthService, ConfigGroupService, DashboardService, DeviceCredentialsService, EnvironmentService, EventService, IntegrationService, MapService, ProfileService, ProjectService, RobotService, ScheduleService, SpotProvisioningServiceNode, StreamService, TargetService, UserService, } from '../services';
|
2
2
|
import { ServiceEnum } from '../models';
|
3
3
|
import { CallerServiceNode } from '../services/CallerServiceNode';
|
4
4
|
import { CommandServiceNode } from '../services/CommandServiceNode';
|
@@ -24,6 +24,9 @@ export class RocosSDKNode extends RocosSDK {
|
|
24
24
|
case ServiceEnum.ROBOT:
|
25
25
|
this.services[name] = new RobotService(config);
|
26
26
|
break;
|
27
|
+
case ServiceEnum.ENVIRONMENT:
|
28
|
+
this.services[name] = new EnvironmentService(config);
|
29
|
+
break;
|
27
30
|
case ServiceEnum.EVENT:
|
28
31
|
this.services[name] = new EventService(config);
|
29
32
|
break;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { IBaseService, IRocosSDKConfig, RocosError } from '../models';
|
2
|
+
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
3
|
+
/**
|
4
|
+
* Service responsible for saving and retrieving the project environment from Giraffe.
|
5
|
+
*/
|
6
|
+
export declare class EnvironmentService extends BaseServiceAbstract implements IBaseService {
|
7
|
+
constructor(config: IRocosSDKConfig);
|
8
|
+
protected getError(e: Error): RocosError;
|
9
|
+
getStatus(): boolean;
|
10
|
+
/**
|
11
|
+
* Get Environment
|
12
|
+
*
|
13
|
+
* @param projectId - Project Id
|
14
|
+
*/
|
15
|
+
get(projectId: string): Promise<unknown>;
|
16
|
+
/**
|
17
|
+
* Update Environment
|
18
|
+
*
|
19
|
+
* @param projectId - Project Id
|
20
|
+
*/
|
21
|
+
update(projectId: string, scene: unknown): Promise<void>;
|
22
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { RocosError, errorCodes } from '../models';
|
2
|
+
import { API_PROJECT_ENVIRONMENT_URL } from '../constants/api';
|
3
|
+
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
4
|
+
import { RocosLogger } from '../logger/RocosLogger';
|
5
|
+
import { formatServiceUrl } from '../helpers/formatServiceUrl';
|
6
|
+
/**
|
7
|
+
* Service responsible for saving and retrieving the project environment from Giraffe.
|
8
|
+
*/
|
9
|
+
export class EnvironmentService extends BaseServiceAbstract {
|
10
|
+
constructor(config) {
|
11
|
+
super(config);
|
12
|
+
this.logger = RocosLogger.getInstance(`EnvironmentService(${this.config.url})`);
|
13
|
+
}
|
14
|
+
getError(e) {
|
15
|
+
return new RocosError(e, errorCodes.ENVIRONMENT_SERVICE_ERROR);
|
16
|
+
}
|
17
|
+
getStatus() {
|
18
|
+
return true;
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* Get Environment
|
22
|
+
*
|
23
|
+
* @param projectId - Project Id
|
24
|
+
*/
|
25
|
+
async get(projectId) {
|
26
|
+
return this.callGet(formatServiceUrl(API_PROJECT_ENVIRONMENT_URL, { url: this.config.url, projectId }, this.config.insecure), `Failed to get environment for ${projectId}.`, undefined);
|
27
|
+
}
|
28
|
+
/**
|
29
|
+
* Update Environment
|
30
|
+
*
|
31
|
+
* @param projectId - Project Id
|
32
|
+
*/
|
33
|
+
async update(projectId, scene) {
|
34
|
+
return this.callPut(formatServiceUrl(API_PROJECT_ENVIRONMENT_URL, { url: this.config.url, projectId }, this.config.insecure), scene, `Failed to update environment for ${projectId}.`);
|
35
|
+
}
|
36
|
+
}
|
package/esm/services/index.d.ts
CHANGED
@@ -6,6 +6,7 @@ export * from './ConfigGroupService';
|
|
6
6
|
export * from './ControlService';
|
7
7
|
export * from './DashboardService';
|
8
8
|
export * from './DeviceCredentialsService';
|
9
|
+
export * from './EnvironmentService';
|
9
10
|
export * from './EvaluatorService';
|
10
11
|
export * from './EventService';
|
11
12
|
export * from './FileAccessorService';
|
package/esm/services/index.js
CHANGED
@@ -6,6 +6,7 @@ export * from './ConfigGroupService';
|
|
6
6
|
export * from './ControlService';
|
7
7
|
export * from './DashboardService';
|
8
8
|
export * from './DeviceCredentialsService';
|
9
|
+
export * from './EnvironmentService';
|
9
10
|
export * from './EvaluatorService';
|
10
11
|
export * from './EventService';
|
11
12
|
export * from './FileAccessorService';
|