@likewatt/models 1.14.1 → 1.14.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/Leads.d.ts +4 -21
- package/dist/core/Leads.js +15 -43
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +1 -1
- package/dist/core/enums/LeadsAuthMode.d.ts +0 -4
- package/dist/core/enums/LeadsAuthMode.js +0 -8
package/dist/core/Leads.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Document } from 'mongoose';
|
|
2
|
-
|
|
3
|
-
export type LeadWidgetTenantDocument = LeadWidgetTenant & Document;
|
|
2
|
+
export type LeadTenantDocument = LeadTenant & Document;
|
|
4
3
|
export declare class LeadThemeConfig {
|
|
5
4
|
logoUrl?: string;
|
|
6
5
|
backgroundImageUrl?: string;
|
|
@@ -15,36 +14,20 @@ export declare const LeadThemeConfigSchema: import("mongoose").Schema<LeadThemeC
|
|
|
15
14
|
} & {
|
|
16
15
|
__v: number;
|
|
17
16
|
}>;
|
|
18
|
-
export declare class
|
|
19
|
-
mode: AuthMode;
|
|
20
|
-
apiLogin?: string;
|
|
21
|
-
apiPasswordEncryptedOrSecretRef?: string;
|
|
22
|
-
apiTokenHash?: string;
|
|
23
|
-
}
|
|
24
|
-
export declare const LeadAuthConfigSchema: import("mongoose").Schema<LeadAuthConfig, import("mongoose").Model<LeadAuthConfig, any, any, any, Document<unknown, any, LeadAuthConfig, any, {}> & LeadAuthConfig & {
|
|
25
|
-
_id: import("mongoose").Types.ObjectId;
|
|
26
|
-
} & {
|
|
27
|
-
__v: number;
|
|
28
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, LeadAuthConfig, Document<unknown, {}, import("mongoose").FlatRecord<LeadAuthConfig>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<LeadAuthConfig> & {
|
|
29
|
-
_id: import("mongoose").Types.ObjectId;
|
|
30
|
-
} & {
|
|
31
|
-
__v: number;
|
|
32
|
-
}>;
|
|
33
|
-
export declare class LeadWidgetTenant {
|
|
17
|
+
export declare class LeadTenant {
|
|
34
18
|
_id: string;
|
|
35
19
|
tenantId: string;
|
|
36
20
|
subdomain: string;
|
|
37
21
|
domain: string;
|
|
38
|
-
auth: LeadAuthConfig;
|
|
39
22
|
defaultScenarioIds: string[];
|
|
40
23
|
theme?: LeadThemeConfig;
|
|
41
24
|
isActive: boolean;
|
|
42
25
|
}
|
|
43
|
-
export declare const
|
|
26
|
+
export declare const LeadTenantSchema: import("mongoose").Schema<LeadTenant, import("mongoose").Model<LeadTenant, any, any, any, Document<unknown, any, LeadTenant, any, {}> & LeadTenant & Required<{
|
|
44
27
|
_id: string;
|
|
45
28
|
}> & {
|
|
46
29
|
__v: number;
|
|
47
|
-
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions,
|
|
30
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, LeadTenant, Document<unknown, {}, import("mongoose").FlatRecord<LeadTenant>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<LeadTenant> & Required<{
|
|
48
31
|
_id: string;
|
|
49
32
|
}> & {
|
|
50
33
|
__v: number;
|
package/dist/core/Leads.js
CHANGED
|
@@ -9,10 +9,9 @@ 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.LeadTenantSchema = exports.LeadTenant = exports.LeadThemeConfigSchema = exports.LeadThemeConfig = void 0;
|
|
13
13
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
14
|
const uuid_1 = require("uuid");
|
|
15
|
-
const LeadsAuthMode_1 = require("./enums/LeadsAuthMode");
|
|
16
15
|
const SUBDOMAIN_REGEX = /^(?!-)[a-z0-9-]{1,63}(?<!-)$/;
|
|
17
16
|
let LeadThemeConfig = class LeadThemeConfig {
|
|
18
17
|
};
|
|
@@ -33,32 +32,9 @@ exports.LeadThemeConfig = LeadThemeConfig = __decorate([
|
|
|
33
32
|
(0, mongoose_1.Schema)({ _id: false })
|
|
34
33
|
], LeadThemeConfig);
|
|
35
34
|
exports.LeadThemeConfigSchema = mongoose_1.SchemaFactory.createForClass(LeadThemeConfig);
|
|
36
|
-
let
|
|
35
|
+
let LeadTenant = class LeadTenant {
|
|
37
36
|
};
|
|
38
|
-
exports.
|
|
39
|
-
__decorate([
|
|
40
|
-
(0, mongoose_1.Prop)({ type: String, enum: LeadsAuthMode_1.AuthMode, required: true }),
|
|
41
|
-
__metadata("design:type", String)
|
|
42
|
-
], LeadAuthConfig.prototype, "mode", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, mongoose_1.Prop)({ type: String }),
|
|
45
|
-
__metadata("design:type", String)
|
|
46
|
-
], LeadAuthConfig.prototype, "apiLogin", void 0);
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, mongoose_1.Prop)({ type: String }),
|
|
49
|
-
__metadata("design:type", String)
|
|
50
|
-
], LeadAuthConfig.prototype, "apiPasswordEncryptedOrSecretRef", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
(0, mongoose_1.Prop)({ type: String }),
|
|
53
|
-
__metadata("design:type", String)
|
|
54
|
-
], LeadAuthConfig.prototype, "apiTokenHash", void 0);
|
|
55
|
-
exports.LeadAuthConfig = LeadAuthConfig = __decorate([
|
|
56
|
-
(0, mongoose_1.Schema)({ _id: false })
|
|
57
|
-
], LeadAuthConfig);
|
|
58
|
-
exports.LeadAuthConfigSchema = mongoose_1.SchemaFactory.createForClass(LeadAuthConfig);
|
|
59
|
-
let LeadWidgetTenant = class LeadWidgetTenant {
|
|
60
|
-
};
|
|
61
|
-
exports.LeadWidgetTenant = LeadWidgetTenant;
|
|
37
|
+
exports.LeadTenant = LeadTenant;
|
|
62
38
|
__decorate([
|
|
63
39
|
(0, mongoose_1.Prop)({
|
|
64
40
|
type: String,
|
|
@@ -68,11 +44,11 @@ __decorate([
|
|
|
68
44
|
default: () => (0, uuid_1.v4)(),
|
|
69
45
|
}),
|
|
70
46
|
__metadata("design:type", String)
|
|
71
|
-
],
|
|
47
|
+
], LeadTenant.prototype, "_id", void 0);
|
|
72
48
|
__decorate([
|
|
73
49
|
(0, mongoose_1.Prop)({ type: String, required: true, index: true }),
|
|
74
50
|
__metadata("design:type", String)
|
|
75
|
-
],
|
|
51
|
+
], LeadTenant.prototype, "tenantId", void 0);
|
|
76
52
|
__decorate([
|
|
77
53
|
(0, mongoose_1.Prop)({
|
|
78
54
|
type: String,
|
|
@@ -82,7 +58,7 @@ __decorate([
|
|
|
82
58
|
match: SUBDOMAIN_REGEX,
|
|
83
59
|
}),
|
|
84
60
|
__metadata("design:type", String)
|
|
85
|
-
],
|
|
61
|
+
], LeadTenant.prototype, "subdomain", void 0);
|
|
86
62
|
__decorate([
|
|
87
63
|
(0, mongoose_1.Prop)({
|
|
88
64
|
type: String,
|
|
@@ -92,35 +68,31 @@ __decorate([
|
|
|
92
68
|
default: 'autoconsommation.eu',
|
|
93
69
|
}),
|
|
94
70
|
__metadata("design:type", String)
|
|
95
|
-
],
|
|
96
|
-
__decorate([
|
|
97
|
-
(0, mongoose_1.Prop)({ type: exports.LeadAuthConfigSchema, required: true }),
|
|
98
|
-
__metadata("design:type", LeadAuthConfig)
|
|
99
|
-
], LeadWidgetTenant.prototype, "auth", void 0);
|
|
71
|
+
], LeadTenant.prototype, "domain", void 0);
|
|
100
72
|
__decorate([
|
|
101
73
|
(0, mongoose_1.Prop)({ type: [String], default: [] }),
|
|
102
74
|
__metadata("design:type", Array)
|
|
103
|
-
],
|
|
75
|
+
], LeadTenant.prototype, "defaultScenarioIds", void 0);
|
|
104
76
|
__decorate([
|
|
105
77
|
(0, mongoose_1.Prop)({ type: exports.LeadThemeConfigSchema }),
|
|
106
78
|
__metadata("design:type", LeadThemeConfig)
|
|
107
|
-
],
|
|
79
|
+
], LeadTenant.prototype, "theme", void 0);
|
|
108
80
|
__decorate([
|
|
109
81
|
(0, mongoose_1.Prop)({ type: Boolean, default: true, index: true }),
|
|
110
82
|
__metadata("design:type", Boolean)
|
|
111
|
-
],
|
|
112
|
-
exports.
|
|
83
|
+
], LeadTenant.prototype, "isActive", void 0);
|
|
84
|
+
exports.LeadTenant = LeadTenant = __decorate([
|
|
113
85
|
(0, mongoose_1.Schema)({
|
|
114
86
|
id: false,
|
|
115
87
|
timestamps: true,
|
|
116
88
|
toJSON: { virtuals: true, versionKey: false },
|
|
117
89
|
toObject: { virtuals: true, versionKey: false },
|
|
118
90
|
})
|
|
119
|
-
],
|
|
120
|
-
exports.
|
|
91
|
+
], LeadTenant);
|
|
92
|
+
exports.LeadTenantSchema = mongoose_1.SchemaFactory.createForClass(LeadTenant);
|
|
121
93
|
// Index composé : un subdomain unique par domaine
|
|
122
|
-
exports.
|
|
94
|
+
exports.LeadTenantSchema.index({ domain: 1, subdomain: 1 }, { unique: true });
|
|
123
95
|
// Virtuel : URL publique dérivée
|
|
124
|
-
exports.
|
|
96
|
+
exports.LeadTenantSchema.virtual('publicBaseUrl').get(function () {
|
|
125
97
|
return `https://${this.subdomain}.${this.domain}`;
|
|
126
98
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,6 @@ 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';
|
|
31
30
|
export * from './core/internal/battery-params';
|
|
32
31
|
export * from './core/internal/bounding-box';
|
|
33
32
|
export * from './core/internal/building-data';
|
package/dist/index.js
CHANGED
|
@@ -50,7 +50,6 @@ __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);
|
|
54
53
|
// Sub-models
|
|
55
54
|
__exportStar(require("./core/internal/battery-params"), exports);
|
|
56
55
|
__exportStar(require("./core/internal/bounding-box"), exports);
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
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 = {}));
|