Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 39 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | var AppEvents = {} |
||
2 | |||
3 | function factory (name, defaults) { |
||
4 | defaults = defaults || {} |
||
5 | var fullName = 'Application.' + name |
||
6 | var event = function (data) { |
||
7 | var self = this |
||
8 | data = data || {} |
||
9 | Object.defineProperty(this, 'name', {value: fullName, writable: false}) |
||
10 | Object.keys(defaults).forEach(function (key) { |
||
11 | self[key] = defaults[key] |
||
12 | }) |
||
13 | Object.keys(data).forEach(function (key) { |
||
14 | self[key] = data[key] |
||
15 | }) |
||
16 | } |
||
17 | Object.defineProperty(event, 'name', {value: fullName, writable: false}) |
||
18 | event._properties = Object.keys(defaults) |
||
19 | AppEvents[name] = event |
||
20 | } |
||
21 | |||
22 | factory('CallAlerting', { |
||
23 | call: {}, |
||
24 | callerid: null, |
||
25 | customData: '', |
||
26 | destination: '', |
||
27 | displayName: '', |
||
28 | fromURI: '', |
||
29 | headers: {}, |
||
30 | toURI: '' |
||
31 | }) |
||
32 | factory('HttpRequest', {content: '', method: 'POST', path: '/'}) |
||
33 | factory('Started', {accessURL: ''}) |
||
34 | factory('Terminating') |
||
35 | factory('Terminated') |
||
36 | |||
37 | module.exports = { |
||
38 | AppEvents: AppEvents |
||
39 | } |
||
40 |