@iveri/contracts 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/cjs/api/unibox/realtime.type.d.ts +13 -1
- package/dist/cjs/api/unibox/realtime.type.d.ts.map +1 -1
- package/dist/cjs/api/unibox/realtime.type.js +1 -0
- package/dist/cjs/api/unibox/realtime.type.js.map +1 -1
- package/dist/esm/api/unibox/realtime.type.d.ts +13 -1
- package/dist/esm/api/unibox/realtime.type.d.ts.map +1 -1
- package/dist/esm/api/unibox/realtime.type.js +1 -0
- package/dist/esm/api/unibox/realtime.type.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
The wire contract every Iveri service and frontend compiles against: shared types and plain
|
|
4
4
|
enums, and nothing else.
|
|
5
5
|
|
|
6
|
+
Release `0.17.0` adds `realtime.unsubscribe`. Subscribing is additive and capped per socket, so
|
|
7
|
+
without it a long-lived inbox that pages through conversations reaches the cap and then silently
|
|
8
|
+
stops receiving anything.
|
|
9
|
+
|
|
6
10
|
Release `0.16.0` adds the Unibox realtime contract under `@iveri/contracts/unibox` —
|
|
7
11
|
`RealtimeConversationEvent`, the publish body, the socket message shapes and the event-name
|
|
8
12
|
constants — plus the `unibox:realtime:publish` permission. It is shared by three repos at once
|
|
@@ -3,6 +3,7 @@ import type { RealtimeConversationEvent } from './realtime-event.enum.js';
|
|
|
3
3
|
/** Socket.IO event names a client sends. */
|
|
4
4
|
export declare const REALTIME_CLIENT_EVENT: {
|
|
5
5
|
readonly SUBSCRIBE: "realtime.subscribe";
|
|
6
|
+
readonly UNSUBSCRIBE: "realtime.unsubscribe";
|
|
6
7
|
};
|
|
7
8
|
/** Socket.IO event names a client receives. */
|
|
8
9
|
export declare const REALTIME_SERVER_EVENT: {
|
|
@@ -48,10 +49,21 @@ export interface PublishConversationEventResponse {
|
|
|
48
49
|
export interface RealtimeReadyMessage {
|
|
49
50
|
protocolVersion: typeof REALTIME_PROTOCOL_VERSION;
|
|
50
51
|
}
|
|
51
|
-
/** What a client asks to watch. */
|
|
52
|
+
/** What a client asks to watch. Additive — the socket keeps what it already had. */
|
|
52
53
|
export interface RealtimeSubscribeRequest {
|
|
53
54
|
conversationIds: UUID[];
|
|
54
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* What a client asks to stop watching.
|
|
58
|
+
*
|
|
59
|
+
* Subscribing is additive and capped at {@link MAX_REALTIME_SUBSCRIPTIONS_PER_SOCKET}, so
|
|
60
|
+
* without this a long-lived inbox that pages through conversations reaches the cap and then
|
|
61
|
+
* silently stops receiving anything new. Unsubscribing what has scrolled out of view is what
|
|
62
|
+
* keeps the set bounded by what is on screen rather than by everything ever looked at.
|
|
63
|
+
*/
|
|
64
|
+
export interface RealtimeUnsubscribeRequest {
|
|
65
|
+
conversationIds: UUID[];
|
|
66
|
+
}
|
|
55
67
|
/** The full set a socket is watching after a subscribe, not just the delta. */
|
|
56
68
|
export interface RealtimeSubscribedMessage {
|
|
57
69
|
conversationIds: UUID[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime.type.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox/realtime.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,4CAA4C;AAC5C,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"realtime.type.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox/realtime.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,4CAA4C;AAC5C,eAAO,MAAM,qBAAqB;;;CAGxB,CAAC;AAE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,uBAAuB,GAC/B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,yBAAyB,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,oBAAoB,CAAA;CAAE,CAAC"}
|
|
@@ -4,6 +4,7 @@ exports.MAX_REALTIME_EVENT_NAME_LENGTH = exports.MAX_REALTIME_EVENT_BYTES = expo
|
|
|
4
4
|
/** Socket.IO event names a client sends. */
|
|
5
5
|
exports.REALTIME_CLIENT_EVENT = {
|
|
6
6
|
SUBSCRIBE: 'realtime.subscribe',
|
|
7
|
+
UNSUBSCRIBE: 'realtime.unsubscribe',
|
|
7
8
|
};
|
|
8
9
|
/** Socket.IO event names a client receives. */
|
|
9
10
|
exports.REALTIME_SERVER_EVENT = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime.type.js","sourceRoot":"","sources":["../../../../src/api/unibox/realtime.type.ts"],"names":[],"mappings":";;;AAIA,4CAA4C;AAC/B,QAAA,qBAAqB,GAAG;IACjC,SAAS,EAAE,oBAAoB;
|
|
1
|
+
{"version":3,"file":"realtime.type.js","sourceRoot":"","sources":["../../../../src/api/unibox/realtime.type.ts"],"names":[],"mappings":";;;AAIA,4CAA4C;AAC/B,QAAA,qBAAqB,GAAG;IACjC,SAAS,EAAE,oBAAoB;IAC/B,WAAW,EAAE,sBAAsB;CAC7B,CAAC;AAEX,+CAA+C;AAClC,QAAA,qBAAqB,GAAG;IACjC,KAAK,EAAE,gBAAgB;IACvB,UAAU,EAAE,qBAAqB;IACjC,oBAAoB,EAAE,sBAAsB;IAC5C,KAAK,EAAE,gBAAgB;CACjB,CAAC;AAEX,4FAA4F;AAC/E,QAAA,yBAAyB,GAAG,CAAC,CAAC;AAE3C,oDAAoD;AACvC,QAAA,qCAAqC,GAAG,GAAG,CAAC;AAEzD,0CAA0C;AAC7B,QAAA,wBAAwB,GAAG,EAAE,GAAG,IAAI,CAAC;AAElD,oDAAoD;AACvC,QAAA,8BAA8B,GAAG,GAAG,CAAC"}
|
|
@@ -3,6 +3,7 @@ import type { RealtimeConversationEvent } from './realtime-event.enum.js';
|
|
|
3
3
|
/** Socket.IO event names a client sends. */
|
|
4
4
|
export declare const REALTIME_CLIENT_EVENT: {
|
|
5
5
|
readonly SUBSCRIBE: "realtime.subscribe";
|
|
6
|
+
readonly UNSUBSCRIBE: "realtime.unsubscribe";
|
|
6
7
|
};
|
|
7
8
|
/** Socket.IO event names a client receives. */
|
|
8
9
|
export declare const REALTIME_SERVER_EVENT: {
|
|
@@ -48,10 +49,21 @@ export interface PublishConversationEventResponse {
|
|
|
48
49
|
export interface RealtimeReadyMessage {
|
|
49
50
|
protocolVersion: typeof REALTIME_PROTOCOL_VERSION;
|
|
50
51
|
}
|
|
51
|
-
/** What a client asks to watch. */
|
|
52
|
+
/** What a client asks to watch. Additive — the socket keeps what it already had. */
|
|
52
53
|
export interface RealtimeSubscribeRequest {
|
|
53
54
|
conversationIds: UUID[];
|
|
54
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* What a client asks to stop watching.
|
|
58
|
+
*
|
|
59
|
+
* Subscribing is additive and capped at {@link MAX_REALTIME_SUBSCRIPTIONS_PER_SOCKET}, so
|
|
60
|
+
* without this a long-lived inbox that pages through conversations reaches the cap and then
|
|
61
|
+
* silently stops receiving anything new. Unsubscribing what has scrolled out of view is what
|
|
62
|
+
* keeps the set bounded by what is on screen rather than by everything ever looked at.
|
|
63
|
+
*/
|
|
64
|
+
export interface RealtimeUnsubscribeRequest {
|
|
65
|
+
conversationIds: UUID[];
|
|
66
|
+
}
|
|
55
67
|
/** The full set a socket is watching after a subscribe, not just the delta. */
|
|
56
68
|
export interface RealtimeSubscribedMessage {
|
|
57
69
|
conversationIds: UUID[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime.type.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox/realtime.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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+EAA+E;AAC/E,MAAM,WAAW,yBAAyB;IACtC,eAAe,EAAE,IAAI,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,iBAAiB,GAAG,WAAW,GAAG,sBAAsB,GAAG,mBAAmB,CAAC;IACrF,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACvC,cAAc,EAAE,IAAI,CAAC;IACrB,KAAK,EAAE,yBAAyB,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,+DAA+D;AAC/D,MAAM,MAAM,uBAAuB,GAC/B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,yBAAyB,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,oBAAoB,CAAA;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime.type.js","sourceRoot":"","sources":["../../../../src/api/unibox/realtime.type.ts"],"names":[],"mappings":"AAIA,4CAA4C;AAC5C,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,SAAS,EAAE,oBAAoB;
|
|
1
|
+
{"version":3,"file":"realtime.type.js","sourceRoot":"","sources":["../../../../src/api/unibox/realtime.type.ts"],"names":[],"mappings":"AAIA,4CAA4C;AAC5C,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,SAAS,EAAE,oBAAoB;IAC/B,WAAW,EAAE,sBAAsB;CAC7B,CAAC;AAEX,+CAA+C;AAC/C,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,KAAK,EAAE,gBAAgB;IACvB,UAAU,EAAE,qBAAqB;IACjC,oBAAoB,EAAE,sBAAsB;IAC5C,KAAK,EAAE,gBAAgB;CACjB,CAAC;AAEX,4FAA4F;AAC5F,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAE3C,oDAAoD;AACpD,MAAM,CAAC,MAAM,qCAAqC,GAAG,GAAG,CAAC;AAEzD,0CAA0C;AAC1C,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,GAAG,IAAI,CAAC;AAElD,oDAAoD;AACpD,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,CAAC"}
|