@esri/solution-common 5.2.3 → 5.2.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.
Files changed (192) hide show
  1. package/dist/cjs/completeItem.d.ts +29 -0
  2. package/dist/cjs/completeItem.js +92 -0
  3. package/dist/cjs/completeItem.js.map +1 -0
  4. package/dist/cjs/create-hub-request-options.d.ts +29 -0
  5. package/dist/cjs/create-hub-request-options.js +64 -0
  6. package/dist/cjs/create-hub-request-options.js.map +1 -0
  7. package/dist/cjs/deleteHelpers/deleteEmptyGroups.d.ts +24 -0
  8. package/dist/cjs/deleteHelpers/deleteEmptyGroups.js +42 -0
  9. package/dist/cjs/deleteHelpers/deleteEmptyGroups.js.map +1 -0
  10. package/dist/cjs/deleteHelpers/deleteGroupIfEmpty.d.ts +27 -0
  11. package/dist/cjs/deleteHelpers/deleteGroupIfEmpty.js +97 -0
  12. package/dist/cjs/deleteHelpers/deleteGroupIfEmpty.js.map +1 -0
  13. package/dist/cjs/deleteHelpers/deleteSolutionContents.d.ts +38 -0
  14. package/dist/cjs/deleteHelpers/deleteSolutionContents.js +130 -0
  15. package/dist/cjs/deleteHelpers/deleteSolutionContents.js.map +1 -0
  16. package/dist/cjs/deleteHelpers/deleteSolutionFolder.d.ts +29 -0
  17. package/dist/cjs/deleteHelpers/deleteSolutionFolder.js +79 -0
  18. package/dist/cjs/deleteHelpers/deleteSolutionFolder.js.map +1 -0
  19. package/dist/cjs/deleteHelpers/deleteSolutionItem.d.ts +30 -0
  20. package/dist/cjs/deleteHelpers/deleteSolutionItem.js +54 -0
  21. package/dist/cjs/deleteHelpers/deleteSolutionItem.js.map +1 -0
  22. package/dist/cjs/deleteHelpers/index.d.ts +22 -0
  23. package/dist/cjs/deleteHelpers/index.js +26 -0
  24. package/dist/cjs/deleteHelpers/index.js.map +1 -0
  25. package/dist/cjs/deleteHelpers/reconstructBuildOrderIds.d.ts +27 -0
  26. package/dist/cjs/deleteHelpers/reconstructBuildOrderIds.js +34 -0
  27. package/dist/cjs/deleteHelpers/reconstructBuildOrderIds.js.map +1 -0
  28. package/dist/cjs/deleteHelpers/removeItems.d.ts +34 -0
  29. package/dist/cjs/deleteHelpers/removeItems.js +112 -0
  30. package/dist/cjs/deleteHelpers/removeItems.js.map +1 -0
  31. package/dist/cjs/deleteHelpers/reportProgress.d.ts +27 -0
  32. package/dist/cjs/deleteHelpers/reportProgress.js +46 -0
  33. package/dist/cjs/deleteHelpers/reportProgress.js.map +1 -0
  34. package/dist/cjs/deleteSolution.d.ts +55 -0
  35. package/dist/cjs/deleteSolution.js +107 -0
  36. package/dist/cjs/deleteSolution.js.map +1 -0
  37. package/dist/cjs/dependencies.d.ts +26 -0
  38. package/dist/cjs/dependencies.js +171 -0
  39. package/dist/cjs/dependencies.js.map +1 -0
  40. package/dist/cjs/featureServiceHelpers.d.ts +799 -0
  41. package/dist/cjs/featureServiceHelpers.js +2438 -0
  42. package/dist/cjs/featureServiceHelpers.js.map +1 -0
  43. package/dist/cjs/formHelpers.d.ts +41 -0
  44. package/dist/cjs/formHelpers.js +78 -0
  45. package/dist/cjs/formHelpers.js.map +1 -0
  46. package/dist/cjs/generalHelpers.d.ts +433 -0
  47. package/dist/cjs/generalHelpers.js +925 -0
  48. package/dist/cjs/generalHelpers.js.map +1 -0
  49. package/dist/cjs/get-subscription-info.d.ts +27 -0
  50. package/dist/cjs/get-subscription-info.js +39 -0
  51. package/dist/cjs/get-subscription-info.js.map +1 -0
  52. package/dist/cjs/getDeletableSolutionInfo.d.ts +29 -0
  53. package/dist/cjs/getDeletableSolutionInfo.js +53 -0
  54. package/dist/cjs/getDeletableSolutionInfo.js.map +1 -0
  55. package/dist/cjs/getItemTypeAbbrev.d.ts +19 -0
  56. package/dist/cjs/getItemTypeAbbrev.js +186 -0
  57. package/dist/cjs/getItemTypeAbbrev.js.map +1 -0
  58. package/dist/cjs/getSolutionSummary.d.ts +27 -0
  59. package/dist/cjs/getSolutionSummary.js +101 -0
  60. package/dist/cjs/getSolutionSummary.js.map +1 -0
  61. package/dist/cjs/index.d.ts +46 -0
  62. package/dist/cjs/index.js +50 -0
  63. package/dist/cjs/index.js.map +1 -0
  64. package/dist/cjs/interfaces.d.ts +1362 -0
  65. package/dist/cjs/interfaces.js +77 -0
  66. package/dist/cjs/interfaces.js.map +1 -0
  67. package/dist/cjs/libConnectors.d.ts +73 -0
  68. package/dist/cjs/libConnectors.js +115 -0
  69. package/dist/cjs/libConnectors.js.map +1 -0
  70. package/dist/cjs/migrations/apply-schema.d.ts +24 -0
  71. package/dist/cjs/migrations/apply-schema.js +36 -0
  72. package/dist/cjs/migrations/apply-schema.js.map +1 -0
  73. package/dist/cjs/migrations/is-legacy-solution.d.ts +24 -0
  74. package/dist/cjs/migrations/is-legacy-solution.js +40 -0
  75. package/dist/cjs/migrations/is-legacy-solution.js.map +1 -0
  76. package/dist/cjs/migrations/upgrade-three-dot-one.d.ts +27 -0
  77. package/dist/cjs/migrations/upgrade-three-dot-one.js +49 -0
  78. package/dist/cjs/migrations/upgrade-three-dot-one.js.map +1 -0
  79. package/dist/cjs/migrations/upgrade-three-dot-zero.d.ts +27 -0
  80. package/dist/cjs/migrations/upgrade-three-dot-zero.js +43 -0
  81. package/dist/cjs/migrations/upgrade-three-dot-zero.js.map +1 -0
  82. package/dist/cjs/migrations/upgrade-two-dot-five.d.ts +24 -0
  83. package/dist/cjs/migrations/upgrade-two-dot-five.js +73 -0
  84. package/dist/cjs/migrations/upgrade-two-dot-five.js.map +1 -0
  85. package/dist/cjs/migrations/upgrade-two-dot-four.d.ts +24 -0
  86. package/dist/cjs/migrations/upgrade-two-dot-four.js +72 -0
  87. package/dist/cjs/migrations/upgrade-two-dot-four.js.map +1 -0
  88. package/dist/cjs/migrations/upgrade-two-dot-one.d.ts +7 -0
  89. package/dist/cjs/migrations/upgrade-two-dot-one.js +39 -0
  90. package/dist/cjs/migrations/upgrade-two-dot-one.js.map +1 -0
  91. package/dist/cjs/migrations/upgrade-two-dot-seven.d.ts +23 -0
  92. package/dist/cjs/migrations/upgrade-two-dot-seven.js +58 -0
  93. package/dist/cjs/migrations/upgrade-two-dot-seven.js.map +1 -0
  94. package/dist/cjs/migrations/upgrade-two-dot-six.d.ts +27 -0
  95. package/dist/cjs/migrations/upgrade-two-dot-six.js +61 -0
  96. package/dist/cjs/migrations/upgrade-two-dot-six.js.map +1 -0
  97. package/dist/cjs/migrations/upgrade-two-dot-three.d.ts +23 -0
  98. package/dist/cjs/migrations/upgrade-two-dot-three.js +55 -0
  99. package/dist/cjs/migrations/upgrade-two-dot-three.js.map +1 -0
  100. package/dist/cjs/migrations/upgrade-two-dot-two.d.ts +23 -0
  101. package/dist/cjs/migrations/upgrade-two-dot-two.js +58 -0
  102. package/dist/cjs/migrations/upgrade-two-dot-two.js.map +1 -0
  103. package/dist/cjs/migrations/upgrade-two-dot-zero.d.ts +44 -0
  104. package/dist/cjs/migrations/upgrade-two-dot-zero.js +95 -0
  105. package/dist/cjs/migrations/upgrade-two-dot-zero.js.map +1 -0
  106. package/dist/cjs/migrator.d.ts +25 -0
  107. package/dist/cjs/migrator.js +77 -0
  108. package/dist/cjs/migrator.js.map +1 -0
  109. package/dist/cjs/package.json +3 -0
  110. package/dist/cjs/resourceHelpers.d.ts +191 -0
  111. package/dist/cjs/resourceHelpers.js +384 -0
  112. package/dist/cjs/resourceHelpers.js.map +1 -0
  113. package/dist/cjs/resources/add-resource-from-blob.d.ts +26 -0
  114. package/dist/cjs/resources/add-resource-from-blob.js +52 -0
  115. package/dist/cjs/resources/add-resource-from-blob.js.map +1 -0
  116. package/dist/cjs/resources/addMetadataFromBlob.d.ts +25 -0
  117. package/dist/cjs/resources/addMetadataFromBlob.js +43 -0
  118. package/dist/cjs/resources/addMetadataFromBlob.js.map +1 -0
  119. package/dist/cjs/resources/convert-item-resource-to-storage-resource.d.ts +32 -0
  120. package/dist/cjs/resources/convert-item-resource-to-storage-resource.js +70 -0
  121. package/dist/cjs/resources/convert-item-resource-to-storage-resource.js.map +1 -0
  122. package/dist/cjs/resources/convert-storage-resource-to-item-resource.d.ts +29 -0
  123. package/dist/cjs/resources/convert-storage-resource-to-item-resource.js +70 -0
  124. package/dist/cjs/resources/convert-storage-resource-to-item-resource.js.map +1 -0
  125. package/dist/cjs/resources/copyAssociatedFiles.d.ts +67 -0
  126. package/dist/cjs/resources/copyAssociatedFiles.js +304 -0
  127. package/dist/cjs/resources/copyAssociatedFiles.js.map +1 -0
  128. package/dist/cjs/resources/copyDataIntoItem.d.ts +33 -0
  129. package/dist/cjs/resources/copyDataIntoItem.js +62 -0
  130. package/dist/cjs/resources/copyDataIntoItem.js.map +1 -0
  131. package/dist/cjs/resources/copyMetadataIntoItem.d.ts +26 -0
  132. package/dist/cjs/resources/copyMetadataIntoItem.js +46 -0
  133. package/dist/cjs/resources/copyMetadataIntoItem.js.map +1 -0
  134. package/dist/cjs/resources/copyResourceIntoZip.d.ts +33 -0
  135. package/dist/cjs/resources/copyResourceIntoZip.js +78 -0
  136. package/dist/cjs/resources/copyResourceIntoZip.js.map +1 -0
  137. package/dist/cjs/resources/copyZipIntoItem.d.ts +25 -0
  138. package/dist/cjs/resources/copyZipIntoItem.js +54 -0
  139. package/dist/cjs/resources/copyZipIntoItem.js.map +1 -0
  140. package/dist/cjs/resources/createCopyResults.d.ts +25 -0
  141. package/dist/cjs/resources/createCopyResults.js +36 -0
  142. package/dist/cjs/resources/createCopyResults.js.map +1 -0
  143. package/dist/cjs/resources/get-blob.d.ts +26 -0
  144. package/dist/cjs/resources/get-blob.js +27 -0
  145. package/dist/cjs/resources/get-blob.js.map +1 -0
  146. package/dist/cjs/resources/getItemResourcesFilesFromPaths.d.ts +24 -0
  147. package/dist/cjs/resources/getItemResourcesFilesFromPaths.js +49 -0
  148. package/dist/cjs/resources/getItemResourcesFilesFromPaths.js.map +1 -0
  149. package/dist/cjs/resources/getItemResourcesPaths.d.ts +26 -0
  150. package/dist/cjs/resources/getItemResourcesPaths.js +76 -0
  151. package/dist/cjs/resources/getItemResourcesPaths.js.map +1 -0
  152. package/dist/cjs/resources/index.d.ts +29 -0
  153. package/dist/cjs/resources/index.js +33 -0
  154. package/dist/cjs/resources/index.js.map +1 -0
  155. package/dist/cjs/resources/solution-resource.d.ts +35 -0
  156. package/dist/cjs/resources/solution-resource.js +31 -0
  157. package/dist/cjs/resources/solution-resource.js.map +1 -0
  158. package/dist/cjs/resources/transform-resource-paths-to-solution-resources.d.ts +56 -0
  159. package/dist/cjs/resources/transform-resource-paths-to-solution-resources.js +146 -0
  160. package/dist/cjs/resources/transform-resource-paths-to-solution-resources.js.map +1 -0
  161. package/dist/cjs/restHelpers.d.ts +607 -0
  162. package/dist/cjs/restHelpers.js +1954 -0
  163. package/dist/cjs/restHelpers.js.map +1 -0
  164. package/dist/cjs/restHelpersGet.d.ts +288 -0
  165. package/dist/cjs/restHelpersGet.js +804 -0
  166. package/dist/cjs/restHelpersGet.js.map +1 -0
  167. package/dist/cjs/sharing/index.d.ts +16 -0
  168. package/dist/cjs/sharing/index.js +20 -0
  169. package/dist/cjs/sharing/index.js.map +1 -0
  170. package/dist/cjs/sharing/share-item-to-groups.d.ts +26 -0
  171. package/dist/cjs/sharing/share-item-to-groups.js +44 -0
  172. package/dist/cjs/sharing/share-item-to-groups.js.map +1 -0
  173. package/dist/cjs/templatization.d.ts +139 -0
  174. package/dist/cjs/templatization.js +316 -0
  175. package/dist/cjs/templatization.js.map +1 -0
  176. package/dist/cjs/trackingHelpers.d.ts +116 -0
  177. package/dist/cjs/trackingHelpers.js +217 -0
  178. package/dist/cjs/trackingHelpers.js.map +1 -0
  179. package/dist/cjs/velocityHelpers.d.ts +57 -0
  180. package/dist/cjs/velocityHelpers.js +135 -0
  181. package/dist/cjs/velocityHelpers.js.map +1 -0
  182. package/dist/cjs/workflowHelpers.d.ts +37 -0
  183. package/dist/cjs/workflowHelpers.js +77 -0
  184. package/dist/cjs/workflowHelpers.js.map +1 -0
  185. package/dist/cjs/workforceHelpers.d.ts +115 -0
  186. package/dist/cjs/workforceHelpers.js +749 -0
  187. package/dist/cjs/workforceHelpers.js.map +1 -0
  188. package/dist/cjs/zip-utils.d.ts +76 -0
  189. package/dist/cjs/zip-utils.js +142 -0
  190. package/dist/cjs/zip-utils.js.map +1 -0
  191. package/dist/esm/package.json +3 -0
  192. package/package.json +2 -2
