@dronedeploy/rocos-js-sdk 3.0.1-alpha.23 → 3.0.1-alpha.25
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/helpers/cleanObject.js +4 -1
- package/cjs/services/AssetStorageService.d.ts +2 -2
- package/cjs/services/AssetStorageService.js +3 -3
- package/esm/helpers/cleanObject.js +4 -1
- package/esm/services/AssetStorageService.d.ts +2 -2
- package/esm/services/AssetStorageService.js +3 -3
- package/package.json +1 -1
@@ -5,7 +5,10 @@ const cleanObject = (object) => {
|
|
5
5
|
return {
|
6
6
|
...(function _flatten(o) {
|
7
7
|
return [...Object.entries(o)].reduce((obj, [key, val]) => {
|
8
|
-
if (
|
8
|
+
if (val === null) {
|
9
|
+
obj[key] = val;
|
10
|
+
}
|
11
|
+
else if (typeof val === 'object') {
|
9
12
|
obj[key] = _flatten(val);
|
10
13
|
}
|
11
14
|
else if (typeof val === 'function') {
|
@@ -82,9 +82,9 @@ export declare class AssetStorageService extends BaseServiceAbstract implements
|
|
82
82
|
* Get mapped asset
|
83
83
|
*
|
84
84
|
* @param projectId
|
85
|
-
* @param
|
85
|
+
* @param assetId
|
86
86
|
*/
|
87
|
-
getMappedAsset(projectId: string,
|
87
|
+
getMappedAsset(projectId: string, assetId: string): Promise<AssetItemWithObservationsModel>;
|
88
88
|
/**
|
89
89
|
* Set Robot Sync Definitions
|
90
90
|
* @param projectId
|
@@ -140,10 +140,10 @@ class AssetStorageService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
140
140
|
* Get mapped asset
|
141
141
|
*
|
142
142
|
* @param projectId
|
143
|
-
* @param
|
143
|
+
* @param assetId
|
144
144
|
*/
|
145
|
-
async getMappedAsset(projectId,
|
146
|
-
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_MAPPED_ASSET_PATH_URL, { url: this.config.url, projectId,
|
145
|
+
async getMappedAsset(projectId, assetId) {
|
146
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_MAPPED_ASSET_PATH_URL, { url: this.config.url, projectId, assetId }, this.config.insecure), `Failed to get mapped asset for ${projectId} and id: ${assetId}.`);
|
147
147
|
}
|
148
148
|
/**
|
149
149
|
* Set Robot Sync Definitions
|
@@ -2,7 +2,10 @@ export const cleanObject = (object) => {
|
|
2
2
|
return {
|
3
3
|
...(function _flatten(o) {
|
4
4
|
return [...Object.entries(o)].reduce((obj, [key, val]) => {
|
5
|
-
if (
|
5
|
+
if (val === null) {
|
6
|
+
obj[key] = val;
|
7
|
+
}
|
8
|
+
else if (typeof val === 'object') {
|
6
9
|
obj[key] = _flatten(val);
|
7
10
|
}
|
8
11
|
else if (typeof val === 'function') {
|
@@ -82,9 +82,9 @@ export declare class AssetStorageService extends BaseServiceAbstract implements
|
|
82
82
|
* Get mapped asset
|
83
83
|
*
|
84
84
|
* @param projectId
|
85
|
-
* @param
|
85
|
+
* @param assetId
|
86
86
|
*/
|
87
|
-
getMappedAsset(projectId: string,
|
87
|
+
getMappedAsset(projectId: string, assetId: string): Promise<AssetItemWithObservationsModel>;
|
88
88
|
/**
|
89
89
|
* Set Robot Sync Definitions
|
90
90
|
* @param projectId
|
@@ -137,10 +137,10 @@ export class AssetStorageService extends BaseServiceAbstract {
|
|
137
137
|
* Get mapped asset
|
138
138
|
*
|
139
139
|
* @param projectId
|
140
|
-
* @param
|
140
|
+
* @param assetId
|
141
141
|
*/
|
142
|
-
async getMappedAsset(projectId,
|
143
|
-
return this.callGet(formatServiceUrl(API_PROJECT_MAPPED_ASSET_PATH_URL, { url: this.config.url, projectId,
|
142
|
+
async getMappedAsset(projectId, assetId) {
|
143
|
+
return this.callGet(formatServiceUrl(API_PROJECT_MAPPED_ASSET_PATH_URL, { url: this.config.url, projectId, assetId }, this.config.insecure), `Failed to get mapped asset for ${projectId} and id: ${assetId}.`);
|
144
144
|
}
|
145
145
|
/**
|
146
146
|
* Set Robot Sync Definitions
|