@privateaim/messenger-kit 0.7.13 → 0.7.15

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,52 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.15](https://github.com/PrivateAIM/hub/compare/v0.7.14...v0.7.15) (2025-07-10)
4
+
5
+
6
+ ### Features
7
+
8
+ * realtime library/service split ([#474](https://github.com/PrivateAIM/hub/issues/474)) ([43c2dfa](https://github.com/PrivateAIM/hub/commit/43c2dfad654cc61ca9784914cbad56c684434088))
9
+ * validate client-to-server messaging message ([a37cbc4](https://github.com/PrivateAIM/hub/commit/a37cbc4582ac66190aa4aad9a78aca58d34526f4))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **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))
15
+ * **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))
16
+ * **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))
17
+ * **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))
18
+
19
+
20
+ ### Dependencies
21
+
22
+ * The following workspace dependencies were updated
23
+ * devDependencies
24
+ * @privateaim/core-kit bumped from ^0.8.13 to ^0.8.14
25
+ * peerDependencies
26
+ * @privateaim/core-kit bumped from ^0.8.13 to ^0.8.14
27
+
28
+ ## [0.7.14](https://github.com/PrivateAIM/hub/compare/v0.7.13...v0.7.14) (2025-05-05)
29
+
30
+
31
+ ### Features
32
+
33
+ * realtime library/service split ([#474](https://github.com/PrivateAIM/hub/issues/474)) ([43c2dfa](https://github.com/PrivateAIM/hub/commit/43c2dfad654cc61ca9784914cbad56c684434088))
34
+ * validate client-to-server messaging message ([a37cbc4](https://github.com/PrivateAIM/hub/commit/a37cbc4582ac66190aa4aad9a78aca58d34526f4))
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * **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))
40
+
41
+
42
+ ### Dependencies
43
+
44
+ * The following workspace dependencies were updated
45
+ * devDependencies
46
+ * @privateaim/core-kit bumped from ^0.8.12 to ^0.8.13
47
+ * peerDependencies
48
+ * @privateaim/core-kit bumped from ^0.8.12 to ^0.8.13
49
+
3
50
  ## [0.7.13](https://github.com/PrivateAIM/hub/compare/v0.7.12...v0.7.13) (2025-04-25)
4
51
 
5
52
 
package/dist/index.cjs CHANGED
@@ -92,7 +92,7 @@ class CTSMessagingMessageValidator extends validup.Container {
92
92
  this.mount('data', adapterZod.createValidator(zod.z.object({}).passthrough().or(zod.z.string()).or(zod.z.null()).or(zod.z.undefined()).optional()));
93
93
  this.mount('metadata', adapterZod.createValidator(zod.z.object({}).passthrough().or(zod.z.null()).or(zod.z.undefined()).optional()));
94
94
  const partyValidator = new CTSMessagingPartyValidator();
95
- this.mount('to', (ctx)=>/*#__PURE__*/ _async_to_generator(function*() {
95
+ this.mount('to', (ctx)=>_async_to_generator(function*() {
96
96
  const validator = adapterZod.createValidator(zod.z.array(zod.z.object({}).passthrough()));
97
97
  const output = yield validator(ctx);
98
98
  return Promise.all(output.map((el)=>partyValidator.run(el, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","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.object({}).passthrough()\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.object({}).passthrough()),\n );\n\n const output = (await validator(ctx)) as unknown[];\n return Promise.all(output.map((el) => partyValidator.run(el, {\n path: ctx.pathAbsolute,\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","partyValidator","ctx","validator","array","output","Promise","all","map","el","run","path","pathAbsolute","group","isEventCallback","input","fnArgs","length","isEventTarget"],"mappings":";;;;;;AAAA;;;;;IAOO,IAAKA,sBAAAA,iBAAAA,SAAAA,sBAAAA,EAAAA;;;;;AAAAA,IAAAA,OAAAA,sBAAAA;AAMX,CAAA,CAAA,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AAA,QAAA,IACpB,OAAOA,KAAU,KAAA,QAAA,IACjB,OAAOA,KAAU,KAAA,WAAA;AACzB;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","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.object({}).passthrough()\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.object({}).passthrough()),\n );\n\n const output = (await validator(ctx)) as unknown[];\n return Promise.all(output.map((el) => partyValidator.run(el, {\n path: ctx.pathAbsolute,\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","partyValidator","ctx","validator","array","output","Promise","all","map","el","run","path","pathAbsolute","group","isEventCallback","input","fnArgs","length","isEventTarget"],"mappings":";;;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O,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;;;;;;;;;;;"}
package/dist/index.mjs CHANGED
@@ -90,7 +90,7 @@ class CTSMessagingMessageValidator extends Container {
90
90
  this.mount('data', createValidator(z.object({}).passthrough().or(z.string()).or(z.null()).or(z.undefined()).optional()));
91
91
  this.mount('metadata', createValidator(z.object({}).passthrough().or(z.null()).or(z.undefined()).optional()));
92
92
  const partyValidator = new CTSMessagingPartyValidator();
93
- this.mount('to', (ctx)=>/*#__PURE__*/ _async_to_generator(function*() {
93
+ this.mount('to', (ctx)=>_async_to_generator(function*() {
94
94
  const validator = createValidator(z.array(z.object({}).passthrough()));
95
95
  const output = yield validator(ctx);
96
96
  return Promise.all(output.map((el)=>partyValidator.run(el, {
@@ -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.object({}).passthrough()\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.object({}).passthrough()),\n );\n\n const output = (await validator(ctx)) as unknown[];\n return Promise.all(output.map((el) => partyValidator.run(el, {\n path: ctx.pathAbsolute,\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","partyValidator","ctx","validator","array","output","Promise","all","map","el","run","path","pathAbsolute","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;;ACvBD;;;;;IAOO,IAAKC,qBAAAA,iBAAAA,SAAAA,qBAAAA,EAAAA;;AAAAA,IAAAA,OAAAA,qBAAAA;AAEX,CAAA,CAAA,EAAA;AAEM,IAAA,qBAAKC,iBAAAA,SAAAA,qBAAAA,EAAAA;;AAAAA,IAAAA,OAAAA,qBAAAA;AAEX,CAAA,CAAA,EAAA;;ACDM,MAAMC,0BAAmCC,SAAAA,SAAAA,CAAAA;IAClCC,UAAa,GAAA;AACnB,QAAA,KAAK,CAACA,UAAAA,EAAAA;QAEN,IAAI,CAACC,KAAK,CACN,IAAA,EACAC,gBACIC,CAAEC,CAAAA,MAAM,GAAGC,IAAI,EAAA,CAAA,CAAA;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,EAAA,CAAA,CAAA;gBAGpC,MAAMS,MAAAA,GAAU,MAAMF,SAAUD,CAAAA,GAAAA,CAAAA;gBAChC,OAAOI,OAAAA,CAAQC,GAAG,CAACF,MAAOG,CAAAA,GAAG,CAAC,CAACC,EAAOR,GAAAA,cAAAA,CAAeS,GAAG,CAACD,EAAI,EAAA;AACzDE,wBAAAA,IAAAA,EAAMT,IAAIU,YAAY;AACtBC,wBAAAA,KAAAA,EAAOX,IAAIW;AACf,qBAAA,CAAA,CAAA,CAAA;AACJ,aAAA,CAAA,EAAA,CAAA;AACJ;AACJ;;ACrDA;;;;;AAKC,IAIM,SAASC,eACZC,CAAAA,KAAc,EACdC,MAAe,EAAA;IAEf,IAAI,OAAOA,WAAW,WAAa,EAAA;AAC/B,QAAA,OAAO,OAAOD,KAAU,KAAA,UAAA;AAC5B;AAEA,IAAA,OAAO,OAAOA,KAAAA,KAAU,UACpBA,IAAAA,KAAAA,CAAME,MAAM,IAAID,MAAAA;AACxB;AAEO,SAASE,cACZH,KAAc,EAAA;AAEd,IAAA,OAAO,OAAOA,KAAU,KAAA,QAAA,IACpB,OAAOA,KAAU,KAAA,QAAA,IACjB,OAAOA,KAAU,KAAA,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 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.object({}).passthrough()\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.object({}).passthrough()),\n );\n\n const output = (await validator(ctx)) as unknown[];\n return Promise.all(output.map((el) => partyValidator.run(el, {\n path: ctx.pathAbsolute,\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","partyValidator","ctx","validator","array","output","Promise","all","map","el","run","path","pathAbsolute","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;;ACvBD;;;;;IAOO,IAAKC,qBAAAA,iBAAAA,SAAAA,qBAAAA,EAAAA;;AAAAA,IAAAA,OAAAA,qBAAAA;AAEX,CAAA,CAAA,EAAA;AAEM,IAAA,qBAAKC,iBAAAA,SAAAA,qBAAAA,EAAAA;;AAAAA,IAAAA,OAAAA,qBAAAA;AAEX,CAAA,CAAA,EAAA;;ACDM,MAAMC,0BAAAA,SAAmCC,SAAAA,CAAAA;IAClCC,UAAAA,GAAa;AACnB,QAAA,KAAK,CAACA,UAAAA,EA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MC,SAAAA,GAAYd,eAAAA,CACdC,CAAAA,CAAEc,KAAK,CAACd,EAAEK,MAAM,CAAC,EAAC,CAAA,CAAGC,WAAW,EAAA,CAAA,CAAA;gBAGpC,MAAMS,MAAAA,GAAU,MAAMF,SAAAA,CAAUD,GAAAA,CAAAA;gBAChC,OAAOI,OAAAA,CAAQC,GAAG,CAACF,MAAAA,CAAOG,GAAG,CAAC,CAACC,EAAAA,GAAOR,cAAAA,CAAeS,GAAG,CAACD,EAAAA,EAAI;AACzDE,wBAAAA,IAAAA,EAAMT,IAAIU,YAAY;AACtBC,wBAAAA,KAAAA,EAAOX,IAAIW;AACf,qBAAA,CAAA,CAAA,CAAA;AACJ,YAAA,CAAA,CAAA,EAAA,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;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privateaim/messenger-kit",
3
- "version": "0.7.13",
3
+ "version": "0.7.15",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "exports": {
@@ -30,13 +30,13 @@
30
30
  "dependencies": {
31
31
  "@validup/adapter-zod": "^0.1.8",
32
32
  "validup": "^0.1.8",
33
- "zod": "^3.24.3"
33
+ "zod": "^3.25.76"
34
34
  },
35
35
  "devDependencies": {
36
- "@privateaim/core-kit": "^0.8.12"
36
+ "@privateaim/core-kit": "^0.8.14"
37
37
  },
38
38
  "peerDependencies": {
39
- "@privateaim/core-kit": "^0.8.12"
39
+ "@privateaim/core-kit": "^0.8.14"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"