@dronedeploy/rocos-js-sdk 3.0.1-alpha.34 → 3.0.1-alpha.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/models/target/Target.d.ts +10 -12
- package/cjs/models/target/Target.js +13 -0
- package/cjs/services/TargetService.d.ts +3 -3
- package/esm/models/target/Target.d.ts +10 -12
- package/esm/models/target/Target.js +9 -1
- package/esm/services/TargetService.d.ts +3 -3
- package/esm/services/TargetService.js +1 -1
- package/package.json +1 -1
|
@@ -3,30 +3,28 @@ import { Vector3 } from '../graph/Vector3';
|
|
|
3
3
|
export interface TargetBase {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
|
-
}
|
|
7
|
-
export interface Target extends TargetBase {
|
|
8
6
|
data?: Record<string, string>;
|
|
9
7
|
translation?: Vector3;
|
|
10
8
|
rotation?: Quaternion;
|
|
11
9
|
media?: TargetMedia[];
|
|
12
|
-
|
|
13
|
-
* Media associated with the target (images)
|
|
14
|
-
*/
|
|
10
|
+
position?: TargetWgs84 | Vector3;
|
|
15
11
|
frame?: string;
|
|
16
12
|
}
|
|
17
13
|
export interface TargetMedia {
|
|
18
14
|
id: string;
|
|
19
15
|
data: Record<string, string>;
|
|
20
16
|
}
|
|
21
|
-
export interface
|
|
17
|
+
export interface TargetWgs84 {
|
|
22
18
|
lat: number;
|
|
23
19
|
lon: number;
|
|
24
20
|
alt?: number;
|
|
25
21
|
}
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
export declare const isTargetWgs84: (position: TargetWgs84 | Vector3) => position is TargetWgs84;
|
|
23
|
+
export interface Target extends TargetBase {
|
|
24
|
+
type: 'TARGET';
|
|
25
|
+
}
|
|
26
|
+
export declare const isTarget: (target: Target | Asset) => target is Target;
|
|
27
|
+
export interface Asset extends TargetBase {
|
|
28
|
+
type: 'ASSET';
|
|
30
29
|
}
|
|
31
|
-
export
|
|
32
|
-
export type CreateAsset = CreateTarget;
|
|
30
|
+
export declare const isAsset: (target: Target | Asset) => target is Asset;
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAsset = exports.isTarget = exports.isTargetWgs84 = void 0;
|
|
4
|
+
const isTargetWgs84 = (position) => {
|
|
5
|
+
return Boolean(position) && 'lat' in position && 'lon' in position;
|
|
6
|
+
};
|
|
7
|
+
exports.isTargetWgs84 = isTargetWgs84;
|
|
8
|
+
const isTarget = (target) => {
|
|
9
|
+
return target.type === 'TARGET';
|
|
10
|
+
};
|
|
11
|
+
exports.isTarget = isTarget;
|
|
12
|
+
const isAsset = (target) => {
|
|
13
|
+
return target.type === 'ASSET';
|
|
14
|
+
};
|
|
15
|
+
exports.isAsset = isAsset;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Asset,
|
|
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
|
|
@@ -8,9 +8,9 @@ export declare class TargetService extends BaseServiceAbstract implements IBaseS
|
|
|
8
8
|
constructor(config: IRocosSDKConfig);
|
|
9
9
|
getStatus(): boolean;
|
|
10
10
|
protected getError(e: Error): RocosError;
|
|
11
|
-
createTargets(projectId: string, targets:
|
|
11
|
+
createTargets(projectId: string, targets: Target[]): Promise<void>;
|
|
12
12
|
listTargets(projectId: string, frameID?: string): Promise<Target[]>;
|
|
13
|
-
createAssets(projectId: string, assets:
|
|
13
|
+
createAssets(projectId: string, assets: Asset[]): Promise<void>;
|
|
14
14
|
listAssets(projectId: string, frameID?: string): Promise<Asset[]>;
|
|
15
15
|
addMedia(projectId: string, targetId: string, media: TargetMedia): Promise<void>;
|
|
16
16
|
}
|
|
@@ -3,30 +3,28 @@ import { Vector3 } from '../graph/Vector3';
|
|
|
3
3
|
export interface TargetBase {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
|
-
}
|
|
7
|
-
export interface Target extends TargetBase {
|
|
8
6
|
data?: Record<string, string>;
|
|
9
7
|
translation?: Vector3;
|
|
10
8
|
rotation?: Quaternion;
|
|
11
9
|
media?: TargetMedia[];
|
|
12
|
-
|
|
13
|
-
* Media associated with the target (images)
|
|
14
|
-
*/
|
|
10
|
+
position?: TargetWgs84 | Vector3;
|
|
15
11
|
frame?: string;
|
|
16
12
|
}
|
|
17
13
|
export interface TargetMedia {
|
|
18
14
|
id: string;
|
|
19
15
|
data: Record<string, string>;
|
|
20
16
|
}
|
|
21
|
-
export interface
|
|
17
|
+
export interface TargetWgs84 {
|
|
22
18
|
lat: number;
|
|
23
19
|
lon: number;
|
|
24
20
|
alt?: number;
|
|
25
21
|
}
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
export declare const isTargetWgs84: (position: TargetWgs84 | Vector3) => position is TargetWgs84;
|
|
23
|
+
export interface Target extends TargetBase {
|
|
24
|
+
type: 'TARGET';
|
|
25
|
+
}
|
|
26
|
+
export declare const isTarget: (target: Target | Asset) => target is Target;
|
|
27
|
+
export interface Asset extends TargetBase {
|
|
28
|
+
type: 'ASSET';
|
|
30
29
|
}
|
|
31
|
-
export
|
|
32
|
-
export type CreateAsset = CreateTarget;
|
|
30
|
+
export declare const isAsset: (target: Target | Asset) => target is Asset;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export const isTargetWgs84 = (position) => {
|
|
2
|
+
return Boolean(position) && 'lat' in position && 'lon' in position;
|
|
3
|
+
};
|
|
4
|
+
export const isTarget = (target) => {
|
|
5
|
+
return target.type === 'TARGET';
|
|
6
|
+
};
|
|
7
|
+
export const isAsset = (target) => {
|
|
8
|
+
return target.type === 'ASSET';
|
|
9
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Asset,
|
|
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
|
|
@@ -8,9 +8,9 @@ export declare class TargetService extends BaseServiceAbstract implements IBaseS
|
|
|
8
8
|
constructor(config: IRocosSDKConfig);
|
|
9
9
|
getStatus(): boolean;
|
|
10
10
|
protected getError(e: Error): RocosError;
|
|
11
|
-
createTargets(projectId: string, targets:
|
|
11
|
+
createTargets(projectId: string, targets: Target[]): Promise<void>;
|
|
12
12
|
listTargets(projectId: string, frameID?: string): Promise<Target[]>;
|
|
13
|
-
createAssets(projectId: string, assets:
|
|
13
|
+
createAssets(projectId: string, assets: Asset[]): Promise<void>;
|
|
14
14
|
listAssets(projectId: string, frameID?: string): Promise<Asset[]>;
|
|
15
15
|
addMedia(projectId: string, targetId: string, media: TargetMedia): Promise<void>;
|
|
16
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { API_ASSETS_UPLOAD_URL, API_ASSETS_URL, API_TARGETS_URL, API_TARGET_UPLOAD_URL } from '../constants/api';
|
|
2
|
-
import { RocosError, errorCodes
|
|
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';
|