cityworks 2.2.7 → 2.2.10
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/LICENSE +21 -21
- package/README.md +119 -119
- package/dist/briefcase.d.ts +10 -0
- package/dist/employee.d.ts +165 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.m.js +1 -1
- package/dist/index.m.js.map +1 -1
- package/dist/index.modern.mjs +1 -1
- package/dist/index.modern.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +59 -59
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Walker Hamilton <3987+walker@users.noreply.github.com>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Walker Hamilton <3987+walker@users.noreply.github.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
# Cityworks node.js API wrapper
|
|
2
|
-
|
|
3
|
-
This API wrapper for Cityworks follows the Cityworks release schedule as closely as possible. Functionality may be missing depending on necessity or use.
|
|
4
|
-
|
|
5
|
-
Require the class:
|
|
6
|
-
|
|
7
|
-
const cw = require('cityworks')
|
|
8
|
-
|
|
9
|
-
or
|
|
10
|
-
|
|
11
|
-
import * as cw from 'cityworks'
|
|
12
|
-
|
|
13
|
-
Instantiate the Class for the instance of Cityworks available given a domain:
|
|
14
|
-
|
|
15
|
-
cw.Cityworks.configure('cwoffice.domain.tld', {path: 'cityworks', version: 15})
|
|
16
|
-
|
|
17
|
-
or
|
|
18
|
-
|
|
19
|
-
cw.Cityworks.configure('cw.domain.tld', {path: 'cityworks', version: 23});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## Authentication
|
|
23
|
-
|
|
24
|
-
Authenticate with the Cityworks install:
|
|
25
|
-
|
|
26
|
-
cw.Cityworks.authenticate('myuser', 'mypassword').then(resp => {}).catch(error => {
|
|
27
|
-
console.log(error.message)
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Get the currently valid token in order to store it in a session or cookie:
|
|
32
|
-
|
|
33
|
-
cw.Cityworks.getToken()
|
|
34
|
-
|
|
35
|
-
Provide a saved token instead of the standard u/p auth:
|
|
36
|
-
|
|
37
|
-
cw.Cityworks.setToken('mytoken')
|
|
38
|
-
|
|
39
|
-
## Main method calls
|
|
40
|
-
|
|
41
|
-
Access the primary AMS ([Inspection](https://walker.github.io/cityworks/classes/inspection.Inspection.html), [WorkOrder](https://walker.github.io/cityworks/classes/workorder.WorkOrder.html), & [Service Request](https://walker.github.io/cityworks/classes/request.Request.html)) & [PLL](https://walker.github.io/cityworks/classes/case.Briefcase.html) object libraries like so:
|
|
42
|
-
|
|
43
|
-
cw.inspection.methodHere().then(resp => {})
|
|
44
|
-
cw.workorder.methodHere().then(resp => {})
|
|
45
|
-
cw.request.methodHere().then(resp => {})
|
|
46
|
-
cw.briefcase.methodHere().then(resp => {})
|
|
47
|
-
|
|
48
|
-
Some of the methods are general or top-level, and so, are accessed separately are at the same level of reference from the cityworks object:
|
|
49
|
-
|
|
50
|
-
[General methods](https://walker.github.io/cityworks/classes/general.General.html) including authentication:
|
|
51
|
-
|
|
52
|
-
cw.general.methodHere().then(resp => {})
|
|
53
|
-
|
|
54
|
-
[Message queue](https://walker.github.io/cityworks/classes/message_queue.MessageQueue.html) methods for examining, processing, and troubleshooting webhooks and activity events:
|
|
55
|
-
|
|
56
|
-
cw.message_queue.methodHere().then(resp => {})
|
|
57
|
-
|
|
58
|
-
[Activity link](https://walker.github.io/cityworks/classes/activity_link.ActivityLinks.html) for linking one node/object to another:
|
|
59
|
-
|
|
60
|
-
cw.activity_link.methodHere().then(resp => {})
|
|
61
|
-
|
|
62
|
-
[Mapping and GIS methods](https://walker.github.io/cityworks/classes/gis.Gis.html) not specific to a single object type:
|
|
63
|
-
|
|
64
|
-
cw.gis.methodHere().then(resp => {})
|
|
65
|
-
|
|
66
|
-
[General query methods](https://walker.github.io/cityworks/classes/query.Query.html):
|
|
67
|
-
|
|
68
|
-
cw.query.methodHere().then(resp => {})
|
|
69
|
-
|
|
70
|
-
[(Deprecated) General search methods](https://walker.github.io/cityworks/classes/search.Search.html):
|
|
71
|
-
|
|
72
|
-
cw.search.methodHere().then(resp => {})
|
|
73
|
-
|
|
74
|
-
## Case financials, data details, and admin
|
|
75
|
-
|
|
76
|
-
For the sake of organizing some of the other methods needed by the primary and secondary libraries, there are also objects and methods accessed within those main libraries:
|
|
77
|
-
|
|
78
|
-
For [PLL case financial actions](https://walker.github.io/cityworks/classes/case_financial.CaseFinancial.html):
|
|
79
|
-
|
|
80
|
-
cw.briefcase.financial.methodHere().then(resp => {})
|
|
81
|
-
|
|
82
|
-
For [PLL case data details & data groups](https://walker.github.io/cityworks/classes/case_data.CaseData.html):
|
|
83
|
-
|
|
84
|
-
cw.briefcase.data.methodHere().then(resp => {})
|
|
85
|
-
|
|
86
|
-
For PLL case [workflow and task actions](https://walker.github.io/cityworks/classes/case_workflow.CaseWorkflow.html):
|
|
87
|
-
|
|
88
|
-
cw.briefcase.workflow.methodHere().then(resp => {})
|
|
89
|
-
|
|
90
|
-
For [PLL administration actions](https://walker.github.io/cityworks/classes/case_admin.CaseAdmin.html):
|
|
91
|
-
|
|
92
|
-
cw.briefcase.admin.methodHere().then(resp => {})
|
|
93
|
-
|
|
94
|
-
## Commenting
|
|
95
|
-
|
|
96
|
-
For any object in Cityworks which can be commented on, use the [Comments class](https://walker.github.io/cityworks/classes/comments.Comments.html) via the class the comment is to be made on:
|
|
97
|
-
|
|
98
|
-
cw.briefcase.comment.add(CaObjectIdGoesHere, "Comment goes here").then(resp => {})
|
|
99
|
-
|
|
100
|
-
cw.workorder.comment.add(WorkOrderSIDGoesHere, "Comment goes here").then(resp => {})
|
|
101
|
-
|
|
102
|
-
cw.request.comment.add(RequestIDGoesHere, "Comment goes here").then(resp => {})
|
|
103
|
-
|
|
104
|
-
## Attachments
|
|
105
|
-
|
|
106
|
-
For any object in Cityworks which has attachments, (including cases as CaRelDocs), use the [Attachments class](https://walker.github.io/cityworks/modules/attachments.html) via the class the attachment is to be made on:
|
|
107
|
-
|
|
108
|
-
cw.briefcase.attachment.add(CaObjectIdGoesHere, path.join('uploads', 'filename.pdf')).then(resp => {})
|
|
109
|
-
|
|
110
|
-
cw.workorder.attachment.add(WorkOrderSIDGoesHere, path.join('uploads', 'filename.pdf')).then(resp => {})
|
|
111
|
-
|
|
112
|
-
cw.request.attachment.add(RequestIDGoesHere, path.join('uploads', 'filename.pdf')).then(resp => {})
|
|
113
|
-
|
|
114
|
-
cw.inspection.attachment.add(InspectionIDGoesHere, path.join('uploads', 'filename.pdf')).then(resp => {})
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
## Activity Links
|
|
118
|
-
|
|
119
|
-
cw.activity_link.add(source_type, source_sid, destination_type, destination_sid)
|
|
1
|
+
# Cityworks node.js API wrapper
|
|
2
|
+
|
|
3
|
+
This API wrapper for Cityworks follows the Cityworks release schedule as closely as possible. Functionality may be missing depending on necessity or use.
|
|
4
|
+
|
|
5
|
+
Require the class:
|
|
6
|
+
|
|
7
|
+
const cw = require('cityworks')
|
|
8
|
+
|
|
9
|
+
or
|
|
10
|
+
|
|
11
|
+
import * as cw from 'cityworks'
|
|
12
|
+
|
|
13
|
+
Instantiate the Class for the instance of Cityworks available given a domain:
|
|
14
|
+
|
|
15
|
+
cw.Cityworks.configure('cwoffice.domain.tld', {path: 'cityworks', version: 15})
|
|
16
|
+
|
|
17
|
+
or
|
|
18
|
+
|
|
19
|
+
cw.Cityworks.configure('cw.domain.tld', {path: 'cityworks', version: 23});
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Authentication
|
|
23
|
+
|
|
24
|
+
Authenticate with the Cityworks install:
|
|
25
|
+
|
|
26
|
+
cw.Cityworks.authenticate('myuser', 'mypassword').then(resp => {}).catch(error => {
|
|
27
|
+
console.log(error.message)
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
Get the currently valid token in order to store it in a session or cookie:
|
|
32
|
+
|
|
33
|
+
cw.Cityworks.getToken()
|
|
34
|
+
|
|
35
|
+
Provide a saved token instead of the standard u/p auth:
|
|
36
|
+
|
|
37
|
+
cw.Cityworks.setToken('mytoken')
|
|
38
|
+
|
|
39
|
+
## Main method calls
|
|
40
|
+
|
|
41
|
+
Access the primary AMS ([Inspection](https://walker.github.io/cityworks/classes/inspection.Inspection.html), [WorkOrder](https://walker.github.io/cityworks/classes/workorder.WorkOrder.html), & [Service Request](https://walker.github.io/cityworks/classes/request.Request.html)) & [PLL](https://walker.github.io/cityworks/classes/case.Briefcase.html) object libraries like so:
|
|
42
|
+
|
|
43
|
+
cw.inspection.methodHere().then(resp => {})
|
|
44
|
+
cw.workorder.methodHere().then(resp => {})
|
|
45
|
+
cw.request.methodHere().then(resp => {})
|
|
46
|
+
cw.briefcase.methodHere().then(resp => {})
|
|
47
|
+
|
|
48
|
+
Some of the methods are general or top-level, and so, are accessed separately are at the same level of reference from the cityworks object:
|
|
49
|
+
|
|
50
|
+
[General methods](https://walker.github.io/cityworks/classes/general.General.html) including authentication:
|
|
51
|
+
|
|
52
|
+
cw.general.methodHere().then(resp => {})
|
|
53
|
+
|
|
54
|
+
[Message queue](https://walker.github.io/cityworks/classes/message_queue.MessageQueue.html) methods for examining, processing, and troubleshooting webhooks and activity events:
|
|
55
|
+
|
|
56
|
+
cw.message_queue.methodHere().then(resp => {})
|
|
57
|
+
|
|
58
|
+
[Activity link](https://walker.github.io/cityworks/classes/activity_link.ActivityLinks.html) for linking one node/object to another:
|
|
59
|
+
|
|
60
|
+
cw.activity_link.methodHere().then(resp => {})
|
|
61
|
+
|
|
62
|
+
[Mapping and GIS methods](https://walker.github.io/cityworks/classes/gis.Gis.html) not specific to a single object type:
|
|
63
|
+
|
|
64
|
+
cw.gis.methodHere().then(resp => {})
|
|
65
|
+
|
|
66
|
+
[General query methods](https://walker.github.io/cityworks/classes/query.Query.html):
|
|
67
|
+
|
|
68
|
+
cw.query.methodHere().then(resp => {})
|
|
69
|
+
|
|
70
|
+
[(Deprecated) General search methods](https://walker.github.io/cityworks/classes/search.Search.html):
|
|
71
|
+
|
|
72
|
+
cw.search.methodHere().then(resp => {})
|
|
73
|
+
|
|
74
|
+
## Case financials, data details, and admin
|
|
75
|
+
|
|
76
|
+
For the sake of organizing some of the other methods needed by the primary and secondary libraries, there are also objects and methods accessed within those main libraries:
|
|
77
|
+
|
|
78
|
+
For [PLL case financial actions](https://walker.github.io/cityworks/classes/case_financial.CaseFinancial.html):
|
|
79
|
+
|
|
80
|
+
cw.briefcase.financial.methodHere().then(resp => {})
|
|
81
|
+
|
|
82
|
+
For [PLL case data details & data groups](https://walker.github.io/cityworks/classes/case_data.CaseData.html):
|
|
83
|
+
|
|
84
|
+
cw.briefcase.data.methodHere().then(resp => {})
|
|
85
|
+
|
|
86
|
+
For PLL case [workflow and task actions](https://walker.github.io/cityworks/classes/case_workflow.CaseWorkflow.html):
|
|
87
|
+
|
|
88
|
+
cw.briefcase.workflow.methodHere().then(resp => {})
|
|
89
|
+
|
|
90
|
+
For [PLL administration actions](https://walker.github.io/cityworks/classes/case_admin.CaseAdmin.html):
|
|
91
|
+
|
|
92
|
+
cw.briefcase.admin.methodHere().then(resp => {})
|
|
93
|
+
|
|
94
|
+
## Commenting
|
|
95
|
+
|
|
96
|
+
For any object in Cityworks which can be commented on, use the [Comments class](https://walker.github.io/cityworks/classes/comments.Comments.html) via the class the comment is to be made on:
|
|
97
|
+
|
|
98
|
+
cw.briefcase.comment.add(CaObjectIdGoesHere, "Comment goes here").then(resp => {})
|
|
99
|
+
|
|
100
|
+
cw.workorder.comment.add(WorkOrderSIDGoesHere, "Comment goes here").then(resp => {})
|
|
101
|
+
|
|
102
|
+
cw.request.comment.add(RequestIDGoesHere, "Comment goes here").then(resp => {})
|
|
103
|
+
|
|
104
|
+
## Attachments
|
|
105
|
+
|
|
106
|
+
For any object in Cityworks which has attachments, (including cases as CaRelDocs), use the [Attachments class](https://walker.github.io/cityworks/modules/attachments.html) via the class the attachment is to be made on:
|
|
107
|
+
|
|
108
|
+
cw.briefcase.attachment.add(CaObjectIdGoesHere, path.join('uploads', 'filename.pdf')).then(resp => {})
|
|
109
|
+
|
|
110
|
+
cw.workorder.attachment.add(WorkOrderSIDGoesHere, path.join('uploads', 'filename.pdf')).then(resp => {})
|
|
111
|
+
|
|
112
|
+
cw.request.attachment.add(RequestIDGoesHere, path.join('uploads', 'filename.pdf')).then(resp => {})
|
|
113
|
+
|
|
114
|
+
cw.inspection.attachment.add(InspectionIDGoesHere, path.join('uploads', 'filename.pdf')).then(resp => {})
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## Activity Links
|
|
118
|
+
|
|
119
|
+
cw.activity_link.add(source_type, source_sid, destination_type, destination_sid)
|
package/dist/briefcase.d.ts
CHANGED
|
@@ -193,6 +193,16 @@ export declare class Briefcase {
|
|
|
193
193
|
* @return {Object} Returns Promise that represents an Array of case Object IDs
|
|
194
194
|
*/
|
|
195
195
|
search(filters: Object): Promise<Array<number>>;
|
|
196
|
+
/**
|
|
197
|
+
* Get the configured custom data for the case, by template and table name
|
|
198
|
+
*
|
|
199
|
+
* @category Cases
|
|
200
|
+
* @param {number} caObjectId - The case Object ID to get
|
|
201
|
+
* @param {number} busCaseId - The business case template ID for which to get the custom columns configuration and data
|
|
202
|
+
* @param {string} tableName - The name of the table to get custom data from
|
|
203
|
+
* @return {Object} Returns Promise that represents a collection of custom fields with data for the case instance
|
|
204
|
+
*/
|
|
205
|
+
getCustomData(caObjectId: number, busCaseId: number, tableName: string): Promise<Array<any>>;
|
|
196
206
|
/**
|
|
197
207
|
* Move a Case point
|
|
198
208
|
*
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export interface EmployeeBase {
|
|
2
|
+
LastName: string;
|
|
3
|
+
FirstName?: string;
|
|
4
|
+
Email?: string;
|
|
5
|
+
Password?: string;
|
|
6
|
+
AdDomain?: string;
|
|
7
|
+
BenefitRate?: number;
|
|
8
|
+
BenefitType?: number;
|
|
9
|
+
DefaultImgPath?: string;
|
|
10
|
+
DomainId?: number;
|
|
11
|
+
EmailReq?: string;
|
|
12
|
+
EmployeeSid?: number;
|
|
13
|
+
EmployeeId?: string;
|
|
14
|
+
GroupIds?: Array<number>;
|
|
15
|
+
HolidayRate?: number;
|
|
16
|
+
HolidayType?: number;
|
|
17
|
+
HourlyRate?: number;
|
|
18
|
+
IsActive?: boolean;
|
|
19
|
+
IsDomain?: boolean;
|
|
20
|
+
LicenseCodes?: Array<string>;
|
|
21
|
+
LoginName?: string;
|
|
22
|
+
MapServiceId?: number;
|
|
23
|
+
MiddleInitial?: string;
|
|
24
|
+
MobileMapCacheId?: number;
|
|
25
|
+
Organization?: string;
|
|
26
|
+
OtherRate?: number;
|
|
27
|
+
OtherRateType?: number;
|
|
28
|
+
OverheadRate?: number;
|
|
29
|
+
OverheadType?: number;
|
|
30
|
+
OvertimeRate?: number;
|
|
31
|
+
OvertimeType?: number;
|
|
32
|
+
Pager?: string;
|
|
33
|
+
ShiftDiffRate?: number;
|
|
34
|
+
ShiftDiffType?: number;
|
|
35
|
+
StandbyRate?: number;
|
|
36
|
+
StandbyType?: number;
|
|
37
|
+
Title?: string;
|
|
38
|
+
UniqueName?: string;
|
|
39
|
+
WorkPhone?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A plugin that contains "general" methods for a Cityworks install
|
|
43
|
+
*/
|
|
44
|
+
export declare class Employee {
|
|
45
|
+
/**
|
|
46
|
+
* @hidden
|
|
47
|
+
*/
|
|
48
|
+
cw: any;
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
constructor(cw: any);
|
|
53
|
+
/**
|
|
54
|
+
* Add a new employee
|
|
55
|
+
*
|
|
56
|
+
* @param {EmployeeBase} employee - The employee information. `LastName` is a required field.
|
|
57
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
58
|
+
*/
|
|
59
|
+
add(employee: EmployeeBase): Promise<unknown>;
|
|
60
|
+
/**
|
|
61
|
+
* Update existing employee(s)
|
|
62
|
+
*
|
|
63
|
+
* @param {number | Array<number>} employeeSids - The SIDs of the employees to update.
|
|
64
|
+
* @param {EmployeeBase} employee - The employee information to update. `LastName` is a required field. `EmployeeSid` and `EmployeeId` cannot be included in the employeeProperties object, as those are used to identify which employees to update and could cause unintended consequences if included in the update information.
|
|
65
|
+
* @return {Object} Returns Promise object that represents an object that is the updated user
|
|
66
|
+
*/
|
|
67
|
+
update(employeeSids: number | Array<number>, employeeProperties: EmployeeBase): Promise<unknown>;
|
|
68
|
+
/**
|
|
69
|
+
* Get employee custom data fields by id
|
|
70
|
+
*
|
|
71
|
+
* @param {number} employeeSid - employeeSid with which the custom fields are associated
|
|
72
|
+
* @param {string} custFieldIds - which custom field IDs to retrieve.
|
|
73
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
74
|
+
*/
|
|
75
|
+
customDataFields(employeeSid: number, custFieldIds?: Array<string>): Promise<unknown>;
|
|
76
|
+
/**
|
|
77
|
+
* Get all employees
|
|
78
|
+
*
|
|
79
|
+
* @param {string} activityType - which activity type the following ID will be for.
|
|
80
|
+
* @param {number} activityId - activity Case or CaseTask (task instance) ID to check
|
|
81
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
82
|
+
*/
|
|
83
|
+
all(inactive?: boolean): Promise<unknown>;
|
|
84
|
+
/**
|
|
85
|
+
* Get the employees in the group with the given group ID.
|
|
86
|
+
*
|
|
87
|
+
* @param {string} groupId - Which group to get employee list.
|
|
88
|
+
* @param {number} inactive - Whether to include inactive employees.
|
|
89
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
90
|
+
*/
|
|
91
|
+
byGroup(groupId: number, inactive?: boolean): Promise<unknown>;
|
|
92
|
+
/**
|
|
93
|
+
* Get employee by ID
|
|
94
|
+
*
|
|
95
|
+
* @param {string} employeeSid - The SID of the employee to retrieve.
|
|
96
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
97
|
+
*/
|
|
98
|
+
getById(employeeSid: number): Promise<unknown>;
|
|
99
|
+
/**
|
|
100
|
+
* Get employees by IDs
|
|
101
|
+
*
|
|
102
|
+
* @param {Array<number>} employeeSids - The SIDs of the employees to retrieve.
|
|
103
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
104
|
+
*/
|
|
105
|
+
getByIds(employeeSids: Array<number>): Promise<unknown>;
|
|
106
|
+
/**
|
|
107
|
+
* Delete by ID
|
|
108
|
+
*
|
|
109
|
+
* @param {Array<number>} employeeSids - The SIDs of the employees to delete.
|
|
110
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
111
|
+
*/
|
|
112
|
+
delete(employeeSids: Array<number>): Promise<unknown>;
|
|
113
|
+
/**
|
|
114
|
+
* Get groups that given employees are member of by employee sids.
|
|
115
|
+
*
|
|
116
|
+
* @param {Array<number>} employeeSids - The SIDs of the employees to retrieve groups for.
|
|
117
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
118
|
+
*/
|
|
119
|
+
getGroupsByEmployeeSid(employeeSids: Array<number>): Promise<unknown>;
|
|
120
|
+
/**
|
|
121
|
+
* Add a licenses to an employee
|
|
122
|
+
*
|
|
123
|
+
* @param {Array<number>} employeeIds - The IDs of the employees to whom to add licenses.
|
|
124
|
+
* @param {Array<string>} licenseCodes - The license codes to add.
|
|
125
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
126
|
+
*/
|
|
127
|
+
addLicenses(employeeIds: Array<Number>, licenseCodes: Array<string>): Promise<unknown>;
|
|
128
|
+
/**
|
|
129
|
+
* Delete licenses from an employee
|
|
130
|
+
*
|
|
131
|
+
* @param {Array<number>} employeeIds - The IDs of the employees from whom to delete licenses.
|
|
132
|
+
* @param {Array<string>} licenseCodes - The license codes to delete.
|
|
133
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
134
|
+
*/
|
|
135
|
+
deleteLicenses(employeeIds: Array<Number>, licenseCodes: Array<string>): Promise<unknown>;
|
|
136
|
+
/**
|
|
137
|
+
* Check names for uniqueness
|
|
138
|
+
*
|
|
139
|
+
* @param {Array<string>} namesToCheck - an array list of the names (strings) to check for uniqueness
|
|
140
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
141
|
+
*/
|
|
142
|
+
checkNames(namesToCheck: Array<string>): Promise<unknown>;
|
|
143
|
+
/**
|
|
144
|
+
* Search for employees
|
|
145
|
+
*
|
|
146
|
+
* @param {Array<string>} searchParameters - an object of employee properties to search for. Support properties are: `AdDomain`, `DomainId`, `Email`, `EmployeeId`, `EmployeeSid`, `LoginName`, `UniqueName`, `FirstName`, `Lastname`, `FullName`, `IsUser`, `Organization`
|
|
147
|
+
* @param {boolean} active - search by active or all employees. Default is false (active only).
|
|
148
|
+
* @param {number} maxResults - the maximum number of results to return. Default is 20.
|
|
149
|
+
* @return {Object} Returns Promise object that represents an object that is the newly-added user
|
|
150
|
+
*/
|
|
151
|
+
search(searchParameters: {
|
|
152
|
+
AdDomain?: Array<string>;
|
|
153
|
+
DomainId?: Array<number>;
|
|
154
|
+
Email?: Array<string>;
|
|
155
|
+
EmployeeId?: Array<string>;
|
|
156
|
+
EmployeeSid?: Array<number>;
|
|
157
|
+
LoginName?: Array<string>;
|
|
158
|
+
UniqueName?: Array<string>;
|
|
159
|
+
FirstName?: Array<string>;
|
|
160
|
+
LastName?: Array<string>;
|
|
161
|
+
FullName?: Array<string>;
|
|
162
|
+
IsUser?: Boolean;
|
|
163
|
+
Organization?: Array<string>;
|
|
164
|
+
}, active?: boolean, maxResults?: number): Promise<unknown>;
|
|
165
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Request } from './request';
|
|
|
9
9
|
import { Inspection } from './inspection';
|
|
10
10
|
import { WorkOrder } from './workorder';
|
|
11
11
|
import { Briefcase } from './briefcase';
|
|
12
|
+
import { Employee } from './employee';
|
|
12
13
|
interface Citywork {
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
@@ -228,4 +229,5 @@ declare const inspection: Inspection;
|
|
|
228
229
|
declare const workorder: WorkOrder;
|
|
229
230
|
declare const briefcase: Briefcase;
|
|
230
231
|
declare const report: Report;
|
|
231
|
-
|
|
232
|
+
declare const employee: Employee;
|
|
233
|
+
export { cw as Cityworks, general, activity_link, message_queue, search, query, gis, request, inspection, workorder, briefcase, report, employee };
|