@ludeo/cloud-common 1.2.96 → 1.2.98
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/assign-build.d.ts +12 -0
- package/dist/v4/events/assign-build.js +45 -0
- package/dist/v4/events/assign-build.js.map +1 -0
- package/dist/v4/events/build-assigned.d.ts +12 -0
- package/dist/v4/events/build-assigned.js +45 -0
- package/dist/v4/events/build-assigned.js.map +1 -0
- package/dist/v4/events/build-assignment-settings-job-finished.d.ts +16 -0
- package/dist/v4/events/build-assignment-settings-job-finished.js +55 -0
- package/dist/v4/events/build-assignment-settings-job-finished.js.map +1 -0
- package/dist/v4/events/build-assignment-settings-ready-for-creation.d.ts +16 -0
- package/dist/v4/events/build-assignment-settings-ready-for-creation.js +55 -0
- package/dist/v4/events/build-assignment-settings-ready-for-creation.js.map +1 -0
- package/dist/v4/events/build-assignment-settings-ready.d.ts +12 -0
- package/dist/v4/events/build-assignment-settings-ready.js +45 -0
- package/dist/v4/events/build-assignment-settings-ready.js.map +1 -0
- package/dist/v4/events/build-assignment-started.d.ts +18 -0
- package/dist/v4/events/build-assignment-started.js +68 -0
- package/dist/v4/events/build-assignment-started.js.map +1 -0
- package/dist/v4/events/cloud-session-allocated.js +1 -1
- package/dist/v4/events/cloud-session-allocated.js.map +1 -1
- package/dist/v4/events/create-build-assignment-settings-job.d.ts +15 -0
- package/dist/v4/events/create-build-assignment-settings-job.js +51 -0
- package/dist/v4/events/create-build-assignment-settings-job.js.map +1 -0
- package/dist/v4/events/game-resource-allocated-response.js +2 -1
- package/dist/v4/events/game-resource-allocated-response.js.map +1 -1
- package/dist/v4/events/index.d.ts +9 -0
- package/dist/v4/events/index.js +9 -0
- package/dist/v4/events/index.js.map +1 -1
- package/dist/v4/events/ludeo-allocated-response.js +1 -1
- package/dist/v4/events/ludeo-allocated-response.js.map +1 -1
- package/dist/v4/events/ludeo-resource-allocated-response.js +1 -1
- package/dist/v4/events/ludeo-resource-allocated-response.js.map +1 -1
- package/dist/v4/events/monitor-aws-build-assignment-settings-status-task.d.ts +13 -0
- package/dist/v4/events/monitor-aws-build-assignment-settings-status-task.js +44 -0
- package/dist/v4/events/monitor-aws-build-assignment-settings-status-task.js.map +1 -0
- package/dist/v4/events/pools-ready-for-build-assignment.d.ts +12 -0
- package/dist/v4/events/pools-ready-for-build-assignment.js +45 -0
- package/dist/v4/events/pools-ready-for-build-assignment.js.map +1 -0
- package/dist/v4/events/swap-cloud-user-gameplay-request.d.ts +2 -0
- package/dist/v4/events/swap-cloud-user-gameplay-request.js +6 -0
- package/dist/v4/events/swap-cloud-user-gameplay-request.js.map +1 -1
- package/dist/v4/events/swap-cloud-user-request.d.ts +2 -0
- package/dist/v4/events/swap-cloud-user-request.js +6 -0
- package/dist/v4/events/swap-cloud-user-request.js.map +1 -1
- package/dist/v4/types/build.d.ts +57 -1
- package/dist/v4/types/build.js +66 -1
- package/dist/v4/types/build.js.map +1 -1
- package/dist/v4/types/cloud/allocation-data.d.ts +2 -0
- package/dist/v4/types/cloud/allocation-data.js +11 -0
- package/dist/v4/types/cloud/allocation-data.js.map +1 -1
- package/dist/v4/types/cloud/allocation-request.js +2 -2
- package/dist/v4/types/cloud/allocation-request.js.map +1 -1
- package/dist/v4/types/cloud/provider-request.d.ts +2 -0
- package/dist/v4/types/cloud/provider-request.js +11 -0
- package/dist/v4/types/cloud/provider-request.js.map +1 -1
- package/dist/v4/types/cloud/session.js +2 -1
- package/dist/v4/types/cloud/session.js.map +1 -1
- package/package.json +1 -1
- package/src/v4/events/assign-build.ts +28 -0
- package/src/v4/events/build-assigned.ts +28 -0
- package/src/v4/events/build-assignment-settings-job-finished.ts +43 -0
- package/src/v4/events/build-assignment-settings-ready-for-creation.ts +43 -0
- package/src/v4/events/build-assignment-settings-ready.ts +31 -0
- package/src/v4/events/build-assignment-started.ts +52 -0
- package/src/v4/events/cloud-session-allocated.ts +2 -2
- package/src/v4/events/create-build-assignment-settings-job.ts +37 -0
- package/src/v4/events/game-resource-allocated-response.ts +3 -7
- package/src/v4/events/index.ts +9 -0
- package/src/v4/events/ludeo-allocated-response.ts +2 -2
- package/src/v4/events/ludeo-resource-allocated-response.ts +3 -3
- package/src/v4/events/monitor-aws-build-assignment-settings-status-task.ts +33 -0
- package/src/v4/events/pools-ready-for-build-assignment.ts +31 -0
- package/src/v4/events/swap-cloud-user-gameplay-request.ts +6 -1
- package/src/v4/events/swap-cloud-user-request.ts +6 -1
- package/src/v4/types/build.ts +78 -2
- package/src/v4/types/cloud/allocation-data.ts +14 -0
- package/src/v4/types/cloud/allocation-request.ts +6 -4
- package/src/v4/types/cloud/provider-request.ts +13 -0
- package/src/v4/types/cloud/session.ts +3 -7
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { IsEnum, IsUUID } from "class-validator";
|
|
2
|
+
import { CloudProvider } from "../types";
|
|
3
|
+
import { BuildContext } from "../contexts/build-context";
|
|
4
|
+
import {
|
|
5
|
+
AwsBuildAssignmentSettings,
|
|
6
|
+
BuildAssignmentProviderSettings,
|
|
7
|
+
} from "../types/build";
|
|
8
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
9
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
10
|
+
|
|
11
|
+
export class BuildAssignmentSettingsReadyForCreationPayload {
|
|
12
|
+
@IsUUID()
|
|
13
|
+
buildId: string;
|
|
14
|
+
|
|
15
|
+
@IsUUID()
|
|
16
|
+
envId: string;
|
|
17
|
+
|
|
18
|
+
@ValidateNestedType(() => AwsBuildAssignmentSettings)
|
|
19
|
+
assignmentProviderSettings: BuildAssignmentProviderSettings;
|
|
20
|
+
|
|
21
|
+
@IsEnum(CloudProvider)
|
|
22
|
+
cloudProvider: CloudProvider;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class BuildAssignmentSettingsReadyForCreation extends LudeoEvent {
|
|
26
|
+
static readonly EVENT_NAME =
|
|
27
|
+
"cloud-builds.build-assignment-settings-ready-for-creation";
|
|
28
|
+
|
|
29
|
+
constructor(
|
|
30
|
+
payload: BuildAssignmentSettingsReadyForCreationPayload,
|
|
31
|
+
context: BuildContext
|
|
32
|
+
) {
|
|
33
|
+
super(BuildAssignmentSettingsReadyForCreation.EVENT_NAME);
|
|
34
|
+
this.payload = payload;
|
|
35
|
+
this.context = context;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@ValidateNestedType(() => BuildContext)
|
|
39
|
+
context: BuildContext;
|
|
40
|
+
|
|
41
|
+
@ValidateNestedType(() => BuildAssignmentSettingsReadyForCreationPayload)
|
|
42
|
+
payload: BuildAssignmentSettingsReadyForCreationPayload;
|
|
43
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IsUUID } from "class-validator";
|
|
2
|
+
import { BuildContext } from "../contexts/build-context";
|
|
3
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
4
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
5
|
+
|
|
6
|
+
export class BuildAssignmentSettingsReadyPayload {
|
|
7
|
+
@IsUUID()
|
|
8
|
+
envId: string;
|
|
9
|
+
|
|
10
|
+
@IsUUID()
|
|
11
|
+
buildId: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class BuildAssignmentSettingsReady extends LudeoEvent {
|
|
15
|
+
static readonly EVENT_NAME = "cloud-builds.build-assignment-settings-ready";
|
|
16
|
+
|
|
17
|
+
constructor(
|
|
18
|
+
payload: BuildAssignmentSettingsReadyPayload,
|
|
19
|
+
context: BuildContext
|
|
20
|
+
) {
|
|
21
|
+
super(BuildAssignmentSettingsReady.EVENT_NAME);
|
|
22
|
+
this.payload = payload;
|
|
23
|
+
this.context = context;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@ValidateNestedType(() => BuildContext)
|
|
27
|
+
context: BuildContext;
|
|
28
|
+
|
|
29
|
+
@ValidateNestedType(() => BuildAssignmentSettingsReadyPayload)
|
|
30
|
+
payload: BuildAssignmentSettingsReadyPayload;
|
|
31
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { IsEnum, IsOptional, IsUUID } from "class-validator";
|
|
2
|
+
import { BuildContext } from "../contexts/build-context";
|
|
3
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
4
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
5
|
+
import {
|
|
6
|
+
BuildAssignmentProviderSettings,
|
|
7
|
+
AwsBuildAssignmentSettings,
|
|
8
|
+
BuildVersionMeta,
|
|
9
|
+
RolloutConfig,
|
|
10
|
+
BuildAssignmentCase,
|
|
11
|
+
} from "../types/build";
|
|
12
|
+
|
|
13
|
+
export class BuildAssignmentStartedPayload {
|
|
14
|
+
@IsUUID()
|
|
15
|
+
envId: string;
|
|
16
|
+
|
|
17
|
+
@ValidateNestedType(() => BuildVersionMeta)
|
|
18
|
+
targetBuild: BuildVersionMeta;
|
|
19
|
+
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@ValidateNestedType(() => BuildVersionMeta)
|
|
22
|
+
previousBuild?: BuildVersionMeta;
|
|
23
|
+
|
|
24
|
+
@ValidateNestedType(() => RolloutConfig)
|
|
25
|
+
rolloutConfigTargetBuild: RolloutConfig;
|
|
26
|
+
|
|
27
|
+
@IsOptional()
|
|
28
|
+
@ValidateNestedType(() => RolloutConfig)
|
|
29
|
+
rolloutConfigPreviousBuild?: RolloutConfig;
|
|
30
|
+
|
|
31
|
+
@ValidateNestedType(() => AwsBuildAssignmentSettings)
|
|
32
|
+
assignmentProviderSettings: BuildAssignmentProviderSettings;
|
|
33
|
+
|
|
34
|
+
@IsEnum(BuildAssignmentCase)
|
|
35
|
+
buildAssignmentCase: BuildAssignmentCase;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class BuildAssignmentStarted extends LudeoEvent {
|
|
39
|
+
static readonly EVENT_NAME = "cloud-builds.build-assignment-started";
|
|
40
|
+
|
|
41
|
+
constructor(payload: BuildAssignmentStartedPayload, context: BuildContext) {
|
|
42
|
+
super(BuildAssignmentStarted.EVENT_NAME);
|
|
43
|
+
this.payload = payload;
|
|
44
|
+
this.context = context;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@ValidateNestedType(() => BuildContext)
|
|
48
|
+
context: BuildContext;
|
|
49
|
+
|
|
50
|
+
@ValidateNestedType(() => BuildAssignmentStartedPayload)
|
|
51
|
+
payload: BuildAssignmentStartedPayload;
|
|
52
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CloudSessionContext } from "../contexts/cloud-session-context";
|
|
2
2
|
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
3
|
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
|
-
import {
|
|
4
|
+
import { CloudProviderAllocationData, getAllocationDataType } from "../types";
|
|
5
5
|
import { IsOptional, IsString, IsUUID } from "class-validator";
|
|
6
6
|
|
|
7
7
|
export class CloudSessionAllocatedPayload {
|
|
8
|
-
@ValidateNestedType(
|
|
8
|
+
@ValidateNestedType(getAllocationDataType)
|
|
9
9
|
allocationData?: CloudProviderAllocationData;
|
|
10
10
|
|
|
11
11
|
@IsString()
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IsEnum, IsUUID } from "class-validator";
|
|
2
|
+
import { CloudProvider } from "../types";
|
|
3
|
+
import { BuildContext } from "../contexts/build-context";
|
|
4
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
5
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
6
|
+
import { CloudBuild } from "../types/build";
|
|
7
|
+
|
|
8
|
+
export class CreateBuildAssignmentSettingsJobPayload {
|
|
9
|
+
@IsUUID()
|
|
10
|
+
envId: string;
|
|
11
|
+
|
|
12
|
+
@ValidateNestedType(() => CloudBuild)
|
|
13
|
+
build: CloudBuild;
|
|
14
|
+
|
|
15
|
+
@IsEnum(CloudProvider)
|
|
16
|
+
cloudProvider: CloudProvider;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class CreateBuildAssignmentSettingsJob extends LudeoEvent {
|
|
20
|
+
static readonly EVENT_NAME =
|
|
21
|
+
"cloud-builds.create-build-assignment-settings-job";
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
payload: CreateBuildAssignmentSettingsJobPayload,
|
|
25
|
+
context: BuildContext
|
|
26
|
+
) {
|
|
27
|
+
super(CreateBuildAssignmentSettingsJob.EVENT_NAME);
|
|
28
|
+
this.payload = payload;
|
|
29
|
+
this.context = context;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@ValidateNestedType(() => BuildContext)
|
|
33
|
+
context: BuildContext;
|
|
34
|
+
|
|
35
|
+
@ValidateNestedType(() => CreateBuildAssignmentSettingsJobPayload)
|
|
36
|
+
payload: CreateBuildAssignmentSettingsJobPayload;
|
|
37
|
+
}
|
|
@@ -3,12 +3,8 @@ import { IsUUID } from "class-validator";
|
|
|
3
3
|
import { CloudSessionContext } from "../contexts";
|
|
4
4
|
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
5
5
|
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
AwsAllocationData,
|
|
9
|
-
CloudProviderAllocationData,
|
|
10
|
-
} from "../types";
|
|
11
|
-
|
|
6
|
+
import { AllocationRequestData, CloudProviderAllocationData } from "../types";
|
|
7
|
+
import { getAllocationDataType } from "../types/cloud/allocation-data";
|
|
12
8
|
export class GameResourceAllocatedResponsePayload {
|
|
13
9
|
@IsUUID()
|
|
14
10
|
gameResourceId: string;
|
|
@@ -16,7 +12,7 @@ export class GameResourceAllocatedResponsePayload {
|
|
|
16
12
|
@IsUUID()
|
|
17
13
|
gamePoolId: string;
|
|
18
14
|
|
|
19
|
-
@ValidateNestedType(
|
|
15
|
+
@ValidateNestedType(getAllocationDataType)
|
|
20
16
|
allocationData: CloudProviderAllocationData;
|
|
21
17
|
|
|
22
18
|
@ValidateNestedType(() => AllocationRequestData)
|
package/src/v4/events/index.ts
CHANGED
|
@@ -122,3 +122,12 @@ export * from "./build-creation-failed";
|
|
|
122
122
|
export * from "./pool-updated.event";
|
|
123
123
|
export * from "./pool-created.event";
|
|
124
124
|
export * from "./machine-resource-termination-failed-response";
|
|
125
|
+
export * from "./assign-build";
|
|
126
|
+
export * from "./build-assignment-settings-job-finished";
|
|
127
|
+
export * from "./build-assignment-settings-ready-for-creation";
|
|
128
|
+
export * from "./create-build-assignment-settings-job";
|
|
129
|
+
export * from "./monitor-aws-build-assignment-settings-status-task";
|
|
130
|
+
export * from "./build-assignment-started";
|
|
131
|
+
export * from "./pools-ready-for-build-assignment";
|
|
132
|
+
export * from "./build-assigned";
|
|
133
|
+
export * from "./build-assignment-settings-ready";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
2
2
|
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
3
|
import { CloudSessionContext } from "../contexts";
|
|
4
|
-
import {
|
|
4
|
+
import { CloudProviderAllocationData, getAllocationDataType } from "../types";
|
|
5
5
|
import { IsUUID } from "class-validator";
|
|
6
6
|
|
|
7
7
|
export class LudeoAllocatedResponsePayload {
|
|
8
|
-
@ValidateNestedType(
|
|
8
|
+
@ValidateNestedType(getAllocationDataType)
|
|
9
9
|
allocationData: CloudProviderAllocationData;
|
|
10
10
|
|
|
11
11
|
@IsUUID()
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
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
4
|
import { CloudSessionContext } from "../contexts";
|
|
5
5
|
import {
|
|
6
6
|
AllocationRequestData,
|
|
7
|
-
AwsAllocationData,
|
|
8
7
|
CloudProviderAllocationData,
|
|
8
|
+
getAllocationDataType,
|
|
9
9
|
} from "../types";
|
|
10
10
|
|
|
11
11
|
export class LudeoResourceAllocatedResponsePayload {
|
|
@@ -15,7 +15,7 @@ export class LudeoResourceAllocatedResponsePayload {
|
|
|
15
15
|
@IsUUID()
|
|
16
16
|
ludeoPoolId: string;
|
|
17
17
|
|
|
18
|
-
@ValidateNestedType(
|
|
18
|
+
@ValidateNestedType(getAllocationDataType)
|
|
19
19
|
allocationData: CloudProviderAllocationData;
|
|
20
20
|
|
|
21
21
|
@ValidateNestedType(() => AllocationRequestData)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IsUUID } from "class-validator";
|
|
2
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
3
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
|
+
import {
|
|
5
|
+
AwsBuildAssignmentSettings,
|
|
6
|
+
BuildAssignmentProviderSettings,
|
|
7
|
+
} from "../types/build";
|
|
8
|
+
|
|
9
|
+
export class MonitorAwsBuildAssignmentSettingsStatusTaskPayload {
|
|
10
|
+
@ValidateNestedType(() => AwsBuildAssignmentSettings)
|
|
11
|
+
assignmentProviderSettings: BuildAssignmentProviderSettings;
|
|
12
|
+
|
|
13
|
+
@IsUUID()
|
|
14
|
+
buildId: string;
|
|
15
|
+
|
|
16
|
+
@IsUUID()
|
|
17
|
+
envId: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class MonitorAwsBuildAssignmentSettingsStatusTask extends LudeoEvent {
|
|
21
|
+
static readonly EVENT_NAME =
|
|
22
|
+
"cloud-builds.monitor-aws-build-assignment-settings-status-task";
|
|
23
|
+
|
|
24
|
+
constructor(payload: MonitorAwsBuildAssignmentSettingsStatusTaskPayload) {
|
|
25
|
+
super(MonitorAwsBuildAssignmentSettingsStatusTask.EVENT_NAME);
|
|
26
|
+
this.payload = payload;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
context: never;
|
|
30
|
+
|
|
31
|
+
@ValidateNestedType(() => MonitorAwsBuildAssignmentSettingsStatusTaskPayload)
|
|
32
|
+
payload: MonitorAwsBuildAssignmentSettingsStatusTaskPayload;
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IsUUID } from "class-validator";
|
|
2
|
+
import { BuildContext } from "../contexts/build-context";
|
|
3
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
4
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
5
|
+
|
|
6
|
+
export class PoolsReadyForBuildAssignmentPayload {
|
|
7
|
+
@IsUUID()
|
|
8
|
+
envId: string;
|
|
9
|
+
|
|
10
|
+
@IsUUID()
|
|
11
|
+
buildId: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class PoolsReadyForBuildAssignment extends LudeoEvent {
|
|
15
|
+
static readonly EVENT_NAME = "cloud-pools.pools-ready-for-build-assignment";
|
|
16
|
+
|
|
17
|
+
constructor(
|
|
18
|
+
payload: PoolsReadyForBuildAssignmentPayload,
|
|
19
|
+
context: BuildContext
|
|
20
|
+
) {
|
|
21
|
+
super(PoolsReadyForBuildAssignment.EVENT_NAME);
|
|
22
|
+
this.payload = payload;
|
|
23
|
+
this.context = context;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@ValidateNestedType(() => BuildContext)
|
|
27
|
+
context: BuildContext;
|
|
28
|
+
|
|
29
|
+
@ValidateNestedType(() => PoolsReadyForBuildAssignmentPayload)
|
|
30
|
+
payload: PoolsReadyForBuildAssignmentPayload;
|
|
31
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { IsString, IsUUID } from "class-validator";
|
|
1
|
+
import { IsEnum, IsOptional, IsString, IsUUID } from "class-validator";
|
|
2
2
|
|
|
3
3
|
import { CloudSessionContext } from "../contexts";
|
|
4
4
|
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
5
5
|
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
6
|
+
import { CloudProvider } from "../types";
|
|
6
7
|
|
|
7
8
|
export class SwapCloudUserGameplayRequestPayload {
|
|
8
9
|
@IsUUID()
|
|
@@ -22,6 +23,10 @@ export class SwapCloudUserGameplayRequestPayload {
|
|
|
22
23
|
|
|
23
24
|
@IsString()
|
|
24
25
|
actualUserSessionToken: string;
|
|
26
|
+
|
|
27
|
+
@IsOptional()
|
|
28
|
+
@IsEnum(CloudProvider)
|
|
29
|
+
cloudProvider?: CloudProvider;
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
export class SwapCloudUserGameplayRequest extends LudeoEvent {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { IsOptional, IsString, IsUUID } from "class-validator";
|
|
1
|
+
import { IsEnum, IsOptional, IsString, IsUUID } from "class-validator";
|
|
2
2
|
|
|
3
3
|
import { CloudSessionContext } from "../contexts";
|
|
4
4
|
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
5
5
|
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
6
|
+
import { CloudProvider } from "../types";
|
|
6
7
|
|
|
7
8
|
export class SwapCloudUserRequestPayload {
|
|
8
9
|
@IsUUID()
|
|
@@ -17,6 +18,10 @@ export class SwapCloudUserRequestPayload {
|
|
|
17
18
|
|
|
18
19
|
@IsUUID()
|
|
19
20
|
ludeoResourceId: string;
|
|
21
|
+
|
|
22
|
+
@IsOptional()
|
|
23
|
+
@IsEnum(CloudProvider)
|
|
24
|
+
cloudProvider?: CloudProvider;
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
export class SwapCloudUserRequest extends LudeoEvent {
|
package/src/v4/types/build.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsOptional, IsString } from "class-validator";
|
|
1
|
+
import { IsNumber, IsOptional, IsString, IsUUID } from "class-validator";
|
|
2
2
|
import { CloudProvider } from "./cloud";
|
|
3
3
|
|
|
4
4
|
export enum BuildStatus {
|
|
@@ -39,6 +39,10 @@ export class BuildMetadata {
|
|
|
39
39
|
@IsString()
|
|
40
40
|
@IsOptional()
|
|
41
41
|
friendlyName?: string;
|
|
42
|
+
|
|
43
|
+
@IsString()
|
|
44
|
+
@IsOptional()
|
|
45
|
+
buildVersion?: string;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
export class AwsArtifactData {
|
|
@@ -92,10 +96,10 @@ export class CloudBuild {
|
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
export class BuildCreationInput {
|
|
95
|
-
applicationName: string;
|
|
96
99
|
basePath: string;
|
|
97
100
|
executeableLaunchPath: string;
|
|
98
101
|
runtimeEnvironment: RuntimeEnvironment;
|
|
102
|
+
buildVersion?: string;
|
|
99
103
|
logPath?: string;
|
|
100
104
|
}
|
|
101
105
|
|
|
@@ -109,3 +113,75 @@ export interface RuntimeEnvironmentConfigurationMap {
|
|
|
109
113
|
streamClass: string;
|
|
110
114
|
runtimeEnvironment: GamecastRuntimeEnvironment;
|
|
111
115
|
}
|
|
116
|
+
|
|
117
|
+
export class BuildAssignmentProvidersSettings {
|
|
118
|
+
[CloudProvider.AWS]: AwsBuildAssignmentSettings;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export class AwsBuildAssignmentSettings {
|
|
122
|
+
[region: string]: AwsBuildAssignmentSettingsData;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export enum StreamGroupStatus {
|
|
126
|
+
ACTIVATING = "ACTIVATING",
|
|
127
|
+
ACTIVE = "ACTIVE",
|
|
128
|
+
DELETING = "DELETING",
|
|
129
|
+
ERROR = "ERROR",
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export class AwsBuildAssignmentSettingsData {
|
|
133
|
+
streamGroupIdentifier: string;
|
|
134
|
+
streamGroupName: string;
|
|
135
|
+
defaultApplicationIdentifier: string;
|
|
136
|
+
runtimeEnvironmentConfigurationMap: RuntimeEnvironmentConfigurationMap;
|
|
137
|
+
status?: StreamGroupStatus;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export class BuildVersionMeta {
|
|
141
|
+
@IsUUID()
|
|
142
|
+
buildId: string;
|
|
143
|
+
|
|
144
|
+
@IsString()
|
|
145
|
+
buildVersion: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export class RolloutConfig {
|
|
149
|
+
@IsNumber()
|
|
150
|
+
@IsOptional()
|
|
151
|
+
value?: number;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export enum BuildAssignmentCase {
|
|
155
|
+
NEW_BUILD = "new-build",
|
|
156
|
+
MAJOR_BUILD = "major-build",
|
|
157
|
+
MINOR_BUILD = "minor-build",
|
|
158
|
+
ROLLBACK = "rollback",
|
|
159
|
+
ALREADY_ASSIGNING = "already-assigning",
|
|
160
|
+
ALREADY_ASSIGNED = "already-assigned",
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export class EnvBuilds {
|
|
164
|
+
id: string;
|
|
165
|
+
createdAt: number;
|
|
166
|
+
updatedAt?: number;
|
|
167
|
+
builds: BuildsAssignmentsData;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export class BuildsAssignmentsData {
|
|
171
|
+
[buildId: string]: BuildAssignmentData;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export type BuildAssignmentProviderSettings = AwsBuildAssignmentSettings;
|
|
175
|
+
|
|
176
|
+
export class BuildAssignmentData {
|
|
177
|
+
buildVersion: string;
|
|
178
|
+
status: BuildAssignmentStatus;
|
|
179
|
+
isActive?: boolean;
|
|
180
|
+
providers?: Partial<BuildAssignmentProvidersSettings>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export enum BuildAssignmentStatus {
|
|
184
|
+
ASSIGNED = "assigned",
|
|
185
|
+
ASSIGNING = "assigning",
|
|
186
|
+
UNASSIGNED = "unassigned",
|
|
187
|
+
}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
+
import { TypeHelpOptions } from "class-transformer";
|
|
2
|
+
|
|
1
3
|
import { AwsAllocationData } from "./aws";
|
|
2
4
|
import { MockAllocationData } from "./mock";
|
|
3
5
|
|
|
4
6
|
export type CloudProviderAllocationData =
|
|
5
7
|
| AwsAllocationData
|
|
6
8
|
| MockAllocationData;
|
|
9
|
+
|
|
10
|
+
export const getAllocationDataType = ({
|
|
11
|
+
object,
|
|
12
|
+
property,
|
|
13
|
+
}: TypeHelpOptions) => {
|
|
14
|
+
const allocationData = object[property];
|
|
15
|
+
if ("streamGroupId" in allocationData) {
|
|
16
|
+
return AwsAllocationData;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return MockAllocationData;
|
|
20
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { IsDefined, IsOptional, IsString
|
|
1
|
+
import { IsDefined, IsOptional, IsString } from "class-validator";
|
|
2
2
|
import { ValidateNestedType } from "../../../decorators";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
CloudProviderRequest,
|
|
5
|
+
getProviderRequestType,
|
|
6
|
+
} from "./provider-request";
|
|
5
7
|
|
|
6
8
|
export class AllocationRequestData {
|
|
7
|
-
@ValidateNestedType(
|
|
9
|
+
@ValidateNestedType(getProviderRequestType)
|
|
8
10
|
@IsDefined()
|
|
9
11
|
cloudProviderRequest: CloudProviderRequest;
|
|
10
12
|
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
+
import { TypeHelpOptions } from "class-transformer";
|
|
1
2
|
import { AWSRequestData } from "./aws";
|
|
2
3
|
import { MockRequestData } from "./mock";
|
|
3
4
|
|
|
4
5
|
export type CloudProviderRequest = AWSRequestData | MockRequestData;
|
|
6
|
+
|
|
7
|
+
export const getProviderRequestType = ({
|
|
8
|
+
object,
|
|
9
|
+
property,
|
|
10
|
+
}: TypeHelpOptions) => {
|
|
11
|
+
const providerRequest = object[property];
|
|
12
|
+
if ("streamGroupId" in providerRequest) {
|
|
13
|
+
return AWSRequestData;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return MockRequestData;
|
|
17
|
+
};
|
|
@@ -6,13 +6,9 @@ import {
|
|
|
6
6
|
IsOptional,
|
|
7
7
|
} from "class-validator";
|
|
8
8
|
import { ValidateNestedType } from "../../../decorators";
|
|
9
|
-
import {
|
|
10
|
-
AwsAllocationData,
|
|
11
|
-
CloudProvider,
|
|
12
|
-
CloudProviderAllocationData,
|
|
13
|
-
} from "../cloud";
|
|
9
|
+
import { CloudProvider, CloudProviderAllocationData } from "../cloud";
|
|
14
10
|
import { AllocationRequestData } from "./allocation-request";
|
|
15
|
-
|
|
11
|
+
import { getAllocationDataType } from "./allocation-data";
|
|
16
12
|
export enum CloudSessionStatus {
|
|
17
13
|
Created = "created",
|
|
18
14
|
PendingAllocation = "pending",
|
|
@@ -60,7 +56,7 @@ export class CloudSession {
|
|
|
60
56
|
requestData: AllocationRequestData;
|
|
61
57
|
|
|
62
58
|
@IsOptional()
|
|
63
|
-
@ValidateNestedType(
|
|
59
|
+
@ValidateNestedType(getAllocationDataType)
|
|
64
60
|
allocationData?: CloudProviderAllocationData;
|
|
65
61
|
|
|
66
62
|
@IsUUID()
|