@ludeo/cloud-common 1.2.215 → 1.2.216

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,23 +1,13 @@
1
1
  import { LudeoEvent } from "../../../infra";
2
2
  import { ProvisionerContext } from "../../contexts";
3
3
  import { LudeoFeatures } from "../../types/predictor";
4
- export declare class GamePool {
4
+ export declare class ProvisionedPool {
5
+ poolId: string;
5
6
  size: number;
6
7
  ludeoFeatures?: LudeoFeatures;
7
8
  }
8
- export declare class Games {
9
- [gamePoolId: string]: GamePool;
10
- }
11
- export declare class MachinePool {
12
- size: number;
13
- games: Games;
14
- }
15
- export declare class Machines {
16
- [machinePoolId: string]: MachinePool;
17
- }
18
9
  export declare class ProvisioningEndedPayload {
19
- machines: Machines;
20
- gamePriorities: Record<string, number>;
10
+ pools: ProvisionedPool[];
21
11
  }
22
12
  export declare class ProvisioningEnded extends LudeoEvent {
23
13
  static readonly EVENT_NAME = "provisioner.provisioning-ended";
@@ -9,54 +9,37 @@ 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.ProvisioningEnded = exports.ProvisioningEndedPayload = exports.Machines = exports.MachinePool = exports.Games = exports.GamePool = void 0;
12
+ exports.ProvisioningEnded = exports.ProvisioningEndedPayload = exports.ProvisionedPool = 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
17
  const predictor_1 = require("../../types/predictor");
18
- class GamePool {
18
+ class ProvisionedPool {
19
19
  }
20
- exports.GamePool = GamePool;
20
+ exports.ProvisionedPool = ProvisionedPool;
21
+ __decorate([
22
+ (0, class_validator_1.IsString)(),
23
+ __metadata("design:type", String)
24
+ ], ProvisionedPool.prototype, "poolId", void 0);
21
25
  __decorate([
22
26
  (0, class_validator_1.IsNumber)(),
23
27
  __metadata("design:type", Number)
24
- ], GamePool.prototype, "size", void 0);
28
+ ], ProvisionedPool.prototype, "size", void 0);
25
29
  __decorate([
26
30
  (0, class_validator_1.IsOptional)(),
27
31
  (0, decorators_1.ValidateNestedType)(() => predictor_1.LudeoFeatures),
28
32
  __metadata("design:type", predictor_1.LudeoFeatures)
29
- ], GamePool.prototype, "ludeoFeatures", void 0);
30
- class Games {
31
- }
32
- exports.Games = Games;
33
- class MachinePool {
34
- }
35
- exports.MachinePool = MachinePool;
36
- __decorate([
37
- (0, class_validator_1.IsNumber)(),
38
- __metadata("design:type", Number)
39
- ], MachinePool.prototype, "size", void 0);
40
- __decorate([
41
- (0, class_validator_1.IsDefined)(),
42
- (0, decorators_1.ValidateNestedType)(() => Games),
43
- __metadata("design:type", Games)
44
- ], MachinePool.prototype, "games", void 0);
45
- class Machines {
46
- }
47
- exports.Machines = Machines;
33
+ ], ProvisionedPool.prototype, "ludeoFeatures", void 0);
48
34
  class ProvisioningEndedPayload {
49
35
  }
50
36
  exports.ProvisioningEndedPayload = ProvisioningEndedPayload;
51
37
  __decorate([
52
38
  (0, class_validator_1.IsDefined)(),
53
- (0, decorators_1.ValidateNestedType)(() => Object),
54
- __metadata("design:type", Machines)
55
- ], ProvisioningEndedPayload.prototype, "machines", void 0);
56
- __decorate([
57
- (0, class_validator_1.IsObject)(),
58
- __metadata("design:type", Object)
59
- ], ProvisioningEndedPayload.prototype, "gamePriorities", void 0);
39
+ (0, class_validator_1.IsArray)(),
40
+ (0, decorators_1.ValidateNestedType)(() => ProvisionedPool),
41
+ __metadata("design:type", Array)
42
+ ], ProvisioningEndedPayload.prototype, "pools", void 0);
60
43
  class ProvisioningEnded extends infra_1.LudeoEvent {
61
44
  constructor(payload, context) {
62
45
  super(ProvisioningEnded.EVENT_NAME);
@@ -1 +1 @@
1
- {"version":3,"file":"provisioning-ended.js","sourceRoot":"","sources":["../../../../src/v4/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ning-ended.js","sourceRoot":"","sources":["../../../../src/v4/events/provisioner/provisioning-ended.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAC5C,oDAAyD;AACzD,qDAAqF;AACrF,6CAAoD;AACpD,qDAAsD;AAEtD,MAAa,eAAe;CAU3B;AAVD,0CAUC;AARG;IADC,IAAA,0BAAQ,GAAE;;+CACI;AAGf;IADC,IAAA,0BAAQ,GAAE;;6CACE;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,yBAAa,CAAC;8BACxB,yBAAa;sDAAC;AAGlC,MAAa,wBAAwB;CAKpC;AALD,4DAKC;AADG;IAHC,IAAA,2BAAS,GAAE;IACX,IAAA,yBAAO,GAAE;IACT,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,eAAe,CAAC;;uDACjB;AAG7B,MAAa,iBAAkB,SAAQ,kBAAU;IAG7C,YAAY,OAAiC,EAAE,OAA2B;QACtE,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;;AAPL,8CAcC;AAbmB,4BAAU,GAAG,gCAAgC,CAAC;AAS9D;IADC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;8BAC1C,wBAAwB;kDAAC;AAGlC;IADC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,6BAAkB,CAAC;8BACpC,6BAAkB;kDAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludeo/cloud-common",
3
- "version": "1.2.215",
3
+ "version": "1.2.216",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Yahil Didi",
@@ -1,10 +1,13 @@
1
1
  import { LudeoEvent } from "../../../infra";
2
2
  import { ValidateNestedType } from "../../../decorators";
3
- import { IsDefined, IsNumber, IsObject, IsOptional } from "class-validator";
3
+ import { IsArray, IsDefined, IsNumber, IsOptional, IsString } from "class-validator";
4
4
  import { ProvisionerContext } from "../../contexts";
5
5
  import { LudeoFeatures } from "../../types/predictor";
6
6
 
7
- export class GamePool {
7
+ export class ProvisionedPool {
8
+ @IsString()
9
+ poolId: string;
10
+
8
11
  @IsNumber()
9
12
  size: number;
10
13
 
@@ -13,30 +16,11 @@ export class GamePool {
13
16
  ludeoFeatures?: LudeoFeatures;
14
17
  }
15
18
 
16
- export class Games {
17
- [gamePoolId: string]: GamePool;
18
- }
19
-
20
- export class MachinePool {
21
- @IsNumber()
22
- size: number;
23
-
24
- @IsDefined()
25
- @ValidateNestedType(() => Games)
26
- games: Games;
27
- }
28
-
29
- export class Machines {
30
- [machinePoolId: string]: MachinePool;
31
- }
32
-
33
19
  export class ProvisioningEndedPayload {
34
20
  @IsDefined()
35
- @ValidateNestedType(() => Object)
36
- machines: Machines;
37
-
38
- @IsObject()
39
- gamePriorities: Record<string, number>; // gameEnvironmentId -> priority
21
+ @IsArray()
22
+ @ValidateNestedType(() => ProvisionedPool)
23
+ pools: ProvisionedPool[];
40
24
  }
41
25
 
42
26
  export class ProvisioningEnded extends LudeoEvent {