@venturialstd/social-network 0.0.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/dist/constants/content-element.constant.d.ts +14 -0
- package/dist/constants/content-element.constant.d.ts.map +1 -0
- package/dist/constants/content-element.constant.js +18 -0
- package/dist/constants/content-element.constant.js.map +1 -0
- package/dist/constants/feed.constant.d.ts +6 -0
- package/dist/constants/feed.constant.d.ts.map +1 -0
- package/dist/constants/feed.constant.js +9 -0
- package/dist/constants/feed.constant.js.map +1 -0
- package/dist/constants/social-network.constant.d.ts +32 -0
- package/dist/constants/social-network.constant.d.ts.map +1 -0
- package/dist/constants/social-network.constant.js +41 -0
- package/dist/constants/social-network.constant.js.map +1 -0
- package/dist/entities/comment.entity.d.ts +13 -0
- package/dist/entities/comment.entity.d.ts.map +1 -0
- package/dist/entities/comment.entity.js +93 -0
- package/dist/entities/comment.entity.js.map +1 -0
- package/dist/entities/content-hashtag.entity.d.ts +9 -0
- package/dist/entities/content-hashtag.entity.d.ts.map +1 -0
- package/dist/entities/content-hashtag.entity.js +63 -0
- package/dist/entities/content-hashtag.entity.js.map +1 -0
- package/dist/entities/content-music.entity.d.ts +13 -0
- package/dist/entities/content-music.entity.d.ts.map +1 -0
- package/dist/entities/content-music.entity.js +95 -0
- package/dist/entities/content-music.entity.js.map +1 -0
- package/dist/entities/content-tagged-place.entity.d.ts +9 -0
- package/dist/entities/content-tagged-place.entity.d.ts.map +1 -0
- package/dist/entities/content-tagged-place.entity.js +62 -0
- package/dist/entities/content-tagged-place.entity.js.map +1 -0
- package/dist/entities/content-tagged-user.entity.d.ts +9 -0
- package/dist/entities/content-tagged-user.entity.d.ts.map +1 -0
- package/dist/entities/content-tagged-user.entity.js +62 -0
- package/dist/entities/content-tagged-user.entity.js.map +1 -0
- package/dist/entities/follow.entity.d.ts +8 -0
- package/dist/entities/follow.entity.d.ts.map +1 -0
- package/dist/entities/follow.entity.js +55 -0
- package/dist/entities/follow.entity.js.map +1 -0
- package/dist/entities/friend-request.entity.d.ts +12 -0
- package/dist/entities/friend-request.entity.d.ts.map +1 -0
- package/dist/entities/friend-request.entity.js +87 -0
- package/dist/entities/friend-request.entity.js.map +1 -0
- package/dist/entities/friendship.entity.d.ts +12 -0
- package/dist/entities/friendship.entity.d.ts.map +1 -0
- package/dist/entities/friendship.entity.js +88 -0
- package/dist/entities/friendship.entity.js.map +1 -0
- package/dist/entities/post.entity.d.ts +14 -0
- package/dist/entities/post.entity.d.ts.map +1 -0
- package/dist/entities/post.entity.js +99 -0
- package/dist/entities/post.entity.js.map +1 -0
- package/dist/entities/reaction.entity.d.ts +11 -0
- package/dist/entities/reaction.entity.d.ts.map +1 -0
- package/dist/entities/reaction.entity.js +79 -0
- package/dist/entities/reaction.entity.js.map +1 -0
- package/dist/entities/reel.entity.d.ts +13 -0
- package/dist/entities/reel.entity.d.ts.map +1 -0
- package/dist/entities/reel.entity.js +94 -0
- package/dist/entities/reel.entity.js.map +1 -0
- package/dist/entities/save.entity.d.ts +10 -0
- package/dist/entities/save.entity.d.ts.map +1 -0
- package/dist/entities/save.entity.js +64 -0
- package/dist/entities/save.entity.js.map +1 -0
- package/dist/entities/story.entity.d.ts +13 -0
- package/dist/entities/story.entity.d.ts.map +1 -0
- package/dist/entities/story.entity.js +87 -0
- package/dist/entities/story.entity.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/services/comment.service.d.ts +20 -0
- package/dist/services/comment.service.d.ts.map +1 -0
- package/dist/services/comment.service.js +74 -0
- package/dist/services/comment.service.js.map +1 -0
- package/dist/services/content-hashtag.service.d.ts +23 -0
- package/dist/services/content-hashtag.service.d.ts.map +1 -0
- package/dist/services/content-hashtag.service.js +84 -0
- package/dist/services/content-hashtag.service.js.map +1 -0
- package/dist/services/content-music.service.d.ts +26 -0
- package/dist/services/content-music.service.d.ts.map +1 -0
- package/dist/services/content-music.service.js +100 -0
- package/dist/services/content-music.service.js.map +1 -0
- package/dist/services/content-tagged-place.service.d.ts +16 -0
- package/dist/services/content-tagged-place.service.d.ts.map +1 -0
- package/dist/services/content-tagged-place.service.js +66 -0
- package/dist/services/content-tagged-place.service.js.map +1 -0
- package/dist/services/content-tagged-user.service.d.ts +16 -0
- package/dist/services/content-tagged-user.service.d.ts.map +1 -0
- package/dist/services/content-tagged-user.service.js +66 -0
- package/dist/services/content-tagged-user.service.js.map +1 -0
- package/dist/services/feed.service.d.ts +14 -0
- package/dist/services/feed.service.d.ts.map +1 -0
- package/dist/services/feed.service.js +135 -0
- package/dist/services/feed.service.js.map +1 -0
- package/dist/services/follow.service.d.ts +21 -0
- package/dist/services/follow.service.d.ts.map +1 -0
- package/dist/services/follow.service.js +78 -0
- package/dist/services/follow.service.js.map +1 -0
- package/dist/services/friend-request.service.d.ts +16 -0
- package/dist/services/friend-request.service.d.ts.map +1 -0
- package/dist/services/friend-request.service.js +106 -0
- package/dist/services/friend-request.service.js.map +1 -0
- package/dist/services/friendship.service.d.ts +17 -0
- package/dist/services/friendship.service.d.ts.map +1 -0
- package/dist/services/friendship.service.js +79 -0
- package/dist/services/friendship.service.js.map +1 -0
- package/dist/services/post.service.d.ts +10 -0
- package/dist/services/post.service.d.ts.map +1 -0
- package/dist/services/post.service.js +48 -0
- package/dist/services/post.service.js.map +1 -0
- package/dist/services/reaction.service.d.ts +19 -0
- package/dist/services/reaction.service.d.ts.map +1 -0
- package/dist/services/reaction.service.js +88 -0
- package/dist/services/reaction.service.js.map +1 -0
- package/dist/services/reel.service.d.ts +8 -0
- package/dist/services/reel.service.d.ts.map +1 -0
- package/dist/services/reel.service.js +34 -0
- package/dist/services/reel.service.js.map +1 -0
- package/dist/services/save.service.d.ts +17 -0
- package/dist/services/save.service.d.ts.map +1 -0
- package/dist/services/save.service.js +65 -0
- package/dist/services/save.service.js.map +1 -0
- package/dist/services/story.service.d.ts +14 -0
- package/dist/services/story.service.d.ts.map +1 -0
- package/dist/services/story.service.js +50 -0
- package/dist/services/story.service.js.map +1 -0
- package/dist/social-network.module.d.ts +3 -0
- package/dist/social-network.module.d.ts.map +1 -0
- package/dist/social-network.module.js +80 -0
- package/dist/social-network.module.js.map +1 -0
- package/dist/types/content-element.types.d.ts +84 -0
- package/dist/types/content-element.types.d.ts.map +1 -0
- package/dist/types/content-element.types.js +3 -0
- package/dist/types/content-element.types.js.map +1 -0
- package/dist/types/content-music.types.d.ts +8 -0
- package/dist/types/content-music.types.d.ts.map +1 -0
- package/dist/types/content-music.types.js +3 -0
- package/dist/types/content-music.types.js.map +1 -0
- package/dist/types/feed.types.d.ts +28 -0
- package/dist/types/feed.types.d.ts.map +1 -0
- package/dist/types/feed.types.js +3 -0
- package/dist/types/feed.types.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { Repository } from 'typeorm';
|
|
3
|
+
import { Friendship } from '../entities/friendship.entity';
|
|
4
|
+
export declare class FriendshipService extends TypeOrmCrudService<Friendship> {
|
|
5
|
+
readonly repo: Repository<Friendship>;
|
|
6
|
+
constructor(repo: Repository<Friendship>);
|
|
7
|
+
block(userId: string, friendUserId: string, blockedByUserId: string): Promise<Friendship>;
|
|
8
|
+
unblock(userId: string, friendUserId: string): Promise<Friendship>;
|
|
9
|
+
listFriends(userId: string, options?: {
|
|
10
|
+
skip?: number;
|
|
11
|
+
take?: number;
|
|
12
|
+
}): Promise<Friendship[]>;
|
|
13
|
+
areFriends(userId: string, friendUserId: string): Promise<boolean>;
|
|
14
|
+
isBlocked(userId: string, friendUserId: string): Promise<boolean>;
|
|
15
|
+
private getFriendshipBetween;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=friendship.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"friendship.service.d.ts","sourceRoot":"","sources":["../../src/services/friendship.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,qBACa,iBAAkB,SAAQ,kBAAkB,CAAC,UAAU,CAAC;aAGjD,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC;gBAA5B,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC;IAKxC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAQzF,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAQlE,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAU9F,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKlE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;YAKzD,oBAAoB;CASnC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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.FriendshipService = void 0;
|
|
16
|
+
const crud_typeorm_1 = require("@dataui/crud-typeorm");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const social_network_constant_1 = require("../constants/social-network.constant");
|
|
21
|
+
const friendship_entity_1 = require("../entities/friendship.entity");
|
|
22
|
+
let FriendshipService = class FriendshipService extends crud_typeorm_1.TypeOrmCrudService {
|
|
23
|
+
repo;
|
|
24
|
+
constructor(repo) {
|
|
25
|
+
super(repo);
|
|
26
|
+
this.repo = repo;
|
|
27
|
+
}
|
|
28
|
+
async block(userId, friendUserId, blockedByUserId) {
|
|
29
|
+
const friendship = await this.getFriendshipBetween(userId, friendUserId);
|
|
30
|
+
if (!friendship)
|
|
31
|
+
throw new Error('Friendship not found');
|
|
32
|
+
friendship.status = social_network_constant_1.FriendshipStatus.BLOCKED;
|
|
33
|
+
friendship.blockedByUserId = blockedByUserId;
|
|
34
|
+
return this.repo.save(friendship);
|
|
35
|
+
}
|
|
36
|
+
async unblock(userId, friendUserId) {
|
|
37
|
+
const friendship = await this.getFriendshipBetween(userId, friendUserId);
|
|
38
|
+
if (!friendship)
|
|
39
|
+
throw new Error('Friendship not found');
|
|
40
|
+
friendship.status = social_network_constant_1.FriendshipStatus.ACTIVE;
|
|
41
|
+
friendship.blockedByUserId = null;
|
|
42
|
+
return this.repo.save(friendship);
|
|
43
|
+
}
|
|
44
|
+
async listFriends(userId, options) {
|
|
45
|
+
const qb = this.repo
|
|
46
|
+
.createQueryBuilder('f')
|
|
47
|
+
.where('(f.userId = :userId OR f.friendUserId = :userId)', { userId })
|
|
48
|
+
.andWhere('f.status = :status', { status: social_network_constant_1.FriendshipStatus.ACTIVE });
|
|
49
|
+
if (options?.take)
|
|
50
|
+
qb.take(options.take);
|
|
51
|
+
if (options?.skip)
|
|
52
|
+
qb.skip(options.skip);
|
|
53
|
+
return qb.orderBy('f.createdAt', 'DESC').getMany();
|
|
54
|
+
}
|
|
55
|
+
async areFriends(userId, friendUserId) {
|
|
56
|
+
const f = await this.getFriendshipBetween(userId, friendUserId);
|
|
57
|
+
return f != null && f.status === social_network_constant_1.FriendshipStatus.ACTIVE;
|
|
58
|
+
}
|
|
59
|
+
async isBlocked(userId, friendUserId) {
|
|
60
|
+
const f = await this.getFriendshipBetween(userId, friendUserId);
|
|
61
|
+
return f != null && f.status === social_network_constant_1.FriendshipStatus.BLOCKED;
|
|
62
|
+
}
|
|
63
|
+
async getFriendshipBetween(userIdA, userIdB) {
|
|
64
|
+
return this.repo
|
|
65
|
+
.createQueryBuilder('f')
|
|
66
|
+
.where('(f.userId = :a AND f.friendUserId = :b) OR (f.userId = :b AND f.friendUserId = :a)', {
|
|
67
|
+
a: userIdA,
|
|
68
|
+
b: userIdB,
|
|
69
|
+
})
|
|
70
|
+
.getOne();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
exports.FriendshipService = FriendshipService;
|
|
74
|
+
exports.FriendshipService = FriendshipService = __decorate([
|
|
75
|
+
(0, common_1.Injectable)(),
|
|
76
|
+
__param(0, (0, typeorm_1.InjectRepository)(friendship_entity_1.Friendship)),
|
|
77
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
78
|
+
], FriendshipService);
|
|
79
|
+
//# sourceMappingURL=friendship.service.js.map
|
|
@@ -0,0 +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,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,8BAAU,CAAC,CAAA;qCACP,oBAAU;GAHvB,iBAAiB,CAqD7B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { Repository } from 'typeorm';
|
|
3
|
+
import { Post } from '../entities/post.entity';
|
|
4
|
+
export declare class PostService extends TypeOrmCrudService<Post> {
|
|
5
|
+
readonly repo: Repository<Post>;
|
|
6
|
+
constructor(repo: Repository<Post>);
|
|
7
|
+
setArchived(id: string, isArchived: boolean): Promise<Post>;
|
|
8
|
+
setAllowComments(id: string, allowComments: boolean): Promise<Post>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=post.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.service.d.ts","sourceRoot":"","sources":["../../src/services/post.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,qBACa,WAAY,SAAQ,kBAAkB,CAAC,IAAI,CAAC;aAGrC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;gBAAtB,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;IAKlC,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3D,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAM1E"}
|
|
@@ -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.PostService = void 0;
|
|
16
|
+
const crud_typeorm_1 = require("@dataui/crud-typeorm");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const post_entity_1 = require("../entities/post.entity");
|
|
21
|
+
let PostService = class PostService extends crud_typeorm_1.TypeOrmCrudService {
|
|
22
|
+
repo;
|
|
23
|
+
constructor(repo) {
|
|
24
|
+
super(repo);
|
|
25
|
+
this.repo = repo;
|
|
26
|
+
}
|
|
27
|
+
async setArchived(id, isArchived) {
|
|
28
|
+
const post = await this.repo.findOne({ where: { id } });
|
|
29
|
+
if (!post)
|
|
30
|
+
throw new common_1.NotFoundException(`Post ${id} not found`);
|
|
31
|
+
post.isArchived = isArchived;
|
|
32
|
+
return this.repo.save(post);
|
|
33
|
+
}
|
|
34
|
+
async setAllowComments(id, allowComments) {
|
|
35
|
+
const post = await this.repo.findOne({ where: { id } });
|
|
36
|
+
if (!post)
|
|
37
|
+
throw new common_1.NotFoundException(`Post ${id} not found`);
|
|
38
|
+
post.allowComments = allowComments;
|
|
39
|
+
return this.repo.save(post);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.PostService = PostService;
|
|
43
|
+
exports.PostService = PostService = __decorate([
|
|
44
|
+
(0, common_1.Injectable)(),
|
|
45
|
+
__param(0, (0, typeorm_1.InjectRepository)(post_entity_1.Post)),
|
|
46
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
47
|
+
], PostService);
|
|
48
|
+
//# sourceMappingURL=post.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.service.js","sourceRoot":"","sources":["../../src/services/post.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA+D;AAC/D,6CAAmD;AACnD,qCAAqC;AAErC,yDAA+C;AAGxC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,iCAAwB;IAGrC;IAFlB,YAEkB,IAAsB;QAEtC,KAAK,CAAC,IAAI,CAAC,CAAC;QAFI,SAAI,GAAJ,IAAI,CAAkB;IAGxC,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,EAAU,EAAE,UAAmB;QAC/C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,0BAAiB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC/D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,EAAU,EAAE,aAAsB;QACvD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,0BAAiB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC/D,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF,CAAA;AArBY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;qCACD,oBAAU;GAHvB,WAAW,CAqBvB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { Repository } from 'typeorm';
|
|
3
|
+
import { ContentTargetType, ReactionType } from '../constants/social-network.constant';
|
|
4
|
+
import { Reaction } from '../entities/reaction.entity';
|
|
5
|
+
export declare class ReactionService extends TypeOrmCrudService<Reaction> {
|
|
6
|
+
readonly repo: Repository<Reaction>;
|
|
7
|
+
constructor(repo: Repository<Reaction>);
|
|
8
|
+
addOrUpdateReaction(userId: string, targetType: ContentTargetType, targetId: string, reactionType: ReactionType): Promise<Reaction>;
|
|
9
|
+
removeReaction(userId: string, targetType: ContentTargetType, targetId: string): Promise<void>;
|
|
10
|
+
getReactionsForContent(targetType: ContentTargetType, targetId: string, options?: {
|
|
11
|
+
take?: number;
|
|
12
|
+
skip?: number;
|
|
13
|
+
}): Promise<Reaction[]>;
|
|
14
|
+
getReactionCountsByType(targetType: ContentTargetType, targetId: string): Promise<Record<ReactionType, number>>;
|
|
15
|
+
getTotalReactionCount(targetType: ContentTargetType, targetId: string): Promise<number>;
|
|
16
|
+
hasUserReacted(userId: string, targetType: ContentTargetType, targetId: string): Promise<boolean>;
|
|
17
|
+
getUserReaction(userId: string, targetType: ContentTargetType, targetId: string): Promise<Reaction | null>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=reaction.service.d.ts.map
|
|
@@ -0,0 +1 @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AAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC;IAOb,eAAe,CACnB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,iBAAiB,EAC7B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;CAK5B"}
|
|
@@ -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
|
+
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.ReactionService = void 0;
|
|
16
|
+
const crud_typeorm_1 = require("@dataui/crud-typeorm");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const social_network_constant_1 = require("../constants/social-network.constant");
|
|
21
|
+
const reaction_entity_1 = require("../entities/reaction.entity");
|
|
22
|
+
let ReactionService = class ReactionService extends crud_typeorm_1.TypeOrmCrudService {
|
|
23
|
+
repo;
|
|
24
|
+
constructor(repo) {
|
|
25
|
+
super(repo);
|
|
26
|
+
this.repo = repo;
|
|
27
|
+
}
|
|
28
|
+
async addOrUpdateReaction(userId, targetType, targetId, reactionType) {
|
|
29
|
+
let reaction = await this.repo.findOne({
|
|
30
|
+
where: { userId, targetType, targetId },
|
|
31
|
+
});
|
|
32
|
+
if (reaction) {
|
|
33
|
+
reaction.reactionType = reactionType;
|
|
34
|
+
return this.repo.save(reaction);
|
|
35
|
+
}
|
|
36
|
+
reaction = this.repo.create({ userId, targetType, targetId, reactionType });
|
|
37
|
+
return this.repo.save(reaction);
|
|
38
|
+
}
|
|
39
|
+
async removeReaction(userId, targetType, targetId) {
|
|
40
|
+
await this.repo.delete({ userId, targetType, targetId });
|
|
41
|
+
}
|
|
42
|
+
async getReactionsForContent(targetType, targetId, options) {
|
|
43
|
+
const qb = this.repo
|
|
44
|
+
.createQueryBuilder('r')
|
|
45
|
+
.where('r.targetType = :targetType', { targetType })
|
|
46
|
+
.andWhere('r.targetId = :targetId', { targetId });
|
|
47
|
+
if (options?.take)
|
|
48
|
+
qb.take(options.take);
|
|
49
|
+
if (options?.skip)
|
|
50
|
+
qb.skip(options.skip);
|
|
51
|
+
return qb.orderBy('r.createdAt', 'DESC').getMany();
|
|
52
|
+
}
|
|
53
|
+
async getReactionCountsByType(targetType, targetId) {
|
|
54
|
+
const rows = await this.repo
|
|
55
|
+
.createQueryBuilder('r')
|
|
56
|
+
.select('r.reactionType', 'type')
|
|
57
|
+
.addSelect('COUNT(*)', 'count')
|
|
58
|
+
.where('r.targetType = :targetType', { targetType })
|
|
59
|
+
.andWhere('r.targetId = :targetId', { targetId })
|
|
60
|
+
.groupBy('r.reactionType')
|
|
61
|
+
.getRawMany();
|
|
62
|
+
const out = Object.fromEntries(Object.values(social_network_constant_1.ReactionType).map((t) => [t, 0]));
|
|
63
|
+
for (const r of rows)
|
|
64
|
+
out[r.type] = parseInt(r.count, 10);
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
async getTotalReactionCount(targetType, targetId) {
|
|
68
|
+
return this.repo.count({ where: { targetType, targetId } });
|
|
69
|
+
}
|
|
70
|
+
async hasUserReacted(userId, targetType, targetId) {
|
|
71
|
+
const count = await this.repo.count({
|
|
72
|
+
where: { userId, targetType, targetId },
|
|
73
|
+
});
|
|
74
|
+
return count > 0;
|
|
75
|
+
}
|
|
76
|
+
async getUserReaction(userId, targetType, targetId) {
|
|
77
|
+
return this.repo.findOne({
|
|
78
|
+
where: { userId, targetType, targetId },
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
exports.ReactionService = ReactionService;
|
|
83
|
+
exports.ReactionService = ReactionService = __decorate([
|
|
84
|
+
(0, common_1.Injectable)(),
|
|
85
|
+
__param(0, (0, typeorm_1.InjectRepository)(reaction_entity_1.Reaction)),
|
|
86
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
87
|
+
], ReactionService);
|
|
88
|
+
//# sourceMappingURL=reaction.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reaction.service.js","sourceRoot":"","sources":["../../src/services/reaction.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AAErC,kFAAuF;AACvF,iEAAuD;AAGhD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,iCAA4B;IAG7C;IAFlB,YAEkB,IAA0B;QAE1C,KAAK,CAAC,IAAI,CAAC,CAAC;QAFI,SAAI,GAAJ,IAAI,CAAsB;IAG5C,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,MAAc,EACd,UAA6B,EAC7B,QAAgB,EAChB,YAA0B;QAE1B,IAAI,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACrC,KAAK,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE;SACxC,CAAC,CAAC;QACH,IAAI,QAAQ,EAAE,CAAC;YACb,QAA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Ae;IAD3B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,0BAAQ,CAAC,CAAA;qCACL,oBAAU;GAHvB,eAAe,CA6F3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { Repository } from 'typeorm';
|
|
3
|
+
import { Reel } from '../entities/reel.entity';
|
|
4
|
+
export declare class ReelService extends TypeOrmCrudService<Reel> {
|
|
5
|
+
readonly repo: Repository<Reel>;
|
|
6
|
+
constructor(repo: Repository<Reel>);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=reel.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reel.service.d.ts","sourceRoot":"","sources":["../../src/services/reel.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,qBACa,WAAY,SAAQ,kBAAkB,CAAC,IAAI,CAAC;aAGrC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;gBAAtB,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;CAIzC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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.ReelService = void 0;
|
|
16
|
+
const crud_typeorm_1 = require("@dataui/crud-typeorm");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const reel_entity_1 = require("../entities/reel.entity");
|
|
21
|
+
let ReelService = class ReelService extends crud_typeorm_1.TypeOrmCrudService {
|
|
22
|
+
repo;
|
|
23
|
+
constructor(repo) {
|
|
24
|
+
super(repo);
|
|
25
|
+
this.repo = repo;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.ReelService = ReelService;
|
|
29
|
+
exports.ReelService = ReelService = __decorate([
|
|
30
|
+
(0, common_1.Injectable)(),
|
|
31
|
+
__param(0, (0, typeorm_1.InjectRepository)(reel_entity_1.Reel)),
|
|
32
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
33
|
+
], ReelService);
|
|
34
|
+
//# sourceMappingURL=reel.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reel.service.js","sourceRoot":"","sources":["../../src/services/reel.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AAErC,yDAA+C;AAGxC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,iCAAwB;IAGrC;IAFlB,YAEkB,IAAsB;QAEtC,KAAK,CAAC,IAAI,CAAC,CAAC;QAFI,SAAI,GAAJ,IAAI,CAAkB;IAGxC,CAAC;CACF,CAAA;AAPY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,kBAAI,CAAC,CAAA;qCACD,oBAAU;GAHvB,WAAW,CAOvB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { Repository } from 'typeorm';
|
|
3
|
+
import { ContentTargetType } from '../constants/social-network.constant';
|
|
4
|
+
import { Save } from '../entities/save.entity';
|
|
5
|
+
export declare class SaveService extends TypeOrmCrudService<Save> {
|
|
6
|
+
readonly repo: Repository<Save>;
|
|
7
|
+
constructor(repo: Repository<Save>);
|
|
8
|
+
save(userId: string, targetType: ContentTargetType, targetId: string, metadata?: Record<string, unknown>): Promise<Save>;
|
|
9
|
+
unsave(userId: string, targetType: ContentTargetType, targetId: string): Promise<void>;
|
|
10
|
+
isSaved(userId: string, targetType: ContentTargetType, targetId: string): Promise<boolean>;
|
|
11
|
+
getSavedByUser(userId: string, options?: {
|
|
12
|
+
targetType?: ContentTargetType;
|
|
13
|
+
take?: number;
|
|
14
|
+
skip?: number;
|
|
15
|
+
}): Promise<Save[]>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=save.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save.service.d.ts","sourceRoot":"","sources":["../../src/services/save.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE/C,qBACa,WAAY,SAAQ,kBAAkB,CAAC,IAAI,CAAC;aAGrC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;gBAAtB,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;IAKlC,IAAI,CACR,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,iBAAiB,EAC7B,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC;IASV,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItF,OAAO,CACX,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,iBAAiB,EAC7B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC;IAOb,cAAc,CAClB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,iBAAiB,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GACzE,OAAO,CAAC,IAAI,EAAE,CAAC;CAWnB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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.SaveService = void 0;
|
|
16
|
+
const crud_typeorm_1 = require("@dataui/crud-typeorm");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const save_entity_1 = require("../entities/save.entity");
|
|
21
|
+
let SaveService = class SaveService extends crud_typeorm_1.TypeOrmCrudService {
|
|
22
|
+
repo;
|
|
23
|
+
constructor(repo) {
|
|
24
|
+
super(repo);
|
|
25
|
+
this.repo = repo;
|
|
26
|
+
}
|
|
27
|
+
async save(userId, targetType, targetId, metadata) {
|
|
28
|
+
let row = await this.repo.findOne({
|
|
29
|
+
where: { userId, targetType, targetId },
|
|
30
|
+
});
|
|
31
|
+
if (row)
|
|
32
|
+
return row;
|
|
33
|
+
row = this.repo.create({ userId, targetType, targetId, metadata });
|
|
34
|
+
return this.repo.save(row);
|
|
35
|
+
}
|
|
36
|
+
async unsave(userId, targetType, targetId) {
|
|
37
|
+
await this.repo.delete({ userId, targetType, targetId });
|
|
38
|
+
}
|
|
39
|
+
async isSaved(userId, targetType, targetId) {
|
|
40
|
+
const count = await this.repo.count({
|
|
41
|
+
where: { userId, targetType, targetId },
|
|
42
|
+
});
|
|
43
|
+
return count > 0;
|
|
44
|
+
}
|
|
45
|
+
async getSavedByUser(userId, options) {
|
|
46
|
+
const qb = this.repo
|
|
47
|
+
.createQueryBuilder('s')
|
|
48
|
+
.where('s.userId = :userId', { userId });
|
|
49
|
+
if (options?.targetType) {
|
|
50
|
+
qb.andWhere('s.targetType = :targetType', { targetType: options.targetType });
|
|
51
|
+
}
|
|
52
|
+
if (options?.take)
|
|
53
|
+
qb.take(options.take);
|
|
54
|
+
if (options?.skip)
|
|
55
|
+
qb.skip(options.skip);
|
|
56
|
+
return qb.orderBy('s.createdAt', 'DESC').getMany();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.SaveService = SaveService;
|
|
60
|
+
exports.SaveService = SaveService = __decorate([
|
|
61
|
+
(0, common_1.Injectable)(),
|
|
62
|
+
__param(0, (0, typeorm_1.InjectRepository)(save_entity_1.Save)),
|
|
63
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
64
|
+
], SaveService);
|
|
65
|
+
//# sourceMappingURL=save.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save.service.js","sourceRoot":"","sources":["../../src/services/save.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AAGrC,yDAA+C;AAGxC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,iCAAwB;IAGrC;IAFlB,YAEkB,IAAsB;QAEtC,KAAK,CAAC,IAAI,CAAC,CAAC;QAFI,SAAI,GAAJ,IAAI,CAAkB;IAGxC,CAAC;IAED,KAAK,CAAC,IAAI,CACR,MAAc,EACd,UAA6B,EAC7B,QAAgB,EAChB,QAAkC;QAElC,IAAI,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YAChC,KAAK,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE;SACxC,CAAC,CAAC;QACH,IAAI,GAAG;YAAE,OAAO,GAAG,CAAC;QACpB,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,UAA6B,EAAE,QAAgB;QAC1E,M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m';
|
|
3
|
+
import { Story } from '../entities/story.entity';
|
|
4
|
+
export declare class StoryService extends TypeOrmCrudService<Story> {
|
|
5
|
+
readonly repo: Repository<Story>;
|
|
6
|
+
constructor(repo: Repository<Story>);
|
|
7
|
+
getActiveStories(options: {
|
|
8
|
+
userId?: string;
|
|
9
|
+
take?: number;
|
|
10
|
+
skip?: number;
|
|
11
|
+
}): Promise<Story[]>;
|
|
12
|
+
deleteExpired(olderThan: Date): Promise<number>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=story.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"story.service.d.ts","sourceRoot":"","sources":["../../src/services/story.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAY,UAAU,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,qBACa,YAAa,SAAQ,kBAAkB,CAAC,KAAK,CAAC;aAGvC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC;gBAAvB,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC;IAMnC,gBAAgB,CAAC,OAAO,EAAE;QAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAWd,aAAa,CAAC,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;CAItD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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.StoryService = void 0;
|
|
16
|
+
const crud_typeorm_1 = require("@dataui/crud-typeorm");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
|
+
const typeorm_2 = require("typeorm");
|
|
20
|
+
const story_entity_1 = require("../entities/story.entity");
|
|
21
|
+
let StoryService = class StoryService extends crud_typeorm_1.TypeOrmCrudService {
|
|
22
|
+
repo;
|
|
23
|
+
constructor(repo) {
|
|
24
|
+
super(repo);
|
|
25
|
+
this.repo = repo;
|
|
26
|
+
}
|
|
27
|
+
async getActiveStories(options) {
|
|
28
|
+
const qb = this.repo
|
|
29
|
+
.createQueryBuilder('s')
|
|
30
|
+
.where('s.expiresAt > :now', { now: new Date() });
|
|
31
|
+
if (options.userId)
|
|
32
|
+
qb.andWhere('s.userId = :userId', { userId: options.userId });
|
|
33
|
+
if (options.take)
|
|
34
|
+
qb.take(options.take);
|
|
35
|
+
if (options.skip)
|
|
36
|
+
qb.skip(options.skip);
|
|
37
|
+
return qb.orderBy('s.createdAt', 'DESC').getMany();
|
|
38
|
+
}
|
|
39
|
+
async deleteExpired(olderThan) {
|
|
40
|
+
const result = await this.repo.delete({ expiresAt: (0, typeorm_2.LessThan)(olderThan) });
|
|
41
|
+
return result.affected ?? 0;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.StoryService = StoryService;
|
|
45
|
+
exports.StoryService = StoryService = __decorate([
|
|
46
|
+
(0, common_1.Injectable)(),
|
|
47
|
+
__param(0, (0, typeorm_1.InjectRepository)(story_entity_1.Story)),
|
|
48
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
49
|
+
], StoryService);
|
|
50
|
+
//# sourceMappingURL=story.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"story.service.js","sourceRoot":"","sources":["../../src/services/story.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA4C;AAC5C,6CAAmD;AACnD,qCAA+C;AAE/C,2DAAiD;AAG1C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,iCAAyB;IAGvC;IAFlB,YAEkB,IAAuB;QAEvC,KAAK,CAAC,IAAI,CAAC,CAAC;QAFI,SAAI,GAAJ,IAAI,CAAmB;IAGzC,CAAC;IAGD,KAAK,CAAC,gBAAgB,CAAC,OAItB;QACC,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI;aACjB,kBAAkB,CAAC,GAAG,CAAC;aACvB,KAAK,CAAC,oBAAoB,EAAE,EAAE,GAAG,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;QACpD,IAAI,OAAO,CAAC,MAAM;YAAE,EAAE,CAAC,QAAQ,CAAC,oBAAoB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAClF,IAAI,OAAO,CAAC,IAAI;YAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,OAAO,CAAC,IAAI;YAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACxC,OAAO,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC;IACrD,CAAC;IAGD,KAAK,CAAC,aAAa,CAAC,SAAe;QACjC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,IAAA,kBAAQ,EAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAC1E,OAAO,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF,CAAA;AA5BY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,oBAAK,CAAC,CAAA;qCACF,oBAAU;GAHvB,YAAY,CA4BxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social-network.module.d.ts","sourceRoot":"","sources":["../src/social-network.module.ts"],"names":[],"mappings":"AAgEA,qBAKa,mBAAmB;CAAG"}
|
|
@@ -0,0 +1,80 @@
|
|
|
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.SocialNetworkModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
12
|
+
const comment_entity_1 = require("./entities/comment.entity");
|
|
13
|
+
const content_hashtag_entity_1 = require("./entities/content-hashtag.entity");
|
|
14
|
+
const content_music_entity_1 = require("./entities/content-music.entity");
|
|
15
|
+
const content_tagged_place_entity_1 = require("./entities/content-tagged-place.entity");
|
|
16
|
+
const content_tagged_user_entity_1 = require("./entities/content-tagged-user.entity");
|
|
17
|
+
const follow_entity_1 = require("./entities/follow.entity");
|
|
18
|
+
const friend_request_entity_1 = require("./entities/friend-request.entity");
|
|
19
|
+
const friendship_entity_1 = require("./entities/friendship.entity");
|
|
20
|
+
const post_entity_1 = require("./entities/post.entity");
|
|
21
|
+
const reaction_entity_1 = require("./entities/reaction.entity");
|
|
22
|
+
const reel_entity_1 = require("./entities/reel.entity");
|
|
23
|
+
const save_entity_1 = require("./entities/save.entity");
|
|
24
|
+
const story_entity_1 = require("./entities/story.entity");
|
|
25
|
+
const comment_service_1 = require("./services/comment.service");
|
|
26
|
+
const content_hashtag_service_1 = require("./services/content-hashtag.service");
|
|
27
|
+
const content_music_service_1 = require("./services/content-music.service");
|
|
28
|
+
const content_tagged_place_service_1 = require("./services/content-tagged-place.service");
|
|
29
|
+
const content_tagged_user_service_1 = require("./services/content-tagged-user.service");
|
|
30
|
+
const feed_service_1 = require("./services/feed.service");
|
|
31
|
+
const follow_service_1 = require("./services/follow.service");
|
|
32
|
+
const friend_request_service_1 = require("./services/friend-request.service");
|
|
33
|
+
const friendship_service_1 = require("./services/friendship.service");
|
|
34
|
+
const post_service_1 = require("./services/post.service");
|
|
35
|
+
const reaction_service_1 = require("./services/reaction.service");
|
|
36
|
+
const reel_service_1 = require("./services/reel.service");
|
|
37
|
+
const save_service_1 = require("./services/save.service");
|
|
38
|
+
const story_service_1 = require("./services/story.service");
|
|
39
|
+
const entities = [
|
|
40
|
+
post_entity_1.Post,
|
|
41
|
+
reel_entity_1.Reel,
|
|
42
|
+
story_entity_1.Story,
|
|
43
|
+
content_tagged_user_entity_1.ContentTaggedUser,
|
|
44
|
+
content_tagged_place_entity_1.ContentTaggedPlace,
|
|
45
|
+
content_hashtag_entity_1.ContentHashtag,
|
|
46
|
+
content_music_entity_1.ContentMusic,
|
|
47
|
+
friendship_entity_1.Friendship,
|
|
48
|
+
friend_request_entity_1.FriendRequest,
|
|
49
|
+
follow_entity_1.Follow,
|
|
50
|
+
reaction_entity_1.Reaction,
|
|
51
|
+
comment_entity_1.Comment,
|
|
52
|
+
save_entity_1.Save,
|
|
53
|
+
];
|
|
54
|
+
const services = [
|
|
55
|
+
feed_service_1.FeedService,
|
|
56
|
+
post_service_1.PostService,
|
|
57
|
+
reel_service_1.ReelService,
|
|
58
|
+
story_service_1.StoryService,
|
|
59
|
+
friend_request_service_1.FriendRequestService,
|
|
60
|
+
friendship_service_1.FriendshipService,
|
|
61
|
+
follow_service_1.FollowService,
|
|
62
|
+
reaction_service_1.ReactionService,
|
|
63
|
+
comment_service_1.CommentService,
|
|
64
|
+
save_service_1.SaveService,
|
|
65
|
+
content_tagged_user_service_1.ContentTaggedUserService,
|
|
66
|
+
content_tagged_place_service_1.ContentTaggedPlaceService,
|
|
67
|
+
content_hashtag_service_1.ContentHashtagService,
|
|
68
|
+
content_music_service_1.ContentMusicService,
|
|
69
|
+
];
|
|
70
|
+
let SocialNetworkModule = class SocialNetworkModule {
|
|
71
|
+
};
|
|
72
|
+
exports.SocialNetworkModule = SocialNetworkModule;
|
|
73
|
+
exports.SocialNetworkModule = SocialNetworkModule = __decorate([
|
|
74
|
+
(0, common_1.Module)({
|
|
75
|
+
imports: [typeorm_1.TypeOrmModule.forFeature(entities)],
|
|
76
|
+
providers: services,
|
|
77
|
+
exports: [typeorm_1.TypeOrmModule, ...services],
|
|
78
|
+
})
|
|
79
|
+
], SocialNetworkModule);
|
|
80
|
+
//# sourceMappingURL=social-network.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social-network.module.js","sourceRoot":"","sources":["../src/social-network.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAEhD,8DAAoD;AACpD,8EAAmE;AACnE,0EAA+D;AAC/D,wFAA4E;AAC5E,sFAA0E;AAC1E,4DAAkD;AAClD,4EAAiE;AACjE,oEAA0D;AAC1D,wDAA8C;AAC9C,gEAAsD;AACtD,wDAA8C;AAC9C,wDAA8C;AAC9C,0DAAgD;AAChD,gEAA4D;AAC5D,gFAA2E;AAC3E,4EAAuE;AACvE,0FAAoF;AACpF,wFAAkF;AAClF,0DAAsD;AACtD,8DAA0D;AAC1D,8EAAyE;AACzE,sEAAkE;AAClE,0DAAsD;AACtD,kEAA8D;AAC9D,0DAAsD;AACtD,0DAAsD;AACtD,4DAAwD;AAExD,MAAM,QAAQ,GAAG;IACf,kBAAI;IACJ,kBAAI;IACJ,oBAAK;IACL,8CAAiB;IACjB,gDAAkB;IAClB,uCAAc;IACd,mCAAY;IACZ,8BAAU;IACV,qCAAa;IACb,sBAAM;IACN,0BAAQ;IACR,wBAAO;IACP,kBAAI;CACL,CAAC;AAEF,MAAM,QAAQ,GAAG;IACf,0BAAW;IACX,0BAAW;IACX,0BAAW;IACX,4BAAY;IACZ,6CAAoB;IACpB,sCAAiB;IACjB,8BAAa;IACb,kCAAe;IACf,gCAAc;IACd,0BAAW;IACX,sDAAwB;IACxB,wDAAyB;IACzB,+CAAqB;IACrB,2CAAmB;CACpB,CAAC;AAOK,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,kDAAmB;8BAAnB,mBAAmB;IAL/B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC7C,SAAS,EAAE,QAAQ;QACnB,OAAO,EAAE,CAAC,uBAAa,EAAE,GAAG,QAAQ,CAAC;KACtC,CAAC;GACW,mBAAmB,CAAG"}
|