@basemaps/server 6.19.0 → 6.22.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/CHANGELOG.md +40 -0
- package/LICENSE +2 -2
- package/bin/basemaps-server.js +2 -0
- package/build/cli.d.ts +3 -1
- package/build/cli.d.ts.map +1 -1
- package/build/cli.js +33 -15
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,46 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [6.22.0](https://github.com/linz/basemaps/compare/v6.21.1...v6.22.0) (2022-03-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **server:** support loading config from dynamodb ([#2119](https://github.com/linz/basemaps/issues/2119)) ([e550505](https://github.com/linz/basemaps/commit/e550505193df3cf148313e364c7c0670e16756e2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [6.21.1](https://github.com/linz/basemaps/compare/v6.21.0...v6.21.1) (2022-03-17)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @basemaps/server
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [6.21.0](https://github.com/linz/basemaps/compare/v6.20.0...v6.21.0) (2022-03-17)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Reverts
|
|
29
|
+
|
|
30
|
+
* Revert "release: v6.21.0 (#2104)" (#2111) ([d07f8ab](https://github.com/linz/basemaps/commit/d07f8ab4037466b060bf7e83960737554ff064b4)), closes [#2104](https://github.com/linz/basemaps/issues/2104) [#2111](https://github.com/linz/basemaps/issues/2111)
|
|
31
|
+
* Revert "release: v6.22.0 (#2108)" (#2110) ([abcd2e4](https://github.com/linz/basemaps/commit/abcd2e4732a6d606eed865f526d6df2e4617aad3)), closes [#2108](https://github.com/linz/basemaps/issues/2108) [#2110](https://github.com/linz/basemaps/issues/2110)
|
|
32
|
+
* Revert "release: v6.21.0 (#2104)" (#2107) ([2c7e7f6](https://github.com/linz/basemaps/commit/2c7e7f6686a293995abdeb9604413808f2208bd6)), closes [#2104](https://github.com/linz/basemaps/issues/2104) [#2107](https://github.com/linz/basemaps/issues/2107)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# [6.20.0](https://github.com/linz/basemaps/compare/v6.19.0...v6.20.0) (2022-02-01)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @basemaps/server
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
6
46
|
# [6.19.0](https://github.com/linz/basemaps/compare/v6.18.1...v6.19.0) (2021-12-20)
|
|
7
47
|
|
|
8
48
|
**Note:** Version bump only for package @basemaps/server
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
Crown copyright (c)
|
|
3
|
+
Crown copyright (c), Toitū Te Whenua Land Information New Zealand on behalf of the New Zealand Government.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/bin/basemaps-server.js
CHANGED
package/build/cli.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { Command } from '@oclif/command';
|
|
1
|
+
import { Command, flags } from '@oclif/command';
|
|
2
2
|
export declare class BasemapsServerCommand extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
5
|
verbose: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
6
6
|
port: import("@oclif/parser/lib/flags").IOptionFlag<number>;
|
|
7
|
+
dynamo: flags.IOptionFlag<string | undefined>;
|
|
7
8
|
};
|
|
8
9
|
static args: {
|
|
9
10
|
name: string;
|
|
10
11
|
required: boolean;
|
|
11
12
|
}[];
|
|
13
|
+
loadFromPath(configPath: string, serverUrl: string): Promise<void>;
|
|
12
14
|
run(): Promise<void>;
|
|
13
15
|
}
|
|
14
16
|
//# sourceMappingURL=cli.d.ts.map
|
package/build/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAkBhD,qBAAa,qBAAsB,SAAQ,OAAO;IAChD,MAAM,CAAC,WAAW,SAAuD;IACzE,MAAM,CAAC,KAAK;;;;MAIV;IAEF,MAAM,CAAC,IAAI;;;QAA6C;IAElD,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8ClE,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA0B3B"}
|
package/build/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Configure the logging before importing everything
|
|
2
|
-
import { ConfigPrefix, ConfigProviderMemory, parseRgba } from '@basemaps/config';
|
|
2
|
+
import { ConfigPrefix, ConfigProviderDynamo, ConfigProviderMemory, parseRgba } from '@basemaps/config';
|
|
3
3
|
import { TileSetLocal } from '@basemaps/lambda-tiler/build/cli/tile.set.local.js';
|
|
4
4
|
import { TileSets } from '@basemaps/lambda-tiler/build/tile.set.cache.js';
|
|
5
5
|
import { Config, Env, LogConfig } from '@basemaps/shared';
|
|
@@ -20,19 +20,11 @@ const BaseProvider = {
|
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
export class BasemapsServerCommand extends Command {
|
|
23
|
-
async
|
|
24
|
-
var _a;
|
|
25
|
-
const { args, flags } = this.parse(BasemapsServerCommand);
|
|
26
|
-
if (flags.verbose)
|
|
27
|
-
logger.level = 'debug';
|
|
28
|
-
const ServerUrl = `http://localhost:${flags.port}`;
|
|
29
|
-
// Force a default url base so WMTS requests know their relative url
|
|
30
|
-
process.env[Env.PublicUrlBase] = (_a = process.env[Env.PublicUrlBase]) !== null && _a !== void 0 ? _a : `http://localhost:${flags.port}`;
|
|
31
|
-
logger.info({ path: args.configPath }, 'Starting Server');
|
|
23
|
+
async loadFromPath(configPath, serverUrl) {
|
|
32
24
|
const config = new ConfigProviderMemory();
|
|
33
25
|
Config.setConfigProvider(config);
|
|
34
26
|
const tifSets = new Map();
|
|
35
|
-
for await (const file of fsa.listDetails(
|
|
27
|
+
for await (const file of fsa.listDetails(configPath)) {
|
|
36
28
|
const lowerPath = file.path.toLowerCase();
|
|
37
29
|
if (lowerPath.endsWith('.tiff') || lowerPath.endsWith('.tif')) {
|
|
38
30
|
const tiffPath = dirname(file.path);
|
|
@@ -42,7 +34,7 @@ export class BasemapsServerCommand extends Command {
|
|
|
42
34
|
const tsl = new TileSetLocal(tileSet, tiffPath);
|
|
43
35
|
await tsl.load();
|
|
44
36
|
TileSets.add(tsl, new Date('3000-01-01').getTime());
|
|
45
|
-
const wmtsUrl = `${
|
|
37
|
+
const wmtsUrl = `${serverUrl}/v1/tiles/${tileSet}/WMTSCapabilities.xml`;
|
|
46
38
|
logger.info({ tileSetId: tileSet, wmtsUrl }, 'TileSet:Loaded');
|
|
47
39
|
if (!config.objects.has('pv_linz'))
|
|
48
40
|
config.put(BaseProvider);
|
|
@@ -66,14 +58,40 @@ export class BasemapsServerCommand extends Command {
|
|
|
66
58
|
const tileSet = Config.unprefix(ConfigPrefix.TileSet, jsonData.id);
|
|
67
59
|
if (jsonData.name == null)
|
|
68
60
|
jsonData.name = tileSet;
|
|
69
|
-
const wmtsUrl = `${
|
|
61
|
+
const wmtsUrl = `${serverUrl}/v1/tiles/${tileSet}/WMTSCapabilities.xml`;
|
|
70
62
|
logger.info({ tileSetId: jsonData.id, wmtsUrl }, 'TileSet:Loaded');
|
|
71
63
|
}
|
|
64
|
+
}
|
|
65
|
+
async run() {
|
|
66
|
+
var _a;
|
|
67
|
+
const { args, flags } = this.parse(BasemapsServerCommand);
|
|
68
|
+
if (flags.verbose)
|
|
69
|
+
logger.level = 'debug';
|
|
70
|
+
if (args.configPath == null && flags.dynamo == null) {
|
|
71
|
+
}
|
|
72
|
+
const ServerUrl = `http://localhost:${flags.port}`;
|
|
73
|
+
if (args.configPath != null) {
|
|
74
|
+
logger.info({ path: args.configPath }, 'Starting Server');
|
|
75
|
+
await this.loadFromPath(args.configPath, ServerUrl);
|
|
76
|
+
}
|
|
77
|
+
else if (flags.dynamo != null) {
|
|
78
|
+
logger.info({ dynamo: flags.dynamo }, 'Starting Server');
|
|
79
|
+
Config.setConfigProvider(new ConfigProviderDynamo(flags.dynamo));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
throw new Error('Either a configuration path or dynamodb table name must be supplied');
|
|
83
|
+
}
|
|
84
|
+
// Force a default url base so WMTS requests know their relative url
|
|
85
|
+
process.env[Env.PublicUrlBase] = (_a = process.env[Env.PublicUrlBase]) !== null && _a !== void 0 ? _a : `http://localhost:${flags.port}`;
|
|
72
86
|
BasemapsServer.listen(flags.port, () => {
|
|
73
87
|
logger.info({ url: ServerUrl }, 'ServerStarted');
|
|
74
88
|
});
|
|
75
89
|
}
|
|
76
90
|
}
|
|
77
91
|
BasemapsServerCommand.description = 'Create a WMTS/XYZ Tile server for basemaps config';
|
|
78
|
-
BasemapsServerCommand.flags = {
|
|
79
|
-
|
|
92
|
+
BasemapsServerCommand.flags = {
|
|
93
|
+
verbose: flags.boolean(),
|
|
94
|
+
port: flags.integer({ default: 5000 }),
|
|
95
|
+
dynamo: flags.string({ description: 'Dynamodb table', required: false }),
|
|
96
|
+
};
|
|
97
|
+
BasemapsServerCommand.args = [{ name: 'configPath', required: false }];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basemaps/server",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.22.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/linz/basemaps.git",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"bin/"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@basemaps/config": "^6.
|
|
36
|
-
"@basemaps/geo": "^6.
|
|
37
|
-
"@basemaps/lambda-tiler": "^6.
|
|
38
|
-
"@basemaps/shared": "^6.
|
|
35
|
+
"@basemaps/config": "^6.21.1",
|
|
36
|
+
"@basemaps/geo": "^6.21.1",
|
|
37
|
+
"@basemaps/lambda-tiler": "^6.22.0",
|
|
38
|
+
"@basemaps/shared": "^6.22.0",
|
|
39
39
|
"@linzjs/lambda": "^2.0.0",
|
|
40
40
|
"@oclif/command": "^1.8.0",
|
|
41
41
|
"express": "^4.17.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/express": "^4.17.13"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b85a4a628bcdfea657a37de97faa23dde5c34798"
|
|
48
48
|
}
|