@leaflow/sdk 0.180.0 → 0.181.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.
Files changed (66) hide show
  1. package/dist/eventbus/v1/generated/functions.d.ts +21 -23
  2. package/dist/eventbus/v1/generated/functions.js +1 -2
  3. package/dist/eventbus/v1/generated/models.d.ts +53 -40
  4. package/dist/eventbus/v1/generated/schemas.zod.d.ts +25 -25
  5. package/dist/eventbus/v1/generated/schemas.zod.js +21 -23
  6. package/dist/eventbus/v1/generated/validators/createEventRequest.zod.d.ts +20 -21
  7. package/dist/eventbus/v1/generated/validators/createEventRequest.zod.js +20 -21
  8. package/dist/eventbus/v1/generated/validators/createNamespaceRequest.zod.d.ts +20 -21
  9. package/dist/eventbus/v1/generated/validators/createNamespaceRequest.zod.js +20 -21
  10. package/dist/eventbus/v1/generated/validators/createVersionRequest.zod.d.ts +20 -21
  11. package/dist/eventbus/v1/generated/validators/createVersionRequest.zod.js +20 -21
  12. package/dist/eventbus/v1/generated/validators/cursorPagination.zod.d.ts +20 -21
  13. package/dist/eventbus/v1/generated/validators/cursorPagination.zod.js +20 -21
  14. package/dist/eventbus/v1/generated/validators/error.zod.d.ts +20 -21
  15. package/dist/eventbus/v1/generated/validators/error.zod.js +20 -21
  16. package/dist/eventbus/v1/generated/validators/errorStatus.zod.d.ts +20 -21
  17. package/dist/eventbus/v1/generated/validators/errorStatus.zod.js +20 -21
  18. package/dist/eventbus/v1/generated/validators/eventDetail.zod.d.ts +20 -21
  19. package/dist/eventbus/v1/generated/validators/eventDetail.zod.js +20 -21
  20. package/dist/eventbus/v1/generated/validators/eventList.zod.d.ts +20 -21
  21. package/dist/eventbus/v1/generated/validators/eventList.zod.js +20 -21
  22. package/dist/eventbus/v1/generated/validators/eventMessage.zod.d.ts +29 -25
  23. package/dist/eventbus/v1/generated/validators/eventMessage.zod.js +27 -26
  24. package/dist/eventbus/v1/generated/validators/eventResource.zod.d.ts +20 -21
  25. package/dist/eventbus/v1/generated/validators/eventResource.zod.js +20 -21
  26. package/dist/eventbus/v1/generated/validators/eventStatus.zod.d.ts +20 -21
  27. package/dist/eventbus/v1/generated/validators/eventStatus.zod.js +20 -21
  28. package/dist/eventbus/v1/generated/validators/eventVersion.zod.d.ts +20 -21
  29. package/dist/eventbus/v1/generated/validators/eventVersion.zod.js +20 -21
  30. package/dist/eventbus/v1/generated/validators/fieldViolation.zod.d.ts +20 -21
  31. package/dist/eventbus/v1/generated/validators/fieldViolation.zod.js +20 -21
  32. package/dist/eventbus/v1/generated/validators/listEventsParams.zod.d.ts +20 -21
  33. package/dist/eventbus/v1/generated/validators/listEventsParams.zod.js +20 -21
  34. package/dist/eventbus/v1/generated/validators/listNamespacesParams.zod.d.ts +20 -21
  35. package/dist/eventbus/v1/generated/validators/listNamespacesParams.zod.js +20 -21
  36. package/dist/eventbus/v1/generated/validators/namespaceList.zod.d.ts +20 -21
  37. package/dist/eventbus/v1/generated/validators/namespaceList.zod.js +20 -21
  38. package/dist/eventbus/v1/generated/validators/namespaceResource.zod.d.ts +20 -21
  39. package/dist/eventbus/v1/generated/validators/namespaceResource.zod.js +20 -21
  40. package/dist/eventbus/v1/generated/validators/namespaceStatus.zod.d.ts +20 -21
  41. package/dist/eventbus/v1/generated/validators/namespaceStatus.zod.js +20 -21
  42. package/dist/eventbus/v1/generated/validators/offsetPagination.zod.d.ts +20 -21
  43. package/dist/eventbus/v1/generated/validators/offsetPagination.zod.js +20 -21
  44. package/dist/eventbus/v1/generated/validators/publication.zod.d.ts +23 -23
  45. package/dist/eventbus/v1/generated/validators/publication.zod.js +22 -27
  46. package/dist/eventbus/v1/generated/validators/publicationRecipient.zod.d.ts +89 -0
  47. package/dist/eventbus/v1/generated/validators/publicationRecipient.zod.js +89 -0
  48. package/dist/eventbus/v1/generated/validators/publishRequest.zod.d.ts +25 -24
  49. package/dist/eventbus/v1/generated/validators/publishRequest.zod.js +23 -23
  50. package/dist/eventbus/v1/generated/validators/publishResponse.zod.d.ts +20 -21
  51. package/dist/eventbus/v1/generated/validators/publishResponse.zod.js +20 -21
  52. package/dist/eventbus/v1/generated/validators/publishedMessage.zod.d.ts +20 -21
  53. package/dist/eventbus/v1/generated/validators/publishedMessage.zod.js +20 -21
  54. package/dist/eventbus/v1/generated/validators/realtimeTicket.zod.d.ts +20 -22
  55. package/dist/eventbus/v1/generated/validators/realtimeTicket.zod.js +20 -24
  56. package/dist/eventbus/v1/generated/validators/realtimeTicketRequest.zod.d.ts +20 -21
  57. package/dist/eventbus/v1/generated/validators/realtimeTicketRequest.zod.js +20 -21
  58. package/dist/eventbus/v1/generated/validators/recipient.zod.d.ts +89 -0
  59. package/dist/eventbus/v1/generated/validators/recipient.zod.js +89 -0
  60. package/dist/eventbus/v1/generated/validators/sender.zod.d.ts +89 -0
  61. package/dist/eventbus/v1/generated/validators/sender.zod.js +92 -0
  62. package/dist/eventbus/v1/generated/validators/updateEventRequest.zod.d.ts +20 -21
  63. package/dist/eventbus/v1/generated/validators/updateEventRequest.zod.js +20 -21
  64. package/dist/eventbus/v1/generated/validators/updateNamespaceRequest.zod.d.ts +20 -21
  65. package/dist/eventbus/v1/generated/validators/updateNamespaceRequest.zod.js +20 -21
  66. package/package.json +1 -1
