@stemy/backend 5.0.0 → 5.0.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.
@@ -24,7 +24,7 @@ import cron from 'node-cron';
24
24
  import { socket } from 'zeromq';
25
25
  import { filter as filter$1, map, first, timeout } from 'rxjs/operators';
26
26
  import { createServer } from 'http';
27
- import express_, { static as static$1 } from 'express';
27
+ import express_ from 'express';
28
28
  import { Server } from 'socket.io';
29
29
  import { v4 } from 'uuid';
30
30
  import { createTransport } from 'nodemailer';
@@ -544,7 +544,9 @@ function createTransformer(transform) {
544
544
  };
545
545
  }
546
546
  function broadcast(socketServer, cb) {
547
- Array.from(Object.values(socketServer.sockets.sockets)).forEach(cb);
547
+ socketServer.sockets.sockets.forEach((client) => {
548
+ cb(client);
549
+ });
548
550
  }
549
551
  function rand(min, max) {
550
552
  return Math.round(random(min, max));
@@ -2392,9 +2394,10 @@ let OpenApi = class OpenApi {
2392
2394
  return this.docsStr;
2393
2395
  }
2394
2396
  async schemaToExample(src, req) {
2395
- if (src.$ref) {
2397
+ const maybeRef = src;
2398
+ if (maybeRef.$ref) {
2396
2399
  const schemas = this.apiDocs.components.schemas;
2397
- const schema = src.$ref
2400
+ const schema = maybeRef.$ref
2398
2401
  .replace("#/components/schemas/", "")
2399
2402
  .replace("#/definitions/", "");
2400
2403
  return this.schemaToExample(schemas[schema], req);
@@ -3094,13 +3097,6 @@ __decorate([
3094
3097
  __metadata("design:paramtypes", []),
3095
3098
  __metadata("design:returntype", void 0)
3096
3099
  ], TerminalController$1.prototype, "console", null);
3097
- __decorate([
3098
- Get(),
3099
- Header("Content-Type", "text/html"),
3100
- __metadata("design:type", Function),
3101
- __metadata("design:paramtypes", [String]),
3102
- __metadata("design:returntype", String)
3103
- ], TerminalController$1.prototype, "generateClient", null);
3104
3100
  TerminalController$1 = __decorate([
3105
3101
  injectable(),
3106
3102
  Controller(),
@@ -3653,7 +3649,7 @@ async function setupStatic(rootFolder, container) {
3653
3649
  console.log(browserFolder, existsSync(browserFolder));
3654
3650
  if (existsSync(browserFolder)) {
3655
3651
  console.log(`public_html exists. setting up static files serving...`);
3656
- app.use(static$1(browserFolder, {
3652
+ app.use(express_.static(browserFolder, {
3657
3653
  maxAge: "1y"
3658
3654
  }));
3659
3655
  }
@@ -3754,15 +3750,14 @@ function ResponseType(type, options = {}) {
3754
3750
  const reference = {
3755
3751
  $ref: `#/components/schemas/${type.name}`,
3756
3752
  };
3757
- const schema = options.isArray
3758
- ? { items: reference, type: "array" }
3759
- : reference;
3760
3753
  op.responses = op.responses || {};
3761
3754
  op.responses[statusCode] = {
3762
3755
  description: options.description || "Success",
3763
3756
  content: {
3764
3757
  [contentType]: {
3765
- schema
3758
+ schema: options.isArray
3759
+ ? { items: reference, type: "array" }
3760
+ : reference
3766
3761
  }
3767
3762
  }
3768
3763
  };