@here/olp-sdk-dataservice-read 1.12.2 → 1.13.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.
Files changed (40) hide show
  1. package/lib/client/ArtifactClient.d.ts +1 -1
  2. package/package.json +9 -6
  3. package/bundle.umd.dev.js +0 -13112
  4. package/bundle.umd.min.js +0 -1
  5. package/lib/cache/MetadataCacheRepository.js +0 -129
  6. package/lib/cache/QuadTreeIndexCacheRepository.js +0 -59
  7. package/lib/cache/index.js +0 -32
  8. package/lib/client/ArtifactClient.js +0 -96
  9. package/lib/client/CatalogClient.js +0 -206
  10. package/lib/client/CatalogRequest.js +0 -47
  11. package/lib/client/CatalogVersionRequest.js +0 -85
  12. package/lib/client/CatalogsRequest.js +0 -67
  13. package/lib/client/ConfigClient.js +0 -72
  14. package/lib/client/DataRequest.js +0 -115
  15. package/lib/client/IndexLayerClient.js +0 -111
  16. package/lib/client/IndexQueryRequest.js +0 -63
  17. package/lib/client/LayerVersionsRequest.js +0 -64
  18. package/lib/client/PartitionsRequest.js +0 -124
  19. package/lib/client/PollRequest.js +0 -63
  20. package/lib/client/QuadKeyPartitionsRequest.js +0 -110
  21. package/lib/client/QuadTreeIndexRequest.js +0 -168
  22. package/lib/client/QueryClient.js +0 -169
  23. package/lib/client/SchemaDetailsRequest.js +0 -68
  24. package/lib/client/SchemaRequest.js +0 -67
  25. package/lib/client/SeekRequest.js +0 -70
  26. package/lib/client/StatisticsClient.js +0 -127
  27. package/lib/client/StatisticsRequest.js +0 -134
  28. package/lib/client/StreamLayerClient.js +0 -252
  29. package/lib/client/SubscribeRequest.js +0 -101
  30. package/lib/client/SummaryRequest.js +0 -66
  31. package/lib/client/TileRequest.js +0 -118
  32. package/lib/client/UnsubscribeRequest.js +0 -63
  33. package/lib/client/VersionedLayerClient.js +0 -230
  34. package/lib/client/VolatileLayerClient.js +0 -194
  35. package/lib/client/index.js +0 -57
  36. package/lib/index.js +0 -33
  37. package/lib/utils/getTile.js +0 -166
  38. package/lib/utils/index.js +0 -33
  39. package/lib/utils/validateBillingTag.js +0 -37
  40. package/lib/utils/validatePartitionsIdsList.js +0 -38
