itlab-internal-services 2.6.2 → 2.6.4
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/hub-resource.enum.d.ts +2 -2
- package/dist/hub-resource.enum.js +3 -3
- package/dist/modules/database/model-service/model.service.d.ts +1 -1
- package/dist/modules/database/model-service/model.service.js +1 -1
- package/dist/modules/database/model-service/schemas/hub-hackschool.schemas.d.ts +1 -1
- package/dist/modules/database/model-service/schemas/hub-hackschool.schemas.js +2 -2
- package/dist/modules/database/service-mapper-service/service-mapper.service.js +1 -1
- package/dist/modules/fetch/fetch.service.d.ts +1 -1
- package/dist/modules/fetch/fetch.service.js +1 -1
- package/dist/virtuals.factory.d.ts +3 -7
- package/dist/virtuals.factory.js +8 -15
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ export declare enum HubResource {
|
|
|
9
9
|
BOOKS_BOOK = "books-book",
|
|
10
10
|
HACKSCHOOL_COURSE = "hackschool-course",
|
|
11
11
|
HACKSCHOOL_THREAD = "hackschool-thread",
|
|
12
|
-
|
|
12
|
+
HACKSCHOOL_DOC = "hackschool-doc",
|
|
13
13
|
TEAM_MEMBER = "team-member",
|
|
14
14
|
NEWSLETTER_ISSUE = "newsletter-issue",
|
|
15
15
|
HUB_USER = "hub-user",
|
|
@@ -26,7 +26,7 @@ export declare enum FetchableHubResource {
|
|
|
26
26
|
BOOKS_BOOK = "books-book",
|
|
27
27
|
HACKSCHOOL_COURSE = "hackschool-course",
|
|
28
28
|
HACKSCHOOL_THREAD = "hackschool-thread",
|
|
29
|
-
|
|
29
|
+
HACKSCHOOL_DOC = "hackschool-doc",
|
|
30
30
|
TEAM_MEMBER = "team-member",
|
|
31
31
|
NEWSLETTER_ISSUE = "newsletter-issue",
|
|
32
32
|
HUB_USER = "hub-user"
|
|
@@ -13,7 +13,7 @@ var HubResource;
|
|
|
13
13
|
HubResource["BOOKS_BOOK"] = "books-book";
|
|
14
14
|
HubResource["HACKSCHOOL_COURSE"] = "hackschool-course";
|
|
15
15
|
HubResource["HACKSCHOOL_THREAD"] = "hackschool-thread";
|
|
16
|
-
HubResource["
|
|
16
|
+
HubResource["HACKSCHOOL_DOC"] = "hackschool-doc";
|
|
17
17
|
HubResource["TEAM_MEMBER"] = "team-member";
|
|
18
18
|
HubResource["NEWSLETTER_ISSUE"] = "newsletter-issue";
|
|
19
19
|
HubResource["HUB_USER"] = "hub-user";
|
|
@@ -31,7 +31,7 @@ var FetchableHubResource;
|
|
|
31
31
|
FetchableHubResource["BOOKS_BOOK"] = "books-book";
|
|
32
32
|
FetchableHubResource["HACKSCHOOL_COURSE"] = "hackschool-course";
|
|
33
33
|
FetchableHubResource["HACKSCHOOL_THREAD"] = "hackschool-thread";
|
|
34
|
-
FetchableHubResource["
|
|
34
|
+
FetchableHubResource["HACKSCHOOL_DOC"] = "hackschool-doc";
|
|
35
35
|
FetchableHubResource["TEAM_MEMBER"] = "team-member";
|
|
36
36
|
FetchableHubResource["NEWSLETTER_ISSUE"] = "newsletter-issue";
|
|
37
37
|
FetchableHubResource["HUB_USER"] = "hub-user";
|
|
@@ -46,7 +46,7 @@ exports.HUB_RESOURCES = [
|
|
|
46
46
|
HubResource.BOOKS_BOOK,
|
|
47
47
|
HubResource.HACKSCHOOL_COURSE,
|
|
48
48
|
HubResource.HACKSCHOOL_THREAD,
|
|
49
|
-
HubResource.
|
|
49
|
+
HubResource.HACKSCHOOL_DOC,
|
|
50
50
|
HubResource.TEAM_MEMBER,
|
|
51
51
|
HubResource.PROJECT_PROJECTS,
|
|
52
52
|
HubResource.NEWSLETTER_ISSUE,
|
|
@@ -85,7 +85,7 @@ export declare class ModelService {
|
|
|
85
85
|
}>, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CourseModel, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<CourseModel>> & import("mongoose").FlatRecord<CourseModel> & Required<{
|
|
86
86
|
_id: unknown;
|
|
87
87
|
}>>>;
|
|
88
|
-
/** Returns the hackschool
|
|
88
|
+
/** Returns the hackschool doc model */
|
|
89
89
|
docModel: () => import("mongoose").Model<DocModel, {}, {}, {}, import("mongoose").Document<unknown, {}, DocModel> & DocModel & Required<{
|
|
90
90
|
_id: unknown;
|
|
91
91
|
}>, Schema<DocModel, import("mongoose").Model<DocModel, any, any, any, import("mongoose").Document<unknown, any, DocModel> & DocModel & Required<{
|
|
@@ -54,7 +54,7 @@ let ModelService = class ModelService {
|
|
|
54
54
|
this.eventModel = () => this.useModel(hub_events_schemas_1.EventsDB, hub_events_schemas_1.EventModel.name, hub_events_schemas_1.EventSchema);
|
|
55
55
|
/** Returns the hackschool course model */
|
|
56
56
|
this.courseModel = () => this.useModel(hub_hackschool_schemas_1.HackschoolDB, hub_hackschool_schemas_1.CourseModel.name, hub_hackschool_schemas_1.CourseSchema);
|
|
57
|
-
/** Returns the hackschool
|
|
57
|
+
/** Returns the hackschool doc model */
|
|
58
58
|
this.docModel = () => this.useModel(hub_hackschool_schemas_1.HackschoolDB, hub_hackschool_schemas_1.DocModel.name, hub_hackschool_schemas_1.DocSchema);
|
|
59
59
|
/** Returns the hackschool thread model */
|
|
60
60
|
this.threadModel = () => this.useModel(hub_hackschool_schemas_1.HackschoolDB, hub_hackschool_schemas_1.ThreadModel.name, hub_hackschool_schemas_1.ThreadSchema);
|
|
@@ -27,4 +27,4 @@ declare const ThreadSchema: import("mongoose").Schema<ThreadModel, import("mongo
|
|
|
27
27
|
_id: unknown;
|
|
28
28
|
}>>;
|
|
29
29
|
declare const HackschoolDB = "hub-hackschool";
|
|
30
|
-
export { CourseModel, CourseSchema, DocModel, DocSchema, ThreadModel, ThreadSchema
|
|
30
|
+
export { CourseModel, CourseSchema, DocModel, DocSchema, HackschoolDB, ThreadModel, ThreadSchema };
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.ThreadSchema = exports.ThreadModel = exports.HackschoolDB = exports.DocSchema = exports.DocModel = exports.CourseSchema = exports.CourseModel = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const mongoose_2 = require("mongoose");
|
|
15
15
|
const transformCourse = {
|
|
@@ -39,7 +39,7 @@ exports.CourseSchema = CourseSchema;
|
|
|
39
39
|
const transformDoc = {
|
|
40
40
|
virtuals: true,
|
|
41
41
|
transform: (_, { title, _hid }) => {
|
|
42
|
-
const url = `https://www.svi-itlab.com/hackschool/
|
|
42
|
+
const url = `https://www.svi-itlab.com/hackschool/tips-tricks/${_hid}`;
|
|
43
43
|
return { title, url };
|
|
44
44
|
},
|
|
45
45
|
};
|
|
@@ -36,7 +36,7 @@ let ServiceMapperService = class ServiceMapperService {
|
|
|
36
36
|
'books-book': this.modelService.bookModel(),
|
|
37
37
|
'hackschool-course': this.modelService.courseModel(),
|
|
38
38
|
'hackschool-thread': this.modelService.threadModel(),
|
|
39
|
-
'hackschool-
|
|
39
|
+
'hackschool-doc': this.modelService.docModel(),
|
|
40
40
|
'team-member': this.modelService.memberModel(),
|
|
41
41
|
// 'newsletter-issue': this.modelService.newsletterModel(),
|
|
42
42
|
};
|
|
@@ -27,7 +27,7 @@ export declare class FetchService {
|
|
|
27
27
|
fetch(resource: FetchableHubResource.BOOKS_BOOK, bookId: string): Promise<LabBook>;
|
|
28
28
|
fetch(resource: FetchableHubResource.HACKSCHOOL_COURSE, courseId: string): Promise<LabHackschoolCourse>;
|
|
29
29
|
fetch(resource: FetchableHubResource.HACKSCHOOL_THREAD, threadId: string): Promise<LabHackschoolThread>;
|
|
30
|
-
fetch(resource: FetchableHubResource.
|
|
30
|
+
fetch(resource: FetchableHubResource.HACKSCHOOL_DOC, docId: string): Promise<LabHackschoolDoc>;
|
|
31
31
|
fetch(resource: FetchableHubResource.TEAM_MEMBER, memberId: string): Promise<LabMember>;
|
|
32
32
|
fetch(resource: FetchableHubResource.NEWSLETTER_ISSUE, issueId: string): Promise<LabNewsletter>;
|
|
33
33
|
fetch(resource: FetchableHubResource.HUB_USER, accountId: string): Promise<LabAccount>;
|
|
@@ -36,7 +36,7 @@ const ENDPOINTS = {
|
|
|
36
36
|
[hub_resource_enum_1.FetchableHubResource.BOOKS_BOOK]: '/books/internal/book/%id%',
|
|
37
37
|
[hub_resource_enum_1.FetchableHubResource.HACKSCHOOL_COURSE]: '/hackschool/internal/course/%id%',
|
|
38
38
|
[hub_resource_enum_1.FetchableHubResource.HACKSCHOOL_THREAD]: '/hackschool/internal/thread/%id%',
|
|
39
|
-
[hub_resource_enum_1.FetchableHubResource.
|
|
39
|
+
[hub_resource_enum_1.FetchableHubResource.HACKSCHOOL_DOC]: '/hackschool/internal/doc/%id%',
|
|
40
40
|
[hub_resource_enum_1.FetchableHubResource.TEAM_MEMBER]: '/team/internal/member/%id%',
|
|
41
41
|
[hub_resource_enum_1.FetchableHubResource.NEWSLETTER_ISSUE]: '/newsletter/internal/issue/%id%',
|
|
42
42
|
[hub_resource_enum_1.FetchableHubResource.HUB_USER]: '/account/internal/account/%id%',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema } from 'mongoose';
|
|
1
|
+
import { Schema, VirtualTypeOptions } from 'mongoose';
|
|
2
2
|
import { HubResource } from './hub-resource.enum';
|
|
3
3
|
/**
|
|
4
4
|
* Creates virtual fields on a schema.
|
|
@@ -30,18 +30,14 @@ export declare class VirtualsFactory {
|
|
|
30
30
|
* @return {VirtualsFactory} the VirtualsFactory
|
|
31
31
|
*/
|
|
32
32
|
accounts(name: string, localField: string): VirtualsFactory;
|
|
33
|
-
/**
|
|
34
|
-
* Creates a virtual content field on the given schema, linking it to the 'content' collection.
|
|
35
|
-
*
|
|
36
|
-
* @return {VirtualsFactory} the VirtualsFactory
|
|
37
|
-
*/
|
|
38
|
-
content(): VirtualsFactory;
|
|
39
33
|
/**
|
|
40
34
|
* Creates virtual comments field on the given schema, linking it to the 'comments' collection.
|
|
41
35
|
*
|
|
42
36
|
* @return {VirtualsFactory} the VirtualsFactory
|
|
43
37
|
*/
|
|
44
38
|
comments(): VirtualsFactory;
|
|
39
|
+
virtual(name: string, options?: VirtualTypeOptions): VirtualsFactory;
|
|
40
|
+
content(): VirtualsFactory;
|
|
45
41
|
/**
|
|
46
42
|
* Creates virtual commentsCount field on the given schema, linking it to the 'comments' collection.
|
|
47
43
|
*
|
package/dist/virtuals.factory.js
CHANGED
|
@@ -49,21 +49,6 @@ class VirtualsFactory {
|
|
|
49
49
|
});
|
|
50
50
|
return this;
|
|
51
51
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Creates a virtual content field on the given schema, linking it to the 'content' collection.
|
|
54
|
-
*
|
|
55
|
-
* @return {VirtualsFactory} the VirtualsFactory
|
|
56
|
-
*/
|
|
57
|
-
content() {
|
|
58
|
-
this.schema.virtual('content', {
|
|
59
|
-
ref: 'content',
|
|
60
|
-
foreignField: '_resourceId',
|
|
61
|
-
localField: '_id',
|
|
62
|
-
match: { _resource: this.resource },
|
|
63
|
-
justOne: true,
|
|
64
|
-
});
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
52
|
/**
|
|
68
53
|
* Creates virtual comments field on the given schema, linking it to the 'comments' collection.
|
|
69
54
|
*
|
|
@@ -79,6 +64,14 @@ class VirtualsFactory {
|
|
|
79
64
|
});
|
|
80
65
|
return this;
|
|
81
66
|
}
|
|
67
|
+
virtual(name, options) {
|
|
68
|
+
this.schema.virtual(name, options);
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
content() {
|
|
72
|
+
this.schema.virtual('content');
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
82
75
|
/**
|
|
83
76
|
* Creates virtual commentsCount field on the given schema, linking it to the 'comments' collection.
|
|
84
77
|
*
|