@dronedeploy/rocos-js-sdk 3.0.1-alpha.28 → 3.0.1-alpha.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,6 +28,7 @@ export declare const API_ACCOUNT_PROJECT_USER_URL = "https://{url}/accounts/{acc
28
28
  export declare const API_ACCOUNT_PROJECT_USER_ID_URL = "https://{url}/accounts/{accountId}/projects/{projectId}/users/{userId}";
29
29
  export declare const API_ACCOUNT_PROJECT_APPLICATION_URL = "https://{url}/accounts/{accountId}/projects/{projectId}/applications";
30
30
  export declare const API_ACCOUNT_PROJECT_APPLICATION_ID_URL = "https://{url}/accounts/{accountId}/projects/{projectId}/applications/{applicationId}";
31
+ export declare const API_ACCOUNT_EXTERNAL_PROJECTS_URL = "https://{url}/accounts/{accountId}/external-projects";
31
32
  export declare const API_PROJECT_URL = "https://{url}/projects";
32
33
  export declare const API_PROJECT_ID_URL = "https://{url}/projects/{projectId}";
33
34
  export declare const API_PROJECT_USERS_URL = "https://{url}/projects/{projectId}/users";
@@ -136,3 +137,4 @@ export declare const API_LINKED_PROJECT_URL = "https://{url}/linked-projects/{li
136
137
  export declare const API_DEVICE_CREDENTIALS_URL = "https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials";
137
138
  export declare const API_DEVICE_CREDENTIALS_AUTH_URL = "https://{url}/device-credentials/auth";
138
139
  export declare const API_TARGETS_URL = "https://{url}/projects/{projectId}/targets";
