@tileflow/static 0.1.0-alpha.21 → 0.1.0-alpha.23
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 +145 -18
- package/dist/chunk-6DWVCK64.js +406 -0
- package/dist/chunk-HVVIAOBE.js +175 -0
- package/dist/{chunk-A23RC4BE.js → chunk-N63IFMFM.js} +64 -18
- package/dist/{chunk-NHQK5UZ2.js → chunk-TBI5AED6.js} +185 -43
- package/dist/chunk-XMT7VJL5.js +297 -0
- package/dist/client.d.ts +93 -10
- package/dist/client.js +16 -5
- package/dist/errors-B9rwehK0.d.ts +21 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +55 -9
- package/dist/manifest.d.ts +419 -13
- package/dist/manifest.js +19 -3
- 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 +103 -4
- package/dist/scene.js +21 -3
- package/package.json +3 -6
- package/GENERATED_OUTPUT_LICENSE.md +0 -21
- package/NOTICE +0 -9
- package/TRADEMARKS.md +0 -10
- package/dist/chunk-KPT7PASB.js +0 -122
- package/dist/chunk-MGQCHCU3.js +0 -228
- package/dist/chunk-S3WXE5P4.js +0 -99
- package/dist/scene-contract-DZMhLDnf.d.ts +0 -159
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import {
|
|
2
|
+
analyzeStaticAutoFit,
|
|
3
|
+
normalizeStaticScene,
|
|
4
|
+
staticAutoFitPlanSchema,
|
|
5
|
+
validateStaticScene
|
|
6
|
+
} from "./chunk-TBI5AED6.js";
|
|
7
|
+
import {
|
|
8
|
+
hashStableValue,
|
|
9
|
+
isSafeHttpUrl,
|
|
10
|
+
jsonByteLength,
|
|
11
|
+
stableStringify,
|
|
12
|
+
staticOverlayPlacements,
|
|
13
|
+
staticSceneSchema,
|
|
14
|
+
stripUndefined
|
|
15
|
+
} from "./chunk-6DWVCK64.js";
|
|
16
|
+
|
|
17
|
+
// src/manifest.ts
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
var staticRendererSchemaVersion = 1;
|
|
20
|
+
var staticAttributionPlanSchemaVersion = 1;
|
|
21
|
+
var staticRenderCompositionSchemaVersion = 1;
|
|
22
|
+
var staticAttributionLimits = {
|
|
23
|
+
maxBytes: 32 * 1024,
|
|
24
|
+
maxEntries: 18,
|
|
25
|
+
maxLinksPerEntry: 8,
|
|
26
|
+
maxTextLength: 16384,
|
|
27
|
+
maxUrlLength: 2048
|
|
28
|
+
};
|
|
29
|
+
var sha256HexSchema = z.string().regex(/^[0-9a-f]{64}$/u);
|
|
30
|
+
var sourceIdSchema = z.string().min(1).max(128);
|
|
31
|
+
var boundedIdentitySchema = z.string().min(1).max(512).refine(hasNoControlCharacters, {
|
|
32
|
+
message: "Expected no control characters"
|
|
33
|
+
});
|
|
34
|
+
var staticResolvedAttributionPositionSchema = z.enum([
|
|
35
|
+
"top-left",
|
|
36
|
+
"top-right",
|
|
37
|
+
"bottom-left",
|
|
38
|
+
"bottom-right"
|
|
39
|
+
]);
|
|
40
|
+
var staticAttributionSegmentSchema = z.discriminatedUnion("kind", [
|
|
41
|
+
z.object({
|
|
42
|
+
kind: z.literal("text"),
|
|
43
|
+
text: z.string().min(1).max(staticAttributionLimits.maxTextLength).refine(hasNoControlCharacters, { message: "Attribution text contains control characters" })
|
|
44
|
+
}).strict(),
|
|
45
|
+
z.object({
|
|
46
|
+
kind: z.literal("link"),
|
|
47
|
+
label: z.string().min(1).max(staticAttributionLimits.maxTextLength).refine(hasNoControlCharacters, {
|
|
48
|
+
message: "Attribution link label contains control characters"
|
|
49
|
+
}),
|
|
50
|
+
url: z.string().trim().url().max(staticAttributionLimits.maxUrlLength).refine(isSafeHttpUrl, {
|
|
51
|
+
message: "Expected an http(s) URL without credentials or a fragment"
|
|
52
|
+
})
|
|
53
|
+
}).strict()
|
|
54
|
+
]);
|
|
55
|
+
var attributionSourceSchema = z.object({
|
|
56
|
+
sourceId: sourceIdSchema,
|
|
57
|
+
sourceSelectionIdentity: boundedIdentitySchema
|
|
58
|
+
}).strict();
|
|
59
|
+
var attributionSourcesSchema = z.array(attributionSourceSchema).min(1).max(18).refine(isUniqueSortedSources, {
|
|
60
|
+
message: "Attribution sources must be unique and sorted"
|
|
61
|
+
});
|
|
62
|
+
var staticAttributionProvenanceSchema = z.discriminatedUnion("authority", [
|
|
63
|
+
z.object({
|
|
64
|
+
authority: z.literal("platform-notice"),
|
|
65
|
+
noticeId: boundedIdentitySchema,
|
|
66
|
+
noticeSha256: sha256HexSchema,
|
|
67
|
+
resource: z.enum(["terrain", "world"]),
|
|
68
|
+
sources: attributionSourcesSchema
|
|
69
|
+
}).strict(),
|
|
70
|
+
z.object({
|
|
71
|
+
authority: z.literal("team-declared"),
|
|
72
|
+
sources: z.array(
|
|
73
|
+
attributionSourceSchema.extend({
|
|
74
|
+
mapRevision: boundedIdentitySchema,
|
|
75
|
+
resourceId: boundedIdentitySchema
|
|
76
|
+
}).strict()
|
|
77
|
+
).min(1).max(18).refine(isUniqueSortedSources, {
|
|
78
|
+
message: "Attribution sources must be unique and sorted"
|
|
79
|
+
})
|
|
80
|
+
}).strict()
|
|
81
|
+
]);
|
|
82
|
+
var staticAttributionEntrySchema = z.object({
|
|
83
|
+
authority: z.enum(["platform-notice", "team-declared"]),
|
|
84
|
+
provenance: staticAttributionProvenanceSchema,
|
|
85
|
+
segments: z.array(staticAttributionSegmentSchema).min(1).max(17)
|
|
86
|
+
}).strict().superRefine((entry, context) => {
|
|
87
|
+
if (entry.authority !== entry.provenance.authority) {
|
|
88
|
+
context.addIssue({
|
|
89
|
+
code: "custom",
|
|
90
|
+
message: "Attribution entry authority must match its provenance",
|
|
91
|
+
path: ["authority"]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const links = entry.segments.filter((segment) => segment.kind === "link").length;
|
|
95
|
+
if (links > staticAttributionLimits.maxLinksPerEntry) {
|
|
96
|
+
context.addIssue({
|
|
97
|
+
code: "custom",
|
|
98
|
+
message: `Attribution entries can contain at most ${staticAttributionLimits.maxLinksPerEntry} links`,
|
|
99
|
+
path: ["segments"]
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
var staticAttributionPlanSchema = z.object({
|
|
104
|
+
entries: z.array(staticAttributionEntrySchema).max(staticAttributionLimits.maxEntries),
|
|
105
|
+
mode: z.enum(["embedded", "external"]),
|
|
106
|
+
position: z.union([z.literal("auto"), staticResolvedAttributionPositionSchema, z.null()]),
|
|
107
|
+
schemaVersion: z.literal(staticAttributionPlanSchemaVersion)
|
|
108
|
+
}).strict().superRefine((plan, context) => {
|
|
109
|
+
if (plan.mode === "external" && plan.position !== null || plan.mode === "embedded" && plan.position === null) {
|
|
110
|
+
context.addIssue({
|
|
111
|
+
code: "custom",
|
|
112
|
+
message: "Attribution position must match its mode",
|
|
113
|
+
path: ["position"]
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (jsonByteLength(plan) > staticAttributionLimits.maxBytes) {
|
|
117
|
+
context.addIssue({
|
|
118
|
+
code: "custom",
|
|
119
|
+
message: `Attribution plan exceeds ${staticAttributionLimits.maxBytes} bytes`
|
|
120
|
+
});
|
|
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
|
+
);
|
|
149
|
+
var staticRenderManifestBaseShape = {
|
|
150
|
+
attribution: staticAttributionPlanSchema,
|
|
151
|
+
autoFit: staticAutoFitPlanSchema.optional(),
|
|
152
|
+
composition: staticRenderCompositionSchema,
|
|
153
|
+
mapId: z.string().trim().min(1).max(128),
|
|
154
|
+
rendererVersion: z.string().trim().min(1).max(64),
|
|
155
|
+
schemaVersion: z.literal(staticRendererSchemaVersion),
|
|
156
|
+
scene: staticSceneSchema,
|
|
157
|
+
styleId: z.string().trim().min(1).max(128).optional(),
|
|
158
|
+
styleRevision: z.string().trim().min(1).max(128),
|
|
159
|
+
styleUrl: z.string().trim().url().max(512).refine(isSafeHttpUrl, {
|
|
160
|
+
message: "Expected an http(s) style URL without credentials or a fragment"
|
|
161
|
+
})
|
|
162
|
+
};
|
|
163
|
+
var staticRenderManifestSchema = z.object(staticRenderManifestBaseShape).strict();
|
|
164
|
+
function validateStaticRenderManifest(input) {
|
|
165
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) {
|
|
166
|
+
return { error: "manifest: Expected an object", ok: false };
|
|
167
|
+
}
|
|
168
|
+
if (input.schemaVersion !== staticRendererSchemaVersion) {
|
|
169
|
+
return { error: "manifest.schemaVersion: Unsupported renderer schema version", ok: false };
|
|
170
|
+
}
|
|
171
|
+
const rawScene = input.scene;
|
|
172
|
+
const sceneValidation = validateStaticScene(rawScene);
|
|
173
|
+
if (!sceneValidation.ok) return sceneValidation;
|
|
174
|
+
const parsed = staticRenderManifestSchema.safeParse({
|
|
175
|
+
...input,
|
|
176
|
+
scene: sceneValidation.scene
|
|
177
|
+
});
|
|
178
|
+
if (!parsed.success) return zodFailure(parsed.error);
|
|
179
|
+
const autoFit = expectedAutoFit(sceneValidation.scene);
|
|
180
|
+
if (autoFit === void 0 !== (parsed.data.autoFit === void 0) || autoFit !== void 0 && stableStringify(autoFit) !== stableStringify(parsed.data.autoFit)) {
|
|
181
|
+
return { error: "manifest.autoFit: Expected the exact plan derived from scene", ok: false };
|
|
182
|
+
}
|
|
183
|
+
if (!attributionMatchesScene(parsed.data.attribution, sceneValidation.scene)) {
|
|
184
|
+
return {
|
|
185
|
+
error: "manifest.attribution: Expected the exact request resolved from scene",
|
|
186
|
+
ok: false
|
|
187
|
+
};
|
|
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
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
manifest: {
|
|
197
|
+
...parsed.data,
|
|
198
|
+
...autoFit === void 0 ? {} : { autoFit },
|
|
199
|
+
scene: sceneValidation.scene
|
|
200
|
+
},
|
|
201
|
+
ok: true
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function createRenderManifest(input) {
|
|
205
|
+
const scene = normalizeStaticScene(input.scene);
|
|
206
|
+
const autoFit = expectedAutoFit(scene);
|
|
207
|
+
return staticRenderManifestSchema.parse(
|
|
208
|
+
stripUndefined({
|
|
209
|
+
attribution: input.attribution,
|
|
210
|
+
autoFit,
|
|
211
|
+
composition: input.composition,
|
|
212
|
+
mapId: input.mapId,
|
|
213
|
+
rendererVersion: input.rendererVersion,
|
|
214
|
+
schemaVersion: staticRendererSchemaVersion,
|
|
215
|
+
scene,
|
|
216
|
+
styleId: input.styleId,
|
|
217
|
+
styleRevision: input.styleRevision,
|
|
218
|
+
styleUrl: input.styleUrl
|
|
219
|
+
})
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
async function hashRenderManifest(manifest) {
|
|
223
|
+
const validation = validateStaticRenderManifest(manifest);
|
|
224
|
+
if (!validation.ok) throw new Error(`Invalid Tileflow render manifest: ${validation.error}`);
|
|
225
|
+
return hashStableValue(validation.manifest);
|
|
226
|
+
}
|
|
227
|
+
async function hashStaticSceneRequest(scene) {
|
|
228
|
+
const validation = validateStaticScene(scene);
|
|
229
|
+
if (!validation.ok) throw new Error(`Invalid Tileflow static scene: ${validation.error}`);
|
|
230
|
+
return hashStableValue(validation.scene);
|
|
231
|
+
}
|
|
232
|
+
function attributionMatchesScene(plan, scene) {
|
|
233
|
+
const request = scene.attribution;
|
|
234
|
+
const expectedMode = request?.mode === "external" ? "external" : "embedded";
|
|
235
|
+
const expectedPosition = expectedMode === "external" ? null : request && "position" in request ? request.position ?? "auto" : "auto";
|
|
236
|
+
return plan.mode === expectedMode && plan.position === expectedPosition;
|
|
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
|
+
}
|
|
246
|
+
function expectedAutoFit(scene) {
|
|
247
|
+
if (scene.camera.type !== "auto") return void 0;
|
|
248
|
+
const analysis = analyzeStaticAutoFit(scene);
|
|
249
|
+
if (!analysis.ok) throw new Error(`Invalid Tileflow auto-fit scene: ${analysis.error}`);
|
|
250
|
+
return analysis.plan;
|
|
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
|
+
}
|
|
261
|
+
function hasNoControlCharacters(value) {
|
|
262
|
+
return !Array.from(value).some((character) => {
|
|
263
|
+
const codePoint = character.codePointAt(0) ?? 0;
|
|
264
|
+
return codePoint <= 31 || codePoint === 127;
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
function isUniqueSortedSources(values) {
|
|
268
|
+
return values.every(
|
|
269
|
+
(value, index) => index === 0 || compareCodeUnits(values[index - 1].sourceId, value.sourceId) < 0
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
function compareCodeUnits(left, right) {
|
|
273
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
274
|
+
}
|
|
275
|
+
function zodFailure(error) {
|
|
276
|
+
return {
|
|
277
|
+
error: error.issues.map((issue) => `${issue.path.join(".") || "manifest"}: ${issue.message}`).join("; "),
|
|
278
|
+
ok: false
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export {
|
|
283
|
+
staticRendererSchemaVersion,
|
|
284
|
+
staticAttributionPlanSchemaVersion,
|
|
285
|
+
staticRenderCompositionSchemaVersion,
|
|
286
|
+
staticAttributionLimits,
|
|
287
|
+
staticAttributionSegmentSchema,
|
|
288
|
+
staticAttributionProvenanceSchema,
|
|
289
|
+
staticAttributionEntrySchema,
|
|
290
|
+
staticAttributionPlanSchema,
|
|
291
|
+
staticRenderCompositionSchema,
|
|
292
|
+
staticRenderManifestSchema,
|
|
293
|
+
validateStaticRenderManifest,
|
|
294
|
+
createRenderManifest,
|
|
295
|
+
hashRenderManifest,
|
|
296
|
+
hashStaticSceneRequest
|
|
297
|
+
};
|
package/dist/client.d.ts
CHANGED
|
@@ -1,17 +1,42 @@
|
|
|
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
|
-
|
|
7
|
+
declare const STATIC_MAP_RESULT_MEDIA_TYPE = "application/vnd.tileflow.static-map-result+json;version=1";
|
|
8
|
+
|
|
9
|
+
type StaticMapAttributionEntry = Readonly<{
|
|
10
|
+
authority: 'platform-notice' | 'team-declared';
|
|
11
|
+
links: readonly Readonly<{
|
|
12
|
+
label: string;
|
|
13
|
+
url: string;
|
|
14
|
+
}>[];
|
|
15
|
+
text: string;
|
|
16
|
+
}>;
|
|
17
|
+
type StaticMapAttributionResult = Readonly<{
|
|
18
|
+
entries: readonly StaticMapAttributionEntry[];
|
|
19
|
+
mode: 'embedded' | 'external';
|
|
20
|
+
position: Exclude<StaticAttributionPosition, 'auto'> | null;
|
|
21
|
+
}>;
|
|
22
|
+
type StaticMapResultBase = Readonly<{
|
|
7
23
|
cached: boolean;
|
|
8
24
|
hash: string;
|
|
9
25
|
imageUrl: string;
|
|
10
|
-
operationId: string | null;
|
|
11
26
|
remainingUnits: number | null;
|
|
12
27
|
status: 'ready';
|
|
13
|
-
|
|
14
|
-
|
|
28
|
+
}>;
|
|
29
|
+
type StaticMapImageResult = StaticMapResultBase & Readonly<{
|
|
30
|
+
operationId: null;
|
|
31
|
+
unitCost: 0;
|
|
32
|
+
}>;
|
|
33
|
+
type StaticMapHostedResult = StaticMapResultBase & Readonly<{
|
|
34
|
+
attribution: StaticMapAttributionResult;
|
|
35
|
+
operationId: string;
|
|
36
|
+
resultVersion: 1;
|
|
37
|
+
unitCost: 15;
|
|
38
|
+
}>;
|
|
39
|
+
type StaticMapResult = StaticMapImageResult | StaticMapHostedResult;
|
|
15
40
|
type StaticMapCreateOptions = {
|
|
16
41
|
apiKey?: string;
|
|
17
42
|
apiUrl?: string;
|
|
@@ -27,7 +52,41 @@ type StaticMapEndpointRequestOptions = Omit<StaticMapCreateOptions, 'apiUrl'> &
|
|
|
27
52
|
type PreparedStaticMapRequest = Readonly<{
|
|
28
53
|
sceneKey: string;
|
|
29
54
|
}>;
|
|
30
|
-
declare const
|
|
55
|
+
declare const staticMapAttributionEntrySchema: z.ZodObject<{
|
|
56
|
+
authority: z.ZodEnum<{
|
|
57
|
+
"platform-notice": "platform-notice";
|
|
58
|
+
"team-declared": "team-declared";
|
|
59
|
+
}>;
|
|
60
|
+
links: z.ZodArray<z.ZodObject<{
|
|
61
|
+
label: z.ZodString;
|
|
62
|
+
url: z.ZodString;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
text: z.ZodString;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
declare const staticMapAttributionResultSchema: z.ZodObject<{
|
|
67
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
68
|
+
authority: z.ZodEnum<{
|
|
69
|
+
"platform-notice": "platform-notice";
|
|
70
|
+
"team-declared": "team-declared";
|
|
71
|
+
}>;
|
|
72
|
+
links: z.ZodArray<z.ZodObject<{
|
|
73
|
+
label: z.ZodString;
|
|
74
|
+
url: z.ZodString;
|
|
75
|
+
}, z.core.$strict>>;
|
|
76
|
+
text: z.ZodString;
|
|
77
|
+
}, z.core.$strict>>;
|
|
78
|
+
mode: z.ZodEnum<{
|
|
79
|
+
embedded: "embedded";
|
|
80
|
+
external: "external";
|
|
81
|
+
}>;
|
|
82
|
+
position: z.ZodNullable<z.ZodEnum<{
|
|
83
|
+
"top-left": "top-left";
|
|
84
|
+
"top-right": "top-right";
|
|
85
|
+
"bottom-left": "bottom-left";
|
|
86
|
+
"bottom-right": "bottom-right";
|
|
87
|
+
}>>;
|
|
88
|
+
}, z.core.$strict>;
|
|
89
|
+
declare const staticMapHostedResultSchema: z.ZodObject<{
|
|
31
90
|
cached: z.ZodBoolean;
|
|
32
91
|
hash: z.ZodString;
|
|
33
92
|
imageUrl: z.ZodString;
|
|
@@ -35,6 +94,30 @@ declare const staticMapReadyResultSchema: z.ZodObject<{
|
|
|
35
94
|
remainingUnits: z.ZodNullable<z.ZodNumber>;
|
|
36
95
|
status: z.ZodLiteral<"ready">;
|
|
37
96
|
unitCost: z.ZodLiteral<15>;
|
|
97
|
+
attribution: z.ZodObject<{
|
|
98
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
99
|
+
authority: z.ZodEnum<{
|
|
100
|
+
"platform-notice": "platform-notice";
|
|
101
|
+
"team-declared": "team-declared";
|
|
102
|
+
}>;
|
|
103
|
+
links: z.ZodArray<z.ZodObject<{
|
|
104
|
+
label: z.ZodString;
|
|
105
|
+
url: z.ZodString;
|
|
106
|
+
}, z.core.$strict>>;
|
|
107
|
+
text: z.ZodString;
|
|
108
|
+
}, z.core.$strict>>;
|
|
109
|
+
mode: z.ZodEnum<{
|
|
110
|
+
embedded: "embedded";
|
|
111
|
+
external: "external";
|
|
112
|
+
}>;
|
|
113
|
+
position: z.ZodNullable<z.ZodEnum<{
|
|
114
|
+
"top-left": "top-left";
|
|
115
|
+
"top-right": "top-right";
|
|
116
|
+
"bottom-left": "bottom-left";
|
|
117
|
+
"bottom-right": "bottom-right";
|
|
118
|
+
}>>;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
resultVersion: z.ZodLiteral<1>;
|
|
38
121
|
}, z.core.$strict>;
|
|
39
122
|
declare const staticMapProcessingResultSchema: z.ZodObject<{
|
|
40
123
|
operationId: z.ZodString;
|
|
@@ -51,8 +134,8 @@ declare function validateStaticMapIdempotencyKey(value: unknown): {
|
|
|
51
134
|
};
|
|
52
135
|
declare function createStaticMapIdempotencyKey(): string;
|
|
53
136
|
declare function prepareStaticMapRequest(scene: StaticSceneInput): PreparedStaticMapRequest;
|
|
54
|
-
declare function createStaticMap(scene: StaticSceneInput, options: StaticMapCreateOptions): Promise<
|
|
55
|
-
declare function precacheStaticMap(scene: StaticSceneInput, options: StaticMapCreateOptions): Promise<
|
|
56
|
-
declare function requestStaticMapUntilReady(request: PreparedStaticMapRequest, options: StaticMapEndpointRequestOptions): Promise<
|
|
137
|
+
declare function createStaticMap(scene: StaticSceneInput, options: StaticMapCreateOptions): Promise<StaticMapHostedResult>;
|
|
138
|
+
declare function precacheStaticMap(scene: StaticSceneInput, options: StaticMapCreateOptions): Promise<StaticMapHostedResult>;
|
|
139
|
+
declare function requestStaticMapUntilReady(request: PreparedStaticMapRequest, options: StaticMapEndpointRequestOptions): Promise<StaticMapHostedResult>;
|
|
57
140
|
|
|
58
|
-
export { type PreparedStaticMapRequest, type StaticMapCreateOptions, type StaticMapEndpointRequestOptions, type StaticMapResult, createStaticMap, createStaticMapIdempotencyKey, precacheStaticMap, prepareStaticMapRequest, requestStaticMapUntilReady, stableStringify,
|
|
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,25 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
|
+
STATIC_MAP_RESULT_MEDIA_TYPE,
|
|
2
3
|
createStaticMap,
|
|
3
4
|
createStaticMapIdempotencyKey,
|
|
4
5
|
precacheStaticMap,
|
|
5
6
|
prepareStaticMapRequest,
|
|
6
7
|
requestStaticMapUntilReady,
|
|
8
|
+
staticMapAttributionEntrySchema,
|
|
9
|
+
staticMapAttributionResultSchema,
|
|
10
|
+
staticMapHostedResultSchema,
|
|
7
11
|
staticMapProcessingResultSchema,
|
|
8
|
-
staticMapReadyResultSchema,
|
|
9
12
|
validateStaticMapIdempotencyKey
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import
|
|
13
|
+
} from "./chunk-N63IFMFM.js";
|
|
14
|
+
import {
|
|
15
|
+
StaticMapError,
|
|
16
|
+
staticMapErrorResponseSchema
|
|
17
|
+
} from "./chunk-TBI5AED6.js";
|
|
12
18
|
import {
|
|
13
19
|
stableStringify
|
|
14
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-6DWVCK64.js";
|
|
15
21
|
export {
|
|
22
|
+
STATIC_MAP_RESULT_MEDIA_TYPE,
|
|
23
|
+
StaticMapError,
|
|
16
24
|
createStaticMap,
|
|
17
25
|
createStaticMapIdempotencyKey,
|
|
18
26
|
precacheStaticMap,
|
|
19
27
|
prepareStaticMapRequest,
|
|
20
28
|
requestStaticMapUntilReady,
|
|
21
29
|
stableStringify,
|
|
30
|
+
staticMapAttributionEntrySchema,
|
|
31
|
+
staticMapAttributionResultSchema,
|
|
32
|
+
staticMapErrorResponseSchema,
|
|
33
|
+
staticMapHostedResultSchema,
|
|
22
34
|
staticMapProcessingResultSchema,
|
|
23
|
-
staticMapReadyResultSchema,
|
|
24
35
|
validateStaticMapIdempotencyKey
|
|
25
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 { StaticRenderManifest, createRenderManifest, hashRenderManifest, hashStaticSceneRequest, staticRenderManifestSchema, staticRendererSchemaVersion, validateStaticRenderManifest } from './manifest.js';
|
|
4
|
-
export { PreparedStaticMapRequest, StaticMapCreateOptions, StaticMapEndpointRequestOptions, StaticMapResult, createStaticMap, createStaticMapIdempotencyKey, precacheStaticMap, prepareStaticMapRequest, requestStaticMapUntilReady, stableStringify,
|
|
5
|
-
export { M as MAX_OVERLAY_LATITUDE, S 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,44 +1,69 @@
|
|
|
1
1
|
import {
|
|
2
|
+
STATIC_MAP_RESULT_MEDIA_TYPE,
|
|
2
3
|
createStaticMap,
|
|
3
4
|
createStaticMapIdempotencyKey,
|
|
4
5
|
precacheStaticMap,
|
|
5
6
|
prepareStaticMapRequest,
|
|
6
7
|
requestStaticMapUntilReady,
|
|
8
|
+
staticMapAttributionEntrySchema,
|
|
9
|
+
staticMapAttributionResultSchema,
|
|
10
|
+
staticMapHostedResultSchema,
|
|
7
11
|
staticMapProcessingResultSchema,
|
|
8
|
-
staticMapReadyResultSchema,
|
|
9
12
|
validateStaticMapIdempotencyKey
|
|
10
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-N63IFMFM.js";
|
|
11
14
|
import {
|
|
12
15
|
createRenderManifest,
|
|
13
16
|
hashRenderManifest,
|
|
14
17
|
hashStaticSceneRequest,
|
|
18
|
+
staticAttributionEntrySchema,
|
|
19
|
+
staticAttributionLimits,
|
|
20
|
+
staticAttributionPlanSchema,
|
|
21
|
+
staticAttributionPlanSchemaVersion,
|
|
22
|
+
staticAttributionProvenanceSchema,
|
|
23
|
+
staticAttributionSegmentSchema,
|
|
24
|
+
staticRenderCompositionSchema,
|
|
25
|
+
staticRenderCompositionSchemaVersion,
|
|
15
26
|
staticRenderManifestSchema,
|
|
16
27
|
staticRendererSchemaVersion,
|
|
17
28
|
validateStaticRenderManifest
|
|
18
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-XMT7VJL5.js";
|
|
19
30
|
import {
|
|
20
31
|
circle,
|
|
21
32
|
compileStaticOverlays,
|
|
22
33
|
line,
|
|
23
34
|
marker,
|
|
24
|
-
polygon
|
|
25
|
-
|
|
35
|
+
polygon,
|
|
36
|
+
symbol
|
|
37
|
+
} from "./chunk-HVVIAOBE.js";
|
|
26
38
|
import {
|
|
39
|
+
StaticMapError,
|
|
27
40
|
StaticMapRequestError,
|
|
28
41
|
normalizeStaticScene,
|
|
42
|
+
staticMapErrorResponseSchema,
|
|
29
43
|
staticMapRequestErrorResponseSchema,
|
|
30
44
|
validateStaticScene
|
|
31
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-TBI5AED6.js";
|
|
32
46
|
import {
|
|
33
47
|
MAX_OVERLAY_LATITUDE,
|
|
48
|
+
isSupportedStaticSymbolCodePoint,
|
|
34
49
|
stableStringify,
|
|
50
|
+
staticAttributionPositionSchema,
|
|
51
|
+
staticAttributionRequestSchema,
|
|
52
|
+
staticOverlayPlacements,
|
|
35
53
|
staticOverlaySchema,
|
|
36
54
|
staticSceneLimits,
|
|
37
55
|
staticSceneSchema,
|
|
38
|
-
staticSceneSchemaVersion
|
|
39
|
-
|
|
56
|
+
staticSceneSchemaVersion,
|
|
57
|
+
staticSymbolAnchors,
|
|
58
|
+
staticSymbolCollisions,
|
|
59
|
+
staticSymbolLabelAppearances,
|
|
60
|
+
staticSymbolLabelPositions,
|
|
61
|
+
staticSymbolLanguages
|
|
62
|
+
} from "./chunk-6DWVCK64.js";
|
|
40
63
|
export {
|
|
41
64
|
MAX_OVERLAY_LATITUDE,
|
|
65
|
+
STATIC_MAP_RESULT_MEDIA_TYPE,
|
|
66
|
+
StaticMapError,
|
|
42
67
|
StaticMapRequestError,
|
|
43
68
|
circle,
|
|
44
69
|
compileStaticOverlays,
|
|
@@ -47,6 +72,7 @@ export {
|
|
|
47
72
|
createStaticMapIdempotencyKey,
|
|
48
73
|
hashRenderManifest,
|
|
49
74
|
hashStaticSceneRequest,
|
|
75
|
+
isSupportedStaticSymbolCodePoint,
|
|
50
76
|
line,
|
|
51
77
|
marker,
|
|
52
78
|
normalizeStaticScene,
|
|
@@ -55,15 +81,35 @@ export {
|
|
|
55
81
|
prepareStaticMapRequest,
|
|
56
82
|
requestStaticMapUntilReady,
|
|
57
83
|
stableStringify,
|
|
84
|
+
staticAttributionEntrySchema,
|
|
85
|
+
staticAttributionLimits,
|
|
86
|
+
staticAttributionPlanSchema,
|
|
87
|
+
staticAttributionPlanSchemaVersion,
|
|
88
|
+
staticAttributionPositionSchema,
|
|
89
|
+
staticAttributionProvenanceSchema,
|
|
90
|
+
staticAttributionRequestSchema,
|
|
91
|
+
staticAttributionSegmentSchema,
|
|
92
|
+
staticMapAttributionEntrySchema,
|
|
93
|
+
staticMapAttributionResultSchema,
|
|
94
|
+
staticMapErrorResponseSchema,
|
|
95
|
+
staticMapHostedResultSchema,
|
|
58
96
|
staticMapProcessingResultSchema,
|
|
59
|
-
staticMapReadyResultSchema,
|
|
60
97
|
staticMapRequestErrorResponseSchema,
|
|
98
|
+
staticOverlayPlacements,
|
|
61
99
|
staticOverlaySchema,
|
|
100
|
+
staticRenderCompositionSchema,
|
|
101
|
+
staticRenderCompositionSchemaVersion,
|
|
62
102
|
staticRenderManifestSchema,
|
|
63
103
|
staticRendererSchemaVersion,
|
|
64
104
|
staticSceneLimits,
|
|
65
105
|
staticSceneSchema,
|
|
66
106
|
staticSceneSchemaVersion,
|
|
107
|
+
staticSymbolAnchors,
|
|
108
|
+
staticSymbolCollisions,
|
|
109
|
+
staticSymbolLabelAppearances,
|
|
110
|
+
staticSymbolLabelPositions,
|
|
111
|
+
staticSymbolLanguages,
|
|
112
|
+
symbol,
|
|
67
113
|
validateStaticMapIdempotencyKey,
|
|
68
114
|
validateStaticRenderManifest,
|
|
69
115
|
validateStaticScene
|