@iveri/contracts 0.104.0 → 0.106.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/README.md CHANGED
@@ -8,6 +8,12 @@ entry offers exactly `types` and `default`. The CommonJS build and the `typesVer
8
8
  gone, so a consumer resolves the subpaths under `moduleResolution` `nodenext` or `bundler` — and
9
9
  under Node 26 a CommonJS consumer still loads it, through `require`. See `CHANGELOG.md`.
10
10
 
11
+ Release `0.106.0` adds `RealtimeResourceType.GYM_PERSON` (`gym.person`) and
12
+ `RealtimeEventType.GYM_PERSON_UPDATED`: a gym member's or trainer's own room, keyed by their
13
+ identity user id, so their apps learn at once that a conversation with the person they train with
14
+ opened. A gateway on an older release refuses the event, so `iveri-realtime` takes this release
15
+ before `gym-api` publishes it.
16
+
11
17
  Release `0.21.0` adds the shared realtime contract under `@iveri/contracts/realtime`: closed
12
18
  resource and event vocabularies, identifier-only publish messages, and short-lived subscription
13
19
  grants bound to one tenant, person and resource. It also separates permission to issue a grant
@@ -35,5 +35,11 @@ export declare enum RealtimeEventType {
35
35
  /** Something new happened to a member, so their activity list and its count are stale. */
36
36
  SOCIAL_ACTIVITY_UPDATED = "social.activity.updated",
37
37
  /** Somebody came through a branch's door or a class changed, so staff screens refetch. */
38
- GYM_BRANCH_UPDATED = "gym.branch.updated"
38
+ GYM_BRANCH_UPDATED = "gym.branch.updated",
39
+ /**
40
+ * Something a member or a trainer reads about themselves changed, such as the conversation with
41
+ * the person they train with opening, so their bookings or sessions refetch. Carried on the
42
+ * person, while the version is that of whatever moved.
43
+ */
44
+ GYM_PERSON_UPDATED = "gym.person.updated"
39
45
  }
@@ -37,4 +37,10 @@ export var RealtimeEventType;
37
37
  RealtimeEventType["SOCIAL_ACTIVITY_UPDATED"] = "social.activity.updated";
38
38
  /** Somebody came through a branch's door or a class changed, so staff screens refetch. */
39
39
  RealtimeEventType["GYM_BRANCH_UPDATED"] = "gym.branch.updated";
40
+ /**
41
+ * Something a member or a trainer reads about themselves changed, such as the conversation with
42
+ * the person they train with opening, so their bookings or sessions refetch. Carried on the
43
+ * person, while the version is that of whatever moved.
44
+ */
45
+ RealtimeEventType["GYM_PERSON_UPDATED"] = "gym.person.updated";
40
46
  })(RealtimeEventType || (RealtimeEventType = {}));
@@ -16,5 +16,11 @@ export declare enum RealtimeResourceType {
16
16
  * message or a like has happened, and the events on it say what became stale.
17
17
  */
18
18
  SOCIAL_MEMBER = "social.member",
19
- GYM_BRANCH = "gym.branch"
19
+ GYM_BRANCH = "gym.branch",
20
+ /**
21
+ * One person's own room at a gym, a member or a trainer, keyed by their identity user id. They
22
+ * subscribe to themselves, the one thing they can name before a conversation with their trainer
23
+ * or member exists, and the events on it say what of their own became stale.
24
+ */
25
+ GYM_PERSON = "gym.person"
20
26
  }
@@ -18,4 +18,10 @@ export var RealtimeResourceType;
18
18
  */
19
19
  RealtimeResourceType["SOCIAL_MEMBER"] = "social.member";
20
20
  RealtimeResourceType["GYM_BRANCH"] = "gym.branch";
21
+ /**
22
+ * One person's own room at a gym, a member or a trainer, keyed by their identity user id. They
23
+ * subscribe to themselves, the one thing they can name before a conversation with their trainer
24
+ * or member exists, and the events on it say what of their own became stale.
25
+ */
26
+ RealtimeResourceType["GYM_PERSON"] = "gym.person";
21
27
  })(RealtimeResourceType || (RealtimeResourceType = {}));
@@ -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. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.104.0",
3
+ "version": "0.106.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {