@dronedeploy/rocos-js-sdk 3.0.1-alpha.30 → 3.0.1-alpha.31
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/constants/api.d.ts +2 -0
- package/cjs/constants/api.js +4 -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/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/esm/constants/api.d.ts +2 -0
- package/esm/constants/api.js +2 -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/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/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";
|
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_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';
|
@@ -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;
|
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";
|
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';
|
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
|
}
|