@basemaps/lambda-tiler 6.19.0 → 6.20.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 (157) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +2 -2
  3. package/build/__test__/tile.style.json.test.d.ts +2 -0
  4. package/build/__test__/tile.style.json.test.d.ts.map +1 -0
  5. package/build/__test__/tile.style.json.test.js +33 -0
  6. package/build/__test__/xyz.test.js +24 -23
  7. package/build/cli/dump.js +2 -2
  8. package/build/index.d.ts.map +1 -1
  9. package/build/index.js +2 -0
  10. package/build/routes/esri/rest.d.ts +10 -0
  11. package/build/routes/esri/rest.d.ts.map +1 -0
  12. package/build/routes/esri/rest.js +87 -0
  13. package/build/routes/imagery.d.ts +2 -0
  14. package/build/routes/imagery.d.ts.map +1 -1
  15. package/build/routes/imagery.js +3 -1
  16. package/build/routes/response.d.ts +4 -0
  17. package/build/routes/response.d.ts.map +1 -0
  18. package/build/routes/response.js +3 -0
  19. package/build/routes/tile.d.ts +0 -20
  20. package/build/routes/tile.d.ts.map +1 -1
  21. package/build/routes/tile.js +11 -161
  22. package/build/routes/tile.json.d.ts +10 -0
  23. package/build/routes/tile.json.d.ts.map +1 -0
  24. package/build/routes/tile.json.js +31 -0
  25. package/build/routes/tile.style.json.d.ts +10 -0
  26. package/build/routes/tile.style.json.d.ts.map +1 -0
  27. package/build/routes/tile.style.json.js +74 -0
  28. package/build/routes/tile.wmts.d.ts +9 -0
  29. package/build/routes/tile.wmts.d.ts.map +1 -0
  30. package/build/routes/tile.wmts.js +57 -0
  31. package/build/routes/tile.xyz.d.ts +13 -0
  32. package/build/routes/tile.xyz.d.ts.map +1 -0
  33. package/build/routes/tile.xyz.js +28 -0
  34. package/build/tile.set.raster.d.ts +2 -0
  35. package/build/tile.set.raster.d.ts.map +1 -1
  36. package/build/tile.set.raster.js +3 -1
  37. package/build/tile.set.vector.js +1 -1
  38. package/dist/index.js +10545 -9583
  39. package/dist/node_modules/color/README.md +7 -7
  40. package/dist/node_modules/color/index.js +173 -158
  41. package/dist/node_modules/color/package.json +18 -16
  42. package/dist/node_modules/color-convert/conversions.js +281 -310
  43. package/dist/node_modules/color-convert/index.js +27 -24
  44. package/dist/node_modules/color-convert/package.json +16 -14
  45. package/dist/node_modules/color-convert/route.js +22 -22
  46. package/dist/node_modules/color-name/package.json +17 -14
  47. package/dist/node_modules/color-string/package.json +5 -5
  48. package/dist/node_modules/decompress-response/index.d.ts +14 -21
  49. package/dist/node_modules/decompress-response/index.js +34 -16
  50. package/dist/node_modules/decompress-response/license +1 -1
  51. package/dist/node_modules/decompress-response/package.json +23 -17
  52. package/dist/node_modules/decompress-response/readme.md +2 -6
  53. package/dist/node_modules/detect-libc/package.json +0 -1
  54. package/dist/node_modules/mimic-response/index.d.ts +2 -2
  55. package/dist/node_modules/mimic-response/index.js +41 -2
  56. package/dist/node_modules/mimic-response/package.json +17 -17
  57. package/dist/node_modules/mimic-response/readme.md +22 -1
  58. package/dist/node_modules/node-abi/.circleci/config.yml +63 -0
  59. package/dist/node_modules/node-abi/.releaserc.json +9 -0
  60. package/dist/node_modules/node-abi/abi_registry.json +39 -4
  61. package/dist/node_modules/node-abi/index.js +5 -2
  62. package/dist/node_modules/node-abi/package.json +17 -16
  63. package/dist/node_modules/node-abi/test/index.js +7 -15
  64. package/dist/node_modules/node-addon-api/README.md +2 -2
  65. package/dist/node_modules/node-addon-api/except.gypi +20 -11
  66. package/dist/node_modules/node-addon-api/napi-inl.h +734 -196
  67. package/dist/node_modules/node-addon-api/napi.h +420 -164
  68. package/dist/node_modules/node-addon-api/noexcept.gypi +21 -11
  69. package/dist/node_modules/node-addon-api/package.json +43 -14
  70. package/dist/node_modules/node-addon-api/tools/clang-format.js +18 -17
  71. package/dist/node_modules/node-addon-api/tools/eslint-format.js +71 -0
  72. package/dist/node_modules/prebuild-install/CHANGELOG.md +24 -7
  73. package/dist/node_modules/prebuild-install/README.md +24 -4
  74. package/dist/node_modules/prebuild-install/asset.js +10 -10
  75. package/dist/node_modules/prebuild-install/bin.js +13 -13
  76. package/dist/node_modules/prebuild-install/download.js +22 -22
  77. package/dist/node_modules/prebuild-install/log.js +4 -4
  78. package/dist/node_modules/prebuild-install/node_modules/detect-libc/LICENSE +201 -0
  79. package/dist/node_modules/prebuild-install/node_modules/detect-libc/README.md +160 -0
  80. package/dist/node_modules/prebuild-install/node_modules/detect-libc/index.d.ts +11 -0
  81. package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/detect-libc.js +178 -0
  82. package/dist/node_modules/prebuild-install/node_modules/detect-libc/lib/process.js +16 -0
  83. package/dist/node_modules/prebuild-install/node_modules/detect-libc/package.json +71 -0
  84. package/dist/node_modules/prebuild-install/package.json +18 -19
  85. package/dist/node_modules/prebuild-install/proxy.js +10 -10
  86. package/dist/node_modules/prebuild-install/rc.js +12 -12
  87. package/dist/node_modules/prebuild-install/util.js +14 -14
  88. package/dist/node_modules/semver/package.json +1 -0
  89. package/dist/node_modules/sharp/README.md +2 -2
  90. package/dist/node_modules/sharp/binding.gyp +12 -9
  91. package/dist/node_modules/sharp/build/Release/sharp-linux-x64.node +0 -0
  92. package/dist/node_modules/sharp/install/dll-copy.js +6 -6
  93. package/dist/node_modules/sharp/install/libvips.js +4 -8
  94. package/dist/node_modules/sharp/lib/channel.js +11 -7
  95. package/dist/node_modules/sharp/lib/colour.js +42 -1
  96. package/dist/node_modules/sharp/lib/constructor.js +18 -31
  97. package/dist/node_modules/sharp/lib/input.js +45 -3
  98. package/dist/node_modules/sharp/lib/is.js +19 -5
  99. package/dist/node_modules/sharp/lib/libvips.js +4 -19
  100. package/dist/node_modules/sharp/lib/operation.js +28 -5
  101. package/dist/node_modules/sharp/lib/output.js +147 -16
  102. package/dist/node_modules/sharp/lib/sharp.js +31 -0
  103. package/dist/node_modules/sharp/lib/utility.js +3 -2
  104. package/dist/node_modules/sharp/package.json +32 -23
  105. package/dist/node_modules/sharp/src/common.cc +67 -11
  106. package/dist/node_modules/sharp/src/common.h +25 -5
  107. package/dist/node_modules/sharp/src/libvips/cplusplus/VConnection.cpp +0 -26
  108. package/dist/node_modules/sharp/src/libvips/cplusplus/VImage.cpp +54 -16
  109. package/dist/node_modules/sharp/src/libvips/cplusplus/VInterpolate.cpp +0 -13
  110. package/dist/node_modules/sharp/src/libvips/cplusplus/vips-operators.cpp +185 -1
  111. package/dist/node_modules/sharp/src/metadata.cc +14 -0
  112. package/dist/node_modules/sharp/src/metadata.h +1 -0
  113. package/dist/node_modules/sharp/src/operations.cc +29 -3
  114. package/dist/node_modules/sharp/src/operations.h +13 -2
  115. package/dist/node_modules/sharp/src/pipeline.cc +103 -35
  116. package/dist/node_modules/sharp/src/pipeline.h +23 -3
  117. package/dist/node_modules/sharp/src/utilities.cc +1 -1
  118. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/THIRD-PARTY-NOTICES.md +2 -3
  119. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/lib/libvips-cpp.so.42 +0 -0
  120. package/dist/node_modules/sharp/vendor/{8.10.6 → 8.11.3/linux-x64}/platform.json +0 -0
  121. package/dist/node_modules/sharp/vendor/8.11.3/linux-x64/versions.json +30 -0
  122. package/dist/node_modules/simple-get/.github/dependabot.yml +15 -0
  123. package/dist/node_modules/simple-get/.github/workflows/ci.yml +23 -0
  124. package/dist/node_modules/simple-get/README.md +17 -3
  125. package/dist/node_modules/simple-get/index.js +9 -0
  126. package/dist/node_modules/simple-get/package.json +27 -13
  127. package/dist/package-lock.json +51 -51
  128. package/dist/package.json +9 -9
  129. package/package.json +10 -10
  130. package/src/__test__/tile.style.json.test.ts +40 -0
  131. package/src/__test__/xyz.test.ts +32 -30
  132. package/src/cli/dump.ts +2 -2
  133. package/src/index.ts +2 -0
  134. package/src/routes/esri/rest.ts +90 -0
  135. package/src/routes/imagery.ts +3 -1
  136. package/src/routes/response.ts +4 -0
  137. package/src/routes/tile.json.ts +44 -0
  138. package/src/routes/tile.style.json.ts +77 -0
  139. package/src/routes/tile.ts +11 -183
  140. package/src/routes/tile.wmts.ts +59 -0
  141. package/src/routes/tile.xyz.ts +30 -0
  142. package/src/tile.set.raster.ts +4 -1
  143. package/src/tile.set.vector.ts +1 -1
  144. package/tsconfig.tsbuildinfo +1 -1
  145. package/dist/node_modules/color-name/.eslintrc.json +0 -43
  146. package/dist/node_modules/color-name/test.js +0 -7
  147. package/dist/node_modules/node-abi/.travis.yml +0 -17
  148. package/dist/node_modules/node-abi/node_modules/semver/CHANGELOG.md +0 -39
  149. package/dist/node_modules/node-abi/node_modules/semver/LICENSE +0 -15
  150. package/dist/node_modules/node-abi/node_modules/semver/README.md +0 -412
  151. package/dist/node_modules/node-abi/node_modules/semver/bin/semver +0 -160
  152. package/dist/node_modules/node-abi/node_modules/semver/package.json +0 -60
  153. package/dist/node_modules/node-abi/node_modules/semver/range.bnf +0 -16
  154. package/dist/node_modules/node-abi/node_modules/semver/semver.js +0 -1483
  155. package/dist/node_modules/node-addon-api/CHANGELOG.md +0 -722
  156. package/dist/node_modules/sharp/build/Release/sharp.node +0 -0
  157. package/dist/node_modules/sharp/vendor/8.10.6/versions.json +0 -31
