@dronedeploy/rocos-js-sdk 3.0.1-alpha.40 → 3.0.1-alpha.42

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
  */
@@ -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";
@@ -139,7 +140,12 @@ export declare const API_GRAPHS_ASSETS_URL = "https://{url}/graphs/projects/{pro
139
140
  export declare const API_PROJECT_WORKFLOW_URL = "https://{url}/projects/{projectId}/automate/flows";
140
141
  export declare const API_PROJECT_WORKFLOW_ID_URL = "https://{url}/projects/{projectId}/automate/flows/{workflowId}";
141
142
  export declare const API_PROJECT_WORKFLOW_ASSET_URL = "https://{url}/projects/{projectId}/automate/flows/{workflowId}/assets";
142
- export declare const API_PROJECT_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments";
143
+ export declare const API_PROJECT_ROBOT_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/robots/{callsign}/automate/flows/deployments";
144
+ export declare const API_PROJECT_PROFILE_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments";
145
+ export declare const API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments";
146
+ export declare const API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments/{workflowId}";
147
+ export declare const API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments/{workflowId}";
148
+ export declare const API_PROJECT_WORKFLOW_AFFECTED_URL = "https://{url}/projects/{projectId}/automate/flows/{flowId}/robots";
143
149
  export declare const API_LINKED_PROJECT_URL = "https://{url}/linked-projects/{linkedProjectId}";
144
150
  export declare const API_DEVICE_CREDENTIALS_URL = "https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials";
145
151
  export declare const API_DEVICE_CREDENTIALS_AUTH_URL = "https://{url}/device-credentials/auth";
@@ -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.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_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_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_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 = void 0;
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';
@@ -144,7 +146,12 @@ exports.API_GRAPHS_ASSETS_URL = 'https://{url}/graphs/projects/{projectId}/asset
144
146
  exports.API_PROJECT_WORKFLOW_URL = 'https://{url}/projects/{projectId}/automate/flows';
145
147
  exports.API_PROJECT_WORKFLOW_ID_URL = 'https://{url}/projects/{projectId}/automate/flows/{workflowId}';
146
148
  exports.API_PROJECT_WORKFLOW_ASSET_URL = 'https://{url}/projects/{projectId}/automate/flows/{workflowId}/assets';
147
- exports.API_PROJECT_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments';
149
+ exports.API_PROJECT_ROBOT_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/robots/{callsign}/automate/flows/deployments';
150
+ exports.API_PROJECT_PROFILE_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments';
151
+ exports.API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments';
152
+ exports.API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments/{workflowId}';
153
+ exports.API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments/{workflowId}';
154
+ exports.API_PROJECT_WORKFLOW_AFFECTED_URL = 'https://{url}/projects/{projectId}/automate/flows/{flowId}/robots';
148
155
  exports.API_LINKED_PROJECT_URL = 'https://{url}/linked-projects/{linkedProjectId}';
149
156
  exports.API_DEVICE_CREDENTIALS_URL = 'https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials';
150
157
  exports.API_DEVICE_CREDENTIALS_AUTH_URL = 'https://{url}/device-credentials/auth';
@@ -26,6 +26,7 @@ export declare const errorCodes: {
26
26
  WEBRTC_SERVICE_ERROR: string;
27
27
  DEVICE_CREDENTIALS_SERVICE_ERROR: string;
28
28
  TARGET_SERVICE_ERROR: string;
29
+ ENVIRONMENT_SERVICE_ERROR: string;
29
30
  };