140
+ export declare const API_TARGETs_MEDIA_URL = "https://{url}/projects/{projectId}/targets/{targetId}/media";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.API_PROJECT_ROBOT_DEFINITION_URL = exports.API_PROJECT_ROBOT_ATTRIBUTES_URL = exports.API_PROJECT_ROBOT_ID_URL = exports.API_PROJECT_ROBOT_URL = exports.API_PROJECT_MAPPED_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_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_ROBOT_DASHBOARD_URL = exports.API_PROJECT_STREAM_CALLSIGN_URL = exports.API_PROJECT_STREAM_DATA_URL = exports.API_PROJECT_STREAM_ID_URL = exports.API_PROJECT_STREAM_URL = exports.API_PROJECT_EXPORT_URL = exports.API_PROJECT_GROUP_TYPE_OWNER_OVERRIDE_URL = exports.API_PROJECT_GROUP_TYPE_OWNER_ID_URL = exports.API_PROJECT_GROUP_TYPE_VERSION_URL = exports.API_PROJECT_GROUP_TYPE_CONFIG_URL = exports.API_PROJECT_GROUP_TYPE_PUBLISH_URL = exports.API_PROJECT_GROUP_TYPE_ID_URL = exports.API_PROJECT_GROUP_TYPE_URL = exports.API_PROJECT_DEFINITION_IMPORT = exports.API_PROJECT_DEFINITION_EXPORT = exports.API_PROJECT_DEFINITION_GAMEPAD_URL = exports.API_PROJECT_DEFINITION_TRIGGER_URL = exports.API_PROJECT_DEFINITION_BUTTON_URL = exports.API_PROJECT_DEFINITION_ACTION_URL = exports.API_PROJECT_DEFINITION_EVENT_URL = exports.API_PROJECT_DEFINITION_COMMAND2_URL = exports.API_PROJECT_DEFINITION_COMMAND_URL = exports.API_PROJECT_DEFINITION_AGENT_URL = exports.API_PROJECT_DEFINITION_SETTING_URL = exports.API_PROJECT_DEFINITION_BLOB_URL = exports.API_PROJECT_DEFINITION_DASHBOARD_URL = exports.API_PROJECT_DEFINITION_COPY_URL = exports.API_PROJECT_DEFINITION_STREAM_URL = exports.API_PROJECT_DEFINITION_ID_URL = exports.API_PROJECT_DEFINITION_URL = exports.API_PROJECT_VROBOT_DEPLOY_URL = exports.API_PROJECT_VROBOT_DETAILS_URL = exports.API_PROJECT_COLLECTION_DOCS_URL = exports.API_PROJECT_COLLECTION_ID_URL = exports.API_PROJECT_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_DASHBOARD_WIDGET_URL = exports.API_PROJECT_DASHBOARD_ID_URL = exports.API_PROJECT_DASHBOARD_URL = exports.API_PROJECT_OPERATION_ID_URL = exports.API_PROJECT_OPERATION_URL = exports.API_PROJECT_ROBOT_GAMEPAD_URL = exports.API_PROJECT_ROBOT_TRIGGER_URL = exports.API_PROJECT_ROBOT_BUTTON_URL = exports.API_PROJECT_ROBOT_COMMAND2_URL = exports.API_PROJECT_ROBOT_COMMAND_URL = exports.API_PROJECT_ROBOT_AGENT_URL = exports.API_PROJECT_ROBOT_SETTING_URL = exports.API_PROJECT_ROBOT_EVENT_HISTORY_URL = exports.API_PROJECT_ROBOT_EVENT_URL = exports.API_PROJECT_ROBOT_REGISTER_URL = void 0;
5
- exports.API_TARGETS_URL = exports.API_DEVICE_CREDENTIALS_AUTH_URL = exports.API_DEVICE_CREDENTIALS_URL = exports.API_LINKED_PROJECT_URL = exports.API_PROJECT_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_WORKFLOW_ASSET_URL = exports.API_PROJECT_WORKFLOW_ID_URL = exports.API_PROJECT_WORKFLOW_URL = exports.API_OBSERVATION_KEYS_URL = exports.API_OBSERVATIONS_URL = exports.API_MAPS_PANORAMA_OBSERVATIONS_URL = exports.API_MAPS_GEOJSON_URL = exports.API_MAPS_DEPLOY_URL = exports.API_MAPS_COPY_URL = exports.API_MAP_ID_URL = exports.API_MAPS_MERGE_URL = exports.API_MAPS_DEPLOYED_URL = exports.API_MAPS_URL = exports.API_DD_INTEGRATION_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 = void 0;
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_CALLSIGN_URL = exports.API_PROJECT_STREAM_DATA_URL = exports.API_PROJECT_STREAM_ID_URL = exports.API_PROJECT_STREAM_URL = exports.API_PROJECT_EXPORT_URL = exports.API_PROJECT_GROUP_TYPE_OWNER_OVERRIDE_URL = exports.API_PROJECT_GROUP_TYPE_OWNER_ID_URL = exports.API_PROJECT_GROUP_TYPE_VERSION_URL = exports.API_PROJECT_GROUP_TYPE_CONFIG_URL = exports.API_PROJECT_GROUP_TYPE_PUBLISH_URL = exports.API_PROJECT_GROUP_TYPE_ID_URL = exports.API_PROJECT_GROUP_TYPE_URL = exports.API_PROJECT_DEFINITION_IMPORT = exports.API_PROJECT_DEFINITION_EXPORT = exports.API_PROJECT_DEFINITION_GAMEPAD_URL = exports.API_PROJECT_DEFINITION_TRIGGER_URL = exports.API_PROJECT_DEFINITION_BUTTON_URL = exports.API_PROJECT_DEFINITION_ACTION_URL = exports.API_PROJECT_DEFINITION_EVENT_URL = exports.API_PROJECT_DEFINITION_COMMAND2_URL = exports.API_PROJECT_DEFINITION_COMMAND_URL = exports.API_PROJECT_DEFINITION_AGENT_URL = exports.API_PROJECT_DEFINITION_SETTING_URL = exports.API_PROJECT_DEFINITION_BLOB_URL = exports.API_PROJECT_DEFINITION_DASHBOARD_URL = exports.API_PROJECT_DEFINITION_COPY_URL = exports.API_PROJECT_DEFINITION_STREAM_URL = exports.API_PROJECT_DEFINITION_ID_URL = exports.API_PROJECT_DEFINITION_URL = exports.API_PROJECT_VROBOT_DEPLOY_URL = exports.API_PROJECT_VROBOT_DETAILS_URL = exports.API_PROJECT_COLLECTION_DOCS_URL = exports.API_PROJECT_COLLECTION_ID_URL = exports.API_PROJECT_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_DASHBOARD_WIDGET_URL = exports.API_PROJECT_DASHBOARD_ID_URL = exports.API_PROJECT_DASHBOARD_URL = exports.API_PROJECT_OPERATION_ID_URL = exports.API_PROJECT_OPERATION_URL = exports.API_PROJECT_ROBOT_GAMEPAD_URL = exports.API_PROJECT_ROBOT_TRIGGER_URL = exports.API_PROJECT_ROBOT_BUTTON_URL = exports.API_PROJECT_ROBOT_COMMAND2_URL = exports.API_PROJECT_ROBOT_COMMAND_URL = exports.API_PROJECT_ROBOT_AGENT_URL = exports.API_PROJECT_ROBOT_SETTING_URL = exports.API_PROJECT_ROBOT_EVENT_HISTORY_URL = exports.API_PROJECT_ROBOT_EVENT_URL = exports.API_PROJECT_ROBOT_REGISTER_URL = exports.API_PROJECT_ROBOT_DEFINITION_URL = void 0;
5
+ exports.API_TARGETs_MEDIA_URL = exports.API_TARGETS_URL = exports.API_DEVICE_CREDENTIALS_AUTH_URL = exports.API_DEVICE_CREDENTIALS_URL = exports.API_LINKED_PROJECT_URL = exports.API_PROJECT_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_WORKFLOW_ASSET_URL = exports.API_PROJECT_WORKFLOW_ID_URL = exports.API_PROJECT_WORKFLOW_URL = exports.API_OBSERVATION_KEYS_URL = exports.API_OBSERVATIONS_URL = exports.API_MAPS_PANORAMA_OBSERVATIONS_URL = exports.API_MAPS_GEOJSON_URL = exports.API_MAPS_DEPLOY_URL = exports.API_MAPS_COPY_URL = exports.API_MAP_ID_URL = exports.API_MAPS_MERGE_URL = exports.API_MAPS_DEPLOYED_URL = exports.API_MAPS_URL = exports.API_DD_INTEGRATION_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 = 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';
@@ -33,6 +33,7 @@ exports.API_ACCOUNT_PROJECT_USER_URL = 'https://{url}/accounts/{accountId}/proje
33
33
  exports.API_ACCOUNT_PROJECT_USER_ID_URL = 'https://{url}/accounts/{accountId}/projects/{projectId}/users/{userId}';
