@ludeo/cloud-common 1.2.271 → 1.2.273

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.
@@ -2,3 +2,4 @@ export * from "./create-ludeocast-game-request";
2
2
  export * from "./create-ludeocast-machine-request";
3
3
  export * from "./terminate-ludeocast-game-request";
4
4
  export * from "./terminate-ludeocast-machine-request";
5
+ export * from "./restart-ludeocast-game-request";
@@ -18,4 +18,5 @@ __exportStar(require("./create-ludeocast-game-request"), exports);
18
18
  __exportStar(require("./create-ludeocast-machine-request"), exports);
19
19
  __exportStar(require("./terminate-ludeocast-game-request"), exports);
20
20
  __exportStar(require("./terminate-ludeocast-machine-request"), exports);
21
+ __exportStar(require("./restart-ludeocast-game-request"), exports);
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v4/events/cloud-resources/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,qEAAmD;AACnD,qEAAmD;AACnD,wEAAsD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v4/events/cloud-resources/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,qEAAmD;AACnD,qEAAmD;AACnD,wEAAsD;AACtD,mEAAiD"}
@@ -0,0 +1,16 @@
1
+ import { LudeoEvent } from '../../../infra';
2
+ import { CloudResourceContext } from '../../contexts';
3
+ export declare class RestartLudeocastGameRequestPayload {
4
+ machineResourceId: string;
5
+ gameResourceId: string;
6
+ site: string;
7
+ region: string;
8
+ buildId: string;
9
+ sourceService?: string;
10
+ }
11
+ export declare class RestartLudeocastGameRequest extends LudeoEvent {
12
+ static readonly EVENT_NAME = "cloud-resources.restart-ludeocast-game-request";
13
+ constructor(payload: RestartLudeocastGameRequestPayload, context: CloudResourceContext);
14
+ payload: RestartLudeocastGameRequestPayload;
15
+ context: CloudResourceContext;
16
+ }
@@ -0,0 +1,62 @@
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.RestartLudeocastGameRequest = exports.RestartLudeocastGameRequestPayload = void 0;
13
+ const infra_1 = require("../../../infra");
14
+ const decorators_1 = require("../../../decorators");
15
+ const class_validator_1 = require("class-validator");
16
+ const contexts_1 = require("../../contexts");
17
+ class RestartLudeocastGameRequestPayload {
18
+ }
19
+ exports.RestartLudeocastGameRequestPayload = RestartLudeocastGameRequestPayload;
20
+ __decorate([
21
+ (0, class_validator_1.IsUUID)(),
22
+ __metadata("design:type", String)
23
+ ], RestartLudeocastGameRequestPayload.prototype, "machineResourceId", void 0);
24
+ __decorate([
25
+ (0, class_validator_1.IsUUID)(),
26
+ __metadata("design:type", String)
27
+ ], RestartLudeocastGameRequestPayload.prototype, "gameResourceId", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsString)(),
30
+ __metadata("design:type", String)
31
+ ], RestartLudeocastGameRequestPayload.prototype, "site", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsString)(),
34
+ __metadata("design:type", String)
35
+ ], RestartLudeocastGameRequestPayload.prototype, "region", void 0);
36
+ __decorate([
37
+ (0, class_validator_1.IsString)(),
38
+ __metadata("design:type", String)
39
+ ], RestartLudeocastGameRequestPayload.prototype, "buildId", void 0);
40
+ __decorate([
41
+ (0, class_validator_1.IsOptional)(),
42
+ (0, class_validator_1.IsString)(),
43
+ __metadata("design:type", String)
44
+ ], RestartLudeocastGameRequestPayload.prototype, "sourceService", void 0);
45
+ class RestartLudeocastGameRequest extends infra_1.LudeoEvent {
46
+ constructor(payload, context) {
47
+ super(RestartLudeocastGameRequest.EVENT_NAME);
48
+ this.payload = payload;
49
+ this.context = context;
50
+ }
51
+ }
52
+ exports.RestartLudeocastGameRequest = RestartLudeocastGameRequest;
53
+ RestartLudeocastGameRequest.EVENT_NAME = 'cloud-resources.restart-ludeocast-game-request';
54
+ __decorate([
55
+ (0, decorators_1.ValidateNestedType)(() => RestartLudeocastGameRequestPayload),
56
+ __metadata("design:type", RestartLudeocastGameRequestPayload)
57
+ ], RestartLudeocastGameRequest.prototype, "payload", void 0);
58
+ __decorate([
59
+ (0, decorators_1.ValidateNestedType)(() => contexts_1.CloudResourceContext),
60
+ __metadata("design:type", contexts_1.CloudResourceContext)
61
+ ], RestartLudeocastGameRequest.prototype, "context", void 0);
62
+ //# sourceMappingURL=restart-ludeocast-game-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restart-ludeocast-game-request.js","sourceRoot":"","sources":["../../../../src/v4/events/cloud-resources/restart-ludeocast-game-request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAC5C,oDAAyD;AACzD,qDAA+D;AAC/D,6CAAsD;AAEtD,MAAa,kCAAkC;CAmB9C;AAnBD,gFAmBC;AAjBC;IADC,IAAA,wBAAM,GAAE;;6EACiB;AAG1B;IADC,IAAA,wBAAM,GAAE;;0EACc;AAGvB;IADC,IAAA,0BAAQ,GAAE;;gEACE;AAGb;IADC,IAAA,0BAAQ,GAAE;;kEACI;AAGf;IADC,IAAA,0BAAQ,GAAE;;mEACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;yEACY;AAGzB,MAAa,2BAA4B,SAAQ,kBAAU;IAGzD,YAAY,OAA2C,EAAE,OAA6B;QACpF,KAAK,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAPH,kEAcC;AAbiB,sCAAU,GAAG,gDAAgD,CAAC;AAS9E;IADC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,kCAAkC,CAAC;8BACpD,kCAAkC;4DAAC;AAG5C;IADC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,+BAAoB,CAAC;8BACtC,+BAAoB;4DAAC"}
@@ -0,0 +1,18 @@
1
+ import { LudeoEvent } from '../../../infra';
2
+ import { CloudResourceContext } from '../../contexts';
3
+ import { SiteOperationStatus } from '../../types/site-controller';
4
+ import { CloudResourceStatus } from '../../types/pools';
5
+ export declare class GameLudeocastRestartEndedPayload {
6
+ gameResourceId: string;
7
+ gamePoolId: string;
8
+ operationStatus: SiteOperationStatus;
9
+ status: CloudResourceStatus;
10
+ reason?: string;
11
+ sourceService?: string;
12
+ }
13
+ export declare class GameLudeocastRestartEnded extends LudeoEvent {
14
+ static readonly EVENT_NAME = "site-controller.game-ludeocast-restart-ended";
15
+ constructor(payload: GameLudeocastRestartEndedPayload, context: CloudResourceContext);
16
+ payload: GameLudeocastRestartEndedPayload;
17
+ context: CloudResourceContext;
18
+ }
@@ -0,0 +1,65 @@
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.GameLudeocastRestartEnded = exports.GameLudeocastRestartEndedPayload = void 0;
13
+ const infra_1 = require("../../../infra");
14
+ const decorators_1 = require("../../../decorators");
15
+ const class_validator_1 = require("class-validator");
16
+ const contexts_1 = require("../../contexts");
17
+ const site_controller_1 = require("../../types/site-controller");
18
+ const pools_1 = require("../../types/pools");
19
+ class GameLudeocastRestartEndedPayload {
20
+ }
21
+ exports.GameLudeocastRestartEndedPayload = GameLudeocastRestartEndedPayload;
22
+ __decorate([
23
+ (0, class_validator_1.IsUUID)(),
24
+ __metadata("design:type", String)
25
+ ], GameLudeocastRestartEndedPayload.prototype, "gameResourceId", void 0);
26
+ __decorate([
27
+ (0, class_validator_1.IsUUID)(),
28
+ __metadata("design:type", String)
29
+ ], GameLudeocastRestartEndedPayload.prototype, "gamePoolId", void 0);
30
+ __decorate([
31
+ (0, class_validator_1.IsEnum)(site_controller_1.SiteOperationStatus),
32
+ __metadata("design:type", String)
33
+ ], GameLudeocastRestartEndedPayload.prototype, "operationStatus", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsEnum)(pools_1.CloudResourceStatus),
36
+ __metadata("design:type", String)
37
+ ], GameLudeocastRestartEndedPayload.prototype, "status", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsOptional)(),
40
+ (0, class_validator_1.IsString)(),
41
+ __metadata("design:type", String)
42
+ ], GameLudeocastRestartEndedPayload.prototype, "reason", void 0);
43
+ __decorate([
44
+ (0, class_validator_1.IsOptional)(),
45
+ (0, class_validator_1.IsString)(),
46
+ __metadata("design:type", String)
47
+ ], GameLudeocastRestartEndedPayload.prototype, "sourceService", void 0);
48
+ class GameLudeocastRestartEnded extends infra_1.LudeoEvent {
49
+ constructor(payload, context) {
50
+ super(GameLudeocastRestartEnded.EVENT_NAME);
51
+ this.payload = payload;
52
+ this.context = context;
53
+ }
54
+ }
55
+ exports.GameLudeocastRestartEnded = GameLudeocastRestartEnded;
56
+ GameLudeocastRestartEnded.EVENT_NAME = 'site-controller.game-ludeocast-restart-ended';
57
+ __decorate([
58
+ (0, decorators_1.ValidateNestedType)(() => GameLudeocastRestartEndedPayload),
59
+ __metadata("design:type", GameLudeocastRestartEndedPayload)
60
+ ], GameLudeocastRestartEnded.prototype, "payload", void 0);
61
+ __decorate([
62
+ (0, decorators_1.ValidateNestedType)(() => contexts_1.CloudResourceContext),
63
+ __metadata("design:type", contexts_1.CloudResourceContext)
64
+ ], GameLudeocastRestartEnded.prototype, "context", void 0);
65
+ //# sourceMappingURL=game-ludeocast-restart-ended.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"game-ludeocast-restart-ended.js","sourceRoot":"","sources":["../../../../src/v4/events/site-controller/game-ludeocast-restart-ended.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAC5C,oDAAyD;AACzD,qDAAuE;AACvE,6CAAsD;AACtD,iEAAkE;AAClE,6CAAwD;AAExD,MAAa,gCAAgC;CAoB5C;AApBD,4EAoBC;AAlBC;IADC,IAAA,wBAAM,GAAE;;wEACc;AAGvB;IADC,IAAA,wBAAM,GAAE;;oEACU;AAGnB;IADC,IAAA,wBAAM,EAAC,qCAAmB,CAAC;;yEACS;AAGrC;IADC,IAAA,wBAAM,EAAC,2BAAmB,CAAC;;gEACA;AAI5B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gEACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uEACY;AAGzB,MAAa,yBAA0B,SAAQ,kBAAU;IAGvD,YAAY,OAAyC,EAAE,OAA6B;QAClF,KAAK,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAPH,8DAcC;AAbiB,oCAAU,GAAG,8CAA8C,CAAC;AAS5E;IADC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,gCAAgC,CAAC;8BAClD,gCAAgC;0DAAC;AAG1C;IADC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,+BAAoB,CAAC;8BACtC,+BAAoB;0DAAC"}
@@ -2,6 +2,7 @@ export * from "./machine-ludeocast-creation-ended";
2
2
  export * from "./machine-ludeocast-preempted";
