@digipair/skill-kafka 0.131.0

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.
@@ -0,0 +1,274 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "title": "@digipair/skill-kafka",
5
+ "summary": "Produire/consommer des messages Kafka",
6
+ "description": "Gérer la communication avec Kafka.",
7
+ "version": "0.1.0",
8
+ "x-icon": "💻"
9
+ },
10
+ "paths": {
11
+ "/kafka": {
12
+ "post": {
13
+ "tags": [
14
+ "service"
15
+ ],
16
+ "summary": "Connecter aux brokers Kafka",
17
+ "parameters": [
18
+ {
19
+ "name": "clientId",
20
+ "summary": "ClientId du worker",
21
+ "required": true,
22
+ "description": "ClientId du worker",
23
+ "schema": {
24
+ "type": "string"
25
+ }
26
+ },
27
+ {
28
+ "name": "brokers",
29
+ "summary": "Brokers Kafka",
30
+ "required": true,
31
+ "description": "Adresses des brokers",
32
+ "schema": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "string"
36
+ }
37
+ }
38
+ }
39
+ ],
40
+ "x-events": [],
41
+ "responses": {
42
+ "200": {
43
+ "description": "Connexion aux brokers Kafka",
44
+ "content": {
45
+ "application/json": {
46
+ "schema": {
47
+ "type": "object",
48
+ "properties": {
49
+ "producer": {
50
+ "type": "object",
51
+ "description": "Instance du producteur de messages"
52
+ },
53
+ "consumer": {
54
+ "type": "object",
55
+ "description": "Instance du consommateur de messages"
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ },
65
+ "/produce": {
66
+ "post": {
67
+ "tags": [
68
+ "service"
69
+ ],
70
+ "summary": "Produire des messages Kafka",
71
+ "parameters": [
72
+ {
73
+ "name": "client",
74
+ "summary": "Connection aux broker Kafka",
75
+ "required": true,
76
+ "description": "Client de production/consommation de messages Kafka",
77
+ "schema": {
78
+ "type": "array",
79
+ "items": {
80
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
81
+ }
82
+ }
83
+ },
84
+ {
85
+ "name": "topic",
86
+ "summary": "Topic",
87
+ "required": true,
88
+ "description": "Topic Kafka",
89
+ "schema": {
90
+ "type": "string"
91
+ }
92
+ },
93
+ {
94
+ "name": "messages",
95
+ "summary": "Message",
96
+ "required": true,
97
+ "description": "Tableau de messages à produire",
98
+ "schema": {
99
+ "type": "array",
100
+ "items": {
101
+ "type": "object",
102
+ "properties": {
103
+ "key": {
104
+ "type": "string",
105
+ "description": "Clé du message (pour la répartition par partition)"
106
+ },
107
+ "value": {
108
+ "type": "string",
109
+ "description": "Contenu du message (peut être un objet stringifié)"
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ ],
116
+ "x-events": [],
117
+ "responses": {
118
+ "200": {
119
+ "description": "Metadata de l'enregistrement",
120
+ "content": {
121
+ "application/json": {
122
+ "schema": {
123
+ "type": "array",
124
+ "items": {
125
+ "type": "object",
126
+ "description": "Information d'enregistrement du message",
127
+ "properties": {
128
+ "topicName": {
129
+ "type": "string",
130
+ "description": "Nom du topic utilisé"
131
+ },
132
+ "partition": {
133
+ "type": "integer",
134
+ "description": "Nom de la partition utilisée"
135
+ },
136
+ "errorCode": {
137
+ "type": "integer",
138
+ "description": "Code d'erreur"
139
+ },
140
+ "offset": {
141
+ "type": "string",
142
+ "description": "Offset du message dans le topic"
143
+ },
144
+ "timestamp": {
145
+ "type": "string",
146
+ "description": "Timestamp de l'enregistrement"
147
+ },
148
+ "baseOffset": {
149
+ "type": "string",
150
+ "description": "Offset du topic avant l'enregistrement"
151
+ },
152
+ "logAppendTime": {
153
+ "type": "string",
154
+ "description": "Timestamp assigné par le broker à l’écriture"
155
+ },
156
+ "logStartOffset": {
157
+ "type": "string",
158
+ "description": "Le plus ancien offset disponible du topic"
159
+ }
160
+ },
161
+ "additionalProperties": true
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
169
+ },
170
+ "/consume": {
171
+ "post": {
172
+ "tags": [
173
+ "service"
174
+ ],
175
+ "summary": "Consommer un message Kafka",
176
+ "parameters": [
177
+ {
178
+ "name": "client",
179
+ "summary": "Connection aux broker Kafka",
180
+ "required": true,
181
+ "description": "Client de production/consommation de messages Kafka",
182
+ "schema": {
183
+ "type": "array",
184
+ "items": {
185
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
186
+ }
187
+ }
188
+ },
189
+ {
190
+ "name": "execute",
191
+ "summary": "Execute",
192
+ "required": true,
193
+ "description": "Commandes à exécuter",
194
+ "schema": {
195
+ "type": "array",
196
+ "items": {
197
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
198
+ }
199
+ }
200
+ },
201
+ {
202
+ "name": "groupId",
203
+ "summary": "groupId",
204
+ "required": true,
205
+ "description": "Group du consumer",
206
+ "schema": {
207
+ "type": "string"
208
+ }
209
+ },
210
+ {
211
+ "name": "topic",
212
+ "summary": "Topic",
213
+ "required": true,
214
+ "description": "Topic Kafka",
215
+ "schema": {
216
+ "type": "string"
217
+ }
218
+ }
219
+ ],
220
+ "x-events": [],
221
+ "responses": {
222
+ "200": {
223
+ "description": "Consumer du topic",
224
+ "content": {
225
+ "application/json": {
226
+ "schema": {
227
+ "type": "object",
228
+ "description": "Méthodes de manipulation du consumer",
229
+ "properties": {
230
+ "disconnect()": {
231
+ "type": "object",
232
+ "description": "Méthode de déconnexion du consumer"
233
+ }
234
+ },
235
+ "additionalProperties": true
236
+ }
237
+ }
238
+ }
239
+ }
240
+ }
241
+ }
242
+ },
243
+ "/consumerDisconnect": {
244
+ "post": {
245
+ "tags": [
246
+ "service"
247
+ ],
248
+ "summary": "Deconnecter un consumer",
249
+ "parameters": [
250
+ {
251
+ "name": "consumer",
252
+ "summary": "Consumer",
253
+ "required": true,
254
+ "description": "Consumer Kafka",
255
+ "schema": {
256
+ "type": "object",
257
+ "properties": {
258
+ "disconnect()": {
259
+ "type": "object",
260
+ "description": "Méthode de déconnexion du consumer"
261
+ }
262
+ }
263
+ }
264
+ }
265
+ ],
266
+ "x-events": []
267
+ }
268
+ }
269
+ },
270
+ "components": {
271
+ "schemas": {}
272
+ },
273
+ "x-scene-blocks": {}
274
+ }
@@ -0,0 +1,274 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "title": "@digipair/skill-kafka",
5
+ "summary": "Produce/consume Kafka messages",
6
+ "description": "Manage communication with Kafka.",
7
+ "version": "0.1.0",
8
+ "x-icon": "💻"
9
+ },
10
+ "paths": {
11
+ "/kafka": {
12
+ "post": {
13
+ "tags": [
14
+ "service"
15
+ ],
16
+ "summary": "Connect to Kafka brokers",
17
+ "parameters": [
18
+ {
19
+ "name": "clientId",
20
+ "summary": "Worker clientId",
21
+ "required": true,
22
+ "description": "Worker clientId",
23
+ "schema": {
24
+ "type": "string"
25
+ }
26
+ },
27
+ {
28
+ "name": "brokers",
29
+ "summary": "Kafka brokers",
30
+ "required": true,
31
+ "description": "Broker addresses",
32
+ "schema": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "string"
36
+ }
37
+ }
38
+ }
39
+ ],
40
+ "x-events": [],
41
+ "responses": {
42
+ "200": {
43
+ "description": "Connection to Kafka brokers",
44
+ "content": {
45
+ "application/json": {
46
+ "schema": {
47
+ "type": "object",
48
+ "properties": {
49
+ "producer": {
50
+ "type": "object",
51
+ "description": "Message producer instance"
52
+ },
53
+ "consumer": {
54
+ "type": "object",
55
+ "description": "Message consumer instance"
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ },
65
+ "/produce": {
66
+ "post": {
67
+ "tags": [
68
+ "service"
69
+ ],
70
+ "summary": "Produce Kafka messages",
71
+ "parameters": [
72
+ {
73
+ "name": "client",
74
+ "summary": "Connection to Kafka brokers",
75
+ "required": true,
76
+ "description": "Kafka message producer/consumer client",
77
+ "schema": {
78
+ "type": "array",
79
+ "items": {
80
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
81
+ }
82
+ }
83
+ },
84
+ {
85
+ "name": "topic",
86
+ "summary": "Topic",
87
+ "required": true,
88
+ "description": "Kafka topic",
89
+ "schema": {
90
+ "type": "string"
91
+ }
92
+ },
93
+ {
94
+ "name": "messages",
95
+ "summary": "Message",
96
+ "required": true,
97
+ "description": "Array of messages to produce",
98
+ "schema": {
99
+ "type": "array",
100
+ "items": {
101
+ "type": "object",
102
+ "properties": {
103
+ "key": {
104
+ "type": "string",
105
+ "description": "Message key (for partition distribution)"
106
+ },
107
+ "value": {
108
+ "type": "string",
109
+ "description": "Message content (can be a stringified object)"
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ ],
116
+ "x-events": [],
117
+ "responses": {
118
+ "200": {
119
+ "description": "Record metadata",
120
+ "content": {
121
+ "application/json": {
122
+ "schema": {
123
+ "type": "array",
124
+ "items": {
125
+ "type": "object",
126
+ "description": "Message record information",
127
+ "properties": {
128
+ "topicName": {
129
+ "type": "string",
130
+ "description": "Name of the topic used"
131
+ },
132
+ "partition": {
133
+ "type": "integer",
134
+ "description": "Name of the partition used"
135
+ },
136
+ "errorCode": {
137
+ "type": "integer",
138
+ "description": "Error code"
139
+ },
140
+ "offset": {
141
+ "type": "string",
142
+ "description": "Message offset in the topic"
143
+ },
144
+ "timestamp": {
145
+ "type": "string",
146
+ "description": "Record timestamp"
147
+ },
148
+ "baseOffset": {
149
+ "type": "string",
150
+ "description": "Topic offset before the record was written"
151
+ },
152
+ "logAppendTime": {
153
+ "type": "string",
154
+ "description": "Timestamp assigned by the broker when writing"
155
+ },
156
+ "logStartOffset": {
157
+ "type": "string",
158
+ "description": "Oldest available offset in the topic"
159
+ }
160
+ },
161
+ "additionalProperties": true
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
169
+ },
170
+ "/consume": {
171
+ "post": {
172
+ "tags": [
173
+ "service"
174
+ ],
175
+ "summary": "Consume a Kafka message",
176
+ "parameters": [
177
+ {
178
+ "name": "client",
179
+ "summary": "Connection to Kafka brokers",
180
+ "required": true,
181
+ "description": "Kafka message producer/consumer client",
182
+ "schema": {
183
+ "type": "array",
184
+ "items": {
185
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
186
+ }
187
+ }
188
+ },
189
+ {
190
+ "name": "execute",
191
+ "summary": "Execute",
192
+ "required": true,
193
+ "description": "Commands to execute",
194
+ "schema": {
195
+ "type": "array",
196
+ "items": {
197
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
198
+ }
199
+ }
200
+ },
201
+ {
202
+ "name": "groupId",
203
+ "summary": "groupId",
204
+ "required": true,
205
+ "description": "Consumer group",
206
+ "schema": {
207
+ "type": "string"
208
+ }
209
+ },
210
+ {
211
+ "name": "topic",
212
+ "summary": "Topic",
213
+ "required": true,
214
+ "description": "Kafka topic",
215
+ "schema": {
216
+ "type": "string"
217
+ }
218
+ }
219
+ ],
220
+ "x-events": [],
221
+ "responses": {
222
+ "200": {
223
+ "description": "Topic consumer",
224
+ "content": {
225
+ "application/json": {
226
+ "schema": {
227
+ "type": "object",
228
+ "description": "Consumer manipulation methods",
229
+ "properties": {
230
+ "disconnect()": {
231
+ "type": "object",
232
+ "description": "Consumer disconnect method"
233
+ }
234
+ },
235
+ "additionalProperties": true
236
+ }
237
+ }
238
+ }
239
+ }
240
+ }
241
+ }
242
+ },
243
+ "/consumerDisconnect": {
244
+ "post": {
245
+ "tags": [
246
+ "service"
247
+ ],
248
+ "summary": "Disconnect a consumer",
249
+ "parameters": [
250
+ {
251
+ "name": "consumer",
252
+ "summary": "Consumer",
253
+ "required": true,
254
+ "description": "Kafka Consumer",
255
+ "schema": {
256
+ "type": "object",
257
+ "properties": {
258
+ "disconnect()": {
259
+ "type": "object",
260
+ "description": "Consumer disconnect method"
261
+ }
262
+ }
263
+ }
264
+ }
265
+ ],
266
+ "x-events": []
267
+ }
268
+ }
269
+ },
270
+ "components": {
271
+ "schemas": {}
272
+ },
273
+ "x-scene-blocks": {}
274
+ }
@@ -0,0 +1,2 @@
1
+ export * from './lib/skill-kafka.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { PinsSettings } from '@digipair/engine';
2
+ import { Kafka } from 'kafkajs';
3
+ export declare const kafka: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<Kafka>;
4
+ export declare const produce: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
5
+ export declare const consume: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
6
+ export declare const consumerDisconnect: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<void>;
7
+ //# sourceMappingURL=skill-kafka.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-kafka.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-kafka.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAiDhC,eAAO,MAAM,KAAK,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,mBACpB,CAAC;AAE9D,eAAO,MAAM,OAAO,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACpB,CAAC;AAEhE,eAAO,MAAM,OAAO,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACpB,CAAC;AAEhE,eAAO,MAAM,kBAAkB,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,kBACpB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@digipair/skill-kafka",
3
+ "version": "0.131.0",
4
+ "main": "./dist/index.cjs.js",
5
+ "module": "./dist/index.esm.js",
6
+ "types": "./dist/index.d.ts",
7
+ "keywords": [
8
+ "digipair",
9
+ "service",
10
+ "tool"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.esm.js",
16
+ "default": "./dist/index.cjs.js"
17
+ },
18
+ "./index.esm.js": "./dist/index.esm.js",
19
+ "./index.cjs.js": "./dist/index.cjs.js",
20
+ "./package.json": "./package.json",
21
+ "./schema.json": "./dist/schema.json",
22
+ "./schema.fr.json": "./dist/schema.fr.json"
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "README.md",
27
+ "package.json"
28
+ ],
29
+ "nx": {
30
+ "name": "skill-kafka"
31
+ },
32
+ "dependencies": {
33
+ "kafkajs": "^2.2.4"
34
+ }
35
+ }
36
+