30
31
  export declare class RocosError extends Error {
31
32
  code?: string;
@@ -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) {
@@ -7,6 +7,7 @@ export declare enum ServiceEnum {
7
7
  CONTROL = "control",
8
8
  DASHBOARD = "dashboard",
9
9
  DEVICE_CREDENTIALS = "device_credentials",
10
+ ENVIRONMENT = "environment",
10
11
  EVENT = "event",
11
12
  EVALUATOR = "evaluator",
12
13
  FILE_ACCESSOR = "file_accessor",
@@ -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";
@@ -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;
@@ -36,27 +36,37 @@ export declare class WorkflowService extends BaseServiceAbstract implements IBas
36
36
  */
37
37
  update(projectId: string, workflowId: string, model: Workflow): Promise<Workflow>;
38
38
  /**
39
- * Upload workflow asset
39
+ * Delete a workflow
40
40
  *
41
41
  * @param projectId - Project Id
42
42
  * @param workflowId - Workflow Id
43
- * @param fileName - Name of file including extension
44
- * @param arrayBuffer - data to upload
45
43
  */
46
- uploadAsset(projectId: string, workflowId: string, fileName: string, arrayBuffer: ArrayBuffer): Promise<void>;
47
- protected uploadAssetWithHash(projectId: string, workflowId: string, fileName: string, arrayBuffer: ArrayBuffer, hash: string): Promise<void>;
44
+ delete(projectId: string, workflowId: string): Promise<void>;
48
45
  /**
49
- * Delete a workflow
46
+ * Upload workflow asset
50
47
  *
51
48
  * @param projectId - Project Id
52
49
  * @param workflowId - Workflow Id
50
+ * @param fileName - Name of file including extension
51
+ * @param arrayBuffer - data to upload
53
52
  */
54
- delete(projectId: string, workflowId: string): Promise<void>;
53
+ uploadAsset(projectId: string, workflowId: string, fileName: string, arrayBuffer: ArrayBuffer): Promise<void>;
54
+ protected uploadAssetWithHash(projectId: string, workflowId: string, fileName: string, arrayBuffer: ArrayBuffer, hash: string): Promise<void>;
55
55
  /**
56
56
  * Get deployed workflows on robot
57
57
  *
58
58
  * @param projectId - Project Id
59
59
  * @param callsign - Robot callsign
60
60
  */
61
- getDeployedWorkflows(projectId: string, callsign: string): Promise<Workflow[]>;
61
+ getDeployedWorkflows(projectId: string, profileId: string, callsign?: string): Promise<Workflow[]>;
62
+ addRobotDeployment(projectId: string, callsign: string, workflowId: string): Promise<void>;
63
+ addProfileDeployment(projectId: string, profileId: string, workflowId: string): Promise<void>;
64
+ removeRobotDeployment(projectId: string, callsign: string, workflowId: string): Promise<void>;
65
+ removeProfileDeployment(projectId: string, profileId: string, workflowId: string): Promise<void>;
66
+ updateRobotDeployments(projectId: string, callsign: string, workflows: string[]): Promise<void>;
67
+ updateProfileDeployments(projectId: string, profileId: string, workflows: string[]): Promise<void>;
68
+ getAffectedRobots(projectId: string, workflowId: string): Promise<{
69
+ callsigns: string[];
70
+ profileIds: string[];
71
+ }>;
62
72
  }
@@ -54,6 +54,16 @@ class WorkflowService extends BaseServiceAbstract_1.BaseServiceAbstract {
54
54
  async update(projectId, workflowId, model) {
55
55
  return this.callPut((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_WORKFLOW_ID_URL, { url: this.config.url, projectId, workflowId }, this.config.insecure), model, `Failed to update workflow for ${projectId}, workflowId ${workflowId}.`);
56
56
  }
57
+ /**
58
+ * Delete a workflow
59
+ *
60
+ * @param projectId - Project Id
61
+ * @param workflowId - Workflow Id
62
+ */
63
+ async delete(projectId, workflowId) {
64
+ return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_WORKFLOW_ID_URL, { url: this.config.url, projectId, workflowId }, this.config.insecure), `Failed to delete workflow for ${projectId}, workflowId ${workflowId}.`);
65
+ }
66
+ // Assets
57
67
  /**
58
68
  * Upload workflow asset
59
69
  *
@@ -85,23 +95,39 @@ class WorkflowService extends BaseServiceAbstract_1.BaseServiceAbstract {
85
95
  if (uploadResponse.status !== 200)
86
96
  throw new Error(`Failed to upload file: ${uploadResponse.statusText}`);
87
97
  }
88
- /**
89
- * Delete a workflow
90
- *
91
- * @param projectId - Project Id
92
- * @param workflowId - Workflow Id
93
- */
94
- async delete(projectId, workflowId) {
95
- return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_WORKFLOW_ID_URL, { url: this.config.url, projectId, workflowId }, this.config.insecure), `Failed to delete workflow for ${projectId}, workflowId ${workflowId}.`);
96
- }
98
+ // Deployments
97
99
  /**
98
100
  * Get deployed workflows on robot
99
101
  *
100
102
  * @param projectId - Project Id
101
103
  * @param callsign - Robot callsign
102
104
  */