3
3
  export * from "./game-ludeocast-creation-ended";
4
4
  export * from "./game-ludeocast-termination-ended";
5
+ export * from "./game-ludeocast-restart-ended";
5
6
  export * from "./machine-ludeocast-termination-ended";
6
7
  export * from "./ludeocast-build-distribution-creation-ended";
7
8
  export * from "./ludeocast-build-distribution-termination-ended";
@@ -14,6 +15,7 @@ export * from "../base/constants";
14
15
  export * from "./init.command";
15
16
  export * from "./terminate-game.command";
16
17
  export * from "./start-game.command";
18
+ export * from "./restart-game.command";
17
19
  export * from "./set-sftp-credentials.command";
18
20
  export * from "./shutdown.command";
19
21
  export * from "./export-logs.command";
@@ -18,6 +18,7 @@ __exportStar(require("./machine-ludeocast-creation-ended"), exports);
18
18
  __exportStar(require("./machine-ludeocast-preempted"), exports);
19
19
  __exportStar(require("./game-ludeocast-creation-ended"), exports);
20
20
  __exportStar(require("./game-ludeocast-termination-ended"), exports);
21
+ __exportStar(require("./game-ludeocast-restart-ended"), exports);
21
22
  __exportStar(require("./machine-ludeocast-termination-ended"), exports);
