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

Sign up to get free protection for your applications and to get access to all the features.
@@ -139,7 +139,12 @@ export declare const API_GRAPHS_ASSETS_URL = "https://{url}/graphs/projects/{pro
139
139
  export declare const API_PROJECT_WORKFLOW_URL = "https://{url}/projects/{projectId}/automate/flows";
140
140
  export declare const API_PROJECT_WORKFLOW_ID_URL = "https://{url}/projects/{projectId}/automate/flows/{workflowId}";
141
141
  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";
142
+ export declare const API_PROJECT_ROBOT_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/robots/{callsign}/automate/flows/deployments";
143
+ export declare const API_PROJECT_PROFILE_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments";
144
+ export declare const API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments";
145
+ export declare const API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments/{workflowId}";
146
+ export declare const API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments/{workflowId}";
147
+ export declare const API_PROJECT_WORKFLOW_AFFECTED_URL = "https://{url}/projects/{projectId}/automate/flows/{flowId}/robots";
143
148
  export declare const API_LINKED_PROJECT_URL = "https://{url}/linked-projects/{linkedProjectId}";
144
149
  export declare const API_DEVICE_CREDENTIALS_URL = "https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials";
145
150
  export declare const API_DEVICE_CREDENTIALS_AUTH_URL = "https://{url}/device-credentials/auth";
@@ -2,7 +2,7 @@
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
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;
5
+ exports.API_DEVICE_CREDENTIALS_AUTH_URL = 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 = 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';
@@ -144,7 +144,12 @@ exports.API_GRAPHS_ASSETS_URL = 'https://{url}/graphs/projects/{projectId}/asset
144
144
  exports.API_PROJECT_WORKFLOW_URL = 'https://{url}/projects/{projectId}/automate/flows';
145
145
  exports.API_PROJECT_WORKFLOW_ID_URL = 'https://{url}/projects/{projectId}/automate/flows/{workflowId}';
146
146
  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';
147
+ exports.API_PROJECT_ROBOT_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/robots/{callsign}/automate/flows/deployments';
148
+ exports.API_PROJECT_PROFILE_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments';
149
+ exports.API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments';
150
+ exports.API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments/{workflowId}';
151
+ exports.API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments/{workflowId}';
152
+ exports.API_PROJECT_WORKFLOW_AFFECTED_URL = 'https://{url}/projects/{projectId}/automate/flows/{flowId}/robots';
148
153
  exports.API_LINKED_PROJECT_URL = 'https://{url}/linked-projects/{linkedProjectId}';
149
154
  exports.API_DEVICE_CREDENTIALS_URL = 'https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials';
150
155
  exports.API_DEVICE_CREDENTIALS_AUTH_URL = 'https://{url}/device-credentials/auth';
@@ -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;
@@ -139,7 +139,12 @@ export declare const API_GRAPHS_ASSETS_URL = "https://{url}/graphs/projects/{pro
139
139
  export declare const API_PROJECT_WORKFLOW_URL = "https://{url}/projects/{projectId}/automate/flows";
140
140
  export declare const API_PROJECT_WORKFLOW_ID_URL = "https://{url}/projects/{projectId}/automate/flows/{workflowId}";
141
141
  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";
142
+ export declare const API_PROJECT_ROBOT_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/robots/{callsign}/automate/flows/deployments";
143
+ export declare const API_PROJECT_PROFILE_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments";
144
+ export declare const API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments";
145
+ export declare const API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments/{workflowId}";
146
+ export declare const API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments/{workflowId}";
147
+ export declare const API_PROJECT_WORKFLOW_AFFECTED_URL = "https://{url}/projects/{projectId}/automate/flows/{flowId}/robots";
143
148
  export declare const API_LINKED_PROJECT_URL = "https://{url}/linked-projects/{linkedProjectId}";
144
149
  export declare const API_DEVICE_CREDENTIALS_URL = "https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials";
145
150
  export declare const API_DEVICE_CREDENTIALS_AUTH_URL = "https://{url}/device-credentials/auth";
@@ -139,7 +139,12 @@ export const API_GRAPHS_ASSETS_URL = 'https://{url}/graphs/projects/{projectId}/
139
139
  export const API_PROJECT_WORKFLOW_URL = 'https://{url}/projects/{projectId}/automate/flows';
140
140
  export const API_PROJECT_WORKFLOW_ID_URL = 'https://{url}/projects/{projectId}/automate/flows/{workflowId}';
141
141
  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';
142
+ export const API_PROJECT_ROBOT_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/robots/{callsign}/automate/flows/deployments';
143
+ export const API_PROJECT_PROFILE_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments';
144
+ export const API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments';
145
+ export const API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments/{workflowId}';
146
+ export const API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments/{workflowId}';
147
+ export const API_PROJECT_WORKFLOW_AFFECTED_URL = 'https://{url}/projects/{projectId}/automate/flows/{flowId}/robots';
143
148
  export const API_LINKED_PROJECT_URL = 'https://{url}/linked-projects/{linkedProjectId}';
144
149
  export const API_DEVICE_CREDENTIALS_URL = 'https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials';
145
150
  export const API_DEVICE_CREDENTIALS_AUTH_URL = 'https://{url}/device-credentials/auth';
@@ -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
  }
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.41",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",