@ludeo/cloud-common 1.2.1 → 1.2.2
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/cloud-resource-context.d.ts +2 -0
- package/dist/v4/contexts/cloud-resource-context.js +10 -0
- package/dist/v4/contexts/cloud-resource-context.js.map +1 -1
- package/dist/v4/contexts/cloud-session-context.d.ts +2 -0
- package/dist/v4/contexts/cloud-session-context.js +10 -0
- package/dist/v4/contexts/cloud-session-context.js.map +1 -1
- package/dist/v4/events/allocate-game-request.d.ts +5 -5
- package/dist/v4/events/allocate-game-request.js +9 -6
- package/dist/v4/events/allocate-game-request.js.map +1 -1
- package/dist/v4/events/allocate-ludeo-request.d.ts +13 -0
- package/dist/v4/events/allocate-ludeo-request.js +46 -0
- package/dist/v4/events/allocate-ludeo-request.js.map +1 -0
- package/dist/v4/events/allocate-ludeo-resource-request.d.ts +13 -7
- package/dist/v4/events/allocate-ludeo-resource-request.js +35 -14
- package/dist/v4/events/allocate-ludeo-resource-request.js.map +1 -1
- package/dist/v4/events/game-allocated-response.d.ts +10 -5
- package/dist/v4/events/game-allocated-response.js +25 -4
- package/dist/v4/events/game-allocated-response.js.map +1 -1
- package/dist/v4/events/game-allocation-failed-response.d.ts +6 -5
- package/dist/v4/events/game-allocation-failed-response.js +13 -6
- package/dist/v4/events/game-allocation-failed-response.js.map +1 -1
- package/dist/v4/events/index.d.ts +5 -1
- package/dist/v4/events/index.js +5 -1
- package/dist/v4/events/index.js.map +1 -1
- package/dist/v4/events/ludeo-allocated-response.d.ts +5 -4
- package/dist/v4/events/ludeo-allocated-response.js +6 -6
- package/dist/v4/events/ludeo-allocated-response.js.map +1 -1
- package/dist/v4/events/ludeo-allocation-failed.d.ts +6 -4
- package/dist/v4/events/ludeo-allocation-failed.js +10 -5
- package/dist/v4/events/ludeo-allocation-failed.js.map +1 -1
- package/dist/v4/events/ludeo-resource-allocated-response.d.ts +7 -3
- package/dist/v4/events/ludeo-resource-allocated-response.js +15 -2
- package/dist/v4/events/ludeo-resource-allocated-response.js.map +1 -1
- package/dist/v4/events/ludeo-resource-allocation-failed.d.ts +4 -0
- package/dist/v4/events/ludeo-resource-allocation-failed.js +13 -0
- package/dist/v4/events/ludeo-resource-allocation-failed.js.map +1 -1
- package/dist/v4/events/ludeo-resource-allocation-timeout-task.d.ts +11 -0
- package/dist/v4/events/ludeo-resource-allocation-timeout-task.js +39 -0
- package/dist/v4/events/ludeo-resource-allocation-timeout-task.js.map +1 -0
- package/dist/v4/events/ludeo-status-updated.d.ts +14 -0
- package/dist/v4/events/ludeo-status-updated.js +50 -0
- package/dist/v4/events/ludeo-status-updated.js.map +1 -0
- package/dist/v4/events/terminate-ludeos-request.d.ts +12 -0
- package/dist/v4/events/terminate-ludeos-request.js +45 -0
- package/dist/v4/events/terminate-ludeos-request.js.map +1 -0
- package/package.json +1 -1
- package/src/v4/contexts/cloud-resource-context.ts +8 -0
- package/src/v4/contexts/cloud-session-context.ts +8 -0
- package/src/v4/events/allocate-game-request.ts +10 -8
- package/src/v4/events/allocate-ludeo-request.ts +32 -0
- package/src/v4/events/allocate-ludeo-resource-request.ts +35 -12
- package/src/v4/events/game-allocated-response.ts +27 -7
- package/src/v4/events/game-allocation-failed-response.ts +13 -8
- package/src/v4/events/index.ts +5 -1
- package/src/v4/events/ludeo-allocated-response.ts +7 -7
- package/src/v4/events/ludeo-allocation-failed.ts +11 -7
- package/src/v4/events/ludeo-resource-allocated-response.ts +18 -4
- package/src/v4/events/ludeo-resource-allocation-failed.ts +11 -1
- package/src/v4/events/ludeo-resource-allocation-timeout-task.ts +26 -0
- package/src/v4/events/ludeo-status-updated.ts +35 -0
- package/src/v4/events/terminate-ludeos-request.ts +32 -0
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { IsUUID } from "class-validator";
|
|
2
1
|
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
2
|
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
4
|
-
import {
|
|
3
|
+
import { CloudSessionContext } from "../contexts";
|
|
4
|
+
import { AllocationRequestData } from "../types";
|
|
5
|
+
import { IsString } from "class-validator";
|
|
5
6
|
|
|
6
7
|
export class LudeoAllocationFailedPayload {
|
|
7
|
-
@
|
|
8
|
-
|
|
8
|
+
@ValidateNestedType(() => AllocationRequestData)
|
|
9
|
+
requestData: AllocationRequestData;
|
|
10
|
+
|
|
11
|
+
@IsString()
|
|
12
|
+
errorMessage: string;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
export class LudeoAllocationFailed extends LudeoEvent {
|
|
@@ -13,15 +17,15 @@ export class LudeoAllocationFailed extends LudeoEvent {
|
|
|
13
17
|
|
|
14
18
|
constructor(
|
|
15
19
|
payload: LudeoAllocationFailedPayload,
|
|
16
|
-
context:
|
|
20
|
+
context: CloudSessionContext
|
|
17
21
|
) {
|
|
18
22
|
super(LudeoAllocationFailed.EVENT_NAME);
|
|
19
23
|
this.payload = payload;
|
|
20
24
|
this.context = context;
|
|
21
25
|
}
|
|
22
26
|
|
|
23
|
-
@ValidateNestedType(() =>
|
|
24
|
-
context:
|
|
27
|
+
@ValidateNestedType(() => CloudSessionContext)
|
|
28
|
+
context: CloudSessionContext;
|
|
25
29
|
|
|
26
30
|
@ValidateNestedType(() => LudeoAllocationFailedPayload)
|
|
27
31
|
payload: LudeoAllocationFailedPayload;
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { IsUUID } from "class-validator";
|
|
2
2
|
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
3
|
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
4
|
-
import { CloudResourceContext } from "../contexts";
|
|
4
|
+
import { CloudResourceContext, CloudSessionContext } from "../contexts";
|
|
5
|
+
import {
|
|
6
|
+
AllocationRequestData,
|
|
7
|
+
AwsAllocationData,
|
|
8
|
+
CloudProviderAllocationData,
|
|
9
|
+
} from "../types";
|
|
5
10
|
|
|
6
11
|
export class LudeoResourceAllocatedResponsePayload {
|
|
7
12
|
@IsUUID()
|
|
8
13
|
ludeoResourceId: string;
|
|
14
|
+
|
|
15
|
+
@IsUUID()
|
|
16
|
+
ludeoPoolId: string;
|
|
17
|
+
|
|
18
|
+
@ValidateNestedType(() => AwsAllocationData)
|
|
19
|
+
allocationData: CloudProviderAllocationData;
|
|
20
|
+
|
|
21
|
+
@ValidateNestedType(() => AllocationRequestData)
|
|
22
|
+
requestData: AllocationRequestData;
|
|
9
23
|
}
|
|
10
24
|
|
|
11
25
|
export class LudeoResourceAllocatedResponse extends LudeoEvent {
|
|
@@ -14,15 +28,15 @@ export class LudeoResourceAllocatedResponse extends LudeoEvent {
|
|
|
14
28
|
|
|
15
29
|
constructor(
|
|
16
30
|
payload: LudeoResourceAllocatedResponsePayload,
|
|
17
|
-
context:
|
|
31
|
+
context: CloudSessionContext
|
|
18
32
|
) {
|
|
19
33
|
super(LudeoResourceAllocatedResponse.EVENT_NAME);
|
|
20
34
|
this.payload = payload;
|
|
21
35
|
this.context = context;
|
|
22
36
|
}
|
|
23
37
|
|
|
24
|
-
@ValidateNestedType(() =>
|
|
25
|
-
context:
|
|
38
|
+
@ValidateNestedType(() => CloudSessionContext)
|
|
39
|
+
context: CloudSessionContext;
|
|
26
40
|
|
|
27
41
|
@ValidateNestedType(() => LudeoResourceAllocatedResponsePayload)
|
|
28
42
|
payload: LudeoResourceAllocatedResponsePayload;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import { IsUUID } from "class-validator";
|
|
1
|
+
import { IsString, IsUUID } from "class-validator";
|
|
2
2
|
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
3
|
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
4
4
|
import { CloudResourceContext } from "../contexts";
|
|
5
|
+
import { AllocationRequestData } from "../types";
|
|
5
6
|
|
|
6
7
|
export class LudeoResourceAllocationFailedPayload {
|
|
7
8
|
@IsUUID()
|
|
8
9
|
ludeoResourceId: string;
|
|
10
|
+
|
|
11
|
+
@IsUUID()
|
|
12
|
+
ludeoPoolId: string;
|
|
13
|
+
|
|
14
|
+
@IsString()
|
|
15
|
+
errorMessage: string;
|
|
16
|
+
|
|
17
|
+
@ValidateNestedType(() => AllocationRequestData)
|
|
18
|
+
requestData: AllocationRequestData;
|
|
9
19
|
}
|
|
10
20
|
|
|
11
21
|
export class LudeoResourceAllocationFailedResponse extends LudeoEvent {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IsUUID } from "class-validator";
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
import { ValidateNestedType } from "../../decorators";
|
|
4
|
+
|
|
5
|
+
export class LudeoResourceAllocationTimeoutTaskPayload {
|
|
6
|
+
@IsUUID()
|
|
7
|
+
ludeoResourceId: string;
|
|
8
|
+
|
|
9
|
+
@IsUUID()
|
|
10
|
+
ludeoPoolId: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class LudeoResourceAllocationTimeoutTask extends LudeoEvent {
|
|
14
|
+
static readonly EVENT_NAME =
|
|
15
|
+
"cloud-pools.ludeo-resource-allocation-timeout-task";
|
|
16
|
+
|
|
17
|
+
constructor(payload: LudeoResourceAllocationTimeoutTaskPayload) {
|
|
18
|
+
super(LudeoResourceAllocationTimeoutTask.EVENT_NAME);
|
|
19
|
+
this.payload = payload;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
context: never;
|
|
23
|
+
|
|
24
|
+
@ValidateNestedType(() => LudeoResourceAllocationTimeoutTaskPayload)
|
|
25
|
+
payload: LudeoResourceAllocationTimeoutTaskPayload;
|
|
26
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IsString, IsUUID } from "class-validator";
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
import { CloudResourceContext } from "../contexts/cloud-resource-context";
|
|
4
|
+
import { CloudResourceStatus } from "../types";
|
|
5
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
6
|
+
|
|
7
|
+
export class LudeoStatusUpdatedPayload {
|
|
8
|
+
@IsUUID()
|
|
9
|
+
ludeoResourceId: string;
|
|
10
|
+
|
|
11
|
+
@IsUUID()
|
|
12
|
+
ludeoPoolId: string;
|
|
13
|
+
|
|
14
|
+
@IsString()
|
|
15
|
+
status: CloudResourceStatus;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class LudeoStatusUpdatedEvent extends LudeoEvent {
|
|
19
|
+
static readonly EVENT_NAME = "cloud-pools.game-resource-status-changed";
|
|
20
|
+
|
|
21
|
+
constructor(
|
|
22
|
+
payload: LudeoStatusUpdatedPayload,
|
|
23
|
+
context: CloudResourceContext
|
|
24
|
+
) {
|
|
25
|
+
super(LudeoStatusUpdatedEvent.EVENT_NAME);
|
|
26
|
+
this.payload = payload;
|
|
27
|
+
this.context = context;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@ValidateNestedType(() => CloudResourceContext)
|
|
31
|
+
context: CloudResourceContext;
|
|
32
|
+
|
|
33
|
+
@ValidateNestedType(() => LudeoStatusUpdatedPayload)
|
|
34
|
+
payload: LudeoStatusUpdatedPayload;
|
|
35
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IsNumber, IsUUID } from "class-validator";
|
|
2
|
+
|
|
3
|
+
import { CloudPoolContext } from "../contexts";
|
|
4
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
5
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
6
|
+
|
|
7
|
+
export class TerminateLudoesRequestPayload {
|
|
8
|
+
@IsUUID()
|
|
9
|
+
poolId: string;
|
|
10
|
+
|
|
11
|
+
@IsNumber()
|
|
12
|
+
quantity: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class TerminateLudeosRequest extends LudeoEvent {
|
|
16
|
+
static readonly EVENT_NAME = "cloud-pools.terminate-ludeos-request";
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
payload: TerminateLudoesRequestPayload,
|
|
20
|
+
context: CloudPoolContext
|
|
21
|
+
) {
|
|
22
|
+
super(TerminateLudeosRequest.EVENT_NAME);
|
|
23
|
+
this.payload = payload;
|
|
24
|
+
this.context = context;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@ValidateNestedType(() => CloudPoolContext)
|
|
28
|
+
context: CloudPoolContext;
|
|
29
|
+
|
|
30
|
+
@ValidateNestedType(() => TerminateLudoesRequestPayload)
|
|
31
|
+
payload: TerminateLudoesRequestPayload;
|
|
32
|
+
}
|