@dismissible/nestjs-api 0.0.2-canary.8976e84.0 → 0.0.2-canary.a611bd3.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.

Potentially problematic release.


This version of @dismissible/nestjs-api might be problematic. Click here for more details.

Files changed (98) hide show
  1. package/config/.env.yaml +34 -1
  2. package/package.json +32 -22
  3. package/src/app-test.factory.d.ts +9 -0
  4. package/src/app-test.factory.js +30 -0
  5. package/src/app-test.factory.js.map +1 -0
  6. package/src/app.module.d.ts +19 -0
  7. package/src/app.module.js +54 -0
  8. package/src/app.module.js.map +1 -0
  9. package/src/app.setup.d.ts +2 -0
  10. package/src/app.setup.js +49 -0
  11. package/src/app.setup.js.map +1 -0
  12. package/src/bootstrap.d.ts +9 -0
  13. package/src/bootstrap.js +19 -0
  14. package/src/bootstrap.js.map +1 -0
  15. package/src/config/app.config.d.ts +9 -0
  16. package/src/config/app.config.js +29 -0
  17. package/src/config/app.config.js.map +1 -0
  18. package/src/config/config.module.d.ts +25 -0
  19. package/src/config/config.module.js +40 -0
  20. package/src/config/config.module.js.map +1 -0
  21. package/src/config/default-app.config.d.ts +10 -0
  22. package/src/config/default-app.config.js +34 -0
  23. package/src/config/default-app.config.js.map +1 -0
  24. package/src/config/index.js +6 -0
  25. package/src/config/index.js.map +1 -0
  26. package/src/cors/cors.config.d.ts +8 -0
  27. package/src/cors/cors.config.js +49 -0
  28. package/src/cors/cors.config.js.map +1 -0
  29. package/src/cors/index.d.ts +1 -0
  30. package/src/cors/index.js +5 -0
  31. package/src/cors/index.js.map +1 -0
  32. package/src/health/health.controller.d.ts +6 -0
  33. package/src/health/health.controller.js +25 -0
  34. package/src/health/health.controller.js.map +1 -0
  35. package/src/health/health.module.d.ts +2 -0
  36. package/src/health/health.module.js +17 -0
  37. package/src/health/health.module.js.map +1 -0
  38. package/src/health/{index.ts → index.d.ts} +0 -1
  39. package/src/health/index.js +6 -0
  40. package/src/health/index.js.map +1 -0
  41. package/src/helmet/helmet.config.d.ts +34 -0
  42. package/src/helmet/helmet.config.js +49 -0
  43. package/src/helmet/helmet.config.js.map +1 -0
  44. package/src/helmet/index.d.ts +1 -0
  45. package/src/helmet/index.js +5 -0
  46. package/src/helmet/index.js.map +1 -0
  47. package/src/index.js +9 -0
  48. package/src/index.js.map +1 -0
  49. package/src/main.d.ts +1 -0
  50. package/src/main.js +5 -0
  51. package/src/main.js.map +1 -0
  52. package/src/server/index.js +5 -0
  53. package/src/server/index.js.map +1 -0
  54. package/src/server/server.config.d.ts +3 -0
  55. package/src/server/server.config.js +15 -0
  56. package/src/server/server.config.js.map +1 -0
  57. package/src/swagger/index.js +6 -0
  58. package/src/swagger/index.js.map +1 -0
  59. package/src/swagger/swagger.config.d.ts +4 -0
  60. package/src/swagger/swagger.config.js +20 -0
  61. package/src/swagger/swagger.config.js.map +1 -0
  62. package/src/swagger/swagger.factory.d.ts +3 -0
  63. package/src/swagger/swagger.factory.js +22 -0
  64. package/src/swagger/swagger.factory.js.map +1 -0
  65. package/src/validation/index.d.ts +1 -0
  66. package/src/validation/index.js +5 -0
  67. package/src/validation/index.js.map +1 -0
  68. package/src/validation/validation.config.d.ts +29 -0
  69. package/src/validation/validation.config.js +38 -0
  70. package/src/validation/validation.config.js.map +1 -0
  71. package/jest.config.ts +0 -13
  72. package/jest.e2e-config.ts +0 -12
  73. package/nest-cli.json +0 -16
  74. package/project.json +0 -91
  75. package/src/app-test.factory.ts +0 -32
  76. package/src/app.e2e-spec.ts +0 -221
  77. package/src/app.module.ts +0 -48
  78. package/src/app.setup.ts +0 -17
  79. package/src/bootstrap.ts +0 -24
  80. package/src/config/app.config.ts +0 -15
  81. package/src/config/config.module.spec.ts +0 -96
  82. package/src/config/config.module.ts +0 -50
  83. package/src/config/default-app.config.ts +0 -9
  84. package/src/health/health.controller.spec.ts +0 -48
  85. package/src/health/health.controller.ts +0 -17
  86. package/src/health/health.module.ts +0 -10
  87. package/src/health/health.service.spec.ts +0 -46
  88. package/src/health/health.service.ts +0 -16
  89. package/src/main.ts +0 -3
  90. package/src/server/server.config.ts +0 -8
  91. package/src/swagger/swagger.config.ts +0 -20
  92. package/src/swagger/swagger.factory.ts +0 -25
  93. package/tsconfig.app.json +0 -13
  94. package/tsconfig.json +0 -13
  95. /package/src/config/{index.ts → index.d.ts} +0 -0
  96. /package/src/{index.ts → index.d.ts} +0 -0
  97. /package/src/server/{index.ts → index.d.ts} +0 -0
  98. /package/src/swagger/{index.ts → index.d.ts} +0 -0
