@bsb/base 9.0.4 → 9.1.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.
- package/lib/base/BSBConfig.d.ts +3 -3
- package/lib/base/BSBConfig.js +9 -14
- package/lib/base/BSBConfig.js.map +1 -1
- package/lib/base/BSBEvents.d.ts +3 -3
- package/lib/base/BSBEvents.js +12 -17
- package/lib/base/BSBEvents.js.map +1 -1
- package/lib/base/BSBObservable.d.ts +4 -4
- package/lib/base/BSBObservable.js +17 -22
- package/lib/base/BSBObservable.js.map +1 -1
- package/lib/base/BSBService.d.ts +7 -8
- package/lib/base/BSBService.js +17 -22
- package/lib/base/BSBService.js.map +1 -1
- package/lib/base/BSBServiceClient.d.ts +4 -4
- package/lib/base/BSBServiceClient.js +12 -18
- package/lib/base/BSBServiceClient.js.map +1 -1
- package/lib/base/EventValidator.d.ts +16 -17
- package/lib/base/EventValidator.js +13 -34
- package/lib/base/EventValidator.js.map +1 -1
- package/lib/base/ObservableBackend.d.ts +2 -2
- package/lib/base/ObservableBackend.js +21 -26
- package/lib/base/ObservableBackend.js.map +1 -1
- package/lib/base/PluginConfig.d.ts +9 -7
- package/lib/base/PluginConfig.js +4 -11
- package/lib/base/PluginConfig.js.map +1 -1
- package/lib/base/PluginEvents.d.ts +4 -4
- package/lib/base/PluginEvents.js +4 -9
- package/lib/base/PluginEvents.js.map +1 -1
- package/lib/base/PluginObservable.d.ts +13 -14
- package/lib/base/PluginObservable.js +4 -8
- package/lib/base/PluginObservable.js.map +1 -1
- package/lib/base/ResourceContext.d.ts +1 -1
- package/lib/base/ResourceContext.js +1 -5
- package/lib/base/ResourceContext.js.map +1 -1
- package/lib/base/base.d.ts +3 -3
- package/lib/base/base.js +10 -18
- package/lib/base/base.js.map +1 -1
- package/lib/base/errorMessages.d.ts +1 -1
- package/lib/base/errorMessages.js +6 -11
- package/lib/base/errorMessages.js.map +1 -1
- package/lib/base/factory.d.ts +1 -1
- package/lib/base/factory.js +19 -22
- package/lib/base/factory.js.map +1 -1
- package/lib/base/functions.d.ts +19 -14
- package/lib/base/functions.js +19 -26
- package/lib/base/functions.js.map +1 -1
- package/lib/base/index.d.ts +18 -18
- package/lib/base/index.js +18 -37
- package/lib/base/index.js.map +1 -1
- package/lib/base/logFormatter.d.ts +1 -1
- package/lib/base/logFormatter.js +10 -14
- package/lib/base/logFormatter.js.map +1 -1
- package/lib/base/module-runtime.d.ts +3 -0
- package/lib/base/module-runtime.js +15 -0
- package/lib/base/module-runtime.js.map +1 -0
- package/lib/base/tools.d.ts +1 -1
- package/lib/base/tools.js +9 -13
- package/lib/base/tools.js.map +1 -1
- package/lib/cli.js +13 -12
- package/lib/cli.js.map +1 -1
- package/lib/dev.js +22 -11
- package/lib/dev.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +3 -19
- package/lib/index.js.map +1 -1
- package/lib/interfaces/events.d.ts +2 -2
- package/lib/interfaces/events.js +1 -4
- package/lib/interfaces/events.js.map +1 -1
- package/lib/interfaces/index.d.ts +13 -12
- package/lib/interfaces/index.js +12 -32
- package/lib/interfaces/index.js.map +1 -1
- package/lib/interfaces/logging.d.ts +3 -3
- package/lib/interfaces/logging.js +1 -4
- package/lib/interfaces/logging.js.map +1 -1
- package/lib/interfaces/metrics.d.ts +2 -2
- package/lib/interfaces/metrics.js +1 -5
- package/lib/interfaces/metrics.js.map +1 -1
- package/lib/interfaces/observable-types.d.ts +1 -1
- package/lib/interfaces/observable-types.js +1 -4
- package/lib/interfaces/observable-types.js.map +1 -1
- package/lib/interfaces/observable.d.ts +8 -9
- package/lib/interfaces/observable.js +1 -2
- package/lib/interfaces/observable.js.map +1 -1
- package/lib/interfaces/options.d.ts +15 -6
- package/lib/interfaces/options.js +2 -5
- package/lib/interfaces/options.js.map +1 -1
- package/lib/interfaces/plugins.d.ts +2 -2
- package/lib/interfaces/plugins.js +1 -4
- package/lib/interfaces/plugins.js.map +1 -1
- package/lib/interfaces/result.js +8 -18
- package/lib/interfaces/result.js.map +1 -1
- package/lib/interfaces/schema-events.d.ts +5 -20
- package/lib/interfaces/schema-events.js +7 -14
- package/lib/interfaces/schema-events.js.map +1 -1
- package/lib/interfaces/schema-types.d.ts +32 -352
- package/lib/interfaces/schema-types.js +77 -512
- package/lib/interfaces/schema-types.js.map +1 -1
- package/lib/interfaces/service.d.ts +1 -1
- package/lib/interfaces/service.js +1 -2
- package/lib/interfaces/service.js.map +1 -1
- package/lib/interfaces/tools.js +8 -13
- package/lib/interfaces/tools.js.map +1 -1
- package/lib/plugins/config-default/index.d.ts +16 -14
- package/lib/plugins/config-default/index.js +66 -50
- package/lib/plugins/config-default/index.js.map +1 -1
- package/lib/plugins/config-default/interfaces.d.ts +1 -1
- package/lib/plugins/config-default/interfaces.js +1 -2
- package/lib/plugins/config-default/interfaces.js.map +1 -1
- package/lib/plugins/events-default/events/broadcast.d.ts +1 -1
- package/lib/plugins/events-default/events/broadcast.js +2 -6
- package/lib/plugins/events-default/events/broadcast.js.map +1 -1
- package/lib/plugins/events-default/events/emit.d.ts +1 -1
- package/lib/plugins/events-default/events/emit.js +4 -8
- package/lib/plugins/events-default/events/emit.js.map +1 -1
- package/lib/plugins/events-default/events/emitAndReturn.d.ts +1 -1
- package/lib/plugins/events-default/events/emitAndReturn.js +4 -8
- package/lib/plugins/events-default/events/emitAndReturn.js.map +1 -1
- package/lib/plugins/events-default/events/emitStreamAndReceiveStream.d.ts +1 -1
- package/lib/plugins/events-default/events/emitStreamAndReceiveStream.js +8 -12
- package/lib/plugins/events-default/events/emitStreamAndReceiveStream.js.map +1 -1
- package/lib/plugins/events-default/events/index.d.ts +4 -4
- package/lib/plugins/events-default/events/index.js +4 -11
- package/lib/plugins/events-default/events/index.js.map +1 -1
- package/lib/plugins/events-default/index.d.ts +5 -5
- package/lib/plugins/events-default/index.js +10 -15
- package/lib/plugins/events-default/index.js.map +1 -1
- package/lib/plugins/observable-default/index.d.ts +5 -5
- package/lib/plugins/observable-default/index.js +8 -13
- package/lib/plugins/observable-default/index.js.map +1 -1
- package/lib/plugins/service-benchmarkify/index.d.ts +196 -0
- package/lib/plugins/service-benchmarkify/index.js +133 -0
- package/lib/plugins/service-benchmarkify/index.js.map +1 -0
- package/lib/plugins/service-default0/index.d.ts +189 -0
- package/lib/plugins/service-default0/index.js +113 -0
- package/lib/plugins/service-default0/index.js.map +1 -0
- package/lib/{tests/sb/plugins/events/emitStreamAndReceiveStream.d.ts → plugins/service-default1/client.d.ts} +16 -4
- package/lib/plugins/service-default1/client.js +66 -0
- package/lib/plugins/service-default1/client.js.map +1 -0
- package/lib/plugins/service-default1/index.d.ts +202 -0
- package/lib/plugins/service-default1/index.js +174 -0
- package/lib/plugins/service-default1/index.js.map +1 -0
- package/lib/plugins/service-default2/index.d.ts +217 -0
- package/lib/plugins/service-default2/index.js +132 -0
- package/lib/plugins/service-default2/index.js.map +1 -0
- package/lib/plugins/service-default3/index.d.ts +91 -0
- package/lib/plugins/service-default3/index.js +83 -0
- package/lib/plugins/service-default3/index.js.map +1 -0
- package/lib/plugins/service-default4/index.d.ts +67 -0
- package/lib/{tests.js → plugins/service-default4/index.js} +31 -17
- package/lib/plugins/service-default4/index.js.map +1 -0
- package/lib/schemas/config-default.json +24 -16
- package/lib/schemas/config-default.plugin.json +24 -16
- package/lib/schemas/events-default.json +1 -1
- package/lib/schemas/events-default.plugin.json +1 -1
- package/lib/schemas/observable-default.json +15 -5
- package/lib/schemas/observable-default.plugin.json +15 -5
- package/lib/schemas/service-benchmarkify.json +314 -0
- package/lib/schemas/service-default0.json +279 -0
- package/lib/schemas/service-default1.json +327 -0
- package/lib/schemas/service-default2.json +355 -0
- package/lib/schemas/service-default3.json +107 -0
- package/lib/schemas/service-default4.json +63 -0
- package/lib/scripts/bsb-client-cli.js +9 -9
- package/lib/scripts/bsb-client-cli.js.map +1 -1
- package/lib/scripts/bsb-plugin-cli.js +93 -64
- package/lib/scripts/bsb-plugin-cli.js.map +1 -1
- package/lib/scripts/export-schemas.js +15 -12
- package/lib/scripts/export-schemas.js.map +1 -1
- package/lib/scripts/extract-schemas-from-source.js +73 -56
- package/lib/scripts/extract-schemas-from-source.js.map +1 -1
- package/lib/scripts/generate-client-types.d.ts +1 -16
- package/lib/scripts/generate-client-types.js +120 -313
- package/lib/scripts/generate-client-types.js.map +1 -1
- package/lib/scripts/generate-plugin-json.js +9 -10
- package/lib/scripts/generate-plugin-json.js.map +1 -1
- package/lib/serviceBase/config.d.ts +4 -4
- package/lib/serviceBase/config.js +33 -35
- package/lib/serviceBase/config.js.map +1 -1
- package/lib/serviceBase/events.d.ts +6 -6
- package/lib/serviceBase/events.js +42 -44
- package/lib/serviceBase/events.js.map +1 -1
- package/lib/serviceBase/index.d.ts +7 -7
- package/lib/serviceBase/index.js +7 -23
- package/lib/serviceBase/index.js.map +1 -1
- package/lib/serviceBase/observable.d.ts +5 -5
- package/lib/serviceBase/observable.js +21 -25
- package/lib/serviceBase/observable.js.map +1 -1
- package/lib/serviceBase/plugins.d.ts +3 -3
- package/lib/serviceBase/plugins.js +48 -54
- package/lib/serviceBase/plugins.js.map +1 -1
- package/lib/serviceBase/serviceBase.d.ts +3 -3
- package/lib/serviceBase/serviceBase.js +40 -44
- package/lib/serviceBase/serviceBase.js.map +1 -1
- package/lib/serviceBase/services.d.ts +6 -6
- package/lib/serviceBase/services.js +21 -22
- package/lib/serviceBase/services.js.map +1 -1
- package/package.json +18 -11
- package/lib/tests/mocks.d.ts +0 -37
- package/lib/tests/mocks.js +0 -164
- package/lib/tests/mocks.js.map +0 -1
- package/lib/tests/sb/plugins/events/broadcast.d.ts +0 -30
- package/lib/tests/sb/plugins/events/broadcast.js +0 -357
- package/lib/tests/sb/plugins/events/broadcast.js.map +0 -1
- package/lib/tests/sb/plugins/events/emit.d.ts +0 -30
- package/lib/tests/sb/plugins/events/emit.js +0 -353
- package/lib/tests/sb/plugins/events/emit.js.map +0 -1
- package/lib/tests/sb/plugins/events/emitAndReturn.d.ts +0 -30
- package/lib/tests/sb/plugins/events/emitAndReturn.js +0 -382
- package/lib/tests/sb/plugins/events/emitAndReturn.js.map +0 -1
- package/lib/tests/sb/plugins/events/emitStreamAndReceiveStream.js +0 -298
- package/lib/tests/sb/plugins/events/emitStreamAndReceiveStream.js.map +0 -1
- package/lib/tests/sb/plugins/events/index.d.ts +0 -28
- package/lib/tests/sb/plugins/events/index.js +0 -69
- package/lib/tests/sb/plugins/events/index.js.map +0 -1
- package/lib/tests/trace.d.ts +0 -41
- package/lib/tests/trace.js +0 -85
- package/lib/tests/trace.js.map +0 -1
- package/lib/tests.d.ts +0 -27
- package/lib/tests.js.map +0 -1
package/lib/dev.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,12 +24,23 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
import { spawnSync } from "node:child_process";
|
|
28
|
+
import * as fs from "node:fs";
|
|
29
|
+
import * as path from "node:path";
|
|
30
|
+
import * as readline from "node:readline";
|
|
31
|
+
import chokidar from "chokidar";
|
|
32
|
+
import { ServiceBase } from "./serviceBase/serviceBase.js";
|
|
33
|
+
import { isMainModule } from "./base/module-runtime.js";
|
|
34
|
+
if (isMainModule(import.meta.url) && process.env.BSB_DEV_LOADER !== "tsx") {
|
|
35
|
+
const child = spawnSync(process.execPath, ["--import", "tsx", process.argv[1], ...process.argv.slice(2)], {
|
|
36
|
+
stdio: "inherit",
|
|
37
|
+
env: {
|
|
38
|
+
...process.env,
|
|
39
|
+
BSB_DEV_LOADER: "tsx",
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
process.exit(child.status ?? 0);
|
|
43
|
+
}
|
|
34
44
|
let currentSB = null;
|
|
35
45
|
let restartTimeout = null;
|
|
36
46
|
let isRestarting = false;
|
|
@@ -82,10 +92,11 @@ const readWatchConfig = (filePath) => {
|
|
|
82
92
|
};
|
|
83
93
|
const startApp = async () => {
|
|
84
94
|
const CWD = process.env.APP_DIR || process.cwd();
|
|
85
|
-
const SB = new
|
|
95
|
+
const SB = new ServiceBase({
|
|
86
96
|
debug: true,
|
|
87
97
|
live: false,
|
|
88
|
-
cwd: CWD
|
|
98
|
+
cwd: CWD,
|
|
99
|
+
runtimeMode: "dev",
|
|
89
100
|
});
|
|
90
101
|
await SB.init();
|
|
91
102
|
await SB.run();
|
|
@@ -184,8 +195,8 @@ const runApp = async () => {
|
|
|
184
195
|
ignored: config.ignore,
|
|
185
196
|
persistent: true
|
|
186
197
|
});
|
|
187
|
-
watcher.on('change', (
|
|
188
|
-
console.log(`File ${
|
|
198
|
+
watcher.on('change', (changedPath) => {
|
|
199
|
+
console.log(`File ${changedPath} has been changed`);
|
|
189
200
|
restartApp();
|
|
190
201
|
});
|
|
191
202
|
// Handle process termination
|
package/lib/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,QAAuB,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AA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AQ,EAAE,OAAO,CAAC,CAAC;IAEhC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,EAAE,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
25
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
|
-
export * from "./base/index";
|
|
28
|
-
export * from "./interfaces/index";
|
|
29
|
-
export * from "./serviceBase/index";
|
|
27
|
+
export * from "./base/index.js";
|
|
28
|
+
export * from "./interfaces/index.js";
|
|
29
|
+
export * from "./serviceBase/index.js";
|
|
30
30
|
/**
|
|
31
31
|
* @see {@link https://bsbcode.dev/languages/nodejs/types/modules.html | API: Module Index}
|
|
32
32
|
*/
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,24 +24,9 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
__exportStar(require("./base/index"), exports);
|
|
44
|
-
__exportStar(require("./interfaces/index"), exports);
|
|
45
|
-
__exportStar(require("./serviceBase/index"), exports);
|
|
27
|
+
export * from "./base/index.js";
|
|
28
|
+
export * from "./interfaces/index.js";
|
|
29
|
+
export * from "./serviceBase/index.js";
|
|
46
30
|
/**
|
|
47
31
|
* @see {@link https://bsbcode.dev/languages/nodejs/types/modules.html | API: Module Index}
|
|
48
32
|
*/
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC;;GAEG"}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
25
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
|
-
import { DTrace } from './metrics';
|
|
28
|
-
import { DynamicallyReferencedMethodBase } from "./tools";
|
|
27
|
+
import { DTrace } from './metrics.js';
|
|
28
|
+
import { DynamicallyReferencedMethodBase } from "./tools.js";
|
|
29
29
|
export type DynamicallyReferencedMethodOnIEvents<Interface extends DynamicallyReferencedMethodBase, Method extends keyof Interface, hasReturnable extends boolean = false> = Interface[Method] extends (...a: infer Arguments) => infer Return ? [
|
|
30
30
|
event: Method,
|
|
31
31
|
trace: DTrace,
|
package/lib/interfaces/events.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,12 +24,10 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.EventsEventTypesBase = void 0;
|
|
30
27
|
/**
|
|
31
28
|
* @hidden
|
|
32
29
|
*/
|
|
33
|
-
|
|
30
|
+
export const EventsEventTypesBase = {
|
|
34
31
|
onBroadcast: "onBroadcast",
|
|
35
32
|
emitBroadcast: "emitBroadcast",
|
|
36
33
|
onEvent: "onEvent",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/interfaces/events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/interfaces/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AA+CH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;IAC9B,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,iBAAiB,EAAE,mBAAmB;IACtC,kBAAkB,EAAE,oBAAoB;IACxC,uBAAuB,EAAE,yBAAyB;IAClD,aAAa,EAAE,eAAe;IAC9B,UAAU,EAAE,YAAY;CAChB,CAAC"}
|
|
@@ -24,15 +24,16 @@
|
|
|
24
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
25
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
|
-
export * from "./events";
|
|
28
|
-
export * from "./logging";
|
|
29
|
-
export * from "./plugins";
|
|
30
|
-
export * from "./service";
|
|
31
|
-
export * from "./metrics";
|
|
32
|
-
export * from "./result";
|
|
33
|
-
export * from "./options";
|
|
34
|
-
export * from "./schema-events";
|
|
35
|
-
export * from "./schema-types";
|
|
36
|
-
export * from "./observable";
|
|
37
|
-
export * from "./observable-types";
|
|
38
|
-
export {
|
|
27
|
+
export * from "./events.js";
|
|
28
|
+
export * from "./logging.js";
|
|
29
|
+
export * from "./plugins.js";
|
|
30
|
+
export * from "./service.js";
|
|
31
|
+
export * from "./metrics.js";
|
|
32
|
+
export * from "./result.js";
|
|
33
|
+
export * from "./options.js";
|
|
34
|
+
export * from "./schema-events.js";
|
|
35
|
+
export * from "./schema-types.js";
|
|
36
|
+
export * from "./observable.js";
|
|
37
|
+
export * from "./observable-types.js";
|
|
38
|
+
export type { DynamicallyReferencedMethodBase, DynamicallyReferencedMethodType, DynamicallyReferencedMethod, DynamicallyReferencedType, MergeObjectsKey, ParamsFromString, SimpleStatu, } from "./tools.js";
|
|
39
|
+
export { CleanStringStrength, generateAppIdHash, generateTimeBasedId, } from "./tools.js";
|
package/lib/interfaces/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,35 +24,16 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
41
|
-
};
|
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.generateTimeBasedId = exports.generateAppIdHash = exports.CleanStringStrength = void 0;
|
|
44
|
-
__exportStar(require("./events"), exports);
|
|
45
|
-
__exportStar(require("./logging"), exports);
|
|
46
|
-
__exportStar(require("./plugins"), exports);
|
|
47
|
-
__exportStar(require("./service"), exports);
|
|
48
|
-
__exportStar(require("./metrics"), exports);
|
|
49
|
-
__exportStar(require("./result"), exports);
|
|
50
|
-
__exportStar(require("./options"), exports);
|
|
51
|
-
__exportStar(require("./schema-events"), exports);
|
|
52
|
-
__exportStar(require("./schema-types"), exports);
|
|
53
|
-
__exportStar(require("./observable"), exports);
|
|
54
|
-
__exportStar(require("./observable-types"), exports);
|
|
55
|
-
var tools_1 = require("./tools");
|
|
56
|
-
Object.defineProperty(exports, "CleanStringStrength", { enumerable: true, get: function () { return tools_1.CleanStringStrength; } });
|
|
57
|
-
Object.defineProperty(exports, "generateAppIdHash", { enumerable: true, get: function () { return tools_1.generateAppIdHash; } });
|
|
58
|
-
Object.defineProperty(exports, "generateTimeBasedId", { enumerable: true, get: function () { return tools_1.generateTimeBasedId; } });
|
|
27
|
+
export * from "./events.js";
|
|
28
|
+
export * from "./logging.js";
|
|
29
|
+
export * from "./plugins.js";
|
|
30
|
+
export * from "./service.js";
|
|
31
|
+
export * from "./metrics.js";
|
|
32
|
+
export * from "./result.js";
|
|
33
|
+
export * from "./options.js";
|
|
34
|
+
export * from "./schema-events.js";
|
|
35
|
+
export * from "./schema-types.js";
|
|
36
|
+
export * from "./observable.js";
|
|
37
|
+
export * from "./observable-types.js";
|
|
38
|
+
export { CleanStringStrength, generateAppIdHash, generateTimeBasedId, } from "./tools.js";
|
|
59
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AAUtC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
25
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
|
-
import { BSBError } from "../base";
|
|
28
|
-
import { ParamsFromString } from "./tools";
|
|
29
|
-
import { DTrace } from "./metrics";
|
|
27
|
+
import { BSBError } from "../base/index.js";
|
|
28
|
+
import { ParamsFromString } from "./tools.js";
|
|
29
|
+
import { DTrace } from "./metrics.js";
|
|
30
30
|
/**
|
|
31
31
|
* The debug mode of the app
|
|
32
32
|
* @see {@link https://bsbcode.dev/languages/nodejs/types/modules.html#module-interfaces_logging | API: interfaces/logging}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,12 +24,10 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.LoggingEventTypesBase = void 0;
|
|
30
27
|
/**
|
|
31
28
|
* @hidden
|
|
32
29
|
*/
|
|
33
|
-
|
|
30
|
+
export const LoggingEventTypesBase = {
|
|
34
31
|
debug: "debug",
|
|
35
32
|
info: "info",
|
|
36
33
|
warn: "warn",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/interfaces/logging.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/interfaces/logging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AA6FH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACN,CAAC"}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
25
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
|
-
import { BSBError } from "../base";
|
|
28
|
-
import { IPluginLogging } from "./logging";
|
|
27
|
+
import { BSBError } from "../base/index.js";
|
|
28
|
+
import { IPluginLogging } from "./logging.js";
|
|
29
29
|
/**
|
|
30
30
|
* @group Observable
|
|
31
31
|
* @category Plugin Development Tools
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,13 +24,11 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.createFakeDTrace = void 0;
|
|
30
27
|
/**
|
|
31
28
|
* @hidden
|
|
32
29
|
*/
|
|
33
30
|
const traceCache = new Map();
|
|
34
|
-
const createFakeDTrace = (trace, span) => {
|
|
31
|
+
export const createFakeDTrace = (trace, span) => {
|
|
35
32
|
const cacheKey = `${trace}:${span}`;
|
|
36
33
|
let cached = traceCache.get(cacheKey);
|
|
37
34
|
if (!cached) {
|
|
@@ -42,5 +39,4 @@ const createFakeDTrace = (trace, span) => {
|
|
|
42
39
|
}
|
|
43
40
|
return cached;
|
|
44
41
|
};
|
|
45
|
-
exports.createFakeDTrace = createFakeDTrace;
|
|
46
42
|
//# sourceMappingURL=metrics.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/interfaces/metrics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/interfaces/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAsRH;;GAEG;AACH,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,IAAY,EAAU,EAAE;IACtE,MAAM,QAAQ,GAAG,GAAG,KAAK,IAAI,IAAI,EAAE,CAAC;IACpC,IAAI,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,EAAE,CAAC,EAAE,YAAY,KAAK,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC;QAC7C,IAAI,UAAU,CAAC,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC,uBAAuB;YACnD,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
25
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
|
-
import { PluginDefinition, FilterDetailed } from "./plugins";
|
|
27
|
+
import { PluginDefinition, FilterDetailed } from "./plugins.js";
|
|
28
28
|
/**
|
|
29
29
|
* Observable event types - unified logging, metrics, and tracing events
|
|
30
30
|
* @hidden
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,13 +24,11 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ObservableEventTypesBase = void 0;
|
|
30
27
|
/**
|
|
31
28
|
* Observable event types - unified logging, metrics, and tracing events
|
|
32
29
|
* @hidden
|
|
33
30
|
*/
|
|
34
|
-
|
|
31
|
+
export const ObservableEventTypesBase = {
|
|
35
32
|
// Logging events
|
|
36
33
|
debug: "debug",
|
|
37
34
|
info: "info",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observable-types.js","sourceRoot":"","sources":["../../src/interfaces/observable-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"observable-types.js","sourceRoot":"","sources":["../../src/interfaces/observable-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,iBAAiB;IACjB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,iBAAiB;IACjB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,iBAAiB;IACjB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CACd,CAAC"}
|
|
@@ -24,11 +24,10 @@
|
|
|
24
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
25
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
|
-
import { DTrace } from './metrics';
|
|
28
|
-
import { SmartLogMeta } from './logging';
|
|
29
|
-
import { Counter, Gauge, Histogram, Timer } from './metrics';
|
|
30
|
-
import { ResourceContext } from '../base/ResourceContext';
|
|
31
|
-
import { z } from 'zod';
|
|
27
|
+
import { DTrace } from './metrics.js';
|
|
28
|
+
import { SmartLogMeta } from './logging.js';
|
|
29
|
+
import { Counter, Gauge, Histogram, Timer } from './metrics.js';
|
|
30
|
+
import { ResourceContext } from '../base/ResourceContext.js';
|
|
32
31
|
/**
|
|
33
32
|
* Observable context for unified observability across logging, metrics, and tracing.
|
|
34
33
|
*
|
|
@@ -60,7 +59,7 @@ import { z } from 'zod';
|
|
|
60
59
|
* }
|
|
61
60
|
* ```
|
|
62
61
|
*/
|
|
63
|
-
export interface Observable
|
|
62
|
+
export interface Observable {
|
|
64
63
|
/**
|
|
65
64
|
* Core trace information (W3C compatible)
|
|
66
65
|
* @readonly
|
|
@@ -206,7 +205,7 @@ export interface Observable<TAttributeSchema extends z.ZodSchema = z.ZodAny> {
|
|
|
206
205
|
* }
|
|
207
206
|
* ```
|
|
208
207
|
*/
|
|
209
|
-
startSpan(name: string, attributes?: Record<string, string | number | boolean>): Observable
|
|
208
|
+
startSpan(name: string, attributes?: Record<string, string | number | boolean>): Observable;
|
|
210
209
|
/**
|
|
211
210
|
* Create a new Observable with an additional attribute
|
|
212
211
|
*
|
|
@@ -230,7 +229,7 @@ export interface Observable<TAttributeSchema extends z.ZodSchema = z.ZodAny> {
|
|
|
230
229
|
* }
|
|
231
230
|
* ```
|
|
232
231
|
*/
|
|
233
|
-
setAttribute<K extends string, V extends string | number | boolean>(key: K, value: V): Observable
|
|
232
|
+
setAttribute<K extends string, V extends string | number | boolean>(key: K, value: V): Observable;
|
|
234
233
|
/**
|
|
235
234
|
* Create a new Observable with multiple attributes
|
|
236
235
|
*
|
|
@@ -253,7 +252,7 @@ export interface Observable<TAttributeSchema extends z.ZodSchema = z.ZodAny> {
|
|
|
253
252
|
* }
|
|
254
253
|
* ```
|
|
255
254
|
*/
|
|
256
|
-
setAttributes(attrs: Record<string, string | number | boolean>): Observable
|
|
255
|
+
setAttributes(attrs: Record<string, string | number | boolean>): Observable;
|
|
257
256
|
/**
|
|
258
257
|
* Record an error to both logs and traces
|
|
259
258
|
*
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,5 +24,5 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
|
|
27
|
+
export {};
|
|
29
28
|
//# sourceMappingURL=observable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observable.js","sourceRoot":"","sources":["../../src/interfaces/observable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"observable.js","sourceRoot":"","sources":["../../src/interfaces/observable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG"}
|
|
@@ -24,12 +24,13 @@
|
|
|
24
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
25
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
|
-
import type { DEBUG_MODE } from "./logging";
|
|
28
|
-
import type { SBConfig } from "../serviceBase/config";
|
|
29
|
-
import type { SBPlugins } from "../serviceBase/plugins";
|
|
30
|
-
import type { SBObservable } from "../serviceBase/observable";
|
|
31
|
-
import type { SBEvents } from "../serviceBase/events";
|
|
32
|
-
import type { SBServices } from "../serviceBase/services";
|
|
27
|
+
import type { DEBUG_MODE } from "./logging.js";
|
|
28
|
+
import type { SBConfig } from "../serviceBase/config.js";
|
|
29
|
+
import type { SBPlugins } from "../serviceBase/plugins.js";
|
|
30
|
+
import type { SBObservable } from "../serviceBase/observable.js";
|
|
31
|
+
import type { SBEvents } from "../serviceBase/events.js";
|
|
32
|
+
import type { SBServices } from "../serviceBase/services.js";
|
|
33
|
+
export type BSBRuntimeMode = "dev" | "prod";
|
|
33
34
|
/**
|
|
34
35
|
* Configuration options for ServiceBase constructor
|
|
35
36
|
*
|
|
@@ -63,6 +64,13 @@ export interface BSBOptions {
|
|
|
63
64
|
* @default undefined (resolved from BSB_REGION env var)
|
|
64
65
|
*/
|
|
65
66
|
region?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Runtime mode controls how plugins are resolved.
|
|
69
|
+
* - `prod`: compiled JavaScript only
|
|
70
|
+
* - `dev`: prefer TypeScript, then fall back to JavaScript
|
|
71
|
+
* @default derived from `live`
|
|
72
|
+
*/
|
|
73
|
+
runtimeMode?: BSBRuntimeMode;
|
|
66
74
|
/**
|
|
67
75
|
* Override default configuration handler
|
|
68
76
|
* @default SBConfig
|
|
@@ -103,6 +111,7 @@ export interface ResolvedBSBOptions {
|
|
|
103
111
|
appId: string;
|
|
104
112
|
region?: string;
|
|
105
113
|
mode: DEBUG_MODE;
|
|
114
|
+
runtimeMode: BSBRuntimeMode;
|
|
106
115
|
config: typeof SBConfig;
|
|
107
116
|
plugins: typeof SBPlugins;
|
|
108
117
|
observable: typeof SBObservable;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,8 +24,6 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.BSBPreset = void 0;
|
|
30
27
|
/**
|
|
31
28
|
* Factory preset configurations
|
|
32
29
|
*
|
|
@@ -34,7 +31,7 @@ exports.BSBPreset = void 0;
|
|
|
34
31
|
* @category Configuration
|
|
35
32
|
* @see {@link https://bsbcode.dev/languages/nodejs/types/interfaces/BSBPreset.html | API: BSBPreset}
|
|
36
33
|
*/
|
|
37
|
-
var BSBPreset;
|
|
34
|
+
export var BSBPreset;
|
|
38
35
|
(function (BSBPreset) {
|
|
39
36
|
/**
|
|
40
37
|
* Minimal setup with basic plugins
|
|
@@ -52,5 +49,5 @@ var BSBPreset;
|
|
|
52
49
|
* Testing setup with mocked components
|
|
53
50
|
*/
|
|
54
51
|
BSBPreset["TESTING"] = "testing";
|
|
55
|
-
})(BSBPreset || (
|
|
52
|
+
})(BSBPreset || (BSBPreset = {}));
|
|
56
53
|
//# sourceMappingURL=options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/interfaces/options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/interfaces/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AA8IH;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,SAoBX;AApBD,WAAY,SAAS;IACnB;;OAEG;IACH,gCAAmB,CAAA;IAEnB;;OAEG;IACH,wCAA2B,CAAA;IAE3B;;OAEG;IACH,sCAAyB,CAAA;IAEzB;;OAEG;IACH,gCAAmB,CAAA;AACrB,CAAC,EApBW,SAAS,KAAT,SAAS,QAoBpB"}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
25
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
26
26
|
*/
|
|
27
|
-
import { BSBConfig, BSBConfigRef, BSBEvents, BSBEventsRef, BSBObservable, BSBObservableRef, BSBPluginConfig, BSBService, BSBServiceRef } from "../base";
|
|
28
|
-
import { EventsEventTypes } from "./events";
|
|
27
|
+
import { BSBConfig, BSBConfigRef, BSBEvents, BSBEventsRef, BSBObservable, BSBObservableRef, BSBPluginConfig, BSBService, BSBServiceRef } from "../base/index.js";
|
|
28
|
+
import { EventsEventTypes } from "./events.js";
|
|
29
29
|
/**
|
|
30
30
|
* @hidden
|
|
31
31
|
*/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* BSB (Better-Service-Base) is an event-bus based microservice framework.
|
|
4
3
|
* Copyright (C) 2016 - 2025 BetterCorp (PTY) Ltd
|
|
@@ -25,15 +24,13 @@
|
|
|
25
24
|
* You should have received a copy of the GNU Affero General Public License
|
|
26
25
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
27
26
|
*/
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.PluginTypes = void 0;
|
|
30
27
|
/**
|
|
31
28
|
* @hidden
|
|
32
29
|
*/
|
|
33
30
|
/**
|
|
34
31
|
* @see {@link https://bsbcode.dev/languages/nodejs/types/modules.html#module-interfaces_plugins | API: interfaces/plugins}
|
|
35
32
|
*/
|
|
36
|
-
|
|
33
|
+
export const PluginTypes = {
|
|
37
34
|
config: "config",
|
|
38
35
|
events: "events",
|
|
39
36
|
observable: "observable",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/interfaces/plugins.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/interfaces/plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAcH;;GAEG;AACH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,SAAS;CACV,CAAC;AA2JX;;GAEG"}
|