34
34
  exports.API_ACCOUNT_PROJECT_APPLICATION_URL = 'https://{url}/accounts/{accountId}/projects/{projectId}/applications';
35
35
  exports.API_ACCOUNT_PROJECT_APPLICATION_ID_URL = 'https://{url}/accounts/{accountId}/projects/{projectId}/applications/{applicationId}';
36
+ exports.API_ACCOUNT_EXTERNAL_PROJECTS_URL = 'https://{url}/accounts/{accountId}/external-projects';
36
37
  exports.API_PROJECT_URL = 'https://{url}/projects';
37
38
  exports.API_PROJECT_ID_URL = 'https://{url}/projects/{projectId}';
38
39
  exports.API_PROJECT_USERS_URL = 'https://{url}/projects/{projectId}/users';
@@ -141,3 +142,4 @@ exports.API_LINKED_PROJECT_URL = 'https://{url}/linked-projects/{linkedProjectId
141
142
  exports.API_DEVICE_CREDENTIALS_URL = 'https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials';
142
143
  exports.API_DEVICE_CREDENTIALS_AUTH_URL = 'https://{url}/device-credentials/auth';
143
144
  exports.API_TARGETS_URL = 'https://{url}/projects/{projectId}/targets';
145
+ exports.API_TARGETs_MEDIA_URL = 'https://{url}/projects/{projectId}/targets/{targetId}/media';
@@ -35,6 +35,8 @@ export * from './integrations/PaginatedResults';
35
35
  export * from './maps/Map';