@@ -0,0 +1,2 @@
1
+ export declare class HealthModule {
2
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HealthModule = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const health_controller_1 = require("./health.controller");
7
+ let HealthModule = class HealthModule {
8
+ };
9
+ exports.HealthModule = HealthModule;
10
+ exports.HealthModule = HealthModule = tslib_1.__decorate([
11
+ (0, common_1.Module)({
12
+ controllers: [health_controller_1.HealthController],
13
+ providers: [],
14
+ exports: [],
15
+ })
16
+ ], HealthModule);
17
+ //# sourceMappingURL=health.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.module.js","sourceRoot":"","sources":["../../../../api/src/health/health.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,2DAAuD;AAOhD,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IALxB,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,oCAAgB,CAAC;QAC/B,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;KACZ,CAAC;GACW,YAAY,CAAG"}
@@ -1,3 +1,2 @@
1
1
  export * from './health.module';
2
2
  export * from './health.controller';
3
- export * from './health.service';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./health.module"), exports);
5
+ tslib_1.__exportStar(require("./health.controller"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../api/src/health/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,8DAAoC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @see https://helmetjs.github.io/
3
+ */
4
+ export declare class HelmetConfig {
5
+ /**
6
+ * Whether to enable Helmet middleware
7
+ */
8
+ readonly enabled: boolean;
9
+ /**
10
+ * Whether to enable Content-Security-Policy header.
11
+ * @default true
12
+ */
13
+ readonly contentSecurityPolicy?: boolean;
14
+ /**
15
+ * Whether to enable Cross-Origin-Embedder-Policy header.
16
+ * @default true
17
+ */
18
+ readonly crossOriginEmbedderPolicy?: boolean;
19
+ /**
20
+ * HSTS max-age in seconds.
21
+ * @default 31536000 (1 year)
22
+ */
23
+ readonly hstsMaxAge?: number;
24
+ /**
25
+ * Whether to include subdomains in HSTS header.
26
+ * @default true
27
+ */
28
+ readonly hstsIncludeSubDomains?: boolean;
29
+ /**
30
+ * Whether to add HSTS preload directive.
31
+ * @default false
32
+ */
33
+ readonly hstsPreload?: boolean;
34
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HelmetConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const class_validator_1 = require("class-validator");
6
+ const class_transformer_1 = require("class-transformer");
7
+ const nestjs_validation_1 = require("@dismissible/nestjs-validation");
8
+ /**
9
+ * @see https://helmetjs.github.io/
10
+ */
11
+ class HelmetConfig {
12
+ }
13
+ exports.HelmetConfig = HelmetConfig;
14
+ tslib_1.__decorate([
15
+ (0, class_validator_1.IsBoolean)(),
16
+ (0, nestjs_validation_1.TransformBoolean)(),
17
+ tslib_1.__metadata("design:type", Boolean)
18
+ ], HelmetConfig.prototype, "enabled", void 0);
19
+ tslib_1.__decorate([
20
+ (0, class_validator_1.IsBoolean)(),
21
+ (0, class_validator_1.IsOptional)(),
22
+ (0, nestjs_validation_1.TransformBoolean)(),
23
+ tslib_1.__metadata("design:type", Boolean)
24
+ ], HelmetConfig.prototype, "contentSecurityPolicy", void 0);
25
+ tslib_1.__decorate([
26
+ (0, class_validator_1.IsBoolean)(),
27
+ (0, class_validator_1.IsOptional)(),
28
+ (0, nestjs_validation_1.TransformBoolean)(),
29
+ tslib_1.__metadata("design:type", Boolean)
30
+ ], HelmetConfig.prototype, "crossOriginEmbedderPolicy", void 0);
31
+ tslib_1.__decorate([
32
+ (0, class_validator_1.IsNumber)(),
33
+ (0, class_validator_1.IsOptional)(),
34
+ (0, class_transformer_1.Type)(() => Number),
35
+ tslib_1.__metadata("design:type", Number)
36
+ ], HelmetConfig.prototype, "hstsMaxAge", void 0);
37
+ tslib_1.__decorate([
38
+ (0, class_validator_1.IsBoolean)(),
39
+ (0, class_validator_1.IsOptional)(),
40
+ (0, nestjs_validation_1.TransformBoolean)(),
41
+ tslib_1.__metadata("design:type", Boolean)
42
+ ], HelmetConfig.prototype, "hstsIncludeSubDomains", void 0);
43
+ tslib_1.__decorate([
44
+ (0, class_validator_1.IsBoolean)(),
45
+ (0, class_validator_1.IsOptional)(),
46
+ (0, nestjs_validation_1.TransformBoolean)(),
47
+ tslib_1.__metadata("design:type", Boolean)
48
+ ], HelmetConfig.prototype, "hstsPreload", void 0);
49
+ //# sourceMappingURL=helmet.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helmet.config.js","sourceRoot":"","sources":["../../../../api/src/helmet/helmet.config.ts"],"names":[],"mappings":";;;;AAAA,qDAAkE;AAClE,yDAAyC;AACzC,sEAAkE;AAElE;;GAEG;AACH,MAAa,YAAY;CAoDxB;AApDD,oCAoDC;AA9CiB;IAFf,IAAA,2BAAS,GAAE;IACX,IAAA,oCAAgB,GAAE;;6CACe;AASlB;IAHf,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;IACZ,IAAA,oCAAgB,GAAE;;2DAC6B;AAShC;IAHf,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;IACZ,IAAA,oCAAgB,GAAE;;+DACiC;AASpC;IAHf,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;gDACiB;AASpB;IAHf,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;IACZ,IAAA,oCAAgB,GAAE;;2DAC6B;AAShC;IAHf,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;IACZ,IAAA,oCAAgB,GAAE;;iDACmB"}
@@ -0,0 +1 @@
1
+ export * from './helmet.config';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./helmet.config"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../api/src/helmet/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC"}
package/src/index.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./config"), exports);
5
+ tslib_1.__exportStar(require("./server"), exports);
6
+ tslib_1.__exportStar(require("./bootstrap"), exports);
7
+ tslib_1.__exportStar(require("./app.module"), exports);
8
+ tslib_1.__exportStar(require("./app.setup"), exports);
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,mDAAyB;AACzB,sDAA4B;AAC5B,uDAA6B;AAC7B,sDAA4B"}
package/src/main.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/src/main.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const bootstrap_1 = require("./bootstrap");
4
+ (0, bootstrap_1.bootstrap)();
5
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../../api/src/main.ts"],"names":[],"mappings":";;AAAA,2CAAwC;AAExC,IAAA,qBAAS,GAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./server.config"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../api/src/server/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC"}
@@ -0,0 +1,3 @@
1
+ export declare class ServerConfig {
2
+ readonly port: number;
3
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServerConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const class_validator_1 = require("class-validator");
6
+ const class_transformer_1 = require("class-transformer");
7
+ class ServerConfig {
8
+ }
9
+ exports.ServerConfig = ServerConfig;
10
+ tslib_1.__decorate([
11
+ (0, class_validator_1.IsNumber)(),
12
+ (0, class_transformer_1.Type)(() => Number),
13
+ tslib_1.__metadata("design:type", Number)
14
+ ], ServerConfig.prototype, "port", void 0);
15
+ //# sourceMappingURL=server.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.config.js","sourceRoot":"","sources":["../../../../api/src/server/server.config.ts"],"names":[],"mappings":";;;;AAAA,qDAA2C;AAC3C,yDAAyC;AAEzC,MAAa,YAAY;CAIxB;AAJD,oCAIC;AADiB;IAFf,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;0CACW"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./swagger.factory"), exports);
5
+ tslib_1.__exportStar(require("./swagger.config"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../api/src/swagger/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,2DAAiC"}
@@ -0,0 +1,4 @@
1
+ export declare class SwaggerConfig {
2
+ readonly enabled: boolean;
3
+ readonly path?: string;
4
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SwaggerConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const class_validator_1 = require("class-validator");
6
+ const nestjs_validation_1 = require("@dismissible/nestjs-validation");
7
+ class SwaggerConfig {
8
+ }
9
+ exports.SwaggerConfig = SwaggerConfig;
10
+ tslib_1.__decorate([
11
+ (0, class_validator_1.IsBoolean)(),
12
+ (0, nestjs_validation_1.TransformBoolean)(),
13
+ tslib_1.__metadata("design:type", Boolean)
14
+ ], SwaggerConfig.prototype, "enabled", void 0);
15
+ tslib_1.__decorate([
16
+ (0, class_validator_1.IsString)(),
17
+ (0, class_validator_1.IsOptional)(),
18
+ tslib_1.__metadata("design:type", String)
19
+ ], SwaggerConfig.prototype, "path", void 0);
20
+ //# sourceMappingURL=swagger.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swagger.config.js","sourceRoot":"","sources":["../../../../api/src/swagger/swagger.config.ts"],"names":[],"mappings":";;;;AAAA,qDAAkE;AAClE,sEAAkE;AAElE,MAAa,aAAa;CAQzB;AARD,sCAQC;AALiB;IAFf,IAAA,2BAAS,GAAE;IACX,IAAA,oCAAgB,GAAE;;8CACe;AAIlB;IAFf,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;2CACiB"}
@@ -0,0 +1,3 @@
1
+ import { INestApplication } from '@nestjs/common';
2
+ import { SwaggerConfig } from './swagger.config';
3
+ export declare function configureAppWithSwagger(app: INestApplication, swaggerConfig: SwaggerConfig): void;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.configureAppWithSwagger = configureAppWithSwagger;
4
+ const swagger_1 = require("@nestjs/swagger");
5
+ const swaggerDocumentOptions = {
6
+ operationIdFactory: (_controllerKey, methodKey) => methodKey,
7
+ };
8
+ function configureAppWithSwagger(app, swaggerConfig) {
9
+ if (swaggerConfig.enabled) {
10
+ const { path = 'docs' } = swaggerConfig;
11
+ const config = new swagger_1.DocumentBuilder()
12
+ .setTitle('Dismissible')
13
+ .setDescription('An API to handle dismissible items for users')
14
+ .setVersion('1.0')
15
+ .build();
16
+ const documentFactory = () => swagger_1.SwaggerModule.createDocument(app, config, swaggerDocumentOptions);
17
+ swagger_1.SwaggerModule.setup(path, app, documentFactory, {
18
+ useGlobalPrefix: true,
19
+ });
20
+ }
21
+ }
22
+ //# sourceMappingURL=swagger.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swagger.factory.js","sourceRoot":"","sources":["../../../../api/src/swagger/swagger.factory.ts"],"names":[],"mappings":";;AAQA,0DAeC;AAtBD,6CAAyF;AAGzF,MAAM,sBAAsB,GAA2B;IACrD,kBAAkB,EAAE,CAAC,cAAsB,EAAE,SAAiB,EAAE,EAAE,CAAC,SAAS;CAC7E,CAAC;AAEF,SAAgB,uBAAuB,CAAC,GAAqB,EAAE,aAA4B;IACzF,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC;QAC1B,MAAM,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,aAAa,CAAC;QAExC,MAAM,MAAM,GAAG,IAAI,yBAAe,EAAE;aACjC,QAAQ,CAAC,aAAa,CAAC;aACvB,cAAc,CAAC,8CAA8C,CAAC;aAC9D,UAAU,CAAC,KAAK,CAAC;aACjB,KAAK,EAAE,CAAC;QAEX,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,uBAAa,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,sBAAsB,CAAC,CAAC;QAChG,uBAAa,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,eAAe,EAAE;YAC9C,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './validation.config';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./validation.config"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../api/src/validation/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Configuration for NestJS ValidationPipe
3
+ * @see https://docs.nestjs.com/techniques/validation
4
+ */
5
+ export declare class ValidationConfig {
6
+ /**
7
+ * Whether to disable error messages in validation responses.
8
+ * Should be true in production to prevent information disclosure.
9
+ * @default true in production, false in development
10
+ */
11
+ readonly disableErrorMessages?: boolean;
12
+ /**
13
+ * If set to true, validator will strip validated (returned) object of any properties
14
+ * that do not use any validation decorators.
15
+ * @default true
16
+ */
17
+ readonly whitelist?: boolean;
18
+ /**
19
+ * If set to true, instead of stripping non-whitelisted properties,
20
+ * validator will throw an error.
21
+ * @default true
22
+ */
23
+ readonly forbidNonWhitelisted?: boolean;
24
+ /**
25
+ * If set to true, class-transformer will attempt transformation based on TS reflected type.
26
+ * @default true
27
+ */
28
+ readonly transform?: boolean;
29
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValidationConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const class_validator_1 = require("class-validator");
6
+ const nestjs_validation_1 = require("@dismissible/nestjs-validation");
7
+ /**
8
+ * Configuration for NestJS ValidationPipe
9
+ * @see https://docs.nestjs.com/techniques/validation
10
+ */
11
+ class ValidationConfig {
12
+ }
13
+ exports.ValidationConfig = ValidationConfig;
14
+ tslib_1.__decorate([
15
+ (0, class_validator_1.IsBoolean)(),
16
+ (0, class_validator_1.IsOptional)(),
17
+ (0, nestjs_validation_1.TransformBoolean)(),
18
+ tslib_1.__metadata("design:type", Boolean)
19
+ ], ValidationConfig.prototype, "disableErrorMessages", void 0);
20
+ tslib_1.__decorate([
21
+ (0, class_validator_1.IsBoolean)(),
22
+ (0, class_validator_1.IsOptional)(),
23
+ (0, nestjs_validation_1.TransformBoolean)(),
24
+ tslib_1.__metadata("design:type", Boolean)
25
+ ], ValidationConfig.prototype, "whitelist", void 0);
26
+ tslib_1.__decorate([
27
+ (0, class_validator_1.IsBoolean)(),
28
+ (0, class_validator_1.IsOptional)(),
29
+ (0, nestjs_validation_1.TransformBoolean)(),
30
+ tslib_1.__metadata("design:type", Boolean)
31
+ ], ValidationConfig.prototype, "forbidNonWhitelisted", void 0);
32
+ tslib_1.__decorate([
33
+ (0, class_validator_1.IsBoolean)(),
34
+ (0, class_validator_1.IsOptional)(),
35
+ (0, nestjs_validation_1.TransformBoolean)(),
36
+ tslib_1.__metadata("design:type", Boolean)
37
+ ], ValidationConfig.prototype, "transform", void 0);
38
+ //# sourceMappingURL=validation.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.config.js","sourceRoot":"","sources":["../../../../api/src/validation/validation.config.ts"],"names":[],"mappings":";;;;AAAA,qDAAwD;AACxD,sEAAkE;AAElE;;;GAGG;AACH,MAAa,gBAAgB;CAuC5B;AAvCD,4CAuCC;AA9BiB;IAHf,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;IACZ,IAAA,oCAAgB,GAAE;;8DAC4B;AAU/B;IAHf,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;IACZ,IAAA,oCAAgB,GAAE;;mDACiB;AAUpB;IAHf,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;IACZ,IAAA,oCAAgB,GAAE;;8DAC4B;AAS/B;IAHf,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;IACZ,IAAA,oCAAgB,GAAE;;mDACiB"}
package/jest.config.ts DELETED
@@ -1,13 +0,0 @@
1
- export default {
2
- displayName: 'api',
3
- preset: '../jest.preset.js',
4
- testEnvironment: 'node',
5
- transform: {
6
- '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.json' }],
7
- },
8
- moduleFileExtensions: ['ts', 'js', 'html'],
9
- coverageDirectory: '../coverage/api',
10
- testMatch: ['**/*.spec.ts'],
11
- testPathIgnorePatterns: ['\\.e2e-spec\\.ts$'],
12
- transformIgnorePatterns: ['node_modules/(?!(nest-typed-config|uuid)/)'],
13
- };
@@ -1,12 +0,0 @@
1
- export default {
2
- displayName: 'api-e2e',
3
- preset: '../jest.preset.js',
4
- testEnvironment: 'node',
5
- transform: {
6
- '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.json' }],
7
- },
8
- moduleFileExtensions: ['ts', 'js', 'html'],
9
- coverageDirectory: '../coverage/api-e2e',
10
- testMatch: ['**/*.e2e-spec.ts'],
11
- transformIgnorePatterns: ['node_modules/(?!(nest-typed-config|uuid)/)'],
12
- };
package/nest-cli.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/nest-cli",
3
- "collection": "@nestjs/schematics",
4
- "sourceRoot": "src",
5
- "compilerOptions": {
6
- "deleteOutDir": true,
7
- "tsConfigPath": "tsconfig.app.json",
8
- "assets": [
9
- {
10
- "include": "../config/**/*.yaml",
11
- "outDir": "../dist/api/config",
12
- "watchAssets": true
13
- }
14
- ]
15
- }
16
- }
package/project.json DELETED
@@ -1,91 +0,0 @@
1
- {
2
- "name": "api",
3
- "$schema": "../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "api/src",
5
- "projectType": "application",
6
- "tags": [],
7
- "targets": {
8
- "build": {
9
- "executor": "@nx/js:tsc",
10
- "outputs": ["{options.outputPath}"],
11
- "dependsOn": ["^build"],
12
- "options": {
13
- "outputPath": "dist/api",
14
- "main": "api/src/main.ts",
15
- "tsConfig": "api/tsconfig.app.json",
16
- "assets": [
17
- {
18
- "input": "api/config",
19
- "glob": "**/*.yaml",
20
- "output": "config"
21
- }
22
- ],
23
- "generatePackageJson": true
24
- }
25
- },
26
- "serve": {
27
- "executor": "@nx/js:node",
28
- "options": {
29
- "buildTarget": "api:build",
30
- "runBuildTargetDependencies": true,
31
- "watch": true
32
- },
33
- "configurations": {
34
- "development": {
35
- "buildTarget": "api:build"
36
- },
37
- "production": {
38
- "buildTarget": "api:build"
39
- }
40
- },
41
- "defaultConfiguration": "development"
42
- },
43
- "lint": {
44
- "executor": "@nx/eslint:lint",
45
- "outputs": ["{options.outputFile}"],
46
- "options": {
47
- "lintFilePatterns": ["api/**/*.ts"]
48
- }
49
- },
50
- "test": {
51
- "executor": "@nx/jest:jest",
52
- "outputs": ["{workspaceRoot}/coverage/api"],
53
- "options": {
54
- "jestConfig": "api/jest.config.ts",
55
- "passWithNoTests": true
56
- }
57
- },
58
- "test-e2e": {
59
- "executor": "@nx/jest:jest",
60
- "outputs": ["{workspaceRoot}/coverage/api-e2e"],
61
- "options": {
62
- "jestConfig": "api/jest.e2e-config.ts"
63
- }
64
- },
65
- "prisma:generate": {
66
- "executor": "nx:run-commands",
67
- "options": {
68
- "command": "npx prisma generate --schema=libs/postgres-storage/prisma/schema.prisma"
69
- }
70
- },
71
- "prisma:migrate": {
72
- "executor": "nx:run-commands",
73
- "options": {
74
- "command": "npx prisma migrate dev --schema=libs/postgres-storage/prisma/schema.prisma"
75
- }
76
- },
77
- "prisma:push": {
78
- "executor": "nx:run-commands",
79
- "options": {
80
- "command": "npx prisma db push --schema=libs/postgres-storage/prisma/schema.prisma"
81
- }
82
- },
83
- "npm-publish": {
84
- "executor": "nx:run-commands",
85
- "options": {
86
- "command": "npm publish --access public",
87
- "cwd": "dist/api"
88
- }
89
- }
90
- }
91
- }
@@ -1,32 +0,0 @@
1
- import { Test, TestingModuleBuilder } from '@nestjs/testing';
2
- import { INestApplication } from '@nestjs/common';
3
- import { AppModule, AppModuleOptions } from './app.module';
4
- import { configureApp } from './app.setup';
5
- import { PrismaService } from '@dismissible/nestjs-postgres-storage';
6
-
7
- export type TestAppOptions = {
8
- moduleOptions?: AppModuleOptions;
9
- customize?: (builder: TestingModuleBuilder) => TestingModuleBuilder;
10
- };
11
-
12
- export async function createTestApp(options?: TestAppOptions): Promise<INestApplication> {
13
- let builder = Test.createTestingModule({
14
- imports: [AppModule.forRoot(options?.moduleOptions)],
15
- });
16
-
17
- if (options?.customize) {
18
- builder = options.customize(builder);
19
- }
20
-
21
- const moduleFixture = await builder.compile();
22
- const app = moduleFixture.createNestApplication();
23
- await configureApp(app);
24
- await app.init();
25
-
26
- return app;
27
- }
28
-
29
- export async function cleanupTestData(app: INestApplication): Promise<void> {
30
- const prisma = app.get(PrismaService);
31
- await prisma.dismissibleItem.deleteMany({});
32
- }