@bsb/base 9.0.0 → 9.0.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 +6 -41
- package/lib/plugins/config-default/interfaces.d.ts +3 -2
- package/lib/plugins/service-benchmarkify/index.d.ts +312 -0
- package/lib/plugins/service-benchmarkify/index.js +138 -0
- package/lib/plugins/service-benchmarkify/index.js.map +1 -0
- package/lib/plugins/service-default0/index.d.ts +287 -0
- package/lib/plugins/service-default0/index.js +118 -0
- package/lib/plugins/service-default0/index.js.map +1 -0
- package/lib/{tests.d.ts → plugins/service-default1/client.d.ts} +16 -1
- package/lib/plugins/service-default1/client.js +70 -0
- package/lib/plugins/service-default1/client.js.map +1 -0
- package/lib/plugins/service-default1/index.d.ts +304 -0
- package/lib/plugins/service-default1/index.js +179 -0
- package/lib/plugins/service-default1/index.js.map +1 -0
- package/lib/plugins/service-default2/index.d.ts +359 -0
- package/lib/plugins/service-default2/index.js +137 -0
- package/lib/plugins/service-default2/index.js.map +1 -0
- package/lib/plugins/service-default3/index.d.ts +119 -0
- package/lib/plugins/service-default3/index.js +88 -0
- package/lib/plugins/service-default3/index.js.map +1 -0
- package/lib/plugins/service-default4/index.d.ts +81 -0
- package/lib/{tests.js → plugins/service-default4/index.js} +35 -16
- package/lib/plugins/service-default4/index.js.map +1 -0
- package/lib/schemas/config-default.plugin.json +1 -1
- package/lib/schemas/events-default.plugin.json +1 -1
- package/lib/schemas/observable-default.plugin.json +1 -1
- package/lib/schemas/service-benchmarkify.json +229 -0
- package/lib/schemas/service-default0.json +216 -0
- package/lib/schemas/service-default1.json +242 -0
- package/lib/schemas/service-default2.json +268 -0
- package/lib/schemas/service-default3.json +65 -0
- package/lib/schemas/service-default4.json +33 -0
- package/lib/serviceBase/events.js +2 -2
- package/lib/serviceBase/events.js.map +1 -1
- package/lib/serviceBase/observable.js +1 -1
- package/lib/serviceBase/observable.js.map +1 -1
- package/lib/serviceBase/plugins.d.ts +8 -1
- package/lib/serviceBase/plugins.js +113 -13
- package/lib/serviceBase/plugins.js.map +1 -1
- package/lib/serviceBase/services.js +2 -2
- package/lib/serviceBase/services.js.map +1 -1
- package/package.json +1 -1
- package/lib/tests.js.map +0 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pluginName": "service-default0",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"events": {
|
|
5
|
+
"test": {
|
|
6
|
+
"type": "fire-and-forget",
|
|
7
|
+
"category": "emitEvents",
|
|
8
|
+
"description": "Test event with string parameters",
|
|
9
|
+
"inputSchema": {
|
|
10
|
+
"description": "Test event parameters",
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"a": {
|
|
14
|
+
"description": "First string parameter",
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"b": {
|
|
18
|
+
"description": "Second string parameter",
|
|
19
|
+
"type": "string"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"required": [
|
|
23
|
+
"a",
|
|
24
|
+
"b"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"outputSchema": null
|
|
28
|
+
},
|
|
29
|
+
"startup": {
|
|
30
|
+
"type": "fire-and-forget",
|
|
31
|
+
"category": "onEvents",
|
|
32
|
+
"description": "Handle system startup notification",
|
|
33
|
+
"inputSchema": {
|
|
34
|
+
"description": "Startup event parameters",
|
|
35
|
+
"type": "object",
|
|
36
|
+
"properties": {
|
|
37
|
+
"timestamp": {
|
|
38
|
+
"description": "Startup timestamp",
|
|
39
|
+
"type": "string",
|
|
40
|
+
"format": "datetime"
|
|
41
|
+
},
|
|
42
|
+
"source": {
|
|
43
|
+
"description": "Source identifier",
|
|
44
|
+
"type": "string"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": [
|
|
48
|
+
"timestamp",
|
|
49
|
+
"source"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"outputSchema": null
|
|
53
|
+
},
|
|
54
|
+
"calculate": {
|
|
55
|
+
"type": "returnable",
|
|
56
|
+
"category": "emitReturnableEvents",
|
|
57
|
+
"description": "Calculate with two numbers",
|
|
58
|
+
"inputSchema": {
|
|
59
|
+
"description": "Calculate input parameters",
|
|
60
|
+
"type": "object",
|
|
61
|
+
"properties": {
|
|
62
|
+
"a": {
|
|
63
|
+
"description": "First number",
|
|
64
|
+
"type": "number",
|
|
65
|
+
"format": "double",
|
|
66
|
+
"minimum": 0
|
|
67
|
+
},
|
|
68
|
+
"b": {
|
|
69
|
+
"description": "Second number",
|
|
70
|
+
"type": "number",
|
|
71
|
+
"format": "double",
|
|
72
|
+
"minimum": 0
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"required": [
|
|
76
|
+
"a",
|
|
77
|
+
"b"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"outputSchema": {
|
|
81
|
+
"description": "Calculation result",
|
|
82
|
+
"type": "number",
|
|
83
|
+
"format": "double"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"data.validate": {
|
|
87
|
+
"type": "returnable",
|
|
88
|
+
"category": "onReturnableEvents",
|
|
89
|
+
"description": "Validate data against a schema",
|
|
90
|
+
"inputSchema": {
|
|
91
|
+
"description": "Validation input",
|
|
92
|
+
"type": "object",
|
|
93
|
+
"properties": {
|
|
94
|
+
"data": {
|
|
95
|
+
"description": "Data to validate",
|
|
96
|
+
"oneOf": []
|
|
97
|
+
},
|
|
98
|
+
"schema": {
|
|
99
|
+
"description": "Schema name",
|
|
100
|
+
"type": "string"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"required": [
|
|
104
|
+
"data",
|
|
105
|
+
"schema"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"outputSchema": {
|
|
109
|
+
"description": "Validation output",
|
|
110
|
+
"type": "object",
|
|
111
|
+
"properties": {
|
|
112
|
+
"valid": {
|
|
113
|
+
"description": "Validation result",
|
|
114
|
+
"type": "boolean"
|
|
115
|
+
},
|
|
116
|
+
"errors": {
|
|
117
|
+
"description": "Validation errors",
|
|
118
|
+
"type": "array",
|
|
119
|
+
"items": {
|
|
120
|
+
"description": "Error message",
|
|
121
|
+
"type": "string"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"required": [
|
|
126
|
+
"valid",
|
|
127
|
+
"errors"
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"system.alert": {
|
|
132
|
+
"type": "broadcast",
|
|
133
|
+
"category": "emitBroadcast",
|
|
134
|
+
"description": "System-wide alert broadcast",
|
|
135
|
+
"inputSchema": {
|
|
136
|
+
"description": "System alert parameters",
|
|
137
|
+
"type": "object",
|
|
138
|
+
"properties": {
|
|
139
|
+
"level": {
|
|
140
|
+
"description": "Alert level",
|
|
141
|
+
"type": "string",
|
|
142
|
+
"enum": [
|
|
143
|
+
"info",
|
|
144
|
+
"warning",
|
|
145
|
+
"error",
|
|
146
|
+
"critical"
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"message": {
|
|
150
|
+
"description": "Alert message",
|
|
151
|
+
"type": "string"
|
|
152
|
+
},
|
|
153
|
+
"timestamp": {
|
|
154
|
+
"description": "Alert timestamp",
|
|
155
|
+
"type": "string",
|
|
156
|
+
"format": "datetime"
|
|
157
|
+
},
|
|
158
|
+
"source": {
|
|
159
|
+
"description": "Alert source",
|
|
160
|
+
"type": "string"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"required": [
|
|
164
|
+
"level",
|
|
165
|
+
"message",
|
|
166
|
+
"timestamp",
|
|
167
|
+
"source"
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"outputSchema": null
|
|
171
|
+
},
|
|
172
|
+
"system.shutdown": {
|
|
173
|
+
"type": "broadcast",
|
|
174
|
+
"category": "onBroadcast",
|
|
175
|
+
"description": "Listen for system shutdown broadcasts",
|
|
176
|
+
"inputSchema": {
|
|
177
|
+
"description": "Shutdown parameters",
|
|
178
|
+
"type": "object",
|
|
179
|
+
"properties": {
|
|
180
|
+
"reason": {
|
|
181
|
+
"description": "Shutdown reason",
|
|
182
|
+
"type": "string"
|
|
183
|
+
},
|
|
184
|
+
"gracefulTimeout": {
|
|
185
|
+
"description": "Graceful timeout in milliseconds",
|
|
186
|
+
"type": "number",
|
|
187
|
+
"format": "double"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"required": [
|
|
191
|
+
"reason",
|
|
192
|
+
"gracefulTimeout"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
"outputSchema": null
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"pluginType": "service",
|
|
199
|
+
"configSchema": {
|
|
200
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
201
|
+
"type": "object",
|
|
202
|
+
"properties": {
|
|
203
|
+
"testa": {
|
|
204
|
+
"type": "number"
|
|
205
|
+
},
|
|
206
|
+
"testb": {
|
|
207
|
+
"type": "number"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"required": [
|
|
211
|
+
"testa",
|
|
212
|
+
"testb"
|
|
213
|
+
],
|
|
214
|
+
"additionalProperties": false
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pluginName": "service-default1",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"events": {
|
|
5
|
+
"data.processed": {
|
|
6
|
+
"type": "fire-and-forget",
|
|
7
|
+
"category": "emitEvents",
|
|
8
|
+
"description": "Emitted when data processing is complete",
|
|
9
|
+
"inputSchema": {
|
|
10
|
+
"description": "Data processing result",
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"itemId": {
|
|
14
|
+
"description": "Processed item ID",
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"result": {
|
|
18
|
+
"description": "Processing result",
|
|
19
|
+
"oneOf": []
|
|
20
|
+
},
|
|
21
|
+
"processingTime": {
|
|
22
|
+
"description": "Processing time in milliseconds",
|
|
23
|
+
"type": "number",
|
|
24
|
+
"format": "double"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"required": [
|
|
28
|
+
"itemId",
|
|
29
|
+
"result",
|
|
30
|
+
"processingTime"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"outputSchema": null
|
|
34
|
+
},
|
|
35
|
+
"data.received": {
|
|
36
|
+
"type": "fire-and-forget",
|
|
37
|
+
"category": "onEvents",
|
|
38
|
+
"description": "Handle incoming data for processing",
|
|
39
|
+
"inputSchema": {
|
|
40
|
+
"description": "Received data parameters",
|
|
41
|
+
"type": "object",
|
|
42
|
+
"properties": {
|
|
43
|
+
"itemId": {
|
|
44
|
+
"description": "Received item ID",
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"data": {
|
|
48
|
+
"description": "Data payload",
|
|
49
|
+
"oneOf": []
|
|
50
|
+
},
|
|
51
|
+
"source": {
|
|
52
|
+
"description": "Data source",
|
|
53
|
+
"type": "string"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"required": [
|
|
57
|
+
"itemId",
|
|
58
|
+
"data",
|
|
59
|
+
"source"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"outputSchema": null
|
|
63
|
+
},
|
|
64
|
+
"calculation.request": {
|
|
65
|
+
"type": "returnable",
|
|
66
|
+
"category": "emitReturnableEvents",
|
|
67
|
+
"description": "Request calculation from external service",
|
|
68
|
+
"inputSchema": {
|
|
69
|
+
"description": "Calculation request parameters",
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"operation": {
|
|
73
|
+
"description": "Calculation operation",
|
|
74
|
+
"type": "string",
|
|
75
|
+
"enum": [
|
|
76
|
+
"add",
|
|
77
|
+
"subtract",
|
|
78
|
+
"multiply",
|
|
79
|
+
"divide"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"operands": {
|
|
83
|
+
"description": "List of operands",
|
|
84
|
+
"type": "array",
|
|
85
|
+
"items": {
|
|
86
|
+
"description": "Operand",
|
|
87
|
+
"type": "number",
|
|
88
|
+
"format": "double"
|
|
89
|
+
},
|
|
90
|
+
"minItems": 2
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"required": [
|
|
94
|
+
"operation",
|
|
95
|
+
"operands"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"outputSchema": {
|
|
99
|
+
"description": "Calculation result",
|
|
100
|
+
"type": "number",
|
|
101
|
+
"format": "double"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"text.transform": {
|
|
105
|
+
"type": "returnable",
|
|
106
|
+
"category": "onReturnableEvents",
|
|
107
|
+
"description": "Transform text according to specified operation",
|
|
108
|
+
"inputSchema": {
|
|
109
|
+
"description": "Text transformation parameters",
|
|
110
|
+
"type": "object",
|
|
111
|
+
"properties": {
|
|
112
|
+
"text": {
|
|
113
|
+
"description": "Text to transform",
|
|
114
|
+
"type": "string"
|
|
115
|
+
},
|
|
116
|
+
"transformation": {
|
|
117
|
+
"description": "Transformation type",
|
|
118
|
+
"type": "string",
|
|
119
|
+
"enum": [
|
|
120
|
+
"uppercase",
|
|
121
|
+
"lowercase",
|
|
122
|
+
"reverse",
|
|
123
|
+
"capitalize"
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"required": [
|
|
128
|
+
"text",
|
|
129
|
+
"transformation"
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
"outputSchema": {
|
|
133
|
+
"description": "Transformed text",
|
|
134
|
+
"type": "string"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"calculate": {
|
|
138
|
+
"type": "returnable",
|
|
139
|
+
"category": "onReturnableEvents",
|
|
140
|
+
"description": "Calculate with two numbers",
|
|
141
|
+
"inputSchema": {
|
|
142
|
+
"description": "Calculation parameters",
|
|
143
|
+
"type": "object",
|
|
144
|
+
"properties": {
|
|
145
|
+
"a": {
|
|
146
|
+
"description": "First number",
|
|
147
|
+
"type": "number",
|
|
148
|
+
"format": "double"
|
|
149
|
+
},
|
|
150
|
+
"b": {
|
|
151
|
+
"description": "Second number",
|
|
152
|
+
"type": "number",
|
|
153
|
+
"format": "double"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"required": [
|
|
157
|
+
"a",
|
|
158
|
+
"b"
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
"outputSchema": {
|
|
162
|
+
"description": "Calculation result",
|
|
163
|
+
"type": "number",
|
|
164
|
+
"format": "double"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"service.status": {
|
|
168
|
+
"type": "broadcast",
|
|
169
|
+
"category": "emitBroadcast",
|
|
170
|
+
"description": "Broadcast service status updates",
|
|
171
|
+
"inputSchema": {
|
|
172
|
+
"description": "Service status parameters",
|
|
173
|
+
"type": "object",
|
|
174
|
+
"properties": {
|
|
175
|
+
"status": {
|
|
176
|
+
"description": "Service status",
|
|
177
|
+
"type": "string",
|
|
178
|
+
"enum": [
|
|
179
|
+
"starting",
|
|
180
|
+
"ready",
|
|
181
|
+
"busy",
|
|
182
|
+
"stopping"
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
"timestamp": {
|
|
186
|
+
"description": "Status timestamp",
|
|
187
|
+
"type": "string",
|
|
188
|
+
"format": "datetime"
|
|
189
|
+
},
|
|
190
|
+
"details": {
|
|
191
|
+
"description": "Status details",
|
|
192
|
+
"type": "string"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"required": [
|
|
196
|
+
"status",
|
|
197
|
+
"timestamp"
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"outputSchema": null
|
|
201
|
+
},
|
|
202
|
+
"config.updated": {
|
|
203
|
+
"type": "broadcast",
|
|
204
|
+
"category": "onBroadcast",
|
|
205
|
+
"description": "Listen for configuration update broadcasts",
|
|
206
|
+
"inputSchema": {
|
|
207
|
+
"description": "Config update parameters",
|
|
208
|
+
"type": "object",
|
|
209
|
+
"properties": {
|
|
210
|
+
"section": {
|
|
211
|
+
"description": "Configuration section",
|
|
212
|
+
"type": "string"
|
|
213
|
+
},
|
|
214
|
+
"changes": {
|
|
215
|
+
"description": "Configuration changes",
|
|
216
|
+
"oneOf": [
|
|
217
|
+
{
|
|
218
|
+
"description": "Setting value",
|
|
219
|
+
"oneOf": []
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
"version": {
|
|
224
|
+
"description": "Configuration version",
|
|
225
|
+
"type": "string"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"required": [
|
|
229
|
+
"section",
|
|
230
|
+
"changes",
|
|
231
|
+
"version"
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
"outputSchema": null
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"pluginType": "service",
|
|
238
|
+
"configSchema": {
|
|
239
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
240
|
+
"type": "null"
|
|
241
|
+
}
|
|
242
|
+
}
|