@here/olp-sdk-dataservice-read 2.0.0 → 3.1.0
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/README.md +3 -3
- package/bundle.umd.dev.js +12548 -76
- package/bundle.umd.min.js +1 -1
- package/index.js +5 -1
- package/index.web.js +5 -1
- package/lib/cache/MetadataCacheRepository.js +1 -0
- package/lib/cache/QuadTreeIndexCacheRepository.js +1 -0
- package/lib/cache/index.js +5 -1
- package/lib/client/ArtifactClient.d.ts +2 -1
- package/lib/client/ArtifactClient.js +31 -43
- package/lib/client/CatalogClient.d.ts +3 -1
- package/lib/client/CatalogClient.js +59 -78
- package/lib/client/CatalogRequest.js +4 -3
- package/lib/client/CatalogVersionRequest.js +6 -3
- package/lib/client/CatalogsRequest.js +5 -3
- package/lib/client/ConfigClient.d.ts +1 -1
- package/lib/client/ConfigClient.js +13 -23
- package/lib/client/DataRequest.js +7 -6
- package/lib/client/IndexLayerClient.d.ts +1 -1
- package/lib/client/IndexLayerClient.js +37 -40
- package/lib/client/IndexQueryRequest.js +2 -0
- package/lib/client/LayerVersionsRequest.js +5 -3
- package/lib/client/PartitionsRequest.js +10 -7
- package/lib/client/PollRequest.js +2 -0
- package/lib/client/QuadKeyPartitionsRequest.d.ts +1 -1
- package/lib/client/QuadKeyPartitionsRequest.js +7 -3
- package/lib/client/QuadTreeIndexRequest.d.ts +1 -1
- package/lib/client/QuadTreeIndexRequest.js +11 -3
- package/lib/client/QueryClient.d.ts +2 -1
- package/lib/client/QueryClient.js +85 -96
- package/lib/client/SchemaDetailsRequest.js +5 -3
- package/lib/client/SchemaRequest.js +5 -3
- package/lib/client/SeekRequest.js +3 -0
- package/lib/client/StatisticsClient.d.ts +2 -1
- package/lib/client/StatisticsClient.js +51 -65
- package/lib/client/StatisticsRequest.js +9 -4
- package/lib/client/StreamLayerClient.d.ts +4 -1
- package/lib/client/StreamLayerClient.js +117 -139
- package/lib/client/SubscribeRequest.js +4 -0
- package/lib/client/SummaryRequest.js +5 -2
- package/lib/client/TileRequest.js +6 -6
- package/lib/client/UnsubscribeRequest.js +2 -0
- package/lib/client/VersionedLayerClient.d.ts +45 -1
- package/lib/client/VersionedLayerClient.js +133 -147
- package/lib/client/VolatileLayerClient.d.ts +4 -1
- package/lib/client/VolatileLayerClient.js +104 -108
- package/lib/client/index.js +5 -1
- package/lib/index.js +5 -1
- package/lib/utils/getTile.d.ts +37 -1
- package/lib/utils/getTile.js +121 -132
- package/lib/utils/index.js +5 -1
- package/lib/utils/validateBillingTag.js +1 -2
- package/lib/utils/validatePartitionsIdsList.js +1 -2
- package/package.json +11 -55
- package/webpack.config.js +2 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (C) 2020 HERE Europe B.V.
|
|
3
|
+
* Copyright (C) 2020-2026 HERE Europe B.V.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -17,15 +17,6 @@
|
|
|
17
17
|
* SPDX-License-Identifier: Apache-2.0
|
|
18
18
|
* License-Filename: LICENSE
|
|
19
19
|
*/
|
|
20
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
24
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
25
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
26
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
21
|
exports.IndexLayerClient = void 0;
|
|
31
22
|
const olp_sdk_core_1 = require("@here/olp-sdk-core");
|
|
@@ -34,13 +25,25 @@ const olp_sdk_dataservice_api_1 = require("@here/olp-sdk-dataservice-api");
|
|
|
34
25
|
* Describes a index layer and provides the possibility to get partitions metadata and data.
|
|
35
26
|
*/
|
|
36
27
|
class IndexLayerClient {
|
|
28
|
+
apiVersion = "v1";
|
|
29
|
+
/**
|
|
30
|
+
* HRN of the catalog.
|
|
31
|
+
*/
|
|
32
|
+
hrn;
|
|
33
|
+
/**
|
|
34
|
+
* The ID of the layer.
|
|
35
|
+
*/
|
|
36
|
+
layerId;
|
|
37
|
+
/**
|
|
38
|
+
* The [[OlpClientSettings]] instance.
|
|
39
|
+
*/
|
|
40
|
+
settings;
|
|
37
41
|
/**
|
|
38
42
|
* Creates the [[IndexLayerClient]] instance with IndexLayerClientParams.
|
|
39
43
|
*
|
|
40
44
|
* @param params parameters for use to initialize IndexLayerClient.
|
|
41
45
|
*/
|
|
42
46
|
constructor(params) {
|
|
43
|
-
this.apiVersion = "v1";
|
|
44
47
|
this.hrn = params.catalogHrn.toString();
|
|
45
48
|
this.layerId = params.layerId;
|
|
46
49
|
this.settings = params.settings;
|
|
@@ -56,22 +59,20 @@ class IndexLayerClient {
|
|
|
56
59
|
*
|
|
57
60
|
* @returns A list of metadata for each of the partitions from the requested layer.
|
|
58
61
|
*/
|
|
59
|
-
getPartitions(request, abortSignal) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
huge: request.getHugeResponse()
|
|
70
|
-
}).catch(err => Promise.reject(err));
|
|
71
|
-
return indexMetadata.data
|
|
72
|
-
? Promise.resolve(indexMetadata.data)
|
|
73
|
-
: Promise.reject(indexMetadata.error);
|
|
62
|
+
async getPartitions(request, abortSignal) {
|
|
63
|
+
const query = request.getQueryString();
|
|
64
|
+
if (!query) {
|
|
65
|
+
return Promise.reject(new Error("Please provide correct query"));
|
|
66
|
+
}
|
|
67
|
+
const requestBuilder = await this.getRequestBuilder("index", olp_sdk_core_1.HRN.fromString(this.hrn), abortSignal);
|
|
68
|
+
const indexMetadata = await olp_sdk_dataservice_api_1.IndexApi.performQuery(requestBuilder, {
|
|
69
|
+
layerID: this.layerId,
|
|
70
|
+
query,
|
|
71
|
+
huge: request.getHugeResponse()
|
|
74
72
|
});
|
|
73
|
+
return indexMetadata.data
|
|
74
|
+
? Promise.resolve(indexMetadata.data)
|
|
75
|
+
: Promise.reject(indexMetadata.error);
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
77
78
|
* Fetches partition data using data handle.
|
|
@@ -84,16 +85,14 @@ class IndexLayerClient {
|
|
|
84
85
|
*
|
|
85
86
|
* @return The data from the requested partition.
|
|
86
87
|
*/
|
|
87
|
-
getData(model, abortSignal) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
layerId: this.layerId
|
|
96
|
-
});
|
|
88
|
+
async getData(model, abortSignal) {
|
|
89
|
+
if (!model.id) {
|
|
90
|
+
return Promise.reject(new Error("No data handle for this partition"));
|
|
91
|
+
}
|
|
92
|
+
const builder = await this.getRequestBuilder("blob", olp_sdk_core_1.HRN.fromString(this.hrn), abortSignal);
|
|
93
|
+
return olp_sdk_dataservice_api_1.BlobApi.getBlob(builder, {
|
|
94
|
+
dataHandle: model.id,
|
|
95
|
+
layerId: this.layerId
|
|
97
96
|
});
|
|
98
97
|
}
|
|
99
98
|
/**
|
|
@@ -102,10 +101,8 @@ class IndexLayerClient {
|
|
|
102
101
|
*
|
|
103
102
|
* @returns requestBuilder
|
|
104
103
|
*/
|
|
105
|
-
getRequestBuilder(builderType, hrn, abortSignal) {
|
|
106
|
-
return
|
|
107
|
-
return olp_sdk_core_1.RequestFactory.create(builderType, this.apiVersion, this.settings, hrn, abortSignal).catch(err => Promise.reject(err));
|
|
108
|
-
});
|
|
104
|
+
async getRequestBuilder(builderType, hrn, abortSignal) {
|
|
105
|
+
return olp_sdk_core_1.RequestFactory.create(builderType, this.apiVersion, this.settings, hrn, abortSignal);
|
|
109
106
|
}
|
|
110
107
|
}
|
|
111
108
|
exports.IndexLayerClient = IndexLayerClient;
|
|
@@ -23,6 +23,8 @@ exports.IndexQueryRequest = void 0;
|
|
|
23
23
|
* Prepares information for calls to get partitions metadata from the platform Index Service.
|
|
24
24
|
*/
|
|
25
25
|
class IndexQueryRequest {
|
|
26
|
+
queryString;
|
|
27
|
+
isHugeResponse;
|
|
26
28
|
/**
|
|
27
29
|
* @param query An RSQL query to use to retrieve partitions that match the query.
|
|
28
30
|
* The query must use the indexing attributes defined in the index layer.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (C) 2020 HERE Europe B.V.
|
|
3
|
+
* Copyright (C) 2020-2026 HERE Europe B.V.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -19,9 +19,11 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.LayerVersionsRequest = void 0;
|
|
22
|
-
const
|
|
22
|
+
const validateBillingTag_1 = require("../utils/validateBillingTag");
|
|
23
23
|
/** Prepares information for calls to get layer versions of a specific catalog version. */
|
|
24
24
|
class LayerVersionsRequest {
|
|
25
|
+
version;
|
|
26
|
+
billingTag;
|
|
25
27
|
/**
|
|
26
28
|
* Gets a catalog version.
|
|
27
29
|
*
|
|
@@ -57,7 +59,7 @@ class LayerVersionsRequest {
|
|
|
57
59
|
* If supplied, it must be 4–16 characters long and contain only alphanumeric ASCII characters [A–Za–z0–9].
|
|
58
60
|
*/
|
|
59
61
|
withBillingTag(tag) {
|
|
60
|
-
this.billingTag =
|
|
62
|
+
this.billingTag = (0, validateBillingTag_1.validateBillingTag)(tag);
|
|
61
63
|
return this;
|
|
62
64
|
}
|
|
63
65
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (C) 2019-
|
|
3
|
+
* Copyright (C) 2019-2026 HERE Europe B.V.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -20,14 +20,17 @@
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.PartitionsRequest = void 0;
|
|
22
22
|
const olp_sdk_core_1 = require("@here/olp-sdk-core");
|
|
23
|
-
const
|
|
23
|
+
const validateBillingTag_1 = require("../utils/validateBillingTag");
|
|
24
|
+
const validatePartitionsIdsList_1 = require("../utils/validatePartitionsIdsList");
|
|
24
25
|
/**
|
|
25
26
|
* Prepares information for calls to get partitions metadata from the Metadata Service API.
|
|
26
27
|
*/
|
|
27
28
|
class PartitionsRequest {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
version;
|
|
30
|
+
billingTag;
|
|
31
|
+
partitionIds;
|
|
32
|
+
additionalFields;
|
|
33
|
+
fetchOption = olp_sdk_core_1.FetchOptions.OnlineIfNotFound;
|
|
31
34
|
/**
|
|
32
35
|
* An optional free-form tag that is used for grouping billing records together.
|
|
33
36
|
*
|
|
@@ -37,7 +40,7 @@ class PartitionsRequest {
|
|
|
37
40
|
* @return The updated [[PartitionsRequest]] instance that you can use to chain methods.
|
|
38
41
|
*/
|
|
39
42
|
withBillingTag(tag) {
|
|
40
|
-
this.billingTag =
|
|
43
|
+
this.billingTag = (0, validateBillingTag_1.validateBillingTag)(tag);
|
|
41
44
|
return this;
|
|
42
45
|
}
|
|
43
46
|
/**
|
|
@@ -59,7 +62,7 @@ class PartitionsRequest {
|
|
|
59
62
|
* @returns The updated [[PartitionsRequest]] instance that you can use to chain methods.
|
|
60
63
|
*/
|
|
61
64
|
withPartitionIds(ids) {
|
|
62
|
-
this.partitionIds =
|
|
65
|
+
this.partitionIds = (0, validatePartitionsIdsList_1.validatePartitionsIdsList)(ids);
|
|
63
66
|
return this;
|
|
64
67
|
}
|
|
65
68
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AdditionalFields } from "@here/olp-sdk-dataservice-api";
|
|
2
2
|
import { QuadKey } from "@here/olp-sdk-core";
|
|
3
|
-
import { QuadTreeIndexDepth } from "
|
|
3
|
+
import { QuadTreeIndexDepth } from "./QuadTreeIndexRequest";
|
|
4
4
|
/**
|
|
5
5
|
* Prepares information for calls to get quadtree metadata from the Query Service API.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (C) 2019-
|
|
3
|
+
* Copyright (C) 2019-2026 HERE Europe B.V.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -19,13 +19,17 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.QuadKeyPartitionsRequest = void 0;
|
|
22
|
-
const
|
|
22
|
+
const validateBillingTag_1 = require("../utils/validateBillingTag");
|
|
23
23
|
/**
|
|
24
24
|
* Prepares information for calls to get quadtree metadata from the Query Service API.
|
|
25
25
|
*
|
|
26
26
|
* This class works only with versioned and volatile layers where the partitioning scheme is HERE Tile.
|
|
27
27
|
*/
|
|
28
28
|
class QuadKeyPartitionsRequest {
|
|
29
|
+
quadKey;
|
|
30
|
+
depth;
|
|
31
|
+
billingTag;
|
|
32
|
+
additionalFields;
|
|
29
33
|
/**
|
|
30
34
|
* A geometric area represented as a HERE tile.
|
|
31
35
|
*
|
|
@@ -59,7 +63,7 @@ class QuadKeyPartitionsRequest {
|
|
|
59
63
|
* @return The updated [[QuadKeyPartitionsRequest]] instance that you can use to chain methods.
|
|
60
64
|
*/
|
|
61
65
|
withBillingTag(tag) {
|
|
62
|
-
this.billingTag =
|
|
66
|
+
this.billingTag = (0, validateBillingTag_1.validateBillingTag)(tag);
|
|
63
67
|
return this;
|
|
64
68
|
}
|
|
65
69
|
/**
|
|
@@ -7,7 +7,7 @@ import { AdditionalFields } from "@here/olp-sdk-dataservice-api";
|
|
|
7
7
|
* In this way, depth describes the maximum length of the subQuadKeys in the response.
|
|
8
8
|
* The maximum allowed value for the depth parameter is 4.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type QuadTreeIndexDepth = 0 | 1 | 2 | 3 | 4;
|
|
11
11
|
/**
|
|
12
12
|
* Prepares information for calls to get quadtree metadata from the Query Service API.
|
|
13
13
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (C) 2019-
|
|
3
|
+
* Copyright (C) 2019-2026 HERE Europe B.V.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -19,13 +19,21 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.QuadTreeIndexRequest = void 0;
|
|
22
|
-
const
|
|
22
|
+
const validateBillingTag_1 = require("../utils/validateBillingTag");
|
|
23
23
|
/**
|
|
24
24
|
* Prepares information for calls to get quadtree metadata from the Query Service API.
|
|
25
25
|
*
|
|
26
26
|
* This class works only with versioned or volatile layers where the partitioning scheme is HERE Tile.
|
|
27
27
|
*/
|
|
28
28
|
class QuadTreeIndexRequest {
|
|
29
|
+
catalogHrn;
|
|
30
|
+
layerId;
|
|
31
|
+
layerType;
|
|
32
|
+
version;
|
|
33
|
+
quadKey;
|
|
34
|
+
depth;
|
|
35
|
+
billingTag;
|
|
36
|
+
additionalFields;
|
|
29
37
|
/**
|
|
30
38
|
* Constructs the [[QuadTreeIndexRequest]] instance for fetching the quadtree index from the Query Service API
|
|
31
39
|
* for volatile or versioned layers
|
|
@@ -84,7 +92,7 @@ class QuadTreeIndexRequest {
|
|
|
84
92
|
* @return The updated [[QuadTreeIndexRequest]] instance that you can use to chain methods.
|
|
85
93
|
*/
|
|
86
94
|
withBillingTag(tag) {
|
|
87
|
-
this.billingTag =
|
|
95
|
+
this.billingTag = (0, validateBillingTag_1.validateBillingTag)(tag);
|
|
88
96
|
return this;
|
|
89
97
|
}
|
|
90
98
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HRN, OlpClientSettings } from "@here/olp-sdk-core";
|
|
2
2
|
import { QueryApi } from "@here/olp-sdk-dataservice-api";
|
|
3
|
-
import { PartitionsRequest
|
|
3
|
+
import { PartitionsRequest } from "./PartitionsRequest";
|
|
4
|
+
import { QuadTreeIndexRequest } from "./QuadTreeIndexRequest";
|
|
4
5
|
/**
|
|
5
6
|
* A client for the Query Service API that provides a way to get information (metadata)
|
|
6
7
|
* about layers and partitions stored in a catalog.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (C) 2019-
|
|
3
|
+
* Copyright (C) 2019-2026 HERE Europe B.V.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -17,26 +17,19 @@
|
|
|
17
17
|
* SPDX-License-Identifier: Apache-2.0
|
|
18
18
|
* License-Filename: LICENSE
|
|
19
19
|
*/
|
|
20
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
24
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
25
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
26
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
21
|
exports.QueryClient = void 0;
|
|
31
22
|
const olp_sdk_core_1 = require("@here/olp-sdk-core");
|
|
32
23
|
const olp_sdk_dataservice_api_1 = require("@here/olp-sdk-dataservice-api");
|
|
33
|
-
const
|
|
24
|
+
const MetadataCacheRepository_1 = require("../cache/MetadataCacheRepository");
|
|
34
25
|
/**
|
|
35
26
|
* A client for the Query Service API that provides a way to get information (metadata)
|
|
36
27
|
* about layers and partitions stored in a catalog.
|
|
37
28
|
* This service exposes the metadata for a single partition that you can query one by one or using a parent tile.
|
|
38
29
|
*/
|
|
39
30
|
class QueryClient {
|
|
31
|
+
settings;
|
|
32
|
+
apiVersion = "v1";
|
|
40
33
|
/**
|
|
41
34
|
* Constructs a new client for the Query Service API.
|
|
42
35
|
*
|
|
@@ -45,7 +38,6 @@ class QueryClient {
|
|
|
45
38
|
*/
|
|
46
39
|
constructor(settings) {
|
|
47
40
|
this.settings = settings;
|
|
48
|
-
this.apiVersion = "v1";
|
|
49
41
|
}
|
|
50
42
|
/**
|
|
51
43
|
* Fetches the quadtree index.
|
|
@@ -58,47 +50,48 @@ class QueryClient {
|
|
|
58
50
|
*
|
|
59
51
|
* @return The quadtree index object.
|
|
60
52
|
*/
|
|
61
|
-
fetchQuadTreeIndex(request, abortSignal) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
53
|
+
async fetchQuadTreeIndex(request, abortSignal) {
|
|
54
|
+
const quadKey = request.getQuadKey();
|
|
55
|
+
const layerId = request.getLayerId();
|
|
56
|
+
if (!quadKey || !olp_sdk_core_1.TileKey.isValid(quadKey)) {
|
|
57
|
+
return Promise.reject("Please provide correct QuadKey");
|
|
58
|
+
}
|
|
59
|
+
if (!layerId) {
|
|
60
|
+
return Promise.reject("Please provide correct Id of the Layer");
|
|
61
|
+
}
|
|
62
|
+
let catalogVersion = request.getVersion();
|
|
63
|
+
if (request.getLayerType() === "versioned" &&
|
|
64
|
+
catalogVersion === undefined) {
|
|
65
|
+
catalogVersion = await this.getCatalogLatestVersion(request.getCatalogHrn(), abortSignal, request.getBillingTag()).catch((error) => Promise.reject(`Error getting the last catalog version: ${error}`));
|
|
66
|
+
}
|
|
67
|
+
if (request.getLayerType() === "versioned" &&
|
|
68
|
+
catalogVersion === undefined) {
|
|
69
|
+
return Promise.reject(`Please provide correct catalog version`);
|
|
70
|
+
}
|
|
71
|
+
const requestBuilder = await olp_sdk_core_1.RequestFactory.create("query", this.apiVersion, this.settings, request.getCatalogHrn(), abortSignal).catch((error) => Promise.reject(`Erorr creating request object for query service: ${error}`));
|
|
72
|
+
const subQuadKeysMaxLength = request.getDepth();
|
|
73
|
+
let fetchingQuadTreeIndexFunction;
|
|
74
|
+
let paramsForFetchQuadTreeIndex = {
|
|
75
|
+
version: 0,
|
|
76
|
+
layerId,
|
|
77
|
+
depth: subQuadKeysMaxLength,
|
|
78
|
+
quadKey: olp_sdk_core_1.TileKey.fromRowColumnLevel(quadKey.row, quadKey.column, quadKey.level)
|
|
79
|
+
.mortonCode()
|
|
80
|
+
.toString(),
|
|
81
|
+
billingTag: request.getBillingTag(),
|
|
82
|
+
additionalFields: request.getAdditionalFields()
|
|
83
|
+
};
|
|
84
|
+
if (request.getLayerType() === "volatile") {
|
|
85
|
+
fetchingQuadTreeIndexFunction = olp_sdk_dataservice_api_1.QueryApi.quadTreeIndexVolatile;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
fetchingQuadTreeIndexFunction = olp_sdk_dataservice_api_1.QueryApi.quadTreeIndex;
|
|
89
|
+
paramsForFetchQuadTreeIndex = {
|
|
90
|
+
...paramsForFetchQuadTreeIndex,
|
|
91
|
+
version: catalogVersion
|
|
92
92
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
fetchingQuadTreeIndexFunction = olp_sdk_dataservice_api_1.QueryApi.quadTreeIndex;
|
|
98
|
-
paramsForFetchQuadTreeIndex = Object.assign(Object.assign({}, paramsForFetchQuadTreeIndex), { version: catalogVersion });
|
|
99
|
-
}
|
|
100
|
-
return fetchingQuadTreeIndexFunction(requestBuilder, paramsForFetchQuadTreeIndex);
|
|
101
|
-
});
|
|
93
|
+
}
|
|
94
|
+
return fetchingQuadTreeIndexFunction(requestBuilder, paramsForFetchQuadTreeIndex);
|
|
102
95
|
}
|
|
103
96
|
/**
|
|
104
97
|
* Gets partitions using their IDs.
|
|
@@ -113,57 +106,53 @@ class QueryClient {
|
|
|
113
106
|
*
|
|
114
107
|
* @return The requested partitions.
|
|
115
108
|
*/
|
|
116
|
-
getPartitionsById(request, layerId, hrn, abortSignal, catalogVersion) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
const requestBuilder = yield olp_sdk_core_1.RequestFactory.create("query", this.apiVersion, this.settings, hrn, abortSignal).catch(error => Promise.reject(`Erorr creating request object for query service: ${error}`));
|
|
132
|
-
const medatada = yield olp_sdk_dataservice_api_1.QueryApi.getPartitionsById(requestBuilder, {
|
|
133
|
-
layerId,
|
|
134
|
-
partition: idsList,
|
|
135
|
-
additionalFields: request.getAdditionalFields(),
|
|
136
|
-
version: catalogVersion !== undefined ? `${catalogVersion}` : undefined
|
|
137
|
-
}).catch(err => Promise.reject(err));
|
|
138
|
-
if (request.getFetchOption() !== olp_sdk_core_1.FetchOptions.OnlineOnly &&
|
|
139
|
-
medatada &&
|
|
140
|
-
medatada.partitions &&
|
|
141
|
-
medatada.partitions.length) {
|
|
142
|
-
const partitions = medatada.partitions.map(partition => ({
|
|
143
|
-
checksum: partition.checksum,
|
|
144
|
-
compressedDataSize: partition.compressedDataSize,
|
|
145
|
-
dataHandle: partition.dataHandle || "",
|
|
146
|
-
dataSize: partition.dataSize,
|
|
147
|
-
partition: partition.partition,
|
|
148
|
-
version: partition.version
|
|
149
|
-
}));
|
|
150
|
-
cache.put(request, hrn.toString(), layerId, partitions, catalogVersion);
|
|
109
|
+
async getPartitionsById(request, layerId, hrn, abortSignal, catalogVersion) {
|
|
110
|
+
const idsList = request.getPartitionIds();
|
|
111
|
+
if (!idsList) {
|
|
112
|
+
return Promise.reject("Please provide correct partitionIds list");
|
|
113
|
+
}
|
|
114
|
+
const cache = new MetadataCacheRepository_1.MetadataCacheRepository(this.settings.cache);
|
|
115
|
+
if (request.getFetchOption() !== olp_sdk_core_1.FetchOptions.OnlineOnly) {
|
|
116
|
+
const cachedPartitions = cache.get(request, hrn.toString(), layerId, catalogVersion);
|
|
117
|
+
if (cachedPartitions) {
|
|
118
|
+
return Promise.resolve({
|
|
119
|
+
partitions: cachedPartitions
|
|
120
|
+
});
|
|
151
121
|
}
|
|
152
|
-
|
|
122
|
+
}
|
|
123
|
+
const requestBuilder = await olp_sdk_core_1.RequestFactory.create("query", this.apiVersion, this.settings, hrn, abortSignal).catch((error) => Promise.reject(`Erorr creating request object for query service: ${error}`));
|
|
124
|
+
const medatada = await olp_sdk_dataservice_api_1.QueryApi.getPartitionsById(requestBuilder, {
|
|
125
|
+
layerId,
|
|
126
|
+
partition: idsList,
|
|
127
|
+
additionalFields: request.getAdditionalFields(),
|
|
128
|
+
version: catalogVersion !== undefined ? `${catalogVersion}` : undefined
|
|
153
129
|
});
|
|
130
|
+
if (request.getFetchOption() !== olp_sdk_core_1.FetchOptions.OnlineOnly &&
|
|
131
|
+
medatada &&
|
|
132
|
+
medatada.partitions &&
|
|
133
|
+
medatada.partitions.length) {
|
|
134
|
+
const partitions = medatada.partitions.map((partition) => ({
|
|
135
|
+
checksum: partition.checksum,
|
|
136
|
+
compressedDataSize: partition.compressedDataSize,
|
|
137
|
+
dataHandle: partition.dataHandle || "",
|
|
138
|
+
dataSize: partition.dataSize,
|
|
139
|
+
partition: partition.partition,
|
|
140
|
+
version: partition.version
|
|
141
|
+
}));
|
|
142
|
+
cache.put(request, hrn.toString(), layerId, partitions, catalogVersion);
|
|
143
|
+
}
|
|
144
|
+
return Promise.resolve(medatada);
|
|
154
145
|
}
|
|
155
146
|
/**
|
|
156
147
|
* Gets the latest available catalog version
|
|
157
148
|
*/
|
|
158
|
-
getCatalogLatestVersion(catalogHrn, abortSignal, billingTag) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
billingTag
|
|
164
|
-
}).catch(error => Promise.reject(error));
|
|
165
|
-
return Promise.resolve(latestVersion.version);
|
|
149
|
+
async getCatalogLatestVersion(catalogHrn, abortSignal, billingTag) {
|
|
150
|
+
const request = await olp_sdk_core_1.RequestFactory.create("metadata", this.apiVersion, this.settings, catalogHrn, abortSignal).catch((error) => Promise.reject(`Erorr creating request object for metadata service: ${error}`));
|
|
151
|
+
const latestVersion = await olp_sdk_dataservice_api_1.MetadataApi.latestVersion(request, {
|
|
152
|
+
startVersion: -1,
|
|
153
|
+
billingTag
|
|
166
154
|
});
|
|
155
|
+
return Promise.resolve(latestVersion.version);
|
|
167
156
|
}
|
|
168
157
|
}
|
|
169
158
|
exports.QueryClient = QueryClient;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (C) 2019-
|
|
3
|
+
* Copyright (C) 2019-2026 HERE Europe B.V.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -19,11 +19,13 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.SchemaDetailsRequest = void 0;
|
|
22
|
-
const
|
|
22
|
+
const validateBillingTag_1 = require("../utils/validateBillingTag");
|
|
23
23
|
/**
|
|
24
24
|
* Prepares information for calls to the platform Artifact Service.
|
|
25
25
|
*/
|
|
26
26
|
class SchemaDetailsRequest {
|
|
27
|
+
schemaHrn;
|
|
28
|
+
billingTag;
|
|
27
29
|
/**
|
|
28
30
|
* Gets schema metadata for the request.
|
|
29
31
|
*
|
|
@@ -53,7 +55,7 @@ class SchemaDetailsRequest {
|
|
|
53
55
|
* @return The updated [[SchemaDetailsRequest]] instance that you can use to chain methods.
|
|
54
56
|
*/
|
|
55
57
|
withBillingTag(tag) {
|
|
56
|
-
this.billingTag =
|
|
58
|
+
this.billingTag = (0, validateBillingTag_1.validateBillingTag)(tag);
|
|
57
59
|
return this;
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (C) 2019 HERE Europe B.V.
|
|
3
|
+
* Copyright (C) 2019-2026 HERE Europe B.V.
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -19,11 +19,13 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.SchemaRequest = void 0;
|
|
22
|
-
const
|
|
22
|
+
const validateBillingTag_1 = require("../utils/validateBillingTag");
|
|
23
23
|
/**
|
|
24
24
|
* Prepares information for calls to the platform Artifact Service.
|
|
25
25
|
*/
|
|
26
26
|
class SchemaRequest {
|
|
27
|
+
variant;
|
|
28
|
+
billingTag;
|
|
27
29
|
/**
|
|
28
30
|
* Gets the `Variant` object of the schema for the request.
|
|
29
31
|
*
|
|
@@ -52,7 +54,7 @@ class SchemaRequest {
|
|
|
52
54
|
* @return The updated [[SchemaRequest]] instance that you can use to chain methods.
|
|
53
55
|
*/
|
|
54
56
|
withBillingTag(tag) {
|
|
55
|
-
this.billingTag =
|
|
57
|
+
this.billingTag = (0, validateBillingTag_1.validateBillingTag)(tag);
|
|
56
58
|
return this;
|
|
57
59
|
}
|
|
58
60
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OlpClientSettings } from "@here/olp-sdk-core";
|
|
2
2
|
import { CoverageApi } from "@here/olp-sdk-dataservice-api";
|
|
3
|
-
import { StatisticsRequest
|
|
3
|
+
import { StatisticsRequest } from "./StatisticsRequest";
|
|
4
|
+
import { SummaryRequest } from "./SummaryRequest";
|
|
4
5
|
/**
|
|
5
6
|
* A client for the platform Statistics Service.
|
|
6
7
|
*/
|