103
- async getDeployedWorkflows(projectId, callsign) {
104
- return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), `Failed to update workflows for ${projectId}, callsign ${callsign}.`);
105
+ async getDeployedWorkflows(projectId, profileId, callsign) {
106
+ if (callsign) {
107
+ return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ROBOT_DEPLOYMENTS_URL, { url: this.config.url, projectId, profileId, callsign }, this.config.insecure), `Failed to get workflows for project ${projectId}, profile ${profileId}, callsign ${callsign}.`);
108
+ }
109
+ return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_PROFILE_DEPLOYMENTS_URL, { url: this.config.url, projectId, profileId }, this.config.insecure), `Failed to get workflows for project ${projectId}, profile ${profileId}.`);
110
+ }
111
+ async addRobotDeployment(projectId, callsign, workflowId) {
112
+ return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, callsign, workflowId }, this.config.insecure), undefined, `Failed to add workflow for ${projectId}, callsign ${callsign}.`);
113
+ }
114
+ async addProfileDeployment(projectId, profileId, workflowId) {
115
+ return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, profileId, workflowId }, this.config.insecure), undefined, `Failed to add workflow for ${projectId}, profile ${profileId}.`);
116
+ }
117
+ async removeRobotDeployment(projectId, callsign, workflowId) {
118
+ return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, callsign, workflowId }, this.config.insecure), `Failed to remove workflow for ${projectId}, callsign ${callsign}.`);
119
+ }
120
+ async removeProfileDeployment(projectId, profileId, workflowId) {
121
+ return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, profileId, workflowId }, this.config.insecure), `Failed to remove workflow for ${projectId}, profile ${profileId}.`);
122
+ }
123
+ async updateRobotDeployments(projectId, callsign, workflows) {
124
+ return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), { deployed: workflows }, `Failed to update workflows for ${projectId}, callsign ${callsign}.`);
125
+ }
126
+ async updateProfileDeployments(projectId, profileId, workflows) {
127
+ return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_PROFILE_DEPLOYMENTS_URL, { url: this.config.url, projectId, profileId }, this.config.insecure), { deployed: workflows }, `Failed to update workflows for ${projectId}, profile ${profileId}.`);
128
+ }
129
+ async getAffectedRobots(projectId, workflowId) {
130
+ return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_WORKFLOW_AFFECTED_URL, { url: this.config.url, projectId, workflowId, flowId: workflowId }, this.config.insecure), `Failed to get affected robots for ${projectId}, workflowId ${workflowId}.`);
105
131
  }
106
132
  }
107
133
  exports.WorkflowService = WorkflowService;
@@ -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';
@@ -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);
@@ -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
  */
@@ -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";
@@ -139,7 +140,12 @@ export declare const API_GRAPHS_ASSETS_URL = "https://{url}/graphs/projects/{pro
139
140
  export declare const API_PROJECT_WORKFLOW_URL = "https://{url}/projects/{projectId}/automate/flows";
140
141
  export declare const API_PROJECT_WORKFLOW_ID_URL = "https://{url}/projects/{projectId}/automate/flows/{workflowId}";
141
142
  export declare const API_PROJECT_WORKFLOW_ASSET_URL = "https://{url}/projects/{projectId}/automate/flows/{workflowId}/assets";
