@here/olp-sdk-dataservice-read 1.12.0 → 1.13.1
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/bundle.umd.dev.js +10259 -10206
- package/bundle.umd.min.js +1 -1
- package/lib/client/ArtifactClient.d.ts +1 -1
- package/lib/client/StreamLayerClient.js +26 -24
- package/lib/utils/getTile.js +4 -1
- package/package.json +8 -5
- package/webpack.config.js +21 -0
|
@@ -20,7 +20,7 @@ export declare class ArtifactClient {
|
|
|
20
20
|
* @param schemaDetailsRequest The [[SchemaDetailsRequest]] instance.
|
|
21
21
|
* @return An object with the schema metadata.
|
|
22
22
|
*/
|
|
23
|
-
getSchemaDetails(schemaDetailsRequest: SchemaDetailsRequest): Promise<ArtifactApi.
|
|
23
|
+
getSchemaDetails(schemaDetailsRequest: SchemaDetailsRequest): Promise<ArtifactApi.GetSchemaResponseObj>;
|
|
24
24
|
/**
|
|
25
25
|
* Gets schema data.
|
|
26
26
|
*
|
|
@@ -125,30 +125,32 @@ class StreamLayerClient {
|
|
|
125
125
|
.catch(error => Promise.reject(error));
|
|
126
126
|
// Update xCorrelationId
|
|
127
127
|
this.xCorrelationId = consumeResponse.xCorrelationId;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
acc[curr.partition]
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
128
|
+
if (consumeResponse.data.length > 0) {
|
|
129
|
+
// Commit offsets
|
|
130
|
+
const latestOffsets = consumeResponse.data
|
|
131
|
+
.map(msg => msg.offset)
|
|
132
|
+
.reduce((acc, curr) => {
|
|
133
|
+
acc[curr.partition] =
|
|
134
|
+
acc[curr.partition] > curr.offset
|
|
135
|
+
? acc[curr.partition]
|
|
136
|
+
: curr.offset;
|
|
137
|
+
return acc;
|
|
138
|
+
}, {});
|
|
139
|
+
yield olp_sdk_dataservice_api_1.StreamApi.doCommitOffsets(requestBuilder, {
|
|
140
|
+
commitOffsets: {
|
|
141
|
+
offsets: Object.keys(latestOffsets).map(key => ({
|
|
142
|
+
partition: +key,
|
|
143
|
+
offset: latestOffsets[key]
|
|
144
|
+
}))
|
|
145
|
+
},
|
|
146
|
+
subscriptionId: request.getSubscriptionId(),
|
|
147
|
+
mode: request.getMode(),
|
|
148
|
+
layerId: this.layerId,
|
|
149
|
+
xCorrelationId: this.xCorrelationId
|
|
150
|
+
}).catch((error) => __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
console.log(`Commit offsets unsuccessful, error=${error.message}`);
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
152
154
|
return Promise.resolve(consumeResponse.data);
|
|
153
155
|
});
|
|
154
156
|
}
|
package/lib/utils/getTile.js
CHANGED
|
@@ -101,7 +101,10 @@ function getTile(request, params, abortSignal) {
|
|
|
101
101
|
quadTreeIndex = yield fetchQuadTreeIndex(Object.assign(Object.assign({}, params), { catalogVersion, depth: delta, fetchOptions: request.getFetchOption(), tileKey: parentTileKey, abortSignal, billingTag: request.getBillingTag() })).catch(e => Promise.reject(e));
|
|
102
102
|
}
|
|
103
103
|
if (!quadTreeIndex.subQuads || !quadTreeIndex.subQuads.length) {
|
|
104
|
-
return Promise.
|
|
104
|
+
return Promise.resolve(new Response("No Content", {
|
|
105
|
+
status: 204,
|
|
106
|
+
statusText: "No Content"
|
|
107
|
+
}));
|
|
105
108
|
}
|
|
106
109
|
// Return the data for the requested QuadKey or for the closest parent
|
|
107
110
|
const subQuads = quadTreeIndex.subQuads;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@here/olp-sdk-dataservice-read",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.1",
|
|
4
4
|
"description": "Wrapper around a subset of the HERE Open Location Platform Data REST API related to reading data from OLP catalogs",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"browser": "index.web.js",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
},
|
|
50
50
|
"license": "Apache-2.0",
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@here/olp-sdk-core": "^1.
|
|
53
|
-
"@here/olp-sdk-dataservice-api": "^1.
|
|
52
|
+
"@here/olp-sdk-core": "^1.8.0",
|
|
53
|
+
"@here/olp-sdk-dataservice-api": "^1.13.0",
|
|
54
54
|
"@here/olp-sdk-fetch": "^1.9.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
@@ -72,10 +72,13 @@
|
|
|
72
72
|
"ts-node": "^8.5.4",
|
|
73
73
|
"tslint": "^6.1.3",
|
|
74
74
|
"tslint-config-prettier": "^1.18.0",
|
|
75
|
-
"typedoc": "^0.
|
|
75
|
+
"typedoc": "^0.22.13",
|
|
76
76
|
"typescript": "4.0.3",
|
|
77
77
|
"tslib": "1.13.0",
|
|
78
|
-
"webpack": "^4.
|
|
78
|
+
"webpack": "^4.46.0",
|
|
79
79
|
"webpack-cli": "^3.3.10"
|
|
80
|
+
},
|
|
81
|
+
"engines": {
|
|
82
|
+
"node": ">= 10.18.0"
|
|
80
83
|
}
|
|
81
84
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
|
|
3
|
+
module.exports = env => {
|
|
4
|
+
const isProd = env.NODE_ENV === "production";
|
|
5
|
+
|
|
6
|
+
return {
|
|
7
|
+
target: "web",
|
|
8
|
+
mode: env.NODE_ENV,
|
|
9
|
+
devtool: isProd ? undefined : "inline-source-map",
|
|
10
|
+
resolve: {
|
|
11
|
+
extensions: [".js"]
|
|
12
|
+
},
|
|
13
|
+
entry: "./index.web.js",
|
|
14
|
+
output: {
|
|
15
|
+
filename: `bundle.umd${isProd ? '.min' : '.dev'}.js`,
|
|
16
|
+
path: path.resolve(__dirname),
|
|
17
|
+
libraryTarget: "umd",
|
|
18
|
+
globalObject: 'this'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|