@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.
Files changed (43) hide show
  1. package/README.md +6 -41
  2. package/lib/plugins/config-default/interfaces.d.ts +3 -2
  3. package/lib/plugins/service-benchmarkify/index.d.ts +312 -0
  4. package/lib/plugins/service-benchmarkify/index.js +138 -0
  5. package/lib/plugins/service-benchmarkify/index.js.map +1 -0
  6. package/lib/plugins/service-default0/index.d.ts +287 -0
  7. package/lib/plugins/service-default0/index.js +118 -0
  8. package/lib/plugins/service-default0/index.js.map +1 -0
  9. package/lib/{tests.d.ts → plugins/service-default1/client.d.ts} +16 -1
  10. package/lib/plugins/service-default1/client.js +70 -0
  11. package/lib/plugins/service-default1/client.js.map +1 -0
  12. package/lib/plugins/service-default1/index.d.ts +304 -0
  13. package/lib/plugins/service-default1/index.js +179 -0
  14. package/lib/plugins/service-default1/index.js.map +1 -0
  15. package/lib/plugins/service-default2/index.d.ts +359 -0
  16. package/lib/plugins/service-default2/index.js +137 -0
  17. package/lib/plugins/service-default2/index.js.map +1 -0
  18. package/lib/plugins/service-default3/index.d.ts +119 -0
  19. package/lib/plugins/service-default3/index.js +88 -0
  20. package/lib/plugins/service-default3/index.js.map +1 -0
  21. package/lib/plugins/service-default4/index.d.ts +81 -0
  22. package/lib/{tests.js → plugins/service-default4/index.js} +35 -16
  23. package/lib/plugins/service-default4/index.js.map +1 -0
  24. package/lib/schemas/config-default.plugin.json +1 -1
  25. package/lib/schemas/events-default.plugin.json +1 -1
  26. package/lib/schemas/observable-default.plugin.json +1 -1
  27. package/lib/schemas/service-benchmarkify.json +229 -0
  28. package/lib/schemas/service-default0.json +216 -0
  29. package/lib/schemas/service-default1.json +242 -0
  30. package/lib/schemas/service-default2.json +268 -0
  31. package/lib/schemas/service-default3.json +65 -0
  32. package/lib/schemas/service-default4.json +33 -0
  33. package/lib/serviceBase/events.js +2 -2
  34. package/lib/serviceBase/events.js.map +1 -1
  35. package/lib/serviceBase/observable.js +1 -1
  36. package/lib/serviceBase/observable.js.map +1 -1
  37. package/lib/serviceBase/plugins.d.ts +8 -1
  38. package/lib/serviceBase/plugins.js +113 -13
  39. package/lib/serviceBase/plugins.js.map +1 -1
  40. package/lib/serviceBase/services.js +2 -2
  41. package/lib/serviceBase/services.js.map +1 -1
  42. package/package.json +1 -1
  43. package/lib/tests.js.map +0 -1
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ /**
3
+ * BSB (Better-Service-Base) is an event-bus based microservice framework.
4
+ * Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License as published
8
+ * by the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * Alternatively, you may obtain a commercial license for this program.
12
+ * The commercial license allows you to use the Program in a closed-source manner,
13
+ * including the right to create derivative works that are not subject to the terms
14
+ * of the AGPL.
15
+ *
16
+ * To obtain a commercial license, please contact the copyright holders at
17
+ * https://www.bettercorp.dev. The terms and conditions of the commercial license
18
+ * will be provided upon request.
19
+ *
20
+ * This program is distributed in the hope that it will be useful,
21
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ * GNU Affero General Public License for more details.
24
+ *
25
+ * You should have received a copy of the GNU Affero General Public License
26
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
27
+ */
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Plugin = exports.EventSchemas = exports.Config = void 0;
30
+ const zod_1 = require("zod");
31
+ const base_1 = require("../../base");
32
+ const schema_events_1 = require("../../interfaces/schema-events");
33
+ exports.Config = (0, base_1.createConfigSchema)({
34
+ name: 'service-default3',
35
+ description: 'Default service plugin 3 for testing',
36
+ version: '1.0.0',
37
+ image: '../docs/public/assets/images/bsb-logo.png',
38
+ tags: ['default', 'example', 'test'],
39
+ initAfterPlugins: ['service-default2'],
40
+ }, zod_1.z.object({}));
41
+ exports.EventSchemas = (0, schema_events_1.createEventSchemas)({
42
+ onReturnableEvents: {
43
+ onReverseReturnable: (0, schema_events_1.createReturnableEvent)(base_1.bsb.object({
44
+ text: base_1.bsb.string({ description: 'Text to reverse' })
45
+ }, 'Reverse input parameters'), base_1.bsb.string({ description: 'Reversed text' }), 'Reverse a string')
46
+ },
47
+ emitReturnableEvents: {
48
+ calculate: (0, schema_events_1.createReturnableEvent)(base_1.bsb.object({
49
+ a: base_1.bsb.number({ description: 'First number' }),
50
+ b: base_1.bsb.number({ description: 'Second number' })
51
+ }, 'Calculate input parameters'), base_1.bsb.number({ description: 'Calculation result' }), 'Calculate with two numbers')
52
+ }
53
+ });
54
+ class Plugin extends base_1.BSBService {
55
+ static Config = exports.Config;
56
+ static EventSchemas = exports.EventSchemas;
57
+ // PLUGIN_CLIENT auto-generated from Config.metadata
58
+ initBeforePlugins;
59
+ runBeforePlugins;
60
+ runAfterPlugins;
61
+ initAfterPlugins = ["service-default2"];
62
+ constructor(config) {
63
+ super(config);
64
+ }
65
+ async init(obs) {
66
+ obs.log.info("Initializing service-default3");
67
+ await this.events.onReturnableEvent("onReverseReturnable", obs, async (obs, input) => {
68
+ obs.log.warn("onReverseReturnable ({text})", { text: input.text });
69
+ return input.text.split("").reverse().join("");
70
+ });
71
+ }
72
+ async run(obs) {
73
+ obs.log.info("Running service-default3");
74
+ // NEW API: Use events to calculate with object parameter
75
+ const result = await this.events.emitEventAndReturn("calculate", obs, {
76
+ a: 18,
77
+ b: 19
78
+ }, 5 // timeout
79
+ );
80
+ obs.log.info("Calculation result: {result}", { result });
81
+ obs.log.debug("Debug {a}", { a: "IT IS AN DEBUG!" });
82
+ obs.log.info("Info {a}", { a: "IT IS AN INFO!" });
83
+ obs.log.warn("Warning {a}", { a: "IT IS AN WARNING!" });
84
+ obs.log.error("Error {a}", { a: "IT IS AN ERROR!" });
85
+ }
86
+ }
87
+ exports.Plugin = Plugin;
88
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/service-default3/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;AAEH,6BAAwB;AACxB,qCAAwF;AAExF,kEAA2F;AAE9E,QAAA,MAAM,GAAG,IAAA,yBAAkB,EACtC;IACE,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,sCAAsC;IACnD,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,2CAA2C;IAClD,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC;IACpC,gBAAgB,EAAE,CAAC,kBAAkB,CAAC;CACvC,EACD,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CACb,CAAC;AAEW,QAAA,YAAY,GAAG,IAAA,kCAAkB,EAAC;IAC7C,kBAAkB,EAAE;QAClB,mBAAmB,EAAE,IAAA,qCAAqB,EACxC,UAAG,CAAC,MAAM,CAAC;YACT,IAAI,EAAE,UAAG,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;SACrD,EAAE,0BAA0B,CAAC,EAC9B,UAAG,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,EAC5C,kBAAkB,CACnB;KACF;IACD,oBAAoB,EAAE;QACpB,SAAS,EAAE,IAAA,qCAAqB,EAC9B,UAAG,CAAC,MAAM,CAAC;YACT,CAAC,EAAE,UAAG,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;YAC9C,CAAC,EAAE,UAAG,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;SAChD,EAAE,4BAA4B,CAAC,EAChC,UAAG,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC,EACjD,4BAA4B,CAC7B;KACF;CACF,CAAC,CAAC;AAEH,MAAa,MAAO,SAAQ,iBAA4D;IACtF,MAAM,CAAC,MAAM,GAAG,cAAM,CAAC;IACvB,MAAM,CAAC,YAAY,GAAG,oBAAY,CAAC;IACnC,oDAAoD;IAE7C,iBAAiB,CAAwB;IACzC,gBAAgB,CAAwB;IACxC,eAAe,CAAwB;IACvC,gBAAgB,GAAa,CAAC,kBAAkB,CAAC,CAAC;IAIzD,YAAY,MAA+E;QACzF,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,GAAe;QAC/B,GAAG,CAAC,GAAG,CAAC,IAAI,CAAE,+BAA+B,CAAC,CAAC;QAE/C,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,CACjC,qBAAqB,EACrB,GAAG,EACH,KAAK,EAAE,GAAe,EAAE,KAAK,EAAE,EAAE;YAC/B,GAAG,CAAC,GAAG,CAAC,IAAI,CAAE,8BAA8B,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACpE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjD,CAAC,CACF,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,GAAe;QAC9B,GAAG,CAAC,GAAG,CAAC,IAAI,CAAE,0BAA0B,CAAC,CAAC;QAE1C,yDAAyD;QACzD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,CACjD,WAAW,EACX,GAAG,EACH;YACE,CAAC,EAAE,EAAE;YACL,CAAC,EAAE,EAAE;SACN,EACD,CAAC,CAAC,UAAU;SACb,CAAC;QAEF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAE,8BAA8B,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC1D,GAAG,CAAC,GAAG,CAAC,KAAK,CAAE,WAAW,EAAE,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,CAAC;QACtD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAE,UAAU,EAAE,EAAE,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC;QACnD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAE,aAAa,EAAE,EAAE,CAAC,EAAE,mBAAmB,EAAE,CAAC,CAAC;QACzD,GAAG,CAAC,GAAG,CAAC,KAAK,CAAE,WAAW,EAAE,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACxD,CAAC;;AAhDH,wBAiDC"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * BSB (Better-Service-Base) is an event-bus based microservice framework.
3
+ * Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU Affero General Public License as published
7
+ * by the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * Alternatively, you may obtain a commercial license for this program.
11
+ * The commercial license allows you to use the Program in a closed-source manner,
12
+ * including the right to create derivative works that are not subject to the terms
13
+ * of the AGPL.
14
+ *
15
+ * To obtain a commercial license, please contact the copyright holders at
16
+ * https://www.bettercorp.dev. The terms and conditions of the commercial license
17
+ * will be provided upon request.
18
+ *
19
+ * This program is distributed in the hope that it will be useful,
20
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ * GNU Affero General Public License for more details.
23
+ *
24
+ * You should have received a copy of the GNU Affero General Public License
25
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
26
+ */
27
+ import { Observable } from "../../index";
28
+ import { BSBService, BSBServiceConstructor } from "../../base";
29
+ import { z } from "zod";
30
+ export declare const Config: import("../../index").BSBPluginConfigClass<z.ZodNull>;
31
+ export declare const EventSchemas: {
32
+ readonly emitReturnableEvents: {
33
+ readonly onReverseReturnable: {
34
+ input: {
35
+ _bsb: "object";
36
+ properties: {
37
+ readonly text: import("../../index").BSBStringType;
38
+ };
39
+ required: string[];
40
+ description?: string;
41
+ optional?: boolean;
42
+ nullable?: boolean;
43
+ };
44
+ output: import("../../index").BSBStringType;
45
+ description?: string;
46
+ defaultTimeout?: number;
47
+ readonly __brand: "returnable";
48
+ };
49
+ };
50
+ };
51
+ export declare class Plugin extends BSBService<InstanceType<typeof Config>, typeof EventSchemas> {
52
+ static Config: import("../../index").BSBPluginConfigClass<z.ZodNull>;
53
+ static EventSchemas: {
54
+ readonly emitReturnableEvents: {
55
+ readonly onReverseReturnable: {
56
+ input: {
57
+ _bsb: "object";
58
+ properties: {
59
+ readonly text: import("../../index").BSBStringType;
60
+ };
61
+ required: string[];
62
+ description?: string;
63
+ optional?: boolean;
64
+ nullable?: boolean;
65
+ };
66
+ output: import("../../index").BSBStringType;
67
+ description?: string;
68
+ defaultTimeout?: number;
69
+ readonly __brand: "returnable";
70
+ };
71
+ };
72
+ };
73
+ initBeforePlugins?: string[] | undefined;
74
+ runBeforePlugins?: string[] | undefined;
75
+ runAfterPlugins?: string[] | undefined;
76
+ initAfterPlugins: string[];
77
+ dispose?(): void;
78
+ init?(): void | Promise<void>;
79
+ constructor(config: BSBServiceConstructor<InstanceType<typeof Config>, typeof EventSchemas>);
80
+ run(obs: Observable): Promise<void>;
81
+ }
@@ -25,20 +25,39 @@
25
25
  * You should have received a copy of the GNU Affero General Public License
26
26
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
27
27
  */
28
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
29
- if (k2 === undefined) k2 = k;
30
- var desc = Object.getOwnPropertyDescriptor(m, k);
31
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
32
- desc = { enumerable: true, get: function() { return m[k]; } };
33
- }
34
- Object.defineProperty(o, k2, desc);
35
- }) : (function(o, m, k, k2) {
36
- if (k2 === undefined) k2 = k;
37
- o[k2] = m[k];
38
- }));
39
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
40
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
41
- };
42
28
  Object.defineProperty(exports, "__esModule", { value: true });
43
- __exportStar(require("./tests/sb/plugins/events"), exports);
44
- //# sourceMappingURL=tests.js.map
29
+ exports.Plugin = exports.EventSchemas = exports.Config = void 0;
30
+ const base_1 = require("../../base");
31
+ const schema_events_1 = require("../../interfaces/schema-events");
32
+ const zod_1 = require("zod");
33
+ exports.Config = (0, base_1.createConfigSchema)({
34
+ name: 'service-default4',
35
+ description: 'Default service plugin 4 for testing',
36
+ version: '1.0.0',
37
+ image: '../docs/public/assets/images/bsb-logo.png',
38
+ tags: ['default', 'example', 'test'],
39
+ }, zod_1.z.null());
40
+ exports.EventSchemas = (0, schema_events_1.createEventSchemas)({
41
+ emitReturnableEvents: {
42
+ onReverseReturnable: (0, schema_events_1.createReturnableEvent)(base_1.bsb.object({
43
+ text: base_1.bsb.string({ description: 'Text to reverse' })
44
+ }, 'Reverse input parameters'), base_1.bsb.string({ description: 'Reversed text' }), 'Reverse text string')
45
+ }
46
+ });
47
+ class Plugin extends base_1.BSBService {
48
+ static Config = exports.Config;
49
+ static EventSchemas = exports.EventSchemas;
50
+ // PLUGIN_CLIENT auto-generated from Config.metadata
51
+ initBeforePlugins;
52
+ runBeforePlugins;
53
+ runAfterPlugins;
54
+ initAfterPlugins = [];
55
+ constructor(config) {
56
+ super(config);
57
+ }
58
+ async run(obs) {
59
+ obs.log.info("Running service-default4");
60
+ }
61
+ }
62
+ exports.Plugin = Plugin;
63
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/service-default4/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;;AAGH,qCAAwF;AACxF,kEAA2F;AAC3F,6BAAwB;AAEX,QAAA,MAAM,GAAG,IAAA,yBAAkB,EACtC;IACE,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,sCAAsC;IACnD,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,2CAA2C;IAClD,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC;CACrC,EACD,OAAC,CAAC,IAAI,EAAE,CACT,CAAC;AAEW,QAAA,YAAY,GAAG,IAAA,kCAAkB,EAAC;IAC7C,oBAAoB,EAAE;QACpB,mBAAmB,EAAE,IAAA,qCAAqB,EACxC,UAAG,CAAC,MAAM,CAAC;YACT,IAAI,EAAE,UAAG,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;SACrD,EAAE,0BAA0B,CAAC,EAC9B,UAAG,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,EAC5C,qBAAqB,CACtB;KACF;CACF,CAAC,CAAC;AAEH,MAAa,MAAO,SAAQ,iBAA4D;IACtF,MAAM,CAAC,MAAM,GAAG,cAAM,CAAC;IACvB,MAAM,CAAC,YAAY,GAAG,oBAAY,CAAC;IACnC,oDAAoD;IAE7C,iBAAiB,CAAwB;IACzC,gBAAgB,CAAwB;IACxC,eAAe,CAAwB;IAC9B,gBAAgB,GAAa,EAAE,CAAC;IAKhD,YAAY,MAA+E;QACzF,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEe,KAAK,CAAC,GAAG,CAAC,GAAe;QACvC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IAC3C,CAAC;;AAnBH,wBAoBC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "config-default",
3
3
  "name": "config-default",