142
- export declare const API_PROJECT_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments";
143
+ export declare const API_PROJECT_ROBOT_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/robots/{callsign}/automate/flows/deployments";
144
+ export declare const API_PROJECT_PROFILE_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments";
145
+ export declare const API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments";
146
+ export declare const API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments/{workflowId}";
147
+ export declare const API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments/{workflowId}";
148
+ export declare const API_PROJECT_WORKFLOW_AFFECTED_URL = "https://{url}/projects/{projectId}/automate/flows/{flowId}/robots";
143
149
  export declare const API_LINKED_PROJECT_URL = "https://{url}/linked-projects/{linkedProjectId}";
144
150
  export declare const API_DEVICE_CREDENTIALS_URL = "https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials";
145
151
  export declare const API_DEVICE_CREDENTIALS_AUTH_URL = "https://{url}/device-credentials/auth";
@@ -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';
@@ -139,7 +140,12 @@ export const API_GRAPHS_ASSETS_URL = 'https://{url}/graphs/projects/{projectId}/
139
140
  export const API_PROJECT_WORKFLOW_URL = 'https://{url}/projects/{projectId}/automate/flows';
140
141
  export const API_PROJECT_WORKFLOW_ID_URL = 'https://{url}/projects/{projectId}/automate/flows/{workflowId}';
141
142
  export const API_PROJECT_WORKFLOW_ASSET_URL = 'https://{url}/projects/{projectId}/automate/flows/{workflowId}/assets';
142
- export const API_PROJECT_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments';
143
+ export const API_PROJECT_ROBOT_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/robots/{callsign}/automate/flows/deployments';
144
+ export const API_PROJECT_PROFILE_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments';
145
+ export const API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments';
146
+ export const API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments/{workflowId}';
147
+ export const API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments/{workflowId}';
148
+ export const API_PROJECT_WORKFLOW_AFFECTED_URL = 'https://{url}/projects/{projectId}/automate/flows/{flowId}/robots';
143
149
  export const API_LINKED_PROJECT_URL = 'https://{url}/linked-projects/{linkedProjectId}';
144
150
  export const API_DEVICE_CREDENTIALS_URL = 'https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials';
145
151
  export const API_DEVICE_CREDENTIALS_AUTH_URL = 'https://{url}/device-credentials/auth';
@@ -26,6 +26,7 @@ export declare const errorCodes: {
26
26
  WEBRTC_SERVICE_ERROR: string;
27
27
  DEVICE_CREDENTIALS_SERVICE_ERROR: string;
28
28
  TARGET_SERVICE_ERROR: string;
29
+ ENVIRONMENT_SERVICE_ERROR: string;
29
30
  };
