@ludeo/cloud-common 1.2.254 → 1.2.256
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/v4/events/provisioner/provisioning-ended.d.ts +2 -0
- package/dist/v4/events/provisioner/provisioning-ended.js +5 -0
- package/dist/v4/events/provisioner/provisioning-ended.js.map +1 -1
- package/dist/v4/types/cloud/cloud-configuration-settings.js +2 -2
- package/dist/v4/types/cloud/cloud-configuration-settings.js.map +1 -1
- package/dist/v4/types/cloud/cloud-configuration-settings.spec.d.ts +1 -0
- package/dist/v4/types/cloud/cloud-configuration-settings.spec.js +12 -0
- package/dist/v4/types/cloud/cloud-configuration-settings.spec.js.map +1 -0
- package/package.json +1 -1
- package/src/v4/events/provisioner/provisioning-ended.ts +9 -1
- package/src/v4/types/cloud/cloud-configuration-settings.spec.ts +12 -0
- package/src/v4/types/cloud/cloud-configuration-settings.ts +4 -5
|
@@ -8,6 +8,7 @@ export declare class UserLocationDemandAllocation {
|
|
|
8
8
|
majorVersion: string;
|
|
9
9
|
demand: number;
|
|
10
10
|
}
|
|
11
|
+
export type GamePoolAllocationSplits = Record<string, number>;
|
|
11
12
|
export declare class ProvisionedPoolMetadata {
|
|
12
13
|
instanceType: string;
|
|
13
14
|
region: string;
|
|
@@ -15,6 +16,7 @@ export declare class ProvisionedPoolMetadata {
|
|
|
15
16
|
userLocationDemandAllocations?: UserLocationDemandAllocation[];
|
|
16
17
|
machinePoolId?: string;
|
|
17
18
|
effectiveSupplyConstraint?: number;
|
|
19
|
+
gamePoolAllocationSplits?: GamePoolAllocationSplits;
|
|
18
20
|
}
|
|
19
21
|
export declare class ProvisionedPool {
|
|
20
22
|
poolId: string;
|
|
@@ -66,6 +66,11 @@ __decorate([
|
|
|
66
66
|
(0, class_validator_1.IsOptional)(),
|
|
67
67
|
__metadata("design:type", Number)
|
|
68
68
|
], ProvisionedPoolMetadata.prototype, "effectiveSupplyConstraint", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, class_validator_1.IsOptional)(),
|
|
71
|
+
(0, class_validator_1.IsObject)(),
|
|
72
|
+
__metadata("design:type", Object)
|
|
73
|
+
], ProvisionedPoolMetadata.prototype, "gamePoolAllocationSplits", void 0);
|
|
69
74
|
class ProvisionedPool {
|
|
70
75
|
}
|
|
71
76
|
exports.ProvisionedPool = ProvisionedPool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provisioning-ended.js","sourceRoot":"","sources":["../../../../src/v4/events/provisioner/provisioning-ended.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAC5C,oDAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"provisioning-ended.js","sourceRoot":"","sources":["../../../../src/v4/events/provisioner/provisioning-ended.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAC5C,oDAAyD;AACzD,qDAAuG;AACvG,6CAAoD;AACpD,qDAAsD;AACtD,6CAAkD;AAElD,MAAa,4BAA4B;CAYxC;AAZD,oEAYC;AAVG;IADC,IAAA,0BAAQ,GAAE;;8DACM;AAGjB;IADC,IAAA,0BAAQ,GAAE;;4DACI;AAGf;IADC,IAAA,0BAAQ,GAAE;;kEACU;AAGrB;IADC,IAAA,0BAAQ,GAAE;;4DACI;AAMnB,MAAa,uBAAuB;CA4BnC;AA5BD,0DA4BC;AA1BG;IADC,IAAA,0BAAQ,GAAE;;6DACU;AAGrB;IADC,IAAA,0BAAQ,GAAE;;uDACI;AAGf;IADC,IAAA,wBAAM,EAAC,qBAAa,CAAC;;qDACF;AAKpB;IAHC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;IACZ,IAAA,+BAAkB,EAAC,GAAG,EAAE,CAAC,4BAA4B,CAAC;;8EACQ;AAI/D;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;8DACU;AAIvB;IAFC,IAAA,0BAAQ,GA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
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const raw = cloudSettings[key];
|
|
34
|
+
return (raw ?? exports.CLOUD_SETTINGS_DEFAULT_VALUES[key].defaultValue);
|
|
35
35
|
};
|
|
36
36
|
exports.getCloudSettingsByKey = getCloudSettingsByKey;
|
|
37
37
|
exports.CLOUD_SETTINGS_DEFAULT_VALUES = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-configuration-settings.js","sourceRoot":"","sources":["../../../../src/v4/types/cloud/cloud-configuration-settings.ts"],"names":[],"mappings":";;;AAAA,iDAAyD;AAEzD,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B,0DAAqC,CAAA;IACrC,iEAA4C,CAAA;IAC5C,uEAAkD,CAAA;IAClD,+DAA0C,CAAA;IAC1C,oEAA+C,CAAA;IAC/C,wFAAmE,CAAA;IACnE,oEAA+C,CAAA;IAC/C,iDAA4B,CAAA;AAC9B,CAAC,EATW,iBAAiB,iCAAjB,iBAAiB,QAS5B;AAeY,QAAA,qCAAqC,GAAG;IACnD,sCAAuB,CAAC,aAAa;IACrC,sCAAuB,CAAC,YAAY;IACpC,sCAAuB,CAAC,cAAc;IACtC,sCAAuB,CAAC,YAAY;IACpC,sCAAuB,CAAC,UAAU;IAClC,sCAAuB,CAAC,UAAU;IAClC,sCAAuB,CAAC,cAAc;IACtC,sCAAuB,CAAC,UAAU;IAClC,sCAAuB,CAAC,UAAU;IAClC,sCAAuB,CAAC,WAAW;IACnC,sCAAuB,CAAC,WAAW;IACnC,sCAAuB,CAAC,cAAc;IACtC,sCAAuB,CAAC,WAAW;IACnC,sCAAuB,CAAC,WAAW;CAEpC,CAAC;
|
|
1
|
+
{"version":3,"file":"cloud-configuration-settings.js","sourceRoot":"","sources":["../../../../src/v4/types/cloud/cloud-configuration-settings.ts"],"names":[],"mappings":";;;AAAA,iDAAyD;AAEzD,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B,0DAAqC,CAAA;IACrC,iEA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C,wBAAwB,CAAC,EAAE;QAC5C,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,iBAAiB,CAAC,wBAAwB;QAC/C,UAAU,EAAE,+BAA+B;QAC3C,YAAY,EAAE,KAAK;KACpB;IACD,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,EAAE;QACxC,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,iBAAiB,CAAC,oBAAoB;QAC3C,UAAU,EAAE,2BAA2B;QACvC,YAAY,EAAE,CAAC;KAChB;IACD,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,EAAE;QAC1C,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,iBAAiB,CAAC,sBAAsB;QAC7C,UAAU,EAAE,wBAAwB;QACpC,YAAY,EAAE,EAAE;KACjB;IACD,CAAC,iBAAiB,CAAC,gCAAgC,CAAC,EAAE;QACpD,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,iBAAiB,CAAC,gCAAgC;QACvD,UAAU,EAAE,kCAAkC;QAC9C,YAAY,EAAE,EAAE;KACjB;IACD,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,EAAE;QAC1C,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,iBAAiB,CAAC,sBAAsB;QAC7C,UAAU,EAAE,wBAAwB;QACpC,YAAY,EAAE,6CAAqC;KACpD;IACD,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAAE;QAChC,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,iBAAiB,CAAC,YAAY;QACnC,UAAU,EAAE,kBAAkB;QAC9B,YAAY,EAAE,GAAG;KAClB;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cloud_configuration_settings_1 = require("./cloud-configuration-settings");
|
|
4
|
+
describe("getCloudSettingsByKey", () => {
|
|
5
|
+
it("preserves SPOT_ROLLOUT 0 instead of falling back to default (100)", () => {
|
|
6
|
+
const settings = {
|
|
7
|
+
[cloud_configuration_settings_1.CloudSettingsKeys.SPOT_ROLLOUT]: 0,
|
|
8
|
+
};
|
|
9
|
+
expect((0, cloud_configuration_settings_1.getCloudSettingsByKey)(cloud_configuration_settings_1.CloudSettingsKeys.SPOT_ROLLOUT, settings)).toBe(0);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=cloud-configuration-settings.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-configuration-settings.spec.js","sourceRoot":"","sources":["../../../../src/v4/types/cloud/cloud-configuration-settings.spec.ts"],"names":[],"mappings":";;AACA,iFAA0F;AAE1F,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QACzE,MAAM,QAAQ,GAAG;YACb,CAAC,gDAAiB,CAAC,YAAY,CAAC,EAAE,CAAC;SACrB,CAAC;QAEnB,MAAM,CAAC,IAAA,oDAAqB,EAAC,gDAAiB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LudeoEvent } from "../../../infra";
|
|
2
2
|
import { ValidateNestedType } from "../../../decorators";
|
|
3
|
-
import { IsArray, IsDefined, IsEnum, IsNumber, IsOptional, IsString } from "class-validator";
|
|
3
|
+
import { IsArray, IsDefined, IsEnum, IsNumber, IsObject, IsOptional, IsString } from "class-validator";
|
|
4
4
|
import { ProvisionerContext } from "../../contexts";
|
|
5
5
|
import { LudeoFeatures } from "../../types/predictor";
|
|
6
6
|
import { CloudPoolType } from "../../types/pools";
|
|
@@ -19,6 +19,9 @@ export class UserLocationDemandAllocation {
|
|
|
19
19
|
demand: number;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/** gamePoolId → allocated units on this machine pool (ProvisioningEnded machine pool metadata only). */
|
|
23
|
+
export type GamePoolAllocationSplits = Record<string, number>;
|
|
24
|
+
|
|
22
25
|
export class ProvisionedPoolMetadata {
|
|
23
26
|
@IsString()
|
|
24
27
|
instanceType: string;
|
|
@@ -42,6 +45,11 @@ export class ProvisionedPoolMetadata {
|
|
|
42
45
|
@IsOptional()
|
|
43
46
|
effectiveSupplyConstraint?: number;
|
|
44
47
|
|
|
48
|
+
/** Machine pools only: allocated units per game pool id on this machine pool (sums to pool size when present). */
|
|
49
|
+
@IsOptional()
|
|
50
|
+
@IsObject()
|
|
51
|
+
gamePoolAllocationSplits?: GamePoolAllocationSplits;
|
|
52
|
+
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
export class ProvisionedPool {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CloudSettings } from "./cloud-configuration-settings";
|
|
2
|
+
import { CloudSettingsKeys, getCloudSettingsByKey } from "./cloud-configuration-settings";
|
|
3
|
+
|
|
4
|
+
describe("getCloudSettingsByKey", () => {
|
|
5
|
+
it("preserves SPOT_ROLLOUT 0 instead of falling back to default (100)", () => {
|
|
6
|
+
const settings = {
|
|
7
|
+
[CloudSettingsKeys.SPOT_ROLLOUT]: 0,
|
|
8
|
+
} as CloudSettings;
|
|
9
|
+
|
|
10
|
+
expect(getCloudSettingsByKey(CloudSettingsKeys.SPOT_ROLLOUT, settings)).toBe(0);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -48,14 +48,13 @@ export type CloudSettings = {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
// Type-safe getter function that returns the specific value type for each key
|
|
51
|
+
/** Uses nullish coalescing so numeric 0 (e.g. SPOT_ROLLOUT) is not replaced by defaults. */
|
|
51
52
|
export const getCloudSettingsByKey = <K extends CloudSettingsKeys>(
|
|
52
53
|
key: K,
|
|
53
|
-
cloudSettings: CloudSettings
|
|
54
|
+
cloudSettings: CloudSettings,
|
|
54
55
|
): CloudSettingsTypeMap[K] => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
(CLOUD_SETTINGS_DEFAULT_VALUES[key].defaultValue as CloudSettingsTypeMap[K])
|
|
58
|
-
);
|
|
56
|
+
const raw = cloudSettings[key];
|
|
57
|
+
return (raw ?? CLOUD_SETTINGS_DEFAULT_VALUES[key].defaultValue) as CloudSettingsTypeMap[K];
|
|
59
58
|
};
|
|
60
59
|
|
|
61
60
|
// Discriminated union for type-safe configuration
|