@@ -0,0 +1,433 @@
1
+ /** @license
2
+ * Copyright 2018 Esri
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Provides general helper functions.
18
+ *
19
+ * @module generalHelpers
20
+ */
21
+ import { IModel } from "@esri/hub-common";
22
+ import { ICreateItemFromTemplateResponse, IDatasourceInfo, IItemTemplate, IStringValuePair } from "./interfaces";
23
+ import { Sanitizer } from "./libConnectors";
24
+ /**
25
+ * Returns a URL with a query parameter appended
26
+ *
27
+ * @param url URL to append to
28
+ * @param parameter Query parameter to append, prefixed with "?" or "&" as appropriate to what url already has
29
+ * @returns New URL combining url and parameter
30
+ */
31
+ export declare function appendQueryParam(url: string, parameter: string): string;
32
+ /**
33
+ * Extracts JSON from a Blob.
34
+ *
35
+ * @param blob Blob to use as source
36
+ * @returns A promise that will resolve with JSON or null
37
+ */
38
+ export declare function blobToJson(blob: Blob): Promise<any>;
39
+ /**
40
+ * Converts a Blob to a File.
41
+ *
42
+ * @param blob Blob to use as source
43
+ * @param filename Name to use for file
44
+ * @param mimeType MIME type to override blob's MIME type
45
+ * @returns File created out of Blob and filename
46
+ */
47
+ export declare function blobToFile(blob: Blob, filename: string, mimeType?: string): File;
48
+ /**
49
+ * Extracts text from a Blob.
50
+ *
51
+ * @param blob Blob to use as source
52
+ * @returns A promise that will resolve with text read from blob
53
+ */
54
+ export declare function blobToText(blob: Blob): Promise<string>;
55
+ /**
56
+ * Checks that a URL path ends with a slash.
57
+ *
58
+ * @param url URL to check
59
+ * @returns URL, appended with slash if missing
60
+ */
61
+ export declare function checkUrlPathTermination(url: string): string;
62
+ /**
63
+ * Converts a hub-style item into a solutions-style item, the difference being handling of resources.
64
+ *
65
+ * @param hubModel Hub-style item
66
+ * @return solutions-style item
67
+ */
68
+ export declare function convertIModel(hubModel: IModel | undefined): IItemTemplate;
69
+ /**
70
+ * Creates a random 32-character alphanumeric string.
71
+ *
72
+ * @returns A lowercase 32-char alphanumeric string
73
+ * @internal
74
+ */
75
+ export declare function createLongId(): string;
76
+ /**
77
+ * Creates a random 8-character alphanumeric string that begins with an alphabetic character.
78
+ *
79
+ * @returns An alphanumeric string in the range [a0000000..zzzzzzzz]
80
+ */
81
+ export declare function createShortId(): string;
82
+ /**
83
+ * Copies an input list removing duplicates.
84
+ *
85
+ * @param input List to be deduped
86
+ * @returns Deduped list; order of items in input is not maintained
87
+ */
88
+ export declare function dedupe(input?: string[]): string[];
89
+ /**
90
+ * Performs an asynchronous delay.
91
+ *
92
+ * @param ms Milliseconds to delay
93
+ * @returns Promise when delay is complete
94
+ */
95
+ export declare function delay(ms: number): Promise<unknown>;
96
+ /**
97
+ * Flags a failure to create an item from a template.
98
+ *
99
+ * @param itemType The AGO item type
100
+ * @param id Item id to include in response
101
+ * @returns Empty creation response
102
+ */
103
+ export declare function generateEmptyCreationResponse(itemType: string, id?: string): ICreateItemFromTemplateResponse;
104
+ /**
105
+ * Returns a regular expression matching a global search for a 32-character AGO-style id.
106
+ *
107
+ * @returns Regular expression
108
+ */
109
+ export declare function getAgoIdRegEx(): RegExp;
110
+ /**
111
+ * Returns a regular expression matching a global search for a 32-character AGO-style id as a Solution template variable.
112
+ *
113
+ * @returns Regular expression
114
+ */
115
+ export declare function getAgoIdTemplateRegEx(): RegExp;
116
+ /**
117
+ * Returns a regular expression matching a global search for a word such as an AGO-style id.
118
+ *
119
+ * @param word Word to search for, bounded by regular expression word boundaries (\b)
120
+ * @returns Regular expression
121
+ */
122
+ export declare function getSpecifiedWordRegEx(word: string): RegExp;
123
+ /**
124
+ * Converts JSON to a Blob.
125
+ *
126
+ * @param json JSON to use as source
127
+ * @returns A blob from the source JSON
128
+ */
129
+ export declare function jsonToBlob(json: any): Blob;
130
+ /**
131
+ * Converts JSON to a File.
132
+ *
133
+ * @param json JSON to use as source
134
+ * @param filename Name to use for file
135
+ * @param mimeType MIME type to override blob's MIME type
136
+ * @returns File created out of JSON and filename
137
+ */
138
+ export declare function jsonToFile(json: any, filename: string, mimeType?: string): File;
139
+ /**
140
+ * Makes a unique copy of JSON by stringifying and parsing.
141
+ *
142
+ * @param json JSON to use as source
143
+ * @returns A JSON object from the source JSON
144
+ */
145
+ export declare function jsonToJson(json: any): any;
146
+ /**
147
+ * Saves a blob to a file.
148
+ *
149
+ * @param filename Name to give file
150
+ * @param blob Blob to save
151
+ * @returns Promise resolving when operation is complete
152
+ */
153
+ export declare function saveBlobAsFile(filename: string, blob: Blob): Promise<void>;
154
+ /**
155
+ * Makes a deep clone, including arrays but not functions.
156
+ *
157
+ * @param obj Object to be cloned
158
+ * @returns Clone of obj
159
+ * @example
160
+ * ```js
161
+ * import { cloneObject } from "utils/object-helpers";
162
+ * const original = { foo: "bar" }
163
+ * const copy = cloneObject(original)
164
+ * copy.foo // "bar"
165
+ * copy === original // false
166
+ * ```
167
+ */
168
+ export declare function cloneObject(obj: {
169
+ [index: string]: any;
170
+ }): any;
171
+ /**
172
+ * Compares two JSON objects using JSON.stringify.
173
+ *
174
+ * @param json1 First object
175
+ * @param json2 Second object
176
+ * @returns True if objects are the same
177
+ */
178
+ export declare function compareJSON(json1: any, json2: any): boolean;
179
+ /**
180
+ * Compares two JSON objects using JSON.stringify, converting empty strings to nulls.
181
+ *
182
+ * @param json1 First object
183
+ * @param json2 Second object
184
+ * @returns True if objects are the same
185
+ */
186
+ export declare function compareJSONNoEmptyStrings(json1: any, json2: any): boolean;
187
+ /**
188
+ * Compares two JSON objects property by property and reports each mismatch.
189
+ *
190
+ * @param json1 First object
191
+ * @param json2 Second object
192
+ * @returns A list of mismatch report strings
193
+ */
194
+ export declare function compareJSONProperties(json1: any, json2: any): string[];
195
+ /**
196
+ * Sanitizes JSON and echoes changes to console.
197
+ *
198
+ * @param json JSON to sanitize
199
+ * @param sanitizer Instance of Sanitizer class
200
+ * @returns Sanitized version of `json`
201
+ * @see https://github.com/esri/arcgis-html-sanitizer#sanitize-json
202
+ */
203
+ export declare function sanitizeJSONAndReportChanges(json: any, sanitizer?: Sanitizer): any;
204
+ export declare function deleteItemProps(itemTemplate: any): any;
205
+ /**
206
+ * Deletes a property from an object.
207
+ *
208
+ * @param obj Object with property to delete
209
+ * @param path Path into an object to property, e.g., "data.values.webmap", where "data" is a top-level property
210
+ * in obj
211
+ */
212
+ export declare function deleteProp(obj: any, path: string): void;
213
+ /**
214
+ * Deletes properties from an object.
215
+ *
216
+ * @param obj Object with properties to delete
217
+ * @param props Array of properties on object that should be deleted
218
+ */
219
+ export declare function deleteProps(obj: any, props: string[]): void;
220
+ /**
221
+ * Creates an AGO-style JSON failure response with success property.
222
+ *
223
+ * @param e Optional error information
224
+ * @returns JSON structure with property success set to false and optionally including `e`
225
+ */
226
+ export declare function fail(e?: any): any;
227
+ /**
228
+ * Creates an AGO-style JSON failure response with success property and extended with ids list.
229
+ *
230
+ * @param ids List of ids
231
+ * @param e Optional error information
232
+ * @returns JSON structure with property success set to false and optionally including `e`
233
+ */
234
+ export declare function failWithIds(itemIds: string[], e?: any): any;
235
+ /**
236
+ * Extracts subgroup ids from item tags
237
+ *
238
+ * @param tags Tags in an item
239
+ * @returns List of subgroup ids; subgroups are identified using tags that begin with "group." and end with a group id,
240
+ * e.g., "group.8d515625ee9f49d7b4f6c6cb2a389151"; non-matching tags are ignored
241
+ */
242
+ export declare function getSubgroupIds(tags: string[]): string[];
243
+ /**
244
+ * Extracts the ids from a string
245
+ *
246
+ * @param v String to examine
247
+ * @returns List of id strings found
248
+ * @example
249
+ * get id from
250
+ * bad3483e025c47338d43df308c117308
251
+ * {bad3483e025c47338d43df308c117308
252
+ * =bad3483e025c47338d43df308c117308
253
+ * do not get id from
254
+ * http: *something/name_bad3483e025c47338d43df308c117308
255
+ * {{bad3483e025c47338d43df308c117308.itemId}}
256
+ * bad3483e025c47338d43df308c117308bad3483e025c47338d43df308c117308
257
+ */
258
+ export declare function getIDs(v: string): string[];
259
+ /**
260
+ * Gets a property out of a deeply nested object.
261
+ * Does not handle anything but nested object graph
262
+ *
263
+ * @param obj Object to retrieve value from
264
+ * @param path Path into an object, e.g., "data.values.webmap", where "data" is a top-level property
265
+ * in obj
266
+ * @returns Value at end of path
267
+ */
268
+ export declare function getProp(obj: {
269
+ [index: string]: any;
270
+ }, path: string): any;
271
+ /**
272
+ * Returns an array of values from an object based on an array of property paths.
273
+ *
274
+ * @param obj Object to retrieve values from
275
+ * @param props Array of paths into the object e.g., "data.values.webmap", where "data" is a top-level property
276
+ * @returns Array of the values plucked from the object; only defined values are returned
277
+ */
278
+ export declare function getProps(obj: any, props: string[]): any;
279
+ /**
280
+ * Get a property out of a deeply nested object
281
+ * Does not handle anything but nested object graph
282
+ *
283
+ * @param obj Object to retrieve value from
284
+ * @param path Path into an object, e.g., "data.values.webmap", where "data" is a top-level property
285
+ * in obj
286
+ * @param defaultV Optional value to use if any part of path--including final value--is undefined
287
+ * @returns Value at end of path
288
+ */
289
+ export declare function getPropWithDefault(obj: IStringValuePair, path: string, defaultV?: any): any;
290
+ /**
291
+ * Updates a list of the items dependencies if more are found in the
292
+ * provided value.
293
+ *
294
+ * @param v a string value to check for ids
295
+ * @param deps a list of the items dependencies
296
+ */
297
+ export declare function idTest(v: any, deps: string[]): void;
298
+ /**
299
+ * Sets a deeply nested property of an object.
300
+ * Creates the full path if it does not exist.
301
+ *
302
+ * @param obj Object to set value of
303
+ * @param path Path into an object, e.g., "data.values.webmap", where "data" is a top-level property in obj
304
+ * @param value The value to set at the end of the path
305
+ */
306
+ export declare function setCreateProp(obj: any, path: string, value: any): void;
307
+ /**
308
+ * Sets a deeply nested property of an object.
309
+ * Does nothing if the full path does not exist.
310
+ *
311
+ * @param obj Object to set value of
312
+ * @param path Path into an object, e.g., "data.values.webmap", where "data" is a top-level property in obj
313
+ * @param value The value to set at the end of the path
314
+ */
315
+ export declare function setProp(obj: any, path: string, value: any): void;
316
+ /**
317
+ * Creates a timestamp string using the current UTC date and time.
318
+ *
319
+ * @returns Timestamp formatted as YYYYMMDD_hhmm_ssmmm, with month one-based and all values padded with zeroes on the
320
+ * left as needed (`ssmmm` stands for seconds from 0..59 and milliseconds from 0..999)
321
+ * @private
322
+ */
323
+ export declare function getUTCTimestamp(): string;
324
+ /**
325
+ * Tests if an object's `item.typeKeywords` or `typeKeywords` properties has any of a set of keywords.
326
+ *
327
+ * @param jsonObj Object to test
328
+ * @param keywords List of keywords to look for in jsonObj
329
+ * @returns Boolean indicating result
330
+ */
331
+ export declare function hasAnyKeyword(jsonObj: any, keywords: string[]): boolean;
332
+ /**
333
+ * Tests if an object's `item.typeKeywords` or `typeKeywords` properties has a specific keyword.
334
+ *
335
+ * @param jsonObj Object to test
336
+ * @param keyword Keyword to look for in jsonObj
337
+ * @returns Boolean indicating result
338
+ */
339
+ export declare function hasTypeKeyword(jsonObj: any, keyword: string): boolean;
340
+ /**
341
+ * Will return the provided title if it does not exist as a property
342
+ * in one of the objects at the defined path. Otherwise the title will
343
+ * have a numerical value attached.
344
+ *
345
+ * @param title The root title to test
346
+ * @param templateDictionary Hash of the facts
347
+ * @param path to the objects to evaluate for potantial name clashes
348
+ * @returns string The unique title to use
349
+ */
350
+ export declare function getUniqueTitle(title: string, templateDictionary: any, path: string): string;
351
+ /**
352
+ * Performs string replacement on every string in an object.
353
+ *
354
+ * @param obj Object to scan and to modify
355
+ * @param pattern Search pattern in each string
356
+ * @param replacement Replacement for matches to search pattern
357
+ * @returns Modified obj is returned
358
+ */
359
+ export declare function globalStringReplace(obj: any, pattern: RegExp, replacement: string): any;
360
+ /**
361
+ * Tests if an array of DatasourceInfos has a given item and layer id already.
362
+ *
363
+ * @param datasourceInfos Array of DatasourceInfos to evaluate
364
+ * @param itemId The items id to check for
365
+ * @param layerId The layers id to check for
366
+ * @returns Boolean indicating result
367
+ */
368
+ export declare function hasDatasource(datasourceInfos: IDatasourceInfo[], itemId: string, layerId: number): boolean;
369
+ /**
370
+ * remove templatization from item id to compare
371
+ *
372
+ * @example
373
+ * \{\{934a9ef8efa7448fa8ddf7b13cef0240.itemId\}\}
374
+ * returns 934a9ef8efa7448fa8ddf7b13cef0240
375
+ */
376
+ export declare function cleanItemId(id: any): any;
377
+ /**
378
+ * remove templatization from layer based item id to compare
379
+ *
380
+ * @example
381
+ * \{\{934a9ef8efa7448fa8ddf7b13cef0240.layer0.itemId\}\}
382
+ * returns 934a9ef8efa7448fa8ddf7b13cef0240
383
+ */
384
+ export declare function cleanLayerBasedItemId(id: any): any;
385
+ /**
386
+ * remove templatization from layer id to compare
387
+ *
388
+ * @example
389
+ * \{\{934a9ef8efa7448fa8ddf7b13cef0240.layer0.layerId\}\}
390
+ * returns 0
391
+ */
392
+ export declare function cleanLayerId(id: any): any;
393
+ /**
394
+ * Get template from list of templates by ID
395
+ *
396
+ * @param templates Array of item templates to search
397
+ * @param id of template we are searching for
398
+ *
399
+ * @returns Template associated with the user provided id argument
400
+ */
401
+ export declare function getTemplateById(templates: IItemTemplate[], id: string): any;
402
+ /**
403
+ * Evaluates a value with a regular expression
404
+ *
405
+ * @param v a string value to test with the expression
406
+ * @param ex the regular expresion to test with
407
+ * @returns an array of matches
408
+ */
409
+ export declare function regExTest(v: any, ex: RegExp): any[];
410
+ /**
411
+ * Removes duplicates from a list of strings.
412
+ *
413
+ * @param list List to be de-duped
414
+ * @returns List of unique strings
415
+ */
416
+ export declare function uniqueStringList(list: string[]): string[];
417
+ /**
418
+ * Creates a random number between two values.
419
+ *
420
+ * @param min Inclusive minimum desired value
421
+ * @param max Non-inclusive maximum desired value
422
+ * @returns Random number in the range [min, max)
423
+ */
424
+ export declare function _getRandomNumberInRange(min: number, max: number): number;
425
+ /**
426
+ * Pads the string representation of a number to a minimum width. Requires modern browser.
427
+ *
428
+ * @param n Number to pad
429
+ * @param totalSize Desired *minimum* width of number after padding with zeroes
430
+ * @returns Number converted to string and padded on the left as needed
431
+ * @private
432
+ */
433
+ export declare function _padPositiveNum(n: number, totalSize: number): string;