@dronedeploy/rocos-js-sdk 3.0.1-alpha.30 → 3.0.1-alpha.32
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/constants/api.d.ts +3 -0
- package/cjs/constants/api.js +5 -2
- package/cjs/models/IConnectedCallsign.d.ts +10 -0
- package/cjs/models/IConnectedCallsign.js +8 -0
- package/cjs/models/index.d.ts +1 -0
- package/cjs/models/index.js +1 -0
- package/cjs/models/maps/Panorama.d.ts +1 -0
- package/cjs/models/target/Target.d.ts +4 -0
- package/cjs/services/DeviceCredentialsService.d.ts +1 -1
- package/cjs/services/DeviceCredentialsService.js +8 -2
- package/cjs/services/RobotService.d.ts +3 -1
- package/cjs/services/RobotService.js +6 -0
- package/cjs/services/TargetService.d.ts +4 -2
- package/cjs/services/TargetService.js +9 -1
- package/esm/constants/api.d.ts +3 -0
- package/esm/constants/api.js +3 -0
- package/esm/models/IConnectedCallsign.d.ts +10 -0
- package/esm/models/IConnectedCallsign.js +5 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/maps/Panorama.d.ts +1 -0
- package/esm/models/target/Target.d.ts +4 -0
- package/esm/services/DeviceCredentialsService.d.ts +1 -1
- package/esm/services/DeviceCredentialsService.js +8 -2
- package/esm/services/RobotService.d.ts +3 -1
- package/esm/services/RobotService.js +8 -2
- package/esm/services/TargetService.d.ts +4 -2
- package/esm/services/TargetService.js +10 -2
- package/package.json +1 -1
package/cjs/constants/api.d.ts
CHANGED
@@ -59,6 +59,8 @@ export declare const API_PROJECT_ROBOT_COMMAND2_URL = "https://{url}/projects/{p
|
|
59
59
|
export declare const API_PROJECT_ROBOT_BUTTON_URL = "https://{url}/projects/{projectId}/robots/{callsign}/buttons";
|
60
60
|
export declare const API_PROJECT_ROBOT_TRIGGER_URL = "https://{url}/projects/{projectId}/robots/{callsign}/triggers";
|
61
61
|
export declare const API_PROJECT_ROBOT_GAMEPAD_URL = "https://{url}/projects/{projectId}/robots/{callsign}/gamepads";
|
62
|
+
export declare const API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL = "https://{url}/robot-configs/connections/projects/{projectId}";
|
63
|
+
export declare const API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL = "https://{url}/robot-configs/connections/projects/{projectId}/callsigns/{callsign}";
|
62
64
|
export declare const API_PROJECT_OPERATION_URL = "https://{url}/projects/{projectId}/operations";
|
63
65
|
export declare const API_PROJECT_OPERATION_ID_URL = "https://{url}/projects/{projectId}/operations/{operationId}";
|
64
66
|
export declare const API_PROJECT_DASHBOARD_URL = "https://{url}/projects/{projectId}/dashboards";
|
@@ -138,3 +140,4 @@ export declare const API_DEVICE_CREDENTIALS_URL = "https://{url}/projects/{proje
|
|
138
140
|
export declare const API_DEVICE_CREDENTIALS_AUTH_URL = "https://{url}/device-credentials/auth";
|
139
141
|
export declare const API_TARGETS_URL = "https://{url}/projects/{projectId}/targets";
|
140
142
|
export declare const API_TARGETs_MEDIA_URL = "https://{url}/projects/{projectId}/targets/{targetId}/media";
|
143
|
+
export declare const API_ASSETS_URL = "https://{url}/projects/{projectId}/assets";
|
package/cjs/constants/api.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.API_PROJECT_ROBOT_ATTRIBUTES_URL = exports.API_PROJECT_ROBOT_ID_URL = exports.API_PROJECT_ROBOT_URL = exports.API_PROJECT_MAPPED_ASSET_PATH_URL = exports.API_PROJECT_MAPPED_ASSETS_PATH_URL = exports.API_PROJECT_MISSION_ASSET_PATH_URL = exports.API_PROJECT_MISSION_ASSETS_PATH_URL = exports.API_PROJECT_FLOW_ASSET_PATH_URL = exports.API_PROJECT_ROBOT_ASSET_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATION_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATIONS_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATION_PROVIDERS_PATH_URL = exports.API_PROJECT_ASSET_PROFILES_SYNC_DEFINITION_PATH_URL = exports.API_PROJECT_ASSET_ROBOTS_SYNC_DEFINITION_PATH_URL = exports.API_PROJECT_ASSET_PATH_URL = exports.API_PROJECT_ASSET_URL = exports.API_PROJECT_USERS_URL = exports.API_PROJECT_ID_URL = exports.API_PROJECT_URL = exports.API_ACCOUNT_EXTERNAL_PROJECTS_URL = exports.API_ACCOUNT_PROJECT_APPLICATION_ID_URL = exports.API_ACCOUNT_PROJECT_APPLICATION_URL = exports.API_ACCOUNT_PROJECT_USER_ID_URL = exports.API_ACCOUNT_PROJECT_USER_URL = exports.API_ACCOUNT_PROJECT_ID_URL = exports.API_ACCOUNT_PROJECT_URL = exports.API_SERVER_TIME_URL = exports.API_ACCOUNT_INTEGRATION_TYPE_URL = exports.API_ACCOUNT_INTEGRATION_URL = exports.API_ACCOUNT_SETTINGS_URL = exports.API_AUTH_USER_ACCOUNT_USER_ID_URL = exports.API_AUTH_USER_ACCOUNT_USER_URL = exports.API_ACCOUNT_ACTIVATE_URL = exports.API_ACCOUNT_ID_URL = exports.API_ACCOUNT_URL = exports.API_USER_PAT_TOKEN_URL = exports.API_USER_PAT_URL = exports.API_USER_VERIFY_EMAIL_URL = exports.API_USER_INVITATION_CHECK_URL = exports.API_USER_INVITATION_ACCEPT_URL = exports.API_USER_INVITATION_URL = exports.API_USER_PASSWORD_FORGOT_URL = exports.API_USER_PASSWORD_RESET_URL = exports.API_OTP_AUTH_URL = exports.API_OTP_URL = exports.API_USER_TOKEN_URL = exports.API_USER_AUTH_URL = exports.API_USER_URL = exports.API_ADMIN_USER_INVITATION_URL = exports.API_APPLICATION_AUTH_URL = void 0;
|
4
|
-
exports.
|
5
|
-
exports.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;
|
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_ASSETS_URL = 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 = 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';
|
@@ -64,6 +64,8 @@ exports.API_PROJECT_ROBOT_COMMAND2_URL = 'https://{url}/projects/{projectId}/rob
|
|
64
64
|
exports.API_PROJECT_ROBOT_BUTTON_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/buttons';
|
65
65
|
exports.API_PROJECT_ROBOT_TRIGGER_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/triggers';
|
66
66
|
exports.API_PROJECT_ROBOT_GAMEPAD_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/gamepads';
|
67
|
+
exports.API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL = 'https://{url}/robot-configs/connections/projects/{projectId}';
|
68
|
+
exports.API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL = 'https://{url}/robot-configs/connections/projects/{projectId}/callsigns/{callsign}';
|
67
69
|
exports.API_PROJECT_OPERATION_URL = 'https://{url}/projects/{projectId}/operations';
|
68
70
|
exports.API_PROJECT_OPERATION_ID_URL = 'https://{url}/projects/{projectId}/operations/{operationId}';
|
69
71
|
exports.API_PROJECT_DASHBOARD_URL = 'https://{url}/projects/{projectId}/dashboards';
|
@@ -143,3 +145,4 @@ exports.API_DEVICE_CREDENTIALS_URL = 'https://{url}/projects/{projectId}/callsig
|
|
143
145
|
exports.API_DEVICE_CREDENTIALS_AUTH_URL = 'https://{url}/device-credentials/auth';
|
144
146
|
exports.API_TARGETS_URL = 'https://{url}/projects/{projectId}/targets';
|
145
147
|
exports.API_TARGETs_MEDIA_URL = 'https://{url}/projects/{projectId}/targets/{targetId}/media';
|
148
|
+
exports.API_ASSETS_URL = 'https://{url}/projects/{projectId}/assets';
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ConnectionStatus = void 0;
|
4
|
+
var ConnectionStatus;
|
5
|
+
(function (ConnectionStatus) {
|
6
|
+
ConnectionStatus["CONNECTED"] = "CONNECTED";
|
7
|
+
ConnectionStatus["DISCONNECTED"] = "DISCONNECTED";
|
8
|
+
})(ConnectionStatus || (exports.ConnectionStatus = ConnectionStatus = {}));
|
package/cjs/models/index.d.ts
CHANGED
@@ -42,6 +42,7 @@ export * from './ExportDataQuery';
|
|
42
42
|
export * from './HttpError';
|
43
43
|
export * from './IBaseService';
|
44
44
|
export * from './IConfigGroup';
|
45
|
+
export * from './IConnectedCallsign';
|
45
46
|
export * from './IDebugLevel';
|
46
47
|
export * from './IExportDataQuery';
|
47
48
|
export * from './IFunctionConfig';
|
package/cjs/models/index.js
CHANGED
@@ -58,6 +58,7 @@ __exportStar(require("./ExportDataQuery"), exports);
|
|
58
58
|
__exportStar(require("./HttpError"), exports);
|
59
59
|
__exportStar(require("./IBaseService"), exports);
|
60
60
|
__exportStar(require("./IConfigGroup"), exports);
|
61
|
+
__exportStar(require("./IConnectedCallsign"), exports);
|
61
62
|
__exportStar(require("./IDebugLevel"), exports);
|
62
63
|
__exportStar(require("./IExportDataQuery"), exports);
|
63
64
|
__exportStar(require("./IFunctionConfig"), exports);
|
@@ -9,7 +9,7 @@ export declare class DeviceCredentialsService extends BaseServiceAbstract implem
|
|
9
9
|
getStatus(): boolean;
|
10
10
|
protected getError(e: Error): RocosError;
|
11
11
|
list(projectId: string, callsign: string): Promise<DeviceCredentials>;
|
12
|
-
create(projectId: string, callsign: string, credentials: DeviceCredentialCreate): Promise<DeviceCredentialCreate>;
|
12
|
+
create(projectId: string, callsign: string, credentials: DeviceCredentialCreate, disableValidation?: boolean): Promise<DeviceCredentialCreate>;
|
13
13
|
delete(projectId: string, callsign: string, component: string, system: string): Promise<void>;
|
14
14
|
auth(credentials: DeviceCredentialAuth): Promise<DeviceCredentialAuthResult>;
|
15
15
|
}
|
@@ -27,12 +27,18 @@ class DeviceCredentialsService extends BaseServiceAbstract_1.BaseServiceAbstract
|
|
27
27
|
callsign,
|
28
28
|
}, this.config.insecure), 'Failed to get device credentials.');
|
29
29
|
}
|
30
|
-
create(projectId, callsign, credentials) {
|
30
|
+
create(projectId, callsign, credentials, disableValidation = false) {
|
31
|
+
let queryParams;
|
32
|
+
if (disableValidation) {
|
33
|
+
queryParams = {
|
34
|
+
validate: false,
|
35
|
+
};
|
36
|
+
}
|
31
37
|
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_DEVICE_CREDENTIALS_URL, {
|
32
38
|
url: this.config.url,
|
33
39
|
projectId,
|
34
40
|
callsign,
|
35
|
-
}, this.config.insecure), credentials, 'Failed to create device credentials.');
|
41
|
+
}, this.config.insecure), credentials, 'Failed to create device credentials.', undefined, queryParams);
|
36
42
|
}
|
37
43
|
delete(projectId, callsign, component, system) {
|
38
44
|
return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_DEVICE_CREDENTIALS_URL, {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IBaseService, IRobot, IRobotSettings, IRobotTemplate, IRocosSDKConfig, RocosError } from '../models';
|
1
|
+
import { IBaseService, IConnectedCallsign, IRobot, IRobotSettings, IRobotTemplate, IRocosSDKConfig, RocosError } from '../models';
|
2
2
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
3
3
|
export declare class RobotService extends BaseServiceAbstract implements IBaseService {
|
4
4
|
constructor(config: IRocosSDKConfig);
|
@@ -275,4 +275,6 @@ export declare class RobotService extends BaseServiceAbstract implements IBaseSe
|
|
275
275
|
* @param model - \payload
|
276
276
|
*/
|
277
277
|
updateGamepads(projectId: string, callsign: string, model: any): Promise<any>;
|
278
|
+
getConnectedCallsigns(projectId: string): Promise<Map<string, IConnectedCallsign>>;
|
279
|
+
getConnectedCallsign(projectId: string, callsign: string): Promise<IConnectedCallsign>;
|
278
280
|
}
|
@@ -460,5 +460,11 @@ class RobotService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
460
460
|
async updateGamepads(projectId, callsign, model) {
|
461
461
|
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ROBOT_GAMEPAD_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), model, `Failed to update gamepads for ${projectId}, callsign ${callsign}.`);
|
462
462
|
}
|
463
|
+
async getConnectedCallsigns(projectId) {
|
464
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL, { url: this.config.url, projectId }, this.config.insecure), `Failed to get connected callsigns for ${projectId}.`);
|
465
|
+
}
|
466
|
+
async getConnectedCallsign(projectId, callsign) {
|
467
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), `Failed to get connected callsign for ${projectId}, callsign ${callsign}.`);
|
468
|
+
}
|
463
469
|
}
|
464
470
|
exports.RobotService = RobotService;
|
@@ -1,13 +1,15 @@
|
|
1
|
-
import { IBaseService, IRocosSDKConfig, RocosError, Target, TargetMedia } from '../models';
|
1
|
+
import { Asset, 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
|
5
5
|
*/
|
6
6
|
export declare class TargetService extends BaseServiceAbstract implements IBaseService {
|
7
|
+
list: (projectId: string, frameID?: string) => Promise<Target[]>;
|
7
8
|
constructor(config: IRocosSDKConfig);
|
8
9
|
getStatus(): boolean;
|
9
10
|
protected getError(e: Error): RocosError;
|
10
|
-
|
11
|
+
listTargets(projectId: string, frameID?: string): Promise<Target[]>;
|
12
|
+
listAssets(projectId: string, frameID?: string): Promise<Asset[]>;
|
11
13
|
getMedia(projectId: string, targetId: string): Promise<Target>;
|
12
14
|
addMedia(projectId: string, targetId: string, media: TargetMedia): Promise<void>;
|
13
15
|
}
|
@@ -13,6 +13,7 @@ class TargetService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
13
13
|
constructor(config) {
|
14
14
|
super(config);
|
15
15
|
this.logger = RocosLogger_1.RocosLogger.getInstance(`TargetService(${this.config.url})`);
|
16
|
+
this.list = this.listTargets;
|
16
17
|
}
|
17
18
|
getStatus() {
|
18
19
|
return true;
|
@@ -20,13 +21,20 @@ class TargetService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
20
21
|
getError(e) {
|
21
22
|
return new models_1.RocosError(e, models_1.errorCodes.TARGET_SERVICE_ERROR);
|
22
23
|
}
|
23
|
-
async
|
24
|
+
async listTargets(projectId, frameID = 'seed') {
|
24
25
|
const resp = await this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_TARGETS_URL, {
|
25
26
|
url: this.config.url,
|
26
27
|
projectId,
|
27
28
|
}, this.config.insecure), 'Failed to list targets', { frameID });
|
28
29
|
return resp;
|
29
30
|
}
|
31
|
+
async listAssets(projectId, frameID = 'seed') {
|
32
|
+
const resp = await this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_ASSETS_URL, {
|
33
|
+
url: this.config.url,
|
34
|
+
projectId,
|
35
|
+
}, this.config.insecure), 'Failed to list assets', { frameID });
|
36
|
+
return resp;
|
37
|
+
}
|
30
38
|
async getMedia(projectId, targetId) {
|
31
39
|
const resp = await this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_TARGETs_MEDIA_URL, {
|
32
40
|
url: this.config.url,
|
package/esm/constants/api.d.ts
CHANGED
@@ -59,6 +59,8 @@ export declare const API_PROJECT_ROBOT_COMMAND2_URL = "https://{url}/projects/{p
|
|
59
59
|
export declare const API_PROJECT_ROBOT_BUTTON_URL = "https://{url}/projects/{projectId}/robots/{callsign}/buttons";
|
60
60
|
export declare const API_PROJECT_ROBOT_TRIGGER_URL = "https://{url}/projects/{projectId}/robots/{callsign}/triggers";
|
61
61
|
export declare const API_PROJECT_ROBOT_GAMEPAD_URL = "https://{url}/projects/{projectId}/robots/{callsign}/gamepads";
|
62
|
+
export declare const API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL = "https://{url}/robot-configs/connections/projects/{projectId}";
|
63
|
+
export declare const API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL = "https://{url}/robot-configs/connections/projects/{projectId}/callsigns/{callsign}";
|
62
64
|
export declare const API_PROJECT_OPERATION_URL = "https://{url}/projects/{projectId}/operations";
|
63
65
|
export declare const API_PROJECT_OPERATION_ID_URL = "https://{url}/projects/{projectId}/operations/{operationId}";
|
64
66
|
export declare const API_PROJECT_DASHBOARD_URL = "https://{url}/projects/{projectId}/dashboards";
|
@@ -138,3 +140,4 @@ export declare const API_DEVICE_CREDENTIALS_URL = "https://{url}/projects/{proje
|
|
138
140
|
export declare const API_DEVICE_CREDENTIALS_AUTH_URL = "https://{url}/device-credentials/auth";
|
139
141
|
export declare const API_TARGETS_URL = "https://{url}/projects/{projectId}/targets";
|
140
142
|
export declare const API_TARGETs_MEDIA_URL = "https://{url}/projects/{projectId}/targets/{targetId}/media";
|
143
|
+
export declare const API_ASSETS_URL = "https://{url}/projects/{projectId}/assets";
|
package/esm/constants/api.js
CHANGED
@@ -59,6 +59,8 @@ export const API_PROJECT_ROBOT_COMMAND2_URL = 'https://{url}/projects/{projectId
|
|
59
59
|
export const API_PROJECT_ROBOT_BUTTON_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/buttons';
|
60
60
|
export const API_PROJECT_ROBOT_TRIGGER_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/triggers';
|
61
61
|
export const API_PROJECT_ROBOT_GAMEPAD_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/gamepads';
|
62
|
+
export const API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL = 'https://{url}/robot-configs/connections/projects/{projectId}';
|
63
|
+
export const API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL = 'https://{url}/robot-configs/connections/projects/{projectId}/callsigns/{callsign}';
|
62
64
|
export const API_PROJECT_OPERATION_URL = 'https://{url}/projects/{projectId}/operations';
|
63
65
|
export const API_PROJECT_OPERATION_ID_URL = 'https://{url}/projects/{projectId}/operations/{operationId}';
|
64
66
|
export const API_PROJECT_DASHBOARD_URL = 'https://{url}/projects/{projectId}/dashboards';
|
@@ -138,3 +140,4 @@ export const API_DEVICE_CREDENTIALS_URL = 'https://{url}/projects/{projectId}/ca
|
|
138
140
|
export const API_DEVICE_CREDENTIALS_AUTH_URL = 'https://{url}/device-credentials/auth';
|
139
141
|
export const API_TARGETS_URL = 'https://{url}/projects/{projectId}/targets';
|
140
142
|
export const API_TARGETs_MEDIA_URL = 'https://{url}/projects/{projectId}/targets/{targetId}/media';
|
143
|
+
export const API_ASSETS_URL = 'https://{url}/projects/{projectId}/assets';
|
package/esm/models/index.d.ts
CHANGED
@@ -42,6 +42,7 @@ export * from './ExportDataQuery';
|
|
42
42
|
export * from './HttpError';
|
43
43
|
export * from './IBaseService';
|
44
44
|
export * from './IConfigGroup';
|
45
|
+
export * from './IConnectedCallsign';
|
45
46
|
export * from './IDebugLevel';
|
46
47
|
export * from './IExportDataQuery';
|
47
48
|
export * from './IFunctionConfig';
|
package/esm/models/index.js
CHANGED
@@ -42,6 +42,7 @@ export * from './ExportDataQuery';
|
|
42
42
|
export * from './HttpError';
|
43
43
|
export * from './IBaseService';
|
44
44
|
export * from './IConfigGroup';
|
45
|
+
export * from './IConnectedCallsign';
|
45
46
|
export * from './IDebugLevel';
|
46
47
|
export * from './IExportDataQuery';
|
47
48
|
export * from './IFunctionConfig';
|
@@ -9,7 +9,7 @@ export declare class DeviceCredentialsService extends BaseServiceAbstract implem
|
|
9
9
|
getStatus(): boolean;
|
10
10
|
protected getError(e: Error): RocosError;
|
11
11
|
list(projectId: string, callsign: string): Promise<DeviceCredentials>;
|
12
|
-
create(projectId: string, callsign: string, credentials: DeviceCredentialCreate): Promise<DeviceCredentialCreate>;
|
12
|
+
create(projectId: string, callsign: string, credentials: DeviceCredentialCreate, disableValidation?: boolean): Promise<DeviceCredentialCreate>;
|
13
13
|
delete(projectId: string, callsign: string, component: string, system: string): Promise<void>;
|
14
14
|
auth(credentials: DeviceCredentialAuth): Promise<DeviceCredentialAuthResult>;
|
15
15
|
}
|
@@ -24,12 +24,18 @@ export class DeviceCredentialsService extends BaseServiceAbstract {
|
|
24
24
|
callsign,
|
25
25
|
}, this.config.insecure), 'Failed to get device credentials.');
|
26
26
|
}
|
27
|
-
create(projectId, callsign, credentials) {
|
27
|
+
create(projectId, callsign, credentials, disableValidation = false) {
|
28
|
+
let queryParams;
|
29
|
+
if (disableValidation) {
|
30
|
+
queryParams = {
|
31
|
+
validate: false,
|
32
|
+
};
|
33
|
+
}
|
28
34
|
return this.callPost(formatServiceUrl(API_DEVICE_CREDENTIALS_URL, {
|
29
35
|
url: this.config.url,
|
30
36
|
projectId,
|
31
37
|
callsign,
|
32
|
-
}, this.config.insecure), credentials, 'Failed to create device credentials.');
|
38
|
+
}, this.config.insecure), credentials, 'Failed to create device credentials.', undefined, queryParams);
|
33
39
|
}
|
34
40
|
delete(projectId, callsign, component, system) {
|
35
41
|
return this.callDelete(formatServiceUrl(API_DEVICE_CREDENTIALS_URL, {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IBaseService, IRobot, IRobotSettings, IRobotTemplate, IRocosSDKConfig, RocosError } from '../models';
|
1
|
+
import { IBaseService, IConnectedCallsign, IRobot, IRobotSettings, IRobotTemplate, IRocosSDKConfig, RocosError } from '../models';
|
2
2
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
3
3
|
export declare class RobotService extends BaseServiceAbstract implements IBaseService {
|
4
4
|
constructor(config: IRocosSDKConfig);
|
@@ -275,4 +275,6 @@ export declare class RobotService extends BaseServiceAbstract implements IBaseSe
|
|
275
275
|
* @param model - \payload
|
276
276
|
*/
|
277
277
|
updateGamepads(projectId: string, callsign: string, model: any): Promise<any>;
|
278
|
+
getConnectedCallsigns(projectId: string): Promise<Map<string, IConnectedCallsign>>;
|
279
|
+
getConnectedCallsign(projectId: string, callsign: string): Promise<IConnectedCallsign>;
|
278
280
|
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { API_PROJECT_PROFILE_DASHBOARD_CUSTOM_WIDGET_URL, API_PROJECT_PROFILE_DASHBOARD_ID_URL, API_PROJECT_PROFILE_DASHBOARD_URL, API_PROJECT_ROBOT_AGENT_URL, API_PROJECT_ROBOT_ATTRIBUTES_URL, API_PROJECT_ROBOT_BUTTON_URL, API_PROJECT_ROBOT_COMMAND2_URL, API_PROJECT_ROBOT_COMMAND_URL, API_PROJECT_ROBOT_DASHBOARD_CUSTOM_WIDGET_URL, API_PROJECT_ROBOT_DASHBOARD_ID_URL, API_PROJECT_ROBOT_DASHBOARD_URL, API_PROJECT_ROBOT_GAMEPAD_URL, API_PROJECT_ROBOT_ID_URL, API_PROJECT_ROBOT_REGISTER_URL, API_PROJECT_ROBOT_SETTING_URL, API_PROJECT_ROBOT_TRIGGER_URL, API_PROJECT_ROBOT_URL, API_PROJECT_VROBOT_DEPLOY_URL, API_PROJECT_VROBOT_DETAILS_URL, API_SOURCE_SCHEMA_URL, API_TEMPLATE_DEPLOY_URL, } from '../constants/api';
|
2
|
-
import {
|
1
|
+
import { API_PROJECT_PROFILE_DASHBOARD_CUSTOM_WIDGET_URL, API_PROJECT_PROFILE_DASHBOARD_ID_URL, API_PROJECT_PROFILE_DASHBOARD_URL, API_PROJECT_ROBOT_AGENT_URL, API_PROJECT_ROBOT_ATTRIBUTES_URL, API_PROJECT_ROBOT_BUTTON_URL, API_PROJECT_ROBOT_COMMAND2_URL, API_PROJECT_ROBOT_COMMAND_URL, API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL, API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL, API_PROJECT_ROBOT_DASHBOARD_CUSTOM_WIDGET_URL, API_PROJECT_ROBOT_DASHBOARD_ID_URL, API_PROJECT_ROBOT_DASHBOARD_URL, API_PROJECT_ROBOT_GAMEPAD_URL, API_PROJECT_ROBOT_ID_URL, API_PROJECT_ROBOT_REGISTER_URL, API_PROJECT_ROBOT_SETTING_URL, API_PROJECT_ROBOT_TRIGGER_URL, API_PROJECT_ROBOT_URL, API_PROJECT_VROBOT_DEPLOY_URL, API_PROJECT_VROBOT_DETAILS_URL, API_SOURCE_SCHEMA_URL, API_TEMPLATE_DEPLOY_URL, } from '../constants/api';
|
2
|
+
import { Robot, RobotTemplate, RocosError, errorCodes, } from '../models';
|
3
3
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
4
4
|
import { RocosLogger } from '../logger/RocosLogger';
|
5
5
|
import { cleanObject } from '../helpers/cleanObject';
|
@@ -457,4 +457,10 @@ export class RobotService extends BaseServiceAbstract {
|
|
457
457
|
async updateGamepads(projectId, callsign, model) {
|
458
458
|
return this.callPost(formatServiceUrl(API_PROJECT_ROBOT_GAMEPAD_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), model, `Failed to update gamepads for ${projectId}, callsign ${callsign}.`);
|
459
459
|
}
|
460
|
+
async getConnectedCallsigns(projectId) {
|
461
|
+
return this.callGet(formatServiceUrl(API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL, { url: this.config.url, projectId }, this.config.insecure), `Failed to get connected callsigns for ${projectId}.`);
|
462
|
+
}
|
463
|
+
async getConnectedCallsign(projectId, callsign) {
|
464
|
+
return this.callGet(formatServiceUrl(API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), `Failed to get connected callsign for ${projectId}, callsign ${callsign}.`);
|
465
|
+
}
|
460
466
|
}
|
@@ -1,13 +1,15 @@
|
|
1
|
-
import { IBaseService, IRocosSDKConfig, RocosError, Target, TargetMedia } from '../models';
|
1
|
+
import { Asset, 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
|
5
5
|
*/
|
6
6
|
export declare class TargetService extends BaseServiceAbstract implements IBaseService {
|
7
|
+
list: (projectId: string, frameID?: string) => Promise<Target[]>;
|
7
8
|
constructor(config: IRocosSDKConfig);
|
8
9
|
getStatus(): boolean;
|
9
10
|
protected getError(e: Error): RocosError;
|
10
|
-
|
11
|
+
listTargets(projectId: string, frameID?: string): Promise<Target[]>;
|
12
|
+
listAssets(projectId: string, frameID?: string): Promise<Asset[]>;
|
11
13
|
getMedia(projectId: string, targetId: string): Promise<Target>;
|
12
14
|
addMedia(projectId: string, targetId: string, media: TargetMedia): Promise<void>;
|
13
15
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { API_TARGETS_URL, API_TARGETs_MEDIA_URL } from '../constants/api';
|
1
|
+
import { API_ASSETS_URL, API_TARGETS_URL, API_TARGETs_MEDIA_URL } from '../constants/api';
|
2
2
|
import { RocosError, errorCodes } from '../models';
|
3
3
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
4
4
|
import { RocosLogger } from '../logger/RocosLogger';
|
@@ -10,6 +10,7 @@ export class TargetService extends BaseServiceAbstract {
|
|
10
10
|
constructor(config) {
|
11
11
|
super(config);
|
12
12
|
this.logger = RocosLogger.getInstance(`TargetService(${this.config.url})`);
|
13
|
+
this.list = this.listTargets;
|
13
14
|
}
|
14
15
|
getStatus() {
|
15
16
|
return true;
|
@@ -17,13 +18,20 @@ export class TargetService extends BaseServiceAbstract {
|
|
17
18
|
getError(e) {
|
18
19
|
return new RocosError(e, errorCodes.TARGET_SERVICE_ERROR);
|
19
20
|
}
|
20
|
-
async
|
21
|
+
async listTargets(projectId, frameID = 'seed') {
|
21
22
|
const resp = await this.callGet(formatServiceUrl(API_TARGETS_URL, {
|
22
23
|
url: this.config.url,
|
23
24
|
projectId,
|
24
25
|
}, this.config.insecure), 'Failed to list targets', { frameID });
|
25
26
|
return resp;
|
26
27
|
}
|
28
|
+
async listAssets(projectId, frameID = 'seed') {
|
29
|
+
const resp = await this.callGet(formatServiceUrl(API_ASSETS_URL, {
|
30
|
+
url: this.config.url,
|
31
|
+
projectId,
|
32
|
+
}, this.config.insecure), 'Failed to list assets', { frameID });
|
33
|
+
return resp;
|
34
|
+
}
|
27
35
|
async getMedia(projectId, targetId) {
|
28
36
|
const resp = await this.callGet(formatServiceUrl(API_TARGETs_MEDIA_URL, {
|
29
37
|
url: this.config.url,
|