@ludeo/cloud-common 1.1.58 → 1.1.60
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/v3/contexts/cloud-pool-context.js +1 -1
- package/dist/v3/contexts/cloud-pool-context.js.map +1 -1
- package/dist/v3/contexts/cloud-resource-context.js +8 -8
- package/dist/v3/contexts/cloud-resource-context.js.map +1 -1
- package/dist/v3/contexts/cloud-session-context.js +4 -4
- package/dist/v3/contexts/cloud-session-context.js.map +1 -1
- package/dist/v3/contexts/getCloudContextType.js +5 -4
- package/dist/v3/contexts/getCloudContextType.js.map +1 -1
- package/dist/v3/contexts/getCloudContextType.spec.js +3 -3
- package/dist/v3/contexts/getCloudContextType.spec.js.map +1 -1
- package/package.json +1 -1
- package/src/v3/contexts/cloud-pool-context.ts +1 -1
- package/src/v3/contexts/cloud-resource-context.ts +8 -8
- package/src/v3/contexts/cloud-session-context.ts +4 -4
- package/src/v3/contexts/getCloudContextType.spec.ts +3 -3
- package/src/v3/contexts/getCloudContextType.ts +6 -4
|
@@ -24,8 +24,8 @@ __decorate([
|
|
|
24
24
|
__metadata("design:type", String)
|
|
25
25
|
], CloudPoolContext.prototype, "poolId", void 0);
|
|
26
26
|
__decorate([
|
|
27
|
-
(0, class_validator_1.IsString)(),
|
|
28
27
|
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
29
|
__metadata("design:type", String)
|
|
30
30
|
], CloudPoolContext.prototype, "streamGroupId", void 0);
|
|
31
31
|
//# sourceMappingURL=cloud-pool-context.js.map
|
|
@@ -1 +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,
|
|
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,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;uDACY"}
|
|
@@ -16,13 +16,13 @@ class CloudResourceContext {
|
|
|
16
16
|
}
|
|
17
17
|
exports.CloudResourceContext = CloudResourceContext;
|
|
18
18
|
__decorate([
|
|
19
|
-
(0, class_validator_1.IsString)(),
|
|
20
19
|
(0, class_validator_1.IsOptional)(),
|
|
20
|
+
(0, class_validator_1.IsString)(),
|
|
21
21
|
__metadata("design:type", String)
|
|
22
22
|
], CloudResourceContext.prototype, "streamGroupId", void 0);
|
|
23
23
|
__decorate([
|
|
24
|
-
(0, class_validator_1.IsString)(),
|
|
25
24
|
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
26
|
__metadata("design:type", String)
|
|
27
27
|
], CloudResourceContext.prototype, "streamSessionId", void 0);
|
|
28
28
|
__decorate([
|
|
@@ -30,33 +30,33 @@ __decorate([
|
|
|
30
30
|
__metadata("design:type", String)
|
|
31
31
|
], CloudResourceContext.prototype, "cloudProvider", void 0);
|
|
32
32
|
__decorate([
|
|
33
|
-
(0, class_validator_1.IsString)(),
|
|
34
33
|
(0, class_validator_1.IsOptional)(),
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
35
|
__metadata("design:type", String)
|
|
36
36
|
], CloudResourceContext.prototype, "resourceId", void 0);
|
|
37
37
|
__decorate([
|
|
38
|
-
(0, class_validator_1.IsString)(),
|
|
39
38
|
(0, class_validator_1.IsOptional)(),
|
|
39
|
+
(0, class_validator_1.IsString)(),
|
|
40
40
|
__metadata("design:type", String)
|
|
41
41
|
], CloudResourceContext.prototype, "poolId", void 0);
|
|
42
42
|
__decorate([
|
|
43
|
-
(0, class_validator_1.IsUUID)(),
|
|
44
43
|
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsUUID)(),
|
|
45
45
|
__metadata("design:type", String)
|
|
46
46
|
], CloudResourceContext.prototype, "gamePoolId", void 0);
|
|
47
47
|
__decorate([
|
|
48
|
-
(0, class_validator_1.IsUUID)(),
|
|
49
48
|
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
(0, class_validator_1.IsUUID)(),
|
|
50
50
|
__metadata("design:type", String)
|
|
51
51
|
], CloudResourceContext.prototype, "gameResourceId", void 0);
|
|
52
52
|
__decorate([
|
|
53
|
-
(0, class_validator_1.IsUUID)(),
|
|
54
53
|
(0, class_validator_1.IsOptional)(),
|
|
54
|
+
(0, class_validator_1.IsUUID)(),
|
|
55
55
|
__metadata("design:type", String)
|
|
56
56
|
], CloudResourceContext.prototype, "machinePoolId", void 0);
|
|
57
57
|
__decorate([
|
|
58
|
-
(0, class_validator_1.IsUUID)(),
|
|
59
58
|
(0, class_validator_1.IsOptional)(),
|
|
59
|
+
(0, class_validator_1.IsUUID)(),
|
|
60
60
|
__metadata("design:type", String)
|
|
61
61
|
], CloudResourceContext.prototype, "machineResourceId", void 0);
|
|
62
62
|
//# sourceMappingURL=cloud-resource-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-resource-context.js","sourceRoot":"","sources":["../../../src/v3/contexts/cloud-resource-context.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuE;AACvE,0CAA+C;AAE/C,MAAa,oBAAoB;CAqChC;AArCD,oDAqCC;AAlCC;IAFC,IAAA,
|
|
1
|
+
{"version":3,"file":"cloud-resource-context.js","sourceRoot":"","sources":["../../../src/v3/contexts/cloud-resource-context.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuE;AACvE,0CAA+C;AAE/C,MAAa,oBAAoB;CAqChC;AArCD,oDAqCC;AAlCC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2DACY;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;6DACc;AAGzB;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;2DACO;AAK7B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wDACS;AAKpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;wDACW;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;4DACe;AAIxB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;2DACc;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;+DACkB"}
|
|
@@ -49,23 +49,23 @@ __decorate([
|
|
|
49
49
|
__metadata("design:type", String)
|
|
50
50
|
], CloudSessionContext.prototype, "cloudProvider", void 0);
|
|
51
51
|
__decorate([
|
|
52
|
-
(0, class_validator_1.IsUUID)(),
|
|
53
52
|
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
(0, class_validator_1.IsUUID)(),
|
|
54
54
|
__metadata("design:type", String)
|
|
55
55
|
], CloudSessionContext.prototype, "gamePoolId", void 0);
|
|
56
56
|
__decorate([
|
|
57
|
-
(0, class_validator_1.IsUUID)(),
|
|
58
57
|
(0, class_validator_1.IsOptional)(),
|
|
58
|
+
(0, class_validator_1.IsUUID)(),
|
|
59
59
|
__metadata("design:type", String)
|
|
60
60
|
], CloudSessionContext.prototype, "gameResourceId", void 0);
|
|
61
61
|
__decorate([
|
|
62
|
-
(0, class_validator_1.IsUUID)(),
|
|
63
62
|
(0, class_validator_1.IsOptional)(),
|
|
63
|
+
(0, class_validator_1.IsUUID)(),
|
|
64
64
|
__metadata("design:type", String)
|
|
65
65
|
], CloudSessionContext.prototype, "machinePoolId", void 0);
|
|
66
66
|
__decorate([
|
|
67
|
-
(0, class_validator_1.IsUUID)(),
|
|
68
67
|
(0, class_validator_1.IsOptional)(),
|
|
68
|
+
(0, class_validator_1.IsUUID)(),
|
|
69
69
|
__metadata("design:type", String)
|
|
70
70
|
], CloudSessionContext.prototype, "machineResourceId", void 0);
|
|
71
71
|
__decorate([
|
|
@@ -1 +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;CA2D/B;AA3DD,kDA2DC;AAxDC;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;AAGjB;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;0DACO;AAI7B;IAFC,IAAA,
|
|
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;CA2D/B;AA3DD,kDA2DC;AAxDC;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;AAGjB;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;0DACO;AAI7B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;uDACW;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;2DACe;AAIxB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;0DACc;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;8DACkB;AAI3B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;0DACY;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;4DACc;AAKzB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;mDACO;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;;uDACW"}
|
|
@@ -5,12 +5,13 @@ const cloud_pool_context_1 = require("./cloud-pool-context");
|
|
|
5
5
|
const cloud_session_context_1 = require("./cloud-session-context");
|
|
6
6
|
const cloud_resource_context_1 = require("./cloud-resource-context");
|
|
7
7
|
const getCloudContextType = ({ object }) => {
|
|
8
|
-
|
|
8
|
+
const { context } = object;
|
|
9
|
+
if ("cloudSessionId" in context) {
|
|
9
10
|
return cloud_session_context_1.CloudSessionContext;
|
|
10
11
|
}
|
|
11
|
-
if ("resourceId" in
|
|
12
|
-
"gameResourceId" in
|
|
13
|
-
"machineResourceId" in
|
|
12
|
+
if ("resourceId" in context ||
|
|
13
|
+
"gameResourceId" in context ||
|
|
14
|
+
"machineResourceId" in context) {
|
|
14
15
|
return cloud_resource_context_1.CloudResourceContext;
|
|
15
16
|
}
|
|
16
17
|
return cloud_pool_context_1.CloudPoolContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCloudContextType.js","sourceRoot":"","sources":["../../../src/v3/contexts/getCloudContextType.ts"],"names":[],"mappings":";;;AACA,6DAAwD;AACxD,mEAA8D;AAC9D,qEAAgE;AAEzD,MAAM,mBAAmB,GAAG,CAAC,EAAE,MAAM,EAAmB,EAAE,EAAE;IACjE,IAAI,gBAAgB,IAAI,
|
|
1
|
+
{"version":3,"file":"getCloudContextType.js","sourceRoot":"","sources":["../../../src/v3/contexts/getCloudContextType.ts"],"names":[],"mappings":";;;AACA,6DAAwD;AACxD,mEAA8D;AAC9D,qEAAgE;AAEzD,MAAM,mBAAmB,GAAG,CAAC,EAAE,MAAM,EAAmB,EAAE,EAAE;IACjE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAE3B,IAAI,gBAAgB,IAAI,OAAO,EAAE,CAAC;QAChC,OAAO,2CAAmB,CAAC;IAC7B,CAAC;IAED,IACE,YAAY,IAAI,OAAO;QACvB,gBAAgB,IAAI,OAAO;QAC3B,mBAAmB,IAAI,OAAO,EAC9B,CAAC;QACD,OAAO,6CAAoB,CAAC;IAC9B,CAAC;IAED,OAAO,qCAAgB,CAAC;AAC1B,CAAC,CAAC;AAhBW,QAAA,mBAAmB,uBAgB9B"}
|
|
@@ -21,19 +21,19 @@ describe("getContextType", () => {
|
|
|
21
21
|
const context = {
|
|
22
22
|
cloudSessionId: "cloudSessionId",
|
|
23
23
|
};
|
|
24
|
-
expect((0, getCloudContextType_1.getCloudContextType)({ object: context })).toBe(cloud_session_context_1.CloudSessionContext);
|
|
24
|
+
expect((0, getCloudContextType_1.getCloudContextType)({ object: { context } })).toBe(cloud_session_context_1.CloudSessionContext);
|
|
25
25
|
});
|
|
26
26
|
it("should return cloud resource context", () => {
|
|
27
27
|
const context = {
|
|
28
28
|
resourceId: "resourceId",
|
|
29
29
|
};
|
|
30
|
-
expect((0, getCloudContextType_1.getCloudContextType)({ object: context })).toBe(cloud_resource_context_1.CloudResourceContext);
|
|
30
|
+
expect((0, getCloudContextType_1.getCloudContextType)({ object: { context } })).toBe(cloud_resource_context_1.CloudResourceContext);
|
|
31
31
|
});
|
|
32
32
|
it("should return cloud pool context", () => {
|
|
33
33
|
const context = {
|
|
34
34
|
poolId: "poolId",
|
|
35
35
|
};
|
|
36
|
-
expect((0, getCloudContextType_1.getCloudContextType)({ object: context })).toBe(cloud_pool_context_1.CloudPoolContext);
|
|
36
|
+
expect((0, getCloudContextType_1.getCloudContextType)({ object: { context } })).toBe(cloud_pool_context_1.CloudPoolContext);
|
|
37
37
|
});
|
|
38
38
|
describe("class validator", () => {
|
|
39
39
|
class Context {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCloudContextType.spec.js","sourceRoot":"","sources":["../../../src/v3/contexts/getCloudContextType.spec.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qDAA2C;AAC3C,yDAAoD;AAEpD,iDAAsD;AACtD,+DAA4D;AAC5D,uEAAkE;AAClE,6EAAwE;AACxE,+EAA0E;AAE1E,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,OAAO,GAAG;YACd,cAAc,EAAE,gBAAgB;SACjC,CAAC;QACF,MAAM,CAAC,IAAA,yCAAmB,EAAC,EAAE,MAAM,EAAE,OAAO,EAAS,CAAC,CAAC,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"getCloudContextType.spec.js","sourceRoot":"","sources":["../../../src/v3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aAAa,EAAE,KAAY;gBAC3B,aAAa,EAAE,YAAY;aAC5B,CAAC;YAEF,MAAM,YAAY,GAAG,IAAA,mCAAe,EAAC,OAAO,EAAE;gBAC5C,OAAO,EAAE,2BAA2B;aACrC,CAAC,CAAC;YACH,MAAM,gBAAgB,GAAG,MAAM,IAAA,0BAAQ,EAAC,YAAY,CAAC,CAAC;YAEtD,MAAM,CAAC,gBAAgB,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACzC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACrD,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC;gBAC1D,QAAQ,EAAE,gCAAgC;aAC3C,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,40 +2,40 @@ import { IsEnum, IsOptional, IsString, IsUUID } from "class-validator";
|
|
|
2
2
|
import { CloudProvider } from "../types/cloud";
|
|
3
3
|
|
|
4
4
|
export class CloudResourceContext {
|
|
5
|
-
@IsString()
|
|
6
5
|
@IsOptional()
|
|
6
|
+
@IsString()
|
|
7
7
|
streamGroupId?: string;
|
|
8
8
|
|
|
9
|
-
@IsString()
|
|
10
9
|
@IsOptional()
|
|
10
|
+
@IsString()
|
|
11
11
|
streamSessionId?: string;
|
|
12
12
|
|
|
13
13
|
@IsEnum(CloudProvider)
|
|
14
14
|
cloudProvider: CloudProvider;
|
|
15
15
|
|
|
16
16
|
// Backwards compat
|
|
17
|
-
@IsString()
|
|
18
17
|
@IsOptional()
|
|
18
|
+
@IsString()
|
|
19
19
|
resourceId?: string;
|
|
20
20
|
|
|
21
21
|
// Backwards compat
|
|
22
|
-
@IsString()
|
|
23
22
|
@IsOptional()
|
|
23
|
+
@IsString()
|
|
24
24
|
poolId?: string;
|
|
25
25
|
|
|
26
|
-
@IsUUID()
|
|
27
26
|
@IsOptional()
|
|
27
|
+
@IsUUID()
|
|
28
28
|
gamePoolId?: string;
|
|
29
29
|
|
|
30
|
-
@IsUUID()
|
|
31
30
|
@IsOptional()
|
|
31
|
+
@IsUUID()
|
|
32
32
|
gameResourceId?: string;
|
|
33
33
|
|
|
34
|
-
@IsUUID()
|
|
35
34
|
@IsOptional()
|
|
35
|
+
@IsUUID()
|
|
36
36
|
machinePoolId?: string;
|
|
37
37
|
|
|
38
|
-
@IsUUID()
|
|
39
38
|
@IsOptional()
|
|
39
|
+
@IsUUID()
|
|
40
40
|
machineResourceId?: string;
|
|
41
41
|
}
|
|
@@ -28,20 +28,20 @@ export class CloudSessionContext {
|
|
|
28
28
|
@IsEnum(CloudProvider)
|
|
29
29
|
cloudProvider: CloudProvider;
|
|
30
30
|
|
|
31
|
-
@IsUUID()
|
|
32
31
|
@IsOptional()
|
|
32
|
+
@IsUUID()
|
|
33
33
|
gamePoolId?: string;
|
|
34
34
|
|
|
35
|
-
@IsUUID()
|
|
36
35
|
@IsOptional()
|
|
36
|
+
@IsUUID()
|
|
37
37
|
gameResourceId?: string;
|
|
38
38
|
|
|
39
|
-
@IsUUID()
|
|
40
39
|
@IsOptional()
|
|
40
|
+
@IsUUID()
|
|
41
41
|
machinePoolId?: string;
|
|
42
42
|
|
|
43
|
-
@IsUUID()
|
|
44
43
|
@IsOptional()
|
|
44
|
+
@IsUUID()
|
|
45
45
|
machineResourceId?: string;
|
|
46
46
|
|
|
47
47
|
@IsOptional()
|
|
@@ -12,7 +12,7 @@ describe("getContextType", () => {
|
|
|
12
12
|
const context = {
|
|
13
13
|
cloudSessionId: "cloudSessionId",
|
|
14
14
|
};
|
|
15
|
-
expect(getCloudContextType({ object: context } as any)).toBe(
|
|
15
|
+
expect(getCloudContextType({ object: { context } } as any)).toBe(
|
|
16
16
|
CloudSessionContext
|
|
17
17
|
);
|
|
18
18
|
});
|
|
@@ -21,7 +21,7 @@ describe("getContextType", () => {
|
|
|
21
21
|
const context = {
|
|
22
22
|
resourceId: "resourceId",
|
|
23
23
|
};
|
|
24
|
-
expect(getCloudContextType({ object: context } as any)).toBe(
|
|
24
|
+
expect(getCloudContextType({ object: { context } } as any)).toBe(
|
|
25
25
|
CloudResourceContext
|
|
26
26
|
);
|
|
27
27
|
});
|
|
@@ -30,7 +30,7 @@ describe("getContextType", () => {
|
|
|
30
30
|
const context = {
|
|
31
31
|
poolId: "poolId",
|
|
32
32
|
};
|
|
33
|
-
expect(getCloudContextType({ object: context } as any)).toBe(
|
|
33
|
+
expect(getCloudContextType({ object: { context } } as any)).toBe(
|
|
34
34
|
CloudPoolContext
|
|
35
35
|
);
|
|
36
36
|
});
|
|
@@ -4,14 +4,16 @@ import { CloudSessionContext } from "./cloud-session-context";
|
|
|
4
4
|
import { CloudResourceContext } from "./cloud-resource-context";
|
|
5
5
|
|
|
6
6
|
export const getCloudContextType = ({ object }: TypeHelpOptions) => {
|
|
7
|
-
|
|
7
|
+
const { context } = object;
|
|
8
|
+
|
|
9
|
+
if ("cloudSessionId" in context) {
|
|
8
10
|
return CloudSessionContext;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
if (
|
|
12
|
-
"resourceId" in
|
|
13
|
-
"gameResourceId" in
|
|
14
|
-
"machineResourceId" in
|
|
14
|
+
"resourceId" in context ||
|
|
15
|
+
"gameResourceId" in context ||
|
|
16
|
+
"machineResourceId" in context
|
|
15
17
|
) {
|
|
16
18
|
return CloudResourceContext;
|
|
17
19
|
}
|