@social.dev/server-sdk 0.0.1-alpha.1
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/README.md +73 -0
- package/dist/app.module.d.ts +10 -0
- package/dist/app.module.js +96 -0
- package/dist/app.module.js.map +1 -0
- package/dist/auth/auth.controller.d.ts +6 -0
- package/dist/auth/auth.controller.js +43 -0
- package/dist/auth/auth.controller.js.map +1 -0
- package/dist/auth/auth.guard.d.ts +7 -0
- package/dist/auth/auth.guard.js +33 -0
- package/dist/auth/auth.guard.js.map +1 -0
- package/dist/auth/auth.middleware.d.ts +14 -0
- package/dist/auth/auth.middleware.js +60 -0
- package/dist/auth/auth.middleware.js.map +1 -0
- package/dist/auth/auth.module.d.ts +2 -0
- package/dist/auth/auth.module.js +35 -0
- package/dist/auth/auth.module.js.map +1 -0
- package/dist/auth/auth.service.d.ts +11 -0
- package/dist/auth/auth.service.js +41 -0
- package/dist/auth/auth.service.js.map +1 -0
- package/dist/auth/constants.d.ts +3 -0
- package/dist/auth/constants.js +7 -0
- package/dist/auth/constants.js.map +1 -0
- package/dist/auth/dto/login-success.dto.d.ts +5 -0
- package/dist/auth/dto/login-success.dto.js +40 -0
- package/dist/auth/dto/login-success.dto.js.map +1 -0
- package/dist/auth/dto/login.dto.d.ts +4 -0
- package/dist/auth/dto/login.dto.js +31 -0
- package/dist/auth/dto/login.dto.js.map +1 -0
- package/dist/auth/enums/auth-method.enum.d.ts +4 -0
- package/dist/auth/enums/auth-method.enum.js +9 -0
- package/dist/auth/enums/auth-method.enum.js.map +1 -0
- package/dist/auth/enums/auth-methods.enum.d.ts +2 -0
- package/dist/auth/enums/auth-methods.enum.js +7 -0
- package/dist/auth/enums/auth-methods.enum.js.map +1 -0
- package/dist/auth/oidc/dto/responses.d.ts +5 -0
- package/dist/auth/oidc/dto/responses.js +45 -0
- package/dist/auth/oidc/dto/responses.js.map +1 -0
- package/dist/auth/oidc/entities/oidc-user.entity.d.ts +8 -0
- package/dist/auth/oidc/entities/oidc-user.entity.js +47 -0
- package/dist/auth/oidc/entities/oidc-user.entity.js.map +1 -0
- package/dist/auth/oidc/oidc.controller.d.ts +12 -0
- package/dist/auth/oidc/oidc.controller.js +91 -0
- package/dist/auth/oidc/oidc.controller.js.map +1 -0
- package/dist/auth/oidc/oidc.module.d.ts +2 -0
- package/dist/auth/oidc/oidc.module.js +33 -0
- package/dist/auth/oidc/oidc.module.js.map +1 -0
- package/dist/auth/oidc/oidc.service.d.ts +32 -0
- package/dist/auth/oidc/oidc.service.js +181 -0
- package/dist/auth/oidc/oidc.service.js.map +1 -0
- package/dist/auth/session/auth.controller.d.ts +10 -0
- package/dist/auth/session/auth.controller.js +92 -0
- package/dist/auth/session/auth.controller.js.map +1 -0
- package/dist/auth/session/auth.service.d.ts +12 -0
- package/dist/auth/session/auth.service.js +46 -0
- package/dist/auth/session/auth.service.js.map +1 -0
- package/dist/auth/session/session.controller.d.ts +9 -0
- package/dist/auth/session/session.controller.js +84 -0
- package/dist/auth/session/session.controller.js.map +1 -0
- package/dist/auth/session/session.module.d.ts +2 -0
- package/dist/auth/session/session.module.js +25 -0
- package/dist/auth/session/session.module.js.map +1 -0
- package/dist/auth/session/session.service.d.ts +18 -0
- package/dist/auth/session/session.service.js +62 -0
- package/dist/auth/session/session.service.js.map +1 -0
- package/dist/bootstrap.d.ts +1 -0
- package/dist/bootstrap.js +32 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/chat/chat.controller.d.ts +18 -0
- package/dist/chat/chat.controller.js +133 -0
- package/dist/chat/chat.controller.js.map +1 -0
- package/dist/chat/chat.module.d.ts +2 -0
- package/dist/chat/chat.module.js +34 -0
- package/dist/chat/chat.module.js.map +1 -0
- package/dist/chat/chat.service.d.ts +30 -0
- package/dist/chat/chat.service.js +113 -0
- package/dist/chat/chat.service.js.map +1 -0
- package/dist/chat/dto/create-conversation.dto.d.ts +10 -0
- package/dist/chat/dto/create-conversation.dto.js +43 -0
- package/dist/chat/dto/create-conversation.dto.js.map +1 -0
- package/dist/chat/dto/create-message.dto.d.ts +5 -0
- package/dist/chat/dto/create-message.dto.js +31 -0
- package/dist/chat/dto/create-message.dto.js.map +1 -0
- package/dist/chat/dto/index.d.ts +4 -0
- package/dist/chat/dto/index.js +24 -0
- package/dist/chat/dto/index.js.map +1 -0
- package/dist/chat/dto/responses.dto.d.ts +14 -0
- package/dist/chat/dto/responses.dto.js +64 -0
- package/dist/chat/dto/responses.dto.js.map +1 -0
- package/dist/chat/entities/conversation-member.entity.d.ts +9 -0
- package/dist/chat/entities/conversation-member.entity.js +59 -0
- package/dist/chat/entities/conversation-member.entity.js.map +1 -0
- package/dist/chat/entities/conversation.entity.d.ts +9 -0
- package/dist/chat/entities/conversation.entity.js +56 -0
- package/dist/chat/entities/conversation.entity.js.map +1 -0
- package/dist/chat/entities/message.entity.d.ts +9 -0
- package/dist/chat/entities/message.entity.js +51 -0
- package/dist/chat/entities/message.entity.js.map +1 -0
- package/dist/chat/enums/conversation-type.enum.d.ts +3 -0
- package/dist/chat/enums/conversation-type.enum.js +8 -0
- package/dist/chat/enums/conversation-type.enum.js.map +1 -0
- package/dist/common/decorators/api-paginated-response.d.ts +2 -0
- package/dist/common/decorators/api-paginated-response.js +26 -0
- package/dist/common/decorators/api-paginated-response.js.map +1 -0
- package/dist/common/dto/paginated-response.dto.d.ts +4 -0
- package/dist/common/dto/paginated-response.dto.js +34 -0
- package/dist/common/dto/paginated-response.dto.js.map +1 -0
- package/dist/common/entities/base.repository.d.ts +7 -0
- package/dist/common/entities/base.repository.js +32 -0
- package/dist/common/entities/base.repository.js.map +1 -0
- package/dist/common/utils/ffmpeg.d.ts +1 -0
- package/dist/common/utils/ffmpeg.js +32 -0
- package/dist/common/utils/ffmpeg.js.map +1 -0
- package/dist/common/utils/ffprobe.d.ts +1 -0
- package/dist/common/utils/ffprobe.js +34 -0
- package/dist/common/utils/ffprobe.js.map +1 -0
- package/dist/common/utils/fs.d.ts +1 -0
- package/dist/common/utils/fs.js +12 -0
- package/dist/common/utils/fs.js.map +1 -0
- package/dist/common/utils/math.d.ts +1 -0
- package/dist/common/utils/math.js +8 -0
- package/dist/common/utils/math.js.map +1 -0
- package/dist/community/community.acl.d.ts +3 -0
- package/dist/community/community.acl.js +49 -0
- package/dist/community/community.acl.js.map +1 -0
- package/dist/community/community.controller.d.ts +25 -0
- package/dist/community/community.controller.js +273 -0
- package/dist/community/community.controller.js.map +1 -0
- package/dist/community/community.module.d.ts +2 -0
- package/dist/community/community.module.js +39 -0
- package/dist/community/community.module.js.map +1 -0
- package/dist/community/community.service.d.ts +37 -0
- package/dist/community/community.service.js +200 -0
- package/dist/community/community.service.js.map +1 -0
- package/dist/community/dto/community-members-response.dto.d.ts +5 -0
- package/dist/community/dto/community-members-response.dto.js +29 -0
- package/dist/community/dto/community-members-response.dto.js.map +1 -0
- package/dist/community/dto/community-response.dto.d.ts +14 -0
- package/dist/community/dto/community-response.dto.js +88 -0
- package/dist/community/dto/community-response.dto.js.map +1 -0
- package/dist/community/dto/create-community.dto.d.ts +3 -0
- package/dist/community/dto/create-community.dto.js +26 -0
- package/dist/community/dto/create-community.dto.js.map +1 -0
- package/dist/community/dto/index.d.ts +10 -0
- package/dist/community/dto/index.js +33 -0
- package/dist/community/dto/index.js.map +1 -0
- package/dist/community/dto/update-community.dto.d.ts +5 -0
- package/dist/community/dto/update-community.dto.js +13 -0
- package/dist/community/dto/update-community.dto.js.map +1 -0
- package/dist/community/entities/community-member.entity.d.ts +13 -0
- package/dist/community/entities/community-member.entity.js +74 -0
- package/dist/community/entities/community-member.entity.js.map +1 -0
- package/dist/community/entities/community.entity.d.ts +10 -0
- package/dist/community/entities/community.entity.js +61 -0
- package/dist/community/entities/community.entity.js.map +1 -0
- package/dist/community/enums/community-privacy.enum.d.ts +6 -0
- package/dist/community/enums/community-privacy.enum.js +11 -0
- package/dist/community/enums/community-privacy.enum.js.map +1 -0
- package/dist/community/enums/community-role.enum.d.ts +7 -0
- package/dist/community/enums/community-role.enum.js +12 -0
- package/dist/community/enums/community-role.enum.js.map +1 -0
- package/dist/community/enums/community-status.enum.d.ts +7 -0
- package/dist/community/enums/community-status.enum.js +12 -0
- package/dist/community/enums/community-status.enum.js.map +1 -0
- package/dist/configs/configs.controller.d.ts +4 -0
- package/dist/configs/configs.controller.js +40 -0
- package/dist/configs/configs.controller.js.map +1 -0
- package/dist/configs/configs.module.d.ts +2 -0
- package/dist/configs/configs.module.js +20 -0
- package/dist/configs/configs.module.js.map +1 -0
- package/dist/configs/configs.service.d.ts +2 -0
- package/dist/configs/configs.service.js +17 -0
- package/dist/configs/configs.service.js.map +1 -0
- package/dist/configs/dto/public-config.dto.d.ts +6 -0
- package/dist/configs/dto/public-config.dto.js +43 -0
- package/dist/configs/dto/public-config.dto.js.map +1 -0
- package/dist/core/acl/acl.factory.d.ts +23 -0
- package/dist/core/acl/acl.factory.js +42 -0
- package/dist/core/acl/acl.factory.js.map +1 -0
- package/dist/core/acl/acl.module.d.ts +6 -0
- package/dist/core/acl/acl.module.js +36 -0
- package/dist/core/acl/acl.module.js.map +1 -0
- package/dist/core/context/context.d.ts +11 -0
- package/dist/core/context/context.js +23 -0
- package/dist/core/context/context.js.map +1 -0
- package/dist/core/context/context.module.d.ts +2 -0
- package/dist/core/context/context.module.js +33 -0
- package/dist/core/context/context.module.js.map +1 -0
- package/dist/core/context/context.service.d.ts +4 -0
- package/dist/core/context/context.service.js +8 -0
- package/dist/core/context/context.service.js.map +1 -0
- package/dist/core/context/context.store.d.ts +7 -0
- package/dist/core/context/context.store.js +3 -0
- package/dist/core/context/context.store.js.map +1 -0
- package/dist/core/core.module.d.ts +2 -0
- package/dist/core/core.module.js +21 -0
- package/dist/core/core.module.js.map +1 -0
- package/dist/core/plugin/plugin-hook.service.d.ts +7 -0
- package/dist/core/plugin/plugin-hook.service.js +43 -0
- package/dist/core/plugin/plugin-hook.service.js.map +1 -0
- package/dist/core/plugin/plugin.factory.d.ts +5 -0
- package/dist/core/plugin/plugin.factory.js +14 -0
- package/dist/core/plugin/plugin.factory.js.map +1 -0
- package/dist/core/plugin/plugin.module.d.ts +4 -0
- package/dist/core/plugin/plugin.module.js +33 -0
- package/dist/core/plugin/plugin.module.js.map +1 -0
- package/dist/file-storage/file-storage.module.d.ts +2 -0
- package/dist/file-storage/file-storage.module.js +21 -0
- package/dist/file-storage/file-storage.module.js.map +1 -0
- package/dist/file-storage/file-storage.service.d.ts +8 -0
- package/dist/file-storage/file-storage.service.js +50 -0
- package/dist/file-storage/file-storage.service.js.map +1 -0
- package/dist/file-storage/utils.d.ts +2 -0
- package/dist/file-storage/utils.js +8 -0
- package/dist/file-storage/utils.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/media/dto/media-response.dto.d.ts +7 -0
- package/dist/media/dto/media-response.dto.js +57 -0
- package/dist/media/dto/media-response.dto.js.map +1 -0
- package/dist/media/entities/audio.entity.d.ts +4 -0
- package/dist/media/entities/audio.entity.js +30 -0
- package/dist/media/entities/audio.entity.js.map +1 -0
- package/dist/media/entities/media.entity.d.ts +10 -0
- package/dist/media/entities/media.entity.js +57 -0
- package/dist/media/entities/media.entity.js.map +1 -0
- package/dist/media/entities/post-media.entity.d.ts +5 -0
- package/dist/media/entities/post-media.entity.js +31 -0
- package/dist/media/entities/post-media.entity.js.map +1 -0
- package/dist/media/media.acl.d.ts +5 -0
- package/dist/media/media.acl.js +11 -0
- package/dist/media/media.acl.js.map +1 -0
- package/dist/media/media.controller.d.ts +9 -0
- package/dist/media/media.controller.js +95 -0
- package/dist/media/media.controller.js.map +1 -0
- package/dist/media/media.module.d.ts +2 -0
- package/dist/media/media.module.js +39 -0
- package/dist/media/media.module.js.map +1 -0
- package/dist/media/media.service.d.ts +18 -0
- package/dist/media/media.service.js +131 -0
- package/dist/media/media.service.js.map +1 -0
- package/dist/network/dto/create-network.dto.d.ts +2 -0
- package/dist/network/dto/create-network.dto.js +11 -0
- package/dist/network/dto/create-network.dto.js.map +1 -0
- package/dist/network/dto/update-network.dto.d.ts +5 -0
- package/dist/network/dto/update-network.dto.js +13 -0
- package/dist/network/dto/update-network.dto.js.map +1 -0
- package/dist/network/entities/network.entity.d.ts +6 -0
- package/dist/network/entities/network.entity.js +42 -0
- package/dist/network/entities/network.entity.js.map +1 -0
- package/dist/network/network.middleware.d.ts +10 -0
- package/dist/network/network.middleware.js +39 -0
- package/dist/network/network.middleware.js.map +1 -0
- package/dist/network/network.module.d.ts +2 -0
- package/dist/network/network.module.js +24 -0
- package/dist/network/network.module.js.map +1 -0
- package/dist/network/network.service.d.ts +14 -0
- package/dist/network/network.service.js +50 -0
- package/dist/network/network.service.js.map +1 -0
- package/dist/post/dto/create-post.dto.d.ts +7 -0
- package/dist/post/dto/create-post.dto.js +49 -0
- package/dist/post/dto/create-post.dto.js.map +1 -0
- package/dist/post/dto/post-response.dto.d.ts +14 -0
- package/dist/post/dto/post-response.dto.js +85 -0
- package/dist/post/dto/post-response.dto.js.map +1 -0
- package/dist/post/dto/update-post.dto.d.ts +5 -0
- package/dist/post/dto/update-post.dto.js +13 -0
- package/dist/post/dto/update-post.dto.js.map +1 -0
- package/dist/post/entities/post.entity.d.ts +18 -0
- package/dist/post/entities/post.entity.js +86 -0
- package/dist/post/entities/post.entity.js.map +1 -0
- package/dist/post/post.acl.d.ts +3 -0
- package/dist/post/post.acl.js +20 -0
- package/dist/post/post.acl.js.map +1 -0
- package/dist/post/post.controller.d.ts +14 -0
- package/dist/post/post.controller.js +134 -0
- package/dist/post/post.controller.js.map +1 -0
- package/dist/post/post.module.d.ts +2 -0
- package/dist/post/post.module.js +40 -0
- package/dist/post/post.module.js.map +1 -0
- package/dist/post/post.service.d.ts +23 -0
- package/dist/post/post.service.js +172 -0
- package/dist/post/post.service.js.map +1 -0
- package/dist/post/reaction/dto/index.d.ts +3 -0
- package/dist/post/reaction/dto/index.js +22 -0
- package/dist/post/reaction/dto/index.js.map +1 -0
- package/dist/post/reaction/entities/reaction.entity.d.ts +9 -0
- package/dist/post/reaction/entities/reaction.entity.js +51 -0
- package/dist/post/reaction/entities/reaction.entity.js.map +1 -0
- package/dist/post/reaction/reaction.controller.d.ts +8 -0
- package/dist/post/reaction/reaction.controller.js +63 -0
- package/dist/post/reaction/reaction.controller.js.map +1 -0
- package/dist/post/reaction/reaction.module.d.ts +2 -0
- package/dist/post/reaction/reaction.module.js +25 -0
- package/dist/post/reaction/reaction.module.js.map +1 -0
- package/dist/post/reaction/reaction.service.d.ts +13 -0
- package/dist/post/reaction/reaction.service.js +48 -0
- package/dist/post/reaction/reaction.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/user/dto/create-user.dto.d.ts +2 -0
- package/dist/user/dto/create-user.dto.js +11 -0
- package/dist/user/dto/create-user.dto.js.map +1 -0
- package/dist/user/dto/update-user.dto.d.ts +5 -0
- package/dist/user/dto/update-user.dto.js +13 -0
- package/dist/user/dto/update-user.dto.js.map +1 -0
- package/dist/user/dto/user-response.dto.d.ts +5 -0
- package/dist/user/dto/user-response.dto.js +40 -0
- package/dist/user/dto/user-response.dto.js.map +1 -0
- package/dist/user/entities/user.entity.d.ts +11 -0
- package/dist/user/entities/user.entity.js +65 -0
- package/dist/user/entities/user.entity.js.map +1 -0
- package/dist/user/user.acl.d.ts +3 -0
- package/dist/user/user.acl.js +9 -0
- package/dist/user/user.acl.js.map +1 -0
- package/dist/user/user.controller.d.ts +7 -0
- package/dist/user/user.controller.js +60 -0
- package/dist/user/user.controller.js.map +1 -0
- package/dist/user/user.exceptions.d.ts +5 -0
- package/dist/user/user.exceptions.js +11 -0
- package/dist/user/user.exceptions.js.map +1 -0
- package/dist/user/user.module.d.ts +2 -0
- package/dist/user/user.module.js +36 -0
- package/dist/user/user.module.js.map +1 -0
- package/dist/user/user.service.d.ts +22 -0
- package/dist/user/user.service.js +90 -0
- package/dist/user/user.service.js.map +1 -0
- package/package.json +110 -0
|
@@ -0,0 +1,51 @@
|
|
|
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.PostReaction = void 0;
|
|
13
|
+
const openapi = require("@nestjs/swagger");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const post_entity_1 = require("../../entities/post.entity");
|
|
16
|
+
const user_entity_1 = require("../../../user/entities/user.entity");
|
|
17
|
+
let PostReaction = class PostReaction {
|
|
18
|
+
userId;
|
|
19
|
+
user;
|
|
20
|
+
postId;
|
|
21
|
+
post;
|
|
22
|
+
emoji;
|
|
23
|
+
static _OPENAPI_METADATA_FACTORY() {
|
|
24
|
+
return { userId: { required: true, type: () => Number }, user: { required: true, type: () => require("../../../user/entities/user.entity").User }, postId: { required: true, type: () => Number }, post: { required: true, type: () => require("../../entities/post.entity").Post }, emoji: { required: true, type: () => String } };
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.PostReaction = PostReaction;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
30
|
+
__metadata("design:type", Object)
|
|
31
|
+
], PostReaction.prototype, "userId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
34
|
+
__metadata("design:type", user_entity_1.User)
|
|
35
|
+
], PostReaction.prototype, "user", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.PrimaryColumn)(),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], PostReaction.prototype, "postId", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.ManyToOne)(() => post_entity_1.Post),
|
|
42
|
+
__metadata("design:type", post_entity_1.Post)
|
|
43
|
+
], PostReaction.prototype, "post", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], PostReaction.prototype, "emoji", void 0);
|
|
48
|
+
exports.PostReaction = PostReaction = __decorate([
|
|
49
|
+
(0, typeorm_1.Entity)()
|
|
50
|
+
], PostReaction);
|
|
51
|
+
//# sourceMappingURL=reaction.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reaction.entity.js","sourceRoot":"","sources":["../../../../src/post/reaction/entities/reaction.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAmE;AACnE,4DAAmD;AACnD,oEAAmD;AAG5C,IAAM,YAAY,GAAlB,MAAM,YAAY;IAKd,MAAM,CAAa;IAG5B,IAAI,CAAO;IAGF,MAAM,CAAa;IAG5B,IAAI,CAAO;IAGX,KAAK,CAAS;;;;CACf,CAAA;AAlBY,oCAAY;AAKd;IADR,IAAA,uBAAa,GAAE;;4CACY;AAG5B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,CAAC;8BAChB,kBAAI;0CAAC;AAGF;IADR,IAAA,uBAAa,GAAE;;4CACY;AAG5B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,CAAC;8BAChB,kBAAI;0CAAC;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;uBAjBH,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CAkBxB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PostIdDto } from './dto';
|
|
2
|
+
import { PostReactionService } from './reaction.service';
|
|
3
|
+
export declare class PostReactionController {
|
|
4
|
+
private service;
|
|
5
|
+
constructor(service: PostReactionService);
|
|
6
|
+
create(dto: PostIdDto): void;
|
|
7
|
+
remove(dto: PostIdDto): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PostReactionController = void 0;
|
|
16
|
+
const openapi = require("@nestjs/swagger");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
19
|
+
const dto_1 = require("./dto");
|
|
20
|
+
const reaction_service_1 = require("./reaction.service");
|
|
21
|
+
let PostReactionController = class PostReactionController {
|
|
22
|
+
service;
|
|
23
|
+
constructor(service) {
|
|
24
|
+
this.service = service;
|
|
25
|
+
}
|
|
26
|
+
create(dto) {
|
|
27
|
+
this.service.create({ postId: dto.post });
|
|
28
|
+
}
|
|
29
|
+
remove(dto) {
|
|
30
|
+
this.service.delete({ postId: dto.post });
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.PostReactionController = PostReactionController;
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, swagger_1.ApiOperation)({
|
|
36
|
+
summary: 'Creates a reaction on a post',
|
|
37
|
+
description: 'This Post API method will add a reaction to a post.',
|
|
38
|
+
}),
|
|
39
|
+
(0, common_1.Post)('post.reaction.create'),
|
|
40
|
+
openapi.ApiResponse({ status: 201 }),
|
|
41
|
+
__param(0, (0, common_1.Body)()),
|
|
42
|
+
__metadata("design:type", Function),
|
|
43
|
+
__metadata("design:paramtypes", [dto_1.PostIdDto]),
|
|
44
|
+
__metadata("design:returntype", void 0)
|
|
45
|
+
], PostReactionController.prototype, "create", null);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, swagger_1.ApiOperation)({
|
|
48
|
+
summary: 'Removes a reaction from post',
|
|
49
|
+
description: 'This Post API method will remove a reaction from a post.',
|
|
50
|
+
}),
|
|
51
|
+
(0, common_1.Post)('post.reaction.delete'),
|
|
52
|
+
openapi.ApiResponse({ status: 201 }),
|
|
53
|
+
__param(0, (0, common_1.Body)()),
|
|
54
|
+
__metadata("design:type", Function),
|
|
55
|
+
__metadata("design:paramtypes", [dto_1.PostIdDto]),
|
|
56
|
+
__metadata("design:returntype", void 0)
|
|
57
|
+
], PostReactionController.prototype, "remove", null);
|
|
58
|
+
exports.PostReactionController = PostReactionController = __decorate([
|
|
59
|
+
(0, swagger_1.ApiTags)('Post'),
|
|
60
|
+
(0, common_1.Controller)(),
|
|
61
|
+
__metadata("design:paramtypes", [reaction_service_1.PostReactionService])
|
|
62
|
+
], PostReactionController);
|
|
63
|
+
//# sourceMappingURL=reaction.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reaction.controller.js","sourceRoot":"","sources":["../../../src/post/reaction/reaction.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwD;AACxD,6CAAwD;AACxD,+BAAkC;AAClC,yDAAyD;AAIlD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACb;IAApB,YAAoB,OAA4B;QAA5B,YAAO,GAAP,OAAO,CAAqB;IAAG,CAAC;IAOpD,MAAM,CAAS,GAAc;QAC3B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IAOD,MAAM,CAAS,GAAc;QAC3B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF,CAAA;AApBY,wDAAsB;AAQjC;IALC,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,8BAA8B;QACvC,WAAW,EAAE,qDAAqD;KACnE,CAAC;IACD,IAAA,aAAI,EAAC,sBAAsB,CAAC;;IACrB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,eAAS;;oDAE5B;AAOD;IALC,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,8BAA8B;QACvC,WAAW,EAAE,0DAA0D;KACxE,CAAC;IACD,IAAA,aAAI,EAAC,sBAAsB,CAAC;;IACrB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,eAAS;;oDAE5B;iCAnBU,sBAAsB;IAFlC,IAAA,iBAAO,EAAC,MAAM,CAAC;IACf,IAAA,mBAAU,GAAE;qCAEkB,sCAAmB;GADrC,sBAAsB,CAoBlC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PostReactionModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const reaction_controller_1 = require("./reaction.controller");
|
|
12
|
+
const reaction_service_1 = require("./reaction.service");
|
|
13
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
14
|
+
const reaction_entity_1 = require("./entities/reaction.entity");
|
|
15
|
+
let PostReactionModule = class PostReactionModule {
|
|
16
|
+
};
|
|
17
|
+
exports.PostReactionModule = PostReactionModule;
|
|
18
|
+
exports.PostReactionModule = PostReactionModule = __decorate([
|
|
19
|
+
(0, common_1.Module)({
|
|
20
|
+
imports: [typeorm_1.TypeOrmModule.forFeature([reaction_entity_1.PostReaction])],
|
|
21
|
+
controllers: [reaction_controller_1.PostReactionController],
|
|
22
|
+
providers: [reaction_service_1.PostReactionService],
|
|
23
|
+
})
|
|
24
|
+
], PostReactionModule);
|
|
25
|
+
//# sourceMappingURL=reaction.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reaction.module.js","sourceRoot":"","sources":["../../../src/post/reaction/reaction.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,+DAA+D;AAC/D,yDAAyD;AACzD,6CAAgD;AAChD,gEAA0D;AAOnD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,gDAAkB;6BAAlB,kBAAkB;IAL9B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,CAAC,8BAAY,CAAC,CAAC,CAAC;QACnD,WAAW,EAAE,CAAC,4CAAsB,CAAC;QACrC,SAAS,EAAE,CAAC,sCAAmB,CAAC;KACjC,CAAC;GACW,kBAAkB,CAAG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Post } from '~/post/entities/post.entity';
|
|
2
|
+
import { PostReaction } from './entities/reaction.entity';
|
|
3
|
+
import { Repository } from 'typeorm';
|
|
4
|
+
export declare class PostReactionService {
|
|
5
|
+
private readonly service;
|
|
6
|
+
constructor(service: Repository<PostReaction>);
|
|
7
|
+
create({ postId }: {
|
|
8
|
+
postId: Post['id'];
|
|
9
|
+
}): Promise<PostReaction>;
|
|
10
|
+
delete({ postId }: {
|
|
11
|
+
postId: Post['id'];
|
|
12
|
+
}): Promise<boolean>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PostReactionService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const reaction_entity_1 = require("./entities/reaction.entity");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const context_1 = require("../../core/context/context");
|
|
21
|
+
let PostReactionService = class PostReactionService {
|
|
22
|
+
service;
|
|
23
|
+
constructor(service) {
|
|
24
|
+
this.service = service;
|
|
25
|
+
}
|
|
26
|
+
async create({ postId }) {
|
|
27
|
+
const reaction = this.service.create({
|
|
28
|
+
post: { id: postId },
|
|
29
|
+
user: { id: context_1.Context.getUser()?.id },
|
|
30
|
+
});
|
|
31
|
+
await this.service.save(reaction);
|
|
32
|
+
return reaction;
|
|
33
|
+
}
|
|
34
|
+
async delete({ postId }) {
|
|
35
|
+
await this.service.delete({
|
|
36
|
+
post: { id: postId },
|
|
37
|
+
user: { id: context_1.Context.getUser()?.id },
|
|
38
|
+
});
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.PostReactionService = PostReactionService;
|
|
43
|
+
exports.PostReactionService = PostReactionService = __decorate([
|
|
44
|
+
(0, common_1.Injectable)(),
|
|
45
|
+
__param(0, (0, typeorm_1.InjectRepository)(reaction_entity_1.PostReaction)),
|
|
46
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
47
|
+
], PostReactionService);
|
|
48
|
+
//# sourceMappingURL=reaction.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reaction.service.js","sourceRoot":"","sources":["../../../src/post/reaction/reaction.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AAEnD,gEAA0D;AAC1D,qCAAqC;AACrC,wDAAiD;AAG1C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAGX;IAFnB,YAEmB,OAAiC;QAAjC,YAAO,GAAP,OAAO,CAA0B;IACjD,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAA0B;QAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;YACnC,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACpB,IAAI,EAAE,EAAE,EAAE,EAAE,iBAAO,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE;SACpC,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAA0B;QAC7C,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;YACxB,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACpB,IAAI,EAAE,EAAE,EAAE,EAAE,iBAAO,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE;SACpC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAtBY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,8BAAY,CAAC,CAAA;qCACL,oBAAU;GAH3B,mBAAmB,CAsB/B"}
|