@@ -28,54 +28,53 @@
28
28
  * wait for consumers. Messages are not stored and are not replayed: a consumer that connects
29
29
  * later does not receive earlier messages.
30
30
  *
31
- * Messages published through this API are sent to the current project. A message may name one
32
- * `subject`, a member of the project; it is then sent to that member only. Without a subject it is
33
- * sent to every member of the project.
31
+ * Messages published through this API are sent to the current project. A message may name a
32
+ * `recipient`, a member of the project; it is then sent to that member only. Without a recipient
33
+ * it is sent to every member of the project.
34
34
  *
35
- * Every publication names a `client_id`. It starts with the prefix returned with a realtime
36
- * ticket, `user.{user_id}.project.{project_id}.`, followed by one segment chosen by the
37
- * client, such as a random identifier per browser tab. Receivers get it unchanged, so a client
38
- * can recognise its own messages. A client ID does not need to be unique: several connections
39
- * may share one.
35
+ * Every message names its `sender`: an `id` and the `name` the publisher had when the message was
36
+ * accepted. A publication may also carry a `client_id`, any label the client chooses, such as one
37
+ * per browser tab. Receivers get it unchanged, so a client can recognise its own messages by
38
+ * `sender` and `client_id`. A client ID need not be unique; a realtime connection is identified
39
+ * by its `connection_id`.
40
40
  *
41
41
  * ## Realtime
42
42
  *
43
- * Every message has a topic `{event}/{project_id|-}/{subject|-}/{key levels}`, where `-` stands
44
- * for a missing recipient and the key, split at `/`, supplies the remaining levels. A topic filter
43
+ * Every message has a topic `{event}/{recipient project_id|-}/{recipient id|-}/{key levels}`, where
44
+ * `-` stands for a missing recipient and the key, split at `/`, supplies the remaining levels. A topic filter
45
45
  * uses `+` to match exactly one level and `#`, only as the last level, to match that level and
46
46
  * every level below it, including none. For example, `{event}/{project_id}/-/#` matches every
47
47
  * message sent to the members of a project, and `{event}/-/{user_id}/#` every message sent to one
48
48
  * person outside any project.
49
49
  *
50
50
  * 1. Create a ticket with `POST /api/v1/realtime/tickets`, naming the events to receive. The
51
- * response lists the topic filters the ticket covers and the `client_id_prefix` to use. For a
52
- * platform event they cover messages sent to the caller, messages sent to no recipient and,
51
+ * response lists the topic filters the ticket covers. For a platform event they cover messages sent to the caller, messages sent to no recipient and,
53
52
  * where the caller's permissions allow, messages sent within the project; for a project event
54
53
  * they cover messages sent within the project. Without a selected project, use
55
54
  * `POST /api/v1/account/realtime/tickets`; such a ticket covers only messages sent to the
56
55
  * caller or to no recipient, and cannot publish.
57
56
  * 2. Open a WebSocket to `wss://eventbus.leaflow.cloud/realtime` and send, within 15 seconds:
58
- * `{"type":"authenticate","ticket":"…","client_id":"…"}`. The reply is
59
- * `{"type":"authenticated","client_id":"…","connection_id":"…","expires_at":"…"}`.
57
+ * `{"type":"authenticate","ticket":"…","client_id":"…"}`, where `client_id` is optional. The
58
+ * reply is `{"type":"authenticated","client_id":"…","connection_id":"…","expires_at":"…"}`.
60
59
  * `connection_id` identifies this connection; it is assigned by EventBus and changes on
61
60
  * every reconnection.
62
- * 3. Send `{"type":"subscribe","id":"…","topics":[…]}`. Each topic must be one of the returned
61
+ * 3. Only after `authenticated`, send `{"type":"subscribe","id":"…","topics":[…]}`; a
62
+ * subscription sent before is rejected. Each topic must be one of the returned
63
63
  * `topics` or lie within one of them, for example by naming a key level where the ticket has
64
64
  * `#`; a batch with any other topic is rejected as a whole. The reply is `subscribed`.
65
- * `unsubscribe` takes the same form and replies `unsubscribed`. Both may be sent at any time
66
- * while the connection is open.
65
+ * `unsubscribe` takes the same form and replies `unsubscribed`.
67
66
  * 4. Messages arrive as `{"type":"messages","messages":[…]}`, each element an `EventMessage`. A
