@ludeo/cloud-common 1.1.56 → 1.1.58

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.
@@ -2,13 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCloudContextType = void 0;
4
4
  const cloud_pool_context_1 = require("./cloud-pool-context");
5
- const cloud_resource_context_1 = require("./cloud-resource-context");
6
5
  const cloud_session_context_1 = require("./cloud-session-context");
6
+ const cloud_resource_context_1 = require("./cloud-resource-context");
7
7
  const getCloudContextType = ({ object }) => {
8
8
  if ("cloudSessionId" in object) {
9
9
  return cloud_session_context_1.CloudSessionContext;
10
10
  }
11
- if ("resourceId" in object) {
11
+ if ("resourceId" in object ||
12
+ "gameResourceId" in object ||
13
+ "machineResourceId" in object) {
12
14
  return cloud_resource_context_1.CloudResourceContext;
13
15
  }
14
16
  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,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"}
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,MAAM,EAAE,CAAC;QAC/B,OAAO,2CAAmB,CAAC;IAC7B,CAAC;IAED,IACE,YAAY,IAAI,MAAM;QACtB,gBAAgB,IAAI,MAAM;QAC1B,mBAAmB,IAAI,MAAM,EAC7B,CAAC;QACD,OAAO,6CAAoB,CAAC;IAC9B,CAAC;IAED,OAAO,qCAAgB,CAAC;AAC1B,CAAC,CAAC;AAdW,QAAA,mBAAmB,uBAc9B"}
@@ -1,9 +1,11 @@
1
+ import { AllocationRequestData } from "../types";
1
2
  import { CloudSessionContext } from "../contexts";
2
3
  import { LudeoEvent } from "../../infra/ludeo-event";
3
4
  export declare class GameResourceAllocationFailedResponsePayload {
4
5
  gameResourceId: string;
5
6
  gamePoolId: string;
6
7
  errorMessage: string;
8
+ requestData: AllocationRequestData;
7
9
  }
8
10
  export declare class GameResourceAllocationFailedResponse extends LudeoEvent {
9
11
  static readonly EVENT_NAME = "cloud-resources.game-resource-allocation-failed-response";
@@ -11,6 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.GameResourceAllocationFailedResponse = exports.GameResourceAllocationFailedResponsePayload = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
+ const types_1 = require("../types");
14
15
  const contexts_1 = require("../contexts");
15
16
  const ludeo_event_1 = require("../../infra/ludeo-event");
16
17
  const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
@@ -29,6 +30,10 @@ __decorate([
29
30
  (0, class_validator_1.IsString)(),
30
31
  __metadata("design:type", String)
31
32
  ], GameResourceAllocationFailedResponsePayload.prototype, "errorMessage", void 0);
33
+ __decorate([
34
+ (0, validate_nested_type_decorator_1.ValidateNestedType)(() => types_1.AllocationRequestData),
35
+ __metadata("design:type", types_1.AllocationRequestData)
36
+ ], GameResourceAllocationFailedResponsePayload.prototype, "requestData", void 0);
32
37
  class GameResourceAllocationFailedResponse extends ludeo_event_1.LudeoEvent {
33
38
  constructor(payload, context) {
34
39
  super(GameResourceAllocationFailedResponse.EVENT_NAME);
@@ -1 +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,0CAAkD;AAClD,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,OAA4B;QAE5B,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,8BAAmB,CAAC;8BACrC,8BAAmB;qEAAC;AAG7B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,2CAA2C,CAAC;8BAC7D,2CAA2C;qEAAC"}
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,oCAAiD;AACjD,0CAAkD;AAClD,yDAAqD;AACrD,oGAAqF;AAErF,MAAa,2CAA2C;CAYvD;AAZD,kGAYC;AAVC;IADC,IAAA,wBAAM,GAAE;;mFACc;AAGvB;IADC,IAAA,wBAAM,GAAE;;+EACU;AAGnB;IADC,IAAA,0BAAQ,GAAE;;iFACU;AAGrB;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,6BAAqB,CAAC;8BACnC,6BAAqB;gFAAC;AAGrC,MAAa,oCAAqC,SAAQ,wBAAU;IAIlE,YACE,OAAoD,EACpD,OAA4B;QAE5B,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,8BAAmB,CAAC;8BACrC,8BAAmB;qEAAC;AAG7B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,2CAA2C,CAAC;8BAC7D,2CAA2C;qEAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludeo/cloud-common",
3
- "version": "1.1.56",
3
+ "version": "1.1.58",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Yahil Didi",
@@ -1,14 +1,18 @@
1
1
  import { TypeHelpOptions } from "class-transformer";
2
2
  import { CloudPoolContext } from "./cloud-pool-context";
3
- import { CloudResourceContext } from "./cloud-resource-context";
4
3
  import { CloudSessionContext } from "./cloud-session-context";
4
+ import { CloudResourceContext } from "./cloud-resource-context";
5
5
 
6
6
  export const getCloudContextType = ({ object }: TypeHelpOptions) => {
7
7
  if ("cloudSessionId" in object) {
8
8
  return CloudSessionContext;
9
9
  }
10
10
 
11
- if ("resourceId" in object) {
11
+ if (
12
+ "resourceId" in object ||
13
+ "gameResourceId" in object ||
14
+ "machineResourceId" in object
15
+ ) {
12
16
  return CloudResourceContext;
13
17
  }
14
18
 
@@ -1,5 +1,6 @@
1
1
  import { IsString, IsUUID } from "class-validator";
2
2
 
3
+ import { AllocationRequestData } from "../types";
3
4
  import { CloudSessionContext } from "../contexts";
4
5
  import { LudeoEvent } from "../../infra/ludeo-event";
5
6
  import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
@@ -13,6 +14,9 @@ export class GameResourceAllocationFailedResponsePayload {
13
14
 
14
15
  @IsString()
15
16
  errorMessage: string;
17
+
18
+ @ValidateNestedType(() => AllocationRequestData)
19
+ requestData: AllocationRequestData;
16
20
  }
17
21
 
18
22
  export class GameResourceAllocationFailedResponse extends LudeoEvent {