36
36
  export * from './maps/Panorama';
37
37
  export * from './projects/ProjectUser';
38
+ export * from './projects/ExternalProject';
39
+ export * from './projects/NewProjectRequest';
38
40
  export * from './target/Target';
39
41
  export * from './ExportDataQuery';
40
42
  export * from './HttpError';
@@ -51,6 +51,8 @@ __exportStar(require("./integrations/PaginatedResults"), exports);
51
51
  __exportStar(require("./maps/Map"), exports);
52
52
  __exportStar(require("./maps/Panorama"), exports);
53
53
  __exportStar(require("./projects/ProjectUser"), exports);
54
+ __exportStar(require("./projects/ExternalProject"), exports);
55
+ __exportStar(require("./projects/NewProjectRequest"), exports);
54
56
  __exportStar(require("./target/Target"), exports);
55
57
  __exportStar(require("./ExportDataQuery"), exports);
56
58
  __exportStar(require("./HttpError"), exports);
@@ -0,0 +1,10 @@
1
+ export interface ExternalProject {
2
+ id: string;
3
+ name: string;
4
+ isLinked: boolean;
5
+ createdAt?: number;
6
+ location?: {
7
+ lng: number;
8
+ lat: number;
9
+ };
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export interface NewProjectRequest {
2
+ accountId: string;
3
+ projectName: string;
4
+ description?: string;
5
+ linkedProjectId?: string;
6
+ lat?: number;
7
+ lng?: number;
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -37,8 +37,7 @@ export interface Target {
37
37
  */
38
38
  media?: TargetMedia[];
39
39
  }
40
- type TargetMedia = {
40
+ export interface TargetMedia {
41
41
  id: string;
42
42
  data: Record<string, string>;
43
- };
44
- export {};
43
+ }
@@ -1,4 +1,4 @@
1
- import { IBaseService, IOperation, IProject, IProjectInfo, IRocosSDKConfig, ProjectUser, RocosError } from '../models';
1
+ import { ExternalProject, IBaseService, IOperation, IProject, IProjectInfo, IRocosSDKConfig, NewProjectRequest, ProjectUser, RocosError } from '../models';
2
2
  import { BaseServiceAbstract } from './BaseServiceAbstract';
3
3
  export declare class ProjectService extends BaseServiceAbstract implements IBaseService {
4
4
  constructor(config: IRocosSDKConfig);
@@ -57,7 +57,7 @@ export declare class ProjectService extends BaseServiceAbstract implements IBase
57
57
  * @param templateId - Template Id, From back-end responses
58
58
  * @param body - Optional parameters
59
59
  */
60
- createProjectByTemplate(templateId: string, body?: any): Promise<any>;
60
+ createProjectByTemplate(templateId: string, body?: NewProjectRequest): Promise<void>;
61
61
  /**
62
62
  * Operations related functions
63
63
  */
@@ -103,4 +103,9 @@ export declare class ProjectService extends BaseServiceAbstract implements IBase
103
103
  */
104
104
  listUsers(projectId: string): Promise<ProjectUser[]>;
105
105
  getProjectByLinkedProjectId(linkedProjectId: string): Promise<IProject>;
106
+ /**
107
+ * List external projects
108
+ * @returns Returns list of DroneDeploy projects with their location and linked state
109
+ */
110
+ listExternalProjects(accountId: string): Promise<ExternalProject[]>;
106
111
  }
@@ -93,9 +93,6 @@ class ProjectService extends BaseServiceAbstract_1.BaseServiceAbstract {
93
93
  * @param templateId - Template Id, From back-end responses
94
94
  * @param body - Optional parameters
95
95
  */
96
- // TODO: map the request model
97
- // TODO: map the response object
98
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
99
96
  async createProjectByTemplate(templateId, body) {
100
97
  return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_TEMPLATE_PROVISION_ID_URL, { url: this.config.url, templateId }, this.config.insecure), body, `Failed to create project template for ${templateId}.`);
101
98
  }
@@ -163,5 +160,12 @@ class ProjectService extends BaseServiceAbstract_1.BaseServiceAbstract {
163
160
  async getProjectByLinkedProjectId(linkedProjectId) {
164
161
  return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_LINKED_PROJECT_URL, { url: this.config.url, linkedProjectId }, this.config.insecure), `Failed to get project info for linked project ID: ${linkedProjectId}.`);
165
162
  }
