@ludeo/cloud-common 1.0.31 → 1.0.33
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/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/v3/contexts/cloud-resource-context.d.ts +8 -0
- package/dist/v3/contexts/cloud-resource-context.js +40 -0
- package/dist/v3/contexts/cloud-resource-context.js.map +1 -0
- package/dist/v3/contexts/index.d.ts +1 -0
- package/dist/v3/contexts/index.js +18 -0
- package/dist/v3/contexts/index.js.map +1 -0
- package/dist/v3/events/allocate-game-request.d.ts +14 -0
- package/dist/v3/events/allocate-game-request.js +50 -0
- package/dist/v3/events/allocate-game-request.js.map +1 -0
- package/dist/v3/events/allocate-game-resource-request.d.ts +17 -0
- package/dist/v3/events/allocate-game-resource-request.js +62 -0
- package/dist/v3/events/allocate-game-resource-request.js.map +1 -0
- package/dist/v3/events/allocate-machine-request.d.ts +13 -0
- package/dist/v3/events/allocate-machine-request.js +49 -0
- package/dist/v3/events/allocate-machine-request.js.map +1 -0
- package/dist/v3/events/create-game-resource-request.d.ts +16 -0
- package/dist/v3/events/create-game-resource-request.js +58 -0
- package/dist/v3/events/create-game-resource-request.js.map +1 -0
- package/dist/v3/events/create-games-request.d.ts +12 -0
- package/dist/v3/events/create-games-request.js +45 -0
- package/dist/v3/events/create-games-request.js.map +1 -0
- package/dist/v3/events/create-machine-resource-batch-request.d.ts +15 -0
- package/dist/v3/events/create-machine-resource-batch-request.js +54 -0
- package/dist/v3/events/create-machine-resource-batch-request.js.map +1 -0
- package/dist/v3/events/create-machine-resource-request.d.ts +15 -0
- package/dist/v3/events/create-machine-resource-request.js +54 -0
- package/dist/v3/events/create-machine-resource-request.js.map +1 -0
- package/dist/v3/events/create-machines-request.d.ts +12 -0
- package/dist/v3/events/create-machines-request.js +45 -0
- package/dist/v3/events/create-machines-request.js.map +1 -0
- package/dist/v3/events/game-allocated-response.d.ts +14 -0
- package/dist/v3/events/game-allocated-response.js +50 -0
- package/dist/v3/events/game-allocated-response.js.map +1 -0
- package/dist/v3/events/game-created-response.d.ts +15 -0
- package/dist/v3/events/game-created-response.js +54 -0
- package/dist/v3/events/game-created-response.js.map +1 -0
- package/dist/v3/events/game-terminated-response.d.ts +12 -0
- package/dist/v3/events/game-terminated-response.js +45 -0
- package/dist/v3/events/game-terminated-response.js.map +1 -0
- package/dist/v3/events/index.d.ts +17 -0
- package/dist/v3/events/index.js +34 -0
- package/dist/v3/events/index.js.map +1 -0
- package/dist/v3/events/machine-allocated-response.d.ts +17 -0
- package/dist/v3/events/machine-allocated-response.js +62 -0
- package/dist/v3/events/machine-allocated-response.js.map +1 -0
- package/dist/v3/events/machine-created-response.d.ts +12 -0
- package/dist/v3/events/machine-created-response.js +45 -0
- package/dist/v3/events/machine-created-response.js.map +1 -0
- package/dist/v3/events/set-pool.event.d.ts +9 -0
- package/dist/v3/events/set-pool.event.js +34 -0
- package/dist/v3/events/set-pool.event.js.map +1 -0
- package/dist/v3/events/terminate-game-resource-request.d.ts +15 -0
- package/dist/v3/events/terminate-game-resource-request.js +54 -0
- package/dist/v3/events/terminate-game-resource-request.js.map +1 -0
- package/dist/v3/events/terminate-games-request.d.ts +12 -0
- package/dist/v3/events/terminate-games-request.js +45 -0
- package/dist/v3/events/terminate-games-request.js.map +1 -0
- package/dist/v3/events/terminate-machine-resource-batch-request.d.ts +15 -0
- package/dist/v3/events/terminate-machine-resource-batch-request.js +54 -0
- package/dist/v3/events/terminate-machine-resource-batch-request.js.map +1 -0
- package/dist/v3/events/terminate-machines-request.d.ts +12 -0
- package/dist/v3/events/terminate-machines-request.js +45 -0
- package/dist/v3/events/terminate-machines-request.js.map +1 -0
- package/dist/v3/index.d.ts +2 -0
- package/dist/v3/index.js +6 -0
- package/dist/v3/index.js.map +1 -0
- package/dist/v3/types/cloud.d.ts +39 -0
- package/dist/v3/types/cloud.js +88 -0
- package/dist/v3/types/cloud.js.map +1 -0
- package/dist/v3/types/index.d.ts +2 -0
- package/dist/v3/types/index.js +19 -0
- package/dist/v3/types/index.js.map +1 -0
- package/dist/v3/types/pools.d.ts +59 -0
- package/dist/v3/types/pools.js +88 -0
- package/dist/v3/types/pools.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/v3/contexts/cloud-resource-context.ts +21 -0
- package/src/v3/contexts/index.ts +1 -0
- package/src/v3/events/allocate-game-request.ts +36 -0
- package/src/v3/events/allocate-game-resource-request.ts +50 -0
- package/src/v3/events/allocate-machine-request.ts +35 -0
- package/src/v3/events/create-game-resource-request.ts +46 -0
- package/src/v3/events/create-games-request.ts +29 -0
- package/src/v3/events/create-machine-resource-batch-request.ts +44 -0
- package/src/v3/events/create-machine-resource-request.ts +43 -0
- package/src/v3/events/create-machines-request.ts +29 -0
- package/src/v3/events/game-allocated-response.ts +36 -0
- package/src/v3/events/game-created-response.ts +43 -0
- package/src/v3/events/game-terminated-response.ts +32 -0
- package/src/v3/events/index.ts +17 -0
- package/src/v3/events/machine-allocated-response.ts +49 -0
- package/src/v3/events/machine-created-response.ts +32 -0
- package/src/v3/events/set-pool.event.ts +23 -0
- package/src/v3/events/terminate-game-resource-request.ts +43 -0
- package/src/v3/events/terminate-games-request.ts +29 -0
- package/src/v3/events/terminate-machine-resource-batch-request.ts +44 -0
- package/src/v3/events/terminate-machines-request.ts +29 -0
- package/src/v3/index.ts +2 -0
- package/src/v3/types/cloud.ts +84 -0
- package/src/v3/types/index.ts +2 -0
- package/src/v3/types/pools.ts +90 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TerminateGamesRequest = exports.TerminateGamesRequestPayload = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const contexts_1 = require("../../v2/contexts");
|
|
15
|
+
const ludeo_event_1 = require("../../infra/ludeo-event");
|
|
16
|
+
const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
|
|
17
|
+
class TerminateGamesRequestPayload {
|
|
18
|
+
}
|
|
19
|
+
exports.TerminateGamesRequestPayload = TerminateGamesRequestPayload;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsUUID)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], TerminateGamesRequestPayload.prototype, "poolId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsNumber)(),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], TerminateGamesRequestPayload.prototype, "quantity", void 0);
|
|
28
|
+
class TerminateGamesRequest extends ludeo_event_1.LudeoEvent {
|
|
29
|
+
constructor(payload, context) {
|
|
30
|
+
super(TerminateGamesRequest.EVENT_NAME);
|
|
31
|
+
this.payload = payload;
|
|
32
|
+
this.context = context;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.TerminateGamesRequest = TerminateGamesRequest;
|
|
36
|
+
TerminateGamesRequest.EVENT_NAME = "cloud-pools.terminate-games-request";
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => contexts_1.PoolContext),
|
|
39
|
+
__metadata("design:type", contexts_1.PoolContext)
|
|
40
|
+
], TerminateGamesRequest.prototype, "context", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => TerminateGamesRequestPayload),
|
|
43
|
+
__metadata("design:type", TerminateGamesRequestPayload)
|
|
44
|
+
], TerminateGamesRequest.prototype, "payload", void 0);
|
|
45
|
+
//# sourceMappingURL=terminate-games-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminate-games-request.js","sourceRoot":"","sources":["../../../src/v3/events/terminate-games-request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmD;AAEnD,gDAAgD;AAChD,yDAAqD;AACrD,oGAAqF;AAErF,MAAa,4BAA4B;CAMxC;AAND,oEAMC;AAJC;IADC,IAAA,wBAAM,GAAE;;4DACM;AAGf;IADC,IAAA,0BAAQ,GAAE;;8DACM;AAGnB,MAAa,qBAAsB,SAAQ,wBAAU;IAGnD,YAAY,OAAqC,EAAE,OAAoB;QACrE,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAPH,sDAcC;AAbiB,gCAAU,GAAG,qCAAqC,CAAC;AASnE;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,sBAAW,CAAC;8BAC7B,sBAAW;sDAAC;AAGrB;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,4BAA4B,CAAC;8BAC9C,4BAA4B;sDAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CloudResourceContext } from "../contexts";
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
import { CloudProvider, CloudProviderSettings } from "../types";
|
|
4
|
+
export declare class TerminateMachineResourceBatchRequestPayload {
|
|
5
|
+
machineResourceIds: string[];
|
|
6
|
+
machinePoolId: string;
|
|
7
|
+
cloudProvider: CloudProvider;
|
|
8
|
+
cloudProviderSettings: CloudProviderSettings;
|
|
9
|
+
}
|
|
10
|
+
export declare class TerminateMachineResourceBatchRequest extends LudeoEvent {
|
|
11
|
+
static readonly EVENT_NAME = "cloud-pools.terminate-machine-resource-batch-request";
|
|
12
|
+
constructor(payload: TerminateMachineResourceBatchRequestPayload, context: CloudResourceContext);
|
|
13
|
+
context: CloudResourceContext;
|
|
14
|
+
payload: TerminateMachineResourceBatchRequestPayload;
|
|
15
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TerminateMachineResourceBatchRequest = exports.TerminateMachineResourceBatchRequestPayload = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const contexts_1 = require("../contexts");
|
|
15
|
+
const ludeo_event_1 = require("../../infra/ludeo-event");
|
|
16
|
+
const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
|
|
17
|
+
const types_1 = require("../types");
|
|
18
|
+
class TerminateMachineResourceBatchRequestPayload {
|
|
19
|
+
}
|
|
20
|
+
exports.TerminateMachineResourceBatchRequestPayload = TerminateMachineResourceBatchRequestPayload;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsArray)(),
|
|
23
|
+
__metadata("design:type", Array)
|
|
24
|
+
], TerminateMachineResourceBatchRequestPayload.prototype, "machineResourceIds", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsUUID)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], TerminateMachineResourceBatchRequestPayload.prototype, "machinePoolId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsEnum)(types_1.CloudProvider),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], TerminateMachineResourceBatchRequestPayload.prototype, "cloudProvider", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => types_1.AWSProviderSettings),
|
|
35
|
+
__metadata("design:type", Object)
|
|
36
|
+
], TerminateMachineResourceBatchRequestPayload.prototype, "cloudProviderSettings", void 0);
|
|
37
|
+
class TerminateMachineResourceBatchRequest extends ludeo_event_1.LudeoEvent {
|
|
38
|
+
constructor(payload, context) {
|
|
39
|
+
super(TerminateMachineResourceBatchRequest.EVENT_NAME);
|
|
40
|
+
this.payload = payload;
|
|
41
|
+
this.context = context;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.TerminateMachineResourceBatchRequest = TerminateMachineResourceBatchRequest;
|
|
45
|
+
TerminateMachineResourceBatchRequest.EVENT_NAME = "cloud-pools.terminate-machine-resource-batch-request";
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => contexts_1.CloudResourceContext),
|
|
48
|
+
__metadata("design:type", contexts_1.CloudResourceContext)
|
|
49
|
+
], TerminateMachineResourceBatchRequest.prototype, "context", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => TerminateMachineResourceBatchRequestPayload),
|
|
52
|
+
__metadata("design:type", TerminateMachineResourceBatchRequestPayload)
|
|
53
|
+
], TerminateMachineResourceBatchRequest.prototype, "payload", void 0);
|
|
54
|
+
//# sourceMappingURL=terminate-machine-resource-batch-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminate-machine-resource-batch-request.js","sourceRoot":"","sources":["../../../src/v3/events/terminate-machine-resource-batch-request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0D;AAE1D,0CAAmD;AACnD,yDAAqD;AACrD,oGAAqF;AACrF,oCAIkB;AAElB,MAAa,2CAA2C;CAYvD;AAZD,kGAYC;AAVC;IADC,IAAA,yBAAO,GAAE;;uFACmB;AAG7B;IADC,IAAA,wBAAM,GAAE;;kFACa;AAGtB;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;kFACO;AAG7B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,2BAAmB,CAAC;;0FACD;AAG/C,MAAa,oCAAqC,SAAQ,wBAAU;IAIlE,YACE,OAAoD,EACpD,OAA6B;QAE7B,KAAK,CAAC,oCAAoC,CAAC,UAAU,CAAC,CAAC;QACvD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAXH,oFAkBC;AAjBiB,+CAAU,GACxB,sDAAsD,CAAC;AAYzD;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,+BAAoB,CAAC;8BACtC,+BAAoB;qEAAC;AAG9B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,2CAA2C,CAAC;8BAC7D,2CAA2C;qEAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PoolContext } from "../../v2/contexts";
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
export declare class TerminateMachinesRequestPayload {
|
|
4
|
+
poolId: string;
|
|
5
|
+
quantity: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class TerminateMachinesRequest extends LudeoEvent {
|
|
8
|
+
static readonly EVENT_NAME = "cloud-pools.terminate-machines-request";
|
|
9
|
+
constructor(payload: TerminateMachinesRequestPayload, context: PoolContext);
|
|
10
|
+
context: PoolContext;
|
|
11
|
+
payload: TerminateMachinesRequestPayload;
|
|
12
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TerminateMachinesRequest = exports.TerminateMachinesRequestPayload = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const contexts_1 = require("../../v2/contexts");
|
|
15
|
+
const ludeo_event_1 = require("../../infra/ludeo-event");
|
|
16
|
+
const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
|
|
17
|
+
class TerminateMachinesRequestPayload {
|
|
18
|
+
}
|
|
19
|
+
exports.TerminateMachinesRequestPayload = TerminateMachinesRequestPayload;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsUUID)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], TerminateMachinesRequestPayload.prototype, "poolId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsNumber)(),
|
|
26
|
+
__metadata("design:type", Number)
|
|
27
|
+
], TerminateMachinesRequestPayload.prototype, "quantity", void 0);
|
|
28
|
+
class TerminateMachinesRequest extends ludeo_event_1.LudeoEvent {
|
|
29
|
+
constructor(payload, context) {
|
|
30
|
+
super(TerminateMachinesRequest.EVENT_NAME);
|
|
31
|
+
this.payload = payload;
|
|
32
|
+
this.context = context;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.TerminateMachinesRequest = TerminateMachinesRequest;
|
|
36
|
+
TerminateMachinesRequest.EVENT_NAME = "cloud-pools.terminate-machines-request";
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => contexts_1.PoolContext),
|
|
39
|
+
__metadata("design:type", contexts_1.PoolContext)
|
|
40
|
+
], TerminateMachinesRequest.prototype, "context", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => TerminateMachinesRequestPayload),
|
|
43
|
+
__metadata("design:type", TerminateMachinesRequestPayload)
|
|
44
|
+
], TerminateMachinesRequest.prototype, "payload", void 0);
|
|
45
|
+
//# sourceMappingURL=terminate-machines-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminate-machines-request.js","sourceRoot":"","sources":["../../../src/v3/events/terminate-machines-request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmD;AAEnD,gDAAgD;AAChD,yDAAqD;AACrD,oGAAqF;AAErF,MAAa,+BAA+B;CAM3C;AAND,0EAMC;AAJC;IADC,IAAA,wBAAM,GAAE;;+DACM;AAGf;IADC,IAAA,0BAAQ,GAAE;;iEACM;AAGnB,MAAa,wBAAyB,SAAQ,wBAAU;IAGtD,YAAY,OAAwC,EAAE,OAAoB;QACxE,KAAK,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAPH,4DAcC;AAbiB,mCAAU,GAAG,wCAAwC,CAAC;AAStE;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,sBAAW,CAAC;8BAC7B,sBAAW;yDAAC;AAGrB;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,+BAA+B,CAAC;8BACjD,+BAA+B;yDAAC"}
|
package/dist/v3/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v3/index.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AACnC,mCAAiC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { GameCast } from "@ludeo/aws-gamecast-sdk";
|
|
2
|
+
export declare class AWSRequestData {
|
|
3
|
+
signalRequest: string;
|
|
4
|
+
}
|
|
5
|
+
export type CloudProviderRequest = AWSRequestData;
|
|
6
|
+
export declare enum CloudProvider {
|
|
7
|
+
AWS = "aws"
|
|
8
|
+
}
|
|
9
|
+
export declare class AWSProviderSettings {
|
|
10
|
+
streamGroupId: GameCast.Identifier;
|
|
11
|
+
additionalEnvironmentVariables?: GameCast.EnvironmentVariables;
|
|
12
|
+
protocol?: GameCast.Protocol;
|
|
13
|
+
connectionTimeoutSeconds?: GameCast.ConnectionTimeoutSeconds;
|
|
14
|
+
sessionLengthSeconds?: GameCast.SessionLengthSeconds;
|
|
15
|
+
applicationIdentifier?: GameCast.Identifier;
|
|
16
|
+
region?: string;
|
|
17
|
+
}
|
|
18
|
+
export type CloudProviderSettings = AWSProviderSettings;
|
|
19
|
+
export declare class AwsAllocationData {
|
|
20
|
+
streamGroupId: string;
|
|
21
|
+
streamSessionId: string;
|
|
22
|
+
signalResponse: string;
|
|
23
|
+
}
|
|
24
|
+
export type CloudProviderAllocationData = AwsAllocationData;
|
|
25
|
+
export declare class AWSResourceProviderSettings {
|
|
26
|
+
streamSessionId: string;
|
|
27
|
+
streamGroupId?: string;
|
|
28
|
+
cloudProvider?: CloudProvider;
|
|
29
|
+
}
|
|
30
|
+
export type CloudResourceProviderSettings = AWSResourceProviderSettings;
|
|
31
|
+
export declare class AWSCreationResponse {
|
|
32
|
+
streamSessionId: string;
|
|
33
|
+
}
|
|
34
|
+
export type CreationResponse = AWSCreationResponse;
|
|
35
|
+
export declare class AllocationRequestData {
|
|
36
|
+
authToken?: string;
|
|
37
|
+
appToken?: string;
|
|
38
|
+
cloudProviderRequest: CloudProviderRequest;
|
|
39
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AllocationRequestData = exports.AWSCreationResponse = exports.AWSResourceProviderSettings = exports.AwsAllocationData = exports.AWSProviderSettings = exports.CloudProvider = exports.AWSRequestData = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const decorators_1 = require("../../decorators");
|
|
15
|
+
class AWSRequestData {
|
|
16
|
+
}
|
|
17
|
+
exports.AWSRequestData = AWSRequestData;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], AWSRequestData.prototype, "signalRequest", void 0);
|
|
23
|
+
var CloudProvider;
|
|
24
|
+
(function (CloudProvider) {
|
|
25
|
+
CloudProvider["AWS"] = "aws";
|
|
26
|
+
})(CloudProvider || (exports.CloudProvider = CloudProvider = {}));
|
|
27
|
+
class AWSProviderSettings {
|
|
28
|
+
}
|
|
29
|
+
exports.AWSProviderSettings = AWSProviderSettings;
|
|
30
|
+
class AwsAllocationData {
|
|
31
|
+
}
|
|
32
|
+
exports.AwsAllocationData = AwsAllocationData;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], AwsAllocationData.prototype, "streamGroupId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsString)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], AwsAllocationData.prototype, "streamSessionId", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], AwsAllocationData.prototype, "signalResponse", void 0);
|
|
45
|
+
class AWSResourceProviderSettings {
|
|
46
|
+
}
|
|
47
|
+
exports.AWSResourceProviderSettings = AWSResourceProviderSettings;
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsString)(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], AWSResourceProviderSettings.prototype, "streamSessionId", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_validator_1.IsOptional)(),
|
|
54
|
+
(0, class_validator_1.IsString)(),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], AWSResourceProviderSettings.prototype, "streamGroupId", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_validator_1.IsEnum)(CloudProvider),
|
|
59
|
+
(0, class_validator_1.IsOptional)(),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], AWSResourceProviderSettings.prototype, "cloudProvider", void 0);
|
|
62
|
+
class AWSCreationResponse {
|
|
63
|
+
}
|
|
64
|
+
exports.AWSCreationResponse = AWSCreationResponse;
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, class_validator_1.IsString)(),
|
|
67
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], AWSCreationResponse.prototype, "streamSessionId", void 0);
|
|
70
|
+
class AllocationRequestData {
|
|
71
|
+
}
|
|
72
|
+
exports.AllocationRequestData = AllocationRequestData;
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_validator_1.IsUUID)(),
|
|
75
|
+
(0, class_validator_1.IsOptional)(),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], AllocationRequestData.prototype, "authToken", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsOptional)(),
|
|
80
|
+
(0, class_validator_1.IsUUID)(),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], AllocationRequestData.prototype, "appToken", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, decorators_1.ValidateNestedType)(() => AWSRequestData),
|
|
85
|
+
(0, class_validator_1.IsDefined)(),
|
|
86
|
+
__metadata("design:type", Object)
|
|
87
|
+
], AllocationRequestData.prototype, "cloudProviderRequest", void 0);
|
|
88
|
+
//# sourceMappingURL=cloud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud.js","sourceRoot":"","sources":["../../../src/v3/types/cloud.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qDAOyB;AACzB,iDAAsD;AAEtD,MAAa,cAAc;CAI1B;AAJD,wCAIC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qDACS;AAKxB,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,4BAAW,CAAA;AACb,CAAC,EAFW,aAAa,6BAAb,aAAa,QAExB;AAED,MAAa,mBAAmB;CAQ/B;AARD,kDAQC;AAID,MAAa,iBAAiB;CAS7B;AATD,8CASC;AAPC;IADC,IAAA,0BAAQ,GAAE;;wDACW;AAGtB;IADC,IAAA,0BAAQ,GAAE;;0DACa;AAGxB;IADC,IAAA,0BAAQ,GAAE;;yDACY;AAKzB,MAAa,2BAA2B;CAWvC;AAXD,kEAWC;AATC;IADC,IAAA,0BAAQ,GAAE;;oEACa;AAIxB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kEACY;AAIvB;IAFC,IAAA,wBAAM,EAAC,aAAa,CAAC;IACrB,IAAA,4BAAU,GAAE;;kEACiB;AAKhC,MAAa,mBAAmB;CAI/B;AAJD,kDAIC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;4DACW;AAK1B,MAAa,qBAAqB;CAYjC;AAZD,sDAYC;AATC;IAFC,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;;wDACM;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;uDACS;AAIlB;IAFC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,cAAc,CAAC;IACxC,IAAA,2BAAS,GAAE;;mEAC+B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cloud"), exports);
|
|
18
|
+
__exportStar(require("./pools"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v3/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,0CAAwB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { AWSResourceProviderSettings, CloudProvider, CloudProviderSettings } from "./cloud";
|
|
2
|
+
export declare enum CloudResourceStatus {
|
|
3
|
+
Allocated = "allocated",
|
|
4
|
+
Available = "available",
|
|
5
|
+
Creating = "creating",
|
|
6
|
+
Created = "created",
|
|
7
|
+
Allocating = "allocating",
|
|
8
|
+
Error = "error",
|
|
9
|
+
Terminating = "terminating",
|
|
10
|
+
Terminated = "terminated"
|
|
11
|
+
}
|
|
12
|
+
export declare enum CloudPoolStatus {
|
|
13
|
+
Active = "active",
|
|
14
|
+
Scaling = "scaling",
|
|
15
|
+
Terminated = "terminated"
|
|
16
|
+
}
|
|
17
|
+
export declare class PoolScaleConfiguration {
|
|
18
|
+
size: number;
|
|
19
|
+
}
|
|
20
|
+
export declare enum CloudPoolType {
|
|
21
|
+
GAME = "game",
|
|
22
|
+
MACHINE = "machine"
|
|
23
|
+
}
|
|
24
|
+
export declare class BaseCloudPoolConfiguration {
|
|
25
|
+
providerSettings?: CloudProviderSettings;
|
|
26
|
+
cloudProvider: CloudProvider;
|
|
27
|
+
poolId: string;
|
|
28
|
+
poolScaleConfiguration: PoolScaleConfiguration;
|
|
29
|
+
type: CloudPoolType;
|
|
30
|
+
}
|
|
31
|
+
export declare class GamePoolConfiguration extends BaseCloudPoolConfiguration {
|
|
32
|
+
type: CloudPoolType.GAME;
|
|
33
|
+
gameId: string;
|
|
34
|
+
}
|
|
35
|
+
export declare class MachinePoolConfiguration extends BaseCloudPoolConfiguration {
|
|
36
|
+
type: CloudPoolType.MACHINE;
|
|
37
|
+
}
|
|
38
|
+
export type CloudResourceMapValue = {
|
|
39
|
+
status: CloudResourceStatus;
|
|
40
|
+
updatedAt?: number;
|
|
41
|
+
};
|
|
42
|
+
export type CloudResourcesMap = Record<string, CloudResourceMapValue>;
|
|
43
|
+
export type CloudResourcesStatusMap = Record<CloudResourceStatus, number>;
|
|
44
|
+
export declare class CloudPool {
|
|
45
|
+
id: string;
|
|
46
|
+
type: CloudPoolType;
|
|
47
|
+
status: CloudPoolStatus;
|
|
48
|
+
createdAt: number;
|
|
49
|
+
updatedAt?: number;
|
|
50
|
+
config: BaseCloudPoolConfiguration;
|
|
51
|
+
resources?: CloudResourcesMap;
|
|
52
|
+
}
|
|
53
|
+
export declare class CloudResource {
|
|
54
|
+
id: string;
|
|
55
|
+
status: CloudResourceStatus;
|
|
56
|
+
createdAt: number;
|
|
57
|
+
updatedAt?: number;
|
|
58
|
+
settings?: AWSResourceProviderSettings;
|
|
59
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CloudResource = exports.CloudPool = exports.MachinePoolConfiguration = exports.GamePoolConfiguration = exports.BaseCloudPoolConfiguration = exports.CloudPoolType = exports.PoolScaleConfiguration = exports.CloudPoolStatus = exports.CloudResourceStatus = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const cloud_1 = require("./cloud");
|
|
15
|
+
const decorators_1 = require("../../decorators");
|
|
16
|
+
var CloudResourceStatus;
|
|
17
|
+
(function (CloudResourceStatus) {
|
|
18
|
+
CloudResourceStatus["Allocated"] = "allocated";
|
|
19
|
+
CloudResourceStatus["Available"] = "available";
|
|
20
|
+
CloudResourceStatus["Creating"] = "creating";
|
|
21
|
+
CloudResourceStatus["Created"] = "created";
|
|
22
|
+
CloudResourceStatus["Allocating"] = "allocating";
|
|
23
|
+
CloudResourceStatus["Error"] = "error";
|
|
24
|
+
CloudResourceStatus["Terminating"] = "terminating";
|
|
25
|
+
CloudResourceStatus["Terminated"] = "terminated";
|
|
26
|
+
})(CloudResourceStatus || (exports.CloudResourceStatus = CloudResourceStatus = {}));
|
|
27
|
+
var CloudPoolStatus;
|
|
28
|
+
(function (CloudPoolStatus) {
|
|
29
|
+
CloudPoolStatus["Active"] = "active";
|
|
30
|
+
CloudPoolStatus["Scaling"] = "scaling";
|
|
31
|
+
CloudPoolStatus["Terminated"] = "terminated";
|
|
32
|
+
})(CloudPoolStatus || (exports.CloudPoolStatus = CloudPoolStatus = {}));
|
|
33
|
+
class PoolScaleConfiguration {
|
|
34
|
+
}
|
|
35
|
+
exports.PoolScaleConfiguration = PoolScaleConfiguration;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsNumber)(),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], PoolScaleConfiguration.prototype, "size", void 0);
|
|
40
|
+
var CloudPoolType;
|
|
41
|
+
(function (CloudPoolType) {
|
|
42
|
+
CloudPoolType["GAME"] = "game";
|
|
43
|
+
CloudPoolType["MACHINE"] = "machine";
|
|
44
|
+
})(CloudPoolType || (exports.CloudPoolType = CloudPoolType = {}));
|
|
45
|
+
class BaseCloudPoolConfiguration {
|
|
46
|
+
}
|
|
47
|
+
exports.BaseCloudPoolConfiguration = BaseCloudPoolConfiguration;
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_validator_1.IsEnum)(cloud_1.CloudProvider),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], BaseCloudPoolConfiguration.prototype, "cloudProvider", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_validator_1.IsUUID)(),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], BaseCloudPoolConfiguration.prototype, "poolId", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, decorators_1.ValidateNestedType)(() => PoolScaleConfiguration),
|
|
58
|
+
__metadata("design:type", PoolScaleConfiguration)
|
|
59
|
+
], BaseCloudPoolConfiguration.prototype, "poolScaleConfiguration", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, class_validator_1.IsEnum)(CloudPoolType),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], BaseCloudPoolConfiguration.prototype, "type", void 0);
|
|
64
|
+
class GamePoolConfiguration extends BaseCloudPoolConfiguration {
|
|
65
|
+
}
|
|
66
|
+
exports.GamePoolConfiguration = GamePoolConfiguration;
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, class_validator_1.IsEnum)(CloudPoolType),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], GamePoolConfiguration.prototype, "type", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsUUID)(),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], GamePoolConfiguration.prototype, "gameId", void 0);
|
|
75
|
+
class MachinePoolConfiguration extends BaseCloudPoolConfiguration {
|
|
76
|
+
}
|
|
77
|
+
exports.MachinePoolConfiguration = MachinePoolConfiguration;
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsEnum)(CloudPoolType),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], MachinePoolConfiguration.prototype, "type", void 0);
|
|
82
|
+
class CloudPool {
|
|
83
|
+
}
|
|
84
|
+
exports.CloudPool = CloudPool;
|
|
85
|
+
class CloudResource {
|
|
86
|
+
}
|
|
87
|
+
exports.CloudResource = CloudResource;
|
|
88
|
+
//# sourceMappingURL=pools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pools.js","sourceRoot":"","sources":["../../../src/v3/types/pools.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2D;AAC3D,mCAIiB;AACjB,iDAAsD;AAEtD,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;IACvB,8CAAuB,CAAA;IACvB,4CAAqB,CAAA;IACrB,0CAAmB,CAAA;IACnB,gDAAyB,CAAA;IACzB,sCAAe,CAAA;IACf,kDAA2B,CAAA;IAC3B,gDAAyB,CAAA;AAC3B,CAAC,EATW,mBAAmB,mCAAnB,mBAAmB,QAS9B;AAED,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,4CAAyB,CAAA;AAC3B,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B;AAED,MAAa,sBAAsB;CAGlC;AAHD,wDAGC;AADC;IADC,IAAA,0BAAQ,GAAE;;oDACE;AAGf,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,oCAAmB,CAAA;AACrB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED,MAAa,0BAA0B;CActC;AAdD,gEAcC;AAVC;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;iEACO;AAG7B;IADC,IAAA,wBAAM,GAAE;;0DACM;AAGf;IADC,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC;8BACzB,sBAAsB;0EAAC;AAG/C;IADC,IAAA,wBAAM,EAAC,aAAa,CAAC;;wDACF;AAGtB,MAAa,qBAAsB,SAAQ,0BAA0B;CAMpE;AAND,sDAMC;AAJC;IADC,IAAA,wBAAM,EAAC,aAAa,CAAC;;mDACG;AAGzB;IADC,IAAA,wBAAM,GAAE;;qDACM;AAGjB,MAAa,wBAAyB,SAAQ,0BAA0B;CAGvE;AAHD,4DAGC;AADC;IADC,IAAA,wBAAM,EAAC,aAAa,CAAC;;sDACM;AAY9B,MAAa,SAAS;CAQrB;AARD,8BAQC;AAED,MAAa,aAAa;CAMzB;AAND,sCAMC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IsEnum, IsOptional, IsString, IsUUID } from "class-validator";
|
|
2
|
+
import { CloudProvider } from "../types/cloud";
|
|
3
|
+
|
|
4
|
+
export class CloudResourceContext {
|
|
5
|
+
@IsUUID()
|
|
6
|
+
resourceId: string;
|
|
7
|
+
|
|
8
|
+
@IsUUID()
|
|
9
|
+
poolId: string;
|
|
10
|
+
|
|
11
|
+
@IsString()
|
|
12
|
+
@IsOptional()
|
|
13
|
+
streamGroupId?: string;
|
|
14
|
+
|
|
15
|
+
@IsString()
|
|
16
|
+
@IsOptional()
|
|
17
|
+
streamSessionId?: string;
|
|
18
|
+
|
|
19
|
+
@IsEnum(CloudProvider)
|
|
20
|
+
cloudProvider: CloudProvider;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./cloud-resource-context";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IsUUID } from "class-validator";
|
|
2
|
+
|
|
3
|
+
import { AllocationRequestData } from "../types";
|
|
4
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
5
|
+
import { CloudSessionContext } from "../../v2/contexts";
|
|
6
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
7
|
+
|
|
8
|
+
export class AllocateGameRequestPayload {
|
|
9
|
+
@IsUUID()
|
|
10
|
+
gameResourceId: string;
|
|
11
|
+
|
|
12
|
+
@IsUUID()
|
|
13
|
+
gamePoolId: string;
|
|
14
|
+
|
|
15
|
+
@ValidateNestedType(() => AllocationRequestData)
|
|
16
|
+
requestData: AllocationRequestData;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class AllocateGameRequest extends LudeoEvent {
|
|
20
|
+
static readonly EVENT_NAME = "cloud-session-allocator.allocate-game-request";
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
payload: AllocateGameRequestPayload,
|
|
24
|
+
context: CloudSessionContext
|
|
25
|
+
) {
|
|
26
|
+
super(AllocateGameRequest.EVENT_NAME);
|
|
27
|
+
this.payload = payload;
|
|
28
|
+
this.context = context;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@ValidateNestedType(() => CloudSessionContext)
|
|
32
|
+
context: CloudSessionContext;
|
|
33
|
+
|
|
34
|
+
@ValidateNestedType(() => AllocateGameRequestPayload)
|
|
35
|
+
payload: AllocateGameRequestPayload;
|
|
36
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { IsUUID, IsEnum } from "class-validator";
|
|
2
|
+
|
|
3
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
4
|
+
import { CloudSessionContext } from "../../v2/contexts";
|
|
5
|
+
import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
|
|
6
|
+
import {
|
|
7
|
+
AWSProviderSettings,
|
|
8
|
+
CloudProviderSettings,
|
|
9
|
+
CloudProvider,
|
|
10
|
+
AllocationRequestData,
|
|
11
|
+
} from "../types";
|
|
12
|
+
|
|
13
|
+
export class AllocateGameResourceRequestPayload {
|
|
14
|
+
@IsUUID()
|
|
15
|
+
gameResourceId: string;
|
|
16
|
+
|
|
17
|
+
@IsUUID()
|
|
18
|
+
gamePoolId: string;
|
|
19
|
+
|
|
20
|
+
@ValidateNestedType(() => AWSProviderSettings)
|
|
21
|
+
providerSettings: CloudProviderSettings;
|
|
22
|
+
|
|
23
|
+
@IsEnum(CloudProvider)
|
|
24
|
+
cloudProvider: CloudProvider;
|
|
25
|
+
|
|
26
|
+
@IsUUID()
|
|
27
|
+
cloudToken: string;
|
|
28
|
+
|
|
29
|
+
@ValidateNestedType(() => AllocationRequestData)
|
|
30
|
+
requestData: AllocationRequestData;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class AllocateGameResourceRequest extends LudeoEvent {
|
|
34
|
+
static readonly EVENT_NAME = "cloud-pools.allocate-game-resource-request";
|
|
35
|
+
|
|
36
|
+
constructor(
|
|
37
|
+
payload: AllocateGameResourceRequestPayload,
|
|
38
|
+
context: CloudSessionContext
|
|
39
|
+
) {
|
|
40
|
+
super(AllocateGameResourceRequest.EVENT_NAME);
|
|
41
|
+
this.payload = payload;
|
|
42
|
+
this.context = context;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@ValidateNestedType(() => CloudSessionContext)
|
|
46
|
+
context: CloudSessionContext;
|
|
47
|
+
|
|
48
|
+
@ValidateNestedType(() => AllocateGameResourceRequestPayload)
|
|
49
|
+
payload: AllocateGameResourceRequestPayload;
|
|
50
|
+
}
|