@tileflow/static 0.1.0-alpha.22 → 0.1.0-alpha.24
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 +91 -17
- package/dist/chunk-6DWVCK64.js +406 -0
- package/dist/chunk-HVVIAOBE.js +175 -0
- package/dist/{chunk-MSQ4OLKA.js → chunk-N63IFMFM.js} +22 -22
- package/dist/{chunk-EMCKSFZV.js → chunk-TBI5AED6.js} +172 -52
- package/dist/{chunk-TQMKOTBE.js → chunk-XMT7VJL5.js} +70 -60
- package/dist/client.d.ts +19 -25
- package/dist/client.js +10 -7
- package/dist/errors-B9rwehK0.d.ts +21 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +35 -23
- package/dist/manifest.d.ts +234 -373
- package/dist/manifest.js +9 -15
- package/dist/overlays.d.ts +9 -3
- package/dist/overlays.js +6 -4
- package/dist/scene-contract-Cr6BNLz0.d.ts +734 -0
- package/dist/scene.d.ts +91 -10
- package/dist/scene.js +17 -3
- package/package.json +4 -7
- package/GENERATED_OUTPUT_LICENSE.md +0 -21
- package/NOTICE +0 -9
- package/TRADEMARKS.md +0 -10
- package/dist/chunk-EPOYQNNT.js +0 -122
- package/dist/chunk-NM2JSFUF.js +0 -252
- package/dist/scene-contract-OMIOisSB.d.ts +0 -204
|
@@ -3,21 +3,22 @@ import {
|
|
|
3
3
|
normalizeStaticScene,
|
|
4
4
|
staticAutoFitPlanSchema,
|
|
5
5
|
validateStaticScene
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TBI5AED6.js";
|
|
7
7
|
import {
|
|
8
8
|
hashStableValue,
|
|
9
9
|
isSafeHttpUrl,
|
|
10
10
|
jsonByteLength,
|
|
11
11
|
stableStringify,
|
|
12
|
+
staticOverlayPlacements,
|
|
12
13
|
staticSceneSchema,
|
|
13
14
|
stripUndefined
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6DWVCK64.js";
|
|
15
16
|
|
|
16
17
|
// src/manifest.ts
|
|
17
18
|
import { z } from "zod";
|
|
18
|
-
var
|
|
19
|
-
var staticRendererSchemaVersion = 2;
|
|
19
|
+
var staticRendererSchemaVersion = 1;
|
|
20
20
|
var staticAttributionPlanSchemaVersion = 1;
|
|
21
|
+
var staticRenderCompositionSchemaVersion = 1;
|
|
21
22
|
var staticAttributionLimits = {
|
|
22
23
|
maxBytes: 32 * 1024,
|
|
23
24
|
maxEntries: 18,
|
|
@@ -99,7 +100,7 @@ var staticAttributionEntrySchema = z.object({
|
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
102
|
});
|
|
102
|
-
var
|
|
103
|
+
var staticAttributionPlanSchema = z.object({
|
|
103
104
|
entries: z.array(staticAttributionEntrySchema).max(staticAttributionLimits.maxEntries),
|
|
104
105
|
mode: z.enum(["embedded", "external"]),
|
|
105
106
|
position: z.union([z.literal("auto"), staticResolvedAttributionPositionSchema, z.null()]),
|
|
@@ -119,45 +120,58 @@ var staticAttributionPlanSchemaV1 = z.object({
|
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
122
|
});
|
|
123
|
+
var placementAnchorsSchema = z.object({
|
|
124
|
+
"above-water": z.string().min(1).max(256).nullable(),
|
|
125
|
+
"below-roads": z.string().min(1).max(256).nullable(),
|
|
126
|
+
"above-roads": z.string().min(1).max(256).nullable(),
|
|
127
|
+
"above-buildings": z.string().min(1).max(256).nullable(),
|
|
128
|
+
"below-labels": z.string().min(1).max(256).nullable(),
|
|
129
|
+
"above-labels": z.null()
|
|
130
|
+
}).strict().refine(anchorsHaveTerminalNulls, {
|
|
131
|
+
message: "Placement anchors may become null only at the end of semantic order"
|
|
132
|
+
});
|
|
133
|
+
var resolvedIconSchema = z.object({
|
|
134
|
+
height: z.number().int().positive().max(2048),
|
|
135
|
+
icon: z.string().max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u),
|
|
136
|
+
overlayIndex: z.number().int().min(0).max(23),
|
|
137
|
+
width: z.number().int().positive().max(2048)
|
|
138
|
+
}).strict();
|
|
139
|
+
var staticRenderCompositionSchema = z.object({
|
|
140
|
+
anchors: placementAnchorsSchema,
|
|
141
|
+
icons: z.array(resolvedIconSchema).max(24),
|
|
142
|
+
schemaVersion: z.literal(staticRenderCompositionSchemaVersion)
|
|
143
|
+
}).strict().refine(
|
|
144
|
+
(composition) => composition.icons.every(
|
|
145
|
+
(icon, index) => index === 0 || composition.icons[index - 1].overlayIndex < icon.overlayIndex
|
|
146
|
+
),
|
|
147
|
+
{ message: "Resolved symbol icons must be unique and sorted by overlay index" }
|
|
148
|
+
);
|
|
122
149
|
var staticRenderManifestBaseShape = {
|
|
150
|
+
attribution: staticAttributionPlanSchema,
|
|
123
151
|
autoFit: staticAutoFitPlanSchema.optional(),
|
|
152
|
+
composition: staticRenderCompositionSchema,
|
|
124
153
|
mapId: z.string().trim().min(1).max(128),
|
|
125
154
|
rendererVersion: z.string().trim().min(1).max(64),
|
|
155
|
+
schemaVersion: z.literal(staticRendererSchemaVersion),
|
|
156
|
+
scene: staticSceneSchema,
|
|
126
157
|
styleId: z.string().trim().min(1).max(128).optional(),
|
|
127
158
|
styleRevision: z.string().trim().min(1).max(128),
|
|
128
159
|
styleUrl: z.string().trim().url().max(512).refine(isSafeHttpUrl, {
|
|
129
160
|
message: "Expected an http(s) style URL without credentials or a fragment"
|
|
130
161
|
})
|
|
131
162
|
};
|
|
132
|
-
var
|
|
133
|
-
var staticRenderManifestV1Schema = z.object({
|
|
134
|
-
...staticRenderManifestBaseShape,
|
|
135
|
-
schemaVersion: z.literal(staticRendererSchemaVersionV1),
|
|
136
|
-
scene: staticSceneSchemaV1
|
|
137
|
-
});
|
|
138
|
-
var staticRenderManifestV2Schema = z.object({
|
|
139
|
-
...staticRenderManifestBaseShape,
|
|
140
|
-
attribution: staticAttributionPlanSchemaV1,
|
|
141
|
-
schemaVersion: z.literal(staticRendererSchemaVersion),
|
|
142
|
-
scene: staticSceneSchema
|
|
143
|
-
}).strict();
|
|
144
|
-
var staticRenderManifestSchema = z.discriminatedUnion("schemaVersion", [
|
|
145
|
-
staticRenderManifestV1Schema,
|
|
146
|
-
staticRenderManifestV2Schema
|
|
147
|
-
]);
|
|
163
|
+
var staticRenderManifestSchema = z.object(staticRenderManifestBaseShape).strict();
|
|
148
164
|
function validateStaticRenderManifest(input) {
|
|
149
165
|
if (!input || typeof input !== "object" || Array.isArray(input)) {
|
|
150
166
|
return { error: "manifest: Expected an object", ok: false };
|
|
151
167
|
}
|
|
152
|
-
|
|
153
|
-
if (schemaVersion !== staticRendererSchemaVersionV1 && schemaVersion !== staticRendererSchemaVersion) {
|
|
168
|
+
if (input.schemaVersion !== staticRendererSchemaVersion) {
|
|
154
169
|
return { error: "manifest.schemaVersion: Unsupported renderer schema version", ok: false };
|
|
155
170
|
}
|
|
156
171
|
const rawScene = input.scene;
|
|
157
|
-
const sceneValidation =
|
|
172
|
+
const sceneValidation = validateStaticScene(rawScene);
|
|
158
173
|
if (!sceneValidation.ok) return sceneValidation;
|
|
159
|
-
const
|
|
160
|
-
const parsed = schema.safeParse({
|
|
174
|
+
const parsed = staticRenderManifestSchema.safeParse({
|
|
161
175
|
...input,
|
|
162
176
|
scene: sceneValidation.scene
|
|
163
177
|
});
|
|
@@ -166,12 +180,18 @@ function validateStaticRenderManifest(input) {
|
|
|
166
180
|
if (autoFit === void 0 !== (parsed.data.autoFit === void 0) || autoFit !== void 0 && stableStringify(autoFit) !== stableStringify(parsed.data.autoFit)) {
|
|
167
181
|
return { error: "manifest.autoFit: Expected the exact plan derived from scene", ok: false };
|
|
168
182
|
}
|
|
169
|
-
if (
|
|
183
|
+
if (!attributionMatchesScene(parsed.data.attribution, sceneValidation.scene)) {
|
|
170
184
|
return {
|
|
171
185
|
error: "manifest.attribution: Expected the exact request resolved from scene",
|
|
172
186
|
ok: false
|
|
173
187
|
};
|
|
174
188
|
}
|
|
189
|
+
if (!compositionMatchesScene(parsed.data.composition, sceneValidation.scene)) {
|
|
190
|
+
return {
|
|
191
|
+
error: "manifest.composition: Expected exact resolved symbol icon references",
|
|
192
|
+
ok: false
|
|
193
|
+
};
|
|
194
|
+
}
|
|
175
195
|
return {
|
|
176
196
|
manifest: {
|
|
177
197
|
...parsed.data,
|
|
@@ -181,31 +201,14 @@ function validateStaticRenderManifest(input) {
|
|
|
181
201
|
ok: true
|
|
182
202
|
};
|
|
183
203
|
}
|
|
184
|
-
function
|
|
185
|
-
const rawScene = staticSceneSchemaV1.parse(input.scene);
|
|
186
|
-
const scene = normalizeStaticScene(rawScene);
|
|
187
|
-
const autoFit = expectedAutoFit(scene);
|
|
188
|
-
return staticRenderManifestV1Schema.parse(
|
|
189
|
-
stripUndefined({
|
|
190
|
-
autoFit,
|
|
191
|
-
mapId: input.mapId,
|
|
192
|
-
rendererVersion: input.rendererVersion,
|
|
193
|
-
schemaVersion: staticRendererSchemaVersionV1,
|
|
194
|
-
scene,
|
|
195
|
-
styleId: input.styleId,
|
|
196
|
-
styleRevision: input.styleRevision,
|
|
197
|
-
styleUrl: input.styleUrl
|
|
198
|
-
})
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
var createRenderManifest = createRenderManifestV1;
|
|
202
|
-
function createRenderManifestV2(input) {
|
|
204
|
+
function createRenderManifest(input) {
|
|
203
205
|
const scene = normalizeStaticScene(input.scene);
|
|
204
206
|
const autoFit = expectedAutoFit(scene);
|
|
205
|
-
return
|
|
207
|
+
return staticRenderManifestSchema.parse(
|
|
206
208
|
stripUndefined({
|
|
207
209
|
attribution: input.attribution,
|
|
208
210
|
autoFit,
|
|
211
|
+
composition: input.composition,
|
|
209
212
|
mapId: input.mapId,
|
|
210
213
|
rendererVersion: input.rendererVersion,
|
|
211
214
|
schemaVersion: staticRendererSchemaVersion,
|
|
@@ -226,25 +229,35 @@ async function hashStaticSceneRequest(scene) {
|
|
|
226
229
|
if (!validation.ok) throw new Error(`Invalid Tileflow static scene: ${validation.error}`);
|
|
227
230
|
return hashStableValue(validation.scene);
|
|
228
231
|
}
|
|
229
|
-
function validateVersionedScene(input, version) {
|
|
230
|
-
if (version === 1 && input && typeof input === "object" && !Array.isArray(input)) {
|
|
231
|
-
const { attribution: _attribution, ...legacy } = input;
|
|
232
|
-
return validateStaticScene(legacy);
|
|
233
|
-
}
|
|
234
|
-
return validateStaticScene(input);
|
|
235
|
-
}
|
|
236
232
|
function attributionMatchesScene(plan, scene) {
|
|
237
233
|
const request = scene.attribution;
|
|
238
234
|
const expectedMode = request?.mode === "external" ? "external" : "embedded";
|
|
239
235
|
const expectedPosition = expectedMode === "external" ? null : request && "position" in request ? request.position ?? "auto" : "auto";
|
|
240
236
|
return plan.mode === expectedMode && plan.position === expectedPosition;
|
|
241
237
|
}
|
|
238
|
+
function compositionMatchesScene(composition, scene) {
|
|
239
|
+
const expected = scene.overlays.flatMap(
|
|
240
|
+
(overlay, overlayIndex) => overlay.type === "symbol" && overlay.icon ? [{ icon: overlay.icon, overlayIndex }] : []
|
|
241
|
+
);
|
|
242
|
+
return expected.length === composition.icons.length && expected.every(
|
|
243
|
+
(icon, index) => composition.icons[index]?.icon === icon.icon && composition.icons[index]?.overlayIndex === icon.overlayIndex
|
|
244
|
+
);
|
|
245
|
+
}
|
|
242
246
|
function expectedAutoFit(scene) {
|
|
243
247
|
if (scene.camera.type !== "auto") return void 0;
|
|
244
248
|
const analysis = analyzeStaticAutoFit(scene);
|
|
245
249
|
if (!analysis.ok) throw new Error(`Invalid Tileflow auto-fit scene: ${analysis.error}`);
|
|
246
250
|
return analysis.plan;
|
|
247
251
|
}
|
|
252
|
+
function anchorsHaveTerminalNulls(anchors) {
|
|
253
|
+
let sawNull = false;
|
|
254
|
+
for (const placement of staticOverlayPlacements) {
|
|
255
|
+
const anchor = anchors[placement];
|
|
256
|
+
if (anchor === null) sawNull = true;
|
|
257
|
+
else if (sawNull) return false;
|
|
258
|
+
}
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
248
261
|
function hasNoControlCharacters(value) {
|
|
249
262
|
return !Array.from(value).some((character) => {
|
|
250
263
|
const codePoint = character.codePointAt(0) ?? 0;
|
|
@@ -267,21 +280,18 @@ function zodFailure(error) {
|
|
|
267
280
|
}
|
|
268
281
|
|
|
269
282
|
export {
|
|
270
|
-
staticRendererSchemaVersionV1,
|
|
271
283
|
staticRendererSchemaVersion,
|
|
272
284
|
staticAttributionPlanSchemaVersion,
|
|
285
|
+
staticRenderCompositionSchemaVersion,
|
|
273
286
|
staticAttributionLimits,
|
|
274
287
|
staticAttributionSegmentSchema,
|
|
275
288
|
staticAttributionProvenanceSchema,
|
|
276
289
|
staticAttributionEntrySchema,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
staticRenderManifestV2Schema,
|
|
290
|
+
staticAttributionPlanSchema,
|
|
291
|
+
staticRenderCompositionSchema,
|
|
280
292
|
staticRenderManifestSchema,
|
|
281
293
|
validateStaticRenderManifest,
|
|
282
|
-
createRenderManifestV1,
|
|
283
294
|
createRenderManifest,
|
|
284
|
-
createRenderManifestV2,
|
|
285
295
|
hashRenderManifest,
|
|
286
296
|
hashStaticSceneRequest
|
|
287
297
|
};
|
package/dist/client.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
2
|
+
export { S as StaticMapError, a as StaticMapErrorResponse, s as staticMapErrorResponseSchema } from './errors-B9rwehK0.js';
|
|
3
|
+
import { a as StaticAttributionPosition, j as StaticSceneInput } from './scene-contract-Cr6BNLz0.js';
|
|
3
4
|
|
|
4
5
|
declare function stableStringify(value: unknown): string;
|
|
5
6
|
|
|
6
|
-
declare const
|
|
7
|
+
declare const STATIC_MAP_RESULT_MEDIA_TYPE = "application/vnd.tileflow.static-map-result+json;version=1";
|
|
8
|
+
|
|
7
9
|
type StaticMapAttributionEntry = Readonly<{
|
|
8
10
|
authority: 'platform-notice' | 'team-declared';
|
|
9
11
|
links: readonly Readonly<{
|
|
@@ -17,23 +19,24 @@ type StaticMapAttributionResult = Readonly<{
|
|
|
17
19
|
mode: 'embedded' | 'external';
|
|
18
20
|
position: Exclude<StaticAttributionPosition, 'auto'> | null;
|
|
19
21
|
}>;
|
|
20
|
-
type
|
|
21
|
-
attribution?: StaticMapAttributionResult;
|
|
22
|
+
type StaticMapResultBase = Readonly<{
|
|
22
23
|
cached: boolean;
|
|
23
24
|
hash: string;
|
|
24
25
|
imageUrl: string;
|
|
25
|
-
operationId: string | null;
|
|
26
26
|
remainingUnits: number | null;
|
|
27
|
-
resultVersion?: 2;
|
|
28
27
|
status: 'ready';
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
}>;
|
|
29
|
+
type StaticMapImageResult = StaticMapResultBase & Readonly<{
|
|
30
|
+
operationId: null;
|
|
31
|
+
unitCost: 0;
|
|
32
|
+
}>;
|
|
33
|
+
type StaticMapHostedResult = StaticMapResultBase & Readonly<{
|
|
32
34
|
attribution: StaticMapAttributionResult;
|
|
33
35
|
operationId: string;
|
|
34
|
-
resultVersion:
|
|
36
|
+
resultVersion: 1;
|
|
35
37
|
unitCost: 15;
|
|
36
38
|
}>;
|
|
39
|
+
type StaticMapResult = StaticMapImageResult | StaticMapHostedResult;
|
|
37
40
|
type StaticMapCreateOptions = {
|
|
38
41
|
apiKey?: string;
|
|
39
42
|
apiUrl?: string;
|
|
@@ -49,15 +52,6 @@ type StaticMapEndpointRequestOptions = Omit<StaticMapCreateOptions, 'apiUrl'> &
|
|
|
49
52
|
type PreparedStaticMapRequest = Readonly<{
|
|
50
53
|
sceneKey: string;
|
|
51
54
|
}>;
|
|
52
|
-
declare const staticMapReadyResultSchema: z.ZodObject<{
|
|
53
|
-
cached: z.ZodBoolean;
|
|
54
|
-
hash: z.ZodString;
|
|
55
|
-
imageUrl: z.ZodString;
|
|
56
|
-
operationId: z.ZodString;
|
|
57
|
-
remainingUnits: z.ZodNullable<z.ZodNumber>;
|
|
58
|
-
status: z.ZodLiteral<"ready">;
|
|
59
|
-
unitCost: z.ZodLiteral<15>;
|
|
60
|
-
}, z.core.$strict>;
|
|
61
55
|
declare const staticMapAttributionEntrySchema: z.ZodObject<{
|
|
62
56
|
authority: z.ZodEnum<{
|
|
63
57
|
"platform-notice": "platform-notice";
|
|
@@ -86,10 +80,10 @@ declare const staticMapAttributionResultSchema: z.ZodObject<{
|
|
|
86
80
|
external: "external";
|
|
87
81
|
}>;
|
|
88
82
|
position: z.ZodNullable<z.ZodEnum<{
|
|
89
|
-
"top-left": "top-left";
|
|
90
|
-
"top-right": "top-right";
|
|
91
83
|
"bottom-left": "bottom-left";
|
|
92
84
|
"bottom-right": "bottom-right";
|
|
85
|
+
"top-left": "top-left";
|
|
86
|
+
"top-right": "top-right";
|
|
93
87
|
}>>;
|
|
94
88
|
}, z.core.$strict>;
|
|
95
89
|
declare const staticMapHostedResultSchema: z.ZodObject<{
|
|
@@ -117,13 +111,13 @@ declare const staticMapHostedResultSchema: z.ZodObject<{
|
|
|
117
111
|
external: "external";
|
|
118
112
|
}>;
|
|
119
113
|
position: z.ZodNullable<z.ZodEnum<{
|
|
120
|
-
"top-left": "top-left";
|
|
121
|
-
"top-right": "top-right";
|
|
122
114
|
"bottom-left": "bottom-left";
|
|
123
115
|
"bottom-right": "bottom-right";
|
|
116
|
+
"top-left": "top-left";
|
|
117
|
+
"top-right": "top-right";
|
|
124
118
|
}>>;
|
|
125
119
|
}, z.core.$strict>;
|
|
126
|
-
resultVersion: z.ZodLiteral<
|
|
120
|
+
resultVersion: z.ZodLiteral<1>;
|
|
127
121
|
}, z.core.$strict>;
|
|
128
122
|
declare const staticMapProcessingResultSchema: z.ZodObject<{
|
|
129
123
|
operationId: z.ZodString;
|
|
@@ -144,4 +138,4 @@ declare function createStaticMap(scene: StaticSceneInput, options: StaticMapCrea
|
|
|
144
138
|
declare function precacheStaticMap(scene: StaticSceneInput, options: StaticMapCreateOptions): Promise<StaticMapHostedResult>;
|
|
145
139
|
declare function requestStaticMapUntilReady(request: PreparedStaticMapRequest, options: StaticMapEndpointRequestOptions): Promise<StaticMapHostedResult>;
|
|
146
140
|
|
|
147
|
-
export { type PreparedStaticMapRequest,
|
|
141
|
+
export { type PreparedStaticMapRequest, STATIC_MAP_RESULT_MEDIA_TYPE, type StaticMapAttributionEntry, type StaticMapAttributionResult, type StaticMapCreateOptions, type StaticMapEndpointRequestOptions, type StaticMapHostedResult, type StaticMapImageResult, type StaticMapResult, createStaticMap, createStaticMapIdempotencyKey, precacheStaticMap, prepareStaticMapRequest, requestStaticMapUntilReady, stableStringify, staticMapAttributionEntrySchema, staticMapAttributionResultSchema, staticMapHostedResultSchema, staticMapProcessingResultSchema, validateStaticMapIdempotencyKey };
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
STATIC_MAP_RESULT_MEDIA_TYPE,
|
|
3
3
|
createStaticMap,
|
|
4
4
|
createStaticMapIdempotencyKey,
|
|
5
5
|
precacheStaticMap,
|
|
@@ -9,15 +9,18 @@ import {
|
|
|
9
9
|
staticMapAttributionResultSchema,
|
|
10
10
|
staticMapHostedResultSchema,
|
|
11
11
|
staticMapProcessingResultSchema,
|
|
12
|
-
staticMapReadyResultSchema,
|
|
13
12
|
validateStaticMapIdempotencyKey
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import
|
|
13
|
+
} from "./chunk-N63IFMFM.js";
|
|
14
|
+
import {
|
|
15
|
+
StaticMapError,
|
|
16
|
+
staticMapErrorResponseSchema
|
|
17
|
+
} from "./chunk-TBI5AED6.js";
|
|
16
18
|
import {
|
|
17
19
|
stableStringify
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-6DWVCK64.js";
|
|
19
21
|
export {
|
|
20
|
-
|
|
22
|
+
STATIC_MAP_RESULT_MEDIA_TYPE,
|
|
23
|
+
StaticMapError,
|
|
21
24
|
createStaticMap,
|
|
22
25
|
createStaticMapIdempotencyKey,
|
|
23
26
|
precacheStaticMap,
|
|
@@ -26,8 +29,8 @@ export {
|
|
|
26
29
|
stableStringify,
|
|
27
30
|
staticMapAttributionEntrySchema,
|
|
28
31
|
staticMapAttributionResultSchema,
|
|
32
|
+
staticMapErrorResponseSchema,
|
|
29
33
|
staticMapHostedResultSchema,
|
|
30
34
|
staticMapProcessingResultSchema,
|
|
31
|
-
staticMapReadyResultSchema,
|
|
32
35
|
validateStaticMapIdempotencyKey
|
|
33
36
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const staticMapErrorResponseSchema: z.ZodObject<{
|
|
4
|
+
code: z.ZodOptional<z.ZodString>;
|
|
5
|
+
error: z.ZodString;
|
|
6
|
+
remainingUnits: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
8
|
+
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
type StaticMapErrorResponse = z.infer<typeof staticMapErrorResponseSchema>;
|
|
11
|
+
declare class StaticMapError extends Error {
|
|
12
|
+
readonly code: string | null;
|
|
13
|
+
readonly remainingUnits: number | null;
|
|
14
|
+
readonly requestId: string | null;
|
|
15
|
+
readonly response: StaticMapErrorResponse;
|
|
16
|
+
readonly retryable: boolean | null;
|
|
17
|
+
readonly status: number;
|
|
18
|
+
constructor(response: StaticMapErrorResponse, status: number);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { StaticMapError as S, type StaticMapErrorResponse as a, staticMapErrorResponseSchema as s };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { StaticAutoFitErrorResponse, StaticAutoFitFailure, StaticMapRequestError, StaticMapRequestErrorResponse, StaticMapRequestFailure, normalizeStaticScene, staticMapRequestErrorResponseSchema, validateStaticScene } from './scene.js';
|
|
2
|
-
export { circle, compileStaticOverlays, line, marker, polygon } from './overlays.js';
|
|
3
|
-
export { StaticAttributionEntry,
|
|
4
|
-
export { PreparedStaticMapRequest,
|
|
5
|
-
export { M as MAX_OVERLAY_LATITUDE, S as StaticAttributionMode, a as StaticAttributionPosition, b as StaticAttributionRequest, c as StaticCoordinate, d as StaticMapFormat, e as StaticOverlay, f as StaticOverlayInput, g as
|
|
2
|
+
export { circle, compileStaticOverlays, line, marker, polygon, symbol } from './overlays.js';
|
|
3
|
+
export { StaticAttributionEntry, StaticAttributionPlan, StaticAttributionProvenance, StaticAttributionSegment, StaticRenderComposition, StaticRenderManifest, StaticResolvedAttributionPosition, createRenderManifest, hashRenderManifest, hashStaticSceneRequest, staticAttributionEntrySchema, staticAttributionLimits, staticAttributionPlanSchema, staticAttributionPlanSchemaVersion, staticAttributionProvenanceSchema, staticAttributionSegmentSchema, staticRenderCompositionSchema, staticRenderCompositionSchemaVersion, staticRenderManifestSchema, staticRendererSchemaVersion, validateStaticRenderManifest } from './manifest.js';
|
|
4
|
+
export { PreparedStaticMapRequest, STATIC_MAP_RESULT_MEDIA_TYPE, StaticMapAttributionEntry, StaticMapAttributionResult, StaticMapCreateOptions, StaticMapEndpointRequestOptions, StaticMapHostedResult, StaticMapImageResult, StaticMapResult, createStaticMap, createStaticMapIdempotencyKey, precacheStaticMap, prepareStaticMapRequest, requestStaticMapUntilReady, stableStringify, staticMapAttributionEntrySchema, staticMapAttributionResultSchema, staticMapHostedResultSchema, staticMapProcessingResultSchema, validateStaticMapIdempotencyKey } from './client.js';
|
|
5
|
+
export { M as MAX_OVERLAY_LATITUDE, S as StaticAttributionMode, a as StaticAttributionPosition, b as StaticAttributionRequest, c as StaticCoordinate, d as StaticMapFormat, e as StaticOverlay, f as StaticOverlayInput, g as StaticOverlayPlacement, h as StaticPadding, i as StaticScene, j as StaticSceneInput, k as StaticSymbolAnchor, l as StaticSymbolCollision, m as StaticSymbolLabelAppearance, n as StaticSymbolLabelPosition, o as StaticSymbolLanguage, p as isSupportedStaticSymbolCodePoint, s as staticAttributionPositionSchema, q as staticAttributionRequestSchema, r as staticOverlayPlacements, t as staticOverlaySchema, u as staticSceneLimits, v as staticSceneSchema, w as staticSceneSchemaVersion, x as staticSymbolAnchors, y as staticSymbolCollisions, z as staticSymbolLabelAppearances, A as staticSymbolLabelPositions, B as staticSymbolLanguages } from './scene-contract-Cr6BNLz0.js';
|
|
6
|
+
export { S as StaticMapError, a as StaticMapErrorResponse, s as staticMapErrorResponseSchema } from './errors-B9rwehK0.js';
|
|
6
7
|
import 'zod';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
STATIC_MAP_RESULT_MEDIA_TYPE,
|
|
3
3
|
createStaticMap,
|
|
4
4
|
createStaticMapIdempotencyKey,
|
|
5
5
|
precacheStaticMap,
|
|
@@ -9,64 +9,70 @@ import {
|
|
|
9
9
|
staticMapAttributionResultSchema,
|
|
10
10
|
staticMapHostedResultSchema,
|
|
11
11
|
staticMapProcessingResultSchema,
|
|
12
|
-
staticMapReadyResultSchema,
|
|
13
12
|
validateStaticMapIdempotencyKey
|
|
14
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-N63IFMFM.js";
|
|
15
14
|
import {
|
|
16
15
|
createRenderManifest,
|
|
17
|
-
createRenderManifestV1,
|
|
18
|
-
createRenderManifestV2,
|
|
19
16
|
hashRenderManifest,
|
|
20
17
|
hashStaticSceneRequest,
|
|
21
18
|
staticAttributionEntrySchema,
|
|
22
19
|
staticAttributionLimits,
|
|
23
|
-
|
|
20
|
+
staticAttributionPlanSchema,
|
|
24
21
|
staticAttributionPlanSchemaVersion,
|
|
25
22
|
staticAttributionProvenanceSchema,
|
|
26
23
|
staticAttributionSegmentSchema,
|
|
24
|
+
staticRenderCompositionSchema,
|
|
25
|
+
staticRenderCompositionSchemaVersion,
|
|
27
26
|
staticRenderManifestSchema,
|
|
28
|
-
staticRenderManifestV1Schema,
|
|
29
|
-
staticRenderManifestV2Schema,
|
|
30
27
|
staticRendererSchemaVersion,
|
|
31
|
-
staticRendererSchemaVersionV1,
|
|
32
28
|
validateStaticRenderManifest
|
|
33
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-XMT7VJL5.js";
|
|
34
30
|
import {
|
|
35
31
|
circle,
|
|
36
32
|
compileStaticOverlays,
|
|
37
33
|
line,
|
|
38
34
|
marker,
|
|
39
|
-
polygon
|
|
40
|
-
|
|
35
|
+
polygon,
|
|
36
|
+
symbol
|
|
37
|
+
} from "./chunk-HVVIAOBE.js";
|
|
41
38
|
import {
|
|
39
|
+
StaticMapError,
|
|
42
40
|
StaticMapRequestError,
|
|
43
41
|
normalizeStaticScene,
|
|
42
|
+
staticMapErrorResponseSchema,
|
|
44
43
|
staticMapRequestErrorResponseSchema,
|
|
45
44
|
validateStaticScene
|
|
46
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-TBI5AED6.js";
|
|
47
46
|
import {
|
|
48
47
|
MAX_OVERLAY_LATITUDE,
|
|
48
|
+
isSupportedStaticSymbolCodePoint,
|
|
49
49
|
stableStringify,
|
|
50
50
|
staticAttributionPositionSchema,
|
|
51
51
|
staticAttributionRequestSchema,
|
|
52
|
+
staticOverlayPlacements,
|
|
52
53
|
staticOverlaySchema,
|
|
53
54
|
staticSceneLimits,
|
|
54
55
|
staticSceneSchema,
|
|
55
|
-
staticSceneSchemaVersion
|
|
56
|
-
|
|
56
|
+
staticSceneSchemaVersion,
|
|
57
|
+
staticSymbolAnchors,
|
|
58
|
+
staticSymbolCollisions,
|
|
59
|
+
staticSymbolLabelAppearances,
|
|
60
|
+
staticSymbolLabelPositions,
|
|
61
|
+
staticSymbolLanguages
|
|
62
|
+
} from "./chunk-6DWVCK64.js";
|
|
57
63
|
export {
|
|
58
64
|
MAX_OVERLAY_LATITUDE,
|
|
59
|
-
|
|
65
|
+
STATIC_MAP_RESULT_MEDIA_TYPE,
|
|
66
|
+
StaticMapError,
|
|
60
67
|
StaticMapRequestError,
|
|
61
68
|
circle,
|
|
62
69
|
compileStaticOverlays,
|
|
63
70
|
createRenderManifest,
|
|
64
|
-
createRenderManifestV1,
|
|
65
|
-
createRenderManifestV2,
|
|
66
71
|
createStaticMap,
|
|
67
72
|
createStaticMapIdempotencyKey,
|
|
68
73
|
hashRenderManifest,
|
|
69
74
|
hashStaticSceneRequest,
|
|
75
|
+
isSupportedStaticSymbolCodePoint,
|
|
70
76
|
line,
|
|
71
77
|
marker,
|
|
72
78
|
normalizeStaticScene,
|
|
@@ -77,7 +83,7 @@ export {
|
|
|
77
83
|
stableStringify,
|
|
78
84
|
staticAttributionEntrySchema,
|
|
79
85
|
staticAttributionLimits,
|
|
80
|
-
|
|
86
|
+
staticAttributionPlanSchema,
|
|
81
87
|
staticAttributionPlanSchemaVersion,
|
|
82
88
|
staticAttributionPositionSchema,
|
|
83
89
|
staticAttributionProvenanceSchema,
|
|
@@ -85,19 +91,25 @@ export {
|
|
|
85
91
|
staticAttributionSegmentSchema,
|
|
86
92
|
staticMapAttributionEntrySchema,
|
|
87
93
|
staticMapAttributionResultSchema,
|
|
94
|
+
staticMapErrorResponseSchema,
|
|
88
95
|
staticMapHostedResultSchema,
|
|
89
96
|
staticMapProcessingResultSchema,
|
|
90
|
-
staticMapReadyResultSchema,
|
|
91
97
|
staticMapRequestErrorResponseSchema,
|
|
98
|
+
staticOverlayPlacements,
|
|
92
99
|
staticOverlaySchema,
|
|
100
|
+
staticRenderCompositionSchema,
|
|
101
|
+
staticRenderCompositionSchemaVersion,
|
|
93
102
|
staticRenderManifestSchema,
|
|
94
|
-
staticRenderManifestV1Schema,
|
|
95
|
-
staticRenderManifestV2Schema,
|
|
96
103
|
staticRendererSchemaVersion,
|
|
97
|
-
staticRendererSchemaVersionV1,
|
|
98
104
|
staticSceneLimits,
|
|
99
105
|
staticSceneSchema,
|
|
100
106
|
staticSceneSchemaVersion,
|
|
107
|
+
staticSymbolAnchors,
|
|
108
|
+
staticSymbolCollisions,
|
|
109
|
+
staticSymbolLabelAppearances,
|
|
110
|
+
staticSymbolLabelPositions,
|
|
111
|
+
staticSymbolLanguages,
|
|
112
|
+
symbol,
|
|
101
113
|
validateStaticMapIdempotencyKey,
|
|
102
114
|
validateStaticRenderManifest,
|
|
103
115
|
validateStaticScene
|