4
- "version": "9.0.0",
4
+ "version": "9.0.1",
5
5
  "description": "Default configuration plugin for profile and plugin resolution",
6
6
  "category": "config",
7
7
  "tags": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "events-default",
3
3
  "name": "events-default",
4
- "version": "9.0.0",
4
+ "version": "9.0.1",
5
5
  "description": "Default in-process events plugin for BSB event routing",
6
6
  "category": "events",
7
7
  "tags": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "observable-default",
3
3
  "name": "observable-default",
4
- "version": "9.0.0",
4
+ "version": "9.0.1",
5
5
  "description": "Default console observable plugin for logging output",
6
6
  "category": "observable",
7
7
  "tags": [
@@ -0,0 +1,229 @@
1
+ {
2
+ "pluginName": "service-benchmarkify",
3
+ "version": "1.0.0",
4
+ "events": {
5
+ "benchmark.started": {
6
+ "type": "fire-and-forget",
7
+ "category": "emitEvents",
8
+ "description": "Benchmark test started",
9
+ "inputSchema": {
10
+ "description": "Benchmark start parameters",
11
+ "type": "object",
12
+ "properties": {
13
+ "name": {
14
+ "description": "Benchmark name",
15
+ "type": "string"
16
+ },
17
+ "timestamp": {
18
+ "description": "Start timestamp",
19
+ "type": "string",
20
+ "format": "datetime"
21
+ }
22
+ },
23
+ "required": [
24
+ "name",
25
+ "timestamp"
26
+ ]
27
+ },
28
+ "outputSchema": null
29
+ },
30
+ "benchmark.trigger": {
31
+ "type": "fire-and-forget",
32
+ "category": "onEvents",
33
+ "description": "Trigger benchmark execution",
34
+ "inputSchema": {
35
+ "description": "Benchmark trigger parameters",
36
+ "type": "object",
37
+ "properties": {
38
+ "testName": {
39
+ "description": "Name of test to run",
40
+ "type": "string"
41
+ }
42
+ },
43
+ "required": []
44
+ },
45
+ "outputSchema": null
46
+ },
47
+ "performance.test": {
48
+ "type": "returnable",
49
+ "category": "emitReturnableEvents",
50
+ "description": "Request performance test execution",
51
+ "inputSchema": {
52
+ "description": "Performance test parameters",
53
+ "type": "object",
54
+ "properties": {
55
+ "iterations": {
56
+ "description": "Number of iterations to run",
57
+ "type": "number",
58
+ "format": "double"
59
+ },
60
+ "warmup": {
61
+ "description": "Whether to run warmup iterations",
62
+ "type": "boolean"
63
+ }
64
+ },
65
+ "required": [
66
+ "iterations",
67
+ "warmup"
68
+ ]
69
+ },
70
+ "outputSchema": {
71
+ "description": "Performance test results",
72
+ "type": "object",
73
+ "properties": {
74
+ "duration": {
75
+ "description": "Test duration in milliseconds",
76
+ "type": "number",
77
+ "format": "double"
78
+ },
79
+ "opsPerSecond": {
80
+ "description": "Operations per second",
81
+ "type": "number",
82
+ "format": "double"
83
+ }
84
+ },
85
+ "required": [
86
+ "duration",
87
+ "opsPerSecond"
88
+ ]
89
+ }
90
+ },
91
+ "add": {
92
+ "type": "returnable",
93
+ "category": "onReturnableEvents",
94
+ "description": "Add two numbers",
95
+ "inputSchema": {
96
+ "description": "Add input parameters",
97
+ "type": "object",
98
+ "properties": {
99
+ "a": {
100
+ "description": "First number",
101
+ "type": "number",
102
+ "format": "double"
103
+ },
104
+ "b": {
105
+ "description": "Second number",
106
+ "type": "number",
107
+ "format": "double"
108
+ }
109
+ },
110
+ "required": [
111
+ "a",
112
+ "b"
113
+ ]
114
+ },
115
+ "outputSchema": {
116
+ "description": "Sum of numbers",
117
+ "type": "number",
118
+ "format": "double"
119
+ }
120
+ },
121
+ "void": {
122
+ "type": "returnable",
123
+ "category": "onReturnableEvents",
124
+ "description": "Void event for benchmarking",
125
+ "inputSchema": {
126
+ "description": "Empty parameters",
127
+ "type": "object",
128
+ "properties": {},
129
+ "required": []
130
+ },
131
+ "outputSchema": {
132
+ "description": "void",
133
+ "oneOf": []
134
+ }
135
+ },
136
+ "benchmark.results": {
137
+ "type": "broadcast",
138
+ "category": "emitBroadcast",
139
+ "description": "Broadcast benchmark results to all interested parties",
140
+ "inputSchema": {
141
+ "description": "Benchmark results parameters",
142
+ "type": "object",
143
+ "properties": {
144
+ "testName": {
145
+ "description": "Test name",
146
+ "type": "string"
147
+ },
148
+ "results": {
149
+ "description": "Array of benchmark results",
150
+ "type": "array",
151
+ "items": {
152
+ "description": "Benchmark result entry",
153
+ "type": "object",
154
+ "properties": {
155
+ "operation": {
156
+ "description": "Operation name",
157
+ "type": "string"
158
+ },
159
+ "opsPerSecond": {
160
+ "description": "Operations per second",
161
+ "type": "number",
162
+ "format": "double"
163
+ },
164
+ "duration": {
165
+ "description": "Duration in milliseconds",
166
+ "type": "number",
167
+ "format": "double"
168
+ }
169
+ },
170
+ "required": [
171
+ "operation",
172
+ "opsPerSecond",
173
+ "duration"
174
+ ]
175
+ }
176
+ },
177
+ "timestamp": {
178
+ "description": "Results timestamp",
179
+ "type": "string",
180
+ "format": "datetime"
181
+ }
182
+ },
183
+ "required": [
184
+ "testName",
185
+ "results",
186
+ "timestamp"
187
+ ]
188
+ },
189
+ "outputSchema": null
190
+ },
191
+ "system.load": {
192
+ "type": "broadcast",
193
+ "category": "onBroadcast",
194
+ "description": "Listen for system load updates",
195
+ "inputSchema": {
196
+ "description": "System load parameters",
197
+ "type": "object",
198
+ "properties": {
199
+ "cpuUsage": {
200
+ "description": "CPU usage percentage",
201
+ "type": "number",
202
+ "format": "double"
203
+ },
204
+ "memoryUsage": {
205
+ "description": "Memory usage percentage",
206
+ "type": "number",
207
+ "format": "double"
208
+ },
209
+ "timestamp": {
210
+ "description": "Load measurement timestamp",
211
+ "type": "string",
212
+ "format": "datetime"
213
+ }
214
+ },
215
+ "required": [
216
+ "cpuUsage",
217
+ "memoryUsage",
218
+ "timestamp"
219
+ ]
220
+ },
221
+ "outputSchema": null
222
+ }
223
+ },
224
+ "pluginType": "service",
225
+ "configSchema": {
226
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
227
+ "type": "null"
228
+ }
229
+ }