itlab-internal-services 2.4.6 → 2.5.2
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/create-duplicate-checker.function.d.ts +1 -1
- package/dist/create-duplicate-checker.function.js +4 -4
- package/dist/hub-resource.enum.d.ts +17 -0
- package/dist/hub-resource.enum.js +36 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/modules/comment/comment.controller.d.ts +4 -4
- package/dist/modules/comment/comment.controller.js +9 -9
- package/dist/modules/comment/comment.module.d.ts +4 -3
- package/dist/modules/comment/comment.module.js +5 -4
- package/dist/modules/comment/comment.service.d.ts +11 -11
- package/dist/modules/comment/comment.service.js +21 -21
- package/dist/modules/content/content.module.d.ts +3 -3
- package/dist/modules/content/content.module.js +4 -4
- package/dist/modules/content/content.service.d.ts +9 -9
- package/dist/modules/content/content.service.js +18 -18
- package/dist/modules/database/account-service/account.service.d.ts +15 -0
- package/dist/modules/{account → database/account-service}/account.service.js +9 -24
- package/dist/modules/database/database.module.js +3 -2
- package/dist/modules/database/index.d.ts +1 -0
- package/dist/modules/database/index.js +8 -13
- package/dist/modules/database/model-service/schemas/hub-account.schemas.d.ts +6 -0
- package/dist/modules/database/model-service/schemas/hub-comments.schemas.d.ts +3 -2
- package/dist/modules/database/model-service/schemas/hub-comments.schemas.js +8 -4
- package/dist/modules/database/model-service/schemas/hub-content.schemas.d.ts +2 -2
- package/dist/modules/database/model-service/schemas/hub-content.schemas.js +2 -2
- package/dist/modules/database/service-mapper-service/service-mapper.service.d.ts +8 -18
- package/dist/modules/database/service-mapper-service/service-mapper.service.js +27 -39
- package/dist/modules/index.d.ts +0 -1
- package/dist/modules/index.js +0 -1
- package/dist/modules/like/like.controller.d.ts +11 -11
- package/dist/modules/like/like.controller.js +27 -27
- package/dist/modules/like/like.service.d.ts +14 -14
- package/dist/modules/like/like.service.js +29 -29
- package/dist/modules/search/search.models.d.ts +2 -0
- package/dist/modules/search/search.models.js +6 -2
- package/dist/modules/search/search.module.d.ts +3 -3
- package/dist/modules/search/search.module.js +4 -4
- package/dist/modules/search/search.service.d.ts +9 -9
- package/dist/modules/search/search.service.js +20 -20
- package/dist/pipes/hub-resource.pipe.d.ts +26 -0
- package/dist/pipes/hub-resource.pipe.js +65 -0
- package/dist/pipes/index.d.ts +1 -1
- package/dist/pipes/index.js +1 -1
- package/dist/virtuals.factory.d.ts +5 -5
- package/dist/virtuals.factory.js +16 -18
- package/package.json +3 -3
- package/dist/modules/account/account.module.d.ts +0 -12
- package/dist/modules/account/account.module.js +0 -34
- package/dist/modules/account/account.service.d.ts +0 -23
- package/dist/modules/account/index.d.ts +0 -2
- package/dist/modules/account/index.js +0 -7
- package/dist/pipes/target.pipe.d.ts +0 -44
- package/dist/pipes/target.pipe.js +0 -83
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AccountService = exports.AccountModule = void 0;
|
|
4
|
-
var account_module_1 = require("./account.module");
|
|
5
|
-
Object.defineProperty(exports, "AccountModule", { enumerable: true, get: function () { return account_module_1.AccountModule; } });
|
|
6
|
-
var account_service_1 = require("./account.service");
|
|
7
|
-
Object.defineProperty(exports, "AccountService", { enumerable: true, get: function () { return account_service_1.AccountService; } });
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { HttpException } from '@nestjs/common';
|
|
2
|
-
/**
|
|
3
|
-
* Enum representing various targets in the application
|
|
4
|
-
*/
|
|
5
|
-
export declare enum Targets {
|
|
6
|
-
NEWSROOM = "news",
|
|
7
|
-
EVENTS = "event",
|
|
8
|
-
DEMOHIVE = "demo",
|
|
9
|
-
TECH_RADAR_BLIPS = "tech-radar-blip",
|
|
10
|
-
TECH_RADAR_RADAR = "tech-radar-radar",
|
|
11
|
-
PODCASTS = "podcast",
|
|
12
|
-
BOOKS = "book",
|
|
13
|
-
HACKSCHOOL_THREAD = "hackschool-thread",
|
|
14
|
-
HACKSCHOOL_DOCUMENTATION = "hackschool-documentation",
|
|
15
|
-
HACKSCHOOL_COURSE = "hackschool-course",
|
|
16
|
-
TEAM_MEMBER = "team-member",
|
|
17
|
-
HUB_USER = "hub-user",
|
|
18
|
-
HUB_FILE = "hub-file"
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Custom exception for invalid targets
|
|
22
|
-
* @class InvalidTargetException
|
|
23
|
-
* @extends {HttpException}
|
|
24
|
-
*/
|
|
25
|
-
export declare class InvalidTargetException extends HttpException {
|
|
26
|
-
/**
|
|
27
|
-
* Constructor for InvalidTargetException
|
|
28
|
-
* @param param - The parameter causing the exception
|
|
29
|
-
*/
|
|
30
|
-
constructor(param: string);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Used to parse a valid target from the request parameters
|
|
34
|
-
* @param param - The parameter to use for the target
|
|
35
|
-
* @returns The extracted target
|
|
36
|
-
*/
|
|
37
|
-
export declare const Target: (param: string) => ParameterDecorator;
|
|
38
|
-
/**
|
|
39
|
-
* Creates an ApiTarget decorator with the given parameter
|
|
40
|
-
*
|
|
41
|
-
* @param {string} param - the parameter for the API target
|
|
42
|
-
* @return A decorator that creates an API target with the given parameter
|
|
43
|
-
*/
|
|
44
|
-
export declare const ApiTarget: (param: string) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiTarget = exports.Target = exports.InvalidTargetException = exports.Targets = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
6
|
-
/**
|
|
7
|
-
* Enum representing various targets in the application
|
|
8
|
-
*/
|
|
9
|
-
var Targets;
|
|
10
|
-
(function (Targets) {
|
|
11
|
-
Targets["NEWSROOM"] = "news";
|
|
12
|
-
Targets["EVENTS"] = "event";
|
|
13
|
-
Targets["DEMOHIVE"] = "demo";
|
|
14
|
-
Targets["TECH_RADAR_BLIPS"] = "tech-radar-blip";
|
|
15
|
-
Targets["TECH_RADAR_RADAR"] = "tech-radar-radar";
|
|
16
|
-
Targets["PODCASTS"] = "podcast";
|
|
17
|
-
Targets["BOOKS"] = "book";
|
|
18
|
-
Targets["HACKSCHOOL_THREAD"] = "hackschool-thread";
|
|
19
|
-
Targets["HACKSCHOOL_DOCUMENTATION"] = "hackschool-documentation";
|
|
20
|
-
Targets["HACKSCHOOL_COURSE"] = "hackschool-course";
|
|
21
|
-
Targets["TEAM_MEMBER"] = "team-member";
|
|
22
|
-
Targets["HUB_USER"] = "hub-user";
|
|
23
|
-
Targets["HUB_FILE"] = "hub-file";
|
|
24
|
-
})(Targets = exports.Targets || (exports.Targets = {}));
|
|
25
|
-
/** Description for invalid targets */
|
|
26
|
-
const description = 'Invalid parameter';
|
|
27
|
-
/** Status code for invalid targets */
|
|
28
|
-
const status = common_1.HttpStatus.BAD_REQUEST;
|
|
29
|
-
/**
|
|
30
|
-
* This class represents a custom pipe to transform Targets to string.
|
|
31
|
-
* @class ParseTargetPipe
|
|
32
|
-
* @implements {PipeTransform<Targets, string>}
|
|
33
|
-
*/
|
|
34
|
-
class ParseTargetPipe {
|
|
35
|
-
/**
|
|
36
|
-
* Creates an instance of ParseTargetPipe.
|
|
37
|
-
* @param param - The parameter for the pipe.
|
|
38
|
-
*/
|
|
39
|
-
constructor(param) {
|
|
40
|
-
this.param = param;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Transforms the given value to a string.
|
|
44
|
-
* @param {Targets} value - The value to be transformed.
|
|
45
|
-
* @returns {string} The transformed string.
|
|
46
|
-
* @throws InvalidTargetException if the value is not a valid target.
|
|
47
|
-
*/
|
|
48
|
-
transform(value) {
|
|
49
|
-
if (Object.values(Targets).includes(value))
|
|
50
|
-
return value;
|
|
51
|
-
throw new InvalidTargetException(this.param);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Custom exception for invalid targets
|
|
56
|
-
* @class InvalidTargetException
|
|
57
|
-
* @extends {HttpException}
|
|
58
|
-
*/
|
|
59
|
-
class InvalidTargetException extends common_1.HttpException {
|
|
60
|
-
/**
|
|
61
|
-
* Constructor for InvalidTargetException
|
|
62
|
-
* @param param - The parameter causing the exception
|
|
63
|
-
*/
|
|
64
|
-
constructor(param) {
|
|
65
|
-
super(`${description} '${param}'`, status);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.InvalidTargetException = InvalidTargetException;
|
|
69
|
-
/**
|
|
70
|
-
* Used to parse a valid target from the request parameters
|
|
71
|
-
* @param param - The parameter to use for the target
|
|
72
|
-
* @returns The extracted target
|
|
73
|
-
*/
|
|
74
|
-
const Target = (param) => (0, common_1.Param)(param, new ParseTargetPipe(param));
|
|
75
|
-
exports.Target = Target;
|
|
76
|
-
/**
|
|
77
|
-
* Creates an ApiTarget decorator with the given parameter
|
|
78
|
-
*
|
|
79
|
-
* @param {string} param - the parameter for the API target
|
|
80
|
-
* @return A decorator that creates an API target with the given parameter
|
|
81
|
-
*/
|
|
82
|
-
const ApiTarget = (param) => (0, common_1.applyDecorators)((0, swagger_1.ApiParam)({ name: param, enum: Targets }), (0, swagger_1.ApiResponse)({ description, status }));
|
|
83
|
-
exports.ApiTarget = ApiTarget;
|