@cloudexp-io/laudro-site-kit 0.0.0-stage → 0.4.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/README.md +55 -2
- package/dist/chunk-YCELGJAT.js +35 -0
- package/dist/client.d.ts +216 -0
- package/dist/client.js +424 -0
- package/dist/index.d.ts +1091 -0
- package/dist/index.js +1002 -0
- package/dist/server.d.ts +90 -0
- package/dist/server.js +210 -0
- package/package.json +57 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1091 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const SITE_LANGS: readonly ["et", "en"];
|
|
4
|
+
type SiteLang = (typeof SITE_LANGS)[number];
|
|
5
|
+
declare const DEFAULT_SITE_LANG: SiteLang;
|
|
6
|
+
declare function isSiteLang(value: unknown): value is SiteLang;
|
|
7
|
+
/** Estonian lives at the root, English under `/en`. `localePath("en", "/menu")` is `/en/menu`. */
|
|
8
|
+
declare function localePath(lang: SiteLang, path: string): string;
|
|
9
|
+
/** Split a public path into language and the path without the `/en` prefix. */
|
|
10
|
+
declare function splitLocale(pathname: string): {
|
|
11
|
+
lang: SiteLang;
|
|
12
|
+
path: string;
|
|
13
|
+
};
|
|
14
|
+
/** Absolute URL from a base (`https://example.com`) and a path. */
|
|
15
|
+
declare function absoluteUrl(baseUrl: string, path: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* A path the site may redirect to: same origin, starts with one `/`, no backslash or control
|
|
18
|
+
* characters. Anything else becomes `fallback`, so `?path=` can never open-redirect.
|
|
19
|
+
*/
|
|
20
|
+
declare function safePath(value: unknown, fallback?: string): string;
|
|
21
|
+
|
|
22
|
+
declare const Money: z.ZodObject<{
|
|
23
|
+
cents: z.ZodInt;
|
|
24
|
+
currency: z.ZodLiteral<"EUR">;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
type Money = z.infer<typeof Money>;
|
|
27
|
+
/** Allergen codes (EU 1169/2011, the 14). Names come from the API in the asked language. */
|
|
28
|
+
declare const AllergenCode: z.ZodEnum<{
|
|
29
|
+
gluten: "gluten";
|
|
30
|
+
crustaceans: "crustaceans";
|
|
31
|
+
eggs: "eggs";
|
|
32
|
+
fish: "fish";
|
|
33
|
+
peanuts: "peanuts";
|
|
34
|
+
soybeans: "soybeans";
|
|
35
|
+
milk: "milk";
|
|
36
|
+
nuts: "nuts";
|
|
37
|
+
celery: "celery";
|
|
38
|
+
mustard: "mustard";
|
|
39
|
+
sesame: "sesame";
|
|
40
|
+
sulphites: "sulphites";
|
|
41
|
+
lupin: "lupin";
|
|
42
|
+
molluscs: "molluscs";
|
|
43
|
+
}>;
|
|
44
|
+
type AllergenCode = z.infer<typeof AllergenCode>;
|
|
45
|
+
/** Only allergens confirmed by staff are public. AI guesses are never returned. */
|
|
46
|
+
declare const Allergen: z.ZodObject<{
|
|
47
|
+
code: z.ZodEnum<{
|
|
48
|
+
gluten: "gluten";
|
|
49
|
+
crustaceans: "crustaceans";
|
|
50
|
+
eggs: "eggs";
|
|
51
|
+
fish: "fish";
|
|
52
|
+
peanuts: "peanuts";
|
|
53
|
+
soybeans: "soybeans";
|
|
54
|
+
milk: "milk";
|
|
55
|
+
nuts: "nuts";
|
|
56
|
+
celery: "celery";
|
|
57
|
+
mustard: "mustard";
|
|
58
|
+
sesame: "sesame";
|
|
59
|
+
sulphites: "sulphites";
|
|
60
|
+
lupin: "lupin";
|
|
61
|
+
molluscs: "molluscs";
|
|
62
|
+
}>;
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
65
|
+
state: z.ZodEnum<{
|
|
66
|
+
contains: "contains";
|
|
67
|
+
may_contain: "may_contain";
|
|
68
|
+
}>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
type Allergen = z.infer<typeof Allergen>;
|
|
71
|
+
declare const DietTag: z.ZodEnum<{
|
|
72
|
+
vegan: "vegan";
|
|
73
|
+
vegetarian: "vegetarian";
|
|
74
|
+
gluten_free: "gluten_free";
|
|
75
|
+
lactose_free: "lactose_free";
|
|
76
|
+
spicy: "spicy";
|
|
77
|
+
new: "new";
|
|
78
|
+
popular: "popular";
|
|
79
|
+
chef_choice: "chef_choice";
|
|
80
|
+
kids: "kids";
|
|
81
|
+
}>;
|
|
82
|
+
type DietTag = z.infer<typeof DietTag>;
|
|
83
|
+
|
|
84
|
+
/** GET /v1/site */
|
|
85
|
+
declare const Site: z.ZodObject<{
|
|
86
|
+
id: z.ZodUUID;
|
|
87
|
+
site_id: z.ZodUUID;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
short_name: z.ZodNullable<z.ZodString>;
|
|
90
|
+
status: z.ZodEnum<{
|
|
91
|
+
demo: "demo";
|
|
92
|
+
live: "live";
|
|
93
|
+
paused: "paused";
|
|
94
|
+
}>;
|
|
95
|
+
timezone: z.ZodString;
|
|
96
|
+
reopen_on: z.ZodOptional<z.ZodNullable<z.ZodISODate>>;
|
|
97
|
+
default_lang: z.ZodEnum<{
|
|
98
|
+
et: "et";
|
|
99
|
+
en: "en";
|
|
100
|
+
}>;
|
|
101
|
+
languages: z.ZodArray<z.ZodEnum<{
|
|
102
|
+
et: "et";
|
|
103
|
+
en: "en";
|
|
104
|
+
}>>;
|
|
105
|
+
logo: z.ZodNullable<z.ZodObject<{
|
|
106
|
+
id: z.ZodUUID;
|
|
107
|
+
url: z.ZodURL;
|
|
108
|
+
width: z.ZodNullable<z.ZodInt>;
|
|
109
|
+
height: z.ZodNullable<z.ZodInt>;
|
|
110
|
+
alt: z.ZodNullable<z.ZodString>;
|
|
111
|
+
blurhash: z.ZodNullable<z.ZodString>;
|
|
112
|
+
lang_fallback: z.ZodBoolean;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
brand: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
115
|
+
social_links: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
116
|
+
booking_mode: z.ZodNullable<z.ZodEnum<{
|
|
117
|
+
provider: "provider";
|
|
118
|
+
request: "request";
|
|
119
|
+
both: "both";
|
|
120
|
+
phone_only: "phone_only";
|
|
121
|
+
}>>;
|
|
122
|
+
contact: z.ZodObject<{
|
|
123
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
124
|
+
email: z.ZodNullable<z.ZodString>;
|
|
125
|
+
address: z.ZodNullable<z.ZodString>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
lang: z.ZodEnum<{
|
|
128
|
+
et: "et";
|
|
129
|
+
en: "en";
|
|
130
|
+
}>;
|
|
131
|
+
lang_fallback: z.ZodBoolean;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
type Site = z.infer<typeof Site>;
|
|
134
|
+
/** One location. The first one (lowest position) is the main location. */
|
|
135
|
+
declare const Location: z.ZodObject<{
|
|
136
|
+
id: z.ZodUUID;
|
|
137
|
+
name: z.ZodString;
|
|
138
|
+
address: z.ZodNullable<z.ZodString>;
|
|
139
|
+
city: z.ZodNullable<z.ZodString>;
|
|
140
|
+
postcode: z.ZodNullable<z.ZodString>;
|
|
141
|
+
country: z.ZodString;
|
|
142
|
+
geo: z.ZodNullable<z.ZodObject<{
|
|
143
|
+
lat: z.ZodNumber;
|
|
144
|
+
lng: z.ZodNumber;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
147
|
+
email: z.ZodNullable<z.ZodString>;
|
|
148
|
+
google_maps_url: z.ZodNullable<z.ZodString>;
|
|
149
|
+
timezone: z.ZodString;
|
|
150
|
+
lang_fallback: z.ZodBoolean;
|
|
151
|
+
}, z.core.$strip>;
|
|
152
|
+
type Location = z.infer<typeof Location>;
|
|
153
|
+
|
|
154
|
+
declare const HoursKind: z.ZodEnum<{
|
|
155
|
+
open: "open";
|
|
156
|
+
kitchen: "kitchen";
|
|
157
|
+
booking: "booking";
|
|
158
|
+
lunch: "lunch";
|
|
159
|
+
}>;
|
|
160
|
+
type HoursKind = z.infer<typeof HoursKind>;
|
|
161
|
+
declare const HoursDay: z.ZodObject<{
|
|
162
|
+
date: z.ZodISODate;
|
|
163
|
+
weekday: z.ZodInt;
|
|
164
|
+
holiday: z.ZodNullable<z.ZodString>;
|
|
165
|
+
open: z.ZodNullable<z.ZodObject<{
|
|
166
|
+
closed: z.ZodBoolean;
|
|
167
|
+
intervals: z.ZodArray<z.ZodObject<{
|
|
168
|
+
opens: z.ZodString;
|
|
169
|
+
closes: z.ZodString;
|
|
170
|
+
opens_at: z.ZodISODateTime;
|
|
171
|
+
closes_at: z.ZodISODateTime;
|
|
172
|
+
}, z.core.$strip>>;
|
|
173
|
+
special: z.ZodBoolean;
|
|
174
|
+
note: z.ZodNullable<z.ZodString>;
|
|
175
|
+
}, z.core.$strip>>;
|
|
176
|
+
kitchen: z.ZodNullable<z.ZodObject<{
|
|
177
|
+
closed: z.ZodBoolean;
|
|
178
|
+
intervals: z.ZodArray<z.ZodObject<{
|
|
179
|
+
opens: z.ZodString;
|
|
180
|
+
closes: z.ZodString;
|
|
181
|
+
opens_at: z.ZodISODateTime;
|
|
182
|
+
closes_at: z.ZodISODateTime;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
special: z.ZodBoolean;
|
|
185
|
+
note: z.ZodNullable<z.ZodString>;
|
|
186
|
+
}, z.core.$strip>>;
|
|
187
|
+
booking: z.ZodNullable<z.ZodObject<{
|
|
188
|
+
closed: z.ZodBoolean;
|
|
189
|
+
intervals: z.ZodArray<z.ZodObject<{
|
|
190
|
+
opens: z.ZodString;
|
|
191
|
+
closes: z.ZodString;
|
|
192
|
+
opens_at: z.ZodISODateTime;
|
|
193
|
+
closes_at: z.ZodISODateTime;
|
|
194
|
+
}, z.core.$strip>>;
|
|
195
|
+
special: z.ZodBoolean;
|
|
196
|
+
note: z.ZodNullable<z.ZodString>;
|
|
197
|
+
}, z.core.$strip>>;
|
|
198
|
+
lunch: z.ZodNullable<z.ZodObject<{
|
|
199
|
+
closed: z.ZodBoolean;
|
|
200
|
+
intervals: z.ZodArray<z.ZodObject<{
|
|
201
|
+
opens: z.ZodString;
|
|
202
|
+
closes: z.ZodString;
|
|
203
|
+
opens_at: z.ZodISODateTime;
|
|
204
|
+
closes_at: z.ZodISODateTime;
|
|
205
|
+
}, z.core.$strip>>;
|
|
206
|
+
special: z.ZodBoolean;
|
|
207
|
+
note: z.ZodNullable<z.ZodString>;
|
|
208
|
+
}, z.core.$strip>>;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
type HoursDay = z.infer<typeof HoursDay>;
|
|
211
|
+
declare const LocationHours: z.ZodObject<{
|
|
212
|
+
location_id: z.ZodUUID;
|
|
213
|
+
timezone: z.ZodString;
|
|
214
|
+
days: z.ZodArray<z.ZodObject<{
|
|
215
|
+
date: z.ZodISODate;
|
|
216
|
+
weekday: z.ZodInt;
|
|
217
|
+
holiday: z.ZodNullable<z.ZodString>;
|
|
218
|
+
open: z.ZodNullable<z.ZodObject<{
|
|
219
|
+
closed: z.ZodBoolean;
|
|
220
|
+
intervals: z.ZodArray<z.ZodObject<{
|
|
221
|
+
opens: z.ZodString;
|
|
222
|
+
closes: z.ZodString;
|
|
223
|
+
opens_at: z.ZodISODateTime;
|
|
224
|
+
closes_at: z.ZodISODateTime;
|
|
225
|
+
}, z.core.$strip>>;
|
|
226
|
+
special: z.ZodBoolean;
|
|
227
|
+
note: z.ZodNullable<z.ZodString>;
|
|
228
|
+
}, z.core.$strip>>;
|
|
229
|
+
kitchen: z.ZodNullable<z.ZodObject<{
|
|
230
|
+
closed: z.ZodBoolean;
|
|
231
|
+
intervals: z.ZodArray<z.ZodObject<{
|
|
232
|
+
opens: z.ZodString;
|
|
233
|
+
closes: z.ZodString;
|
|
234
|
+
opens_at: z.ZodISODateTime;
|
|
235
|
+
closes_at: z.ZodISODateTime;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
special: z.ZodBoolean;
|
|
238
|
+
note: z.ZodNullable<z.ZodString>;
|
|
239
|
+
}, z.core.$strip>>;
|
|
240
|
+
booking: z.ZodNullable<z.ZodObject<{
|
|
241
|
+
closed: z.ZodBoolean;
|
|
242
|
+
intervals: z.ZodArray<z.ZodObject<{
|
|
243
|
+
opens: z.ZodString;
|
|
244
|
+
closes: z.ZodString;
|
|
245
|
+
opens_at: z.ZodISODateTime;
|
|
246
|
+
closes_at: z.ZodISODateTime;
|
|
247
|
+
}, z.core.$strip>>;
|
|
248
|
+
special: z.ZodBoolean;
|
|
249
|
+
note: z.ZodNullable<z.ZodString>;
|
|
250
|
+
}, z.core.$strip>>;
|
|
251
|
+
lunch: z.ZodNullable<z.ZodObject<{
|
|
252
|
+
closed: z.ZodBoolean;
|
|
253
|
+
intervals: z.ZodArray<z.ZodObject<{
|
|
254
|
+
opens: z.ZodString;
|
|
255
|
+
closes: z.ZodString;
|
|
256
|
+
opens_at: z.ZodISODateTime;
|
|
257
|
+
closes_at: z.ZodISODateTime;
|
|
258
|
+
}, z.core.$strip>>;
|
|
259
|
+
special: z.ZodBoolean;
|
|
260
|
+
note: z.ZodNullable<z.ZodString>;
|
|
261
|
+
}, z.core.$strip>>;
|
|
262
|
+
}, z.core.$strip>>;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
type LocationHours = z.infer<typeof LocationHours>;
|
|
265
|
+
|
|
266
|
+
declare const Menu: z.ZodObject<{
|
|
267
|
+
id: z.ZodUUID;
|
|
268
|
+
name: z.ZodString;
|
|
269
|
+
description: z.ZodNullable<z.ZodString>;
|
|
270
|
+
kind: z.ZodEnum<{
|
|
271
|
+
kids: "kids";
|
|
272
|
+
lunch: "lunch";
|
|
273
|
+
main: "main";
|
|
274
|
+
drinks: "drinks";
|
|
275
|
+
event: "event";
|
|
276
|
+
}>;
|
|
277
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
278
|
+
id: z.ZodUUID;
|
|
279
|
+
name: z.ZodString;
|
|
280
|
+
description: z.ZodNullable<z.ZodString>;
|
|
281
|
+
items: z.ZodArray<z.ZodObject<{
|
|
282
|
+
id: z.ZodUUID;
|
|
283
|
+
name: z.ZodString;
|
|
284
|
+
description: z.ZodNullable<z.ZodString>;
|
|
285
|
+
tagline: z.ZodNullable<z.ZodString>;
|
|
286
|
+
ingredients: z.ZodNullable<z.ZodString>;
|
|
287
|
+
price: z.ZodNullable<z.ZodObject<{
|
|
288
|
+
cents: z.ZodInt;
|
|
289
|
+
currency: z.ZodLiteral<"EUR">;
|
|
290
|
+
}, z.core.$strip>>;
|
|
291
|
+
sold_out: z.ZodBoolean;
|
|
292
|
+
sold_out_until: z.ZodNullable<z.ZodISODate>;
|
|
293
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
294
|
+
id: z.ZodUUID;
|
|
295
|
+
url: z.ZodURL;
|
|
296
|
+
width: z.ZodNullable<z.ZodInt>;
|
|
297
|
+
height: z.ZodNullable<z.ZodInt>;
|
|
298
|
+
alt: z.ZodNullable<z.ZodString>;
|
|
299
|
+
blurhash: z.ZodNullable<z.ZodString>;
|
|
300
|
+
lang_fallback: z.ZodBoolean;
|
|
301
|
+
}, z.core.$strip>>;
|
|
302
|
+
allergens: z.ZodArray<z.ZodObject<{
|
|
303
|
+
code: z.ZodEnum<{
|
|
304
|
+
gluten: "gluten";
|
|
305
|
+
crustaceans: "crustaceans";
|
|
306
|
+
eggs: "eggs";
|
|
307
|
+
fish: "fish";
|
|
308
|
+
peanuts: "peanuts";
|
|
309
|
+
soybeans: "soybeans";
|
|
310
|
+
milk: "milk";
|
|
311
|
+
nuts: "nuts";
|
|
312
|
+
celery: "celery";
|
|
313
|
+
mustard: "mustard";
|
|
314
|
+
sesame: "sesame";
|
|
315
|
+
sulphites: "sulphites";
|
|
316
|
+
lupin: "lupin";
|
|
317
|
+
molluscs: "molluscs";
|
|
318
|
+
}>;
|
|
319
|
+
name: z.ZodString;
|
|
320
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
321
|
+
state: z.ZodEnum<{
|
|
322
|
+
contains: "contains";
|
|
323
|
+
may_contain: "may_contain";
|
|
324
|
+
}>;
|
|
325
|
+
}, z.core.$strip>>;
|
|
326
|
+
tags: z.ZodArray<z.ZodEnum<{
|
|
327
|
+
vegan: "vegan";
|
|
328
|
+
vegetarian: "vegetarian";
|
|
329
|
+
gluten_free: "gluten_free";
|
|
330
|
+
lactose_free: "lactose_free";
|
|
331
|
+
spicy: "spicy";
|
|
332
|
+
new: "new";
|
|
333
|
+
popular: "popular";
|
|
334
|
+
chef_choice: "chef_choice";
|
|
335
|
+
kids: "kids";
|
|
336
|
+
}>>;
|
|
337
|
+
variants: z.ZodArray<z.ZodObject<{
|
|
338
|
+
id: z.ZodUUID;
|
|
339
|
+
name: z.ZodString;
|
|
340
|
+
price: z.ZodNullable<z.ZodObject<{
|
|
341
|
+
cents: z.ZodInt;
|
|
342
|
+
currency: z.ZodLiteral<"EUR">;
|
|
343
|
+
}, z.core.$strip>>;
|
|
344
|
+
lang_fallback: z.ZodBoolean;
|
|
345
|
+
}, z.core.$strip>>;
|
|
346
|
+
lang_fallback: z.ZodBoolean;
|
|
347
|
+
}, z.core.$strip>>;
|
|
348
|
+
lang_fallback: z.ZodBoolean;
|
|
349
|
+
}, z.core.$strip>>;
|
|
350
|
+
lang_fallback: z.ZodBoolean;
|
|
351
|
+
}, z.core.$strip>;
|
|
352
|
+
type Menu = z.infer<typeof Menu>;
|
|
353
|
+
|
|
354
|
+
/** `?date=` (or no query): one day. */
|
|
355
|
+
declare const LunchDayResponse: z.ZodObject<{
|
|
356
|
+
date: z.ZodISODate;
|
|
357
|
+
location_id: z.ZodNullable<z.ZodUUID>;
|
|
358
|
+
offer: z.ZodNullable<z.ZodObject<{
|
|
359
|
+
id: z.ZodUUID;
|
|
360
|
+
location_id: z.ZodUUID;
|
|
361
|
+
date: z.ZodISODate;
|
|
362
|
+
status: z.ZodEnum<{
|
|
363
|
+
live: "live";
|
|
364
|
+
draft: "draft";
|
|
365
|
+
}>;
|
|
366
|
+
set_price: z.ZodNullable<z.ZodObject<{
|
|
367
|
+
cents: z.ZodInt;
|
|
368
|
+
currency: z.ZodLiteral<"EUR">;
|
|
369
|
+
}, z.core.$strip>>;
|
|
370
|
+
served_from: z.ZodNullable<z.ZodString>;
|
|
371
|
+
served_to: z.ZodNullable<z.ZodString>;
|
|
372
|
+
note: z.ZodNullable<z.ZodString>;
|
|
373
|
+
items: z.ZodArray<z.ZodObject<{
|
|
374
|
+
id: z.ZodUUID;
|
|
375
|
+
name: z.ZodString;
|
|
376
|
+
description: z.ZodNullable<z.ZodString>;
|
|
377
|
+
price: z.ZodNullable<z.ZodObject<{
|
|
378
|
+
cents: z.ZodInt;
|
|
379
|
+
currency: z.ZodLiteral<"EUR">;
|
|
380
|
+
}, z.core.$strip>>;
|
|
381
|
+
allergens: z.ZodArray<z.ZodObject<{
|
|
382
|
+
code: z.ZodEnum<{
|
|
383
|
+
gluten: "gluten";
|
|
384
|
+
crustaceans: "crustaceans";
|
|
385
|
+
eggs: "eggs";
|
|
386
|
+
fish: "fish";
|
|
387
|
+
peanuts: "peanuts";
|
|
388
|
+
soybeans: "soybeans";
|
|
389
|
+
milk: "milk";
|
|
390
|
+
nuts: "nuts";
|
|
391
|
+
celery: "celery";
|
|
392
|
+
mustard: "mustard";
|
|
393
|
+
sesame: "sesame";
|
|
394
|
+
sulphites: "sulphites";
|
|
395
|
+
lupin: "lupin";
|
|
396
|
+
molluscs: "molluscs";
|
|
397
|
+
}>;
|
|
398
|
+
name: z.ZodString;
|
|
399
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
400
|
+
state: z.ZodEnum<{
|
|
401
|
+
contains: "contains";
|
|
402
|
+
may_contain: "may_contain";
|
|
403
|
+
}>;
|
|
404
|
+
}, z.core.$strip>>;
|
|
405
|
+
tags: z.ZodArray<z.ZodEnum<{
|
|
406
|
+
vegan: "vegan";
|
|
407
|
+
vegetarian: "vegetarian";
|
|
408
|
+
gluten_free: "gluten_free";
|
|
409
|
+
lactose_free: "lactose_free";
|
|
410
|
+
spicy: "spicy";
|
|
411
|
+
new: "new";
|
|
412
|
+
popular: "popular";
|
|
413
|
+
chef_choice: "chef_choice";
|
|
414
|
+
kids: "kids";
|
|
415
|
+
}>>;
|
|
416
|
+
sold_out: z.ZodDefault<z.ZodBoolean>;
|
|
417
|
+
lang_fallback: z.ZodBoolean;
|
|
418
|
+
}, z.core.$strip>>;
|
|
419
|
+
lang_fallback: z.ZodBoolean;
|
|
420
|
+
}, z.core.$strip>>;
|
|
421
|
+
next_date: z.ZodNullable<z.ZodISODate>;
|
|
422
|
+
lang: z.ZodEnum<{
|
|
423
|
+
et: "et";
|
|
424
|
+
en: "en";
|
|
425
|
+
}>;
|
|
426
|
+
}, z.core.$strip>;
|
|
427
|
+
type LunchDayResponse = z.infer<typeof LunchDayResponse>;
|
|
428
|
+
|
|
429
|
+
/** One content block. `type` decides the other fields; sites ignore types they do not know. */
|
|
430
|
+
declare const PageBlock: z.ZodObject<{
|
|
431
|
+
type: z.ZodString;
|
|
432
|
+
}, z.core.$loose>;
|
|
433
|
+
type PageBlock = z.infer<typeof PageBlock>;
|
|
434
|
+
|
|
435
|
+
declare const EventPackage: z.ZodObject<{
|
|
436
|
+
id: z.ZodUUID;
|
|
437
|
+
name: z.ZodString;
|
|
438
|
+
description: z.ZodNullable<z.ZodString>;
|
|
439
|
+
min_guests: z.ZodNullable<z.ZodInt>;
|
|
440
|
+
max_guests: z.ZodNullable<z.ZodInt>;
|
|
441
|
+
price: z.ZodNullable<z.ZodObject<{
|
|
442
|
+
cents: z.ZodInt;
|
|
443
|
+
currency: z.ZodLiteral<"EUR">;
|
|
444
|
+
}, z.core.$strip>>;
|
|
445
|
+
price_unit: z.ZodEnum<{
|
|
446
|
+
per_person: "per_person";
|
|
447
|
+
total: "total";
|
|
448
|
+
}>;
|
|
449
|
+
lang_fallback: z.ZodBoolean;
|
|
450
|
+
}, z.core.$strip>;
|
|
451
|
+
type EventPackage = z.infer<typeof EventPackage>;
|
|
452
|
+
declare const EventKind: z.ZodEnum<{
|
|
453
|
+
company: "company";
|
|
454
|
+
birthday: "birthday";
|
|
455
|
+
wedding: "wedding";
|
|
456
|
+
other: "other";
|
|
457
|
+
}>;
|
|
458
|
+
type EventKind = z.infer<typeof EventKind>;
|
|
459
|
+
|
|
460
|
+
declare const BookingLocation: z.ZodObject<{
|
|
461
|
+
location_id: z.ZodUUID;
|
|
462
|
+
mode: z.ZodEnum<{
|
|
463
|
+
provider: "provider";
|
|
464
|
+
request: "request";
|
|
465
|
+
both: "both";
|
|
466
|
+
phone_only: "phone_only";
|
|
467
|
+
}>;
|
|
468
|
+
provider: z.ZodNullable<z.ZodEnum<{
|
|
469
|
+
tableonline: "tableonline";
|
|
470
|
+
zenchef: "zenchef";
|
|
471
|
+
quandoo: "quandoo";
|
|
472
|
+
}>>;
|
|
473
|
+
provider_url: z.ZodNullable<z.ZodString>;
|
|
474
|
+
min_party: z.ZodInt;
|
|
475
|
+
max_party: z.ZodInt;
|
|
476
|
+
min_lead_minutes: z.ZodInt;
|
|
477
|
+
max_days_ahead: z.ZodInt;
|
|
478
|
+
confirm_text: z.ZodNullable<z.ZodString>;
|
|
479
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
480
|
+
booking_hours: z.ZodArray<z.ZodObject<{
|
|
481
|
+
weekday: z.ZodInt;
|
|
482
|
+
opens: z.ZodString;
|
|
483
|
+
closes: z.ZodString;
|
|
484
|
+
}, z.core.$strip>>;
|
|
485
|
+
booking_hours_kind: z.ZodEnum<{
|
|
486
|
+
open: "open";
|
|
487
|
+
booking: "booking";
|
|
488
|
+
}>;
|
|
489
|
+
lang_fallback: z.ZodBoolean;
|
|
490
|
+
}, z.core.$strip>;
|
|
491
|
+
type BookingLocation = z.infer<typeof BookingLocation>;
|
|
492
|
+
/** GET /v1/booking */
|
|
493
|
+
declare const BookingResponse: z.ZodObject<{
|
|
494
|
+
mode: z.ZodNullable<z.ZodEnum<{
|
|
495
|
+
provider: "provider";
|
|
496
|
+
request: "request";
|
|
497
|
+
both: "both";
|
|
498
|
+
phone_only: "phone_only";
|
|
499
|
+
}>>;
|
|
500
|
+
locations: z.ZodArray<z.ZodObject<{
|
|
501
|
+
location_id: z.ZodUUID;
|
|
502
|
+
mode: z.ZodEnum<{
|
|
503
|
+
provider: "provider";
|
|
504
|
+
request: "request";
|
|
505
|
+
both: "both";
|
|
506
|
+
phone_only: "phone_only";
|
|
507
|
+
}>;
|
|
508
|
+
provider: z.ZodNullable<z.ZodEnum<{
|
|
509
|
+
tableonline: "tableonline";
|
|
510
|
+
zenchef: "zenchef";
|
|
511
|
+
quandoo: "quandoo";
|
|
512
|
+
}>>;
|
|
513
|
+
provider_url: z.ZodNullable<z.ZodString>;
|
|
514
|
+
min_party: z.ZodInt;
|
|
515
|
+
max_party: z.ZodInt;
|
|
516
|
+
min_lead_minutes: z.ZodInt;
|
|
517
|
+
max_days_ahead: z.ZodInt;
|
|
518
|
+
confirm_text: z.ZodNullable<z.ZodString>;
|
|
519
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
520
|
+
booking_hours: z.ZodArray<z.ZodObject<{
|
|
521
|
+
weekday: z.ZodInt;
|
|
522
|
+
opens: z.ZodString;
|
|
523
|
+
closes: z.ZodString;
|
|
524
|
+
}, z.core.$strip>>;
|
|
525
|
+
booking_hours_kind: z.ZodEnum<{
|
|
526
|
+
open: "open";
|
|
527
|
+
booking: "booking";
|
|
528
|
+
}>;
|
|
529
|
+
lang_fallback: z.ZodBoolean;
|
|
530
|
+
}, z.core.$strip>>;
|
|
531
|
+
lang: z.ZodEnum<{
|
|
532
|
+
et: "et";
|
|
533
|
+
en: "en";
|
|
534
|
+
}>;
|
|
535
|
+
}, z.core.$strip>;
|
|
536
|
+
type BookingResponse = z.infer<typeof BookingResponse>;
|
|
537
|
+
|
|
538
|
+
declare const TrackName: z.ZodEnum<{
|
|
539
|
+
page_view: "page_view";
|
|
540
|
+
visit: "visit";
|
|
541
|
+
menu_view: "menu_view";
|
|
542
|
+
lunch_view: "lunch_view";
|
|
543
|
+
item_view: "item_view";
|
|
544
|
+
call_tap: "call_tap";
|
|
545
|
+
map_tap: "map_tap";
|
|
546
|
+
booking_open: "booking_open";
|
|
547
|
+
booking_provider_tap: "booking_provider_tap";
|
|
548
|
+
form_submit: "form_submit";
|
|
549
|
+
}>;
|
|
550
|
+
type TrackName = z.infer<typeof TrackName>;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Fixed UI words. These never go through AI translation (technical brief, section 11).
|
|
554
|
+
* Sites can pass their own labels to any component to override a word.
|
|
555
|
+
*/
|
|
556
|
+
interface Dictionary {
|
|
557
|
+
langName: string;
|
|
558
|
+
weekdays: [string, string, string, string, string, string, string];
|
|
559
|
+
weekdaysShort: [string, string, string, string, string, string, string];
|
|
560
|
+
today: string;
|
|
561
|
+
tomorrow: string;
|
|
562
|
+
openNow: string;
|
|
563
|
+
closedNow: string;
|
|
564
|
+
closesAt: (time: string) => string;
|
|
565
|
+
opensAt: (when: string) => string;
|
|
566
|
+
closed: string;
|
|
567
|
+
openingHours: string;
|
|
568
|
+
kitchen: string;
|
|
569
|
+
holiday: string;
|
|
570
|
+
specialDay: string;
|
|
571
|
+
lunch: string;
|
|
572
|
+
lunchToday: string;
|
|
573
|
+
noLunch: string;
|
|
574
|
+
nextLunch: (date: string) => string;
|
|
575
|
+
servedBetween: (from: string, to: string) => string;
|
|
576
|
+
setPrice: string;
|
|
577
|
+
/** Between two times or days in the table format: "11:00 kuni 22:00". */
|
|
578
|
+
to: string;
|
|
579
|
+
language: string;
|
|
580
|
+
/** "24.12 ja 25.12 on suletud". Dates are `dd.mm`. */
|
|
581
|
+
closedOn: (dates: string[]) => string;
|
|
582
|
+
visit: string;
|
|
583
|
+
pages: string;
|
|
584
|
+
menu: string;
|
|
585
|
+
/** Header: accessible name of the phone menu button. */
|
|
586
|
+
openMenu: string;
|
|
587
|
+
/** Header: short book label on phone. */
|
|
588
|
+
bookShort: string;
|
|
589
|
+
/** Header: accessible name of the main navigation. */
|
|
590
|
+
mainNav: string;
|
|
591
|
+
soldOut: string;
|
|
592
|
+
allergens: string;
|
|
593
|
+
mayContain: string;
|
|
594
|
+
ingredients: string;
|
|
595
|
+
tags: Record<DietTag, string>;
|
|
596
|
+
allergenNames: Record<AllergenCode, string>;
|
|
597
|
+
booking: {
|
|
598
|
+
title: string;
|
|
599
|
+
note: string;
|
|
600
|
+
fewer: string;
|
|
601
|
+
more: string;
|
|
602
|
+
fullHint: string;
|
|
603
|
+
today: string;
|
|
604
|
+
tomorrow: string;
|
|
605
|
+
submit: string;
|
|
606
|
+
};
|
|
607
|
+
events: {
|
|
608
|
+
seatsLeft: (n: number) => string;
|
|
609
|
+
soldOut: string;
|
|
610
|
+
};
|
|
611
|
+
form: {
|
|
612
|
+
date: string;
|
|
613
|
+
time: string;
|
|
614
|
+
partySize: string;
|
|
615
|
+
name: string;
|
|
616
|
+
phone: string;
|
|
617
|
+
email: string;
|
|
618
|
+
emailOptional: string;
|
|
619
|
+
note: string;
|
|
620
|
+
send: string;
|
|
621
|
+
sending: string;
|
|
622
|
+
sent: string;
|
|
623
|
+
bookingSent: string;
|
|
624
|
+
eventSent: string;
|
|
625
|
+
contactSent: string;
|
|
626
|
+
required: string;
|
|
627
|
+
/** Field-specific text when a value is too short. */
|
|
628
|
+
tooShort: {
|
|
629
|
+
phone: string;
|
|
630
|
+
};
|
|
631
|
+
invalid: string;
|
|
632
|
+
rateLimited: string;
|
|
633
|
+
failed: string;
|
|
634
|
+
failedCall: (phone: string) => string;
|
|
635
|
+
eventDate: string;
|
|
636
|
+
guests: string;
|
|
637
|
+
kind: string;
|
|
638
|
+
kinds: Record<EventKind, string>;
|
|
639
|
+
budget: string;
|
|
640
|
+
package: string;
|
|
641
|
+
noPackage: string;
|
|
642
|
+
/** After a package price: "45 € / in". */
|
|
643
|
+
perPerson: string;
|
|
644
|
+
company: string;
|
|
645
|
+
message: string;
|
|
646
|
+
sendAnother: string;
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
declare const DICTIONARIES: Record<SiteLang, Dictionary>;
|
|
650
|
+
declare function dictionary(lang: SiteLang): Dictionary;
|
|
651
|
+
|
|
652
|
+
/** `1250` cents as `12,50 €` (et) or `€12.50` (en). Whole euros drop the decimals. */
|
|
653
|
+
declare function formatMoney(money: Money | null | undefined, lang: SiteLang): string;
|
|
654
|
+
/** Price for JSON-LD: `"12.50"`. */
|
|
655
|
+
declare function moneyAmount(money: Money): string;
|
|
656
|
+
/** `"09:00"` stays `"09:00"`; an ISO date-time becomes local wall time in `timeZone`. */
|
|
657
|
+
declare function formatTime(value: string, timeZone?: string): string;
|
|
658
|
+
/** `2026-11-16` as `16. november` (et) or `16 November` (en). */
|
|
659
|
+
declare function formatDate(isoDate: string, lang: SiteLang, withWeekday?: boolean): string;
|
|
660
|
+
/** Today's date (`YYYY-MM-DD`) in a time zone. */
|
|
661
|
+
declare function isoDateIn(timeZone: string, now?: Date): string;
|
|
662
|
+
/** Calendar maths on `YYYY-MM-DD` strings. */
|
|
663
|
+
declare function addDays(isoDate: string, days: number): string;
|
|
664
|
+
/** `2026-11-18` as `18.11`. */
|
|
665
|
+
declare function formatDayMonth(isoDate: string): string;
|
|
666
|
+
/** Upper-case the first letter: `kolmapäev` becomes `Kolmapäev`. */
|
|
667
|
+
declare function capitalize(text: string, lang: SiteLang): string;
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* `/v1/hours` range for a page: from yesterday (so an interval past midnight is included) to
|
|
671
|
+
* `days - 1` days after today, in the restaurant time zone. The API takes at most 62 days.
|
|
672
|
+
*/
|
|
673
|
+
declare function hoursRange(timeZone: string, now?: Date, days?: number): {
|
|
674
|
+
from: string;
|
|
675
|
+
to: string;
|
|
676
|
+
today: string;
|
|
677
|
+
};
|
|
678
|
+
interface OpenStatus {
|
|
679
|
+
open: boolean;
|
|
680
|
+
/** End of the current interval (ISO with offset), when open. */
|
|
681
|
+
closes_at: string | null;
|
|
682
|
+
/** Start of the next known interval, when closed. */
|
|
683
|
+
next_opens_at: string | null;
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Open at `now`? Same rule as the SDK's `openNow`, which only ships on its server entry; this
|
|
687
|
+
* copy also runs in client components. The API intervals carry UTC offsets, so no time zone
|
|
688
|
+
* maths is needed.
|
|
689
|
+
*/
|
|
690
|
+
declare function openStatus(hours: Pick<LocationHours, "days">, now?: Date, kind?: HoursKind): OpenStatus;
|
|
691
|
+
/** "Open until 22:00", "Opens tomorrow at 09:00", "Closed". */
|
|
692
|
+
declare function describeOpenStatus(status: OpenStatus, lang: SiteLang, timeZone: string, now?: Date): string;
|
|
693
|
+
/** ISO weekday (1 = Monday) of a `YYYY-MM-DD` date. */
|
|
694
|
+
declare function isoWeekday(isoDate: string): number;
|
|
695
|
+
/** Days from `today` on, at most `count`. */
|
|
696
|
+
declare function upcomingDays(hours: Pick<LocationHours, "days">, today: string, count?: number): HoursDay[];
|
|
697
|
+
interface WeeklySlot {
|
|
698
|
+
weekday: number;
|
|
699
|
+
intervals: {
|
|
700
|
+
opens: string;
|
|
701
|
+
closes: string;
|
|
702
|
+
}[];
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* The regular week: for each weekday, the first date in range that no special row decided.
|
|
706
|
+
* Weekdays not in range (or only seen on special days) are left out.
|
|
707
|
+
*/
|
|
708
|
+
declare function weeklyPattern(hours: Pick<LocationHours, "days">, kind?: HoursKind): WeeklySlot[];
|
|
709
|
+
/** Dates decided by a special row (or a holiday), for "special days" lists and JSON-LD. */
|
|
710
|
+
declare function specialDays(hours: Pick<LocationHours, "days">, kind?: HoursKind): {
|
|
711
|
+
date: string;
|
|
712
|
+
closed: boolean;
|
|
713
|
+
intervals: {
|
|
714
|
+
opens: string;
|
|
715
|
+
closes: string;
|
|
716
|
+
}[];
|
|
717
|
+
note: string | null;
|
|
718
|
+
holiday: string | null;
|
|
719
|
+
}[];
|
|
720
|
+
declare function intervalsLabel(intervals: {
|
|
721
|
+
opens: string;
|
|
722
|
+
closes: string;
|
|
723
|
+
}[], lang: SiteLang): string;
|
|
724
|
+
interface WeeklyGroup {
|
|
725
|
+
/** ISO weekdays, 1 = Monday. */
|
|
726
|
+
from: number;
|
|
727
|
+
to: number;
|
|
728
|
+
days: string;
|
|
729
|
+
hours: string;
|
|
730
|
+
closed: boolean;
|
|
731
|
+
}
|
|
732
|
+
/** Like `groupWeekly`, with the weekday range and a closed flag for highlighting. */
|
|
733
|
+
declare function groupWeeklyDetailed(pattern: WeeklySlot[], lang: SiteLang): WeeklyGroup[];
|
|
734
|
+
/** Group equal consecutive weekdays: `[{ days: "E–N", hours: "09:00–22:00" }, ...]`. */
|
|
735
|
+
declare function groupWeekly(pattern: WeeklySlot[], lang: SiteLang): {
|
|
736
|
+
days: string;
|
|
737
|
+
hours: string;
|
|
738
|
+
}[];
|
|
739
|
+
/** A special day as `specialDays` returns it. */
|
|
740
|
+
type SpecialDay = ReturnType<typeof specialDays>[number];
|
|
741
|
+
/** Special days of a kind, from `today` on (all when `today` is not given). */
|
|
742
|
+
declare function specialDaysFrom(hours: Pick<LocationHours, "days">, kind?: HoursKind, today?: string): SpecialDay[];
|
|
743
|
+
/**
|
|
744
|
+
* Splits special days for the hours list. With `table`, closed days become a one-line notice
|
|
745
|
+
* (`closedDates`) and only the rest is `listed`; otherwise everything is listed.
|
|
746
|
+
*/
|
|
747
|
+
declare function splitSpecialDays(specials: SpecialDay[], table: boolean): {
|
|
748
|
+
closedDates: string[];
|
|
749
|
+
listed: SpecialDay[];
|
|
750
|
+
};
|
|
751
|
+
/** "24.12 ja 25.12 on suletud" for the closed dates (`YYYY-MM-DD`). */
|
|
752
|
+
declare function closedNoticeText(closedDates: string[], lang: SiteLang): string;
|
|
753
|
+
/** Does `today` (`YYYY-MM-DD`) fall on a weekday of the group? False when `today` is not given. */
|
|
754
|
+
declare function groupHasDay(group: Pick<WeeklyGroup, "from" | "to">, today?: string): boolean;
|
|
755
|
+
/**
|
|
756
|
+
* Text of one week row. `table`: "E kuni N" and "11:00 kuni 22:00", a single day as the full
|
|
757
|
+
* name ("Laupäev"), a closed day capitalised. Otherwise the compact "E–N" and "11:00–22:00".
|
|
758
|
+
*/
|
|
759
|
+
declare function weekRowLabels(g: WeeklyGroup, lang: SiteLang, table: boolean): {
|
|
760
|
+
days: string;
|
|
761
|
+
hours: string;
|
|
762
|
+
};
|
|
763
|
+
/** One row of the "next days" view: date label ("täna" for today), hours, special flag, note. */
|
|
764
|
+
declare function dayRowView(day: HoursDay, kind: HoursKind, lang: SiteLang, today: string | undefined): {
|
|
765
|
+
date: string;
|
|
766
|
+
isToday: boolean;
|
|
767
|
+
dateLabel: string;
|
|
768
|
+
label: string;
|
|
769
|
+
special: boolean;
|
|
770
|
+
note: string | null;
|
|
771
|
+
};
|
|
772
|
+
/** One row of the special days list: date, hours (or closed) and the note or holiday name. */
|
|
773
|
+
declare function specialRowView(s: SpecialDay, lang: SiteLang): {
|
|
774
|
+
date: string;
|
|
775
|
+
dateLabel: string;
|
|
776
|
+
label: string;
|
|
777
|
+
note: string | null;
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
/** JSON for a `<script type="application/ld+json">`, with `<` escaped so it cannot end the tag. */
|
|
781
|
+
declare function jsonLdScript(data: unknown): string;
|
|
782
|
+
type Json = Record<string, unknown>;
|
|
783
|
+
/**
|
|
784
|
+
* `OpeningHoursSpecification` list: the regular week, then special dates with
|
|
785
|
+
* `validFrom`/`validThrough`. A closed special date is `00:00`–`00:00`, as schema.org asks.
|
|
786
|
+
*/
|
|
787
|
+
declare function openingHoursSpecification(hours: Pick<LocationHours, "days">): Json[];
|
|
788
|
+
/** `Menu` → `MenuSection` → `MenuItem` with `offers` and `suitableForDiet`. */
|
|
789
|
+
declare function menuJsonLd(menu: Menu, url?: string): Json;
|
|
790
|
+
interface RestaurantJsonLdInput {
|
|
791
|
+
site: Site;
|
|
792
|
+
/** Main location. */
|
|
793
|
+
location?: Location | null;
|
|
794
|
+
hours?: Pick<LocationHours, "days"> | null;
|
|
795
|
+
/** Full menus to embed under `hasMenu`. Without them, `menuUrl` is used. */
|
|
796
|
+
menus?: Menu[];
|
|
797
|
+
menuUrl?: string;
|
|
798
|
+
/** Canonical URL of the site's home page. */
|
|
799
|
+
url: string;
|
|
800
|
+
/** e.g. ["Estonian", "Seafood"]. The API has no cuisine field yet; the site sets it. */
|
|
801
|
+
servesCuisine?: string[];
|
|
802
|
+
priceRange?: string;
|
|
803
|
+
image?: string;
|
|
804
|
+
}
|
|
805
|
+
/** schema.org `Restaurant` for the home page (and, with menus, the menu page). */
|
|
806
|
+
declare function restaurantJsonLd(input: RestaurantJsonLdInput): Json;
|
|
807
|
+
|
|
808
|
+
/** One page of the site in each language: `{ et: "/broneeri", en: "/en/book" }`. */
|
|
809
|
+
type LocalizedPaths = Record<SiteLang, string>;
|
|
810
|
+
interface SitemapRoute {
|
|
811
|
+
paths: LocalizedPaths;
|
|
812
|
+
changeFrequency?: "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never";
|
|
813
|
+
priority?: number;
|
|
814
|
+
}
|
|
815
|
+
interface SitemapEntry {
|
|
816
|
+
url: string;
|
|
817
|
+
lastModified?: Date;
|
|
818
|
+
changeFrequency?: SitemapRoute["changeFrequency"];
|
|
819
|
+
priority?: number;
|
|
820
|
+
alternates: {
|
|
821
|
+
languages: Record<string, string>;
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Entries for Next.js `app/sitemap.ts` (same shape as `MetadataRoute.Sitemap`): one entry per
|
|
826
|
+
* language, each with `hreflang` alternates for ET, EN and `x-default` (Estonian).
|
|
827
|
+
*/
|
|
828
|
+
declare function buildSitemap(opts: {
|
|
829
|
+
baseUrl: string;
|
|
830
|
+
routes: SitemapRoute[];
|
|
831
|
+
langs?: readonly SiteLang[];
|
|
832
|
+
lastModified?: Date;
|
|
833
|
+
}): SitemapEntry[];
|
|
834
|
+
/**
|
|
835
|
+
* Next.js `app/robots.ts` content. A demo restaurant (or `noindex`) blocks every crawler;
|
|
836
|
+
* otherwise everything but `/api/` is open and the sitemap is listed.
|
|
837
|
+
*/
|
|
838
|
+
declare function buildRobots(opts: {
|
|
839
|
+
baseUrl: string;
|
|
840
|
+
noindex?: boolean;
|
|
841
|
+
}): {
|
|
842
|
+
rules: {
|
|
843
|
+
userAgent: string;
|
|
844
|
+
allow?: string;
|
|
845
|
+
disallow?: string | string[];
|
|
846
|
+
};
|
|
847
|
+
sitemap?: string;
|
|
848
|
+
};
|
|
849
|
+
/** Next.js `metadata.alternates` for a page: canonical plus `hreflang` links. */
|
|
850
|
+
declare function alternatesFor(baseUrl: string, paths: LocalizedPaths, lang: SiteLang): {
|
|
851
|
+
canonical: string;
|
|
852
|
+
languages: {
|
|
853
|
+
et: string;
|
|
854
|
+
en: string;
|
|
855
|
+
"x-default": string;
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
interface LlmsTxtInput {
|
|
859
|
+
baseUrl: string;
|
|
860
|
+
lang: SiteLang;
|
|
861
|
+
site: Site;
|
|
862
|
+
location?: Location | null;
|
|
863
|
+
hours?: Pick<LocationHours, "days"> | null;
|
|
864
|
+
menus?: Menu[];
|
|
865
|
+
lunch?: LunchDayResponse | null;
|
|
866
|
+
booking?: BookingResponse | null;
|
|
867
|
+
/** Site paths for links. */
|
|
868
|
+
links: {
|
|
869
|
+
menu: string;
|
|
870
|
+
booking?: string;
|
|
871
|
+
events?: string;
|
|
872
|
+
};
|
|
873
|
+
/** One line about the place; written by the site. */
|
|
874
|
+
summary?: string;
|
|
875
|
+
/** Max menu items listed per section. Default 30. */
|
|
876
|
+
maxItemsPerSection?: number;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* `llms.txt`: a plain Markdown summary for AI assistants (what, where, hours, menu, how to
|
|
880
|
+
* book). Only public data from the API. No personal data.
|
|
881
|
+
*/
|
|
882
|
+
declare function buildLlmsTxt(input: LlmsTxtInput): string;
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* One unique capital letter per allergen. G, L, M and P follow the board legend (gluten, milk,
|
|
886
|
+
* eggs, nuts); the rest are picked so that no two allergens share a letter.
|
|
887
|
+
*/
|
|
888
|
+
declare const ALLERGEN_CODES: Record<AllergenCode, string>;
|
|
889
|
+
type AllergenCodes = Partial<Record<AllergenCode, string>>;
|
|
890
|
+
/** The letter of an allergen: from `codes` when given, else `ALLERGEN_CODES`. */
|
|
891
|
+
declare function allergenLetter(a: Allergen, codes?: AllergenCodes): string;
|
|
892
|
+
/** The display name of an allergen: the API name, else the fixed word for its code. */
|
|
893
|
+
declare function allergenName(a: Allergen, lang: SiteLang): string;
|
|
894
|
+
/** Each allergen code once (the first seen), in order: the rows of an allergen legend. */
|
|
895
|
+
declare function uniqueAllergens(allergens: Allergen[]): Allergen[];
|
|
896
|
+
|
|
897
|
+
/** A price as text (`8,50 €`), or null when there is no price. Items, variants, lunch and sets. */
|
|
898
|
+
declare function priceLabel(price: Money | null | undefined, lang: SiteLang): string | null;
|
|
899
|
+
/** ` (16. november)` for the date an item is back, or null when the date is unknown. */
|
|
900
|
+
declare function soldOutUntilLabel(until: string | null | undefined, lang: SiteLang): string | null;
|
|
901
|
+
/**
|
|
902
|
+
* Heading plan of a menu list: whether menu names show (default: more than one menu) and the
|
|
903
|
+
* level of the section names (one below the menu name when it shows).
|
|
904
|
+
*/
|
|
905
|
+
declare function menuHeadings(menuCount: number, showMenuNames: boolean | undefined, headingLevel: number): {
|
|
906
|
+
showNames: boolean;
|
|
907
|
+
sectionLevel: number;
|
|
908
|
+
};
|
|
909
|
+
/** Every allergen of every item of a menu, in page order (with repeats), for the legend. */
|
|
910
|
+
declare function menuAllergens(menu: Menu): Allergen[];
|
|
911
|
+
|
|
912
|
+
/** Is the lunch date today? `today` is the restaurant's `YYYY-MM-DD`; false when it is unknown. */
|
|
913
|
+
declare function lunchIsToday(date: string, today: string | undefined): boolean;
|
|
914
|
+
/** "Kolmapäev, 18.11": weekday and day.month of a lunch date. */
|
|
915
|
+
declare function lunchDayLabel(date: string, lang: SiteLang): string;
|
|
916
|
+
/** Does the lunch day have an offer with at least one item? */
|
|
917
|
+
declare function hasLunchOffer(lunch: Pick<LunchDayResponse, "offer">): boolean;
|
|
918
|
+
/** Empty state: "no lunch today" and, when known, the line for the next lunch date. */
|
|
919
|
+
declare function lunchEmpty(lunch: Pick<LunchDayResponse, "next_date">, lang: SiteLang): {
|
|
920
|
+
message: string;
|
|
921
|
+
next: string | null;
|
|
922
|
+
};
|
|
923
|
+
/** "Pakume 11:00–14:00", or null unless both times are set. */
|
|
924
|
+
declare function lunchServed(offer: {
|
|
925
|
+
served_from: string | null;
|
|
926
|
+
served_to: string | null;
|
|
927
|
+
}, lang: SiteLang): string | null;
|
|
928
|
+
|
|
929
|
+
/** Month (short, no trailing dot) and two-digit day of a `YYYY-MM-DD` date, for the date badge. */
|
|
930
|
+
declare function eventDateParts(isoDate: string, lang: SiteLang): {
|
|
931
|
+
month: string;
|
|
932
|
+
day: string;
|
|
933
|
+
};
|
|
934
|
+
/**
|
|
935
|
+
* Sold-out word when the event is sold out, else "12 kohta vaba" when the seat count is known.
|
|
936
|
+
* At most one of the two is set.
|
|
937
|
+
*/
|
|
938
|
+
declare function eventAvailability(soldOut: boolean, seatsLeft: number | undefined, lang: SiteLang): {
|
|
939
|
+
soldOutLabel: string | null;
|
|
940
|
+
seatsText: string | null;
|
|
941
|
+
};
|
|
942
|
+
|
|
943
|
+
/** http(s), mailto:, tel: or a site-relative path. Anything else (javascript:, data:) is dropped. */
|
|
944
|
+
declare function safeHref(value: unknown): string | null;
|
|
945
|
+
/** Only http(s) image sources. */
|
|
946
|
+
declare function safeImageSrc(value: unknown): string | null;
|
|
947
|
+
/** A non-blank string field of a page block, or null. */
|
|
948
|
+
declare function blockString(b: PageBlock, key: string): string | null;
|
|
949
|
+
/** Heading level of a `heading` block: 3 or 4 as given, else 2. */
|
|
950
|
+
declare function blockHeadingLevel(b: PageBlock): 2 | 3 | 4;
|
|
951
|
+
/** Link and label of a `cta`/`button` block; null when either is missing or the link is unsafe. */
|
|
952
|
+
declare function blockCta(b: PageBlock): {
|
|
953
|
+
href: string;
|
|
954
|
+
label: string;
|
|
955
|
+
external: boolean;
|
|
956
|
+
} | null;
|
|
957
|
+
|
|
958
|
+
/** `tel:` link for a phone number: keeps digits and a leading plus. */
|
|
959
|
+
declare function telHref(phone: string): string;
|
|
960
|
+
/** `mailto:` link for an e-mail address. */
|
|
961
|
+
declare function mailtoHref(email: string): string;
|
|
962
|
+
/**
|
|
963
|
+
* Body of the contact form from cleaned field values. Required text defaults to "" so the
|
|
964
|
+
* schema reports it as missing; phone stays optional.
|
|
965
|
+
*/
|
|
966
|
+
declare function contactPayload(v: {
|
|
967
|
+
name?: string | undefined;
|
|
968
|
+
email?: string | undefined;
|
|
969
|
+
phone?: string | undefined;
|
|
970
|
+
message?: string | undefined;
|
|
971
|
+
}): {
|
|
972
|
+
name: string;
|
|
973
|
+
email: string;
|
|
974
|
+
phone: string | undefined;
|
|
975
|
+
message: string;
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
/** Last bookable date: `maxDaysAhead` days after today; undefined when there is no limit. */
|
|
979
|
+
declare function maxBookingDate(today: string, maxDaysAhead: number | null | undefined): string | undefined;
|
|
980
|
+
/** Party size limits of a location; 1 to 20 when the location is unknown. */
|
|
981
|
+
declare function partyLimits(booking: Pick<BookingLocation, "min_party" | "max_party"> | null | undefined): {
|
|
982
|
+
min: number;
|
|
983
|
+
max: number;
|
|
984
|
+
};
|
|
985
|
+
/** `n` kept inside `min`..`max`. */
|
|
986
|
+
declare function clampParty(n: number, min: number, max: number): number;
|
|
987
|
+
/** Party size to start with: 2, or the minimum when higher, never above the maximum. */
|
|
988
|
+
declare function initialParty(min: number, max: number): number;
|
|
989
|
+
/** How many day buttons: at most `days`, and no day past `maxDaysAhead`. */
|
|
990
|
+
declare function bookingDayCount(days: number, maxDaysAhead: number | null | undefined): number;
|
|
991
|
+
/** Day buttons from today: "Täna", "Homme", then the weekday letter; with `dd.mm`. */
|
|
992
|
+
declare function bookingDays(today: string, count: number, lang: SiteLang): {
|
|
993
|
+
iso: string;
|
|
994
|
+
top: string;
|
|
995
|
+
main: string;
|
|
996
|
+
}[];
|
|
997
|
+
/** Time slots as buttons: full ones disabled, the chosen one pressed; `anyFull` shows the hint. */
|
|
998
|
+
declare function bookingSlots(slots: {
|
|
999
|
+
time: string;
|
|
1000
|
+
full?: boolean;
|
|
1001
|
+
}[] | undefined, selected: string): {
|
|
1002
|
+
slots: {
|
|
1003
|
+
time: string;
|
|
1004
|
+
disabled: boolean;
|
|
1005
|
+
pressed: boolean;
|
|
1006
|
+
}[];
|
|
1007
|
+
anyFull: boolean;
|
|
1008
|
+
};
|
|
1009
|
+
interface BookingFields {
|
|
1010
|
+
date?: string | undefined;
|
|
1011
|
+
time?: string | undefined;
|
|
1012
|
+
party_size?: number | undefined;
|
|
1013
|
+
name?: string | undefined;
|
|
1014
|
+
phone?: string | undefined;
|
|
1015
|
+
}
|
|
1016
|
+
/** Booking request body from cleaned field values; required text defaults to "". */
|
|
1017
|
+
declare function bookingPayload(locationId: string | undefined, v: BookingFields): Record<string, unknown>;
|
|
1018
|
+
/** Like `bookingPayload`, plus the optional e-mail and note of the full booking form. */
|
|
1019
|
+
declare function bookingRequestPayload(locationId: string | undefined, v: BookingFields & {
|
|
1020
|
+
email?: string | undefined;
|
|
1021
|
+
note?: string | undefined;
|
|
1022
|
+
}): Record<string, unknown>;
|
|
1023
|
+
|
|
1024
|
+
/** Event kinds in the order the request form offers them. */
|
|
1025
|
+
declare const EVENT_KINDS: EventKind[];
|
|
1026
|
+
/** Euros as typed ("12,50") to cents; undefined when empty, NaN when not a number. */
|
|
1027
|
+
declare function budgetToCents(euros: string | undefined): number | undefined;
|
|
1028
|
+
/** ` – 45 € / in` after a package name; "" when the package has no price. */
|
|
1029
|
+
declare function packagePriceLabel(pk: Pick<EventPackage, "price" | "price_unit">, lang: SiteLang): string;
|
|
1030
|
+
|
|
1031
|
+
/** Refetch the form token when it is older than this at submit (the API allows 2 h). */
|
|
1032
|
+
declare const TOKEN_MAX_AGE_MS: number;
|
|
1033
|
+
/** The API drops forms sent sooner than 3 s after the token. Wait a little past that. */
|
|
1034
|
+
declare const TOKEN_MIN_AGE_MS = 3500;
|
|
1035
|
+
/** Optional text field value: trimmed; empty or not a string becomes undefined. */
|
|
1036
|
+
declare function cleanText(v: unknown): string | undefined;
|
|
1037
|
+
/** Optional integer field value: undefined when empty, NaN when not a whole number. */
|
|
1038
|
+
declare function cleanInt(v: unknown): number | undefined;
|
|
1039
|
+
/**
|
|
1040
|
+
* Field errors from failed client-side validation (zod-like issues). First issue per field wins:
|
|
1041
|
+
* empty is "required", a short phone has its own text, anything else is "invalid".
|
|
1042
|
+
*/
|
|
1043
|
+
declare function clientFieldErrors(issues: {
|
|
1044
|
+
path: PropertyKey[];
|
|
1045
|
+
code: string;
|
|
1046
|
+
}[], body: Record<string, unknown>, form: Dictionary["form"]): Record<string, string>;
|
|
1047
|
+
/** "Sending failed" text; with the restaurant phone it asks people to call. */
|
|
1048
|
+
declare function failureMessage(form: Dictionary["form"], phone: string | null | undefined): string;
|
|
1049
|
+
/**
|
|
1050
|
+
* What to show after the site's route answered with an error: 422 with field errors marks those
|
|
1051
|
+
* fields, 429 says too many tries, anything else is the general failure.
|
|
1052
|
+
*/
|
|
1053
|
+
declare function submitFailure(res: {
|
|
1054
|
+
status: number;
|
|
1055
|
+
fieldErrors: Record<string, unknown>;
|
|
1056
|
+
}, form: Dictionary["form"], phone: string | null | undefined): {
|
|
1057
|
+
errors: Record<string, string>;
|
|
1058
|
+
message: string | null;
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
/** Media query that counts as a phone: `device` is "mobile" when it matches. */
|
|
1062
|
+
declare const MOBILE_QUERY = "(max-width: 767px)";
|
|
1063
|
+
/**
|
|
1064
|
+
* JSON body of a track beacon. `path` is cut at 300 characters ("/" when empty); `ref` is the
|
|
1065
|
+
* referrer host when it is not the site's own `host`. No cookies, no ids.
|
|
1066
|
+
*/
|
|
1067
|
+
declare function trackBody(input: {
|
|
1068
|
+
name: TrackName;
|
|
1069
|
+
lang: SiteLang;
|
|
1070
|
+
path: string;
|
|
1071
|
+
/** `document.referrer`, "" when none. */
|
|
1072
|
+
referrer: string;
|
|
1073
|
+
/** The site's own host (`location.host`). */
|
|
1074
|
+
host: string;
|
|
1075
|
+
mobile: boolean;
|
|
1076
|
+
}): {
|
|
1077
|
+
name: TrackName;
|
|
1078
|
+
path: string;
|
|
1079
|
+
lang: SiteLang;
|
|
1080
|
+
device: "mobile" | "desktop";
|
|
1081
|
+
ref?: string;
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* Tab to focus after a key press: ArrowRight/ArrowLeft wrap around, Home and End jump to the
|
|
1086
|
+
* ends. Null for any other key (leave the event alone) or when there are no tabs.
|
|
1087
|
+
*/
|
|
1088
|
+
declare function nextTabIndex(key: string, current: number, count: number): number | null;
|
|
1089
|
+
|
|
1090
|
+
export { ALLERGEN_CODES, DEFAULT_SITE_LANG, DICTIONARIES, EVENT_KINDS, MOBILE_QUERY, SITE_LANGS, TOKEN_MAX_AGE_MS, TOKEN_MIN_AGE_MS, absoluteUrl, addDays, allergenLetter, allergenName, alternatesFor, blockCta, blockHeadingLevel, blockString, bookingDayCount, bookingDays, bookingPayload, bookingRequestPayload, bookingSlots, budgetToCents, buildLlmsTxt, buildRobots, buildSitemap, capitalize, clampParty, cleanInt, cleanText, clientFieldErrors, closedNoticeText, contactPayload, dayRowView, describeOpenStatus, dictionary, eventAvailability, eventDateParts, failureMessage, formatDate, formatDayMonth, formatMoney, formatTime, groupHasDay, groupWeekly, groupWeeklyDetailed, hasLunchOffer, hoursRange, initialParty, intervalsLabel, isSiteLang, isoDateIn, isoWeekday, jsonLdScript, localePath, lunchDayLabel, lunchEmpty, lunchIsToday, lunchServed, mailtoHref, maxBookingDate, menuAllergens, menuHeadings, menuJsonLd, moneyAmount, nextTabIndex, openStatus, openingHoursSpecification, packagePriceLabel, partyLimits, priceLabel, restaurantJsonLd, safeHref, safeImageSrc, safePath, soldOutUntilLabel, specialDays, specialDaysFrom, specialRowView, splitLocale, splitSpecialDays, submitFailure, telHref, trackBody, uniqueAllergens, upcomingDays, weekRowLabels, weeklyPattern };
|
|
1091
|
+
export type { AllergenCodes, Dictionary, LlmsTxtInput, LocalizedPaths, OpenStatus, RestaurantJsonLdInput, SiteLang, SitemapEntry, SitemapRoute, SpecialDay, WeeklyGroup, WeeklySlot };
|