@ludeo/cloud-common 1.2.169-beta-yahil-5 → 1.2.169-beta-yahil-7
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/types/cloud/cloud-configuration-settings.d.ts +33 -38
- package/dist/v4/types/cloud/cloud-configuration-settings.js +8 -3
- package/dist/v4/types/cloud/cloud-configuration-settings.js.map +1 -1
- package/package.json +1 -1
- package/src/v4/types/cloud/cloud-configuration-settings.ts +58 -4
|
@@ -6,42 +6,37 @@ export declare enum CloudSettingsKeys {
|
|
|
6
6
|
ADDITIONAL_LAUNCH_ARGS = "additionalLaunchArgs",
|
|
7
7
|
ADDITIONAL_ENVIRONMENT_VARIABLES = "additionalEnvironmentVariables"
|
|
8
8
|
}
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
additionalEnvironmentVariables: {
|
|
42
|
-
type: string;
|
|
43
|
-
key: CloudSettingsKeys;
|
|
44
|
-
displayKey: string;
|
|
45
|
-
defaultValue: {};
|
|
46
|
-
};
|
|
9
|
+
export interface CloudSettingsTypeMap {
|
|
10
|
+
[CloudSettingsKeys.GAME_LOADING_TIME]: number;
|
|
11
|
+
[CloudSettingsKeys.FIRST_TIME_LUDEO_LOAD]: number;
|
|
12
|
+
[CloudSettingsKeys.NON_PRELOADED_LUDEO_LOAD]: number;
|
|
13
|
+
[CloudSettingsKeys.POST_GAME_LOAD_DELAY]: number;
|
|
14
|
+
[CloudSettingsKeys.ADDITIONAL_LAUNCH_ARGS]: string[];
|
|
15
|
+
[CloudSettingsKeys.ADDITIONAL_ENVIRONMENT_VARIABLES]: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export type CloudSettings = {
|
|
18
|
+
[K in CloudSettingsKeys]: CloudSettingsTypeMap[K];
|
|
19
|
+
};
|
|
20
|
+
export declare const getCloudSettingsByKey: <K extends CloudSettingsKeys>(key: K, cloudSettings: CloudSettings) => CloudSettingsTypeMap[K];
|
|
21
|
+
export type CloudSettingConfig = {
|
|
22
|
+
type: "number";
|
|
23
|
+
key: CloudSettingsKeys;
|
|
24
|
+
displayKey: string;
|
|
25
|
+
defaultValue: number;
|
|
26
|
+
} | {
|
|
27
|
+
type: "string";
|
|
28
|
+
key: CloudSettingsKeys;
|
|
29
|
+
displayKey: string;
|
|
30
|
+
defaultValue: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: "array";
|
|
33
|
+
key: CloudSettingsKeys;
|
|
34
|
+
displayKey: string;
|
|
35
|
+
defaultValue: string[];
|
|
36
|
+
} | {
|
|
37
|
+
type: "object";
|
|
38
|
+
key: CloudSettingsKeys;
|
|
39
|
+
displayKey: string;
|
|
40
|
+
defaultValue: Record<string, string>;
|
|
47
41
|
};
|
|
42
|
+
export declare const CLOUD_SETTINGS_DEFAULT_VALUES: Record<CloudSettingsKeys, CloudSettingConfig>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CLOUD_SETTINGS_DEFAULT_VALUES = exports.CloudSettingsKeys = void 0;
|
|
3
|
+
exports.CLOUD_SETTINGS_DEFAULT_VALUES = exports.getCloudSettingsByKey = exports.CloudSettingsKeys = void 0;
|
|
4
4
|
var CloudSettingsKeys;
|
|
5
5
|
(function (CloudSettingsKeys) {
|
|
6
6
|
CloudSettingsKeys["GAME_LOADING_TIME"] = "gameLoadingTime";
|
|
@@ -10,6 +10,11 @@ var CloudSettingsKeys;
|
|
|
10
10
|
CloudSettingsKeys["ADDITIONAL_LAUNCH_ARGS"] = "additionalLaunchArgs";
|
|
11
11
|
CloudSettingsKeys["ADDITIONAL_ENVIRONMENT_VARIABLES"] = "additionalEnvironmentVariables";
|
|
12
12
|
})(CloudSettingsKeys || (exports.CloudSettingsKeys = CloudSettingsKeys = {}));
|
|
13
|
+
const getCloudSettingsByKey = (key, cloudSettings) => {
|
|
14
|
+
return (cloudSettings[key] ||
|
|
15
|
+
exports.CLOUD_SETTINGS_DEFAULT_VALUES[key].defaultValue);
|
|
16
|
+
};
|
|
17
|
+
exports.getCloudSettingsByKey = getCloudSettingsByKey;
|
|
13
18
|
exports.CLOUD_SETTINGS_DEFAULT_VALUES = {
|
|
14
19
|
[CloudSettingsKeys.GAME_LOADING_TIME]: {
|
|
15
20
|
type: "number",
|
|
@@ -27,13 +32,13 @@ exports.CLOUD_SETTINGS_DEFAULT_VALUES = {
|
|
|
27
32
|
type: "number",
|
|
28
33
|
key: CloudSettingsKeys.NON_PRELOADED_LUDEO_LOAD,
|
|
29
34
|
displayKey: "Non Preloaded Ludeo Load (ms)",
|
|
30
|
-
defaultValue:
|
|
35
|
+
defaultValue: 25000,
|
|
31
36
|
},
|
|
32
37
|
[CloudSettingsKeys.POST_GAME_LOAD_DELAY]: {
|
|
33
38
|
type: "number",
|
|
34
39
|
key: CloudSettingsKeys.POST_GAME_LOAD_DELAY,
|
|
35
40
|
displayKey: "Post Game Load Delay (ms)",
|
|
36
|
-
defaultValue:
|
|
41
|
+
defaultValue: 30000,
|
|
37
42
|
},
|
|
38
43
|
[CloudSettingsKeys.ADDITIONAL_LAUNCH_ARGS]: {
|
|
39
44
|
type: "array",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-configuration-settings.js","sourceRoot":"","sources":["../../../../src/v4/types/cloud/cloud-configuration-settings.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,0DAAqC,CAAA;IACrC,iEAA4C,CAAA;IAC5C,uEAAkD,CAAA;IAClD,+DAA0C,CAAA;IAC1C,oEAA+C,CAAA;IAC/C,wFAAmE,CAAA;AACrE,CAAC,EAPW,iBAAiB,iCAAjB,iBAAiB,QAO5B;
|
|
1
|
+
{"version":3,"file":"cloud-configuration-settings.js","sourceRoot":"","sources":["../../../../src/v4/types/cloud/cloud-configuration-settings.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,0DAAqC,CAAA;IACrC,iEAA4C,CAAA;IAC5C,uEAAkD,CAAA;IAClD,+DAA0C,CAAA;IAC1C,oEAA+C,CAAA;IAC/C,wFAAmE,CAAA;AACrE,CAAC,EAPW,iBAAiB,iCAAjB,iBAAiB,QAO5B;AAkBM,MAAM,qBAAqB,GAAG,CACnC,GAAM,EACN,aAA4B,EACH,EAAE;IAC3B,OAAO,CACL,aAAa,CAAC,GAAG,CAAC;QACjB,qCAA6B,CAAC,GAAG,CAAC,CAAC,YAAwC,CAC7E,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,qBAAqB,yBAQhC;AA6BW,QAAA,6BAA6B,GAGtC;IACF,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,EAAE;QACrC,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,iBAAiB,CAAC,iBAAiB;QACxC,UAAU,EAAE,wBAAwB;QACpC,YAAY,EAAE,MAAM;KACrB;IACD,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,EAAE;QACzC,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,iBAAiB,CAAC,qBAAqB;QAC5C,UAAU,EAAE,4BAA4B;QACxC,YAAY,EAAE,KAAK;KACpB;IACD,CAAC,iBAAiB,CAAC,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,KAAK;KACpB;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;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -7,9 +7,63 @@ export enum CloudSettingsKeys {
|
|
|
7
7
|
ADDITIONAL_ENVIRONMENT_VARIABLES = "additionalEnvironmentVariables",
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// Define the mapping of setting keys to their actual value types
|
|
11
|
+
export interface CloudSettingsTypeMap {
|
|
12
|
+
[CloudSettingsKeys.GAME_LOADING_TIME]: number;
|
|
13
|
+
[CloudSettingsKeys.FIRST_TIME_LUDEO_LOAD]: number;
|
|
14
|
+
[CloudSettingsKeys.NON_PRELOADED_LUDEO_LOAD]: number;
|
|
15
|
+
[CloudSettingsKeys.POST_GAME_LOAD_DELAY]: number;
|
|
16
|
+
[CloudSettingsKeys.ADDITIONAL_LAUNCH_ARGS]: string[];
|
|
17
|
+
[CloudSettingsKeys.ADDITIONAL_ENVIRONMENT_VARIABLES]: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Create a type-safe CloudSettings type
|
|
21
|
+
export type CloudSettings = {
|
|
22
|
+
[K in CloudSettingsKeys]: CloudSettingsTypeMap[K];
|
|
23
|
+
};
|
|
11
24
|
|
|
12
|
-
|
|
25
|
+
// Type-safe getter function that returns the specific value type for each key
|
|
26
|
+
export const getCloudSettingsByKey = <K extends CloudSettingsKeys>(
|
|
27
|
+
key: K,
|
|
28
|
+
cloudSettings: CloudSettings
|
|
29
|
+
): CloudSettingsTypeMap[K] => {
|
|
30
|
+
return (
|
|
31
|
+
cloudSettings[key] ||
|
|
32
|
+
(CLOUD_SETTINGS_DEFAULT_VALUES[key].defaultValue as CloudSettingsTypeMap[K])
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Discriminated union for type-safe configuration
|
|
37
|
+
export type CloudSettingConfig =
|
|
38
|
+
| {
|
|
39
|
+
type: "number";
|
|
40
|
+
key: CloudSettingsKeys;
|
|
41
|
+
displayKey: string;
|
|
42
|
+
defaultValue: number;
|
|
43
|
+
}
|
|
44
|
+
| {
|
|
45
|
+
type: "string";
|
|
46
|
+
key: CloudSettingsKeys;
|
|
47
|
+
displayKey: string;
|
|
48
|
+
defaultValue: string;
|
|
49
|
+
}
|
|
50
|
+
| {
|
|
51
|
+
type: "array";
|
|
52
|
+
key: CloudSettingsKeys;
|
|
53
|
+
displayKey: string;
|
|
54
|
+
defaultValue: string[];
|
|
55
|
+
}
|
|
56
|
+
| {
|
|
57
|
+
type: "object";
|
|
58
|
+
key: CloudSettingsKeys;
|
|
59
|
+
displayKey: string;
|
|
60
|
+
defaultValue: Record<string, string>;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const CLOUD_SETTINGS_DEFAULT_VALUES: Record<
|
|
64
|
+
CloudSettingsKeys,
|
|
65
|
+
CloudSettingConfig
|
|
66
|
+
> = {
|
|
13
67
|
[CloudSettingsKeys.GAME_LOADING_TIME]: {
|
|
14
68
|
type: "number",
|
|
15
69
|
key: CloudSettingsKeys.GAME_LOADING_TIME,
|
|
@@ -26,13 +80,13 @@ export const CLOUD_SETTINGS_DEFAULT_VALUES = {
|
|
|
26
80
|
type: "number",
|
|
27
81
|
key: CloudSettingsKeys.NON_PRELOADED_LUDEO_LOAD,
|
|
28
82
|
displayKey: "Non Preloaded Ludeo Load (ms)",
|
|
29
|
-
defaultValue:
|
|
83
|
+
defaultValue: 25000,
|
|
30
84
|
},
|
|
31
85
|
[CloudSettingsKeys.POST_GAME_LOAD_DELAY]: {
|
|
32
86
|
type: "number",
|
|
33
87
|
key: CloudSettingsKeys.POST_GAME_LOAD_DELAY,
|
|
34
88
|
displayKey: "Post Game Load Delay (ms)",
|
|
35
|
-
defaultValue:
|
|
89
|
+
defaultValue: 30000,
|
|
36
90
|
},
|
|
37
91
|
[CloudSettingsKeys.ADDITIONAL_LAUNCH_ARGS]: {
|
|
38
92
|
type: "array",
|