This repository was archived by the owner on Dec 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcloud-config-manager.d.ts
87 lines (76 loc) · 2.45 KB
/
cloud-config-manager.d.ts
1
2
3
4
5
6
7
8
9
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
interface ICloudConfigManager {
/**
* Resets config.json to it's default values.
* @returns {void}
*/
reset(): void;
/**
* Applies specific configuration and saves it in config.json
* @param {string} configName The name of the configuration to be applied.
* @param {IConfigOptions} [options] The config options.
* @param {IServerConfigBase} [globalServerConfig] The global server configuration which will
* be used when changing the configuration. This parameter will override the default global configuration.
* @returns {void}
*/
applyConfig(configName: string, options?: IConfigOptions, globalServerConfig?: IServerConfigBase): void;
/**
* Returns the current cloud configuration.
* @returns {IServerConfig}
*/
getCurrentConfigData(): IServerConfig;
/**
* Returns the domain of the provided cloud service.
* @param serviceName The name of the cloud service.
* @returns {string}
*/
getServiceDomainName(serviceName: string): string;
/**
* Returns the domain names of all cloud services.
* @returns {string[]} The domain names of all cloud services.
*/
getCloudServicesDomainNames(): string[];
/**
* Returns the value stored in the configuration of the provided service or the default value stored in the
* global configuration.
* @param serviceName The name of the cloud service.
* @param valueName The name of the value.
* @returns {string} The value specified in the provided service config or the value specified in the global config.
*/
getServiceValueOrDefault(serviceName: string, valueName: string): string;
/**
* Prints the current cloud configuration on the stdout of the process.
* @returns {void}
*/
printConfigData(): void;
}
interface IServerConfigBase {
apiVersion?: string;
serverProto?: string;
namespace?: string;
}
interface IServerConfig extends IServerConfigBase {
domainName: string;
stage?: string;
cloudServices: IDictionary<ICloudServiceConfig>;
mBaaS: IDictionary<IMBaaSConfig>;
[index: string]: string | IDictionary<ICloudServiceConfig> | IDictionary<IMBaaSConfig>;
}
interface ICloudServiceConfig extends IServerConfigBase {
fullHostName?: string;
subdomain?: string;
[index: string]: string;
}
interface IMBaaSConfig {
fullHostName: string;
apiVersion: string;
authScheme?: string;
}
/**
* Describes options that can be passed to load/get configuration methods
*/
interface IConfigOptions {
/**
* Path to the configuration file to load.
*/
configurationFile?: string;
}