163
+ /**
164
+ * List external projects
165
+ * @returns Returns list of DroneDeploy projects with their location and linked state
166
+ */
167
+ async listExternalProjects(accountId) {
168
+ return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_ACCOUNT_EXTERNAL_PROJECTS_URL, { url: this.config.url, accountId }, this.config.insecure), 'Failed to get external project list.');
169
+ }
166
170
  }
167
171
  exports.ProjectService = ProjectService;
@@ -1,4 +1,4 @@
1
- import { IBaseService, IRocosSDKConfig, RocosError, Target } from '../models';
1
+ import { IBaseService, IRocosSDKConfig, RocosError, Target, TargetMedia } from '../models';
2
2
  import { BaseServiceAbstract } from './BaseServiceAbstract';
3
3
  /**
4
4
  * Service for managing targets (such as assets, PoI's, or FLOCS) on DroneDeploy
@@ -8,4 +8,6 @@ export declare class TargetService extends BaseServiceAbstract implements IBaseS
8
8
  getStatus(): boolean;
9
9
  protected getError(e: Error): RocosError;
10
10
  list(projectId: string, frameID?: string): Promise<Target[]>;
11
+ getMedia(projectId: string, targetId: string): Promise<Target>;
12
+ addMedia(projectId: string, targetId: string, media: TargetMedia): Promise<void>;
11
13
  }
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TargetService = void 0;
4
- const models_1 = require("../models");
5
4
  const api_1 = require("../constants/api");
5
+ const models_1 = require("../models");
6
6
  const BaseServiceAbstract_1 = require("./BaseServiceAbstract");
7
7
  const RocosLogger_1 = require("../logger/RocosLogger");
8
8
  const formatServiceUrl_1 = require("../helpers/formatServiceUrl");
@@ -27,5 +27,20 @@ class TargetService extends BaseServiceAbstract_1.BaseServiceAbstract {
27
27
  }, this.config.insecure), 'Failed to list targets', { frameID });
28
28
  return resp;
29
29
  }
30
+ async getMedia(projectId, targetId) {
31
+ const resp = await this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_TARGETs_MEDIA_URL, {
32
+ url: this.config.url,
33
+ projectId,
34
+ targetId,
35
+ }, this.config.insecure), 'Failed to get target media');
36
+ return resp;
37
+ }
38
+ async addMedia(projectId, targetId, media) {
39
+ await this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_TARGETS_URL, {
40
+ url: this.config.url,
41
+ projectId,
42
+ targetId,
43
+ }, this.config.insecure), media, 'Failed to add media to a target');
44
+ }
30
45
  }
31
46
  exports.TargetService = TargetService;
@@ -28,6 +28,7 @@ export declare const API_ACCOUNT_PROJECT_USER_URL = "https://{url}/accounts/{acc
28
28
  export declare const API_ACCOUNT_PROJECT_USER_ID_URL = "https://{url}/accounts/{accountId}/projects/{projectId}/users/{userId}";
29
29
  export declare const API_ACCOUNT_PROJECT_APPLICATION_URL = "https://{url}/accounts/{accountId}/projects/{projectId}/applications";
30
30
  export declare const API_ACCOUNT_PROJECT_APPLICATION_ID_URL = "https://{url}/accounts/{accountId}/projects/{projectId}/applications/{applicationId}";
31
+ export declare const API_ACCOUNT_EXTERNAL_PROJECTS_URL = "https://{url}/accounts/{accountId}/external-projects";
31
32
  export declare const API_PROJECT_URL = "https://{url}/projects";
32
33
  export declare const API_PROJECT_ID_URL = "https://{url}/projects/{projectId}";
33
34
  export declare const API_PROJECT_USERS_URL = "https://{url}/projects/{projectId}/users";
@@ -136,3 +137,4 @@ export declare const API_LINKED_PROJECT_URL = "https://{url}/linked-projects/{li
136
137
  export declare const API_DEVICE_CREDENTIALS_URL = "https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials";
137
138
  export declare const API_DEVICE_CREDENTIALS_AUTH_URL = "https://{url}/device-credentials/auth";
138
139
  export declare const API_TARGETS_URL = "https://{url}/projects/{projectId}/targets";
140
+ export declare const API_TARGETs_MEDIA_URL = "https://{url}/projects/{projectId}/targets/{targetId}/media";
@@ -28,6 +28,7 @@ export const API_ACCOUNT_PROJECT_USER_URL = 'https://{url}/accounts/{accountId}/
28
28
  export const API_ACCOUNT_PROJECT_USER_ID_URL = 'https://{url}/accounts/{accountId}/projects/{projectId}/users/{userId}';
29
29
  export const API_ACCOUNT_PROJECT_APPLICATION_URL = 'https://{url}/accounts/{accountId}/projects/{projectId}/applications';
30
30
  export const API_ACCOUNT_PROJECT_APPLICATION_ID_URL = 'https://{url}/accounts/{accountId}/projects/{projectId}/applications/{applicationId}';
31
+ export const API_ACCOUNT_EXTERNAL_PROJECTS_URL = 'https://{url}/accounts/{accountId}/external-projects';
31
32
  export const API_PROJECT_URL = 'https://{url}/projects';
32
33
  export const API_PROJECT_ID_URL = 'https://{url}/projects/{projectId}';
33
34
  export const API_PROJECT_USERS_URL = 'https://{url}/projects/{projectId}/users';
@@ -136,3 +137,4 @@ export const API_LINKED_PROJECT_URL = 'https://{url}/linked-projects/{linkedProj
136
137
  export const API_DEVICE_CREDENTIALS_URL = 'https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials';
137
138
  export const API_DEVICE_CREDENTIALS_AUTH_URL = 'https://{url}/device-credentials/auth';
138
139
  export const API_TARGETS_URL = 'https://{url}/projects/{projectId}/targets';
140
+ export const API_TARGETs_MEDIA_URL = 'https://{url}/projects/{projectId}/targets/{targetId}/media';
@@ -35,6 +35,8 @@ export * from './integrations/PaginatedResults';
35
35
  export * from './maps/Map';
36
36
  export * from './maps/Panorama';
37
37
  export * from './projects/ProjectUser';
38
+ export * from './projects/ExternalProject';
39
+ export * from './projects/NewProjectRequest';
38
40
  export * from './target/Target';
39
41
  export * from './ExportDataQuery';
40
42
  export * from './HttpError';
@@ -35,6 +35,8 @@ export * from './integrations/PaginatedResults';
35
35
  export * from './maps/Map';
36
36
  export * from './maps/Panorama';
37
37
  export * from './projects/ProjectUser';
38
+ export * from './projects/ExternalProject';
39
+ export * from './projects/NewProjectRequest';
38
40
  export * from './target/Target';
39
41
  export * from './ExportDataQuery';
40
42
  export * from './HttpError';
@@ -0,0 +1,10 @@
1
+ export interface ExternalProject {
2
+ id: string;
3
+ name: string;
4
+ isLinked: boolean;
5
+ createdAt?: number;
6
+ location?: {
7
+ lng: number;
8
+ lat: number;
9
+ };
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface NewProjectRequest {
2
+ accountId: string;
3
+ projectName: string;
4
+ description?: string;
5
+ linkedProjectId?: string;
6
+ lat?: number;
7
+ lng?: number;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -37,8 +37,7 @@ export interface Target {
37
37
  */
