Skip to content

Commit

Permalink
Merge branch 'release/2.0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Elvio Wang committed Oct 2, 2023
2 parents 93a685e + 3a89a4c commit 4bb66af
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 7 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
## [2.0.6] - 2023-10-03
### FIXED
- Fixed `hisDelete` date validation on timezone offsets.

## [2.0.5] - 2023-07-07
### FIXED
Expand Down Expand Up @@ -96,7 +99,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### ADDED
- Alpha release

[Unreleased]: https://github.com/widesky/jswidesky-client/compare/master...2.0.4
[Unreleased]: https://github.com/widesky/jswidesky-client/compare/master...2.0.6
[1.0.0]: https://github.com/widesky/jswidesky-client/compare/1.0.0...1.0.0
[1.1.0]: https://github.com/widesky/jswidesky-client/compare/1.1.0...1.0.0
[1.1.1]: https://github.com/widesky/jswidesky-client/compare/1.1.1...1.1.0
Expand All @@ -109,3 +112,5 @@ This project adheres to [Semantic Versioning](http://semver.org/).
[2.0.2]: https://github.com/widesky/jswidesky-client/compare/2.0.2...2.0.1
[2.0.3]: https://github.com/widesky/jswidesky-client/compare/2.0.3...2.0.2
[2.0.4]: https://github.com/widesky/jswidesky-client/compare/2.0.4...2.0.3
[2.0.5]: https://github.com/widesky/jswidesky-client/compare/2.0.5...2.0.4
[2.0.6]: https://github.com/widesky/jswidesky-client/compare/2.0.6...2.0.5
5 changes: 4 additions & 1 deletion dist/wideskyClient.develop.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/wideskyClient.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@widesky/jswidesky-client",
"version": "2.0.5",
"version": "2.0.6",
"description": "WideSky Client in JavaScript",
"main": "index.js",
"private": false,
Expand Down
3 changes: 3 additions & 0 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,9 @@ class WideSkyClient {
}

for (const ts in ranges) {
if (ranges[ts].includes(' ')) {
ranges[ts] = ranges[ts].trimStart().split(' ')[0];
}
if (!moment(ranges[ts].trim(), moment.ISO_8601).isValid()) {
throw new Error(range_err + 'Invalid ISO8601 timestamp.');
}
Expand Down
45 changes: 44 additions & 1 deletion test/client/hist.js
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,6 @@ describe('client', () => {
}
});


it("should generate the correct grid for a single point", async () => {
const TEST_POINT = "b3b6be5a-cd9d-46ab-9fc5-837c1c583f79";
let http = new stubs.StubHTTPClient(),
Expand Down Expand Up @@ -1895,6 +1894,50 @@ describe('client', () => {
);
});

it("should generate the correct grid for a single point with a timezone offset", async () => {
const TEST_POINT = "b3b6be5a-cd9d-46ab-9fc5-837c1c583f79";
const TEST_RANGE_OFFSET = "s:2023-05-13T05:14:30+10:00 Brisbane, 2023-05-14T05:14:30+10:00 Brisbane";

let http = new stubs.StubHTTPClient(),
log = new stubs.StubLogger(),
ws = getInstance(http, log);

await ws.hisDelete(TEST_POINT, TEST_RANGE_OFFSET);
expect(ws._wsRawSubmit.callCount).to.equal(2);
verifyTokenCall(ws._wsRawSubmit.firstCall.args);
verifyRequestCall(
ws._wsRawSubmit.secondCall.args,
"POST",
"/api/hisDelete",
{
meta: {
ver: "2.0",
},
cols: [
{
name: "range",
},
{
name: "id",
},
],
rows: [
{
range: TEST_RANGE_OFFSET,
id: `r:${TEST_POINT}`,
},
],
},
{
headers: {
Authorization: `Bearer ${WS_ACCESS_TOKEN}`,
Accept: "application/json",
},
decompress: true,
}
);
});

it("should generate the correct grid for an array of points", async () => {
const TEST_POINTS = [
"00000112-0000-0000-0000-000000000000",
Expand Down

0 comments on commit 4bb66af

Please sign in to comment.