@likewatt/models 1.14.1 → 1.14.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.
@@ -1,6 +1,6 @@
1
1
  import { Document } from 'mongoose';
2
2
  import { AuthMode } from './enums/LeadsAuthMode';
3
- export type LeadWidgetTenantDocument = LeadWidgetTenant & Document;
3
+ export type LeadTenantDocument = LeadTenant & Document;
4
4
  export declare class LeadThemeConfig {
5
5
  logoUrl?: string;
6
6
  backgroundImageUrl?: string;
@@ -30,7 +30,7 @@ export declare const LeadAuthConfigSchema: import("mongoose").Schema<LeadAuthCon
30
30
  } & {
31
31
  __v: number;
32
32
  }>;
33
- export declare class LeadWidgetTenant {
33
+ export declare class LeadTenant {
34
34
  _id: string;
35
35
  tenantId: string;
36
36
  subdomain: string;
@@ -40,11 +40,11 @@ export declare class LeadWidgetTenant {
40
40
  theme?: LeadThemeConfig;
41
41
  isActive: boolean;
42
42
  }
43
- export declare const LeadWidgetTenantSchema: import("mongoose").Schema<LeadWidgetTenant, import("mongoose").Model<LeadWidgetTenant, any, any, any, Document<unknown, any, LeadWidgetTenant, any, {}> & LeadWidgetTenant & Required<{
43
+ export declare const LeadTenantSchema: import("mongoose").Schema<LeadTenant, import("mongoose").Model<LeadTenant, any, any, any, Document<unknown, any, LeadTenant, any, {}> & LeadTenant & Required<{
44
44
  _id: string;
45
45
  }> & {
46
46
  __v: number;
47
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, LeadWidgetTenant, Document<unknown, {}, import("mongoose").FlatRecord<LeadWidgetTenant>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<LeadWidgetTenant> & Required<{
47
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, LeadTenant, Document<unknown, {}, import("mongoose").FlatRecord<LeadTenant>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<LeadTenant> & Required<{
48
48
  _id: string;
49
49
  }> & {
50
50
  __v: number;
@@ -9,7 +9,7 @@ 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.LeadWidgetTenantSchema = exports.LeadWidgetTenant = exports.LeadAuthConfigSchema = exports.LeadAuthConfig = exports.LeadThemeConfigSchema = exports.LeadThemeConfig = void 0;
12
+ exports.LeadTenantSchema = exports.LeadTenant = exports.LeadAuthConfigSchema = exports.LeadAuthConfig = exports.LeadThemeConfigSchema = exports.LeadThemeConfig = void 0;
13
13
  const mongoose_1 = require("@nestjs/mongoose");
14
14
  const uuid_1 = require("uuid");
15
15
  const LeadsAuthMode_1 = require("./enums/LeadsAuthMode");
@@ -56,9 +56,9 @@ exports.LeadAuthConfig = LeadAuthConfig = __decorate([
56
56
  (0, mongoose_1.Schema)({ _id: false })
57
57
  ], LeadAuthConfig);
58
58
  exports.LeadAuthConfigSchema = mongoose_1.SchemaFactory.createForClass(LeadAuthConfig);
59
- let LeadWidgetTenant = class LeadWidgetTenant {
59
+ let LeadTenant = class LeadTenant {
60
60
  };
61
- exports.LeadWidgetTenant = LeadWidgetTenant;
61
+ exports.LeadTenant = LeadTenant;
62
62
  __decorate([
63
63
  (0, mongoose_1.Prop)({
64
64
  type: String,
@@ -68,11 +68,11 @@ __decorate([
68
68
  default: () => (0, uuid_1.v4)(),
69
69
  }),
70
70
  __metadata("design:type", String)
71
- ], LeadWidgetTenant.prototype, "_id", void 0);
71
+ ], LeadTenant.prototype, "_id", void 0);
72
72
  __decorate([
73
73
  (0, mongoose_1.Prop)({ type: String, required: true, index: true }),
74
74
  __metadata("design:type", String)
75
- ], LeadWidgetTenant.prototype, "tenantId", void 0);
75
+ ], LeadTenant.prototype, "tenantId", void 0);
76
76
  __decorate([
77
77
  (0, mongoose_1.Prop)({
78
78
  type: String,
@@ -82,7 +82,7 @@ __decorate([
82
82
  match: SUBDOMAIN_REGEX,
83
83
  }),
84
84
  __metadata("design:type", String)
85
- ], LeadWidgetTenant.prototype, "subdomain", void 0);
85
+ ], LeadTenant.prototype, "subdomain", void 0);
86
86
  __decorate([
87
87
  (0, mongoose_1.Prop)({
88
88
  type: String,
@@ -92,35 +92,35 @@ __decorate([
92
92
  default: 'autoconsommation.eu',
93
93
  }),
94
94
  __metadata("design:type", String)
95
- ], LeadWidgetTenant.prototype, "domain", void 0);
95
+ ], LeadTenant.prototype, "domain", void 0);
96
96
  __decorate([
97
97
  (0, mongoose_1.Prop)({ type: exports.LeadAuthConfigSchema, required: true }),
98
98
  __metadata("design:type", LeadAuthConfig)
99
- ], LeadWidgetTenant.prototype, "auth", void 0);
99
+ ], LeadTenant.prototype, "auth", void 0);
100
100
  __decorate([
101
101
  (0, mongoose_1.Prop)({ type: [String], default: [] }),
102
102
  __metadata("design:type", Array)
103
- ], LeadWidgetTenant.prototype, "defaultScenarioIds", void 0);
103
+ ], LeadTenant.prototype, "defaultScenarioIds", void 0);
104
104
  __decorate([
105
105
  (0, mongoose_1.Prop)({ type: exports.LeadThemeConfigSchema }),
106
106
  __metadata("design:type", LeadThemeConfig)
107
- ], LeadWidgetTenant.prototype, "theme", void 0);
107
+ ], LeadTenant.prototype, "theme", void 0);
108
108
  __decorate([
109
109
  (0, mongoose_1.Prop)({ type: Boolean, default: true, index: true }),
110
110
  __metadata("design:type", Boolean)
111
- ], LeadWidgetTenant.prototype, "isActive", void 0);
112
- exports.LeadWidgetTenant = LeadWidgetTenant = __decorate([
111
+ ], LeadTenant.prototype, "isActive", void 0);
112
+ exports.LeadTenant = LeadTenant = __decorate([
113
113
  (0, mongoose_1.Schema)({
114
114
  id: false,
115
115
  timestamps: true,
116
116
  toJSON: { virtuals: true, versionKey: false },
117
117
  toObject: { virtuals: true, versionKey: false },
118
118
  })
119
- ], LeadWidgetTenant);
120
- exports.LeadWidgetTenantSchema = mongoose_1.SchemaFactory.createForClass(LeadWidgetTenant);
119
+ ], LeadTenant);
120
+ exports.LeadTenantSchema = mongoose_1.SchemaFactory.createForClass(LeadTenant);
121
121
  // Index composé : un subdomain unique par domaine
122
- exports.LeadWidgetTenantSchema.index({ domain: 1, subdomain: 1 }, { unique: true });
122
+ exports.LeadTenantSchema.index({ domain: 1, subdomain: 1 }, { unique: true });
123
123
  // Virtuel : URL publique dérivée
124
- exports.LeadWidgetTenantSchema.virtual('publicBaseUrl').get(function () {
124
+ exports.LeadTenantSchema.virtual('publicBaseUrl').get(function () {
125
125
  return `https://${this.subdomain}.${this.domain}`;
126
126
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likewatt/models",
3
- "version": "1.14.1",
3
+ "version": "1.14.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {