@wix/table-reservations 1.0.118 → 1.0.119
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/package.json +5 -5
- package/type-bundles/context.bundle.d.ts +294 -58
- package/type-bundles/index.bundle.d.ts +294 -58
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/table-reservations",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.119",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"type-bundles"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@wix/table-reservations_reservation-locations": "1.0.
|
|
22
|
-
"@wix/table-reservations_reservations": "1.0.
|
|
23
|
-
"@wix/table-reservations_time-slots": "1.0.
|
|
21
|
+
"@wix/table-reservations_reservation-locations": "1.0.41",
|
|
22
|
+
"@wix/table-reservations_reservations": "1.0.37",
|
|
23
|
+
"@wix/table-reservations_time-slots": "1.0.39"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"glob": "^10.4.1",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"fqdn": ""
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
"falconPackageHash": "
|
|
48
|
+
"falconPackageHash": "ee219035473bc54f3047debfe407f36873031fc5ac43ad3b45bce872"
|
|
49
49
|
}
|
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2
|
+
interface HttpClient {
|
|
3
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
4
|
+
fetchWithAuth: typeof fetch;
|
|
5
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
6
|
+
}
|
|
7
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
8
|
+
type HttpResponse<T = any> = {
|
|
9
|
+
data: T;
|
|
10
|
+
status: number;
|
|
11
|
+
statusText: string;
|
|
12
|
+
headers: any;
|
|
13
|
+
request?: any;
|
|
14
|
+
};
|
|
15
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
16
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
17
|
+
url: string;
|
|
18
|
+
data?: Data;
|
|
19
|
+
params?: URLSearchParams;
|
|
20
|
+
} & APIMetadata;
|
|
21
|
+
type APIMetadata = {
|
|
22
|
+
methodFqn?: string;
|
|
23
|
+
entityFqdn?: string;
|
|
24
|
+
packageName?: string;
|
|
25
|
+
};
|
|
26
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
27
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
28
|
+
__type: 'event-definition';
|
|
29
|
+
type: Type;
|
|
30
|
+
isDomainEvent?: boolean;
|
|
31
|
+
transformations?: (envelope: unknown) => Payload;
|
|
32
|
+
__payload: Payload;
|
|
33
|
+
};
|
|
34
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
35
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
36
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
37
|
+
|
|
38
|
+
declare global {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
40
|
+
interface SymbolConstructor {
|
|
41
|
+
readonly observable: symbol;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
1
45
|
/** The reservation domain object. */
|
|
2
46
|
interface Reservation {
|
|
3
47
|
/**
|
|
@@ -1412,60 +1456,159 @@ interface ReservationsQueryBuilder {
|
|
|
1412
1456
|
find: () => Promise<ReservationsQueryResult>;
|
|
1413
1457
|
}
|
|
1414
1458
|
|
|
1415
|
-
|
|
1416
|
-
interface
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1459
|
+
declare function createReservation$1(httpClient: HttpClient): CreateReservationSignature;
|
|
1460
|
+
interface CreateReservationSignature {
|
|
1461
|
+
/**
|
|
1462
|
+
* Creates a new reservation.
|
|
1463
|
+
*
|
|
1464
|
+
* `createReservation()` accepts and requires different fields depending on the `status` provided and your permissions.
|
|
1465
|
+
*
|
|
1466
|
+
* **Status and source**
|
|
1467
|
+
*
|
|
1468
|
+
* If a `status` is not provided, it will be set to:
|
|
1469
|
+
* * `RESERVED` if manual approval is not required for confirmation
|
|
1470
|
+
* * `REQUESTED` if manual approval is required for confirmation.
|
|
1471
|
+
*
|
|
1472
|
+
* A reservation created with any `source` other than `WALK_IN` requires the `reservation.reservee.phone` and `reservation.reservee.firstName` fields.
|
|
1473
|
+
* Attempting to create a reservation without these fields will result in an error.
|
|
1474
|
+
*
|
|
1475
|
+
* **Permissions**
|
|
1476
|
+
*
|
|
1477
|
+
* Including the fields `status`, `source`, `reservation.details.tableIds`, `reservation.details.endDate`, `ignoreReservationLocationConflicts`, or `ignoreTableCombinationConflicts` in the request requires additional permissions. See this API's Introduction article for more information.
|
|
1478
|
+
*
|
|
1479
|
+
* If `source` is not provided, its value is set depending on the permissions of the user making the call. See this API's Introduction article for more information.
|
|
1480
|
+
*
|
|
1481
|
+
*
|
|
1482
|
+
* > **Note:** `createReservation()` requires all details of the reservation upfront. The process of creating a reservation can be broken up using `createHeldReservation`. `createHeldReservation` creates a temporary reservation that expires automatically unless it is completed with the addition of more details using `reserveReservation()`.
|
|
1483
|
+
* @param - Reservation details.
|
|
1484
|
+
* @param - Options for creating the reservation.
|
|
1485
|
+
* @returns Reservation.
|
|
1486
|
+
*/
|
|
1487
|
+
(reservation: Reservation, options?: CreateReservationOptions | undefined): Promise<Reservation & ReservationNonNullableFields>;
|
|
1420
1488
|
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1489
|
+
declare function getReservation$1(httpClient: HttpClient): GetReservationSignature;
|
|
1490
|
+
interface GetReservationSignature {
|
|
1491
|
+
/**
|
|
1492
|
+
* Retrieves a reservation.
|
|
1493
|
+
*
|
|
1494
|
+
* Calling this method with `fieldsets` set to `FULL` requires additional permissions. See this API's Introduction article for more information.
|
|
1495
|
+
* @param - Reservation ID.
|
|
1496
|
+
* @returns Reservation.
|
|
1497
|
+
*/
|
|
1498
|
+
(reservationId: string, options?: GetReservationOptions | undefined): Promise<Reservation & ReservationNonNullableFields>;
|
|
1499
|
+
}
|
|
1500
|
+
declare function updateReservation$1(httpClient: HttpClient): UpdateReservationSignature;
|
|
1501
|
+
interface UpdateReservationSignature {
|
|
1502
|
+
/**
|
|
1503
|
+
* Updates a reservation.
|
|
1504
|
+
*
|
|
1505
|
+
* Including the fields `status`, `source`, `reservation.details.tableIds`, `reservation.details.endDate`, `ignoreReservationLocationConflicts`, and `ignoreTableCombinationConflicts` in the request requires additional permissions. See this API's Introduction article for more information.
|
|
1506
|
+
*
|
|
1507
|
+
* Each time the reservation is updated, revision increments by 1. The existing revision must be included when updating the reservation. This ensures you're working with the latest reservation information, and it prevents unintended overwrites.
|
|
1508
|
+
* @param - Reservation ID.
|
|
1509
|
+
* @param - Options for updating the reservation.
|
|
1510
|
+
* @param - Reservation information to update.
|
|
1511
|
+
* @returns Reservation.
|
|
1512
|
+
*/
|
|
1513
|
+
(_id: string | null, reservation: UpdateReservation, options?: UpdateReservationOptions | undefined): Promise<Reservation & ReservationNonNullableFields>;
|
|
1514
|
+
}
|
|
1515
|
+
declare function createHeldReservation$1(httpClient: HttpClient): CreateHeldReservationSignature;
|
|
1516
|
+
interface CreateHeldReservationSignature {
|
|
1517
|
+
/**
|
|
1518
|
+
* Creates a new temporary reservation and holds it for the customer for 10 minutes.
|
|
1519
|
+
*
|
|
1520
|
+
* Creates a new reservation with the `HELD` status. `HELD` reservations are intended to reserve seats and tables for a party in a selected time slot while they enter further reservation details, such as names and contact information. Reservations with the `HELD` status are only valid for 10 minutes. Trying to change a `HELD` reservation’s status after 10 minutes returns an error.
|
|
1521
|
+
*
|
|
1522
|
+
* You cannot call `updateReservation()` to change a reservation’s status from `HELD`. Trying to do so returns an error. Instead, you should use `reserveReservation()`.
|
|
1523
|
+
*
|
|
1524
|
+
* If you do not wish to have `HELD` reservations in your flow, you can create a reservation with all required details using `createReservation()`.
|
|
1525
|
+
*
|
|
1526
|
+
* @param - Held reservation information to update.
|
|
1527
|
+
*/
|
|
1528
|
+
(reservationDetails: HeldReservationDetails): Promise<CreateHeldReservationResponse & CreateHeldReservationResponseNonNullableFields>;
|
|
1529
|
+
}
|
|
1530
|
+
declare function reserveReservation$1(httpClient: HttpClient): ReserveReservationSignature;
|
|
1531
|
+
interface ReserveReservationSignature {
|
|
1532
|
+
/**
|
|
1533
|
+
* Reserves or requests a held reservation.
|
|
1534
|
+
*
|
|
1535
|
+
* Held reservations are temporary reservations with the `HELD` status created by `createHeldReservation()`.
|
|
1536
|
+
*
|
|
1537
|
+
* They are intended to reserve seats and tables for a party in a selected time slot while they enter further reservation details, such as names and contact information. Reservations with the `HELD` status are only valid for 10 minutes. Trying to call `Reserve Reservation` with a held reservation older than 10 minutes returns an error.
|
|
1538
|
+
*
|
|
1539
|
+
* `Reserve Reservation` changes a reservation's `HELD` status to:
|
|
1540
|
+
* * `RESERVED` if the reservation's reservation location does not require manual approval.
|
|
1541
|
+
* * `REQUESTED` if the reservation's reservation location requires manual approval.
|
|
1542
|
+
* @param - Reservation ID.
|
|
1543
|
+
* @param - Reservee details.
|
|
1544
|
+
* @param - Revision number.
|
|
1545
|
+
*
|
|
1546
|
+
* Include the existing `revision` to prevent conflicting updates to reservations.
|
|
1547
|
+
*/
|
|
1548
|
+
(reservationId: string, reservee: Reservee, revision: string | null): Promise<ReserveReservationResponse & ReserveReservationResponseNonNullableFields>;
|
|
1549
|
+
}
|
|
1550
|
+
declare function cancelReservation$1(httpClient: HttpClient): CancelReservationSignature;
|
|
1551
|
+
interface CancelReservationSignature {
|
|
1552
|
+
/**
|
|
1553
|
+
* Cancels a reservation.
|
|
1554
|
+
*
|
|
1555
|
+
* Sets the reservation status to `CANCELED`.
|
|
1556
|
+
* @param - Reservation ID.
|
|
1557
|
+
* @param - Revision number.
|
|
1558
|
+
*
|
|
1559
|
+
* Include the existing `revision` to prevent conflicting updates to reservations.
|
|
1560
|
+
* @param - Options for canceling the reservation.
|
|
1561
|
+
*/
|
|
1562
|
+
(reservationId: string, revision: string | null, options?: CancelReservationOptions | undefined): Promise<CancelReservationResponse & CancelReservationResponseNonNullableFields>;
|
|
1563
|
+
}
|
|
1564
|
+
declare function deleteReservation$1(httpClient: HttpClient): DeleteReservationSignature;
|
|
1565
|
+
interface DeleteReservationSignature {
|
|
1566
|
+
/**
|
|
1567
|
+
* Deletes a reservation. Only reservations with the `HELD` status can be deleted.
|
|
1568
|
+
* @param - Reservation ID.
|
|
1569
|
+
*/
|
|
1570
|
+
(reservationId: string): Promise<void>;
|
|
1571
|
+
}
|
|
1572
|
+
declare function listReservations$1(httpClient: HttpClient): ListReservationsSignature;
|
|
1573
|
+
interface ListReservationsSignature {
|
|
1574
|
+
/**
|
|
1575
|
+
* Retrieves a list of up to 100 reservations.
|
|
1576
|
+
* @param - Options for listing the reservations.
|
|
1577
|
+
*/
|
|
1578
|
+
(options?: ListReservationsOptions | undefined): Promise<ListReservationsResponse & ListReservationsResponseNonNullableFields>;
|
|
1579
|
+
}
|
|
1580
|
+
declare function queryReservations$1(httpClient: HttpClient): QueryReservationsSignature;
|
|
1581
|
+
interface QueryReservationsSignature {
|
|
1582
|
+
/**
|
|
1583
|
+
* Creates a query to retrieve a list of reservations.
|
|
1584
|
+
*
|
|
1585
|
+
* The `queryReservations()` function builds a query to retrieve a list of reservations and returns a [`ReservationsQueryBuilder`](/reservations/reservations-query-builder) object.
|
|
1586
|
+
*
|
|
1587
|
+
* The returned object contains the query definition, which is used to run the query using the [find()](/reservations/reservations-query-builder/find) function.
|
|
1588
|
+
*
|
|
1589
|
+
* You can refine the query by chaining `ReservationsQueryBuilder` functions onto the query. `ReservationsQueryBuilder` functions enable you to filter, sort, and control the results that `queryReservations()` returns.
|
|
1590
|
+
*
|
|
1591
|
+
* `queryReservations()` runs with the following `ReservationsQueryBuilder` defaults, which you can override:
|
|
1592
|
+
*
|
|
1593
|
+
* * [`skip(0)`](/reservations/reservations-query-builder/skip)
|
|
1594
|
+
* * [`limit(50)`](/reservations/reservations-query-builder/limit)
|
|
1595
|
+
* * [`descending('_createdDate')`](/reservations/reservations-query-builder/descending)
|
|
1596
|
+
*
|
|
1597
|
+
* The following `ReservationsQueryBuilder` functions are supported for `queryReservations()`. For a full description of the reservation object, see the object returned for the [`items`](/reservations/reservations-query-builder/items) property in [`ReservationsQueryResult`](/reservations/reservations-query-result).
|
|
1598
|
+
*/
|
|
1599
|
+
(): ReservationsQueryBuilder;
|
|
1600
|
+
}
|
|
1601
|
+
declare function searchReservations$1(httpClient: HttpClient): SearchReservationsSignature;
|
|
1602
|
+
interface SearchReservationsSignature {
|
|
1603
|
+
/**
|
|
1604
|
+
* Use this endpoint to search the fields of the table reservations on a site for a given expression.
|
|
1605
|
+
*
|
|
1606
|
+
* You can also use this endpoint to perform data aggregations on a site's table reservation fields.
|
|
1607
|
+
* For a detailed list of supported operations, see the [Sorting, Filtering, and Search](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/reservations/reservations/sorting-filtering-and-search) article.
|
|
1608
|
+
* @param - Search query.
|
|
1609
|
+
*/
|
|
1610
|
+
(search: CursorSearch): Promise<SearchReservationsResponse & SearchReservationsResponseNonNullableFields>;
|
|
1457
1611
|
}
|
|
1458
|
-
|
|
1459
|
-
declare function createReservation$1(httpClient: HttpClient): (reservation: Reservation, options?: CreateReservationOptions) => Promise<Reservation & ReservationNonNullableFields>;
|
|
1460
|
-
declare function getReservation$1(httpClient: HttpClient): (reservationId: string, options?: GetReservationOptions) => Promise<Reservation & ReservationNonNullableFields>;
|
|
1461
|
-
declare function updateReservation$1(httpClient: HttpClient): (_id: string | null, reservation: UpdateReservation, options?: UpdateReservationOptions) => Promise<Reservation & ReservationNonNullableFields>;
|
|
1462
|
-
declare function createHeldReservation$1(httpClient: HttpClient): (reservationDetails: HeldReservationDetails) => Promise<CreateHeldReservationResponse & CreateHeldReservationResponseNonNullableFields>;
|
|
1463
|
-
declare function reserveReservation$1(httpClient: HttpClient): (reservationId: string, reservee: Reservee, revision: string | null) => Promise<ReserveReservationResponse & ReserveReservationResponseNonNullableFields>;
|
|
1464
|
-
declare function cancelReservation$1(httpClient: HttpClient): (reservationId: string, revision: string | null, options?: CancelReservationOptions) => Promise<CancelReservationResponse & CancelReservationResponseNonNullableFields>;
|
|
1465
|
-
declare function deleteReservation$1(httpClient: HttpClient): (reservationId: string) => Promise<void>;
|
|
1466
|
-
declare function listReservations$1(httpClient: HttpClient): (options?: ListReservationsOptions) => Promise<ListReservationsResponse & ListReservationsResponseNonNullableFields>;
|
|
1467
|
-
declare function queryReservations$1(httpClient: HttpClient): () => ReservationsQueryBuilder;
|
|
1468
|
-
declare function searchReservations$1(httpClient: HttpClient): (search: CursorSearch) => Promise<SearchReservationsResponse & SearchReservationsResponseNonNullableFields>;
|
|
1469
1612
|
declare const onReservationCreated$1: EventDefinition<ReservationCreatedEnvelope, "wix.table_reservations.v1.reservation_created">;
|
|
1470
1613
|
|
|
1471
1614
|
declare function createRESTModule$2<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
@@ -1494,6 +1637,9 @@ type _publicSearchReservationsType = typeof searchReservations$1;
|
|
|
1494
1637
|
declare const searchReservations: ReturnType<typeof createRESTModule$2<_publicSearchReservationsType>>;
|
|
1495
1638
|
|
|
1496
1639
|
type _publicOnReservationCreatedType = typeof onReservationCreated$1;
|
|
1640
|
+
/**
|
|
1641
|
+
* Triggered when a held reservation is created.
|
|
1642
|
+
*/
|
|
1497
1643
|
declare const onReservationCreated: ReturnType<typeof createEventModule$1<_publicOnReservationCreatedType>>;
|
|
1498
1644
|
|
|
1499
1645
|
type context$2_Aggregation = Aggregation;
|
|
@@ -3779,10 +3925,65 @@ interface ListReservationLocationsOptions {
|
|
|
3779
3925
|
fieldsets?: Set[];
|
|
3780
3926
|
}
|
|
3781
3927
|
|
|
3782
|
-
declare function getReservationLocation$1(httpClient: HttpClient):
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3928
|
+
declare function getReservationLocation$1(httpClient: HttpClient): GetReservationLocationSignature;
|
|
3929
|
+
interface GetReservationLocationSignature {
|
|
3930
|
+
/**
|
|
3931
|
+
* Retrieves a reservation location by ID.
|
|
3932
|
+
*
|
|
3933
|
+
* The `FULL` fieldset can only be retrieved by users with the `READ RESERVATION LOCATIONS (FULL)` or `MANAGE RESERVATION LOCATIONS` permission scopes.
|
|
3934
|
+
* @param - ID of the ReservationLocation to retrieve.
|
|
3935
|
+
* @param - An object representing the available options for retrieving a reservation location.
|
|
3936
|
+
* @returns The retrieved reservation location.
|
|
3937
|
+
*/
|
|
3938
|
+
(reservationLocationId: string, options?: GetReservationLocationOptions | undefined): Promise<ReservationLocation & ReservationLocationNonNullableFields>;
|
|
3939
|
+
}
|
|
3940
|
+
declare function updateReservationLocation$1(httpClient: HttpClient): UpdateReservationLocationSignature;
|
|
3941
|
+
interface UpdateReservationLocationSignature {
|
|
3942
|
+
/**
|
|
3943
|
+
* Updates a reservation location. Supports partial updates.
|
|
3944
|
+
*
|
|
3945
|
+
* Each time the reservation location is updated, `revision` increments by 1. The existing revision must be included when updating the reservation location. This ensures you're working with the latest reservation location information, and it prevents unintended overwrites.
|
|
3946
|
+
*
|
|
3947
|
+
* You cannot use this endpoint to change a reservation location's `location` object. Attempting to do so will cause the server to return an application error.
|
|
3948
|
+
* @param - Reservation location ID.
|
|
3949
|
+
* @param - Reservation location information to update.
|
|
3950
|
+
* @returns The updated reservation location.
|
|
3951
|
+
*/
|
|
3952
|
+
(_id: string | null, reservationLocation: UpdateReservationLocation): Promise<ReservationLocation & ReservationLocationNonNullableFields>;
|
|
3953
|
+
}
|
|
3954
|
+
declare function queryReservationLocations$1(httpClient: HttpClient): QueryReservationLocationsSignature;
|
|
3955
|
+
interface QueryReservationLocationsSignature {
|
|
3956
|
+
/**
|
|
3957
|
+
* Creates a query to retrieve a list of reservation locations.
|
|
3958
|
+
*
|
|
3959
|
+
*
|
|
3960
|
+
* The `queryReservationLocations()` function builds a query to retrieve a list of reservation locations and returns a [`ReservationLocationsQueryBuilder`](/reservation-locations/reservation-locations-query-builder/) object.
|
|
3961
|
+
*
|
|
3962
|
+
* The returned object contains the query definition, which is used to run the query using the [find()](/reservation-locations/reservation-locations-query-builder/find) function.
|
|
3963
|
+
*
|
|
3964
|
+
* You can refine the query by chaining `ReservationLocationsQueryBuilder` functions onto the query. `ReservationLocationsQueryBuilder` functions enable you to filter, sort, and control the results that `queryReservationLocations()` returns.
|
|
3965
|
+
*
|
|
3966
|
+
* `queryReservationLocations()` runs with the following `ReservationLocationsQueryBuilder` defaults, which you can override:
|
|
3967
|
+
*
|
|
3968
|
+
* * [`skip(0)`](/reservation-locations/reservation-locations-query-builder/skip)
|
|
3969
|
+
* * [`limit(50)`](/reservation-locations/reservation-locations-query-builder/limit)
|
|
3970
|
+
* * [`descending('_createdDate')`](/reservation-locations/reservation-locations-query-builder/descending)
|
|
3971
|
+
*
|
|
3972
|
+
* The following `ReservationLocationsQueryBuilder` functions are supported for `queryReservationLocations()`. For a full description of the reservation location object, see the object returned for the [`items`](/reservation-locations/reservation-locations-query-result/items) property in [`ReservationLocationsQueryResult`](/reservation-locations/reservation-locations-query-result).
|
|
3973
|
+
* @param - An object representing the available options for querying reservation locations.
|
|
3974
|
+
*/
|
|
3975
|
+
(options?: QueryReservationLocationsOptions | undefined): ReservationLocationsQueryBuilder;
|
|
3976
|
+
}
|
|
3977
|
+
declare function listReservationLocations$1(httpClient: HttpClient): ListReservationLocationsSignature;
|
|
3978
|
+
interface ListReservationLocationsSignature {
|
|
3979
|
+
/**
|
|
3980
|
+
* Retrieves a list of up to 100 reservation locations.
|
|
3981
|
+
*
|
|
3982
|
+
* The `FULL` fieldset can only be retrieved by users with the `READ RESERVATION LOCATIONS (FULL)` or `MANAGE RESERVATION LOCATIONS` permission scopes.
|
|
3983
|
+
* @param - An object representing the available options for listing reservation locations.
|
|
3984
|
+
*/
|
|
3985
|
+
(options?: ListReservationLocationsOptions | undefined): Promise<ListReservationLocationsResponse & ListReservationLocationsResponseNonNullableFields>;
|
|
3986
|
+
}
|
|
3786
3987
|
declare const onReservationLocationUpdated$1: EventDefinition<ReservationLocationUpdatedEnvelope, "wix.table_reservations.v1.reservation_location_updated">;
|
|
3787
3988
|
declare const onReservationLocationCreated$1: EventDefinition<ReservationLocationCreatedEnvelope, "wix.table_reservations.v1.reservation_location_created">;
|
|
3788
3989
|
|
|
@@ -3800,9 +4001,15 @@ type _publicListReservationLocationsType = typeof listReservationLocations$1;
|
|
|
3800
4001
|
declare const listReservationLocations: ReturnType<typeof createRESTModule$1<_publicListReservationLocationsType>>;
|
|
3801
4002
|
|
|
3802
4003
|
type _publicOnReservationLocationUpdatedType = typeof onReservationLocationUpdated$1;
|
|
4004
|
+
/**
|
|
4005
|
+
* Triggered when a reservation location is updated.
|
|
4006
|
+
*/
|
|
3803
4007
|
declare const onReservationLocationUpdated: ReturnType<typeof createEventModule<_publicOnReservationLocationUpdatedType>>;
|
|
3804
4008
|
|
|
3805
4009
|
type _publicOnReservationLocationCreatedType = typeof onReservationLocationCreated$1;
|
|
4010
|
+
/**
|
|
4011
|
+
* Triggered when a reservation location is updated.
|
|
4012
|
+
*/
|
|
3806
4013
|
declare const onReservationLocationCreated: ReturnType<typeof createEventModule<_publicOnReservationLocationCreatedType>>;
|
|
3807
4014
|
|
|
3808
4015
|
type context$1_ActionEvent = ActionEvent;
|
|
@@ -4223,8 +4430,37 @@ interface CheckTimeSlotOptions {
|
|
|
4223
4430
|
excludeReservationId?: string | null;
|
|
4224
4431
|
}
|
|
4225
4432
|
|
|
4226
|
-
declare function getTimeSlots$1(httpClient: HttpClient):
|
|
4227
|
-
|
|
4433
|
+
declare function getTimeSlots$1(httpClient: HttpClient): GetTimeSlotsSignature;
|
|
4434
|
+
interface GetTimeSlotsSignature {
|
|
4435
|
+
/**
|
|
4436
|
+
* Returns a list of time slots at a given restaurant on a given `date`, and their availability for a given `partySize`.
|
|
4437
|
+
*
|
|
4438
|
+
* Without passing optional parameters, the list will contain a single time slot at the given `date`.
|
|
4439
|
+
* Use `slotsBefore` and `slotsAfter` to get additional time slots before and after the given `date`.
|
|
4440
|
+
*
|
|
4441
|
+
* If you do not provide a `duration`, the duration will be calculated automatically based on the reservation location's configuration.
|
|
4442
|
+
* The reservation location's settings used to determine the duration are its `defaultTurnoverTime` and `turnoverTimeRules`. These specify how much time should be allotted for a reservation of a party of a given size.
|
|
4443
|
+
*
|
|
4444
|
+
* The `startDate`s of time slots in the response are 15 minutes apart regardless of the `duration` provided.
|
|
4445
|
+
* @param - ID of the reservation location for which to retrieve time slots.
|
|
4446
|
+
* @param - Date and time for which to retrieve a time slot in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format.
|
|
4447
|
+
* @param - Size of the party that needs to be seated during this time slot.
|
|
4448
|
+
*
|
|
4449
|
+
* Min: `1`
|
|
4450
|
+
* @param - Options for retrieving the time slots.
|
|
4451
|
+
*/
|
|
4452
|
+
(reservationLocationId: string, date: Date, partySize: number | null, options?: GetTimeSlotsOptions | undefined): Promise<GetTimeSlotsResponse & GetTimeSlotsResponseNonNullableFields>;
|
|
4453
|
+
}
|
|
4454
|
+
declare function checkTimeSlot$1(httpClient: HttpClient): CheckTimeSlotSignature;
|
|
4455
|
+
interface CheckTimeSlotSignature {
|
|
4456
|
+
/**
|
|
4457
|
+
* Checks a restaurant's availability to accommodate a reservation for a given party size in a given time slot.
|
|
4458
|
+
*
|
|
4459
|
+
* This endpoint returns availability information for the restaurant's table combinations, and flags any party pacing or seat pacing conflicts that the proposed reservation would cause.
|
|
4460
|
+
* @param - ID of the reservation location for which to check the time slot.
|
|
4461
|
+
*/
|
|
4462
|
+
(reservationLocationId: string, options?: CheckTimeSlotOptions | undefined): Promise<CheckTimeSlotResponse & CheckTimeSlotResponseNonNullableFields>;
|
|
4463
|
+
}
|
|
4228
4464
|
|
|
4229
4465
|
declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
4230
4466
|
|
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2
|
+
interface HttpClient {
|
|
3
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
4
|
+
fetchWithAuth: typeof fetch;
|
|
5
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
6
|
+
}
|
|
7
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
8
|
+
type HttpResponse<T = any> = {
|
|
9
|
+
data: T;
|
|
10
|
+
status: number;
|
|
11
|
+
statusText: string;
|
|
12
|
+
headers: any;
|
|
13
|
+
request?: any;
|
|
14
|
+
};
|
|
15
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
16
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
17
|
+
url: string;
|
|
18
|
+
data?: Data;
|
|
19
|
+
params?: URLSearchParams;
|
|
20
|
+
} & APIMetadata;
|
|
21
|
+
type APIMetadata = {
|
|
22
|
+
methodFqn?: string;
|
|
23
|
+
entityFqdn?: string;
|
|
24
|
+
packageName?: string;
|
|
25
|
+
};
|
|
26
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
27
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
28
|
+
__type: 'event-definition';
|
|
29
|
+
type: Type;
|
|
30
|
+
isDomainEvent?: boolean;
|
|
31
|
+
transformations?: (envelope: unknown) => Payload;
|
|
32
|
+
__payload: Payload;
|
|
33
|
+
};
|
|
34
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
35
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
36
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
37
|
+
|
|
38
|
+
declare global {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
40
|
+
interface SymbolConstructor {
|
|
41
|
+
readonly observable: symbol;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
1
45
|
/** The reservation domain object. */
|
|
2
46
|
interface Reservation {
|
|
3
47
|
/**
|
|
@@ -1412,60 +1456,159 @@ interface ReservationsQueryBuilder {
|
|
|
1412
1456
|
find: () => Promise<ReservationsQueryResult>;
|
|
1413
1457
|
}
|
|
1414
1458
|
|
|
1415
|
-
|
|
1416
|
-
interface
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1459
|
+
declare function createReservation$1(httpClient: HttpClient): CreateReservationSignature;
|
|
1460
|
+
interface CreateReservationSignature {
|
|
1461
|
+
/**
|
|
1462
|
+
* Creates a new reservation.
|
|
1463
|
+
*
|
|
1464
|
+
* `createReservation()` accepts and requires different fields depending on the `status` provided and your permissions.
|
|
1465
|
+
*
|
|
1466
|
+
* **Status and source**
|
|
1467
|
+
*
|
|
1468
|
+
* If a `status` is not provided, it will be set to:
|
|
1469
|
+
* * `RESERVED` if manual approval is not required for confirmation
|
|
1470
|
+
* * `REQUESTED` if manual approval is required for confirmation.
|
|
1471
|
+
*
|
|
1472
|
+
* A reservation created with any `source` other than `WALK_IN` requires the `reservation.reservee.phone` and `reservation.reservee.firstName` fields.
|
|
1473
|
+
* Attempting to create a reservation without these fields will result in an error.
|
|
1474
|
+
*
|
|
1475
|
+
* **Permissions**
|
|
1476
|
+
*
|
|
1477
|
+
* Including the fields `status`, `source`, `reservation.details.tableIds`, `reservation.details.endDate`, `ignoreReservationLocationConflicts`, or `ignoreTableCombinationConflicts` in the request requires additional permissions. See this API's Introduction article for more information.
|
|
1478
|
+
*
|
|
1479
|
+
* If `source` is not provided, its value is set depending on the permissions of the user making the call. See this API's Introduction article for more information.
|
|
1480
|
+
*
|
|
1481
|
+
*
|
|
1482
|
+
* > **Note:** `createReservation()` requires all details of the reservation upfront. The process of creating a reservation can be broken up using `createHeldReservation`. `createHeldReservation` creates a temporary reservation that expires automatically unless it is completed with the addition of more details using `reserveReservation()`.
|
|
1483
|
+
* @param - Reservation details.
|
|
1484
|
+
* @param - Options for creating the reservation.
|
|
1485
|
+
* @returns Reservation.
|
|
1486
|
+
*/
|
|
1487
|
+
(reservation: Reservation, options?: CreateReservationOptions | undefined): Promise<Reservation & ReservationNonNullableFields>;
|
|
1420
1488
|
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1489
|
+
declare function getReservation$1(httpClient: HttpClient): GetReservationSignature;
|
|
1490
|
+
interface GetReservationSignature {
|
|
1491
|
+
/**
|
|
1492
|
+
* Retrieves a reservation.
|
|
1493
|
+
*
|
|
1494
|
+
* Calling this method with `fieldsets` set to `FULL` requires additional permissions. See this API's Introduction article for more information.
|
|
1495
|
+
* @param - Reservation ID.
|
|
1496
|
+
* @returns Reservation.
|
|
1497
|
+
*/
|
|
1498
|
+
(reservationId: string, options?: GetReservationOptions | undefined): Promise<Reservation & ReservationNonNullableFields>;
|
|
1499
|
+
}
|
|
1500
|
+
declare function updateReservation$1(httpClient: HttpClient): UpdateReservationSignature;
|
|
1501
|
+
interface UpdateReservationSignature {
|
|
1502
|
+
/**
|
|
1503
|
+
* Updates a reservation.
|
|
1504
|
+
*
|
|
1505
|
+
* Including the fields `status`, `source`, `reservation.details.tableIds`, `reservation.details.endDate`, `ignoreReservationLocationConflicts`, and `ignoreTableCombinationConflicts` in the request requires additional permissions. See this API's Introduction article for more information.
|
|
1506
|
+
*
|
|
1507
|
+
* Each time the reservation is updated, revision increments by 1. The existing revision must be included when updating the reservation. This ensures you're working with the latest reservation information, and it prevents unintended overwrites.
|
|
1508
|
+
* @param - Reservation ID.
|
|
1509
|
+
* @param - Options for updating the reservation.
|
|
1510
|
+
* @param - Reservation information to update.
|
|
1511
|
+
* @returns Reservation.
|
|
1512
|
+
*/
|
|
1513
|
+
(_id: string | null, reservation: UpdateReservation, options?: UpdateReservationOptions | undefined): Promise<Reservation & ReservationNonNullableFields>;
|
|
1514
|
+
}
|
|
1515
|
+
declare function createHeldReservation$1(httpClient: HttpClient): CreateHeldReservationSignature;
|
|
1516
|
+
interface CreateHeldReservationSignature {
|
|
1517
|
+
/**
|
|
1518
|
+
* Creates a new temporary reservation and holds it for the customer for 10 minutes.
|
|
1519
|
+
*
|
|
1520
|
+
* Creates a new reservation with the `HELD` status. `HELD` reservations are intended to reserve seats and tables for a party in a selected time slot while they enter further reservation details, such as names and contact information. Reservations with the `HELD` status are only valid for 10 minutes. Trying to change a `HELD` reservation’s status after 10 minutes returns an error.
|
|
1521
|
+
*
|
|
1522
|
+
* You cannot call `updateReservation()` to change a reservation’s status from `HELD`. Trying to do so returns an error. Instead, you should use `reserveReservation()`.
|
|
1523
|
+
*
|
|
1524
|
+
* If you do not wish to have `HELD` reservations in your flow, you can create a reservation with all required details using `createReservation()`.
|
|
1525
|
+
*
|
|
1526
|
+
* @param - Held reservation information to update.
|
|
1527
|
+
*/
|
|
1528
|
+
(reservationDetails: HeldReservationDetails): Promise<CreateHeldReservationResponse & CreateHeldReservationResponseNonNullableFields>;
|
|
1529
|
+
}
|
|
1530
|
+
declare function reserveReservation$1(httpClient: HttpClient): ReserveReservationSignature;
|
|
1531
|
+
interface ReserveReservationSignature {
|
|
1532
|
+
/**
|
|
1533
|
+
* Reserves or requests a held reservation.
|
|
1534
|
+
*
|
|
1535
|
+
* Held reservations are temporary reservations with the `HELD` status created by `createHeldReservation()`.
|
|
1536
|
+
*
|
|
1537
|
+
* They are intended to reserve seats and tables for a party in a selected time slot while they enter further reservation details, such as names and contact information. Reservations with the `HELD` status are only valid for 10 minutes. Trying to call `Reserve Reservation` with a held reservation older than 10 minutes returns an error.
|
|
1538
|
+
*
|
|
1539
|
+
* `Reserve Reservation` changes a reservation's `HELD` status to:
|
|
1540
|
+
* * `RESERVED` if the reservation's reservation location does not require manual approval.
|
|
1541
|
+
* * `REQUESTED` if the reservation's reservation location requires manual approval.
|
|
1542
|
+
* @param - Reservation ID.
|
|
1543
|
+
* @param - Reservee details.
|
|
1544
|
+
* @param - Revision number.
|
|
1545
|
+
*
|
|
1546
|
+
* Include the existing `revision` to prevent conflicting updates to reservations.
|
|
1547
|
+
*/
|
|
1548
|
+
(reservationId: string, reservee: Reservee, revision: string | null): Promise<ReserveReservationResponse & ReserveReservationResponseNonNullableFields>;
|
|
1549
|
+
}
|
|
1550
|
+
declare function cancelReservation$1(httpClient: HttpClient): CancelReservationSignature;
|
|
1551
|
+
interface CancelReservationSignature {
|
|
1552
|
+
/**
|
|
1553
|
+
* Cancels a reservation.
|
|
1554
|
+
*
|
|
1555
|
+
* Sets the reservation status to `CANCELED`.
|
|
1556
|
+
* @param - Reservation ID.
|
|
1557
|
+
* @param - Revision number.
|
|
1558
|
+
*
|
|
1559
|
+
* Include the existing `revision` to prevent conflicting updates to reservations.
|
|
1560
|
+
* @param - Options for canceling the reservation.
|
|
1561
|
+
*/
|
|
1562
|
+
(reservationId: string, revision: string | null, options?: CancelReservationOptions | undefined): Promise<CancelReservationResponse & CancelReservationResponseNonNullableFields>;
|
|
1563
|
+
}
|
|
1564
|
+
declare function deleteReservation$1(httpClient: HttpClient): DeleteReservationSignature;
|
|
1565
|
+
interface DeleteReservationSignature {
|
|
1566
|
+
/**
|
|
1567
|
+
* Deletes a reservation. Only reservations with the `HELD` status can be deleted.
|
|
1568
|
+
* @param - Reservation ID.
|
|
1569
|
+
*/
|
|
1570
|
+
(reservationId: string): Promise<void>;
|
|
1571
|
+
}
|
|
1572
|
+
declare function listReservations$1(httpClient: HttpClient): ListReservationsSignature;
|
|
1573
|
+
interface ListReservationsSignature {
|
|
1574
|
+
/**
|
|
1575
|
+
* Retrieves a list of up to 100 reservations.
|
|
1576
|
+
* @param - Options for listing the reservations.
|
|
1577
|
+
*/
|
|
1578
|
+
(options?: ListReservationsOptions | undefined): Promise<ListReservationsResponse & ListReservationsResponseNonNullableFields>;
|
|
1579
|
+
}
|
|
1580
|
+
declare function queryReservations$1(httpClient: HttpClient): QueryReservationsSignature;
|
|
1581
|
+
interface QueryReservationsSignature {
|
|
1582
|
+
/**
|
|
1583
|
+
* Creates a query to retrieve a list of reservations.
|
|
1584
|
+
*
|
|
1585
|
+
* The `queryReservations()` function builds a query to retrieve a list of reservations and returns a [`ReservationsQueryBuilder`](/reservations/reservations-query-builder) object.
|
|
1586
|
+
*
|
|
1587
|
+
* The returned object contains the query definition, which is used to run the query using the [find()](/reservations/reservations-query-builder/find) function.
|
|
1588
|
+
*
|
|
1589
|
+
* You can refine the query by chaining `ReservationsQueryBuilder` functions onto the query. `ReservationsQueryBuilder` functions enable you to filter, sort, and control the results that `queryReservations()` returns.
|
|
1590
|
+
*
|
|
1591
|
+
* `queryReservations()` runs with the following `ReservationsQueryBuilder` defaults, which you can override:
|
|
1592
|
+
*
|
|
1593
|
+
* * [`skip(0)`](/reservations/reservations-query-builder/skip)
|
|
1594
|
+
* * [`limit(50)`](/reservations/reservations-query-builder/limit)
|
|
1595
|
+
* * [`descending('_createdDate')`](/reservations/reservations-query-builder/descending)
|
|
1596
|
+
*
|
|
1597
|
+
* The following `ReservationsQueryBuilder` functions are supported for `queryReservations()`. For a full description of the reservation object, see the object returned for the [`items`](/reservations/reservations-query-builder/items) property in [`ReservationsQueryResult`](/reservations/reservations-query-result).
|
|
1598
|
+
*/
|
|
1599
|
+
(): ReservationsQueryBuilder;
|
|
1600
|
+
}
|
|
1601
|
+
declare function searchReservations$1(httpClient: HttpClient): SearchReservationsSignature;
|
|
1602
|
+
interface SearchReservationsSignature {
|
|
1603
|
+
/**
|
|
1604
|
+
* Use this endpoint to search the fields of the table reservations on a site for a given expression.
|
|
1605
|
+
*
|
|
1606
|
+
* You can also use this endpoint to perform data aggregations on a site's table reservation fields.
|
|
1607
|
+
* For a detailed list of supported operations, see the [Sorting, Filtering, and Search](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/reservations/reservations/sorting-filtering-and-search) article.
|
|
1608
|
+
* @param - Search query.
|
|
1609
|
+
*/
|
|
1610
|
+
(search: CursorSearch): Promise<SearchReservationsResponse & SearchReservationsResponseNonNullableFields>;
|
|
1457
1611
|
}
|
|
1458
|
-
|
|
1459
|
-
declare function createReservation$1(httpClient: HttpClient): (reservation: Reservation, options?: CreateReservationOptions) => Promise<Reservation & ReservationNonNullableFields>;
|
|
1460
|
-
declare function getReservation$1(httpClient: HttpClient): (reservationId: string, options?: GetReservationOptions) => Promise<Reservation & ReservationNonNullableFields>;
|
|
1461
|
-
declare function updateReservation$1(httpClient: HttpClient): (_id: string | null, reservation: UpdateReservation, options?: UpdateReservationOptions) => Promise<Reservation & ReservationNonNullableFields>;
|
|
1462
|
-
declare function createHeldReservation$1(httpClient: HttpClient): (reservationDetails: HeldReservationDetails) => Promise<CreateHeldReservationResponse & CreateHeldReservationResponseNonNullableFields>;
|
|
1463
|
-
declare function reserveReservation$1(httpClient: HttpClient): (reservationId: string, reservee: Reservee, revision: string | null) => Promise<ReserveReservationResponse & ReserveReservationResponseNonNullableFields>;
|
|
1464
|
-
declare function cancelReservation$1(httpClient: HttpClient): (reservationId: string, revision: string | null, options?: CancelReservationOptions) => Promise<CancelReservationResponse & CancelReservationResponseNonNullableFields>;
|
|
1465
|
-
declare function deleteReservation$1(httpClient: HttpClient): (reservationId: string) => Promise<void>;
|
|
1466
|
-
declare function listReservations$1(httpClient: HttpClient): (options?: ListReservationsOptions) => Promise<ListReservationsResponse & ListReservationsResponseNonNullableFields>;
|
|
1467
|
-
declare function queryReservations$1(httpClient: HttpClient): () => ReservationsQueryBuilder;
|
|
1468
|
-
declare function searchReservations$1(httpClient: HttpClient): (search: CursorSearch) => Promise<SearchReservationsResponse & SearchReservationsResponseNonNullableFields>;
|
|
1469
1612
|
declare const onReservationCreated$1: EventDefinition<ReservationCreatedEnvelope, "wix.table_reservations.v1.reservation_created">;
|
|
1470
1613
|
|
|
1471
1614
|
declare function createRESTModule$2<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
@@ -1494,6 +1637,9 @@ type _publicSearchReservationsType = typeof searchReservations$1;
|
|
|
1494
1637
|
declare const searchReservations: ReturnType<typeof createRESTModule$2<_publicSearchReservationsType>>;
|
|
1495
1638
|
|
|
1496
1639
|
type _publicOnReservationCreatedType = typeof onReservationCreated$1;
|
|
1640
|
+
/**
|
|
1641
|
+
* Triggered when a held reservation is created.
|
|
1642
|
+
*/
|
|
1497
1643
|
declare const onReservationCreated: ReturnType<typeof createEventModule$1<_publicOnReservationCreatedType>>;
|
|
1498
1644
|
|
|
1499
1645
|
type index_d$2_Aggregation = Aggregation;
|
|
@@ -3779,10 +3925,65 @@ interface ListReservationLocationsOptions {
|
|
|
3779
3925
|
fieldsets?: Set[];
|
|
3780
3926
|
}
|
|
3781
3927
|
|
|
3782
|
-
declare function getReservationLocation$1(httpClient: HttpClient):
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3928
|
+
declare function getReservationLocation$1(httpClient: HttpClient): GetReservationLocationSignature;
|
|
3929
|
+
interface GetReservationLocationSignature {
|
|
3930
|
+
/**
|
|
3931
|
+
* Retrieves a reservation location by ID.
|
|
3932
|
+
*
|
|
3933
|
+
* The `FULL` fieldset can only be retrieved by users with the `READ RESERVATION LOCATIONS (FULL)` or `MANAGE RESERVATION LOCATIONS` permission scopes.
|
|
3934
|
+
* @param - ID of the ReservationLocation to retrieve.
|
|
3935
|
+
* @param - An object representing the available options for retrieving a reservation location.
|
|
3936
|
+
* @returns The retrieved reservation location.
|
|
3937
|
+
*/
|
|
3938
|
+
(reservationLocationId: string, options?: GetReservationLocationOptions | undefined): Promise<ReservationLocation & ReservationLocationNonNullableFields>;
|
|
3939
|
+
}
|
|
3940
|
+
declare function updateReservationLocation$1(httpClient: HttpClient): UpdateReservationLocationSignature;
|
|
3941
|
+
interface UpdateReservationLocationSignature {
|
|
3942
|
+
/**
|
|
3943
|
+
* Updates a reservation location. Supports partial updates.
|
|
3944
|
+
*
|
|
3945
|
+
* Each time the reservation location is updated, `revision` increments by 1. The existing revision must be included when updating the reservation location. This ensures you're working with the latest reservation location information, and it prevents unintended overwrites.
|
|
3946
|
+
*
|
|
3947
|
+
* You cannot use this endpoint to change a reservation location's `location` object. Attempting to do so will cause the server to return an application error.
|
|
3948
|
+
* @param - Reservation location ID.
|
|
3949
|
+
* @param - Reservation location information to update.
|
|
3950
|
+
* @returns The updated reservation location.
|
|
3951
|
+
*/
|
|
3952
|
+
(_id: string | null, reservationLocation: UpdateReservationLocation): Promise<ReservationLocation & ReservationLocationNonNullableFields>;
|
|
3953
|
+
}
|
|
3954
|
+
declare function queryReservationLocations$1(httpClient: HttpClient): QueryReservationLocationsSignature;
|
|
3955
|
+
interface QueryReservationLocationsSignature {
|
|
3956
|
+
/**
|
|
3957
|
+
* Creates a query to retrieve a list of reservation locations.
|
|
3958
|
+
*
|
|
3959
|
+
*
|
|
3960
|
+
* The `queryReservationLocations()` function builds a query to retrieve a list of reservation locations and returns a [`ReservationLocationsQueryBuilder`](/reservation-locations/reservation-locations-query-builder/) object.
|
|
3961
|
+
*
|
|
3962
|
+
* The returned object contains the query definition, which is used to run the query using the [find()](/reservation-locations/reservation-locations-query-builder/find) function.
|
|
3963
|
+
*
|
|
3964
|
+
* You can refine the query by chaining `ReservationLocationsQueryBuilder` functions onto the query. `ReservationLocationsQueryBuilder` functions enable you to filter, sort, and control the results that `queryReservationLocations()` returns.
|
|
3965
|
+
*
|
|
3966
|
+
* `queryReservationLocations()` runs with the following `ReservationLocationsQueryBuilder` defaults, which you can override:
|
|
3967
|
+
*
|
|
3968
|
+
* * [`skip(0)`](/reservation-locations/reservation-locations-query-builder/skip)
|
|
3969
|
+
* * [`limit(50)`](/reservation-locations/reservation-locations-query-builder/limit)
|
|
3970
|
+
* * [`descending('_createdDate')`](/reservation-locations/reservation-locations-query-builder/descending)
|
|
3971
|
+
*
|
|
3972
|
+
* The following `ReservationLocationsQueryBuilder` functions are supported for `queryReservationLocations()`. For a full description of the reservation location object, see the object returned for the [`items`](/reservation-locations/reservation-locations-query-result/items) property in [`ReservationLocationsQueryResult`](/reservation-locations/reservation-locations-query-result).
|
|
3973
|
+
* @param - An object representing the available options for querying reservation locations.
|
|
3974
|
+
*/
|
|
3975
|
+
(options?: QueryReservationLocationsOptions | undefined): ReservationLocationsQueryBuilder;
|
|
3976
|
+
}
|
|
3977
|
+
declare function listReservationLocations$1(httpClient: HttpClient): ListReservationLocationsSignature;
|
|
3978
|
+
interface ListReservationLocationsSignature {
|
|
3979
|
+
/**
|
|
3980
|
+
* Retrieves a list of up to 100 reservation locations.
|
|
3981
|
+
*
|
|
3982
|
+
* The `FULL` fieldset can only be retrieved by users with the `READ RESERVATION LOCATIONS (FULL)` or `MANAGE RESERVATION LOCATIONS` permission scopes.
|
|
3983
|
+
* @param - An object representing the available options for listing reservation locations.
|
|
3984
|
+
*/
|
|
3985
|
+
(options?: ListReservationLocationsOptions | undefined): Promise<ListReservationLocationsResponse & ListReservationLocationsResponseNonNullableFields>;
|
|
3986
|
+
}
|
|
3786
3987
|
declare const onReservationLocationUpdated$1: EventDefinition<ReservationLocationUpdatedEnvelope, "wix.table_reservations.v1.reservation_location_updated">;
|
|
3787
3988
|
declare const onReservationLocationCreated$1: EventDefinition<ReservationLocationCreatedEnvelope, "wix.table_reservations.v1.reservation_location_created">;
|
|
3788
3989
|
|
|
@@ -3800,9 +4001,15 @@ type _publicListReservationLocationsType = typeof listReservationLocations$1;
|
|
|
3800
4001
|
declare const listReservationLocations: ReturnType<typeof createRESTModule$1<_publicListReservationLocationsType>>;
|
|
3801
4002
|
|
|
3802
4003
|
type _publicOnReservationLocationUpdatedType = typeof onReservationLocationUpdated$1;
|
|
4004
|
+
/**
|
|
4005
|
+
* Triggered when a reservation location is updated.
|
|
4006
|
+
*/
|
|
3803
4007
|
declare const onReservationLocationUpdated: ReturnType<typeof createEventModule<_publicOnReservationLocationUpdatedType>>;
|
|
3804
4008
|
|
|
3805
4009
|
type _publicOnReservationLocationCreatedType = typeof onReservationLocationCreated$1;
|
|
4010
|
+
/**
|
|
4011
|
+
* Triggered when a reservation location is updated.
|
|
4012
|
+
*/
|
|
3806
4013
|
declare const onReservationLocationCreated: ReturnType<typeof createEventModule<_publicOnReservationLocationCreatedType>>;
|
|
3807
4014
|
|
|
3808
4015
|
type index_d$1_ActionEvent = ActionEvent;
|
|
@@ -4223,8 +4430,37 @@ interface CheckTimeSlotOptions {
|
|
|
4223
4430
|
excludeReservationId?: string | null;
|
|
4224
4431
|
}
|
|
4225
4432
|
|
|
4226
|
-
declare function getTimeSlots$1(httpClient: HttpClient):
|
|
4227
|
-
|
|
4433
|
+
declare function getTimeSlots$1(httpClient: HttpClient): GetTimeSlotsSignature;
|
|
4434
|
+
interface GetTimeSlotsSignature {
|
|
4435
|
+
/**
|
|
4436
|
+
* Returns a list of time slots at a given restaurant on a given `date`, and their availability for a given `partySize`.
|
|
4437
|
+
*
|
|
4438
|
+
* Without passing optional parameters, the list will contain a single time slot at the given `date`.
|
|
4439
|
+
* Use `slotsBefore` and `slotsAfter` to get additional time slots before and after the given `date`.
|
|
4440
|
+
*
|
|
4441
|
+
* If you do not provide a `duration`, the duration will be calculated automatically based on the reservation location's configuration.
|
|
4442
|
+
* The reservation location's settings used to determine the duration are its `defaultTurnoverTime` and `turnoverTimeRules`. These specify how much time should be allotted for a reservation of a party of a given size.
|
|
4443
|
+
*
|
|
4444
|
+
* The `startDate`s of time slots in the response are 15 minutes apart regardless of the `duration` provided.
|
|
4445
|
+
* @param - ID of the reservation location for which to retrieve time slots.
|
|
4446
|
+
* @param - Date and time for which to retrieve a time slot in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format.
|
|
4447
|
+
* @param - Size of the party that needs to be seated during this time slot.
|
|
4448
|
+
*
|
|
4449
|
+
* Min: `1`
|
|
4450
|
+
* @param - Options for retrieving the time slots.
|
|
4451
|
+
*/
|
|
4452
|
+
(reservationLocationId: string, date: Date, partySize: number | null, options?: GetTimeSlotsOptions | undefined): Promise<GetTimeSlotsResponse & GetTimeSlotsResponseNonNullableFields>;
|
|
4453
|
+
}
|
|
4454
|
+
declare function checkTimeSlot$1(httpClient: HttpClient): CheckTimeSlotSignature;
|
|
4455
|
+
interface CheckTimeSlotSignature {
|
|
4456
|
+
/**
|
|
4457
|
+
* Checks a restaurant's availability to accommodate a reservation for a given party size in a given time slot.
|
|
4458
|
+
*
|
|
4459
|
+
* This endpoint returns availability information for the restaurant's table combinations, and flags any party pacing or seat pacing conflicts that the proposed reservation would cause.
|
|
4460
|
+
* @param - ID of the reservation location for which to check the time slot.
|
|
4461
|
+
*/
|
|
4462
|
+
(reservationLocationId: string, options?: CheckTimeSlotOptions | undefined): Promise<CheckTimeSlotResponse & CheckTimeSlotResponseNonNullableFields>;
|
|
4463
|
+
}
|
|
4228
4464
|
|
|
4229
4465
|
declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
4230
4466
|
|