@ludeo/cloud-common 1.2.85 → 1.2.86-ygarbage2

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.
Files changed (58) hide show
  1. package/dist/tsconfig.tsbuildinfo +1 -1
  2. package/dist/v4/events/build-created.d.ts +2 -1
  3. package/dist/v4/events/build-created.js +4 -4
  4. package/dist/v4/events/build-created.js.map +1 -1
  5. package/dist/v4/events/build-creation-failed.d.ts +12 -0
  6. package/dist/v4/events/build-creation-failed.js +46 -0
  7. package/dist/v4/events/build-creation-failed.js.map +1 -0
  8. package/dist/v4/events/build-uploaded.d.ts +12 -0
  9. package/dist/v4/events/build-uploaded.js +45 -0
  10. package/dist/v4/events/build-uploaded.js.map +1 -0
  11. package/dist/v4/events/create-build.d.ts +15 -0
  12. package/dist/v4/events/create-build.js +51 -0
  13. package/dist/v4/events/create-build.js.map +1 -0
  14. package/dist/v4/events/index.d.ts +4 -0
  15. package/dist/v4/events/index.js +4 -0
  16. package/dist/v4/events/index.js.map +1 -1
  17. package/dist/v4/events/machine-resource-created-response.d.ts +3 -1
  18. package/dist/v4/events/machine-resource-created-response.js +4 -0
  19. package/dist/v4/events/machine-resource-created-response.js.map +1 -1
  20. package/dist/v4/events/machine-resource-termination-failed-response.d.ts +16 -0
  21. package/dist/v4/events/machine-resource-termination-failed-response.js +58 -0
  22. package/dist/v4/events/machine-resource-termination-failed-response.js.map +1 -0
  23. package/dist/v4/events/terminate-machine-resource-request.d.ts +3 -1
  24. package/dist/v4/events/terminate-machine-resource-request.js +4 -0
  25. package/dist/v4/events/terminate-machine-resource-request.js.map +1 -1
  26. package/dist/v4/types/build.d.ts +3 -3
  27. package/dist/v4/types/build.js +30 -0
  28. package/dist/v4/types/build.js.map +1 -1
  29. package/dist/v4/types/cloud/index.d.ts +1 -0
  30. package/dist/v4/types/cloud/index.js +1 -0
  31. package/dist/v4/types/cloud/index.js.map +1 -1
  32. package/dist/v4/types/cloud/machine-provider-settings.d.ts +2 -0
  33. package/dist/v4/types/cloud/machine-provider-settings.js +3 -0
  34. package/dist/v4/types/cloud/machine-provider-settings.js.map +1 -0
  35. package/dist/v4/types/cloud/mock/index.d.ts +1 -0
  36. package/dist/v4/types/cloud/mock/index.js +1 -0
  37. package/dist/v4/types/cloud/mock/index.js.map +1 -1
  38. package/dist/v4/types/cloud/mock/machine-provider-settings.d.ts +3 -0
  39. package/dist/v4/types/cloud/mock/machine-provider-settings.js +21 -0
  40. package/dist/v4/types/cloud/mock/machine-provider-settings.js.map +1 -0
  41. package/dist/v4/types/pools/resource/machine.d.ts +2 -0
  42. package/dist/v4/types/pools/resource/machine.js +4 -0
  43. package/dist/v4/types/pools/resource/machine.js.map +1 -1
  44. package/package.json +1 -1
  45. package/src/v4/events/build-created.ts +3 -3
  46. package/src/v4/events/build-creation-failed.ts +29 -0
  47. package/src/v4/events/build-uploaded.ts +28 -0
  48. package/src/v4/events/create-build.ts +33 -0
  49. package/src/v4/events/index.ts +4 -0
  50. package/src/v4/events/machine-resource-created-response.ts +8 -2
  51. package/src/v4/events/machine-resource-termination-failed-response.ts +47 -0
  52. package/src/v4/events/terminate-machine-resource-request.ts +7 -2
  53. package/src/v4/types/build.ts +15 -3
  54. package/src/v4/types/cloud/index.ts +1 -0
  55. package/src/v4/types/cloud/machine-provider-settings.ts +3 -0
  56. package/src/v4/types/cloud/mock/index.ts +1 -0
  57. package/src/v4/types/cloud/mock/machine-provider-settings.ts +6 -0
  58. package/src/v4/types/pools/resource/machine.ts +4 -0
@@ -1,11 +1,11 @@
1
- import { IsUUID } from "class-validator";
2
1
  import { BuildContext } from "../contexts/build-context";
3
2
  import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
4
3
  import { LudeoEvent } from "../../infra/ludeo-event";
4
+ import { CloudBuild } from "../types";
5
5
 
6
6
  export class BuildCreatedPayload {
7
- @IsUUID()
8
- buildId: string;
7
+ @ValidateNestedType(() => CloudBuild)
8
+ build: CloudBuild;
9
9
  }
10
10
 
