@leaflow/sdk 0.180.0 → 0.182.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 (114) hide show
  1. package/dist/compute/v2/generated/models.d.ts +37 -0
  2. package/dist/compute/v2/generated/models.js +5 -0
  3. package/dist/compute/v2/generated/validators/createElasticIPResponseBody.zod.d.ts +9 -0
  4. package/dist/compute/v2/generated/validators/createInstanceResponseBody.zod.d.ts +9 -0
  5. package/dist/compute/v2/generated/validators/createPrivateImageResponseBody.zod.d.ts +9 -0
  6. package/dist/compute/v2/generated/validators/createVolumeBackupResponseBody.zod.d.ts +9 -0
  7. package/dist/compute/v2/generated/validators/createVolumeResponseBody.zod.d.ts +9 -0
  8. package/dist/compute/v2/generated/validators/createVolumeSnapshotResponseBody.zod.d.ts +9 -0
  9. package/dist/compute/v2/generated/validators/deleteElasticIPResponseBody.zod.d.ts +9 -0
  10. package/dist/compute/v2/generated/validators/deleteInstanceResponseBody.zod.d.ts +9 -0
  11. package/dist/compute/v2/generated/validators/deletePrivateImageResponseBody.zod.d.ts +9 -0
  12. package/dist/compute/v2/generated/validators/deleteVolumeBackupResponseBody.zod.d.ts +9 -0
  13. package/dist/compute/v2/generated/validators/deleteVolumeResponseBody.zod.d.ts +9 -0
  14. package/dist/compute/v2/generated/validators/deleteVolumeSnapshotResponseBody.zod.d.ts +9 -0
  15. package/dist/compute/v2/generated/validators/elasticIP.zod.d.ts +9 -0
  16. package/dist/compute/v2/generated/validators/elasticIP.zod.js +4 -0
  17. package/dist/compute/v2/generated/validators/elasticIPListResponseBody.zod.d.ts +9 -0
  18. package/dist/compute/v2/generated/validators/instance.zod.d.ts +9 -0
  19. package/dist/compute/v2/generated/validators/instance.zod.js +4 -0
  20. package/dist/compute/v2/generated/validators/instanceListResponseBody.zod.d.ts +9 -0
  21. package/dist/compute/v2/generated/validators/latestOperation.zod.d.ts +46 -0
  22. package/dist/compute/v2/generated/validators/latestOperation.zod.js +46 -0
  23. package/dist/compute/v2/generated/validators/networkInterface.zod.d.ts +9 -0
  24. package/dist/compute/v2/generated/validators/networkInterface.zod.js +4 -0
  25. package/dist/compute/v2/generated/validators/networkInterfaceListResponseBody.zod.d.ts +9 -0
  26. package/dist/compute/v2/generated/validators/privateImageListResponseBody.zod.d.ts +9 -0
  27. package/dist/compute/v2/generated/validators/privateImageResource.zod.d.ts +9 -0
  28. package/dist/compute/v2/generated/validators/privateImageResource.zod.js +4 -0
  29. package/dist/compute/v2/generated/validators/rebuildInstanceResponseBody.zod.d.ts +9 -0
  30. package/dist/compute/v2/generated/validators/rescueInstanceResponseBody.zod.d.ts +9 -0
  31. package/dist/compute/v2/generated/validators/updateElasticIPResponseBody.zod.d.ts +9 -0
  32. package/dist/compute/v2/generated/validators/updateInstanceResponseBody.zod.d.ts +9 -0
  33. package/dist/compute/v2/generated/validators/updateVolumeResponseBody.zod.d.ts +9 -0
  34. package/dist/compute/v2/generated/validators/virtualPrivateCloud.zod.d.ts +9 -0
  35. package/dist/compute/v2/generated/validators/virtualPrivateCloud.zod.js +4 -0
  36. package/dist/compute/v2/generated/validators/virtualPrivateCloudListResponseBody.zod.d.ts +9 -0
  37. package/dist/compute/v2/generated/validators/virtualPrivateCloudPeeringListResponseBody.zod.d.ts +9 -0
  38. package/dist/compute/v2/generated/validators/virtualPrivateCloudPeeringResource.zod.d.ts +9 -0
  39. package/dist/compute/v2/generated/validators/virtualPrivateCloudPeeringResource.zod.js +4 -0
  40. package/dist/compute/v2/generated/validators/volumeBackupListResponseBody.zod.d.ts +9 -0
  41. package/dist/compute/v2/generated/validators/volumeBackupResource.zod.d.ts +9 -0
  42. package/dist/compute/v2/generated/validators/volumeBackupResource.zod.js +4 -0
  43. package/dist/compute/v2/generated/validators/volumeListResponseBody.zod.d.ts +9 -0
  44. package/dist/compute/v2/generated/validators/volumeResource.zod.d.ts +9 -0
  45. package/dist/compute/v2/generated/validators/volumeResource.zod.js +4 -0
  46. package/dist/compute/v2/generated/validators/volumeSnapshotListResponseBody.zod.d.ts +9 -0
  47. package/dist/compute/v2/generated/validators/volumeSnapshotResource.zod.d.ts +9 -0
  48. package/dist/compute/v2/generated/validators/volumeSnapshotResource.zod.js +4 -0
  49. package/dist/eventbus/v1/generated/functions.d.ts +21 -23
  50. package/dist/eventbus/v1/generated/functions.js +1 -2
  51. package/dist/eventbus/v1/generated/models.d.ts +53 -40
  52. package/dist/eventbus/v1/generated/schemas.zod.d.ts +25 -25
  53. package/dist/eventbus/v1/generated/schemas.zod.js +21 -23
  54. package/dist/eventbus/v1/generated/validators/createEventRequest.zod.d.ts +20 -21
  55. package/dist/eventbus/v1/generated/validators/createEventRequest.zod.js +20 -21
  56. package/dist/eventbus/v1/generated/validators/createNamespaceRequest.zod.d.ts +20 -21
  57. package/dist/eventbus/v1/generated/validators/createNamespaceRequest.zod.js +20 -21
  58. package/dist/eventbus/v1/generated/validators/createVersionRequest.zod.d.ts +20 -21
  59. package/dist/eventbus/v1/generated/validators/createVersionRequest.zod.js +20 -21
  60. package/dist/eventbus/v1/generated/validators/cursorPagination.zod.d.ts +20 -21
  61. package/dist/eventbus/v1/generated/validators/cursorPagination.zod.js +20 -21
  62. package/dist/eventbus/v1/generated/validators/error.zod.d.ts +20 -21
  63. package/dist/eventbus/v1/generated/validators/error.zod.js +20 -21
  64. package/dist/eventbus/v1/generated/validators/errorStatus.zod.d.ts +20 -21
  65. package/dist/eventbus/v1/generated/validators/errorStatus.zod.js +20 -21
  66. package/dist/eventbus/v1/generated/validators/eventDetail.zod.d.ts +20 -21
  67. package/dist/eventbus/v1/generated/validators/eventDetail.zod.js +20 -21
  68. package/dist/eventbus/v1/generated/validators/eventList.zod.d.ts +20 -21
  69. package/dist/eventbus/v1/generated/validators/eventList.zod.js +20 -21
  70. package/dist/eventbus/v1/generated/validators/eventMessage.zod.d.ts +29 -25
  71. package/dist/eventbus/v1/generated/validators/eventMessage.zod.js +27 -26
  72. package/dist/eventbus/v1/generated/validators/eventResource.zod.d.ts +20 -21
  73. package/dist/eventbus/v1/generated/validators/eventResource.zod.js +20 -21
  74. package/dist/eventbus/v1/generated/validators/eventStatus.zod.d.ts +20 -21
  75. package/dist/eventbus/v1/generated/validators/eventStatus.zod.js +20 -21
  76. package/dist/eventbus/v1/generated/validators/eventVersion.zod.d.ts +20 -21
  77. package/dist/eventbus/v1/generated/validators/eventVersion.zod.js +20 -21
  78. package/dist/eventbus/v1/generated/validators/fieldViolation.zod.d.ts +20 -21
  79. package/dist/eventbus/v1/generated/validators/fieldViolation.zod.js +20 -21
  80. package/dist/eventbus/v1/generated/validators/listEventsParams.zod.d.ts +20 -21
  81. package/dist/eventbus/v1/generated/validators/listEventsParams.zod.js +20 -21
  82. package/dist/eventbus/v1/generated/validators/listNamespacesParams.zod.d.ts +20 -21
  83. package/dist/eventbus/v1/generated/validators/listNamespacesParams.zod.js +20 -21
  84. package/dist/eventbus/v1/generated/validators/namespaceList.zod.d.ts +20 -21
  85. package/dist/eventbus/v1/generated/validators/namespaceList.zod.js +20 -21
  86. package/dist/eventbus/v1/generated/validators/namespaceResource.zod.d.ts +20 -21
  87. package/dist/eventbus/v1/generated/validators/namespaceResource.zod.js +20 -21
  88. package/dist/eventbus/v1/generated/validators/namespaceStatus.zod.d.ts +20 -21
  89. package/dist/eventbus/v1/generated/validators/namespaceStatus.zod.js +20 -21
  90. package/dist/eventbus/v1/generated/validators/offsetPagination.zod.d.ts +20 -21
  91. package/dist/eventbus/v1/generated/validators/offsetPagination.zod.js +20 -21
  92. package/dist/eventbus/v1/generated/validators/publication.zod.d.ts +23 -23
  93. package/dist/eventbus/v1/generated/validators/publication.zod.js +22 -27
  94. package/dist/eventbus/v1/generated/validators/publicationRecipient.zod.d.ts +89 -0
  95. package/dist/eventbus/v1/generated/validators/publicationRecipient.zod.js +89 -0
  96. package/dist/eventbus/v1/generated/validators/publishRequest.zod.d.ts +25 -24
  97. package/dist/eventbus/v1/generated/validators/publishRequest.zod.js +23 -23
  98. package/dist/eventbus/v1/generated/validators/publishResponse.zod.d.ts +20 -21
  99. package/dist/eventbus/v1/generated/validators/publishResponse.zod.js +20 -21
  100. package/dist/eventbus/v1/generated/validators/publishedMessage.zod.d.ts +20 -21
  101. package/dist/eventbus/v1/generated/validators/publishedMessage.zod.js +20 -21
  102. package/dist/eventbus/v1/generated/validators/realtimeTicket.zod.d.ts +20 -22
  103. package/dist/eventbus/v1/generated/validators/realtimeTicket.zod.js +20 -24
  104. package/dist/eventbus/v1/generated/validators/realtimeTicketRequest.zod.d.ts +20 -21
  105. package/dist/eventbus/v1/generated/validators/realtimeTicketRequest.zod.js +20 -21
  106. package/dist/eventbus/v1/generated/validators/recipient.zod.d.ts +89 -0
  107. package/dist/eventbus/v1/generated/validators/recipient.zod.js +89 -0
  108. package/dist/eventbus/v1/generated/validators/sender.zod.d.ts +89 -0
  109. package/dist/eventbus/v1/generated/validators/sender.zod.js +92 -0
  110. package/dist/eventbus/v1/generated/validators/updateEventRequest.zod.d.ts +20 -21
  111. package/dist/eventbus/v1/generated/validators/updateEventRequest.zod.js +20 -21
  112. package/dist/eventbus/v1/generated/validators/updateNamespaceRequest.zod.d.ts +20 -21
  113. package/dist/eventbus/v1/generated/validators/updateNamespaceRequest.zod.js +20 -21
  114. 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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -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.