@ludeo/cloud-common 1.2.209 → 1.2.210
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/tsconfig.tsbuildinfo +1 -1
- package/dist/v4/contexts/forecast-context.d.ts +5 -0
- package/dist/v4/contexts/forecast-context.js +32 -0
- package/dist/v4/contexts/forecast-context.js.map +1 -0
- package/dist/v4/contexts/index.d.ts +1 -0
- package/dist/v4/contexts/index.js +1 -0
- package/dist/v4/contexts/index.js.map +1 -1
- package/dist/v4/events/forecast/forecast-ended.d.ts +10 -5
- package/dist/v4/events/forecast/forecast-ended.js +28 -14
- package/dist/v4/events/forecast/forecast-ended.js.map +1 -1
- package/package.json +1 -1
- package/src/v4/contexts/forecast-context.ts +15 -0
- package/src/v4/contexts/index.ts +1 -0
- package/src/v4/events/forecast/forecast-ended.ts +20 -9
|
@@ -0,0 +1,32 @@
|
|
|
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.ForecastContext = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class ForecastContext {
|
|
15
|
+
}
|
|
16
|
+
exports.ForecastContext = ForecastContext;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsOptional)(),
|
|
19
|
+
(0, class_validator_1.IsNumber)(),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], ForecastContext.prototype, "sizeByReservations", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsOptional)(),
|
|
24
|
+
(0, class_validator_1.IsNumber)(),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], ForecastContext.prototype, "sizeByUsage", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
(0, class_validator_1.IsUUID)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], ForecastContext.prototype, "forecastId", void 0);
|
|
32
|
+
//# sourceMappingURL=forecast-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forecast-context.js","sourceRoot":"","sources":["../../../src/v4/contexts/forecast-context.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+D;AAE/D,MAAa,eAAe;CAY3B;AAZD,0CAYC;AATC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2DACiB;AAI5B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACU;AAIrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;mDACW"}
|
|
@@ -20,4 +20,5 @@ __exportStar(require("./cloud-session-context"), exports);
|
|
|
20
20
|
__exportStar(require("./getCloudContextType"), exports);
|
|
21
21
|
__exportStar(require("./build-context"), exports);
|
|
22
22
|
__exportStar(require("./client-geo-data"), exports);
|
|
23
|
+
__exportStar(require("./forecast-context"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v4/contexts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,2DAAyC;AACzC,0DAAwC;AACxC,wDAAsC;AACtC,kDAAgC;AAChC,oDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v4/contexts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,2DAAyC;AACzC,0DAAwC;AACxC,wDAAsC;AACtC,kDAAgC;AAChC,oDAAkC;AAClC,qDAAmC"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { LudeoEvent } from "../../../infra";
|
|
2
|
-
|
|
2
|
+
import { ForecastContext } from "../../contexts";
|
|
3
|
+
export declare class ReservedLudeos {
|
|
3
4
|
[ludeoId: string]: number;
|
|
4
5
|
}
|
|
5
|
-
export declare class
|
|
6
|
+
export declare class LudeosPopularity {
|
|
6
7
|
[ludeoId: string]: number;
|
|
7
8
|
}
|
|
9
|
+
export declare class LudeoFeatures {
|
|
10
|
+
reservations?: ReservedLudeos;
|
|
11
|
+
popularity?: LudeosPopularity;
|
|
12
|
+
}
|
|
8
13
|
export declare class ForecastMajorVersion {
|
|
9
14
|
totalDemand: number;
|
|
10
|
-
|
|
11
|
-
ludeosRatio?: LudeosRatio;
|
|
15
|
+
ludeoFeatures?: LudeoFeatures;
|
|
12
16
|
}
|
|
13
17
|
export declare class ForecastEnvironment {
|
|
14
18
|
[majorVersion: string]: ForecastMajorVersion;
|
|
@@ -23,6 +27,7 @@ export declare class ForecastEndedPayload {
|
|
|
23
27
|
}
|
|
24
28
|
export declare class ForecastEnded extends LudeoEvent {
|
|
25
29
|
static readonly EVENT_NAME = "forecast.forecast-ended";
|
|
26
|
-
constructor(payload: ForecastEndedPayload);
|
|
30
|
+
constructor(payload: ForecastEndedPayload, context: ForecastContext);
|
|
27
31
|
payload: ForecastEndedPayload;
|
|
32
|
+
context: ForecastContext;
|
|
28
33
|
}
|
|
@@ -9,16 +9,30 @@ 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.ForecastEnded = exports.ForecastEndedPayload = exports.ForecastLocation = exports.ForecastEnvironment = exports.ForecastMajorVersion = exports.
|
|
12
|
+
exports.ForecastEnded = exports.ForecastEndedPayload = exports.ForecastLocation = exports.ForecastEnvironment = exports.ForecastMajorVersion = exports.LudeoFeatures = exports.LudeosPopularity = exports.ReservedLudeos = void 0;
|
|
13
13
|
const infra_1 = require("../../../infra");
|
|
14
14
|
const decorators_1 = require("../../../decorators");
|
|
15
15
|
const class_validator_1 = require("class-validator");
|
|
16
|
-
|
|
16
|
+
const contexts_1 = require("../../contexts");
|
|
17
|
+
class ReservedLudeos {
|
|
17
18
|
}
|
|
18
|
-
exports.
|
|
19
|
-
class
|
|
19
|
+
exports.ReservedLudeos = ReservedLudeos;
|
|
20
|
+
class LudeosPopularity {
|
|
20
21
|
}
|
|
21
|
-
exports.
|
|
22
|
+
exports.LudeosPopularity = LudeosPopularity;
|
|
23
|
+
class LudeoFeatures {
|
|
24
|
+
}
|
|
25
|
+
exports.LudeoFeatures = LudeoFeatures;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, decorators_1.ValidateNestedType)(() => ReservedLudeos),
|
|
29
|
+
__metadata("design:type", ReservedLudeos)
|
|
30
|
+
], LudeoFeatures.prototype, "reservations", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, decorators_1.ValidateNestedType)(() => LudeosPopularity),
|
|
34
|
+
__metadata("design:type", LudeosPopularity)
|
|
35
|
+
], LudeoFeatures.prototype, "popularity", void 0);
|
|
22
36
|
class ForecastMajorVersion {
|
|
23
37
|
}
|
|
24
38
|
exports.ForecastMajorVersion = ForecastMajorVersion;
|
|
@@ -28,14 +42,9 @@ __decorate([
|
|
|
28
42
|
], ForecastMajorVersion.prototype, "totalDemand", void 0);
|
|
29
43
|
__decorate([
|
|
30
44
|
(0, class_validator_1.IsOptional)(),
|
|
31
|
-
(0, decorators_1.ValidateNestedType)(() =>
|
|
32
|
-
__metadata("design:type",
|
|
33
|
-
], ForecastMajorVersion.prototype, "
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, class_validator_1.IsOptional)(),
|
|
36
|
-
(0, decorators_1.ValidateNestedType)(() => LudeosRatio),
|
|
37
|
-
__metadata("design:type", LudeosRatio)
|
|
38
|
-
], ForecastMajorVersion.prototype, "ludeosRatio", void 0);
|
|
45
|
+
(0, decorators_1.ValidateNestedType)(() => LudeoFeatures),
|
|
46
|
+
__metadata("design:type", LudeoFeatures)
|
|
47
|
+
], ForecastMajorVersion.prototype, "ludeoFeatures", void 0);
|
|
39
48
|
class ForecastEnvironment {
|
|
40
49
|
}
|
|
41
50
|
exports.ForecastEnvironment = ForecastEnvironment;
|
|
@@ -51,9 +60,10 @@ __decorate([
|
|
|
51
60
|
__metadata("design:type", Object)
|
|
52
61
|
], ForecastEndedPayload.prototype, "forecasts", void 0);
|
|
53
62
|
class ForecastEnded extends infra_1.LudeoEvent {
|
|
54
|
-
constructor(payload) {
|
|
63
|
+
constructor(payload, context) {
|
|
55
64
|
super(ForecastEnded.EVENT_NAME);
|
|
56
65
|
this.payload = payload;
|
|
66
|
+
this.context = context;
|
|
57
67
|
}
|
|
58
68
|
}
|
|
59
69
|
exports.ForecastEnded = ForecastEnded;
|
|
@@ -62,4 +72,8 @@ __decorate([
|
|
|
62
72
|
(0, decorators_1.ValidateNestedType)(() => ForecastEndedPayload),
|
|
63
73
|
__metadata("design:type", ForecastEndedPayload)
|
|
64
74
|
], ForecastEnded.prototype, "payload", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, decorators_1.ValidateNestedType)(() => contexts_1.ForecastContext),
|
|
77
|
+
__metadata("design:type", contexts_1.ForecastContext)
|
|
78
|
+
], ForecastEnded.prototype, "context", void 0);
|
|
65
79
|
//# sourceMappingURL=forecast-ended.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forecast-ended.js","sourceRoot":"","sources":["../../../../src/v4/events/forecast/forecast-ended.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAC5C,oDAAyD;AACzD,qDAAkE;
|
|
1
|
+
{"version":3,"file":"forecast-ended.js","sourceRoot":"","sources":["../../../../src/v4/events/forecast/forecast-ended.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAC5C,oDAAyD;AACzD,qDAAkE;AAClE,6CAAiD;AAEjD,MAAa,cAAc;CAE1B;AAFD,wCAEC;AAED,MAAa,gBAAgB;CAE5B;AAFD,4CAEC;AAED,MAAa,aAAa;CAQzB;AARD,sCAQC;AALG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,cAAc,CAAC;8BAC1B,cAAc;mDAAC;AAI9B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC;8BAC9B,gBAAgB;iDAAC;AAGlC,MAAa,oBAAoB;CAOhC;AAPD,oDAOC;AALG;IADC,IAAA,0BAAQ,GAAE;;yDACS;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,aAAa,CAAC;8BACxB,aAAa;2DAAC;AAGlC,MAAa,mBAAmB;CAE/B;AAFD,kDAEC;AAED,MAAa,gBAAgB;CAE5B;AAFD,4CAEC;AAED,MAAa,oBAAoB;CAMhC;AAND,oDAMC;AAHG;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;uDAG/B;AAGN,MAAa,aAAc,SAAQ,kBAAU;IAGzC,YAAY,OAA6B,EAAE,OAAwB;QAC/D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;;AAPL,sCAcC;AAbmB,wBAAU,GAAG,yBAAyB,CAAC;AASvD;IADC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC;8BACtC,oBAAoB;8CAAC;AAG9B;IADC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,0BAAe,CAAC;8BACjC,0BAAe;8CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IsNumber, IsOptional, IsUUID } from "class-validator";
|
|
2
|
+
|
|
3
|
+
export class ForecastContext {
|
|
4
|
+
@IsOptional()
|
|
5
|
+
@IsNumber()
|
|
6
|
+
sizeByReservations?: number;
|
|
7
|
+
|
|
8
|
+
@IsOptional()
|
|
9
|
+
@IsNumber()
|
|
10
|
+
sizeByUsage?: number;
|
|
11
|
+
|
|
12
|
+
@IsOptional()
|
|
13
|
+
@IsUUID()
|
|
14
|
+
forecastId?: string;
|
|
15
|
+
}
|
package/src/v4/contexts/index.ts
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
import { LudeoEvent } from "../../../infra";
|
|
2
2
|
import { ValidateNestedType } from "../../../decorators";
|
|
3
3
|
import { IsDefined, IsNumber, IsOptional } from "class-validator";
|
|
4
|
+
import { ForecastContext } from "../../contexts";
|
|
4
5
|
|
|
5
|
-
export class
|
|
6
|
+
export class ReservedLudeos {
|
|
6
7
|
[ludeoId: string]: number;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
export class
|
|
10
|
+
export class LudeosPopularity {
|
|
10
11
|
[ludeoId: string]: number;
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
export class LudeoFeatures {
|
|
15
|
+
@IsOptional()
|
|
16
|
+
@ValidateNestedType(() => ReservedLudeos)
|
|
17
|
+
reservations?: ReservedLudeos;
|
|
18
|
+
|
|
19
|
+
@IsOptional()
|
|
20
|
+
@ValidateNestedType(() => LudeosPopularity)
|
|
21
|
+
popularity?: LudeosPopularity;
|
|
22
|
+
}
|
|
23
|
+
|
|
13
24
|
export class ForecastMajorVersion {
|
|
14
25
|
@IsNumber()
|
|
15
26
|
totalDemand: number;
|
|
16
27
|
|
|
17
28
|
@IsOptional()
|
|
18
|
-
@ValidateNestedType(() =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
@IsOptional()
|
|
22
|
-
@ValidateNestedType(() => LudeosRatio)
|
|
23
|
-
ludeosRatio?: LudeosRatio;
|
|
29
|
+
@ValidateNestedType(() => LudeoFeatures)
|
|
30
|
+
ludeoFeatures?: LudeoFeatures;
|
|
24
31
|
}
|
|
25
32
|
|
|
26
33
|
export class ForecastEnvironment {
|
|
@@ -42,11 +49,15 @@ export class ForecastEndedPayload {
|
|
|
42
49
|
export class ForecastEnded extends LudeoEvent {
|
|
43
50
|
static readonly EVENT_NAME = "forecast.forecast-ended";
|
|
44
51
|
|
|
45
|
-
constructor(payload: ForecastEndedPayload) {
|
|
52
|
+
constructor(payload: ForecastEndedPayload, context: ForecastContext) {
|
|
46
53
|
super(ForecastEnded.EVENT_NAME);
|
|
47
54
|
this.payload = payload;
|
|
55
|
+
this.context = context;
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
@ValidateNestedType(() => ForecastEndedPayload)
|
|
51
59
|
payload: ForecastEndedPayload;
|
|
60
|
+
|
|
61
|
+
@ValidateNestedType(() => ForecastContext)
|
|
62
|
+
context: ForecastContext;
|
|
52
63
|
}
|