@venturialstd/social-network 0.0.8 → 0.0.10
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/social-network.constant.d.ts +11 -0
- package/dist/constants/social-network.constant.d.ts.map +1 -1
- package/dist/constants/social-network.constant.js +14 -1
- package/dist/constants/social-network.constant.js.map +1 -1
- package/dist/entities/content-media.entity.d.ts +14 -0
- package/dist/entities/content-media.entity.d.ts.map +1 -0
- package/dist/entities/content-media.entity.js +105 -0
- package/dist/entities/content-media.entity.js.map +1 -0
- package/dist/entities/post.entity.d.ts +2 -1
- package/dist/entities/post.entity.d.ts.map +1 -1
- package/dist/entities/post.entity.js +2 -2
- package/dist/entities/post.entity.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/services/content-media.service.d.ts +20 -0
- package/dist/services/content-media.service.d.ts.map +1 -0
- package/dist/services/content-media.service.js +116 -0
- package/dist/services/content-media.service.js.map +1 -0
- package/dist/services/feed.service.js +4 -4
- package/dist/social-network.module.d.ts +4 -2
- package/dist/social-network.module.d.ts.map +1 -1
- package/dist/social-network.module.js +4 -0
- package/dist/social-network.module.js.map +1 -1
- package/dist/types/content-media.types.d.ts +13 -0
- package/dist/types/content-media.types.d.ts.map +1 -0
- package/dist/types/content-media.types.js +3 -0
- package/dist/types/content-media.types.js.map +1 -0
- package/package.json +1 -1
|
@@ -24,6 +24,17 @@ export declare enum StoryMediaType {
|
|
|
24
24
|
IMAGE = "IMAGE",
|
|
25
25
|
VIDEO = "VIDEO"
|
|
26
26
|
}
|
|
27
|
+
export declare enum ContentMediaType {
|
|
28
|
+
IMAGE = "IMAGE",
|
|
29
|
+
VIDEO = "VIDEO",
|
|
30
|
+
AUDIO = "AUDIO"
|
|
31
|
+
}
|
|
32
|
+
export declare enum ContentMediaStatus {
|
|
33
|
+
ACTIVE = "ACTIVE",
|
|
34
|
+
UNDER_REVIEW = "UNDER_REVIEW",
|
|
35
|
+
BANNED = "BANNED",
|
|
36
|
+
DELETED = "DELETED"
|
|
37
|
+
}
|
|
27
38
|
export declare enum TaggableContentType {
|
|
28
39
|
POST = "POST",
|
|
29
40
|
REEL = "REEL",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-network.constant.d.ts","sourceRoot":"","sources":["../../src/constants/social-network.constant.ts"],"names":[],"mappings":"AAGA,oBAAY,iBAAiB;IAC3B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAKD,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB;AAKD,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB;AAKD,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAKD,oBAAY,cAAc;IACxB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAMD,oBAAY,mBAAmB;IAC7B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;CAChB"}
|
|
1
|
+
{"version":3,"file":"social-network.constant.d.ts","sourceRoot":"","sources":["../../src/constants/social-network.constant.ts"],"names":[],"mappings":"AAGA,oBAAY,iBAAiB;IAC3B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAKD,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB;AAKD,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB;AAKD,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAKD,oBAAY,cAAc;IACxB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAKD,oBAAY,gBAAgB;IAC1B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAKD,oBAAY,kBAAkB;IAC5B,MAAM,WAAW;IACjB,YAAY,iBAAiB;IAC7B,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAMD,oBAAY,mBAAmB;IAC7B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;CAChB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaggableContentType = exports.StoryMediaType = exports.FriendshipStatus = exports.FriendRequestStatus = exports.ReactionType = exports.ContentTargetType = void 0;
|
|
3
|
+
exports.TaggableContentType = exports.ContentMediaStatus = exports.ContentMediaType = exports.StoryMediaType = exports.FriendshipStatus = exports.FriendRequestStatus = exports.ReactionType = exports.ContentTargetType = void 0;
|
|
4
4
|
var ContentTargetType;
|
|
5
5
|
(function (ContentTargetType) {
|
|
6
6
|
ContentTargetType["POST"] = "POST";
|
|
@@ -32,6 +32,19 @@ var StoryMediaType;
|
|
|
32
32
|
StoryMediaType["IMAGE"] = "IMAGE";
|
|
33
33
|
StoryMediaType["VIDEO"] = "VIDEO";
|
|
34
34
|
})(StoryMediaType || (exports.StoryMediaType = StoryMediaType = {}));
|
|
35
|
+
var ContentMediaType;
|
|
36
|
+
(function (ContentMediaType) {
|
|
37
|
+
ContentMediaType["IMAGE"] = "IMAGE";
|
|
38
|
+
ContentMediaType["VIDEO"] = "VIDEO";
|
|
39
|
+
ContentMediaType["AUDIO"] = "AUDIO";
|
|
40
|
+
})(ContentMediaType || (exports.ContentMediaType = ContentMediaType = {}));
|
|
41
|
+
var ContentMediaStatus;
|
|
42
|
+
(function (ContentMediaStatus) {
|
|
43
|
+
ContentMediaStatus["ACTIVE"] = "ACTIVE";
|
|
44
|
+
ContentMediaStatus["UNDER_REVIEW"] = "UNDER_REVIEW";
|
|
45
|
+
ContentMediaStatus["BANNED"] = "BANNED";
|
|
46
|
+
ContentMediaStatus["DELETED"] = "DELETED";
|
|
47
|
+
})(ContentMediaStatus || (exports.ContentMediaStatus = ContentMediaStatus = {}));
|
|
35
48
|
var TaggableContentType;
|
|
36
49
|
(function (TaggableContentType) {
|
|
37
50
|
TaggableContentType["POST"] = "POST";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-network.constant.js","sourceRoot":"","sources":["../../src/constants/social-network.constant.ts"],"names":[],"mappings":";;;AAGA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,wCAAmB,CAAA;AACrB,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B;AAKD,IAAY,YAOX;AAPD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,+BAAe,CAAA;AACjB,CAAC,EAPW,YAAY,4BAAZ,YAAY,QAOvB;AAKD,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,4CAAqB,CAAA;IACrB,4CAAqB,CAAA;AACvB,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B;AAKD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;AACrB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAKD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAMD,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,oCAAa,CAAA;IACb,sCAAe,CAAA;AACjB,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B"}
|
|
1
|
+
{"version":3,"file":"social-network.constant.js","sourceRoot":"","sources":["../../src/constants/social-network.constant.ts"],"names":[],"mappings":";;;AAGA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,kCAAa,CAAA;IACb,wCAAmB,CAAA;AACrB,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B;AAKD,IAAY,YAOX;AAPD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,2BAAW,CAAA;IACX,2BAAW,CAAA;IACX,+BAAe,CAAA;AACjB,CAAC,EAPW,YAAY,4BAAZ,YAAY,QAOvB;AAKD,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,4CAAqB,CAAA;IACrB,4CAAqB,CAAA;AACvB,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B;AAKD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;AACrB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAKD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAKD,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,mCAAe,CAAA;IACf,mCAAe,CAAA;AACjB,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAKD,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,mDAA6B,CAAA;IAC7B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACrB,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B;AAMD,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,oCAAa,CAAA;IACb,sCAAe,CAAA;AACjB,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContentMediaStatus, ContentMediaType, TaggableContentType } from '../constants/social-network.constant';
|
|
2
|
+
export declare class ContentMedia {
|
|
3
|
+
id: string;
|
|
4
|
+
contentType: TaggableContentType;
|
|
5
|
+
contentId: string;
|
|
6
|
+
url: string;
|
|
7
|
+
mediaType: ContentMediaType;
|
|
8
|
+
position: number;
|
|
9
|
+
status: ContentMediaStatus;
|
|
10
|
+
metadata: Record<string, unknown>;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=content-media.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-media.entity.d.ts","sourceRoot":"","sources":["../../src/entities/content-media.entity.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAU9C,qBAKa,YAAY;IAEvB,EAAE,EAAE,MAAM,CAAC;IAMX,WAAW,EAAE,mBAAmB,CAAC;IAKjC,SAAS,EAAE,MAAM,CAAC;IAOlB,GAAG,EAAE,MAAM,CAAC;IAOZ,SAAS,EAAE,gBAAgB,CAAC;IAM5B,QAAQ,EAAE,MAAM,CAAC;IAQjB,MAAM,EAAE,kBAAkB,CAAC;IAK3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAQlC,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
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.ContentMedia = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const social_network_constant_1 = require("../constants/social-network.constant");
|
|
16
|
+
let ContentMedia = class ContentMedia {
|
|
17
|
+
id;
|
|
18
|
+
contentType;
|
|
19
|
+
contentId;
|
|
20
|
+
url;
|
|
21
|
+
mediaType;
|
|
22
|
+
position;
|
|
23
|
+
status;
|
|
24
|
+
metadata;
|
|
25
|
+
createdAt;
|
|
26
|
+
updatedAt;
|
|
27
|
+
};
|
|
28
|
+
exports.ContentMedia = ContentMedia;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], ContentMedia.prototype, "id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({
|
|
35
|
+
type: 'enum',
|
|
36
|
+
enum: social_network_constant_1.TaggableContentType,
|
|
37
|
+
}),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], ContentMedia.prototype, "contentType", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'uuid' }),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], ContentMedia.prototype, "contentId", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_validator_1.IsString)(),
|
|
48
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
49
|
+
(0, class_validator_1.MaxLength)(2048),
|
|
50
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 2048 }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], ContentMedia.prototype, "url", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({
|
|
55
|
+
type: 'enum',
|
|
56
|
+
enum: social_network_constant_1.ContentMediaType,
|
|
57
|
+
default: social_network_constant_1.ContentMediaType.IMAGE,
|
|
58
|
+
}),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], ContentMedia.prototype, "mediaType", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_validator_1.IsNumber)(),
|
|
63
|
+
(0, class_validator_1.Min)(0),
|
|
64
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
65
|
+
__metadata("design:type", Number)
|
|
66
|
+
], ContentMedia.prototype, "position", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({
|
|
69
|
+
type: 'enum',
|
|
70
|
+
enum: social_network_constant_1.ContentMediaStatus,
|
|
71
|
+
default: social_network_constant_1.ContentMediaStatus.ACTIVE,
|
|
72
|
+
}),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], ContentMedia.prototype, "status", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, class_validator_1.IsOptional)(),
|
|
77
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], ContentMedia.prototype, "metadata", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.CreateDateColumn)({
|
|
82
|
+
name: 'createdAt',
|
|
83
|
+
nullable: false,
|
|
84
|
+
type: 'timestamptz',
|
|
85
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", Date)
|
|
88
|
+
], ContentMedia.prototype, "createdAt", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, typeorm_1.UpdateDateColumn)({
|
|
91
|
+
name: 'updatedAt',
|
|
92
|
+
nullable: false,
|
|
93
|
+
type: 'timestamptz',
|
|
94
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", Date)
|
|
97
|
+
], ContentMedia.prototype, "updatedAt", void 0);
|
|
98
|
+
exports.ContentMedia = ContentMedia = __decorate([
|
|
99
|
+
(0, typeorm_1.Entity)('social_content_media'),
|
|
100
|
+
(0, typeorm_1.Index)(['url', 'contentType']),
|
|
101
|
+
(0, typeorm_1.Index)(['contentType', 'contentId']),
|
|
102
|
+
(0, typeorm_1.Index)(['contentType', 'contentId', 'position'], { unique: true }),
|
|
103
|
+
(0, typeorm_1.Index)(['status'])
|
|
104
|
+
], ContentMedia);
|
|
105
|
+
//# sourceMappingURL=content-media.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-media.entity.js","sourceRoot":"","sources":["../../src/entities/content-media.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAOyB;AACzB,qCAOiB;AAEjB,kFAI8C;AAevC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEvB,EAAE,CAAS;IAMX,WAAW,CAAsB;IAKjC,SAAS,CAAS;IAOlB,GAAG,CAAS;IAOZ,SAAS,CAAmB;IAM5B,QAAQ,CAAS;IAQjB,MAAM,CAAqB;IAK3B,QAAQ,CAA0B;IAQlC,SAAS,CAAO;IAQhB,SAAS,CAAO;CACjB,CAAA;AA/DY,oCAAY;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,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB;KACnC,CAAC;8BACS,IAAI;+CAAC;uBA9DL,YAAY;IALxB,IAAA,gBAAM,EAAC,sBAAsB,CAAC;IAC9B,IAAA,eAAK,EAAC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAC7B,IAAA,eAAK,EAAC,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IACnC,IAAA,eAAK,EAAC,CAAC,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACjE,IAAA,eAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;GACL,YAAY,CA+DxB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { MediaCacheItem } from '../types/content-media.types';
|
|
1
2
|
export declare class Post {
|
|
2
3
|
id: string;
|
|
3
4
|
userId: string;
|
|
4
5
|
caption: string;
|
|
5
|
-
|
|
6
|
+
media: MediaCacheItem[];
|
|
6
7
|
elements: Record<string, unknown>[];
|
|
7
8
|
location: string;
|
|
8
9
|
allowComments: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.entity.d.ts","sourceRoot":"","sources":["../../src/entities/post.entity.ts"],"names":[],"mappings":"AAgBA,qBACa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAMX,MAAM,EAAE,MAAM,CAAC;IAKf,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"post.entity.d.ts","sourceRoot":"","sources":["../../src/entities/post.entity.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,qBACa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAMX,MAAM,EAAE,MAAM,CAAC;IAKf,OAAO,EAAE,MAAM,CAAC;IAUhB,KAAK,EAAE,cAAc,EAAE,CAAC;IASxB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAKpC,QAAQ,EAAE,MAAM,CAAC;IAMjB,aAAa,EAAE,OAAO,CAAC;IAIvB,UAAU,EAAE,OAAO,CAAC;IAIpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAQlC,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -16,7 +16,7 @@ let Post = class Post {
|
|
|
16
16
|
id;
|
|
17
17
|
userId;
|
|
18
18
|
caption;
|
|
19
|
-
|
|
19
|
+
media;
|
|
20
20
|
elements;
|
|
21
21
|
location;
|
|
22
22
|
allowComments;
|
|
@@ -48,7 +48,7 @@ __decorate([
|
|
|
48
48
|
(0, class_validator_1.IsOptional)(),
|
|
49
49
|
(0, typeorm_1.Column)({ type: 'jsonb', default: [] }),
|
|
50
50
|
__metadata("design:type", Array)
|
|
51
|
-
], Post.prototype, "
|
|
51
|
+
], Post.prototype, "media", void 0);
|
|
52
52
|
__decorate([
|
|
53
53
|
(0, class_validator_1.IsOptional)(),
|
|
54
54
|
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true, default: [] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.entity.js","sourceRoot":"","sources":["../../src/entities/post.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAMyB;AACzB,qCAOiB;
|
|
1
|
+
{"version":3,"file":"post.entity.js","sourceRoot":"","sources":["../../src/entities/post.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAMyB;AACzB,qCAOiB;AAKV,IAAM,IAAI,GAAV,MAAM,IAAI;IAEf,EAAE,CAAS;IAMX,MAAM,CAAS;IAKf,OAAO,CAAS;IAUhB,KAAK,CAAmB;IASxB,QAAQ,CAA4B;IAKpC,QA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;;sCACR;AAQlC;IANC,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB;KACnC,CAAC;8BACS,IAAI;uCAAC;AAQhB;IANC,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB;KACnC,CAAC;8BACS,IAAI;uCAAC;eAnEL,IAAI;IADhB,IAAA,gBAAM,EAAC,aAAa,CAAC;GACT,IAAI,CAoEhB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './constants/feed.constant';
|
|
|
3
3
|
export * from './constants/social-network.constant';
|
|
4
4
|
export * from './entities/comment.entity';
|
|
5
5
|
export * from './entities/content-hashtag.entity';
|
|
6
|
+
export * from './entities/content-media.entity';
|
|
6
7
|
export * from './entities/content-music.entity';
|
|
7
8
|
export * from './entities/content-tagged-place.entity';
|
|
8
9
|
export * from './entities/content-tagged-user.entity';
|
|
@@ -16,6 +17,7 @@ export * from './entities/save.entity';
|
|
|
16
17
|
export * from './entities/story.entity';
|
|
17
18
|
export * from './services/comment.service';
|
|
18
19
|
export * from './services/content-hashtag.service';
|
|
20
|
+
export * from './services/content-media.service';
|
|
19
21
|
export * from './services/feed.service';
|
|
20
22
|
export * from './services/content-music.service';
|
|
21
23
|
export * from './services/content-tagged-place.service';
|
|
@@ -31,6 +33,7 @@ export * from './services/story.service';
|
|
|
31
33
|
export { SOCIAL_NETWORK_ENTITIES, SOCIAL_NETWORK_SERVICES } from './social-network.module';
|
|
32
34
|
export * from './social-network.module';
|
|
33
35
|
export * from './types/content-element.types';
|
|
36
|
+
export * from './types/content-media.types';
|
|
34
37
|
export * from './types/content-music.types';
|
|
35
38
|
export * from './types/feed.types';
|
|
36
39
|
export * from './utils/user-settings-privacy.util';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __exportStar(require("./constants/feed.constant"), exports);
|
|
|
20
20
|
__exportStar(require("./constants/social-network.constant"), exports);
|
|
21
21
|
__exportStar(require("./entities/comment.entity"), exports);
|
|
22
22
|
__exportStar(require("./entities/content-hashtag.entity"), exports);
|
|
23
|
+
__exportStar(require("./entities/content-media.entity"), exports);
|
|
23
24
|
__exportStar(require("./entities/content-music.entity"), exports);
|
|
24
25
|
__exportStar(require("./entities/content-tagged-place.entity"), exports);
|
|
25
26
|
__exportStar(require("./entities/content-tagged-user.entity"), exports);
|
|
@@ -33,6 +34,7 @@ __exportStar(require("./entities/save.entity"), exports);
|
|
|
33
34
|
__exportStar(require("./entities/story.entity"), exports);
|
|
34
35
|
__exportStar(require("./services/comment.service"), exports);
|
|
35
36
|
__exportStar(require("./services/content-hashtag.service"), exports);
|
|
37
|
+
__exportStar(require("./services/content-media.service"), exports);
|
|
36
38
|
__exportStar(require("./services/feed.service"), exports);
|
|
37
39
|
__exportStar(require("./services/content-music.service"), exports);
|
|
38
40
|
__exportStar(require("./services/content-tagged-place.service"), exports);
|
|
@@ -50,6 +52,7 @@ Object.defineProperty(exports, "SOCIAL_NETWORK_ENTITIES", { enumerable: true, ge
|
|
|
50
52
|
Object.defineProperty(exports, "SOCIAL_NETWORK_SERVICES", { enumerable: true, get: function () { return social_network_module_1.SOCIAL_NETWORK_SERVICES; } });
|
|
51
53
|
__exportStar(require("./social-network.module"), exports);
|
|
52
54
|
__exportStar(require("./types/content-element.types"), exports);
|
|
55
|
+
__exportStar(require("./types/content-media.types"), exports);
|
|
53
56
|
__exportStar(require("./types/content-music.types"), exports);
|
|
54
57
|
__exportStar(require("./types/feed.types"), exports);
|
|
55
58
|
__exportStar(require("./utils/user-settings-privacy.util"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uEAAqD;AACrD,4DAA0C;AAC1C,sEAAoD;AACpD,4DAA0C;AAC1C,oEAAkD;AAClD,kEAAgD;AAChD,yEAAuD;AACvD,wEAAsD;AACtD,2DAAyC;AACzC,mEAAiD;AACjD,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,6DAA2C;AAC3C,qEAAmD;AACnD,0DAAwC;AACxC,mEAAiD;AACjD,0EAAwD;AACxD,yEAAuD;AACvD,4DAA0C;AAC1C,oEAAkD;AAClD,gEAA8C;AAC9C,0DAAwC;AACxC,8DAA4C;AAC5C,0DAAwC;AACxC,0DAAwC;AACxC,2DAAyC;AACzC,iEAA2F;AAAlF,gIAAA,uBAAuB,OAAA;AAAE,gIAAA,uBAAuB,OAAA;AACzD,0DAAwC;AACxC,gEAA8C;AAC9C,8DAA4C;AAC5C,qDAAmC;AACnC,qEAAmD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uEAAqD;AACrD,4DAA0C;AAC1C,sEAAoD;AACpD,4DAA0C;AAC1C,oEAAkD;AAClD,kEAAgD;AAChD,kEAAgD;AAChD,yEAAuD;AACvD,wEAAsD;AACtD,2DAAyC;AACzC,mEAAiD;AACjD,+DAA6C;AAC7C,yDAAuC;AACvC,6DAA2C;AAC3C,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,6DAA2C;AAC3C,qEAAmD;AACnD,mEAAiD;AACjD,0DAAwC;AACxC,mEAAiD;AACjD,0EAAwD;AACxD,yEAAuD;AACvD,4DAA0C;AAC1C,oEAAkD;AAClD,gEAA8C;AAC9C,0DAAwC;AACxC,8DAA4C;AAC5C,0DAAwC;AACxC,0DAAwC;AACxC,2DAAyC;AACzC,iEAA2F;AAAlF,gIAAA,uBAAuB,OAAA;AAAE,gIAAA,uBAAuB,OAAA;AACzD,0DAAwC;AACxC,gEAA8C;AAC9C,8DAA4C;AAC5C,8DAA4C;AAC5C,qDAAmC;AACnC,qEAAmD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { Repository } from 'typeorm';
|
|
3
|
+
import { TaggableContentType } from '../constants/social-network.constant';
|
|
4
|
+
import { ContentMedia } from '../entities/content-media.entity';
|
|
5
|
+
import { AddMediaInput, MediaCacheItem } from '../types/content-media.types';
|
|
6
|
+
export declare class ContentMediaService extends TypeOrmCrudService<ContentMedia> {
|
|
7
|
+
readonly repo: Repository<ContentMedia>;
|
|
8
|
+
constructor(repo: Repository<ContentMedia>);
|
|
9
|
+
addMedia(contentType: TaggableContentType, contentId: string, data: AddMediaInput): Promise<ContentMedia>;
|
|
10
|
+
removeAllMedia(contentType: TaggableContentType, contentId: string): Promise<void>;
|
|
11
|
+
getMediaForContent(contentType: TaggableContentType, contentId: string): Promise<ContentMedia[]>;
|
|
12
|
+
getMediaForContentBatch(contentType: TaggableContentType, contentIds: string[]): Promise<Map<string, ContentMedia[]>>;
|
|
13
|
+
setMediaForContent(contentType: TaggableContentType, contentId: string, items: AddMediaInput[]): Promise<{
|
|
14
|
+
rows: ContentMedia[];
|
|
15
|
+
cache: MediaCacheItem[];
|
|
16
|
+
}>;
|
|
17
|
+
banMedia(mediaId: string): Promise<ContentMedia | null>;
|
|
18
|
+
buildCacheForContent(contentType: TaggableContentType, contentId: string): Promise<MediaCacheItem[]>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=content-media.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-media.service.d.ts","sourceRoot":"","sources":["../../src/services/content-media.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAM,UAAU,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAGL,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE7E,qBACa,mBAAoB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;aAGrD,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC;gBAA9B,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC;IAM1C,QAAQ,CACZ,WAAW,EAAE,mBAAmB,EAChC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,YAAY,CAAC;IAwBlB,cAAc,CAClB,WAAW,EAAE,mBAAmB,EAChC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;IAKV,kBAAkB,CACtB,WAAW,EAAE,mBAAmB,EAChC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,YAAY,EAAE,CAAC;IAWpB,uBAAuB,CAC3B,WAAW,EAAE,mBAAmB,EAChC,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;IAuBjC,kBAAkB,CACtB,WAAW,EAAE,mBAAmB,EAChC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,aAAa,EAAE,GACrB,OAAO,CAAC;QAAE,IAAI,EAAE,YAAY,EAAE,CAAC;QAAC,KAAK,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC;IAuBvD,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAQvD,oBAAoB,CACxB,WAAW,EAAE,mBAAmB,EAChC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,cAAc,EAAE,CAAC;CAI7B"}
|
|
@@ -0,0 +1,116 @@
|
|
|
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.ContentMediaService = 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 content_media_entity_1 = require("../entities/content-media.entity");
|
|
22
|
+
let ContentMediaService = class ContentMediaService extends crud_typeorm_1.TypeOrmCrudService {
|
|
23
|
+
repo;
|
|
24
|
+
constructor(repo) {
|
|
25
|
+
super(repo);
|
|
26
|
+
this.repo = repo;
|
|
27
|
+
}
|
|
28
|
+
async addMedia(contentType, contentId, data) {
|
|
29
|
+
let row = await this.repo.findOne({
|
|
30
|
+
where: { contentType, contentId, position: data.position },
|
|
31
|
+
});
|
|
32
|
+
if (row) {
|
|
33
|
+
row.url = data.url;
|
|
34
|
+
row.mediaType = data.mediaType;
|
|
35
|
+
row.status = data.status ?? row.status;
|
|
36
|
+
row.metadata = data.metadata ?? row.metadata;
|
|
37
|
+
return this.repo.save(row);
|
|
38
|
+
}
|
|
39
|
+
row = this.repo.create({
|
|
40
|
+
contentType,
|
|
41
|
+
contentId,
|
|
42
|
+
url: data.url,
|
|
43
|
+
mediaType: data.mediaType,
|
|
44
|
+
position: data.position,
|
|
45
|
+
status: data.status ?? social_network_constant_1.ContentMediaStatus.ACTIVE,
|
|
46
|
+
metadata: data.metadata,
|
|
47
|
+
});
|
|
48
|
+
return this.repo.save(row);
|
|
49
|
+
}
|
|
50
|
+
async removeAllMedia(contentType, contentId) {
|
|
51
|
+
await this.repo.delete({ contentType, contentId });
|
|
52
|
+
}
|
|
53
|
+
async getMediaForContent(contentType, contentId) {
|
|
54
|
+
return this.repo.find({
|
|
55
|
+
where: { contentType, contentId, status: social_network_constant_1.ContentMediaStatus.ACTIVE },
|
|
56
|
+
order: { position: 'ASC' },
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
async getMediaForContentBatch(contentType, contentIds) {
|
|
60
|
+
if (contentIds.length === 0)
|
|
61
|
+
return new Map();
|
|
62
|
+
const rows = await this.repo.find({
|
|
63
|
+
where: {
|
|
64
|
+
contentType,
|
|
65
|
+
contentId: (0, typeorm_2.In)(contentIds),
|
|
66
|
+
status: social_network_constant_1.ContentMediaStatus.ACTIVE,
|
|
67
|
+
},
|
|
68
|
+
order: { contentId: 'ASC', position: 'ASC' },
|
|
69
|
+
});
|
|
70
|
+
const map = new Map();
|
|
71
|
+
for (const row of rows) {
|
|
72
|
+
const list = map.get(row.contentId) ?? [];
|
|
73
|
+
list.push(row);
|
|
74
|
+
map.set(row.contentId, list);
|
|
75
|
+
}
|
|
76
|
+
return map;
|
|
77
|
+
}
|
|
78
|
+
async setMediaForContent(contentType, contentId, items) {
|
|
79
|
+
await this.repo.delete({ contentType, contentId });
|
|
80
|
+
if (items.length === 0)
|
|
81
|
+
return { rows: [], cache: [] };
|
|
82
|
+
const entities = items.map((item) => this.repo.create({
|
|
83
|
+
contentType,
|
|
84
|
+
contentId,
|
|
85
|
+
url: item.url,
|
|
86
|
+
mediaType: item.mediaType,
|
|
87
|
+
position: item.position,
|
|
88
|
+
status: item.status ?? social_network_constant_1.ContentMediaStatus.ACTIVE,
|
|
89
|
+
metadata: item.metadata,
|
|
90
|
+
}));
|
|
91
|
+
const rows = await this.repo.save(entities);
|
|
92
|
+
const cache = rows
|
|
93
|
+
.filter((r) => r.status === social_network_constant_1.ContentMediaStatus.ACTIVE)
|
|
94
|
+
.sort((a, b) => a.position - b.position)
|
|
95
|
+
.map((r) => ({ url: r.url, type: r.mediaType }));
|
|
96
|
+
return { rows, cache };
|
|
97
|
+
}
|
|
98
|
+
async banMedia(mediaId) {
|
|
99
|
+
const row = await this.repo.findOne({ where: { id: mediaId } });
|
|
100
|
+
if (!row)
|
|
101
|
+
return null;
|
|
102
|
+
row.status = social_network_constant_1.ContentMediaStatus.BANNED;
|
|
103
|
+
return this.repo.save(row);
|
|
104
|
+
}
|
|
105
|
+
async buildCacheForContent(contentType, contentId) {
|
|
106
|
+
const rows = await this.getMediaForContent(contentType, contentId);
|
|
107
|
+
return rows.map((r) => ({ url: r.url, type: r.mediaType }));
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
exports.ContentMediaService = ContentMediaService;
|
|
111
|
+
exports.ContentMediaService = ContentMediaService = __decorate([
|
|
112
|
+
(0, common_1.Injectable)(),
|
|
113
|
+
__param(0, (0, typeorm_1.InjectRepository)(content_media_entity_1.ContentMedia)),
|
|
114
|
+
__metadata("design:paramtypes", [typeorm_2.Repository])
|
|
115
|
+
], ContentMediaService);
|
|
116
|
+
//# sourceMappingURL=content-media.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-media.service.js","sourceRoot":"","sources":["../../src/services/content-media.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAyC;AAEzC,kFAI8C;AAC9C,2EAAgE;AAIzD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,iCAAgC;IAGrD;IAFlB,YAEkB,IAA8B;QAE9C,KAAK,CAAC,IAAI,CAAC,CA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vC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAGD,KAAK,CAAC,oBAAoB,CACxB,WAAgC,EAChC,SAAiB;QAEjB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAC9D,CAAC;CACF,CAAA;AA/HY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,mCAAY,CAAC,CAAA;qCACT,oBAAU;GAHvB,mBAAmB,CA+H/B"}
|
|
@@ -51,10 +51,10 @@ let FeedService = class FeedService {
|
|
|
51
51
|
if (options.authorIds?.length) {
|
|
52
52
|
qb.andWhere('p.userId IN (:...authorIds)', { authorIds: options.authorIds });
|
|
53
53
|
}
|
|
54
|
-
const scoreExpr = `(
|
|
55
|
-
(SELECT COUNT(*) FROM social_comment c WHERE c."targetType"::text = 'POST' AND c."targetId" = p.id) * :commentWeight +
|
|
56
|
-
(SELECT COUNT(*) FROM social_reaction r WHERE r."targetType"::text = 'POST' AND r."targetId" = p.id) * :reactionWeight +
|
|
57
|
-
(1.0 / (1.0 + EXTRACT(EPOCH FROM (NOW() - p."createdAt")) / 86400.0)) * :recencyWeight
|
|
54
|
+
const scoreExpr = `(
|
|
55
|
+
(SELECT COUNT(*) FROM social_comment c WHERE c."targetType"::text = 'POST' AND c."targetId" = p.id) * :commentWeight +
|
|
56
|
+
(SELECT COUNT(*) FROM social_reaction r WHERE r."targetType"::text = 'POST' AND r."targetId" = p.id) * :reactionWeight +
|
|
57
|
+
(1.0 / (1.0 + EXTRACT(EPOCH FROM (NOW() - p."createdAt")) / 86400.0)) * :recencyWeight
|
|
58
58
|
)`;
|
|
59
59
|
qb.addSelect(scoreExpr, 'importance_score')
|
|
60
60
|
.setParameter('commentWeight', weights.commentWeight)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ContentHashtag } from './entities/content-hashtag.entity';
|
|
2
|
+
import { ContentMedia } from './entities/content-media.entity';
|
|
2
3
|
import { ContentMusic } from './entities/content-music.entity';
|
|
3
4
|
import { ContentTaggedPlace } from './entities/content-tagged-place.entity';
|
|
4
5
|
import { ContentTaggedUser } from './entities/content-tagged-user.entity';
|
|
@@ -11,6 +12,7 @@ import { Save } from './entities/save.entity';
|
|
|
11
12
|
import { Story } from './entities/story.entity';
|
|
12
13
|
import { CommentService } from './services/comment.service';
|
|
13
14
|
import { ContentHashtagService } from './services/content-hashtag.service';
|
|
15
|
+
import { ContentMediaService } from './services/content-media.service';
|
|
14
16
|
import { ContentMusicService } from './services/content-music.service';
|
|
15
17
|
import { ContentTaggedPlaceService } from './services/content-tagged-place.service';
|
|
16
18
|
import { ContentTaggedUserService } from './services/content-tagged-user.service';
|
|
@@ -23,8 +25,8 @@ import { ReactionService } from './services/reaction.service';
|
|
|
23
25
|
import { ReelService } from './services/reel.service';
|
|
24
26
|
import { SaveService } from './services/save.service';
|
|
25
27
|
import { StoryService } from './services/story.service';
|
|
26
|
-
export declare const SOCIAL_NETWORK_ENTITIES: (typeof ContentHashtag | typeof ContentMusic | typeof ContentTaggedPlace | typeof ContentTaggedUser | typeof Follow | typeof FriendRequest | typeof Friendship | typeof Post | typeof Reel | typeof Save | typeof Story)[];
|
|
27
|
-
export declare const SOCIAL_NETWORK_SERVICES: (typeof CommentService | typeof ContentHashtagService | typeof FeedService | typeof ContentMusicService | typeof ContentTaggedPlaceService | typeof ContentTaggedUserService | typeof FollowService | typeof FriendRequestService | typeof FriendshipService | typeof PostService | typeof ReactionService | typeof ReelService | typeof SaveService | typeof StoryService)[];
|
|
28
|
+
export declare const SOCIAL_NETWORK_ENTITIES: (typeof ContentHashtag | typeof ContentMedia | typeof ContentMusic | typeof ContentTaggedPlace | typeof ContentTaggedUser | typeof Follow | typeof FriendRequest | typeof Friendship | typeof Post | typeof Reel | typeof Save | typeof Story)[];
|
|
29
|
+
export declare const SOCIAL_NETWORK_SERVICES: (typeof CommentService | typeof ContentHashtagService | typeof ContentMediaService | typeof FeedService | typeof ContentMusicService | typeof ContentTaggedPlaceService | typeof ContentTaggedUserService | typeof FollowService | typeof FriendRequestService | typeof FriendshipService | typeof PostService | typeof ReactionService | typeof ReelService | typeof SaveService | typeof StoryService)[];
|
|
28
30
|
export declare class SocialNetworkModule {
|
|
29
31
|
}
|
|
30
32
|
//# sourceMappingURL=social-network.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-network.module.d.ts","sourceRoot":"","sources":["../src/social-network.module.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;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AM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,eAAO,MAAM,uBAAuB,kPAenC,CAAC;AAGF,eAAO,MAAM,uBAAuB,4YAgBnC,CAAC;AAEF,qBAIa,mBAAmB;CAAG"}
|
|
@@ -10,6 +10,7 @@ exports.SocialNetworkModule = exports.SOCIAL_NETWORK_SERVICES = exports.SOCIAL_N
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const comment_entity_1 = require("./entities/comment.entity");
|
|
12
12
|
const content_hashtag_entity_1 = require("./entities/content-hashtag.entity");
|
|
13
|
+
const content_media_entity_1 = require("./entities/content-media.entity");
|
|
13
14
|
const content_music_entity_1 = require("./entities/content-music.entity");
|
|
14
15
|
const content_tagged_place_entity_1 = require("./entities/content-tagged-place.entity");
|
|
15
16
|
const content_tagged_user_entity_1 = require("./entities/content-tagged-user.entity");
|
|
@@ -23,6 +24,7 @@ const save_entity_1 = require("./entities/save.entity");
|
|
|
23
24
|
const story_entity_1 = require("./entities/story.entity");
|
|
24
25
|
const comment_service_1 = require("./services/comment.service");
|
|
25
26
|
const content_hashtag_service_1 = require("./services/content-hashtag.service");
|
|
27
|
+
const content_media_service_1 = require("./services/content-media.service");
|
|
26
28
|
const content_music_service_1 = require("./services/content-music.service");
|
|
27
29
|
const content_tagged_place_service_1 = require("./services/content-tagged-place.service");
|
|
28
30
|
const content_tagged_user_service_1 = require("./services/content-tagged-user.service");
|
|
@@ -39,6 +41,7 @@ exports.SOCIAL_NETWORK_ENTITIES = [
|
|
|
39
41
|
post_entity_1.Post,
|
|
40
42
|
reel_entity_1.Reel,
|
|
41
43
|
story_entity_1.Story,
|
|
44
|
+
content_media_entity_1.ContentMedia,
|
|
42
45
|
content_tagged_user_entity_1.ContentTaggedUser,
|
|
43
46
|
content_tagged_place_entity_1.ContentTaggedPlace,
|
|
44
47
|
content_hashtag_entity_1.ContentHashtag,
|
|
@@ -61,6 +64,7 @@ exports.SOCIAL_NETWORK_SERVICES = [
|
|
|
61
64
|
reaction_service_1.ReactionService,
|
|
62
65
|
comment_service_1.CommentService,
|
|
63
66
|
save_service_1.SaveService,
|
|
67
|
+
content_media_service_1.ContentMediaService,
|
|
64
68
|
content_tagged_user_service_1.ContentTaggedUserService,
|
|
65
69
|
content_tagged_place_service_1.ContentTaggedPlaceService,
|
|
66
70
|
content_hashtag_service_1.ContentHashtagService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-network.module.js","sourceRoot":"","sources":["../src/social-network.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAExC,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;AAG3C,QAAA,uBAAuB,GAAG;IACrC,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;AAGW,QAAA,uBAAuB,GAAG;IACrC,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;AAMK,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,kDAAmB;8BAAnB,mBAAmB;IAJ/B,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,+BAAuB;QAClC,OAAO,EAAE,+BAAuB;KACjC,CAAC;GACW,mBAAmB,CAAG"}
|
|
1
|
+
{"version":3,"file":"social-network.module.js","sourceRoot":"","sources":["../src/social-network.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAExC,8DAAoD;AACpD,8EAAmE;AACnE,0EAA+D;AAC/D,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,4EAAuE;AACvE,0FAAoF;AACpF,wFAAkF;AAClF,0DAAsD;AACtD,8DAA0D;AAC1D,8EAAyE;AACzE,sEAAkE;AAClE,0DAAsD;AACtD,kEAA8D;AAC9D,0DAAsD;AACtD,0DAAsD;AACtD,4DAAwD;AAG3C,QAAA,uBAAuB,GAAG;IACrC,kBAAI;IACJ,kBAAI;IACJ,oBAAK;IACL,mCAAY;IACZ,8CAAiB;IACjB,gDAAkB;IAClB,uCAAc;IACd,mCAAY;IACZ,8BAAU;IACV,qCAAa;IACb,sBAAM;IACN,0BAAQ;IACR,wBAAO;IACP,kBAAI;CACL,CAAC;AAGW,QAAA,uBAAuB,GAAG;IACrC,0BAAW;IACX,0BAAW;IACX,0BAAW;IACX,4BAAY;IACZ,6CAAoB;IACpB,sCAAiB;IACjB,8BAAa;IACb,kCAAe;IACf,gCAAc;IACd,0BAAW;IACX,2CAAmB;IACnB,sDAAwB;IACxB,wDAAyB;IACzB,+CAAqB;IACrB,2CAAmB;CACpB,CAAC;AAMK,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,kDAAmB;8BAAnB,mBAAmB;IAJ/B,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,+BAAuB;QAClC,OAAO,EAAE,+BAAuB;KACjC,CAAC;GACW,mBAAmB,CAAG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContentMediaStatus, ContentMediaType } from '../constants/social-network.constant';
|
|
2
|
+
export interface AddMediaInput {
|
|
3
|
+
url: string;
|
|
4
|
+
mediaType: ContentMediaType;
|
|
5
|
+
position: number;
|
|
6
|
+
status?: ContentMediaStatus;
|
|
7
|
+
metadata?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface MediaCacheItem {
|
|
10
|
+
url: string;
|
|
11
|
+
type: ContentMediaType;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=content-media.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-media.types.d.ts","sourceRoot":"","sources":["../../src/types/content-media.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE5F,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAGD,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,gBAAgB,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-media.types.js","sourceRoot":"","sources":["../../src/types/content-media.types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venturialstd/social-network",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Social network entities and module for Venturial (posts, reels, stories, friends, reactions, comments)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|