@basemaps/lambda-tiler 8.3.0 → 8.6.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/dist/index.js CHANGED
@@ -44838,7 +44838,7 @@ var require_GetObjectCommand = __commonJS({
44838
44838
  var types_1 = require_dist_cjs();
44839
44839
  var models_0_1 = require_models_0();
44840
44840
  var Aws_restXml_1 = require_Aws_restXml();
44841
- var GetObjectCommand3 = class _GetObjectCommand extends smithy_client_1.Command {
44841
+ var GetObjectCommand4 = class _GetObjectCommand extends smithy_client_1.Command {
44842
44842
  static getEndpointParameterInstructions() {
44843
44843
  return {
44844
44844
  Bucket: { type: "contextParams", name: "Bucket" },
@@ -44894,7 +44894,7 @@ var require_GetObjectCommand = __commonJS({
44894
44894
  return (0, Aws_restXml_1.de_GetObjectCommand)(output, context);
44895
44895
  }
44896
44896
  };
44897
- exports.GetObjectCommand = GetObjectCommand3;
44897
+ exports.GetObjectCommand = GetObjectCommand4;
44898
44898
  }
44899
44899
  });
44900
44900
 
@@ -49117,6 +49117,204 @@ var require_dist_cjs69 = __commonJS({
49117
49117
  }
49118
49118
  });
49119
49119
 
49120
+ // ../shared/node_modules/@aws-sdk/util-format-url/dist-cjs/index.js
49121
+ var require_dist_cjs70 = __commonJS({
49122
+ "../shared/node_modules/@aws-sdk/util-format-url/dist-cjs/index.js"(exports) {
49123
+ "use strict";
49124
+ Object.defineProperty(exports, "__esModule", { value: true });
49125
+ exports.formatUrl = void 0;
49126
+ var querystring_builder_1 = require_dist_cjs13();
49127
+ function formatUrl(request) {
49128
+ var _a2, _b;
49129
+ const { port, query } = request;
49130
+ let { protocol, path: path2, hostname } = request;
49131
+ if (protocol && protocol.slice(-1) !== ":") {
49132
+ protocol += ":";
49133
+ }
49134
+ if (port) {
49135
+ hostname += `:${port}`;
49136
+ }
49137
+ if (path2 && path2.charAt(0) !== "/") {
49138
+ path2 = `/${path2}`;
49139
+ }
49140
+ let queryString = query ? (0, querystring_builder_1.buildQueryString)(query) : "";
49141
+ if (queryString && queryString[0] !== "?") {
49142
+ queryString = `?${queryString}`;
49143
+ }
49144
+ let auth = "";
49145
+ if (request.username != null || request.password != null) {
49146
+ const username = (_a2 = request.username) !== null && _a2 !== void 0 ? _a2 : "";
49147
+ const password = (_b = request.password) !== null && _b !== void 0 ? _b : "";
49148
+ auth = `${username}:${password}@`;
49149
+ }
49150
+ let fragment = "";
49151
+ if (request.fragment) {
49152
+ fragment = `#${request.fragment}`;
49153
+ }
49154
+ return `${protocol}//${auth}${hostname}${path2}${queryString}${fragment}`;
49155
+ }
49156
+ exports.formatUrl = formatUrl;
49157
+ }
49158
+ });
49159
+
49160
+ // ../shared/node_modules/@aws-sdk/s3-request-presigner/dist-cjs/constants.js
49161
+ var require_constants11 = __commonJS({
49162
+ "../shared/node_modules/@aws-sdk/s3-request-presigner/dist-cjs/constants.js"(exports) {
49163
+ "use strict";
49164
+ Object.defineProperty(exports, "__esModule", { value: true });
49165
+ exports.ALGORITHM_IDENTIFIER = exports.HOST_HEADER = exports.EXPIRES_QUERY_PARAM = exports.SIGNED_HEADERS_QUERY_PARAM = exports.AMZ_DATE_QUERY_PARAM = exports.CREDENTIAL_QUERY_PARAM = exports.ALGORITHM_QUERY_PARAM = exports.SHA256_HEADER = exports.UNSIGNED_PAYLOAD = void 0;
49166
+ exports.UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
49167
+ exports.SHA256_HEADER = "X-Amz-Content-Sha256";
49168
+ exports.ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm";
49169
+ exports.CREDENTIAL_QUERY_PARAM = "X-Amz-Credential";
49170
+ exports.AMZ_DATE_QUERY_PARAM = "X-Amz-Date";
49171
+ exports.SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders";
49172
+ exports.EXPIRES_QUERY_PARAM = "X-Amz-Expires";
49173
+ exports.HOST_HEADER = "host";
49174
+ exports.ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256";
49175
+ }
49176
+ });
49177
+
49178
+ // ../shared/node_modules/@aws-sdk/s3-request-presigner/dist-cjs/presigner.js
49179
+ var require_presigner = __commonJS({
49180
+ "../shared/node_modules/@aws-sdk/s3-request-presigner/dist-cjs/presigner.js"(exports) {
49181
+ "use strict";
49182
+ Object.defineProperty(exports, "__esModule", { value: true });
49183
+ exports.S3RequestPresigner = void 0;
49184
+ var signature_v4_multi_region_1 = require_dist_cjs64();
49185
+ var constants_1 = require_constants11();
49186
+ var S3RequestPresigner = class {
49187
+ constructor(options) {
49188
+ const resolvedOptions = {
49189
+ service: options.signingName || options.service || "s3",
49190
+ uriEscapePath: options.uriEscapePath || false,
49191
+ applyChecksum: options.applyChecksum || false,
49192
+ ...options
49193
+ };
49194
+ this.signer = new signature_v4_multi_region_1.SignatureV4MultiRegion(resolvedOptions);
49195
+ }
49196
+ presign(requestToSign, { unsignableHeaders = /* @__PURE__ */ new Set(), unhoistableHeaders = /* @__PURE__ */ new Set(), ...options } = {}) {
49197
+ this.prepareRequest(requestToSign, {
49198
+ unsignableHeaders,
49199
+ unhoistableHeaders
49200
+ });
49201
+ return this.signer.presign(requestToSign, {
49202
+ expiresIn: 900,
49203
+ unsignableHeaders,
49204
+ unhoistableHeaders,
49205
+ ...options
49206
+ });
49207
+ }
49208
+ presignWithCredentials(requestToSign, credentials2, { unsignableHeaders = /* @__PURE__ */ new Set(), unhoistableHeaders = /* @__PURE__ */ new Set(), ...options } = {}) {
49209
+ this.prepareRequest(requestToSign, {
49210
+ unsignableHeaders,
49211
+ unhoistableHeaders
49212
+ });
49213
+ return this.signer.presignWithCredentials(requestToSign, credentials2, {
49214
+ expiresIn: 900,
49215
+ unsignableHeaders,
49216
+ unhoistableHeaders,
49217
+ ...options
49218
+ });
49219
+ }
49220
+ prepareRequest(requestToSign, { unsignableHeaders = /* @__PURE__ */ new Set(), unhoistableHeaders = /* @__PURE__ */ new Set() } = {}) {
49221
+ unsignableHeaders.add("content-type");
49222
+ Object.keys(requestToSign.headers).map((header) => header.toLowerCase()).filter((header) => header.startsWith("x-amz-server-side-encryption")).forEach((header) => {
49223
+ unhoistableHeaders.add(header);
49224
+ });
49225
+ requestToSign.headers[constants_1.SHA256_HEADER] = constants_1.UNSIGNED_PAYLOAD;
49226
+ const currentHostHeader = requestToSign.headers.host;
49227
+ const port = requestToSign.port;
49228
+ const expectedHostHeader = `${requestToSign.hostname}${requestToSign.port != null ? ":" + port : ""}`;
49229
+ if (!currentHostHeader || currentHostHeader === requestToSign.hostname && requestToSign.port != null) {
49230
+ requestToSign.headers.host = expectedHostHeader;
49231
+ }
49232
+ }
49233
+ };
49234
+ exports.S3RequestPresigner = S3RequestPresigner;
49235
+ }
49236
+ });
49237
+
49238
+ // ../shared/node_modules/@aws-sdk/s3-request-presigner/dist-cjs/getSignedUrl.js
49239
+ var require_getSignedUrl = __commonJS({
49240
+ "../shared/node_modules/@aws-sdk/s3-request-presigner/dist-cjs/getSignedUrl.js"(exports) {
49241
+ "use strict";
49242
+ Object.defineProperty(exports, "__esModule", { value: true });
49243
+ exports.getSignedUrl = void 0;
49244
+ var util_format_url_1 = require_dist_cjs70();
49245
+ var middleware_endpoint_1 = require_dist_cjs38();
49246
+ var protocol_http_1 = require_dist_cjs2();
49247
+ var presigner_1 = require_presigner();
49248
+ var getSignedUrl2 = async (client, command, options = {}) => {
49249
+ var _a2, _b;
49250
+ let s3Presigner;
49251
+ if (typeof client.config.endpointProvider === "function") {
49252
+ const endpointV2 = await (0, middleware_endpoint_1.getEndpointFromInstructions)(command.input, command.constructor, client.config);
49253
+ const authScheme = (_b = (_a2 = endpointV2.properties) === null || _a2 === void 0 ? void 0 : _a2.authSchemes) === null || _b === void 0 ? void 0 : _b[0];
49254
+ s3Presigner = new presigner_1.S3RequestPresigner({
49255
+ ...client.config,
49256
+ signingName: authScheme === null || authScheme === void 0 ? void 0 : authScheme.signingName,
49257
+ region: async () => authScheme === null || authScheme === void 0 ? void 0 : authScheme.signingRegion
49258
+ });
49259
+ } else {
49260
+ s3Presigner = new presigner_1.S3RequestPresigner(client.config);
49261
+ }
49262
+ const presignInterceptMiddleware = (next, context) => async (args) => {
49263
+ var _a3, _b2;
49264
+ const { request } = args;
49265
+ if (!protocol_http_1.HttpRequest.isInstance(request)) {
49266
+ throw new Error("Request to be presigned is not an valid HTTP request.");
49267
+ }
49268
+ delete request.headers["amz-sdk-invocation-id"];
49269
+ delete request.headers["amz-sdk-request"];
49270
+ delete request.headers["x-amz-user-agent"];
49271
+ let presigned2;
49272
+ const presignerOptions = {
49273
+ ...options,
49274
+ signingRegion: (_a3 = options.signingRegion) !== null && _a3 !== void 0 ? _a3 : context["signing_region"],
49275
+ signingService: (_b2 = options.signingService) !== null && _b2 !== void 0 ? _b2 : context["signing_service"]
49276
+ };
49277
+ if (context.s3ExpressIdentity) {
49278
+ presigned2 = await s3Presigner.presignWithCredentials(request, context.s3ExpressIdentity, presignerOptions);
49279
+ } else {
49280
+ presigned2 = await s3Presigner.presign(request, presignerOptions);
49281
+ }
49282
+ return {
49283
+ response: {},
49284
+ output: {
49285
+ $metadata: { httpStatusCode: 200 },
49286
+ presigned: presigned2
49287
+ }
49288
+ };
49289
+ };
49290
+ const middlewareName = "presignInterceptMiddleware";
49291
+ const clientStack = client.middlewareStack.clone();
49292
+ clientStack.addRelativeTo(presignInterceptMiddleware, {
49293
+ name: middlewareName,
49294
+ relation: "before",
49295
+ toMiddleware: "awsAuthMiddleware",
49296
+ override: true
49297
+ });
49298
+ const handler2 = command.resolveMiddleware(clientStack, client.config, {});
49299
+ const { output } = await handler2({ input: command.input });
49300
+ const { presigned } = output;
49301
+ return (0, util_format_url_1.formatUrl)(presigned);
49302
+ };
49303
+ exports.getSignedUrl = getSignedUrl2;
49304
+ }
49305
+ });
49306
+
49307
+ // ../shared/node_modules/@aws-sdk/s3-request-presigner/dist-cjs/index.js
49308
+ var require_dist_cjs71 = __commonJS({
49309
+ "../shared/node_modules/@aws-sdk/s3-request-presigner/dist-cjs/index.js"(exports) {
49310
+ "use strict";
49311
+ Object.defineProperty(exports, "__esModule", { value: true });
49312
+ var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
49313
+ tslib_1.__exportStar(require_getSignedUrl(), exports);
49314
+ tslib_1.__exportStar(require_presigner(), exports);
49315
+ }
49316
+ });
49317
+
49120
49318
  // ../../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/EndpointParameters.js
49121
49319
  var require_EndpointParameters4 = __commonJS({
49122
49320
  "../../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/endpoint/EndpointParameters.js"(exports) {
@@ -52666,7 +52864,7 @@ var require_models4 = __commonJS({
52666
52864
  });
52667
52865
 
52668
52866
  // ../../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/index.js
52669
- var require_dist_cjs70 = __commonJS({
52867
+ var require_dist_cjs72 = __commonJS({
52670
52868
  "../../node_modules/@aws-sdk/client-cognito-identity/dist-cjs/index.js"(exports) {
52671
52869
  "use strict";
52672
52870
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -52739,7 +52937,7 @@ var require_fromCognitoIdentity = __commonJS({
52739
52937
  "use strict";
52740
52938
  Object.defineProperty(exports, "__esModule", { value: true });
52741
52939
  exports.fromCognitoIdentity = void 0;
52742
- var client_cognito_identity_1 = require_dist_cjs70();
52940
+ var client_cognito_identity_1 = require_dist_cjs72();
52743
52941
  var property_provider_1 = require_dist_cjs25();
52744
52942
  var resolveLogins_1 = require_resolveLogins();
52745
52943
  function fromCognitoIdentity(parameters) {
@@ -52903,7 +53101,7 @@ var require_fromCognitoIdentityPool = __commonJS({
52903
53101
  "use strict";
52904
53102
  Object.defineProperty(exports, "__esModule", { value: true });
52905
53103
  exports.fromCognitoIdentityPool = void 0;
52906
- var client_cognito_identity_1 = require_dist_cjs70();
53104
+ var client_cognito_identity_1 = require_dist_cjs72();
52907
53105
  var property_provider_1 = require_dist_cjs25();
52908
53106
  var fromCognitoIdentity_1 = require_fromCognitoIdentity();
52909
53107
  var localStorage_1 = require_localStorage();
@@ -52948,7 +53146,7 @@ var require_fromCognitoIdentityPool = __commonJS({
52948
53146
  });
52949
53147
 
52950
53148
  // ../../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js
52951
- var require_dist_cjs71 = __commonJS({
53149
+ var require_dist_cjs73 = __commonJS({
52952
53150
  "../../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-cjs/index.js"(exports) {
52953
53151
  "use strict";
52954
53152
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -52967,8 +53165,8 @@ var require_fromCognitoIdentity2 = __commonJS({
52967
53165
  "use strict";
52968
53166
  Object.defineProperty(exports, "__esModule", { value: true });
52969
53167
  exports.fromCognitoIdentity = void 0;
52970
- var client_cognito_identity_1 = require_dist_cjs70();
52971
- var credential_provider_cognito_identity_1 = require_dist_cjs71();
53168
+ var client_cognito_identity_1 = require_dist_cjs72();
53169
+ var credential_provider_cognito_identity_1 = require_dist_cjs73();
52972
53170
  var fromCognitoIdentity = (options) => {
52973
53171
  var _a2;
52974
53172
  return (0, credential_provider_cognito_identity_1.fromCognitoIdentity)({
@@ -52986,8 +53184,8 @@ var require_fromCognitoIdentityPool2 = __commonJS({
52986
53184
  "use strict";
52987
53185
  Object.defineProperty(exports, "__esModule", { value: true });
52988
53186
  exports.fromCognitoIdentityPool = void 0;
52989
- var client_cognito_identity_1 = require_dist_cjs70();
52990
- var credential_provider_cognito_identity_1 = require_dist_cjs71();
53187
+ var client_cognito_identity_1 = require_dist_cjs72();
53188
+ var credential_provider_cognito_identity_1 = require_dist_cjs73();
52991
53189
  var fromCognitoIdentityPool = (options) => {
52992
53190
  var _a2;
52993
53191
  return (0, credential_provider_cognito_identity_1.fromCognitoIdentityPool)({
@@ -53208,7 +53406,7 @@ var require_fromHttp = __commonJS({
53208
53406
  });
53209
53407
 
53210
53408
  // ../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js
53211
- var require_dist_cjs72 = __commonJS({
53409
+ var require_dist_cjs74 = __commonJS({
53212
53410
  "../../node_modules/@aws-sdk/credential-provider-http/dist-cjs/index.js"(exports) {
53213
53411
  "use strict";
53214
53412
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -53378,7 +53576,7 @@ var require_fromWebToken2 = __commonJS({
53378
53576
  });
53379
53577
 
53380
53578
  // ../../node_modules/@aws-sdk/credential-providers/dist-cjs/index.js
53381
- var require_dist_cjs73 = __commonJS({
53579
+ var require_dist_cjs75 = __commonJS({
53382
53580
  "../../node_modules/@aws-sdk/credential-providers/dist-cjs/index.js"(exports) {
53383
53581
  "use strict";
53384
53582
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -53388,7 +53586,7 @@ var require_dist_cjs73 = __commonJS({
53388
53586
  tslib_1.__exportStar(require_fromCognitoIdentityPool2(), exports);
53389
53587
  tslib_1.__exportStar(require_fromContainerMetadata2(), exports);
53390
53588
  tslib_1.__exportStar(require_fromEnv3(), exports);
53391
- var credential_provider_http_1 = require_dist_cjs72();
53589
+ var credential_provider_http_1 = require_dist_cjs74();
53392
53590
  Object.defineProperty(exports, "fromHttp", { enumerable: true, get: function() {
53393
53591
  return credential_provider_http_1.fromHttp;
53394
53592
  } });
@@ -53453,7 +53651,7 @@ var require_AbortController = __commonJS({
53453
53651
  });
53454
53652
 
53455
53653
  // ../../node_modules/@smithy/abort-controller/dist-cjs/index.js
53456
- var require_dist_cjs74 = __commonJS({
53654
+ var require_dist_cjs76 = __commonJS({
53457
53655
  "../../node_modules/@smithy/abort-controller/dist-cjs/index.js"(exports) {
53458
53656
  "use strict";
53459
53657
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -53667,7 +53865,7 @@ var require_Upload = __commonJS({
53667
53865
  Object.defineProperty(exports, "__esModule", { value: true });
53668
53866
  exports.Upload = void 0;
53669
53867
  var client_s3_1 = require_dist_cjs69();
53670
- var abort_controller_1 = require_dist_cjs74();
53868
+ var abort_controller_1 = require_dist_cjs76();
53671
53869
  var middleware_endpoint_1 = require_dist_cjs38();
53672
53870
  var smithy_client_1 = require_dist_cjs16();
53673
53871
  var events_1 = require("events");
@@ -53940,7 +54138,7 @@ var require_types11 = __commonJS({
53940
54138
  });
53941
54139
 
53942
54140
  // ../../node_modules/@aws-sdk/lib-storage/dist-cjs/index.js
53943
- var require_dist_cjs75 = __commonJS({
54141
+ var require_dist_cjs77 = __commonJS({
53944
54142
  "../../node_modules/@aws-sdk/lib-storage/dist-cjs/index.js"(exports) {
53945
54143
  "use strict";
53946
54144
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -54701,7 +54899,7 @@ var require_EndpointCache = __commonJS({
54701
54899
  });
54702
54900
 
54703
54901
  // ../../node_modules/@aws-sdk/endpoint-cache/dist-cjs/index.js
54704
- var require_dist_cjs76 = __commonJS({
54902
+ var require_dist_cjs78 = __commonJS({
54705
54903
  "../../node_modules/@aws-sdk/endpoint-cache/dist-cjs/index.js"(exports) {
54706
54904
  "use strict";
54707
54905
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -54717,7 +54915,7 @@ var require_resolveEndpointDiscoveryConfig = __commonJS({
54717
54915
  "use strict";
54718
54916
  Object.defineProperty(exports, "__esModule", { value: true });
54719
54917
  exports.resolveEndpointDiscoveryConfig = void 0;
54720
- var endpoint_cache_1 = require_dist_cjs76();
54918
+ var endpoint_cache_1 = require_dist_cjs78();
54721
54919
  var resolveEndpointDiscoveryConfig = (input, { endpointDiscoveryCommandCtor }) => {
54722
54920
  var _a2;
54723
54921
  return {
@@ -54733,7 +54931,7 @@ var require_resolveEndpointDiscoveryConfig = __commonJS({
54733
54931
  });
54734
54932
 
54735
54933
  // ../../node_modules/@aws-sdk/middleware-endpoint-discovery/dist-cjs/index.js
54736
- var require_dist_cjs77 = __commonJS({
54934
+ var require_dist_cjs79 = __commonJS({
54737
54935
  "../../node_modules/@aws-sdk/middleware-endpoint-discovery/dist-cjs/index.js"(exports) {
54738
54936
  "use strict";
54739
54937
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -60213,7 +60411,7 @@ var require_runtimeConfig6 = __commonJS({
60213
60411
  var client_sts_1 = require_dist_cjs59();
60214
60412
  var core_1 = require_dist_cjs44();
60215
60413
  var credential_provider_node_1 = require_dist_cjs58();
60216
- var middleware_endpoint_discovery_1 = require_dist_cjs77();
60414
+ var middleware_endpoint_discovery_1 = require_dist_cjs79();
60217
60415
  var util_user_agent_node_1 = require_dist_cjs48();
60218
60416
  var config_resolver_1 = require_dist_cjs30();
60219
60417
  var hash_node_1 = require_dist_cjs49();
@@ -60292,7 +60490,7 @@ var require_DynamoDBClient = __commonJS({
60292
60490
  "use strict";
60293
60491
  Object.defineProperty(exports, "__esModule", { value: true });
60294
60492
  exports.DynamoDBClient = exports.__Client = void 0;
60295
- var middleware_endpoint_discovery_1 = require_dist_cjs77();
60493
+ var middleware_endpoint_discovery_1 = require_dist_cjs79();
60296
60494
  var middleware_host_header_1 = require_dist_cjs4();
60297
60495
  var middleware_logger_1 = require_dist_cjs5();
60298
60496
  var middleware_recursion_detection_1 = require_dist_cjs6();
@@ -63924,7 +64122,7 @@ var require_models5 = __commonJS({
63924
64122
  });
63925
64123
 
63926
64124
  // ../../node_modules/@aws-sdk/client-dynamodb/dist-cjs/index.js
63927
- var require_dist_cjs78 = __commonJS({
64125
+ var require_dist_cjs80 = __commonJS({
63928
64126
  "../../node_modules/@aws-sdk/client-dynamodb/dist-cjs/index.js"(exports) {
63929
64127
  "use strict";
63930
64128
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -64260,7 +64458,7 @@ var require_unmarshall = __commonJS({
64260
64458
  });
64261
64459
 
64262
64460
  // ../../node_modules/@aws-sdk/util-dynamodb/dist-cjs/index.js
64263
- var require_dist_cjs79 = __commonJS({
64461
+ var require_dist_cjs81 = __commonJS({
64264
64462
  "../../node_modules/@aws-sdk/util-dynamodb/dist-cjs/index.js"(exports) {
64265
64463
  "use strict";
64266
64464
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -80133,9 +80331,14 @@ var ConfigBase = z.object({
80133
80331
  /**
80134
80332
  * Was this configuration object generated from another object
80135
80333
  *
80136
- * @default undefined / false
80334
+ * tileset-all: All tileset contains all raster layers
80335
+ * tileset-alias: Alias that points to another tileset
80336
+ * imagery-name: Tileset that is identified by its imagery name
80337
+ * imagery-id: Tileset that is identified by its imagery id
80338
+ *
80339
+ * @default undefined
80137
80340
  */
80138
- virtual: z.boolean().optional()
80341
+ virtual: z.enum(["tileset-all", "tileset-alias", "imagery-name", "imagery-id"]).optional()
80139
80342
  });
80140
80343
 
80141
80344
  // ../config/build/config/tile.set.js
@@ -80458,14 +80661,25 @@ var ConfigProviderMemory = class _ConfigProviderMemory extends BasemapsConfigPro
80458
80661
  return cfg;
80459
80662
  }
80460
80663
  /** Find all imagery inside this configuration and create a virtual tile set for it */
80461
- createVirtualTileSets() {
80664
+ createVirtualTileSets(createById = true) {
80462
80665
  const allLayers = [];
80463
80666
  for (const obj of this.objects.values()) {
80464
80667
  if (isConfigImagery(obj)) {
80465
- this.put(_ConfigProviderMemory.imageryToTileSet(obj));
80668
+ if (createById)
80669
+ this.put(_ConfigProviderMemory.imageryToTileSet(obj));
80466
80670
  const tileSet = this.imageryToTileSetByName(obj);
80467
80671
  allLayers.push(tileSet.layers[0]);
80468
80672
  }
80673
+ if (this.TileSet.is(obj)) {
80674
+ if (obj.aliases) {
80675
+ for (const alias of obj.aliases) {
80676
+ const aliasTs = structuredClone(obj);
80677
+ aliasTs.id = ConfigId.prefix(ConfigPrefix.TileSet, alias);
80678
+ aliasTs.virtual = "tileset-alias";
80679
+ this.put(aliasTs);
80680
+ }
80681
+ }
80682
+ }
80469
80683
  }
80470
80684
  if (allLayers.length)
80471
80685
  this.createVirtualAllTileSet(allLayers);
@@ -80482,7 +80696,7 @@ var ConfigProviderMemory = class _ConfigProviderMemory extends BasemapsConfigPro
80482
80696
  }
80483
80697
  const allTileset = {
80484
80698
  type: TileSetType.Raster,
80485
- virtual: true,
80699
+ virtual: "tileset-all",
80486
80700
  id: "ts_all",
80487
80701
  name: "all",
80488
80702
  title: "All Imagery",
@@ -80499,7 +80713,7 @@ var ConfigProviderMemory = class _ConfigProviderMemory extends BasemapsConfigPro
80499
80713
  if (existing == null) {
80500
80714
  existing = {
80501
80715
  type: TileSetType.Raster,
80502
- virtual: true,
80716
+ virtual: "imagery-name",
80503
80717
  id: targetId,
80504
80718
  title: i.title,
80505
80719
  category: i.category,
@@ -80530,7 +80744,7 @@ var ConfigProviderMemory = class _ConfigProviderMemory extends BasemapsConfigPro
80530
80744
  static imageryToTileSet(i) {
80531
80745
  const ts = {
80532
80746
  type: TileSetType.Raster,
80533
- virtual: true,
80747
+ virtual: "imagery-id",
80534
80748
  id: ConfigId.prefix(ConfigPrefix.TileSet, ConfigId.unprefix(ConfigPrefix.Imagery, i.id)),
80535
80749
  name: i.name,
80536
80750
  title: i.title,
@@ -80597,6 +80811,7 @@ var MemoryConfigObject = class extends BasemapsConfigObject {
80597
80811
 
80598
80812
  // ../shared/build/file.system.js
80599
80813
  var import_client_s34 = __toESM(require_dist_cjs69(), 1);
80814
+ var import_s3_request_presigner = __toESM(require_dist_cjs71(), 1);
80600
80815
 
80601
80816
  // ../../node_modules/@chunkd/source/build/src/error.js
80602
80817
  var SourceError = class _SourceError extends Error {
@@ -81270,12 +81485,12 @@ var FsHttp = class {
81270
81485
 
81271
81486
  // ../../node_modules/@chunkd/fs-aws/build/src/credentials.js
81272
81487
  var import_client_s33 = __toESM(require_dist_cjs69(), 1);
81273
- var import_credential_providers = __toESM(require_dist_cjs73(), 1);
81488
+ var import_credential_providers = __toESM(require_dist_cjs75(), 1);
81274
81489
 
81275
81490
  // ../../node_modules/@chunkd/fs-aws/build/src/fs.s3.js
81276
81491
  var import_node_stream = require("stream");
81277
81492
  var import_client_s32 = __toESM(require_dist_cjs69(), 1);
81278
- var import_lib_storage = __toESM(require_dist_cjs75(), 1);
81493
+ var import_lib_storage = __toESM(require_dist_cjs77(), 1);
81279
81494
 
81280
81495
  // ../../node_modules/@chunkd/source-aws/build/src/index.js
81281
81496
  var import_client_s3 = __toESM(require_dist_cjs69(), 1);
@@ -81999,20 +82214,31 @@ function hasHostName(x) {
81999
82214
  }
82000
82215
 
82001
82216
  // ../shared/build/file.system.js
82002
- var s3Fs = new FsAwsS3(new import_client_s34.S3Client({
82217
+ var s3Client = new import_client_s34.S3Client({
82003
82218
  /**
82004
- * We buckets in multiple regions we do not know ahead of time which bucket is in what region
82219
+ * We have buckets in multiple regions. We don’t know ahead of time which region each bucket is in
82005
82220
  *
82006
- * So the S3 Client will have to follow the endpoints, this adds a bit of extra latency as requests have to be retried
82221
+ * So, the S3 Client will have to follow the endpoints. This adds a bit of extra latency as requests have to be retried
82007
82222
  */
82008
82223
  followRegionRedirects: true
82009
- }));
82224
+ });
82225
+ var s3Config = {
82226
+ client: s3Client,
82227
+ getSignedUrl: import_s3_request_presigner.getSignedUrl
82228
+ };
82229
+ var s3Fs = new FsAwsS3(s3Client);
82010
82230
  var s3FsPublic = new FsAwsS3(new import_client_s34.S3Client({
82011
82231
  followRegionRedirects: true,
82012
82232
  signer: {
82013
82233
  sign: (req) => Promise.resolve(req)
82014
82234
  }
82015
82235
  }));
82236
+ async function signS3Get(target) {
82237
+ if (target.protocol !== "s3:")
82238
+ throw new Error(`Presigning only works for S3 URLs, got ${target.href}`);
82239
+ const command = new import_client_s34.GetObjectCommand({ Bucket: target.host, Key: target.pathname.slice(1) });
82240
+ return await s3Config.getSignedUrl(s3Client, command, { expiresIn: 3600 });
82241
+ }
82016
82242
  function applyS3MiddleWare(fs4) {
82017
82243
  if (fs4.s3 == null)
82018
82244
  return;
@@ -82086,12 +82312,12 @@ function stringToUrlFolder(str) {
82086
82312
  }
82087
82313
 
82088
82314
  // ../shared/build/dynamo/dynamo.config.js
82089
- var import_client_dynamodb2 = __toESM(require_dist_cjs78(), 1);
82315
+ var import_client_dynamodb2 = __toESM(require_dist_cjs80(), 1);
82090
82316
  var import_util_retry = __toESM(require_dist_cjs40(), 1);
82091
82317
 
82092
82318
  // ../shared/build/dynamo/dynamo.config.base.js
82093
- var import_client_dynamodb = __toESM(require_dist_cjs78(), 1);
82094
- var import_util_dynamodb = __toESM(require_dist_cjs79(), 1);
82319
+ var import_client_dynamodb = __toESM(require_dist_cjs80(), 1);
82320
+ var import_util_dynamodb = __toESM(require_dist_cjs81(), 1);
82095
82321
  function toId(id) {
82096
82322
  return { id: { S: id } };
82097
82323
  }
@@ -87328,9 +87554,9 @@ var Router = class {
87328
87554
  };
87329
87555
 
87330
87556
  // ../../node_modules/@linzjs/lambda/build/src/function.js
87331
- var version2 = "v8.2.0-8-gfe8bbf9d";
87332
- var hash = "fe8bbf9d0a3ca2f590505924f227a6d9da0ea5a8";
87333
- var buildId = "15719849199-1";
87557
+ var version2 = "v8.5.0-5-gbd34894f";
87558
+ var hash = "bd34894f26d1c7827503e0cb9d48d0773ecd6775";
87559
+ var buildId = "16790799626-1";
87334
87560
  var versionInfo = { version: version2, hash, buildId };
87335
87561
  async function runFunction(req, fn) {
87336
87562
  if (!req.timer.timers.has("lambda"))
@@ -88182,6 +88408,40 @@ async function configImageryGet(req) {
88182
88408
  return sendJson(req, imagery);
88183
88409
  }
88184
88410
 
88411
+ // src/routes/export.tileset.ts
88412
+ async function exportTileSetGet(req) {
88413
+ Validate.apiKey(req);
88414
+ req.set("tileSet", req.params.tileSet);
88415
+ const tileMatrix = Validate.getTileMatrixSet(req.params.tileMatrix);
88416
+ if (tileMatrix == null)
88417
+ throw new LambdaHttpResponse(404, "Tile Matrix not found");
88418
+ req.set("tileMatrix", tileMatrix.identifier);
88419
+ req.set("projection", tileMatrix.projection.code);
88420
+ const config = await ConfigLoader.load(req);
88421
+ req.timer.start("tileset:load");
88422
+ const tileSet = await config.TileSet.get(config.TileSet.id(req.params.tileSet));
88423
+ req.timer.end("tileset:load");
88424
+ if (tileSet == null)
88425
+ return NotFound();
88426
+ if (tileSet.layers.length > 1) {
88427
+ return new LambdaHttpResponse(500, `Too many layers in vector tileset ${tileSet.layers.length}`);
88428
+ }
88429
+ const epsgCode = tileMatrix.projection.code;
88430
+ const layerId = tileSet.layers[0][epsgCode];
88431
+ if (layerId == null)
88432
+ return new LambdaHttpResponse(404, `No data found for tile matrix: ${tileMatrix.identifier}`);
88433
+ if (!layerId.startsWith("s3://"))
88434
+ return new LambdaHttpResponse(400, `Unable to export tilesets not inside of S3`);
88435
+ if (!layerId.endsWith(".tar.co"))
88436
+ return new LambdaHttpResponse(400, `Unable to export tileset`);
88437
+ const target = new URL(layerId.replace(".tar.co", ".mbtiles"));
88438
+ const exists = await fsa.exists(target);
88439
+ if (!exists)
88440
+ return NotFound();
88441
+ const presignedUrl = await signS3Get(target);
88442
+ return new LambdaHttpResponse(302, "Moved", { location: presignedUrl });
88443
+ }
88444
+
88185
88445
  // src/util/source.cache.ts
88186
88446
  var SourceCache2 = class {
88187
88447
  constructor(maxSize) {
@@ -91680,18 +91940,18 @@ async function versionGet(req) {
91680
91940
  * last git version tag
91681
91941
  * @example "v6.42.1"
91682
91942
  */
91683
- version: "v8.2.0-8-gfe8bbf9d",
91943
+ version: "v8.5.0-5-gbd34894f",
91684
91944
  /**
91685
91945
  * Full git commit hash
91686
91946
  * @example "e4231b1ee62c276c8657c56677ced02681dfe5d6"
91687
91947
  */
91688
- hash: "fe8bbf9d0a3ca2f590505924f227a6d9da0ea5a8",
91948
+ hash: "bd34894f26d1c7827503e0cb9d48d0773ecd6775",
91689
91949
  /**
91690
91950
  *
91691
91951
  * The exact build that this release was run from
91692
91952
  * @example "1658821493-3"
91693
91953
  */
91694
- buildId: "15719849199-1",
91954
+ buildId: "16790799626-1",
91695
91955
  /**
91696
91956
  * Configuration id that was used to power this config
91697
91957
  * @example { "id": "cb_01JTQ7ZK49F8EY4N5DRJ3XFT73", hash: "HcByZ8WS2zpaTxFJp6wSKg2eUpwahLqAGEQdcDxKxqp6" }
@@ -91761,6 +92021,7 @@ handler.router.get("/v1/attribution/:tileSet/:tileMatrix/summary.json", tileAttr
91761
92021
  handler.router.get("/v1/tiles/:tileSet/:tileMatrix/WMTSCapabilities.xml", wmtsCapabilitiesGet);
91762
92022
  handler.router.get("/v1/tiles/:tileSet/WMTSCapabilities.xml", wmtsCapabilitiesGet);
91763
92023
  handler.router.get("/v1/tiles/WMTSCapabilities.xml", wmtsCapabilitiesGet);
92024
+ handler.router.get("/v1/export/:tileSet/:tileMatrix.:extension", exportTileSetGet);
91764
92025
  // Annotate the CommonJS export names for ESM import in node:
91765
92026
  0 && (module.exports = {
91766
92027
  handler
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basemaps/lambda-tiler",
3
- "version": "8.3.0",
3
+ "version": "8.6.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@basemaps/lambda-tiler",
3
- "version": "8.3.0",
3
+ "version": "8.6.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@basemaps/lambda-tiler",
9
- "version": "8.3.0",
9
+ "version": "8.6.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "lerc": "4.0.4",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basemaps/lambda-tiler",
3
- "version": "8.3.0",
3
+ "version": "8.6.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/linz/basemaps.git",