@tileflow/static 0.1.0-alpha.24 → 0.1.0-alpha.25

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/README.md CHANGED
@@ -237,3 +237,11 @@ logical operation, including a distinct-key cache reuse. Downloading an immutabl
237
237
  consumes zero units.
238
238
 
239
239
  Docs: https://tileflow.dev/docs
240
+
241
+ ## Team credentials
242
+
243
+ A Team credential can serve multiple Maps. Pass `mapId` in the options to `createStaticMap` or
244
+ `precacheStaticMap`; it must be a Managed Map ID such as `map_1234567890abcdef`. The client sends
245
+ `X-Tileflow-Map-Id` separately from the portable scene. `scene.map` remains the deployed environment
246
+ name. The Hosted API must support unified Team credentials and authorize the selected Map.
247
+ Existing Map-scoped keys remain usable without this option. Keep either key on a trusted server.
@@ -136,6 +136,12 @@ async function requestStaticMapUntilReady(request, options) {
136
136
  if (options.apiKey) {
137
137
  headers.Authorization = `Bearer ${options.apiKey}`;
138
138
  }
139
+ if (options.mapId !== void 0) {
140
+ if (!/^map_[A-Za-z0-9_-]{16}$/u.test(options.mapId)) {
141
+ throw new Error("Invalid Tileflow Map ID.");
142
+ }
143
+ headers["X-Tileflow-Map-Id"] = options.mapId;
144
+ }
139
145
  return runWithinStaticMapBudget(maxWaitMs, options.signal, async (signal) => {
140
146
  let operationId = null;
141
147
  while (true) {
package/dist/client.d.ts CHANGED
@@ -39,6 +39,7 @@ type StaticMapHostedResult = StaticMapResultBase & Readonly<{
39
39
  type StaticMapResult = StaticMapImageResult | StaticMapHostedResult;
40
40
  type StaticMapCreateOptions = {
41
41
  apiKey?: string;
42
+ mapId?: string;
42
43
  apiUrl?: string;
43
44
  fetch?: typeof fetch;
44
45
  idempotencyKey: string;
package/dist/client.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  staticMapHostedResultSchema,
11
11
  staticMapProcessingResultSchema,
12
12
  validateStaticMapIdempotencyKey
13
- } from "./chunk-N63IFMFM.js";
13
+ } from "./chunk-RGXE4HDY.js";
14
14
  import {
15
15
  StaticMapError,
16
16
  staticMapErrorResponseSchema
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  staticMapHostedResultSchema,
11
11
  staticMapProcessingResultSchema,
12
12
  validateStaticMapIdempotencyKey
13
- } from "./chunk-N63IFMFM.js";
13
+ } from "./chunk-RGXE4HDY.js";
14
14
  import {
15
15
  createRenderManifest,
16
16
  hashRenderManifest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tileflow/static",
3
- "version": "0.1.0-alpha.24",
3
+ "version": "0.1.0-alpha.25",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Static map request schemas and helpers for Tileflow.",
6
6
  "type": "module",