38
38
  media?: TargetMedia[];
39
39
  }
40
- type TargetMedia = {
40
+ export interface TargetMedia {
41
41
  id: string;
42
42
  data: Record<string, string>;
43
- };
44
- export {};
43
+ }
@@ -1,4 +1,4 @@
1
- import { IBaseService, IOperation, IProject, IProjectInfo, IRocosSDKConfig, ProjectUser, RocosError } from '../models';
1
+ import { ExternalProject, IBaseService, IOperation, IProject, IProjectInfo, IRocosSDKConfig, NewProjectRequest, ProjectUser, RocosError } from '../models';
2
2
  import { BaseServiceAbstract } from './BaseServiceAbstract';
3
3
  export declare class ProjectService extends BaseServiceAbstract implements IBaseService {
4
4
  constructor(config: IRocosSDKConfig);
@@ -57,7 +57,7 @@ export declare class ProjectService extends BaseServiceAbstract implements IBase
57
57
  * @param templateId - Template Id, From back-end responses
58
58
  * @param body - Optional parameters
59
59
  */
60
- createProjectByTemplate(templateId: string, body?: any): Promise<any>;
60
+ createProjectByTemplate(templateId: string, body?: NewProjectRequest): Promise<void>;
61
61
  /**
62
62
  * Operations related functions
63
63
  */
@@ -103,4 +103,9 @@ export declare class ProjectService extends BaseServiceAbstract implements IBase
103
103
  */
104
104
  listUsers(projectId: string): Promise<ProjectUser[]>;
105
105
  getProjectByLinkedProjectId(linkedProjectId: string): Promise<IProject>;
106
+ /**
107
+ * List external projects
108
+ * @returns Returns list of DroneDeploy projects with their location and linked state
109
+ */
110
+ listExternalProjects(accountId: string): Promise<ExternalProject[]>;
106
111
  }
