cityworks 1.0.5 → 2.0.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.
package/dist/general.d.ts DELETED
@@ -1,78 +0,0 @@
1
- /**
2
- * A plugin that contains "general" methods for a Cityworks install
3
- */
4
- export declare class General {
5
- /**
6
- * @hidden
7
- */
8
- cw: any;
9
- /**
10
- * @hidden
11
- */
12
- constructor(cw: any);
13
- /**
14
- * Get notifications for currently authenticated user
15
- *
16
- * @return {Object} Returns Promise object that represents a collection of available notifications
17
- */
18
- notifications(): Promise<unknown>;
19
- /**
20
- * Find out if the current user is watching a particular activity (case, task, null [as a string])
21
- *
22
- * @param {string} activityType - which activity type the following ID will be for.
23
- * @param {number} activityId - activity Case or CaseTask (task instance) ID to check
24
- * @return {Object} Returns Promise object that represents a boolean indicating the currently authenticated user is watching the provided activity
25
- */
26
- amIWatching(activityType: any, activityId: number): Promise<unknown>;
27
- /**
28
- * Get CwMetatData by Type and CwSid
29
- *
30
- * @param {Array<number>} Ids
31
- * @param {string} TableName - INSPECTION, REQUEST, WORKORDER require View permission on the activities
32
- * @return {Object} Returns Promise object that represents a
33
- */
34
- getActivityMetadataByIds(ids: Array<number>, table: string): Promise<unknown>;
35
- /**
36
- * Get recent history for authenticated user
37
- *
38
- * @return {Object} Returns Promise object that represents a collection of RecentActivity objects
39
- */
40
- getHistory(): Promise<unknown>;
41
- /**
42
- * Get cost summary for WorkOrder entities
43
- *
44
- * @param {Array<number>} ObjectIds
45
- * @return {Object} Returns Promise object that represents a
46
- */
47
- getWOEntityCostSummary(object_ids: Array<number>): Promise<unknown>;
48
- /**
49
- * Get cost summary for WorkOrder entities selected through a search definition
50
- *
51
- * @param {number} SearchId - Search Definition Id
52
- * @return {Object} Returns Promise object that represents a
53
- */
54
- searchWOEntityCostSummary(search_id: number): Promise<unknown>;
55
- /**
56
- * Get Holidays
57
- *
58
- * @param {Date} startDate - Date to search for Holidays, including this date.
59
- * @param {Date} [endDate] - If not specified, Holidays _on_ startDate are returned. If specified, Holidays on startDate up to, but not including endDate are returned.
60
- * @return {Object} Returns Promise object that represents a list of the holiday(s) found
61
- */
62
- getHolidays(startDate: Date, endDate?: Date): Promise<unknown>;
63
- /**
64
- * Add Holidays
65
- *
66
- * @param {Date} holiday - The holiday's date
67
- * @param {string} description - The holiday's name/description
68
- * @return {Object} Returns Promise object that represents a
69
- */
70
- addHolidays(holiday: Date, description: string): Promise<unknown>;
71
- /**
72
- * Delete Holidays
73
- *
74
- * @param {Array<Date>} holidays - List of datetimes which should have holidays deleted
75
- * @return {Object} Returns Promise object that represents a
76
- */
77
- deleteHolidays(holidays: Array<Date>): Promise<unknown>;
78
- }
package/dist/gis.d.ts DELETED
@@ -1,92 +0,0 @@
1
- export declare class Gis {
2
- /**
3
- * @hidden
4
- */
5
- cw: any;
6
- /**
7
- * @hidden
8
- */
9
- constructor(cw: any);
10
- /**
11
- * Get gis service configuration for user, group, domain, or service id
12
- *
13
- * @param {string} [whichType] - domain, group, mapservice, or user
14
- * @param {number} [whichId] - domain, group, mapservice, or user Id
15
- * @param {number} [getGisData] - If true, check for feature server JSON data, default is true
16
- * @param {Array<string>} [context] Filter returned list by specific context, i.e. Office, Field, Mobile, Public, etc. Default is all.
17
- * @return {Object} Returns Promise object that represents an Object with the desired GIS service definitions
18
- */
19
- getConfig(whichType: any, whichId: any, getGisData?: boolean, context?: Array<string>): Promise<unknown>;
20
- /**
21
- * Get domain gis services
22
- *
23
- * @param {number} domainId - The mobile map cache Id to download
24
- * @return {Object} Returns Promise object that represents an Object with the domain's default GIS services
25
- */
26
- domain(domainId: any, getGisData?: boolean): Promise<unknown>;
27
- /**
28
- * Download mobile map cache
29
- *
30
- * @param {number} cacheId - The mobile map cache Id to download
31
- * @return {Object} Returns Promise object that represents a streaming download (?)
32
- */
33
- downloadMobile(cacheId: any, getGisData?: boolean): Promise<unknown>;
34
- /**
35
- * Get initial extent for user
36
- *
37
- * @return {Object} Returns Promise object that represents ... (?)
38
- */
39
- initialExtent(): Promise<unknown>;
40
- /**
41
- * Get service request gis services
42
- *
43
- * @param {number} requestId - The WorkOrder to check against.
44
- * @param {boolean} getGisData - If true, check for feature server JSON data, default is true.
45
- * @return {Object} Returns Promise object that represents an Object with the specified request's entit(y|ies)
46
- */
47
- request(requestId: any, getGisData?: boolean): Promise<unknown>;
48
- /**
49
- * Get inspection gis services
50
- *
51
- * @param {number} inspectionId - The WorkOrder to check against.
52
- * @param {boolean} getGisData - If true, check for feature server JSON data, default is true.
53
- * @return {Object} Returns Promise object that represents an Object with the specified inspection's entity
54
- */
55
- inspection(inspectionId: any, getGisData?: boolean): Promise<unknown>;
56
- /**
57
- * Get workorder gis services
58
- *
59
- * @param {number} workOrderSid - The WorkOrder to check against.
60
- * @param {boolean} getGisData - If true, check for feature server JSON data, default is true.
61
- * @return {Object} Returns Promise object that represents an Object with the specified WorkOrder's entit(y|ies)
62
- */
63
- workOrder(workOrderSid: any, getGisData?: boolean): Promise<unknown>;
64
- /**
65
- * Get service request gis services
66
- *
67
- * @param {Array<string>} [context] Filter returned list by specific context, i.e. Office, Field, Mobile, Public, etc. Default is all.
68
- * @param {boolean} [allDomains] services assigned to any domain the user belongs to, default is true
69
- * @param {boolean} [allGroups] services assigned to any groups the user belongs to regardless of domain, default is true
70
- * @param {boolean} [getGisData] If true, check for feature server JSON data, default is true
71
- * @return {Object} Returns Promise object that represents an Object with the user's GIS services
72
- */
73
- user(context?: Array<string>, allDomains?: boolean, allGroups?: boolean, getGisData?: boolean): Promise<unknown>;
74
- /**
75
- * Get Geocode server info by ServerId
76
- *
77
- * @param {number} ServiceId
78
- * @return {Object} Returns Promise object that represents an object describing the provided Geocoder service configuration
79
- */
80
- /**
81
- * Get currently selected entities from the Cityworks install's session for your user
82
- * @return {Object} Returns Promise object that represents an Object with the currently-selected entities
83
- */
84
- selectedEntities(): Promise<unknown>;
85
- /**
86
- * Get attributes available for provided entity
87
- *
88
- * @param {string} entityType - The entity type to describe
89
- * @return {Object} Returns Promise object that represents a collection of attribute description objects
90
- */
91
- getEntityAttributes(entityType: string): Promise<unknown>;
92
- }
package/dist/index.d.ts DELETED
@@ -1,224 +0,0 @@
1
- import { General } from './general';
2
- import { ActivityLinks } from './activity_link';
3
- import { Gis } from './gis';
4
- import { MessageQueue } from './message_queue';
5
- import { Search } from './search';
6
- import { Query } from './query';
7
- import { Request } from './request';
8
- import { Inspection } from './inspection';
9
- import { WorkOrder } from './workorder';
10
- import { Briefcase } from './briefcase';
11
- interface Citywork {
12
- }
13
- /**
14
- * Core class Cityworks with most of the authentication and install capabilities functions
15
- */
16
- declare class Cityworks implements Citywork {
17
- /**
18
- * The domain of the cityworks install. Defaults to Cityworks Online
19
- */
20
- private base_url;
21
- /**
22
- * Stores the currently in use authentication token
23
- */
24
- private Token?;
25
- /**
26
- * Stores the login username
27
- */
28
- private login?;
29
- /**
30
- * Holds the login password
31
- */
32
- private password?;
33
- /**
34
- * Holds the GIS Token for GIS-based Authentication (Portal)
35
- */
36
- private gisToken?;
37
- /**
38
- * Holds the GIS Token URL for GIS-based Authentication (Portal)
39
- */
40
- private gisTokenUrl?;
41
- /**
42
- * Stores settings including path (defaults to "cityworks"), secure (defaults to true), expires (defaults to null - does not expire), default_domain
43
- */
44
- private settings;
45
- error?: any;
46
- private extensions;
47
- private features;
48
- private potential_loads;
49
- /**
50
- * Contructor for a new cityworks instance's object, allows one to optionally configure the domain and other settings right from the get-go
51
- * @param {string} [base_url] - The base url of your Cityworks instance
52
- * @param {object} [settings] - The settings for your Cityworks site. Full list: {path: (defaults to "cityworks"), secure: defaults to true, expires: defaults to NULL, does not expire, default_domain: defaults to NULL, uses default user domain, version: defaults to 23, for 15.x set to 15}
53
- * @param {array} [load] - allows user to choose which modules to load and make available. Full availability array: ['general', 'activity_link', 'message_queue', 'gis', 'workorder', 'inspection', 'request', 'case']
54
- */
55
- constructor(base_url?: string, settings?: Object, load?: Array<string>);
56
- /**
57
- * Configure a new cityworks instance's domain and other settings
58
- *
59
- * @param {string} [base_url] - The first color, in hexadecimal format.
60
- * @param {object} [settings] - The second color, in hexadecimal format.
61
- * @param {array} [load] - allows user to choose which modules to load and make available. Full availability array: ['general', 'activity_link', 'message_queue', 'gis', 'search', 'workorder', 'inspection', 'request', 'case']
62
- * @return {boolean} Returns true if successful, otherwise, throws error
63
- */
64
- configure(base_url?: string, settings?: Object, load?: Array<string>): void;
65
- /**
66
- * Send a request to the Cityworks API
67
- *
68
- * If one ever needs to access or call an unimplemented API endpoint of a Cityworks install, one can call this method directly with the path and data payload:
69
- *
70
- * `cityworks.runRequest(service_path, post_data)`
71
- *
72
- * @param {string} service_path - The path to the particular endpoint
73
- * @param {any} post_data - The data object to be sent to the Cityworks API
74
- * @param {string} post_file - The path of the file to send to the Cityworks API
75
- * @return {Object} Returns Promise object that represents the json object returned from the Cityworks API
76
- */
77
- runRequest(service_path: string, post_data?: any, post_file?: string): Promise<unknown>;
78
- /**
79
- * Authenticate with the Cityworks API and store an access token for use. Stores the token on cityworks.Token.
80
- * @param {string} login - User's login name
81
- * @param {password} password - User's password
82
- * @return {Object} Returns Promise object that represents a boolean which tells you the login succeeded (true) or failed (false).
83
- */
84
- authenticate(login: string, password: string): Promise<unknown>;
85
- /**
86
- * Authenticate a username with a GIS Token
87
- * @param {login} - Gis user name, should match a Cityworks employee login name
88
- * @param {string} gisToken - Gis Oauth2 access token
89
- * @param {string} gisTokenUrl - Base url to GIS server (not the '/generateToken' endpoint)
90
- * @param {number} [expires] - Authenticate to Cityworks for a specified number of milliseconds, defaults to 2 weeks
91
- */
92
- authenticateWithGISToken(login: string, gisToken: string, gisTokenUrl: string, expires?: number): Promise<unknown>;
93
- /**
94
- * Validate provided token
95
- * @param {string} token - User's login name
96
- * @param {boolean} [set] - Set a valid token as the cityworks instance's active token
97
- * @return {Object} Returns Promise object that represents a boolean which apprises one of the token's validity and that is was set (true) or throws an error if was not valid (and not set).
98
- */
99
- validateToken(token: string, set?: boolean): Promise<unknown>;
100
- /**
101
- * Set a token you've retrieved from your storage system as the active token for the cityworks instance. Note that this doesn't check the token for validity.
102
- * @param {token} token - The token string to set as the active token.
103
- * @return {boolean} Returns a boolean which apprises one that the token was set (true) or not set (false).
104
- */
105
- setToken(token: any): boolean;
106
- /**
107
- * Get currently set, valid token
108
- * @param {token} token - The token string to set as the active token.
109
- * @return {string} Returns a string which is the currently-set token or the boolean false value if no (valid) token set
110
- */
111
- getToken(): string | false;
112
- /**
113
- * Revoke all current user's tokens or only tokens created before a particular date and time.
114
- * @param {number} [revokeBefore] - Datetime as an Epoch integer (number), if you wish to revoke only tokens created before a particular datetime
115
- * @return {Object} Returns Promise object that represents a boolean which apprises one of the revocation outcome's success (true) or failure (false)
116
- */
117
- revokeToken(revokeBefore?: number): Promise<unknown>;
118
- /**
119
- * Get the localization settings for current Cityworks install
120
- * @return {Object} Returns Promise object that represents an Object which contains all the localization settings for the current Cityworks install
121
- */
122
- getLocalizationSettings(): Promise<unknown>;
123
- /**
124
- * Get the system timezone options for current Cityworks install
125
- * @return {Object} Returns Promise object that represents an Object which contains all the timezone settings for the currentCityworks install
126
- */
127
- getTimezoneOptions(): Promise<unknown>;
128
- /**
129
- * Get the current install's location information
130
- * @return {Object} Returns Promise object that represents an Object which contains the location information
131
- */
132
- getCurrentLocation(): Promise<unknown>;
133
- /**
134
- * Check if a particular license is available to the currently-authenticated user
135
- * @param {string} area - Area of access
136
- * @param {string} service - Service to access
137
- * @return {boolean} Returns Promise object that represents a boolean which informs access is granted (true) or denied (false)
138
- */
139
- licensedApiCheck(area: string, service: string): Promise<unknown>;
140
- /**
141
- * Check if a current Cityworks install is licensed to use a particular extension
142
- *
143
- * Possible extensions currently include: "UnknownExtension", "CwAnalytics", "WebHooks", "PLLPublicApp", "ActivityUpdate", "SingleSignOn"
144
- *
145
- * @param {string} extension - Extension name
146
- * @return {boolean} Returns Promise object that represents a boolean which informs extension is licensed (true) or not (false)
147
- */
148
- licensedExtensionCheck(extension: string): Promise<unknown>;
149
- /**
150
- * Check a whole list to see if current Cityworks install is licensed to use extensions
151
- *
152
- * Possible extensions currently include: "UnknownExtension", "CwAnalytics", "WebHooks", "PLLPublicApp", "ActivityUpdate", "SingleSignOn"
153
- *
154
- * @param {Array<string>} extension - Extension names
155
- * @return {Object} Returns Promise object that represents a boolean which informs extension is licensed (true) or not (false)
156
- */
157
- licensedExtensionsCheck(extensions: Array<string>): Promise<unknown>;
158
- /**
159
- * Check if current user is licensed to use a feature:
160
- *
161
- * "UnknownFeature", "ViewInspections", "EditInspections", "ViewServiceRequest", "EditServiceRequest", "ViewWorkOrder", "EditWorkOrder", "EquipmentCheckOut", "OfficeField", "Respond", "Eurl", "PaverInterface", "Contracts", "Storeroom", "PLL", "Cw4XL", "TableEditor", "CCTVInterface", "MobileAndroid", "MobileiOS", "PerformanceBudgeting", "Insights", "RespondCase", "RespondInspection", "RespondServiceRequest", "RespondTaskManager", "RespondWorkOrder", "Workload", "OpX", "TrimbleUnityMobile", "TrimbleVegetationManager"
162
- *
163
- * @param {string} [feature] - Feature to check to see if ciurrently authenticated user can utilize
164
- * @return {Object} Returns Promise object that represents a boolean which communicates license state as licensed (true) or not (false)
165
- */
166
- licensedFeatureCheck(feature: string): Promise<unknown>;
167
- /**
168
- * Check if current user is licensed to use features:
169
- *
170
- * "UnknownFeature", "ViewInspections", "EditInspections", "ViewServiceRequest", "EditServiceRequest", "ViewWorkOrder", "EditWorkOrder", "EquipmentCheckOut", "OfficeField", "Respond", "Eurl", "PaverInterface", "Contracts", "Storeroom", "PLL", "Cw4XL", "TableEditor", "CCTVInterface", "MobileAndroid", "MobileiOS", "PerformanceBudgeting", "Insights", "RespondCase", "RespondInspection", "RespondServiceRequest", "RespondTaskManager", "RespondWorkOrder", "Workload", "OpX", "TrimbleUnityMobile", "TrimbleVegetationManager"
171
- *
172
- * @param {Array<string>} [feature] - Features to check to see if currently authenticated user can utilize
173
- * @return {Object} Returns Promise object that represents a boolean which communicates license state as licensed (true) or not (false)
174
- */
175
- licensedFeaturesCheck(features: Array<string>): Promise<unknown>;
176
- /**
177
- * Check if current user is licensed to use services. List req ServicesList of 'Area/Service', i.e.:
178
- *
179
- * ['AMS/Inspection','AMS/WorkOrder','PLL/Case']
180
- *
181
- * @param {Array<string>} [services] - Services to check to see if currently authenticated user can utilize
182
- * @return {Object} Returns Promise object that represents a boolean which communicates license state as licensed (true) or not (false)
183
- */
184
- licensedServicesCheck(services: Array<string>): Promise<unknown>;
185
- /**
186
- * Get a list of CityworksOnline sites for this user
187
- *
188
- * @param {string} [login] - Login Name to use when checking. Defaults to previously-stored login name.
189
- * @param {string} [password] - Password to use when checking. Defaults to previously-stored password.
190
- * @return {Object} Returns Promise object that represents an array of cityworks online sites available to this user.
191
- */
192
- cityworksOnlineSites(login?: string, password?: string): Promise<unknown>;
193
- /**
194
- * Get a list of Domains (not tld, but organizations) in the currently-connected Cityworks install
195
- *
196
- * @return {Object} Returns Promise object that represents a collection of the configured domains.
197
- */
198
- domains(): Promise<unknown>;
199
- /**
200
- * Get a list of Domains (not tld, but organizations) in the currently-connected Cityworks install
201
- *
202
- * @param {string} [login] - Optional login name to get user information for. Defaults to currently-set user name used for login.
203
- * @return {Object} Returns Promise object that represents an Object with the user information
204
- */
205
- user(login?: string): Promise<unknown>;
206
- /**
207
- * Get the software version number of the currently-connected Cityworks install
208
- *
209
- * @return {Object} Returns Promise object that represents a string of the version number
210
- */
211
- version(): Promise<unknown>;
212
- }
213
- declare const cw: Cityworks;
214
- declare const general: General;
215
- declare const activity_link: ActivityLinks;
216
- declare const message_queue: MessageQueue;
217
- declare const search: Search;
218
- declare const query: Query;
219
- declare const gis: Gis;
220
- declare const request: Request;
221
- declare const inspection: Inspection;
222
- declare const workorder: WorkOrder;
223
- declare const briefcase: Briefcase;
224
- export { cw as Cityworks, general, activity_link, message_queue, search, query, gis, request, inspection, workorder, briefcase };