@ludeo/cloud-common 1.2.274-beta-yahil-1 → 1.2.275

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.
@@ -1,16 +1,19 @@
1
1
  import { CloudSessionContext } from "../contexts/cloud-session-context";
2
2
  import { LudeoEvent } from "../../infra/ludeo-event";
3
3
  export declare enum AllocateCloudSessionFailureCode {
4
- NOT_AVAILABLE = "NOT_AVAILABLE",
5
- TIMEOUT = "TIMEOUT",
6
- NO_AVAILABLE_POOLS = "NO_AVAILABLE_POOLS",
7
- INVALID_REQUEST = "INVALID_REQUEST",
8
- INTERNAL = "INTERNAL"
4
+ NOT_AVAILABLE_ERROR = "NOT_AVAILABLE_ERROR",
5
+ QUEUE_TIMEOUT_ERROR = "QUEUE_TIMEOUT_ERROR",
6
+ NO_AVAILABLE_POOLS_REGION_ERROR = "NO_AVAILABLE_POOLS_REGION_ERROR",
7
+ NO_AVAILABLE_POOLS_HARDWARE_ERROR = "NO_AVAILABLE_POOLS_HARDWARE_ERROR",
8
+ INVALID_REQUEST_ERROR = "INVALID_REQUEST_ERROR",
9
+ INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR"
9
10
  }
10
11
  export declare class AllocateCloudSessionFailedPayload {
11
- error: string;
12
- errorCode?: AllocateCloudSessionFailureCode;
13
- retryable?: boolean;
12
+ code?: AllocateCloudSessionFailureCode;
13
+ description?: string;
14
+ error?: string;
15
+ stack?: string;
16
+ isRetryable?: boolean;
14
17
  }
15
18
  export declare class AllocateCloudSessionFailed extends LudeoEvent {
16
19
  static readonly EVENT_NAME = "cloud-session-allocator.allocate-cloud-session-failed";
@@ -16,29 +16,41 @@ const validate_nested_type_decorator_1 = require("../../decorators/validate-nest
16
16
  const ludeo_event_1 = require("../../infra/ludeo-event");
17
17
  var AllocateCloudSessionFailureCode;
18
18
  (function (AllocateCloudSessionFailureCode) {
19
- AllocateCloudSessionFailureCode["NOT_AVAILABLE"] = "NOT_AVAILABLE";
20
- AllocateCloudSessionFailureCode["TIMEOUT"] = "TIMEOUT";
21
- AllocateCloudSessionFailureCode["NO_AVAILABLE_POOLS"] = "NO_AVAILABLE_POOLS";
22
- AllocateCloudSessionFailureCode["INVALID_REQUEST"] = "INVALID_REQUEST";
23
- AllocateCloudSessionFailureCode["INTERNAL"] = "INTERNAL";
19
+ AllocateCloudSessionFailureCode["NOT_AVAILABLE_ERROR"] = "NOT_AVAILABLE_ERROR";
20
+ AllocateCloudSessionFailureCode["QUEUE_TIMEOUT_ERROR"] = "QUEUE_TIMEOUT_ERROR";
21
+ AllocateCloudSessionFailureCode["NO_AVAILABLE_POOLS_REGION_ERROR"] = "NO_AVAILABLE_POOLS_REGION_ERROR";
22
+ AllocateCloudSessionFailureCode["NO_AVAILABLE_POOLS_HARDWARE_ERROR"] = "NO_AVAILABLE_POOLS_HARDWARE_ERROR";
23
+ AllocateCloudSessionFailureCode["INVALID_REQUEST_ERROR"] = "INVALID_REQUEST_ERROR";
24
+ AllocateCloudSessionFailureCode["INTERNAL_SERVER_ERROR"] = "INTERNAL_SERVER_ERROR";
24
25
  })(AllocateCloudSessionFailureCode || (exports.AllocateCloudSessionFailureCode = AllocateCloudSessionFailureCode = {}));
25
26
  class AllocateCloudSessionFailedPayload {
26
27
  }
27
28
  exports.AllocateCloudSessionFailedPayload = AllocateCloudSessionFailedPayload;
28
29
  __decorate([
30
+ (0, class_validator_1.IsOptional)(),
31
+ (0, class_validator_1.IsEnum)(AllocateCloudSessionFailureCode),
32
+ __metadata("design:type", String)
33
+ ], AllocateCloudSessionFailedPayload.prototype, "code", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsOptional)(),
36
+ (0, class_validator_1.IsString)(),
37
+ __metadata("design:type", String)
38
+ ], AllocateCloudSessionFailedPayload.prototype, "description", void 0);
39
+ __decorate([
40
+ (0, class_validator_1.IsOptional)(),
29
41
  (0, class_validator_1.IsString)(),
30
42
  __metadata("design:type", String)
31
43
  ], AllocateCloudSessionFailedPayload.prototype, "error", void 0);
