@ludeo/cloud-common 1.1.75 → 1.1.76

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.
@@ -27,6 +27,7 @@ export * from "./machine-resource-created-response";
27
27
  export * from "./machine-resource-creation-failed-response";
28
28
  export * from "./monitor-game-resource-task";
29
29
  export * from "./set-pool.event";
30
+ export * from "./set-pools-state";
30
31
  export * from "./swap-cloud-user-completed";
31
32
  export * from "./swap-cloud-user-request-failed";
32
33
  export * from "./swap-cloud-user-request";
@@ -43,6 +43,7 @@ __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
45
  __exportStar(require("./set-pool.event"), exports);
46
+ __exportStar(require("./set-pools-state"), exports);
46
47
  __exportStar(require("./swap-cloud-user-completed"), exports);
47
48
  __exportStar(require("./swap-cloud-user-request-failed"), exports);
48
49
  __exportStar(require("./swap-cloud-user-request"), 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,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,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,18 @@
1
+ import { LudeoEvent } from "../../infra/ludeo-event";
2
+ import { MachinePoolAttributes, GamePoolAttributes } from "../types";
3
+ export declare class MachinePoolAttributesWithQuantity extends MachinePoolAttributes {
4
+ quantity: number;
5
+ }
6
+ export declare class GamePoolAttributesWithQuantity extends GamePoolAttributes {
7
+ quantity: number;
8
+ }
9
+ export declare class SetPoolStateEventPayload {
10
+ machines: MachinePoolAttributesWithQuantity[];
11
+ games: GamePoolAttributesWithQuantity[];
12
+ error_message?: string;
13
+ }
14
+ export declare class SetPoolsStateEvent extends LudeoEvent {
15
+ static readonly EVENT_NAME = "set-pools-state";
16
+ constructor(payload: SetPoolStateEventPayload);
17
+ payload: SetPoolStateEventPayload;
18
+ }
@@ -0,0 +1,53 @@
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.SetPoolsStateEvent = exports.SetPoolStateEventPayload = exports.GamePoolAttributesWithQuantity = exports.MachinePoolAttributesWithQuantity = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const ludeo_event_1 = require("../../infra/ludeo-event");
15
+ const types_1 = require("../types");
16
+ const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
17
+ class MachinePoolAttributesWithQuantity extends types_1.MachinePoolAttributes {
18
+ }
19
+ exports.MachinePoolAttributesWithQuantity = MachinePoolAttributesWithQuantity;
20
+ class GamePoolAttributesWithQuantity extends types_1.GamePoolAttributes {
21
+ }
22
+ exports.GamePoolAttributesWithQuantity = GamePoolAttributesWithQuantity;
23
+ class SetPoolStateEventPayload {
24
+ }
25
+ exports.SetPoolStateEventPayload = SetPoolStateEventPayload;
26
+ __decorate([
27
+ (0, class_validator_1.IsArray)(),
28
+ (0, validate_nested_type_decorator_1.ValidateNestedType)(() => Array),
29
+ __metadata("design:type", Array)
30
+ ], SetPoolStateEventPayload.prototype, "machines", void 0);
31
+ __decorate([
32
+ (0, class_validator_1.IsArray)(),
33
+ (0, validate_nested_type_decorator_1.ValidateNestedType)(() => Array),
34
+ __metadata("design:type", Array)
35
+ ], SetPoolStateEventPayload.prototype, "games", void 0);
36
+ __decorate([
37
+ (0, class_validator_1.IsOptional)(),
38
+ (0, class_validator_1.IsString)(),
39
+ __metadata("design:type", String)
40
+ ], SetPoolStateEventPayload.prototype, "error_message", void 0);
41
+ class SetPoolsStateEvent extends ludeo_event_1.LudeoEvent {
42
+ constructor(payload) {
43
+ super(SetPoolsStateEvent.EVENT_NAME);
44
+ this.payload = payload;
45
+ }
46
+ }
47
+ exports.SetPoolsStateEvent = SetPoolsStateEvent;
48
+ SetPoolsStateEvent.EVENT_NAME = "set-pools-state";
49
+ __decorate([
50
+ (0, validate_nested_type_decorator_1.ValidateNestedType)(() => SetPoolStateEventPayload),
51
+ __metadata("design:type", SetPoolStateEventPayload)
52
+ ], SetPoolsStateEvent.prototype, "payload", void 0);
53
+ //# sourceMappingURL=set-pools-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-pools-state.js","sourceRoot":"","sources":["../../../src/v3/events/set-pools-state.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAgE;AAEhE,yDAAqD;AACrD,oCAAqE;AACrE,oGAAqF;AAErF,MAAa,iCAAkC,SAAQ,6BAAqB;CAE3E;AAFD,8EAEC;AAED,MAAa,8BAA+B,SAAQ,0BAAkB;CAErE;AAFD,wEAEC;AAED,MAAa,wBAAwB;CAYpC;AAZD,4DAYC;AATC;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,KAAwC,CAAC;;0DACrB;AAI9C;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,KAAqC,CAAC;;uDACxB;AAIxC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+DACY;AAGzB,MAAa,kBAAmB,SAAQ,wBAAU;IAGhD,YAAY,OAAiC;QAC3C,KAAK,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AANH,gDAUC;AATiB,6BAAU,GAAG,iBAAiB,CAAC;AAQ/C;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;8BAC1C,wBAAwB;mDAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludeo/cloud-common",
3
- "version": "1.1.75",
3
+ "version": "1.1.76",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Yahil Didi",
@@ -27,6 +27,7 @@ export * from "./machine-resource-created-response";
27
27
  export * from "./machine-resource-creation-failed-response";
28
28
  export * from "./monitor-game-resource-task";
29
29
  export * from "./set-pool.event";
30
+ export * from "./set-pools-state";
30
31
  export * from "./swap-cloud-user-completed";
31
32
  export * from "./swap-cloud-user-request-failed";
32
33
  export * from "./swap-cloud-user-request";
@@ -0,0 +1,39 @@
1
+ import { IsArray, IsOptional, IsString } from "class-validator";
2
+
3
+ import { LudeoEvent } from "../../infra/ludeo-event";
4
+ import { MachinePoolAttributes, GamePoolAttributes } from "../types";
5
+ import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
6
+
7
+ export class MachinePoolAttributesWithQuantity extends MachinePoolAttributes {
8
+ quantity: number;
9
+ }
10
+
11
+ export class GamePoolAttributesWithQuantity extends GamePoolAttributes {
12
+ quantity: number;
13
+ }
14
+
15
+ export class SetPoolStateEventPayload {
16
+ @IsArray()
17
+ @ValidateNestedType(() => Array<MachinePoolAttributesWithQuantity>)
18
+ machines: MachinePoolAttributesWithQuantity[];
19
+
20
+ @IsArray()
21
+ @ValidateNestedType(() => Array<GamePoolAttributesWithQuantity>)
22
+ games: GamePoolAttributesWithQuantity[];
23
+
24
+ @IsOptional()
25
+ @IsString()
26
+ error_message?: string;
27
+ }
28
+
29
+ export class SetPoolsStateEvent extends LudeoEvent {
30
+ static readonly EVENT_NAME = "set-pools-state";
31
+
32
+ constructor(payload: SetPoolStateEventPayload) {
33
+ super(SetPoolsStateEvent.EVENT_NAME);
34
+ this.payload = payload;
35
+ }
36
+
37
+ @ValidateNestedType(() => SetPoolStateEventPayload)
38
+ payload: SetPoolStateEventPayload;
39
+ }