@cloudexp-io/laudro-sdk 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/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 { RbClientOptions, 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, Location, LocationHours, LocationsResponse, LunchDay, LunchItem, LunchOffer, LunchResponse, Menu, MenuItem, MenuItemVariant, MenuKind, MenuSection, MenusResponse, OpenNow, PREVIEW_TOKEN_HEADER, Page, PageBlock, PageKey, PreviewCheck, PreviewQuery, RbApiError, RbClient, 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: RbClientOptions): {
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, LunchDayResponse, LunchQuery, LunchWeekResponse, MenusQuery, RbClientOptions, RequestOptions, TrackEvent, WriteOptions, createClient };
package/dist/next.js ADDED
@@ -0,0 +1,180 @@
1
+ import {
2
+ createClient
3
+ } from "./chunk-6J7GJOQI.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
+ LocationHours,
18
+ LunchDay,
19
+ LunchDayResponse,
20
+ LunchItem,
21
+ LunchOffer,
22
+ LunchQuery,
23
+ LunchResponse,
24
+ LunchWeekResponse,
25
+ Menu,
26
+ MenuItem,
27
+ MenuItemVariant,
28
+ MenuKind,
29
+ MenuSection,
30
+ MenusQuery,
31
+ MenusResponse,
32
+ PREVIEW_TOKEN_HEADER,
33
+ Page,
34
+ PageBlock,
35
+ PageKey,
36
+ PreviewCheck,
37
+ PreviewQuery,
38
+ RbApiError,
39
+ WEBHOOK_SIGNATURE_HEADER,
40
+ WEBHOOK_TOLERANCE_SECONDS,
41
+ WebhookPayload,
42
+ buildOpenApi,
43
+ expandCacheTags,
44
+ openNow,
45
+ signFormToken,
46
+ verifyWebhook
47
+ } from "./chunk-4ADLD5ZW.js";
48
+ import {
49
+ Allergen,
50
+ AllergenCode,
51
+ BookingLocation,
52
+ BookingMode,
53
+ BookingProvider,
54
+ BookingRequestCreate,
55
+ BookingResponse,
56
+ ContactCreate,
57
+ Currency,
58
+ DEFAULT_LANG,
59
+ DietTag,
60
+ Email,
61
+ EventKind,
62
+ EventPackage,
63
+ EventPackagesResponse,
64
+ EventRequestCreate,
65
+ FormToken,
66
+ Honeypot,
67
+ IsoDate,
68
+ IsoDateTime,
69
+ IsoWeek,
70
+ Lang,
71
+ LangFallback,
72
+ LangQuery,
73
+ LocalTime,
74
+ Location,
75
+ LocationsResponse,
76
+ Media,
77
+ Money,
78
+ PROBLEM_CONTENT_TYPE,
79
+ PhoneInput,
80
+ Problem,
81
+ ProblemFieldError,
82
+ RequestCreated,
83
+ RestaurantStatus,
84
+ Site,
85
+ TrackEvent,
86
+ TrackName,
87
+ TurnstileToken,
88
+ Uuid,
89
+ WeeklyHours,
90
+ eur,
91
+ parseRetryAfter
92
+ } from "./chunk-6LTB3GRQ.js";
93
+ export {
94
+ API_ROUTES,
95
+ Allergen,
96
+ AllergenCode,
97
+ BookingLocation,
98
+ BookingMode,
99
+ BookingProvider,
100
+ BookingRequestCreate,
101
+ BookingResponse,
102
+ CACHE_TAGS,
103
+ CacheTag,
104
+ ContactCreate,
105
+ Currency,
106
+ DEFAULT_LANG,
107
+ DEFAULT_REVALIDATE_SECONDS,
108
+ DietTag,
109
+ Email,
110
+ EventKind,
111
+ EventPackage,
112
+ EventPackagesResponse,
113
+ EventRequestCreate,
114
+ FormToken,
115
+ HOURS_MAX_DAYS,
116
+ Honeypot,
117
+ HoursDay,
118
+ HoursInterval,
119
+ HoursKind,
120
+ HoursQuery,
121
+ HoursResponse,
122
+ IsoDate,
123
+ IsoDateTime,
124
+ IsoWeek,
125
+ KindHours,
126
+ LEGACY_PREVIEW_TOKEN_HEADER,
127
+ Lang,
128
+ LangFallback,
129
+ LangQuery,
130
+ LocalTime,
131
+ Location,
132
+ LocationHours,
133
+ LocationsResponse,
134
+ LunchDay,
135
+ LunchDayResponse,
136
+ LunchItem,
137
+ LunchOffer,
138
+ LunchQuery,
139
+ LunchResponse,
140
+ LunchWeekResponse,
141
+ Media,
142
+ Menu,
143
+ MenuItem,
144
+ MenuItemVariant,
145
+ MenuKind,
146
+ MenuSection,
147
+ MenusQuery,
148
+ MenusResponse,
149
+ Money,
150
+ PREVIEW_TOKEN_HEADER,
151
+ PROBLEM_CONTENT_TYPE,
152
+ Page,
153
+ PageBlock,
154
+ PageKey,
155
+ PhoneInput,
156
+ PreviewCheck,
157
+ PreviewQuery,
158
+ Problem,
159
+ ProblemFieldError,
160
+ RbApiError,
161
+ RequestCreated,
162
+ RestaurantStatus,
163
+ Site,
164
+ TrackEvent,
165
+ TrackName,
166
+ TurnstileToken,
167
+ Uuid,
168
+ WEBHOOK_SIGNATURE_HEADER,
169
+ WEBHOOK_TOLERANCE_SECONDS,
170
+ WebhookPayload,
171
+ WeeklyHours,
172
+ buildOpenApi,
173
+ createClient,
174
+ eur,
175
+ expandCacheTags,
176
+ openNow,
177
+ parseRetryAfter,
178
+ signFormToken,
179
+ verifyWebhook
180
+ };