32
44
  __decorate([
33
45
  (0, class_validator_1.IsOptional)(),
34
- (0, class_validator_1.IsEnum)(AllocateCloudSessionFailureCode),
46
+ (0, class_validator_1.IsString)(),
35
47
  __metadata("design:type", String)
36
- ], AllocateCloudSessionFailedPayload.prototype, "errorCode", void 0);
48
+ ], AllocateCloudSessionFailedPayload.prototype, "stack", void 0);
37
49
  __decorate([
38
50
  (0, class_validator_1.IsOptional)(),
39
51
  (0, class_validator_1.IsBoolean)(),
40
52
  __metadata("design:type", Boolean)
41
- ], AllocateCloudSessionFailedPayload.prototype, "retryable", void 0);
53
+ ], AllocateCloudSessionFailedPayload.prototype, "isRetryable", void 0);
42
54
  class AllocateCloudSessionFailed extends ludeo_event_1.LudeoEvent {
43
55
  constructor(payload, context) {
44
56
  super(AllocateCloudSessionFailed.EVENT_NAME);
@@ -1 +1 @@
1
- {"version":3,"file":"allocate-cloud-session-failed.js","sourceRoot":"","sources":["../../../src/v4/events/allocate-cloud-session-failed.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0E;AAC1E,6EAAwE;AACxE,oGAAqF;AACrF,yDAAqD;AAErD,IAAY,+BAWX;AAXD,WAAY,+BAA+B;IAEzC,kEAA+B,CAAA;IAE/B,sDAAmB,CAAA;IAEnB,4EAAyC,CAAA;IAEzC,sEAAmC,CAAA;IAEnC,wDAAqB,CAAA;AACvB,CAAC,EAXW,+BAA+B,+CAA/B,+BAA+B,QAW1C;AAED,MAAa,iCAAiC;CAY7C;AAZD,8EAYC;AAVC;IADC,IAAA,0BAAQ,GAAE;;gEACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,+BAA+B,CAAC;;oEACI;AAK5C;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;oEACQ;AAEtB,MAAa,0BAA2B,SAAQ,wBAAU;IAIxD,YACE,OAA0C,EAC1C,OAA4B;QAE5B,KAAK,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAXH,gEAkBC;AAjBiB,qCAAU,GACxB,uDAAuD,CAAC;AAY1D;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,iCAAiC,CAAC;8BACnD,iCAAiC;2DAAC;AAG3C;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,2CAAmB,CAAC;8BACrC,2CAAmB;2DAAC"}
1
+ {"version":3,"file":"allocate-cloud-session-failed.js","sourceRoot":"","sources":["../../../src/v4/events/allocate-cloud-session-failed.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0E;AAC1E,6EAAwE;AACxE,oGAAqF;AACrF,yDAAqD;AAErD,IAAY,+BAaX;AAbD,WAAY,+BAA+B;IAEzC,8EAA2C,CAAA;IAE3C,8EAA2C,CAAA;IAE3C,sGAAmE,CAAA;IAEnE,0GAAuE,CAAA;IAEvE,kFAA+C,CAAA;IAE/C,kFAA+C,CAAA;AACjD,CAAC,EAbW,+BAA+B,+CAA/B,+BAA+B,QAa1C;AAED,MAAa,iCAAiC;CAyB7C;AAzBD,8EAyBC;AArBC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,+BAA+B,CAAC;;+DACD;AAKvC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;sEACU;AAKrB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gEACI;AAKf;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gEACI;AAKf;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;sEACU;AAExB,MAAa,0BAA2B,SAAQ,wBAAU;IAIxD,YACE,OAA0C,EAC1C,OAA4B;QAE5B,KAAK,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;;AAXH,gEAkBC;AAjBiB,qCAAU,GACxB,uDAAuD,CAAC;AAY1D;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,iCAAiC,CAAC;8BACnD,iCAAiC;2DAAC;AAG3C;IADC,IAAA,mDAAkB,EAAC,GAAG,EAAE,CAAC,2CAAmB,CAAC;8BACrC,2CAAmB;2DAAC"}
@@ -2,8 +2,8 @@ import { LudeoEvent } from "../../infra/ludeo-event";
2
2
  import { CloudPoolContext } from "../contexts";
3
3
  export declare class LudeoAvailablePayload {
4
4
  ludeoPoolId: string;
5
- gamePoolId?: string;
6
- ludeoId?: string;
5
+ gamePoolId: string;
6
+ ludeoId: string;
7
7
  }
8
8
  export declare class LudeoAvailable extends LudeoEvent {
9
9
  static readonly EVENT_NAME = "cloud-pools.ludeo-available";
@@ -22,12 +22,10 @@ __decorate([
22
22
  __metadata("design:type", String)
23
23
  ], LudeoAvailablePayload.prototype, "ludeoPoolId", void 0);
24
24
  __decorate([
25
- (0, class_validator_1.IsOptional)(),
26
25
  (0, class_validator_1.IsUUID)(),
27
26
  __metadata("design:type", String)
28
27
  ], LudeoAvailablePayload.prototype, "gamePoolId", void 0);
29
28
  __decorate([
30
- (0, class_validator_1.IsOptional)(),
31
29
  (0, class_validator_1.IsUUID)(),
32
30
  __metadata("design:type", String)
33
31
  ], LudeoAvailablePayload.prototype, "ludeoId", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"ludeo-available.js","sourceRoot":"","sources":["../../../src/v4/events/ludeo-available.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAqD;AAErD,oGAAqF;AACrF,yDAAqD;AACrD,0CAA+C;AAE/C,MAAa,qBAAqB;CAcjC;AAdD,sDAcC;AAZC;IADC,IAAA,wBAAM,GAAE;;0DACW;AAMpB;IAFC,IAAA,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B,EAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC;8BACvC,qBAAqB;+CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludeo/cloud-common",
3
- "version": "1.2.274-beta-yahil-1",
3
+ "version": "1.2.275",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Yahil Didi",
@@ -5,29 +5,44 @@ import { LudeoEvent } from "../../infra/ludeo-event";
5
5
 
6
6
  export enum AllocateCloudSessionFailureCode {
7
7
  // No machines and autoscale is off — nothing can ever serve this request.
8
- NOT_AVAILABLE = "NOT_AVAILABLE",
8
+ NOT_AVAILABLE_ERROR = "NOT_AVAILABLE_ERROR",
9
9
  // Held in the queue past QUEUE_MAX_WAIT_MS.
10
- TIMEOUT = "TIMEOUT",
11
- // No eligible pools matched (region/hardware/version).
12
- NO_AVAILABLE_POOLS = "NO_AVAILABLE_POOLS",
10
+ QUEUE_TIMEOUT_ERROR = "QUEUE_TIMEOUT_ERROR",
11
+ // No eligible pools matched the requested region.
12
+ NO_AVAILABLE_POOLS_REGION_ERROR = "NO_AVAILABLE_POOLS_REGION_ERROR",
13
+ // No eligible pools matched the requested hardware.
14
+ NO_AVAILABLE_POOLS_HARDWARE_ERROR = "NO_AVAILABLE_POOLS_HARDWARE_ERROR",
13
15
  // Bad request payload.
14
- INVALID_REQUEST = "INVALID_REQUEST",
16
+ INVALID_REQUEST_ERROR = "INVALID_REQUEST_ERROR",
15
17
  // Unexpected failure.
16
- INTERNAL = "INTERNAL",
18
+ INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR",
17
19
  }
18
20
 
19
21
  export class AllocateCloudSessionFailedPayload {
22
+ // Structured failure code (queue V2). Omitted on the legacy path.
23
+ @IsOptional()
24
+ @IsEnum(AllocateCloudSessionFailureCode)
25
+ code?: AllocateCloudSessionFailureCode;
26
+
27
+ // Human-readable failure message. Optional during rollout — old in-flight events carry `error` instead.
28
+ @IsOptional()
20
29
  @IsString()
21
- error: string;
30
+ description?: string;
22
31
 
32
+ // @deprecated legacy message field, kept so events produced before the rename still parse. Read `description ?? error`.
23
33
  @IsOptional()
24
- @IsEnum(AllocateCloudSessionFailureCode)
25
- errorCode?: AllocateCloudSessionFailureCode;
34
+ @IsString()
35
+ error?: string;
36
+
37
+ // Optional error stack for debugging (not shown to the player).
38
+ @IsOptional()
39
+ @IsString()
40
+ stack?: string;
26
41
 
27
- // Whether retrying the request could plausibly succeed. NOT_AVAILABLE/INVALID_REQUEST are false.
42
+ // Whether retrying could plausibly succeed. NOT_AVAILABLE/INVALID_REQUEST are false.
28
43
  @IsOptional()
29
44
  @IsBoolean()
30
- retryable?: boolean;
45
+ isRetryable?: boolean;
31
46
  }
32
47
  export class AllocateCloudSessionFailed extends LudeoEvent {
33
48
  static readonly EVENT_NAME =
@@ -1,4 +1,4 @@
1
- import { IsOptional, IsUUID } from "class-validator";
1
+ import { IsUUID } from "class-validator";
2
2
 
3
3
  import { ValidateNestedType } from "../../decorators/validate-nested-type.decorator";
4
4
  import { LudeoEvent } from "../../infra/ludeo-event";
@@ -8,16 +8,13 @@ export class LudeoAvailablePayload {
8
8
  @IsUUID()
9
9
  ludeoPoolId: string;
10
10
 
11
- // Parent game pool — the waiting queue this freed slot pops. Optional for
12
- // backwards-compat; the allocator falls back to its ludeoPool→gamePool mapping.
13
- @IsOptional()
11
+ // Parent game pool — the waiting queue this freed slot pops.
14
12
  @IsUUID()
15
- gamePoolId?: string;
13
+ gamePoolId: string;
16
14
 
17
- // The ludeo this freed slot is for. Optional for backwards-compat.
18
- @IsOptional()
15
+ // The ludeo this freed slot is for.
19
16
  @IsUUID()
20
- ludeoId?: string;
17
+ ludeoId: string;
21
18
  }
22
19
 
23
20
  export class LudeoAvailable extends LudeoEvent {