@bsb/observable-winston 9.0.1 → 9.1.2

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/index.d.ts CHANGED
@@ -24,4 +24,4 @@
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 { WinstonConfigSchema, type WinstonConfig, Config, Plugin, } from "./plugins/observable-winston";
27
+ export { WinstonConfigSchema, type WinstonConfig, Config, Plugin, } from "./plugins/observable-winston/index.js";
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,9 +24,4 @@
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.Plugin = exports.Config = exports.WinstonConfigSchema = void 0;
30
- var observable_winston_1 = require("./plugins/observable-winston");
31
- Object.defineProperty(exports, "WinstonConfigSchema", { enumerable: true, get: function () { return observable_winston_1.WinstonConfigSchema; } });
32
- Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return observable_winston_1.Config; } });
33
- Object.defineProperty(exports, "Plugin", { enumerable: true, get: function () { return observable_winston_1.Plugin; } });
27
+ export { WinstonConfigSchema, Config, Plugin, } from "./plugins/observable-winston/index.js";
@@ -26,121 +26,105 @@
26
26
  */
27
27
  import { BSBObservable, BSBObservableConstructor, BSBError } from "@bsb/base";
28
28
  import { DTrace, LogMeta } from "@bsb/base";
29
- import { z } from "zod";
30
- import "winston-daily-rotate-file";
29
+ import * as av from "@anyvali/js";
31
30
  /**
32
31
  * Configuration schema for Winston observable
33
32
  */
34
- export declare const WinstonConfigSchema: z.ZodObject<{
35
- level: z.ZodDefault<z.ZodEnum<{
36
- error: "error";
37
- warn: "warn";
38
- info: "info";
39
- debug: "debug";
40
- }>>;
41
- transports: z.ZodObject<{
42
- console: z.ZodObject<{
43
- enabled: z.ZodDefault<z.ZodBoolean>;
44
- colorize: z.ZodDefault<z.ZodBoolean>;
45
- }, z.core.$strip>;
46
- file: z.ZodObject<{
47
- enabled: z.ZodDefault<z.ZodBoolean>;
48
- filename: z.ZodDefault<z.ZodString>;
49
- maxsize: z.ZodDefault<z.ZodNumber>;
50
- maxFiles: z.ZodDefault<z.ZodNumber>;
51
- tailable: z.ZodDefault<z.ZodBoolean>;
52
- }, z.core.$strip>;
53
- dailyRotate: z.ZodObject<{
54
- enabled: z.ZodDefault<z.ZodBoolean>;
55
- dirname: z.ZodDefault<z.ZodString>;
56
- filename: z.ZodDefault<z.ZodString>;
57
- datePattern: z.ZodDefault<z.ZodString>;
58
- maxSize: z.ZodDefault<z.ZodString>;
59
- maxFiles: z.ZodDefault<z.ZodString>;
60
- zippedArchive: z.ZodDefault<z.ZodBoolean>;
61
- }, z.core.$strip>;
62
- }, z.core.$strip>;
63
- format: z.ZodObject<{
64
- timestamp: z.ZodDefault<z.ZodBoolean>;
65
- json: z.ZodDefault<z.ZodBoolean>;
66
- prettyPrint: z.ZodDefault<z.ZodBoolean>;
67
- }, z.core.$strip>;
68
- }, z.core.$strip>;
69
- export type WinstonConfig = z.infer<typeof WinstonConfigSchema>;
70
- export declare const Config: import("@bsb/base").BSBPluginConfigClass<z.ZodObject<{
71
- level: z.ZodDefault<z.ZodEnum<{
72
- error: "error";
73
- warn: "warn";
74
- info: "info";
75
- debug: "debug";
76
- }>>;
77
- transports: z.ZodObject<{
78
- console: z.ZodObject<{
79
- enabled: z.ZodDefault<z.ZodBoolean>;
80
- colorize: z.ZodDefault<z.ZodBoolean>;
81
- }, z.core.$strip>;
82
- file: z.ZodObject<{
83
- enabled: z.ZodDefault<z.ZodBoolean>;
84
- filename: z.ZodDefault<z.ZodString>;
85
- maxsize: z.ZodDefault<z.ZodNumber>;
86
- maxFiles: z.ZodDefault<z.ZodNumber>;
87
- tailable: z.ZodDefault<z.ZodBoolean>;
88
- }, z.core.$strip>;
89
- dailyRotate: z.ZodObject<{
90
- enabled: z.ZodDefault<z.ZodBoolean>;
91
- dirname: z.ZodDefault<z.ZodString>;
92
- filename: z.ZodDefault<z.ZodString>;
93
- datePattern: z.ZodDefault<z.ZodString>;
94
- maxSize: z.ZodDefault<z.ZodString>;
95
- maxFiles: z.ZodDefault<z.ZodString>;
96
- zippedArchive: z.ZodDefault<z.ZodBoolean>;
97
- }, z.core.$strip>;
98
- }, z.core.$strip>;
99
- format: z.ZodObject<{
100
- timestamp: z.ZodDefault<z.ZodBoolean>;
101
- json: z.ZodDefault<z.ZodBoolean>;
102
- prettyPrint: z.ZodDefault<z.ZodBoolean>;
103
- }, z.core.$strip>;
104
- }, z.core.$strip>>;
33
+ export declare const WinstonConfigSchema: av.ObjectSchema<{
34
+ level: av.OptionalSchema<av.EnumSchema<string[]>>;
35
+ transports: av.ObjectSchema<{
36
+ console: av.ObjectSchema<{
37
+ enabled: av.OptionalSchema<av.BoolSchema>;
38
+ colorize: av.OptionalSchema<av.BoolSchema>;
39
+ }>;
40
+ file: av.ObjectSchema<{
41
+ enabled: av.OptionalSchema<av.BoolSchema>;
42
+ filename: av.OptionalSchema<av.StringSchema>;
43
+ maxsize: av.OptionalSchema<av.Int32Schema>;
44
+ maxFiles: av.OptionalSchema<av.Int32Schema>;
45
+ tailable: av.OptionalSchema<av.BoolSchema>;
46
+ }>;
47
+ dailyRotate: av.ObjectSchema<{
48
+ enabled: av.OptionalSchema<av.BoolSchema>;
49
+ dirname: av.OptionalSchema<av.StringSchema>;
50
+ filename: av.OptionalSchema<av.StringSchema>;
51
+ datePattern: av.OptionalSchema<av.StringSchema>;
52
+ maxSize: av.OptionalSchema<av.StringSchema>;
53
+ maxFiles: av.OptionalSchema<av.StringSchema>;
54
+ zippedArchive: av.OptionalSchema<av.BoolSchema>;
55
+ }>;
56
+ }>;
57
+ format: av.ObjectSchema<{
58
+ timestamp: av.OptionalSchema<av.BoolSchema>;
59
+ json: av.OptionalSchema<av.BoolSchema>;
60
+ prettyPrint: av.OptionalSchema<av.BoolSchema>;
61
+ }>;
62
+ }>;
63
+ export type WinstonConfig = av.Infer<typeof WinstonConfigSchema>;
64
+ export declare const Config: import("@bsb/base").BSBPluginConfigClass<av.ObjectSchema<{
65
+ level: av.OptionalSchema<av.EnumSchema<string[]>>;
66
+ transports: av.ObjectSchema<{
67
+ console: av.ObjectSchema<{
68
+ enabled: av.OptionalSchema<av.BoolSchema>;
69
+ colorize: av.OptionalSchema<av.BoolSchema>;
70
+ }>;
71
+ file: av.ObjectSchema<{
72
+ enabled: av.OptionalSchema<av.BoolSchema>;
73
+ filename: av.OptionalSchema<av.StringSchema>;
74
+ maxsize: av.OptionalSchema<av.Int32Schema>;
75
+ maxFiles: av.OptionalSchema<av.Int32Schema>;
76
+ tailable: av.OptionalSchema<av.BoolSchema>;
77
+ }>;
78
+ dailyRotate: av.ObjectSchema<{
79
+ enabled: av.OptionalSchema<av.BoolSchema>;
80
+ dirname: av.OptionalSchema<av.StringSchema>;
81
+ filename: av.OptionalSchema<av.StringSchema>;
82
+ datePattern: av.OptionalSchema<av.StringSchema>;
83
+ maxSize: av.OptionalSchema<av.StringSchema>;
84
+ maxFiles: av.OptionalSchema<av.StringSchema>;
85
+ zippedArchive: av.OptionalSchema<av.BoolSchema>;
86
+ }>;
87
+ }>;
88
+ format: av.ObjectSchema<{
89
+ timestamp: av.OptionalSchema<av.BoolSchema>;
90
+ json: av.OptionalSchema<av.BoolSchema>;
91
+ prettyPrint: av.OptionalSchema<av.BoolSchema>;
92
+ }>;
93
+ }>>;
105
94
  /**
106
95
  * Winston observable plugin - integrate with Winston logger
107
96
  */
108
97
  export declare class Plugin extends BSBObservable<InstanceType<typeof Config>> {
109
- static Config: import("@bsb/base").BSBPluginConfigClass<z.ZodObject<{
110
- level: z.ZodDefault<z.ZodEnum<{
111
- error: "error";
112
- warn: "warn";
113
- info: "info";
114
- debug: "debug";
115
- }>>;
116
- transports: z.ZodObject<{
117
- console: z.ZodObject<{
118
- enabled: z.ZodDefault<z.ZodBoolean>;
119
- colorize: z.ZodDefault<z.ZodBoolean>;
120
- }, z.core.$strip>;
121
- file: z.ZodObject<{
122
- enabled: z.ZodDefault<z.ZodBoolean>;
123
- filename: z.ZodDefault<z.ZodString>;
124
- maxsize: z.ZodDefault<z.ZodNumber>;
125
- maxFiles: z.ZodDefault<z.ZodNumber>;
126
- tailable: z.ZodDefault<z.ZodBoolean>;
127
- }, z.core.$strip>;
128
- dailyRotate: z.ZodObject<{
129
- enabled: z.ZodDefault<z.ZodBoolean>;
130
- dirname: z.ZodDefault<z.ZodString>;
131
- filename: z.ZodDefault<z.ZodString>;
132
- datePattern: z.ZodDefault<z.ZodString>;
133
- maxSize: z.ZodDefault<z.ZodString>;
134
- maxFiles: z.ZodDefault<z.ZodString>;
135
- zippedArchive: z.ZodDefault<z.ZodBoolean>;
136
- }, z.core.$strip>;
137
- }, z.core.$strip>;
138
- format: z.ZodObject<{
139
- timestamp: z.ZodDefault<z.ZodBoolean>;
140
- json: z.ZodDefault<z.ZodBoolean>;
141
- prettyPrint: z.ZodDefault<z.ZodBoolean>;
142
- }, z.core.$strip>;
143
- }, z.core.$strip>>;
98
+ static Config: import("@bsb/base").BSBPluginConfigClass<av.ObjectSchema<{
99
+ level: av.OptionalSchema<av.EnumSchema<string[]>>;
100
+ transports: av.ObjectSchema<{
101
+ console: av.ObjectSchema<{
102
+ enabled: av.OptionalSchema<av.BoolSchema>;
103
+ colorize: av.OptionalSchema<av.BoolSchema>;
104
+ }>;
105
+ file: av.ObjectSchema<{
106
+ enabled: av.OptionalSchema<av.BoolSchema>;
107
+ filename: av.OptionalSchema<av.StringSchema>;
108
+ maxsize: av.OptionalSchema<av.Int32Schema>;
109
+ maxFiles: av.OptionalSchema<av.Int32Schema>;
110
+ tailable: av.OptionalSchema<av.BoolSchema>;
111
+ }>;
112
+ dailyRotate: av.ObjectSchema<{
113
+ enabled: av.OptionalSchema<av.BoolSchema>;
114
+ dirname: av.OptionalSchema<av.StringSchema>;
115
+ filename: av.OptionalSchema<av.StringSchema>;
116
+ datePattern: av.OptionalSchema<av.StringSchema>;
117
+ maxSize: av.OptionalSchema<av.StringSchema>;
118
+ maxFiles: av.OptionalSchema<av.StringSchema>;
119
+ zippedArchive: av.OptionalSchema<av.BoolSchema>;
120
+ }>;
121
+ }>;
122
+ format: av.ObjectSchema<{
123
+ timestamp: av.OptionalSchema<av.BoolSchema>;
124
+ json: av.OptionalSchema<av.BoolSchema>;
125
+ prettyPrint: av.OptionalSchema<av.BoolSchema>;
126
+ }>;
127
+ }>>;
144
128
  private logFormatter;
145
129
  private logger;
146
130
  private isDisposed;
@@ -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,86 +24,51 @@
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
- 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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
40
- Object.defineProperty(o, "default", { enumerable: true, value: v });
41
- }) : function(o, v) {
42
- o["default"] = v;
43
- });
44
- var __importStar = (this && this.__importStar) || (function () {
45
- var ownKeys = function(o) {
46
- ownKeys = Object.getOwnPropertyNames || function (o) {
47
- var ar = [];
48
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
49
- return ar;
50
- };
51
- return ownKeys(o);
52
- };
53
- return function (mod) {
54
- if (mod && mod.__esModule) return mod;
55
- var result = {};
56
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
57
- __setModuleDefault(result, mod);
58
- return result;
59
- };
60
- })();
61
- Object.defineProperty(exports, "__esModule", { value: true });
62
- exports.Plugin = exports.Config = exports.WinstonConfigSchema = void 0;
63
- const base_1 = require("@bsb/base");
64
- const zod_1 = require("zod");
65
- const winston = __importStar(require("winston"));
66
- require("winston-daily-rotate-file");
27
+ import { BSBObservable, createConfigSchema, LogFormatter, BSBError } from "@bsb/base";
28
+ import * as av from "@anyvali/js";
29
+ import * as winston from "winston";
30
+ import DailyRotateFile from "winston-daily-rotate-file";
67
31
  /**
68
32
  * Configuration schema for Winston observable
69
33
  */