@@ -1,5 +1,5 @@
1
- import { API_ACCOUNT_PROJECT_ID_URL, API_ACCOUNT_PROJECT_URL, API_LINKED_PROJECT_URL, API_PROJECT_ID_URL, API_PROJECT_OPERATION_ID_URL, API_PROJECT_OPERATION_URL, API_PROJECT_URL, API_PROJECT_USERS_URL, API_TEMPLATE_PROVISION_ID_URL, API_TEMPLATE_PROVISION_URL, } from '../constants/api';
2
- import { errorCodes, RocosError, } from '../models';
1
+ import { API_ACCOUNT_EXTERNAL_PROJECTS_URL, API_ACCOUNT_PROJECT_ID_URL, API_ACCOUNT_PROJECT_URL, API_LINKED_PROJECT_URL, API_PROJECT_ID_URL, API_PROJECT_OPERATION_ID_URL, API_PROJECT_OPERATION_URL, API_PROJECT_URL, API_PROJECT_USERS_URL, API_TEMPLATE_PROVISION_ID_URL, API_TEMPLATE_PROVISION_URL, } from '../constants/api';
2
+ import { RocosError, errorCodes, } from '../models';
3
3
  import { BaseServiceAbstract } from './BaseServiceAbstract';
4
4
  import { RocosLogger } from '../logger/RocosLogger';
5
5
  import { formatServiceUrl } from '../helpers/formatServiceUrl';