30
31
  export declare class RocosError extends Error {
31
32
  code?: string;
@@ -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) {
@@ -7,6 +7,7 @@ export declare enum ServiceEnum {
7
7
  CONTROL = "control",
8
8
  DASHBOARD = "dashboard",
9
9
  DEVICE_CREDENTIALS = "device_credentials",
10
+ ENVIRONMENT = "environment",
10
11
  EVENT = "event",
11
12
  EVALUATOR = "evaluator",
12
13
  FILE_ACCESSOR = "file_accessor",
@@ -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";
@@ -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
+ }
@@ -36,27 +36,37 @@ export declare class WorkflowService extends BaseServiceAbstract implements IBas
36
36
  */
37
37
  update(projectId: string, workflowId: string, model: Workflow): Promise<Workflow>;
38
38
  /**
39
- * Upload workflow asset
39
+ * Delete a workflow
40
40
  *
41
41
  * @param projectId - Project Id
42
42
  * @param workflowId - Workflow Id
43
- * @param fileName - Name of file including extension
44
- * @param arrayBuffer - data to upload
45
43
  */
46
- uploadAsset(projectId: string, workflowId: string, fileName: string, arrayBuffer: ArrayBuffer): Promise<void>;
47
- protected uploadAssetWithHash(projectId: string, workflowId: string, fileName: string, arrayBuffer: ArrayBuffer, hash: string): Promise<void>;
44
+ delete(projectId: string, workflowId: string): Promise<void>;
48
45
  /**
49
- * Delete a workflow
46
+ * Upload workflow asset
50
47
  *
51
48
  * @param projectId - Project Id
52
49
  * @param workflowId - Workflow Id
50
+ * @param fileName - Name of file including extension
51
+ * @param arrayBuffer - data to upload
53
52
  */
54
- delete(projectId: string, workflowId: string): Promise<void>;
53
+ uploadAsset(projectId: string, workflowId: string, fileName: string, arrayBuffer: ArrayBuffer): Promise<void>;
54
+ protected uploadAssetWithHash(projectId: string, workflowId: string, fileName: string, arrayBuffer: ArrayBuffer, hash: string): Promise<void>;
55
55
  /**
56
56
  * Get deployed workflows on robot
57
57
  *
58
58
  * @param projectId - Project Id
59
59
  * @param callsign - Robot callsign
60
60
  */
61
- getDeployedWorkflows(projectId: string, callsign: string): Promise<Workflow[]>;
61
+ getDeployedWorkflows(projectId: string, profileId: string, callsign?: string): Promise<Workflow[]>;
62
+ addRobotDeployment(projectId: string, callsign: string, workflowId: string): Promise<void>;
63
+ addProfileDeployment(projectId: string, profileId: string, workflowId: string): Promise<void>;
64
+ removeRobotDeployment(projectId: string, callsign: string, workflowId: string): Promise<void>;
65
+ removeProfileDeployment(projectId: string, profileId: string, workflowId: string): Promise<void>;
66
+ updateRobotDeployments(projectId: string, callsign: string, workflows: string[]): Promise<void>;
67
+ updateProfileDeployments(projectId: string, profileId: string, workflows: string[]): Promise<void>;
68
+ getAffectedRobots(projectId: string, workflowId: string): Promise<{
69
+ callsigns: string[];
70
+ profileIds: string[];
71
+ }>;
62
72
  }
@@ -1,4 +1,4 @@
1
- import { API_PROJECT_DEPLOYED_WORKFLOW_URL, API_PROJECT_WORKFLOW_ASSET_URL, API_PROJECT_WORKFLOW_ID_URL, API_PROJECT_WORKFLOW_URL, } from '../constants/api';
1
+ import { API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL, API_PROJECT_PROFILE_DEPLOYMENTS_URL, API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL, API_PROJECT_ROBOT_DEPLOYMENTS_URL, API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL, API_PROJECT_WORKFLOW_AFFECTED_URL, API_PROJECT_WORKFLOW_ASSET_URL, API_PROJECT_WORKFLOW_ID_URL, API_PROJECT_WORKFLOW_URL, } from '../constants/api';
2
2
  import { RocosError, errorCodes } from '../models/RocosError';
3
3
  import { BaseServiceAbstract } from './BaseServiceAbstract';
4
4
  import { RocosLogger } from '../logger/RocosLogger';
