cityworks 0.0.37 → 0.0.39
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/README.md +4 -2
- package/dist/cityworks.d.ts +10 -25
- package/dist/index.js.map +1 -1
- package/dist/index.m.js.map +1 -1
- package/dist/index.modern.mjs.map +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -1
- package/index.js +0 -1
- package/src/activity_link.ts +0 -241
- package/src/case.ts +0 -282
- package/src/case_admin.ts +0 -883
- package/src/case_assets.ts +0 -129
- package/src/case_data.ts +0 -446
- package/src/case_financial.ts +0 -848
- package/src/case_workflow.ts +0 -462
- package/src/cityworks.ts +0 -719
- package/src/comments.ts +0 -167
- package/src/costs.ts +0 -289
- package/src/error.ts +0 -56
- package/src/event_layer.ts +0 -231
- package/src/general.ts +0 -143
- package/src/gis.ts +0 -242
- package/src/index.ts +0 -1
- package/src/inspection.ts +0 -851
- package/src/inspection_admin.ts +0 -45
- package/src/message_queue.ts +0 -243
- package/src/request.ts +0 -823
- package/src/request_admin.ts +0 -35
- package/src/search.ts +0 -339
- package/src/workorder.ts +0 -838
- package/src/workorder_admin.ts +0 -248
- package/test/01.cityworksTest.js +0 -80
- package/test/02.activitylinkTest.js +0 -58
- package/test/03.generalTest.js +0 -87
- package/test/04.requestTest.js +0 -293
- package/test/05.caseTest.js +0 -110
- package/test/06.caseFinancialTest.js +0 -172
- package/test/07.searchTest.js +0 -191
- package/test/08.workOrderTest.js +0 -48
- package/test/09.caseAssetsTest.js +0 -72
- package/test/09.inspectionTest.js +0 -28
- package/tsconfig.json +0 -68
package/src/workorder_admin.ts
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { CWError } from './error'
|
|
2
|
-
const _ = require('lodash')
|
|
3
|
-
|
|
4
|
-
export class WorkOrderAdmin {
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
cw: any
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
*/
|
|
13
|
-
constructor(cw) {
|
|
14
|
-
this.cw = cw
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Get entity groups
|
|
19
|
-
*
|
|
20
|
-
* @category WorkOrders Admin
|
|
21
|
-
* @return {Object} Returns Promise that represents a collection of all entity groups
|
|
22
|
-
*/
|
|
23
|
-
getEntityGroups() {
|
|
24
|
-
return new Promise((resolve, reject) => {
|
|
25
|
-
var data = {}
|
|
26
|
-
this.cw.runRequest('Ams/Entity/Groups', data).then(r => {
|
|
27
|
-
resolve(r.Value)
|
|
28
|
-
}).catch(e => {
|
|
29
|
-
reject(e)
|
|
30
|
-
})
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Get entity types
|
|
36
|
-
*
|
|
37
|
-
* @category WorkOrders Admin
|
|
38
|
-
* @return {Object} Returns Promise that represents a collection of all GIS WorkOrder entity types
|
|
39
|
-
*/
|
|
40
|
-
getEntityTypes(entityGroups:Array<string>) {
|
|
41
|
-
return new Promise((resolve, reject) => {
|
|
42
|
-
var data = {EntityGroups: entityGroups}
|
|
43
|
-
this.cw.runRequest('Ams/Designer/WOTemplates', data).then(r => {
|
|
44
|
-
resolve(r.Value)
|
|
45
|
-
}).catch(e => {
|
|
46
|
-
reject(e)
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Get WorkOrder templates
|
|
53
|
-
*
|
|
54
|
-
* @category WorkOrders Admin
|
|
55
|
-
* @return {Object} Returns Promise that represents a collection of all WorkOrder templates
|
|
56
|
-
*/
|
|
57
|
-
getTemplates(entityType:string, includeComments:boolean=true, includeInstructions:boolean=true) {
|
|
58
|
-
return new Promise((resolve, reject) => {
|
|
59
|
-
var data = {EntityType: entityType, IncludeComments: includeComments, IncludeInstructions: includeInstructions}
|
|
60
|
-
this.cw.runRequest('Ams/Designer/WOTemplates', data).then(r => {
|
|
61
|
-
resolve(r.Value)
|
|
62
|
-
}).catch(e => {
|
|
63
|
-
reject(e)
|
|
64
|
-
})
|
|
65
|
-
})
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Update WorkOrder template
|
|
70
|
-
*
|
|
71
|
-
* @category WorkOrders Admin
|
|
72
|
-
* @param {Object} wOTemplate - Obect that describes the WorkOrder Template
|
|
73
|
-
* @return {Object} Returns Promise that represents a collection of all
|
|
74
|
-
*/
|
|
75
|
-
updateTemplate(wOTemplate:Object) {
|
|
76
|
-
let valid_fields = ["AcctNum", "AutoCreateTask", "Cancel", "Comments", "CopyCustomFieldVal", "CycleFrom", "CycleIncludeWeekends", "CycleIntervalNum", "CycleIntervalUnit", "CycleType", "DaysToComplete", "DefaultProject", "DefaultProjectSid", "Description", "Effort", "ExpenseType", "Instructions", "IsReactive", "MaintScore", "NumDaysBefore", "Priority", "RequireAssetOnClose", "Shop", "Stage", "SubmitToEmployeeSid", "SupervisorEmployeeSid", "UnitsAccompDesc", "UnitsAccompDescLock", "WOCategory", "WOCustFieldCatId", "WOPrintTmpt", "WOTemplateId", "WorkMonth"]
|
|
77
|
-
return new Promise((resolve, reject) => {
|
|
78
|
-
var data = wOTemplate
|
|
79
|
-
this.cw.runRequest('Ams/Designer/WOTemplates', data).then(r => {
|
|
80
|
-
resolve(r.Value)
|
|
81
|
-
}).catch(e => {
|
|
82
|
-
reject(e)
|
|
83
|
-
})
|
|
84
|
-
})
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Get template group rights for provided WorkOrder Templates
|
|
89
|
-
*
|
|
90
|
-
* @category WorkOrders Admin
|
|
91
|
-
* @param {Array<number>} wOTemplateIds - Array one or more WorkOrder Template IDs
|
|
92
|
-
* @return {Object} Returns Promise that represents a collection of all
|
|
93
|
-
*/
|
|
94
|
-
getTemplateGroupRights(wOTemplateIds:Array<number>) {
|
|
95
|
-
return new Promise((resolve, reject) => {
|
|
96
|
-
var data = {WOTemplateIds: wOTemplateIds}
|
|
97
|
-
this.cw.runRequest('Ams/Designer/WOTemplates', data).then(r => { // TODO: Update this URL
|
|
98
|
-
resolve(r.Value)
|
|
99
|
-
}).catch(e => {
|
|
100
|
-
reject(e)
|
|
101
|
-
})
|
|
102
|
-
})
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Get template activity services for provided WorkOrder Templates
|
|
107
|
-
*
|
|
108
|
-
* @category WorkOrders Admin
|
|
109
|
-
* @param {Array<number>} wOTemplateIds - Array one or more WorkOrder Template IDs
|
|
110
|
-
* @return {Object} Returns Promise that represents a collection of all
|
|
111
|
-
*/
|
|
112
|
-
getTemplateActivity(wOTemplateIds:Array<number>) {
|
|
113
|
-
return new Promise((resolve, reject) => {
|
|
114
|
-
var data = {WOTemplateIds: wOTemplateIds}
|
|
115
|
-
this.cw.runRequest('Ams/Designer/WOTemplateActivityService', data).then(r => {
|
|
116
|
-
resolve(r.Value)
|
|
117
|
-
}).catch(e => {
|
|
118
|
-
reject(e)
|
|
119
|
-
})
|
|
120
|
-
})
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Get fields which will be updated when provided WorkOrder Template instance closes
|
|
125
|
-
*
|
|
126
|
-
* @category WorkOrders Admin
|
|
127
|
-
* @param {Array<number>} wOTemplateIds - Array one or more WorkOrder Template IDs
|
|
128
|
-
* @return {Object} Returns Promise that represents a collection of all
|
|
129
|
-
*/
|
|
130
|
-
getUpdateFields(wOTemplateIds:Array<number>) {
|
|
131
|
-
return new Promise((resolve, reject) => {
|
|
132
|
-
var data = {WOTemplateIds: wOTemplateIds}
|
|
133
|
-
this.cw.runRequest('Ams/Designer/WOTemplateUpdateFields', data).then(r => {
|
|
134
|
-
resolve(r.Value)
|
|
135
|
-
}).catch(e => {
|
|
136
|
-
reject(e)
|
|
137
|
-
})
|
|
138
|
-
})
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Get equipment
|
|
143
|
-
*
|
|
144
|
-
* @category WorkOrders Admin
|
|
145
|
-
* @param {Array<number>} wOTemplateIds - WorkOrder Template ID
|
|
146
|
-
* @return {Object} Returns Promise that represents a collection of all
|
|
147
|
-
*/
|
|
148
|
-
getTemplateEquipment(wOTemplateId:number) {
|
|
149
|
-
return new Promise((resolve, reject) => {
|
|
150
|
-
var data = {WOTemplateId: wOTemplateId}
|
|
151
|
-
this.cw.runRequest('Ams/Designer/WOTemplateEquipment', data).then(r => {
|
|
152
|
-
resolve(r.Value)
|
|
153
|
-
}).catch(e => {
|
|
154
|
-
reject(e)
|
|
155
|
-
})
|
|
156
|
-
})
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Get labor
|
|
161
|
-
*
|
|
162
|
-
* @category WorkOrders Admin
|
|
163
|
-
* @param {Array<number>} wOTemplateIds - WorkOrder Template ID
|
|
164
|
-
* @return {Object} Returns Promise that represents a collection of all
|
|
165
|
-
*/
|
|
166
|
-
getTemplateLabor(wOTemplateId:number) {
|
|
167
|
-
return new Promise((resolve, reject) => {
|
|
168
|
-
var data = {WOTemplateId: wOTemplateId}
|
|
169
|
-
this.cw.runRequest('Ams/Designer/WOTemplateLabor', data).then(r => {
|
|
170
|
-
resolve(r.Value)
|
|
171
|
-
}).catch(e => {
|
|
172
|
-
reject(e)
|
|
173
|
-
})
|
|
174
|
-
})
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Get material
|
|
179
|
-
*
|
|
180
|
-
* @category WorkOrders Admin
|
|
181
|
-
* @param {number} wOTemplateId - WorkOrder Template ID
|
|
182
|
-
* @return {Object} Returns Promise that represents a collection of all
|
|
183
|
-
*/
|
|
184
|
-
getTemplateMaterial(wOTemplateId:number) {
|
|
185
|
-
return new Promise((resolve, reject) => {
|
|
186
|
-
var data = {WOTemplateId: wOTemplateId}
|
|
187
|
-
this.cw.runRequest('Ams/Designer/WOTemplateMaterial', data).then(r => {
|
|
188
|
-
resolve(r.Value)
|
|
189
|
-
}).catch(e => {
|
|
190
|
-
reject(e)
|
|
191
|
-
})
|
|
192
|
-
})
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Get map layer fields configured for provided WorkOrder template
|
|
197
|
-
*
|
|
198
|
-
* @category WorkOrders Admin
|
|
199
|
-
* @param {number} wOTemplateId - WorkOrder Template ID
|
|
200
|
-
* @return {Object} Returns Promise that represents a collection of all
|
|
201
|
-
*/
|
|
202
|
-
getTemplateMapLayerFields(wOTemplateId:number) {
|
|
203
|
-
return new Promise((resolve, reject) => {
|
|
204
|
-
var data = {WorkOrderTemplateId: wOTemplateId}
|
|
205
|
-
this.cw.runRequest('Ams/Designer/WorkOrderTemplateMapLayerFields', data).then(r => {
|
|
206
|
-
resolve(r.Value)
|
|
207
|
-
}).catch(e => {
|
|
208
|
-
reject(e)
|
|
209
|
-
})
|
|
210
|
-
})
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Get tasks configured for provided WorkOrder template
|
|
215
|
-
*
|
|
216
|
-
* @category WorkOrders Admin
|
|
217
|
-
* @param {number} wOTemplateId - WorkOrder Template ID
|
|
218
|
-
* @return {Object} Returns Promise that represents a collection of all tasks on WorkOrder template
|
|
219
|
-
*/
|
|
220
|
-
getTemplateTasks(wOTemplateId:number) {
|
|
221
|
-
return new Promise((resolve, reject) => {
|
|
222
|
-
var data = {WOTemplateId: wOTemplateId}
|
|
223
|
-
this.cw.runRequest('Ams/Tasks/ByWorkOrderTemplate', data).then(r => {
|
|
224
|
-
resolve(r.Value)
|
|
225
|
-
}).catch(e => {
|
|
226
|
-
reject(e)
|
|
227
|
-
})
|
|
228
|
-
})
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Get inspections connected to provided WorkOrder template
|
|
233
|
-
*
|
|
234
|
-
* @category WorkOrders Admin
|
|
235
|
-
* @param {number} wOTemplateId - WorkOrder Template ID
|
|
236
|
-
* @return {Object} Returns Promise that represents a collection of all tasks on WorkOrder template
|
|
237
|
-
*/
|
|
238
|
-
getRelatedInspectionTemplates(wOTemplateId:number) {
|
|
239
|
-
return new Promise((resolve, reject) => {
|
|
240
|
-
var data = {WOTemplateId: wOTemplateId}
|
|
241
|
-
this.cw.runRequest('Ams/Designer/WOTemplateInspections', data).then(r => {
|
|
242
|
-
resolve(r.Value)
|
|
243
|
-
}).catch(e => {
|
|
244
|
-
reject(e)
|
|
245
|
-
})
|
|
246
|
-
})
|
|
247
|
-
}
|
|
248
|
-
}
|
package/test/01.cityworksTest.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
require('dotenv').config();
|
|
3
|
-
var expect = require('chai').expect;
|
|
4
|
-
var assert = require('chai').assert;
|
|
5
|
-
var Cityworks = require('../dist/index.js');
|
|
6
|
-
var cw1;
|
|
7
|
-
|
|
8
|
-
before(function(done) {
|
|
9
|
-
this.timeout(20000000);
|
|
10
|
-
done();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
beforeEach(function() {
|
|
14
|
-
return cw1 = new Cityworks(process.env.domain, {path:process.env.path});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
describe('[Cityworks (construct)] function test', () => {
|
|
18
|
-
it('should return a Cityworks object', (done) => {
|
|
19
|
-
assert.isObject(cw1, 'cw is an object');
|
|
20
|
-
done();
|
|
21
|
-
});
|
|
22
|
-
it('should not have a token set if authentication not run', (done) => {
|
|
23
|
-
assert.isUndefined(cw1.Token);
|
|
24
|
-
done();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
describe('[Cityworks::authenticate] function test', () => {
|
|
29
|
-
it('should throw Unknown Error if username provided is not known', (done) => {
|
|
30
|
-
cw1.authenticate('myuser', 'mypassword').then(res => {
|
|
31
|
-
// assert.isUndefined(cw1.Token);
|
|
32
|
-
done();
|
|
33
|
-
})
|
|
34
|
-
.catch(error => {
|
|
35
|
-
assert.equal(error.message, 'Unknown Error');
|
|
36
|
-
done();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// TODO: Uncomment for commit
|
|
41
|
-
it('should throw invalid login error if password provided is not provided user\'s password', () => {
|
|
42
|
-
let cw4 = new Cityworks(process.env.domain, {path:process.env.path})
|
|
43
|
-
cw4.authenticate('mrrobot', 'mypassword').then(resp => {
|
|
44
|
-
// assert.isNotEmpty(cw4.Token);
|
|
45
|
-
return true;
|
|
46
|
-
}).catch(error => {
|
|
47
|
-
assert.equal(error.message, 'Invalid Credentials');
|
|
48
|
-
return true;
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
describe('[Cityworks::validateToken] function test', () => {
|
|
54
|
-
it('should have a valid token set, if logged in', (done) => {
|
|
55
|
-
cw1.authenticate(process.env.login, process.env.password).then(resp => {
|
|
56
|
-
cw1.validateToken(cw1.Token).then(res => {
|
|
57
|
-
assert.isTrue(res);
|
|
58
|
-
done();
|
|
59
|
-
}).catch(error => {
|
|
60
|
-
console.log(error, 'unexpected error');
|
|
61
|
-
done();
|
|
62
|
-
});
|
|
63
|
-
}).catch(error => {
|
|
64
|
-
console.log(error, 'unexpected error');
|
|
65
|
-
done();
|
|
66
|
-
});
|
|
67
|
-
})
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
describe('[Cityworks::setToken] function test', () => {
|
|
71
|
-
it('should have set token', (done) => {
|
|
72
|
-
cw1.authenticate(process.env.login, process.env.password).then(res => {
|
|
73
|
-
assert.isTrue(cw1.setToken(cw1.Token));
|
|
74
|
-
done();
|
|
75
|
-
}).catch(error => {
|
|
76
|
-
console.log(error, 'unexpected error');
|
|
77
|
-
done();
|
|
78
|
-
});
|
|
79
|
-
})
|
|
80
|
-
})
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
require('dotenv').config();
|
|
3
|
-
var expect = require('chai').expect;
|
|
4
|
-
var assert = require('chai').assert;
|
|
5
|
-
var Cityworks = require('../dist/index.js');
|
|
6
|
-
var cw2 = new Cityworks(process.env.domain, {path: process.env.path});
|
|
7
|
-
|
|
8
|
-
before(function(done) {
|
|
9
|
-
this.timeout(20000000);
|
|
10
|
-
cw2.authenticate(process.env.login, process.env.password).then(resp => {
|
|
11
|
-
done();
|
|
12
|
-
}).catch(e => {
|
|
13
|
-
console.log(e, 'unexpected error')
|
|
14
|
-
done();
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
describe('[ActivityLink (construct)] function test', () => {
|
|
19
|
-
it('should be a defined object', (done) => {
|
|
20
|
-
assert.isObject(cw2.activity_link, 'ActivityLink is an object');
|
|
21
|
-
done();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
describe('[ActivityLink::get] function test', () => {
|
|
26
|
-
it('should return error if type doesn\'t exist', (done) => {
|
|
27
|
-
cw2.activity_link.get('something').then(resp => {
|
|
28
|
-
}).catch(error => {
|
|
29
|
-
assert.equal(error.message, 'Activity type not found.');
|
|
30
|
-
done();
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('should return collection', (done) => {
|
|
35
|
-
cw2.activity_link.get('case', [10512]).then(resp => {
|
|
36
|
-
assert.isArray(resp);
|
|
37
|
-
done();
|
|
38
|
-
}).catch(error => {
|
|
39
|
-
console.log(error, 'unexpected error');
|
|
40
|
-
done();
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
describe('[ActivityLink::clone] function test', () => {
|
|
46
|
-
it('should create a clone of an existing link, if it exists');
|
|
47
|
-
it('should not create a clone of an existing link, if it does not exist');
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
describe('[ActivityLink::delete] function test', () => {
|
|
51
|
-
it('should delete an activity link if the ID is found');
|
|
52
|
-
it('should fail to delete an activity link if the ID cannot be found');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
describe('[ActivityLink::remove] function test', () => {
|
|
56
|
-
it('should remove a link when all items provided');
|
|
57
|
-
it('should fail when any 1 item is not provided');
|
|
58
|
-
});
|
package/test/03.generalTest.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
require('dotenv').config();
|
|
3
|
-
var chai = require('chai');
|
|
4
|
-
var expect = require('chai').expect;
|
|
5
|
-
var assert = require('chai').assert;
|
|
6
|
-
var chaiAsPromised = require("chai-as-promised");
|
|
7
|
-
chai.use(chaiAsPromised);
|
|
8
|
-
var Cityworks = require('../dist/index.js');
|
|
9
|
-
var cw3 = new Cityworks(process.env.domain, {path: process.env.path});
|
|
10
|
-
|
|
11
|
-
before(function(done) {
|
|
12
|
-
this.timeout(20000000);
|
|
13
|
-
cw3.authenticate(process.env.login, process.env.password).then(resp => {
|
|
14
|
-
done();
|
|
15
|
-
}).catch(e => {
|
|
16
|
-
console.log(e, 'unexpected error')
|
|
17
|
-
done();
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
describe('[General::notifications] function test', () => {
|
|
22
|
-
it('should resolve a collection', (done) => {
|
|
23
|
-
cw3.general.notifications().then(resp => {
|
|
24
|
-
assert.isArray(resp);
|
|
25
|
-
done();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
describe('[General::amIWatching] function test', () => {
|
|
31
|
-
it('should reject with an error if the activity type is not available or does not exist', (done) => {
|
|
32
|
-
cw3.general.amIWatching('request', 42015).then(r => {
|
|
33
|
-
}).catch(e => {
|
|
34
|
-
assert.equal(e.message, 'Activity type provided does not exist.');
|
|
35
|
-
done();
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
it('should resolve a boolean', (done) => {
|
|
39
|
-
cw3.general.amIWatching('case', 42015).then(r => {
|
|
40
|
-
assert.isBoolean(r);
|
|
41
|
-
done();
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
it('should resolve with false if id does not exist', (done) => {
|
|
45
|
-
cw3.general.amIWatching('case', 200042015).then(r => {
|
|
46
|
-
assert.isFalse(r);
|
|
47
|
-
done();
|
|
48
|
-
}).catch(e => {
|
|
49
|
-
done();
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
it('should reject with an error if the activity id is too large', (done) => {
|
|
53
|
-
cw3.general.amIWatching('case', 10000000000).then(response => {
|
|
54
|
-
}).catch(e => {
|
|
55
|
-
assert.equal(e.message, 'Unknown error.');
|
|
56
|
-
done();
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
describe('[General::quickSearch] function test', () => {
|
|
62
|
-
it('should resolve results', (done) => {
|
|
63
|
-
cw3.general.quickSearch('256460').then(r => {
|
|
64
|
-
assert.property(r, 'Permits');
|
|
65
|
-
done();
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it('should resolve (empty) results even when the string is not found', (done) => {
|
|
70
|
-
cw3.general.quickSearch('SomethingSidewalk').then(r => {
|
|
71
|
-
assert.property(r, 'Permits');
|
|
72
|
-
done();
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
describe('[General::getActivityMetadataByIds] function test', () => {
|
|
78
|
-
it('should resolve an activity based on the metadata ids');
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
describe('[General::getWOEntityCostSummary] function test', () => {
|
|
82
|
-
it('should get an Entity\'s cost summary');
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
describe('[General::searchWOEntityCostSummary] function test', () => {
|
|
86
|
-
it('should resolve reults of a search for cost summary of an entity');
|
|
87
|
-
});
|