@esri/solution-common 1.3.10 → 1.3.13
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/esm/completeItem.d.ts +1 -1
- package/dist/esm/completeItem.js +1 -1
- package/dist/esm/deleteHelpers/deleteEmptyGroups.d.ts +1 -1
- package/dist/esm/deleteHelpers/deleteEmptyGroups.js +1 -1
- package/dist/esm/deleteHelpers/deleteGroupIfEmpty.d.ts +1 -1
- package/dist/esm/deleteHelpers/deleteGroupIfEmpty.js +1 -1
- package/dist/esm/deleteHelpers/deleteSolutionContents.d.ts +1 -1
- package/dist/esm/deleteHelpers/deleteSolutionContents.js +1 -1
- package/dist/esm/deleteHelpers/deleteSolutionFolder.d.ts +1 -1
- package/dist/esm/deleteHelpers/deleteSolutionFolder.js +1 -1
- package/dist/esm/deleteHelpers/deleteSolutionItem.d.ts +1 -1
- package/dist/esm/deleteHelpers/deleteSolutionItem.js +1 -1
- package/dist/esm/deleteHelpers/reconstructBuildOrderIds.d.ts +1 -1
- package/dist/esm/deleteHelpers/reconstructBuildOrderIds.js +1 -1
- package/dist/esm/deleteHelpers/removeItems.d.ts +1 -1
- package/dist/esm/deleteHelpers/removeItems.js +1 -1
- package/dist/esm/deleteSolution.d.ts +2 -2
- package/dist/esm/deleteSolution.js +2 -2
- package/dist/esm/dependencies.d.ts +1 -1
- package/dist/esm/dependencies.js +2 -2
- package/dist/esm/featureServiceHelpers.d.ts +99 -60
- package/dist/esm/featureServiceHelpers.js +99 -60
- package/dist/esm/featureServiceHelpers.js.map +1 -1
- package/dist/esm/generalHelpers.d.ts +34 -34
- package/dist/esm/generalHelpers.js +36 -36
- package/dist/esm/getDeletableSolutionInfo.d.ts +1 -1
- package/dist/esm/getDeletableSolutionInfo.js +1 -1
- package/dist/esm/getSolutionSummary.d.ts +1 -1
- package/dist/esm/getSolutionSummary.js +1 -1
- package/dist/esm/interfaces.d.ts +438 -10
- package/dist/esm/interfaces.js +7 -1
- package/dist/esm/interfaces.js.map +1 -1
- package/dist/esm/libConnectors.d.ts +5 -5
- package/dist/esm/libConnectors.js +5 -5
- package/dist/esm/migrations/apply-schema.d.ts +1 -0
- package/dist/esm/migrations/apply-schema.js +1 -0
- package/dist/esm/migrations/apply-schema.js.map +1 -1
- package/dist/esm/migrations/upgrade-three-dot-one.d.ts +1 -0
- package/dist/esm/migrations/upgrade-three-dot-one.js +1 -0
- package/dist/esm/migrations/upgrade-three-dot-one.js.map +1 -1
- package/dist/esm/migrations/upgrade-two-dot-seven.d.ts +7 -0
- package/dist/esm/migrations/upgrade-two-dot-seven.js +7 -0
- package/dist/esm/migrations/upgrade-two-dot-seven.js.map +1 -1
- package/dist/esm/polyfills.d.ts +2 -2
- package/dist/esm/polyfills.js +2 -2
- package/dist/esm/resourceHelpers.d.ts +11 -11
- package/dist/esm/resourceHelpers.js +11 -11
- package/dist/esm/resources/addMetadataFromBlob.d.ts +1 -1
- package/dist/esm/resources/addMetadataFromBlob.js +1 -1
- package/dist/esm/resources/convert-item-resource-to-storage-resource.d.ts +1 -1
- package/dist/esm/resources/convert-item-resource-to-storage-resource.js +1 -1
- package/dist/esm/resources/convert-storage-resource-to-item-resource.d.ts +1 -1
- package/dist/esm/resources/convert-storage-resource-to-item-resource.js +1 -1
- package/dist/esm/resources/copyAssociatedFiles.d.ts +4 -3
- package/dist/esm/resources/copyAssociatedFiles.js +5 -4
- package/dist/esm/resources/copyAssociatedFiles.js.map +1 -1
- package/dist/esm/resources/copyDataIntoItem.d.ts +2 -2
- package/dist/esm/resources/copyDataIntoItem.js +2 -2
- package/dist/esm/resources/copyMetadataIntoItem.d.ts +1 -1
- package/dist/esm/resources/copyMetadataIntoItem.js +1 -1
- package/dist/esm/resources/copyResourceIntoZip.d.ts +2 -2
- package/dist/esm/resources/copyResourceIntoZip.js +2 -2
- package/dist/esm/resources/copyZipIntoItem.d.ts +1 -1
- package/dist/esm/resources/copyZipIntoItem.js +1 -1
- package/dist/esm/resources/createCopyResults.d.ts +1 -1
- package/dist/esm/resources/createCopyResults.js +1 -1
- package/dist/esm/resources/get-blob.d.ts +1 -1
- package/dist/esm/resources/get-blob.js +1 -1
- package/dist/esm/resources/getItemResourcesFilesFromPaths.d.ts +1 -1
- package/dist/esm/resources/getItemResourcesFilesFromPaths.js +1 -1
- package/dist/esm/resources/getItemResourcesPaths.d.ts +1 -1
- package/dist/esm/resources/getItemResourcesPaths.js +1 -1
- package/dist/esm/resources/transform-resource-paths-to-solution-resources.d.ts +1 -0
- package/dist/esm/resources/transform-resource-paths-to-solution-resources.js +1 -0
- package/dist/esm/resources/transform-resource-paths-to-solution-resources.js.map +1 -1
- package/dist/esm/restHelpers.d.ts +59 -54
- package/dist/esm/restHelpers.js +55 -50
- package/dist/esm/restHelpers.js.map +1 -1
- package/dist/esm/restHelpersGet.d.ts +30 -30
- package/dist/esm/restHelpersGet.js +30 -30
- package/dist/esm/templatization.d.ts +15 -15
- package/dist/esm/templatization.js +15 -15
- package/dist/esm/trackingHelpers.d.ts +9 -9
- package/dist/esm/trackingHelpers.js +9 -9
- package/dist/esm/velocityHelpers.d.ts +4 -4
- package/dist/esm/velocityHelpers.js +4 -4
- package/dist/esm/workforceHelpers.d.ts +8 -7
- package/dist/esm/workforceHelpers.js +18 -7
- package/dist/esm/workforceHelpers.js.map +1 -1
- package/dist/node/completeItem.d.ts +1 -1
- package/dist/node/completeItem.js +1 -1
- package/dist/node/deleteHelpers/deleteEmptyGroups.d.ts +1 -1
- package/dist/node/deleteHelpers/deleteEmptyGroups.js +1 -1
- package/dist/node/deleteHelpers/deleteGroupIfEmpty.d.ts +1 -1
- package/dist/node/deleteHelpers/deleteGroupIfEmpty.js +1 -1
- package/dist/node/deleteHelpers/deleteSolutionContents.d.ts +1 -1
- package/dist/node/deleteHelpers/deleteSolutionContents.js +1 -1
- package/dist/node/deleteHelpers/deleteSolutionFolder.d.ts +1 -1
- package/dist/node/deleteHelpers/deleteSolutionFolder.js +1 -1
- package/dist/node/deleteHelpers/deleteSolutionItem.d.ts +1 -1
- package/dist/node/deleteHelpers/deleteSolutionItem.js +1 -1
- package/dist/node/deleteHelpers/reconstructBuildOrderIds.d.ts +1 -1
- package/dist/node/deleteHelpers/reconstructBuildOrderIds.js +1 -1
- package/dist/node/deleteHelpers/removeItems.d.ts +1 -1
- package/dist/node/deleteHelpers/removeItems.js +1 -1
- package/dist/node/deleteSolution.d.ts +2 -2
- package/dist/node/deleteSolution.js +2 -2
- package/dist/node/dependencies.d.ts +1 -1
- package/dist/node/dependencies.js +2 -2
- package/dist/node/featureServiceHelpers.d.ts +99 -60
- package/dist/node/featureServiceHelpers.js +99 -60
- package/dist/node/featureServiceHelpers.js.map +1 -1
- package/dist/node/generalHelpers.d.ts +34 -34
- package/dist/node/generalHelpers.js +36 -36
- package/dist/node/getDeletableSolutionInfo.d.ts +1 -1
- package/dist/node/getDeletableSolutionInfo.js +1 -1
- package/dist/node/getSolutionSummary.d.ts +1 -1
- package/dist/node/getSolutionSummary.js +1 -1
- package/dist/node/interfaces.d.ts +438 -10
- package/dist/node/interfaces.js +7 -1
- package/dist/node/interfaces.js.map +1 -1
- package/dist/node/libConnectors.d.ts +5 -5
- package/dist/node/libConnectors.js +5 -5
- package/dist/node/migrations/apply-schema.d.ts +1 -0
- package/dist/node/migrations/apply-schema.js +1 -0
- package/dist/node/migrations/apply-schema.js.map +1 -1
- package/dist/node/migrations/upgrade-three-dot-one.d.ts +1 -0
- package/dist/node/migrations/upgrade-three-dot-one.js +1 -0
- package/dist/node/migrations/upgrade-three-dot-one.js.map +1 -1
- package/dist/node/migrations/upgrade-two-dot-seven.d.ts +7 -0
- package/dist/node/migrations/upgrade-two-dot-seven.js +7 -0
- package/dist/node/migrations/upgrade-two-dot-seven.js.map +1 -1
- package/dist/node/polyfills.d.ts +2 -2
- package/dist/node/polyfills.js +2 -2
- package/dist/node/resourceHelpers.d.ts +11 -11
- package/dist/node/resourceHelpers.js +11 -11
- package/dist/node/resources/addMetadataFromBlob.d.ts +1 -1
- package/dist/node/resources/addMetadataFromBlob.js +1 -1
- package/dist/node/resources/convert-item-resource-to-storage-resource.d.ts +1 -1
- package/dist/node/resources/convert-item-resource-to-storage-resource.js +1 -1
- package/dist/node/resources/convert-storage-resource-to-item-resource.d.ts +1 -1
- package/dist/node/resources/convert-storage-resource-to-item-resource.js +1 -1
- package/dist/node/resources/copyAssociatedFiles.d.ts +4 -3
- package/dist/node/resources/copyAssociatedFiles.js +5 -4
- package/dist/node/resources/copyAssociatedFiles.js.map +1 -1
- package/dist/node/resources/copyDataIntoItem.d.ts +2 -2
- package/dist/node/resources/copyDataIntoItem.js +2 -2
- package/dist/node/resources/copyMetadataIntoItem.d.ts +1 -1
- package/dist/node/resources/copyMetadataIntoItem.js +1 -1
- package/dist/node/resources/copyResourceIntoZip.d.ts +2 -2
- package/dist/node/resources/copyResourceIntoZip.js +2 -2
- package/dist/node/resources/copyZipIntoItem.d.ts +1 -1
- package/dist/node/resources/copyZipIntoItem.js +1 -1
- package/dist/node/resources/createCopyResults.d.ts +1 -1
- package/dist/node/resources/createCopyResults.js +1 -1
- package/dist/node/resources/get-blob.d.ts +1 -1
- package/dist/node/resources/get-blob.js +1 -1
- package/dist/node/resources/getItemResourcesFilesFromPaths.d.ts +1 -1
- package/dist/node/resources/getItemResourcesFilesFromPaths.js +1 -1
- package/dist/node/resources/getItemResourcesPaths.d.ts +1 -1
- package/dist/node/resources/getItemResourcesPaths.js +1 -1
- package/dist/node/resources/transform-resource-paths-to-solution-resources.d.ts +1 -0
- package/dist/node/resources/transform-resource-paths-to-solution-resources.js +1 -0
- package/dist/node/resources/transform-resource-paths-to-solution-resources.js.map +1 -1
- package/dist/node/restHelpers.d.ts +59 -54
- package/dist/node/restHelpers.js +55 -50
- package/dist/node/restHelpers.js.map +1 -1
- package/dist/node/restHelpersGet.d.ts +30 -30
- package/dist/node/restHelpersGet.js +30 -30
- package/dist/node/templatization.d.ts +15 -15
- package/dist/node/templatization.js +15 -15
- package/dist/node/trackingHelpers.d.ts +9 -9
- package/dist/node/trackingHelpers.js +9 -9
- package/dist/node/velocityHelpers.d.ts +4 -4
- package/dist/node/velocityHelpers.js +4 -4
- package/dist/node/workforceHelpers.d.ts +8 -7
- package/dist/node/workforceHelpers.js +18 -7
- package/dist/node/workforceHelpers.js.map +1 -1
- package/dist/umd/common.umd.js +399 -313
- package/dist/umd/common.umd.js.map +1 -1
- package/dist/umd/common.umd.min.js +3 -3
- package/dist/umd/common.umd.min.js.map +1 -1
- package/dist/umd/completeItem.d.ts +1 -1
- package/dist/umd/deleteHelpers/deleteEmptyGroups.d.ts +1 -1
- package/dist/umd/deleteHelpers/deleteGroupIfEmpty.d.ts +1 -1
- package/dist/umd/deleteHelpers/deleteSolutionContents.d.ts +1 -1
- package/dist/umd/deleteHelpers/deleteSolutionFolder.d.ts +1 -1
- package/dist/umd/deleteHelpers/deleteSolutionItem.d.ts +1 -1
- package/dist/umd/deleteHelpers/reconstructBuildOrderIds.d.ts +1 -1
- package/dist/umd/deleteHelpers/removeItems.d.ts +1 -1
- package/dist/umd/deleteSolution.d.ts +2 -2
- package/dist/umd/dependencies.d.ts +1 -1
- package/dist/umd/featureServiceHelpers.d.ts +99 -60
- package/dist/umd/generalHelpers.d.ts +34 -34
- package/dist/umd/getDeletableSolutionInfo.d.ts +1 -1
- package/dist/umd/getSolutionSummary.d.ts +1 -1
- package/dist/umd/interfaces.d.ts +438 -10
- package/dist/umd/libConnectors.d.ts +5 -5
- package/dist/umd/migrations/apply-schema.d.ts +1 -0
- package/dist/umd/migrations/upgrade-three-dot-one.d.ts +1 -0
- package/dist/umd/migrations/upgrade-two-dot-seven.d.ts +7 -0
- package/dist/umd/polyfills.d.ts +2 -2
- package/dist/umd/resourceHelpers.d.ts +11 -11
- package/dist/umd/resources/addMetadataFromBlob.d.ts +1 -1
- package/dist/umd/resources/convert-item-resource-to-storage-resource.d.ts +1 -1
- package/dist/umd/resources/convert-storage-resource-to-item-resource.d.ts +1 -1
- package/dist/umd/resources/copyAssociatedFiles.d.ts +4 -3
- package/dist/umd/resources/copyDataIntoItem.d.ts +2 -2
- package/dist/umd/resources/copyMetadataIntoItem.d.ts +1 -1
- package/dist/umd/resources/copyResourceIntoZip.d.ts +2 -2
- package/dist/umd/resources/copyZipIntoItem.d.ts +1 -1
- package/dist/umd/resources/createCopyResults.d.ts +1 -1
- package/dist/umd/resources/get-blob.d.ts +1 -1
- package/dist/umd/resources/getItemResourcesFilesFromPaths.d.ts +1 -1
- package/dist/umd/resources/getItemResourcesPaths.d.ts +1 -1
- package/dist/umd/resources/transform-resource-paths-to-solution-resources.d.ts +1 -0
- package/dist/umd/restHelpers.d.ts +59 -54
- package/dist/umd/restHelpersGet.d.ts +30 -30
- package/dist/umd/templatization.d.ts +15 -15
- package/dist/umd/trackingHelpers.d.ts +9 -9
- package/dist/umd/velocityHelpers.d.ts +4 -4
- package/dist/umd/workforceHelpers.d.ts +8 -7
- package/package.json +18 -17
|
@@ -27,7 +27,7 @@ import { new_File } from "./polyfills";
|
|
|
27
27
|
*
|
|
28
28
|
* @param url URL to append to
|
|
29
29
|
* @param parameter Query parameter to append, prefixed with "?" or "&" as appropriate to what url already has
|
|
30
|
-
* @
|
|
30
|
+
* @returns New URL combining url and parameter
|
|
31
31
|
*/
|
|
32
32
|
export function appendQueryParam(url, parameter) {
|
|
33
33
|
return url + (url.indexOf("?") === -1 ? "?" : "&") + parameter;
|
|
@@ -36,7 +36,7 @@ export function appendQueryParam(url, parameter) {
|
|
|
36
36
|
* Extracts JSON from a Blob.
|
|
37
37
|
*
|
|
38
38
|
* @param blob Blob to use as source
|
|
39
|
-
* @
|
|
39
|
+
* @returns A promise that will resolve with JSON or null
|
|
40
40
|
*/
|
|
41
41
|
export function blobToJson(blob) {
|
|
42
42
|
return new Promise(resolve => {
|
|
@@ -56,7 +56,7 @@ export function blobToJson(blob) {
|
|
|
56
56
|
* @param blob Blob to use as source
|
|
57
57
|
* @param filename Name to use for file
|
|
58
58
|
* @param mimeType MIME type to override blob's MIME type
|
|
59
|
-
* @
|
|
59
|
+
* @returns File created out of Blob and filename
|
|
60
60
|
*/
|
|
61
61
|
export function blobToFile(blob, filename, mimeType) {
|
|
62
62
|
return blob
|
|
@@ -69,7 +69,7 @@ export function blobToFile(blob, filename, mimeType) {
|
|
|
69
69
|
* Extracts text from a Blob.
|
|
70
70
|
*
|
|
71
71
|
* @param blob Blob to use as source
|
|
72
|
-
* @
|
|
72
|
+
* @returns A promise that will resolve with text read from blob
|
|
73
73
|
*/
|
|
74
74
|
export function blobToText(blob) {
|
|
75
75
|
return new Promise(resolve => {
|
|
@@ -87,7 +87,7 @@ export function blobToText(blob) {
|
|
|
87
87
|
* Checks that a URL path ends with a slash.
|
|
88
88
|
*
|
|
89
89
|
* @param url URL to check
|
|
90
|
-
* @
|
|
90
|
+
* @returns URL, appended with slash if missing
|
|
91
91
|
*/
|
|
92
92
|
export function checkUrlPathTermination(url) {
|
|
93
93
|
return url ? (url.endsWith("/") ? url : url + "/") : url;
|
|
@@ -95,7 +95,7 @@ export function checkUrlPathTermination(url) {
|
|
|
95
95
|
/**
|
|
96
96
|
* Creates a random 32-character alphanumeric string.
|
|
97
97
|
*
|
|
98
|
-
* @
|
|
98
|
+
* @returns A lowercase 32-char alphanumeric string
|
|
99
99
|
* @internal
|
|
100
100
|
*/
|
|
101
101
|
export function createLongId() {
|
|
@@ -105,7 +105,7 @@ export function createLongId() {
|
|
|
105
105
|
/**
|
|
106
106
|
* Creates a random 8-character alphanumeric string that begins with an alphabetic character.
|
|
107
107
|
*
|
|
108
|
-
* @
|
|
108
|
+
* @returns An alphanumeric string in the range [a0000000..zzzzzzzz]
|
|
109
109
|
*/
|
|
110
110
|
export function createShortId() {
|
|
111
111
|
// Return a random number, but beginning with an alphabetic character so that it can be used as a valid
|
|
@@ -135,7 +135,7 @@ export function dedupe(input = []) {
|
|
|
135
135
|
*
|
|
136
136
|
* @param itemType The AGO item type
|
|
137
137
|
* @param id Item id to include in response
|
|
138
|
-
* @
|
|
138
|
+
* @returns Empty creation response
|
|
139
139
|
*/
|
|
140
140
|
export function generateEmptyCreationResponse(itemType, id = "") {
|
|
141
141
|
return {
|
|
@@ -149,7 +149,7 @@ export function generateEmptyCreationResponse(itemType, id = "") {
|
|
|
149
149
|
* Converts JSON to a Blob.
|
|
150
150
|
*
|
|
151
151
|
* @param json JSON to use as source
|
|
152
|
-
* @
|
|
152
|
+
* @returns A blob from the source JSON
|
|
153
153
|
*/
|
|
154
154
|
export function jsonToBlob(json) {
|
|
155
155
|
const _json = JSON.stringify(json);
|
|
@@ -166,7 +166,7 @@ export function jsonToBlob(json) {
|
|
|
166
166
|
* @param json JSON to use as source
|
|
167
167
|
* @param filename Name to use for file
|
|
168
168
|
* @param mimeType MIME type to override blob's MIME type
|
|
169
|
-
* @
|
|
169
|
+
* @returns File created out of JSON and filename
|
|
170
170
|
*/
|
|
171
171
|
export function jsonToFile(json, filename, mimeType = "application/json") {
|
|
172
172
|
return blobToFile(jsonToBlob(json), filename, mimeType);
|
|
@@ -176,7 +176,7 @@ export function jsonToFile(json, filename, mimeType = "application/json") {
|
|
|
176
176
|
*
|
|
177
177
|
* @param filename Name to give file
|
|
178
178
|
* @param blob Blob to save
|
|
179
|
-
* @
|
|
179
|
+
* @returns Promise resolving when operation is complete
|
|
180
180
|
*/
|
|
181
181
|
// Function is only used for live testing, so excluding it from coverage for now
|
|
182
182
|
/* istanbul ignore next */
|
|
@@ -200,7 +200,7 @@ export function saveBlobAsFile(filename, blob) {
|
|
|
200
200
|
* Makes a deep clone, including arrays but not functions.
|
|
201
201
|
*
|
|
202
202
|
* @param obj Object to be cloned
|
|
203
|
-
* @
|
|
203
|
+
* @returns Clone of obj
|
|
204
204
|
* @example
|
|
205
205
|
* ```js
|
|
206
206
|
* import { cloneObject } from "utils/object-helpers";
|
|
@@ -242,7 +242,7 @@ export function cloneObject(obj) {
|
|
|
242
242
|
*
|
|
243
243
|
* @param json1 First object
|
|
244
244
|
* @param json2 Second object
|
|
245
|
-
* @
|
|
245
|
+
* @returns True if objects are the same
|
|
246
246
|
*/
|
|
247
247
|
export function compareJSON(json1, json2) {
|
|
248
248
|
return JSON.stringify(json1) === JSON.stringify(json2);
|
|
@@ -252,7 +252,7 @@ export function compareJSON(json1, json2) {
|
|
|
252
252
|
*
|
|
253
253
|
* @param json1 First object
|
|
254
254
|
* @param json2 Second object
|
|
255
|
-
* @
|
|
255
|
+
* @returns True if objects are the same
|
|
256
256
|
*/
|
|
257
257
|
export function compareJSONNoEmptyStrings(json1, json2) {
|
|
258
258
|
const jsonStr1 = JSON.stringify(json1).replace(/":""/g, '":null');
|
|
@@ -264,7 +264,7 @@ export function compareJSONNoEmptyStrings(json1, json2) {
|
|
|
264
264
|
*
|
|
265
265
|
* @param json1 First object
|
|
266
266
|
* @param json2 Second object
|
|
267
|
-
* @
|
|
267
|
+
* @returns A list of mismatch report strings
|
|
268
268
|
*/
|
|
269
269
|
export function compareJSONProperties(json1, json2) {
|
|
270
270
|
let mismatches = [];
|
|
@@ -328,7 +328,7 @@ export function compareJSONProperties(json1, json2) {
|
|
|
328
328
|
*
|
|
329
329
|
* @param json JSON to sanitize
|
|
330
330
|
* @param sanitizer Instance of Sanitizer class
|
|
331
|
-
* @
|
|
331
|
+
* @returns Sanitized version of `json`
|
|
332
332
|
* @see https://github.com/esri/arcgis-html-sanitizer#sanitize-json
|
|
333
333
|
*/
|
|
334
334
|
export function sanitizeJSONAndReportChanges(json, sanitizer) {
|
|
@@ -413,7 +413,7 @@ export function deleteProps(obj, props) {
|
|
|
413
413
|
* Creates an AGO-style JSON failure response with success property.
|
|
414
414
|
*
|
|
415
415
|
* @param e Optional error information
|
|
416
|
-
* @
|
|
416
|
+
* @returns JSON structure with property success set to false and optionally including `e`
|
|
417
417
|
*/
|
|
418
418
|
export function fail(e) {
|
|
419
419
|
if (e) {
|
|
@@ -428,7 +428,7 @@ export function fail(e) {
|
|
|
428
428
|
*
|
|
429
429
|
* @param ids List of ids
|
|
430
430
|
* @param e Optional error information
|
|
431
|
-
* @
|
|
431
|
+
* @returns JSON structure with property success set to false and optionally including `e`
|
|
432
432
|
*/
|
|
433
433
|
export function failWithIds(itemIds, e) {
|
|
434
434
|
if (e) {
|
|
@@ -442,7 +442,7 @@ export function failWithIds(itemIds, e) {
|
|
|
442
442
|
* Extracts the ids from a string
|
|
443
443
|
*
|
|
444
444
|
* @param v String to examine
|
|
445
|
-
* @
|
|
445
|
+
* @returns List of id strings found
|
|
446
446
|
* @example
|
|
447
447
|
* get id from
|
|
448
448
|
* bad3483e025c47338d43df308c117308
|
|
@@ -472,7 +472,7 @@ export function getIDs(v) {
|
|
|
472
472
|
* @param obj Object to retrieve value from
|
|
473
473
|
* @param path Path into an object, e.g., "data.values.webmap", where "data" is a top-level property
|
|
474
474
|
* in obj
|
|
475
|
-
* @
|
|
475
|
+
* @returns Value at end of path
|
|
476
476
|
*/
|
|
477
477
|
export function getProp(obj, path) {
|
|
478
478
|
return path.split(".").reduce(function (prev, curr) {
|
|
@@ -485,7 +485,7 @@ export function getProp(obj, path) {
|
|
|
485
485
|
*
|
|
486
486
|
* @param obj Object to retrieve values from
|
|
487
487
|
* @param props Array of paths into the object e.g., "data.values.webmap", where "data" is a top-level property
|
|
488
|
-
* @
|
|
488
|
+
* @returns Array of the values plucked from the object; only defined values are returned
|
|
489
489
|
*/
|
|
490
490
|
export function getProps(obj, props) {
|
|
491
491
|
return props.reduce((a, p) => {
|
|
@@ -504,7 +504,7 @@ export function getProps(obj, props) {
|
|
|
504
504
|
* @param path Path into an object, e.g., "data.values.webmap", where "data" is a top-level property
|
|
505
505
|
* in obj
|
|
506
506
|
* @param defaultV Optional value to use if any part of path--including final value--is undefined
|
|
507
|
-
* @
|
|
507
|
+
* @returns Value at end of path
|
|
508
508
|
*/
|
|
509
509
|
export function getPropWithDefault(obj, path, defaultV) {
|
|
510
510
|
const value = path.split(".").reduce(function (prev, curr) {
|
|
@@ -582,9 +582,9 @@ export function setProp(obj, path, value) {
|
|
|
582
582
|
/**
|
|
583
583
|
* Creates a timestamp string using the current UTC date and time.
|
|
584
584
|
*
|
|
585
|
-
* @
|
|
585
|
+
* @returns Timestamp formatted as YYYYMMDD_hhmm_ssmmm, with month one-based and all values padded with zeroes on the
|
|
586
586
|
* left as needed (`ssmmm` stands for seconds from 0..59 and milliseconds from 0..999)
|
|
587
|
-
* @
|
|
587
|
+
* @private
|
|
588
588
|
*/
|
|
589
589
|
export function getUTCTimestamp() {
|
|
590
590
|
const now = new Date();
|
|
@@ -603,7 +603,7 @@ export function getUTCTimestamp() {
|
|
|
603
603
|
*
|
|
604
604
|
* @param jsonObj Object to test
|
|
605
605
|
* @param keywords List of keywords to look for in jsonObj
|
|
606
|
-
* @
|
|
606
|
+
* @returns Boolean indicating result
|
|
607
607
|
*/
|
|
608
608
|
export function hasAnyKeyword(jsonObj, keywords) {
|
|
609
609
|
const typeKeywords = getProp(jsonObj, "item.typeKeywords") || jsonObj.typeKeywords || [];
|
|
@@ -619,7 +619,7 @@ export function hasAnyKeyword(jsonObj, keywords) {
|
|
|
619
619
|
*
|
|
620
620
|
* @param jsonObj Object to test
|
|
621
621
|
* @param keyword Keyword to look for in jsonObj
|
|
622
|
-
* @
|
|
622
|
+
* @returns Boolean indicating result
|
|
623
623
|
*/
|
|
624
624
|
export function hasTypeKeyword(jsonObj, keyword) {
|
|
625
625
|
const typeKeywords = getProp(jsonObj, "item.typeKeywords") || jsonObj.typeKeywords || [];
|
|
@@ -633,7 +633,7 @@ export function hasTypeKeyword(jsonObj, keyword) {
|
|
|
633
633
|
* @param title The root title to test
|
|
634
634
|
* @param templateDictionary Hash of the facts
|
|
635
635
|
* @param path to the objects to evaluate for potantial name clashes
|
|
636
|
-
* @
|
|
636
|
+
* @returns string The unique title to use
|
|
637
637
|
*/
|
|
638
638
|
export function getUniqueTitle(title, templateDictionary, path) {
|
|
639
639
|
title = title ? title.trim() : "_";
|
|
@@ -655,7 +655,7 @@ export function getUniqueTitle(title, templateDictionary, path) {
|
|
|
655
655
|
* @param obj Object to scan and to modify
|
|
656
656
|
* @param pattern Search pattern in each string
|
|
657
657
|
* @param replacement Replacement for matches to search pattern
|
|
658
|
-
* @
|
|
658
|
+
* @returns Modified obj is returned
|
|
659
659
|
*/
|
|
660
660
|
export function globalStringReplace(obj, pattern, replacement) {
|
|
661
661
|
if (obj) {
|
|
@@ -680,7 +680,7 @@ export function globalStringReplace(obj, pattern, replacement) {
|
|
|
680
680
|
* @param datasourceInfos Array of DatasourceInfos to evaluate
|
|
681
681
|
* @param itemId The items id to check for
|
|
682
682
|
* @param layerId The layers id to check for
|
|
683
|
-
* @
|
|
683
|
+
* @returns Boolean indicating result
|
|
684
684
|
*/
|
|
685
685
|
export function hasDatasource(datasourceInfos, itemId, layerId) {
|
|
686
686
|
return datasourceInfos.some(ds => ds.itemId === itemId && ds.layerId === layerId);
|
|
@@ -725,7 +725,7 @@ export function cleanLayerId(id) {
|
|
|
725
725
|
* @param templates Array of item templates to search
|
|
726
726
|
* @param id of template we are searching for
|
|
727
727
|
*
|
|
728
|
-
* @
|
|
728
|
+
* @returns Template associated with the user provided id argument
|
|
729
729
|
*/
|
|
730
730
|
export function getTemplateById(templates, id) {
|
|
731
731
|
let template;
|
|
@@ -743,7 +743,7 @@ export function getTemplateById(templates, id) {
|
|
|
743
743
|
*
|
|
744
744
|
* @param v a string value to test with the expression
|
|
745
745
|
* @param ex the regular expresion to test with
|
|
746
|
-
* @
|
|
746
|
+
* @returns an array of matches
|
|
747
747
|
*/
|
|
748
748
|
export function regExTest(v, ex) {
|
|
749
749
|
return v && ex.test(v) ? v.match(ex) : [];
|
|
@@ -754,7 +754,7 @@ export function regExTest(v, ex) {
|
|
|
754
754
|
*
|
|
755
755
|
* @param min Inclusive minimum desired value
|
|
756
756
|
* @param max Non-inclusive maximum desired value
|
|
757
|
-
* @
|
|
757
|
+
* @returns Random number in the range [min, max)
|
|
758
758
|
*/
|
|
759
759
|
export function _getRandomNumberInRange(min, max) {
|
|
760
760
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Getting_a_random_number_between_two_values
|
|
@@ -767,8 +767,8 @@ export function _getRandomNumberInRange(min, max) {
|
|
|
767
767
|
*
|
|
768
768
|
* @param n Number to pad
|
|
769
769
|
* @param totalSize Desired *minimum* width of number after padding with zeroes
|
|
770
|
-
* @
|
|
771
|
-
* @
|
|
770
|
+
* @returns Number converted to string and padded on the left as needed
|
|
771
|
+
* @private
|
|
772
772
|
*/
|
|
773
773
|
export function _padPositiveNum(n, totalSize) {
|
|
774
774
|
let numStr = n.toString();
|
|
@@ -782,9 +782,9 @@ export function _padPositiveNum(n, totalSize) {
|
|
|
782
782
|
* Implements rejected ECMA proposal to change `typeof null` from "object" to "null".
|
|
783
783
|
*
|
|
784
784
|
* @param value Value whose type is sought
|
|
785
|
-
* @
|
|
785
|
+
* @returns "null" if `value` is null; `typeof value` otherwise
|
|
786
786
|
* @see https://web.archive.org/web/20160331031419/http://wiki.ecmascript.org:80/doku.php?id=harmony:typeof_null
|
|
787
|
-
* @
|
|
787
|
+
* @private
|
|
788
788
|
*/
|
|
789
789
|
function _typeof_null(value) {
|
|
790
790
|
return value === null ? "null" : typeof value;
|
|
@@ -24,6 +24,6 @@ import { ISolutionPrecis, UserSession } from "./interfaces";
|
|
|
24
24
|
*
|
|
25
25
|
* @param solutionItemId Id of a deployed Solution
|
|
26
26
|
* @param authentication Credentials for the request
|
|
27
|
-
* @
|
|
27
|
+
* @returns Promise resolving to the list of items in the solution that would be deleted.
|
|
28
28
|
*/
|
|
29
29
|
export declare function getDeletableSolutionInfo(solutionItemId: string, authentication: UserSession): Promise<ISolutionPrecis>;
|
|
@@ -23,7 +23,7 @@ import * as restHelpersGet from "./restHelpersGet";
|
|
|
23
23
|
*
|
|
24
24
|
* @param solutionItemId Id of a deployed Solution
|
|
25
25
|
* @param authentication Credentials for the request
|
|
26
|
-
* @
|
|
26
|
+
* @returns Promise resolving to the list of items in the solution that would be deleted.
|
|
27
27
|
*/
|
|
28
28
|
export function getDeletableSolutionInfo(solutionItemId, authentication) {
|
|
29
29
|
let solutionSummary;
|
|
@@ -22,6 +22,6 @@ import { ISolutionPrecis, UserSession } from "./interfaces";
|
|
|
22
22
|
*
|
|
23
23
|
* @param solutionItemId Id of a deployed Solution
|
|
24
24
|
* @param authentication Credentials for the request
|
|
25
|
-
* @
|
|
25
|
+
* @returns Promise resolving to a summary of the deployed Solution
|
|
26
26
|
*/
|
|
27
27
|
export declare function getSolutionSummary(solutionItemId: string, authentication: UserSession): Promise<ISolutionPrecis>;
|
|
@@ -26,7 +26,7 @@ import * as templatization from "./templatization";
|
|
|
26
26
|
*
|
|
27
27
|
* @param solutionItemId Id of a deployed Solution
|
|
28
28
|
* @param authentication Credentials for the request
|
|
29
|
-
* @
|
|
29
|
+
* @returns Promise resolving to a summary of the deployed Solution
|
|
30
30
|
*/
|
|
31
31
|
export function getSolutionSummary(solutionItemId, authentication) {
|
|
32
32
|
const solutionSummary = {
|