itlab-internal-services 2.2.1 → 2.3.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.
Files changed (144) hide show
  1. package/dist/env.d.ts +14 -0
  2. package/dist/env.js +14 -0
  3. package/dist/exceptions/bad-body.exception.d.ts +14 -0
  4. package/dist/exceptions/bad-body.exception.js +16 -0
  5. package/dist/exceptions/duplicate.exception.d.ts +14 -0
  6. package/dist/exceptions/duplicate.exception.js +16 -0
  7. package/dist/exceptions/index.d.ts +11 -0
  8. package/dist/exceptions/index.js +11 -0
  9. package/dist/exceptions/not-found.exception.d.ts +14 -0
  10. package/dist/exceptions/not-found.exception.js +16 -0
  11. package/dist/favicon.controller.d.ts +12 -0
  12. package/dist/favicon.controller.js +13 -0
  13. package/dist/guards/perms.guard.d.ts +28 -0
  14. package/dist/guards/perms.guard.js +40 -2
  15. package/dist/guards/puplic.guard.d.ts +5 -0
  16. package/dist/guards/puplic.guard.js +5 -0
  17. package/dist/http.logger.d.ts +6 -0
  18. package/dist/http.logger.js +9 -1
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +2 -0
  21. package/dist/interceptors/errors.interceptor.d.ts +33 -1
  22. package/dist/interceptors/errors.interceptor.js +41 -3
  23. package/dist/liveness.probe.d.ts +12 -2
  24. package/dist/liveness.probe.js +15 -13
  25. package/dist/models/content.d.ts +8 -0
  26. package/dist/models/content.js +21 -0
  27. package/dist/models/filter/index.d.ts +49 -0
  28. package/dist/models/filter/index.js +88 -0
  29. package/dist/models/filter/limit.property.d.ts +4 -0
  30. package/dist/models/filter/limit.property.js +11 -0
  31. package/dist/models/filter/skip.property.d.ts +4 -0
  32. package/dist/models/filter/skip.property.js +16 -0
  33. package/dist/models/filter/sort-direction.property.d.ts +4 -0
  34. package/dist/models/filter/sort-direction.property.js +16 -0
  35. package/dist/models/filter/sort-field.property.d.ts +4 -0
  36. package/dist/models/filter/sort-field.property.js +17 -0
  37. package/dist/models/index.d.ts +4 -0
  38. package/dist/models/index.js +20 -0
  39. package/dist/models/search-result.d.ts +14 -0
  40. package/dist/models/search-result.js +32 -0
  41. package/dist/models/thumbnail/alt.property.d.ts +8 -0
  42. package/dist/models/thumbnail/alt.property.js +18 -0
  43. package/dist/models/thumbnail/background.property.d.ts +8 -0
  44. package/dist/models/thumbnail/background.property.js +27 -0
  45. package/dist/models/thumbnail/contain.property.d.ts +8 -0
  46. package/dist/models/thumbnail/contain.property.js +18 -0
  47. package/dist/models/thumbnail/index.d.ts +30 -0
  48. package/dist/models/thumbnail/index.js +68 -0
  49. package/dist/models/thumbnail/max-height.property.d.ts +8 -0
  50. package/dist/models/thumbnail/max-height.property.js +20 -0
  51. package/dist/models/thumbnail/src.property.d.ts +8 -0
  52. package/dist/models/thumbnail/src.property.js +21 -0
  53. package/dist/modules/authentication/authentication.module.d.ts +14 -0
  54. package/dist/modules/authentication/authentication.module.js +10 -0
  55. package/dist/modules/authentication/internal/internal.constants.d.ts +4 -0
  56. package/dist/modules/authentication/internal/internal.constants.js +4 -0
  57. package/dist/modules/authentication/internal/internal.decorators.d.ts +4 -0
  58. package/dist/modules/authentication/internal/internal.decorators.js +4 -0
  59. package/dist/modules/authentication/internal/internal.guard.d.ts +5 -0
  60. package/dist/modules/authentication/internal/internal.guard.js +5 -0
  61. package/dist/modules/authentication/internal/internal.strategy.d.ts +17 -0
  62. package/dist/modules/authentication/internal/internal.strategy.js +17 -0
  63. package/dist/modules/authentication/jwt/jwt.constants.d.ts +20 -0
  64. package/dist/modules/authentication/jwt/jwt.constants.js +12 -0
  65. package/dist/modules/authentication/jwt/jwt.decorators.d.ts +15 -3
  66. package/dist/modules/authentication/jwt/jwt.decorators.js +16 -7
  67. package/dist/modules/authentication/jwt/jwt.guard.d.ts +15 -0
  68. package/dist/modules/authentication/jwt/jwt.guard.js +17 -0
  69. package/dist/modules/authentication/jwt/jwt.strategy.d.ts +16 -1
  70. package/dist/modules/authentication/jwt/jwt.strategy.js +16 -1
  71. package/dist/modules/database/database.module-options.d.ts +6 -0
  72. package/dist/modules/database/database.module.d.ts +19 -0
  73. package/dist/modules/database/database.module.js +41 -0
  74. package/dist/modules/database/index.js +12 -0
  75. package/dist/modules/database/model-service/model.service.d.ts +29 -0
  76. package/dist/modules/database/model-service/model.service.js +31 -0
  77. package/dist/modules/database/model-service/schemas/hub-account.schemas.d.ts +10 -0
  78. package/dist/modules/database/model-service/schemas/hub-account.schemas.js +7 -0
  79. package/dist/modules/database/model-service/schemas/hub-hackschool.schemas.js +3 -0
  80. package/dist/modules/database/model-service/schemas/hub-tech-radar.schemas.js +2 -0
  81. package/dist/modules/database/populate-service/populate.service.d.ts +35 -0
  82. package/dist/modules/database/populate-service/populate.service.js +35 -0
  83. package/dist/modules/database/service-mapper-service/service-mapper.service.d.ts +23 -0
  84. package/dist/modules/database/service-mapper-service/service-mapper.service.js +23 -0
  85. package/dist/modules/index.d.ts +1 -0
  86. package/dist/modules/index.js +1 -0
  87. package/dist/modules/like/index.d.ts +1 -0
  88. package/dist/modules/like/index.js +8 -0
  89. package/dist/modules/like/like.controller.d.ts +38 -0
  90. package/dist/modules/like/like.controller.js +119 -0
  91. package/dist/modules/like/like.module-options.d.ts +17 -0
  92. package/dist/modules/like/like.module-options.js +17 -0
  93. package/dist/modules/like/like.module.d.ts +18 -0
  94. package/dist/modules/like/like.module.js +45 -0
  95. package/dist/modules/like/like.service.d.ts +48 -0
  96. package/dist/modules/like/like.service.js +107 -0
  97. package/dist/modules/services/account-service/account.service.d.ts +15 -0
  98. package/dist/modules/services/account-service/account.service.js +15 -0
  99. package/dist/modules/services/comment-service/comment-service.definitions.d.ts +11 -0
  100. package/dist/modules/services/comment-service/comment-service.definitions.js +8 -0
  101. package/dist/modules/services/comment-service/comment.service.d.ts +26 -0
  102. package/dist/modules/services/comment-service/comment.service.js +26 -0
  103. package/dist/modules/services/content-service/content.service.d.ts +33 -1
  104. package/dist/modules/services/content-service/content.service.js +34 -2
  105. package/dist/modules/services/index.js +18 -0
  106. package/dist/modules/services/mail-service/mail-service.definitions.d.ts +15 -0
  107. package/dist/modules/services/mail-service/mail-service.definitions.js +6 -0
  108. package/dist/modules/services/mail-service/mail.service.d.ts +31 -0
  109. package/dist/modules/services/mail-service/mail.service.js +31 -0
  110. package/dist/modules/services/search-service/search-service.definitions.d.ts +13 -0
  111. package/dist/modules/services/search-service/search-service.definitions.js +9 -0
  112. package/dist/modules/services/search-service/search.service.d.ts +25 -0
  113. package/dist/modules/services/search-service/search.service.js +25 -0
  114. package/dist/modules/services/services.module-utils.d.ts +9 -0
  115. package/dist/modules/services/services.module-utils.js +5 -0
  116. package/dist/modules/services/services.module.d.ts +17 -0
  117. package/dist/modules/services/services.module.js +9 -0
  118. package/dist/pipes/hid.pipe.d.ts +30 -0
  119. package/dist/pipes/hid.pipe.js +49 -5
  120. package/dist/pipes/id.pipe.d.ts +20 -0
  121. package/dist/pipes/id.pipe.js +40 -4
  122. package/dist/pipes/target.pipe.d.ts +23 -0
  123. package/dist/pipes/target.pipe.js +48 -6
  124. package/dist/swagger.config.d.ts +36 -2
  125. package/dist/swagger.config.js +40 -3
  126. package/dist/transform/_trim.d.ts +7 -0
  127. package/dist/transform/_trim.js +16 -0
  128. package/dist/transform/index.d.ts +6 -0
  129. package/dist/transform/index.js +17 -0
  130. package/dist/transform/transformImage.d.ts +4 -0
  131. package/dist/transform/transformImage.js +16 -0
  132. package/dist/transform/transformString.d.ts +5 -0
  133. package/dist/transform/transformString.js +16 -0
  134. package/dist/transform/transformStringArray.d.ts +6 -0
  135. package/dist/transform/transformStringArray.js +24 -0
  136. package/dist/transform/transformStringLike.d.ts +20 -0
  137. package/dist/transform/transformStringLike.js +37 -0
  138. package/dist/transform/transformStringLowerCase.d.ts +5 -0
  139. package/dist/transform/transformStringLowerCase.js +16 -0
  140. package/dist/transform/transformStringSet.d.ts +6 -0
  141. package/dist/transform/transformStringSet.js +25 -0
  142. package/dist/virtuals.d.ts +43 -0
  143. package/dist/virtuals.js +44 -0
  144. package/package.json +3 -1
