-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleConfig.cfc
More file actions
36 lines (31 loc) · 1.27 KB
/
ModuleConfig.cfc
File metadata and controls
36 lines (31 loc) · 1.27 KB
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
component {
this.name = "cordial-sdk";
this.author = "Ortus Solutions";
this.webUrl = "https://github.com/coldbox-modules/cordial-sdk";
this.dependencies = [ "hyper" ];
function configure() {
settings = {
apiKey: getSystemSetting( "CORDIAL_SDK_API_KEY", "" ),
baseURL: getSystemSetting( "CORDIAL_SDK_BASE_URL", "" ),
maxConcurrency: val( getSystemSetting( "CORDIAL_SDK_MAX_CONCURRENCY", "10" ) ),
forceSubscribe: getSystemSetting( "CORDIAL_SDK_FORCE_SUBSCRIBE", "false" )
};
settings.forceSubscribe = isBoolean( settings.forceSubscribe ) && (
settings.forceSubscribe == true || lCase( settings.forceSubscribe ) == "true"
);
settings.maxConcurrency = settings.maxConcurrency > 0 ? settings.maxConcurrency : 10;
}
function onLoad() {
binder
.map( "CordialHyperClient@cordial-sdk" )
.to( "hyper.models.HyperBuilder" )
.asSingleton()
.initWith(
username = settings.apiKey,
password = "",
baseURL = settings.baseURL,
bodyFormat = "json",
headers = { "Content-Type": "application/json", "Accept": "application/json" }
);
}
}