70
- exports.WinstonConfigSchema = zod_1.z.object({
71
- level: zod_1.z.enum(["error", "warn", "info", "debug"]).default("info"),
72
- transports: zod_1.z.object({
73
- console: zod_1.z.object({
74
- enabled: zod_1.z.boolean().default(true),
75
- colorize: zod_1.z.boolean().default(true),
76
- }),
77
- file: zod_1.z.object({
78
- enabled: zod_1.z.boolean().default(false),
79
- filename: zod_1.z.string().default("./logs/application.log"),
80
- maxsize: zod_1.z.number().int().default(10485760), // 10MB
81
- maxFiles: zod_1.z.number().int().default(5),
82
- tailable: zod_1.z.boolean().default(true),
83
- }),
84
- dailyRotate: zod_1.z.object({
85
- enabled: zod_1.z.boolean().default(false),
86
- dirname: zod_1.z.string().default("./logs"),
87
- filename: zod_1.z.string().default("application-%DATE%.log"),
88
- datePattern: zod_1.z.string().default("YYYY-MM-DD"),
89
- maxSize: zod_1.z.string().default("20m"),
90
- maxFiles: zod_1.z.string().default("14d"),
91
- zippedArchive: zod_1.z.boolean().default(true),
92
- }),
93
- }),
94
- format: zod_1.z.object({
95
- timestamp: zod_1.z.boolean().default(true),
96
- json: zod_1.z.boolean().default(true),
97
- prettyPrint: zod_1.z.boolean().default(false),
98
- }),
99
- });
100
- exports.Config = (0, base_1.createConfigSchema)({
34
+ export const WinstonConfigSchema = av.object({
35
+ level: av.optional(av.enum_(["error", "warn", "info", "debug"])).default("info"),
36
+ transports: av.object({
37
+ console: av.object({
38
+ enabled: av.optional(av.bool()).default(true),
39
+ colorize: av.optional(av.bool()).default(true),
40
+ }, { unknownKeys: "strip" }),
41
+ file: av.object({
42
+ enabled: av.optional(av.bool()).default(false),
43
+ filename: av.optional(av.string()).default("./logs/application.log"),
44
+ maxsize: av.optional(av.int32()).default(10485760),
45
+ maxFiles: av.optional(av.int32()).default(5),
46
+ tailable: av.optional(av.bool()).default(true),
47
+ }, { unknownKeys: "strip" }),
48
+ dailyRotate: av.object({
49
+ enabled: av.optional(av.bool()).default(false),
50
+ dirname: av.optional(av.string()).default("./logs"),
51
+ filename: av.optional(av.string()).default("application-%DATE%.log"),
52
+ datePattern: av.optional(av.string()).default("YYYY-MM-DD"),
53
+ maxSize: av.optional(av.string()).default("20m"),
54
+ maxFiles: av.optional(av.string()).default("14d"),
55
+ zippedArchive: av.optional(av.bool()).default(true),
56
+ }, { unknownKeys: "strip" }),
57
+ }, { unknownKeys: "strip" }),
58
+ format: av.object({
59
+ timestamp: av.optional(av.bool()).default(true),
60
+ json: av.optional(av.bool()).default(true),
61
+ prettyPrint: av.optional(av.bool()).default(false),
62
+ }, { unknownKeys: "strip" }),
63
+ }, { unknownKeys: "strip" });
64
+ export const Config = createConfigSchema({
101
65
  name: 'observable-winston',
102
66
  description: 'Winston observable plugin with console, file, and rotation transports',
103
67
  version: '9.0.0',
104
68
  image: './observable-winston.png',
105
69
  tags: ['winston', 'logging', 'observability', 'transports'],
106
70
  documentation: ['./docs/plugin.md'],
107
- }, exports.WinstonConfigSchema);
71
+ }, WinstonConfigSchema);
108
72
  /**
109
73
  * Convert BSB log level to Winston log level
110
74
  */
