@ubs-platform/greenhat-webservice 6.10.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.
@@ -0,0 +1,63 @@
1
+ import { HydratedDocument, Types } from 'mongoose';
2
+ export declare class DocProject {
3
+ _id: Types.ObjectId;
4
+ slug: string;
5
+ title: string;
6
+ description: string;
7
+ visibility: 'private' | 'public';
8
+ createdBy: string;
9
+ updatedBy?: string;
10
+ deactivated: boolean;
11
+ }
12
+ export type DocProjectDoc = HydratedDocument<DocProject>;
13
+ export declare const DocProjectSchema: import("mongoose").Schema<DocProject, import("mongoose").Model<DocProject, any, any, any, import("mongoose").Document<unknown, any, DocProject, any> & DocProject & Required<{
14
+ _id: Types.ObjectId;
15
+ }> & {
16
+ __v: number;
17
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, DocProject, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<DocProject>, {}> & import("mongoose").FlatRecord<DocProject> & Required<{
18
+ _id: Types.ObjectId;
19
+ }> & {
20
+ __v: number;
21
+ }>;
22
+ export declare class DocLocalizedContent {
23
+ type: 'text';
24
+ content: string;
25
+ updatedBy?: string;
26
+ updatedAt?: Date;
27
+ }
28
+ export declare const DocLocalizedContentSchema: import("mongoose").Schema<DocLocalizedContent, import("mongoose").Model<DocLocalizedContent, any, any, any, import("mongoose").Document<unknown, any, DocLocalizedContent, any> & DocLocalizedContent & {
29
+ _id: Types.ObjectId;
30
+ } & {
31
+ __v: number;
32
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, DocLocalizedContent, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<DocLocalizedContent>, {}> & import("mongoose").FlatRecord<DocLocalizedContent> & {
33
+ _id: Types.ObjectId;
34
+ } & {
35
+ __v: number;
36
+ }>;
37
+ export declare class DocArticle {
38
+ _id: Types.ObjectId;
39
+ projectId: Types.ObjectId;
40
+ parentId: Types.ObjectId | null;
41
+ path: string;
42
+ slug: string;
43
+ name: string;
44
+ nameLower: string;
45
+ titlesByLocale: Map<string, string>;
46
+ contentsByLocale: Map<string, DocLocalizedContent>;
47
+ ancestors: Types.ObjectId[];
48
+ createdBy: string;
49
+ updatedBy?: string;
50
+ deactivated: boolean;
51
+ }
52
+ export type DocArticleDoc = HydratedDocument<DocArticle>;
53
+ export declare const DocArticleSchema: import("mongoose").Schema<DocArticle, import("mongoose").Model<DocArticle, any, any, any, import("mongoose").Document<unknown, any, DocArticle, any> & DocArticle & Required<{
54
+ _id: Types.ObjectId;
55
+ }> & {
56
+ __v: number;
57
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, DocArticle, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<DocArticle>, {}> & import("mongoose").FlatRecord<DocArticle> & Required<{
58
+ _id: Types.ObjectId;
59
+ }> & {
60
+ __v: number;
61
+ }>;
62
+ export declare class GreenhatEntityMongoModule {
63
+ }
@@ -0,0 +1,165 @@
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.GreenhatEntityMongoModule = exports.DocArticleSchema = exports.DocArticle = exports.DocLocalizedContentSchema = exports.DocLocalizedContent = exports.DocProjectSchema = exports.DocProject = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const mongoose_1 = require("@nestjs/mongoose");
15
+ const mongoose_2 = require("@nestjs/mongoose");
16
+ const mongoose_3 = require("mongoose");
17
+ let DocProject = class DocProject {
18
+ constructor() {
19
+ this.description = '';
20
+ this.visibility = 'private';
21
+ this.deactivated = false;
22
+ }
23
+ };
24
+ exports.DocProject = DocProject;
25
+ __decorate([
26
+ (0, mongoose_2.Prop)({ type: String, required: true }),
27
+ __metadata("design:type", String)
28
+ ], DocProject.prototype, "slug", void 0);
29
+ __decorate([
30
+ (0, mongoose_2.Prop)({ type: String, required: true }),
31
+ __metadata("design:type", String)
32
+ ], DocProject.prototype, "title", void 0);
33
+ __decorate([
34
+ (0, mongoose_2.Prop)({ type: String, default: '' }),
35
+ __metadata("design:type", String)
36
+ ], DocProject.prototype, "description", void 0);
37
+ __decorate([
38
+ (0, mongoose_2.Prop)({ type: String, enum: ['private', 'public'], default: 'private' }),
39
+ __metadata("design:type", String)
40
+ ], DocProject.prototype, "visibility", void 0);
41
+ __decorate([
42
+ (0, mongoose_2.Prop)({ type: String, required: true }),
43
+ __metadata("design:type", String)
44
+ ], DocProject.prototype, "createdBy", void 0);
45
+ __decorate([
46
+ (0, mongoose_2.Prop)({ type: String }),
47
+ __metadata("design:type", String)
48
+ ], DocProject.prototype, "updatedBy", void 0);
49
+ __decorate([
50
+ (0, mongoose_2.Prop)({ type: Boolean, default: false, index: true }),
51
+ __metadata("design:type", Boolean)
52
+ ], DocProject.prototype, "deactivated", void 0);
53
+ exports.DocProject = DocProject = __decorate([
54
+ (0, mongoose_2.Schema)({ collection: 'doc_projects', timestamps: true })
55
+ ], DocProject);
56
+ exports.DocProjectSchema = mongoose_2.SchemaFactory.createForClass(DocProject);
57
+ exports.DocProjectSchema.index({ slug: 1 }, { unique: true, partialFilterExpression: { deactivated: false } });
58
+ let DocLocalizedContent = class DocLocalizedContent {
59
+ constructor() {
60
+ this.type = 'text';
61
+ this.content = '';
62
+ }
63
+ };
64
+ exports.DocLocalizedContent = DocLocalizedContent;
65
+ __decorate([
66
+ (0, mongoose_2.Prop)({ type: String, enum: ['text'], default: 'text' }),
67
+ __metadata("design:type", String)
68
+ ], DocLocalizedContent.prototype, "type", void 0);
69
+ __decorate([
70
+ (0, mongoose_2.Prop)({ type: String, default: '' }),
71
+ __metadata("design:type", String)
72
+ ], DocLocalizedContent.prototype, "content", void 0);
73
+ __decorate([
74
+ (0, mongoose_2.Prop)({ type: String }),
75
+ __metadata("design:type", String)
76
+ ], DocLocalizedContent.prototype, "updatedBy", void 0);
77
+ __decorate([
78
+ (0, mongoose_2.Prop)({ type: Date }),
79
+ __metadata("design:type", Date)
80
+ ], DocLocalizedContent.prototype, "updatedAt", void 0);
81
+ exports.DocLocalizedContent = DocLocalizedContent = __decorate([
82
+ (0, mongoose_2.Schema)({ _id: false })
83
+ ], DocLocalizedContent);
84
+ exports.DocLocalizedContentSchema = mongoose_2.SchemaFactory.createForClass(DocLocalizedContent);
85
+ let DocArticle = class DocArticle {
86
+ constructor() {
87
+ this.titlesByLocale = new Map();
88
+ this.contentsByLocale = new Map();
89
+ this.ancestors = [];
90
+ this.deactivated = false;
91
+ }
92
+ };
93
+ exports.DocArticle = DocArticle;
94
+ __decorate([
95
+ (0, mongoose_2.Prop)({ type: mongoose_3.Types.ObjectId, ref: DocProject.name, required: true, index: true }),
96
+ __metadata("design:type", mongoose_3.Types.ObjectId)
97
+ ], DocArticle.prototype, "projectId", void 0);
98
+ __decorate([
99
+ (0, mongoose_2.Prop)({ type: mongoose_3.Types.ObjectId, ref: 'DocArticle', default: null, index: true }),
100
+ __metadata("design:type", Object)
101
+ ], DocArticle.prototype, "parentId", void 0);
102
+ __decorate([
103
+ (0, mongoose_2.Prop)({ type: String, required: true }),
104
+ __metadata("design:type", String)
105
+ ], DocArticle.prototype, "path", void 0);
106
+ __decorate([
107
+ (0, mongoose_2.Prop)({ type: String, required: true }),
108
+ __metadata("design:type", String)
109
+ ], DocArticle.prototype, "slug", void 0);
110
+ __decorate([
111
+ (0, mongoose_2.Prop)({ type: String, required: true }),
112
+ __metadata("design:type", String)
113
+ ], DocArticle.prototype, "name", void 0);
114
+ __decorate([
115
+ (0, mongoose_2.Prop)({ type: String, required: true, index: true }),
116
+ __metadata("design:type", String)
117
+ ], DocArticle.prototype, "nameLower", void 0);
118
+ __decorate([
119
+ (0, mongoose_2.Prop)({ type: Map, of: String, default: {} }),
120
+ __metadata("design:type", Map)
121
+ ], DocArticle.prototype, "titlesByLocale", void 0);
122
+ __decorate([
123
+ (0, mongoose_2.Prop)({ type: Map, of: exports.DocLocalizedContentSchema, default: {} }),
124
+ __metadata("design:type", Map)
125
+ ], DocArticle.prototype, "contentsByLocale", void 0);
126
+ __decorate([
127
+ (0, mongoose_2.Prop)({ type: [mongoose_3.Types.ObjectId], default: [] }),
128
+ __metadata("design:type", Array)
129
+ ], DocArticle.prototype, "ancestors", void 0);
130
+ __decorate([
131
+ (0, mongoose_2.Prop)({ type: String, required: true }),
132
+ __metadata("design:type", String)
133
+ ], DocArticle.prototype, "createdBy", void 0);
134
+ __decorate([
135
+ (0, mongoose_2.Prop)({ type: String }),
136
+ __metadata("design:type", String)
137
+ ], DocArticle.prototype, "updatedBy", void 0);
138
+ __decorate([
139
+ (0, mongoose_2.Prop)({ type: Boolean, default: false, index: true }),
140
+ __metadata("design:type", Boolean)
141
+ ], DocArticle.prototype, "deactivated", void 0);
142
+ exports.DocArticle = DocArticle = __decorate([
143
+ (0, mongoose_2.Schema)({ collection: 'doc_articles', timestamps: true })
144
+ ], DocArticle);
145
+ exports.DocArticleSchema = mongoose_2.SchemaFactory.createForClass(DocArticle);
146
+ exports.DocArticleSchema.index({ projectId: 1, path: 1 }, { unique: true, partialFilterExpression: { deactivated: false } });
147
+ exports.DocArticleSchema.index({ projectId: 1, nameLower: 1 }, { unique: true, partialFilterExpression: { deactivated: false } });
148
+ exports.DocArticleSchema.index({ projectId: 1, parentId: 1 });
149
+ exports.DocArticleSchema.index({ projectId: 1, ancestors: 1 });
150
+ exports.DocArticleSchema.index({ name: 'text', titlesByLocale: 'text' });
151
+ let GreenhatEntityMongoModule = class GreenhatEntityMongoModule {
152
+ };
153
+ exports.GreenhatEntityMongoModule = GreenhatEntityMongoModule;
154
+ exports.GreenhatEntityMongoModule = GreenhatEntityMongoModule = __decorate([
155
+ (0, common_1.Module)({
156
+ imports: [
157
+ mongoose_1.MongooseModule.forFeature([
158
+ { name: DocProject.name, schema: exports.DocProjectSchema },
159
+ { name: DocArticle.name, schema: exports.DocArticleSchema },
160
+ ]),
161
+ ],
162
+ exports: [mongoose_1.MongooseModule],
163
+ })
164
+ ], GreenhatEntityMongoModule);
165
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../libs/greenhat-entity-mongo/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwC;AACxC,+CAAkD;AAClD,+CAA+D;AAC/D,uCAAmD;AAM5C,IAAM,UAAU,GAAhB,MAAM,UAAU;IAAhB;QAWL,gBAAW,GAAW,EAAE,CAAC;QAIzB,eAAU,GAAyB,SAAS,CAAC;QAS7C,gBAAW,GAAY,KAAK,CAAC;IAC/B,CAAC;CAAA,CAAA;AAzBY,gCAAU;AAKrB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACzB;AAGd;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACxB;AAGf;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;+CACX;AAIzB;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;;8CAC3B;AAG7C;IADC,IAAA,eAAI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,EAAE,CAAC,EAAE,CAAC,CAAC;AAGtD,wBAAgB,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AAGvD,wBAAgB,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;AAW1D,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;CAAG,CAAA;AAA5B,8DAAyB;oCAAzB,yBAAyB;IATrC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,yBAAc,CAAC,UAAU,CAAC;gBACxB,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,wBAAgB,EAAE;gBACnD,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,wBAAgB,EAAE;aACpD,CAAC;SACH;QACD,OAAO,EAAE,CAAC,yBAAc,CAAC;KAC1B,CAAC;GACW,yBAAyB,CAAG"}
@@ -0,0 +1 @@
1
+ {"name":"@ubs-platform/greenhat-entity-mongo","version":"6.10.1","description":"","repository":{"type":"git","url":"git+https://github.com/ubs-platform/ubs-mona-mr.git"},"homepage":"https://github.com/ubs-platform/ubs-mona-mr","iksir":{"type":"LIBRARY","libraryMode":"EMBEDDED","buildSubFolder":""},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"ISC","peerDependencies":{"@nestjs/common":"^11.1.19","@nestjs/mongoose":"^11.0.1","mongoose":"^8.10.2"}}