@privateaim/messenger-kit 0.7.29 → 0.7.31

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/CHANGELOG.md CHANGED
@@ -1,5 +1,84 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.31](https://github.com/PrivateAIM/hub/compare/v0.7.30...v0.7.31) (2026-03-02)
4
+
5
+
6
+ ### Features
7
+
8
+ * initial server-telmetry package with http api & db ([31dbfdc](https://github.com/PrivateAIM/hub/commit/31dbfdcd7c5a0d833aa5021c44da00fb8685e55e))
9
+ * migrate to esm & replace jest with vitest ([#1368](https://github.com/PrivateAIM/hub/issues/1368)) ([5a4d9d1](https://github.com/PrivateAIM/hub/commit/5a4d9d1ce118f65740aa49caf948208eac299032))
10
+ * support client identity for messenger/realtime communication ([#1464](https://github.com/PrivateAIM/hub/issues/1464)) ([5987458](https://github.com/PrivateAIM/hub/commit/59874581dbbc1101b79dd728b5786d5350074866))
11
+ * validate client-to-server messaging message ([a37cbc4](https://github.com/PrivateAIM/hub/commit/a37cbc4582ac66190aa4aad9a78aca58d34526f4))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **deps:** bump the minorandpatch group across 1 directory with 10 updates ([#1204](https://github.com/PrivateAIM/hub/issues/1204)) ([72923d8](https://github.com/PrivateAIM/hub/commit/72923d81911880e176907e893c62241fe7f849f3))
17
+ * **deps:** bump the minorandpatch group across 1 directory with 11 updates ([#1114](https://github.com/PrivateAIM/hub/issues/1114)) ([1b644a8](https://github.com/PrivateAIM/hub/commit/1b644a8df5200356bc91c624379917c8dd409fdc))
18
+ * **deps:** bump the minorandpatch group across 1 directory with 11 updates ([#1162](https://github.com/PrivateAIM/hub/issues/1162)) ([2aa8123](https://github.com/PrivateAIM/hub/commit/2aa8123394aafdd3dbc1eb5284a2bdc5fcc659a9))
19
+ * **deps:** bump the minorandpatch group across 1 directory with 12 updates ([#1343](https://github.com/PrivateAIM/hub/issues/1343)) ([015daa8](https://github.com/PrivateAIM/hub/commit/015daa8d7403b906eeb175d7ab83dd9df665dc6a))
20
+ * **deps:** bump the minorandpatch group across 1 directory with 13 updates ([#1246](https://github.com/PrivateAIM/hub/issues/1246)) ([bc898f9](https://github.com/PrivateAIM/hub/commit/bc898f9e40b52d6a93b815f9a07fb517219d051f))
21
+ * **deps:** bump the minorandpatch group across 1 directory with 15 updates ([#1415](https://github.com/PrivateAIM/hub/issues/1415)) ([ae2e03c](https://github.com/PrivateAIM/hub/commit/ae2e03cea61aa74820128bc22039d5f23f51466f))
22
+ * **deps:** bump the minorandpatch group across 1 directory with 16 updates ([#1194](https://github.com/PrivateAIM/hub/issues/1194)) ([46336b8](https://github.com/PrivateAIM/hub/commit/46336b8d8f320705bf216bab81ed61d940ff2895))
23
+ * **deps:** bump the minorandpatch group across 1 directory with 16 updates ([#1329](https://github.com/PrivateAIM/hub/issues/1329)) ([7b394da](https://github.com/PrivateAIM/hub/commit/7b394da159d8e52cc37fe489832307a234f3ddb0))
24
+ * **deps:** bump the minorandpatch group across 1 directory with 19 updates ([#1392](https://github.com/PrivateAIM/hub/issues/1392)) ([23060bf](https://github.com/PrivateAIM/hub/commit/23060bfce24100d17d4d83c7ee45ed6d85073c6b))
25
+ * **deps:** bump the minorandpatch group across 1 directory with 20 updates ([#1231](https://github.com/PrivateAIM/hub/issues/1231)) ([dddccd3](https://github.com/PrivateAIM/hub/commit/dddccd358e8caa9512bd8945dd8f1efc7155b20e))
26
+ * **deps:** bump the minorandpatch group across 1 directory with 24 updates ([#1084](https://github.com/PrivateAIM/hub/issues/1084)) ([92a3f43](https://github.com/PrivateAIM/hub/commit/92a3f43eb47795a7fff756939a036f2e771bd3cd))
27
+ * **deps:** bump the minorandpatch group across 1 directory with 4 updates ([#1036](https://github.com/PrivateAIM/hub/issues/1036)) ([e52ea50](https://github.com/PrivateAIM/hub/commit/e52ea50288486db487ce0c5f4d2cd0b027c18861))
28
+ * **deps:** bump the minorandpatch group across 1 directory with 5 updates ([#1149](https://github.com/PrivateAIM/hub/issues/1149)) ([6ad2f9a](https://github.com/PrivateAIM/hub/commit/6ad2f9aa8f9a9e93e3624ec8d6bf2517c122822a))
29
+ * **deps:** bump the minorandpatch group across 1 directory with 5 updates ([#1167](https://github.com/PrivateAIM/hub/issues/1167)) ([9f12a16](https://github.com/PrivateAIM/hub/commit/9f12a16ccb268989579e0a6464c3e9c189bf042f))
30
+ * **deps:** bump the minorandpatch group across 1 directory with 6 updates ([#1173](https://github.com/PrivateAIM/hub/issues/1173)) ([47fa968](https://github.com/PrivateAIM/hub/commit/47fa968c35135638d3c55a6e58cd94ca8a0079b9))
31
+ * **deps:** bump the minorandpatch group across 1 directory with 8 updates ([#1091](https://github.com/PrivateAIM/hub/issues/1091)) ([5da2ab0](https://github.com/PrivateAIM/hub/commit/5da2ab0af1133b1c8408317486fb6394cdb2452e))
32
+ * **deps:** bump the minorandpatch group across 1 directory with 9 updates ([#1331](https://github.com/PrivateAIM/hub/issues/1331)) ([2802bc3](https://github.com/PrivateAIM/hub/commit/2802bc319b84453f8bb351ba1723d9a58bba9830))
33
+
34
+
35
+ ### Dependencies
36
+
37
+ * The following workspace dependencies were updated
38
+ * devDependencies
39
+ * @privateaim/core-kit bumped from ^0.8.29 to ^0.8.30
40
+ * peerDependencies
41
+ * @privateaim/core-kit bumped from ^0.8.29 to ^0.8.30
42
+
43
+ ## [0.7.30](https://github.com/PrivateAIM/hub/compare/v0.7.29...v0.7.30) (2026-03-02)
44
+
45
+
46
+ ### Features
47
+
48
+ * initial server-telmetry package with http api & db ([31dbfdc](https://github.com/PrivateAIM/hub/commit/31dbfdcd7c5a0d833aa5021c44da00fb8685e55e))
49
+ * migrate to esm & replace jest with vitest ([#1368](https://github.com/PrivateAIM/hub/issues/1368)) ([5a4d9d1](https://github.com/PrivateAIM/hub/commit/5a4d9d1ce118f65740aa49caf948208eac299032))
50
+ * validate client-to-server messaging message ([a37cbc4](https://github.com/PrivateAIM/hub/commit/a37cbc4582ac66190aa4aad9a78aca58d34526f4))
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * **deps:** bump the minorandpatch group across 1 directory with 10 updates ([#1204](https://github.com/PrivateAIM/hub/issues/1204)) ([72923d8](https://github.com/PrivateAIM/hub/commit/72923d81911880e176907e893c62241fe7f849f3))
56
+ * **deps:** bump the minorandpatch group across 1 directory with 11 updates ([#1114](https://github.com/PrivateAIM/hub/issues/1114)) ([1b644a8](https://github.com/PrivateAIM/hub/commit/1b644a8df5200356bc91c624379917c8dd409fdc))
57
+ * **deps:** bump the minorandpatch group across 1 directory with 11 updates ([#1162](https://github.com/PrivateAIM/hub/issues/1162)) ([2aa8123](https://github.com/PrivateAIM/hub/commit/2aa8123394aafdd3dbc1eb5284a2bdc5fcc659a9))
58
+ * **deps:** bump the minorandpatch group across 1 directory with 12 updates ([#1343](https://github.com/PrivateAIM/hub/issues/1343)) ([015daa8](https://github.com/PrivateAIM/hub/commit/015daa8d7403b906eeb175d7ab83dd9df665dc6a))
59
+ * **deps:** bump the minorandpatch group across 1 directory with 13 updates ([#1246](https://github.com/PrivateAIM/hub/issues/1246)) ([bc898f9](https://github.com/PrivateAIM/hub/commit/bc898f9e40b52d6a93b815f9a07fb517219d051f))
60
+ * **deps:** bump the minorandpatch group across 1 directory with 15 updates ([#1415](https://github.com/PrivateAIM/hub/issues/1415)) ([ae2e03c](https://github.com/PrivateAIM/hub/commit/ae2e03cea61aa74820128bc22039d5f23f51466f))
61
+ * **deps:** bump the minorandpatch group across 1 directory with 16 updates ([#1194](https://github.com/PrivateAIM/hub/issues/1194)) ([46336b8](https://github.com/PrivateAIM/hub/commit/46336b8d8f320705bf216bab81ed61d940ff2895))
62
+ * **deps:** bump the minorandpatch group across 1 directory with 16 updates ([#1329](https://github.com/PrivateAIM/hub/issues/1329)) ([7b394da](https://github.com/PrivateAIM/hub/commit/7b394da159d8e52cc37fe489832307a234f3ddb0))
63
+ * **deps:** bump the minorandpatch group across 1 directory with 19 updates ([#1392](https://github.com/PrivateAIM/hub/issues/1392)) ([23060bf](https://github.com/PrivateAIM/hub/commit/23060bfce24100d17d4d83c7ee45ed6d85073c6b))
64
+ * **deps:** bump the minorandpatch group across 1 directory with 20 updates ([#1231](https://github.com/PrivateAIM/hub/issues/1231)) ([dddccd3](https://github.com/PrivateAIM/hub/commit/dddccd358e8caa9512bd8945dd8f1efc7155b20e))
65
+ * **deps:** bump the minorandpatch group across 1 directory with 24 updates ([#1084](https://github.com/PrivateAIM/hub/issues/1084)) ([92a3f43](https://github.com/PrivateAIM/hub/commit/92a3f43eb47795a7fff756939a036f2e771bd3cd))
66
+ * **deps:** bump the minorandpatch group across 1 directory with 4 updates ([#1036](https://github.com/PrivateAIM/hub/issues/1036)) ([e52ea50](https://github.com/PrivateAIM/hub/commit/e52ea50288486db487ce0c5f4d2cd0b027c18861))
67
+ * **deps:** bump the minorandpatch group across 1 directory with 5 updates ([#1149](https://github.com/PrivateAIM/hub/issues/1149)) ([6ad2f9a](https://github.com/PrivateAIM/hub/commit/6ad2f9aa8f9a9e93e3624ec8d6bf2517c122822a))
68
+ * **deps:** bump the minorandpatch group across 1 directory with 5 updates ([#1167](https://github.com/PrivateAIM/hub/issues/1167)) ([9f12a16](https://github.com/PrivateAIM/hub/commit/9f12a16ccb268989579e0a6464c3e9c189bf042f))
69
+ * **deps:** bump the minorandpatch group across 1 directory with 6 updates ([#1173](https://github.com/PrivateAIM/hub/issues/1173)) ([47fa968](https://github.com/PrivateAIM/hub/commit/47fa968c35135638d3c55a6e58cd94ca8a0079b9))
70
+ * **deps:** bump the minorandpatch group across 1 directory with 8 updates ([#1091](https://github.com/PrivateAIM/hub/issues/1091)) ([5da2ab0](https://github.com/PrivateAIM/hub/commit/5da2ab0af1133b1c8408317486fb6394cdb2452e))
71
+ * **deps:** bump the minorandpatch group across 1 directory with 9 updates ([#1331](https://github.com/PrivateAIM/hub/issues/1331)) ([2802bc3](https://github.com/PrivateAIM/hub/commit/2802bc319b84453f8bb351ba1723d9a58bba9830))
72
+
73
+
74
+ ### Dependencies
75
+
76
+ * The following workspace dependencies were updated
77
+ * devDependencies
78
+ * @privateaim/core-kit bumped from ^0.8.28 to ^0.8.29
79
+ * peerDependencies
80
+ * @privateaim/core-kit bumped from ^0.8.28 to ^0.8.29
81
+
3
82
  ## [0.7.29](https://github.com/PrivateAIM/hub/compare/v0.7.28...v0.7.29) (2026-02-26)
4
83
 
5
84
 
@@ -1,10 +1,15 @@
1
1
  export declare enum STCConnectionEventName {
2
+ CLIENT_CONNECTED = "clientConnected",
3
+ CLIENT_DISCONNECTED = "clientDisconnected",
2
4
  USER_CONNECTED = "userConnected",
3
5
  USER_DISCONNECTED = "userDisconnected",
4
6
  ROBOT_CONNECTED = "robotConnected",
5
7
  ROBOT_DISCONNECTED = "robotDisconnected"
6
8
  }
7
9
  export declare enum CTSConnectionEventName {
10
+ CLIENT_CONNECTIONS = "clientConnections",
11
+ CLIENT_CONNECTION_SUBSCRIBE = "clientConnectionSubscribe",
12
+ CLIENT_CONNECTION_UNSUBSCRIBE = "clientConnectionUnsubscribe",
8
13
  USER_CONNECTIONS = "userConnections",
9
14
  USER_CONNECTION_SUBSCRIBE = "userConnectionSubscribe",
10
15
  USER_CONNECTION_UNSUBSCRIBE = "userConnectionUnsubscribe",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/connection/constants.ts"],"names":[],"mappings":"AAOA,oBAAY,sBAAsB;IAC9B,cAAc,kBAAkB;IAChC,iBAAiB,qBAAqB;IAEtC,eAAe,mBAAmB;IAClC,kBAAkB,sBAAsB;CAC3C;AAED,oBAAY,sBAAsB;IAC9B,gBAAgB,oBAAoB;IACpC,yBAAyB,4BAA4B;IACrD,2BAA2B,8BAA8B;IAEzD,iBAAiB,qBAAqB;IACtC,0BAA0B,6BAA6B;IACvD,4BAA4B,+BAA+B;CAC9D"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/connection/constants.ts"],"names":[],"mappings":"AAOA,oBAAY,sBAAsB;IAC9B,gBAAgB,oBAAoB;IACpC,mBAAmB,uBAAuB;IAE1C,cAAc,kBAAkB;IAChC,iBAAiB,qBAAqB;IAEtC,eAAe,mBAAmB;IAClC,kBAAkB,sBAAsB;CAC3C;AAED,oBAAY,sBAAsB;IAC9B,kBAAkB,sBAAsB;IACxC,2BAA2B,8BAA8B;IACzD,6BAA6B,gCAAgC;IAE7D,gBAAgB,oBAAoB;IACpC,yBAAyB,4BAA4B;IACrD,2BAA2B,8BAA8B;IAEzD,iBAAiB,qBAAqB;IACtC,0BAA0B,6BAA6B;IACvD,4BAA4B,+BAA+B;CAC9D"}
@@ -1,9 +1,9 @@
1
1
  import type { EventCallback, EventTarget, STCEventContext } from '../types';
2
2
  import type { CTSConnectionEventName, STCConnectionEventName } from './constants';
3
3
  export type CTSConnectionEvents = {
4
- [K in `${CTSConnectionEventName.USER_CONNECTION_SUBSCRIBE}` | `${CTSConnectionEventName.USER_CONNECTION_UNSUBSCRIBE}` | `${CTSConnectionEventName.ROBOT_CONNECTION_SUBSCRIBE}` | `${CTSConnectionEventName.ROBOT_CONNECTION_UNSUBSCRIBE}`]: (target: EventTarget, cb?: EventCallback<undefined>) => void;
4
+ [K in `${CTSConnectionEventName.USER_CONNECTION_SUBSCRIBE}` | `${CTSConnectionEventName.USER_CONNECTION_UNSUBSCRIBE}` | `${CTSConnectionEventName.CLIENT_CONNECTION_SUBSCRIBE}` | `${CTSConnectionEventName.CLIENT_CONNECTION_UNSUBSCRIBE}` | `${CTSConnectionEventName.ROBOT_CONNECTION_SUBSCRIBE}` | `${CTSConnectionEventName.ROBOT_CONNECTION_UNSUBSCRIBE}`]: (target: EventTarget, cb?: EventCallback<undefined>) => void;
5
5
  } & {
6
- [K in `${CTSConnectionEventName.USER_CONNECTIONS}` | `${CTSConnectionEventName.ROBOT_CONNECTIONS}`]: (target: EventTarget, cb?: EventCallback<number>) => void;
6
+ [K in `${CTSConnectionEventName.USER_CONNECTIONS}` | `${CTSConnectionEventName.ROBOT_CONNECTIONS}` | `${CTSConnectionEventName.CLIENT_CONNECTIONS}`]: (target: EventTarget, cb?: EventCallback<number>) => void;
7
7
  };
8
8
  export type STCConnectionEvents = {
9
9
  [K in `${STCConnectionEventName}`]: (data: STCEventContext<{
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/connection/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAElF,MAAM,MAAM,mBAAmB,GAAG;KAC7B,CAAC,IAAI,GAAG,sBAAsB,CAAC,yBAAyB,EAAE,GACvD,GAAG,sBAAsB,CAAC,2BAA2B,EAAE,GACvD,GAAG,sBAAsB,CAAC,0BAA0B,EAAE,GACtD,GAAG,sBAAsB,CAAC,4BAA4B,EAAE,GAAG,CAC3D,MAAM,EAAE,WAAW,EACnB,EAAE,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,KAC5B,IAAI;CACZ,GAAG;KACC,CAAC,IAAI,GAAG,sBAAsB,CAAC,gBAAgB,EAAE,GAAG,GAAG,sBAAsB,CAAC,iBAAiB,EAAE,GAAG,CACjG,MAAM,EAAE,WAAW,EACnB,EAAE,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,KACzB,IAAI;CACZ,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;KAC7B,CAAC,IAAI,GAAG,sBAAsB,EAAE,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,IAAI;CACtF,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/connection/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAElF,MAAM,MAAM,mBAAmB,GAAG;KAC7B,CAAC,IAAI,GAAG,sBAAsB,CAAC,yBAAyB,EAAE,GACvD,GAAG,sBAAsB,CAAC,2BAA2B,EAAE,GACvD,GAAG,sBAAsB,CAAC,2BAA2B,EAAE,GACvD,GAAG,sBAAsB,CAAC,6BAA6B,EAAE,GACzD,GAAG,sBAAsB,CAAC,0BAA0B,EAAE,GACtD,GAAG,sBAAsB,CAAC,4BAA4B,EAAE,GAAG,CAC3D,MAAM,EAAE,WAAW,EACnB,EAAE,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,KAC5B,IAAI;CACZ,GAAG;KACC,CAAC,IAAI,GAAG,sBAAsB,CAAC,gBAAgB,EAAE,GAAG,GAAG,sBAAsB,CAAC,iBAAiB,EAAE,GAAG,GAAG,sBAAsB,CAAC,kBAAkB,EAAE,GAAG,CAClJ,MAAM,EAAE,WAAW,EACnB,EAAE,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,KACzB,IAAI;CACZ,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;KAC7B,CAAC,IAAI,GAAG,sBAAsB,EAAE,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,IAAI;CACtF,CAAC"}
package/dist/index.mjs CHANGED
@@ -8,6 +8,8 @@ import { Container } from 'validup';
8
8
  * For the full copyright and license information,
9
9
  * view the LICENSE file that was distributed with this source code.
10
10
  */ var STCConnectionEventName = /*#__PURE__*/ function(STCConnectionEventName) {
11
+ STCConnectionEventName["CLIENT_CONNECTED"] = "clientConnected";
12
+ STCConnectionEventName["CLIENT_DISCONNECTED"] = "clientDisconnected";
11
13
  STCConnectionEventName["USER_CONNECTED"] = "userConnected";
12
14
  STCConnectionEventName["USER_DISCONNECTED"] = "userDisconnected";
13
15
  STCConnectionEventName["ROBOT_CONNECTED"] = "robotConnected";
@@ -15,6 +17,9 @@ import { Container } from 'validup';
15
17
  return STCConnectionEventName;
16
18
  }({});
17
19
  var CTSConnectionEventName = /*#__PURE__*/ function(CTSConnectionEventName) {
20
+ CTSConnectionEventName["CLIENT_CONNECTIONS"] = "clientConnections";
21
+ CTSConnectionEventName["CLIENT_CONNECTION_SUBSCRIBE"] = "clientConnectionSubscribe";
22
+ CTSConnectionEventName["CLIENT_CONNECTION_UNSUBSCRIBE"] = "clientConnectionUnsubscribe";
18
23
  CTSConnectionEventName["USER_CONNECTIONS"] = "userConnections";
19
24
  CTSConnectionEventName["USER_CONNECTION_SUBSCRIBE"] = "userConnectionSubscribe";
20
25
  CTSConnectionEventName["USER_CONNECTION_UNSUBSCRIBE"] = "userConnectionUnsubscribe";
@@ -41,7 +46,7 @@ var CTSMessagingEventName = /*#__PURE__*/ function(CTSMessagingEventName) {
41
46
  class CTSMessagingPartyValidator extends Container {
42
47
  initialize() {
43
48
  super.initialize();
44
- this.mount('id', createValidator(z.string().uuid()));
49
+ this.mount('id', createValidator(z.uuid()));
45
50
  this.mount('type', createValidator(z.enum([
46
51
  'user',
47
52
  'robot',
@@ -53,7 +58,7 @@ class CTSMessagingPartyValidator extends Container {
53
58
  class CTSMessagingMessageValidator extends Container {
54
59
  initialize() {
55
60
  super.initialize();
56
- this.mount('data', createValidator(z.object({}).passthrough().or(z.string()).or(z.null()).or(z.undefined()).optional()));
61
+ this.mount('data', createValidator(z.looseObject({}).or(z.string()).or(z.null()).or(z.undefined()).optional()));
57
62
  this.mount('metadata', createValidator(z.looseObject({}).or(z.null()).or(z.undefined()).optional()));
58
63
  const partyValidator = new CTSMessagingPartyValidator();
59
64
  this.mount('to', async (ctx)=>{
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/connection/constants.ts","../src/messaging/constants.ts","../src/messaging/validators/to.ts","../src/messaging/validators/message.ts","../src/utils.ts"],"sourcesContent":["/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum STCConnectionEventName {\n USER_CONNECTED = 'userConnected',\n USER_DISCONNECTED = 'userDisconnected',\n\n ROBOT_CONNECTED = 'robotConnected',\n ROBOT_DISCONNECTED = 'robotDisconnected',\n}\n\nexport enum CTSConnectionEventName {\n USER_CONNECTIONS = 'userConnections',\n USER_CONNECTION_SUBSCRIBE = 'userConnectionSubscribe',\n USER_CONNECTION_UNSUBSCRIBE = 'userConnectionUnsubscribe',\n\n ROBOT_CONNECTIONS = 'robotConnections',\n ROBOT_CONNECTION_SUBSCRIBE = 'robotConnectionSubscribe',\n ROBOT_CONNECTION_UNSUBSCRIBE = 'robotConnectionUnsubscribe',\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum STCMessagingEventName {\n SEND = 'send',\n}\n\nexport enum CTSMessagingEventName {\n SEND = 'send',\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { z } from 'zod';\nimport { createValidator } from '@validup/adapter-zod';\nimport { Container } from 'validup';\nimport type { CTSMessagingParty } from '../types';\n\nexport class CTSMessagingPartyValidator extends Container<CTSMessagingParty> {\n protected initialize() {\n super.initialize();\n\n this.mount(\n 'id',\n createValidator(\n z.string().uuid(),\n ),\n );\n\n this.mount(\n 'type',\n createValidator(\n z.enum(['user', 'robot', 'client']),\n ),\n );\n }\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { z } from 'zod';\nimport { createValidator } from '@validup/adapter-zod';\nimport { Container } from 'validup';\nimport type { CTSMessagingMessage } from '../types';\nimport { CTSMessagingPartyValidator } from './to';\n\nexport class CTSMessagingMessageValidator extends Container<CTSMessagingMessage> {\n protected initialize() {\n super.initialize();\n\n this.mount(\n 'data',\n createValidator(\n z.object({})\n .passthrough()\n .or(z.string())\n .or(z.null())\n .or(z.undefined())\n .optional(),\n ),\n );\n\n this.mount(\n 'metadata',\n createValidator(\n z.looseObject({})\n .or(z.null())\n .or(z.undefined())\n .optional(),\n ),\n );\n\n const partyValidator = new CTSMessagingPartyValidator();\n\n this.mount('to', async (ctx) => {\n const validator = createValidator(\n z.array(z.looseObject({})),\n );\n\n const output = (await validator(ctx)) as unknown[];\n return Promise.all(output.map((el) => partyValidator.run(el, {\n path: ctx.path,\n group: ctx.group,\n })));\n });\n }\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { EventCallback } from './types';\n\nexport function isEventCallback(\n input: unknown,\n fnArgs?: number,\n) : input is EventCallback {\n if (typeof fnArgs === 'undefined') {\n return typeof input === 'function';\n }\n\n return typeof input === 'function' &&\n input.length >= fnArgs;\n}\n\nexport function isEventTarget(\n input: unknown,\n) : input is EventTarget {\n return typeof input === 'number' ||\n typeof input === 'string' ||\n typeof input === 'undefined';\n}\n"],"names":["STCConnectionEventName","CTSConnectionEventName","STCMessagingEventName","CTSMessagingEventName","CTSMessagingPartyValidator","Container","initialize","mount","createValidator","z","string","uuid","enum","CTSMessagingMessageValidator","object","passthrough","or","null","undefined","optional","looseObject","partyValidator","ctx","validator","array","output","Promise","all","map","el","run","path","group","isEventCallback","input","fnArgs","length","isEventTarget"],"mappings":";;;;AAAA;;;;;IAOO,IAAKA,sBAAAA,iBAAAA,SAAAA,sBAAAA,EAAAA;;;;;AAAAA,IAAAA,OAAAA,sBAAAA;AAMX,CAAA,CAAA,EAAA;AAEM,IAAA,sBAAKC,iBAAAA,SAAAA,sBAAAA,EAAAA;;;;;;;AAAAA,IAAAA,OAAAA,sBAAAA;AAQX,CAAA,CAAA,EAAA;;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AAA,MAAME,iBAAiB,IAAIjB,0BAAAA,EAAAA;AAE3B,QAAA,IAAI,CAACG,KAAK,CAAC,IAAA,EAAM,OAAOe,GAAAA,GAAAA;YACpB,MAAMC,SAAAA,GAAYf,gBACdC,CAAAA,CAAEe,KAAK,CAACf,CAAAA,CAAEW,WAAW,CAAC,EAAC,CAAA,CAAA,CAAA;YAG3B,MAAMK,MAAAA,GAAU,MAAMF,SAAAA,CAAUD,GAAAA,CAAAA;YAChC,OAAOI,OAAAA,CAAQC,GAAG,CAACF,MAAAA,CAAOG,GAAG,CAAC,CAACC,EAAAA,GAAOR,cAAAA,CAAeS,GAAG,CAACD,EAAAA,EAAI;AACzDE,oBAAAA,IAAAA,EAAMT,IAAIS,IAAI;AACdC,oBAAAA,KAAAA,EAAOV,IAAIU;AACf,iBAAA,CAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA;AACJ,IAAA;AACJ;;ACrDA;;;;;AAKC,IAIM,SAASC,eAAAA,CACZC,KAAc,EACdC,MAAe,EAAA;IAEf,IAAI,OAAOA,WAAW,WAAA,EAAa;AAC/B,QAAA,OAAO,OAAOD,KAAAA,KAAU,UAAA;AAC5B,IAAA;AAEA,IAAA,OAAO,OAAOA,KAAAA,KAAU,UAAA,IACpBA,KAAAA,CAAME,MAAM,IAAID,MAAAA;AACxB;AAEO,SAASE,cACZH,KAAc,EAAA;AAEd,IAAA,OAAO,OAAOA,KAAAA,KAAU,QAAA,IACpB,OAAOA,KAAAA,KAAU,QAAA,IACjB,OAAOA,KAAAA,KAAU,WAAA;AACzB;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/connection/constants.ts","../src/messaging/constants.ts","../src/messaging/validators/to.ts","../src/messaging/validators/message.ts","../src/utils.ts"],"sourcesContent":["/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum STCConnectionEventName {\n CLIENT_CONNECTED = 'clientConnected',\n CLIENT_DISCONNECTED = 'clientDisconnected',\n\n USER_CONNECTED = 'userConnected',\n USER_DISCONNECTED = 'userDisconnected',\n\n ROBOT_CONNECTED = 'robotConnected',\n ROBOT_DISCONNECTED = 'robotDisconnected',\n}\n\nexport enum CTSConnectionEventName {\n CLIENT_CONNECTIONS = 'clientConnections',\n CLIENT_CONNECTION_SUBSCRIBE = 'clientConnectionSubscribe',\n CLIENT_CONNECTION_UNSUBSCRIBE = 'clientConnectionUnsubscribe',\n\n USER_CONNECTIONS = 'userConnections',\n USER_CONNECTION_SUBSCRIBE = 'userConnectionSubscribe',\n USER_CONNECTION_UNSUBSCRIBE = 'userConnectionUnsubscribe',\n\n ROBOT_CONNECTIONS = 'robotConnections',\n ROBOT_CONNECTION_SUBSCRIBE = 'robotConnectionSubscribe',\n ROBOT_CONNECTION_UNSUBSCRIBE = 'robotConnectionUnsubscribe',\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum STCMessagingEventName {\n SEND = 'send',\n}\n\nexport enum CTSMessagingEventName {\n SEND = 'send',\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { z } from 'zod';\nimport { createValidator } from '@validup/adapter-zod';\nimport { Container } from 'validup';\nimport type { CTSMessagingParty } from '../types';\n\nexport class CTSMessagingPartyValidator extends Container<CTSMessagingParty> {\n protected initialize() {\n super.initialize();\n\n this.mount(\n 'id',\n createValidator(\n z.uuid(),\n ),\n );\n\n this.mount(\n 'type',\n createValidator(\n z.enum(['user', 'robot', 'client']),\n ),\n );\n }\n}\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { z } from 'zod';\nimport { createValidator } from '@validup/adapter-zod';\nimport { Container } from 'validup';\nimport type { CTSMessagingMessage } from '../types';\nimport { CTSMessagingPartyValidator } from './to';\n\nexport class CTSMessagingMessageValidator extends Container<CTSMessagingMessage> {\n protected initialize() {\n super.initialize();\n\n this.mount(\n 'data',\n createValidator(\n z.looseObject({})\n .or(z.string())\n .or(z.null())\n .or(z.undefined())\n .optional(),\n ),\n );\n\n this.mount(\n 'metadata',\n createValidator(\n z.looseObject({})\n .or(z.null())\n .or(z.undefined())\n .optional(),\n ),\n );\n\n const partyValidator = new CTSMessagingPartyValidator();\n\n this.mount('to', async (ctx) => {\n const validator = createValidator(\n z.array(z.looseObject({})),\n );\n\n const output = (await validator(ctx)) as unknown[];\n return Promise.all(output.map((el) => partyValidator.run(el, {\n path: ctx.path,\n group: ctx.group,\n })));\n });\n }\n}\n","/*\n * Copyright (c) 2021-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { EventCallback } from './types';\n\nexport function isEventCallback(\n input: unknown,\n fnArgs?: number,\n) : input is EventCallback {\n if (typeof fnArgs === 'undefined') {\n return typeof input === 'function';\n }\n\n return typeof input === 'function' &&\n input.length >= fnArgs;\n}\n\nexport function isEventTarget(\n input: unknown,\n) : input is EventTarget {\n return typeof input === 'number' ||\n typeof input === 'string' ||\n typeof input === 'undefined';\n}\n"],"names":["STCConnectionEventName","CTSConnectionEventName","STCMessagingEventName","CTSMessagingEventName","CTSMessagingPartyValidator","Container","initialize","mount","createValidator","z","uuid","enum","CTSMessagingMessageValidator","looseObject","or","string","null","undefined","optional","partyValidator","ctx","validator","array","output","Promise","all","map","el","run","path","group","isEventCallback","input","fnArgs","length","isEventTarget"],"mappings":";;;;AAAA;;;;;IAOO,IAAKA,sBAAAA,iBAAAA,SAAAA,sBAAAA,EAAAA;;;;;;;AAAAA,IAAAA,OAAAA,sBAAAA;AASX,CAAA,CAAA,EAAA;AAEM,IAAA,sBAAKC,iBAAAA,SAAAA,sBAAAA,EAAAA;;;;;;;;;;AAAA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IrB,QAAA,MAAMC,iBAAiB,IAAIf,0BAAAA,EAAAA;AAE3B,QAAA,IAAI,CAACG,KAAK,CAAC,IAAA,EAAM,OAAOa,GAAAA,GAAAA;YACpB,MAAMC,SAAAA,GAAYb,gBACdC,CAAAA,CAAEa,KAAK,CAACb,CAAAA,CAAEI,WAAW,CAAC,EAAC,CAAA,CAAA,CAAA;YAG3B,MAAMU,MAAAA,GAAU,MAAMF,SAAAA,CAAUD,GAAAA,CAAAA;YAChC,OAAOI,OAAAA,CAAQC,GAAG,CAACF,MAAAA,CAAOG,GAAG,CAAC,CAACC,EAAAA,GAAOR,cAAAA,CAAeS,GAAG,CAACD,EAAAA,EAAI;AACzDE,oBAAAA,IAAAA,EAAMT,IAAIS,IAAI;AACdC,oBAAAA,KAAAA,EAAOV,IAAIU;AACf,iBAAA,CAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA;AACJ,IAAA;AACJ;;ACpDA;;;;;AAKC,IAIM,SAASC,eAAAA,CACZC,KAAc,EACdC,MAAe,EAAA;IAEf,IAAI,OAAOA,WAAW,WAAA,EAAa;AAC/B,QAAA,OAAO,OAAOD,KAAAA,KAAU,UAAA;AAC5B,IAAA;AAEA,IAAA,OAAO,OAAOA,KAAAA,KAAU,UAAA,IACpBA,KAAAA,CAAME,MAAM,IAAID,MAAAA;AACxB;AAEO,SAASE,cACZH,KAAc,EAAA;AAEd,IAAA,OAAO,OAAOA,KAAAA,KAAU,QAAA,IACpB,OAAOA,KAAAA,KAAU,QAAA,IACjB,OAAOA,KAAAA,KAAU,WAAA;AACzB;;;;"}
@@ -1,7 +1,7 @@
1
1
  import type { EventCallback } from '../types';
2
2
  import type { CTSMessagingEventName, STCMessagingEventName } from './constants';
3
3
  export type CTSMessagingParty = {
4
- type: 'user' | 'robot';
4
+ type: 'user' | 'robot' | 'client';
5
5
  id: string;
6
6
  };
7
7
  export type CTSMessagingMessage = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources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C;IAC5E,SAAS,CAAC,UAAU;CAuCvB"}
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/messaging/validators/message.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD,qBAAa,4BAA6B,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IAC5E,SAAS,CAAC,UAAU;CAsCvB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@privateaim/messenger-kit",
3
3
  "type": "module",
4
- "version": "0.7.29",
4
+ "version": "0.7.31",
5
5
  "license": "Apache-2.0",
6
6
  "description": "",
7
7
  "module": "./dist/index.mjs",
@@ -32,11 +32,11 @@
32
32
  "zod": "^4.3.6"
33
33
  },
34
34
  "devDependencies": {
35
- "@privateaim/core-kit": "^0.8.28",
35
+ "@privateaim/core-kit": "^0.8.30",
36
36
  "vitest": "^4.0.18"
37
37
  },
38
38
  "peerDependencies": {
39
- "@privateaim/core-kit": "^0.8.28"
39
+ "@privateaim/core-kit": "^0.8.30"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
@@ -6,6 +6,9 @@
6
6
  */
7
7
 
8
8
  export enum STCConnectionEventName {
9
+ CLIENT_CONNECTED = 'clientConnected',
10
+ CLIENT_DISCONNECTED = 'clientDisconnected',
11
+
9
12
  USER_CONNECTED = 'userConnected',
10
13
  USER_DISCONNECTED = 'userDisconnected',
11
14
 
@@ -14,6 +17,10 @@ export enum STCConnectionEventName {
14
17
  }
15
18
 
16
19
  export enum CTSConnectionEventName {
20
+ CLIENT_CONNECTIONS = 'clientConnections',
21
+ CLIENT_CONNECTION_SUBSCRIBE = 'clientConnectionSubscribe',
22
+ CLIENT_CONNECTION_UNSUBSCRIBE = 'clientConnectionUnsubscribe',
23
+
17
24
  USER_CONNECTIONS = 'userConnections',
18
25
  USER_CONNECTION_SUBSCRIBE = 'userConnectionSubscribe',
19
26
  USER_CONNECTION_UNSUBSCRIBE = 'userConnectionUnsubscribe',
@@ -11,13 +11,15 @@ import type { CTSConnectionEventName, STCConnectionEventName } from './constants
11
11
  export type CTSConnectionEvents = {
12
12
  [K in `${CTSConnectionEventName.USER_CONNECTION_SUBSCRIBE}` |
13
13
  `${CTSConnectionEventName.USER_CONNECTION_UNSUBSCRIBE}` |
14
+ `${CTSConnectionEventName.CLIENT_CONNECTION_SUBSCRIBE}` |
15
+ `${CTSConnectionEventName.CLIENT_CONNECTION_UNSUBSCRIBE}` |
14
16
  `${CTSConnectionEventName.ROBOT_CONNECTION_SUBSCRIBE}` |
15
17
  `${CTSConnectionEventName.ROBOT_CONNECTION_UNSUBSCRIBE}`]: (
16
18
  target: EventTarget,
17
19
  cb?: EventCallback<undefined>
18
20
  ) => void
19
21
  } & {
20
- [K in `${CTSConnectionEventName.USER_CONNECTIONS}` | `${CTSConnectionEventName.ROBOT_CONNECTIONS}`]: (
22
+ [K in `${CTSConnectionEventName.USER_CONNECTIONS}` | `${CTSConnectionEventName.ROBOT_CONNECTIONS}` | `${CTSConnectionEventName.CLIENT_CONNECTIONS}`]: (
21
23
  target: EventTarget,
22
24
  cb?: EventCallback<number>
23
25
  ) => void
@@ -2,7 +2,7 @@ import type { EventCallback } from '../types';
2
2
  import type { CTSMessagingEventName, STCMessagingEventName } from './constants';
3
3
 
4
4
  export type CTSMessagingParty = {
5
- type: 'user' | 'robot',
5
+ type: 'user' | 'robot' | 'client',
6
6
  id: string
7
7
  };
8
8
 
@@ -18,8 +18,7 @@ export class CTSMessagingMessageValidator extends Container<CTSMessagingMessage>
18
18
  this.mount(
19
19
  'data',
20
20
  createValidator(
21
- z.object({})
22
- .passthrough()
21
+ z.looseObject({})
23
22
  .or(z.string())
24
23
  .or(z.null())
25
24
  .or(z.undefined())
@@ -17,7 +17,7 @@ export class CTSMessagingPartyValidator extends Container<CTSMessagingParty> {
17
17
  this.mount(
18
18
  'id',
19
19
  createValidator(
20
- z.string().uuid(),
20
+ z.uuid(),
21
21
  ),
22
22
  );
23
23