@ludeo/cloud-common 1.1.46 → 1.1.48

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.
@@ -0,0 +1,8 @@
1
+ import { LudeoEvent } from "../../infra/ludeo-event";
2
+ import { CloudSessionContext } from "../contexts";
3
+ export declare class CloudSessionTerminated extends LudeoEvent {
4
+ static readonly EVENT_NAME = "cloud-sessions.cloud-session-terminated";
5
+ constructor(payload: {}, context: CloudSessionContext);
6
+ context: CloudSessionContext;
7
+ payload: {};
8
+ }
@@ -0,0 +1,29 @@
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.CloudSessionTerminated = void 0;
13
+ const validate_nested_type_decorator_1 = require("../../decorators/validate-nested-type.decorator");
14
+ const ludeo_event_1 = require("../../infra/ludeo-event");
15
+ const contexts_1 = require("../contexts");
16
+ class CloudSessionTerminated extends ludeo_event_1.LudeoEvent {
17
+ constructor(payload, context) {
18
+ super(CloudSessionTerminated.EVENT_NAME);
19
+ this.context = context;
20
+ this.payload = payload;
21
+ }
22
+ }
23
+ exports.CloudSessionTerminated = CloudSessionTerminated;
24
+ CloudSessionTerminated.EVENT_NAME = "cloud-sessions.cloud-session-terminated";
25
+ __decorate([
26
+ (0, validate_nested_type_decorator_1.ValidateNestedType)(() => contexts_1.CloudSessionContext),
27
+ __metadata("design:type", contexts_1.CloudSessionContext)
28
+ ], CloudSessionTerminated.prototype, "context", void 0);
29
+ //# sourceMappingURL=cloud-session-terminated.event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-session-terminated.event.js","sourceRoot":"","sources":["../../../src/v2/events/cloud-session-terminated.event.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oGAAqF;AACrF,yDAAqD;AACrD,0CAAkD;AAElD,MAAa,sBAAuB,SAAQ,wBAAU;IAGpD,YAAY,OAAW,EAAE,OAA4B;QACnD,KAAK,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAPH,wDAaC;AAZiB,iCAAU,GAAG,yCAAyC,CAAC;AASvE;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,8BAAmB,CAAC;8BACrC,8BAAmB;uDAAC"}
@@ -8,7 +8,7 @@ export * from "./cloud-resource-created.event";
8
8
  export * from "./cloud-resource-creation-failed.event";
9
9
  export * from "./cloud-resource-status.event";
10
10
  export * from "./cloud-session-allocated.event";
11
- export * from "./cloud-session-ended.event";
11
+ export * from "./cloud-session-terminated.event";
12
12
  export * from "./create-cloud-resource-request.event";
13
13
  export * from "./monitor-pool-task.event";
14
14
  export * from "./pool-created.event";
@@ -24,7 +24,7 @@ __exportStar(require("./cloud-resource-created.event"), exports);
24
24
  __exportStar(require("./cloud-resource-creation-failed.event"), exports);
25
25
  __exportStar(require("./cloud-resource-status.event"), exports);
26
26
  __exportStar(require("./cloud-session-allocated.event"), exports);
27
- __exportStar(require("./cloud-session-ended.event"), exports);
27
+ __exportStar(require("./cloud-session-terminated.event"), exports);
28
28
  __exportStar(require("./create-cloud-resource-request.event"), exports);
29
29
  __exportStar(require("./monitor-pool-task.event"), exports);
