@ludeo/cloud-common 1.1.123 → 1.1.125-beta1

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,13 +1,13 @@
1
1
  import { LudeoEvent } from "../../infra/ludeo-event";
2
- import { CloudResourcesStatusMap, BasePoolAttributes } from "../types";
3
- export declare class PoolStatusEventPoolV2 {
4
- attributes: BasePoolAttributes;
2
+ import { PoolAttributesType } from "../types/pools/configuration/attributes/type";
3
+ import { CloudResourcesStatusMap, CloudPoolType } from "../types";
4
+ export declare class PoolStatusEventPool<T extends CloudPoolType> {
5
+ attributes: PoolAttributesType<T>;
5
6
  statusMap: CloudResourcesStatusMap;
6
7
  }
7
- export type PoolStatusEventPayloadV1 = Record<string, string | number>;
8
8
  export declare class PoolStatusEventPayload {
9
- games: PoolStatusEventPayloadV1[];
10
- machines: PoolStatusEventPayloadV1[];
9
+ games: PoolStatusEventPool<CloudPoolType.GAME>[];
10
+ machines: PoolStatusEventPool<CloudPoolType.MACHINE>[];
11
11
  requestId: string;
12
12
  }
13
13
  export declare class PoolStatusEvent extends LudeoEvent {
@@ -9,18 +9,18 @@ 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.PoolStatusEvent = exports.PoolStatusEventPayload = exports.PoolStatusEventPoolV2 = void 0;
12
+ exports.PoolStatusEvent = exports.PoolStatusEventPayload = exports.PoolStatusEventPool = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const ludeo_event_1 = require("../../infra/ludeo-event");
15
- const types_1 = require("../types");
16
15
  const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
17
- class PoolStatusEventPoolV2 {
16
+ const types_1 = require("../types");
17
+ class PoolStatusEventPool {
18
18
  }
19
- exports.PoolStatusEventPoolV2 = PoolStatusEventPoolV2;
19
+ exports.PoolStatusEventPool = PoolStatusEventPool;
20
20
  __decorate([
21
21
  (0, validate_nested_type_decorator_1.ValidateNestedType)(() => types_1.BasePoolAttributes),
22
- __metadata("design:type", types_1.BasePoolAttributes)
23
- ], PoolStatusEventPoolV2.prototype, "attributes", void 0);
22
+ __metadata("design:type", Object)
23
+ ], PoolStatusEventPool.prototype, "attributes", void 0);
24
24
  class PoolStatusEventPayload {
25
25
  }
26
26
  exports.PoolStatusEventPayload = PoolStatusEventPayload;
@@ -1 +1 @@
1
- {"version":3,"file":"pool-status.js","sourceRoot":"","sources":["../../../src/v3/events/pool-status.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAyC;AAEzC,yDAAqD;AACrD,oCAAuE;AACvE,oGAAqF;AAKrF,MAAa,qBAAqB;CAKjC;AALD,sDAKC;AAHC;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,0BAAkB,CAAC;8BACjC,0BAAkB;yDAAC;AAQjC,MAAa,sBAAsB;CAOlC;AAPD,wDAOC;AADC;IADC,IAAA,wBAAM,GAAE;;yDACS;AAGpB,MAAa,eAAgB,SAAQ,wBAAU;IAG7C,YAAY,OAA+B;QACzC,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AANH,0CAUC;AATiB,0BAAU,GAAG,yBAAyB,CAAC;AAQvD;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC;8BACxC,sBAAsB;gDAAC"}
1
+ {"version":3,"file":"pool-status.js","sourceRoot":"","sources":["../../../src/v3/events/pool-status.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAyC;AAEzC,yDAAqD;AACrD,oGAAqF;AAErF,oCAIkB;AAElB,MAAa,mBAAmB;CAK/B;AALD,kDAKC;AAHC;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,0BAAkB,CAAC;;uDACX;AAKpC,MAAa,sBAAsB;CAOlC;AAPD,wDAOC;AADC;IADC,IAAA,wBAAM,GAAE;;yDACS;AAGpB,MAAa,eAAgB,SAAQ,wBAAU;IAG7C,YAAY,OAA+B;QACzC,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AANH,0CAUC;AATiB,0BAAU,GAAG,yBAAyB,CAAC;AAQvD;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC;8BACxC,sBAAsB;gDAAC"}
@@ -0,0 +1,5 @@
1
+ import { CloudPoolType } from "../../type";
2
+ import { BasePoolAttributes } from "./base";
3
+ import { GamePoolAttributes } from "./game";
4
+ import { MachinePoolAttributes } from "./machine";
5
+ export type PoolAttributesType<T extends CloudPoolType | undefined = undefined> = T extends undefined ? BasePoolAttributes : T extends CloudPoolType.GAME ? GamePoolAttributes : T extends CloudPoolType.MACHINE ? MachinePoolAttributes : BasePoolAttributes;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../../../../src/v3/types/pools/configuration/attributes/type.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludeo/cloud-common",
3
- "version": "1.1.123",
3
+ "version": "1.1.125-beta1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Yahil Didi",
@@ -1,26 +1,25 @@
1
1
  import { IsUUID } from "class-validator";
2
2
 
3
3
  import { LudeoEvent } from "../../infra/ludeo-event";
4
- import { CloudResourcesStatusMap, BasePoolAttributes } from "../types";
5
4
  import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
6
-
7
- /**
8
- * Will be used later on in a newer version of the predictor
9
- */
10
- export class PoolStatusEventPoolV2 {
5
+ import { PoolAttributesType } from "../types/pools/configuration/attributes/type";
6
+ import {
7
+ CloudResourcesStatusMap,
8
+ BasePoolAttributes,
9
+ CloudPoolType,
10
+ } from "../types";
11
+
12
+ export class PoolStatusEventPool<T extends CloudPoolType> {
11
13
  @ValidateNestedType(() => BasePoolAttributes)
12
- attributes: BasePoolAttributes;
14
+ attributes: PoolAttributesType<T>;
13
15
 
14
16
  statusMap: CloudResourcesStatusMap;
15
17
  }
16
18
 
17
- // something like {...attributes, ...statusMap}
18
- export type PoolStatusEventPayloadV1 = Record<string, string | number>;
19
-
20
19
  export class PoolStatusEventPayload {
21
- games: PoolStatusEventPayloadV1[];
20
+ games: PoolStatusEventPool<CloudPoolType.GAME>[];
22
21
 
23
- machines: PoolStatusEventPayloadV1[];
22
+ machines: PoolStatusEventPool<CloudPoolType.MACHINE>[];
24
23
 
25
24
  @IsUUID()
26
25
  requestId: string;
@@ -0,0 +1,14 @@
1
+ import { CloudPoolType } from "../../type";
2
+ import { BasePoolAttributes } from "./base";
3
+ import { GamePoolAttributes } from "./game";
4
+ import { MachinePoolAttributes } from "./machine";
5
+
6
+ export type PoolAttributesType<
7
+ T extends CloudPoolType | undefined = undefined
8
+ > = T extends undefined
9
+ ? BasePoolAttributes
10
+ : T extends CloudPoolType.GAME
11
+ ? GamePoolAttributes
12
+ : T extends CloudPoolType.MACHINE
13
+ ? MachinePoolAttributes
14
+ : BasePoolAttributes;