@axxel/event-bus 1.0.9 → 1.1.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/README.md +0 -0
- package/dist/config/kafka.d.ts +0 -0
- package/dist/config/kafka.d.ts.map +1 -1
- package/dist/config/kafka.js +20 -1
- package/dist/consumers/index.d.ts +0 -0
- package/dist/consumers/index.d.ts.map +0 -0
- package/dist/consumers/index.js +0 -0
- package/dist/consumers/poolCreatedConsumer.d.ts +0 -0
- package/dist/consumers/poolCreatedConsumer.d.ts.map +0 -0
- package/dist/consumers/poolCreatedConsumer.js +0 -0
- package/dist/consumers/tokenPriceConsumer.d.ts +0 -0
- package/dist/consumers/tokenPriceConsumer.d.ts.map +0 -0
- package/dist/consumers/tokenPriceConsumer.js +0 -0
- package/dist/consumers/tradeExecutionConsumer.d.ts +0 -0
- package/dist/consumers/tradeExecutionConsumer.d.ts.map +0 -0
- package/dist/consumers/tradeExecutionConsumer.js +0 -0
- package/dist/consumers/walletTransactionConsumer.d.ts +0 -0
- package/dist/consumers/walletTransactionConsumer.d.ts.map +0 -0
- package/dist/consumers/walletTransactionConsumer.js +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.d.ts.map +0 -0
- package/dist/index.js +0 -0
- package/dist/producers/index.d.ts +0 -0
- package/dist/producers/index.d.ts.map +0 -0
- package/dist/producers/index.js +0 -0
- package/dist/producers/poolCreatedProducer.d.ts +0 -0
- package/dist/producers/poolCreatedProducer.d.ts.map +0 -0
- package/dist/producers/poolCreatedProducer.js +0 -0
- package/dist/producers/tokenPriceProducer.d.ts +0 -0
- package/dist/producers/tokenPriceProducer.d.ts.map +0 -0
- package/dist/producers/tokenPriceProducer.js +0 -0
- package/dist/producers/tradeExecutionProducer.d.ts +0 -0
- package/dist/producers/tradeExecutionProducer.d.ts.map +0 -0
- package/dist/producers/tradeExecutionProducer.js +0 -0
- package/dist/producers/walletTransactionProducer.d.ts +0 -0
- package/dist/producers/walletTransactionProducer.d.ts.map +0 -0
- package/dist/producers/walletTransactionProducer.js +0 -0
- package/dist/topics.d.ts +0 -0
- package/dist/topics.d.ts.map +0 -0
- package/dist/topics.js +0 -0
- package/dist/types/PoolCreatedEvent.d.ts +0 -0
- package/dist/types/PoolCreatedEvent.d.ts.map +0 -0
- package/dist/types/PoolCreatedEvent.js +0 -0
- package/dist/types/TokenPriceEvent.d.ts +0 -0
- package/dist/types/TokenPriceEvent.d.ts.map +0 -0
- package/dist/types/TokenPriceEvent.js +0 -0
- package/dist/types/TradeExecutionEvent.d.ts +0 -0
- package/dist/types/TradeExecutionEvent.d.ts.map +0 -0
- package/dist/types/TradeExecutionEvent.js +0 -0
- package/dist/types/WalletTransactionEvent.d.ts +0 -0
- package/dist/types/WalletTransactionEvent.d.ts.map +0 -0
- package/dist/types/WalletTransactionEvent.js +0 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/index.d.ts.map +0 -0
- package/dist/types/index.js +0 -0
- package/dist/validation/common.d.ts +0 -0
- package/dist/validation/common.d.ts.map +0 -0
- package/dist/validation/common.js +0 -0
- package/dist/validation/tokenPriceEvent.schema.d.ts +0 -0
- package/dist/validation/tokenPriceEvent.schema.d.ts.map +0 -0
- package/dist/validation/tokenPriceEvent.schema.js +0 -0
- package/dist/validation/walletTransactionEvent.schema.d.ts +0 -0
- package/dist/validation/walletTransactionEvent.schema.d.ts.map +0 -0
- package/dist/validation/walletTransactionEvent.schema.js +0 -0
- package/package.json +5 -7
package/README.md
CHANGED
|
File without changes
|
package/dist/config/kafka.d.ts
CHANGED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kafka.d.ts","sourceRoot":"","sources":["../../src/config/kafka.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"kafka.d.ts","sourceRoot":"","sources":["../../src/config/kafka.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAehC,eAAO,MAAM,KAAK,OAehB,CAAC"}
|
package/dist/config/kafka.js
CHANGED
|
@@ -5,11 +5,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.kafka = void 0;
|
|
7
7
|
const kafkajs_1 = require("kafkajs");
|
|
8
|
+
const aws_msk_iam_sasl_signer_js_1 = require("aws-msk-iam-sasl-signer-js");
|
|
8
9
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
9
10
|
dotenv_1.default.config();
|
|
11
|
+
const isMSK = process.env.KAFKA_ENV === 'msk';
|
|
12
|
+
async function oauthBearerProvider() {
|
|
13
|
+
const { token } = await (0, aws_msk_iam_sasl_signer_js_1.generateAuthToken)({
|
|
14
|
+
region: process.env.AWS_REGION || 'us-east-1',
|
|
15
|
+
});
|
|
16
|
+
return { value: token };
|
|
17
|
+
}
|
|
10
18
|
exports.kafka = new kafkajs_1.Kafka({
|
|
11
19
|
clientId: process.env.KAFKA_CLIENT_ID || 'axxel-event-bus',
|
|
12
20
|
brokers: process.env.KAFKA_BROKERS?.split(',') || [],
|
|
13
|
-
|
|
21
|
+
...(isMSK
|
|
22
|
+
? {
|
|
23
|
+
ssl: true,
|
|
24
|
+
sasl: {
|
|
25
|
+
mechanism: 'oauthbearer',
|
|
26
|
+
oauthBearerProvider,
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
: {
|
|
30
|
+
ssl: false,
|
|
31
|
+
}),
|
|
14
32
|
});
|
|
33
|
+
console.log('Kafka mode:', isMSK ? 'MSK (IAM)' : 'Local');
|
|
15
34
|
console.log('Kafka brokers:', process.env.KAFKA_BROKERS);
|
|
File without changes
|
|
File without changes
|
package/dist/consumers/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.d.ts.map
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/producers/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/topics.d.ts
CHANGED
|
File without changes
|
package/dist/topics.d.ts.map
CHANGED
|
File without changes
|
package/dist/topics.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/types/index.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/types/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axxel/event-bus",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Axxel Kafka Event Bus SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
|
-
"publishConfig": {
|
|
11
|
-
"access": "public"
|
|
12
|
-
},
|
|
13
10
|
"scripts": {
|
|
14
11
|
"dev": "tsx example/demo.ts",
|
|
15
12
|
"build": "tsc -p tsconfig.build.json",
|
|
@@ -19,16 +16,17 @@
|
|
|
19
16
|
"clean": "rm -rf dist",
|
|
20
17
|
"prepublishOnly": "npm run build",
|
|
21
18
|
"test": "echo \"No tests yet\" && exit 0",
|
|
22
|
-
"publish:public": "npm publish --access public",
|
|
23
19
|
"publish:private": "npm publish",
|
|
24
20
|
"release:patch": "npm version patch && npm publish --access public",
|
|
25
21
|
"release:minor": "npm version minor && npm publish --access public",
|
|
26
|
-
"release:major": "npm version major && npm publish --access public"
|
|
22
|
+
"release:major": "npm version major && npm publish --access public",
|
|
23
|
+
"kafka:setup": "tsx scripts/setup.ts"
|
|
27
24
|
},
|
|
28
25
|
"keywords": [],
|
|
29
26
|
"author": "",
|
|
30
27
|
"license": "ISC",
|
|
31
28
|
"dependencies": {
|
|
29
|
+
"aws-msk-iam-sasl-signer-js": "^1.0.1",
|
|
32
30
|
"dotenv": "^17.2.3",
|
|
33
31
|
"kafkajs": "^2.2.4",
|
|
34
32
|
"zod": "^4.1.12"
|
|
@@ -39,4 +37,4 @@
|
|
|
39
37
|
"tsx": "^4.20.6",
|
|
40
38
|
"typescript": "^5.9.3"
|
|
41
39
|
}
|
|
42
|
-
}
|
|
40
|
+
}
|