@glowlabs-org/events-sdk 0.1.0 → 0.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 +8 -8
- package/package.json +8 -11
package/README.md
CHANGED
@@ -9,7 +9,7 @@ A TypeScript-first SDK for consuming and emitting typed events on the Glow platf
|
|
9
9
|
### 1. Install
|
10
10
|
|
11
11
|
```bash
|
12
|
-
|
12
|
+
pnpm install @glowlabs-org/events-sdk
|
13
13
|
```
|
14
14
|
|
15
15
|
### 2. Available Events
|
@@ -23,7 +23,7 @@ npm install @glow/events-sdk
|
|
23
23
|
|
24
24
|
```ts
|
25
25
|
// AuditPushedEvent
|
26
|
-
import type { AuditPushedEvent } from "@
|
26
|
+
import type { AuditPushedEvent } from "@glowlabs-org/events-sdk";
|
27
27
|
// type AuditPushedEvent = {
|
28
28
|
// farmId: string;
|
29
29
|
// protocolFeeUSDPrice_12Decimals: string;
|
@@ -44,7 +44,7 @@ import type { AuditPushedEvent } from "@glow/events-sdk";
|
|
44
44
|
### Listen to Events
|
45
45
|
|
46
46
|
```ts
|
47
|
-
import { createGlowListener } from "@
|
47
|
+
import { createGlowListener } from "@glowlabs-org/events-sdk";
|
48
48
|
|
49
49
|
async function main() {
|
50
50
|
const sdk = await createGlowListener({
|
@@ -75,7 +75,7 @@ main();
|
|
75
75
|
### Emit Events (Admin Only)
|
76
76
|
|
77
77
|
```ts
|
78
|
-
import { createGlowListener } from "@
|
78
|
+
import { createGlowListener } from "@glowlabs-org/events-sdk";
|
79
79
|
|
80
80
|
async function main() {
|
81
81
|
const sdk = await createGlowListener({
|
@@ -203,7 +203,7 @@ import {
|
|
203
203
|
bindQueueToExchange,
|
204
204
|
deleteExchange,
|
205
205
|
deleteQueue,
|
206
|
-
} from "@
|
206
|
+
} from "@glowlabs-org/events-sdk";
|
207
207
|
|
208
208
|
await createExchange({
|
209
209
|
username: "admin",
|
@@ -240,7 +240,7 @@ If your listener credentials only have `read` permission (no `configure`), you m
|
|
240
240
|
### 1. Admin: Pre-create and bind the queue
|
241
241
|
|
242
242
|
```ts
|
243
|
-
import { createAndBindQueue } from "@
|
243
|
+
import { createAndBindQueue } from "@glowlabs-org/events-sdk";
|
244
244
|
|
245
245
|
await createAndBindQueue({
|
246
246
|
username: "admin",
|
@@ -253,7 +253,7 @@ await createAndBindQueue({
|
|
253
253
|
### 2. Listener: Consume from the pre-created queue
|
254
254
|
|
255
255
|
```ts
|
256
|
-
import { createGlowListener } from "@
|
256
|
+
import { createGlowListener } from "@glowlabs-org/events-sdk";
|
257
257
|
|
258
258
|
const sdk = await createGlowListener({
|
259
259
|
username: "listener",
|
@@ -286,7 +286,7 @@ make clean
|
|
286
286
|
```
|
287
287
|
|
288
288
|
- The first time, run `npm login` to authenticate with npm.
|
289
|
-
- For scoped packages (like `@
|
289
|
+
- For scoped packages (like `@glowlabs-org/events-sdk`), the Makefile uses `--access public` for publishing.
|
290
290
|
|
291
291
|
---
|
292
292
|
|
package/package.json
CHANGED
@@ -1,18 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "@glowlabs-org/events-sdk",
|
3
|
-
"version": "0.1.
|
4
|
-
"description": "Typed event SDK for Glow, powered by
|
3
|
+
"version": "0.1.1",
|
4
|
+
"description": "Typed event SDK for Glow, powered by RabbitMQ and Zod.",
|
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
|
"repository": {
|
14
11
|
"type": "git",
|
15
|
-
"url": "https://github.com/glowlabs-org/glow-events
|
12
|
+
"url": "https://github.com/glowlabs-org/glow-events"
|
16
13
|
},
|
17
14
|
"author": "Lironie <julien@glowlabs.org>",
|
18
15
|
"license": "MIT",
|
@@ -25,12 +22,9 @@
|
|
25
22
|
"typescript",
|
26
23
|
"glow"
|
27
24
|
],
|
28
|
-
"scripts": {
|
29
|
-
"build": "tsc -p tsconfig.json",
|
30
|
-
"prepublishOnly": "npm run build"
|
31
|
-
},
|
32
25
|
"dependencies": {
|
33
26
|
"@kafkajs/confluent-schema-registry": "^3.8.0",
|
27
|
+
"@types/node": "^20.0.0",
|
34
28
|
"amqplib": "^0.10.8",
|
35
29
|
"json-schema": "^0.4.0",
|
36
30
|
"kafkajs": "^2.2.4",
|
@@ -42,5 +36,8 @@
|
|
42
36
|
"@types/amqplib": "^0.10.7",
|
43
37
|
"@types/json-schema": "^7.0.15",
|
44
38
|
"typescript": "^5.8.3"
|
39
|
+
},
|
40
|
+
"scripts": {
|
41
|
+
"build": "tsc -p tsconfig.json"
|
45
42
|
}
|
46
|
-
}
|
43
|
+
}
|