@lakutata/nats 1.4.0 → 1.5.1
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
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.5.1](https://github.com/lakutata/lakutata-packages/compare/@lakutata/nats@1.5.0...@lakutata/nats@1.5.1) (2025-12-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @lakutata/nats
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.5.0](https://github.com/lakutata/lakutata-packages/compare/@lakutata/nats@1.4.0...@lakutata/nats@1.5.0) (2025-12-27)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **nats:** export MessagePackCodec in CommonExports ([b22f0d0](https://github.com/lakutata/lakutata-packages/commit/b22f0d0480bbbe5b6e83b7f481e4f5ce4fc06e15))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [1.4.0](https://github.com/lakutata/lakutata-packages/compare/@lakutata/nats@1.3.12...@lakutata/nats@1.4.0) (2025-12-27)
|
|
7
26
|
|
|
8
27
|
|
package/dist/CommonExports.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { SetupNatsServiceEntrypoint } from './entrypoints/SetupNatsServiceEntryp
|
|
|
2
2
|
export { ServiceProxy, BuildServiceProxy, type BuildServiceProxyOptions } from './providers/ServiceProxy';
|
|
3
3
|
export { NATS, buildNatsClientOptions } from './components/NATS';
|
|
4
4
|
export { JSONCodec } from './codecs/JSONCodec';
|
|
5
|
+
export { MessagePackCodec } from './codecs/MessagePackCodec';
|
|
5
6
|
export { StringCodec } from 'nats';
|
|
6
7
|
export type { SubscribeOptions } from './types/SubscribeOptions';
|
|
7
8
|
export type { Subscription, Codec } from 'nats';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonExports.d.ts","sourceRoot":"","sources":["../src/CommonExports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,0BAA0B,EAAC,MAAM,0CAA0C,CAAA;AACnF,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAC,MAAM,0BAA0B,CAAA;AACvG,OAAO,EAAC,IAAI,EAAE,sBAAsB,EAAC,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAC,WAAW,EAAC,MAAM,MAAM,CAAA;AAChC,YAAY,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAA;AAC9D,YAAY,EAAC,YAAY,EAAE,KAAK,EAAC,MAAM,MAAM,CAAA;AAC7C,YAAY,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAA;AACrE,OAAO,EAAC,uBAAuB,EAAC,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAA;AAC1E,OAAO,EAAC,2BAA2B,EAAC,MAAM,0CAA0C,CAAA;AACpF,OAAO,EAAC,kCAAkC,EAAC,MAAM,iDAAiD,CAAA;AAClG,OAAO,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAA;AACxE,OAAO,EAAC,2BAA2B,EAAC,MAAM,0CAA0C,CAAA"}
|
|
1
|
+
{"version":3,"file":"CommonExports.d.ts","sourceRoot":"","sources":["../src/CommonExports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,0BAA0B,EAAC,MAAM,0CAA0C,CAAA;AACnF,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAC,MAAM,0BAA0B,CAAA;AACvG,OAAO,EAAC,IAAI,EAAE,sBAAsB,EAAC,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAC,WAAW,EAAC,MAAM,MAAM,CAAA;AAChC,YAAY,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAA;AAC9D,YAAY,EAAC,YAAY,EAAE,KAAK,EAAC,MAAM,MAAM,CAAA;AAC7C,YAAY,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAA;AACrE,OAAO,EAAC,uBAAuB,EAAC,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAA;AAC1E,OAAO,EAAC,2BAA2B,EAAC,MAAM,0CAA0C,CAAA;AACpF,OAAO,EAAC,kCAAkC,EAAC,MAAM,iDAAiD,CAAA;AAClG,OAAO,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAA;AACxE,OAAO,EAAC,2BAA2B,EAAC,MAAM,0CAA0C,CAAA"}
|
package/dist/CommonExports.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NatsRequestTimeoutException = exports.NatsNotFoundException = exports.NatsNoRespondersAvailableException = exports.NatsInternalServerException = exports.NatsForbiddenException = exports.NatsBadRequestException = exports.StringCodec = exports.JSONCodec = exports.buildNatsClientOptions = exports.NATS = exports.BuildServiceProxy = exports.ServiceProxy = exports.SetupNatsServiceEntrypoint = void 0;
|
|
3
|
+
exports.NatsRequestTimeoutException = exports.NatsNotFoundException = exports.NatsNoRespondersAvailableException = exports.NatsInternalServerException = exports.NatsForbiddenException = exports.NatsBadRequestException = exports.StringCodec = exports.MessagePackCodec = exports.JSONCodec = exports.buildNatsClientOptions = exports.NATS = exports.BuildServiceProxy = exports.ServiceProxy = exports.SetupNatsServiceEntrypoint = void 0;
|
|
4
4
|
var SetupNatsServiceEntrypoint_1 = require("./entrypoints/SetupNatsServiceEntrypoint");
|
|
5
5
|
Object.defineProperty(exports, "SetupNatsServiceEntrypoint", { enumerable: true, get: function () { return SetupNatsServiceEntrypoint_1.SetupNatsServiceEntrypoint; } });
|
|
6
6
|
var ServiceProxy_1 = require("./providers/ServiceProxy");
|
|
@@ -11,6 +11,8 @@ Object.defineProperty(exports, "NATS", { enumerable: true, get: function () { re
|
|
|
11
11
|
Object.defineProperty(exports, "buildNatsClientOptions", { enumerable: true, get: function () { return NATS_1.buildNatsClientOptions; } });
|
|
12
12
|
var JSONCodec_1 = require("./codecs/JSONCodec");
|
|
13
13
|
Object.defineProperty(exports, "JSONCodec", { enumerable: true, get: function () { return JSONCodec_1.JSONCodec; } });
|
|
14
|
+
var MessagePackCodec_1 = require("./codecs/MessagePackCodec");
|
|
15
|
+
Object.defineProperty(exports, "MessagePackCodec", { enumerable: true, get: function () { return MessagePackCodec_1.MessagePackCodec; } });
|
|
14
16
|
var nats_1 = require("nats");
|
|
15
17
|
Object.defineProperty(exports, "StringCodec", { enumerable: true, get: function () { return nats_1.StringCodec; } });
|
|
16
18
|
var NatsBadRequestException_1 = require("./exceptions/NatsBadRequestException");
|
|
@@ -5,7 +5,7 @@ const helper_1 = require("lakutata/helper");
|
|
|
5
5
|
function MessagePackCodec() {
|
|
6
6
|
return {
|
|
7
7
|
encode(d) {
|
|
8
|
-
return helper_1.MessagePack.encode([d]);
|
|
8
|
+
return helper_1.MessagePack.encode(JSON.parse(JSON.stringify([d])));
|
|
9
9
|
},
|
|
10
10
|
decode(a) {
|
|
11
11
|
const [res] = helper_1.MessagePack.decode(a);
|
|
@@ -52,11 +52,11 @@ class TestComponent extends lakutata_1.Component {
|
|
|
52
52
|
this.self.on('testEvt', handler2);
|
|
53
53
|
// this.nats.onServiceEvent(this.app.appId, 'testEvt', handler1)
|
|
54
54
|
// this.nats.onServiceEvent(this.app.appId, 'testEvt', handler2)
|
|
55
|
-
setInterval(() => {
|
|
56
|
-
|
|
57
|
-
}, 1000)
|
|
55
|
+
// setInterval(() => {
|
|
56
|
+
// this.nats.emitServiceEvent('testEvt', 123, 456)
|
|
57
|
+
// }, 1000)
|
|
58
58
|
try {
|
|
59
|
-
console.log(await this.self.invoke({ test: true }));
|
|
59
|
+
console.log(await this.self.invoke({ test: true, start: new Date() }));
|
|
60
60
|
}
|
|
61
61
|
catch (e) {
|
|
62
62
|
// console.error(JSON.parse(JSON.stringify(e)))
|
|
@@ -78,6 +78,7 @@ __decorate([
|
|
|
78
78
|
], TestComponent.prototype, "self", void 0);
|
|
79
79
|
class TestController extends entrypoint_1.Controller {
|
|
80
80
|
async test(inp) {
|
|
81
|
+
console.log(inp);
|
|
81
82
|
// throw new Error('fuck')
|
|
82
83
|
// throw new NatsForbiddenException('fuck')
|
|
83
84
|
// return 'hahahah'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lakutata/nats",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Lakutata NATS Client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lakutata",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"lakutata": "^2.0.117",
|
|
33
33
|
"nats": "^2.29.3"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "17359613e7541eecc38622ced493bd60e80f1f22"
|
|
36
36
|
}
|