@@ -127,9 +91,9 @@ function bsbLevelToWinstonLevel(level) {
127
91
  /**
128
92
  * Winston observable plugin - integrate with Winston logger
129
93
  */
130
- class Plugin extends base_1.BSBObservable {
131
- static Config = exports.Config;
132
- logFormatter = new base_1.LogFormatter();
94
+ export class Plugin extends BSBObservable {
95
+ static Config = Config;
96
+ logFormatter = new LogFormatter();
133
97
  logger;
134
98
  isDisposed = false;
135
99
  constructor(config) {
@@ -157,7 +121,6 @@ class Plugin extends base_1.BSBObservable {
157
121
  }
158
122
  // Daily rotate file transport
159
123
  if (this.config.transports.dailyRotate.enabled) {
160
- const DailyRotateFile = require("winston-daily-rotate-file");
161
124
  transports.push(new DailyRotateFile({
162
125
  dirname: this.config.transports.dailyRotate.dirname,
163
126
  filename: this.config.transports.dailyRotate.filename,
@@ -230,7 +193,7 @@ class Plugin extends base_1.BSBObservable {
230
193
  this.sendLog("warn", trace, pluginName, message, meta);
231
194
  }
232
195
  error(trace, pluginName, message, meta) {
233
- if (message instanceof base_1.BSBError) {
196
+ if (message instanceof BSBError) {
234
197
  if (message.raw !== null) {
235
198
  this.sendLog("error", message.raw.trace, pluginName, message.raw.message, message.raw.meta);
236
199
  }
@@ -249,4 +212,3 @@ class Plugin extends base_1.BSBObservable {
249
212
  }
250
213
  }
251
214
  }
252
- exports.Plugin = Plugin;
@@ -2,160 +2,6 @@
2
2
  "pluginName": "observable-winston",
3
3
  "version": "9.0.0",
4
4
  "events": {},
5
- "configSchema": {
6
- "$schema": "https://json-schema.org/draft/2020-12/schema",
7
- "type": "object",
8
- "properties": {
9
- "level": {
10
- "default": "info",
11
- "type": "string",
12
- "enum": [
13
- "error",
14
- "warn",
15
- "info",
16
- "debug"
17
- ]
18
- },
19
- "transports": {
20
- "type": "object",
21
- "properties": {
22
- "console": {
23
- "type": "object",
24
- "properties": {
25
- "enabled": {
26
- "default": true,
27
- "type": "boolean"
28
- },
29
- "colorize": {
30
- "default": true,
31
- "type": "boolean"
32
- }
33
- },
34
- "required": [
35
- "enabled",
36
- "colorize"
37
- ],
38
- "additionalProperties": false
39
- },
40
- "file": {
41
- "type": "object",
42
- "properties": {
43
- "enabled": {
44
- "default": false,
45
- "type": "boolean"
46
- },
47
- "filename": {
48
- "default": "./logs/application.log",
49
- "type": "string"
50
- },
51
- "maxsize": {
52
- "default": 10485760,
53
- "type": "integer",
54
- "minimum": -9007199254740991,
55
- "maximum": 9007199254740991
56
- },
57
- "maxFiles": {
58
- "default": 5,
59
- "type": "integer",
60
- "minimum": -9007199254740991,
61
- "maximum": 9007199254740991
62
- },
63
- "tailable": {
64
- "default": true,
65
- "type": "boolean"
66
- }
67
- },
68
- "required": [
69
- "enabled",
70
- "filename",
71
- "maxsize",
72
- "maxFiles",
73
- "tailable"
74
- ],
75
- "additionalProperties": false
76
- },
77
- "dailyRotate": {
78
- "type": "object",
79
- "properties": {
80
- "enabled": {
81
- "default": false,
82
- "type": "boolean"
83
- },
84
- "dirname": {
85
- "default": "./logs",
86
- "type": "string"
87
- },
88
- "filename": {
89
- "default": "application-%DATE%.log",
90
- "type": "string"
91
- },
92
- "datePattern": {
93
- "default": "YYYY-MM-DD",
94
- "type": "string"
95
- },
96
- "maxSize": {
97
- "default": "20m",
98
- "type": "string"
99
- },
100
- "maxFiles": {
101
- "default": "14d",
102
- "type": "string"
103
- },
104
- "zippedArchive": {
105
- "default": true,
106
- "type": "boolean"
107
- }
108
- },
109
- "required": [
110
- "enabled",
111
- "dirname",
112
- "filename",
113
- "datePattern",
114
- "maxSize",
115
- "maxFiles",
116
- "zippedArchive"
117
- ],
118
- "additionalProperties": false
119
- }
120
- },
121
- "required": [
122
- "console",
123
- "file",
124
- "dailyRotate"
125
- ],
126
- "additionalProperties": false
127
- },
128
- "format": {
129
- "type": "object",
130
- "properties": {
131
- "timestamp": {
132
- "default": true,
133
- "type": "boolean"
134
- },
135
- "json": {
136
- "default": true,
137
- "type": "boolean"
138
- },
139
- "prettyPrint": {
140
- "default": false,
141
- "type": "boolean"
142
- }
143
- },
144
- "required": [
145
- "timestamp",
146
- "json",
147
- "prettyPrint"
148
- ],
149
- "additionalProperties": false
150
- }
151
- },
152
- "required": [
153
- "level",
154
- "transports",
155
- "format"
156
- ],
157
- "additionalProperties": false
158
- },
159
5
  "pluginType": "observable",
160
6
  "capabilities": {
161
7
  "logging": {
@@ -14,159 +14,5 @@
14
14
  "./docs/plugin.md"
15
15
  ],
16
16
  "dependencies": [],
17
- "image": "./observable-winston.png",
18
- "configSchema": {
19
- "$schema": "https://json-schema.org/draft/2020-12/schema",
20
- "type": "object",
21
- "properties": {
22
- "level": {
23
- "default": "info",
24
- "type": "string",
25
- "enum": [
26
- "error",
27
- "warn",
28
- "info",
29
- "debug"
30
- ]
31
- },
32
- "transports": {
33
- "type": "object",
34
- "properties": {
35
- "console": {
36
- "type": "object",
37
- "properties": {
38
- "enabled": {
39
- "default": true,
40
- "type": "boolean"
41
- },
42
- "colorize": {
43
- "default": true,
44
- "type": "boolean"
45
- }
46
- },
47
- "required": [
48
- "enabled",
49
- "colorize"
50
- ],
51
- "additionalProperties": false
52
- },
53
- "file": {
54
- "type": "object",
55
- "properties": {
56
- "enabled": {
57
- "default": false,
58
- "type": "boolean"
59
- },
60
- "filename": {
61
- "default": "./logs/application.log",
62
- "type": "string"
63
- },
64
- "maxsize": {
65
- "default": 10485760,
66
- "type": "integer",
67
- "minimum": -9007199254740991,
68
- "maximum": 9007199254740991
69
- },
70
- "maxFiles": {
71
- "default": 5,
72
- "type": "integer",
73
- "minimum": -9007199254740991,
74
- "maximum": 9007199254740991
75
- },
76
- "tailable": {
77
- "default": true,
78
- "type": "boolean"
79
- }
80
- },
81
- "required": [
82
- "enabled",
83
- "filename",
84
- "maxsize",
85
- "maxFiles",
86
- "tailable"
87
- ],
88
- "additionalProperties": false
89
- },
90
- "dailyRotate": {
91
- "type": "object",
92
- "properties": {
93
- "enabled": {
94
- "default": false,
95
- "type": "boolean"
96
- },
97
- "dirname": {
98
- "default": "./logs",
99
- "type": "string"
100
- },
101
- "filename": {
102
- "default": "application-%DATE%.log",
103
- "type": "string"
104
- },
105
- "datePattern": {
106
- "default": "YYYY-MM-DD",
107
- "type": "string"
108
- },
109
- "maxSize": {
110
- "default": "20m",
111
- "type": "string"
112
- },
113
- "maxFiles": {
114
- "default": "14d",
115
- "type": "string"
116
- },
117
- "zippedArchive": {
118
- "default": true,
119
- "type": "boolean"
120
- }
121
- },
122
- "required": [
123
- "enabled",
124
- "dirname",
125
- "filename",
126
- "datePattern",
127
- "maxSize",
128
- "maxFiles",
129
- "zippedArchive"
130
- ],
131
- "additionalProperties": false
132
- }
133
- },
134
- "required": [
135
- "console",
136
- "file",
137
- "dailyRotate"
138
- ],
139
- "additionalProperties": false
140
- },
141
- "format": {
142
- "type": "object",
143
- "properties": {
144
- "timestamp": {
145
- "default": true,
146
- "type": "boolean"
147
- },
148
- "json": {
149
- "default": true,
150
- "type": "boolean"
151
- },
152
- "prettyPrint": {
153
- "default": false,
154
- "type": "boolean"
155
- }
156
- },
157
- "required": [
158
- "timestamp",
159
- "json",
160
- "prettyPrint"
161
- ],
162
- "additionalProperties": false
163
- }
164
- },
165
- "required": [
166
- "level",
167
- "transports",
168
- "format"
169
- ],
170
- "additionalProperties": false
171
- }
17
+ "image": "./observable-winston.png"
172
18
  }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@bsb/observable-winston",
3
- "version": "9.0.1",
3
+ "version": "9.1.2",
4
+ "type": "module",
4
5
  "license": "(AGPL-3.0-only OR Commercial)",
5
6
  "author": {
6
7
  "name": "BetterCorp (PTY) Ltd",
@@ -39,12 +40,12 @@
39
40
  "@bsb/base": "^9.0.0"
40
41
  },
41
42
  "dependencies": {
43
+ "@anyvali/js": "^0.2.0",
42
44
  "winston": "^3.17.0",
43
- "winston-daily-rotate-file": "^5.0.0",
44
- "zod": "^4.3.6"
45
+ "winston-daily-rotate-file": "^5.0.0"
45
46
  },
46
47
  "devDependencies": {
47
- "@bsb/base": "file:../../../nodejs",
48
+ "@bsb/base": "^9.0.0",
48
49
  "@types/node": "^25.0.0",
49
50
  "mocha": "^11.0.0",
50
51
  "typescript": "^5.9.0"
@@ -55,7 +56,3 @@
55
56
  },
56
57
  "homepage": "https://io.bsbcode.dev/packages/nodejs/@bsb/observable-winston"
57
58
  }
58
-
59
-
60
-
61
-