@likewatt/models 1.65.1 → 1.65.3
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/core/InfoBanner.d.ts +7 -6
- package/dist/core/InfoBanner.js +23 -1
- package/package.json +1 -1
|
@@ -2,15 +2,16 @@ import { Document } from 'mongoose';
|
|
|
2
2
|
import { BannerSeverity } from './enums/BannerSeverity';
|
|
3
3
|
export type InfoBannerDocument = InfoBanner & Document;
|
|
4
4
|
export declare class InfoBanner {
|
|
5
|
+
readonly _id: string;
|
|
5
6
|
severity: BannerSeverity;
|
|
6
7
|
message: string;
|
|
7
8
|
}
|
|
8
|
-
export declare const InfoBannerSchema: import("mongoose").Schema<InfoBanner, import("mongoose").Model<InfoBanner, any, any, any, Document<unknown, any, InfoBanner, any, {}> & InfoBanner & {
|
|
9
|
-
_id:
|
|
10
|
-
} & {
|
|
9
|
+
export declare const InfoBannerSchema: import("mongoose").Schema<InfoBanner, import("mongoose").Model<InfoBanner, any, any, any, Document<unknown, any, InfoBanner, any, {}> & InfoBanner & Required<{
|
|
10
|
+
_id: string;
|
|
11
|
+
}> & {
|
|
11
12
|
__v: number;
|
|
12
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, InfoBanner, Document<unknown, {}, import("mongoose").FlatRecord<InfoBanner>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<InfoBanner> & {
|
|
13
|
-
_id:
|
|
14
|
-
} & {
|
|
13
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, InfoBanner, Document<unknown, {}, import("mongoose").FlatRecord<InfoBanner>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<InfoBanner> & Required<{
|
|
14
|
+
_id: string;
|
|
15
|
+
}> & {
|
|
15
16
|
__v: number;
|
|
16
17
|
}>;
|
package/dist/core/InfoBanner.js
CHANGED
|
@@ -12,10 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.InfoBannerSchema = exports.InfoBanner = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const uuid_1 = require("uuid");
|
|
15
16
|
const BannerSeverity_1 = require("./enums/BannerSeverity");
|
|
16
17
|
let InfoBanner = class InfoBanner {
|
|
17
18
|
};
|
|
18
19
|
exports.InfoBanner = InfoBanner;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, swagger_1.ApiProperty)({
|
|
22
|
+
description: 'Identifiant unique (UUID ou custom string)',
|
|
23
|
+
example: '2M61PGSm7lRpqXeaDacbAYOLTYG3',
|
|
24
|
+
type: String,
|
|
25
|
+
readOnly: true,
|
|
26
|
+
}),
|
|
27
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], InfoBanner.prototype, "_id", void 0);
|
|
19
30
|
__decorate([
|
|
20
31
|
(0, swagger_1.ApiProperty)({ enum: BannerSeverity_1.BannerSeverity, example: BannerSeverity_1.BannerSeverity.INFO }),
|
|
21
32
|
(0, mongoose_1.Prop)({ required: true, enum: BannerSeverity_1.BannerSeverity }),
|
|
@@ -27,6 +38,17 @@ __decorate([
|
|
|
27
38
|
__metadata("design:type", String)
|
|
28
39
|
], InfoBanner.prototype, "message", void 0);
|
|
29
40
|
exports.InfoBanner = InfoBanner = __decorate([
|
|
30
|
-
(0, mongoose_1.Schema)({
|
|
41
|
+
(0, mongoose_1.Schema)({
|
|
42
|
+
id: false,
|
|
43
|
+
timestamps: true,
|
|
44
|
+
toJSON: { virtuals: true, versionKey: false },
|
|
45
|
+
toObject: { virtuals: true, versionKey: false },
|
|
46
|
+
})
|
|
31
47
|
], InfoBanner);
|
|
32
48
|
exports.InfoBannerSchema = mongoose_1.SchemaFactory.createForClass(InfoBanner);
|
|
49
|
+
exports.InfoBannerSchema.pre('save', function (next) {
|
|
50
|
+
if (!this._id) {
|
|
51
|
+
this._id = (0, uuid_1.v4)();
|
|
52
|
+
}
|
|
53
|
+
next();
|
|
54
|
+
});
|