68
67
  * message matching several subscriptions on one connection arrives once for each of them.
69
68
  * 5. A connection may switch to another ticket of the same user at any time by sending
70
69
  * `authenticate` again: to renew before `expires_at`, to move from an account ticket to a
71
- * project ticket, or to move to another project. `client_id` may be omitted while the
72
- * `client_id_prefix` stays the same; when it changes, a client ID under the new prefix is
73
- * required. Subscriptions the new ticket does not cover are removed at once and reported in a
70
+ * project ticket, or to move to another project. Wait for its `authenticated` reply before
71
+ * changing subscriptions; if it is rejected, the previous ticket stays in effect. `client_id`
72
+ * may be omitted to keep the current one. Subscriptions the new ticket does not cover are removed at once and reported in a
74
73
  * `{"type":"revoked","topics":[…]}` frame. A ticket for another user closes the connection
75
74
  * with code 4401, as does letting the ticket expire.
76
75
  *
77
76
  * A connection holding a project ticket may publish the project's own events with
78
- * `{"type":"publish","id":"…","messages":[{"event":"…","key":"…","subject":"…","data":{…}}]}`;
77
+ * `{"type":"publish","id":"…","messages":[{"event":"…","key":"…","recipient":{"id":"…"},"data":{…}}]}`;
79
78
  * the reply is `published` with the identity of each message. `ping` is answered with `pong`.
80
79
  * A rejected request is answered with `{"type":"error","id":"…","code":"…","message":"…"}`.
81
80
  * Every reply carries the `id` of the request it answers.
@@ -606,8 +605,7 @@ export declare const getCreateAccountRealtimeTicketUrl: () => string;
606
605
  /**
607
606
  * Issues a short-lived ticket for a caller who has not selected a project, or belongs to none. Only
608
607
  * platform events are accepted, and the ticket covers only messages sent to the caller outside
609
- * any project or to no recipient. The ticket cannot publish. Its `client_id_prefix` is `user.{user_id}.`. The
610
- * ticket lives no longer than the token it was created with.
608
+ * any project or to no recipient. The ticket cannot publish. The ticket lives no longer than the token it was created with.
611
609
  * @summary Create an account realtime ticket
612
610
  */