@@ -20,33 +20,35 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  step((generator = generator.apply(thisArg, _arguments || [])).next());
21
21
  });
22
22
  };
23
- var __importDefault = (this && this.__importDefault) || function (mod) {
24
- return (mod && mod.__esModule) ? mod : { "default": mod };
25
- };
26
23
  Object.defineProperty(exports, "__esModule", { value: true });
27
24
  exports.LivenessProbe = void 0;
28
25
  const common_1 = require("@nestjs/common");
29
26
  const swagger_1 = require("@nestjs/swagger");
30
- const axios_1 = __importDefault(require("axios"));
31
- const favicon = 'https://file.svi-itlab.com/650d514c58cbe60df3494bc0';
27
+ /**
28
+ * The LivenessProbe controller
29
+ *
30
+ * @class LivenessProbe
31
+ */
32
32
  let LivenessProbe = class LivenessProbe {
33
- constructor() {
34
- this.axios = axios_1.default.create();
35
- }
36
- getFavicon(res) {
33
+ /**
34
+ * A function that handles getting alive status.
35
+ *
36
+ * @param {@Res()} response - the response object
37
+ * @return {Promise<void>} a Promise that resolves to void
38
+ */
39
+ getAlive(response) {
37
40
  return __awaiter(this, void 0, void 0, function* () {
38
- const { data } = yield this.axios.get(favicon, { responseType: 'stream' });
39
- data.pipe(res);
41
+ response.status(200).send({ ok: 1 });
40
42
  });
41
43
  }
42
44
  };
43
45
  __decorate([
44
- (0, common_1.Get)('favicon.ico'),
46
+ (0, common_1.Get)('/alive'),
45
47
  __param(0, (0, common_1.Res)()),
46
48
  __metadata("design:type", Function),
47
49
  __metadata("design:paramtypes", [Object]),
48
50
  __metadata("design:returntype", Promise)
49
- ], LivenessProbe.prototype, "getFavicon", null);
51
+ ], LivenessProbe.prototype, "getAlive", null);
50
52
  LivenessProbe = __decorate([
51
53
  (0, swagger_1.ApiTags)('Kubernetes Liveness Probe'),
52
54
  (0, common_1.Controller)()
@@ -0,0 +1,8 @@
1
+ import { ApiPropertyOptions } from '@nestjs/swagger';
2
+ /**
3
+ * Creates a ContentDecorator with the given options.
4
+ *
5
+ * @param {ApiPropertyOptions} options - the options for the Content
6
+ * @return PropertyDecorator
7
+ */
8
+ export declare const PropertyContent: (options?: ApiPropertyOptions) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PropertyContent = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_transformer_1 = require("class-transformer");
7
+ const class_validator_1 = require("class-validator");
8
+ /**
9
+ * Creates a ContentDecorator with the given options.
10
+ *
11
+ * @param {ApiPropertyOptions} options - the options for the Content
12
+ * @return PropertyDecorator
13
+ */
14
+ const PropertyContent = (options = {}) => (0, common_1.applyDecorators)(
15
+ /** ApiProperty with the given options */
16
+ (0, swagger_1.ApiProperty)(Object.assign({ example: [] }, options)),
17
+ /** Transform the array */
18
+ (0, class_transformer_1.Transform)(({ value }) => ((0, class_validator_1.arrayMinSize)(value, 1) ? value : undefined)),
19
+ /** Check if the length is at least 1 */
20
+ (0, class_validator_1.ArrayMinSize)(1, { message: 'Der Inhalt muss mindestens 1 Element haben' }));
21
+ exports.PropertyContent = PropertyContent;
@@ -0,0 +1,49 @@
1
+ export { PropertyLimit } from './limit.property';
2
+ export { PropertySkip } from './skip.property';
3
+ export { PropertySortDirection } from './sort-direction.property';
4
+ export { PropertySortField } from './sort-field.property';
5
+ /**
6
+ * Represents the filter for skip and limit.
7
+ *
8
+ * @class SkipLimitFilter
9
+ * @property {number} skip - The number of items to skip.
10
+ * @property {number} limit - The maximum number of items to return.
11
+ */
12
+ export declare class SkipLimitFilter {
13
+ /** The number of items to skip. */
14
+ skip?: number;
15
+ /** The maximum number of items to return. */
16
+ limit?: number;
17
+ }
18
+ /**
19
+ * Represents the filter for sort.
20
+ *
21
+ * @class SortFilter
22
+ * @property {string} sortField - The field to sort by.
23
+ * @property {number} sortDirection - The direction to sort in.
24
+ */
25
+ export declare class SortFilter {
26
+ /** The field to sort by. */
27
+ sortField?: string;
28
+ /** The direction to sort in. */
29
+ sortDirection?: 1 | -1;
30
+ }
31
+ /**
32
+ * Represents the filter for skip, limit, sort.
33
+ *
34
+ * @class SkipLimitSortFilter
35
+ * @property {number} skip - The number of items to skip.
36
+ * @property {number} limit - The maximum number of items to return.
37
+ * @property {string} sortField - The field to sort by.
38
+ * @property {number} sortDirection - The direction to sort in.
39
+ */
40
+ export declare class SkipLimitSortFilter {
41
+ /** The number of items to skip. */
42
+ skip?: number;
43
+ /** The maximum number of items to return. */
44
+ limit?: number;
45
+ /** The field to sort by. */
46
+ sortField?: string;
47
+ /** The direction to sort in. */
48
+ sortDirection?: 1 | -1;
49
+ }
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SkipLimitSortFilter = exports.SortFilter = exports.SkipLimitFilter = exports.PropertySortField = exports.PropertySortDirection = exports.PropertySkip = exports.PropertyLimit = void 0;
13
+ const limit_property_1 = require("./limit.property");
14
+ const skip_property_1 = require("./skip.property");
15
+ const sort_direction_property_1 = require("./sort-direction.property");
16
+ const sort_field_property_1 = require("./sort-field.property");
17
+ var limit_property_2 = require("./limit.property");
18
+ Object.defineProperty(exports, "PropertyLimit", { enumerable: true, get: function () { return limit_property_2.PropertyLimit; } });
19
+ var skip_property_2 = require("./skip.property");
20
+ Object.defineProperty(exports, "PropertySkip", { enumerable: true, get: function () { return skip_property_2.PropertySkip; } });
21
+ var sort_direction_property_2 = require("./sort-direction.property");
22
+ Object.defineProperty(exports, "PropertySortDirection", { enumerable: true, get: function () { return sort_direction_property_2.PropertySortDirection; } });
23
+ var sort_field_property_2 = require("./sort-field.property");
24
+ Object.defineProperty(exports, "PropertySortField", { enumerable: true, get: function () { return sort_field_property_2.PropertySortField; } });
25
+ /**
26
+ * Represents the filter for skip and limit.
27
+ *
28
+ * @class SkipLimitFilter
29
+ * @property {number} skip - The number of items to skip.
30
+ * @property {number} limit - The maximum number of items to return.
31
+ */
32
+ class SkipLimitFilter {
33
+ }
34
+ __decorate([
35
+ (0, skip_property_1.PropertySkip)(),
36
+ __metadata("design:type", Number)
37
+ ], SkipLimitFilter.prototype, "skip", void 0);
38
+ __decorate([
39
+ (0, limit_property_1.PropertyLimit)(),
40
+ __metadata("design:type", Number)
41
+ ], SkipLimitFilter.prototype, "limit", void 0);
42
+ exports.SkipLimitFilter = SkipLimitFilter;
43
+ /**
44
+ * Represents the filter for sort.
45
+ *
46
+ * @class SortFilter
47
+ * @property {string} sortField - The field to sort by.
48
+ * @property {number} sortDirection - The direction to sort in.
49
+ */
50
+ class SortFilter {
51
+ }
52
+ __decorate([
53
+ (0, sort_field_property_1.PropertySortField)(),
54
+ __metadata("design:type", String)
55
+ ], SortFilter.prototype, "sortField", void 0);
56
+ __decorate([
57
+ (0, sort_direction_property_1.PropertySortDirection)(),
58
+ __metadata("design:type", Number)
59
+ ], SortFilter.prototype, "sortDirection", void 0);
60
+ exports.SortFilter = SortFilter;
61
+ /**
62
+ * Represents the filter for skip, limit, sort.
63
+ *
64
+ * @class SkipLimitSortFilter
65
+ * @property {number} skip - The number of items to skip.
66
+ * @property {number} limit - The maximum number of items to return.
67
+ * @property {string} sortField - The field to sort by.
68
+ * @property {number} sortDirection - The direction to sort in.
69
+ */
70
+ class SkipLimitSortFilter {
71
+ }
72
+ __decorate([
73
+ (0, skip_property_1.PropertySkip)(),
74
+ __metadata("design:type", Number)
75
+ ], SkipLimitSortFilter.prototype, "skip", void 0);
76
+ __decorate([
77
+ (0, limit_property_1.PropertyLimit)(),
78
+ __metadata("design:type", Number)
79
+ ], SkipLimitSortFilter.prototype, "limit", void 0);
80
+ __decorate([
81
+ (0, sort_field_property_1.PropertySortField)(),
82
+ __metadata("design:type", String)
83
+ ], SkipLimitSortFilter.prototype, "sortField", void 0);
84
+ __decorate([
85
+ (0, sort_direction_property_1.PropertySortDirection)(),
86
+ __metadata("design:type", Number)
87
+ ], SkipLimitSortFilter.prototype, "sortDirection", void 0);
88
+ exports.SkipLimitSortFilter = SkipLimitSortFilter;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Creates a PropertyLimitDecorator with the given options.
3
+ */
4
+ export declare const PropertyLimit: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PropertyLimit = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_validator_1 = require("class-validator");
7
+ /**
8
+ * Creates a PropertyLimitDecorator with the given options.
9
+ */
10
+ const PropertyLimit = () => (0, common_1.applyDecorators)((0, swagger_1.ApiProperty)({ required: false, minimum: 0, example: 10, description: 'Die maximale Anzahl der Ergebnisse' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.Min)(0));
11
+ exports.PropertyLimit = PropertyLimit;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Creates a PropertySkipDecorator with the given options.
3
+ */
4
+ export declare const PropertySkip: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PropertySkip = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_validator_1 = require("class-validator");
7
+ /**
8
+ * Creates a PropertySkipDecorator with the given options.
9
+ */
10
+ const PropertySkip = () => (0, common_1.applyDecorators)((0, swagger_1.ApiProperty)({
11
+ required: false,
12
+ minimum: 0,
13
+ example: 0,
14
+ description: 'Die Anzahl der zu überspringenden Ergebnisse',
15
+ }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.Min)(0));
16
+ exports.PropertySkip = PropertySkip;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Creates a PropertySortDirectionDecorator with the given options.
3
+ */
4
+ export declare const PropertySortDirection: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PropertySortDirection = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_validator_1 = require("class-validator");
7
+ /**
8
+ * Creates a PropertySortDirectionDecorator with the given options.
9
+ */
10
+ const PropertySortDirection = () => (0, common_1.applyDecorators)((0, swagger_1.ApiProperty)({
11
+ required: false,
12
+ description: 'Die Reihenfolge der Ergebnisse (1 = aufsteigend, -1 = absteigend)',
13
+ examples: [-1, 1],
14
+ default: -1,
15
+ }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsIn)([-1, 1]));
16
+ exports.PropertySortDirection = PropertySortDirection;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Creates a PropertySortFieldDecorator with the given options.
3
+ */
4
+ export declare const PropertySortField: () => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PropertySortField = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_validator_1 = require("class-validator");
7
+ /**
8
+ * Creates a PropertySortFieldDecorator with the given options.
9
+ */
10
+ const PropertySortField = () => (0, common_1.applyDecorators)((0, swagger_1.ApiProperty)({
11
+ required: false,
12
+ description: 'Das Feld, nach dem sortiert werden soll',
13
+ examples: ['title', 'timestamp', 'createdAt', 'updatedAt', '_id'],
14
+ example: 'title',
15
+ default: '_id',
16
+ }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.MinLength)(1));
17
+ exports.PropertySortField = PropertySortField;
@@ -0,0 +1,4 @@
1
+ export * from './content';
2
+ export * from './filter';
3
+ export * from './search-result';
4
+ export * from './thumbnail';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./content"), exports);
18
+ __exportStar(require("./filter"), exports);
19
+ __exportStar(require("./search-result"), exports);
20
+ __exportStar(require("./thumbnail"), exports);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Represents the result of a search operation.
3
+ *
4
+ * @class SearchResult
5
+ * @template T - The type of the search result.
6
+ * @property {T[]} results - Array of found objects.
7
+ * @property {number} total - Total number of objects without pagination.
8
+ */
9
+ export declare class SearchResult<T> {
10
+ /** Array of found objects. */
11
+ results: T[];
12
+ /** Total number of objects without pagination. */
13
+ total: number;
14
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SearchResult = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ /**
15
+ * Represents the result of a search operation.
16
+ *
17
+ * @class SearchResult
18
+ * @template T - The type of the search result.
19
+ * @property {T[]} results - Array of found objects.
20
+ * @property {number} total - Total number of objects without pagination.
21
+ */
22
+ class SearchResult {
23
+ }
24
+ __decorate([
25
+ (0, swagger_1.ApiProperty)({ description: 'Gefundene Events', type: [Object] }),
26
+ __metadata("design:type", Array)
27
+ ], SearchResult.prototype, "results", void 0);
28
+ __decorate([
29
+ (0, swagger_1.ApiProperty)({ description: 'Insgesamt auffindbare Events', example: 17 }),
30
+ __metadata("design:type", Number)
31
+ ], SearchResult.prototype, "total", void 0);
32
+ exports.SearchResult = SearchResult;
@@ -0,0 +1,8 @@
1
+ import { ApiPropertyOptions } from '@nestjs/swagger';
2
+ /**
3
+ * Creates a ThumbnailAltDecorator with the given options.
4
+ *
5
+ * @param {ApiPropertyOptions} options - the options for the ThumbnailAlt
6
+ * @return PropertyDecorator
7
+ */
8
+ export declare const ThumbnailAlt: (options?: ApiPropertyOptions) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThumbnailAlt = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_validator_1 = require("class-validator");
7
+ /**
8
+ * Creates a ThumbnailAltDecorator with the given options.
9
+ *
10
+ * @param {ApiPropertyOptions} options - the options for the ThumbnailAlt
11
+ * @return PropertyDecorator
12
+ */
13
+ const ThumbnailAlt = (options = {}) => (0, common_1.applyDecorators)(
14
+ /** ApiProperty with the given options */
15
+ (0, swagger_1.ApiProperty)(Object.assign({ example: 'Eine Person mit einem Kissen' }, options)),
16
+ /** Check if the length is at least 3 */
17
+ (0, class_validator_1.MinLength)(3, { message: 'Der Alternativtext muss mindestens 3 Zeichen lang sein' }));
18
+ exports.ThumbnailAlt = ThumbnailAlt;
@@ -0,0 +1,8 @@
1
+ import { ApiPropertyOptions } from '@nestjs/swagger';
2
+ /**
3
+ * Creates a ThumbnailBackgrounndDecorator with the given options.
4
+ *
5
+ * @param {ApiPropertyOptions} options - the options for the ThumbnailBackgrounnd
6
+ * @return PropertyDecorator
7
+ */
8
+ export declare const ThumbnailBackground: (options?: ApiPropertyOptions) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThumbnailBackground = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_validator_1 = require("class-validator");
7
+ const transform_1 = require("../../transform");
8
+ /**
9
+ * Creates a ThumbnailBackgrounndDecorator with the given options.
10
+ *
11
+ * @param {ApiPropertyOptions} options - the options for the ThumbnailBackgrounnd
12
+ * @return PropertyDecorator
13
+ */
14
+ const ThumbnailBackground = (options = {}) => (0, common_1.applyDecorators)(
15
+ /** ApiProperty with the given options */
16
+ (0, swagger_1.ApiProperty)(Object.assign({ example: [], type: [String], examples: {
17
+ 'Kein Hintergrund': { value: [] },
18
+ 'Einfacher Hintergrund': { value: ['#e74c3c'] },
19
+ Farbverlauf: { value: ['#e74c3c', '#c0392b'] },
20
+ } }, options)),
21
+ /** Transform the string array */
22
+ (0, transform_1.TransformStringArray)(),
23
+ /** Check if the value is a HEX color */
24
+ (0, class_validator_1.IsHexColor)({ each: true, message: 'Die Hintergrundfarbe muss eine HEX Farbe sein' }),
25
+ /** Check if the value is an array */
26
+ (0, class_validator_1.IsArray)({ message: 'Die Hintergrundfarbe muss ein Array sein' }));
27
+ exports.ThumbnailBackground = ThumbnailBackground;
@@ -0,0 +1,8 @@
1
+ import { ApiPropertyOptions } from '@nestjs/swagger';
2
+ /**
3
+ * Creates a ThumbnailContainDecorator with the given options.
4
+ *
5
+ * @param {ApiPropertyOptions} options - the options for the ThumbnailContain
6
+ * @return PropertyDecorator
7
+ */
8
+ export declare const ThumbnailContain: (options?: ApiPropertyOptions) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThumbnailContain = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_validator_1 = require("class-validator");
7
+ /**
8
+ * Creates a ThumbnailContainDecorator with the given options.
9
+ *
10
+ * @param {ApiPropertyOptions} options - the options for the ThumbnailContain
11
+ * @return PropertyDecorator
12
+ */
13
+ const ThumbnailContain = (options = {}) => (0, common_1.applyDecorators)(
14
+ /** ApiProperty with the given options */
15
+ (0, swagger_1.ApiProperty)(Object.assign({ description: 'Gibt an, ob das Bild gecroppt oder komplett angezeigt werden soll', example: false }, options)),
16
+ /** Check if the value is a boolean */
17
+ (0, class_validator_1.IsBoolean)({ message: 'Contain muss als Boolean übergeben werden' }));
18
+ exports.ThumbnailContain = ThumbnailContain;
@@ -0,0 +1,30 @@
1
+ import { ApiPropertyOptions } from '@nestjs/swagger';
2
+ /**
3
+ * Represents a thumbnail.
4
+ *
5
+ * @class Thumbnail
6
+ * @property {string} src - The source of the thumbnail image.
7
+ * @property {string} alt - The alternative text for the thumbnail image.
8
+ * @property {string[]} background - The background color or gradient for the thumbnail.
9
+ * @property {boolean} contain - Indicates whether the thumbnail should be cropped or not.
10
+ * @property {number} maxHeight - The maximum height of the thumbnail.
11
+ */
12
+ export declare class Thumbnail {
13
+ /** The source of the thumbnail image. */
14
+ src: string;
15
+ /** The alternative text for the thumbnail image. */
16
+ alt: string;
17
+ /** The background color or gradient for the thumbnail. */
18
+ background: string[];
19
+ /** Indicates whether the thumbnail should be cropped or not. */
20
+ contain: boolean;
21
+ /** The maximum height of the thumbnail. */
22
+ maxHeight?: number;
23
+ }
24
+ /**
25
+ * Creates a ThumbnailDecorator with the given options.
26
+ *
27
+ * @param {ApiPropertyOptions} options - the options for the Thumbnail
28
+ * @return PropertyDecorator
29
+ */
30
+ export declare const PropertyThumbnail: (options?: ApiPropertyOptions) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PropertyThumbnail = exports.Thumbnail = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ const class_transformer_1 = require("class-transformer");
16
+ const class_validator_1 = require("class-validator");
17
+ const alt_property_1 = require("./alt.property");
18
+ const background_property_1 = require("./background.property");
19
+ const contain_property_1 = require("./contain.property");
20
+ const max_height_property_1 = require("./max-height.property");
21
+ const src_property_1 = require("./src.property");
22
+ /**
23
+ * Represents a thumbnail.
24
+ *
25
+ * @class Thumbnail
26
+ * @property {string} src - The source of the thumbnail image.
27
+ * @property {string} alt - The alternative text for the thumbnail image.
28
+ * @property {string[]} background - The background color or gradient for the thumbnail.
29
+ * @property {boolean} contain - Indicates whether the thumbnail should be cropped or not.
30
+ * @property {number} maxHeight - The maximum height of the thumbnail.
31
+ */
32
+ class Thumbnail {
33
+ }
34
+ __decorate([
35
+ (0, src_property_1.ThumbnailSrc)(),
36
+ __metadata("design:type", String)
37
+ ], Thumbnail.prototype, "src", void 0);
38
+ __decorate([
39
+ (0, alt_property_1.ThumbnailAlt)(),
40
+ __metadata("design:type", String)
41
+ ], Thumbnail.prototype, "alt", void 0);
42
+ __decorate([
43
+ (0, background_property_1.ThumbnailBackground)(),
44
+ __metadata("design:type", Array)
45
+ ], Thumbnail.prototype, "background", void 0);
46
+ __decorate([
47
+ (0, contain_property_1.ThumbnailContain)(),
48
+ __metadata("design:type", Boolean)
49
+ ], Thumbnail.prototype, "contain", void 0);
50
+ __decorate([
51
+ (0, max_height_property_1.ThumbnailMaxHeight)(),
52
+ __metadata("design:type", Number)
53
+ ], Thumbnail.prototype, "maxHeight", void 0);
54
+ exports.Thumbnail = Thumbnail;
55
+ /**
56
+ * Creates a ThumbnailDecorator with the given options.
57
+ *
58
+ * @param {ApiPropertyOptions} options - the options for the Thumbnail
59
+ * @return PropertyDecorator
60
+ */
61
+ const PropertyThumbnail = (options = {}) => (0, common_1.applyDecorators)(
62
+ /** ApiProperty with the given options */
63
+ (0, swagger_1.ApiProperty)(Object.assign({ type: Thumbnail }, options)),
64
+ /** Validate the nested object */
65
+ (0, class_validator_1.ValidateNested)(),
66
+ /** Check if the value is a Thumbnail */
67
+ (0, class_transformer_1.Type)(() => Thumbnail));
68
+ exports.PropertyThumbnail = PropertyThumbnail;
@@ -0,0 +1,8 @@
1
+ import { ApiPropertyOptions } from '@nestjs/swagger';
2
+ /**
3
+ * Creates a ThumbnailMaxHeightDecorator with the given options.
4
+ *
5
+ * @param {ApiPropertyOptions} options - the options for the ThumbnailMaxHeight
6
+ * @return PropertyDecorator
7
+ */
8
+ export declare const ThumbnailMaxHeight: (options?: ApiPropertyOptions) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThumbnailMaxHeight = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_validator_1 = require("class-validator");
7
+ /**
8
+ * Creates a ThumbnailMaxHeightDecorator with the given options.
9
+ *
10
+ * @param {ApiPropertyOptions} options - the options for the ThumbnailMaxHeight
11
+ * @return PropertyDecorator
12
+ */
13
+ const ThumbnailMaxHeight = (options = {}) => (0, common_1.applyDecorators)(
14
+ /** ApiProperty with the given options */
15
+ (0, swagger_1.ApiProperty)(Object.assign({ description: 'Die maximale Höhe des Thumbnails in Pixel (>= 100)', example: 200, minimum: 100 }, options)),
16
+ /** The property is optional */
17
+ (0, class_validator_1.IsOptional)(),
18
+ /** If set, the value must be at least 100 */
19
+ (0, class_validator_1.Min)(100, { message: 'Die maximale Höhe muss mindestens 100 Pixel betragen' }));
20
+ exports.ThumbnailMaxHeight = ThumbnailMaxHeight;
@@ -0,0 +1,8 @@
1
+ import { ApiPropertyOptions } from '@nestjs/swagger';
2
+ /**
3
+ * Creates a ThumbnailSrcDecorator with the given options.
4
+ *
5
+ * @param {ApiPropertyOptions} options - the options for the ThumbnailSrc
6
+ * @return PropertyDecorator
7
+ */
8
+ export declare const ThumbnailSrc: (options?: ApiPropertyOptions) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThumbnailSrc = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_validator_1 = require("class-validator");
7
+ const transform_1 = require("../../transform");
8
+ /**
9
+ * Creates a ThumbnailSrcDecorator with the given options.
10
+ *
11
+ * @param {ApiPropertyOptions} options - the options for the ThumbnailSrc
12
+ * @return PropertyDecorator
13
+ */
14
+ const ThumbnailSrc = (options = {}) => (0, common_1.applyDecorators)(
15
+ /** ApiProperty with the given options */
16
+ (0, swagger_1.ApiProperty)(Object.assign({ example: 'https://example.com/image' }, options)),
17
+ /** Transform the URL */
18
+ (0, transform_1.TransformImage)(),
19
+ /** Check if the URL starts with https */
20
+ (0, class_validator_1.IsUrl)({ protocols: ['https'], require_protocol: true }, { message: 'Die URL muss mit https beginnen' }));
21
+ exports.ThumbnailSrc = ThumbnailSrc;