@ask-ell/back-end 0.0.4 → 0.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ask-ell/back-end",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -6,5 +6,6 @@ export declare class AddOnWrapper<T> implements IAddOn<T> {
6
6
  private implementations;
7
7
  constructor(params: AddOnWrapperParams);
8
8
  apply(application: INestApplication<T>): void;
9
+ private appendImplementations;
9
10
  }
10
11
  //# sourceMappingURL=add-on.wrapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-on.wrapper.d.ts","sourceRoot":"","sources":["../../../../../packages/back-end/src/add-ons/add-on.wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG7C,qBAAa,YAAY,CAAC,CAAC,CAAE,YAAW,MAAM,CAAC,CAAC,CAAC;IAIzC,OAAO,CAAC,MAAM;IAHlB,OAAO,CAAC,eAAe,CAAc;gBAGzB,MAAM,EAAE,kBAAkB;IAQtC,KAAK,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI;CAKhD"}
1
+ {"version":3,"file":"add-on.wrapper.d.ts","sourceRoot":"","sources":["../../../../../packages/back-end/src/add-ons/add-on.wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAK7C,qBAAa,YAAY,CAAC,CAAC,CAAE,YAAW,MAAM,CAAC,CAAC,CAAC;IAMzC,OAAO,CAAC,MAAM;IALlB,OAAO,CAAC,eAAe,CAErB;gBAGU,MAAM,EAAE,kBAAkB;IAKtC,KAAK,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI;IAM7C,OAAO,CAAC,qBAAqB;CAShC"}
@@ -1,22 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AddOnWrapper = void 0;
4
- const swagger_add_on_1 = require("./implementations/swagger/swagger.add-on");
5
4
  const security_add_on_1 = require("./implementations/security/security.add-on");
5
+ const swagger_add_on_1 = require("./implementations/swagger/swagger.add-on");
6
+ const sentry_add_on_1 = require("./implementations/sentry/sentry.add-on");
6
7
  class AddOnWrapper {
7
8
  params;
8
- implementations;
9
+ implementations = [
10
+ new security_add_on_1.SecurityAddOn()
11
+ ];
9
12
  constructor(params) {
10
13
  this.params = params;
11
- this.implementations = [
12
- new swagger_add_on_1.SwaggerAddon(this.params.swagger),
13
- new security_add_on_1.SecurityAddOn()
14
- ];
14
+ this.appendImplementations();
15
15
  }
16
16
  apply(application) {
17
17
  this.implementations.forEach((addOn) => {
18
18
  addOn.apply(application);
19
19
  });
20
20
  }
21
+ appendImplementations() {
22
+ const { sentry, swagger } = this.params;
23
+ if (swagger) {
24
+ this.implementations.push(new swagger_add_on_1.SwaggerAddon(swagger));
25
+ }
26
+ if (sentry) {
27
+ this.implementations.push(new sentry_add_on_1.SentryAddon(sentry));
28
+ }
29
+ }
21
30
  }
22
31
  exports.AddOnWrapper = AddOnWrapper;
@@ -1,5 +1,7 @@
1
+ import { ISentryAddOnState } from "./implementations/sentry/sentry.add-on.state.interface";
1
2
  import { ISwaggerAddOnState } from "./implementations/swagger/swagger.add-on.state.interface";
2
- export type AddOnWrapperParams = {
3
+ export type AddOnWrapperParams = Partial<{
3
4
  swagger: ISwaggerAddOnState;
4
- };
5
+ sentry: ISentryAddOnState;
6
+ }>;
5
7
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../packages/back-end/src/add-ons/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAA;AAE7F,MAAM,MAAM,kBAAkB,GAAG;IAC7B,OAAO,EAAE,kBAAkB,CAAC;CAC/B,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../packages/back-end/src/add-ons/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AAE9F,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC;IACrC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,MAAM,EAAE,iBAAiB,CAAC;CAC7B,CAAC,CAAC"}