cityworks 0.0.52 → 1.0.1

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.
Files changed (45) hide show
  1. package/README.md +13 -1
  2. package/dist/activity_link.js +219 -0
  3. package/dist/attachments.d.ts +59 -0
  4. package/dist/briefcase.d.ts +22 -1
  5. package/dist/briefcase.js +327 -0
  6. package/dist/case_admin.d.ts +0 -22
  7. package/dist/case_admin.js +821 -0
  8. package/dist/case_assets.js +129 -0
  9. package/dist/case_data.js +416 -0
  10. package/dist/case_financial.js +848 -0
  11. package/dist/case_workflow.js +455 -0
  12. package/dist/comments.js +126 -0
  13. package/dist/error.js +30 -0
  14. package/dist/event_layer.d.ts +97 -0
  15. package/dist/event_layer.js +207 -0
  16. package/dist/general.d.ts +23 -0
  17. package/dist/general.js +212 -0
  18. package/dist/gis.js +250 -0
  19. package/dist/index.d.ts +10 -8
  20. package/dist/index.js +1 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.m.js +1 -1
  23. package/dist/index.m.js.map +1 -1
  24. package/dist/index.modern.mjs +1 -1
  25. package/dist/index.modern.mjs.map +1 -1
  26. package/dist/index.umd.js +1 -1
  27. package/dist/index.umd.js.map +1 -1
  28. package/dist/inspection.d.ts +17 -1
  29. package/dist/inspection.js +933 -0
  30. package/dist/inspection_admin.js +43 -0
  31. package/dist/inspection_costs.js +200 -0
  32. package/dist/message_queue.js +248 -0
  33. package/dist/query.d.ts +108 -0
  34. package/dist/query.js +242 -0
  35. package/dist/request.d.ts +5 -1
  36. package/dist/request.js +899 -0
  37. package/dist/request_admin.js +32 -0
  38. package/dist/request_costs.js +113 -0
  39. package/dist/search.d.ts +12 -1
  40. package/dist/search.js +371 -0
  41. package/dist/workorder.d.ts +4 -0
  42. package/dist/workorder.js +951 -0
  43. package/dist/workorder_admin.js +248 -0
  44. package/dist/workorder_costs.js +274 -0
  45. package/package.json +7 -2
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CaseAssets = void 0;
4
+ var error_1 = require("./error");
5
+ var _ = require('lodash');
6
+ var CaseAssets = /** @class */ (function () {
7
+ /**
8
+ * @hidden
9
+ */
10
+ function CaseAssets(cw) {
11
+ this.cw = cw;
12
+ }
13
+ /**
14
+ * Attach asset to case
15
+ *
16
+ * @category Case Assets
17
+ * @param {number} caObjectId - The Case Object to attach the data group to.
18
+ * @param {boolean} updateXY - Whether or not to update the Case's X/Y values when attaching the asset. Defaults to true.
19
+ * @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
20
+ * @return {Object} Returns Promise that represents an object describing CaAddress.
21
+ */
22
+ CaseAssets.prototype.attach = function (caObjectId, updateXY, options) {
23
+ var _this = this;
24
+ if (updateXY === void 0) { updateXY = true; }
25
+ return new Promise(function (resolve, reject) {
26
+ var data = {
27
+ CaObjectId: caObjectId,
28
+ UpdateXY: updateXY
29
+ };
30
+ if (typeof (options) != 'undefined') {
31
+ data = _.merge(data, options);
32
+ }
33
+ _this.cw.runRequest('Pll/CaseAddress/Add', data).then(function (r) {
34
+ resolve(r.Value);
35
+ }).catch(function (e) {
36
+ reject(e);
37
+ });
38
+ });
39
+ };
40
+ /**
41
+ * Detach specific asset from case
42
+ *
43
+ * @category Case Assets
44
+ * @param {number} caObjectId - The Case Object to attach the data group to.
45
+ * @param {boolean} updateXY - Whether or not to update the Case's X/Y values when detaching the assets. Defaults to true.
46
+ * @return {Object} Returns Promise that represents a collection of the default CaDataGroupItemBases.
47
+ */
48
+ CaseAssets.prototype.detach = function (caAddressId, updateXY) {
49
+ var _this = this;
50
+ if (updateXY === void 0) { updateXY = true; }
51
+ return new Promise(function (resolve, reject) {
52
+ var data = {
53
+ CaAddressId: caAddressId,
54
+ UpdateXY: updateXY
55
+ };
56
+ _this.cw.runRequest('Pll/CaseAddress/Delete', data).then(function (r) {
57
+ resolve(r.Value);
58
+ }).catch(function (e) {
59
+ reject(e);
60
+ });
61
+ });
62
+ };
63
+ /**
64
+ * Detach all assets from case
65
+ *
66
+ * @category Case Assets
67
+ * @param {number} caObjectId - The Case Object to detach the assets from.
68
+ * @param {boolean} updateXY - Whether or not to update the Case's X/Y values when detaching the asset(s). Defaults to false.
69
+ * @return {Object} Returns Promise that represents a collection of detached CaAddressIds.
70
+ */
71
+ CaseAssets.prototype.detachAll = function (caObjectId, updateXY) {
72
+ var _this = this;
73
+ if (updateXY === void 0) { updateXY = false; }
74
+ return new Promise(function (resolve, reject) {
75
+ var data = {
76
+ CaObjectId: caObjectId,
77
+ UpdateXY: updateXY
78
+ };
79
+ _this.cw.runRequest('Pll/CaseAddress/DeleteByCaObjectId', data).then(function (r) {
80
+ resolve(r.Value);
81
+ }).catch(function (e) {
82
+ reject(e);
83
+ });
84
+ });
85
+ };
86
+ /**
87
+ * Get assets attached to a specific case
88
+ *
89
+ * @category Case Assets
90
+ * @param {number} caObjectId - The Case Object from which to get attached assets
91
+ * @return {Object} Returns Promise that represents a collection of the default CaAddresses.
92
+ */
93
+ CaseAssets.prototype.getForCase = function (caObjectId) {
94
+ var _this = this;
95
+ return new Promise(function (resolve, reject) {
96
+ var data = {
97
+ CaObjectId: caObjectId
98
+ };
99
+ _this.cw.runRequest('Pll/CaseAddress/ByCaObjectId', data).then(function (r) {
100
+ resolve(r.Value);
101
+ }).catch(function (e) {
102
+ reject(e);
103
+ });
104
+ });
105
+ };
106
+ /**
107
+ * Search for Case Assets. Include one or more of the search fields. A logical 'and' operation is applied to muliple search fields
108
+ *
109
+ * @category Case Assets
110
+ * @param {Object} filters - The parameters to search by. (AssetType, CaAddressId, CaObjectId, CityName, ExpiredFlag, StateCode, StateName, StreetName, StreetNumber, Suite, ZipCode)
111
+ * @return {Object} Returns Promise that represents an Array of resulting CaAddresses
112
+ */
113
+ CaseAssets.prototype.search = function (filters) {
114
+ var _this = this;
115
+ return new Promise(function (resolve, reject) {
116
+ if (_.intersectionBy(_.keysIn(filters), ['AssetType', 'CaAddressId', 'CaObjectId', 'CityName', 'ExpiredFlag', 'StateCode', 'StateName', 'StreetName', 'StreetNumber', 'Suite', 'ZipCode']).length == 0) {
117
+ reject(new error_1.CWError(3, 'At least one of the attributes (AssetType, CaAddressId, CaObjectId, CityName, ExpiredFlag, StateCode, StateName, StreetName, StreetNumber, Suite, ZipCode) must be defined.'));
118
+ }
119
+ var data = filters;
120
+ _this.cw.runRequest('Pll/CaseAddress/Search', data).then(function (r) {
121
+ resolve(r.Value);
122
+ }).catch(function (e) {
123
+ reject(e);
124
+ });
125
+ });
126
+ };
127
+ return CaseAssets;
128
+ }());
129
+ exports.CaseAssets = CaseAssets;
@@ -0,0 +1,416 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CaseData = void 0;
4
+ var error_1 = require("./error");
5
+ var _ = require('lodash');
6
+ var CaseData = /** @class */ (function () {
7
+ /**
8
+ * @hidden
9
+ */
10
+ function CaseData(cw) {
11
+ this.cw = cw;
12
+ }
13
+ /**
14
+ * Add Case Data Group
15
+ *
16
+ * @category Data Groups
17
+ * @param {number} caObjectId - The Case Object to attach the data group to.
18
+ * @param {number} caseDataGroupId - CaseDataGroupId as defined in CaseDataGroup admin.
19
+ * @param {string} groupCode - The Group Code.
20
+ * @param {Object} [options] - Options for CaseDataGroup including GroupDesc, GroupSum, and SumFlag
21
+ * @return {Object} Returns Promise that represents an object describing CaDataGroupItemBase.
22
+ */
23
+ CaseData.prototype.addGroup = function (caObjectId, caseDataGroupId, groupCode, options) {
24
+ var _this = this;
25
+ return new Promise(function (resolve, reject) {
26
+ var data = {
27
+ CaObjectId: caObjectId,
28
+ CaseDataGroupId: caseDataGroupId,
29
+ GroupCode: groupCode
30
+ };
31
+ if (typeof (options) != 'undefined') {
32
+ data = _.merge(data, options);
33
+ }
34
+ _this.cw.runRequest('Pll/CaseDataGroup/Add', data).then(function (r) {
35
+ resolve(r.Value);
36
+ }).catch(function (e) {
37
+ reject(e);
38
+ });
39
+ });
40
+ };
41
+ /**
42
+ * Add Default Case Data Groups
43
+ *
44
+ * @category Data Groups
45
+ * @param {number} caObjectId - The Case Object to attach the data group to.
46
+ * @param {number} busCaseId - The business case ID
47
+ * @return {Object} Returns Promise that represents a collection of the default CaDataGroupItemBases.
48
+ */
49
+ CaseData.prototype.addDefaultGroups = function (caObjectId, busCaseId) {
50
+ var _this = this;
51
+ return new Promise(function (resolve, reject) {
52
+ var data = {
53
+ CaObjectId: caObjectId,
54
+ BusCaseId: busCaseId
55
+ };
56
+ _this.cw.runRequest('Pll/CaseDataGroup/AddDefault', data).then(function (r) {
57
+ resolve(r.Value);
58
+ }).catch(function (e) {
59
+ reject(e);
60
+ });
61
+ });
62
+ };
63
+ /**
64
+ * Adds a data detail entry to the case data group specified by the CaDataGroupId. The CaDataGroupId is associated to a case.
65
+ *
66
+ * @category Data Groups
67
+ * @param {number} caseDataDetailId - The Data Detail template ID
68
+ * @param {number} caDataGroupId - The Case Instance Data Group ID
69
+ * @param {string} columnSequence - The column sequence
70
+ * @param {string} detailCode - The detail Code
71
+ * @param {number} detailSequence - The detail order number
72
+ * @param {Object} [options] - Other options for CaseDataDetail. See WIPAdd here: /{subdirectory}/apidocs/#/service-info/Pll/CaseDataDetail
73
+ * @return {Object} Returns Promise that represents an object describing CaDataDetailItemBase.
74
+ */
75
+ CaseData.prototype.wipAddDetail = function (caseDataDetailId, caDataGroupId, columnSequence, detailCode, detailSequence, options) {
76
+ var _this = this;
77
+ return new Promise(function (resolve, reject) {
78
+ var data_init = {
79
+ CaseDataDetailId: caseDataDetailId,
80
+ CaDataGroupId: caDataGroupId,
81
+ ColumnSequence: columnSequence,
82
+ DetailCode: detailCode,
83
+ DetailSequence: detailSequence
84
+ };
85
+ var data = _.merge(data_init, options);
86
+ _this.cw.runRequest('Pll/CaseDataGroup/Add', data).then(function (r) {
87
+ resolve(r.Value);
88
+ }).catch(function (e) {
89
+ reject(e);
90
+ });
91
+ });
92
+ };
93
+ /**
94
+ * Get groups by CaObjectId
95
+ *
96
+ * @category Data Groups
97
+ * @param {number} caObjectId - The Case Object to get the attached data groups.
98
+ * @return {Object} Returns Promise that represents a collection of the CaDataGroupItemBases.
99
+ */
100
+ CaseData.prototype.getGroupsByCaseId = function (caObjectId) {
101
+ var _this = this;
102
+ return new Promise(function (resolve, reject) {
103
+ var data = {
104
+ CaObjectId: caObjectId
105
+ };
106
+ _this.cw.runRequest('Pll/CaseDataGroup/ByCaObjectId', data).then(function (r) {
107
+ resolve(r.Value);
108
+ }).catch(function (e) {
109
+ reject(e);
110
+ });
111
+ });
112
+ };
113
+ /**
114
+ * Delete Case Data Groups by Case Object ID.
115
+ *
116
+ * @category Data Groups
117
+ * @param {number} caObjectId - The Case Object to attach the data group to.
118
+ * @return {Object} Returns Promise that represents a number that is the CaObjectId (?)
119
+ */
120
+ CaseData.prototype.deleteGroupsByCaseId = function (caObjectId) {
121
+ var _this = this;
122
+ return new Promise(function (resolve, reject) {
123
+ var data = {
124
+ CaObjectId: caObjectId
125
+ };
126
+ _this.cw.runRequest('Pll/CaseDataGroup/DeleteByCaObjectId', data).then(function (r) {
127
+ resolve(r.Value);
128
+ }).catch(function (e) {
129
+ reject(e);
130
+ });
131
+ });
132
+ };
133
+ /**
134
+ * Search for Case Data Groups. Include one or more of the search fields. A logical 'and' operation is applied to muliple search fields
135
+ *
136
+ * @category Data Groups
137
+ * @param {Object} filters - The parameters to search by. (CaDataGroupId, CaseDataGroupId, GroupCode, GroupDesc, GroupSum, SumFlag)
138
+ * @return {Object} Returns Promise that represents a number that is the CaObjectId (?)
139
+ */
140
+ CaseData.prototype.searchForGroups = function (filters) {
141
+ var _this = this;
142
+ return new Promise(function (resolve, reject) {
143
+ if (_.intersectionBy(_.keysIn(filters), ['CaDataGroupId', 'CaseDataGroupId', 'GroupCode', 'GroupDesc', 'GroupSum', 'SumFlag']).length == 0) {
144
+ reject(new error_1.CWError(2, 'At least one of the attributes (CaDataGroupId, CaseDataGroupId, GroupCode, GroupDesc, GroupSum, SumFlag) must be defined.'));
145
+ }
146
+ var data = filters;
147
+ _this.cw.runRequest('Pll/CaseDataGroup/Search', data).then(function (r) {
148
+ resolve(r.Value);
149
+ }).catch(function (e) {
150
+ reject(e);
151
+ });
152
+ });
153
+ };
154
+ /**
155
+ * Get Case Data Groups by Case ObjectId
156
+ *
157
+ * @category Data Groups
158
+ * @param {string} entityType - The entity type to check
159
+ * @param {string} entityUid - The specific entityUID to check
160
+ * @param {Object} options - The other options for checkGIS. Either CaObjectId or CaseDataGroupId is required.
161
+ * @return {Object} Returns Promise that represents a collection of the default CaDataGroupItemBases.
162
+ */
163
+ CaseData.prototype.checkGIS = function (entityType, entityUid, options) {
164
+ var _this = this;
165
+ return new Promise(function (resolve, reject) {
166
+ var data = {
167
+ EntityType: entityType,
168
+ EntityUid: entityUid
169
+ };
170
+ if (_.has(options, 'CaObjectId')) {
171
+ _.set(data, 'CaObjectId', _.get(options, 'CaObjectId'));
172
+ }
173
+ else if (_.has(options, 'CaseDataGroupId')) {
174
+ _.set(data, 'CaseDataGroupId', _.get(options, 'CaseDataGroupId'));
175
+ }
176
+ else {
177
+ reject(new error_1.CWError(1, 'Either CaObjectId or CaseDataGroupId is required.', { 'provided': options }));
178
+ }
179
+ if (_.has(options, 'CaseDataDetailId')) {
180
+ _.set(data, 'CaseDataDetailId', _.get(options, 'CaseDataDetailId'));
181
+ }
182
+ _this.cw.runRequest('Pll/CaseDataGroup/CheckGISChanges', data).then(function (r) {
183
+ resolve(r.Value);
184
+ }).catch(function (e) {
185
+ reject(e);
186
+ });
187
+ });
188
+ };
189
+ /**
190
+ * Update data groups on a case based on asset value mappings.
191
+ *
192
+ * @category Data Groups
193
+ * @param {number} caObjectId - The case to update
194
+ * @param {string} entityType - The entity type to check
195
+ * @param {string} entityUid - The specific entityUID to check
196
+ * @param {number} [caDataGroupId] - The specific data group ID to limit updates to
197
+ * @return {Object} Returns Promise that represents a collection of the default CaDataGroupItemBases.
198
+ */
199
+ CaseData.prototype.updateGroupsFromAsset = function (caObjectId, entityType, entityUid, caDataGroupId) {
200
+ var _this = this;
201
+ return new Promise(function (resolve, reject) {
202
+ var data = {
203
+ CaObjectId: caObjectId,
204
+ EntityType: entityType,
205
+ EntityUid: entityUid
206
+ };
207
+ if (typeof (caDataGroupId) != 'undefined') {
208
+ _.set(data, 'CaDataGroupId', caDataGroupId);
209
+ }
210
+ _this.cw.runRequest('Pll/CaseDataGroup/UpdateFromAsset', data).then(function (r) {
211
+ resolve(r.Value);
212
+ }).catch(function (e) {
213
+ reject(e);
214
+ });
215
+ });
216
+ };
217
+ /**
218
+ * Attach Case Data Detail
219
+ *
220
+ * @category Data Details
221
+ * @param {number} caDataGroupId - The Case Data Group ID to attach the data detail to.
222
+ * @param {number} caseDataDetailId - caseDataDetailId to attach.
223
+ * @param {Object} [options] - Options
224
+ * @return {Object} Returns Promise that represents an object describing CaDataGroupItemBase.
225
+ */
226
+ CaseData.prototype.addDetail = function (caDataGroupId, caseDataDetailId, options) {
227
+ var _this = this;
228
+ return new Promise(function (resolve, reject) {
229
+ var data = {
230
+ CaDataGroupId: caDataGroupId,
231
+ CaseDataDetailId: caseDataDetailId
232
+ };
233
+ if (typeof (options) != 'undefined') {
234
+ data = _.merge(data, options);
235
+ }
236
+ _this.cw.runRequest('Pll/CaseDataDetail/Add', data).then(function (r) {
237
+ resolve(r.Value);
238
+ }).catch(function (e) {
239
+ reject(e);
240
+ });
241
+ });
242
+ };
243
+ /**
244
+ * Update Case Data Detail
245
+ *
246
+ * @category Data Details
247
+ * @param {number} caDataDetailId - The Case Data Group ID to attach the data detail to.
248
+ * @param {Object} [options] - Options
249
+ * @return {Object} Returns Promise that represents an object describing CaDataGroupItemBase.
250
+ */
251
+ CaseData.prototype.updateDetail = function (caDataDetailId, options) {
252
+ var _this = this;
253
+ return new Promise(function (resolve, reject) {
254
+ var data = {
255
+ CaDataDetailId: caDataDetailId
256
+ };
257
+ if (typeof (options) != 'undefined') {
258
+ data = _.merge(data, options);
259
+ }
260
+ _this.cw.runRequest('Pll/CaseDataDetail/Update', data).then(function (r) {
261
+ resolve(r.Value);
262
+ }).catch(function (e) {
263
+ reject(e);
264
+ });
265
+ });
266
+ };
267
+ /**
268
+ * Lock Case Data Detail
269
+ *
270
+ * @category Data Details
271
+ * @param {number} caDataDetailId - The Case Data Group ID to lock
272
+ * @return {Object} Returns Promise which represents an object describing the CaDataDetailItem.
273
+ */
274
+ CaseData.prototype.lockDetail = function (caDataDetailId) {
275
+ var _this = this;
276
+ return new Promise(function (resolve, reject) {
277
+ var data = {
278
+ CaDataDetailId: caDataDetailId,
279
+ Lock: true
280
+ };
281
+ _this.cw.runRequest('Pll/CaseDataDetail/UpdateLock', data).then(function (r) {
282
+ resolve(r.Value);
283
+ }).catch(function (e) {
284
+ reject(e);
285
+ });
286
+ });
287
+ };
288
+ /**
289
+ * Unlock Case Data Detail
290
+ *
291
+ * @category Data Details
292
+ * @param {number} caDataDetailId - The Case Data Group ID to unlock
293
+ * @return {Object} Returns Promise which represents an object describing the CaDataDetailItem.
294
+ */
295
+ CaseData.prototype.unlockDetail = function (caDataDetailId) {
296
+ var _this = this;
297
+ return new Promise(function (resolve, reject) {
298
+ var data = {
299
+ CaDataDetailId: caDataDetailId,
300
+ Lock: false
301
+ };
302
+ _this.cw.runRequest('Pll/CaseDataDetail/UpdateLock', data).then(function (r) {
303
+ resolve(r.Value);
304
+ }).catch(function (e) {
305
+ reject(e);
306
+ });
307
+ });
308
+ };
309
+ /**
310
+ * Search for Case Data Details. Include one or more of the search fields. A logical 'and' operation is applied to muliple search fields
311
+ *
312
+ * @category Data Details
313
+ * @param {Object} filters - The parameters to search by. (CaDataGroupId, CaseDataGroupId, GroupCode, GroupDesc, GroupSum, SumFlag)
314
+ * @return {Object} Returns Promise that represents a number that is the CaObjectId (?)
315
+ */
316
+ CaseData.prototype.searchForDetails = function (filters) {
317
+ var _this = this;
318
+ return new Promise(function (resolve, reject) {
319
+ if (_.intersectionBy(_.keysIn(filters), ['CaDataDetailId', 'CaDataGroupId', 'CalcRateFlag', 'CaseDataDetailId', 'CommentFlag', 'DateFlag', 'DetailCode', 'DetailDesc', 'ListValuesFlag', 'NumberFlag', 'TextFlag', 'ValueFlag', 'YesNoFlag']).length == 0) {
320
+ reject(new error_1.CWError(2, 'At least one of the attributes (CaDataDetailId, CaDataGroupId, CalcRateFlag, CaseDataDetailId, CommentFlag, DateFlag, DetailCode, DetailDesc, ListValuesFlag, NumberFlag, TextFlag, ValueFlag, YesNoFlag) must be defined.'));
321
+ }
322
+ var data = filters;
323
+ _this.cw.runRequest('Pll/CaseDataDetail/SearchObject', data).then(function (r) {
324
+ resolve(r.Value);
325
+ }).catch(function (e) {
326
+ reject(e);
327
+ });
328
+ });
329
+ };
330
+ /**
331
+ * Adds a list of possible values to the data detail entry specified by the CaDataDetailId.
332
+ *
333
+ * @category Data List Values
334
+ * @param {number} caDataDetailId - The Case Object to attach the data group to.
335
+ * @param {string} listValue - The Group Code.
336
+ * @return {Object} Returns Promise that represents an object describing CaDataListValuesItemBase.
337
+ */
338
+ CaseData.prototype.addListValue = function (caDataDetailId, listValue) {
339
+ var _this = this;
340
+ return new Promise(function (resolve, reject) {
341
+ var data = {
342
+ CaDataDetailId: caDataDetailId,
343
+ ListValue: listValue
344
+ };
345
+ _this.cw.runRequest('Pll/CaseDataListValues/Add', data).then(function (r) {
346
+ resolve(r.Value);
347
+ }).catch(function (e) {
348
+ reject(e);
349
+ });
350
+ });
351
+ };
352
+ /**
353
+ * Delete by Id (Ca Data List Id)
354
+ *
355
+ * @category Data List Values
356
+ * @param {number} CaDataListId - The Case Data List ID
357
+ * @return {Object} Returns Promise that represents an object describing CaDataListValuesItemBase.
358
+ */
359
+ CaseData.prototype.deleteListValue = function (caDataDetailId) {
360
+ var _this = this;
361
+ return new Promise(function (resolve, reject) {
362
+ var data = {
363
+ CaDataDetailId: caDataDetailId
364
+ };
365
+ _this.cw.runRequest('Pll/CaseDataListValues/Delete', data).then(function (r) {
366
+ resolve(r.Value);
367
+ }).catch(function (e) {
368
+ reject(e);
369
+ });
370
+ });
371
+ };
372
+ /**
373
+ * Search for List Value IDs. Include one or more of the search fields. A logical 'and' operation is applied to muliple search fields
374
+ *
375
+ * @category Data List Values
376
+ * @param {Object} filters - The parameters to search by. (CaDataDetailId, CaDataListId, ListValue)
377
+ * @return {Object} Returns Promise that represents an Array of resulting CaDataListIds
378
+ */
379
+ CaseData.prototype.searchForListValueIds = function (filters) {
380
+ var _this = this;
381
+ return new Promise(function (resolve, reject) {
382
+ if (_.intersectionBy(_.keysIn(filters), ['CaDataDetailId', 'CaDataListId', 'ListValue']).length == 0) {
383
+ reject(new error_1.CWError(3, 'At least one of the attributes (CaDataDetailId, CaDataListId, ListValue) must be defined.'));
384
+ }
385
+ var data = filters;
386
+ _this.cw.runRequest('Pll/CaseDataGroup/Search', data).then(function (r) {
387
+ resolve(r.Value);
388
+ }).catch(function (e) {
389
+ reject(e);
390
+ });
391
+ });
392
+ };
393
+ /**
394
+ * Search for List Value Objects. Include one or more of the search fields. A logical 'and' operation is applied to muliple search fields
395
+ *
396
+ * @category Data List Values
397
+ * @param {Object} filters - The parameters to search by. (CaDataDetailId, CaDataListId, ListValue, CaDataGroupId)
398
+ * @return {Object} Returns Promise that represents a collection of resulting CaDataListValuesItemBase objects
399
+ */
400
+ CaseData.prototype.searchForListValueObjects = function (filters) {
401
+ var _this = this;
402
+ return new Promise(function (resolve, reject) {
403
+ if (_.intersectionBy(_.keysIn(filters), ['CaDataDetailId', 'CaDataListId', 'ListValue', 'CaDataGroupId']).length == 0) {
404
+ reject(new error_1.CWError(4, 'At least one of the attributes (CaDataDetailId, CaDataListId, ListValue, CaDataGroupId) must be defined.'));
405
+ }
406
+ var data = filters;
407
+ _this.cw.runRequest('Pll/CaseDataGroup/SearchObject', data).then(function (r) {
408
+ resolve(r.Value);
409
+ }).catch(function (e) {
410
+ reject(e);
411
+ });
412
+ });
413
+ };
414
+ return CaseData;
415
+ }());
416
+ exports.CaseData = CaseData;