cityworks 1.0.3 → 1.0.4

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 CHANGED
@@ -101,3 +101,8 @@ For any object in Cityworks which has attachments, (including cases as CaRelDocs
101
101
  cw.request.attachment.add(RequestIDGoesHere, path.join('uploads', 'filename.pdf')).then(resp => {})
102
102
 
103
103
  cw.inspection.attachment.add(InspectionIDGoesHere, path.join('uploads', 'filename.pdf')).then(resp => {})
104
+
105
+
106
+ ## Activity Links
107
+
108
+ cw.activity_link.add(source_type, source_sid, destination_type, destination_sid)
@@ -1,8 +1,86 @@
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
+ }
1
75
  export declare class Briefcase {
2
76
  /**
3
77
  * @hidden
4
78
  */
5
79
  cw: any;
80
+ /**
81
+ * @hidden
82
+ */
83
+ current_case: number;
6
84
  /**
7
85
  * Data Detail methods
8
86
  */
@@ -44,7 +122,7 @@ export declare class Briefcase {
44
122
  * @param {Object} [options] - See /{subdirectory}/apidocs/#/data-type-info;dataType=CaObjectItemBase
45
123
  * @return {Object} Returns Promise that represents an object describing the newly-created case
46
124
  */
47
- create(caseTypeId: number, subTypeId: number, options?: Object): Promise<unknown>;
125
+ create(caseTypeId: number, subTypeId: number, options?: Object): Promise<Briefcase>;
48
126
  /**
49
127
  * Create a child case
50
128
  *
@@ -54,7 +132,7 @@ export declare class Briefcase {
54
132
  * @param {Object} [options] - See /{subdirectory}/apidocs/#/data-type-info;dataType=CaObjectItemBase
55
133
  * @return {Object} Returns Promise that represents an object describing the newly-created case
56
134
  */
57
- createChild(busCaseId: number, parentCaObjectId: number, options?: Object): Promise<unknown>;
135
+ createChild(busCaseId: number, parentCaObjectId: number, options?: Object): Promise<Briefcase>;
58
136
  /**
59
137
  * Create a case from a Service Request
60
138
  *
@@ -74,15 +152,15 @@ export declare class Briefcase {
74
152
  * @param {Object} [options] - See /{subdirectory}/apidocs/#/data-type-info;dataType=CaObjectItemBase
75
153
  * @return {Object} Returns Promise that represents an object describing the updated case
76
154
  */
77
- update(caObjectId: number, options?: Object): Promise<unknown>;
155
+ update(caObjectId: number, options?: Object): Promise<Briefcase>;
78
156
  /**
79
157
  * Get cases by IDs
80
158
  *
81
159
  * @category Cases
82
- * @param {Array<number>} caObjectIds - The case Object ID to update
160
+ * @param {Array<number>} caObjectIds - The case Object ID to get
83
161
  * @return {Object} Returns Promise that represents a collection of objects describing the cases
84
162
  */
85
- getByIds(caObjectIds: Array<number>): Promise<unknown>;
163
+ getByIds(caObjectIds: Array<number>): Promise<Array<Briefcase>>;
86
164
  /**
87
165
  * Search for Cases. Include at least one of the search fields. A logical 'and' operation is applied for multiple search fields.
88
166
  *
@@ -90,7 +168,7 @@ export declare class Briefcase {
90
168
  * @param {Object} filters - The parameter(s) to search by
91
169
  * @return {Object} Returns Promise that represents an Array of case Object IDs
92
170
  */
93
- search(filters: Object): Promise<unknown>;
171
+ search(filters: Object): Promise<Array<number>>;
94
172
  /**
95
173
  * Move a Case point
96
174
  *
@@ -15,6 +15,7 @@ export declare class CaseAssets {
15
15
  * @param {boolean} updateXY - Whether or not to update the Case's X/Y values when attaching the asset. Defaults to true.
16
16
  * @param {Object} [options] - Options for CaseDataGroup including Address, AddressId, AssetId, AssetObjectId, AssetType, CityName, CrossStreet, DateExpired, ExpiredFlag, Facility_Id, FeatureAssetId, FeatureClass, FeatureObjectId, LegacyId, Level_Id, LndObjectId, Location, MasterFlag, ObjectId, StateCode, StreetDirection, StreetFraction, StreetName, StreetNumber, StreetPostDir, StreetType, Suite, TileNo, UpdateCaseData, XCoord, YCoord, ZCoord, and ZipCode
17
17
  * @return {Object} Returns Promise that represents an object describing CaAddress.
18
+ * // {"AddressId":OBJECTID,"AssetId":"GUID","AssetType":"ASSET_NAME","CaObjectId":CA_OBJECTID,"FeatureAssetId":"GUID","FeatureClass":"ASSET_NAME","FeatureObjectId":OBJECTID,"Location":"Address string","ObjectId":"OBJECTID","XCoord":,"YCoord":,"UpdateCaseData":false}
18
19
  */
19
20
  attach(caObjectId: number, updateXY?: boolean, options?: {
20
21
  Address?: string;
@@ -48,10 +48,10 @@ export declare class CaseData {
48
48
  * Get groups by CaObjectId
49
49
  *
50
50
  * @category Data Groups
51
- * @param {number} caObjectId - The Case Object to get the attached data groups.
51
+ * @param {number} caseId - The Case Object to get the attached data groups.
52
52
  * @return {Object} Returns Promise that represents a collection of the CaDataGroupItemBases.
53
53
  */
54
- getGroupsByCaseId(caObjectId: number): Promise<unknown>;
54
+ getGroupsByCaseId(caseId: number): Promise<unknown>;
55
55
  /**
56
56
  * Delete Case Data Groups by Case Object ID.
57
57
  *
@@ -67,7 +67,7 @@ export declare class CaseData {
67
67
  * @param {Object} filters - The parameters to search by. (CaDataGroupId, CaseDataGroupId, GroupCode, GroupDesc, GroupSum, SumFlag)
68
68
  * @return {Object} Returns Promise that represents a number that is the CaObjectId (?)
69
69
  */
70
- searchForGroups(filters?: Object): Promise<unknown>;
70
+ searchForGroups(filters?: Object): Promise<Array<any>>;
71
71
  /**
72
72
  * Get Case Data Groups by Case ObjectId
73
73
  *
@@ -116,7 +116,7 @@ export declare class CaseData {
116
116
  * Lock Case Data Detail
117
117
  *
118
118
  * @category Data Details
119
- * @param {number} caDataDetailId - The Case Data Group ID to lock
119
+ * @param {number} caDataDetailId - The Case Data Detail ID to lock
120
120
  * @return {Object} Returns Promise which represents an object describing the CaDataDetailItem.
121
121
  */
122
122
  lockDetail(caDataDetailId: number): Promise<unknown>;
@@ -133,9 +133,9 @@ export declare class CaseData {
133
133
  *
134
134
  * @category Data Details
135
135
  * @param {Object} filters - The parameters to search by. (CaDataGroupId, CaseDataGroupId, GroupCode, GroupDesc, GroupSum, SumFlag)
136
- * @return {Object} Returns Promise that represents a number that is the CaObjectId (?)
136
+ * @return {Object} Returns Promise that represents an object describing CaDataDetailItemBase.
137
137
  */
138
- searchForDetails(filters?: Object): Promise<unknown>;
138
+ searchForDetails(filters?: Object): Promise<Array<any>>;
139
139
  /**
140
140
  * Adds a list of possible values to the data detail entry specified by the CaDataDetailId.
141
141
  *
@@ -169,4 +169,43 @@ export declare class CaseData {
169
169
  * @return {Object} Returns Promise that represents a collection of resulting CaDataListValuesItemBase objects
170
170
  */
171
171
  searchForListValueObjects(filters?: Object): Promise<unknown>;
172
+ /**
173
+ * Set a data detail item's value without needing to find the type
174
+ *
175
+ * @category Data Details
176
+ * @param dataDetailId - The data detail item's ID
177
+ * @param value - the value to set the data detail item to
178
+ * @returns Promise that represents
179
+ */
180
+ updateDetailItemValue(dataDetailId: number, value: any): Promise<unknown>;
181
+ /**
182
+ * Get the Case Data Details for a Case by Case ID
183
+ *
184
+ * @category Data Details
185
+ * @param {number} caseId - The case ID to get the details for
186
+ * @return {Object} Returns Promise that represents a collection of Case Data Detail Items
187
+ */
188
+ getAllDataDetails(caseId: number): Promise<Array<any>>;
189
+ /**
190
+ * Set Case Data Detail Items for a Case by GroupCode.ItemCode syntax reference
191
+ *
192
+ * @category Data Details
193
+ * @param {number} caseId - The case ID to get the details for
194
+ * @param {Object} items - The parameters to search by. (DataGroup/Item string, Value) (e.g. {code: 'GroupCode.ItemCode', value: 'Value goes here'})
195
+ * @return {Object} Returns Promise that represents a collection
196
+ */
197
+ setCaseData(caseId: number, items: Array<{
198
+ code: string;
199
+ value: any;
200
+ }>): Promise<unknown>;
201
+ /**
202
+ * Set Case Data Detail Item for a Case by GroupCode.ItemCode syntax reference
203
+ *
204
+ * @category Data Details
205
+ * @param {number} caseId - The Case ID to set the detail for
206
+ * @param {string} detailGroupAndItemCode - The parameters to search (e.g. 'GroupCode.ItemCode')
207
+ * @param {any} value - The value to set the specified detail to
208
+ * @return {Object} Returns Promise
209
+ */
210
+ setCaseDataItem(caseId: number, detailGroupAndItemCode: string, value: any): Promise<unknown>;
172
211
  }
package/dist/error.d.ts CHANGED
@@ -1,3 +1,12 @@
1
+ export interface CWErrorMsgs {
2
+ MessageType: number;
3
+ Code: number;
4
+ Service: string;
5
+ Name: string;
6
+ DebugDetails: string;
7
+ DisplayText: string;
8
+ InnerMessage: string | null;
9
+ }
1
10
  /**
2
11
  * CWErrorInt interface definition for implementation by CWError
3
12
  *
@@ -8,6 +17,7 @@ export interface CWErrorInt {
8
17
  name: string;
9
18
  code: number;
10
19
  message: string;
20
+ error_messages?: Array<CWErrorMsgs>;
11
21
  info?: string;
12
22
  }
13
23
  /**
@@ -27,6 +37,10 @@ export declare class CWError implements CWErrorInt {
27
37
  * The error message
28
38
  */
29
39
  message: string;
40
+ /**
41
+ * The error message
42
+ */
43
+ error_messages: Array<CWErrorMsgs>;
30
44
  /**
31
45
  * Object stuffed with any other information one wishes to include in the thrown error
32
46
  */
@@ -39,5 +53,5 @@ export declare class CWError implements CWErrorInt {
39
53
  * @param {Object} info - Object stuffed with any other information one wishes to include in the thrown error
40
54
  * @return {Object} Returns instance of CWError object
41
55
  */
42
- constructor(code: number, message: string, info?: object);
56
+ constructor(code: number, message: string, info?: any);
43
57
  }