@likewatt/models 1.11.0 → 1.11.2
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/Leads.d.ts +38 -0
- package/dist/core/Leads.js +130 -0
- package/dist/core/Scenario.d.ts +1 -1
- package/dist/core/Scenario.js +6 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Document } from 'mongoose';
|
|
2
|
+
/**
|
|
3
|
+
* Sous-schéma pour la configuration des Leads
|
|
4
|
+
*/
|
|
5
|
+
export declare class LeadsConfig {
|
|
6
|
+
logo?: string;
|
|
7
|
+
backgroundImage?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const LeadsConfigSchema: import("mongoose").Schema<LeadsConfig, import("mongoose").Model<LeadsConfig, any, any, any, Document<unknown, any, LeadsConfig, any, {}> & LeadsConfig & {
|
|
11
|
+
_id: import("mongoose").Types.ObjectId;
|
|
12
|
+
} & {
|
|
13
|
+
__v: number;
|
|
14
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, LeadsConfig, Document<unknown, {}, import("mongoose").FlatRecord<LeadsConfig>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<LeadsConfig> & {
|
|
15
|
+
_id: import("mongoose").Types.ObjectId;
|
|
16
|
+
} & {
|
|
17
|
+
__v: number;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Schéma pour les Leads
|
|
21
|
+
*/
|
|
22
|
+
export declare class Leads {
|
|
23
|
+
_id: string;
|
|
24
|
+
userId: string;
|
|
25
|
+
url: string;
|
|
26
|
+
defaultScenarios: string[];
|
|
27
|
+
config?: LeadsConfig;
|
|
28
|
+
}
|
|
29
|
+
export declare const LeadsSchema: import("mongoose").Schema<Leads, import("mongoose").Model<Leads, any, any, any, Document<unknown, any, Leads, any, {}> & Leads & Required<{
|
|
30
|
+
_id: string;
|
|
31
|
+
}> & {
|
|
32
|
+
__v: number;
|
|
33
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Leads, Document<unknown, {}, import("mongoose").FlatRecord<Leads>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Leads> & Required<{
|
|
34
|
+
_id: string;
|
|
35
|
+
}> & {
|
|
36
|
+
__v: number;
|
|
37
|
+
}>;
|
|
38
|
+
export type LeadsDocument = Leads & Document;
|
|
@@ -0,0 +1,130 @@
|
|
|
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.LeadsSchema = exports.Leads = exports.LeadsConfigSchema = exports.LeadsConfig = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const uuid_1 = require("uuid");
|
|
16
|
+
const class_validator_1 = require("class-validator");
|
|
17
|
+
/**
|
|
18
|
+
* Sous-schéma pour la configuration des Leads
|
|
19
|
+
*/
|
|
20
|
+
let LeadsConfig = class LeadsConfig {
|
|
21
|
+
};
|
|
22
|
+
exports.LeadsConfig = LeadsConfig;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
25
|
+
description: 'URL du logo',
|
|
26
|
+
example: 'https://example.com/logo.png',
|
|
27
|
+
}),
|
|
28
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.IsOptional)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], LeadsConfig.prototype, "logo", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
35
|
+
description: "URL de l'image de fond",
|
|
36
|
+
example: 'https://example.com/background.jpg',
|
|
37
|
+
}),
|
|
38
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], LeadsConfig.prototype, "backgroundImage", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
45
|
+
description: 'Couleur principale (format hex)',
|
|
46
|
+
example: '#3498db',
|
|
47
|
+
}),
|
|
48
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
49
|
+
(0, class_validator_1.IsString)(),
|
|
50
|
+
(0, class_validator_1.IsOptional)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], LeadsConfig.prototype, "color", void 0);
|
|
53
|
+
exports.LeadsConfig = LeadsConfig = __decorate([
|
|
54
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
55
|
+
], LeadsConfig);
|
|
56
|
+
exports.LeadsConfigSchema = mongoose_1.SchemaFactory.createForClass(LeadsConfig);
|
|
57
|
+
/**
|
|
58
|
+
* Schéma pour les Leads
|
|
59
|
+
*/
|
|
60
|
+
let Leads = class Leads {
|
|
61
|
+
};
|
|
62
|
+
exports.Leads = Leads;
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, swagger_1.ApiProperty)({
|
|
65
|
+
description: 'Identifiant unique (UUID)',
|
|
66
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
67
|
+
type: String,
|
|
68
|
+
}),
|
|
69
|
+
(0, mongoose_1.Prop)({
|
|
70
|
+
type: String,
|
|
71
|
+
unique: true,
|
|
72
|
+
required: true,
|
|
73
|
+
index: true,
|
|
74
|
+
default: () => (0, uuid_1.v4)(),
|
|
75
|
+
}),
|
|
76
|
+
(0, class_validator_1.IsString)(),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], Leads.prototype, "_id", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, swagger_1.ApiProperty)({
|
|
81
|
+
description: "Identifiant de l'utilisateur propriétaire",
|
|
82
|
+
example: '2M61PGSm7lRpqXeaDacbAYOLTYG3',
|
|
83
|
+
}),
|
|
84
|
+
(0, mongoose_1.Prop)({ type: String, required: true, index: true }),
|
|
85
|
+
(0, class_validator_1.IsString)(),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], Leads.prototype, "userId", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, swagger_1.ApiProperty)({
|
|
90
|
+
description: 'URL leads',
|
|
91
|
+
example: 'https://likewatt.autoconsommation.eu',
|
|
92
|
+
}),
|
|
93
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
94
|
+
(0, class_validator_1.IsString)(),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], Leads.prototype, "url", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, swagger_1.ApiProperty)({
|
|
99
|
+
description: 'Tableau des identifiants de scénarios par défaut',
|
|
100
|
+
example: [
|
|
101
|
+
'550e8400-e29b-41d4-a716-446655440001',
|
|
102
|
+
'550e8400-e29b-41d4-a716-446655440002',
|
|
103
|
+
'550e8400-e29b-41d4-a716-446655440003',
|
|
104
|
+
],
|
|
105
|
+
type: [String],
|
|
106
|
+
}),
|
|
107
|
+
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
108
|
+
(0, class_validator_1.IsArray)(),
|
|
109
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
110
|
+
__metadata("design:type", Array)
|
|
111
|
+
], Leads.prototype, "defaultScenarios", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
114
|
+
description: 'Configuration visuelle des leads',
|
|
115
|
+
type: LeadsConfig,
|
|
116
|
+
}),
|
|
117
|
+
(0, mongoose_1.Prop)({ type: exports.LeadsConfigSchema, required: false }),
|
|
118
|
+
(0, class_validator_1.IsObject)(),
|
|
119
|
+
(0, class_validator_1.IsOptional)(),
|
|
120
|
+
__metadata("design:type", LeadsConfig)
|
|
121
|
+
], Leads.prototype, "config", void 0);
|
|
122
|
+
exports.Leads = Leads = __decorate([
|
|
123
|
+
(0, mongoose_1.Schema)({
|
|
124
|
+
id: false,
|
|
125
|
+
timestamps: true,
|
|
126
|
+
toJSON: { virtuals: true, versionKey: false },
|
|
127
|
+
toObject: { virtuals: true, versionKey: false },
|
|
128
|
+
})
|
|
129
|
+
], Leads);
|
|
130
|
+
exports.LeadsSchema = mongoose_1.SchemaFactory.createForClass(Leads);
|
package/dist/core/Scenario.d.ts
CHANGED
package/dist/core/Scenario.js
CHANGED
|
@@ -228,11 +228,12 @@ __decorate([
|
|
|
228
228
|
__metadata("design:type", String)
|
|
229
229
|
], Pv.prototype, "name", void 0);
|
|
230
230
|
__decorate([
|
|
231
|
-
(0, swagger_1.ApiProperty)({ example:
|
|
232
|
-
(0, mongoose_1.Prop)({ required: false }),
|
|
233
|
-
(0, class_validator_1.
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
(0, swagger_1.ApiProperty)({ example: 'counter_12345' }),
|
|
232
|
+
(0, mongoose_1.Prop)({ required: false, default: null }),
|
|
233
|
+
(0, class_validator_1.IsOptional)(),
|
|
234
|
+
(0, class_validator_1.IsString)(),
|
|
235
|
+
__metadata("design:type", String)
|
|
236
|
+
], Pv.prototype, "counterId", void 0);
|
|
236
237
|
__decorate([
|
|
237
238
|
(0, swagger_1.ApiPropertyOptional)({ example: 1 }),
|
|
238
239
|
(0, mongoose_1.Prop)({ type: Number }),
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './core/License';
|
|
|
7
7
|
export * from './core/ScenarioDefaultValue';
|
|
8
8
|
export * from './core/Invitation';
|
|
9
9
|
export * from './core/DefaultRate';
|
|
10
|
+
export * from './core/Leads';
|
|
10
11
|
export * from './core/TypeORM/analysis';
|
|
11
12
|
export * from './core/TypeORM/Co2History';
|
|
12
13
|
export * from './core/TypeORM/EnedisReportHistory';
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __exportStar(require("./core/License"), exports);
|
|
|
25
25
|
__exportStar(require("./core/ScenarioDefaultValue"), exports);
|
|
26
26
|
__exportStar(require("./core/Invitation"), exports);
|
|
27
27
|
__exportStar(require("./core/DefaultRate"), exports);
|
|
28
|
+
__exportStar(require("./core/Leads"), exports);
|
|
28
29
|
// TypeORM entities
|
|
29
30
|
__exportStar(require("./core/TypeORM/analysis"), exports);
|
|
30
31
|
__exportStar(require("./core/TypeORM/Co2History"), exports);
|