@ludeo/cloud-common 1.1.7 → 1.1.8
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/decorators/validate-nested-type.decorator.d.ts +2 -1
- package/dist/decorators/validate-nested-type.decorator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/v3/contexts/cloud-pool-context.d.ts +6 -0
- package/dist/v3/contexts/cloud-pool-context.js +31 -0
- package/dist/v3/contexts/cloud-pool-context.js.map +1 -0
- package/dist/v3/contexts/cloud-session-context.d.ts +14 -0
- package/dist/v3/contexts/cloud-session-context.js +71 -0
- package/dist/v3/contexts/cloud-session-context.js.map +1 -0
- package/dist/v3/contexts/getCloudContextType.d.ts +4 -0
- package/dist/v3/contexts/getCloudContextType.js +17 -0
- package/dist/v3/contexts/getCloudContextType.js.map +1 -0
- package/dist/v3/contexts/getCloudContextType.spec.d.ts +1 -0
- package/dist/v3/contexts/getCloudContextType.spec.js +95 -0
- package/dist/v3/contexts/getCloudContextType.spec.js.map +1 -0
- package/dist/v3/contexts/index.d.ts +3 -0
- package/dist/v3/contexts/index.js +3 -0
- package/dist/v3/contexts/index.js.map +1 -1
- package/dist/v3/events/deallocate-machine-request.d.ts +15 -0
- package/dist/v3/events/deallocate-machine-request.js +53 -0
- package/dist/v3/events/deallocate-machine-request.js.map +1 -0
- package/dist/v3/events/game-resource-allocated-response.d.ts +14 -0
- package/dist/v3/events/game-resource-allocated-response.js +50 -0
- package/dist/v3/events/game-resource-allocated-response.js.map +1 -0
- package/dist/v3/events/game-resource-allocation-failed-response.d.ts +13 -0
- package/dist/v3/events/game-resource-allocation-failed-response.js +49 -0
- package/dist/v3/events/game-resource-allocation-failed-response.js.map +1 -0
- package/dist/v3/events/game-resource-created-response.d.ts +15 -0
- package/dist/v3/events/game-resource-created-response.js +54 -0
- package/dist/v3/events/game-resource-created-response.js.map +1 -0
- package/dist/v3/events/game-resource-creation-failed-response.d.ts +13 -0
- package/dist/v3/events/game-resource-creation-failed-response.js +49 -0
- package/dist/v3/events/game-resource-creation-failed-response.js.map +1 -0
- package/dist/v3/events/game-resource-terminated-response.d.ts +12 -0
- package/dist/v3/events/game-resource-terminated-response.js +45 -0
- package/dist/v3/events/game-resource-terminated-response.js.map +1 -0
- package/dist/v3/events/game-resource-termination-failed-response.d.ts +13 -0
- package/dist/v3/events/game-resource-termination-failed-response.js +49 -0
- package/dist/v3/events/game-resource-termination-failed-response.js.map +1 -0
- package/dist/v3/events/index.d.ts +12 -4
- package/dist/v3/events/index.js +12 -4
- package/dist/v3/events/index.js.map +1 -1
- package/dist/v3/events/machine-allocation-failed-response.d.ts +14 -0
- package/dist/v3/events/machine-allocation-failed-response.js +53 -0
- package/dist/v3/events/machine-allocation-failed-response.js.map +1 -0
- package/dist/v3/events/machine-deallocated-response.d.ts +15 -0
- package/dist/v3/events/machine-deallocated-response.js +53 -0
- package/dist/v3/events/machine-deallocated-response.js.map +1 -0
- package/dist/v3/events/machine-deallocation-failed-response.d.ts +16 -0
- package/dist/v3/events/machine-deallocation-failed-response.js +57 -0
- package/dist/v3/events/machine-deallocation-failed-response.js.map +1 -0
- package/dist/v3/events/machine-resource-created-response.d.ts +12 -0
- package/dist/v3/events/machine-resource-created-response.js +45 -0
- package/dist/v3/events/machine-resource-created-response.js.map +1 -0
- package/dist/v3/events/machine-resource-creation-failed-response.d.ts +13 -0
- package/dist/v3/events/machine-resource-creation-failed-response.js +49 -0
- package/dist/v3/events/machine-resource-creation-failed-response.js.map +1 -0
- package/package.json +1 -1
- package/src/decorators/validate-nested-type.decorator.ts +4 -2
- package/src/v3/contexts/cloud-pool-context.ts +14 -0
- package/src/v3/contexts/cloud-session-context.ts +46 -0
- package/src/v3/contexts/getCloudContextType.spec.ts +102 -0
- package/src/v3/contexts/getCloudContextType.ts +16 -0
- package/src/v3/contexts/index.ts +3 -0
- package/src/v3/events/deallocate-machine-request.ts +41 -0
- package/src/v3/events/{game-allocated-response.ts → game-resource-allocated-response.ts} +4 -3
- package/src/v3/events/game-resource-allocation-failed-response.ts +36 -0
- package/src/v3/events/{game-created-response.ts → game-resource-created-response.ts} +3 -3
- package/src/v3/events/game-resource-creation-failed-response.ts +36 -0
- package/src/v3/events/{game-terminated-response.ts → game-resource-terminated-response.ts} +4 -3
- package/src/v3/events/game-resource-termination-failed-response.ts +36 -0
- package/src/v3/events/index.ts +12 -4
- package/src/v3/events/machine-allocation-failed-response.ts +39 -0
- package/src/v3/events/machine-deallocated-response.ts +39 -0
- package/src/v3/events/machine-deallocation-failed-response.ts +43 -0
- package/src/v3/events/{machine-created-response.ts → machine-resource-created-response.ts} +8 -7
- package/src/v3/events/machine-resource-creation-failed-response.ts +36 -0
|
@@ -0,0 +1,31 @@
|
|
|
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.CloudPoolContext = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const types_1 = require("../types");
|
|
15
|
+
class CloudPoolContext {
|
|
16
|
+
}
|
|
17
|
+
exports.CloudPoolContext = CloudPoolContext;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsEnum)(types_1.CloudProvider),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], CloudPoolContext.prototype, "cloudProvider", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsUUID)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], CloudPoolContext.prototype, "poolId", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], CloudPoolContext.prototype, "streamGroupId", void 0);
|
|
31
|
+
//# sourceMappingURL=cloud-pool-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-pool-context.js","sourceRoot":"","sources":["../../../src/v3/contexts/cloud-pool-context.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuE;AACvE,oCAAyC;AAEzC,MAAa,gBAAgB;CAU5B;AAVD,4CAUC;AARC;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;uDACO;AAG7B;IADC,IAAA,wBAAM,GAAE;;gDACM;AAIf;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uDACU"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CloudProvider } from "../types";
|
|
2
|
+
export declare class CloudSessionContext {
|
|
3
|
+
allocationRequestId?: string;
|
|
4
|
+
clientRequestId?: string;
|
|
5
|
+
cloudSessionId: string;
|
|
6
|
+
userId?: string;
|
|
7
|
+
gameId?: string;
|
|
8
|
+
ludeoId?: string;
|
|
9
|
+
poolId?: string;
|
|
10
|
+
cloudProvider: CloudProvider;
|
|
11
|
+
resourceId?: string;
|
|
12
|
+
streamGroupId?: string;
|
|
13
|
+
streamSessionId?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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.CloudSessionContext = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const types_1 = require("../types");
|
|
15
|
+
class CloudSessionContext {
|
|
16
|
+
}
|
|
17
|
+
exports.CloudSessionContext = CloudSessionContext;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsOptional)(),
|
|
20
|
+
(0, class_validator_1.IsUUID)(),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], CloudSessionContext.prototype, "allocationRequestId", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
(0, class_validator_1.IsUUID)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], CloudSessionContext.prototype, "clientRequestId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsUUID)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], CloudSessionContext.prototype, "cloudSessionId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
(0, class_validator_1.IsUUID)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CloudSessionContext.prototype, "userId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsUUID)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], CloudSessionContext.prototype, "gameId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsUUID)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], CloudSessionContext.prototype, "ludeoId", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
(0, class_validator_1.IsUUID)(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], CloudSessionContext.prototype, "poolId", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_validator_1.IsEnum)(types_1.CloudProvider),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], CloudSessionContext.prototype, "cloudProvider", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_validator_1.IsOptional)(),
|
|
58
|
+
(0, class_validator_1.IsUUID)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], CloudSessionContext.prototype, "resourceId", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, class_validator_1.IsOptional)(),
|
|
63
|
+
(0, class_validator_1.IsString)(),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], CloudSessionContext.prototype, "streamGroupId", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsOptional)(),
|
|
68
|
+
(0, class_validator_1.IsString)(),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], CloudSessionContext.prototype, "streamSessionId", void 0);
|
|
71
|
+
//# sourceMappingURL=cloud-session-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-session-context.js","sourceRoot":"","sources":["../../../src/v3/contexts/cloud-session-context.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuE;AACvE,oCAAyC;AAEzC,MAAa,mBAAmB;CA0C/B;AA1CD,kDA0CC;AAvCC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;gEACoB;AAI7B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;4DACgB;AAGzB;IADC,IAAA,wBAAM,GAAE;;2DACc;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;mDACO;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;mDACO;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;oDACQ;AAIjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;mDACO;AAGhB;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;0DACO;AAI7B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;uDACW;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0DACY;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;4DACc"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TypeHelpOptions } from "class-transformer";
|
|
2
|
+
import { CloudPoolContext } from "./cloud-pool-context";
|
|
3
|
+
import { CloudSessionContext } from "./cloud-session-context";
|
|
4
|
+
export declare const getCloudContextType: ({ object }: TypeHelpOptions) => typeof CloudSessionContext | typeof CloudPoolContext;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCloudContextType = void 0;
|
|
4
|
+
const cloud_pool_context_1 = require("./cloud-pool-context");
|
|
5
|
+
const cloud_resource_context_1 = require("./cloud-resource-context");
|
|
6
|
+
const cloud_session_context_1 = require("./cloud-session-context");
|
|
7
|
+
const getCloudContextType = ({ object }) => {
|
|
8
|
+
if ("cloudSessionId" in object) {
|
|
9
|
+
return cloud_session_context_1.CloudSessionContext;
|
|
10
|
+
}
|
|
11
|
+
if ("resourceId" in object) {
|
|
12
|
+
return cloud_resource_context_1.CloudResourceContext;
|
|
13
|
+
}
|
|
14
|
+
return cloud_pool_context_1.CloudPoolContext;
|
|
15
|
+
};
|
|
16
|
+
exports.getCloudContextType = getCloudContextType;
|
|
17
|
+
//# sourceMappingURL=getCloudContextType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCloudContextType.js","sourceRoot":"","sources":["../../../src/v3/contexts/getCloudContextType.ts"],"names":[],"mappings":";;;AACA,6DAAwD;AACxD,qEAAgE;AAChE,mEAA8D;AAEvD,MAAM,mBAAmB,GAAG,CAAC,EAAE,MAAM,EAAmB,EAAE,EAAE;IACjE,IAAI,gBAAgB,IAAI,MAAM,EAAE,CAAC;QAC/B,OAAO,2CAAmB,CAAC;IAC7B,CAAC;IAED,IAAI,YAAY,IAAI,MAAM,EAAE,CAAC;QAC3B,OAAO,6CAAoB,CAAC;IAC9B,CAAC;IAED,OAAO,qCAAgB,CAAC;AAC1B,CAAC,CAAC;AAVW,QAAA,mBAAmB,uBAU9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
const class_validator_1 = require("class-validator");
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const decorators_1 = require("../../decorators");
|
|
15
|
+
const getCloudContextType_1 = require("./getCloudContextType");
|
|
16
|
+
const cloud_pool_context_1 = require("../contexts/cloud-pool-context");
|
|
17
|
+
const cloud_session_context_1 = require("../contexts/cloud-session-context");
|
|
18
|
+
const cloud_resource_context_1 = require("../contexts/cloud-resource-context");
|
|
19
|
+
describe("getContextType", () => {
|
|
20
|
+
it("should return cloud session context", () => {
|
|
21
|
+
const context = {
|
|
22
|
+
cloudSessionId: "cloudSessionId",
|
|
23
|
+
};
|
|
24
|
+
expect((0, getCloudContextType_1.getCloudContextType)({ object: context })).toBe(cloud_session_context_1.CloudSessionContext);
|
|
25
|
+
});
|
|
26
|
+
it("should return cloud resource context", () => {
|
|
27
|
+
const context = {
|
|
28
|
+
resourceId: "resourceId",
|
|
29
|
+
};
|
|
30
|
+
expect((0, getCloudContextType_1.getCloudContextType)({ object: context })).toBe(cloud_resource_context_1.CloudResourceContext);
|
|
31
|
+
});
|
|
32
|
+
it("should return cloud pool context", () => {
|
|
33
|
+
const context = {
|
|
34
|
+
poolId: "poolId",
|
|
35
|
+
};
|
|
36
|
+
expect((0, getCloudContextType_1.getCloudContextType)({ object: context })).toBe(cloud_pool_context_1.CloudPoolContext);
|
|
37
|
+
});
|
|
38
|
+
describe("class validator", () => {
|
|
39
|
+
class Context {
|
|
40
|
+
constructor(context) {
|
|
41
|
+
this.context = context;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, decorators_1.ValidateNestedType)(getCloudContextType_1.getCloudContextType),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], Context.prototype, "context", void 0);
|
|
48
|
+
it("invalid cloud session context", async () => {
|
|
49
|
+
const invalidCloudSessionContext = {
|
|
50
|
+
cloudSessionId: "BA7C9AEE-955D-4155-9220-A4BCB0F0A106",
|
|
51
|
+
poolId: "E738D912-8D00-4E3B-9F0A-A448C9FEAA73",
|
|
52
|
+
cloudProvider: "invalid",
|
|
53
|
+
};
|
|
54
|
+
const invalidEvent = (0, class_transformer_1.plainToInstance)(Context, {
|
|
55
|
+
context: invalidCloudSessionContext,
|
|
56
|
+
});
|
|
57
|
+
const validationErrors = await (0, class_validator_1.validate)(invalidEvent);
|
|
58
|
+
expect(validationErrors).toHaveLength(1);
|
|
59
|
+
expect(validationErrors[0].children).toHaveLength(1);
|
|
60
|
+
expect(validationErrors[0].children[0].constraints).toEqual({
|
|
61
|
+
isEnum: "cloudProvider must be one of the following values: aws",
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
it("valid cloud session context", async () => {
|
|
65
|
+
const validCloudSessionContext = {
|
|
66
|
+
cloudSessionId: "BA7C9AEE-955D-4155-9220-A4BCB0F0A106",
|
|
67
|
+
poolId: "E738D912-8D00-4E3B-9F0A-A448C9FEAA73",
|
|
68
|
+
cloudProvider: "aws",
|
|
69
|
+
};
|
|
70
|
+
const validEvent = (0, class_transformer_1.plainToInstance)(Context, {
|
|
71
|
+
context: validCloudSessionContext,
|
|
72
|
+
});
|
|
73
|
+
const validationErrors = await (0, class_validator_1.validate)(validEvent);
|
|
74
|
+
expect(validationErrors).toHaveLength(0);
|
|
75
|
+
});
|
|
76
|
+
it("invalid cloud resource context", async () => {
|
|
77
|
+
const invalidCloudResourceContext = {
|
|
78
|
+
resourceId: "BA7C9AEE-955D-4155-9220-A4BCB0F0A106",
|
|
79
|
+
poolId: "E738D912-8D00-4E3B-9F0A-A448C9FEAA73",
|
|
80
|
+
cloudProvider: "aws",
|
|
81
|
+
streamGroupId: 123839289312,
|
|
82
|
+
};
|
|
83
|
+
const invalidEvent = (0, class_transformer_1.plainToInstance)(Context, {
|
|
84
|
+
context: invalidCloudResourceContext,
|
|
85
|
+
});
|
|
86
|
+
const validationErrors = await (0, class_validator_1.validate)(invalidEvent);
|
|
87
|
+
expect(validationErrors).toHaveLength(1);
|
|
88
|
+
expect(validationErrors[0].children).toHaveLength(1);
|
|
89
|
+
expect(validationErrors[0].children[0].constraints).toEqual({
|
|
90
|
+
isString: "streamGroupId must be a string",
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=getCloudContextType.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCloudContextType.spec.js","sourceRoot":"","sources":["../../../src/v3/contexts/getCloudContextType.spec.ts"],"names":[],"mappings":"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"}
|
|
@@ -14,5 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./cloud-pool-context"), exports);
|
|
17
18
|
__exportStar(require("./cloud-resource-context"), exports);
|
|
19
|
+
__exportStar(require("./cloud-session-context"), exports);
|
|
20
|
+
__exportStar(require("./getCloudContextType"), exports);
|
|
18
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v3/contexts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v3/contexts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,2DAAyC;AACzC,0DAAwC;AACxC,wDAAsC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CloudPoolContext } from "../contexts";
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
import { CloudSessionContext } from "../../v2/contexts";
|
|
4
|
+
export declare class DeallocateMachineRequestPayload {
|
|
5
|
+
machinePoolId: string;
|
|
6
|
+
machineResourceId: string;
|
|
7
|
+
gamePoolId: string;
|
|
8
|
+
gameResourceId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class DeallocateMachineRequest extends LudeoEvent {
|
|
11
|
+
static readonly EVENT_NAME = "cloud-pools.deallocate-machine-request";
|
|
12
|
+
constructor(payload: DeallocateMachineRequestPayload, context: CloudSessionContext);
|
|
13
|
+
context: CloudSessionContext | CloudPoolContext;
|
|
14
|
+
payload: DeallocateMachineRequestPayload;
|
|
15
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.DeallocateMachineRequest = exports.DeallocateMachineRequestPayload = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const ludeo_event_1 = require("../../infra/ludeo-event");
|
|
15
|
+
const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
|
|
16
|
+
const getCloudContextType_1 = require("../contexts/getCloudContextType");
|
|
17
|
+
class DeallocateMachineRequestPayload {
|
|
18
|
+
}
|
|
19
|
+
exports.DeallocateMachineRequestPayload = DeallocateMachineRequestPayload;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsUUID)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], DeallocateMachineRequestPayload.prototype, "machinePoolId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsUUID)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], DeallocateMachineRequestPayload.prototype, "machineResourceId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsUUID)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], DeallocateMachineRequestPayload.prototype, "gamePoolId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_validator_1.IsUUID)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], DeallocateMachineRequestPayload.prototype, "gameResourceId", void 0);
|
|
36
|
+
class DeallocateMachineRequest extends ludeo_event_1.LudeoEvent {
|
|
37
|
+
constructor(payload, context) {
|
|
38
|
+
super(DeallocateMachineRequest.EVENT_NAME);
|
|
39
|
+
this.payload = payload;
|
|
40
|
+
this.context = context;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.DeallocateMachineRequest = DeallocateMachineRequest;
|
|
44
|
+
DeallocateMachineRequest.EVENT_NAME = "cloud-pools.deallocate-machine-request";
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(getCloudContextType_1.getCloudContextType),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], DeallocateMachineRequest.prototype, "context", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => DeallocateMachineRequestPayload),
|
|
51
|
+
__metadata("design:type", DeallocateMachineRequestPayload)
|
|
52
|
+
], DeallocateMachineRequest.prototype, "payload", void 0);
|
|
53
|
+
//# sourceMappingURL=deallocate-machine-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deallocate-machine-request.js","sourceRoot":"","sources":["../../../src/v3/events/deallocate-machine-request.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qDAAyD;AAGzD,yDAAqD;AAErD,oGAAqF;AACrF,yEAAsE;AAEtE,MAAa,+BAA+B;CAY3C;AAZD,0EAYC;AAVC;IADC,IAAA,wBAAM,GAAE;;sEACa;AAGtB;IADC,IAAA,wBAAM,GAAE;;0EACiB;AAG1B;IADC,IAAA,wBAAM,GAAE;;mEACU;AAGnB;IADC,IAAA,wBAAM,GAAE;;uEACc;AAGzB,MAAa,wBAAyB,SAAQ,wBAAU;IAGtD,YACE,OAAwC,EACxC,OAA4B;QAE5B,KAAK,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAVH,4DAiBC;AAhBiB,mCAAU,GAAG,wCAAwC,CAAC;AAYtE;IADC,IAAA,mDAAkB,EAAC,yCAAmB,CAAC;;yDACQ;AAGhD;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,+BAA+B,CAAC;8BACjD,+BAA+B;yDAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CloudResourceContext } from "../contexts";
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
import { CloudProviderAllocationData } from "../types";
|
|
4
|
+
export declare class GameAllocatedResponsePayload {
|
|
5
|
+
gameResourceId: string;
|
|
6
|
+
gamePoolId: string;
|
|
7
|
+
allocationData: CloudProviderAllocationData;
|
|
8
|
+
}
|
|
9
|
+
export declare class GameResourceAllocatedResponse extends LudeoEvent {
|
|
10
|
+
static readonly EVENT_NAME = "cloud-resources.game-resource-allocated-response";
|
|
11
|
+
constructor(payload: GameAllocatedResponsePayload, context: CloudResourceContext);
|
|
12
|
+
context: CloudResourceContext;
|
|
13
|
+
payload: GameAllocatedResponsePayload;
|
|
14
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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.GameResourceAllocatedResponse = exports.GameAllocatedResponsePayload = 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 GameAllocatedResponsePayload {
|
|
19
|
+
}
|
|
20
|
+
exports.GameAllocatedResponsePayload = GameAllocatedResponsePayload;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsUUID)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], GameAllocatedResponsePayload.prototype, "gameResourceId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsUUID)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], GameAllocatedResponsePayload.prototype, "gamePoolId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => types_1.AwsAllocationData),
|
|
31
|
+
__metadata("design:type", Object)
|
|
32
|
+
], GameAllocatedResponsePayload.prototype, "allocationData", void 0);
|
|
33
|
+
class GameResourceAllocatedResponse extends ludeo_event_1.LudeoEvent {
|
|
34
|
+
constructor(payload, context) {
|
|
35
|
+
super(GameResourceAllocatedResponse.EVENT_NAME);
|
|
36
|
+
this.payload = payload;
|
|
37
|
+
this.context = context;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.GameResourceAllocatedResponse = GameResourceAllocatedResponse;
|
|
41
|
+
GameResourceAllocatedResponse.EVENT_NAME = "cloud-resources.game-resource-allocated-response";
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => contexts_1.CloudResourceContext),
|
|
44
|
+
__metadata("design:type", contexts_1.CloudResourceContext)
|
|
45
|
+
], GameResourceAllocatedResponse.prototype, "context", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => GameAllocatedResponsePayload),
|
|
48
|
+
__metadata("design:type", GameAllocatedResponsePayload)
|
|
49
|
+
], GameResourceAllocatedResponse.prototype, "payload", void 0);
|
|
50
|
+
//# sourceMappingURL=game-resource-allocated-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-resource-allocated-response.js","sourceRoot":"","sources":["../../../src/v3/events/game-resource-allocated-response.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAyC;AAEzC,0CAAmD;AACnD,yDAAqD;AACrD,oGAAqF;AACrF,oCAA0E;AAE1E,MAAa,4BAA4B;CASxC;AATD,oEASC;AAPC;IADC,IAAA,wBAAM,GAAE;;oEACc;AAGvB;IADC,IAAA,wBAAM,GAAE;;gEACU;AAGnB;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,yBAAiB,CAAC;;oEACA;AAG9C,MAAa,6BAA8B,SAAQ,wBAAU;IAI3D,YACE,OAAqC,EACrC,OAA6B;QAE7B,KAAK,CAAC,6BAA6B,CAAC,UAAU,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAXH,sEAkBC;AAjBiB,wCAAU,GACxB,kDAAkD,CAAC;AAYrD;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,+BAAoB,CAAC;8BACtC,+BAAoB;8DAAC;AAG9B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,4BAA4B,CAAC;8BAC9C,4BAA4B;8DAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CloudResourceContext } from "../contexts";
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
export declare class GameResourceAllocationFailedResponsePayload {
|
|
4
|
+
gameResourceId: string;
|
|
5
|
+
gamePoolId: string;
|
|
6
|
+
errorMessage: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class GameResourceAllocationFailedResponse extends LudeoEvent {
|
|
9
|
+
static readonly EVENT_NAME = "cloud-resources.game-resource-allocation-failed-response";
|
|
10
|
+
constructor(payload: GameResourceAllocationFailedResponsePayload, context: CloudResourceContext);
|
|
11
|
+
context: CloudResourceContext;
|
|
12
|
+
payload: GameResourceAllocationFailedResponsePayload;
|
|
13
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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.GameResourceAllocationFailedResponse = exports.GameResourceAllocationFailedResponsePayload = 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
|
+
class GameResourceAllocationFailedResponsePayload {
|
|
18
|
+
}
|
|
19
|
+
exports.GameResourceAllocationFailedResponsePayload = GameResourceAllocationFailedResponsePayload;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, class_validator_1.IsUUID)(),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], GameResourceAllocationFailedResponsePayload.prototype, "gameResourceId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsUUID)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], GameResourceAllocationFailedResponsePayload.prototype, "gamePoolId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], GameResourceAllocationFailedResponsePayload.prototype, "errorMessage", void 0);
|
|
32
|
+
class GameResourceAllocationFailedResponse extends ludeo_event_1.LudeoEvent {
|
|
33
|
+
constructor(payload, context) {
|
|
34
|
+
super(GameResourceAllocationFailedResponse.EVENT_NAME);
|
|
35
|
+
this.payload = payload;
|
|
36
|
+
this.context = context;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.GameResourceAllocationFailedResponse = GameResourceAllocationFailedResponse;
|
|
40
|
+
GameResourceAllocationFailedResponse.EVENT_NAME = "cloud-resources.game-resource-allocation-failed-response";
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => contexts_1.CloudResourceContext),
|
|
43
|
+
__metadata("design:type", contexts_1.CloudResourceContext)
|
|
44
|
+
], GameResourceAllocationFailedResponse.prototype, "context", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => GameResourceAllocationFailedResponsePayload),
|
|
47
|
+
__metadata("design:type", GameResourceAllocationFailedResponsePayload)
|
|
48
|
+
], GameResourceAllocationFailedResponse.prototype, "payload", void 0);
|
|
49
|
+
//# sourceMappingURL=game-resource-allocation-failed-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-resource-allocation-failed-response.js","sourceRoot":"","sources":["../../../src/v3/events/game-resource-allocation-failed-response.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmD;AAEnD,0CAAmD;AACnD,yDAAqD;AACrD,oGAAqF;AAErF,MAAa,2CAA2C;CASvD;AATD,kGASC;AAPC;IADC,IAAA,wBAAM,GAAE;;mFACc;AAGvB;IADC,IAAA,wBAAM,GAAE;;+EACU;AAGnB;IADC,IAAA,0BAAQ,GAAE;;iFACU;AAGvB,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,0DAA0D,CAAC;AAY7D;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,15 @@
|
|
|
1
|
+
import { CloudResourceContext } from "../contexts";
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
import { CloudProviderSettings, CloudProvider } from "../types";
|
|
4
|
+
export declare class GameCreatedResponsePayload {
|
|
5
|
+
gameResourceId: string;
|
|
6
|
+
gamePoolId: string;
|
|
7
|
+
providerSettings: CloudProviderSettings;
|
|
8
|
+
cloudProvider: CloudProvider;
|
|
9
|
+
}
|
|
10
|
+
export declare class GameResourceCreatedResponse extends LudeoEvent {
|
|
11
|
+
static readonly EVENT_NAME = "cloud-resources.game-resource-created-response";
|
|
12
|
+
constructor(payload: GameCreatedResponsePayload, context: CloudResourceContext);
|
|
13
|
+
context: CloudResourceContext;
|
|
14
|
+
payload: GameCreatedResponsePayload;
|
|
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.GameResourceCreatedResponse = exports.GameCreatedResponsePayload = 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 GameCreatedResponsePayload {
|
|
19
|
+
}
|
|
20
|
+
exports.GameCreatedResponsePayload = GameCreatedResponsePayload;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsUUID)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], GameCreatedResponsePayload.prototype, "gameResourceId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsUUID)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], GameCreatedResponsePayload.prototype, "gamePoolId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => types_1.AWSProviderSettings),
|
|
31
|
+
__metadata("design:type", Object)
|
|
32
|
+
], GameCreatedResponsePayload.prototype, "providerSettings", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsEnum)(types_1.CloudProvider),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], GameCreatedResponsePayload.prototype, "cloudProvider", void 0);
|
|
37
|
+
class GameResourceCreatedResponse extends ludeo_event_1.LudeoEvent {
|
|
38
|
+
constructor(payload, context) {
|
|
39
|
+
super(GameResourceCreatedResponse.EVENT_NAME);
|
|
40
|
+
this.payload = payload;
|
|
41
|
+
this.context = context;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.GameResourceCreatedResponse = GameResourceCreatedResponse;
|
|
45
|
+
GameResourceCreatedResponse.EVENT_NAME = "cloud-resources.game-resource-created-response";
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => contexts_1.CloudResourceContext),
|
|
48
|
+
__metadata("design:type", contexts_1.CloudResourceContext)
|
|
49
|
+
], GameResourceCreatedResponse.prototype, "context", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, validate_nested_type_decorator_1.ValidateNestedType)(() => GameCreatedResponsePayload),
|
|
52
|
+
__metadata("design:type", GameCreatedResponsePayload)
|
|
53
|
+
], GameResourceCreatedResponse.prototype, "payload", void 0);
|
|
54
|
+
//# sourceMappingURL=game-resource-created-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-resource-created-response.js","sourceRoot":"","sources":["../../../src/v3/events/game-resource-created-response.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiD;AAEjD,0CAAmD;AACnD,yDAAqD;AACrD,oGAAqF;AACrF,oCAIkB;AAElB,MAAa,0BAA0B;CAYtC;AAZD,gEAYC;AAVC;IADC,IAAA,wBAAM,GAAE;;kEACc;AAGvB;IADC,IAAA,wBAAM,GAAE;;8DACU;AAGnB;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,2BAAmB,CAAC;;oEACN;AAGxC;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;iEACO;AAG/B,MAAa,2BAA4B,SAAQ,wBAAU;IAGzD,YACE,OAAmC,EACnC,OAA6B;QAE7B,KAAK,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAVH,kEAiBC;AAhBiB,sCAAU,GAAG,gDAAgD,CAAC;AAY9E;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,+BAAoB,CAAC;8BACtC,+BAAoB;4DAAC;AAG9B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;8BAC5C,0BAA0B;4DAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CloudResourceContext } from "../contexts";
|
|
2
|
+
import { LudeoEvent } from "../../infra/ludeo-event";
|
|
3
|
+
export declare class GameResourceCreationFailedResponsePayload {
|
|
4
|
+
gameResourceId: string;
|
|
5
|
+
gamePoolId: string;
|
|
6
|
+
errorMessage: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class GameResourceCreationFailedResponse extends LudeoEvent {
|
|
9
|
+
static readonly EVENT_NAME = "cloud-resources.game-resource-creation-failed-response";
|
|
10
|
+
constructor(payload: GameResourceCreationFailedResponsePayload, context: CloudResourceContext);
|
|
11
|
+
context: CloudResourceContext;
|
|
12
|
+
payload: GameResourceCreationFailedResponsePayload;
|
|
13
|
+
}
|