@ask-ell/back-end 0.0.4 → 0.0.6
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 +1 -1
- package/src/add-ons/add-on.wrapper.d.ts +1 -0
- package/src/add-ons/add-on.wrapper.d.ts.map +1 -1
- package/src/add-ons/add-on.wrapper.js +15 -6
- package/src/add-ons/types.d.ts +4 -2
- package/src/add-ons/types.d.ts.map +1 -1
- package/src/requirement.module.d.ts.map +1 -1
- package/src/requirement.module.js +12 -4
package/package.json
CHANGED
|
@@ -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;
|
|
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.
|
|
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;
|
package/src/add-ons/types.d.ts
CHANGED
|
@@ -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,
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requirement.module.d.ts","sourceRoot":"","sources":["../../../../packages/back-end/src/requirement.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"requirement.module.d.ts","sourceRoot":"","sources":["../../../../packages/back-end/src/requirement.module.ts"],"names":[],"mappings":"AAcA,qBA0Ca,iBAAiB;CAAI"}
|
|
@@ -8,12 +8,14 @@ const core_1 = require("@nestjs/core");
|
|
|
8
8
|
const throttler_1 = require("@nestjs/throttler");
|
|
9
9
|
const ask_1 = require("@ask-ell/ask");
|
|
10
10
|
const nest_1 = require("@ask-ell/nest");
|
|
11
|
+
const setup_1 = require("@sentry/nestjs/setup");
|
|
11
12
|
const keyv_store_adapter_factory_1 = require("./keyv.store.adapter.factory");
|
|
12
|
-
const
|
|
13
|
+
const logger = new nest_1.NestLogger("Requirements");
|
|
13
14
|
let RequirementModule = (() => {
|
|
14
15
|
let _classDecorators = [(0, common_1.Global)(), (0, common_1.Module)({
|
|
15
16
|
imports: [
|
|
16
17
|
nest_1.HealthModule,
|
|
18
|
+
setup_1.SentryModule.forRoot(),
|
|
17
19
|
throttler_1.ThrottlerModule.forRoot([{
|
|
18
20
|
ttl: 60000,
|
|
19
21
|
limit: 30,
|
|
@@ -21,8 +23,8 @@ let RequirementModule = (() => {
|
|
|
21
23
|
config_1.ConfigModule.forRoot({
|
|
22
24
|
isGlobal: true,
|
|
23
25
|
load: [
|
|
24
|
-
(0, ask_1.askDockerSecretsFactory)(
|
|
25
|
-
(0, ask_1.askLocalSecretsFactory)(
|
|
26
|
+
(0, ask_1.askDockerSecretsFactory)(logger),
|
|
27
|
+
(0, ask_1.askLocalSecretsFactory)(logger)
|
|
26
28
|
]
|
|
27
29
|
})
|
|
28
30
|
],
|
|
@@ -39,10 +41,16 @@ let RequirementModule = (() => {
|
|
|
39
41
|
{
|
|
40
42
|
provide: core_1.APP_FILTER,
|
|
41
43
|
useClass: nest_1.HttpExceptionFilter
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
provide: core_1.APP_FILTER,
|
|
47
|
+
useClass: setup_1.SentryGlobalFilter
|
|
42
48
|
}
|
|
43
49
|
],
|
|
44
50
|
exports: [
|
|
45
|
-
config_1.ConfigModule
|
|
51
|
+
config_1.ConfigModule,
|
|
52
|
+
setup_1.SentryModule,
|
|
53
|
+
keyv_store_adapter_factory_1.KeyvStoreAdapterFactory
|
|
46
54
|
]
|
|
47
55
|
})];
|
|
48
56
|
let _classDescriptor;
|