cityworks 2.0.0 → 2.1.0

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.
@@ -0,0 +1,84 @@
1
+ import ReversibleMap from 'reversible-map';
2
+ /**
3
+ * ActivityLink interface for ActivityLinks
4
+ *
5
+ */
6
+ export interface ActivityLink {
7
+ linkTypes: ReversibleMap<string, number>;
8
+ activityTypes: ReversibleMap<string, number>;
9
+ cw: any;
10
+ }
11
+ /**
12
+ * ActivityLinks implements the activity link functions via using the ActivityLink interface
13
+ *
14
+ */
15
+ export declare class ActivityLinks implements ActivityLink {
16
+ /**
17
+ * Activity types to map string to number for internal use. Activity types available are: "null", "case", "inspection", "request", "workorder", "wipcase"
18
+ */
19
+ activityTypes: ReversibleMap<string, number>;
20
+ /**
21
+ * Link types to map string to number for internal use. Link types available are: "null", "parent", "related"
22
+ */
23
+ linkTypes: ReversibleMap<string, number>;
24
+ /**
25
+ * @hidden
26
+ */
27
+ cw: any;
28
+ /**
29
+ * @hidden
30
+ */
31
+ constructor(cw: any);
32
+ private setActivityTypes;
33
+ private setLinkTypes;
34
+ private validateType;
35
+ private transformLinksData;
36
+ private runRequest;
37
+ /**
38
+ * Create a new activity link between two items.
39
+ *
40
+ * @param {string} source_type - Source type as string. Options: "null", "case", "inspection", "request", "workorder", "wipcase"
41
+ * @param {number} source_sid - Source SID (numeric ID) one wishes to remove a link between SID as source and a particular destination
42
+ * @param {string} destination_type - Destination type as string: "null", "case", "inspection", "request", "workorder", "wipcase"
43
+ * @param {number} destination_sid - Destination SID (numeric ID) one wishes to remove a link between SID as destination and a particular source
44
+ * @param {string} link_type - The type of link which exists between provided source and destination. Defaults to `related`. Options: "null", "parent", "related"
45
+ * @return {Object} Returns Promise object that represents a
46
+ */
47
+ add(source_type: string, source_sid: number, destination_type: string, destination_sid: number, link_type?: string): Promise<unknown>;
48
+ /**
49
+ * Get the links for a particular node type by ID.
50
+ *
51
+ * @param {string} type - Source type as string. Options: "null", "case", "inspection", "request", "workorder", "wipcase"
52
+ * @param {Array<number>} sids - Array of numeric (S)IDs you wish to get of the specified type
53
+ * @return {Object} Returns Promise object that represents a collection
54
+ */
55
+ get(type: string, sids: Array<number>): Promise<unknown>;
56
+ /**
57
+ * Clone a current activity link.
58
+ *
59
+ * @param {string} source_type - Source type as string. Options: "null", "case", "inspection", "request", "workorder", "wipcase"
60
+ * @param {number} source_sid - Source SID (numeric ID) one wishes to clone a link between SID as source and a particular destination
61
+ * @param {string} destination_type - Destination type as string: "null", "case", "inspection", "request", "workorder", "wipcase"
62
+ * @param {number} destination_sid - Destination SID (numeric ID) one wishes to clone a link between SID as destination and a particular source
63
+ * @return {Object} Returns Promise object that represents a
64
+ */
65
+ clone(source_type: string, source_sid: number, destination_type: string, destination_sid: number): Promise<unknown>;
66
+ /**
67
+ * Delete an activity link by ID
68
+ *
69
+ * @param {number} activity_link_id - The ID of the activity link one wishes to delete
70
+ * @return {Object} Returns Promise object that represents a
71
+ */
72
+ delete(activity_link_id: number): Promise<unknown>;
73
+ /**
74
+ * Remove a link by specifying everything.
75
+ *
76
+ * @param {string} source_type - Source type as string. Options: "null", "case", "inspection", "request", "workorder", "wipcase"
77
+ * @param {number} source_sid - Source SID (numeric ID) one wishes to remove a link between SID as source and a particular destination
78
+ * @param {string} destination_type - Destination type as string: "null", "case", "inspection", "request", "workorder", "wipcase"
79
+ * @param {number} destination_sid - Destination SID (numeric ID) one wishes to remove a link between SID as destination and a particular source
80
+ * @param {string} link_type - The type of link which exists between provided source and destination. Defaults to `related`. Options: "null", "parent", "related"
81
+ * @return {Object} Returns Promise object that represents a
82
+ */
83
+ remove(source_type: string, source_sid: number, destination_type: string, destination_sid: number, link_type?: string): Promise<unknown>;
84
+ }
@@ -0,0 +1,134 @@
1
+ export declare class Attachments {
2
+ /**
3
+ * @hidden
4
+ */
5
+ cw: any;
6
+ /**
7
+ * Storage of object's active activityType
8
+ */
9
+ currentActivityType: string;
10
+ /**
11
+ * @hidden
12
+ */
13
+ constructor(cw: any, current_type: any);
14
+ /**
15
+ * Add attachments (doesn't handle URL or Signature type attachments properly, currently)
16
+ *
17
+ * @category Attachments
18
+ * @param {number} id - The ID of the node to add the attachment to (CA_OBJECT_ID, REQUESTID, WORKORDERSID, WORKORDERID, INSPECTIONID). If WORKORDERID, you _must_ feed in as a string.
19
+ * @param {string} the_file - The loca path of the file to upload to the Cityworks instance
20
+ * @param {number} [task_id] - ID of WorkOrder task, if current activity is a work order and the attachment should be on the task
21
+ * @param {string} [filename] - The filename for the attachment
22
+ * @param {string} [attachment_type] - The filename for the attachment, values: attachment, signature, url
23
+ * @param {string} [comments] - The filename for the attachment
24
+ * @param {string} [label] - The label to apply to the (PLL only)
25
+ * @return {Object} Returns object that represents a boolean for action resolution
26
+ */
27
+ add(node_id: number | string, the_file: string, filename?: string, attachment_type?: string, task_id?: number, comments?: string, label?: string): Promise<unknown>;
28
+ /**
29
+ * Update attachment
30
+ *
31
+ * @category Attachments
32
+ * @param {number} id - The ID of the node to add the attachment to (CA_OBJECT_ID, REQUESTID, WORKORDERSID, WORKORDERID, INSPECTIONID). If WORKORDERID, you _must_ feed in as a string.
33
+ * @param {string} [title] - The filename for the attachment
34
+ * @param {string} [description] - The filename for the attachment
35
+ * @param {string} [label] - The label to apply to the (PLL only)
36
+ * @return {Object} Returns object that represents a boolean for action resolution
37
+ */
38
+ update(attachment_id: number, title?: string, description?: string, label?: string): Promise<unknown>;
39
+ /**
40
+ * Delete inspection attachments
41
+ *
42
+ * @category Inspection Attachments
43
+ * @param {Array<number>|number} attachmentIds - An array of attachment IDs or a single attachment ID to delete.
44
+ * @return {Object} Returns object that represents a boolean for action resolution
45
+ */
46
+ delete(attachmentIds: Array<number> | number): Promise<unknown>;
47
+ /**
48
+ * Get attachment URLs in array
49
+ *
50
+ * @category Attachments
51
+ * @return {Object} Returns array of attachment URLs
52
+ */
53
+ static downloadUrls(): string[];
54
+ /**
55
+ * Download an attachment
56
+ *
57
+ * @category Attachments
58
+ * @param {number} attachmentId - ID of an attachment to download
59
+ * @return {Object} Returns object that represents a file stream
60
+ */
61
+ download(attachmentId: number): Promise<unknown>;
62
+ /**
63
+ * Get attachment by ID (not implemented)
64
+ *
65
+ * @category Attachments
66
+ * @param {number} attachmentId - An attachment ID to get info for
67
+ * @return {Object} Returns object that represents an object that describes the matched inspection attachment
68
+ */
69
+ getById(attachmentId: number): Promise<unknown>;
70
+ /**
71
+ * Get attachments related to Inspection, WorkOrder, or Request
72
+ *
73
+ * @category Attachments
74
+ * @param {Array<number>|number} ids - An array of IDs or a single ID (inspectionIds, WorkOrderSids, WorkOrderIds, or RequestIds) for which to get attachments. Only one node (Inspection, WorkOrder, Request, or Case) type at a time. Don't mix-and-match WorkOrderIds with WorkOrderSids.
75
+ * @return {Object} Returns Promise that represents a collection of attachments from the matched inspections, service requests, or work orders
76
+ */
77
+ getAttachments(ids: Array<number> | number): Promise<unknown>;
78
+ /**
79
+ * Get Related Documents from Case
80
+ *
81
+ * @category Attachments
82
+ * @param {number} id - An array of CaseIDs or a single CaseID for which to get related documents.
83
+ * @return {Object} Returns Promise that represents a collection of related documents from the matched cases
84
+ */
85
+ getRelatedDocs(id: number): Promise<unknown>;
86
+ /**
87
+ * Get attachment by node (Inspection, WorkOrder, Request, or Case) IDs
88
+ *
89
+ * @category Attachments
90
+ * @param {Array<number>|number} ids - An array of IDs or a single ID (inspectionIds, WorkOrderSids, WorkOrderIds, RequestIds, or CaseIds) to get attachments for. Only one node (Inspection, WorkOrder, Request, or Case) type at a time. Don't mix-and-match WorkOrderIds with WorkOrderSids.
91
+ * @return {Object} Returns Promise that represents a collection of attachments from the matched inspections
92
+ */
93
+ getByNodesId(ids: Array<number> | number): Promise<unknown>;
94
+ /**
95
+ * Get Tags available with which to tag attachments
96
+ *
97
+ * @category Attachments
98
+ * @return {Object} Returns Promise that represents a collection of tags that can be added to attachments
99
+ */
100
+ getTags(): Promise<unknown>;
101
+ private syncTags;
102
+ private loopSyncTags;
103
+ /**
104
+ * Set Tags on an attachment
105
+ *
106
+ * @category Attachments
107
+ * @return {Object} Returns Promise that represents a collection of tags that can be added to attachments
108
+ */
109
+ setTags(attachmentId: number, tags: {
110
+ tagid: number;
111
+ tagtext: string;
112
+ }[], activityType: string): Promise<unknown>;
113
+ /**
114
+ * Set Tags on an many attachments
115
+ *
116
+ * @category Attachments
117
+ * @param {Array<number>|number} attachmentIds - An array of attachment IDs to add tags to.
118
+ * @param {Array<{tagid: number, tagtext: string}>} tags - An array of tag objects to add to the attachments
119
+ * @param {string} activityType - The type of activity to which the attachments belong
120
+ * @return {Object} Returns Promise that represents a collection of documents which have had their tags set
121
+ */
122
+ setTagsOnMany(attachmentIds: number[], tags: {
123
+ tagid: number;
124
+ tagtext: string;
125
+ }[]): Promise<unknown>;
126
+ /**
127
+ * Get Doc labels for a case template
128
+ *
129
+ * @category Attachments
130
+ * @param {number} busCaseId - The ID of the Business Case to get Document Labels for
131
+ * @return {Object} Returns Promise that represents a collection of tags that can be added to attachments
132
+ */
133
+ getDocLabels(busCaseId: number): Promise<unknown>;
134
+ }
@@ -0,0 +1,274 @@
1
+ export interface Briefcase {
2
+ TempTableName: string;
3
+ AnonymousFlag: string;
4
+ RegisteredFlag: string;
5
+ CreatedByLoginId: string;
6
+ TableName: string;
7
+ ModifiedByLoginId: number;
8
+ AcceptedByLoginId: number;
9
+ EnteredByLoginid: number;
10
+ WorkOrderId: string;
11
+ WorkOrderDesc: string;
12
+ WorkOrderStatus: string;
13
+ ServiceRequestId: number;
14
+ ServiceRequestDesc: string;
15
+ ServiceRequestStatus: string;
16
+ CloneCaseRelation: any | null;
17
+ PendingFlag: any | null;
18
+ CaseGroup: any | null;
19
+ ParentCaObjectId: number | null;
20
+ AmountDue: number | null;
21
+ GetViewColumns: Array<string>;
22
+ CaObjectId: number;
23
+ OrgId: number;
24
+ CaseTypeId: number;
25
+ CaseType: string;
26
+ CaseTypeDesc: string;
27
+ BusCaseDesc: string | null;
28
+ SubTypeId: number | null;
29
+ SubType: string | null;
30
+ SubTypeDesc: string | null;
31
+ CreatedBy: number;
32
+ DateAccepted: Date | null;
33
+ DateCreated: Date;
34
+ DateEntered: Date;
35
+ DateExpiration: Date | null;
36
+ DateIssued: Date | null;
37
+ DateModified: Date | null;
38
+ EnteredBy: number;
39
+ ExpiredFlag: string | null;
40
+ IssuedBy: number | null;
41
+ IssuedFlag: string | null;
42
+ ModifiedBy: number | null;
43
+ SubTypeDefaultText: string | null;
44
+ CaseNumber: string;
45
+ CaseStatusId: number;
46
+ CaseStatus: string;
47
+ ProjectSid: number | null;
48
+ ProjectId: string | null;
49
+ ProjectCode: string | null;
50
+ ProjectDesc: string | null;
51
+ PriorityLevel: string | null;
52
+ StatusCode: string;
53
+ CaseName: string;
54
+ AcceptedBy: number;
55
+ BLicenseFlag: string | null;
56
+ BusinessName: string | null;
57
+ BusCaseId: number | null;
58
+ BusinessOrgType: string | null;
59
+ BusinessCategory: string | null;
60
+ StateTaxId: string | null;
61
+ FedTaxId: string | null;
62
+ Location: string | null;
63
+ PACaseFlag: string | null;
64
+ ActiveFlag: string | null;
65
+ CX: number | null;
66
+ CY: number | null;
67
+ CZ: number | null;
68
+ AssignedTo: number | null;
69
+ AssignedToLoginId: string | null;
70
+ AssignedToFirstName: string | null;
71
+ AssignedToLastName: string | null;
72
+ Facility_Id: string | number | null;
73
+ Level_Id: string | number | null;
74
+ }
75
+ export declare class Briefcase {
76
+ /**
77
+ * @hidden
78
+ */
79
+ cw: any;
80
+ /**
81
+ * @hidden
82
+ */
83
+ current_case: number;
84
+ /**
85
+ * Data Detail methods
86
+ */
87
+ data?: any;
88
+ /**
89
+ * Asset (Address) methods
90
+ */
91
+ asset?: any;
92
+ /**
93
+ * Asset (Address) methods
94
+ */
95
+ attachments?: any;
96
+ /**
97
+ * Workflow & task methods
98
+ */
99
+ workflow?: any;
100
+ /**
101
+ * Payment, Receipt, & Fee methods
102
+ */
103
+ financial?: any;
104
+ /**
105
+ * Commenting methods
106
+ */
107
+ comment?: any;
108
+ /**
109
+ * Payment, Receipt, & Fee methods
110
+ */
111
+ people?: any;
112
+ /**
113
+ * PLL Administration methods
114
+ */
115
+ admin?: any;
116
+ /**
117
+ * @hidden
118
+ */
119
+ constructor(cw: any);
120
+ /**
121
+ * Get Required items for case by case template id (BusCaseId)
122
+ *
123
+ * @category Cases
124
+ * @param {number} busCaseId - The case tmeplate ID (BusCaseId)
125
+ * @return {Object} Returns Promise that represents a collection of objects describing the requirements of the case template
126
+ */
127
+ getRequirements(busCaseId: number): Promise<Briefcase>;
128
+ /**
129
+ * Create new case
130
+ *
131
+ * @category Cases
132
+ * @param {number} caseTypeId - The case Type ID
133
+ * @param {number} subTypeId - The case subType ID
134
+ * @param {Object} [options] - See /{subdirectory}/apidocs/#/data-type-info;dataType=CaObjectItemBase
135
+ * @return {Object} Returns Promise that represents an object describing the newly-created case
136
+ */
137
+ create(caseTypeId: number, subTypeId: number, options?: Object): Promise<Briefcase>;
138
+ /**
139
+ * Create a child case
140
+ *
141
+ * @category Cases
142
+ * @param {number} busCaseId - The case Type ID
143
+ * @param {number} parentCaObjectId - The case subType ID
144
+ * @param {Object} [options] - See /{subdirectory}/apidocs/#/data-type-info;dataType=CaObjectItemBase
145
+ * @return {Object} Returns Promise that represents an object describing the newly-created case
146
+ */
147
+ createChild(busCaseId: number, parentCaObjectId: number, options?: Object): Promise<Briefcase>;
148
+ /**
149
+ * Create a case from a Service Request
150
+ *
151
+ * @category Cases
152
+ * @param {number} caseTypeId - The case Type ID
153
+ * @param {number} subTypeId - The case subType ID
154
+ * @param {number} requestId - The service request ID
155
+ * @param {Object} [options] - See /{subdirectory}/apidocs/#/data-type-info;dataType=CaObjectItemBase
156
+ * @return {Object} Returns Promise that represents an object describing the newly-created case
157
+ */
158
+ createFromRequest(caseTypeId: number, subTypeId: number, requestId: number, options?: Object): Promise<unknown>;
159
+ /**
160
+ * Update a case
161
+ *
162
+ * @category Cases
163
+ * @param {number} caObjectId - The case Object ID to update
164
+ * @param {Object} [options] - See /{subdirectory}/apidocs/#/data-type-info;dataType=CaObjectItemBase
165
+ * @return {Object} Returns Promise that represents an object describing the updated case
166
+ */
167
+ update(caObjectId: number, options?: Object): Promise<Briefcase>;
168
+ /**
169
+ * Get cases by IDs
170
+ *
171
+ * @category Cases
172
+ * @param {Array<number>} caObjectIds - The case Object ID to get
173
+ * @return {Object} Returns Promise that represents a collection of objects describing the cases
174
+ */
175
+ getByIds(caObjectIds: Array<number>): Promise<Array<Briefcase>>;
176
+ /**
177
+ * Search for Cases. Include at least one of the search fields. A logical 'and' operation is applied for multiple search fields.
178
+ *
179
+ * @category Cases
180
+ * @param {Object} filters - The parameter(s) to search by
181
+ * @return {Object} Returns Promise that represents an Array of case Object IDs
182
+ */
183
+ search(filters: Object): Promise<Array<number>>;
184
+ /**
185
+ * Move a Case point
186
+ *
187
+ * @category Cases
188
+ * @param {string} caObjectId
189
+ * @param {number} x
190
+ * @param {number} y
191
+ * @param {Object} projection - Should include at least WKT _or_ WKID attribute. Can also include VcsWKID attribute.
192
+ * @param {number} [z] - Optional Z coordinate
193
+ * @return {Object} Returns Promise that represents an object describing the updated GISPoint
194
+ */
195
+ move(caObjectId: number, x: number, y: number, projection: {
196
+ WKID?: string;
197
+ WKT?: string;
198
+ VcsWKID?: string;
199
+ }, z?: number): Promise<unknown>;
200
+ /**
201
+ * Delete case
202
+ *
203
+ * @category Cases
204
+ * @param {number} caObjectId - The case Object ID
205
+ * @return {Object} Returns Promise that represents an object describing the deleted case
206
+ */
207
+ delete(caObjectId: number): Promise<unknown>;
208
+ /**
209
+ * Get Map Layer Fields
210
+ *
211
+ * @category Cases
212
+ * @param {number} caObjectId - The case object ID to get the map layer fields for.
213
+ * @return {Object} Returns Promise that represents a collection of Objects describing the case object map layer fields
214
+ */
215
+ getMLFs(caObjectId: number): Promise<unknown>;
216
+ /**
217
+ * Update Map Layer Fields
218
+ *
219
+ * @category Cases
220
+ * @param {number} caObjectId - The case object ID to get the map layer fields for.
221
+ * @param {number} x
222
+ * @param {number} y
223
+ * @param {number} domainId - The domain ID for the case in question
224
+ * @param {number} [z] - Optional Z coordinate
225
+ * @return {Object} Returns Promise that represents a collection of Objects describing the case object map layer fields
226
+ */
227
+ updateMLFs(caObjectId: number, x?: number, y?: number, domainId?: number, z?: number): Promise<unknown>;
228
+ /**
229
+ * Delete Map Layer Fields
230
+ *
231
+ * @category Cases
232
+ * @param {number} caObjectId - The case object ID to delete the map layer fields for.
233
+ * @return {Object} Returns Promise that represents a collection of Objects describing the case object map layer fields deleted
234
+ */
235
+ deleteMLFs(caObjectId: number): Promise<unknown>;
236
+ /**
237
+ * Reports available for Case
238
+ *
239
+ * @category Cases
240
+ * @param {number} caObjectId - The case object ID to get the report (print template) list for
241
+ * @return {Object} Returns Promise that represents a collection of Objects describing the reports (print templates) available for this case
242
+ */
243
+ getPrintTemplates(caObjectId: number): Promise<unknown>;
244
+ /**
245
+ * Print Case
246
+ *
247
+ * @category Cases
248
+ * @param {number} caObjectId - The case object ID to delete the map layer fields for.
249
+ * @param {string} fileName - the filename of the report from the getPrintTemplates method, but w/out the extension
250
+ * @return {Object} Returns Promise that represents a collection of Objects describing the case object map layer fields deleted
251
+ */
252
+ print(caObjectId: number, fileName: string, callback: any): Promise<unknown>;
253
+ /**
254
+ * Get the configured zip codes for the install
255
+ *
256
+ * @category Cases
257
+ * @return {Object} Returns Promise that represents a collection of zip codes configured for the install
258
+ */
259
+ getZips(): Promise<unknown>;
260
+ /**
261
+ * Get the configured states for the install
262
+ *
263
+ * @category Cases
264
+ * @return {Object} Returns Promise that represents a collection of states configured for the install
265
+ */
266
+ getStates(): Promise<unknown>;
267
+ /**
268
+ * Get the configured countries for the install
269
+ *
270
+ * @category Cases
271
+ * @return {Object} Returns Promise that represents a collection of countries configured for the install
272
+ */
273
+ getCountries(): Promise<unknown>;
274
+ }