@@ -1,96 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (C) 2019-2020 HERE Europe B.V.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- * SPDX-License-Identifier: Apache-2.0
18
- * License-Filename: LICENSE
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
- Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.ArtifactClient = void 0;
31
- const olp_sdk_core_1 = require("@here/olp-sdk-core");
32
- const olp_sdk_dataservice_api_1 = require("@here/olp-sdk-dataservice-api");
33
- /**
34
- * Gets schema metadata and data from the platform Artifact Service.
35
- */
36
- class ArtifactClient {
37
- /**
38
- * Constructs a new client to work with schemas data in the platform Artifact Service.
39
- *
40
- * @param settings The [[OlpClientSettings]] instance.
41
- * @return The [[ArtifactClient]] instance.
42
- */
43
- constructor(settings) {
44
- this.settings = settings;
45
- this.apiVersion = "v1";
46
- }
47
- /**
48
- * Gets schema metadata.
49
- *
50
- * @param schemaDetailsRequest The [[SchemaDetailsRequest]] instance.
51
- * @return An object with the schema metadata.
52
- */
53
- getSchemaDetails(schemaDetailsRequest) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- const hrn = schemaDetailsRequest.getSchema();
56
- if (!hrn) {
57
- return Promise.reject(new Error(`Please provide the schema HRN by schemaDetailsRequest.withSchema()`));
58
- }
59
- const hrnStr = hrn.toString();
60
- const request = yield olp_sdk_core_1.RequestFactory.create("artifact", this.apiVersion, this.settings).catch(error => Promise.reject(error));
61
- return olp_sdk_dataservice_api_1.ArtifactApi.getSchemaUsingGET(request, {
62
- schemaHrn: hrnStr
63
- }).catch(err => Promise.reject(err));
64
- });
65
- }
66
- /**
67
- * Gets schema data.
68
- *
69
- * @param schemaRequest The [[SchemaRequest]] instance.
70
- * @return A blob with the schema.
71
- */
72
- getSchema(schemaRequest) {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- const variant = schemaRequest.getVariant();
75
- if (!variant) {
76
- return Promise.reject(new Error(`Please provide the schema variant by schemaRequest.withVariant()`));
77
- }
78
- const request = yield olp_sdk_core_1.RequestFactory.create("artifact", this.apiVersion, this.settings).catch(error => Promise.reject(error));
79
- const response = yield olp_sdk_dataservice_api_1.ArtifactApi.getArtifactUsingGET(request, {
80
- artifactHrn: variant.url
81
- }).catch((error) => __awaiter(this, void 0, void 0, function* () {
82
- const messages = {
83
- 400: "Bad request",
84
- 401: "You are not authorized to view the schema",
85
- 403: "Accessing the schema is forbidden",
86
- 404: "The schema was not found",
87
- 500: "Internal server error"
88
- };
89
- const message = error.statusText || messages[error.status];
90
- return Promise.reject(new Error(`Artifact Service error: HTTP ${error.status}: ${message}`));
91
- }));
92
- return response.arrayBuffer();
93
- });
94
- }
95
- }
96
- exports.ArtifactClient = ArtifactClient;
@@ -1,206 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (C) 2019-2020 HERE Europe B.V.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- * SPDX-License-Identifier: Apache-2.0
18
- * License-Filename: LICENSE
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
- Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.CatalogClient = void 0;
31
- const olp_sdk_core_1 = require("@here/olp-sdk-core");
32
- const olp_sdk_dataservice_api_1 = require("@here/olp-sdk-dataservice-api");
33
- const olp_sdk_dataservice_read_1 = require("@here/olp-sdk-dataservice-read");
34
- /**
35
- * Interacts with the `DataStore` catalog.
36
- */
37
- class CatalogClient {
38
- /**
39
- * Constructs the [[CatalogClient]] instance.
40
- *
41
- * @param catalogHrn The HERE Resource Name (HRN) of the catalog.
42
- * @param settings The [[OlpClientSettings]] instance.
43
- * @return The [[CatalogClient]] instance.
44
- */
45
- constructor(catalogHrn, settings) {
46
- this.settings = settings;
47
- this.apiVersion = "v1";
48
- this.hrn = catalogHrn.toString();
49
- }
50
- /**
51
- * Loads and caches the full catalog configuration for the requested catalog.
52
- * The catalog configuration contains descriptive and structural
53
- * information such as layer definitions and layer types.
54
- *
55
- * @summary Gets details about the requested catalog.
56
- *
57
- * @param request The [[CatalogRequest]] instance that contains the configured request parameters.
58
- * @param abortSignal A signal object that allows you to communicate with a request (such as the `fetch` request)
59
- * and, if required, abort it using the `AbortController` object.
60
- *
61
- * For more information, see the [`AbortController` documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).
62
- *
63
- * @return The catalog metadata.
64
- */
65
- getCatalog(request, abortSignal) {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- const builder = yield this.getRequestBuilder("config", undefined, abortSignal);
68
- return olp_sdk_dataservice_api_1.ConfigApi.getCatalog(builder, {
69
- catalogHrn: this.hrn,
70
- billingTag: request.getBillingTag()
71
- }).catch(err => Promise.reject(err));
72
- });
73
- }
74
- /**
75
- * Returns minimum version for the given catalog. If the catalog doesn't contain any versions error will be returned.
76
- * @param request Is [[CatalogVersionRequest]] instance and has ((getBillingTag)) method.
77
- * @param abortSignal A signal object that allows you to communicate with a request (such as a Fetch)
78
- * and abort it if required via an AbortController object.
79
- * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
80
- * @returns A promise of the http response that contains the pminimum version for the given catalog.
81
- */
82
- getEarliestVersion(request, abortSignal) {
83
- return __awaiter(this, void 0, void 0, function* () {
84
- const builder = yield this.getRequestBuilder("metadata", olp_sdk_core_1.HRN.fromString(this.hrn), abortSignal).catch(error => Promise.reject(error));
85
- const earliestVersion = yield olp_sdk_dataservice_api_1.MetadataApi.minimumVersion(builder, {
86
- billingTag: request.getBillingTag()
87
- }).catch(err => Promise.reject(err));
88
- return Promise.resolve(earliestVersion.version);
89
- });
90
- }
91
- /**
92
- * Returns information about layer versions for the catalog version. It will return array with
93
- * all catalog layers and latest version for each layer or return error if the catalog does not
94
- * have any versions or if the version passed in the query parameter does not exist. If a layer
95
- * does not have any data for the requested version it is excluded from the response.
96
- *
97
- * @param request Is [[LayerVersionsRequest]] instance and has ((getVersion)) method.
98
- * Version - catalog version to get all related layers versions. If not defined, then the version will be the latest catalog version.
99
- * @param abortSignal A signal object that allows you to communicate with a request (such as a Fetch)
100
- * and abort it if required via an AbortController object.
101
- * @returns A promise of the http response that contains an array with all catalog layers and latest version for each layer.
102
- */
103
- getLayerVersions(request, abortSignal) {
104
- return __awaiter(this, void 0, void 0, function* () {
105
- const builder = yield this.getRequestBuilder("metadata", olp_sdk_core_1.HRN.fromString(this.hrn), abortSignal).catch(error => Promise.reject(error));
106
- let requestedCatalogVersion = request.getVersion();
107
- if (requestedCatalogVersion === undefined) {
108
- const billingtag = request.getBillingTag();
109
- const catalogVersionRequest = new olp_sdk_dataservice_read_1.CatalogVersionRequest();
110
- if (billingtag) {
111
- catalogVersionRequest.withBillingTag(billingtag);
112
- }
113
- requestedCatalogVersion = yield this.getLatestVersion(catalogVersionRequest).catch(error => Promise.reject(error));
114
- }
115
- if (requestedCatalogVersion === undefined) {
116
- return Promise.reject(new Error("Please set version with LayerVersionsRequest.withVersion() method."));
117
- }
118
- const layerVersions = yield olp_sdk_dataservice_api_1.MetadataApi.getLayerVersions(builder, {
119
- version: requestedCatalogVersion,
120
- billingTag: request.getBillingTag()
121
- }).catch((error) => __awaiter(this, void 0, void 0, function* () { return Promise.reject(new Error(error)); }));
122
- return Promise.resolve(layerVersions.layerVersions);
123
- });
124
- }
125
- /**
126
- * Gets the latest version of a catalog.
127
- *
128
- * @param request The [[CatalogVersionRequest]] instance with the `getStartVersion` method used to get
129
- * the catalog start version (exclusive).
130
- *
131
- * The default value is -1. By convention -1
132
- * indicates the virtual initial version before the first publication that has version 0.
133
- * @param abortSignal A signal object that allows you to communicate with a request (such as the `fetch` request)
134
- * and, if required, abort it using the `AbortController` object.
135
- *
136
- * For more information, see the [`AbortController` documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).
137
- *
138
- * @returns A promise of the HTTP response that contains the payload with the latest version.
139
- */
140
- getLatestVersion(request, abortSignal) {
141
- return __awaiter(this, void 0, void 0, function* () {
142
- let startVersion = request.getStartVersion();
143
- if (startVersion === undefined) {
144
- startVersion = -1;
145
- }
146
- const builder = yield this.getRequestBuilder("metadata", olp_sdk_core_1.HRN.fromString(this.hrn), abortSignal).catch(error => Promise.reject(error));
147
- const latestVersion = yield olp_sdk_dataservice_api_1.MetadataApi.latestVersion(builder, {
148
- startVersion,
149
- billingTag: request.getBillingTag()
150
- }).catch(err => Promise.reject(err));
151
- return Promise.resolve(latestVersion.version);
152
- });
153
- }
154
- /**
155
- * Gets information about specific catalog versions. The maximum number of versions to be
156
- * returned per call is 1000 versions. If the range is bigger than 1000 versions, you get the 400 Bad Request error.
157
- *
158
- * @param request The [[CatalogVersionRequest]] instance with the `getStartVersion` and `getEndVersion` methods.
159
- * * `StartVersion` - a catalog start version (exclusive). Default is -1. By convention -1
160
- * indicates the virtual initial version before the first publication that has version 0.
161
- * * `EndVersion` - a catalog end version (inclusive). If not defined, then the latest catalog
162
- * version is fethced and used.
163
- * @param abortSignal A signal object that allows you to communicate with a request (such as the `fetch` request)
164
- * and, if required, abort it using the `AbortController` object.
165
- *
166
- * For more information, see the [`AbortController` documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).
167
- *
168
- * @returns A promise of the HTTP response that contains the payload with versions in the requested
169
- * range.
170
- */
171
- getVersions(request, abortSignal) {
172
- return __awaiter(this, void 0, void 0, function* () {
173
- let startVersion = request.getStartVersion();
174
- if (startVersion === undefined) {
175
- startVersion = -1;
176
- }
177
- let endVersion = request.getEndVersion();
178
- if (endVersion === undefined) {
179
- endVersion = yield this.getLatestVersion(request);
180
- }
181
- const builder = yield this.getRequestBuilder("metadata", olp_sdk_core_1.HRN.fromString(this.hrn), abortSignal).catch(error => Promise.reject(error));
182
- return olp_sdk_dataservice_api_1.MetadataApi.listVersions(builder, {
183
- startVersion,
184
- endVersion,
185
- billingTag: request.getBillingTag()
186
- });
187
- });
188
- }
189
- /**
190
- * Fetches `baseUrl` and creates `requestBuilder` for sending requests to the API Lookup Service.
191
- * @param builderType The endpoint name that is needed to create apropriate `requestBuilder`.
192
- * @param hrn The catalog HERE Resource Name (HRN).
193
- * @param abortSignal A signal object that allows you to communicate with a request (such as the `fetch` request)
194
- * and, if required, abort it using the `AbortController` object.
195
- *
196
- * For more information, see the [`AbortController` documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).
197
- *
198
- * @returns `requestBuilder`
199
- */
200
- getRequestBuilder(builderType, hrn, abortSignal) {
201
- return __awaiter(this, void 0, void 0, function* () {
202
- return olp_sdk_core_1.RequestFactory.create(builderType, this.apiVersion, this.settings, hrn, abortSignal).catch((err) => Promise.reject(`Error retrieving from cache builder for resource "${this.hrn}" and api: "${builderType}.\n${err}"`));
203
- });
204
- }
205
- }
206
- exports.CatalogClient = CatalogClient;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (C) 2019 HERE Europe B.V.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- * SPDX-License-Identifier: Apache-2.0
18
- * License-Filename: LICENSE
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.CatalogRequest = void 0;
22
- const olp_sdk_dataservice_read_1 = require("@here/olp-sdk-dataservice-read");
23
- /**
24
- * Prepares information for calls to get catalog metadata from the platform Config Service.
25
- */
26
- class CatalogRequest {
27
- /**
28
- * An optional free-form tag that is used for grouping billing records together.
29
- * If supplied, it must be 4–16 characters long and contain only alphanumeric ASCII characters [A-Za-z0-9].
30
- *
31
- * @param tag The `BillingTag` string.
32
- * @return The updated [[CatalogRequest]] instance that you can use to chain methods.
33
- */
34
- withBillingTag(tag) {
35
- this.billingTag = olp_sdk_dataservice_read_1.validateBillingTag(tag);
36
- return this;
37
- }
38
- /**
39
- * Gets a billing tag to group billing records together.
40
- *
41
- * @return The `BillingTag` string.
42
- */
43
- getBillingTag() {
44
- return this.billingTag;
45
- }
46
- }
47
- exports.CatalogRequest = CatalogRequest;
@@ -1,85 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (C) 2019 HERE Europe B.V.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- * SPDX-License-Identifier: Apache-2.0
18
- * License-Filename: LICENSE
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.CatalogVersionRequest = void 0;
22
- const olp_sdk_dataservice_read_1 = require("@here/olp-sdk-dataservice-read");
23
- /**
24
- * Prepares information for calls to the platform Artifact Service.
25
- */
26
- class CatalogVersionRequest {
27
- /**
28
- * Gets a catalog start version (exclusive) for the request. Default is -1. By convention -1
29
- * indicates the virtual initial version before the first publication that has version 0.
30
- *
31
- * @return The catalog start version.
32
- */
33
- getStartVersion() {
34
- return this.startVersion;
35
- }
36
- /**
37
- * Gets a catalog end version (inclusive) for the request. If not defined, then the latest catalog
38
- * version is fethced and used.
39
- *
40
- * @return The catalog end version.
41
- */
42
- getEndVersion() {
43
- return this.endVersion;
44
- }
45
- /**
46
- * Sets the `startVersion` value that is used in the `getVersions and `getLatestVersion` methods of [[CatalogClient]].
47
- *
48
- * @param startVersion Specify the end catalog version or, if you want to use the latest catalog version, set to undefined.
49
- * @returns The updated [[CatalogVersionRequest]] instance that you can use to chain methods.
50
- */
51
- withStartVersion(version) {
52
- this.startVersion = version;
53
- return this;
54
- }
55
- /**
56
- * Sets the `endVersion` value that is used in the `getVersions` method of [[CatalogClient]].
57
- *
58
- * @param version Specify the end catalog version or, if you want to use the latest catalog version, set to undefined.
59
- * @returns The updated [[CatalogVersionRequest]] instance that you can use to chain methods.
60
- */
61
- withEndVersion(version) {
62
- this.endVersion = version;
63
- return this;
64
- }
65
- /**
66
- * An optional free-form tag that is used for grouping billing records together.
67
- * If supplied, it must be 4–16 characters long and contain only alphanumeric ASCII characters [A-Za-z0-9].
68
- *
69
- * @param tag The `BillingTag` string.
70
- * @return The updated [[CatalogVersionRequest]] instance that you can use to chain methods.
71
- */
72
- withBillingTag(tag) {
73
- this.billingTag = olp_sdk_dataservice_read_1.validateBillingTag(tag);
74
- return this;
75
- }
76
- /**
77
- * Gets a billing tag to group billing records together.
78
- *
79
- * @return The `BillingTag` string.
80
- */
81
- getBillingTag() {
82
- return this.billingTag;
83
- }
84
- }
85
- exports.CatalogVersionRequest = CatalogVersionRequest;
@@ -1,67 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (C) 2019 HERE Europe B.V.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- * SPDX-License-Identifier: Apache-2.0
18
- * License-Filename: LICENSE
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.CatalogsRequest = void 0;
22
- const olp_sdk_dataservice_read_1 = require("@here/olp-sdk-dataservice-read");
23
- /**
24
- * Prepares information for calls to get catalogs from the platform Config Service.
25
- */
26
- class CatalogsRequest {
27
- /**
28
- * Gets a schema HERE Resource Name (HRN) for the request.
29
- *
30
- * @return The schema HRN.
31
- */
32
- getSchema() {
33
- return this.schemaHrn;
34
- }
35
- /**
36
- * Sets a value of a layer schema HERE Resource Name (HRN) that is used in the `getCatalogs` method of the [[ConfigClient]] instance.
37
- * If the schema is set, the `getCatalogs` method returns catalogs witch have a layer or layers with the specific schema HRN.
38
- * If the schema is not set, the filter returns all of the catalogs to which you have access.
39
- *
40
- * @param schemaHrn The layer schema HRN.
41
- * @return The updated [[CatalogRequest]] instance that you can use to chain methods.
42
- */
43
- withSchema(schemaHrn) {
44
- this.schemaHrn = schemaHrn;
45
- return this;
46
- }
47
- /**
48
- * An optional free-form tag that is used for grouping billing records together.
49
- * If supplied, it must be 4–16 characters long and contain only alphanumeric ASCII characters [A-Za-z0-9].
50
- *
51
- * @param tag The `BillingTag` string.
52
- * @return The updated [[CatalogsRequest]] instance that you can use to chain methods.
53
- */
54
- withBillingTag(tag) {
55
- this.billingTag = olp_sdk_dataservice_read_1.validateBillingTag(tag);
56
- return this;
57
- }
58
- /**
59
- * Gets a billing tag to group billing records together.
60
- *
61
- * @return The `BillingTag` string.
62
- */
63
- getBillingTag() {
64
- return this.billingTag;
65
- }
66
- }
67
- exports.CatalogsRequest = CatalogsRequest;
@@ -1,72 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (C) 2019-2020 HERE Europe B.V.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- *
17
- * SPDX-License-Identifier: Apache-2.0
18
- * License-Filename: LICENSE
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
- Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.ConfigClient = void 0;
31
- const olp_sdk_core_1 = require("@here/olp-sdk-core");
32
- const olp_sdk_dataservice_api_1 = require("@here/olp-sdk-dataservice-api");
33
- /**
34
- * A client for the platform Config Service.
35
- */
36
- class ConfigClient {
37
- /**
38
- * Constructs a new client for the data store to work with data
39
- * about catalogs configurations in the store.
40
- *
41
- * @param settings The [[OlpClientSettings]] instance.
42
- * @return The [[ConfigClient]] instance.
43
- */
44
- constructor(settings) {
45
- this.settings = settings;
46
- this.apiVersion = "v1";
47
- }
48
- /**
49
- * Asynchronously retrieves a list of catalogs to which you have access.
50
- *
51
- * @param request The [[CatalogsRequest]] instance.
52
- * @return The list of catalogs to which you have access.
53
- *
54
- * If the schema is set, you get the catalogs with layers filtered by the specified layer schema HERE Resource Name (HRN).
55
- * If the schema is not set, the filter returns all of the catalogs to which you have access.
56
- */
57
- getCatalogs(request) {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- const requestBuilder = yield olp_sdk_core_1.RequestFactory.create("config", this.apiVersion, this.settings).catch(error => Promise.reject(error));
60
- const params = {};
61
- if (request) {
62
- params.billingTag = request.getBillingTag();
63
- if (request.getSchema()) {
64
- params.verbose = "true";
65
- params.schemaHrn = request.getSchema();
66
- }
67
- }
68
- return olp_sdk_dataservice_api_1.ConfigApi.getCatalogs(requestBuilder, params);
69
- });
70
- }
71
- }
72
- exports.ConfigClient = ConfigClient;