@ludeo/cloud-common 1.2.173 → 1.2.174-beta-yahil-1
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.
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/v4/contexts/index.d.ts +1 -0
- package/dist/v4/contexts/index.js +1 -0
- package/dist/v4/contexts/index.js.map +1 -1
- package/dist/v4/contexts/site-controller-context.d.ts +8 -0
- package/dist/v4/contexts/site-controller-context.js +47 -0
- package/dist/v4/contexts/site-controller-context.js.map +1 -0
- package/dist/v4/events/index.d.ts +1 -0
- package/dist/v4/events/index.js +2 -0
- package/dist/v4/events/index.js.map +1 -1
- package/dist/v4/events/site-controller/create-game-request.event.d.ts +16 -0
- package/dist/v4/events/site-controller/create-game-request.event.js +53 -0
- package/dist/v4/events/site-controller/create-game-request.event.js.map +1 -0
- package/dist/v4/events/site-controller/create-machine-request.event.d.ts +15 -0
- package/dist/v4/events/site-controller/create-machine-request.event.js +54 -0
- package/dist/v4/events/site-controller/create-machine-request.event.js.map +1 -0
- package/dist/v4/events/site-controller/create-snapshot-request.event.d.ts +14 -0
- package/dist/v4/events/site-controller/create-snapshot-request.event.js +53 -0
- package/dist/v4/events/site-controller/create-snapshot-request.event.js.map +1 -0
- package/dist/v4/events/site-controller/game-creation-ended.event.d.ts +14 -0
- package/dist/v4/events/site-controller/game-creation-ended.event.js +51 -0
- package/dist/v4/events/site-controller/game-creation-ended.event.js.map +1 -0
- package/dist/v4/events/site-controller/index.d.ts +11 -0
- package/dist/v4/events/site-controller/index.js +28 -0
- package/dist/v4/events/site-controller/index.js.map +1 -0
- package/dist/v4/events/site-controller/machine-creation-ended.event.d.ts +14 -0
- package/dist/v4/events/site-controller/machine-creation-ended.event.js +51 -0
- package/dist/v4/events/site-controller/machine-creation-ended.event.js.map +1 -0
- package/dist/v4/events/site-controller/resource-status-update.event.d.ts +15 -0
- package/dist/v4/events/site-controller/resource-status-update.event.js +55 -0
- package/dist/v4/events/site-controller/resource-status-update.event.js.map +1 -0
- package/dist/v4/events/site-controller/snapshot-creation-ended.event.d.ts +14 -0
- package/dist/v4/events/site-controller/snapshot-creation-ended.event.js +51 -0
- package/dist/v4/events/site-controller/snapshot-creation-ended.event.js.map +1 -0
- package/dist/v4/events/site-controller/snapshot-termination-ended.event.d.ts +14 -0
- package/dist/v4/events/site-controller/snapshot-termination-ended.event.js +51 -0
- package/dist/v4/events/site-controller/snapshot-termination-ended.event.js.map +1 -0
- package/dist/v4/events/site-controller/terminate-game-request.event.d.ts +14 -0
- package/dist/v4/events/site-controller/terminate-game-request.event.js +53 -0
- package/dist/v4/events/site-controller/terminate-game-request.event.js.map +1 -0
- package/dist/v4/events/site-controller/terminate-machine-request.event.d.ts +13 -0
- package/dist/v4/events/site-controller/terminate-machine-request.event.js +49 -0
- package/dist/v4/events/site-controller/terminate-machine-request.event.js.map +1 -0
- package/dist/v4/events/site-controller/terminate-snapshot-request.event.d.ts +13 -0
- package/dist/v4/events/site-controller/terminate-snapshot-request.event.js +49 -0
- package/dist/v4/events/site-controller/terminate-snapshot-request.event.js.map +1 -0
- package/dist/v4/types/index.d.ts +2 -0
- package/dist/v4/types/index.js +2 -0
- package/dist/v4/types/index.js.map +1 -1
- package/dist/v4/types/mqtt/index.d.ts +1 -0
- package/dist/v4/types/mqtt/index.js +18 -0
- package/dist/v4/types/mqtt/index.js.map +1 -0
- package/dist/v4/types/mqtt/types.d.ts +67 -0
- package/dist/v4/types/mqtt/types.js +178 -0
- package/dist/v4/types/mqtt/types.js.map +1 -0
- package/dist/v4/types/site-controller/index.d.ts +1 -0
- package/dist/v4/types/site-controller/index.js +18 -0
- package/dist/v4/types/site-controller/index.js.map +1 -0
- package/dist/v4/types/site-controller/types.d.ts +16 -0
- package/dist/v4/types/site-controller/types.js +14 -0
- package/dist/v4/types/site-controller/types.js.map +1 -0
- package/package.json +1 -1
- package/src/v4/contexts/index.ts +1 -0
- package/src/v4/contexts/site-controller-context.ts +32 -0
- package/src/v4/events/index.ts +3 -0
- package/src/v4/events/site-controller/create-game-request.event.ts +39 -0
- package/src/v4/events/site-controller/create-machine-request.event.ts +36 -0
- package/src/v4/events/site-controller/create-snapshot-request.event.ts +35 -0
- package/src/v4/events/site-controller/game-creation-ended.event.ts +34 -0
- package/src/v4/events/site-controller/index.ts +26 -0
- package/src/v4/events/site-controller/machine-creation-ended.event.ts +34 -0
- package/src/v4/events/site-controller/resource-status-update.event.ts +38 -0
- package/src/v4/events/site-controller/snapshot-creation-ended.event.ts +34 -0
- package/src/v4/events/site-controller/snapshot-termination-ended.event.ts +34 -0
- package/src/v4/events/site-controller/terminate-game-request.event.ts +35 -0
- package/src/v4/events/site-controller/terminate-machine-request.event.ts +32 -0
- package/src/v4/events/site-controller/terminate-snapshot-request.event.ts +32 -0
- package/src/v4/types/build.ts +1 -1
- package/src/v4/types/index.ts +2 -0
- package/src/v4/types/mqtt/index.ts +6 -0
- package/src/v4/types/mqtt/types.ts +232 -0
- package/src/v4/types/site-controller/index.ts +2 -0
- package/src/v4/types/site-controller/types.ts +32 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v4/types/site-controller/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum MachineMode {
|
|
2
|
+
Proton = "proton",
|
|
3
|
+
Android = "android"
|
|
4
|
+
}
|
|
5
|
+
export interface ProtonGameCreationPayload {
|
|
6
|
+
exeRelativePath: string;
|
|
7
|
+
additionalEnvironmentVariables?: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export interface AndroidGameCreationPayload {
|
|
10
|
+
packageId: string;
|
|
11
|
+
}
|
|
12
|
+
export type GameCreationPayload = ProtonGameCreationPayload | AndroidGameCreationPayload;
|
|
13
|
+
export declare enum OperationStatus {
|
|
14
|
+
Success = "success",
|
|
15
|
+
Error = "error"
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationStatus = exports.MachineMode = void 0;
|
|
4
|
+
var MachineMode;
|
|
5
|
+
(function (MachineMode) {
|
|
6
|
+
MachineMode["Proton"] = "proton";
|
|
7
|
+
MachineMode["Android"] = "android";
|
|
8
|
+
})(MachineMode || (exports.MachineMode = MachineMode = {}));
|
|
9
|
+
var OperationStatus;
|
|
10
|
+
(function (OperationStatus) {
|
|
11
|
+
OperationStatus["Success"] = "success";
|
|
12
|
+
OperationStatus["Error"] = "error";
|
|
13
|
+
})(OperationStatus || (exports.OperationStatus = OperationStatus = {}));
|
|
14
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/v4/types/site-controller/types.ts"],"names":[],"mappings":";;;AAOA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;AACrB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAiBD,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,kCAAe,CAAA;AACjB,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B"}
|
package/package.json
CHANGED
package/src/v4/contexts/index.ts
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IsOptional, IsString, IsUUID } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Context for site-controller events
|
|
5
|
+
* Contains information about the resources involved in the operation
|
|
6
|
+
*/
|
|
7
|
+
export class SiteControllerContext {
|
|
8
|
+
@IsOptional()
|
|
9
|
+
@IsString()
|
|
10
|
+
site?: string;
|
|
11
|
+
|
|
12
|
+
@IsOptional()
|
|
13
|
+
@IsString()
|
|
14
|
+
region?: string;
|
|
15
|
+
|
|
16
|
+
@IsOptional()
|
|
17
|
+
@IsUUID()
|
|
18
|
+
machineResourceId?: string;
|
|
19
|
+
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsUUID()
|
|
22
|
+
gameResourceId?: string;
|
|
23
|
+
|
|
24
|
+
@IsOptional()
|
|
25
|
+
@IsString()
|
|
26
|
+
buildId?: string;
|
|
27
|
+
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@IsString()
|
|
30
|
+
snapshotId?: string;
|
|
31
|
+
}
|
|
32
|
+
|
package/src/v4/events/index.ts
CHANGED
|
@@ -171,3 +171,6 @@ export * from "./pools-deleted-for-build";
|
|
|
171
171
|
export * from "./pools-deletion-for-build-failed";
|
|
172
172
|
export * from "./monitor-ludeocast-transfer-status-task";
|
|
173
173
|
export * from "./ludeocast-machine-resource-error-timeout-task";
|
|
174
|
+
|
|
175
|
+
// Site Controller Events
|
|
176
|
+
export * as SiteController from "./site-controller";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LudeoEvent } from '../../../infra';
|
|
2
|
+
import { ValidateNestedType } from '../../../decorators';
|
|
3
|
+
import { IsString, IsUUID } from 'class-validator';
|
|
4
|
+
import { GameCreationPayload } from '../../types/site-controller';
|
|
5
|
+
import { SiteControllerContext } from '../../contexts';
|
|
6
|
+
|
|
7
|
+
export class CreateGameRequestPayload {
|
|
8
|
+
@IsUUID()
|
|
9
|
+
machineResourceId: string;
|
|
10
|
+
|
|
11
|
+
@IsUUID()
|
|
12
|
+
gameResourceId: string;
|
|
13
|
+
|
|
14
|
+
// Note: Using any here since it's a union type - validation happens at runtime
|
|
15
|
+
gameCreationPayload: GameCreationPayload;
|
|
16
|
+
|
|
17
|
+
@IsString()
|
|
18
|
+
site: string;
|
|
19
|
+
|
|
20
|
+
@IsString()
|
|
21
|
+
region: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class CreateGameRequestEvent extends LudeoEvent {
|
|
25
|
+
static readonly EVENT_NAME = 'site-controller.create-game-request';
|
|
26
|
+
|
|
27
|
+
constructor(payload: CreateGameRequestPayload, context: SiteControllerContext) {
|
|
28
|
+
super(CreateGameRequestEvent.EVENT_NAME);
|
|
29
|
+
this.payload = payload;
|
|
30
|
+
this.context = context;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@ValidateNestedType(() => CreateGameRequestPayload)
|
|
34
|
+
payload: CreateGameRequestPayload;
|
|
35
|
+
|
|
36
|
+
@ValidateNestedType(() => SiteControllerContext)
|
|
37
|
+
context: SiteControllerContext;
|
|
38
|
+
}
|
|
39
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LudeoEvent } from '../../../infra';
|
|
2
|
+
import { ValidateNestedType } from '../../../decorators';
|
|
3
|
+
import { IsEnum, IsString, IsUUID } from 'class-validator';
|
|
4
|
+
import { MachineMode } from '../../types/site-controller';
|
|
5
|
+
import { SiteControllerContext } from '../../contexts';
|
|
6
|
+
|
|
7
|
+
export class CreateMachineRequestPayload {
|
|
8
|
+
@IsUUID()
|
|
9
|
+
machineResourceId: string;
|
|
10
|
+
|
|
11
|
+
@IsEnum(MachineMode)
|
|
12
|
+
mode: MachineMode;
|
|
13
|
+
|
|
14
|
+
@IsString()
|
|
15
|
+
site: string;
|
|
16
|
+
|
|
17
|
+
@IsString()
|
|
18
|
+
region: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class CreateMachineRequestEvent extends LudeoEvent {
|
|
22
|
+
static readonly EVENT_NAME = 'site-controller.create-machine-request';
|
|
23
|
+
|
|
24
|
+
constructor(payload: CreateMachineRequestPayload, context: SiteControllerContext) {
|
|
25
|
+
super(CreateMachineRequestEvent.EVENT_NAME);
|
|
26
|
+
this.payload = payload;
|
|
27
|
+
this.context = context;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@ValidateNestedType(() => CreateMachineRequestPayload)
|
|
31
|
+
payload: CreateMachineRequestPayload;
|
|
32
|
+
|
|
33
|
+
@ValidateNestedType(() => SiteControllerContext)
|
|
34
|
+
context: SiteControllerContext;
|
|
35
|
+
}
|
|
36
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { LudeoEvent } from '../../../infra';
|
|
2
|
+
import { ValidateNestedType } from '../../../decorators';
|
|
3
|
+
import { IsString } from 'class-validator';
|
|
4
|
+
import { SiteControllerContext } from '../../contexts';
|
|
5
|
+
|
|
6
|
+
export class CreateSnapshotRequestPayload {
|
|
7
|
+
@IsString()
|
|
8
|
+
buildId: string;
|
|
9
|
+
|
|
10
|
+
@IsString()
|
|
11
|
+
downloadURL: string;
|
|
12
|
+
|
|
13
|
+
@IsString()
|
|
14
|
+
site: string;
|
|
15
|
+
|
|
16
|
+
@IsString()
|
|
17
|
+
region: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class CreateSnapshotRequestEvent extends LudeoEvent {
|
|
21
|
+
static readonly EVENT_NAME = 'cloud-builds.create-snapshot-request';
|
|
22
|
+
|
|
23
|
+
constructor(payload: CreateSnapshotRequestPayload, context: SiteControllerContext) {
|
|
24
|
+
super(CreateSnapshotRequestEvent.EVENT_NAME);
|
|
25
|
+
this.payload = payload;
|
|
26
|
+
this.context = context;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@ValidateNestedType(() => CreateSnapshotRequestPayload)
|
|
30
|
+
payload: CreateSnapshotRequestPayload;
|
|
31
|
+
|
|
32
|
+
@ValidateNestedType(() => SiteControllerContext)
|
|
33
|
+
context: SiteControllerContext;
|
|
34
|
+
}
|
|
35
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LudeoEvent } from '../../../infra';
|
|
2
|
+
import { ValidateNestedType } from '../../../decorators';
|
|
3
|
+
import { IsEnum, IsOptional, IsString, IsUUID } from 'class-validator';
|
|
4
|
+
import { SiteControllerContext } from '../../contexts';
|
|
5
|
+
import { OperationStatus } from '../../types/site-controller';
|
|
6
|
+
|
|
7
|
+
export class GameCreationEndedPayload {
|
|
8
|
+
@IsUUID()
|
|
9
|
+
gameResourceId: string;
|
|
10
|
+
|
|
11
|
+
@IsEnum(OperationStatus)
|
|
12
|
+
status: OperationStatus;
|
|
13
|
+
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
reason?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class GameCreationEndedEvent extends LudeoEvent {
|
|
20
|
+
static readonly EVENT_NAME = 'site-controller.game-creation-ended';
|
|
21
|
+
|
|
22
|
+
constructor(payload: GameCreationEndedPayload, context: SiteControllerContext) {
|
|
23
|
+
super(GameCreationEndedEvent.EVENT_NAME);
|
|
24
|
+
this.payload = payload;
|
|
25
|
+
this.context = context;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@ValidateNestedType(() => GameCreationEndedPayload)
|
|
29
|
+
payload: GameCreationEndedPayload;
|
|
30
|
+
|
|
31
|
+
@ValidateNestedType(() => SiteControllerContext)
|
|
32
|
+
context: SiteControllerContext;
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Site Controller Events
|
|
3
|
+
* Events for site-controller service communication with other cloud platform services
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Consumed Events - Resources
|
|
7
|
+
export * from './create-machine-request.event';
|
|
8
|
+
export * from './terminate-machine-request.event';
|
|
9
|
+
export * from './create-game-request.event';
|
|
10
|
+
export * from './terminate-game-request.event';
|
|
11
|
+
|
|
12
|
+
// Consumed Events - Builds
|
|
13
|
+
export * from './create-snapshot-request.event';
|
|
14
|
+
export * from './terminate-snapshot-request.event';
|
|
15
|
+
|
|
16
|
+
// Produced Events - Resources
|
|
17
|
+
export * from './machine-creation-ended.event';
|
|
18
|
+
export * from './game-creation-ended.event';
|
|
19
|
+
|
|
20
|
+
// Produced Events - Builds
|
|
21
|
+
export * from './snapshot-creation-ended.event';
|
|
22
|
+
export * from './snapshot-termination-ended.event';
|
|
23
|
+
|
|
24
|
+
// Produced Events - Resource Monitor
|
|
25
|
+
export * from './resource-status-update.event';
|
|
26
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LudeoEvent } from '../../../infra';
|
|
2
|
+
import { ValidateNestedType } from '../../../decorators';
|
|
3
|
+
import { IsEnum, IsOptional, IsString, IsUUID } from 'class-validator';
|
|
4
|
+
import { SiteControllerContext } from '../../contexts';
|
|
5
|
+
import { OperationStatus } from '../../types/site-controller';
|
|
6
|
+
|
|
7
|
+
export class MachineCreationEndedPayload {
|
|
8
|
+
@IsUUID()
|
|
9
|
+
machineResourceId: string;
|
|
10
|
+
|
|
11
|
+
@IsEnum(OperationStatus)
|
|
12
|
+
status: OperationStatus;
|
|
13
|
+
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
reason?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class MachineCreationEndedEvent extends LudeoEvent {
|
|
20
|
+
static readonly EVENT_NAME = 'site-controller.machine-creation-ended';
|
|
21
|
+
|
|
22
|
+
constructor(payload: MachineCreationEndedPayload, context: SiteControllerContext) {
|
|
23
|
+
super(MachineCreationEndedEvent.EVENT_NAME);
|
|
24
|
+
this.payload = payload;
|
|
25
|
+
this.context = context;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@ValidateNestedType(() => MachineCreationEndedPayload)
|
|
29
|
+
payload: MachineCreationEndedPayload;
|
|
30
|
+
|
|
31
|
+
@ValidateNestedType(() => SiteControllerContext)
|
|
32
|
+
context: SiteControllerContext;
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { LudeoEvent } from '../../../infra';
|
|
2
|
+
import { ValidateNestedType } from '../../../decorators';
|
|
3
|
+
import { IsEnum, IsOptional, IsString, IsUUID } from 'class-validator';
|
|
4
|
+
import { SiteControllerContext } from '../../contexts';
|
|
5
|
+
import { CloudResourceStatus, CloudPoolType } from '../../types';
|
|
6
|
+
|
|
7
|
+
export class ResourceStatusUpdatePayload {
|
|
8
|
+
@IsUUID()
|
|
9
|
+
resourceId: string;
|
|
10
|
+
|
|
11
|
+
@IsEnum(CloudPoolType)
|
|
12
|
+
resourceType: CloudPoolType;
|
|
13
|
+
|
|
14
|
+
@IsEnum(CloudResourceStatus)
|
|
15
|
+
resourceStatus: CloudResourceStatus;
|
|
16
|
+
|
|
17
|
+
@IsOptional()
|
|
18
|
+
@IsString()
|
|
19
|
+
statusReason?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export class ResourceStatusUpdateEvent extends LudeoEvent {
|
|
24
|
+
static readonly EVENT_NAME = 'site-controller.resource-status-update';
|
|
25
|
+
|
|
26
|
+
constructor(payload: ResourceStatusUpdatePayload, context: SiteControllerContext) {
|
|
27
|
+
super(ResourceStatusUpdateEvent.EVENT_NAME);
|
|
28
|
+
this.payload = payload;
|
|
29
|
+
this.context = context;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@ValidateNestedType(() => ResourceStatusUpdatePayload)
|
|
33
|
+
payload: ResourceStatusUpdatePayload;
|
|
34
|
+
|
|
35
|
+
@ValidateNestedType(() => SiteControllerContext)
|
|
36
|
+
context: SiteControllerContext;
|
|
37
|
+
}
|
|
38
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LudeoEvent } from '../../../infra';
|
|
2
|
+
import { ValidateNestedType } from '../../../decorators';
|
|
3
|
+
import { IsEnum, IsOptional, IsString } from 'class-validator';
|
|
4
|
+
import { SiteControllerContext } from '../../contexts';
|
|
5
|
+
import { OperationStatus } from '../../types/site-controller';
|
|
6
|
+
|
|
7
|
+
export class SnapshotCreationEndedPayload {
|
|
8
|
+
@IsString()
|
|
9
|
+
buildId: string;
|
|
10
|
+
|
|
11
|
+
@IsEnum(OperationStatus)
|
|
12
|
+
status: OperationStatus;
|
|
13
|
+
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
reason?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class SnapshotCreationEndedEvent extends LudeoEvent {
|
|
20
|
+
static readonly EVENT_NAME = 'site-controller.snapshot-creation-ended';
|
|
21
|
+
|
|
22
|
+
constructor(payload: SnapshotCreationEndedPayload, context: SiteControllerContext) {
|
|
23
|
+
super(SnapshotCreationEndedEvent.EVENT_NAME);
|
|
24
|
+
this.payload = payload;
|
|
25
|
+
this.context = context;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@ValidateNestedType(() => SnapshotCreationEndedPayload)
|
|
29
|
+
payload: SnapshotCreationEndedPayload;
|
|
30
|
+
|
|
31
|
+
@ValidateNestedType(() => SiteControllerContext)
|
|
32
|
+
context: SiteControllerContext;
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LudeoEvent } from '../../../infra';
|
|
2
|
+
import { ValidateNestedType } from '../../../decorators';
|
|
3
|
+
import { IsEnum, IsOptional, IsString } from 'class-validator';
|
|
4
|
+
import { SiteControllerContext } from '../../contexts';
|
|
5
|
+
import { OperationStatus } from '../../types/site-controller';
|
|
6
|
+
|
|
7
|
+
export class SnapshotTerminationEndedPayload {
|
|
8
|
+
@IsString()
|
|
9
|
+
buildId: string;
|
|
10
|
+
|
|
11
|
+
@IsEnum(OperationStatus)
|
|
12
|
+
status: OperationStatus;
|
|
13
|
+
|
|
14
|
+
@IsOptional()
|
|
15
|
+
@IsString()
|
|
16
|
+
reason?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class SnapshotTerminationEndedEvent extends LudeoEvent {
|
|
20
|
+
static readonly EVENT_NAME = 'site-controller.snapshot-termination-ended';
|
|
21
|
+
|
|
22
|
+
constructor(payload: SnapshotTerminationEndedPayload, context: SiteControllerContext) {
|
|
23
|
+
super(SnapshotTerminationEndedEvent.EVENT_NAME);
|
|
24
|
+
this.payload = payload;
|
|
25
|
+
this.context = context;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@ValidateNestedType(() => SnapshotTerminationEndedPayload)
|
|
29
|
+
payload: SnapshotTerminationEndedPayload;
|
|
30
|
+
|
|
31
|
+
@ValidateNestedType(() => SiteControllerContext)
|
|
32
|
+
context: SiteControllerContext;
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { LudeoEvent } from '../../../infra';
|
|
2
|
+
import { ValidateNestedType } from '../../../decorators';
|
|
3
|
+
import { IsString, IsUUID } from 'class-validator';
|
|
4
|
+
import { SiteControllerContext } from '../../contexts';
|
|
5
|
+
|
|
6
|
+
export class TerminateGameRequestPayload {
|
|
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
|
+
|
|
20
|
+
export class TerminateGameRequestEvent extends LudeoEvent {
|
|
21
|
+
static readonly EVENT_NAME = 'site-controller.terminate-game-request';
|
|
22
|
+
|
|
23
|
+
constructor(payload: TerminateGameRequestPayload, context: SiteControllerContext) {
|
|
24
|
+
super(TerminateGameRequestEvent.EVENT_NAME);
|
|
25
|
+
this.payload = payload;
|
|
26
|
+
this.context = context;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@ValidateNestedType(() => TerminateGameRequestPayload)
|
|
30
|
+
payload: TerminateGameRequestPayload;
|
|
31
|
+
|
|
32
|
+
@ValidateNestedType(() => SiteControllerContext)
|
|
33
|
+
context: SiteControllerContext;
|
|
34
|
+
}
|
|
35
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LudeoEvent } from '../../../infra';
|
|
2
|
+
import { ValidateNestedType } from '../../../decorators';
|
|
3
|
+
import { IsString, IsUUID } from 'class-validator';
|
|
4
|
+
import { SiteControllerContext } from '../../contexts';
|
|
5
|
+
|
|
6
|
+
export class TerminateMachineRequestPayload {
|
|
7
|
+
@IsUUID()
|
|
8
|
+
machineResourceId: string;
|
|
9
|
+
|
|
10
|
+
@IsString()
|
|
11
|
+
site: string;
|
|
12
|
+
|
|
13
|
+
@IsString()
|
|
14
|
+
region: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class TerminateMachineRequestEvent extends LudeoEvent {
|
|
18
|
+
static readonly EVENT_NAME = 'site-controller.terminate-machine-request';
|
|
19
|
+
|
|
20
|
+
constructor(payload: TerminateMachineRequestPayload, context: SiteControllerContext) {
|
|
21
|
+
super(TerminateMachineRequestEvent.EVENT_NAME);
|
|
22
|
+
this.payload = payload;
|
|
23
|
+
this.context = context;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@ValidateNestedType(() => TerminateMachineRequestPayload)
|
|
27
|
+
payload: TerminateMachineRequestPayload;
|
|
28
|
+
|
|
29
|
+
@ValidateNestedType(() => SiteControllerContext)
|
|
30
|
+
context: SiteControllerContext;
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LudeoEvent } from '../../../infra';
|
|
2
|
+
import { ValidateNestedType } from '../../../decorators';
|
|
3
|
+
import { IsString } from 'class-validator';
|
|
4
|
+
import { SiteControllerContext } from '../../contexts';
|
|
5
|
+
|
|
6
|
+
export class TerminateSnapshotRequestPayload {
|
|
7
|
+
@IsString()
|
|
8
|
+
buildId: string;
|
|
9
|
+
|
|
10
|
+
@IsString()
|
|
11
|
+
site: string;
|
|
12
|
+
|
|
13
|
+
@IsString()
|
|
14
|
+
region: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class TerminateSnapshotRequestEvent extends LudeoEvent {
|
|
18
|
+
static readonly EVENT_NAME = 'cloud-builds.terminate-snapshot-request';
|
|
19
|
+
|
|
20
|
+
constructor(payload: TerminateSnapshotRequestPayload, context: SiteControllerContext) {
|
|
21
|
+
super(TerminateSnapshotRequestEvent.EVENT_NAME);
|
|
22
|
+
this.payload = payload;
|
|
23
|
+
this.context = context;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@ValidateNestedType(() => TerminateSnapshotRequestPayload)
|
|
27
|
+
payload: TerminateSnapshotRequestPayload;
|
|
28
|
+
|
|
29
|
+
@ValidateNestedType(() => SiteControllerContext)
|
|
30
|
+
context: SiteControllerContext;
|
|
31
|
+
}
|
|
32
|
+
|
package/src/v4/types/build.ts
CHANGED
package/src/v4/types/index.ts
CHANGED