@@ -51,6 +51,16 @@ export class WorkflowService extends BaseServiceAbstract {
51
51
  async update(projectId, workflowId, model) {
52
52
  return this.callPut(formatServiceUrl(API_PROJECT_WORKFLOW_ID_URL, { url: this.config.url, projectId, workflowId }, this.config.insecure), model, `Failed to update workflow for ${projectId}, workflowId ${workflowId}.`);
53
53
  }
54
+ /**
55
+ * Delete a workflow
56
+ *
57
+ * @param projectId - Project Id
58
+ * @param workflowId - Workflow Id
59
+ */
60
+ async delete(projectId, workflowId) {
61
+ return this.callDelete(formatServiceUrl(API_PROJECT_WORKFLOW_ID_URL, { url: this.config.url, projectId, workflowId }, this.config.insecure), `Failed to delete workflow for ${projectId}, workflowId ${workflowId}.`);
62
+ }
63
+ // Assets
54
64
  /**
55
65
  * Upload workflow asset
56
66
  *
@@ -82,22 +92,38 @@ export class WorkflowService extends BaseServiceAbstract {
82
92
  if (uploadResponse.status !== 200)
83
93
  throw new Error(`Failed to upload file: ${uploadResponse.statusText}`);
84
94
  }
85
- /**
86
- * Delete a workflow
87
- *
88
- * @param projectId - Project Id
89
- * @param workflowId - Workflow Id
90
- */
91
- async delete(projectId, workflowId) {
92
- return this.callDelete(formatServiceUrl(API_PROJECT_WORKFLOW_ID_URL, { url: this.config.url, projectId, workflowId }, this.config.insecure), `Failed to delete workflow for ${projectId}, workflowId ${workflowId}.`);
93
- }
95
+ // Deployments
94
96
  /**
95
97
  * Get deployed workflows on robot
96
98
  *
97
99
  * @param projectId - Project Id
98
100
  * @param callsign - Robot callsign
99
101
  */
100
- async getDeployedWorkflows(projectId, callsign) {
101
- return this.callGet(formatServiceUrl(API_PROJECT_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), `Failed to update workflows for ${projectId}, callsign ${callsign}.`);
102
+ async getDeployedWorkflows(projectId, profileId, callsign) {
103
+ if (callsign) {
104
+ return this.callGet(formatServiceUrl(API_PROJECT_ROBOT_DEPLOYMENTS_URL, { url: this.config.url, projectId, profileId, callsign }, this.config.insecure), `Failed to get workflows for project ${projectId}, profile ${profileId}, callsign ${callsign}.`);
105
+ }
106
+ return this.callGet(formatServiceUrl(API_PROJECT_PROFILE_DEPLOYMENTS_URL, { url: this.config.url, projectId, profileId }, this.config.insecure), `Failed to get workflows for project ${projectId}, profile ${profileId}.`);
107
+ }
108
+ async addRobotDeployment(projectId, callsign, workflowId) {
109
+ return this.callPost(formatServiceUrl(API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, callsign, workflowId }, this.config.insecure), undefined, `Failed to add workflow for ${projectId}, callsign ${callsign}.`);
110
+ }
111
+ async addProfileDeployment(projectId, profileId, workflowId) {
112
+ return this.callPost(formatServiceUrl(API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, profileId, workflowId }, this.config.insecure), undefined, `Failed to add workflow for ${projectId}, profile ${profileId}.`);
113
+ }
114
+ async removeRobotDeployment(projectId, callsign, workflowId) {
115
+ return this.callDelete(formatServiceUrl(API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, callsign, workflowId }, this.config.insecure), `Failed to remove workflow for ${projectId}, callsign ${callsign}.`);
116
+ }
117
+ async removeProfileDeployment(projectId, profileId, workflowId) {
118
+ return this.callDelete(formatServiceUrl(API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, profileId, workflowId }, this.config.insecure), `Failed to remove workflow for ${projectId}, profile ${profileId}.`);
119
+ }
120
+ async updateRobotDeployments(projectId, callsign, workflows) {
121
+ return this.callPost(formatServiceUrl(API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), { deployed: workflows }, `Failed to update workflows for ${projectId}, callsign ${callsign}.`);
122
+ }
123
+ async updateProfileDeployments(projectId, profileId, workflows) {
124
+ return this.callPost(formatServiceUrl(API_PROJECT_PROFILE_DEPLOYMENTS_URL, { url: this.config.url, projectId, profileId }, this.config.insecure), { deployed: workflows }, `Failed to update workflows for ${projectId}, profile ${profileId}.`);
125
+ }
126
+ async getAffectedRobots(projectId, workflowId) {
127
+ return this.callGet(formatServiceUrl(API_PROJECT_WORKFLOW_AFFECTED_URL, { url: this.config.url, projectId, workflowId, flowId: workflowId }, this.config.insecure), `Failed to get affected robots for ${projectId}, workflowId ${workflowId}.`);
102
128
  }
103
129
  }
@@ -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';
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dronedeploy/rocos-js-sdk",
3
- "version": "3.0.1-alpha.40",
3
+ "version": "3.0.1-alpha.42",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",