@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
|
@@ -30,7 +30,7 @@ const polyfills_1 = require("./polyfills");
|
|
|
30
30
|
*
|
|
31
31
|
* @param url URL to append to
|
|
32
32
|
* @param parameter Query parameter to append, prefixed with "?" or "&" as appropriate to what url already has
|
|
33
|
-
* @
|
|
33
|
+
* @returns New URL combining url and parameter
|
|
34
34
|
*/
|
|
35
35
|
function appendQueryParam(url, parameter) {
|
|
36
36
|
return url + (url.indexOf("?") === -1 ? "?" : "&") + parameter;
|
|
@@ -40,7 +40,7 @@ exports.appendQueryParam = appendQueryParam;
|
|
|
40
40
|
* Extracts JSON from a Blob.
|
|
41
41
|
*
|
|
42
42
|
* @param blob Blob to use as source
|
|
43
|
-
* @
|
|
43
|
+
* @returns A promise that will resolve with JSON or null
|
|
44
44
|
*/
|
|
45
45
|
function blobToJson(blob) {
|
|
46
46
|
return new Promise(resolve => {
|
|
@@ -61,7 +61,7 @@ exports.blobToJson = blobToJson;
|
|
|
61
61
|
* @param blob Blob to use as source
|
|
62
62
|
* @param filename Name to use for file
|
|
63
63
|
* @param mimeType MIME type to override blob's MIME type
|
|
64
|
-
* @
|
|
64
|
+
* @returns File created out of Blob and filename
|
|
65
65
|
*/
|
|
66
66
|
function blobToFile(blob, filename, mimeType) {
|
|
67
67
|
return blob
|
|
@@ -75,7 +75,7 @@ exports.blobToFile = blobToFile;
|
|
|
75
75
|
* Extracts text from a Blob.
|
|
76
76
|
*
|
|
77
77
|
* @param blob Blob to use as source
|
|
78
|
-
* @
|
|
78
|
+
* @returns A promise that will resolve with text read from blob
|
|
79
79
|
*/
|
|
80
80
|
function blobToText(blob) {
|
|
81
81
|
return new Promise(resolve => {
|
|
@@ -94,7 +94,7 @@ exports.blobToText = blobToText;
|
|
|
94
94
|
* Checks that a URL path ends with a slash.
|
|
95
95
|
*
|
|
96
96
|
* @param url URL to check
|
|
97
|
-
* @
|
|
97
|
+
* @returns URL, appended with slash if missing
|
|
98
98
|
*/
|
|
99
99
|
function checkUrlPathTermination(url) {
|
|
100
100
|
return url ? (url.endsWith("/") ? url : url + "/") : url;
|
|
@@ -103,7 +103,7 @@ exports.checkUrlPathTermination = checkUrlPathTermination;
|
|
|
103
103
|
/**
|
|
104
104
|
* Creates a random 32-character alphanumeric string.
|
|
105
105
|
*
|
|
106
|
-
* @
|
|
106
|
+
* @returns A lowercase 32-char alphanumeric string
|
|
107
107
|
* @internal
|
|
108
108
|
*/
|
|
109
109
|
function createLongId() {
|
|
@@ -114,7 +114,7 @@ exports.createLongId = createLongId;
|
|
|
114
114
|
/**
|
|
115
115
|
* Creates a random 8-character alphanumeric string that begins with an alphabetic character.
|
|
116
116
|
*
|
|
117
|
-
* @
|
|
117
|
+
* @returns An alphanumeric string in the range [a0000000..zzzzzzzz]
|
|
118
118
|
*/
|
|
119
119
|
function createShortId() {
|
|
120
120
|
// Return a random number, but beginning with an alphabetic character so that it can be used as a valid
|
|
@@ -146,7 +146,7 @@ exports.dedupe = dedupe;
|
|
|
146
146
|
*
|
|
147
147
|
* @param itemType The AGO item type
|
|
148
148
|
* @param id Item id to include in response
|
|
149
|
-
* @
|
|
149
|
+
* @returns Empty creation response
|
|
150
150
|
*/
|
|
151
151
|
function generateEmptyCreationResponse(itemType, id = "") {
|
|
152
152
|
return {
|
|
@@ -161,7 +161,7 @@ exports.generateEmptyCreationResponse = generateEmptyCreationResponse;
|
|
|
161
161
|
* Converts JSON to a Blob.
|
|
162
162
|
*
|
|
163
163
|
* @param json JSON to use as source
|
|
164
|
-
* @
|
|
164
|
+
* @returns A blob from the source JSON
|
|
165
165
|
*/
|
|
166
166
|
function jsonToBlob(json) {
|
|
167
167
|
const _json = JSON.stringify(json);
|
|
@@ -179,7 +179,7 @@ exports.jsonToBlob = jsonToBlob;
|
|
|
179
179
|
* @param json JSON to use as source
|
|
180
180
|
* @param filename Name to use for file
|
|
181
181
|
* @param mimeType MIME type to override blob's MIME type
|
|
182
|
-
* @
|
|
182
|
+
* @returns File created out of JSON and filename
|
|
183
183
|
*/
|
|
184
184
|
function jsonToFile(json, filename, mimeType = "application/json") {
|
|
185
185
|
return blobToFile(jsonToBlob(json), filename, mimeType);
|
|
@@ -190,7 +190,7 @@ exports.jsonToFile = jsonToFile;
|
|
|
190
190
|
*
|
|
191
191
|
* @param filename Name to give file
|
|
192
192
|
* @param blob Blob to save
|
|
193
|
-
* @
|
|
193
|
+
* @returns Promise resolving when operation is complete
|
|
194
194
|
*/
|
|
195
195
|
// Function is only used for live testing, so excluding it from coverage for now
|
|
196
196
|
/* istanbul ignore next */
|
|
@@ -215,7 +215,7 @@ exports.saveBlobAsFile = saveBlobAsFile;
|
|
|
215
215
|
* Makes a deep clone, including arrays but not functions.
|
|
216
216
|
*
|
|
217
217
|
* @param obj Object to be cloned
|
|
218
|
-
* @
|
|
218
|
+
* @returns Clone of obj
|
|
219
219
|
* @example
|
|
220
220
|
* ```js
|
|
221
221
|
* import { cloneObject } from "utils/object-helpers";
|
|
@@ -258,7 +258,7 @@ exports.cloneObject = cloneObject;
|
|
|
258
258
|
*
|
|
259
259
|
* @param json1 First object
|
|
260
260
|
* @param json2 Second object
|
|
261
|
-
* @
|
|
261
|
+
* @returns True if objects are the same
|
|
262
262
|
*/
|
|
263
263
|
function compareJSON(json1, json2) {
|
|
264
264
|
return JSON.stringify(json1) === JSON.stringify(json2);
|
|
@@ -269,7 +269,7 @@ exports.compareJSON = compareJSON;
|
|
|
269
269
|
*
|
|
270
270
|
* @param json1 First object
|
|
271
271
|
* @param json2 Second object
|
|
272
|
-
* @
|
|
272
|
+
* @returns True if objects are the same
|
|
273
273
|
*/
|
|
274
274
|
function compareJSONNoEmptyStrings(json1, json2) {
|
|
275
275
|
const jsonStr1 = JSON.stringify(json1).replace(/":""/g, '":null');
|
|
@@ -282,7 +282,7 @@ exports.compareJSONNoEmptyStrings = compareJSONNoEmptyStrings;
|
|
|
282
282
|
*
|
|
283
283
|
* @param json1 First object
|
|
284
284
|
* @param json2 Second object
|
|
285
|
-
* @
|
|
285
|
+
* @returns A list of mismatch report strings
|
|
286
286
|
*/
|
|
287
287
|
function compareJSONProperties(json1, json2) {
|
|
288
288
|
let mismatches = [];
|
|
@@ -347,7 +347,7 @@ exports.compareJSONProperties = compareJSONProperties;
|
|
|
347
347
|
*
|
|
348
348
|
* @param json JSON to sanitize
|
|
349
349
|
* @param sanitizer Instance of Sanitizer class
|
|
350
|
-
* @
|
|
350
|
+
* @returns Sanitized version of `json`
|
|
351
351
|
* @see https://github.com/esri/arcgis-html-sanitizer#sanitize-json
|
|
352
352
|
*/
|
|
353
353
|
function sanitizeJSONAndReportChanges(json, sanitizer) {
|
|
@@ -436,7 +436,7 @@ exports.deleteProps = deleteProps;
|
|
|
436
436
|
* Creates an AGO-style JSON failure response with success property.
|
|
437
437
|
*
|
|
438
438
|
* @param e Optional error information
|
|
439
|
-
* @
|
|
439
|
+
* @returns JSON structure with property success set to false and optionally including `e`
|
|
440
440
|
*/
|
|
441
441
|
function fail(e) {
|
|
442
442
|
if (e) {
|
|
@@ -452,7 +452,7 @@ exports.fail = fail;
|
|
|
452
452
|
*
|
|
453
453
|
* @param ids List of ids
|
|
454
454
|
* @param e Optional error information
|
|
455
|
-
* @
|
|
455
|
+
* @returns JSON structure with property success set to false and optionally including `e`
|
|
456
456
|
*/
|
|
457
457
|
function failWithIds(itemIds, e) {
|
|
458
458
|
if (e) {
|
|
@@ -467,7 +467,7 @@ exports.failWithIds = failWithIds;
|
|
|
467
467
|
* Extracts the ids from a string
|
|
468
468
|
*
|
|
469
469
|
* @param v String to examine
|
|
470
|
-
* @
|
|
470
|
+
* @returns List of id strings found
|
|
471
471
|
* @example
|
|
472
472
|
* get id from
|
|
473
473
|
* bad3483e025c47338d43df308c117308
|
|
@@ -498,7 +498,7 @@ exports.getIDs = getIDs;
|
|
|
498
498
|
* @param obj Object to retrieve value from
|
|
499
499
|
* @param path Path into an object, e.g., "data.values.webmap", where "data" is a top-level property
|
|
500
500
|
* in obj
|
|
501
|
-
* @
|
|
501
|
+
* @returns Value at end of path
|
|
502
502
|
*/
|
|
503
503
|
function getProp(obj, path) {
|
|
504
504
|
return path.split(".").reduce(function (prev, curr) {
|
|
@@ -512,7 +512,7 @@ exports.getProp = getProp;
|
|
|
512
512
|
*
|
|
513
513
|
* @param obj Object to retrieve values from
|
|
514
514
|
* @param props Array of paths into the object e.g., "data.values.webmap", where "data" is a top-level property
|
|
515
|
-
* @
|
|
515
|
+
* @returns Array of the values plucked from the object; only defined values are returned
|
|
516
516
|
*/
|
|
517
517
|
function getProps(obj, props) {
|
|
518
518
|
return props.reduce((a, p) => {
|
|
@@ -532,7 +532,7 @@ exports.getProps = getProps;
|
|
|
532
532
|
* @param path Path into an object, e.g., "data.values.webmap", where "data" is a top-level property
|
|
533
533
|
* in obj
|
|
534
534
|
* @param defaultV Optional value to use if any part of path--including final value--is undefined
|
|
535
|
-
* @
|
|
535
|
+
* @returns Value at end of path
|
|
536
536
|
*/
|
|
537
537
|
function getPropWithDefault(obj, path, defaultV) {
|
|
538
538
|
const value = path.split(".").reduce(function (prev, curr) {
|
|
@@ -614,9 +614,9 @@ exports.setProp = setProp;
|
|
|
614
614
|
/**
|
|
615
615
|
* Creates a timestamp string using the current UTC date and time.
|
|
616
616
|
*
|
|
617
|
-
* @
|
|
617
|
+
* @returns Timestamp formatted as YYYYMMDD_hhmm_ssmmm, with month one-based and all values padded with zeroes on the
|
|
618
618
|
* left as needed (`ssmmm` stands for seconds from 0..59 and milliseconds from 0..999)
|
|
619
|
-
* @
|
|
619
|
+
* @private
|
|
620
620
|
*/
|
|
621
621
|
function getUTCTimestamp() {
|
|
622
622
|
const now = new Date();
|
|
@@ -636,7 +636,7 @@ exports.getUTCTimestamp = getUTCTimestamp;
|
|
|
636
636
|
*
|
|
637
637
|
* @param jsonObj Object to test
|
|
638
638
|
* @param keywords List of keywords to look for in jsonObj
|
|
639
|
-
* @
|
|
639
|
+
* @returns Boolean indicating result
|
|
640
640
|
*/
|
|
641
641
|
function hasAnyKeyword(jsonObj, keywords) {
|
|
642
642
|
const typeKeywords = getProp(jsonObj, "item.typeKeywords") || jsonObj.typeKeywords || [];
|
|
@@ -653,7 +653,7 @@ exports.hasAnyKeyword = hasAnyKeyword;
|
|
|
653
653
|
*
|
|
654
654
|
* @param jsonObj Object to test
|
|
655
655
|
* @param keyword Keyword to look for in jsonObj
|
|
656
|
-
* @
|
|
656
|
+
* @returns Boolean indicating result
|
|
657
657
|
*/
|
|
658
658
|
function hasTypeKeyword(jsonObj, keyword) {
|
|
659
659
|
const typeKeywords = getProp(jsonObj, "item.typeKeywords") || jsonObj.typeKeywords || [];
|
|
@@ -668,7 +668,7 @@ exports.hasTypeKeyword = hasTypeKeyword;
|
|
|
668
668
|
* @param title The root title to test
|
|
669
669
|
* @param templateDictionary Hash of the facts
|
|
670
670
|
* @param path to the objects to evaluate for potantial name clashes
|
|
671
|
-
* @
|
|
671
|
+
* @returns string The unique title to use
|
|
672
672
|
*/
|
|
673
673
|
function getUniqueTitle(title, templateDictionary, path) {
|
|
674
674
|
title = title ? title.trim() : "_";
|
|
@@ -691,7 +691,7 @@ exports.getUniqueTitle = getUniqueTitle;
|
|
|
691
691
|
* @param obj Object to scan and to modify
|
|
692
692
|
* @param pattern Search pattern in each string
|
|
693
693
|
* @param replacement Replacement for matches to search pattern
|
|
694
|
-
* @
|
|
694
|
+
* @returns Modified obj is returned
|
|
695
695
|
*/
|
|
696
696
|
function globalStringReplace(obj, pattern, replacement) {
|
|
697
697
|
if (obj) {
|
|
@@ -717,7 +717,7 @@ exports.globalStringReplace = globalStringReplace;
|
|
|
717
717
|
* @param datasourceInfos Array of DatasourceInfos to evaluate
|
|
718
718
|
* @param itemId The items id to check for
|
|
719
719
|
* @param layerId The layers id to check for
|
|
720
|
-
* @
|
|
720
|
+
* @returns Boolean indicating result
|
|
721
721
|
*/
|
|
722
722
|
function hasDatasource(datasourceInfos, itemId, layerId) {
|
|
723
723
|
return datasourceInfos.some(ds => ds.itemId === itemId && ds.layerId === layerId);
|
|
@@ -766,7 +766,7 @@ exports.cleanLayerId = cleanLayerId;
|
|
|
766
766
|
* @param templates Array of item templates to search
|
|
767
767
|
* @param id of template we are searching for
|
|
768
768
|
*
|
|
769
|
-
* @
|
|
769
|
+
* @returns Template associated with the user provided id argument
|
|
770
770
|
*/
|
|
771
771
|
function getTemplateById(templates, id) {
|
|
772
772
|
let template;
|
|
@@ -785,7 +785,7 @@ exports.getTemplateById = getTemplateById;
|
|
|
785
785
|
*
|
|
786
786
|
* @param v a string value to test with the expression
|
|
787
787
|
* @param ex the regular expresion to test with
|
|
788
|
-
* @
|
|
788
|
+
* @returns an array of matches
|
|
789
789
|
*/
|
|
790
790
|
function regExTest(v, ex) {
|
|
791
791
|
return v && ex.test(v) ? v.match(ex) : [];
|
|
@@ -797,7 +797,7 @@ exports.regExTest = regExTest;
|
|
|
797
797
|
*
|
|
798
798
|
* @param min Inclusive minimum desired value
|
|
799
799
|
* @param max Non-inclusive maximum desired value
|
|
800
|
-
* @
|
|
800
|
+
* @returns Random number in the range [min, max)
|
|
801
801
|
*/
|
|
802
802
|
function _getRandomNumberInRange(min, max) {
|
|
803
803
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random#Getting_a_random_number_between_two_values
|
|
@@ -811,8 +811,8 @@ exports._getRandomNumberInRange = _getRandomNumberInRange;
|
|
|
811
811
|
*
|
|
812
812
|
* @param n Number to pad
|
|
813
813
|
* @param totalSize Desired *minimum* width of number after padding with zeroes
|
|
814
|
-
* @
|
|
815
|
-
* @
|
|
814
|
+
* @returns Number converted to string and padded on the left as needed
|
|
815
|
+
* @private
|
|
816
816
|
*/
|
|
817
817
|
function _padPositiveNum(n, totalSize) {
|
|
818
818
|
let numStr = n.toString();
|
|
@@ -827,9 +827,9 @@ exports._padPositiveNum = _padPositiveNum;
|
|
|
827
827
|
* Implements rejected ECMA proposal to change `typeof null` from "object" to "null".
|
|
828
828
|
*
|
|
829
829
|
* @param value Value whose type is sought
|
|
830
|
-
* @
|
|
830
|
+
* @returns "null" if `value` is null; `typeof value` otherwise
|
|
831
831
|
* @see https://web.archive.org/web/20160331031419/http://wiki.ecmascript.org:80/doku.php?id=harmony:typeof_null
|
|
832
|
-
* @
|
|
832
|
+
* @private
|
|
833
833
|
*/
|
|
834
834
|
function _typeof_null(value) {
|
|
835
835
|
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>;
|
|
@@ -27,7 +27,7 @@ const restHelpersGet = tslib_1.__importStar(require("./restHelpersGet"));
|
|
|
27
27
|
*
|
|
28
28
|
* @param solutionItemId Id of a deployed Solution
|
|
29
29
|
* @param authentication Credentials for the request
|
|
30
|
-
* @
|
|
30
|
+
* @returns Promise resolving to the list of items in the solution that would be deleted.
|
|
31
31
|
*/
|
|
32
32
|
function getDeletableSolutionInfo(solutionItemId, authentication) {
|
|
33
33
|
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>;
|
|
@@ -30,7 +30,7 @@ const templatization = tslib_1.__importStar(require("./templatization"));
|
|
|
30
30
|
*
|
|
31
31
|
* @param solutionItemId Id of a deployed Solution
|
|
32
32
|
* @param authentication Credentials for the request
|
|
33
|
-
* @
|
|
33
|
+
* @returns Promise resolving to a summary of the deployed Solution
|
|
34
34
|
*/
|
|
35
35
|
function getSolutionSummary(solutionItemId, authentication) {
|
|
36
36
|
const solutionSummary = {
|