@basemaps/config-loader 7.1.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/LICENSE +21 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +3 -0
- package/build/index.js.map +1 -0
- package/build/json/__tests__/config.loader.test.d.ts +1 -0
- package/build/json/__tests__/config.loader.test.js +105 -0
- package/build/json/__tests__/config.loader.test.js.map +1 -0
- package/build/json/__tests__/tiff.config.test.d.ts +1 -0
- package/build/json/__tests__/tiff.config.test.js +53 -0
- package/build/json/__tests__/tiff.config.test.js.map +1 -0
- package/build/json/__tests__/tiff.load.test.d.ts +1 -0
- package/build/json/__tests__/tiff.load.test.js +143 -0
- package/build/json/__tests__/tiff.load.test.js.map +1 -0
- package/build/json/imagery.config.cache.d.ts +7 -0
- package/build/json/imagery.config.cache.js +45 -0
- package/build/json/imagery.config.cache.js.map +1 -0
- package/build/json/json.config.d.ts +39 -0
- package/build/json/json.config.js +319 -0
- package/build/json/json.config.js.map +1 -0
- package/build/json/log.d.ts +17 -0
- package/build/json/log.js +2 -0
- package/build/json/log.js.map +1 -0
- package/build/json/parse.provider.d.ts +149 -0
- package/build/json/parse.provider.js +31 -0
- package/build/json/parse.provider.js.map +1 -0
- package/build/json/parse.style.d.ts +30 -0
- package/build/json/parse.style.js +13 -0
- package/build/json/parse.style.js.map +1 -0
- package/build/json/parse.tile.set.d.ts +252 -0
- package/build/json/parse.tile.set.js +47 -0
- package/build/json/parse.tile.set.js.map +1 -0
- package/build/json/tiff.config.d.ts +113 -0
- package/build/json/tiff.config.js +430 -0
- package/build/json/tiff.config.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { ConfigId, ConfigPrefix, ConfigProviderMemory, parseRgba, sha256base58, TileSetType, } from '@basemaps/config';
|
|
2
|
+
import { TileMatrixSets } from '@basemaps/geo';
|
|
3
|
+
import { Cotar, fsa, stringToUrlFolder, Tiff, TiffTag } from '@basemaps/shared';
|
|
4
|
+
import ulid from 'ulid';
|
|
5
|
+
import { zProviderConfig } from './parse.provider.js';
|
|
6
|
+
import { zStyleJson } from './parse.style.js';
|
|
7
|
+
import { zTileSetConfig } from './parse.tile.set.js';
|
|
8
|
+
import { initImageryFromTiffUrl } from './tiff.config.js';
|
|
9
|
+
export function matchUri(a, b) {
|
|
10
|
+
const UrlA = new URL(a.endsWith('/') ? a : a + '/');
|
|
11
|
+
const UrlB = new URL(b.endsWith('/') ? b : b + '/');
|
|
12
|
+
if (UrlA.href === UrlB.href)
|
|
13
|
+
return true;
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
export function guessIdFromUri(uri) {
|
|
17
|
+
const parts = uri.split('/');
|
|
18
|
+
const id = uri.endsWith('/') ? parts.at(-2) : parts.at(-1);
|
|
19
|
+
if (id == null)
|
|
20
|
+
return null;
|
|
21
|
+
try {
|
|
22
|
+
const date = new Date(ulid.decodeTime(id));
|
|
23
|
+
if (date.getUTCFullYear() < 2015)
|
|
24
|
+
return null;
|
|
25
|
+
if (date.getUTCFullYear() > new Date().getUTCFullYear() + 1)
|
|
26
|
+
return null;
|
|
27
|
+
return id;
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const IsEmptyCheckSizeBytes = 512 * 1024;
|
|
34
|
+
/**
|
|
35
|
+
* Check to see if this tiff has any data
|
|
36
|
+
*
|
|
37
|
+
* This looks at tiff tile offset arrays see if any internal tiff tiles contain any data
|
|
38
|
+
*
|
|
39
|
+
* @param toCheck Path or tiff check
|
|
40
|
+
* @returns true if the tiff is empty, false otherwise
|
|
41
|
+
*/
|
|
42
|
+
export async function isEmptyTiff(toCheck) {
|
|
43
|
+
const isUrl = toCheck instanceof URL;
|
|
44
|
+
const tiff = isUrl ? await Tiff.create(fsa.source(toCheck)) : toCheck;
|
|
45
|
+
try {
|
|
46
|
+
// Only check the tiff for empty if the size is less than IsEmptyCheckSizeBytes
|
|
47
|
+
const tiffSize = tiff.source.metadata?.size ?? 0;
|
|
48
|
+
if (tiffSize > IsEmptyCheckSizeBytes)
|
|
49
|
+
return false;
|
|
50
|
+
// Starting the smallest tiff overview greatly reduces the amount of data needing to be read
|
|
51
|
+
// if the tiff contains data.
|
|
52
|
+
for (let i = tiff.images.length - 1; i >= 0; i--) {
|
|
53
|
+
const tileOffsets = await tiff.images[i].fetch(TiffTag.TileByteCounts);
|
|
54
|
+
// Tiff is not tiled, so cannot know if its empty from tile offsets
|
|
55
|
+
if (tileOffsets == null)
|
|
56
|
+
return false;
|
|
57
|
+
// If any tile offset is above 0 then there is data at that offset.
|
|
58
|
+
for (const offset of tileOffsets) {
|
|
59
|
+
// There exists a tile that contains some data, so this tiff is not empty
|
|
60
|
+
if (offset > 0)
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
// If the tiff was created here, it needs to be closed
|
|
68
|
+
if (isUrl)
|
|
69
|
+
await tiff.source.close?.();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export class ConfigJson {
|
|
73
|
+
constructor(url, Q, log, imageryConfigCache) {
|
|
74
|
+
Object.defineProperty(this, "mem", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
configurable: true,
|
|
77
|
+
writable: true,
|
|
78
|
+
value: void 0
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(this, "url", {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
configurable: true,
|
|
83
|
+
writable: true,
|
|
84
|
+
value: void 0
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(this, "cache", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
configurable: true,
|
|
89
|
+
writable: true,
|
|
90
|
+
value: new Map()
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(this, "logger", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
configurable: true,
|
|
95
|
+
writable: true,
|
|
96
|
+
value: void 0
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(this, "Q", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
configurable: true,
|
|
101
|
+
writable: true,
|
|
102
|
+
value: void 0
|
|
103
|
+
});
|
|
104
|
+
Object.defineProperty(this, "imageryConfigCache", {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
configurable: true,
|
|
107
|
+
writable: true,
|
|
108
|
+
value: void 0
|
|
109
|
+
});
|
|
110
|
+
this.url = url;
|
|
111
|
+
this.mem = new ConfigProviderMemory();
|
|
112
|
+
this.imageryConfigCache = imageryConfigCache;
|
|
113
|
+
this.logger = log;
|
|
114
|
+
this.Q = Q;
|
|
115
|
+
}
|
|
116
|
+
/** Import configuration from a base path */
|
|
117
|
+
static async fromUrl(basePath, Q, log, imageryConfigCache) {
|
|
118
|
+
if (basePath.pathname.endsWith('.json') || basePath.pathname.endsWith('.json.gz')) {
|
|
119
|
+
const config = await fsa.readJson(basePath);
|
|
120
|
+
if (config.id && config.id.startsWith('cb_')) {
|
|
121
|
+
// We have been given a config bundle just load that instead!
|
|
122
|
+
return ConfigProviderMemory.fromJson(config);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const cfg = new ConfigJson(basePath, Q, log, imageryConfigCache);
|
|
126
|
+
const files = await fsa.toArray(fsa.list(basePath));
|
|
127
|
+
const todo = files.map(async (filePath) => {
|
|
128
|
+
if (!filePath.pathname.endsWith('.json'))
|
|
129
|
+
return;
|
|
130
|
+
const bc = await fsa.readJson(filePath);
|
|
131
|
+
const prefix = ConfigId.getPrefix(bc.id);
|
|
132
|
+
if (prefix) {
|
|
133
|
+
log.debug({ path: filePath, type: prefix, config: bc.id }, 'Config:Load');
|
|
134
|
+
switch (prefix) {
|
|
135
|
+
case ConfigPrefix.TileSet:
|
|
136
|
+
cfg.mem.put(await cfg.tileSet(bc));
|
|
137
|
+
break;
|
|
138
|
+
case ConfigPrefix.Provider:
|
|
139
|
+
cfg.mem.put(await cfg.provider(bc));
|
|
140
|
+
break;
|
|
141
|
+
case ConfigPrefix.Style:
|
|
142
|
+
cfg.mem.put(await cfg.style(bc));
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
log.warn({ path: filePath }, 'Config:Invalid');
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
await Promise.all(todo);
|
|
151
|
+
return cfg.mem;
|
|
152
|
+
}
|
|
153
|
+
async provider(obj) {
|
|
154
|
+
const pv = zProviderConfig.parse(obj);
|
|
155
|
+
this.logger.info({ config: pv.id }, 'Config:Loaded:Provider');
|
|
156
|
+
return {
|
|
157
|
+
id: pv.id,
|
|
158
|
+
name: ConfigId.unprefix(ConfigPrefix.Provider, pv.id),
|
|
159
|
+
serviceIdentification: pv.serviceIdentification,
|
|
160
|
+
serviceProvider: pv.serviceProvider,
|
|
161
|
+
updatedAt: Date.now(),
|
|
162
|
+
version: 1,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
async style(obj) {
|
|
166
|
+
const st = zStyleJson.parse(obj);
|
|
167
|
+
this.logger.info({ config: st.id }, 'Config:Loaded:Style');
|
|
168
|
+
return {
|
|
169
|
+
id: st.id,
|
|
170
|
+
name: st.name,
|
|
171
|
+
style: st,
|
|
172
|
+
updatedAt: Date.now(),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
async tileSet(obj) {
|
|
176
|
+
const ts = zTileSetConfig.parse(obj);
|
|
177
|
+
this.logger.info({ config: ts.id }, 'Config:Loaded:TileSet');
|
|
178
|
+
const imageryFetch = [];
|
|
179
|
+
if (ts.type === TileSetType.Raster) {
|
|
180
|
+
for (const layer of ts.layers) {
|
|
181
|
+
if (layer[2193] != null) {
|
|
182
|
+
imageryFetch.push(this.loadImagery(stringToUrlFolder(layer[2193]), layer.name, layer.title));
|
|
183
|
+
}
|
|
184
|
+
if (layer[3857] != null) {
|
|
185
|
+
imageryFetch.push(this.loadImagery(stringToUrlFolder(layer[3857]), layer.name, layer.title));
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const imagery = await Promise.all(imageryFetch);
|
|
190
|
+
const layers = [];
|
|
191
|
+
const tileSet = {
|
|
192
|
+
type: ts.type,
|
|
193
|
+
id: ts.id,
|
|
194
|
+
name: ConfigId.unprefix(ConfigPrefix.TileSet, ts.id),
|
|
195
|
+
title: ts.title,
|
|
196
|
+
layers,
|
|
197
|
+
};
|
|
198
|
+
function updateLayerUri(layer, uri, logger) {
|
|
199
|
+
if (uri == null)
|
|
200
|
+
return uri;
|
|
201
|
+
if (uri.startsWith(ConfigPrefix.Imagery))
|
|
202
|
+
return uri;
|
|
203
|
+
const record = imagery.find((f) => matchUri(f.uri, uri)); ///
|
|
204
|
+
if (record == null)
|
|
205
|
+
throw new Error('Unable to find imagery id for uri:' + uri);
|
|
206
|
+
if (record.title && record.title !== layer.title) {
|
|
207
|
+
logger.warn({ layer: layer.name, imageryTitle: record.title, layerTitle: layer.title }, 'Imagery:Title:Missmatch');
|
|
208
|
+
}
|
|
209
|
+
record.title = layer.title;
|
|
210
|
+
if (layer.category) {
|
|
211
|
+
if (record.category && record.category !== layer.category) {
|
|
212
|
+
logger.warn({ layer: layer.name, imageryCategory: record.category, layerCategory: layer.category }, 'Imagery:Category:Missmatch');
|
|
213
|
+
}
|
|
214
|
+
record.category = layer.category;
|
|
215
|
+
}
|
|
216
|
+
return record.id;
|
|
217
|
+
}
|
|
218
|
+
// Map the configuration sources into imagery ids
|
|
219
|
+
for (const l of ts.layers) {
|
|
220
|
+
const layer = { ...l };
|
|
221
|
+
layers.push(layer);
|
|
222
|
+
if (tileSet.type === TileSetType.Raster) {
|
|
223
|
+
if (layer[2193])
|
|
224
|
+
layer[2193] = updateLayerUri(layer, layer[2193], this.logger);
|
|
225
|
+
if (layer[3857])
|
|
226
|
+
layer[3857] = updateLayerUri(layer, layer[3857], this.logger);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (ts.description)
|
|
230
|
+
tileSet.description = ts.description;
|
|
231
|
+
if (ts.category)
|
|
232
|
+
tileSet.category = ts.category;
|
|
233
|
+
if (ts.minZoom)
|
|
234
|
+
tileSet.minZoom = ts.minZoom;
|
|
235
|
+
if (ts.maxZoom)
|
|
236
|
+
tileSet.maxZoom = ts.maxZoom;
|
|
237
|
+
if (tileSet.type === TileSetType.Raster) {
|
|
238
|
+
if (ts.outputs)
|
|
239
|
+
tileSet.outputs = ts.outputs;
|
|
240
|
+
if (ts.background) {
|
|
241
|
+
tileSet.background = parseRgba(ts.background);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (ts.format) {
|
|
245
|
+
tileSet.format = ts.format;
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
tileSet.format = ts.type === TileSetType.Vector ? 'pbf' : 'webp';
|
|
249
|
+
}
|
|
250
|
+
return tileSet;
|
|
251
|
+
}
|
|
252
|
+
loadImagery(url, name, title) {
|
|
253
|
+
let existing = this.cache.get(url.href);
|
|
254
|
+
if (existing == null) {
|
|
255
|
+
existing = this._loadImagery(url, name, title);
|
|
256
|
+
this.cache.set(url.href, existing);
|
|
257
|
+
}
|
|
258
|
+
return existing;
|
|
259
|
+
}
|
|
260
|
+
async _loadImagery(url, name, title) {
|
|
261
|
+
// TODO is there a better way of guessing the imagery id & tile matrix?
|
|
262
|
+
const imageId = guessIdFromUri(url.href) ?? sha256base58(url.href);
|
|
263
|
+
const id = ConfigId.prefix(ConfigPrefix.Imagery, imageId);
|
|
264
|
+
this.logger.trace({ url: url.href, imageId: id }, 'Imagery:Fetch');
|
|
265
|
+
const img = await initImageryFromTiffUrl(url, this.Q, this.imageryConfigCache, this.logger);
|
|
266
|
+
img.id = id; // TODO could we use img.collection.id for this?
|
|
267
|
+
// TODO should we be overwriting the name and title when it is loaded from the STAC metadata?
|
|
268
|
+
img.name = name;
|
|
269
|
+
img.title = title;
|
|
270
|
+
// TODO should we store the STAC collection somewhere?
|
|
271
|
+
delete img.collection;
|
|
272
|
+
this.mem.put(img);
|
|
273
|
+
return img;
|
|
274
|
+
}
|
|
275
|
+
static async findImageryOverviews(cfg) {
|
|
276
|
+
if (cfg.overviews)
|
|
277
|
+
throw new Error('Overviews exist already for config: ' + cfg.id);
|
|
278
|
+
const targetOverviews = new URL('overviews.tar.co', fsa.toUrl(cfg.uri));
|
|
279
|
+
const exists = await fsa.exists(targetOverviews);
|
|
280
|
+
if (!exists)
|
|
281
|
+
return;
|
|
282
|
+
const tileMatrix = TileMatrixSets.find(cfg.tileMatrix);
|
|
283
|
+
if (tileMatrix == null)
|
|
284
|
+
throw new Error('Missing tileMatrix for imagery:' + cfg.id);
|
|
285
|
+
const cotar = await Cotar.fromTar(fsa.source(targetOverviews));
|
|
286
|
+
// When the cotars are made a WMTSCapabilties is added so it easy to view in something like QGIS
|
|
287
|
+
// We can use the WMTSCapabitities to figure out the tileMatrix and zoom levels
|
|
288
|
+
const wmtsRaw = await cotar.get('WMTSCapabilities.xml');
|
|
289
|
+
if (wmtsRaw == null)
|
|
290
|
+
return;
|
|
291
|
+
const wmts = Buffer.from(wmtsRaw).toString();
|
|
292
|
+
const zoomLevels = zoomLevelsFromWmts(wmts, tileMatrix);
|
|
293
|
+
if (zoomLevels == null)
|
|
294
|
+
return;
|
|
295
|
+
return { path: 'overviews.tar.co', minZoom: zoomLevels.minZoom, maxZoom: zoomLevels.maxZoom };
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/** Attempt to parse a cotar WMTSCapabilties to figure out what zoom levels are applicable */
|
|
299
|
+
export function zoomLevelsFromWmts(wmts, tileMatrix) {
|
|
300
|
+
const owsIds = wmts
|
|
301
|
+
.split('\n')
|
|
302
|
+
.filter((f) => f.includes('ows:Identifier'))
|
|
303
|
+
.map((c) => c.trim().replace('<ows:Identifier>', '').replace('</ows:Identifier>', ''));
|
|
304
|
+
const tileMatrixOffset = owsIds.indexOf(tileMatrix.identifier);
|
|
305
|
+
if (tileMatrixOffset === -1)
|
|
306
|
+
return null;
|
|
307
|
+
const minZoom = Number(owsIds[tileMatrixOffset + 1]);
|
|
308
|
+
const maxZoom = Number(owsIds[owsIds.length - 1]);
|
|
309
|
+
if (isNaN(minZoom))
|
|
310
|
+
return null;
|
|
311
|
+
if (isNaN(maxZoom))
|
|
312
|
+
return null;
|
|
313
|
+
if (maxZoom < minZoom)
|
|
314
|
+
return null;
|
|
315
|
+
if (maxZoom === 0)
|
|
316
|
+
return null;
|
|
317
|
+
return { minZoom, maxZoom };
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=json.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.config.js","sourceRoot":"","sources":["../../src/json/json.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,EAIR,YAAY,EAEZ,oBAAoB,EAGpB,SAAS,EACT,YAAY,EAEZ,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAA8B,cAAc,EAAgB,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAA4B,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,UAAU,QAAQ,CAAC,CAAS,EAAE,CAAS;IAC3C,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,C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AAC;IAC/D,IAAI,gBAAgB,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAElD,IAAI,KAAK,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,KAAK,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,OAAO,GAAG,OAAO;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,OAAO,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface LogFunc {
|
|
2
|
+
(msg: string): void;
|
|
3
|
+
(obj: Record<string, unknown>, msg: string): void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Expose log type so functions that do not have direct access to pino have access to the log type
|
|
7
|
+
*/
|
|
8
|
+
export interface LogType {
|
|
9
|
+
level: string;
|
|
10
|
+
trace: LogFunc;
|
|
11
|
+
debug: LogFunc;
|
|
12
|
+
info: LogFunc;
|
|
13
|
+
warn: LogFunc;
|
|
14
|
+
error: LogFunc;
|
|
15
|
+
fatal: LogFunc;
|
|
16
|
+
child: (obj: Record<string, unknown>) => LogType;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/json/log.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const zProviderConfig: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
serviceIdentification: z.ZodObject<{
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
description: z.ZodString;
|
|
7
|
+
fees: z.ZodString;
|
|
8
|
+
accessConstraints: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
fees: string;
|
|
13
|
+
accessConstraints: string;
|
|
14
|
+
}, {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
fees: string;
|
|
18
|
+
accessConstraints: string;
|
|
19
|
+
}>;
|
|
20
|
+
serviceProvider: z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
site: z.ZodString;
|
|
23
|
+
contact: z.ZodObject<{
|
|
24
|
+
individualName: z.ZodString;
|
|
25
|
+
position: z.ZodString;
|
|
26
|
+
phone: z.ZodString;
|
|
27
|
+
address: z.ZodObject<{
|
|
28
|
+
deliveryPoint: z.ZodString;
|
|
29
|
+
city: z.ZodString;
|
|
30
|
+
postalCode: z.ZodString;
|
|
31
|
+
country: z.ZodString;
|
|
32
|
+
email: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
deliveryPoint: string;
|
|
35
|
+
city: string;
|
|
36
|
+
postalCode: string;
|
|
37
|
+
country: string;
|
|
38
|
+
email: string;
|
|
39
|
+
}, {
|
|
40
|
+
deliveryPoint: string;
|
|
41
|
+
city: string;
|
|
42
|
+
postalCode: string;
|
|
43
|
+
country: string;
|
|
44
|
+
email: string;
|
|
45
|
+
}>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
individualName: string;
|
|
48
|
+
position: string;
|
|
49
|
+
phone: string;
|
|
50
|
+
address: {
|
|
51
|
+
deliveryPoint: string;
|
|
52
|
+
city: string;
|
|
53
|
+
postalCode: string;
|
|
54
|
+
country: string;
|
|
55
|
+
email: string;
|
|
56
|
+
};
|
|
57
|
+
}, {
|
|
58
|
+
individualName: string;
|
|
59
|
+
position: string;
|
|
60
|
+
phone: string;
|
|
61
|
+
address: {
|
|
62
|
+
deliveryPoint: string;
|
|
63
|
+
city: string;
|
|
64
|
+
postalCode: string;
|
|
65
|
+
country: string;
|
|
66
|
+
email: string;
|
|
67
|
+
};
|
|
68
|
+
}>;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
name: string;
|
|
71
|
+
site: string;
|
|
72
|
+
contact: {
|
|
73
|
+
individualName: string;
|
|
74
|
+
position: string;
|
|
75
|
+
phone: string;
|
|
76
|
+
address: {
|
|
77
|
+
deliveryPoint: string;
|
|
78
|
+
city: string;
|
|
79
|
+
postalCode: string;
|
|
80
|
+
country: string;
|
|
81
|
+
email: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}, {
|
|
85
|
+
name: string;
|
|
86
|
+
site: string;
|
|
87
|
+
contact: {
|
|
88
|
+
individualName: string;
|
|
89
|
+
position: string;
|
|
90
|
+
phone: string;
|
|
91
|
+
address: {
|
|
92
|
+
deliveryPoint: string;
|
|
93
|
+
city: string;
|
|
94
|
+
postalCode: string;
|
|
95
|
+
country: string;
|
|
96
|
+
email: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
}>;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
id: string;
|
|
102
|
+
serviceIdentification: {
|
|
103
|
+
title: string;
|
|
104
|
+
description: string;
|
|
105
|
+
fees: string;
|
|
106
|
+
accessConstraints: string;
|
|
107
|
+
};
|
|
108
|
+
serviceProvider: {
|
|
109
|
+
name: string;
|
|
110
|
+
site: string;
|
|
111
|
+
contact: {
|
|
112
|
+
individualName: string;
|
|
113
|
+
position: string;
|
|
114
|
+
phone: string;
|
|
115
|
+
address: {
|
|
116
|
+
deliveryPoint: string;
|
|
117
|
+
city: string;
|
|
118
|
+
postalCode: string;
|
|
119
|
+
country: string;
|
|
120
|
+
email: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
}, {
|
|
125
|
+
id: string;
|
|
126
|
+
serviceIdentification: {
|
|
127
|
+
title: string;
|
|
128
|
+
description: string;
|
|
129
|
+
fees: string;
|
|
130
|
+
accessConstraints: string;
|
|
131
|
+
};
|
|
132
|
+
serviceProvider: {
|
|
133
|
+
name: string;
|
|
134
|
+
site: string;
|
|
135
|
+
contact: {
|
|
136
|
+
individualName: string;
|
|
137
|
+
position: string;
|
|
138
|
+
phone: string;
|
|
139
|
+
address: {
|
|
140
|
+
deliveryPoint: string;
|
|
141
|
+
city: string;
|
|
142
|
+
postalCode: string;
|
|
143
|
+
country: string;
|
|
144
|
+
email: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
}>;
|
|
149
|
+
export type ProviderConfigSchema = z.infer<typeof zProviderConfig>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const zServiceIdentification = z.object({
|
|
3
|
+
title: z.string(),
|
|
4
|
+
description: z.string(),
|
|
5
|
+
fees: z.string(),
|
|
6
|
+
accessConstraints: z.string(),
|
|
7
|
+
});
|
|
8
|
+
const zAddress = z.object({
|
|
9
|
+
deliveryPoint: z.string(),
|
|
10
|
+
city: z.string(),
|
|
11
|
+
postalCode: z.string(),
|
|
12
|
+
country: z.string(),
|
|
13
|
+
email: z.string(),
|
|
14
|
+
});
|
|
15
|
+
const zContact = z.object({
|
|
16
|
+
individualName: z.string(),
|
|
17
|
+
position: z.string(),
|
|
18
|
+
phone: z.string(),
|
|
19
|
+
address: zAddress,
|
|
20
|
+
});
|
|
21
|
+
const zServiceProvider = z.object({
|
|
22
|
+
name: z.string(),
|
|
23
|
+
site: z.string(),
|
|
24
|
+
contact: zContact,
|
|
25
|
+
});
|
|
26
|
+
export const zProviderConfig = z.object({
|
|
27
|
+
id: z.string(),
|
|
28
|
+
serviceIdentification: zServiceIdentification,
|
|
29
|
+
serviceProvider: zServiceProvider,
|
|
30
|
+
});
|
|
31
|
+
//# sourceMapping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AAE,gBAAgB;CAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const zStyleJson: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
version: z.ZodNumber;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
metadata: z.ZodOptional<z.ZodUnknown>;
|
|
7
|
+
sprite: z.ZodOptional<z.ZodString>;
|
|
8
|
+
glyphs: z.ZodOptional<z.ZodString>;
|
|
9
|
+
sources: z.ZodUnknown;
|
|
10
|
+
layers: z.ZodArray<z.ZodUnknown, "many">;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
name: string;
|
|
13
|
+
id: string;
|
|
14
|
+
version: number;
|
|
15
|
+
layers: unknown[];
|
|
16
|
+
metadata?: unknown;
|
|
17
|
+
sprite?: string | undefined;
|
|
18
|
+
glyphs?: string | undefined;
|
|
19
|
+
sources?: unknown;
|
|
20
|
+
}, {
|
|
21
|
+
name: string;
|
|
22
|
+
id: string;
|
|
23
|
+
version: number;
|
|
24
|
+
layers: unknown[];
|
|
25
|
+
metadata?: unknown;
|
|
26
|
+
sprite?: string | undefined;
|
|
27
|
+
glyphs?: string | undefined;
|
|
28
|
+
sources?: unknown;
|
|
29
|
+
}>;
|
|
30
|
+
export type StyleJsonConfigSchema = z.infer<typeof zStyleJson>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const zStyleJson = z.object({
|
|
3
|
+
id: z.string(),
|
|
4
|
+
version: z.number(),
|
|
5
|
+
name: z.string(),
|
|
6
|
+
metadata: z.unknown().optional(),
|
|
7
|
+
sprite: z.string().optional(),
|
|
8
|
+
glyphs: z.string().optional(),
|
|
9
|
+
sources: z.unknown(),
|
|
10
|
+
// TODO it would be good to actually validate all the styles
|
|
11
|
+
layers: z.array(z.unknown()),
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=parse.style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.style.js","sourceRoot":"","sources":["../../src/json/parse.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IAEpB,4DAA4D;IAC5D,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;CAC7B,CAAC,CAAC"}
|