@likewatt/models 1.78.1 → 1.80.0
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/Consent.js +8 -0
- package/dist/core/User.d.ts +2 -0
- package/dist/core/User.js +10 -0
- package/dist/core/internal/chart-theme.d.ts +12 -0
- package/dist/core/internal/chart-theme.js +34 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/core/Consent.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.ConsentSchema = exports.Consent = void 0;
|
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
15
15
|
const class_validator_1 = require("class-validator");
|
|
16
|
+
const uuid_1 = require("uuid");
|
|
16
17
|
/**
|
|
17
18
|
* Représente un utilisateur dans le système.
|
|
18
19
|
* - @Schema/timestamps : gère createdAt et updatedAt automatiques
|
|
@@ -164,3 +165,10 @@ exports.Consent = Consent = __decorate([
|
|
|
164
165
|
})
|
|
165
166
|
], Consent);
|
|
166
167
|
exports.ConsentSchema = mongoose_1.SchemaFactory.createForClass(Consent);
|
|
168
|
+
// Hook pre-save pour générer automatiquement un UUID si _id n'est pas fourni
|
|
169
|
+
exports.ConsentSchema.pre('save', function (next) {
|
|
170
|
+
if (!this._id) {
|
|
171
|
+
this._id = (0, uuid_1.v4)();
|
|
172
|
+
}
|
|
173
|
+
next();
|
|
174
|
+
});
|
package/dist/core/User.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Document } from 'mongoose';
|
|
|
2
2
|
import { Folder } from './internal/folder.model';
|
|
3
3
|
import { ManagerLicenses } from './internal/manager-licenses';
|
|
4
4
|
import { UsersList } from './internal/users-list';
|
|
5
|
+
import { ChartTheme } from './internal/chart-theme';
|
|
5
6
|
/**
|
|
6
7
|
* Sous-schéma pour les tags liés au site de l’utilisateur.
|
|
7
8
|
*/
|
|
@@ -122,6 +123,7 @@ export declare class User {
|
|
|
122
123
|
endDate?: Date | string;
|
|
123
124
|
stripeCustomerId?: string;
|
|
124
125
|
hasLeads?: boolean;
|
|
126
|
+
chartTheme?: ChartTheme;
|
|
125
127
|
}
|
|
126
128
|
export type UserDocument = User & Document;
|
|
127
129
|
export declare const UserSchema: import("mongoose").Schema<User, import("mongoose").Model<User, any, any, any, Document<unknown, any, User, any, {}> & User & Required<{
|
package/dist/core/User.js
CHANGED
|
@@ -17,6 +17,7 @@ const class_validator_1 = require("class-validator");
|
|
|
17
17
|
const folder_model_1 = require("./internal/folder.model");
|
|
18
18
|
const manager_licenses_1 = require("./internal/manager-licenses");
|
|
19
19
|
const users_list_1 = require("./internal/users-list");
|
|
20
|
+
const chart_theme_1 = require("./internal/chart-theme");
|
|
20
21
|
/**
|
|
21
22
|
* Sous-schéma pour les tags liés au site de l’utilisateur.
|
|
22
23
|
*/
|
|
@@ -687,6 +688,15 @@ __decorate([
|
|
|
687
688
|
(0, class_validator_1.IsBoolean)(),
|
|
688
689
|
__metadata("design:type", Boolean)
|
|
689
690
|
], User.prototype, "hasLeads", void 0);
|
|
691
|
+
__decorate([
|
|
692
|
+
(0, swagger_1.ApiProperty)({
|
|
693
|
+
description: 'Thème de graphiques personnalisé',
|
|
694
|
+
type: () => chart_theme_1.ChartTheme,
|
|
695
|
+
}),
|
|
696
|
+
(0, mongoose_1.Prop)({ type: chart_theme_1.ChartThemeSchema, _id: false, required: false }),
|
|
697
|
+
(0, class_validator_1.IsOptional)(),
|
|
698
|
+
__metadata("design:type", chart_theme_1.ChartTheme)
|
|
699
|
+
], User.prototype, "chartTheme", void 0);
|
|
690
700
|
exports.User = User = __decorate([
|
|
691
701
|
(0, mongoose_1.Schema)({
|
|
692
702
|
id: false,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class ChartTheme {
|
|
2
|
+
palette: string[];
|
|
3
|
+
}
|
|
4
|
+
export declare const ChartThemeSchema: import("mongoose").Schema<ChartTheme, import("mongoose").Model<ChartTheme, any, any, any, import("mongoose").Document<unknown, any, ChartTheme, any, {}> & ChartTheme & {
|
|
5
|
+
_id: import("mongoose").Types.ObjectId;
|
|
6
|
+
} & {
|
|
7
|
+
__v: number;
|
|
8
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ChartTheme, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ChartTheme>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ChartTheme> & {
|
|
9
|
+
_id: import("mongoose").Types.ObjectId;
|
|
10
|
+
} & {
|
|
11
|
+
__v: number;
|
|
12
|
+
}>;
|
|
@@ -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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ChartThemeSchema = exports.ChartTheme = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
let ChartTheme = class ChartTheme {
|
|
17
|
+
};
|
|
18
|
+
exports.ChartTheme = ChartTheme;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiProperty)({
|
|
21
|
+
description: 'Palette de couleurs du thème de graphiques',
|
|
22
|
+
example: ['#FF6384', '#36A2EB', '#FFCE56'],
|
|
23
|
+
isArray: true,
|
|
24
|
+
type: String,
|
|
25
|
+
}),
|
|
26
|
+
(0, mongoose_1.Prop)({ type: [String], required: true, default: [] }),
|
|
27
|
+
(0, class_validator_1.IsArray)(),
|
|
28
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
29
|
+
__metadata("design:type", Array)
|
|
30
|
+
], ChartTheme.prototype, "palette", void 0);
|
|
31
|
+
exports.ChartTheme = ChartTheme = __decorate([
|
|
32
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
33
|
+
], ChartTheme);
|
|
34
|
+
exports.ChartThemeSchema = mongoose_1.SchemaFactory.createForClass(ChartTheme);
|
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export * from './core/internal/battery-params';
|
|
|
39
39
|
export * from './core/internal/bounding-box';
|
|
40
40
|
export * from './core/internal/building-data';
|
|
41
41
|
export * from './core/internal/building-stats';
|
|
42
|
+
export * from './core/internal/chart-theme';
|
|
42
43
|
export * from './core/internal/conversion-params';
|
|
43
44
|
export * from './core/internal/customer-infos.model';
|
|
44
45
|
export * from './core/internal/data-source-history';
|
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ __exportStar(require("./core/internal/battery-params"), exports);
|
|
|
64
64
|
__exportStar(require("./core/internal/bounding-box"), exports);
|
|
65
65
|
__exportStar(require("./core/internal/building-data"), exports);
|
|
66
66
|
__exportStar(require("./core/internal/building-stats"), exports);
|
|
67
|
+
__exportStar(require("./core/internal/chart-theme"), exports);
|
|
67
68
|
__exportStar(require("./core/internal/conversion-params"), exports);
|
|
68
69
|
__exportStar(require("./core/internal/customer-infos.model"), exports);
|
|
69
70
|
__exportStar(require("./core/internal/data-source-history"), exports);
|