@likewatt/models 1.12.0 → 1.13.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/Leads.d.ts +37 -24
- package/dist/core/Leads.js +57 -130
- package/dist/core/enums/LeadsAuthMode.d.ts +4 -0
- package/dist/core/enums/LeadsAuthMode.js +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/core/Leads.d.ts
CHANGED
|
@@ -1,43 +1,56 @@
|
|
|
1
1
|
import { Document } from 'mongoose';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
color?: string;
|
|
2
|
+
import { AuthMode } from './enums/LeadsAuthMode';
|
|
3
|
+
export type LeadWidgetTenantDocument = LeadWidgetTenant & Document;
|
|
4
|
+
export declare class LeadThemeConfig {
|
|
5
|
+
logoUrl?: string;
|
|
6
|
+
backgroundImageUrl?: string;
|
|
7
|
+
primaryColor?: string;
|
|
9
8
|
}
|
|
10
|
-
export declare const
|
|
9
|
+
export declare const LeadThemeConfigSchema: import("mongoose").Schema<LeadThemeConfig, import("mongoose").Model<LeadThemeConfig, any, any, any, Document<unknown, any, LeadThemeConfig, any, {}> & LeadThemeConfig & {
|
|
11
10
|
_id: import("mongoose").Types.ObjectId;
|
|
12
11
|
} & {
|
|
13
12
|
__v: number;
|
|
14
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions,
|
|
13
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, LeadThemeConfig, Document<unknown, {}, import("mongoose").FlatRecord<LeadThemeConfig>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<LeadThemeConfig> & {
|
|
15
14
|
_id: import("mongoose").Types.ObjectId;
|
|
16
15
|
} & {
|
|
17
16
|
__v: number;
|
|
18
17
|
}>;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
export declare class Leads {
|
|
23
|
-
_id: string;
|
|
24
|
-
userId: string;
|
|
25
|
-
url: string;
|
|
26
|
-
apiToken: string;
|
|
18
|
+
export declare class LeadAuthConfig {
|
|
19
|
+
mode: AuthMode;
|
|
27
20
|
apiLogin?: string;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
/**
|
|
22
|
+
* IMPORTANT :
|
|
23
|
+
* - si tu dois réutiliser le secret vers un service externe => chiffrement ou secretRef, PAS un hash
|
|
24
|
+
* - si tu compares localement => hash ok, mais c’est atypique ici
|
|
25
|
+
*/
|
|
26
|
+
apiPasswordEncryptedOrSecretRef?: string;
|
|
27
|
+
apiTokenHash?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const LeadAuthConfigSchema: import("mongoose").Schema<LeadAuthConfig, import("mongoose").Model<LeadAuthConfig, any, any, any, Document<unknown, any, LeadAuthConfig, any, {}> & LeadAuthConfig & {
|
|
30
|
+
_id: import("mongoose").Types.ObjectId;
|
|
31
|
+
} & {
|
|
32
|
+
__v: number;
|
|
33
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, LeadAuthConfig, Document<unknown, {}, import("mongoose").FlatRecord<LeadAuthConfig>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<LeadAuthConfig> & {
|
|
34
|
+
_id: import("mongoose").Types.ObjectId;
|
|
35
|
+
} & {
|
|
36
|
+
__v: number;
|
|
37
|
+
}>;
|
|
38
|
+
export declare class LeadWidgetTenant {
|
|
39
|
+
_id: string;
|
|
40
|
+
tenantId: string;
|
|
41
|
+
urlOriginal: string;
|
|
42
|
+
urlCanonical: string;
|
|
43
|
+
auth: LeadAuthConfig;
|
|
44
|
+
defaultScenarioIds: string[];
|
|
45
|
+
theme?: LeadThemeConfig;
|
|
32
46
|
isActive: boolean;
|
|
33
47
|
}
|
|
34
|
-
export declare const
|
|
48
|
+
export declare const LeadWidgetTenantSchema: import("mongoose").Schema<LeadWidgetTenant, import("mongoose").Model<LeadWidgetTenant, any, any, any, Document<unknown, any, LeadWidgetTenant, any, {}> & LeadWidgetTenant & Required<{
|
|
35
49
|
_id: string;
|
|
36
50
|
}> & {
|
|
37
51
|
__v: number;
|
|
38
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions,
|
|
52
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, LeadWidgetTenant, Document<unknown, {}, import("mongoose").FlatRecord<LeadWidgetTenant>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<LeadWidgetTenant> & Required<{
|
|
39
53
|
_id: string;
|
|
40
54
|
}> & {
|
|
41
55
|
__v: number;
|
|
42
56
|
}>;
|
|
43
|
-
export type LeadsDocument = Leads & Document;
|
package/dist/core/Leads.js
CHANGED
|
@@ -9,63 +9,59 @@ 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.LeadWidgetTenantSchema = exports.LeadWidgetTenant = exports.LeadAuthConfigSchema = exports.LeadAuthConfig = exports.LeadThemeConfigSchema = exports.LeadThemeConfig = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
15
14
|
const uuid_1 = require("uuid");
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
* Sous-schéma pour la configuration des Leads
|
|
19
|
-
*/
|
|
20
|
-
let LeadsConfig = class LeadsConfig {
|
|
15
|
+
const LeadsAuthMode_1 = require("./enums/LeadsAuthMode");
|
|
16
|
+
let LeadThemeConfig = class LeadThemeConfig {
|
|
21
17
|
};
|
|
22
|
-
exports.
|
|
18
|
+
exports.LeadThemeConfig = LeadThemeConfig;
|
|
23
19
|
__decorate([
|
|
24
|
-
(0,
|
|
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)(),
|
|
20
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
31
21
|
__metadata("design:type", String)
|
|
32
|
-
],
|
|
22
|
+
], LeadThemeConfig.prototype, "logoUrl", void 0);
|
|
33
23
|
__decorate([
|
|
34
|
-
(0,
|
|
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)(),
|
|
24
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
41
25
|
__metadata("design:type", String)
|
|
42
|
-
],
|
|
26
|
+
], LeadThemeConfig.prototype, "backgroundImageUrl", void 0);
|
|
43
27
|
__decorate([
|
|
44
|
-
(0,
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
(0, mongoose_1.Prop)({
|
|
29
|
+
type: String,
|
|
30
|
+
match: /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,
|
|
47
31
|
}),
|
|
48
|
-
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
49
|
-
(0, class_validator_1.IsString)(),
|
|
50
|
-
(0, class_validator_1.IsOptional)(),
|
|
51
32
|
__metadata("design:type", String)
|
|
52
|
-
],
|
|
53
|
-
exports.
|
|
33
|
+
], LeadThemeConfig.prototype, "primaryColor", void 0);
|
|
34
|
+
exports.LeadThemeConfig = LeadThemeConfig = __decorate([
|
|
54
35
|
(0, mongoose_1.Schema)({ _id: false })
|
|
55
|
-
],
|
|
56
|
-
exports.
|
|
57
|
-
|
|
58
|
-
* Schéma pour les Leads
|
|
59
|
-
*/
|
|
60
|
-
let Leads = class Leads {
|
|
36
|
+
], LeadThemeConfig);
|
|
37
|
+
exports.LeadThemeConfigSchema = mongoose_1.SchemaFactory.createForClass(LeadThemeConfig);
|
|
38
|
+
let LeadAuthConfig = class LeadAuthConfig {
|
|
61
39
|
};
|
|
62
|
-
exports.
|
|
40
|
+
exports.LeadAuthConfig = LeadAuthConfig;
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, mongoose_1.Prop)({ type: String, enum: LeadsAuthMode_1.AuthMode, required: true }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], LeadAuthConfig.prototype, "mode", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], LeadAuthConfig.prototype, "apiLogin", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], LeadAuthConfig.prototype, "apiPasswordEncryptedOrSecretRef", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, mongoose_1.Prop)({ type: String }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], LeadAuthConfig.prototype, "apiTokenHash", void 0);
|
|
57
|
+
exports.LeadAuthConfig = LeadAuthConfig = __decorate([
|
|
58
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
59
|
+
], LeadAuthConfig);
|
|
60
|
+
exports.LeadAuthConfigSchema = mongoose_1.SchemaFactory.createForClass(LeadAuthConfig);
|
|
61
|
+
let LeadWidgetTenant = class LeadWidgetTenant {
|
|
62
|
+
};
|
|
63
|
+
exports.LeadWidgetTenant = LeadWidgetTenant;
|
|
63
64
|
__decorate([
|
|
64
|
-
(0, swagger_1.ApiProperty)({
|
|
65
|
-
description: 'Identifiant unique (UUID)',
|
|
66
|
-
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
67
|
-
type: String,
|
|
68
|
-
}),
|
|
69
65
|
(0, mongoose_1.Prop)({
|
|
70
66
|
type: String,
|
|
71
67
|
unique: true,
|
|
@@ -73,111 +69,42 @@ __decorate([
|
|
|
73
69
|
index: true,
|
|
74
70
|
default: () => (0, uuid_1.v4)(),
|
|
75
71
|
}),
|
|
76
|
-
(0, class_validator_1.IsString)(),
|
|
77
72
|
__metadata("design:type", String)
|
|
78
|
-
],
|
|
73
|
+
], LeadWidgetTenant.prototype, "_id", void 0);
|
|
79
74
|
__decorate([
|
|
80
|
-
(0, swagger_1.ApiProperty)({
|
|
81
|
-
description: "Identifiant de l'utilisateur propriétaire",
|
|
82
|
-
example: '2M61PGSm7lRpqXeaDacbAYOLTYG3',
|
|
83
|
-
}),
|
|
84
75
|
(0, mongoose_1.Prop)({ type: String, required: true, index: true }),
|
|
85
|
-
(0, class_validator_1.IsString)(),
|
|
86
76
|
__metadata("design:type", String)
|
|
87
|
-
],
|
|
77
|
+
], LeadWidgetTenant.prototype, "tenantId", void 0);
|
|
88
78
|
__decorate([
|
|
89
|
-
(0, swagger_1.ApiProperty)({
|
|
90
|
-
description: 'URL leads',
|
|
91
|
-
example: 'https://likewatt.autoconsommation.eu',
|
|
92
|
-
}),
|
|
93
79
|
(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: "Token pour l'API (V2)",
|
|
100
|
-
example: 'tk_1234567890abcdef',
|
|
101
|
-
}),
|
|
102
|
-
(0, mongoose_1.Prop)({ type: String, required: true, unique: true }),
|
|
103
|
-
(0, class_validator_1.IsString)(),
|
|
104
80
|
__metadata("design:type", String)
|
|
105
|
-
],
|
|
81
|
+
], LeadWidgetTenant.prototype, "urlOriginal", void 0);
|
|
106
82
|
__decorate([
|
|
107
|
-
(0,
|
|
108
|
-
description: 'Login pour API V1',
|
|
109
|
-
example: 'client_login',
|
|
110
|
-
}),
|
|
111
|
-
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
112
|
-
(0, class_validator_1.IsString)(),
|
|
113
|
-
(0, class_validator_1.IsOptional)(),
|
|
83
|
+
(0, mongoose_1.Prop)({ type: String, required: true, unique: true, index: true }),
|
|
114
84
|
__metadata("design:type", String)
|
|
115
|
-
],
|
|
85
|
+
], LeadWidgetTenant.prototype, "urlCanonical", void 0);
|
|
116
86
|
__decorate([
|
|
117
|
-
(0,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}),
|
|
121
|
-
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
122
|
-
(0, class_validator_1.IsString)(),
|
|
123
|
-
(0, class_validator_1.IsOptional)(),
|
|
124
|
-
__metadata("design:type", String)
|
|
125
|
-
], Leads.prototype, "apiPassword", void 0);
|
|
87
|
+
(0, mongoose_1.Prop)({ type: exports.LeadAuthConfigSchema, required: true }),
|
|
88
|
+
__metadata("design:type", LeadAuthConfig)
|
|
89
|
+
], LeadWidgetTenant.prototype, "auth", void 0);
|
|
126
90
|
__decorate([
|
|
127
|
-
(0, swagger_1.ApiProperty)({
|
|
128
|
-
description: 'Tableau des identifiants de scénarios par défaut',
|
|
129
|
-
example: [
|
|
130
|
-
'550e8400-e29b-41d4-a716-446655440001',
|
|
131
|
-
'550e8400-e29b-41d4-a716-446655440002',
|
|
132
|
-
'550e8400-e29b-41d4-a716-446655440003',
|
|
133
|
-
],
|
|
134
|
-
type: [String],
|
|
135
|
-
}),
|
|
136
91
|
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
137
|
-
(0, class_validator_1.IsArray)(),
|
|
138
|
-
(0, class_validator_1.IsString)({ each: true }),
|
|
139
92
|
__metadata("design:type", Array)
|
|
140
|
-
],
|
|
93
|
+
], LeadWidgetTenant.prototype, "defaultScenarioIds", void 0);
|
|
141
94
|
__decorate([
|
|
142
|
-
(0,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}),
|
|
146
|
-
(0, mongoose_1.Prop)({ type: exports.LeadsConfigSchema, required: false }),
|
|
147
|
-
(0, class_validator_1.IsObject)(),
|
|
148
|
-
(0, class_validator_1.IsOptional)(),
|
|
149
|
-
__metadata("design:type", LeadsConfig)
|
|
150
|
-
], Leads.prototype, "config", void 0);
|
|
95
|
+
(0, mongoose_1.Prop)({ type: exports.LeadThemeConfigSchema }),
|
|
96
|
+
__metadata("design:type", LeadThemeConfig)
|
|
97
|
+
], LeadWidgetTenant.prototype, "theme", void 0);
|
|
151
98
|
__decorate([
|
|
152
|
-
(0,
|
|
153
|
-
description: 'IDs des projets créés via cette URL',
|
|
154
|
-
example: [
|
|
155
|
-
'550e8400-e29b-41d4-a716-446655440010',
|
|
156
|
-
'550e8400-e29b-41d4-a716-446655440011',
|
|
157
|
-
],
|
|
158
|
-
type: [String],
|
|
159
|
-
}),
|
|
160
|
-
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
161
|
-
(0, class_validator_1.IsArray)(),
|
|
162
|
-
(0, class_validator_1.IsString)({ each: true }),
|
|
163
|
-
(0, class_validator_1.IsOptional)(),
|
|
164
|
-
__metadata("design:type", Array)
|
|
165
|
-
], Leads.prototype, "projects", void 0);
|
|
166
|
-
__decorate([
|
|
167
|
-
(0, swagger_1.ApiProperty)({
|
|
168
|
-
description: 'Indique si le compte Leads est actif',
|
|
169
|
-
example: true,
|
|
170
|
-
}),
|
|
171
|
-
(0, mongoose_1.Prop)({ type: Boolean, default: true }),
|
|
172
|
-
(0, class_validator_1.IsBoolean)(),
|
|
99
|
+
(0, mongoose_1.Prop)({ type: Boolean, default: true, index: true }),
|
|
173
100
|
__metadata("design:type", Boolean)
|
|
174
|
-
],
|
|
175
|
-
exports.
|
|
101
|
+
], LeadWidgetTenant.prototype, "isActive", void 0);
|
|
102
|
+
exports.LeadWidgetTenant = LeadWidgetTenant = __decorate([
|
|
176
103
|
(0, mongoose_1.Schema)({
|
|
177
104
|
id: false,
|
|
178
105
|
timestamps: true,
|
|
179
106
|
toJSON: { virtuals: true, versionKey: false },
|
|
180
107
|
toObject: { virtuals: true, versionKey: false },
|
|
181
108
|
})
|
|
182
|
-
],
|
|
183
|
-
exports.
|
|
109
|
+
], LeadWidgetTenant);
|
|
110
|
+
exports.LeadWidgetTenantSchema = mongoose_1.SchemaFactory.createForClass(LeadWidgetTenant);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthMode = void 0;
|
|
4
|
+
var AuthMode;
|
|
5
|
+
(function (AuthMode) {
|
|
6
|
+
AuthMode["V1_LOGIN_PASSWORD"] = "v1_login_password";
|
|
7
|
+
AuthMode["V2_TOKEN"] = "v2_token";
|
|
8
|
+
})(AuthMode || (exports.AuthMode = AuthMode = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from './core/internal/enums';
|
|
|
27
27
|
export * from './core/enums/BuildingDataStatus';
|
|
28
28
|
export * from './core/enums/FileType';
|
|
29
29
|
export * from './core/enums/ImageryQuality';
|
|
30
|
+
export * from './core/enums/LeadsAuthMode';
|
|
30
31
|
export * from './core/internal/battery-params';
|
|
31
32
|
export * from './core/internal/bounding-box';
|
|
32
33
|
export * from './core/internal/building-data';
|
package/dist/index.js
CHANGED
|
@@ -50,6 +50,7 @@ __exportStar(require("./core/internal/enums"), exports);
|
|
|
50
50
|
__exportStar(require("./core/enums/BuildingDataStatus"), exports);
|
|
51
51
|
__exportStar(require("./core/enums/FileType"), exports);
|
|
52
52
|
__exportStar(require("./core/enums/ImageryQuality"), exports);
|
|
53
|
+
__exportStar(require("./core/enums/LeadsAuthMode"), exports);
|
|
53
54
|
// Sub-models
|
|
54
55
|
__exportStar(require("./core/internal/battery-params"), exports);
|
|
55
56
|
__exportStar(require("./core/internal/bounding-box"), exports);
|