@ludeo/cloud-common 1.2.52-ygarbage3 → 1.2.53-dodsheli
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/events/game-deallocated-response.d.ts +14 -0
- package/dist/v4/events/game-deallocated-response.js +53 -0
- package/dist/v4/events/game-deallocated-response.js.map +1 -0
- package/dist/v4/events/game-deallocation-failed-response.d.ts +15 -0
- package/dist/v4/events/game-deallocation-failed-response.js +57 -0
- package/dist/v4/events/game-deallocation-failed-response.js.map +1 -0
- package/dist/v4/events/index.d.ts +4 -0
- package/dist/v4/events/index.js +4 -0
- package/dist/v4/events/index.js.map +1 -1
- package/dist/v4/events/pool-status.d.ts +7 -6
- package/dist/v4/events/pool-status.js +1 -1
- package/dist/v4/events/pool-status.js.map +1 -1
- package/dist/v4/events/set-pools-state.d.ts +10 -11
- package/dist/v4/events/set-pools-state.js +10 -10
- package/dist/v4/events/set-pools-state.js.map +1 -1
- package/dist/v4/events/terminate-ludeo-request.d.ts +15 -0
- package/dist/v4/events/terminate-ludeo-request.js +60 -0
- package/dist/v4/events/terminate-ludeo-request.js.map +1 -0
- package/dist/v4/events/terminate-stale-ludeos.d.ts +11 -0
- package/dist/v4/events/terminate-stale-ludeos.js +41 -0
- package/dist/v4/events/terminate-stale-ludeos.js.map +1 -0
- package/package.json +1 -1
- package/src/v4/events/game-deallocated-response.ts +42 -0
- package/src/v4/events/game-deallocation-failed-response.ts +45 -0
- package/src/v4/events/index.ts +4 -0
- package/src/v4/events/pool-status.ts +14 -6
- package/src/v4/events/set-pools-state.ts +16 -13
- package/src/v4/events/terminate-ludeo-request.ts +49 -0
- package/src/v4/events/terminate-stale-ludeos.ts +28 -0
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import { IsArray, IsOptional, IsUUID } from "class-validator";
|
|
1
|
+
import { IsArray, IsOptional, IsString, IsUUID } from "class-validator";
|
|
2
2
|
|
|
3
3
|
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
|
+
import { MachinePoolAttributes, GamePoolAttributes } from "../types";
|
|
4
5
|
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
5
6
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
export class BasePoolAttributesWithQuantity {
|
|
9
|
-
[attribute: string]: any;
|
|
10
|
-
|
|
7
|
+
export class MachinePoolAttributesWithQuantity extends MachinePoolAttributes {
|
|
11
8
|
quantity: number;
|
|
12
9
|
|
|
13
10
|
poolId: string;
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
reason?: string; // backward compat
|
|
13
|
+
|
|
14
|
+
context?: Record<string, string>;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
export class
|
|
17
|
+
export class GamePoolAttributesWithQuantity extends GamePoolAttributes {
|
|
18
|
+
quantity: number;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
ludeos: LudeoPoolAttributesWithQuantity[];
|
|
22
|
-
}
|
|
20
|
+
poolId: string;
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
reason?: string; // backward compat
|
|
23
|
+
|
|
24
|
+
context?: Record<string, string>;
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
export class SetPoolsStateEventRequestId {
|
|
@@ -38,6 +37,10 @@ export class SetPoolStateEventPayload {
|
|
|
38
37
|
@ValidateNestedType(() => Array<MachinePoolAttributesWithQuantity>)
|
|
39
38
|
machines: MachinePoolAttributesWithQuantity[];
|
|
40
39
|
|
|
40
|
+
@IsArray()
|
|
41
|
+
@ValidateNestedType(() => Array<GamePoolAttributesWithQuantity>)
|
|
42
|
+
games: GamePoolAttributesWithQuantity[];
|
|
43
|
+
|
|
41
44
|
@IsOptional()
|
|
42
45
|
@ValidateNestedType(() => SetPoolsStateEventRequestId)
|
|
43
46
|
requestId?: SetPoolsStateEventRequestId;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { IsBoolean, IsOptional, IsString, IsUUID } from "class-validator";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CloudResourceContext,
|
|
5
|
+
CloudSessionContext,
|
|
6
|
+
getCloudContextType,
|
|
7
|
+
} from "../contexts";
|
|
8
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
9
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
10
|
+
|
|
11
|
+
export class TerminateLudeoRequestPayload {
|
|
12
|
+
@IsUUID()
|
|
13
|
+
ludeoPoolId: string;
|
|
14
|
+
|
|
15
|
+
@IsUUID()
|
|
16
|
+
ludeoResourceId: string;
|
|
17
|
+
|
|
18
|
+
@IsOptional()
|
|
19
|
+
@IsBoolean()
|
|
20
|
+
shouldTerminate?: boolean;
|
|
21
|
+
|
|
22
|
+
@IsOptional()
|
|
23
|
+
@IsString()
|
|
24
|
+
uploadLogs?: boolean;
|
|
25
|
+
|
|
26
|
+
@IsString()
|
|
27
|
+
@IsOptional()
|
|
28
|
+
reason?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class TerminateLudeoRequest extends LudeoEvent {
|
|
32
|
+
static readonly EVENT_NAME =
|
|
33
|
+
"cloud-session-allocator.terminate-ludeo-request";
|
|
34
|
+
|
|
35
|
+
constructor(
|
|
36
|
+
payload: TerminateLudeoRequestPayload,
|
|
37
|
+
context: CloudSessionContext | CloudResourceContext
|
|
38
|
+
) {
|
|
39
|
+
super(TerminateLudeoRequest.EVENT_NAME);
|
|
40
|
+
this.payload = payload;
|
|
41
|
+
this.context = context;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@ValidateNestedType(getCloudContextType)
|
|
45
|
+
context: CloudSessionContext | CloudResourceContext;
|
|
46
|
+
|
|
47
|
+
@ValidateNestedType(() => TerminateLudeoRequestPayload)
|
|
48
|
+
payload: TerminateLudeoRequestPayload;
|
|
49
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IsString } from "class-validator";
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
import { CloudPoolContext } from "../contexts";
|
|
4
|
+
import { ValidateNestedType } from "../../decorators";
|
|
5
|
+
|
|
6
|
+
export class TerminateStaleLudeosRequestPayload {
|
|
7
|
+
@IsString()
|
|
8
|
+
poolId: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class TerminateStaleLudeos extends LudeoEvent {
|
|
12
|
+
static readonly EVENT_NAME = "cloud-pools.terminate-stale-ludeos";
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
payload: TerminateStaleLudeosRequestPayload,
|
|
16
|
+
context: CloudPoolContext
|
|
17
|
+
) {
|
|
18
|
+
super(TerminateStaleLudeos.EVENT_NAME);
|
|
19
|
+
this.payload = payload;
|
|
20
|
+
this.context = context;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@ValidateNestedType(() => CloudPoolContext)
|
|
24
|
+
context: CloudPoolContext;
|
|
25
|
+
|
|
26
|
+
@ValidateNestedType(() => TerminateStaleLudeosRequestPayload)
|
|
27
|
+
payload: TerminateStaleLudeosRequestPayload;
|
|
28
|
+
}
|