11
11
  export class BuildCreated extends LudeoEvent {
@@ -0,0 +1,29 @@
1
+ import { IsOptional, IsString, 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 BuildCreationFailedPayload {
7
+ @IsUUID()
8
+ buildId: string;
9
+
10
+ @IsString()
11
+ @IsOptional()
12
+ error?: string;
13
+ }
14
+
15
+ export class BuildCreationFailed extends LudeoEvent {
16
+ static readonly EVENT_NAME = "cloud-builds.build-creation-failed";
17
+
18
+ constructor(payload: BuildCreationFailedPayload, context: BuildContext) {
19
+ super(BuildCreationFailed.EVENT_NAME);
20
+ this.payload = payload;
21
+ this.context = context;
22
+ }
23
+
24
+ @ValidateNestedType(() => BuildContext)
25
+ context: BuildContext;
26
+
27
+ @ValidateNestedType(() => BuildCreationFailedPayload)
28
+ payload: BuildCreationFailedPayload;
29
+ }
@@ -0,0 +1,28 @@
1
+ import { IsUUID, IsString } 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 BuildUploadedPayload {
7
+ @IsUUID()
8
+ buildId: string;
9
+
10
+ @IsString()
11
+ centralizedPath: string;
12
+ }
13
+
14
+ export class BuildUploaded extends LudeoEvent {
15
+ static readonly EVENT_NAME = "cloud-builds.build-uploaded";
16
+
17
+ constructor(payload: BuildUploadedPayload, context: BuildContext) {
18
+ super(BuildUploaded.EVENT_NAME);
19
+ this.payload = payload;
20
+ this.context = context;
21
+ }
22
+
23
+ @ValidateNestedType(() => BuildContext)
24
+ context: BuildContext;
25
+
26
+ @ValidateNestedType(() => BuildUploadedPayload)
27
+ payload: BuildUploadedPayload;
28
+ }
@@ -0,0 +1,33 @@
1
+ import { IsString } from "class-validator";
2
+ import { BuildContext } from "../contexts/build-context";
3
+ import { BuildMetadata } from "../types/build";
4
+ import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
5
+ import { LudeoEvent } from "../../infra/ludeo-event";
6
+ import { BuildCreationInput } from "../types/build";
7
+
8
+ export class CreateBuildPayload {
9
+ @IsString()
10
+ buildId: string;
11
+
12
+ @ValidateNestedType(() => BuildMetadata)
13
+ meta: BuildMetadata;
14
+
15
+ @ValidateNestedType(() => BuildCreationInput)
16
+ creationInput: BuildCreationInput;
17
+ }
18
+
19
+ export class CreateBuild extends LudeoEvent {
20
+ static readonly EVENT_NAME = "cloud-builds.create-build";
21
+
22
+ constructor(payload: CreateBuildPayload, context: BuildContext) {
23
+ super(CreateBuild.EVENT_NAME);
24
+ this.payload = payload;
25
+ this.context = context;
26
+ }
27
+
28
+ @ValidateNestedType(() => BuildContext)
29
+ context: BuildContext;
30
+
31
+ @ValidateNestedType(() => CreateBuildPayload)
32
+ payload: CreateBuildPayload;
33
+ }
@@ -116,5 +116,9 @@ export * from "./monitor-aws-artifacts-status-task";
116
116
  export * from "./build-artifacts-ready-for-creation";
117
117
  export * from "./token-activated";
118
118
  export * from "./cloud-session-sent-to-client";
119
+ export * from "./build-uploaded";
120
+ export * from "./create-build";
121
+ export * from "./build-creation-failed";
119
122
  export * from "./pool-updated.event";
120
123
  export * from "./pool-created.event";
124
+ export * from "./machine-resource-termination-failed-response";
@@ -1,15 +1,21 @@
1
- import { IsUUID } from "class-validator";
1
+ import { IsOptional, IsUUID } from "class-validator";
2
2
 
3
3
  import { CloudResourceContext } from "../contexts";
4
4
  import { LudeoEvent } from "../../infra/ludeo-event";
5
5
  import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
6
+ import { MachineProviderSettings } from "../types/cloud/machine-provider-settings";
6
7
 
7
- export class MachineResourceCreatedResponsePayload {
8
+ export class MachineResourceCreatedResponsePayload<
9
+ T extends MachineProviderSettings = MachineProviderSettings
10
+ > {
8
11
  @IsUUID()
9
12
  machineResourceId: string;
10
13
 
11
14
  @IsUUID()
12
15
  machinePoolId: string;
16
+
17
+ @IsOptional()
18
+ machineProviderSettings?: T;
13
19
  }
14
20
 
15
21
  export class MachineResourceCreatedResponse extends LudeoEvent {
@@ -0,0 +1,47 @@
1
+ import { IsArray, IsEnum, IsString, IsUUID } from "class-validator";
2
+
3
+ import { CloudResourceContext } from "../contexts";
4
+ import { LudeoEvent } from "../../infra/ludeo-event";
5
+ import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
6
+ import {
7
+ AWSProviderSettings,
8
+ CloudProvider,
9
+ CloudProviderSettings,
10
+ } from "../types";
11
+
12
+ export class MachineResourceTerminationFailedResponsePayload {
13
+ @IsUUID()
14
+ machineResourceId: string;
15
+
16
+ @IsUUID()
17
+ machinePoolId: string;
18
+
19
+ @IsEnum(CloudProvider)
20
+ cloudProvider: CloudProvider;
21
+
22
+ @ValidateNestedType(() => AWSProviderSettings)
23
+ cloudProviderSettings: CloudProviderSettings;
24
+
25
+ @IsString()
26
+ errorMessage: string;
27
+ }
28
+
29
+ export class MachineResourceTerminationFailedResponse extends LudeoEvent {
30
+ static readonly EVENT_NAME =
31
+ "cloud-pools.machine-resource-termination-failed-response";
32
+
33
+ constructor(
34
+ payload: MachineResourceTerminationFailedResponsePayload,
35
+ context: CloudResourceContext
36
+ ) {
37
+ super(MachineResourceTerminationFailedResponse.EVENT_NAME);
38
+ this.payload = payload;
39
+ this.context = context;
40
+ }
41
+
42
+ @ValidateNestedType(() => CloudResourceContext)
43
+ context: CloudResourceContext;
44
+
45
+ @ValidateNestedType(() => MachineResourceTerminationFailedResponsePayload)
46
+ payload: MachineResourceTerminationFailedResponsePayload;
47
+ }
@@ -1,4 +1,4 @@
1
- import { IsEnum, IsUUID } from "class-validator";
1
+ import { IsEnum, IsOptional, IsUUID } from "class-validator";
2
2
 
3
3
  import { CloudResourceContext } from "../contexts";
4
4
  import { LudeoEvent } from "../../infra/ludeo-event";
@@ -8,9 +8,11 @@ import {
8
8
  CloudProviderSettings,
9
9
  getProviderSettingsType,
10
10
  } from "../types";
11
+ import { MachineProviderSettings } from "../types/cloud/machine-provider-settings";
11
12
 
12
13
  export class TerminateMachineResourceRequestPayload<
13
- T extends CloudProviderSettings = CloudProviderSettings
14
+ T extends CloudProviderSettings = CloudProviderSettings,
15
+ K extends MachineProviderSettings = MachineProviderSettings
14
16
  > {
15
17
  @IsUUID()
16
18
  machineResourceId: string;
@@ -23,6 +25,9 @@ export class TerminateMachineResourceRequestPayload<
23
25
 
24
26
  @ValidateNestedType(getProviderSettingsType)
25
27
  cloudProviderSettings: T;
28
+
29
+ @IsOptional()
30
+ providerSettings?: K;
26
31
  }
27
32
 
28
33
  export class TerminateMachineResourceRequest extends LudeoEvent {
@@ -1,3 +1,4 @@
1
+ import { IsOptional, IsString } from "class-validator";
1
2
  import { CloudProvider } from "./cloud";
2
3
 
3
4
  export enum BuildStatus {
@@ -23,9 +24,20 @@ export enum ArtifactStatus {
23
24
  }
24
25
 
25
26
  export class BuildMetadata {
26
- studioId: string;
27
- gameId: string;
28
- versionId: string;
27
+ @IsString()
28
+ @IsOptional()
29
+ studioId?: string;
30
+
31
+ @IsString()
32
+ @IsOptional()
33
+ gameId?: string;
34
+
35
+ @IsString()
36
+ @IsOptional()
37
+ versionId?: string;
38
+
39
+ @IsString()
40
+ @IsOptional()
29
41
  friendlyName?: string;
30
42
  }
31
43
 
@@ -8,3 +8,4 @@ export * from "./provider";
8
8
  export * from "./resource-provider-settings";
9
9
  export * from "./session";
10
10
  export * from "./mock";
11
+ export * from "./machine-provider-settings";
@@ -0,0 +1,3 @@
1
+ import { MockMachineProviderSettings } from "./mock";
2
+
3
+ export type MachineProviderSettings = MockMachineProviderSettings;
@@ -3,3 +3,4 @@ export * from "./provider-settings";
3
3
  export * from "./request-data";
4
4
  export * from "./game-creation-response";
5
5
  export * from "./allocation-data";
6
+ export * from "./machine-provider-settings";
@@ -0,0 +1,6 @@
1
+ import { IsString } from "class-validator";
2
+
3
+ export class MockMachineProviderSettings {
4
+ @IsString()
5
+ machineId: string;
6
+ }
@@ -1,5 +1,6 @@
1
1
  import { IsOptional, IsUUID } from "class-validator";
2
2
  import { BaseCloudResource } from "./base";
3
+ import { MachineProviderSettings } from "../../cloud";
3
4
 
4
5
  export class MachineCloudResource extends BaseCloudResource {
5
6
  @IsOptional()
@@ -9,4 +10,7 @@ export class MachineCloudResource extends BaseCloudResource {
9
10
  @IsOptional()
10
11
  @IsUUID()
11
12
  gamePoolId?: string;
13
+
14
+ @IsOptional()
15
+ providerSettings?: MachineProviderSettings;
12
16
  }