22
23
  __exportStar(require("./ludeocast-build-distribution-creation-ended"), exports);
23
24
  __exportStar(require("./ludeocast-build-distribution-termination-ended"), exports);
@@ -30,6 +31,7 @@ __exportStar(require("../base/constants"), exports);
30
31
  __exportStar(require("./init.command"), exports);
31
32
  __exportStar(require("./terminate-game.command"), exports);
32
33
  __exportStar(require("./start-game.command"), exports);
34
+ __exportStar(require("./restart-game.command"), exports);
33
35
  __exportStar(require("./set-sftp-credentials.command"), exports);
34
36
  __exportStar(require("./shutdown.command"), exports);
35
37
  __exportStar(require("./export-logs.command"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v4/events/site-controller/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAmD;AACnD,gEAA8C;AAC9C,kEAAgD;AAChD,qEAAmD;AACnD,wEAAsD;AAEtD,gFAA8D;AAC9D,mFAAiE;AACjE,4EAA0D;AAE1D,qEAAmD;AACnD,gEAA8C;AAC9C,qEAAmD;AAGnD,+CAA6B;AAC7B,oDAAkC;AAClC,iDAA+B;AAC/B,2DAAyC;AACzC,uDAAqC;AACrC,iEAA+C;AAC/C,qDAAmC;AACnC,wDAAsC;AACtC,6DAA2C;AAC3C,2DAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v4/events/site-controller/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAmD;AACnD,gEAA8C;AAC9C,kEAAgD;AAChD,qEAAmD;AACnD,iEAA+C;AAC/C,wEAAsD;AAEtD,gFAA8D;AAC9D,mFAAiE;AACjE,4EAA0D;AAE1D,qEAAmD;AACnD,gEAA8C;AAC9C,qEAAmD;AAGnD,+CAA6B;AAC7B,oDAAkC;AAClC,iDAA+B;AAC/B,2DAAyC;AACzC,uDAAqC;AACrC,yDAAuC;AACvC,iEAA+C;AAC/C,qDAAmC;AACnC,wDAAsC;AACtC,6DAA2C;AAC3C,2DAAyC"}
@@ -0,0 +1,10 @@
1
+ import { BaseCommand, BaseCommandPayload } from '../base/base';
2
+ import { GameCreationPayload } from '../../types/site-controller';
3
+ export declare class RestartGameCommandPayload extends BaseCommandPayload {
4
+ payload: GameCreationPayload;
5
+ gameResourceId: string;
6
+ }
7
+ export declare class RestartGameCommand extends BaseCommand<RestartGameCommandPayload> {
8
+ payload: RestartGameCommandPayload;
9
+ constructor(payload: RestartGameCommandPayload);
10
+ }
@@ -0,0 +1,33 @@
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.RestartGameCommand = exports.RestartGameCommandPayload = void 0;
13
+ const base_1 = require("../base/base");
14
+ const decorators_1 = require("../../../decorators");
15
+ const class_validator_1 = require("class-validator");
16
+ class RestartGameCommandPayload extends base_1.BaseCommandPayload {
17
+ }
18
+ exports.RestartGameCommandPayload = RestartGameCommandPayload;
19
+ __decorate([
20
+ (0, class_validator_1.IsString)(),
21
+ __metadata("design:type", String)
22
+ ], RestartGameCommandPayload.prototype, "gameResourceId", void 0);
23
+ class RestartGameCommand extends base_1.BaseCommand {
24
+ constructor(payload) {
25
+ super(payload.machineResourceId, 'restart-game', payload);
26
+ }
27
+ }
28
+ exports.RestartGameCommand = RestartGameCommand;
29
+ __decorate([
30
+ (0, decorators_1.ValidateNestedType)(() => RestartGameCommandPayload),
31
+ __metadata("design:type", RestartGameCommandPayload)
32
+ ], RestartGameCommand.prototype, "payload", void 0);
33
+ //# sourceMappingURL=restart-game.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restart-game.command.js","sourceRoot":"","sources":["../../../../src/v4/events/site-controller/restart-game.command.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAA+D;AAE/D,oDAAyD;AACzD,qDAA2C;AAG3C,MAAa,yBAA0B,SAAQ,yBAAkB;CAKhE;AALD,8DAKC;AADC;IADC,IAAA,0BAAQ,GAAE;;iEACY;AAGzB,MAAa,kBAAmB,SAAQ,kBAAsC;IAI5E,YAAY,OAAkC;QAC5C,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;CACF;AAPD,gDAOC;AALC;IADC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC;8BAC3C,yBAAyB;mDAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludeo/cloud-common",
3
- "version": "1.2.271",
3
+ "version": "1.2.273",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Yahil Didi",
@@ -1,4 +1,5 @@
1
1
  export * from "./create-ludeocast-game-request";
2
2
  export * from "./create-ludeocast-machine-request";
3
3
  export * from "./terminate-ludeocast-game-request";
4
- export * from "./terminate-ludeocast-machine-request";
4
+ export * from "./terminate-ludeocast-machine-request";
5
+ export * from "./restart-ludeocast-game-request";
@@ -0,0 +1,41 @@
1
+ import { LudeoEvent } from '../../../infra';
2
+ import { ValidateNestedType } from '../../../decorators';
3
+ import { IsOptional, IsString, IsUUID } from 'class-validator';
4
+ import { CloudResourceContext } from '../../contexts';
5
+
6
+ export class RestartLudeocastGameRequestPayload {
7
+ @IsUUID()
8
+ machineResourceId: string;
9
+
10
+ @IsUUID()
11
+ gameResourceId: string;
12
+
13
+ @IsString()
14
+ site: string;
15
+
16
+ @IsString()
17
+ region: string;
18
+
19
+ @IsString()
20
+ buildId: string;
21
+
22
+ @IsOptional()
23
+ @IsString()
24
+ sourceService?: string;
25
+ }
26
+
27
+ export class RestartLudeocastGameRequest extends LudeoEvent {
28
+ static readonly EVENT_NAME = 'cloud-resources.restart-ludeocast-game-request';
29
+
30
+ constructor(payload: RestartLudeocastGameRequestPayload, context: CloudResourceContext) {
31
+ super(RestartLudeocastGameRequest.EVENT_NAME);
32
+ this.payload = payload;
33
+ this.context = context;
34
+ }
35
+
36
+ @ValidateNestedType(() => RestartLudeocastGameRequestPayload)
37
+ payload: RestartLudeocastGameRequestPayload;
38
+
39
+ @ValidateNestedType(() => CloudResourceContext)
40
+ context: CloudResourceContext;
41
+ }
@@ -0,0 +1,44 @@
1
+ import { LudeoEvent } from '../../../infra';
2
+ import { ValidateNestedType } from '../../../decorators';
3
+ import { IsEnum, IsOptional, IsString, IsUUID } from 'class-validator';
4
+ import { CloudResourceContext } from '../../contexts';
5
+ import { SiteOperationStatus } from '../../types/site-controller';
6
+ import { CloudResourceStatus } from '../../types/pools';
7
+
8
+ export class GameLudeocastRestartEndedPayload {
9
+ @IsUUID()
10
+ gameResourceId: string;
11
+
12
+ @IsUUID()
13
+ gamePoolId: string;
14
+
15
+ @IsEnum(SiteOperationStatus)
16
+ operationStatus: SiteOperationStatus;
17
+
18
+ @IsEnum(CloudResourceStatus)
19
+ status: CloudResourceStatus;
20
+
21
+ @IsOptional()
22
+ @IsString()
23
+ reason?: string;
24
+
25
+ @IsOptional()
26
+ @IsString()
27
+ sourceService?: string;
28
+ }
29
+
30
+ export class GameLudeocastRestartEnded extends LudeoEvent {
31
+ static readonly EVENT_NAME = 'site-controller.game-ludeocast-restart-ended';
32
+
33
+ constructor(payload: GameLudeocastRestartEndedPayload, context: CloudResourceContext) {
34
+ super(GameLudeocastRestartEnded.EVENT_NAME);
35
+ this.payload = payload;
36
+ this.context = context;
37
+ }
38
+
39
+ @ValidateNestedType(() => GameLudeocastRestartEndedPayload)
40
+ payload: GameLudeocastRestartEndedPayload;
41
+
42
+ @ValidateNestedType(() => CloudResourceContext)
43
+ context: CloudResourceContext;
44
+ }
@@ -2,6 +2,7 @@ export * from "./machine-ludeocast-creation-ended";
2
2
  export * from "./machine-ludeocast-preempted";
3
3
  export * from "./game-ludeocast-creation-ended";
4
4
  export * from "./game-ludeocast-termination-ended";
5
+ export * from "./game-ludeocast-restart-ended";
5
6
  export * from "./machine-ludeocast-termination-ended";
6
7
 
7
8
  export * from "./ludeocast-build-distribution-creation-ended";
@@ -18,6 +19,7 @@ export * from "../base/constants";
18
19
  export * from "./init.command";
19
20
  export * from "./terminate-game.command";
20
21
  export * from "./start-game.command";
22
+ export * from "./restart-game.command";
21
23
  export * from "./set-sftp-credentials.command";
22
24
  export * from "./shutdown.command";
23
25
  export * from "./export-logs.command";
@@ -0,0 +1,21 @@
1
+ import { BaseCommand, BaseCommandPayload } from '../base/base';
2
+ import { GameCreationPayload } from '../../types/site-controller';
3
+ import { ValidateNestedType } from '../../../decorators';
4
+ import { IsString } from 'class-validator';
5
+
6
+
7
+ export class RestartGameCommandPayload extends BaseCommandPayload {
8
+ payload: GameCreationPayload;
9
+
10
+ @IsString()
11
+ gameResourceId: string;
12
+ }
13
+
14
+ export class RestartGameCommand extends BaseCommand<RestartGameCommandPayload> {
15
+ @ValidateNestedType(() => RestartGameCommandPayload)
16
+ payload: RestartGameCommandPayload;
17
+
18
+ constructor(payload: RestartGameCommandPayload) {
19
+ super(payload.machineResourceId, 'restart-game', payload);
20
+ }
21
+ }