@ludeo/cloud-common 1.0.5 → 1.0.6
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/v2/events/pool-item-allocated.event.d.ts +4 -1
- package/dist/v2/events/pool-item-allocated.event.js +11 -4
- package/dist/v2/events/pool-item-allocated.event.js.map +1 -1
- package/dist/v2/types/cloud.d.ts +44 -0
- package/dist/v2/types/cloud.js +100 -0
- package/dist/v2/types/cloud.js.map +1 -0
- package/dist/v2/types/index.d.ts +2 -78
- package/dist/v2/types/index.js +15 -144
- package/dist/v2/types/index.js.map +1 -1
- package/dist/v2/types/pools.d.ts +28 -0
- package/dist/v2/types/pools.js +54 -0
- package/dist/v2/types/pools.js.map +1 -0
- package/package.json +1 -1
- package/src/v2/events/pool-item-allocated.event.ts +6 -1
- package/src/v2/types/cloud.ts +89 -0
- package/src/v2/types/index.ts +2 -139
- package/src/v2/types/pools.ts +41 -0
package/src/v2/types/index.ts
CHANGED
|
@@ -1,139 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
IsUUID,
|
|
4
|
-
IsString,
|
|
5
|
-
IsNotEmpty,
|
|
6
|
-
IsOptional,
|
|
7
|
-
IsNumber,
|
|
8
|
-
IsEnum,
|
|
9
|
-
} from "class-validator";
|
|
10
|
-
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
11
|
-
import { GameCast } from "@ludeo/aws-gamecast-sdk";
|
|
12
|
-
|
|
13
|
-
export class AWSRequestData {
|
|
14
|
-
@IsString()
|
|
15
|
-
@IsNotEmpty()
|
|
16
|
-
signalRequest: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type CloudProviderRequest = AWSRequestData;
|
|
20
|
-
|
|
21
|
-
export class CloudProviderRequestData {
|
|
22
|
-
@IsUUID()
|
|
23
|
-
authToken: string;
|
|
24
|
-
|
|
25
|
-
@IsUUID()
|
|
26
|
-
appToken: string;
|
|
27
|
-
|
|
28
|
-
@IsDefined()
|
|
29
|
-
@ValidateNestedType(() => AWSRequestData)
|
|
30
|
-
cloudProviderRequest: CloudProviderRequest;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export enum CloudProvider {
|
|
34
|
-
AWS = "aws",
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export class AWSResourceCreationConfig {
|
|
38
|
-
streamGroupId: string;
|
|
39
|
-
identifier: GameCast.Identifier;
|
|
40
|
-
additionalEnvironmentVariables?: GameCast.EnvironmentVariables;
|
|
41
|
-
protocol?: GameCast.Protocol;
|
|
42
|
-
connectionTimeoutSeconds?: GameCast.ConnectionTimeoutSeconds;
|
|
43
|
-
sessionLengthSeconds?: GameCast.SessionLengthSeconds;
|
|
44
|
-
applicationIdentifier?: GameCast.Identifier;
|
|
45
|
-
region?: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export type CloudResourceCreationConfig = AWSResourceCreationConfig;
|
|
49
|
-
|
|
50
|
-
export enum CloudResourceStatus {
|
|
51
|
-
Allocated = "allocated",
|
|
52
|
-
Available = "available",
|
|
53
|
-
Creating = "creating",
|
|
54
|
-
Allocating = "allocating",
|
|
55
|
-
Error = "error",
|
|
56
|
-
Terminated = "terminated",
|
|
57
|
-
Terminating = "terminating",
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export class AllocateCloudResourceRequestData {
|
|
61
|
-
providerSettings: CloudResourceCreationConfig;
|
|
62
|
-
requestData: CloudProviderRequestData;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export class AwsAllocationData {
|
|
66
|
-
@IsString()
|
|
67
|
-
streamGroupId: string;
|
|
68
|
-
|
|
69
|
-
@IsString()
|
|
70
|
-
streamSessionId: string;
|
|
71
|
-
|
|
72
|
-
@IsString()
|
|
73
|
-
signalResponse: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export type CloudProviderAllocationData = AwsAllocationData;
|
|
77
|
-
|
|
78
|
-
export class AWSResourceProviderSettings {
|
|
79
|
-
@IsString()
|
|
80
|
-
streamSessionId: string;
|
|
81
|
-
|
|
82
|
-
@IsString()
|
|
83
|
-
streamGroupId: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export class AWSCreationResponse {
|
|
87
|
-
@IsOptional()
|
|
88
|
-
signalResponse?: GameCast.SignalResponse;
|
|
89
|
-
|
|
90
|
-
@IsString()
|
|
91
|
-
@IsNotEmpty()
|
|
92
|
-
streamSessionId: string;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export type CreationResponse = AWSCreationResponse;
|
|
96
|
-
|
|
97
|
-
export enum CloudPoolStatus {
|
|
98
|
-
Active = "active",
|
|
99
|
-
Scaling = "scaling",
|
|
100
|
-
Terminated = "terminated",
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export class CloudPoolConfiguration {
|
|
104
|
-
providerSettings?: CloudResourceCreationConfig;
|
|
105
|
-
|
|
106
|
-
@IsEnum(CloudProvider)
|
|
107
|
-
cloudProvider: CloudProvider;
|
|
108
|
-
|
|
109
|
-
@IsUUID()
|
|
110
|
-
poolId: string;
|
|
111
|
-
|
|
112
|
-
@ValidateNestedType(() => PoolScaleConfiguration)
|
|
113
|
-
poolScaleConfiguration: PoolScaleConfiguration;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export type CloudResourcesMap = Record<string, { status: CloudResourceStatus }>;
|
|
117
|
-
|
|
118
|
-
export class PoolScaleConfiguration {
|
|
119
|
-
@IsNumber()
|
|
120
|
-
size: number;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export class PoolItemAllocatedPayload {
|
|
124
|
-
@ValidateNestedType(() => AwsAllocationData)
|
|
125
|
-
allocationData?: CloudProviderAllocationData;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export type CloudResourcesStatusMap = Record<CloudResourceStatus, number>;
|
|
129
|
-
|
|
130
|
-
export class AllocationRequestData {
|
|
131
|
-
@IsString()
|
|
132
|
-
authToken: string;
|
|
133
|
-
|
|
134
|
-
@IsString()
|
|
135
|
-
appToken: string;
|
|
136
|
-
|
|
137
|
-
@ValidateNestedType(() => CloudProviderRequestData)
|
|
138
|
-
cloudProviderRequest: CloudProviderRequest;
|
|
139
|
-
}
|
|
1
|
+
export * from "./cloud";
|
|
2
|
+
export * from "./pools";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IsEnum, IsNumber, IsUUID } from "class-validator";
|
|
2
|
+
import { CloudProvider, CloudResourceCreationConfig } from "./cloud";
|
|
3
|
+
import { ValidateNestedType } from "../../decorators";
|
|
4
|
+
|
|
5
|
+
export enum CloudResourceStatus {
|
|
6
|
+
Allocated = "allocated",
|
|
7
|
+
Available = "available",
|
|
8
|
+
Creating = "creating",
|
|
9
|
+
Allocating = "allocating",
|
|
10
|
+
Error = "error",
|
|
11
|
+
Terminated = "terminated",
|
|
12
|
+
Terminating = "terminating",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export enum CloudPoolStatus {
|
|
16
|
+
Active = "active",
|
|
17
|
+
Scaling = "scaling",
|
|
18
|
+
Terminated = "terminated",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class CloudPoolConfiguration {
|
|
22
|
+
providerSettings?: CloudResourceCreationConfig;
|
|
23
|
+
|
|
24
|
+
@IsEnum(CloudProvider)
|
|
25
|
+
cloudProvider: CloudProvider;
|
|
26
|
+
|
|
27
|
+
@IsUUID()
|
|
28
|
+
poolId: string;
|
|
29
|
+
|
|
30
|
+
@ValidateNestedType(() => PoolScaleConfiguration)
|
|
31
|
+
poolScaleConfiguration: PoolScaleConfiguration;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type CloudResourcesMap = Record<string, { status: CloudResourceStatus }>;
|
|
35
|
+
|
|
36
|
+
export class PoolScaleConfiguration {
|
|
37
|
+
@IsNumber()
|
|
38
|
+
size: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type CloudResourcesStatusMap = Record<CloudResourceStatus, number>;
|