@iveri/contracts 0.103.0 → 0.105.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/api/chat/chat-call.type.d.ts +17 -1
- package/dist/api/chat/chat-refusal.enum.d.ts +3 -1
- package/dist/api/chat/chat-refusal.enum.js +3 -1
- package/dist/api/restaurant/index.d.ts +1 -0
- package/dist/api/restaurant/index.js +1 -0
- package/dist/api/restaurant/restaurant-diner-order.type.d.ts +6 -0
- package/dist/api/restaurant/restaurant-order-chat.type.d.ts +22 -0
- package/dist/api/restaurant/restaurant-order-chat.type.js +1 -0
- package/dist/api/restaurant/restaurant-order.type.d.ts +5 -0
- package/package.json +1 -1
|
@@ -28,6 +28,19 @@ export interface ChatCall {
|
|
|
28
28
|
/** Set once the call has ended, and only then. */
|
|
29
29
|
endReason: Nullable<ChatCallEndReason>;
|
|
30
30
|
startedBy: UUID;
|
|
31
|
+
/**
|
|
32
|
+
* A call in a group: it rang everybody who could be rung, anybody in the group may join it while it lasts, and
|
|
33
|
+
* leaving it does not end it for the others. A call between two people is not.
|
|
34
|
+
*/
|
|
35
|
+
isGroup: boolean;
|
|
36
|
+
/** The group's title in a group call, so a ring can say where it comes from; null between two people. */
|
|
37
|
+
title: Nullable<string>;
|
|
38
|
+
/** How many people may be in it at once: 2 between two people, the group call cap in a group. */
|
|
39
|
+
maxParticipants: number;
|
|
40
|
+
/**
|
|
41
|
+
* Everybody it rang and everybody who joined. In a group call somebody who joins late is added, and one the call
|
|
42
|
+
* did not ring (they muted the group, or it was too large to ring) appears only once they join.
|
|
43
|
+
*/
|
|
31
44
|
participants: ChatCallParticipant[];
|
|
32
45
|
/** When an unanswered call stops ringing and becomes missed. */
|
|
33
46
|
ringExpiresAt: IsoDateTime;
|
|
@@ -52,7 +65,10 @@ export interface ChatCallJoin {
|
|
|
52
65
|
token: string;
|
|
53
66
|
expiresAt: IsoDateTime;
|
|
54
67
|
}
|
|
55
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* `GET /conversations/:conversationId/calls/current`: the call ringing or under way there, if any. Between two people
|
|
70
|
+
* only a call I am in; in a group any live call, so a member it did not ring can see it and join.
|
|
71
|
+
*/
|
|
56
72
|
export interface ChatCurrentCall {
|
|
57
73
|
call: Nullable<ChatCall>;
|
|
58
74
|
}
|
|
@@ -16,10 +16,12 @@ export declare enum ChatRefusal {
|
|
|
16
16
|
SUSPENDED = "suspended",
|
|
17
17
|
ATTACHMENT_REFUSED = "attachment-refused",
|
|
18
18
|
REQUEST_PENDING = "request-pending",
|
|
19
|
-
/** This conversation takes no calls: a
|
|
19
|
+
/** This conversation takes no calls: a product's conversation that does not allow them, or an app's. */
|
|
20
20
|
CALLS_OFF = "calls-off",
|
|
21
21
|
/** The call has ended, or this person is not in it. */
|
|
22
22
|
CALL_UNAVAILABLE = "call-unavailable",
|
|
23
|
+
/** A group call already has as many people in it as it takes. */
|
|
24
|
+
CALL_FULL = "call-full",
|
|
23
25
|
/**
|
|
24
26
|
* The app's plan does not allow it this month: a new user over the monthly-active-user limit, or a message over the
|
|
25
27
|
* message limit. The value is `USAGE_LIMIT_REACHED_REASON` from `@iveri/contracts/billing`, and the details name the
|
|
@@ -17,10 +17,12 @@ export var ChatRefusal;
|
|
|
17
17
|
ChatRefusal["SUSPENDED"] = "suspended";
|
|
18
18
|
ChatRefusal["ATTACHMENT_REFUSED"] = "attachment-refused";
|
|
19
19
|
ChatRefusal["REQUEST_PENDING"] = "request-pending";
|
|
20
|
-
/** This conversation takes no calls: a
|
|
20
|
+
/** This conversation takes no calls: a product's conversation that does not allow them, or an app's. */
|
|
21
21
|
ChatRefusal["CALLS_OFF"] = "calls-off";
|
|
22
22
|
/** The call has ended, or this person is not in it. */
|
|
23
23
|
ChatRefusal["CALL_UNAVAILABLE"] = "call-unavailable";
|
|
24
|
+
/** A group call already has as many people in it as it takes. */
|
|
25
|
+
ChatRefusal["CALL_FULL"] = "call-full";
|
|
24
26
|
/**
|
|
25
27
|
* The app's plan does not allow it this month: a new user over the monthly-active-user limit, or a message over the
|
|
26
28
|
* message limit. The value is `USAGE_LIMIT_REACHED_REASON` from `@iveri/contracts/billing`, and the details name the
|
|
@@ -11,6 +11,7 @@ export * from './restaurant-floor.type.js';
|
|
|
11
11
|
export * from './restaurant-kitchen.type.js';
|
|
12
12
|
export * from './restaurant-line-status.enum.js';
|
|
13
13
|
export * from './restaurant-menu.type.js';
|
|
14
|
+
export * from './restaurant-order-chat.type.js';
|
|
14
15
|
export * from './restaurant-order-payment-status.enum.js';
|
|
15
16
|
export * from './restaurant-order-source.enum.js';
|
|
16
17
|
export * from './restaurant-order-status.enum.js';
|
|
@@ -11,6 +11,7 @@ export * from './restaurant-floor.type.js';
|
|
|
11
11
|
export * from './restaurant-kitchen.type.js';
|
|
12
12
|
export * from './restaurant-line-status.enum.js';
|
|
13
13
|
export * from './restaurant-menu.type.js';
|
|
14
|
+
export * from './restaurant-order-chat.type.js';
|
|
14
15
|
export * from './restaurant-order-payment-status.enum.js';
|
|
15
16
|
export * from './restaurant-order-source.enum.js';
|
|
16
17
|
export * from './restaurant-order-status.enum.js';
|
|
@@ -97,6 +97,12 @@ export interface RestaurantDinerOrder {
|
|
|
97
97
|
canPay: boolean;
|
|
98
98
|
/** Whether the person who placed it can still say how it was. */
|
|
99
99
|
canReview: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The Baasi conversation with the restaurant about this order, for the diner who placed it while signed in, once it
|
|
102
|
+
* is open. Null on a guest's order, on a link followed without the account, and before it opens. It stays set after
|
|
103
|
+
* the order ends, because the two can still read it.
|
|
104
|
+
*/
|
|
105
|
+
chatConversationId: UUID | null;
|
|
100
106
|
}
|
|
101
107
|
export interface RestaurantOrderPlaced {
|
|
102
108
|
order: RestaurantDinerOrder;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { IsoDateTime } from '../../type/iso-date-time.type.js';
|
|
2
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
3
|
+
/** `POST /orders/:orderId/chat`: the conversation a member of staff just took up. */
|
|
4
|
+
export interface RestaurantOrderChat {
|
|
5
|
+
conversationId: UUID;
|
|
6
|
+
}
|
|
7
|
+
/** `GET /orders/chat/me`: whether the caller answers diners, named in every order conversation. */
|
|
8
|
+
export interface RestaurantOrderChatStanding {
|
|
9
|
+
hasJoined: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** One person on the restaurant's side of every order conversation. */
|
|
12
|
+
export interface RestaurantOrderChatStaffMember {
|
|
13
|
+
userId: UUID;
|
|
14
|
+
/** As identity shows them to colleagues, or null when identity cannot name them. */
|
|
15
|
+
displayName: string | null;
|
|
16
|
+
isMe: boolean;
|
|
17
|
+
joinedAt: IsoDateTime;
|
|
18
|
+
}
|
|
19
|
+
/** `GET /orders/chat/staff`: everybody who answers diners, in the order they took it up. */
|
|
20
|
+
export interface RestaurantOrderChatStaff {
|
|
21
|
+
items: RestaurantOrderChatStaffMember[];
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -64,6 +64,11 @@ export interface RestaurantOrder {
|
|
|
64
64
|
completedAt: IsoDateTime | null;
|
|
65
65
|
cancelledAt: IsoDateTime | null;
|
|
66
66
|
cancelReason: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* The Baasi conversation between the diner and the restaurant's staff, once one is open: only an order a signed-in
|
|
69
|
+
* diner placed for takeaway or delivery has one, never a table's. Staff take it up with `POST /orders/:id/chat`.
|
|
70
|
+
*/
|
|
71
|
+
chatConversationId: UUID | null;
|
|
67
72
|
version: number;
|
|
68
73
|
}
|
|
69
74
|
/** What is being ordered. A client never sends a price. */
|