@@ -1,3 +1,4 @@
1
+ /*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
1
2
  module.exports = simpleGet
2
3
 
3
4
  const concat = require('simple-concat')
@@ -43,6 +44,7 @@ function simpleGet (opts, cb) {
43
44
  if (opts.json) opts.headers.accept = 'application/json'
44
45
  if (opts.method) opts.method = opts.method.toUpperCase()
45
46
 
47
+ const originalHost = opts.hostname // hostname before potential redirect
46
48
  const protocol = opts.protocol === 'https:' ? https : http // Support http/https urls
47
49
  const req = protocol.request(opts, res => {
48
50
  if (opts.followRedirects !== false && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
@@ -50,6 +52,13 @@ function simpleGet (opts, cb) {
50
52
  delete opts.headers.host // Discard `host` header on redirect (see #32)
51
53
  res.resume() // Discard response
52
54
 
55
+ const redirectHost = url.parse(opts.url).hostname // eslint-disable-line node/no-deprecated-api
56
+ // If redirected host is different than original host, drop headers to prevent cookie leak (#73)
57
+ if (redirectHost !== null && redirectHost !== originalHost) {
58
+ delete opts.headers.cookie
59
+ delete opts.headers.authorization
60
+ }
61
+
53
62
  if (opts.method === 'POST' && [301, 302].includes(res.statusCode)) {
54
63
  opts.method = 'GET' // On 301/302 redirect, change POST to GET (see #35)
55
64
  delete opts.headers['content-length']; delete opts.headers['content-type']
@@ -1,32 +1,32 @@
1
1
  {
2
- "_from": "simple-get@^3.1.0",
3
- "_id": "simple-get@3.1.0",
2
+ "_from": "simple-get@^4.0.0",
3
+ "_id": "simple-get@4.0.1",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==",
5
+ "_integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
6
6
  "_location": "/simple-get",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
9
  "type": "range",
10
10
  "registry": true,
11
- "raw": "simple-get@^3.1.0",
11
+ "raw": "simple-get@^4.0.0",
12
12
  "name": "simple-get",
13
13
  "escapedName": "simple-get",
14
- "rawSpec": "^3.1.0",
14
+ "rawSpec": "^4.0.0",
15
15
  "saveSpec": null,
16
- "fetchSpec": "^3.1.0"
16
+ "fetchSpec": "^4.0.0"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/prebuild-install",
20
20
  "/sharp"
21
21
  ],
22
- "_resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz",
23
- "_shasum": "b45be062435e50d159540b576202ceec40b9c6b3",
24
- "_spec": "simple-get@^3.1.0",
22
+ "_resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
23
+ "_shasum": "4a39db549287c979d352112fa03fd99fd6bc3543",
24
+ "_spec": "simple-get@^4.0.0",
25
25
  "_where": "/home/runner/work/basemaps/basemaps/packages/lambda-tiler/dist/node_modules/sharp",
26
26
  "author": {
27
27
  "name": "Feross Aboukhadijeh",
28
28
  "email": "feross@feross.org",
29
- "url": "http://feross.org/"
29
+ "url": "https://feross.org"
30
30
  },
31
31
  "browser": {
32
32
  "decompress-response": false
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "decompress-response": "^4.2.0",
39
+ "decompress-response": "^6.0.0",
40
40
  "once": "^1.3.1",
41
41
  "simple-concat": "^1.0.0"
42
42
  },
@@ -46,8 +46,22 @@
46
46
  "self-signed-https": "^1.0.5",
47
47
  "standard": "*",
48
48
  "string-to-stream": "^3.0.0",
49
- "tape": "^4.0.0"
49
+ "tape": "^5.0.0"
50
50
  },
51
+ "funding": [
52
+ {
53
+ "type": "github",
54
+ "url": "https://github.com/sponsors/feross"
55
+ },
56
+ {
57
+ "type": "patreon",
58
+ "url": "https://www.patreon.com/feross"
59
+ },
60
+ {
61
+ "type": "consulting",
62
+ "url": "https://feross.org/support"
63
+ }
64
+ ],
51
65
  "homepage": "https://github.com/feross/simple-get",
52
66
  "keywords": [
53
67
  "request",
@@ -75,5 +89,5 @@
75
89
  "scripts": {
76
90
  "test": "standard && tape test/*.js"
77
91
  },
78
- "version": "3.1.0"
92
+ "version": "4.0.1"
79
93
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basemaps/lambda-tiler",
3
- "version": "6.19.0",
3
+ "version": "6.20.0",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
@@ -70,26 +70,26 @@
70
70
  "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
71
71
  },
72
72
  "color": {
73
- "version": "3.2.1",
74
- "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
75
- "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
73
+ "version": "4.2.0",
74
+ "resolved": "https://registry.npmjs.org/color/-/color-4.2.0.tgz",
75
+ "integrity": "sha512-hHTcrbvEnGjC7WBMk6ibQWFVDgEFTVmjrz2Q5HlU6ltwxv0JJN2Z8I7uRbWeQLF04dikxs8zgyZkazRJvSMtyQ==",
76
76
  "requires": {
77
- "color-convert": "^1.9.3",
78
- "color-string": "^1.6.0"
77
+ "color-convert": "^2.0.1",
78
+ "color-string": "^1.9.0"
79
79
  }
80
80
  },
81
81
  "color-convert": {
82
- "version": "1.9.3",
83
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
84
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
82
+ "version": "2.0.1",
83
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
84
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
85
85
  "requires": {
86
- "color-name": "1.1.3"
86
+ "color-name": "~1.1.4"
87
87
  }
88
88
  },
89
89
  "color-name": {
90
- "version": "1.1.3",
91
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
92
- "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
90
+ "version": "1.1.4",
91
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
92
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
93
93
  },
94
94
  "color-string": {
95
95
  "version": "1.9.0",
@@ -111,11 +111,11 @@
111
111
  "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
112
112
  },
113
113
  "decompress-response": {
114
- "version": "4.2.1",
115
- "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz",
116
- "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==",
114
+ "version": "6.0.0",
115
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
116
+ "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
117
117
  "requires": {
118
- "mimic-response": "^2.0.0"
118
+ "mimic-response": "^3.1.0"
119
119
  }
120
120
  },
121
121
  "deep-extend": {
@@ -218,9 +218,9 @@
218
218
  }
219
219
  },
220
220
  "mimic-response": {
221
- "version": "2.1.0",
222
- "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz",
223
- "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA=="
221
+ "version": "3.1.0",
222
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
223
+ "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="
224
224
  },
225
225
  "minimist": {
226
226
  "version": "1.2.5",
@@ -238,24 +238,17 @@
238
238
  "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
239
239
  },
240
240
  "node-abi": {
241
- "version": "2.30.1",
242
- "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz",
243
- "integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==",
241
+ "version": "3.7.0",
242
+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.7.0.tgz",
243
+ "integrity": "sha512-3J+U4CvxVNEk9+lGdJkmYbN8cIN0HMTDT9R0ezX7pmp7aD6BaKsfAHwVn3IvVg6pYIRUuQ+gHW1eawrvywnSQQ==",
244
244
  "requires": {
245
- "semver": "^5.4.1"
246
- },
247
- "dependencies": {
248
- "semver": {
249
- "version": "5.7.1",
250
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
251
- "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
252
- }
245
+ "semver": "^7.3.5"
253
246
  }
254
247
  },
255
248
  "node-addon-api": {
256
- "version": "3.2.1",
257
- "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
258
- "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A=="
249
+ "version": "4.3.0",
250
+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz",
251
+ "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ=="
259
252
  },
260
253
  "npmlog": {
261
254
  "version": "4.1.2",
@@ -287,23 +280,30 @@
287
280
  }
288
281
  },
289
282
  "prebuild-install": {
290
- "version": "6.1.4",
291
- "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz",
292
- "integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==",
283
+ "version": "7.0.1",
284
+ "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.0.1.tgz",
285
+ "integrity": "sha512-QBSab31WqkyxpnMWQxubYAHR5S9B2+r81ucocew34Fkl98FhvKIF50jIJnNOBmAZfyNV7vE5T6gd3hTVWgY6tg==",
293
286
  "requires": {
294
- "detect-libc": "^1.0.3",
287
+ "detect-libc": "^2.0.0",
295
288
  "expand-template": "^2.0.3",
296
289
  "github-from-package": "0.0.0",
297
290
  "minimist": "^1.2.3",
298
291
  "mkdirp-classic": "^0.5.3",
299
292
  "napi-build-utils": "^1.0.1",
300
- "node-abi": "^2.21.0",
293
+ "node-abi": "^3.3.0",
301
294
  "npmlog": "^4.0.1",
302
295
  "pump": "^3.0.0",
303
296
  "rc": "^1.2.7",
304
- "simple-get": "^3.0.3",
297
+ "simple-get": "^4.0.0",
305
298
  "tar-fs": "^2.0.0",
306
299
  "tunnel-agent": "^0.6.0"
300
+ },
301
+ "dependencies": {
302
+ "detect-libc": {
303
+ "version": "2.0.0",
304
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.0.tgz",
305
+ "integrity": "sha512-S55LzUl8HUav8l9E2PBTlC5PAJrHK7tkM+XXFGD+fbsbkTzhCpG6K05LxJcUOEWzMa4v6ptcMZ9s3fOdJDu0Zw=="
306
+ }
307
307
  }
308
308
  },
309
309
  "process-nextick-args": {
@@ -364,16 +364,16 @@
364
364
  "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
365
365
  },
366
366
  "sharp": {
367
- "version": "0.28.3",
368
- "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.28.3.tgz",
369
- "integrity": "sha512-21GEP45Rmr7q2qcmdnjDkNP04Ooh5v0laGS5FDpojOO84D1DJwUijLiSq8XNNM6e8aGXYtoYRh3sVNdm8NodMA==",
367
+ "version": "0.29.3",
368
+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.29.3.tgz",
369
+ "integrity": "sha512-fKWUuOw77E4nhpyzCCJR1ayrttHoFHBT2U/kR/qEMRhvPEcluG4BKj324+SCO1e84+knXHwhJ1HHJGnUt4ElGA==",
370
370
  "requires": {
371
- "color": "^3.1.3",
371
+ "color": "^4.0.1",
372
372
  "detect-libc": "^1.0.3",
373
- "node-addon-api": "^3.2.0",
374
- "prebuild-install": "^6.1.2",
373
+ "node-addon-api": "^4.2.0",
374
+ "prebuild-install": "^7.0.0",
375
375
  "semver": "^7.3.5",
376
- "simple-get": "^3.1.0",
376
+ "simple-get": "^4.0.0",
377
377
  "tar-fs": "^2.1.1",
378
378
  "tunnel-agent": "^0.6.0"
379
379
  }
@@ -389,11 +389,11 @@
389
389
  "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="
390
390
  },
391
391
  "simple-get": {
392
- "version": "3.1.0",
393
- "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz",
394
- "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==",
392
+ "version": "4.0.1",
393
+ "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
394
+ "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
395
395
  "requires": {
396
- "decompress-response": "^4.2.0",
396
+ "decompress-response": "^6.0.0",
397
397
  "once": "^1.3.1",
398
398
  "simple-concat": "^1.0.0"
399
399
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basemaps/lambda-tiler",
3
- "version": "6.19.0",
3
+ "version": "6.20.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/linz/basemaps.git",
@@ -24,18 +24,18 @@
24
24
  "@basemaps/config": "^6.18.0",
25
25
  "@basemaps/geo": "^6.10.0",
26
26
  "@basemaps/lambda": "^6.7.0",
27
- "@basemaps/shared": "^6.18.0",
28
- "@basemaps/tiler": "^6.11.0",
29
- "@basemaps/tiler-sharp": "^6.16.1",
30
- "@chunkd/fs": "^7.3.1",
31
- "@cogeotiff/core": "^6.0.2",
32
- "@cotar/core": "^5.0.1",
27
+ "@basemaps/shared": "^6.20.0",
28
+ "@basemaps/tiler": "^6.20.0",
29
+ "@basemaps/tiler-sharp": "^6.20.0",
30
+ "@chunkd/fs": "^8.0.3",
31
+ "@cogeotiff/core": "^6.1.1",
32
+ "@cotar/core": "^5.1.1",
33
33
  "@linzjs/geojson": "^6.10.0",
34
34
  "@linzjs/lambda": "^2.0.0",
35
35
  "p-limit": "^4.0.0",
36
36
  "path-to-regexp": "^6.1.0",
37
37
  "pixelmatch": "^5.1.0",
38
- "sharp": "^0.28.3"
38
+ "sharp": "^0.29.3"
39
39
  },
40
40
  "bundle": {
41
41
  "entry": "src/index.ts",
@@ -56,7 +56,7 @@
56
56
  "@types/express": "^4.17.11",
57
57
  "@types/node": "^14.11.2",
58
58
  "@types/pixelmatch": "^5.0.0",
59
- "@types/sharp": "^0.28.0",
59
+ "@types/sharp": "^0.29.3",
60
60
  "express": "^4.17.1",
61
61
  "pretty-json-log": "^1.0.0"
62
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basemaps/lambda-tiler",
3
- "version": "6.19.0",
3
+ "version": "6.20.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/linz/basemaps.git",
@@ -25,18 +25,18 @@
25
25
  "@basemaps/config": "^6.18.0",
26
26
  "@basemaps/geo": "^6.10.0",
27
27
  "@basemaps/lambda": "^6.7.0",
28
- "@basemaps/shared": "^6.18.0",
29
- "@basemaps/tiler": "^6.11.0",
30
- "@basemaps/tiler-sharp": "^6.16.1",
31
- "@chunkd/fs": "^7.3.1",
32
- "@cogeotiff/core": "^6.0.2",
33
- "@cotar/core": "^5.0.1",
28
+ "@basemaps/shared": "^6.20.0",
29
+ "@basemaps/tiler": "^6.20.0",
30
+ "@basemaps/tiler-sharp": "^6.20.0",
31
+ "@chunkd/fs": "^8.0.3",
32
+ "@cogeotiff/core": "^6.1.1",
33
+ "@cotar/core": "^5.1.1",
34
34
  "@linzjs/geojson": "^6.10.0",
35
35
  "@linzjs/lambda": "^2.0.0",
36
36
  "p-limit": "^4.0.0",
37
37
  "path-to-regexp": "^6.1.0",
38
38
  "pixelmatch": "^5.1.0",
39
- "sharp": "^0.28.3"
39
+ "sharp": "^0.29.3"
40
40
  },
41
41
  "bundle": {
42
42
  "entry": "src/index.ts",
@@ -57,9 +57,9 @@
57
57
  "@types/express": "^4.17.11",
58
58
  "@types/node": "^14.11.2",
59
59
  "@types/pixelmatch": "^5.0.0",
60
- "@types/sharp": "^0.28.0",
60
+ "@types/sharp": "^0.29.3",
61
61
  "express": "^4.17.1",
62
62
  "pretty-json-log": "^1.0.0"
63
63
  },
64
- "gitHead": "87d778480368585d0f4a5a7546a2858882d8ab39"
64
+ "gitHead": "ca2a4b302477accd62e80f994d7ef12873808fe5"
65
65
  }
@@ -0,0 +1,40 @@
1
+ import { Env } from '@basemaps/shared';
2
+ import o from 'ospec';
3
+ import { convertRelativeUrl } from '../routes/tile.style.json.js';
4
+
5
+ o.spec('TileStyleJson', () => {
6
+ const host = 'https://tiles.test';
7
+ let originalHost: string | undefined;
8
+ o.beforeEach(() => {
9
+ originalHost = process.env[Env.PublicUrlBase];
10
+ process.env[Env.PublicUrlBase] = host;
11
+ });
12
+
13
+ o.afterEach(() => {
14
+ process.env[Env.PublicUrlBase] = originalHost;
15
+ });
16
+
17
+ o('should not convert empty urls', () => {
18
+ o(convertRelativeUrl()).equals('');
19
+ o(convertRelativeUrl('')).equals('');
20
+ o(convertRelativeUrl(undefined)).equals('');
21
+ });
22
+
23
+ o('should only convert relative urls', () => {
24
+ o(convertRelativeUrl('/foo')).equals('https://tiles.test/foo');
25
+ o(convertRelativeUrl('/bar/baz/')).equals('https://tiles.test/bar/baz/');
26
+ });
27
+
28
+ o('should only convert with api keys', () => {
29
+ o(convertRelativeUrl('/foo', 'abc')).equals('https://tiles.test/foo?api=abc');
30
+ o(convertRelativeUrl('/bar/baz/', 'abc')).equals('https://tiles.test/bar/baz/?api=abc');
31
+ });
32
+
33
+ o('should convert with other query params', () => {
34
+ o(convertRelativeUrl('/foo?bar=baz', 'abc')).equals('https://tiles.test/foo?bar=baz&api=abc');
35
+ });
36
+
37
+ o('should not convert full urls', () => {
38
+ o(convertRelativeUrl('https://foo.com/foo?bar=baz', 'abc')).equals('https://foo.com/foo?bar=baz');
39
+ });
40
+ });
@@ -3,17 +3,21 @@ import { TileMatrixSets } from '@basemaps/geo';
3
3
  import { Config, Env, LogConfig, VNodeParser } from '@basemaps/shared';
4
4
  import { round } from '@basemaps/test/build/rounding.js';
5
5
  import o from 'ospec';
6
+ import sinon from 'sinon';
6
7
  import { handleRequest } from '../index.js';
7
- import { TileComposer } from '../routes/tile.js';
8
8
  import { TileEtag } from '../routes/tile.etag.js';
9
9
  import { TileSets } from '../tile.set.cache.js';
10
+ import { TileComposer } from '../tile.set.raster.js';
10
11
  import { FakeTileSet, mockRequest, Provider } from './xyz.util.js';
11
- import sinon from 'sinon';
12
+
12
13
  const sandbox = sinon.createSandbox();
13
14
 
14
15
  const TileSetNames = ['aerial', 'aerial@head', 'aerial@beta', '01E7PJFR9AMQFJ05X9G7FQ3XMW'];
15
16
  /* eslint-disable @typescript-eslint/explicit-function-return-type */
