@camstack/server 1.2.835 → 1.2.837

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/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.837] - 2026-11-11
11
+
12
+ ### Changed
13
+
14
+ - Rebuilt against updated dependencies.
15
+
16
+ ## [1.2.836] - 2026-11-11
17
+
18
+ ### Changed
19
+
20
+ - Log shutdown now waits for the rotating log file to close, so a stopping hub no longer leaves a late file open.
21
+
10
22
  ## [1.2.835] - 2026-11-11
11
23
 
12
24
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.835",
3
+ "version": "1.2.837",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -66,8 +66,9 @@
66
66
  ],
67
67
  "requires": {
68
68
  "addons": {
69
- "@camstack/addon-pipeline-orchestrator": ">=1.2.680",
70
- "@camstack/addon-provider-bosch": ">=0.1.51"
69
+ "@camstack/addon-admin-ui": ">=1.2.642",
70
+ "@camstack/addon-agent-ui": ">=1.2.364",
71
+ "@camstack/addon-import-alexa": ">=0.2.203"
71
72
  },
72
73
  "wrapper": {
73
74
  "desktop": ">=0.0.1",
@@ -76,8 +77,8 @@
76
77
  }
77
78
  },
78
79
  "dependencies": {
79
- "@camstack/addon-admin-ui": "1.2.640",
80
- "@camstack/addon-agent-ui": "1.2.362",
80
+ "@camstack/addon-admin-ui": "1.2.642",
81
+ "@camstack/addon-agent-ui": "1.2.364",
81
82
  "@camstack/addon-auth": "1.2.182",
82
83
  "@camstack/addon-benchmark": "1.2.313",
83
84
  "@camstack/addon-decoder-nodeav": "1.2.149",
@@ -87,8 +88,8 @@
87
88
  "@camstack/addon-post-analysis": "1.2.693",
88
89
  "@camstack/develop": "0.1.52",
89
90
  "@camstack/sdk": "1.2.157",
90
- "@camstack/types": "1.2.545",
91
- "@camstack/ui-library": "1.2.422",
91
+ "@camstack/types": "1.2.547",
92
+ "@camstack/ui-library": "1.2.424",
92
93
  "@fastify/compress": "^9.0.0",
93
94
  "@fastify/cookie": "^11.0.2",
94
95
  "@fastify/cors": "^11.2.0",
@@ -219,6 +219,8 @@ var LogFileReadClient = class {
219
219
  };
220
220
  //#endregion
221
221
  //#region src/builtins/winston-logging/winston-destination.ts
222
+ /** How long `shutdown` waits for the rotating file to close before giving up. */
223
+ var LOG_FILE_CLOSE_BOUND_MS = 5e3;
222
224
  /**
223
225
  * Rotated-file log destination. Console output goes through the shared
224
226
  * `formatLogLine` so every console sink (Winston, ConsoleDestination,
@@ -228,6 +230,7 @@ var LogFileReadClient = class {
228
230
  var WinstonDestination = class {
229
231
  readerOptions;
230
232
  logger = null;
233
+ fileTransport = null;
231
234
  reader = null;
232
235
  retentionDays = 30;
233
236
  /**
@@ -253,15 +256,17 @@ var WinstonDestination = class {
253
256
  return info;
254
257
  });
255
258
  const fileFormat = winston.format.combine(winston.format.timestamp(), stripRendered(), winston.format.json());
259
+ const fileTransport = new winston_daily_rotate_file.default({
260
+ dirname: logsDir,
261
+ filename: "camstack-%DATE%.log",
262
+ datePattern: "YYYY-MM-DD",
263
+ maxFiles: `${retentionDays}d`,
264
+ format: fileFormat
265
+ });
266
+ this.fileTransport = fileTransport;
256
267
  this.logger = winston.createLogger({
257
268
  level,
258
- transports: [new winston_daily_rotate_file.default({
259
- dirname: logsDir,
260
- filename: "camstack-%DATE%.log",
261
- datePattern: "YYYY-MM-DD",
262
- maxFiles: `${retentionDays}d`,
263
- format: fileFormat
264
- })]
269
+ transports: [fileTransport]
265
270
  });
266
271
  }
267
272
  write(entry) {
@@ -310,12 +315,25 @@ var WinstonDestination = class {
310
315
  async shutdown() {
311
316
  this.reader?.stop();
312
317
  this.reader = null;
313
- if (!this.logger) return;
318
+ const logger = this.logger;
319
+ const fileTransport = this.fileTransport;
320
+ if (!logger) return;
321
+ this.logger = null;
322
+ this.fileTransport = null;
323
+ const fileClosed = new Promise((resolve) => {
324
+ if (fileTransport === null) return resolve();
325
+ const bound = setTimeout(resolve, LOG_FILE_CLOSE_BOUND_MS);
326
+ bound.unref();
327
+ fileTransport.logStream.once("close", () => {
328
+ clearTimeout(bound);
329
+ resolve();
330
+ });
331
+ });
314
332
  await new Promise((resolve) => {
315
- this.logger.on("finish", resolve);
316
- this.logger.end();
333
+ logger.on("finish", resolve);
334
+ logger.end();
317
335
  });
318
- this.logger = null;
336
+ await fileClosed;
319
337
  }
320
338
  };
321
339
  //#endregion
@@ -212,6 +212,8 @@ var LogFileReadClient = class {
212
212
  };
213
213
  //#endregion
214
214
  //#region src/builtins/winston-logging/winston-destination.ts
215
+ /** How long `shutdown` waits for the rotating file to close before giving up. */
216
+ var LOG_FILE_CLOSE_BOUND_MS = 5e3;
215
217
  /**
216
218
  * Rotated-file log destination. Console output goes through the shared
217
219
  * `formatLogLine` so every console sink (Winston, ConsoleDestination,
@@ -221,6 +223,7 @@ var LogFileReadClient = class {
221
223
  var WinstonDestination = class {
222
224
  readerOptions;
223
225
  logger = null;
226
+ fileTransport = null;
224
227
  reader = null;
225
228
  retentionDays = 30;
226
229
  /**
@@ -246,15 +249,17 @@ var WinstonDestination = class {
246
249
  return info;
247
250
  });
248
251
  const fileFormat = winston.format.combine(winston.format.timestamp(), stripRendered(), winston.format.json());
252
+ const fileTransport = new DailyRotateFile({
253
+ dirname: logsDir,
254
+ filename: "camstack-%DATE%.log",
255
+ datePattern: "YYYY-MM-DD",
256
+ maxFiles: `${retentionDays}d`,
257
+ format: fileFormat
258
+ });
259
+ this.fileTransport = fileTransport;
249
260
  this.logger = winston.createLogger({
250
261
  level,
251
- transports: [new DailyRotateFile({
252
- dirname: logsDir,
253
- filename: "camstack-%DATE%.log",
254
- datePattern: "YYYY-MM-DD",
255
- maxFiles: `${retentionDays}d`,
256
- format: fileFormat
257
- })]
262
+ transports: [fileTransport]
258
263
  });
259
264
  }
260
265
  write(entry) {
@@ -303,12 +308,25 @@ var WinstonDestination = class {
303
308
  async shutdown() {
304
309
  this.reader?.stop();
305
310
  this.reader = null;
306
- if (!this.logger) return;
311
+ const logger = this.logger;
312
+ const fileTransport = this.fileTransport;
313
+ if (!logger) return;
314
+ this.logger = null;
315
+ this.fileTransport = null;
316
+ const fileClosed = new Promise((resolve) => {
317
+ if (fileTransport === null) return resolve();
318
+ const bound = setTimeout(resolve, LOG_FILE_CLOSE_BOUND_MS);
319
+ bound.unref();
320
+ fileTransport.logStream.once("close", () => {
321
+ clearTimeout(bound);
322
+ resolve();
323
+ });
324
+ });
307
325
  await new Promise((resolve) => {
308
- this.logger.on("finish", resolve);
309
- this.logger.end();
326
+ logger.on("finish", resolve);
327
+ logger.end();
310
328
  });
311
- this.logger = null;
329
+ await fileClosed;
312
330
  }
313
331
  };
314
332
  //#endregion
@@ -15,6 +15,7 @@ interface WinstonConfig {
15
15
  export declare class WinstonDestination implements ILogDestination {
16
16
  private readonly readerOptions;
17
17
  private logger;
18
+ private fileTransport;
18
19
  private reader;
19
20
  private retentionDays;
20
21
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.835",
3
+ "version": "1.2.837",
4
4
  "description": "CamStack builtins — shipped inside @camstack/server (generated, do not edit)",
5
5
  "license": "MIT",
6
6
  "camstack": {