@likewatt/models 1.46.0 → 1.48.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.
@@ -1,6 +1,5 @@
1
1
  import { Document } from 'mongoose';
2
2
  export type LeadTenantDocument = LeadTenant & Document;
3
- export declare const SUBDOMAIN_REGEX: RegExp;
4
3
  export declare class LeadThemeConfig {
5
4
  logoUrl?: string;
6
5
  backgroundImageUrl?: string;
@@ -9,11 +9,10 @@ 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.LeadTenantSchema = exports.LeadTenant = exports.LeadTenantLimitsSchema = exports.LeadTenantLimits = exports.LeadLimitRuleSchema = exports.LeadLimitRule = exports.LeadThemeConfigSchema = exports.LeadThemeConfig = exports.SUBDOMAIN_REGEX = void 0;
12
+ exports.LeadTenantSchema = exports.LeadTenant = exports.LeadTenantLimitsSchema = exports.LeadTenantLimits = exports.LeadLimitRuleSchema = exports.LeadLimitRule = exports.LeadThemeConfigSchema = exports.LeadThemeConfig = void 0;
13
13
  const mongoose_1 = require("@nestjs/mongoose");
14
14
  const uuid_1 = require("uuid");
15
- exports.SUBDOMAIN_REGEX = /^(?!-)[a-z0-9-]{1,63}(?<!-)$/;
16
- const COLOR_REGEX = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
15
+ const Regex_1 = require("./Regex");
17
16
  let LeadThemeConfig = class LeadThemeConfig {
18
17
  };
19
18
  exports.LeadThemeConfig = LeadThemeConfig;
@@ -26,19 +25,19 @@ __decorate([
26
25
  __metadata("design:type", String)
27
26
  ], LeadThemeConfig.prototype, "backgroundImageUrl", void 0);
28
27
  __decorate([
29
- (0, mongoose_1.Prop)({ type: String, match: COLOR_REGEX }),
28
+ (0, mongoose_1.Prop)({ type: String, match: Regex_1.COLOR_REGEX }),
30
29
  __metadata("design:type", String)
31
30
  ], LeadThemeConfig.prototype, "buttonBgColor", void 0);
32
31
  __decorate([
33
- (0, mongoose_1.Prop)({ type: String, match: COLOR_REGEX }),
32
+ (0, mongoose_1.Prop)({ type: String, match: Regex_1.COLOR_REGEX }),
34
33
  __metadata("design:type", String)
35
34
  ], LeadThemeConfig.prototype, "buttonTextColor", void 0);
36
35
  __decorate([
37
- (0, mongoose_1.Prop)({ type: String, match: COLOR_REGEX }),
36
+ (0, mongoose_1.Prop)({ type: String, match: Regex_1.COLOR_REGEX }),
38
37
  __metadata("design:type", String)
39
38
  ], LeadThemeConfig.prototype, "sectionBgColor", void 0);
40
39
  __decorate([
41
- (0, mongoose_1.Prop)({ type: String, match: COLOR_REGEX }),
40
+ (0, mongoose_1.Prop)({ type: String, match: Regex_1.COLOR_REGEX }),
42
41
  __metadata("design:type", String)
43
42
  ], LeadThemeConfig.prototype, "textColor", void 0);
44
43
  exports.LeadThemeConfig = LeadThemeConfig = __decorate([
@@ -92,7 +91,7 @@ __decorate([
92
91
  required: true,
93
92
  lowercase: true,
94
93
  trim: true,
95
- match: exports.SUBDOMAIN_REGEX,
94
+ match: Regex_1.SUBDOMAIN_REGEX,
96
95
  }),
97
96
  __metadata("design:type", String)
98
97
  ], LeadTenant.prototype, "subdomain", void 0);
@@ -0,0 +1,4 @@
1
+ export declare const SUBDOMAIN_REGEX: RegExp;
2
+ export declare const COLOR_REGEX: RegExp;
3
+ export declare const ENEDIS_REGEX: RegExp;
4
+ export declare const STRASBOURG_REGEX: RegExp;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STRASBOURG_REGEX = exports.ENEDIS_REGEX = exports.COLOR_REGEX = exports.SUBDOMAIN_REGEX = void 0;
4
+ exports.SUBDOMAIN_REGEX = /^(?!-)[a-z0-9-]{1,63}(?<!-)$/;
5
+ exports.COLOR_REGEX = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
6
+ exports.ENEDIS_REGEX = /^\d{14}$/;
7
+ exports.STRASBOURG_REGEX = /^\d{5}_[A-Z]\d_\d{7}$/;
@@ -155,6 +155,7 @@ export declare class Scenario {
155
155
  isOptimized?: boolean;
156
156
  leasingLifespan?: number;
157
157
  message?: string;
158
+ errorType?: string;
158
159
  name?: string;
159
160
  objectives?: Objective[];
160
161
  optimizationYear?: number;
@@ -505,6 +505,13 @@ __decorate([
505
505
  (0, class_validator_1.IsString)(),
506
506
  __metadata("design:type", String)
507
507
  ], Scenario.prototype, "message", void 0);
508
+ __decorate([
509
+ (0, swagger_1.ApiPropertyOptional)({ example: 'handled', description: 'Type d\'erreur d\'optimisation (infeasible, handled, timeout, unknown)' }),
510
+ (0, mongoose_1.Prop)(),
511
+ (0, class_validator_1.IsOptional)(),
512
+ (0, class_validator_1.IsString)(),
513
+ __metadata("design:type", String)
514
+ ], Scenario.prototype, "errorType", void 0);
508
515
  __decorate([
509
516
  (0, swagger_1.ApiProperty)({ example: 'Scenario A - Hybrid PV/Wind' }),
510
517
  (0, mongoose_1.Prop)({ required: true }),
@@ -31,3 +31,9 @@ export declare enum UseCase {
31
31
  export declare enum Reference {
32
32
  REFERENCE = "REFERENCE"
33
33
  }
34
+ export declare enum OptimizationErrorType {
35
+ INFEASIBLE = "infeasible",
36
+ HANDLED = "handled",
37
+ TIMEOUT = "timeout",
38
+ UNKNOWN = "unknown"
39
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Reference = exports.UseCase = exports.TrackerType = exports.FinancingTypeEnum = exports.Profiles = exports.SiteType = void 0;
3
+ exports.OptimizationErrorType = exports.Reference = exports.UseCase = exports.TrackerType = exports.FinancingTypeEnum = exports.Profiles = exports.SiteType = void 0;
4
4
  var SiteType;
5
5
  (function (SiteType) {
6
6
  SiteType["CONSUMER"] = "CONSUMER";
@@ -40,3 +40,10 @@ var Reference;
40
40
  (function (Reference) {
41
41
  Reference["REFERENCE"] = "REFERENCE";
42
42
  })(Reference || (exports.Reference = Reference = {}));
43
+ var OptimizationErrorType;
44
+ (function (OptimizationErrorType) {
45
+ OptimizationErrorType["INFEASIBLE"] = "infeasible";
46
+ OptimizationErrorType["HANDLED"] = "handled";
47
+ OptimizationErrorType["TIMEOUT"] = "timeout";
48
+ OptimizationErrorType["UNKNOWN"] = "unknown";
49
+ })(OptimizationErrorType || (exports.OptimizationErrorType = OptimizationErrorType = {}));
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from './core/ScenarioDefaultValue';
9
9
  export * from './core/Invitation';
10
10
  export * from './core/DefaultRate';
11
11
  export * from './core/Leads';
12
+ export * from './core/Regex';
12
13
  export * from './core/TypeORM/analysis';
13
14
  export * from './core/TypeORM/Co2History';
14
15
  export * from './core/TypeORM/EnedisReportHistory';
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ __exportStar(require("./core/ScenarioDefaultValue"), exports);
27
27
  __exportStar(require("./core/Invitation"), exports);
28
28
  __exportStar(require("./core/DefaultRate"), exports);
29
29
  __exportStar(require("./core/Leads"), exports);
30
+ __exportStar(require("./core/Regex"), exports);
30
31
  // TypeORM entities
31
32
  __exportStar(require("./core/TypeORM/analysis"), exports);
32
33
  __exportStar(require("./core/TypeORM/Co2History"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likewatt/models",
3
- "version": "1.46.0",
3
+ "version": "1.48.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {