@stemy/backend 5.0.2 → 5.0.4

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.
@@ -30,6 +30,7 @@ import { v4 } from 'uuid';
30
30
  import { createTransport } from 'nodemailer';
31
31
  import * as Handlebars from 'handlebars';
32
32
  import { routingControllersToSpec, OpenAPI, getStatusCode } from 'routing-controllers-openapi';
33
+ import { defaultMetadataStorage } from 'class-transformer/cjs/storage';
33
34
  import { validationMetadatasToSchemas } from 'class-validator-jsonschema';
34
35
  import { ValidatorConstraint, ValidationTypes, Min, Max, IsOptional, IsBoolean } from 'class-validator';
35
36
  import { CommandsAddon, AnsiCodes } from '@stemy/terminal-commands-addon';
@@ -1776,7 +1777,16 @@ let BackendProvider = class BackendProvider {
1776
1777
  this.server = createServer(this.express);
1777
1778
  }
1778
1779
  get io() {
1779
- this.ioServer = this.ioServer || new Server(this.server, { path: "/socket" });
1780
+ this.ioServer = this.ioServer || new Server(this.server, {
1781
+ path: "/socket",
1782
+ cors: {
1783
+ credentials: true,
1784
+ exposedHeaders: ["content-disposition"],
1785
+ origin: (origin, callback) => {
1786
+ callback(null, true);
1787
+ }
1788
+ }
1789
+ });
1780
1790
  return this.ioServer;
1781
1791
  }
1782
1792
  };
@@ -2449,6 +2459,7 @@ let OpenApi = class OpenApi {
2449
2459
  const docs = routingControllersToSpec(storage);
2450
2460
  docs.basePath = "/api/";
2451
2461
  docs.definitions = validationMetadatasToSchemas({
2462
+ classTransformerMetadataStorage: defaultMetadataStorage,
2452
2463
  additionalConverters: {
2453
2464
  [ValidationTypes.CUSTOM_VALIDATION]: (meta, options) => {
2454
2465
  const res = isFunction(this.customValidation) ? this.customValidation(meta, options) : this.customValidation;