@cloudexp-io/laudro-sdk 0.0.0-stage → 0.5.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/dist/next.d.ts ADDED
@@ -0,0 +1,263 @@
1
+ import { L as LangQuery, B as BookingRequestCreate, E as EventRequestCreate, C as ContactCreate, T as TrackEvent } from './retry-BnQHOsTh.js';
2
+ export { A as Allergen, c as AllergenCode, d as BookingLocation, e as BookingProvider, f as BookingResponse, g as Currency, D as DEFAULT_LANG, h as DietTag, i as Email, j as EventKind, k as EventPackage, l as EventPackagesResponse, F as FormToken, H as Honeypot, I as IsoDate, m as IsoDateTime, n as IsoWeek, o as Lang, p as LangFallback, q as LocalTime, M as Media, r as Money, s as PROBLEM_CONTENT_TYPE, t as PhoneInput, P as Problem, b as ProblemFieldError, R as RequestCreated, a as RetryOptions, u as TrackName, v as TurnstileToken, U as Uuid, W as WeeklyHours, w as eur, x as parseRetryAfter } from './retry-BnQHOsTh.js';
3
+ import { LaudroClientOptions, RequestOptions, HoursQuery, MenusQuery, LunchQuery, LunchWeekResponse, LunchDayResponse, WriteOptions } from './core.js';
4
+ export { API_ROUTES, ApiRoute, BookingMode, CACHE_TAGS, CacheTag, DEFAULT_REVALIDATE_SECONDS, HOURS_MAX_DAYS, HoursDay, HoursInterval, HoursKind, HoursResponse, KindHours, LEGACY_PREVIEW_TOKEN_HEADER, LaudroApiError, LaudroClient, Location, LocationHours, LocationsResponse, LunchDay, LunchItem, LunchOffer, LunchResponse, Menu, MenuItem, MenuItemVariant, MenuKind, MenuSection, MenusResponse, OpenNow, PREVIEW_TOKEN_HEADER, Page, PageBlock, PageKey, PreviewCheck, PreviewQuery, RbApiError, RbClient, RbClientOptions, RestaurantStatus, Site, VerifyWebhookResult, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TOLERANCE_SECONDS, WebhookPayload, buildOpenApi, expandCacheTags, openNow, signFormToken, verifyWebhook } from './core.js';
5
+ import 'zod';
6
+
7
+ /** Core client plus (the core already applies DEFAULT_REVALIDATE_SECONDS) Next.js fetch cache tags and revalidate on cacheable reads. */
8
+ declare function createClient(options: LaudroClientOptions): {
9
+ request: <T>(path: string, opts?: RequestOptions) => Promise<T>;
10
+ site: (q?: LangQuery) => Promise<{
11
+ id: string;
12
+ site_id: string;
13
+ name: string;
14
+ short_name: string | null;
15
+ status: "demo" | "live" | "paused";
16
+ timezone: string;
17
+ default_lang: "et" | "en";
18
+ languages: ("et" | "en")[];
19
+ logo: {
20
+ id: string;
21
+ url: string;
22
+ width: number | null;
23
+ height: number | null;
24
+ alt: string | null;
25
+ blurhash: string | null;
26
+ lang_fallback: boolean;
27
+ } | null;
28
+ brand: Record<string, string>;
29
+ social_links: Record<string, string>;
30
+ booking_mode: "provider" | "request" | "both" | "phone_only" | null;
31
+ contact: {
32
+ phone: string | null;
33
+ email: string | null;
34
+ address: string | null;
35
+ };
36
+ lang: "et" | "en";
37
+ lang_fallback: boolean;
38
+ reopen_on?: string | null | undefined;
39
+ }>;
40
+ locations: (q?: LangQuery) => Promise<{
41
+ locations: {
42
+ id: string;
43
+ name: string;
44
+ address: string | null;
45
+ city: string | null;
46
+ postcode: string | null;
47
+ country: string;
48
+ geo: {
49
+ lat: number;
50
+ lng: number;
51
+ } | null;
52
+ phone: string | null;
53
+ email: string | null;
54
+ google_maps_url: string | null;
55
+ timezone: string;
56
+ lang_fallback: boolean;
57
+ }[];
58
+ lang: "et" | "en";
59
+ }>;
60
+ hours: (q: HoursQuery) => Promise<{
61
+ from: string;
62
+ to: string;
63
+ locations: {
64
+ location_id: string;
65
+ timezone: string;
66
+ days: {
67
+ date: string;
68
+ weekday: number;
69
+ holiday: string | null;
70
+ open: {
71
+ closed: boolean;
72
+ intervals: {
73
+ opens: string;
74
+ closes: string;
75
+ opens_at: string;
76
+ closes_at: string;
77
+ }[];
78
+ special: boolean;
79
+ note: string | null;
80
+ } | null;
81
+ kitchen: {
82
+ closed: boolean;
83
+ intervals: {
84
+ opens: string;
85
+ closes: string;
86
+ opens_at: string;
87
+ closes_at: string;
88
+ }[];
89
+ special: boolean;
90
+ note: string | null;
91
+ } | null;
92
+ booking: {
93
+ closed: boolean;
94
+ intervals: {
95
+ opens: string;
96
+ closes: string;
97
+ opens_at: string;
98
+ closes_at: string;
99
+ }[];
100
+ special: boolean;
101
+ note: string | null;
102
+ } | null;
103
+ lunch: {
104
+ closed: boolean;
105
+ intervals: {
106
+ opens: string;
107
+ closes: string;
108
+ opens_at: string;
109
+ closes_at: string;
110
+ }[];
111
+ special: boolean;
112
+ note: string | null;
113
+ } | null;
114
+ }[];
115
+ }[];
116
+ lang: "et" | "en";
117
+ }>;
118
+ menus: (q?: MenusQuery) => Promise<{
119
+ menus: {
120
+ id: string;
121
+ name: string;
122
+ description: string | null;
123
+ kind: "main" | "drinks" | "lunch" | "kids" | "event";
124
+ sections: {
125
+ id: string;
126
+ name: string;
127
+ description: string | null;
128
+ items: {
129
+ id: string;
130
+ name: string;
131
+ description: string | null;
132
+ tagline: string | null;
133
+ ingredients: string | null;
134
+ price: {
135
+ cents: number;
136
+ currency: "EUR";
137
+ } | null;
138
+ sold_out: boolean;
139
+ sold_out_until: string | null;
140
+ image: {
141
+ id: string;
142
+ url: string;
143
+ width: number | null;
144
+ height: number | null;
145
+ alt: string | null;
146
+ blurhash: string | null;
147
+ lang_fallback: boolean;
148
+ } | null;
149
+ allergens: {
150
+ code: "gluten" | "crustaceans" | "eggs" | "fish" | "peanuts" | "soybeans" | "milk" | "nuts" | "celery" | "mustard" | "sesame" | "sulphites" | "lupin" | "molluscs";
151
+ name: string;
152
+ icon: string | null;
153
+ state: "contains" | "may_contain";
154
+ }[];
155
+ tags: ("kids" | "vegan" | "vegetarian" | "gluten_free" | "lactose_free" | "spicy" | "new" | "popular" | "chef_choice")[];
156
+ variants: {
157
+ id: string;
158
+ name: string;
159
+ price: {
160
+ cents: number;
161
+ currency: "EUR";
162
+ } | null;
163
+ lang_fallback: boolean;
164
+ }[];
165
+ lang_fallback: boolean;
166
+ }[];
167
+ lang_fallback: boolean;
168
+ }[];
169
+ lang_fallback: boolean;
170
+ }[];
171
+ lang: "et" | "en";
172
+ }>;
173
+ lunch: {
174
+ (q: LunchQuery & {
175
+ week: string;
176
+ }): Promise<LunchWeekResponse>;
177
+ (q?: LunchQuery & {
178
+ week?: undefined;
179
+ }): Promise<LunchDayResponse>;
180
+ };
181
+ page: (key: string, q?: LangQuery) => Promise<{
182
+ id: string;
183
+ key: string;
184
+ title: string;
185
+ blocks: {
186
+ [x: string]: unknown;
187
+ type: string;
188
+ }[];
189
+ seo: {
190
+ title: string | null;
191
+ description: string | null;
192
+ };
193
+ lang: "et" | "en";
194
+ lang_fallback: boolean;
195
+ }>;
196
+ packages: (q?: LangQuery) => Promise<{
197
+ packages: {
198
+ id: string;
199
+ name: string;
200
+ description: string | null;
201
+ min_guests: number | null;
202
+ max_guests: number | null;
203
+ price: {
204
+ cents: number;
205
+ currency: "EUR";
206
+ } | null;
207
+ price_unit: "per_person" | "total";
208
+ lang_fallback: boolean;
209
+ }[];
210
+ lang: "et" | "en";
211
+ }>;
212
+ booking: (q?: LangQuery) => Promise<{
213
+ mode: "provider" | "request" | "both" | "phone_only" | null;
214
+ locations: {
215
+ location_id: string;
216
+ mode: "provider" | "request" | "both" | "phone_only";
217
+ provider: "tableonline" | "zenchef" | "quandoo" | null;
218
+ provider_url: string | null;
219
+ min_party: number;
220
+ max_party: number;
221
+ min_lead_minutes: number;
222
+ max_days_ahead: number;
223
+ confirm_text: string | null;
224
+ phone: string | null;
225
+ booking_hours: {
226
+ weekday: number;
227
+ opens: string;
228
+ closes: string;
229
+ }[];
230
+ booking_hours_kind: "open" | "booking";
231
+ lang_fallback: boolean;
232
+ }[];
233
+ lang: "et" | "en";
234
+ }>;
235
+ checkPreview: (token: string) => Promise<{
236
+ valid: true;
237
+ restaurant_id: string;
238
+ path: string;
239
+ expires_at: string;
240
+ }>;
241
+ bookingRequests: {
242
+ create: (body: BookingRequestCreate, o?: WriteOptions) => Promise<{
243
+ id: string;
244
+ status: "new";
245
+ }>;
246
+ };
247
+ eventRequests: {
248
+ create: (body: EventRequestCreate, o?: WriteOptions) => Promise<{
249
+ id: string;
250
+ status: "new";
251
+ }>;
252
+ };
253
+ contact: {
254
+ create: (body: ContactCreate, o?: WriteOptions) => Promise<{
255
+ id: string;
256
+ status: "new";
257
+ }>;
258
+ };
259
+ track: (event: TrackEvent, o?: WriteOptions) => Promise<void>;
260
+ withPreview: (token: string) => /*elided*/ any;
261
+ };
262
+
263
+ export { BookingRequestCreate, ContactCreate, EventRequestCreate, HoursQuery, LangQuery, LaudroClientOptions, LunchDayResponse, LunchQuery, LunchWeekResponse, MenusQuery, RequestOptions, TrackEvent, WriteOptions, createClient };
package/dist/next.js ADDED
@@ -0,0 +1,182 @@
1
+ import {
2
+ createClient
3
+ } from "./chunk-LSPODMW7.js";
4
+ import {
5
+ API_ROUTES,
6
+ CACHE_TAGS,
7
+ CacheTag,
8
+ DEFAULT_REVALIDATE_SECONDS,
9
+ HOURS_MAX_DAYS,
10
+ HoursDay,
11
+ HoursInterval,
12
+ HoursKind,
13
+ HoursQuery,
14
+ HoursResponse,
15
+ KindHours,
16
+ LEGACY_PREVIEW_TOKEN_HEADER,
17
+ LaudroApiError,
18
+ LocationHours,
19
+ LunchDay,
20
+ LunchDayResponse,
21
+ LunchItem,
22
+ LunchOffer,
23
+ LunchQuery,
24
+ LunchResponse,
25
+ LunchWeekResponse,
26
+ Menu,
27
+ MenuItem,
28
+ MenuItemVariant,
29
+ MenuKind,
30
+ MenuSection,
31
+ MenusQuery,
32
+ MenusResponse,
33
+ PREVIEW_TOKEN_HEADER,
34
+ Page,
35
+ PageBlock,
36
+ PageKey,
37
+ PreviewCheck,
38
+ PreviewQuery,
39
+ RbApiError,
40
+ WEBHOOK_SIGNATURE_HEADER,
41
+ WEBHOOK_TOLERANCE_SECONDS,
42
+ WebhookPayload,
43
+ buildOpenApi,
44
+ expandCacheTags,
45
+ openNow,
46
+ signFormToken,
47
+ verifyWebhook
48
+ } from "./chunk-5H4Y5WKX.js";
49
+ import {
50
+ Allergen,
51
+ AllergenCode,
52
+ BookingLocation,
53
+ BookingMode,
54
+ BookingProvider,
55
+ BookingRequestCreate,
56
+ BookingResponse,
57
+ ContactCreate,
58
+ Currency,
59
+ DEFAULT_LANG,
60
+ DietTag,
61
+ Email,
62
+ EventKind,
63
+ EventPackage,
64
+ EventPackagesResponse,
65
+ EventRequestCreate,
66
+ FormToken,
67
+ Honeypot,
68
+ IsoDate,
69
+ IsoDateTime,
70
+ IsoWeek,
71
+ Lang,
72
+ LangFallback,
73
+ LangQuery,
74
+ LocalTime,
75
+ Location,
76
+ LocationsResponse,
77
+ Media,
78
+ Money,
79
+ PROBLEM_CONTENT_TYPE,
80
+ PhoneInput,
81
+ Problem,
82
+ ProblemFieldError,
83
+ RequestCreated,
84
+ RestaurantStatus,
85
+ Site,
86
+ TrackEvent,
87
+ TrackName,
88
+ TurnstileToken,
89
+ Uuid,
90
+ WeeklyHours,
91
+ eur,
92
+ parseRetryAfter
93
+ } from "./chunk-6LTB3GRQ.js";
94
+ export {
95
+ API_ROUTES,
96
+ Allergen,
97
+ AllergenCode,
98
+ BookingLocation,
99
+ BookingMode,
100
+ BookingProvider,
101
+ BookingRequestCreate,
102
+ BookingResponse,
103
+ CACHE_TAGS,
104
+ CacheTag,
105
+ ContactCreate,
106
+ Currency,
107
+ DEFAULT_LANG,
108
+ DEFAULT_REVALIDATE_SECONDS,
109
+ DietTag,
110
+ Email,
111
+ EventKind,
112
+ EventPackage,
113
+ EventPackagesResponse,
114
+ EventRequestCreate,
115
+ FormToken,
116
+ HOURS_MAX_DAYS,
117
+ Honeypot,
118
+ HoursDay,
119
+ HoursInterval,
120
+ HoursKind,
121
+ HoursQuery,
122
+ HoursResponse,
123
+ IsoDate,
124
+ IsoDateTime,
125
+ IsoWeek,
126
+ KindHours,
127
+ LEGACY_PREVIEW_TOKEN_HEADER,
128
+ Lang,
129
+ LangFallback,
130
+ LangQuery,
131
+ LaudroApiError,
132
+ LocalTime,
133
+ Location,
134
+ LocationHours,
135
+ LocationsResponse,
136
+ LunchDay,
137
+ LunchDayResponse,
138
+ LunchItem,
139
+ LunchOffer,
140
+ LunchQuery,
141
+ LunchResponse,
142
+ LunchWeekResponse,
143
+ Media,
144
+ Menu,
145
+ MenuItem,
146
+ MenuItemVariant,
147
+ MenuKind,
148
+ MenuSection,
149
+ MenusQuery,
150
+ MenusResponse,
151
+ Money,
152
+ PREVIEW_TOKEN_HEADER,
153
+ PROBLEM_CONTENT_TYPE,
154
+ Page,
155
+ PageBlock,
156
+ PageKey,
157
+ PhoneInput,
158
+ PreviewCheck,
159
+ PreviewQuery,
160
+ Problem,
161
+ ProblemFieldError,
162
+ RbApiError,
163
+ RequestCreated,
164
+ RestaurantStatus,
165
+ Site,
166
+ TrackEvent,
167
+ TrackName,
168
+ TurnstileToken,
169
+ Uuid,
170
+ WEBHOOK_SIGNATURE_HEADER,
171
+ WEBHOOK_TOLERANCE_SECONDS,
172
+ WebhookPayload,
173
+ WeeklyHours,
174
+ buildOpenApi,
175
+ createClient,
176
+ eur,
177
+ expandCacheTags,
178
+ openNow,
179
+ parseRetryAfter,
180
+ signFormToken,
181
+ verifyWebhook
182
+ };