@@ -90,9 +90,6 @@ export class ProjectService extends BaseServiceAbstract {
90
90
  * @param templateId - Template Id, From back-end responses
91
91
  * @param body - Optional parameters
92
92
  */
93
- // TODO: map the request model
94
- // TODO: map the response object
95
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
96
93
  async createProjectByTemplate(templateId, body) {
97
94
  return this.callPost(formatServiceUrl(API_TEMPLATE_PROVISION_ID_URL, { url: this.config.url, templateId }, this.config.insecure), body, `Failed to create project template for ${templateId}.`);
98
95
  }
@@ -160,4 +157,11 @@ export class ProjectService extends BaseServiceAbstract {
160
157
  async getProjectByLinkedProjectId(linkedProjectId) {
161
158
  return this.callGet(formatServiceUrl(API_LINKED_PROJECT_URL, { url: this.config.url, linkedProjectId }, this.config.insecure), `Failed to get project info for linked project ID: ${linkedProjectId}.`);
162
159
  }
160
+ /**
161
+ * List external projects
162
+ * @returns Returns list of DroneDeploy projects with their location and linked state
163
+ */
164
+ async listExternalProjects(accountId) {
165
+ return this.callGet(formatServiceUrl(API_ACCOUNT_EXTERNAL_PROJECTS_URL, { url: this.config.url, accountId }, this.config.insecure), 'Failed to get external project list.');
166
+ }
163
167
  }
@@ -1,4 +1,4 @@
1
- import { IBaseService, IRocosSDKConfig, RocosError, Target } from '../models';
1
+ import { IBaseService, IRocosSDKConfig, RocosError, Target, TargetMedia } from '../models';
2
2
  import { BaseServiceAbstract } from './BaseServiceAbstract';
3
3
  /**
4
4
  * Service for managing targets (such as assets, PoI's, or FLOCS) on DroneDeploy
@@ -8,4 +8,6 @@ export declare class TargetService extends BaseServiceAbstract implements IBaseS
8
8
  getStatus(): boolean;
9
9
  protected getError(e: Error): RocosError;
10
10
  list(projectId: string, frameID?: string): Promise<Target[]>;
11
+ getMedia(projectId: string, targetId: string): Promise<Target>;
12
+ addMedia(projectId: string, targetId: string, media: TargetMedia): Promise<void>;
11
13
  }
@@ -1,5 +1,5 @@
1
+ import { API_TARGETS_URL, API_TARGETs_MEDIA_URL } from '../constants/api';
1
2
  import { RocosError, errorCodes } from '../models';
2
- import { API_TARGETS_URL } from '../constants/api';
3
3
  import { BaseServiceAbstract } from './BaseServiceAbstract';
4
4
  import { RocosLogger } from '../logger/RocosLogger';
5
5
  import { formatServiceUrl } from '../helpers/formatServiceUrl';
@@ -24,4 +24,19 @@ export class TargetService extends BaseServiceAbstract {
24
24
  }, this.config.insecure), 'Failed to list targets', { frameID });
25
25
  return resp;
26
26
  }
27
+ async getMedia(projectId, targetId) {
28
+ const resp = await this.callGet(formatServiceUrl(API_TARGETs_MEDIA_URL, {
29
+ url: this.config.url,
30
+ projectId,
31
+ targetId,
32
+ }, this.config.insecure), 'Failed to get target media');
33
+ return resp;
34
+ }
35
+ async addMedia(projectId, targetId, media) {
36
+ await this.callPost(formatServiceUrl(API_TARGETS_URL, {
37
+ url: this.config.url,
38
+ projectId,
39
+ targetId,
40
+ }, this.config.insecure), media, 'Failed to add media to a target');
41
+ }
27
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dronedeploy/rocos-js-sdk",
3
- "version": "3.0.1-alpha.28",
3
+ "version": "3.0.1-alpha.29",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -1,6 +0,0 @@
1
- export declare class ExternalProject {
2
- id?: string;
3
- name?: string;
4
- createdAt?: number;
5
- isLinked?: boolean;
6
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExternalProject = void 0;
4
- class ExternalProject {
5
- }
6
- exports.ExternalProject = ExternalProject;
@@ -1,6 +0,0 @@
1
- export declare class ExternalProject {
2
- id?: string;
3
- name?: string;
4
- createdAt?: number;
5
- isLinked?: boolean;
6
- }
@@ -1,2 +0,0 @@
1
- export class ExternalProject {
2
- }