@ludeo/cloud-common 1.1.77 → 1.1.79-beta

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.
@@ -26,6 +26,7 @@ export * from "./machine-pool-resizing-task";
26
26
  export * from "./machine-resource-created-response";
27
27
  export * from "./machine-resource-creation-failed-response";
28
28
  export * from "./monitor-game-resource-task";
29
+ export * from "./pool-status";
29
30
  export * from "./set-pool.event";
30
31
  export * from "./set-pools-state";
31
32
  export * from "./swap-cloud-user-completed";
@@ -42,6 +42,7 @@ __exportStar(require("./machine-pool-resizing-task"), exports);
42
42
  __exportStar(require("./machine-resource-created-response"), exports);
43
43
  __exportStar(require("./machine-resource-creation-failed-response"), exports);
44
44
  __exportStar(require("./monitor-game-resource-task"), exports);
45
+ __exportStar(require("./pool-status"), exports);
45
46
  __exportStar(require("./set-pool.event"), exports);
46
47
  __exportStar(require("./set-pools-state"), exports);
47
48
  __exportStar(require("./swap-cloud-user-completed"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v3/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,mEAAiD;AACjD,6DAA2C;AAC3C,iEAA+C;AAC/C,yDAAuC;AACvC,0EAAwD;AACxD,oEAAkD;AAClD,4DAA0C;AAC1C,+DAA6C;AAC7C,4DAA0C;AAC1C,oEAAkD;AAClD,qEAAmD;AACnD,6EAA2D;AAC3D,mEAAiD;AACjD,2EAAyD;AACzD,sEAAoD;AACpD,8EAA4D;AAC5D,6DAA2C;AAC3C,qEAAmD;AACnD,iEAA+C;AAC/C,+DAA6C;AAC7C,uEAAqD;AACrD,iEAA+C;AAC/C,yEAAuD;AACvD,+DAA6C;AAC7C,sEAAoD;AACpD,8EAA4D;AAC5D,+DAA6C;AAC7C,mDAAiC;AACjC,oDAAkC;AAClC,8DAA4C;AAC5C,mEAAiD;AACjD,4DAA0C;AAC1C,2DAAyC;AACzC,oEAAkD;AAClD,4DAA0C;AAC1C,6EAA2D;AAC3D,+DAA6C;AAC7C,+DAA6C;AAC7C,sEAAoD;AACpD,yDAAuC;AACvC,6DAA2C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v3/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,mEAAiD;AACjD,6DAA2C;AAC3C,iEAA+C;AAC/C,yDAAuC;AACvC,0EAAwD;AACxD,oEAAkD;AAClD,4DAA0C;AAC1C,+DAA6C;AAC7C,4DAA0C;AAC1C,oEAAkD;AAClD,qEAAmD;AACnD,6EAA2D;AAC3D,mEAAiD;AACjD,2EAAyD;AACzD,sEAAoD;AACpD,8EAA4D;AAC5D,6DAA2C;AAC3C,qEAAmD;AACnD,iEAA+C;AAC/C,+DAA6C;AAC7C,uEAAqD;AACrD,iEAA+C;AAC/C,yEAAuD;AACvD,+DAA6C;AAC7C,sEAAoD;AACpD,8EAA4D;AAC5D,+DAA6C;AAC7C,gDAA8B;AAC9B,mDAAiC;AACjC,oDAAkC;AAClC,8DAA4C;AAC5C,mEAAiD;AACjD,4DAA0C;AAC1C,2DAAyC;AACzC,oEAAkD;AAClD,4DAA0C;AAC1C,6EAA2D;AAC3D,+DAA6C;AAC7C,+DAA6C;AAC7C,sEAAoD;AACpD,yDAAuC;AACvC,6DAA2C"}
@@ -0,0 +1,16 @@
1
+ import { LudeoEvent } from "../../infra/ludeo-event";
2
+ import { CloudResourcesStatusMap, BasePoolAttributes } from "../types";
3
+ export declare class PoolStatusEventPoolV2 {
4
+ attributes: BasePoolAttributes;
5
+ statusMap: CloudResourcesStatusMap;
6
+ }
7
+ export type PoolStatusEventPayloadV1 = Record<string, string | number>;
8
+ export declare class PoolStatusEventPayload {
9
+ games: PoolStatusEventPayloadV1[];
10
+ machines: PoolStatusEventPayloadV1[];
11
+ }
12
+ export declare class PoolStatusEvent extends LudeoEvent {
13
+ static readonly EVENT_NAME = "cloud-pools.pool-status";
14
+ constructor(payload: PoolStatusEventPayload);
15
+ payload: PoolStatusEventPayload;
16
+ }
@@ -0,0 +1,38 @@
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.PoolStatusEvent = exports.PoolStatusEventPayload = exports.PoolStatusEventPoolV2 = void 0;
13
+ const ludeo_event_1 = require("../../infra/ludeo-event");
14
+ const types_1 = require("../types");
15
+ const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
16
+ class PoolStatusEventPoolV2 {
17
+ }
18
+ exports.PoolStatusEventPoolV2 = PoolStatusEventPoolV2;
19
+ __decorate([
20
+ (0, validate_nested_type_decorator_1.ValidateNestedType)(() => types_1.BasePoolAttributes),
21
+ __metadata("design:type", types_1.BasePoolAttributes)
22
+ ], PoolStatusEventPoolV2.prototype, "attributes", void 0);
23
+ class PoolStatusEventPayload {
24
+ }
25
+ exports.PoolStatusEventPayload = PoolStatusEventPayload;
26
+ class PoolStatusEvent extends ludeo_event_1.LudeoEvent {
27
+ constructor(payload) {
28
+ super(PoolStatusEvent.EVENT_NAME);
29
+ this.payload = payload;
30
+ }
31
+ }
32
+ exports.PoolStatusEvent = PoolStatusEvent;
33
+ PoolStatusEvent.EVENT_NAME = "cloud-pools.pool-status";
34
+ __decorate([
35
+ (0, validate_nested_type_decorator_1.ValidateNestedType)(() => PoolStatusEventPayload),
36
+ __metadata("design:type", PoolStatusEventPayload)
37
+ ], PoolStatusEvent.prototype, "payload", void 0);
38
+ //# sourceMappingURL=pool-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool-status.js","sourceRoot":"","sources":["../../../src/v3/events/pool-status.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,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;CAIlC;AAJD,wDAIC;AAED,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludeo/cloud-common",
3
- "version": "1.1.77",
3
+ "version": "1.1.79-beta",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Yahil Didi",
@@ -26,6 +26,7 @@ export * from "./machine-pool-resizing-task";
26
26
  export * from "./machine-resource-created-response";
27
27
  export * from "./machine-resource-creation-failed-response";
28
28
  export * from "./monitor-game-resource-task";
29
+ export * from "./pool-status";
29
30
  export * from "./set-pool.event";
30
31
  export * from "./set-pools-state";
31
32
  export * from "./swap-cloud-user-completed";
@@ -0,0 +1,34 @@
1
+ import { LudeoEvent } from "../../infra/ludeo-event";
2
+ import { CloudResourcesStatusMap, BasePoolAttributes } from "../types";
3
+ import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
4
+
5
+ /**
6
+ * Will be used later on in a newer version of the predictor
7
+ */
8
+ export class PoolStatusEventPoolV2 {
9
+ @ValidateNestedType(() => BasePoolAttributes)
10
+ attributes: BasePoolAttributes;
11
+
12
+ statusMap: CloudResourcesStatusMap;
13
+ }
14
+
15
+ // something like {...attributes, ...statusMap}
16
+ export type PoolStatusEventPayloadV1 = Record<string, string | number>;
17
+
18
+ export class PoolStatusEventPayload {
19
+ games: PoolStatusEventPayloadV1[];
20
+
21
+ machines: PoolStatusEventPayloadV1[];
22
+ }
23
+
24
+ export class PoolStatusEvent extends LudeoEvent {
25
+ static readonly EVENT_NAME = "cloud-pools.pool-status";
26
+
27
+ constructor(payload: PoolStatusEventPayload) {
28
+ super(PoolStatusEvent.EVENT_NAME);
29
+ this.payload = payload;
30
+ }
31
+
32
+ @ValidateNestedType(() => PoolStatusEventPayload)
33
+ payload: PoolStatusEventPayload;
34
+ }