@basemaps/cli 6.18.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 CHANGED
@@ -3,6 +3,59 @@
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
+ * **cli:** support multiple invalidations for cloudfront ([#2120](https://github.com/linz/basemaps/issues/2120)) ([764fdeb](https://github.com/linz/basemaps/commit/764fdebaf7624c7761cede3a24c2184105bff9e2))
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/cli
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
+ ### Bug Fixes
29
+
30
+ * **config:** fetch all unprocessed keys from dynamo if there are any ([#2101](https://github.com/linz/basemaps/issues/2101)) ([731430e](https://github.com/linz/basemaps/commit/731430e73756f05b2684f5b7ae7bd2852bc0a9b5))
31
+
32
+
33
+ ### Features
34
+
35
+ * **cli:** remove unused config cli this has been moved into linz/basemaps-config ([#2102](https://github.com/linz/basemaps/issues/2102)) ([b047e11](https://github.com/linz/basemaps/commit/b047e111a9be2b200d5812d2d32fc6df7fdf4c2a))
36
+
37
+
38
+ ### Reverts
39
+
40
+ * 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)
41
+ * 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)
42
+ * 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)
43
+
44
+
45
+
46
+
47
+
48
+ # [6.20.0](https://github.com/linz/basemaps/compare/v6.19.0...v6.20.0) (2022-02-01)
49
+
50
+
51
+ ### Bug Fixes
52
+
53
+ * **cli:** disable reading sidecar files ([#2049](https://github.com/linz/basemaps/issues/2049)) ([d42d03b](https://github.com/linz/basemaps/commit/d42d03b34a1f3d9de895ee3c318112882e5a8972))
54
+
55
+
56
+
57
+
58
+
6
59
  # [6.18.0](https://github.com/linz/basemaps/compare/v6.17.0...v6.18.0) (2021-12-14)
7
60
 
8
61
  **Note:** Version bump only for package @basemaps/cli
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
- Basemaps MIT Licence
1
+ MIT License
2
2
 
3
- Crown copyright (c) 2020, Land Information New Zealand on behalf of the New Zealand Government.
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
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Invalidate the cloudfront distribution cache when updating imagery sets
3
3
  */
4
- export declare function invalidateCache(path: string, commit?: boolean): Promise<void>;
4
+ export declare function invalidateCache(path: string | string[], commit?: boolean): Promise<void>;
5
5
  export declare const HashKey = "linz-hash";
6
6
  export declare function getHash(Bucket: string, Key: string): Promise<string | null>;
7
7
  export declare function getStaticBucket(): Promise<string | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/cli/util.ts"],"names":[],"mappings":"AAkBA;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BjF;AAED,eAAO,MAAM,OAAO,cAAc,CAAC;AAEnC,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQjF;AAOD,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQ9D;AAMD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,CA6BlB"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/cli/util.ts"],"names":[],"mappings":"AAkBA;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA+B5F;AAED,eAAO,MAAM,OAAO,cAAc,CAAC;AAEnC,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQjF;AAOD,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQ9D;AAMD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,CA6BlB"}
package/build/cli/util.js CHANGED
@@ -31,12 +31,13 @@ export async function invalidateCache(path, commit = false) {
31
31
  return;
32
32
  }
33
33
  LogConfig.get().info({ path, cfId: cf.Id }, 'Invalidating');
34
+ const Items = Array.isArray(path) ? path : [path];
34
35
  if (commit) {
35
36
  await cloudFront
36
37
  .createInvalidation({
37
38
  DistributionId: cf.Id,
38
39
  InvalidationBatch: {
39
- Paths: { Quantity: 1, Items: [path] },
40
+ Paths: { Quantity: Items.length, Items },
40
41
  CallerReference: `${CliId}-${InvalidationId++}`,
41
42
  },
42
43
  })
@@ -66,6 +66,9 @@ o.spec('cog', () => {
66
66
  'QUALITY=90',
67
67
  '-co',
68
68
  'SPARSE_OK=YES',
69
+ '--config',
70
+ 'GDAL_DISABLE_READDIR_ON_OPEN',
71
+ 'EMPTY_DIR',
69
72
  '-tr',
70
73
  '0.75',
71
74
  '0.75',
package/build/cog/cog.js CHANGED
@@ -2,7 +2,7 @@ import { Bounds, TileMatrixSet } from '@basemaps/geo';
2
2
  import { Env, isConfigS3Role, Projection } from '@basemaps/shared';
3
3
  import { GdalCogBuilder } from '../gdal/gdal.cog.js';
4
4
  import { GdalProgressParser } from '../gdal/gdal.progress.js';
5
- import { AwsCredentials } from '@chunkd/fs';
5
+ import { AwsCredentials } from '@chunkd/source-aws-v2';
6
6
  /**
7
7
  * Create a onProgress logger
8
8
  *
@@ -2,7 +2,7 @@ import { Epsg } from '@basemaps/geo';
2
2
  import { Env, fsa, isConfigS3Role, s3ToVsis3 } from '@basemaps/shared';
3
3
  import { Gdal } from '../gdal/gdal.js';
4
4
  import { onProgress } from './cog.js';
5
- import { AwsCredentials } from '@chunkd/fs';
5
+ import { AwsCredentials } from '@chunkd/source-aws-v2';
6
6
  /**
7
7
  * Build the VRT for the needed source imagery
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"gdal.cog.d.ts","sourceRoot":"","sources":["../../src/gdal/gdal.cog.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAA0B,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEjF,+DAA+D;AAG/D;;;;;;GAMG;AACH,qBAAa,cAAc;IACzB,MAAM,EAAE,qBAAqB,CAAC;IAE9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,8BAA8B,GAAG,IAAI,CAAC;IAC7C;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9B,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,IAAI,EAAE,WAAW,CAAC;gBAEN,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAmBvF,SAAS,IAAI,MAAM,EAAE;IAYrB,IAAI,kBAAkB,IAAI,MAAM,CAO/B;IAED,IAAI,IAAI,IAAI,MAAM,EAAE,CA+CnB;IAEK,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3C"}
1
+ {"version":3,"file":"gdal.cog.d.ts","sourceRoot":"","sources":["../../src/gdal/gdal.cog.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAA0B,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEjF,+DAA+D;AAG/D;;;;;;GAMG;AACH,qBAAa,cAAc;IACzB,MAAM,EAAE,qBAAqB,CAAC;IAE9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,8BAA8B,GAAG,IAAI,CAAC;IAC7C;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9B,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,IAAI,EAAE,WAAW,CAAC;gBAEN,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAmBvF,SAAS,IAAI,MAAM,EAAE;IAYrB,IAAI,kBAAkB,IAAI,MAAM,CAO/B;IAED,IAAI,IAAI,IAAI,MAAM,EAAE,CAmDnB;IAEK,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3C"}
@@ -84,6 +84,10 @@ export class GdalCogBuilder {
84
84
  // most of the imagery contains a lot of empty tiles, no need to output them
85
85
  '-co',
86
86
  `SPARSE_OK=YES`,
87
+ // Do not attempt to read sidecar files
88
+ '--config',
89
+ `GDAL_DISABLE_READDIR_ON_OPEN`,
90
+ `EMPTY_DIR`,
87
91
  // Force a target resolution to be better than the imagery not worse
88
92
  '-tr',
89
93
  tr,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basemaps/cli",
3
- "version": "6.18.0",
3
+ "version": "6.22.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,8 +16,7 @@
16
16
  "main": "./build/index.js",
17
17
  "types": "./build/index.d.ts",
18
18
  "bin": {
19
- "cogify": "./cogify.js",
20
- "basemaps": "./basemaps.js"
19
+ "cogify": "./cogify.js"
21
20
  },
22
21
  "scripts": {
23
22
  "build": "tsc",
@@ -38,12 +37,12 @@
38
37
  "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
39
38
  },
40
39
  "dependencies": {
41
- "@basemaps/config": "^6.18.0",
42
- "@basemaps/geo": "^6.10.0",
43
- "@basemaps/shared": "^6.18.0",
44
- "@chunkd/fs": "^7.3.1",
45
- "@cogeotiff/core": "^6.0.2",
46
- "@linzjs/geojson": "^6.10.0",
40
+ "@basemaps/config": "^6.21.1",
41
+ "@basemaps/geo": "^6.21.1",
42
+ "@basemaps/shared": "^6.22.0",
43
+ "@chunkd/fs": "^8.1.0",
44
+ "@cogeotiff/core": "^6.1.1",
45
+ "@linzjs/geojson": "^6.21.1",
47
46
  "@rushstack/ts-command-line": "^4.3.13",
48
47
  "ansi-colors": "^4.1.1",
49
48
  "p-limit": "^4.0.0",
@@ -60,5 +59,5 @@
60
59
  "files": [
61
60
  "build/"
62
61
  ],
63
- "gitHead": "e87458ee8d0572780b9df074b718af0ecd72acc3"
62
+ "gitHead": "b85a4a628bcdfea657a37de97faa23dde5c34798"
64
63
  }
package/basemaps.js DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import './build/cli/basemaps/index.js';
@@ -1,10 +0,0 @@
1
- import { TileSetBaseAction } from './tileset.action.js';
2
- export declare class TileSetInvalidateAction extends TileSetBaseAction {
3
- private commit;
4
- private projection;
5
- private tileSet;
6
- constructor();
7
- protected onDefineParameters(): void;
8
- protected onExecute(): Promise<void>;
9
- }
10
- //# sourceMappingURL=action.invalidate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action.invalidate.d.ts","sourceRoot":"","sources":["../../../src/cli/basemaps/action.invalidate.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,qBAAa,uBAAwB,SAAQ,iBAAiB;IAC5D,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,UAAU,CAA8B;IAChD,OAAO,CAAC,OAAO,CAA6B;;IAU5C,SAAS,CAAC,kBAAkB,IAAI,IAAI;cAMpB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAgB3C"}
@@ -1,36 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
- import { Epsg } from '@basemaps/geo';
3
- import { Config, LogConfig } from '@basemaps/shared';
4
- import { TagActions } from '../tag.action.js';
5
- import { TileSetBaseAction } from './tileset.action.js';
6
- import { invalidateXYZCache } from './tileset.util.js';
7
- export class TileSetInvalidateAction extends TileSetBaseAction {
8
- constructor() {
9
- super({
10
- actionName: 'invalidate',
11
- summary: 'Invalidate basemaps caches rendering',
12
- documentation: 'Destroy the cache for cloudfront, useful if all the tiles need to be rendered again',
13
- });
14
- }
15
- onDefineParameters() {
16
- this.commit = this.defineFlagParameter(TagActions.Commit);
17
- this.projection = this.defineIntegerParameter(TagActions.Projection);
18
- this.tileSet = this.defineStringParameter(TagActions.TileSet);
19
- }
20
- async onExecute() {
21
- const tileSet = this.tileSet.value;
22
- const projection = Epsg.tryGet(this.projection.value);
23
- if (projection == null)
24
- return this.fatal({ projection: this.projection.value }, 'Invalid projection');
25
- const tsData = await Config.TileSet.get(Config.TileSet.id(tileSet));
26
- if (tsData == null)
27
- return this.fatal({ tileSet }, 'Could not find tileset');
28
- LogConfig.get().info({ tileSet, projection }, 'Invalidating');
29
- if (this.commit.value) {
30
- await invalidateXYZCache(tileSet, projection, this.commit.value);
31
- }
32
- else {
33
- LogConfig.get().warn('DryRun:Done');
34
- }
35
- }
36
- }
@@ -1,12 +0,0 @@
1
- import { TileSetBaseAction } from './tileset.action.js';
2
- export declare class TileSetInfoAction extends TileSetBaseAction {
3
- private imagery;
4
- private projection;
5
- private tileSet;
6
- private version;
7
- constructor();
8
- protected onDefineParameters(): void;
9
- private imageInfo;
10
- protected onExecute(): Promise<void>;
11
- }
12
- //# sourceMappingURL=action.tileset.info.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action.tileset.info.d.ts","sourceRoot":"","sources":["../../../src/cli/basemaps/action.tileset.info.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,qBAAa,iBAAkB,SAAQ,iBAAiB;IACtD,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,UAAU,CAA8B;IAChD,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,OAAO,CAA8B;;IAU7C,SAAS,CAAC,kBAAkB,IAAI,IAAI;YAOtB,SAAS;cAcP,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAuB3C"}
@@ -1,56 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
- import { Epsg } from '@basemaps/geo';
3
- import { Config, LogConfig } from '@basemaps/shared';
4
- import * as c from 'ansi-colors';
5
- import { TagActions } from '../tag.action.js';
6
- import { TileSetBaseAction } from './tileset.action.js';
7
- import { printTileSet } from './tileset.util.js';
8
- export class TileSetInfoAction extends TileSetBaseAction {
9
- constructor() {
10
- super({
11
- actionName: 'info',
12
- summary: 'Rendering information for tile sets or imagery',
13
- documentation: 'Get rendering information for the tile set or imagery',
14
- });
15
- }
16
- onDefineParameters() {
17
- this.imagery = this.defineStringParameter(TagActions.Imagery);
18
- this.projection = this.defineIntegerParameter(TagActions.Projection);
19
- this.tileSet = this.defineStringParameter(TagActions.TileSet);
20
- this.version = this.defineIntegerParameter(TagActions.Version);
21
- }
22
- async imageInfo(imageryId) {
23
- const img = await Config.Imagery.get(imageryId);
24
- if (img == null)
25
- throw new Error('Cannot find imagery with id ' + imageryId);
26
- console.log(c.bold('Imagery:'), img.name);
27
- console.log(c.bold('CreatedAt:'), new Date(img.createdAt).toString());
28
- console.log(c.bold('UpdatedAt:'), new Date(img.updatedAt).toString());
29
- console.log(c.bold('Year:'), img.year);
30
- console.log(c.bold('Projection:'), img.projection);
31
- console.log(c.bold('Resolution:'), img.resolution);
32
- console.log(c.bold('Files:\n'), img.files.map((c) => `\t${c.name}`).join('\n'));
33
- // TODO get job.json from s3 and get information on how the imagery was made.
34
- }
35
- async onExecute() {
36
- const tileSet = this.tileSet.value;
37
- const projection = Epsg.tryGet(this.projection.value);
38
- if (projection == null)
39
- return this.fatal({ projection: this.projection.value }, 'Invalid projection');
40
- const imgId = this.imagery.value;
41
- if (imgId != null)
42
- return this.imageInfo(imgId);
43
- if (tileSet == null) {
44
- LogConfig.get().fatal('Missing --tileset and --projection or --imagery');
45
- console.log(this.renderHelpText());
46
- return;
47
- }
48
- const tileSetId = Config.TileSet.id(tileSet);
49
- const tsData = await Config.TileSet.get(tileSetId);
50
- if (tsData == null) {
51
- LogConfig.get().fatal({ tileSet }, 'Unable to find tile set');
52
- return;
53
- }
54
- await printTileSet(tsData, projection);
55
- }
56
- }
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import 'source-map-support/register.js';
3
- import { BaseCommandLine } from '../base.cli.js';
4
- export declare class BasemapsCommandLine extends BaseCommandLine {
5
- constructor();
6
- }
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/basemaps/index.ts"],"names":[],"mappings":";AACA,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIjD,qBAAa,mBAAoB,SAAQ,eAAe;;CASvD"}
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import 'source-map-support/register.js';
3
- import { BaseCommandLine } from '../base.cli.js';
4
- import { TileSetInvalidateAction } from './action.invalidate.js';
5
- import { TileSetInfoAction } from './action.tileset.info.js';
6
- export class BasemapsCommandLine extends BaseCommandLine {
7
- constructor() {
8
- super({
9
- toolFilename: 'basemaps',
10
- toolDescription: 'Basemaps configuration utilities',
11
- });
12
- this.addAction(new TileSetInfoAction());
13
- this.addAction(new TileSetInvalidateAction());
14
- }
15
- }
16
- new BasemapsCommandLine().run();
@@ -1,7 +0,0 @@
1
- import { LogType } from '@basemaps/shared';
2
- import { CommandLineAction } from '@rushstack/ts-command-line';
3
- export declare abstract class TileSetBaseAction extends CommandLineAction {
4
- /** Log a fatal error and render the help text */
5
- fatal(obj: Record<string, unknown>, msg: string, logger?: LogType): void;
6
- }
7
- //# sourceMappingURL=tileset.action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tileset.action.d.ts","sourceRoot":"","sources":["../../../src/cli/basemaps/tileset.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,8BAAsB,iBAAkB,SAAQ,iBAAiB;IAC/D,iDAAiD;IACjD,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,OAAyB,GAAG,IAAI;CAK1F"}
@@ -1,10 +0,0 @@
1
- import { LogConfig } from '@basemaps/shared';
2
- import { CommandLineAction } from '@rushstack/ts-command-line';
3
- export class TileSetBaseAction extends CommandLineAction {
4
- /** Log a fatal error and render the help text */
5
- fatal(obj, msg, logger = LogConfig.get()) {
6
- logger.fatal(obj, msg);
7
- console.log('\n');
8
- console.log(this.renderHelpText());
9
- }
10
- }
@@ -1,22 +0,0 @@
1
- import { ConfigImagery, ConfigLayer, ConfigTileSet, ConfigTileSetRaster } from '@basemaps/config';
2
- import { Epsg } from '@basemaps/geo';
3
- import { CliTable } from '../cli.table.js';
4
- export declare function rgbaToHex(c: {
5
- r: number;
6
- g: number;
7
- b: number;
8
- alpha: number;
9
- }): string;
10
- interface TileSetLayerImagery {
11
- layer: ConfigLayer;
12
- imagery: ConfigImagery;
13
- }
14
- export declare const TileSetTable: CliTable<TileSetLayerImagery>;
15
- export declare function printTileSetImagery(tsData: ConfigTileSetRaster, projection: Epsg): Promise<void>;
16
- export declare function printTileSet(tsData: ConfigTileSet, projection: Epsg, printImagery?: boolean): Promise<void>;
17
- /**
18
- * Invalidate the cloudfront distribution cache when updating imagery sets
19
- */
20
- export declare function invalidateXYZCache(name: string, projection: Epsg, commit?: boolean): Promise<void>;
21
- export {};
22
- //# sourceMappingURL=tileset.util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tileset.util.d.ts","sourceRoot":"","sources":["../../../src/cli/basemaps/tileset.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAC/G,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGrC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAU3C,wBAAgB,SAAS,CAAC,CAAC,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEvF;AAED,UAAU,mBAAmB;IAC3B,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,+BAAsC,CAAC;AAMhE,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CActG;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAc9G;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAItG"}
@@ -1,58 +0,0 @@
1
- import { TileSetType } from '@basemaps/config';
2
- import { Config } from '@basemaps/shared';
3
- import * as c from 'ansi-colors';
4
- import { CliTable } from '../cli.table.js';
5
- import { invalidateCache } from '../util.js';
6
- /**
7
- * Convert a number to a two digit hex string. numbers < 16 are padded with '0'
8
- */
9
- function numberToHexString(n) {
10
- const ans = n.toString(16);
11
- return ans.length === 1 ? '0' + ans : ans;
12
- }
13
- export function rgbaToHex(c) {
14
- return numberToHexString(c.r) + numberToHexString(c.g) + numberToHexString(c.b) + numberToHexString(c.alpha);
15
- }
16
- export const TileSetTable = new CliTable();
17
- TileSetTable.field('Imagery Id', 30, (obj) => c.dim(obj.imagery.id));
18
- TileSetTable.field('Name', 40, (obj) => obj.imagery.name);
19
- TileSetTable.field('Zoom', 10, (obj) => obj.layer.minZoom + ' -> ' + obj.layer.maxZoom);
20
- TileSetTable.field('CreatedAt', 10, (obj) => new Date(obj.imagery.createdAt).toISOString());
21
- export async function printTileSetImagery(tsData, projection) {
22
- const allImagery = await Config.getTileSetImagery(tsData);
23
- const ruleImagery = [];
24
- for (const layer of tsData.layers) {
25
- const imgId = Config.getImageId(layer, projection);
26
- if (imgId != null) {
27
- const imagery = allImagery.get(imgId);
28
- if (imagery == null)
29
- continue;
30
- ruleImagery.push({ layer, imagery });
31
- }
32
- }
33
- console.log('');
34
- TileSetTable.header();
35
- TileSetTable.print(ruleImagery);
36
- }
37
- export async function printTileSet(tsData, projection, printImagery = true) {
38
- console.log(c.bold('TileSet:'), `${tsData.name} `);
39
- console.log(c.bold('CreatedAt:'), new Date(tsData.createdAt).toISOString());
40
- console.log(c.bold('UpdatedAt:'), new Date(tsData.updatedAt).toISOString());
41
- if (tsData.type === TileSetType.Vector)
42
- return;
43
- if (tsData.background) {
44
- console.log(c.bold('Background'), tsData.background);
45
- }
46
- if (tsData.resizeKernel) {
47
- console.log(c.bold('ResizeKernel:'), c.dim('in'), tsData.resizeKernel.in, c.dim('out'), tsData.resizeKernel.out);
48
- }
49
- if (printImagery)
50
- await printTileSetImagery(tsData, projection);
51
- }
52
- /**
53
- * Invalidate the cloudfront distribution cache when updating imagery sets
54
- */
55
- export async function invalidateXYZCache(name, projection, commit = false) {
56
- const path = `/v1/tiles/${name}/${projection.toEpsgString()}/*`;
57
- return invalidateCache(path, commit);
58
- }
@@ -1,15 +0,0 @@
1
- /**
2
- * Simple fixed width table formatter
3
- */
4
- export declare class CliTable<T extends Record<string, any>> {
5
- fields: {
6
- name: string;
7
- width: number;
8
- value: (obj: T) => string;
9
- }[];
10
- field(name: string, width: number, value: (obj: T) => string): void;
11
- header(): void;
12
- line(obj: T): string;
13
- print(obj: T[]): void;
14
- }
15
- //# sourceMappingURL=cli.table.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.table.d.ts","sourceRoot":"","sources":["../../src/cli/cli.table.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACjD,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAA;KAAE,EAAE,CAAM;IAE1E,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI;IAInE,MAAM,IAAI,IAAI;IAId,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,MAAM;IAIpB,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,IAAI;CAGtB"}
@@ -1,21 +0,0 @@
1
- import * as c from 'ansi-colors';
2
- /**
3
- * Simple fixed width table formatter
4
- */
5
- export class CliTable {
6
- constructor() {
7
- this.fields = [];
8
- }
9
- field(name, width, value) {
10
- this.fields.push({ name, width, value });
11
- }
12
- header() {
13
- console.log(this.fields.map((f) => c.bold(f.name.substr(0, f.width).padEnd(f.width))).join('\t'));
14
- }
15
- line(obj) {
16
- return this.fields.map((f) => f.value(obj).padEnd(f.width)).join('\t');
17
- }
18
- print(obj) {
19
- obj.forEach((o) => console.log(this.line(o)));
20
- }
21
- }
@@ -1,37 +0,0 @@
1
- /** Commonly used definitions for cli args */
2
- export declare const TagActions: {
3
- readonly Version: {
4
- readonly argumentName: "VERSION";
5
- readonly parameterLongName: "--version";
6
- readonly parameterShortName: "-v";
7
- readonly description: "Version ID";
8
- readonly required: false;
9
- };
10
- readonly Commit: {
11
- readonly parameterLongName: "--commit";
12
- readonly description: "Commit to database";
13
- readonly required: false;
14
- };
15
- readonly Imagery: {
16
- readonly argumentName: "IMAGERY";
17
- readonly parameterLongName: "--imagery";
18
- readonly parameterShortName: "-i";
19
- readonly description: "Imagery ID";
20
- readonly required: false;
21
- };
22
- readonly TileSet: {
23
- readonly argumentName: "TILE_SET";
24
- readonly parameterLongName: "--tileset-name";
25
- readonly parameterShortName: "-n";
26
- readonly description: "Tileset name to use";
27
- readonly required: false;
28
- };
29
- readonly Projection: {
30
- readonly argumentName: "PROJECTION";
31
- readonly parameterLongName: "--projection";
32
- readonly parameterShortName: "-p";
33
- readonly description: "Projection to use";
34
- readonly required: false;
35
- };
36
- };
37
- //# sourceMappingURL=tag.action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tag.action.d.ts","sourceRoot":"","sources":["../../src/cli/tag.action.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCb,CAAC"}
@@ -1,36 +0,0 @@
1
- /** Commonly used definitions for cli args */
2
- export const TagActions = {
3
- Version: {
4
- argumentName: 'VERSION',
5
- parameterLongName: '--version',
6
- parameterShortName: '-v',
7
- description: 'Version ID',
8
- required: false,
9
- },
10
- Commit: {
11
- parameterLongName: '--commit',
12
- description: 'Commit to database',
13
- required: false,
14
- },
15
- Imagery: {
16
- argumentName: 'IMAGERY',
17
- parameterLongName: '--imagery',
18
- parameterShortName: '-i',
19
- description: 'Imagery ID',
20
- required: false,
21
- },
22
- TileSet: {
23
- argumentName: 'TILE_SET',
24
- parameterLongName: '--tileset-name',
25
- parameterShortName: '-n',
26
- description: 'Tileset name to use',
27
- required: false,
28
- },
29
- Projection: {
30
- argumentName: 'PROJECTION',
31
- parameterLongName: '--projection',
32
- parameterShortName: '-p',
33
- description: 'Projection to use',
34
- required: false,
35
- },
36
- };