@carno.js/swagger 0.2.10 → 1.0.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/dist/entry.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { Carno } from "@carno.js/core";
2
2
  import { CarnoSwaggerConfig } from "./swagger.service";
3
- export declare const SwaggerModule: (config: CarnoSwaggerConfig) => Carno<import("@carno.js/core").ValidatorAdapterConstructor>;
3
+ export declare const SwaggerModule: (config: CarnoSwaggerConfig) => Carno;
package/dist/entry.js CHANGED
@@ -4,11 +4,11 @@ exports.SwaggerModule = void 0;
4
4
  const core_1 = require("@carno.js/core");
5
5
  const swagger_service_1 = require("./swagger.service");
6
6
  const SwaggerModule = (config) => {
7
- const app = new core_1.Carno({
7
+ (0, swagger_service_1.useConfig)(config);
8
+ const plugin = new core_1.Carno({
8
9
  exports: [swagger_service_1.SwaggerService],
9
- providers: [swagger_service_1.SwaggerService],
10
10
  });
11
- (0, swagger_service_1.useConfig)(config);
12
- return app;
11
+ plugin.controllers([swagger_service_1.SwaggerService]);
12
+ return plugin;
13
13
  };
14
14
  exports.SwaggerModule = SwaggerModule;
@@ -1,4 +1,3 @@
1
- import { InjectorService } from "@carno.js/core";
2
1
  import { OpenAPIV3 } from "openapi-types";
3
2
  import { SwaggerUIOptions } from "swagger-ui";
4
3
  export declare const filterPaths: (paths: Record<string, any>, { excludeStaticFile, exclude, }: {
@@ -59,9 +58,8 @@ export interface CarnoSwaggerConfig {
59
58
  export declare let config: CarnoSwaggerConfig;
60
59
  export declare function useConfig(newConfig: CarnoSwaggerConfig): void;
61
60
  export declare class SwaggerService {
62
- private injector;
63
61
  private routes;
64
- constructor(injector: InjectorService);
62
+ constructor();
65
63
  setDocumentation(documentation: CarnoSwaggerConfig["documentation"]): void;
66
64
  ui(): Response;
67
65
  onApplicationInit(): void;
@@ -60,8 +60,7 @@ function useConfig(newConfig) {
60
60
  exports.config = newConfig;
61
61
  }
62
62
  let SwaggerService = class SwaggerService {
63
- constructor(injector) {
64
- this.injector = injector;
63
+ constructor() {
65
64
  this.routes = {};
66
65
  const version = exports.config.version || "5.9.0";
67
66
  exports.config = {
@@ -312,5 +311,5 @@ __decorate([
312
311
  ], SwaggerService.prototype, "getDocumentation", null);
313
312
  exports.SwaggerService = SwaggerService = __decorate([
314
313
  (0, core_1.Controller)(),
315
- __metadata("design:paramtypes", [core_1.InjectorService])
314
+ __metadata("design:paramtypes", [])
316
315
  ], SwaggerService);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carno.js/swagger",
3
- "version": "0.2.10",
3
+ "version": "1.0.0",
4
4
  "description": "Generate automatically swagger.json from your carno.js project",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",
@@ -42,5 +42,5 @@
42
42
  "carno.js",
43
43
  "swagger"
44
44
  ],
45
- "gitHead": "5c765c2c9172bec7f509ca2513f6c10472ec89eb"
45
+ "gitHead": "d2b000eeb352a03569b90d8eb2bf3557c00b741b"
46
46
  }