bestraw-sdk 1.0.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/index.cjs +546 -0
- package/dist/index.d.cts +509 -0
- package/dist/index.d.ts +509 -0
- package/dist/index.js +508 -0
- package/package.json +32 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
interface BestrawConfig {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
apiToken?: string;
|
|
4
|
+
defaultLocale?: string;
|
|
5
|
+
getAuthToken?: () => string | null | Promise<string | null>;
|
|
6
|
+
}
|
|
7
|
+
declare class BestrawError extends Error {
|
|
8
|
+
status: number;
|
|
9
|
+
code?: string;
|
|
10
|
+
meta?: Record<string, unknown>;
|
|
11
|
+
details?: unknown;
|
|
12
|
+
constructor(status: number, message: string, details?: unknown);
|
|
13
|
+
}
|
|
14
|
+
interface RequestOptions extends RequestInit {
|
|
15
|
+
locale?: string;
|
|
16
|
+
}
|
|
17
|
+
declare class BaseClient {
|
|
18
|
+
protected baseUrl: string;
|
|
19
|
+
protected defaultLocale?: string;
|
|
20
|
+
private apiToken?;
|
|
21
|
+
private getAuthToken?;
|
|
22
|
+
constructor(config: BestrawConfig);
|
|
23
|
+
private headers;
|
|
24
|
+
private appendLocale;
|
|
25
|
+
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface StrapiResponse<T> {
|
|
29
|
+
data: T;
|
|
30
|
+
meta?: {
|
|
31
|
+
pagination?: {
|
|
32
|
+
page: number;
|
|
33
|
+
pageSize: number;
|
|
34
|
+
pageCount: number;
|
|
35
|
+
total: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
interface StrapiListResponse<T> {
|
|
40
|
+
data: T[];
|
|
41
|
+
meta?: {
|
|
42
|
+
pagination?: {
|
|
43
|
+
page: number;
|
|
44
|
+
pageSize: number;
|
|
45
|
+
pageCount: number;
|
|
46
|
+
total: number;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
interface Picture {
|
|
51
|
+
id: number;
|
|
52
|
+
documentId: string;
|
|
53
|
+
url: string;
|
|
54
|
+
alternativeText?: string;
|
|
55
|
+
width?: number;
|
|
56
|
+
height?: number;
|
|
57
|
+
formats?: Record<string, {
|
|
58
|
+
url: string;
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
}>;
|
|
62
|
+
}
|
|
63
|
+
interface Sauce {
|
|
64
|
+
id?: number;
|
|
65
|
+
name: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
}
|
|
68
|
+
interface Side {
|
|
69
|
+
id?: number;
|
|
70
|
+
name: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
}
|
|
73
|
+
interface Field {
|
|
74
|
+
id?: number;
|
|
75
|
+
name: string;
|
|
76
|
+
value: string;
|
|
77
|
+
}
|
|
78
|
+
interface Meal {
|
|
79
|
+
id: number;
|
|
80
|
+
documentId: string;
|
|
81
|
+
name: string;
|
|
82
|
+
description: string;
|
|
83
|
+
price: number;
|
|
84
|
+
sortOrder: number;
|
|
85
|
+
available: boolean;
|
|
86
|
+
show: boolean;
|
|
87
|
+
pictures?: Picture[];
|
|
88
|
+
sauces?: Sauce[];
|
|
89
|
+
sides?: Side[];
|
|
90
|
+
fields?: Field[];
|
|
91
|
+
allergens?: number[];
|
|
92
|
+
}
|
|
93
|
+
interface Category {
|
|
94
|
+
id: number;
|
|
95
|
+
documentId: string;
|
|
96
|
+
name: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
sortOrder: number;
|
|
99
|
+
picture?: Picture;
|
|
100
|
+
meals?: Meal[];
|
|
101
|
+
}
|
|
102
|
+
interface Variant {
|
|
103
|
+
id: number;
|
|
104
|
+
documentId: string;
|
|
105
|
+
name: string;
|
|
106
|
+
description?: string;
|
|
107
|
+
pictures?: Picture[];
|
|
108
|
+
categories?: Category[];
|
|
109
|
+
}
|
|
110
|
+
interface Menu {
|
|
111
|
+
id: number;
|
|
112
|
+
documentId: string;
|
|
113
|
+
name: string;
|
|
114
|
+
description?: string;
|
|
115
|
+
variants?: Variant[];
|
|
116
|
+
activeVariant?: Variant;
|
|
117
|
+
}
|
|
118
|
+
type CreateMenuInput = Pick<Menu, 'name'> & Partial<Pick<Menu, 'description'>>;
|
|
119
|
+
type UpdateMenuInput = Partial<Pick<Menu, 'name' | 'description'>>;
|
|
120
|
+
type CreateVariantInput = Pick<Variant, 'name'> & Partial<Pick<Variant, 'description'>> & {
|
|
121
|
+
menu: string;
|
|
122
|
+
};
|
|
123
|
+
type UpdateVariantInput = Partial<Pick<Variant, 'name' | 'description'>>;
|
|
124
|
+
type CreateCategoryInput = Pick<Category, 'name'> & Partial<Pick<Category, 'description'>> & {
|
|
125
|
+
variant: string;
|
|
126
|
+
};
|
|
127
|
+
type UpdateCategoryInput = Partial<Pick<Category, 'name' | 'description' | 'sortOrder'>>;
|
|
128
|
+
type CreateMealInput = Pick<Meal, 'name' | 'description' | 'price'> & {
|
|
129
|
+
category: string;
|
|
130
|
+
available?: boolean;
|
|
131
|
+
show?: boolean;
|
|
132
|
+
sauces?: Sauce[];
|
|
133
|
+
sides?: Side[];
|
|
134
|
+
fields?: Field[];
|
|
135
|
+
allergens?: number[];
|
|
136
|
+
};
|
|
137
|
+
type UpdateMealInput = Partial<Omit<Meal, 'id' | 'documentId' | 'pictures'>>;
|
|
138
|
+
interface Customer {
|
|
139
|
+
documentId: string;
|
|
140
|
+
phone?: string;
|
|
141
|
+
email?: string;
|
|
142
|
+
name?: string;
|
|
143
|
+
locale?: string;
|
|
144
|
+
lastSeenAt?: string;
|
|
145
|
+
metadata?: Record<string, any>;
|
|
146
|
+
}
|
|
147
|
+
type UpdateCustomerInput = Partial<Pick<Customer, 'name' | 'locale'>>;
|
|
148
|
+
type OrderStatus = 'pending' | 'confirmed' | 'preparing' | 'ready' | 'completed' | 'cancelled';
|
|
149
|
+
type OrderType = 'dine-in' | 'takeaway';
|
|
150
|
+
interface OrderItem {
|
|
151
|
+
mealDocumentId: string;
|
|
152
|
+
mealName: string;
|
|
153
|
+
quantity: number;
|
|
154
|
+
unitPrice: number;
|
|
155
|
+
totalPrice: number;
|
|
156
|
+
selectedSauces?: string[];
|
|
157
|
+
selectedSides?: string[];
|
|
158
|
+
specialInstructions?: string;
|
|
159
|
+
}
|
|
160
|
+
interface Order {
|
|
161
|
+
documentId: string;
|
|
162
|
+
orderNumber: string;
|
|
163
|
+
status: OrderStatus;
|
|
164
|
+
type: OrderType;
|
|
165
|
+
tableNumber?: string;
|
|
166
|
+
customer?: Customer;
|
|
167
|
+
items: OrderItem[];
|
|
168
|
+
subtotal: number;
|
|
169
|
+
discount?: number;
|
|
170
|
+
discountLabel?: string;
|
|
171
|
+
rewardIndex?: number;
|
|
172
|
+
tax: number;
|
|
173
|
+
total: number;
|
|
174
|
+
notes?: string;
|
|
175
|
+
estimatedReadyAt?: string;
|
|
176
|
+
confirmedAt?: string;
|
|
177
|
+
completedAt?: string;
|
|
178
|
+
cancelledAt?: string;
|
|
179
|
+
cancelReason?: string;
|
|
180
|
+
createdAt: string;
|
|
181
|
+
}
|
|
182
|
+
interface CreateOrderInput {
|
|
183
|
+
items: Array<{
|
|
184
|
+
mealDocumentId: string;
|
|
185
|
+
quantity: number;
|
|
186
|
+
selectedSauces?: string[];
|
|
187
|
+
selectedSides?: string[];
|
|
188
|
+
specialInstructions?: string;
|
|
189
|
+
}>;
|
|
190
|
+
type: OrderType;
|
|
191
|
+
tableNumber?: string;
|
|
192
|
+
notes?: string;
|
|
193
|
+
rewardIndex?: number;
|
|
194
|
+
}
|
|
195
|
+
interface OrderSettings {
|
|
196
|
+
orderingEnabled: boolean;
|
|
197
|
+
takeawayEnabled: boolean;
|
|
198
|
+
dineInEnabled: boolean;
|
|
199
|
+
taxRate: number;
|
|
200
|
+
estimatedPrepMinutes: number;
|
|
201
|
+
autoConfirm: boolean;
|
|
202
|
+
maxActiveOrders: number;
|
|
203
|
+
}
|
|
204
|
+
interface PublicOrderSettings {
|
|
205
|
+
orderingEnabled: boolean;
|
|
206
|
+
takeawayEnabled: boolean;
|
|
207
|
+
dineInEnabled: boolean;
|
|
208
|
+
estimatedPrepMinutes: number;
|
|
209
|
+
}
|
|
210
|
+
type PaymentStatus = 'pending' | 'processing' | 'succeeded' | 'failed' | 'refunded' | 'partially_refunded';
|
|
211
|
+
interface Payment {
|
|
212
|
+
documentId: string;
|
|
213
|
+
stripePaymentIntentId: string;
|
|
214
|
+
stripeClientSecret?: string;
|
|
215
|
+
status: PaymentStatus;
|
|
216
|
+
amount: number;
|
|
217
|
+
currency: string;
|
|
218
|
+
refundedAmount: number;
|
|
219
|
+
metadata?: Record<string, any>;
|
|
220
|
+
failureMessage?: string;
|
|
221
|
+
order?: Order;
|
|
222
|
+
}
|
|
223
|
+
type LoyaltyTier = 'bronze' | 'silver' | 'gold';
|
|
224
|
+
interface LoyaltyReward {
|
|
225
|
+
name: string;
|
|
226
|
+
description?: string;
|
|
227
|
+
pointsCost: number;
|
|
228
|
+
type: 'free-item' | 'discount-percent' | 'discount-fixed';
|
|
229
|
+
value?: number;
|
|
230
|
+
mealDocumentId?: string;
|
|
231
|
+
active: boolean;
|
|
232
|
+
}
|
|
233
|
+
interface LoyaltyProgram {
|
|
234
|
+
enabled: boolean;
|
|
235
|
+
pointsPerEuro: number;
|
|
236
|
+
rewards?: LoyaltyReward[];
|
|
237
|
+
}
|
|
238
|
+
interface LoyaltyAccount {
|
|
239
|
+
documentId: string;
|
|
240
|
+
customer?: Customer;
|
|
241
|
+
points: number;
|
|
242
|
+
totalPointsEarned: number;
|
|
243
|
+
totalPointsRedeemed: number;
|
|
244
|
+
tier: LoyaltyTier;
|
|
245
|
+
}
|
|
246
|
+
interface LoyaltyTransaction {
|
|
247
|
+
documentId: string;
|
|
248
|
+
type: 'earn' | 'redeem' | 'adjust' | 'expire';
|
|
249
|
+
points: number;
|
|
250
|
+
description?: string;
|
|
251
|
+
orderDocumentId?: string;
|
|
252
|
+
rewardDocumentId?: string;
|
|
253
|
+
createdAt: string;
|
|
254
|
+
}
|
|
255
|
+
interface Address {
|
|
256
|
+
street: string;
|
|
257
|
+
city: string;
|
|
258
|
+
postalCode: string;
|
|
259
|
+
country: string;
|
|
260
|
+
lat?: number;
|
|
261
|
+
lng?: number;
|
|
262
|
+
}
|
|
263
|
+
interface SocialLink {
|
|
264
|
+
platform: string;
|
|
265
|
+
url: string;
|
|
266
|
+
}
|
|
267
|
+
interface TimeSlot {
|
|
268
|
+
dayOfWeek: number;
|
|
269
|
+
openTime: string;
|
|
270
|
+
closeTime: string;
|
|
271
|
+
label?: string;
|
|
272
|
+
}
|
|
273
|
+
interface Closure {
|
|
274
|
+
date: string;
|
|
275
|
+
reason?: string;
|
|
276
|
+
}
|
|
277
|
+
interface RestaurantInfo {
|
|
278
|
+
name: string;
|
|
279
|
+
description?: string;
|
|
280
|
+
logo?: Picture;
|
|
281
|
+
coverImage?: Picture;
|
|
282
|
+
phone?: string;
|
|
283
|
+
email?: string;
|
|
284
|
+
website?: string;
|
|
285
|
+
address?: Address;
|
|
286
|
+
socialLinks?: SocialLink[];
|
|
287
|
+
timezone: string;
|
|
288
|
+
currency: string;
|
|
289
|
+
locale: string;
|
|
290
|
+
}
|
|
291
|
+
interface OpeningHours {
|
|
292
|
+
slots?: TimeSlot[];
|
|
293
|
+
specialClosures?: Closure[];
|
|
294
|
+
}
|
|
295
|
+
interface RestaurantStatus {
|
|
296
|
+
isOpen: boolean;
|
|
297
|
+
closureReason?: string;
|
|
298
|
+
todaySlots: Array<{
|
|
299
|
+
openTime: string;
|
|
300
|
+
closeTime: string;
|
|
301
|
+
}>;
|
|
302
|
+
nextOpenSlot?: {
|
|
303
|
+
dayOfWeek: number;
|
|
304
|
+
openTime: string;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
interface Theme {
|
|
308
|
+
primaryColor: string;
|
|
309
|
+
accentColor: string;
|
|
310
|
+
fontFamily: string;
|
|
311
|
+
darkMode: boolean;
|
|
312
|
+
favicon?: Picture;
|
|
313
|
+
customCSS?: string;
|
|
314
|
+
}
|
|
315
|
+
interface BlogArticle {
|
|
316
|
+
documentId: string;
|
|
317
|
+
title: string;
|
|
318
|
+
slug: string;
|
|
319
|
+
excerpt?: string;
|
|
320
|
+
content?: string;
|
|
321
|
+
coverImage?: Picture;
|
|
322
|
+
published: boolean;
|
|
323
|
+
featured: boolean;
|
|
324
|
+
category?: BlogCategory;
|
|
325
|
+
tags?: string[];
|
|
326
|
+
authorName?: string;
|
|
327
|
+
readingTime?: number;
|
|
328
|
+
publishDate?: string;
|
|
329
|
+
seo?: {
|
|
330
|
+
metaTitle?: string;
|
|
331
|
+
metaDescription?: string;
|
|
332
|
+
metaKeywords?: string;
|
|
333
|
+
};
|
|
334
|
+
createdAt: string;
|
|
335
|
+
updatedAt: string;
|
|
336
|
+
}
|
|
337
|
+
interface BlogCategory {
|
|
338
|
+
documentId: string;
|
|
339
|
+
name: string;
|
|
340
|
+
slug: string;
|
|
341
|
+
description?: string;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
declare class MenuNamespace {
|
|
345
|
+
private client;
|
|
346
|
+
constructor(client: BaseClient);
|
|
347
|
+
getMenus(locale?: string): Promise<Menu[]>;
|
|
348
|
+
getMenu(documentId: string, options?: {
|
|
349
|
+
populate?: string;
|
|
350
|
+
locale?: string;
|
|
351
|
+
}): Promise<Menu>;
|
|
352
|
+
createMenu(data: CreateMenuInput, locale?: string): Promise<Menu>;
|
|
353
|
+
updateMenu(documentId: string, data: UpdateMenuInput, locale?: string): Promise<Menu>;
|
|
354
|
+
deleteMenu(documentId: string): Promise<void>;
|
|
355
|
+
getVariants(menuDocumentId: string, locale?: string): Promise<Variant[]>;
|
|
356
|
+
getActiveVariant(menuDocumentId: string, locale?: string): Promise<Variant>;
|
|
357
|
+
setActiveVariant(menuDocumentId: string, variantDocumentId: string): Promise<void>;
|
|
358
|
+
createVariant(data: CreateVariantInput, locale?: string): Promise<Variant>;
|
|
359
|
+
updateVariant(documentId: string, data: UpdateVariantInput, locale?: string): Promise<Variant>;
|
|
360
|
+
deleteVariant(documentId: string): Promise<void>;
|
|
361
|
+
createCategory(data: CreateCategoryInput, locale?: string): Promise<Category>;
|
|
362
|
+
updateCategory(documentId: string, data: UpdateCategoryInput, locale?: string): Promise<Category>;
|
|
363
|
+
deleteCategory(documentId: string): Promise<void>;
|
|
364
|
+
sortCategories(variantDocumentId: string, sortedCategoryIds: string[]): Promise<void>;
|
|
365
|
+
createMeal(data: CreateMealInput, locale?: string): Promise<Meal>;
|
|
366
|
+
updateMeal(documentId: string, data: UpdateMealInput, locale?: string): Promise<Meal>;
|
|
367
|
+
deleteMeal(documentId: string): Promise<void>;
|
|
368
|
+
sortMeals(categoryDocumentId: string, sortedMealIds: string[]): Promise<void>;
|
|
369
|
+
uploadPicture(file: File | Blob, ref: string, refId: string, field: string): Promise<Picture[]>;
|
|
370
|
+
deletePicture(pictureId: number): Promise<void>;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
declare class RestaurantNamespace {
|
|
374
|
+
private client;
|
|
375
|
+
constructor(client: BaseClient);
|
|
376
|
+
getInfo(locale?: string): Promise<RestaurantInfo>;
|
|
377
|
+
updateInfo(data: Partial<RestaurantInfo>, locale?: string): Promise<RestaurantInfo>;
|
|
378
|
+
getHours(): Promise<OpeningHours>;
|
|
379
|
+
getStatus(): Promise<RestaurantStatus>;
|
|
380
|
+
updateHours(data: Partial<OpeningHours>): Promise<OpeningHours>;
|
|
381
|
+
getTheme(): Promise<Theme>;
|
|
382
|
+
updateTheme(data: Partial<Theme>): Promise<Theme>;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
declare class CustomerNamespace {
|
|
386
|
+
private client;
|
|
387
|
+
constructor(client: BaseClient);
|
|
388
|
+
requestOtp(phone: string): Promise<{
|
|
389
|
+
message: string;
|
|
390
|
+
}>;
|
|
391
|
+
verifyOtp(phone: string, code: string): Promise<{
|
|
392
|
+
token: string;
|
|
393
|
+
customer: Customer;
|
|
394
|
+
}>;
|
|
395
|
+
requestEmailOtp(email: string): Promise<{
|
|
396
|
+
message: string;
|
|
397
|
+
}>;
|
|
398
|
+
verifyEmailOtp(email: string, code: string): Promise<{
|
|
399
|
+
token: string;
|
|
400
|
+
customer: Customer;
|
|
401
|
+
}>;
|
|
402
|
+
getMe(): Promise<Customer>;
|
|
403
|
+
updateMe(data: UpdateCustomerInput): Promise<Customer>;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
declare class OrderingNamespace {
|
|
407
|
+
private client;
|
|
408
|
+
constructor(client: BaseClient);
|
|
409
|
+
createOrder(data: CreateOrderInput): Promise<Order>;
|
|
410
|
+
getMyOrders(): Promise<Order[]>;
|
|
411
|
+
getMyOrder(documentId: string): Promise<Order>;
|
|
412
|
+
cancelOrder(documentId: string, reason?: string): Promise<Order>;
|
|
413
|
+
getOrders(query?: Record<string, unknown>): Promise<Order[]>;
|
|
414
|
+
getOrder(documentId: string): Promise<Order>;
|
|
415
|
+
updateOrderStatus(documentId: string, status: OrderStatus): Promise<Order>;
|
|
416
|
+
getActiveOrders(): Promise<Order[]>;
|
|
417
|
+
getPublicOrderSettings(): Promise<PublicOrderSettings>;
|
|
418
|
+
getOrderSettings(): Promise<OrderSettings>;
|
|
419
|
+
updateOrderSettings(data: Partial<OrderSettings>): Promise<OrderSettings>;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
declare class PaymentNamespace {
|
|
423
|
+
private client;
|
|
424
|
+
constructor(client: BaseClient);
|
|
425
|
+
createPaymentIntent(orderDocumentId: string): Promise<{
|
|
426
|
+
clientSecret: string;
|
|
427
|
+
paymentId: string;
|
|
428
|
+
}>;
|
|
429
|
+
getPayment(documentId: string): Promise<Payment>;
|
|
430
|
+
refundPayment(documentId: string, amount?: number): Promise<Payment>;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
declare class LoyaltyNamespace {
|
|
434
|
+
private client;
|
|
435
|
+
constructor(client: BaseClient);
|
|
436
|
+
getMyAccount(): Promise<LoyaltyAccount>;
|
|
437
|
+
getMyTransactions(): Promise<LoyaltyTransaction[]>;
|
|
438
|
+
redeemReward(rewardIndex: number): Promise<LoyaltyTransaction>;
|
|
439
|
+
getProgram(): Promise<LoyaltyProgram>;
|
|
440
|
+
getAccounts(): Promise<LoyaltyAccount[]>;
|
|
441
|
+
adjustPoints(accountDocumentId: string, points: number, description: string): Promise<LoyaltyTransaction>;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
declare class BlogNamespace {
|
|
445
|
+
private client;
|
|
446
|
+
constructor(client: BaseClient);
|
|
447
|
+
getArticles(options?: {
|
|
448
|
+
category?: string;
|
|
449
|
+
tag?: string;
|
|
450
|
+
featured?: boolean;
|
|
451
|
+
page?: number;
|
|
452
|
+
pageSize?: number;
|
|
453
|
+
locale?: string;
|
|
454
|
+
}): Promise<BlogArticle[]>;
|
|
455
|
+
getArticle(slug: string, locale?: string): Promise<BlogArticle>;
|
|
456
|
+
getCategories(locale?: string): Promise<BlogCategory[]>;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
declare class BestrawClient extends BaseClient {
|
|
460
|
+
readonly menu: MenuNamespace;
|
|
461
|
+
readonly restaurant: RestaurantNamespace;
|
|
462
|
+
readonly customer: CustomerNamespace;
|
|
463
|
+
readonly ordering: OrderingNamespace;
|
|
464
|
+
readonly payment: PaymentNamespace;
|
|
465
|
+
readonly loyalty: LoyaltyNamespace;
|
|
466
|
+
readonly blog: BlogNamespace;
|
|
467
|
+
constructor(config: BestrawConfig);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
declare const ErrorCode: {
|
|
471
|
+
readonly UNKNOWN: "UNKNOWN";
|
|
472
|
+
readonly NETWORK_ERROR: "NETWORK_ERROR";
|
|
473
|
+
readonly AUTH_REQUIRED: "AUTH_REQUIRED";
|
|
474
|
+
readonly INVALID_PHONE: "INVALID_PHONE";
|
|
475
|
+
readonly INVALID_EMAIL: "INVALID_EMAIL";
|
|
476
|
+
readonly NO_ACTIVE_SESSION: "NO_ACTIVE_SESSION";
|
|
477
|
+
readonly OTP_EXPIRED: "OTP_EXPIRED";
|
|
478
|
+
readonly OTP_TOO_MANY_ATTEMPTS: "OTP_TOO_MANY_ATTEMPTS";
|
|
479
|
+
readonly OTP_INVALID: "OTP_INVALID";
|
|
480
|
+
readonly INVALID_TOKEN: "INVALID_TOKEN";
|
|
481
|
+
readonly ORDER_DISABLED: "ORDER_DISABLED";
|
|
482
|
+
readonly TAKEAWAY_DISABLED: "TAKEAWAY_DISABLED";
|
|
483
|
+
readonly DINEIN_DISABLED: "DINEIN_DISABLED";
|
|
484
|
+
readonly MAX_ORDERS_REACHED: "MAX_ORDERS_REACHED";
|
|
485
|
+
readonly EMPTY_ORDER: "EMPTY_ORDER";
|
|
486
|
+
readonly MEAL_NOT_FOUND: "MEAL_NOT_FOUND";
|
|
487
|
+
readonly MEAL_UNAVAILABLE: "MEAL_UNAVAILABLE";
|
|
488
|
+
readonly ORDER_NOT_FOUND: "ORDER_NOT_FOUND";
|
|
489
|
+
readonly INVALID_STATUS_TRANSITION: "INVALID_STATUS_TRANSITION";
|
|
490
|
+
readonly CANNOT_CANCEL_ORDER: "CANNOT_CANCEL_ORDER";
|
|
491
|
+
readonly PAYMENT_ORDER_NOT_FOUND: "PAYMENT_ORDER_NOT_FOUND";
|
|
492
|
+
readonly PAYMENT_INVALID_ORDER_STATUS: "PAYMENT_INVALID_ORDER_STATUS";
|
|
493
|
+
readonly PAYMENT_NOT_FOUND: "PAYMENT_NOT_FOUND";
|
|
494
|
+
readonly PAYMENT_CANNOT_REFUND: "PAYMENT_CANNOT_REFUND";
|
|
495
|
+
readonly PAYMENT_FAILED: "PAYMENT_FAILED";
|
|
496
|
+
readonly LOYALTY_ACCOUNT_NOT_FOUND: "LOYALTY_ACCOUNT_NOT_FOUND";
|
|
497
|
+
readonly REWARD_NOT_FOUND: "REWARD_NOT_FOUND";
|
|
498
|
+
readonly REWARD_INACTIVE: "REWARD_INACTIVE";
|
|
499
|
+
readonly NOT_ENOUGH_POINTS: "NOT_ENOUGH_POINTS";
|
|
500
|
+
};
|
|
501
|
+
type ErrorCodeValue = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
502
|
+
declare class AppError extends Error {
|
|
503
|
+
readonly code: ErrorCodeValue;
|
|
504
|
+
readonly statusCode: number;
|
|
505
|
+
readonly meta?: Record<string, unknown>;
|
|
506
|
+
constructor(code: ErrorCodeValue, statusCode: number, message: string, meta?: Record<string, unknown>);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
export { type Address, AppError, BaseClient, BestrawClient, type BestrawConfig, BestrawError, type BlogArticle, type BlogCategory, BlogNamespace, type Category, type Closure, type CreateCategoryInput, type CreateMealInput, type CreateMenuInput, type CreateOrderInput, type CreateVariantInput, type Customer, CustomerNamespace, ErrorCode, type ErrorCodeValue, type Field, type LoyaltyAccount, LoyaltyNamespace, type LoyaltyProgram, type LoyaltyReward, type LoyaltyTier, type LoyaltyTransaction, type Meal, type Menu, MenuNamespace, type OpeningHours, type Order, type OrderItem, type OrderSettings, type OrderStatus, type OrderType, OrderingNamespace, type Payment, PaymentNamespace, type PaymentStatus, type Picture, type PublicOrderSettings, type RestaurantInfo, RestaurantNamespace, type RestaurantStatus, type Sauce, type Side, type SocialLink, type StrapiListResponse, type StrapiResponse, type Theme, type TimeSlot, type UpdateCategoryInput, type UpdateCustomerInput, type UpdateMealInput, type UpdateMenuInput, type UpdateVariantInput, type Variant };
|