613
611
  export declare const createAccountRealtimeTicket: (realtimeTicketRequest: RealtimeTicketRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<createAccountRealtimeTicketResponse>;
@@ -369,8 +369,7 @@ export const getCreateAccountRealtimeTicketUrl = () => {
369
369
  /**
370
370
  * Issues a short-lived ticket for a caller who has not selected a project, or belongs to none. Only
371
371
  * platform events are accepted, and the ticket covers only messages sent to the caller outside
372
- * any project or to no recipient. The ticket cannot publish. Its `client_id_prefix` is `user.{user_id}.`. The
373
- * ticket lives no longer than the token it was created with.
372
+ * any project or to no recipient. The ticket cannot publish. The ticket lives no longer than the token it was created with.
374
373
  * @summary Create an account realtime ticket
375
374
  */
376
375
  export const createAccountRealtimeTicket = async (realtimeTicketRequest, options, fetchFn) => {
@@ -28,54 +28,53 @@
28
28
  * wait for consumers. Messages are not stored and are not replayed: a consumer that connects
29
29
  * later does not receive earlier messages.
30
30
  *
31
- * Messages published through this API are sent to the current project. A message may name one
32
- * `subject`, a member of the project; it is then sent to that member only. Without a subject it is
33
- * sent to every member of the project.
31
+ * Messages published through this API are sent to the current project. A message may name a
32
+ * `recipient`, a member of the project; it is then sent to that member only. Without a recipient
33
+ * it is sent to every member of the project.
34
34
  *
35
- * Every publication names a `client_id`. It starts with the prefix returned with a realtime
36
- * ticket, `user.{user_id}.project.{project_id}.`, followed by one segment chosen by the
37
- * client, such as a random identifier per browser tab. Receivers get it unchanged, so a client
38
- * can recognise its own messages. A client ID does not need to be unique: several connections
39
- * may share one.
35
+ * Every message names its `sender`: an `id` and the `name` the publisher had when the message was
36
+ * accepted. A publication may also carry a `client_id`, any label the client chooses, such as one
37
+ * per browser tab. Receivers get it unchanged, so a client can recognise its own messages by
38
+ * `sender` and `client_id`. A client ID need not be unique; a realtime connection is identified
39
+ * by its `connection_id`.
40
40
  *
41
41
  * ## Realtime
42
42
  *
43
- * Every message has a topic `{event}/{project_id|-}/{subject|-}/{key levels}`, where `-` stands
44
- * for a missing recipient and the key, split at `/`, supplies the remaining levels. A topic filter
43
+ * Every message has a topic `{event}/{recipient project_id|-}/{recipient id|-}/{key levels}`, where
44
+ * `-` stands for a missing recipient and the key, split at `/`, supplies the remaining levels. A topic filter
45
45
  * uses `+` to match exactly one level and `#`, only as the last level, to match that level and
46
46
  * every level below it, including none. For example, `{event}/{project_id}/-/#` matches every
47
47
  * message sent to the members of a project, and `{event}/-/{user_id}/#` every message sent to one
48
48
  * person outside any project.
49
49
  *
50
50
  * 1. Create a ticket with `POST /api/v1/realtime/tickets`, naming the events to receive. The
51
- * response lists the topic filters the ticket covers and the `client_id_prefix` to use. For a
52
- * platform event they cover messages sent to the caller, messages sent to no recipient and,
51
+ * response lists the topic filters the ticket covers. For a platform event they cover messages sent to the caller, messages sent to no recipient and,
53
52
  * where the caller's permissions allow, messages sent within the project; for a project event
54
53
  * they cover messages sent within the project. Without a selected project, use
55
54
  * `POST /api/v1/account/realtime/tickets`; such a ticket covers only messages sent to the
56
55
  * caller or to no recipient, and cannot publish.
57
56
  * 2. Open a WebSocket to `wss://eventbus.leaflow.cloud/realtime` and send, within 15 seconds:
58
- * `{"type":"authenticate","ticket":"…","client_id":"…"}`. The reply is
59
- * `{"type":"authenticated","client_id":"…","connection_id":"…","expires_at":"…"}`.
57
+ * `{"type":"authenticate","ticket":"…","client_id":"…"}`, where `client_id` is optional. The
58
+ * reply is `{"type":"authenticated","client_id":"…","connection_id":"…","expires_at":"…"}`.
60
59
  * `connection_id` identifies this connection; it is assigned by EventBus and changes on
61
60
  * every reconnection.
62
- * 3. Send `{"type":"subscribe","id":"…","topics":[…]}`. Each topic must be one of the returned
61
+ * 3. Only after `authenticated`, send `{"type":"subscribe","id":"…","topics":[…]}`; a
62
+ * subscription sent before is rejected. Each topic must be one of the returned
63
63
  * `topics` or lie within one of them, for example by naming a key level where the ticket has
64
64
  * `#`; a batch with any other topic is rejected as a whole. The reply is `subscribed`.
65
- * `unsubscribe` takes the same form and replies `unsubscribed`. Both may be sent at any time
66
- * while the connection is open.
65
+ * `unsubscribe` takes the same form and replies `unsubscribed`.
67
66
  * 4. Messages arrive as `{"type":"messages","messages":[…]}`, each element an `EventMessage`. A
68
67
  * message matching several subscriptions on one connection arrives once for each of them.
69
68
  * 5. A connection may switch to another ticket of the same user at any time by sending
70
69
  * `authenticate` again: to renew before `expires_at`, to move from an account ticket to a
71
- * project ticket, or to move to another project. `client_id` may be omitted while the
72
- * `client_id_prefix` stays the same; when it changes, a client ID under the new prefix is
73
- * required. Subscriptions the new ticket does not cover are removed at once and reported in a
70
+ * project ticket, or to move to another project. Wait for its `authenticated` reply before
71
+ * changing subscriptions; if it is rejected, the previous ticket stays in effect. `client_id`
72
+ * may be omitted to keep the current one. Subscriptions the new ticket does not cover are removed at once and reported in a
74
73
  * `{"type":"revoked","topics":[…]}` frame. A ticket for another user closes the connection
75
74
  * with code 4401, as does letting the ticket expire.
76
75
  *
77
76
  * A connection holding a project ticket may publish the project's own events with
78
- * `{"type":"publish","id":"…","messages":[{"event":"…","key":"…","subject":"…","data":{…}}]}`;
77
+ * `{"type":"publish","id":"…","messages":[{"event":"…","key":"…","recipient":{"id":"…"},"data":{…}}]}`;
79
78
  * the reply is `published` with the identity of each message. `ping` is answered with `pong`.
80
79
  * A rejected request is answered with `{"type":"error","id":"…","code":"…","message":"…"}`.
81
80
  * Every reply carries the `id` of the request it answers.
@@ -377,6 +376,13 @@ export interface UpdateEventRequest {
377
376
  tags?: string[];
378
377
  status?: EventStatus;
379
378
  }
379
+ /**
380
+ * A member of the current project; when set, only that member receives the message
381
+ */
382
+ export interface PublicationRecipient {
383
+ /** @maxLength 128 */
384
+ id: string;
385
+ }
380
386
  /**
381
387
  * The message payload
382
388
  */
@@ -400,21 +406,16 @@ export interface Publication {
400
406
  * @maxLength 256
401
407
  */
402
408
  key?: string;
403
- /**
404
- * A member of the current project; when set, only that member receives the message
405
- * @maxLength 128
406
- */
407
- subject?: string;
409
+ recipient?: PublicationRecipient;
408
410
  /** The message payload */
409
411
  data: PublicationData;
410
412
  }
411
413
  export interface PublishRequest {
412
414
  /**
413
- * The publishing client: the caller's prefix, `user.{user_id}.project.{project_id}.`,
414
- * followed by one segment of up to 64 letters, digits, hyphens or underscores
415
- * @maxLength 192
415
+ * Any label for the publishing client, such as one per browser tab; it need not be unique
416
+ * @maxLength 128
416
417
  */
417
- client_id: string;
418
+ client_id?: string;
418
419
  /**
419
420
  * @minItems 1
420
421
  * @maxItems 64
@@ -452,14 +453,30 @@ export interface RealtimeTicket {
452
453
  ticket: string;
453
454
  /** When the ticket expires, in UTC RFC 3339; renew the connection before then */
454
455
  expires_at: string;
455
- /** The prefix every client ID on this ticket must start with */
456
- client_id_prefix: string;
457
456
  /** The topic filters the ticket covers; subscribe to these or to filters within them */
458
457
  topics: string[];
459
458
  }
460
459
  export type EventMessageData = {
461
460
  [key: string]: unknown;
462
461
  };
462
+ /**
463
+ * Who published a message, as established when it was accepted
464
+ */
465
+ export interface Sender {
466
+ /** The publisher's identity */
467
+ id: string;
468
+ /** The publisher's display name when the message was accepted; absent when none is known */
469
+ name?: string;
470
+ }
471
+ /**
472
+ * Who a message is sent to; absent for a message sent to no recipient. With only `project_id` the
473
+ * message goes to the members of the project; with only `id` it goes to that person outside any
474
+ * project; with both it goes to that person as a member of the project.
475
+ */
476
+ export interface Recipient {
477
+ project_id?: string;
478
+ id?: string;
479
+ }
463
480
  /**
464
481
  * A message as delivered over a realtime connection
465
482
  */
@@ -469,16 +486,12 @@ export interface EventMessage {
469
486
  /** @minimum 1 */
470
487
  version: number;
471
488
  key?: string;
472
- /** The publisher; the platform service for an event in a platform namespace, or the publishing user otherwise */
473
- source: string;
474
- /** The publishing client, exactly as it identified itself */
475
- client_id: string;
489
+ sender: Sender;
490
+ recipient?: Recipient;
491
+ /** The label the publishing client gave, exactly as given; absent when it gave none */
492
+ client_id?: string;
476
493
  /** The realtime connection the message was published on; absent for messages published over HTTP or by platform services */
477
494
  connection_id?: string;
478
- /** The project the message was sent to */
479
- project_id?: string;
480
- /** The person the message was sent to */
481
- subject?: string;
482
495
  created_at: string;
483
496
  data: EventMessageData;
484
497
  }
@@ -28,54 +28,53 @@
28
28
  * wait for consumers. Messages are not stored and are not replayed: a consumer that connects
29
29
  * later does not receive earlier messages.
30
30
  *
31
- * Messages published through this API are sent to the current project. A message may name one
32
- * `subject`, a member of the project; it is then sent to that member only. Without a subject it is
33
- * sent to every member of the project.
31
+ * Messages published through this API are sent to the current project. A message may name a
32
+ * `recipient`, a member of the project; it is then sent to that member only. Without a recipient
33
+ * it is sent to every member of the project.
34
34
  *
35
- * Every publication names a `client_id`. It starts with the prefix returned with a realtime
36
- * ticket, `user.{user_id}.project.{project_id}.`, followed by one segment chosen by the
37
- * client, such as a random identifier per browser tab. Receivers get it unchanged, so a client
38
- * can recognise its own messages. A client ID does not need to be unique: several connections
39
- * may share one.
35
+ * Every message names its `sender`: an `id` and the `name` the publisher had when the message was
36
+ * accepted. A publication may also carry a `client_id`, any label the client chooses, such as one
37
+ * per browser tab. Receivers get it unchanged, so a client can recognise its own messages by
38
+ * `sender` and `client_id`. A client ID need not be unique; a realtime connection is identified
39
+ * by its `connection_id`.
40
40
  *
41
41
  * ## Realtime
42
42
  *
43
- * Every message has a topic `{event}/{project_id|-}/{subject|-}/{key levels}`, where `-` stands
44
- * for a missing recipient and the key, split at `/`, supplies the remaining levels. A topic filter
43
+ * Every message has a topic `{event}/{recipient project_id|-}/{recipient id|-}/{key levels}`, where
44
+ * `-` stands for a missing recipient and the key, split at `/`, supplies the remaining levels. A topic filter
45
45
  * uses `+` to match exactly one level and `#`, only as the last level, to match that level and
46
46
  * every level below it, including none. For example, `{event}/{project_id}/-/#` matches every
47
47
  * message sent to the members of a project, and `{event}/-/{user_id}/#` every message sent to one
48
48
  * person outside any project.
49
49
  *
50
50
  * 1. Create a ticket with `POST /api/v1/realtime/tickets`, naming the events to receive. The
51
- * response lists the topic filters the ticket covers and the `client_id_prefix` to use. For a
52
- * platform event they cover messages sent to the caller, messages sent to no recipient and,
51
+ * response lists the topic filters the ticket covers. For a platform event they cover messages sent to the caller, messages sent to no recipient and,
53
52
  * where the caller's permissions allow, messages sent within the project; for a project event
54
53
  * they cover messages sent within the project. Without a selected project, use
55
54
  * `POST /api/v1/account/realtime/tickets`; such a ticket covers only messages sent to the
56
55
  * caller or to no recipient, and cannot publish.
57
56
  * 2. Open a WebSocket to `wss://eventbus.leaflow.cloud/realtime` and send, within 15 seconds:
58
- * `{"type":"authenticate","ticket":"…","client_id":"…"}`. The reply is
59
- * `{"type":"authenticated","client_id":"…","connection_id":"…","expires_at":"…"}`.
57
+ * `{"type":"authenticate","ticket":"…","client_id":"…"}`, where `client_id` is optional. The
58
+ * reply is `{"type":"authenticated","client_id":"…","connection_id":"…","expires_at":"…"}`.
60
59
  * `connection_id` identifies this connection; it is assigned by EventBus and changes on
61
60
  * every reconnection.
62
- * 3. Send `{"type":"subscribe","id":"…","topics":[…]}`. Each topic must be one of the returned
61
+ * 3. Only after `authenticated`, send `{"type":"subscribe","id":"…","topics":[…]}`; a
62
+ * subscription sent before is rejected. Each topic must be one of the returned
63
63
  * `topics` or lie within one of them, for example by naming a key level where the ticket has
64
64
  * `#`; a batch with any other topic is rejected as a whole. The reply is `subscribed`.
65
- * `unsubscribe` takes the same form and replies `unsubscribed`. Both may be sent at any time
66
- * while the connection is open.
65
+ * `unsubscribe` takes the same form and replies `unsubscribed`.
67
66
  * 4. Messages arrive as `{"type":"messages","messages":[…]}`, each element an `EventMessage`. A
68
67
  * message matching several subscriptions on one connection arrives once for each of them.
69
68
  * 5. A connection may switch to another ticket of the same user at any time by sending
70
69
  * `authenticate` again: to renew before `expires_at`, to move from an account ticket to a
71
- * project ticket, or to move to another project. `client_id` may be omitted while the
72
- * `client_id_prefix` stays the same; when it changes, a client ID under the new prefix is
73
- * required. Subscriptions the new ticket does not cover are removed at once and reported in a
70
+ * project ticket, or to move to another project. Wait for its `authenticated` reply before
71
+ * changing subscriptions; if it is rejected, the previous ticket stays in effect. `client_id`
72
+ * may be omitted to keep the current one. Subscriptions the new ticket does not cover are removed at once and reported in a
74
73
  * `{"type":"revoked","topics":[…]}` frame. A ticket for another user closes the connection
75
74
  * with code 4401, as does letting the ticket expire.
76
75
  *
77
76
  * A connection holding a project ticket may publish the project's own events with
78
- * `{"type":"publish","id":"…","messages":[{"event":"…","key":"…","subject":"…","data":{…}}]}`;
77
+ * `{"type":"publish","id":"…","messages":[{"event":"…","key":"…","recipient":{"id":"…"},"data":{…}}]}`;
79
78
  * the reply is `published` with the identity of each message. `ping` is answered with `pong`.
80
79
  * A rejected request is answered with `{"type":"error","id":"…","code":"…","message":"…"}`.
81
80
  * Every reply carries the `id` of the request it answers.
@@ -237,12 +236,14 @@ export declare const GetEventVersionParams: zod.ZodObject<{
237
236
  * @summary Publish event messages
238
237
  */
239
238
  export declare const PublishEventsBody: zod.ZodObject<{
240
- client_id: zod.ZodString;
239
+ client_id: zod.ZodOptional<zod.ZodString>;
241
240
  messages: zod.ZodArray<zod.ZodObject<{
242
241
  event: zod.ZodString;
243
242
  version: zod.ZodDefault<zod.ZodInt>;
244
243
  key: zod.ZodOptional<zod.ZodString>;
245
- subject: zod.ZodOptional<zod.ZodString>;
244
+ recipient: zod.ZodOptional<zod.ZodObject<{
245
+ id: zod.ZodString;
246
+ }, zod.z.core.$strict>>;
246
247
  data: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
247
248
  }, zod.z.core.$strict>>;
248
249
  }, zod.z.core.$strict>;
@@ -262,8 +263,7 @@ export declare const CreateRealtimeTicketBody: zod.ZodObject<{
262
263
  /**
263
264
  * Issues a short-lived ticket for a caller who has not selected a project, or belongs to none. Only
264
265
  * platform events are accepted, and the ticket covers only messages sent to the caller outside
265
- * any project or to no recipient. The ticket cannot publish. Its `client_id_prefix` is `user.{user_id}.`. The
266
- * ticket lives no longer than the token it was created with.
266
+ * any project or to no recipient. The ticket cannot publish. The ticket lives no longer than the token it was created with.
267
267
  * @summary Create an account realtime ticket
268
268
  */
269
269
  export declare const CreateAccountRealtimeTicketBody: zod.ZodObject<{
@@ -28,54 +28,53 @@
28
28
  * wait for consumers. Messages are not stored and are not replayed: a consumer that connects
29
29
  * later does not receive earlier messages.
30
30
  *
31
- * Messages published through this API are sent to the current project. A message may name one
32
- * `subject`, a member of the project; it is then sent to that member only. Without a subject it is
33
- * sent to every member of the project.
31
+ * Messages published through this API are sent to the current project. A message may name a
32
+ * `recipient`, a member of the project; it is then sent to that member only. Without a recipient
33
+ * it is sent to every member of the project.
34
34
  *
35
- * Every publication names a `client_id`. It starts with the prefix returned with a realtime
36
- * ticket, `user.{user_id}.project.{project_id}.`, followed by one segment chosen by the
37
- * client, such as a random identifier per browser tab. Receivers get it unchanged, so a client
38
- * can recognise its own messages. A client ID does not need to be unique: several connections
39
- * may share one.
35
+ * Every message names its `sender`: an `id` and the `name` the publisher had when the message was
36
+ * accepted. A publication may also carry a `client_id`, any label the client chooses, such as one
37
+ * per browser tab. Receivers get it unchanged, so a client can recognise its own messages by
38
+ * `sender` and `client_id`. A client ID need not be unique; a realtime connection is identified
39
+ * by its `connection_id`.
40
40
  *
41
41
  * ## Realtime
42
42
  *
43
- * Every message has a topic `{event}/{project_id|-}/{subject|-}/{key levels}`, where `-` stands
44
- * for a missing recipient and the key, split at `/`, supplies the remaining levels. A topic filter
43
+ * Every message has a topic `{event}/{recipient project_id|-}/{recipient id|-}/{key levels}`, where
44
+ * `-` stands for a missing recipient and the key, split at `/`, supplies the remaining levels. A topic filter
45
45
  * uses `+` to match exactly one level and `#`, only as the last level, to match that level and
46
46
  * every level below it, including none. For example, `{event}/{project_id}/-/#` matches every
47
47
  * message sent to the members of a project, and `{event}/-/{user_id}/#` every message sent to one
48
48
  * person outside any project.
49
49
  *
50
50
  * 1. Create a ticket with `POST /api/v1/realtime/tickets`, naming the events to receive. The
51
- * response lists the topic filters the ticket covers and the `client_id_prefix` to use. For a
52
- * platform event they cover messages sent to the caller, messages sent to no recipient and,
51
+ * response lists the topic filters the ticket covers. For a platform event they cover messages sent to the caller, messages sent to no recipient and,
53
52
  * where the caller's permissions allow, messages sent within the project; for a project event
54
53
  * they cover messages sent within the project. Without a selected project, use
55
54
  * `POST /api/v1/account/realtime/tickets`; such a ticket covers only messages sent to the
56
55
  * caller or to no recipient, and cannot publish.
57
56
  * 2. Open a WebSocket to `wss://eventbus.leaflow.cloud/realtime` and send, within 15 seconds:
58
- * `{"type":"authenticate","ticket":"…","client_id":"…"}`. The reply is
59
- * `{"type":"authenticated","client_id":"…","connection_id":"…","expires_at":"…"}`.
57
+ * `{"type":"authenticate","ticket":"…","client_id":"…"}`, where `client_id` is optional. The
58
+ * reply is `{"type":"authenticated","client_id":"…","connection_id":"…","expires_at":"…"}`.
60
59
  * `connection_id` identifies this connection; it is assigned by EventBus and changes on
61
60
  * every reconnection.
62
- * 3. Send `{"type":"subscribe","id":"…","topics":[…]}`. Each topic must be one of the returned
61
+ * 3. Only after `authenticated`, send `{"type":"subscribe","id":"…","topics":[…]}`; a
62
+ * subscription sent before is rejected. Each topic must be one of the returned
63
63
  * `topics` or lie within one of them, for example by naming a key level where the ticket has
64
64
  * `#`; a batch with any other topic is rejected as a whole. The reply is `subscribed`.
65
- * `unsubscribe` takes the same form and replies `unsubscribed`. Both may be sent at any time
66
- * while the connection is open.
65
+ * `unsubscribe` takes the same form and replies `unsubscribed`.
67
66
  * 4. Messages arrive as `{"type":"messages","messages":[…]}`, each element an `EventMessage`. A
68
67
  * message matching several subscriptions on one connection arrives once for each of them.
69
68
  * 5. A connection may switch to another ticket of the same user at any time by sending
70
69
  * `authenticate` again: to renew before `expires_at`, to move from an account ticket to a
71
- * project ticket, or to move to another project. `client_id` may be omitted while the
72
- * `client_id_prefix` stays the same; when it changes, a client ID under the new prefix is
73
- * required. Subscriptions the new ticket does not cover are removed at once and reported in a
70
+ * project ticket, or to move to another project. Wait for its `authenticated` reply before
71
+ * changing subscriptions; if it is rejected, the previous ticket stays in effect. `client_id`
72
+ * may be omitted to keep the current one. Subscriptions the new ticket does not cover are removed at once and reported in a
74
73
  * `{"type":"revoked","topics":[…]}` frame. A ticket for another user closes the connection
75
74
  * with code 4401, as does letting the ticket expire.
76
75
  *
77
76
  * A connection holding a project ticket may publish the project's own events with
78
- * `{"type":"publish","id":"…","messages":[{"event":"…","key":"…","subject":"…","data":{…}}]}`;
77
+ * `{"type":"publish","id":"…","messages":[{"event":"…","key":"…","recipient":{"id":"…"},"data":{…}}]}`;
79
78
  * the reply is `published` with the identity of each message. `ping` is answered with `pong`.
80
79
  * A rejected request is answered with `{"type":"error","id":"…","code":"…","message":"…"}`.
81
80
  * Every reply carries the `id` of the request it answers.
@@ -299,8 +298,7 @@ export const CreateRealtimeTicketBody = RealtimeTicketRequest;
299
298
  /**
300
299
  * Issues a short-lived ticket for a caller who has not selected a project, or belongs to none. Only
301
300
  * platform events are accepted, and the ticket covers only messages sent to the caller outside
302
- * any project or to no recipient. The ticket cannot publish. Its `client_id_prefix` is `user.{user_id}.`. The
303
- * ticket lives no longer than the token it was created with.
301
+ * any project or to no recipient. The ticket cannot publish. The ticket lives no longer than the token it was created with.
304
302
  * @summary Create an account realtime ticket
305
303
  */
306
304
  export const CreateAccountRealtimeTicketBody = RealtimeTicketRequest;
@@ -28,54 +28,53 @@
28
28
  * wait for consumers. Messages are not stored and are not replayed: a consumer that connects
29
29
  * later does not receive earlier messages.
30
30
  *
31
- * Messages published through this API are sent to the current project. A message may name one
32
- * `subject`, a member of the project; it is then sent to that member only. Without a subject it is
33
- * sent to every member of the project.
31
+ * Messages published through this API are sent to the current project. A message may name a
32
+ * `recipient`, a member of the project; it is then sent to that member only. Without a recipient
33
+ * it is sent to every member of the project.
34
34
  *
35
- * Every publication names a `client_id`. It starts with the prefix returned with a realtime
36
- * ticket, `user.{user_id}.project.{project_id}.`, followed by one segment chosen by the
37
- * client, such as a random identifier per browser tab. Receivers get it unchanged, so a client
38
- * can recognise its own messages. A client ID does not need to be unique: several connections
39
- * may share one.
35
+ * Every message names its `sender`: an `id` and the `name` the publisher had when the message was
36
+ * accepted. A publication may also carry a `client_id`, any label the client chooses, such as one
37
+ * per browser tab. Receivers get it unchanged, so a client can recognise its own messages by
38
+ * `sender` and `client_id`. A client ID need not be unique; a realtime connection is identified
39
+ * by its `connection_id`.
40
40
  *
41
41
  * ## Realtime
42
42
  *
43
- * Every message has a topic `{event}/{project_id|-}/{subject|-}/{key levels}`, where `-` stands
44
- * for a missing recipient and the key, split at `/`, supplies the remaining levels. A topic filter
43
+ * Every message has a topic `{event}/{recipient project_id|-}/{recipient id|-}/{key levels}`, where
44
+ * `-` stands for a missing recipient and the key, split at `/`, supplies the remaining levels. A topic filter
45
45
  * uses `+` to match exactly one level and `#`, only as the last level, to match that level and
46
46
  * every level below it, including none. For example, `{event}/{project_id}/-/#` matches every
47
47
  * message sent to the members of a project, and `{event}/-/{user_id}/#` every message sent to one
48
48
  * person outside any project.
49
49
  *
50
50
  * 1. Create a ticket with `POST /api/v1/realtime/tickets`, naming the events to receive. The
51
- * response lists the topic filters the ticket covers and the `client_id_prefix` to use. For a
52
- * platform event they cover messages sent to the caller, messages sent to no recipient and,
51
+ * response lists the topic filters the ticket covers. For a platform event they cover messages sent to the caller, messages sent to no recipient and,
53
52
  * where the caller's permissions allow, messages sent within the project; for a project event
54
53
  * they cover messages sent within the project. Without a selected project, use
55
54
  * `POST /api/v1/account/realtime/tickets`; such a ticket covers only messages sent to the
56
55
  * caller or to no recipient, and cannot publish.
57
56
  * 2. Open a WebSocket to `wss://eventbus.leaflow.cloud/realtime` and send, within 15 seconds:
58
- * `{"type":"authenticate","ticket":"…","client_id":"…"}`. The reply is
59
- * `{"type":"authenticated","client_id":"…","connection_id":"…","expires_at":"…"}`.
57
+ * `{"type":"authenticate","ticket":"…","client_id":"…"}`, where `client_id` is optional. The
58
+ * reply is `{"type":"authenticated","client_id":"…","connection_id":"…","expires_at":"…"}`.
60
59
  * `connection_id` identifies this connection; it is assigned by EventBus and changes on
61
60
  * every reconnection.
62
- * 3. Send `{"type":"subscribe","id":"…","topics":[…]}`. Each topic must be one of the returned
61
+ * 3. Only after `authenticated`, send `{"type":"subscribe","id":"…","topics":[…]}`; a
62
+ * subscription sent before is rejected. Each topic must be one of the returned
63
63
  * `topics` or lie within one of them, for example by naming a key level where the ticket has
64
64
  * `#`; a batch with any other topic is rejected as a whole. The reply is `subscribed`.
65
- * `unsubscribe` takes the same form and replies `unsubscribed`. Both may be sent at any time
66
- * while the connection is open.
65
+ * `unsubscribe` takes the same form and replies `unsubscribed`.
67
66
  * 4. Messages arrive as `{"type":"messages","messages":[…]}`, each element an `EventMessage`. A
68
67
  * message matching several subscriptions on one connection arrives once for each of them.
69
68
  * 5. A connection may switch to another ticket of the same user at any time by sending
70
69
  * `authenticate` again: to renew before `expires_at`, to move from an account ticket to a
71
- * project ticket, or to move to another project. `client_id` may be omitted while the
72
- * `client_id_prefix` stays the same; when it changes, a client ID under the new prefix is
73
- * required. Subscriptions the new ticket does not cover are removed at once and reported in a
70
+ * project ticket, or to move to another project. Wait for its `authenticated` reply before
71
+ * changing subscriptions; if it is rejected, the previous ticket stays in effect. `client_id`
72
+ * may be omitted to keep the current one. Subscriptions the new ticket does not cover are removed at once and reported in a
74
73
  * `{"type":"revoked","topics":[…]}` frame. A ticket for another user closes the connection
75
74
  * with code 4401, as does letting the ticket expire.
76
75
  *
77
76
  * A connection holding a project ticket may publish the project's own events with
78
- * `{"type":"publish","id":"…","messages":[{"event":"…","key":"…","subject":"…","data":{…}}]}`;
77
+ * `{"type":"publish","id":"…","messages":[{"event":"…","key":"…","recipient":{"id":"…"},"data":{…}}]}`;
79
78
  * the reply is `published` with the identity of each message. `ping` is answered with `pong`.
80
79
  * A rejected request is answered with `{"type":"error","id":"…","code":"…","message":"…"}`.
81
80
  * Every reply carries the `id` of the request it answers.