@tileflow/static 0.1.0-alpha.17 → 0.1.0-alpha.18

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.
@@ -0,0 +1,58 @@
1
+ import { z } from 'zod';
2
+ import { d as StaticSceneInput } from './scene-contract-DzsUeJ_V.js';
3
+
4
+ declare function stableStringify(value: unknown): string;
5
+
6
+ type StaticMapResult = {
7
+ cached: boolean;
8
+ hash: string;
9
+ imageUrl: string;
10
+ operationId: string | null;
11
+ remainingUnits: number | null;
12
+ status: 'ready';
13
+ unitCost: 0 | 15;
14
+ };
15
+ type StaticMapCreateOptions = {
16
+ apiKey?: string;
17
+ apiUrl?: string;
18
+ fetch?: typeof fetch;
19
+ idempotencyKey: string;
20
+ maxWaitMs?: number;
21
+ pollIntervalMs?: number;
22
+ signal?: AbortSignal;
23
+ };
24
+ type StaticMapEndpointRequestOptions = Omit<StaticMapCreateOptions, 'apiUrl'> & {
25
+ createUrl: string;
26
+ };
27
+ type PreparedStaticMapRequest = Readonly<{
28
+ sceneKey: string;
29
+ }>;
30
+ declare const staticMapReadyResultSchema: z.ZodObject<{
31
+ cached: z.ZodBoolean;
32
+ hash: z.ZodString;
33
+ imageUrl: z.ZodString;
34
+ operationId: z.ZodString;
35
+ remainingUnits: z.ZodNumber;
36
+ status: z.ZodLiteral<"ready">;
37
+ unitCost: z.ZodLiteral<15>;
38
+ }, z.core.$strict>;
39
+ declare const staticMapProcessingResultSchema: z.ZodObject<{
40
+ operationId: z.ZodString;
41
+ retryAfterMs: z.ZodNumber;
42
+ status: z.ZodLiteral<"processing">;
43
+ }, z.core.$strict>;
44
+
45
+ declare function validateStaticMapIdempotencyKey(value: unknown): {
46
+ key: string;
47
+ ok: true;
48
+ } | {
49
+ error: string;
50
+ ok: false;
51
+ };
52
+ declare function createStaticMapIdempotencyKey(): string;
53
+ declare function prepareStaticMapRequest(scene: StaticSceneInput): PreparedStaticMapRequest;
54
+ declare function createStaticMap(scene: StaticSceneInput, options: StaticMapCreateOptions): Promise<StaticMapResult>;
55
+ declare function precacheStaticMap(scene: StaticSceneInput, options: StaticMapCreateOptions): Promise<StaticMapResult>;
56
+ declare function requestStaticMapUntilReady(request: PreparedStaticMapRequest, options: StaticMapEndpointRequestOptions): Promise<StaticMapResult>;
57
+
58
+ export { type PreparedStaticMapRequest, type StaticMapCreateOptions, type StaticMapEndpointRequestOptions, type StaticMapResult, createStaticMap, createStaticMapIdempotencyKey, precacheStaticMap, prepareStaticMapRequest, requestStaticMapUntilReady, stableStringify, staticMapProcessingResultSchema, staticMapReadyResultSchema, validateStaticMapIdempotencyKey };
package/dist/client.js ADDED
@@ -0,0 +1,25 @@
1
+ import {
2
+ createStaticMap,
3
+ createStaticMapIdempotencyKey,
4
+ precacheStaticMap,
5
+ prepareStaticMapRequest,
6
+ requestStaticMapUntilReady,
7
+ staticMapProcessingResultSchema,
8
+ staticMapReadyResultSchema,
9
+ validateStaticMapIdempotencyKey
10
+ } from "./chunk-43QGLF6K.js";
11
+ import "./chunk-ROBEGDDY.js";
12
+ import {
13
+ stableStringify
14
+ } from "./chunk-YUG3PBK2.js";
15
+ export {
16
+ createStaticMap,
17
+ createStaticMapIdempotencyKey,
18
+ precacheStaticMap,
19
+ prepareStaticMapRequest,
20
+ requestStaticMapUntilReady,
21
+ stableStringify,
22
+ staticMapProcessingResultSchema,
23
+ staticMapReadyResultSchema,
24
+ validateStaticMapIdempotencyKey
25
+ };
package/dist/index.d.ts CHANGED
@@ -1,278 +1,6 @@
1
- import { z } from 'zod';
2
-
3
- declare const staticSceneSchemaVersion = 1;
4
- declare const staticRendererSchemaVersion = 1;
5
- declare const staticSceneLimits: {
6
- readonly maxDimension: 1280;
7
- readonly maxGeoJsonBytes: 96000;
8
- readonly maxOverlays: 24;
9
- readonly maxPathCoordinates: 2000;
10
- readonly maxPhysicalPixels: number;
11
- readonly minDimension: 64;
12
- };
13
- declare const coordinateSchema: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
14
- declare const lineOverlaySchema: z.ZodObject<{
15
- color: z.ZodDefault<z.ZodString>;
16
- coordinates: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
17
- id: z.ZodOptional<z.ZodString>;
18
- opacity: z.ZodDefault<z.ZodNumber>;
19
- type: z.ZodLiteral<"line">;
20
- width: z.ZodDefault<z.ZodNumber>;
21
- }, z.core.$strip>;
22
- declare const circleOverlaySchema: z.ZodObject<{
23
- color: z.ZodDefault<z.ZodString>;
24
- coordinate: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
25
- id: z.ZodOptional<z.ZodString>;
26
- opacity: z.ZodDefault<z.ZodNumber>;
27
- radius: z.ZodDefault<z.ZodNumber>;
28
- strokeColor: z.ZodOptional<z.ZodString>;
29
- strokeWidth: z.ZodDefault<z.ZodNumber>;
30
- type: z.ZodLiteral<"circle">;
31
- }, z.core.$strip>;
32
- declare const markerOverlaySchema: z.ZodObject<{
33
- color: z.ZodDefault<z.ZodString>;
34
- coordinate: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
35
- id: z.ZodOptional<z.ZodString>;
36
- radius: z.ZodDefault<z.ZodNumber>;
37
- strokeColor: z.ZodDefault<z.ZodString>;
38
- strokeWidth: z.ZodDefault<z.ZodNumber>;
39
- type: z.ZodLiteral<"marker">;
40
- }, z.core.$strip>;
41
- declare const polygonOverlaySchema: z.ZodObject<{
42
- coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
43
- fill: z.ZodDefault<z.ZodString>;
44
- id: z.ZodOptional<z.ZodString>;
45
- opacity: z.ZodDefault<z.ZodNumber>;
46
- stroke: z.ZodOptional<z.ZodString>;
47
- strokeWidth: z.ZodDefault<z.ZodNumber>;
48
- type: z.ZodLiteral<"polygon">;
49
- }, z.core.$strip>;
50
- declare const staticOverlaySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
51
- color: z.ZodDefault<z.ZodString>;
52
- coordinates: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
53
- id: z.ZodOptional<z.ZodString>;
54
- opacity: z.ZodDefault<z.ZodNumber>;
55
- type: z.ZodLiteral<"line">;
56
- width: z.ZodDefault<z.ZodNumber>;
57
- }, z.core.$strip>, z.ZodObject<{
58
- color: z.ZodDefault<z.ZodString>;
59
- coordinate: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
60
- id: z.ZodOptional<z.ZodString>;
61
- opacity: z.ZodDefault<z.ZodNumber>;
62
- radius: z.ZodDefault<z.ZodNumber>;
63
- strokeColor: z.ZodOptional<z.ZodString>;
64
- strokeWidth: z.ZodDefault<z.ZodNumber>;
65
- type: z.ZodLiteral<"circle">;
66
- }, z.core.$strip>, z.ZodObject<{
67
- color: z.ZodDefault<z.ZodString>;
68
- coordinate: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
69
- id: z.ZodOptional<z.ZodString>;
70
- radius: z.ZodDefault<z.ZodNumber>;
71
- strokeColor: z.ZodDefault<z.ZodString>;
72
- strokeWidth: z.ZodDefault<z.ZodNumber>;
73
- type: z.ZodLiteral<"marker">;
74
- }, z.core.$strip>, z.ZodObject<{
75
- coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
76
- fill: z.ZodDefault<z.ZodString>;
77
- id: z.ZodOptional<z.ZodString>;
78
- opacity: z.ZodDefault<z.ZodNumber>;
79
- stroke: z.ZodOptional<z.ZodString>;
80
- strokeWidth: z.ZodDefault<z.ZodNumber>;
81
- type: z.ZodLiteral<"polygon">;
82
- }, z.core.$strip>], "type">;
83
- declare const staticSceneSchema: z.ZodObject<{
84
- camera: z.ZodDiscriminatedUnion<[z.ZodObject<{
85
- bearing: z.ZodOptional<z.ZodNumber>;
86
- center: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
87
- type: z.ZodLiteral<"center">;
88
- zoom: z.ZodNumber;
89
- }, z.core.$strip>, z.ZodObject<{
90
- bearing: z.ZodOptional<z.ZodNumber>;
91
- bounds: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
92
- padding: z.ZodOptional<z.ZodNumber>;
93
- type: z.ZodLiteral<"bounds">;
94
- }, z.core.$strip>], "type">;
95
- map: z.ZodString;
96
- overlays: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
97
- color: z.ZodDefault<z.ZodString>;
98
- coordinates: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
99
- id: z.ZodOptional<z.ZodString>;
100
- opacity: z.ZodDefault<z.ZodNumber>;
101
- type: z.ZodLiteral<"line">;
102
- width: z.ZodDefault<z.ZodNumber>;
103
- }, z.core.$strip>, z.ZodObject<{
104
- color: z.ZodDefault<z.ZodString>;
105
- coordinate: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
106
- id: z.ZodOptional<z.ZodString>;
107
- opacity: z.ZodDefault<z.ZodNumber>;
108
- radius: z.ZodDefault<z.ZodNumber>;
109
- strokeColor: z.ZodOptional<z.ZodString>;
110
- strokeWidth: z.ZodDefault<z.ZodNumber>;
111
- type: z.ZodLiteral<"circle">;
112
- }, z.core.$strip>, z.ZodObject<{
113
- color: z.ZodDefault<z.ZodString>;
114
- coordinate: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
115
- id: z.ZodOptional<z.ZodString>;
116
- radius: z.ZodDefault<z.ZodNumber>;
117
- strokeColor: z.ZodDefault<z.ZodString>;
118
- strokeWidth: z.ZodDefault<z.ZodNumber>;
119
- type: z.ZodLiteral<"marker">;
120
- }, z.core.$strip>, z.ZodObject<{
121
- coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
122
- fill: z.ZodDefault<z.ZodString>;
123
- id: z.ZodOptional<z.ZodString>;
124
- opacity: z.ZodDefault<z.ZodNumber>;
125
- stroke: z.ZodOptional<z.ZodString>;
126
- strokeWidth: z.ZodDefault<z.ZodNumber>;
127
- type: z.ZodLiteral<"polygon">;
128
- }, z.core.$strip>], "type">>>;
129
- size: z.ZodObject<{
130
- dpr: z.ZodOptional<z.ZodLiteral<1>>;
131
- height: z.ZodNumber;
132
- width: z.ZodNumber;
133
- }, z.core.$strip>;
134
- }, z.core.$strip>;
135
- declare const staticRenderManifestSchema: z.ZodObject<{
136
- mapId: z.ZodString;
137
- rendererVersion: z.ZodString;
138
- schemaVersion: z.ZodLiteral<1>;
139
- scene: z.ZodObject<{
140
- camera: z.ZodDiscriminatedUnion<[z.ZodObject<{
141
- bearing: z.ZodOptional<z.ZodNumber>;
142
- center: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
143
- type: z.ZodLiteral<"center">;
144
- zoom: z.ZodNumber;
145
- }, z.core.$strip>, z.ZodObject<{
146
- bearing: z.ZodOptional<z.ZodNumber>;
147
- bounds: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
148
- padding: z.ZodOptional<z.ZodNumber>;
149
- type: z.ZodLiteral<"bounds">;
150
- }, z.core.$strip>], "type">;
151
- map: z.ZodString;
152
- overlays: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
153
- color: z.ZodDefault<z.ZodString>;
154
- coordinates: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
155
- id: z.ZodOptional<z.ZodString>;
156
- opacity: z.ZodDefault<z.ZodNumber>;
157
- type: z.ZodLiteral<"line">;
158
- width: z.ZodDefault<z.ZodNumber>;
159
- }, z.core.$strip>, z.ZodObject<{
160
- color: z.ZodDefault<z.ZodString>;
161
- coordinate: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
162
- id: z.ZodOptional<z.ZodString>;
163
- opacity: z.ZodDefault<z.ZodNumber>;
164
- radius: z.ZodDefault<z.ZodNumber>;
165
- strokeColor: z.ZodOptional<z.ZodString>;
166
- strokeWidth: z.ZodDefault<z.ZodNumber>;
167
- type: z.ZodLiteral<"circle">;
168
- }, z.core.$strip>, z.ZodObject<{
169
- color: z.ZodDefault<z.ZodString>;
170
- coordinate: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
171
- id: z.ZodOptional<z.ZodString>;
172
- radius: z.ZodDefault<z.ZodNumber>;
173
- strokeColor: z.ZodDefault<z.ZodString>;
174
- strokeWidth: z.ZodDefault<z.ZodNumber>;
175
- type: z.ZodLiteral<"marker">;
176
- }, z.core.$strip>, z.ZodObject<{
177
- coordinates: z.ZodArray<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
178
- fill: z.ZodDefault<z.ZodString>;
179
- id: z.ZodOptional<z.ZodString>;
180
- opacity: z.ZodDefault<z.ZodNumber>;
181
- stroke: z.ZodOptional<z.ZodString>;
182
- strokeWidth: z.ZodDefault<z.ZodNumber>;
183
- type: z.ZodLiteral<"polygon">;
184
- }, z.core.$strip>], "type">>>;
185
- size: z.ZodObject<{
186
- dpr: z.ZodOptional<z.ZodLiteral<1>>;
187
- height: z.ZodNumber;
188
- width: z.ZodNumber;
189
- }, z.core.$strip>;
190
- }, z.core.$strip>;
191
- styleId: z.ZodOptional<z.ZodString>;
192
- styleRevision: z.ZodString;
193
- styleUrl: z.ZodString;
194
- }, z.core.$strip>;
195
- type StaticCoordinate = z.infer<typeof coordinateSchema>;
196
- type StaticSceneInput = z.input<typeof staticSceneSchema>;
197
- type StaticScene = z.infer<typeof staticSceneSchema>;
198
- type StaticOverlayInput = z.input<typeof staticOverlaySchema>;
199
- type StaticOverlay = z.infer<typeof staticOverlaySchema>;
200
- type StaticRenderManifest = z.infer<typeof staticRenderManifestSchema>;
201
- type StaticMapResult = {
202
- cached: boolean;
203
- hash: string;
204
- imageUrl: string;
205
- operationId: string | null;
206
- remainingUnits: number | null;
207
- status: 'ready';
208
- unitCost: 0 | 15;
209
- };
210
- type StaticMapCreateOptions = {
211
- apiKey?: string;
212
- apiUrl?: string;
213
- fetch?: typeof fetch;
214
- idempotencyKey: string;
215
- maxWaitMs?: number;
216
- pollIntervalMs?: number;
217
- signal?: AbortSignal;
218
- };
219
- declare const staticMapReadyResultSchema: z.ZodObject<{
220
- cached: z.ZodBoolean;
221
- hash: z.ZodString;
222
- imageUrl: z.ZodString;
223
- operationId: z.ZodString;
224
- remainingUnits: z.ZodNumber;
225
- status: z.ZodLiteral<"ready">;
226
- unitCost: z.ZodLiteral<15>;
227
- }, z.core.$strict>;
228
- declare const staticMapProcessingResultSchema: z.ZodObject<{
229
- operationId: z.ZodString;
230
- retryAfterMs: z.ZodNumber;
231
- status: z.ZodLiteral<"processing">;
232
- }, z.core.$strict>;
233
- declare function validateStaticMapIdempotencyKey(value: unknown): {
234
- key: string;
235
- ok: true;
236
- } | {
237
- error: string;
238
- ok: false;
239
- };
240
- declare function createStaticMapIdempotencyKey(): string;
241
- declare function line(input: Omit<z.input<typeof lineOverlaySchema>, 'type'>): StaticOverlay;
242
- declare function circle(input: Omit<z.input<typeof circleOverlaySchema>, 'type'>): StaticOverlay;
243
- declare function marker(input: Omit<z.input<typeof markerOverlaySchema>, 'type'>): StaticOverlay;
244
- declare function polygon(input: Omit<z.input<typeof polygonOverlaySchema>, 'type'>): StaticOverlay;
245
- declare function validateStaticScene(input: unknown): {
246
- ok: true;
247
- scene: StaticScene;
248
- } | {
249
- error: string;
250
- ok: false;
251
- };
252
- declare function validateStaticRenderManifest(input: unknown): {
253
- manifest: StaticRenderManifest;
254
- ok: true;
255
- } | {
256
- error: string;
257
- ok: false;
258
- };
259
- declare function normalizeStaticScene(scene: StaticSceneInput): StaticScene;
260
- declare function createRenderManifest(input: {
261
- mapId: string;
262
- rendererVersion: string;
263
- scene: StaticSceneInput;
264
- styleId?: string;
265
- styleRevision: string;
266
- styleUrl: string;
267
- }): StaticRenderManifest;
268
- declare function hashRenderManifest(manifest: StaticRenderManifest): Promise<string>;
269
- declare function hashStaticSceneRequest(scene: StaticSceneInput): Promise<string>;
270
- declare function compileStaticOverlays(overlays: StaticOverlay[]): {
271
- layers: Record<string, unknown>[];
272
- sources: Record<string, Record<string, unknown>>;
273
- };
274
- declare function createStaticMap(scene: StaticSceneInput, options: StaticMapCreateOptions): Promise<StaticMapResult>;
275
- declare function precacheStaticMap(scene: StaticSceneInput, options: StaticMapCreateOptions): Promise<StaticMapResult>;
276
- declare function stableStringify(value: unknown): string;
277
-
278
- export { type StaticCoordinate, type StaticMapCreateOptions, type StaticMapResult, type StaticOverlay, type StaticOverlayInput, type StaticRenderManifest, type StaticScene, type StaticSceneInput, circle, compileStaticOverlays, createRenderManifest, createStaticMap, createStaticMapIdempotencyKey, hashRenderManifest, hashStaticSceneRequest, line, marker, normalizeStaticScene, polygon, precacheStaticMap, stableStringify, staticMapProcessingResultSchema, staticMapReadyResultSchema, staticOverlaySchema, staticRenderManifestSchema, staticRendererSchemaVersion, staticSceneLimits, staticSceneSchema, staticSceneSchemaVersion, validateStaticMapIdempotencyKey, validateStaticRenderManifest, validateStaticScene };
1
+ export { normalizeStaticScene, 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, staticMapProcessingResultSchema, staticMapReadyResultSchema, validateStaticMapIdempotencyKey } from './client.js';
5
+ export { S as StaticCoordinate, a as StaticOverlay, b as StaticOverlayInput, c as StaticScene, d as StaticSceneInput, s as staticOverlaySchema, e as staticSceneLimits, f as staticSceneSchema, g as staticSceneSchemaVersion } from './scene-contract-DzsUeJ_V.js';
6
+ import 'zod';