30
30
  __exportStar(require("./pool-created.event"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v2/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAAwD;AACxD,wEAAsD;AACtD,yEAAuD;AACvD,oEAAkD;AAClD,qEAAmD;AACnD,mEAAiD;AACjD,iEAA+C;AAC/C,yEAAuD;AACvD,gEAA8C;AAC9C,kEAAgD;AAChD,8DAA4C;AAC5C,wEAAsD;AACtD,4DAA0C;AAC1C,uDAAqC;AACrC,8DAA4C;AAC5C,8DAA4C;AAC5C,sDAAoC;AACpC,uDAAqC;AACrC,wEAAsD;AACtD,8DAA4C;AAC5C,gEAA8C;AAC9C,mDAAiC;AACjC,yDAAuC;AACvC,gEAA8C;AAC9C,6DAA2C;AAC3C,2EAAyD;AACzD,oEAAkD;AAClD,2EAAyD;AACzD,0EAAwD;AACxD,sEAAoD;AACpD,0EAAwD;AACxD,qEAAmD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v2/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAAwD;AACxD,wEAAsD;AACtD,yEAAuD;AACvD,oEAAkD;AAClD,qEAAmD;AACnD,mEAAiD;AACjD,iEAA+C;AAC/C,yEAAuD;AACvD,gEAA8C;AAC9C,kEAAgD;AAChD,mEAAiD;AACjD,wEAAsD;AACtD,4DAA0C;AAC1C,uDAAqC;AACrC,8DAA4C;AAC5C,8DAA4C;AAC5C,sDAAoC;AACpC,uDAAqC;AACrC,wEAAsD;AACtD,8DAA4C;AAC5C,gEAA8C;AAC9C,mDAAiC;AACjC,yDAAuC;AACvC,gEAA8C;AAC9C,6DAA2C;AAC3C,2EAAyD;AACzD,oEAAkD;AAClD,2EAAyD;AACzD,0EAAwD;AACxD,sEAAoD;AACpD,0EAAwD;AACxD,qEAAmD"}
@@ -1,9 +1,10 @@
1
- import { AllocationRequestData } from "../types";
1
+ import { AllocationRequestData, CloudProvider } from "../types";
2
2
  import { CloudSessionContext } from "../contexts";
3
3
  import { LudeoEvent } from "../../infra/ludeo-event";
4
4
  export declare class AllocateGameRequestPayload {
5
5
  gameResourceId: string;
6
6
  gamePoolId: string;
7
+ cloudProvider: CloudProvider;
7
8
  requestData: AllocationRequestData;
8
9
  }
9
10
  export declare class AllocateGameRequest extends LudeoEvent {
@@ -26,6 +26,10 @@ __decorate([
26
26
  (0, class_validator_1.IsUUID)(),
27
27
  __metadata("design:type", String)
28
28
  ], AllocateGameRequestPayload.prototype, "gamePoolId", void 0);
29
+ __decorate([
30
+ (0, class_validator_1.IsEnum)(types_1.CloudProvider),
31
+ __metadata("design:type", String)
32
+ ], AllocateGameRequestPayload.prototype, "cloudProvider", void 0);
29
33
  __decorate([
30
34
  (0, validate_nested_type_decorator_1.ValidateNestedType)(() => types_1.AllocationRequestData),
31
35
  __metadata("design:type", types_1.AllocationRequestData)
@@ -1 +1 @@
1
- {"version":3,"file":"allocate-game-request.js","sourceRoot":"","sources":["../../../src/v3/events/allocate-game-request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAyC;AAEzC,oCAAiD;AACjD,0CAAkD;AAClD,yDAAqD;AACrD,oGAAqF;AAErF,MAAa,0BAA0B;CAStC;AATD,gEASC;AAPC;IADC,IAAA,wBAAM,GAAE;;kEACc;AAGvB;IADC,IAAA,wBAAM,GAAE;;8DACU;AAGnB;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,6BAAqB,CAAC;8BACnC,6BAAqB;+DAAC;AAGrC,MAAa,mBAAoB,SAAQ,wBAAU;IAGjD,YACE,OAAmC,EACnC,OAA4B;QAE5B,KAAK,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAVH,kDAiBC;AAhBiB,8BAAU,GAAG,+CAA+C,CAAC;AAY7E;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,8BAAmB,CAAC;8BACrC,8BAAmB;oDAAC;AAG7B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;8BAC5C,0BAA0B;oDAAC"}
1
+ {"version":3,"file":"allocate-game-request.js","sourceRoot":"","sources":["../../../src/v3/events/allocate-game-request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiD;AAEjD,oCAAgE;AAChE,0CAAkD;AAClD,yDAAqD;AACrD,oGAAqF;AAErF,MAAa,0BAA0B;CAYtC;AAZD,gEAYC;AAVC;IADC,IAAA,wBAAM,GAAE;;kEACc;AAGvB;IADC,IAAA,wBAAM,GAAE;;8DACU;AAGnB;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;iEACO;AAG7B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,6BAAqB,CAAC;8BACnC,6BAAqB;+DAAC;AAGrC,MAAa,mBAAoB,SAAQ,wBAAU;IAGjD,YACE,OAAmC,EACnC,OAA4B;QAE5B,KAAK,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAVH,kDAiBC;AAhBiB,8BAAU,GAAG,+CAA+C,CAAC;AAY7E;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,8BAAmB,CAAC;8BACrC,8BAAmB;oDAAC;AAG7B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;8BAC5C,0BAA0B;oDAAC"}
@@ -1,10 +1,11 @@
1
1
  import { CloudResourceContext } from "../contexts";
2
2
  import { LudeoEvent } from "../../infra/ludeo-event";
3
- import { CloudProviderSettings, CloudResourceProviderSettings } from "../types";
3
+ import { CloudProviderSettings, CloudResourceProviderSettings, CloudProvider } from "../types";
4
4
  export declare class TerminateGameResourceRequestPayload {
5
5
  gameResourceId: string;
6
6
  gamePoolId: string;
7
7
  uploadLogs?: boolean;
8
+ cloudProvider: CloudProvider;
8
9
  providerSettings: CloudProviderSettings;
9
10
  resourceProviderSettings: CloudResourceProviderSettings;
10
11
  }
@@ -31,6 +31,10 @@ __decorate([
31
31
  (0, class_validator_1.IsOptional)(),
32
32
  __metadata("design:type", Boolean)
33
33
  ], TerminateGameResourceRequestPayload.prototype, "uploadLogs", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsEnum)(types_1.CloudProvider),
36
+ __metadata("design:type", String)
37
+ ], TerminateGameResourceRequestPayload.prototype, "cloudProvider", void 0);
34
38
  __decorate([
35
39
  (0, validate_nested_type_decorator_1.ValidateNestedType)(() => types_1.AWSProviderSettings),
36
40
  __metadata("design:type", Object)
@@ -1 +1 @@
1
- {"version":3,"file":"terminate-game-resource-request.js","sourceRoot":"","sources":["../../../src/v3/events/terminate-game-resource-request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAgE;AAEhE,0CAAmD;AACnD,yDAAqD;AACrD,oGAAqF;AACrF,oCAKkB;AAElB,MAAa,mCAAmC;CAgB/C;AAhBD,kFAgBC;AAdC;IADC,IAAA,wBAAM,GAAE;;2EACc;AAGvB;IADC,IAAA,wBAAM,GAAE;;uEACU;AAInB;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;uEACQ;AAGrB;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,2BAAmB,CAAC;;6EACN;AAGxC;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,mCAA2B,CAAC;;qFACE;AAG1D,MAAa,4BAA6B,SAAQ,wBAAU;IAG1D,YACE,OAA4C,EAC5C,OAA6B;QAE7B,KAAK,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAVH,oEAiBC;AAhBiB,uCAAU,GAAG,6CAA6C,CAAC;AAY3E;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,+BAAoB,CAAC;8BACtC,+BAAoB;6DAAC;AAG9B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,mCAAmC,CAAC;8BACrD,mCAAmC;6DAAC"}
1
+ {"version":3,"file":"terminate-game-resource-request.js","sourceRoot":"","sources":["../../../src/v3/events/terminate-game-resource-request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAwE;AAExE,0CAAmD;AACnD,yDAAqD;AACrD,oGAAqF;AACrF,oCAMkB;AAElB,MAAa,mCAAmC;CAmB/C;AAnBD,kFAmBC;AAjBC;IADC,IAAA,wBAAM,GAAE;;2EACc;AAGvB;IADC,IAAA,wBAAM,GAAE;;uEACU;AAInB;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;uEACQ;AAGrB;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;0EACO;AAG7B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,2BAAmB,CAAC;;6EACN;AAGxC;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,mCAA2B,CAAC;;qFACE;AAG1D,MAAa,4BAA6B,SAAQ,wBAAU;IAG1D,YACE,OAA4C,EAC5C,OAA6B;QAE7B,KAAK,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAVH,oEAiBC;AAhBiB,uCAAU,GAAG,6CAA6C,CAAC;AAY3E;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,+BAAoB,CAAC;8BACtC,+BAAoB;6DAAC;AAG9B;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,mCAAmC,CAAC;8BACrD,mCAAmC;6DAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludeo/cloud-common",
3
- "version": "1.1.46",
3
+ "version": "1.1.48",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Yahil Didi",
@@ -1,17 +1,18 @@
1
- import { CloudSessionContext } from "../contexts/cloud-session-context";
2
1
  import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
3
2
  import { LudeoEvent } from "../../infra/ludeo-event";
3
+ import { CloudSessionContext } from "../contexts";
4
4
 
5
5
  export class CloudSessionTerminated extends LudeoEvent {
6
6
  static readonly EVENT_NAME = "cloud-sessions.cloud-session-terminated";
7
7
 
8
- constructor(context: CloudSessionContext) {
8
+ constructor(payload: {}, context: CloudSessionContext) {
9
9
  super(CloudSessionTerminated.EVENT_NAME);
10
10
  this.context = context;
11
+ this.payload = payload;
11
12
  }
12
13
 
13
14
  @ValidateNestedType(() => CloudSessionContext)
14
15
  context: CloudSessionContext;
15
16
 
16
- payload: never;
17
+ payload: {};
17
18
  }
@@ -8,7 +8,7 @@ export * from "./cloud-resource-created.event";
8
8
  export * from "./cloud-resource-creation-failed.event";
9
9
  export * from "./cloud-resource-status.event";
10
10
  export * from "./cloud-session-allocated.event";
11
- export * from "./cloud-session-ended.event";
11
+ export * from "./cloud-session-terminated.event";
12
12
  export * from "./create-cloud-resource-request.event";
13
13
  export * from "./monitor-pool-task.event";
14
14
  export * from "./pool-created.event";
@@ -1,6 +1,6 @@
1
- import { IsUUID } from "class-validator";
1
+ import { IsEnum, IsUUID } from "class-validator";
2
2
 
3
- import { AllocationRequestData } from "../types";
3
+ import { AllocationRequestData, CloudProvider } from "../types";
4
4
  import { CloudSessionContext } from "../contexts";
5
5
  import { LudeoEvent } from "../../infra/ludeo-event";
6
6
  import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
@@ -12,6 +12,9 @@ export class AllocateGameRequestPayload {
12
12
  @IsUUID()
13
13
  gamePoolId: string;
14
14
 
15
+ @IsEnum(CloudProvider)
16
+ cloudProvider: CloudProvider;
17
+
15
18
  @ValidateNestedType(() => AllocationRequestData)
16
19
  requestData: AllocationRequestData;
17
20
  }
@@ -1,4 +1,4 @@
1
- import { IsUUID, IsBoolean, IsOptional } from "class-validator";
1
+ import { IsUUID, IsBoolean, IsOptional, IsEnum } from "class-validator";
2
2
 
3
3
  import { CloudResourceContext } from "../contexts";
4
4
  import { LudeoEvent } from "../../infra/ludeo-event";
@@ -8,6 +8,7 @@ import {
8
8
  CloudProviderSettings,
9
9
  AWSResourceProviderSettings,
10
10
  CloudResourceProviderSettings,
11
+ CloudProvider,
11
12
  } from "../types";
12
13
 
13
14
  export class TerminateGameResourceRequestPayload {
@@ -21,6 +22,9 @@ export class TerminateGameResourceRequestPayload {
21
22
  @IsOptional()
22
23
  uploadLogs?: boolean;
23
24
 
25
+ @IsEnum(CloudProvider)
26
+ cloudProvider: CloudProvider;
27
+
24
28
  @ValidateNestedType(() => AWSProviderSettings)
25
29
  providerSettings: CloudProviderSettings;
26
30