16
17
  o.spec('LambdaXyz', () => {
18
+ const host = 'https://tiles.test';
19
+ const origPublicUrlBase = process.env[Env.PublicUrlBase];
20
+
17
21
  /** Generate mock ALBEvent */
18
22
 
19
23
  let rasterMock = o.spy();
@@ -26,6 +30,8 @@ o.spec('LambdaXyz', () => {
26
30
  const apiKeyHeader = { 'x-linz-api-key': 'd01f7w7rnhdzg0p7fyrc9v9ard1' };
27
31
 
28
32
  o.beforeEach(() => {
33
+ process.env[Env.PublicUrlBase] = host;
34
+
29
35
  LogConfig.disable();
30
36
  // tileMock = o.spy(() => tileMockData) as any;
31
37
  rasterMock = o.spy(() => {
@@ -54,6 +60,7 @@ o.spec('LambdaXyz', () => {
54
60
  TileSets.cache.clear();
55
61
  TileComposer.compose = origCompose;
56
62
  TileEtag.generate = origTileEtag;
63
+ process.env[Env.PublicUrlBase] = origPublicUrlBase;
57
64
  sandbox.restore();
58
65
  });
59
66
 
@@ -134,12 +141,8 @@ o.spec('LambdaXyz', () => {
134
141
  });
135
142
 
136
143
  o.spec('WMTSCapabilities', () => {
137
- const origPublicUrlBase = process.env[Env.PublicUrlBase];
138
- o.after(() => {
139
- process.env[Env.PublicUrlBase] = origPublicUrlBase;
140
- });
141
-
142
144
  o('should 304 if a xml is not modified', async () => {
145
+ delete process.env[Env.PublicUrlBase];
143
146
  o.timeout(1000);
144
147
  const key = 'NuirTK8fozzCJV1iG1FznmdHhKvk6WaWuDhhEA1d40c=';
145
148
  const request = mockRequest('/v1/tiles/WMTSCapabilities.xml', 'get', {
@@ -148,6 +151,7 @@ o.spec('LambdaXyz', () => {
148
151
  });
149
152
 
150
153
  const res = await handleRequest(request);
154
+
151
155
  if (res.status === 200) {
152
156
  o(res.header('eTaG')).equals(key); // this line is useful for discovering the new etag
153
157
  return;
@@ -160,9 +164,6 @@ o.spec('LambdaXyz', () => {
160
164
  });
161
165
 
162
166
  o('should serve WMTSCapabilities for tile_set', async () => {
163
- console.log('\n\nTestStart');
164
- process.env[Env.PublicUrlBase] = 'https://tiles.test';
165
-
166
167
  const request = mockRequest('/v1/tiles/aerial@beta/WMTSCapabilities.xml', 'get', apiKeyHeader);
167
168
 
168
169
  const res = await handleRequest(request);
@@ -185,13 +186,10 @@ o.spec('LambdaXyz', () => {
185
186
  });
186
187
 
187
188
  o.spec('tileJson', () => {
188
- const origPublicUrlBase = process.env[Env.PublicUrlBase];
189
- o.after(() => {
190
- process.env[Env.PublicUrlBase] = origPublicUrlBase;
191
- });
192
-
193
189
  o('should 304 if a json is not modified', async () => {
194
- const key = 'XecTdbcdjCyzB1MHOOQbrOkD2TTJ0ORh4JuXqhxXEE0=';
190
+ // delete process.env[Env.PublicUrlBase];
191
+
192
+ const key = 'BBfQpNXA3Q90jlFrLSOZhxbvfOh7OpN1OEE+BylpbHw=';
195
193
  const request = mockRequest('/v1/tiles/tile.json', 'get', { 'if-none-match': key, ...apiKeyHeader });
196
194
 
197
195
  const res = await handleRequest(request);
@@ -206,9 +204,19 @@ o.spec('LambdaXyz', () => {
206
204
  o(request.logContext['cache']).deepEquals({ key, match: key, hit: true });
207
205
  });
208
206
 
209
- o('should serve tile json for tile_set', async () => {
210
- process.env[Env.PublicUrlBase] = 'https://tiles.test';
207
+ o('should 200 if a invalid etag is given', async () => {
208
+ const key = 'ABCXecTdbcdjCyzB1MHOOQbrOkD2TTJ0ORh4JuXqhxXEE0=';
209
+ const request = mockRequest('/v1/tiles/tile.json', 'get', { 'if-none-match': key, ...apiKeyHeader });
210
+
211
+ const res = await handleRequest(request);
212
+ o(res.status).equals(200);
213
+ o(res.header('etag')).equals('BBfQpNXA3Q90jlFrLSOZhxbvfOh7OpN1OEE+BylpbHw=');
214
+ const out = JSON.parse(Buffer.from(res.body ?? '', 'base64').toString());
215
+ o(out.tiles[0].startsWith('https://tiles.test/v1/tiles/tile.json/undefined/{z}/{x}/{y}.pbf?api=')).equals(true);
216
+ o(request.logContext['cache']).deepEquals(undefined);
217
+ });
211
218
 
219
+ o('should serve tile json for tile_set', async () => {
212
220
  const request = mockRequest('/v1/tiles/topographic/Google/tile.json', 'get', apiKeyHeader);
213
221
 
214
222
  const res = await handleRequest(request);
@@ -228,14 +236,7 @@ o.spec('LambdaXyz', () => {
228
236
  });
229
237
 
230
238
  o.spec('styleJson', () => {
231
- const origPublicUrlBase = process.env[Env.PublicUrlBase];
232
- o.after(() => {
233
- process.env[Env.PublicUrlBase] = origPublicUrlBase;
234
- });
235
-
236
239
  o('should not found style json', async () => {
237
- process.env[Env.PublicUrlBase] = 'https://tiles.test';
238
-
239
240
  const request = mockRequest('/v1/tiles/topographic/Google/style/topographic.json', 'get', apiKeyHeader);
240
241
 
241
242
  sandbox.stub(Config.Style, 'get').resolves(null);
@@ -245,9 +246,6 @@ o.spec('LambdaXyz', () => {
245
246
  });
246
247
 
247
248
  o('should serve style json', async () => {
248
- const host = 'https://tiles.test';
249
- process.env[Env.PublicUrlBase] = host;
250
-
251
249
  const request = mockRequest('/v1/tiles/topographic/Google/style/topographic.json', 'get', apiKeyHeader);
252
250
 
253
251
  const fakeStyle: StyleJson = {
@@ -289,8 +287,8 @@ o.spec('LambdaXyz', () => {
289
287
  minzoom: 0,
290
288
  },
291
289
  ],
292
- glyphs: 'glyphs',
293
- sprite: 'sprite',
290
+ glyphs: '/glyphs',
291
+ sprite: '/sprite',
294
292
  metadata: { id: 'test' },
295
293
  };
296
294
 
@@ -320,6 +318,10 @@ o.spec('LambdaXyz', () => {
320
318
  type: 'raster',
321
319
  tiles: [`${host}/raster/{z}/{x}/{y}.webp?api=${apiKey}`],
322
320
  };
321
+
322
+ fakeStyle.sprite = `${host}/sprite`;
323
+ fakeStyle.glyphs = `${host}/glyphs`;
324
+
323
325
  o(JSON.parse(body)).deepEquals(fakeStyle);
324
326
  });
325
327
  });
package/src/cli/dump.ts CHANGED
@@ -4,7 +4,7 @@ import { ImageFormat } from '@basemaps/tiler';
4
4
  import { LambdaAlbRequest } from '@linzjs/lambda';
5
5
  import { Context } from 'aws-lambda';
6
6
  import { promises as fs } from 'fs';
7
- import { TileRoute } from '../routes/tile.js';
7
+ import { tileXyz } from '../routes/tile.xyz.js';
8
8
  import { TileSets } from '../tile.set.cache.js';
9
9
  import { TileSet } from '../tile.set.js';
10
10
  import { TileSetLocal } from './tile.set.local.js';
@@ -48,7 +48,7 @@ async function main(): Promise<void> {
48
48
  logger,
49
49
  );
50
50
 
51
- const tileData = await TileRoute.tile(ctx);
51
+ const tileData = await tileXyz(ctx);
52
52
 
53
53
  const headers: Record<string, any> = {};
54
54
  for (const [key, value] of tileData.headers) headers[key] = value;
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ import { Tiles } from './routes/tile.js';
6
6
  import { Router } from './router.js';
7
7
  import { createHash } from 'crypto';
8
8
  import { Imagery } from './routes/imagery.js';
9
+ import { Esri } from './routes/esri/rest.js';
9
10
 
10
11
  const app = new Router();
11
12
 
@@ -14,6 +15,7 @@ app.get('health', Health);
14
15
  app.get('version', Version);
15
16
  app.get('tiles', Tiles);
16
17
  app.get('imagery', Imagery);
18
+ app.get('esri', Esri);
17
19
 
18
20
  let slowTimer: NodeJS.Timer | null = null;
19
21
  export async function handleRequest(req: LambdaHttpRequest): Promise<LambdaHttpResponse> {