@esri/solution-common 6.1.3 → 6.1.5
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/cjs/arcgisRestJS.d.ts +63 -0
- package/dist/cjs/arcgisRestJS.js +158 -0
- package/dist/cjs/arcgisRestJS.js.map +1 -0
- package/dist/cjs/completeItem.d.ts +30 -0
- package/dist/cjs/completeItem.js +72 -0
- package/dist/cjs/completeItem.js.map +1 -0
- package/dist/cjs/create-hub-request-options.d.ts +29 -0
- package/dist/cjs/create-hub-request-options.js +64 -0
- package/dist/cjs/create-hub-request-options.js.map +1 -0
- package/dist/cjs/deleteHelpers/deleteEmptyGroups.d.ts +24 -0
- package/dist/cjs/deleteHelpers/deleteEmptyGroups.js +42 -0
- package/dist/cjs/deleteHelpers/deleteEmptyGroups.js.map +1 -0
- package/dist/cjs/deleteHelpers/deleteGroupIfEmpty.d.ts +27 -0
- package/dist/cjs/deleteHelpers/deleteGroupIfEmpty.js +99 -0
- package/dist/cjs/deleteHelpers/deleteGroupIfEmpty.js.map +1 -0
- package/dist/cjs/deleteHelpers/deleteSolutionContents.d.ts +39 -0
- package/dist/cjs/deleteHelpers/deleteSolutionContents.js +127 -0
- package/dist/cjs/deleteHelpers/deleteSolutionContents.js.map +1 -0
- package/dist/cjs/deleteHelpers/deleteSolutionFolder.d.ts +29 -0
- package/dist/cjs/deleteHelpers/deleteSolutionFolder.js +81 -0
- package/dist/cjs/deleteHelpers/deleteSolutionFolder.js.map +1 -0
- package/dist/cjs/deleteHelpers/deleteSolutionItem.d.ts +31 -0
- package/dist/cjs/deleteHelpers/deleteSolutionItem.js +52 -0
- package/dist/cjs/deleteHelpers/deleteSolutionItem.js.map +1 -0
- package/dist/cjs/deleteHelpers/index.d.ts +22 -0
- package/dist/cjs/deleteHelpers/index.js +26 -0
- package/dist/cjs/deleteHelpers/index.js.map +1 -0
- package/dist/cjs/deleteHelpers/reconstructBuildOrderIds.d.ts +27 -0
- package/dist/cjs/deleteHelpers/reconstructBuildOrderIds.js +34 -0
- package/dist/cjs/deleteHelpers/reconstructBuildOrderIds.js.map +1 -0
- package/dist/cjs/deleteHelpers/removeItems.d.ts +35 -0
- package/dist/cjs/deleteHelpers/removeItems.js +116 -0
- package/dist/cjs/deleteHelpers/removeItems.js.map +1 -0
- package/dist/cjs/deleteHelpers/reportProgress.d.ts +27 -0
- package/dist/cjs/deleteHelpers/reportProgress.js +46 -0
- package/dist/cjs/deleteHelpers/reportProgress.js.map +1 -0
- package/dist/cjs/deleteSolution.d.ts +56 -0
- package/dist/cjs/deleteSolution.js +107 -0
- package/dist/cjs/deleteSolution.js.map +1 -0
- package/dist/cjs/dependencies.d.ts +26 -0
- package/dist/cjs/dependencies.js +171 -0
- package/dist/cjs/dependencies.js.map +1 -0
- package/dist/cjs/featureServiceHelpers.d.ts +847 -0
- package/dist/cjs/featureServiceHelpers.js +2553 -0
- package/dist/cjs/featureServiceHelpers.js.map +1 -0
- package/dist/cjs/formHelpers.d.ts +26 -0
- package/dist/cjs/formHelpers.js +40 -0
- package/dist/cjs/formHelpers.js.map +1 -0
- package/dist/cjs/generalHelpers.d.ts +447 -0
- package/dist/cjs/generalHelpers.js +959 -0
- package/dist/cjs/generalHelpers.js.map +1 -0
- package/dist/cjs/get-subscription-info.d.ts +27 -0
- package/dist/cjs/get-subscription-info.js +38 -0
- package/dist/cjs/get-subscription-info.js.map +1 -0
- package/dist/cjs/getDeletableSolutionInfo.d.ts +30 -0
- package/dist/cjs/getDeletableSolutionInfo.js +53 -0
- package/dist/cjs/getDeletableSolutionInfo.js.map +1 -0
- package/dist/cjs/getItemTypeAbbrev.d.ts +19 -0
- package/dist/cjs/getItemTypeAbbrev.js +186 -0
- package/dist/cjs/getItemTypeAbbrev.js.map +1 -0
- package/dist/cjs/getSolutionSummary.d.ts +28 -0
- package/dist/cjs/getSolutionSummary.js +100 -0
- package/dist/cjs/getSolutionSummary.js.map +1 -0
- package/dist/cjs/index.d.ts +49 -0
- package/dist/cjs/index.js +53 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/interfaces.d.ts +1446 -0
- package/dist/cjs/interfaces.js +72 -0
- package/dist/cjs/interfaces.js.map +1 -0
- package/dist/cjs/item-reuse.d.ts +140 -0
- package/dist/cjs/item-reuse.js +176 -0
- package/dist/cjs/item-reuse.js.map +1 -0
- package/dist/cjs/libConnectors.d.ts +73 -0
- package/dist/cjs/libConnectors.js +115 -0
- package/dist/cjs/libConnectors.js.map +1 -0
- package/dist/cjs/migrations/apply-schema.d.ts +24 -0
- package/dist/cjs/migrations/apply-schema.js +36 -0
- package/dist/cjs/migrations/apply-schema.js.map +1 -0
- package/dist/cjs/migrations/is-legacy-solution.d.ts +24 -0
- package/dist/cjs/migrations/is-legacy-solution.js +39 -0
- package/dist/cjs/migrations/is-legacy-solution.js.map +1 -0
- package/dist/cjs/migrations/upgrade-three-dot-one.d.ts +26 -0
- package/dist/cjs/migrations/upgrade-three-dot-one.js +48 -0
- package/dist/cjs/migrations/upgrade-three-dot-one.js.map +1 -0
- package/dist/cjs/migrations/upgrade-three-dot-zero.d.ts +27 -0
- package/dist/cjs/migrations/upgrade-three-dot-zero.js +43 -0
- package/dist/cjs/migrations/upgrade-three-dot-zero.js.map +1 -0
- package/dist/cjs/migrations/upgrade-two-dot-five.d.ts +24 -0
- package/dist/cjs/migrations/upgrade-two-dot-five.js +73 -0
- package/dist/cjs/migrations/upgrade-two-dot-five.js.map +1 -0
- package/dist/cjs/migrations/upgrade-two-dot-four.d.ts +24 -0
- package/dist/cjs/migrations/upgrade-two-dot-four.js +72 -0
- package/dist/cjs/migrations/upgrade-two-dot-four.js.map +1 -0
- package/dist/cjs/migrations/upgrade-two-dot-one.d.ts +7 -0
- package/dist/cjs/migrations/upgrade-two-dot-one.js +39 -0
- package/dist/cjs/migrations/upgrade-two-dot-one.js.map +1 -0
- package/dist/cjs/migrations/upgrade-two-dot-seven.d.ts +23 -0
- package/dist/cjs/migrations/upgrade-two-dot-seven.js +58 -0
- package/dist/cjs/migrations/upgrade-two-dot-seven.js.map +1 -0
- package/dist/cjs/migrations/upgrade-two-dot-six.d.ts +27 -0
- package/dist/cjs/migrations/upgrade-two-dot-six.js +61 -0
- package/dist/cjs/migrations/upgrade-two-dot-six.js.map +1 -0
- package/dist/cjs/migrations/upgrade-two-dot-three.d.ts +23 -0
- package/dist/cjs/migrations/upgrade-two-dot-three.js +55 -0
- package/dist/cjs/migrations/upgrade-two-dot-three.js.map +1 -0
- package/dist/cjs/migrations/upgrade-two-dot-two.d.ts +23 -0
- package/dist/cjs/migrations/upgrade-two-dot-two.js +58 -0
- package/dist/cjs/migrations/upgrade-two-dot-two.js.map +1 -0
- package/dist/cjs/migrations/upgrade-two-dot-zero.d.ts +44 -0
- package/dist/cjs/migrations/upgrade-two-dot-zero.js +95 -0
- package/dist/cjs/migrations/upgrade-two-dot-zero.js.map +1 -0
- package/dist/cjs/migrator.d.ts +25 -0
- package/dist/cjs/migrator.js +75 -0
- package/dist/cjs/migrator.js.map +1 -0
- package/dist/cjs/resourceHelpers.d.ts +192 -0
- package/dist/cjs/resourceHelpers.js +380 -0
- package/dist/cjs/resourceHelpers.js.map +1 -0
- package/dist/cjs/resources/add-resource.d.ts +38 -0
- package/dist/cjs/resources/add-resource.js +84 -0
- package/dist/cjs/resources/add-resource.js.map +1 -0
- package/dist/cjs/resources/addMetadataFromBlob.d.ts +25 -0
- package/dist/cjs/resources/addMetadataFromBlob.js +43 -0
- package/dist/cjs/resources/addMetadataFromBlob.js.map +1 -0
- package/dist/cjs/resources/convert-item-resource-to-storage-resource.d.ts +32 -0
- package/dist/cjs/resources/convert-item-resource-to-storage-resource.js +70 -0
- package/dist/cjs/resources/convert-item-resource-to-storage-resource.js.map +1 -0
- package/dist/cjs/resources/convert-storage-resource-to-item-resource.d.ts +29 -0
- package/dist/cjs/resources/convert-storage-resource-to-item-resource.js +70 -0
- package/dist/cjs/resources/convert-storage-resource-to-item-resource.js.map +1 -0
- package/dist/cjs/resources/copyAssociatedFiles.d.ts +79 -0
- package/dist/cjs/resources/copyAssociatedFiles.js +348 -0
- package/dist/cjs/resources/copyAssociatedFiles.js.map +1 -0
- package/dist/cjs/resources/copyDataIntoItem.d.ts +34 -0
- package/dist/cjs/resources/copyDataIntoItem.js +45 -0
- package/dist/cjs/resources/copyDataIntoItem.js.map +1 -0
- package/dist/cjs/resources/copyMetadataIntoItem.d.ts +27 -0
- package/dist/cjs/resources/copyMetadataIntoItem.js +44 -0
- package/dist/cjs/resources/copyMetadataIntoItem.js.map +1 -0
- package/dist/cjs/resources/copyResourceIntoZip.d.ts +34 -0
- package/dist/cjs/resources/copyResourceIntoZip.js +74 -0
- package/dist/cjs/resources/copyResourceIntoZip.js.map +1 -0
- package/dist/cjs/resources/copyZipIntoItem.d.ts +26 -0
- package/dist/cjs/resources/copyZipIntoItem.js +53 -0
- package/dist/cjs/resources/copyZipIntoItem.js.map +1 -0
- package/dist/cjs/resources/createCopyResults.d.ts +25 -0
- package/dist/cjs/resources/createCopyResults.js +36 -0
- package/dist/cjs/resources/createCopyResults.js.map +1 -0
- package/dist/cjs/resources/get-blob.d.ts +25 -0
- package/dist/cjs/resources/get-blob.js +42 -0
- package/dist/cjs/resources/get-blob.js.map +1 -0
- package/dist/cjs/resources/getItemResourcesFilesFromPaths.d.ts +25 -0
- package/dist/cjs/resources/getItemResourcesFilesFromPaths.js +49 -0
- package/dist/cjs/resources/getItemResourcesFilesFromPaths.js.map +1 -0
- package/dist/cjs/resources/getItemResourcesPaths.d.ts +27 -0
- package/dist/cjs/resources/getItemResourcesPaths.js +80 -0
- package/dist/cjs/resources/getItemResourcesPaths.js.map +1 -0
- package/dist/cjs/resources/index.d.ts +30 -0
- package/dist/cjs/resources/index.js +34 -0
- package/dist/cjs/resources/index.js.map +1 -0
- package/dist/cjs/resources/solution-resource.d.ts +35 -0
- package/dist/cjs/resources/solution-resource.js +31 -0
- package/dist/cjs/resources/solution-resource.js.map +1 -0
- package/dist/cjs/resources/transform-resource-paths-to-solution-resources.d.ts +56 -0
- package/dist/cjs/resources/transform-resource-paths-to-solution-resources.js +140 -0
- package/dist/cjs/resources/transform-resource-paths-to-solution-resources.js.map +1 -0
- package/dist/cjs/resources/update-resource.d.ts +27 -0
- package/dist/cjs/resources/update-resource.js +52 -0
- package/dist/cjs/resources/update-resource.js.map +1 -0
- package/dist/cjs/restHelpers.d.ts +634 -0
- package/dist/cjs/restHelpers.js +2008 -0
- package/dist/cjs/restHelpers.js.map +1 -0
- package/dist/cjs/restHelpersGet.d.ts +303 -0
- package/dist/cjs/restHelpersGet.js +835 -0
- package/dist/cjs/restHelpersGet.js.map +1 -0
- package/dist/cjs/sharing/index.d.ts +16 -0
- package/dist/cjs/sharing/index.js +20 -0
- package/dist/cjs/sharing/index.js.map +1 -0
- package/dist/cjs/sharing/share-item-to-groups.d.ts +26 -0
- package/dist/cjs/sharing/share-item-to-groups.js +44 -0
- package/dist/cjs/sharing/share-item-to-groups.js.map +1 -0
- package/dist/cjs/templatization.d.ts +139 -0
- package/dist/cjs/templatization.js +311 -0
- package/dist/cjs/templatization.js.map +1 -0
- package/dist/cjs/trackingHelpers.d.ts +115 -0
- package/dist/cjs/trackingHelpers.js +212 -0
- package/dist/cjs/trackingHelpers.js.map +1 -0
- package/dist/cjs/velocityHelpers.d.ts +68 -0
- package/dist/cjs/velocityHelpers.js +151 -0
- package/dist/cjs/velocityHelpers.js.map +1 -0
- package/dist/cjs/webtoolHelpers.d.ts +57 -0
- package/dist/cjs/webtoolHelpers.js +102 -0
- package/dist/cjs/webtoolHelpers.js.map +1 -0
- package/dist/cjs/workflowHelpers.d.ts +112 -0
- package/dist/cjs/workflowHelpers.js +284 -0
- package/dist/cjs/workflowHelpers.js.map +1 -0
- package/dist/cjs/workforceHelpers.d.ts +121 -0
- package/dist/cjs/workforceHelpers.js +720 -0
- package/dist/cjs/workforceHelpers.js.map +1 -0
- package/dist/cjs/zip-utils.d.ts +85 -0
- package/dist/cjs/zip-utils.js +154 -0
- package/dist/cjs/zip-utils.js.map +1 -0
- package/dist/esm/arcgisRestJS.d.ts +63 -0
- package/dist/esm/arcgisRestJS.js +110 -0
- package/dist/esm/arcgisRestJS.js.map +1 -0
- package/dist/esm/completeItem.d.ts +30 -0
- package/dist/esm/completeItem.js +67 -0
- package/dist/esm/completeItem.js.map +1 -0
- package/dist/esm/create-hub-request-options.d.ts +29 -0
- package/dist/esm/create-hub-request-options.js +60 -0
- package/dist/esm/create-hub-request-options.js.map +1 -0
- package/dist/esm/deleteHelpers/deleteEmptyGroups.d.ts +24 -0
- package/dist/esm/deleteHelpers/deleteEmptyGroups.js +38 -0
- package/dist/esm/deleteHelpers/deleteEmptyGroups.js.map +1 -0
- package/dist/esm/deleteHelpers/deleteGroupIfEmpty.d.ts +27 -0
- package/dist/esm/deleteHelpers/deleteGroupIfEmpty.js +95 -0
- package/dist/esm/deleteHelpers/deleteGroupIfEmpty.js.map +1 -0
- package/dist/esm/deleteHelpers/deleteSolutionContents.d.ts +39 -0
- package/dist/esm/deleteHelpers/deleteSolutionContents.js +122 -0
- package/dist/esm/deleteHelpers/deleteSolutionContents.js.map +1 -0
- package/dist/esm/deleteHelpers/deleteSolutionFolder.d.ts +29 -0
- package/dist/esm/deleteHelpers/deleteSolutionFolder.js +77 -0
- package/dist/esm/deleteHelpers/deleteSolutionFolder.js.map +1 -0
- package/dist/esm/deleteHelpers/deleteSolutionItem.d.ts +31 -0
- package/dist/esm/deleteHelpers/deleteSolutionItem.js +48 -0
- package/dist/esm/deleteHelpers/deleteSolutionItem.js.map +1 -0
- package/dist/esm/deleteHelpers/index.d.ts +22 -0
- package/dist/esm/deleteHelpers/index.js +23 -0
- package/dist/esm/deleteHelpers/index.js.map +1 -0
- package/dist/esm/deleteHelpers/reconstructBuildOrderIds.d.ts +27 -0
- package/dist/esm/deleteHelpers/reconstructBuildOrderIds.js +29 -0
- package/dist/esm/deleteHelpers/reconstructBuildOrderIds.js.map +1 -0
- package/dist/esm/deleteHelpers/removeItems.d.ts +35 -0
- package/dist/esm/deleteHelpers/removeItems.js +111 -0
- package/dist/esm/deleteHelpers/removeItems.js.map +1 -0
- package/dist/esm/deleteHelpers/reportProgress.d.ts +27 -0
- package/dist/esm/deleteHelpers/reportProgress.js +42 -0
- package/dist/esm/deleteHelpers/reportProgress.js.map +1 -0
- package/dist/esm/deleteSolution.d.ts +56 -0
- package/dist/esm/deleteSolution.js +101 -0
- package/dist/esm/deleteSolution.js.map +1 -0
- package/dist/esm/dependencies.d.ts +26 -0
- package/dist/esm/dependencies.js +167 -0
- package/dist/esm/dependencies.js.map +1 -0
- package/dist/esm/featureServiceHelpers.d.ts +847 -0
- package/dist/esm/featureServiceHelpers.js +2466 -0
- package/dist/esm/featureServiceHelpers.js.map +1 -0
- package/dist/esm/formHelpers.d.ts +26 -0
- package/dist/esm/formHelpers.js +35 -0
- package/dist/esm/formHelpers.js.map +1 -0
- package/dist/esm/generalHelpers.d.ts +447 -0
- package/dist/esm/generalHelpers.js +903 -0
- package/dist/esm/generalHelpers.js.map +1 -0
- package/dist/esm/get-subscription-info.d.ts +27 -0
- package/dist/esm/get-subscription-info.js +34 -0
- package/dist/esm/get-subscription-info.js.map +1 -0
- package/dist/esm/getDeletableSolutionInfo.d.ts +30 -0
- package/dist/esm/getDeletableSolutionInfo.js +48 -0
- package/dist/esm/getDeletableSolutionInfo.js.map +1 -0
- package/dist/esm/getItemTypeAbbrev.d.ts +19 -0
- package/dist/esm/getItemTypeAbbrev.js +182 -0
- package/dist/esm/getItemTypeAbbrev.js.map +1 -0
- package/dist/esm/getSolutionSummary.d.ts +28 -0
- package/dist/esm/getSolutionSummary.js +95 -0
- package/dist/esm/getSolutionSummary.js.map +1 -0
- package/dist/esm/index.d.ts +49 -0
- package/dist/esm/index.js +50 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interfaces.d.ts +1446 -0
- package/dist/esm/interfaces.js +69 -0
- package/dist/esm/interfaces.js.map +1 -0
- package/dist/esm/item-reuse.d.ts +140 -0
- package/dist/esm/item-reuse.js +167 -0
- package/dist/esm/item-reuse.js.map +1 -0
- package/dist/esm/libConnectors.d.ts +73 -0
- package/dist/esm/libConnectors.js +105 -0
- package/dist/esm/libConnectors.js.map +1 -0
- package/dist/esm/migrations/apply-schema.d.ts +24 -0
- package/dist/esm/migrations/apply-schema.js +32 -0
- package/dist/esm/migrations/apply-schema.js.map +1 -0
- package/dist/esm/migrations/is-legacy-solution.d.ts +24 -0
- package/dist/esm/migrations/is-legacy-solution.js +35 -0
- package/dist/esm/migrations/is-legacy-solution.js.map +1 -0
- package/dist/esm/migrations/upgrade-three-dot-one.d.ts +26 -0
- package/dist/esm/migrations/upgrade-three-dot-one.js +44 -0
- package/dist/esm/migrations/upgrade-three-dot-one.js.map +1 -0
- package/dist/esm/migrations/upgrade-three-dot-zero.d.ts +27 -0
- package/dist/esm/migrations/upgrade-three-dot-zero.js +39 -0
- package/dist/esm/migrations/upgrade-three-dot-zero.js.map +1 -0
- package/dist/esm/migrations/upgrade-two-dot-five.d.ts +24 -0
- package/dist/esm/migrations/upgrade-two-dot-five.js +69 -0
- package/dist/esm/migrations/upgrade-two-dot-five.js.map +1 -0
- package/dist/esm/migrations/upgrade-two-dot-four.d.ts +24 -0
- package/dist/esm/migrations/upgrade-two-dot-four.js +68 -0
- package/dist/esm/migrations/upgrade-two-dot-four.js.map +1 -0
- package/dist/esm/migrations/upgrade-two-dot-one.d.ts +7 -0
- package/dist/esm/migrations/upgrade-two-dot-one.js +35 -0
- package/dist/esm/migrations/upgrade-two-dot-one.js.map +1 -0
- package/dist/esm/migrations/upgrade-two-dot-seven.d.ts +23 -0
- package/dist/esm/migrations/upgrade-two-dot-seven.js +54 -0
- package/dist/esm/migrations/upgrade-two-dot-seven.js.map +1 -0
- package/dist/esm/migrations/upgrade-two-dot-six.d.ts +27 -0
- package/dist/esm/migrations/upgrade-two-dot-six.js +57 -0
- package/dist/esm/migrations/upgrade-two-dot-six.js.map +1 -0
- package/dist/esm/migrations/upgrade-two-dot-three.d.ts +23 -0
- package/dist/esm/migrations/upgrade-two-dot-three.js +51 -0
- package/dist/esm/migrations/upgrade-two-dot-three.js.map +1 -0
- package/dist/esm/migrations/upgrade-two-dot-two.d.ts +23 -0
- package/dist/esm/migrations/upgrade-two-dot-two.js +54 -0
- package/dist/esm/migrations/upgrade-two-dot-two.js.map +1 -0
- package/dist/esm/migrations/upgrade-two-dot-zero.d.ts +44 -0
- package/dist/esm/migrations/upgrade-two-dot-zero.js +88 -0
- package/dist/esm/migrations/upgrade-two-dot-zero.js.map +1 -0
- package/dist/esm/migrator.d.ts +25 -0
- package/dist/esm/migrator.js +71 -0
- package/dist/esm/migrator.js.map +1 -0
- package/dist/esm/resourceHelpers.d.ts +192 -0
- package/dist/esm/resourceHelpers.js +361 -0
- package/dist/esm/resourceHelpers.js.map +1 -0
- package/dist/esm/resources/add-resource.d.ts +38 -0
- package/dist/esm/resources/add-resource.js +79 -0
- package/dist/esm/resources/add-resource.js.map +1 -0
- package/dist/esm/resources/addMetadataFromBlob.d.ts +25 -0
- package/dist/esm/resources/addMetadataFromBlob.js +39 -0
- package/dist/esm/resources/addMetadataFromBlob.js.map +1 -0
- package/dist/esm/resources/convert-item-resource-to-storage-resource.d.ts +32 -0
- package/dist/esm/resources/convert-item-resource-to-storage-resource.js +66 -0
- package/dist/esm/resources/convert-item-resource-to-storage-resource.js.map +1 -0
- package/dist/esm/resources/convert-storage-resource-to-item-resource.d.ts +29 -0
- package/dist/esm/resources/convert-storage-resource-to-item-resource.js +66 -0
- package/dist/esm/resources/convert-storage-resource-to-item-resource.js.map +1 -0
- package/dist/esm/resources/copyAssociatedFiles.d.ts +79 -0
- package/dist/esm/resources/copyAssociatedFiles.js +339 -0
- package/dist/esm/resources/copyAssociatedFiles.js.map +1 -0
- package/dist/esm/resources/copyDataIntoItem.d.ts +34 -0
- package/dist/esm/resources/copyDataIntoItem.js +40 -0
- package/dist/esm/resources/copyDataIntoItem.js.map +1 -0
- package/dist/esm/resources/copyMetadataIntoItem.d.ts +27 -0
- package/dist/esm/resources/copyMetadataIntoItem.js +40 -0
- package/dist/esm/resources/copyMetadataIntoItem.js.map +1 -0
- package/dist/esm/resources/copyResourceIntoZip.d.ts +34 -0
- package/dist/esm/resources/copyResourceIntoZip.js +69 -0
- package/dist/esm/resources/copyResourceIntoZip.js.map +1 -0
- package/dist/esm/resources/copyZipIntoItem.d.ts +26 -0
- package/dist/esm/resources/copyZipIntoItem.js +49 -0
- package/dist/esm/resources/copyZipIntoItem.js.map +1 -0
- package/dist/esm/resources/createCopyResults.d.ts +25 -0
- package/dist/esm/resources/createCopyResults.js +32 -0
- package/dist/esm/resources/createCopyResults.js.map +1 -0
- package/dist/esm/resources/get-blob.d.ts +25 -0
- package/dist/esm/resources/get-blob.js +38 -0
- package/dist/esm/resources/get-blob.js.map +1 -0
- package/dist/esm/resources/getItemResourcesFilesFromPaths.d.ts +25 -0
- package/dist/esm/resources/getItemResourcesFilesFromPaths.js +45 -0
- package/dist/esm/resources/getItemResourcesFilesFromPaths.js.map +1 -0
- package/dist/esm/resources/getItemResourcesPaths.d.ts +27 -0
- package/dist/esm/resources/getItemResourcesPaths.js +76 -0
- package/dist/esm/resources/getItemResourcesPaths.js.map +1 -0
- package/dist/esm/resources/index.d.ts +30 -0
- package/dist/esm/resources/index.js +31 -0
- package/dist/esm/resources/index.js.map +1 -0
- package/dist/esm/resources/solution-resource.d.ts +35 -0
- package/dist/esm/resources/solution-resource.js +28 -0
- package/dist/esm/resources/solution-resource.js.map +1 -0
- package/dist/esm/resources/transform-resource-paths-to-solution-resources.d.ts +56 -0
- package/dist/esm/resources/transform-resource-paths-to-solution-resources.js +132 -0
- package/dist/esm/resources/transform-resource-paths-to-solution-resources.js.map +1 -0
- package/dist/esm/resources/update-resource.d.ts +27 -0
- package/dist/esm/resources/update-resource.js +48 -0
- package/dist/esm/resources/update-resource.js.map +1 -0
- package/dist/esm/restHelpers.d.ts +634 -0
- package/dist/esm/restHelpers.js +1943 -0
- package/dist/esm/restHelpers.js.map +1 -0
- package/dist/esm/restHelpersGet.d.ts +303 -0
- package/dist/esm/restHelpersGet.js +793 -0
- package/dist/esm/restHelpersGet.js.map +1 -0
- package/dist/esm/sharing/index.d.ts +16 -0
- package/dist/esm/sharing/index.js +17 -0
- package/dist/esm/sharing/index.js.map +1 -0
- package/dist/esm/sharing/share-item-to-groups.d.ts +26 -0
- package/dist/esm/sharing/share-item-to-groups.js +40 -0
- package/dist/esm/sharing/share-item-to-groups.js.map +1 -0
- package/dist/esm/templatization.d.ts +139 -0
- package/dist/esm/templatization.js +291 -0
- package/dist/esm/templatization.js.map +1 -0
- package/dist/esm/trackingHelpers.d.ts +115 -0
- package/dist/esm/trackingHelpers.js +200 -0
- package/dist/esm/trackingHelpers.js.map +1 -0
- package/dist/esm/velocityHelpers.d.ts +68 -0
- package/dist/esm/velocityHelpers.js +144 -0
- package/dist/esm/velocityHelpers.js.map +1 -0
- package/dist/esm/webtoolHelpers.d.ts +57 -0
- package/dist/esm/webtoolHelpers.js +95 -0
- package/dist/esm/webtoolHelpers.js.map +1 -0
- package/dist/esm/workflowHelpers.d.ts +112 -0
- package/dist/esm/workflowHelpers.js +270 -0
- package/dist/esm/workflowHelpers.js.map +1 -0
- package/dist/esm/workforceHelpers.d.ts +121 -0
- package/dist/esm/workforceHelpers.js +691 -0
- package/dist/esm/workforceHelpers.js.map +1 -0
- package/dist/esm/zip-utils.d.ts +85 -0
- package/dist/esm/zip-utils.js +142 -0
- package/dist/esm/zip-utils.js.map +1 -0
- package/dist/solution.js_commit.txt +7 -0
- package/package.json +2 -2
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** @license
|
|
3
|
+
* Copyright 2024 Esri
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports._updateDependencies = exports._globalTemplatize = exports.postProcessWebToolReferences = exports.preProcessWebTool = void 0;
|
|
19
|
+
const generalHelpers_1 = require("./generalHelpers");
|
|
20
|
+
/**
|
|
21
|
+
* Store any web tool urls in the templateDictionary so we can use them to search other items
|
|
22
|
+
* after they have been converted to templates
|
|
23
|
+
*
|
|
24
|
+
* @param template the current template
|
|
25
|
+
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
function preProcessWebTool(template, templateDictionary) {
|
|
29
|
+
if (template.type === "Geoprocessing Service") {
|
|
30
|
+
const url = template.item.origUrl;
|
|
31
|
+
const urlVar = `{{${template.itemId}.url}}`;
|
|
32
|
+
templateDictionary[url] = urlVar;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.preProcessWebTool = preProcessWebTool;
|
|
36
|
+
/**
|
|
37
|
+
* Use any stored GPServer urls to search all other templates for potential references
|
|
38
|
+
* This will allow us to replace the base server name as will as the itemId
|
|
39
|
+
*
|
|
40
|
+
* @param templates the list of all the templates in the solution
|
|
41
|
+
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
42
|
+
*
|
|
43
|
+
* @returns potentially updated list of all the templates in the solution
|
|
44
|
+
*/
|
|
45
|
+
function postProcessWebToolReferences(templates, templateDictionary) {
|
|
46
|
+
const gpServerUrls = Object.keys(templateDictionary).filter((k) => k.indexOf("GPServer") > -1);
|
|
47
|
+
if (gpServerUrls.length > 0) {
|
|
48
|
+
gpServerUrls.forEach((url) => {
|
|
49
|
+
const itemId = templateDictionary[url].replace("{{", "").replace(".url}}", "");
|
|
50
|
+
_globalTemplatize(templates, url, templateDictionary[url], itemId);
|
|
51
|
+
// handle items that already have a templatized itemId in the url
|
|
52
|
+
const idTest = /[0-9A-F]{32}/gim;
|
|
53
|
+
const templatizedUrl = url.replace(idTest, `{{${itemId}.itemId}}`);
|
|
54
|
+
_globalTemplatize(templates, templatizedUrl, templateDictionary[url], itemId);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return templates;
|
|
58
|
+
}
|
|
59
|
+
exports.postProcessWebToolReferences = postProcessWebToolReferences;
|
|
60
|
+
/**
|
|
61
|
+
* Use any stored GPServer urls to search all other templates for potential references
|
|
62
|
+
* This will allow us to replace the base server name as will as the itemId
|
|
63
|
+
*
|
|
64
|
+
* @param templates the list of all the templates in the solution
|
|
65
|
+
* @param orgUrl the item url of the GPServer
|
|
66
|
+
* @param templatizedUrl the templatized GPServer Url
|
|
67
|
+
* @param orgItemId the item id of the GPServer
|
|
68
|
+
*
|
|
69
|
+
* @returns potentially updated list of all the templates in the solution
|
|
70
|
+
*/
|
|
71
|
+
function _globalTemplatize(templates, orgUrl, templatizedUrl, orgItemId) {
|
|
72
|
+
// Cycle through each of the items in the template and scan the `item` and `data` sections of each for replacements
|
|
73
|
+
templates.forEach((template) => {
|
|
74
|
+
const itemString = JSON.stringify(template.item);
|
|
75
|
+
const dataString = JSON.stringify(template.data);
|
|
76
|
+
(0, generalHelpers_1.globalStringReplace)(template.item, new RegExp(orgUrl, "gi"), templatizedUrl);
|
|
77
|
+
(0, generalHelpers_1.globalStringReplace)(template.data, new RegExp(orgUrl, "gi"), templatizedUrl);
|
|
78
|
+
_updateDependencies(template, itemString, dataString, orgItemId);
|
|
79
|
+
});
|
|
80
|
+
return templates;
|
|
81
|
+
}
|
|
82
|
+
exports._globalTemplatize = _globalTemplatize;
|
|
83
|
+
/**
|
|
84
|
+
* Update the templates dependencies if we can detect differences after we try and replace a GPServer url
|
|
85
|
+
*
|
|
86
|
+
* @param template the current template
|
|
87
|
+
* @param itemString stringified version of the the templates item before we replaced anything
|
|
88
|
+
* @param dataString stringified version of the the templates data before we replaced anything
|
|
89
|
+
* @param id the current item Id of the GPServer
|
|
90
|
+
*
|
|
91
|
+
*/
|
|
92
|
+
function _updateDependencies(template, itemString, dataString, id) {
|
|
93
|
+
const hasItemDepdendency = template.dependencies.indexOf(id) > -1;
|
|
94
|
+
if (itemString && itemString !== JSON.stringify(template.item) && !hasItemDepdendency) {
|
|
95
|
+
template.dependencies.push(id);
|
|
96
|
+
}
|
|
97
|
+
if (dataString && dataString !== JSON.stringify(template.data) && !hasItemDepdendency) {
|
|
98
|
+
template.dependencies.push(id);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports._updateDependencies = _updateDependencies;
|
|
102
|
+
//# sourceMappingURL=webtoolHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webtoolHelpers.js","sourceRoot":"","sources":["../../src/webtoolHelpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,qDAAuD;AAEvD;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,QAAuB,EAAE,kBAAuB;IAChF,IAAI,QAAQ,CAAC,IAAI,KAAK,uBAAuB,EAAE;QAC7C,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;QAClC,MAAM,MAAM,GAAG,KAAK,QAAQ,CAAC,MAAM,QAAQ,CAAC;QAC5C,kBAAkB,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;KAClC;AACH,CAAC;AAND,8CAMC;AAED;;;;;;;;GAQG;AACH,SAAgB,4BAA4B,CAAC,SAA0B,EAAE,kBAAuB;IAC9F,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,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C,IAAI,EAAE,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC;QAE7E,mBAAmB,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC;AAjBD,8CAiBC;AAED;;;;;;;;GAQG;AACH,SAAgB,mBAAmB,CAAC,QAAuB,EAAE,UAAkB,EAAE,UAAkB,EAAE,EAAU;IAC7G,MAAM,kBAAkB,GAAG,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAElE,IAAI,UAAU,IAAI,UAAU,KAAK,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;QACrF,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAChC;IAED,IAAI,UAAU,IAAI,UAAU,KAAK,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;QACrF,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAChC;AACH,CAAC;AAVD,kDAUC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/** @license
|
|
2
|
+
* Copyright 2024 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 common functions compressing and decompressing workflow configurations.
|
|
18
|
+
*
|
|
19
|
+
* @module workflowHelpers
|
|
20
|
+
*/
|
|
21
|
+
import { IItemTemplate, IPreProcessWorkflowTemplatesResponse } from "./interfaces";
|
|
22
|
+
import { IPortal, UserSession } from "./arcgisRestJS";
|
|
23
|
+
/**
|
|
24
|
+
* Compresses a workflow configuration into a zip file.
|
|
25
|
+
*
|
|
26
|
+
* @param workflowConfig Workflow configuration
|
|
27
|
+
* @returns Promise resolving with a zip file
|
|
28
|
+
*/
|
|
29
|
+
export declare function compressWorkflowIntoZipFile(workflowConfig: any): Promise<File>;
|
|
30
|
+
/**
|
|
31
|
+
* Deletes a workflow.
|
|
32
|
+
*
|
|
33
|
+
* @param itemId Id of the workflow item
|
|
34
|
+
* @param workflowBaseUrl URL of the workflow manager, e.g., "https://workflow.arcgis.com/orgId"
|
|
35
|
+
* @param authentication Credentials for the request to AGOL
|
|
36
|
+
* @returns Promise resolving with success or faliure of the request
|
|
37
|
+
*/
|
|
38
|
+
export declare function deleteWorkflowItem(itemId: string, workflowBaseUrl: string, authentication: UserSession): Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Extracts a workflow configuration from a zip file into a JSON object.
|
|
41
|
+
*
|
|
42
|
+
* @param zipFile Zip file containing a workflow configuration
|
|
43
|
+
* @returns Promise resolving with a workflow configuration as JSON object, with each file being a key
|
|
44
|
+
*/
|
|
45
|
+
export declare function extractWorkflowFromZipFile(zipFile: File): Promise<any>;
|
|
46
|
+
/**
|
|
47
|
+
* Check the license capability of Workflow Manager Server.
|
|
48
|
+
*
|
|
49
|
+
* @param workflowBaseUrl URL of the workflow manager, e.g., "https://workflow.arcgis.com/orgId"
|
|
50
|
+
* @param authentication Credentials for the request to AGO
|
|
51
|
+
* @returns Promise resolving with a boolean indicating whether the organization has the license
|
|
52
|
+
* @throws {WorkflowJsonExceptionDTO} if request to workflow manager fails
|
|
53
|
+
*/
|
|
54
|
+
export declare function getWorkflowManagerAuthorized(workflowBaseUrl: string, authentication: UserSession): Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Determines the URL to the Workflow Manager.
|
|
57
|
+
*
|
|
58
|
+
* @param authentication Authenticated user session
|
|
59
|
+
* @param portalResponse Response from portal "self" call; will be fetched if not supplied
|
|
60
|
+
* @param orgId Id of organization whose license is to be checked; if truthy, the URL will be for AGO;
|
|
61
|
+
* if falsy, the URL will be for Workflow Manager Enterprise
|
|
62
|
+
* @returns A URL based on ArcGIS Online or Enterprise, e.g., "https://abc123.esri.com:6443/arcgis"
|
|
63
|
+
*/
|
|
64
|
+
export declare function getWorkflowBaseURL(authentication: UserSession, portalResponse?: IPortal, orgId?: string): Promise<string>;
|
|
65
|
+
/**
|
|
66
|
+
* Get the URL for the Workflow Manager Enterprise application.
|
|
67
|
+
*
|
|
68
|
+
* @param portalRestUrl URL of the portal REST endpoint, e.g., "https://gisserver.domain.com/server/rest/services"
|
|
69
|
+
* @param authentication Credentials for the request to AGO
|
|
70
|
+
* @returns URL for the Workflow Manager Enterprise application (e.g., "https://abc123.esri.com:6443/arcgis"),
|
|
71
|
+
* or an empty string if Workflow Manager is not enabled
|
|
72
|
+
*/
|
|
73
|
+
export declare function getWorkflowEnterpriseServerRootURL(portalRestUrl: string, authentication: UserSession): Promise<string>;
|
|
74
|
+
/**
|
|
75
|
+
* Remove feature service templates that will be auto-generated by Workflow when
|
|
76
|
+
* creating the Workflow item.
|
|
77
|
+
*
|
|
78
|
+
* Also store key values from any Workflow items so we can update variables in other items.
|
|
79
|
+
*
|
|
80
|
+
* @param templates The list of all templates from the Solutions
|
|
81
|
+
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
82
|
+
*
|
|
83
|
+
* @returns An object that contains the items that should use standard deployment and
|
|
84
|
+
* templates that will be deployed by Wokflow deployment.
|
|
85
|
+
*/
|
|
86
|
+
export declare function preprocessWorkflowTemplates(templates: IItemTemplate[], templateDictionary: any): IPreProcessWorkflowTemplatesResponse;
|
|
87
|
+
/**
|
|
88
|
+
* Store key values from any Workflow items so we can update variables in other items.
|
|
89
|
+
*
|
|
90
|
+
* @param key property from a workflow item that will contain an item id that we will need for variable replacement
|
|
91
|
+
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
92
|
+
* @param template Workflow template
|
|
93
|
+
* @param ids list of ids that will be auto generated by Workflow
|
|
94
|
+
*
|
|
95
|
+
*/
|
|
96
|
+
export declare function storeKeyWorkflowServiceId(key: string, templateDictionary: any, template: IItemTemplate, ids: string[]): void;
|
|
97
|
+
/**
|
|
98
|
+
* Replace various IDs in the templates based on items that were created by Workflow
|
|
99
|
+
*
|
|
100
|
+
* @param templates The list of all templates from the Solutions
|
|
101
|
+
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
102
|
+
*
|
|
103
|
+
* @returns The updated collection of templates
|
|
104
|
+
*/
|
|
105
|
+
export declare function updateWorkflowTemplateIds(templates: IItemTemplate[], templateDictionary: any): IItemTemplate[];
|
|
106
|
+
/**
|
|
107
|
+
* Get the various dependencies from the workflow item and add them to the current templates dependency list
|
|
108
|
+
*
|
|
109
|
+
* @param template The IItemTemplate of the workflow item
|
|
110
|
+
*
|
|
111
|
+
*/
|
|
112
|
+
export declare function getWorkflowDependencies(template: IItemTemplate): void;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** @license
|
|
3
|
+
* Copyright 2024 Esri
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.getWorkflowDependencies = exports.updateWorkflowTemplateIds = exports.storeKeyWorkflowServiceId = exports.preprocessWorkflowTemplates = exports.getWorkflowEnterpriseServerRootURL = exports.getWorkflowBaseURL = exports.getWorkflowManagerAuthorized = exports.extractWorkflowFromZipFile = exports.deleteWorkflowItem = exports.compressWorkflowIntoZipFile = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const restHelpersGet = tslib_1.__importStar(require("./restHelpersGet"));
|
|
21
|
+
const zipUtils = tslib_1.__importStar(require("./zip-utils"));
|
|
22
|
+
const arcgisRestJS_1 = require("./arcgisRestJS");
|
|
23
|
+
const restHelpers_1 = require("./restHelpers");
|
|
24
|
+
const restHelpersGet_1 = require("./restHelpersGet");
|
|
25
|
+
const copyDataIntoItem_1 = require("./resources/copyDataIntoItem");
|
|
26
|
+
const generalHelpers_1 = require("./generalHelpers");
|
|
27
|
+
const jszip_1 = tslib_1.__importDefault(require("jszip"));
|
|
28
|
+
// ------------------------------------------------------------------------------------------------------------------ //
|
|
29
|
+
/**
|
|
30
|
+
* Compresses a workflow configuration into a zip file.
|
|
31
|
+
*
|
|
32
|
+
* @param workflowConfig Workflow configuration
|
|
33
|
+
* @returns Promise resolving with a zip file
|
|
34
|
+
*/
|
|
35
|
+
async function compressWorkflowIntoZipFile(workflowConfig) {
|
|
36
|
+
const zip = new jszip_1.default();
|
|
37
|
+
Object.keys(workflowConfig).forEach((key) => {
|
|
38
|
+
zip.file(key, workflowConfig[key]);
|
|
39
|
+
});
|
|
40
|
+
const zipFile = (0, copyDataIntoItem_1.createMimeTypedFile)({
|
|
41
|
+
blob: await zip.generateAsync({ type: "blob" }),
|
|
42
|
+
filename: `workflow_configuration.zip`,
|
|
43
|
+
mimeType: "application/zip",
|
|
44
|
+
});
|
|
45
|
+
return Promise.resolve(zipFile);
|
|
46
|
+
}
|
|
47
|
+
exports.compressWorkflowIntoZipFile = compressWorkflowIntoZipFile;
|
|
48
|
+
/**
|
|
49
|
+
* Deletes a workflow.
|
|
50
|
+
*
|
|
51
|
+
* @param itemId Id of the workflow item
|
|
52
|
+
* @param workflowBaseUrl URL of the workflow manager, e.g., "https://workflow.arcgis.com/orgId"
|
|
53
|
+
* @param authentication Credentials for the request to AGOL
|
|
54
|
+
* @returns Promise resolving with success or faliure of the request
|
|
55
|
+
*/
|
|
56
|
+
async function deleteWorkflowItem(itemId, workflowBaseUrl, authentication) {
|
|
57
|
+
// Get the id of the Workflow Manager Admin group because the group has to be deleted separately
|
|
58
|
+
const data = await (0, restHelpersGet_1.getItemDataAsJson)(itemId, authentication);
|
|
59
|
+
const adminGroupId = data?.groupId;
|
|
60
|
+
// Delete the item
|
|
61
|
+
const url = `${workflowBaseUrl}/admin/${itemId}`;
|
|
62
|
+
const options = {
|
|
63
|
+
authentication,
|
|
64
|
+
headers: {
|
|
65
|
+
"Accept": "application/json",
|
|
66
|
+
"Authorization": `Bearer ${authentication.token}`,
|
|
67
|
+
"X-Esri-Authorization": `Bearer ${authentication.token}`,
|
|
68
|
+
},
|
|
69
|
+
httpMethod: "DELETE",
|
|
70
|
+
params: {
|
|
71
|
+
f: "json",
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
const response = await (0, arcgisRestJS_1.request)(url, options);
|
|
75
|
+
// Delete the admin group
|
|
76
|
+
if (adminGroupId) {
|
|
77
|
+
await (0, restHelpers_1.removeGroup)(adminGroupId, authentication);
|
|
78
|
+
}
|
|
79
|
+
return Promise.resolve(response.success);
|
|
80
|
+
}
|
|
81
|
+
exports.deleteWorkflowItem = deleteWorkflowItem;
|
|
82
|
+
/**
|
|
83
|
+
* Extracts a workflow configuration from a zip file into a JSON object.
|
|
84
|
+
*
|
|
85
|
+
* @param zipFile Zip file containing a workflow configuration
|
|
86
|
+
* @returns Promise resolving with a workflow configuration as JSON object, with each file being a key
|
|
87
|
+
*/
|
|
88
|
+
async function extractWorkflowFromZipFile(zipFile) {
|
|
89
|
+
const zippedFiles = await zipUtils.getZipObjectContents(await zipUtils.blobToZipObject(zipFile));
|
|
90
|
+
const workflowConfig = {};
|
|
91
|
+
zippedFiles.forEach((zippedFile) => {
|
|
92
|
+
workflowConfig[zippedFile.file] = zippedFile.content;
|
|
93
|
+
});
|
|
94
|
+
return Promise.resolve(workflowConfig);
|
|
95
|
+
}
|
|
96
|
+
exports.extractWorkflowFromZipFile = extractWorkflowFromZipFile;
|
|
97
|
+
/**
|
|
98
|
+
* Check the license capability of Workflow Manager Server.
|
|
99
|
+
*
|
|
100
|
+
* @param workflowBaseUrl URL of the workflow manager, e.g., "https://workflow.arcgis.com/orgId"
|
|
101
|
+
* @param authentication Credentials for the request to AGO
|
|
102
|
+
* @returns Promise resolving with a boolean indicating whether the organization has the license
|
|
103
|
+
* @throws {WorkflowJsonExceptionDTO} if request to workflow manager fails
|
|
104
|
+
*/
|
|
105
|
+
async function getWorkflowManagerAuthorized(workflowBaseUrl, authentication) {
|
|
106
|
+
try {
|
|
107
|
+
const url = `${workflowBaseUrl}/checkStatus`;
|
|
108
|
+
const options = {
|
|
109
|
+
authentication,
|
|
110
|
+
httpMethod: "GET",
|
|
111
|
+
params: {
|
|
112
|
+
f: "json",
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
const response = await (0, arcgisRestJS_1.request)(url, options);
|
|
116
|
+
const isAuthorized = response?.hasAdvancedLicense || false;
|
|
117
|
+
return Promise.resolve(isAuthorized);
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
// User is not authorized for Workflow Manager
|
|
121
|
+
return Promise.resolve(false);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.getWorkflowManagerAuthorized = getWorkflowManagerAuthorized;
|
|
125
|
+
/**
|
|
126
|
+
* Determines the URL to the Workflow Manager.
|
|
127
|
+
*
|
|
128
|
+
* @param authentication Authenticated user session
|
|
129
|
+
* @param portalResponse Response from portal "self" call; will be fetched if not supplied
|
|
130
|
+
* @param orgId Id of organization whose license is to be checked; if truthy, the URL will be for AGO;
|
|
131
|
+
* if falsy, the URL will be for Workflow Manager Enterprise
|
|
132
|
+
* @returns A URL based on ArcGIS Online or Enterprise, e.g., "https://abc123.esri.com:6443/arcgis"
|
|
133
|
+
*/
|
|
134
|
+
async function getWorkflowBaseURL(authentication, portalResponse, orgId) {
|
|
135
|
+
let workflowServerUrl;
|
|
136
|
+
if (!portalResponse) {
|
|
137
|
+
const user = await restHelpersGet.getUser(authentication);
|
|
138
|
+
orgId = orgId ?? user.orgId;
|
|
139
|
+
portalResponse = await restHelpersGet.getPortal("", authentication);
|
|
140
|
+
}
|
|
141
|
+
const portalURL = `https://${portalResponse.portalHostname}`;
|
|
142
|
+
const portalRestURL = `${portalURL}/sharing/rest`;
|
|
143
|
+
if (portalResponse.isPortal) {
|
|
144
|
+
// Enterprise
|
|
145
|
+
workflowServerUrl = await getWorkflowEnterpriseServerRootURL(portalRestURL, authentication);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
// ArcGIS Online
|
|
149
|
+
workflowServerUrl = portalResponse.helperServices?.workflowManager?.url ?? portalURL;
|
|
150
|
+
}
|
|
151
|
+
return Promise.resolve(orgId ? `${workflowServerUrl}/${orgId}` : `${workflowServerUrl}/workflow`);
|
|
152
|
+
}
|
|
153
|
+
exports.getWorkflowBaseURL = getWorkflowBaseURL;
|
|
154
|
+
/**
|
|
155
|
+
* Get the URL for the Workflow Manager Enterprise application.
|
|
156
|
+
*
|
|
157
|
+
* @param portalRestUrl URL of the portal REST endpoint, e.g., "https://gisserver.domain.com/server/rest/services"
|
|
158
|
+
* @param authentication Credentials for the request to AGO
|
|
159
|
+
* @returns URL for the Workflow Manager Enterprise application (e.g., "https://abc123.esri.com:6443/arcgis"),
|
|
160
|
+
* or an empty string if Workflow Manager is not enabled
|
|
161
|
+
*/
|
|
162
|
+
async function getWorkflowEnterpriseServerRootURL(portalRestUrl, authentication) {
|
|
163
|
+
// Get the servers
|
|
164
|
+
const servers = await (0, restHelpersGet_1.getEnterpriseServers)(portalRestUrl, authentication);
|
|
165
|
+
// Find the Workflow Manager server
|
|
166
|
+
const workflowServer = servers.find((server) => server.serverFunction === "WorkflowManager");
|
|
167
|
+
if (!workflowServer) {
|
|
168
|
+
return "";
|
|
169
|
+
}
|
|
170
|
+
return workflowServer.url;
|
|
171
|
+
}
|
|
172
|
+
exports.getWorkflowEnterpriseServerRootURL = getWorkflowEnterpriseServerRootURL;
|
|
173
|
+
/**
|
|
174
|
+
* Remove feature service templates that will be auto-generated by Workflow when
|
|
175
|
+
* creating the Workflow item.
|
|
176
|
+
*
|
|
177
|
+
* Also store key values from any Workflow items so we can update variables in other items.
|
|
178
|
+
*
|
|
179
|
+
* @param templates The list of all templates from the Solutions
|
|
180
|
+
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
181
|
+
*
|
|
182
|
+
* @returns An object that contains the items that should use standard deployment and
|
|
183
|
+
* templates that will be deployed by Wokflow deployment.
|
|
184
|
+
*/
|
|
185
|
+
function preprocessWorkflowTemplates(templates, templateDictionary) {
|
|
186
|
+
const workflowItems = templates.filter((t) => t.type === "Workflow");
|
|
187
|
+
const serviceIds = workflowItems.reduce((prev, cur) => {
|
|
188
|
+
templateDictionary.workflows = { ...templateDictionary.workflows };
|
|
189
|
+
templateDictionary.workflows[cur.itemId] = {};
|
|
190
|
+
storeKeyWorkflowServiceId("viewSchema", templateDictionary, cur, prev);
|
|
191
|
+
storeKeyWorkflowServiceId("workflowLocations", templateDictionary, cur, prev);
|
|
192
|
+
storeKeyWorkflowServiceId("workflowSchema", templateDictionary, cur, prev);
|
|
193
|
+
return prev;
|
|
194
|
+
}, []);
|
|
195
|
+
const workflowManagedTemplates = [];
|
|
196
|
+
const deployTemplates = templates.filter((t) => {
|
|
197
|
+
if (serviceIds.indexOf(t.itemId) < 0) {
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
workflowManagedTemplates.push(t);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return {
|
|
205
|
+
deployTemplates,
|
|
206
|
+
workflowManagedTemplates,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
exports.preprocessWorkflowTemplates = preprocessWorkflowTemplates;
|
|
210
|
+
/**
|
|
211
|
+
* Store key values from any Workflow items so we can update variables in other items.
|
|
212
|
+
*
|
|
213
|
+
* @param key property from a workflow item that will contain an item id that we will need for variable replacement
|
|
214
|
+
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
215
|
+
* @param template Workflow template
|
|
216
|
+
* @param ids list of ids that will be auto generated by Workflow
|
|
217
|
+
*
|
|
218
|
+
*/
|
|
219
|
+
function storeKeyWorkflowServiceId(key, templateDictionary, template, ids) {
|
|
220
|
+
const id = (0, generalHelpers_1.getProp)(template, `data.${key}.itemId`).replace("{{", "").replace(".itemId}}", "");
|
|
221
|
+
if (id && ids.indexOf(id) < 0) {
|
|
222
|
+
ids.push(id);
|
|
223
|
+
}
|
|
224
|
+
templateDictionary.workflows[template.itemId][key] = id;
|
|
225
|
+
templateDictionary[id] = {};
|
|
226
|
+
}
|
|
227
|
+
exports.storeKeyWorkflowServiceId = storeKeyWorkflowServiceId;
|
|
228
|
+
/**
|
|
229
|
+
* Replace various IDs in the templates based on items that were created by Workflow
|
|
230
|
+
*
|
|
231
|
+
* @param templates The list of all templates from the Solutions
|
|
232
|
+
* @param templateDictionary Hash of facts: folder id, org URL, adlib replacements
|
|
233
|
+
*
|
|
234
|
+
* @returns The updated collection of templates
|
|
235
|
+
*/
|
|
236
|
+
function updateWorkflowTemplateIds(templates, templateDictionary) {
|
|
237
|
+
if (templateDictionary.workflows) {
|
|
238
|
+
Object.keys(templateDictionary.workflows).forEach((k) => {
|
|
239
|
+
// the ids retained here are that of the source items
|
|
240
|
+
// we justr need to swap them out in the templates arrey
|
|
241
|
+
const workflowHash = templateDictionary.workflows[k];
|
|
242
|
+
const viewSchemaId = workflowHash.viewSchema;
|
|
243
|
+
const workflowLocationsId = workflowHash.workflowLocations;
|
|
244
|
+
const workflowSchemaId = workflowHash.workflowSchema;
|
|
245
|
+
const workflowIds = [viewSchemaId, workflowLocationsId, workflowSchemaId];
|
|
246
|
+
templates = templates.map((t) => {
|
|
247
|
+
if (workflowIds.indexOf(t.itemId) > -1) {
|
|
248
|
+
t.dependencies = t.dependencies.map((d) => {
|
|
249
|
+
if (workflowIds.indexOf(d) > -1) {
|
|
250
|
+
d = templateDictionary[d].itemId;
|
|
251
|
+
}
|
|
252
|
+
return d;
|
|
253
|
+
});
|
|
254
|
+
t.itemId = templateDictionary[t.itemId].itemId;
|
|
255
|
+
}
|
|
256
|
+
return t;
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
return templates;
|
|
261
|
+
}
|
|
262
|
+
exports.updateWorkflowTemplateIds = updateWorkflowTemplateIds;
|
|
263
|
+
/**
|
|
264
|
+
* Get the various dependencies from the workflow item and add them to the current templates dependency list
|
|
265
|
+
*
|
|
266
|
+
* @param template The IItemTemplate of the workflow item
|
|
267
|
+
*
|
|
268
|
+
*/
|
|
269
|
+
function getWorkflowDependencies(template) {
|
|
270
|
+
const data = template.data;
|
|
271
|
+
if (data) {
|
|
272
|
+
const keys = ["viewSchema", "workflowLocations", "workflowSchema"];
|
|
273
|
+
keys.forEach((k) => {
|
|
274
|
+
if (Object.keys(data).indexOf(k) > -1) {
|
|
275
|
+
const id = data[k].itemId;
|
|
276
|
+
if (id && template.dependencies.indexOf(id) < 0) {
|
|
277
|
+
template.dependencies.push(id);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
exports.getWorkflowDependencies = getWorkflowDependencies;
|
|
284
|
+
//# sourceMappingURL=workflowHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflowHelpers.js","sourceRoot":"","sources":["../../src/workflowHelpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AASH,yEAAmD;AACnD,8DAAwC;AACxC,iDAAgF;AAChF,+CAA4C;AAC5C,qDAA2E;AAC3E,mEAAmE;AACnE,qDAA2C;AAC3C,0DAA0B;AAE1B,wHAAwH;AAExH;;;;;GAKG;AACI,KAAK,UAAU,2BAA2B,CAAC,cAAmB;IACnE,MAAM,GAAG,GAAG,IAAI,eAAK,EAAE,CAAC;IACxB,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE;QAClD,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAA,sCAAmB,EAAC;QAClC,IAAI,EAAE,MAAM,GAAG,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC/C,QAAQ,EAAE,4BAA4B;QACtC,QAAQ,EAAE,iBAAiB;KAC5B,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAbD,kEAaC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,kBAAkB,CACtC,MAAc,EACd,eAAuB,EACvB,cAA2B;IAE3B,gGAAgG;IAChG,MAAM,IAAI,GAAG,MAAM,IAAA,kCAAiB,EAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC7D,MAAM,YAAY,GAAG,IAAI,EAAE,OAAO,CAAC;IAEnC,kBAAkB;IAClB,MAAM,GAAG,GAAG,GAAG,eAAe,UAAU,MAAM,EAAE,CAAC;IAEjD,MAAM,OAAO,GAAoB;QAC/B,cAAc;QACd,OAAO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AAC,EAAE,CAAC,GAAG,CAAC,EAAE;oBAC/C,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;iBAChC;aACF;QACH,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAbD,0DAaC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/** @license
|
|
2
|
+
* Copyright 2020 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 workforceHelpers
|
|
20
|
+
*/
|
|
21
|
+
import { UserSession } from "./arcgisRestJS";
|
|
22
|
+
import { IItemTemplate, IFeatureServiceProperties } from "./interfaces";
|
|
23
|
+
/**
|
|
24
|
+
* Converts an workforce item to a template.
|
|
25
|
+
*
|
|
26
|
+
* @param itemTemplate template for the workforce project item
|
|
27
|
+
* @param authentication credentials for any requests
|
|
28
|
+
* @param templateDictionary Hash of key details used for variable replacement
|
|
29
|
+
* @returns templatized itemTemplate
|
|
30
|
+
*/
|
|
31
|
+
export declare function convertWorkforceItemToTemplate(itemTemplate: IItemTemplate, authentication: UserSession, templateDictionary: any): Promise<IItemTemplate>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the ids of the dependencies of the workforce project.
|
|
34
|
+
*
|
|
35
|
+
* @param data itemTemplate data
|
|
36
|
+
* @param keyProperties workforce project properties that contain references to dependencies
|
|
37
|
+
* @param authentication credentials for any requests
|
|
38
|
+
* @returns List of dependencies ids
|
|
39
|
+
*/
|
|
40
|
+
export declare function extractWorkforceDependencies(data: any, keyProperties: string[], authentication: UserSession): Promise<any>;
|
|
41
|
+
/**
|
|
42
|
+
* Templatizes key item properties.
|
|
43
|
+
*
|
|
44
|
+
* @param data itemTemplate data
|
|
45
|
+
* @param keyProperties workforce project properties that should be templatized
|
|
46
|
+
* @param urlHash a key value pair of url and itemId
|
|
47
|
+
* @param templateDictionary Hash of key details used for variable replacement
|
|
48
|
+
* @returns an updated data object to be stored in the template
|
|
49
|
+
*/
|
|
50
|
+
export declare function templatizeWorkforce(data: any, keyProperties: string[], urlHash: any, templateDictionary: any): any;
|
|
51
|
+
/**
|
|
52
|
+
* Evaluate key properties in the workforce service of additional items that are needed
|
|
53
|
+
*
|
|
54
|
+
* @param itemTemplate template for the workforce project item
|
|
55
|
+
* @param dependencies list of the items dependencies
|
|
56
|
+
* @returns an array of objects with dependency ids
|
|
57
|
+
*/
|
|
58
|
+
export declare function getWorkforceDependencies(itemTemplate: IItemTemplate, dependencies: any[]): any;
|
|
59
|
+
export declare function getWorkforceServiceInfo(properties: IFeatureServiceProperties, url: string, authentication: UserSession): Promise<IFeatureServiceProperties>;
|
|
60
|
+
/**
|
|
61
|
+
* Wrap global id and assignmenttype values in curly braces
|
|
62
|
+
*
|
|
63
|
+
* Added for issue #734
|
|
64
|
+
*
|
|
65
|
+
* This function will update the provided workforceInfos object
|
|
66
|
+
*
|
|
67
|
+
* @param workforceInfos the object that stores the integration and type info with global ids
|
|
68
|
+
* @private
|
|
69
|
+
*/
|
|
70
|
+
export declare function _updateGlobalIdAndAssignmentType(workforceInfos: any): void;
|
|
71
|
+
export declare function _getAssignmentTypeInfos(assignmentTypes: any): any[];
|
|
72
|
+
export declare function _getAssignmentIntegrationInfos(assignmentIntegrations: any, authentication: UserSession): Promise<any>;
|
|
73
|
+
export declare function getUrlDependencies(requests: Array<Promise<any>>, urls: string[]): Promise<any>;
|
|
74
|
+
/**
|
|
75
|
+
* Templatizes values from a urlTemplate
|
|
76
|
+
*
|
|
77
|
+
* @param item the object that may contain a urlTemplate
|
|
78
|
+
* @param urlHash a key value pair of url and itemId
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
export declare function _templatizeUrlTemplate(item: any, urlHash: any): void;
|
|
82
|
+
export declare function getLayerId(url: string): any;
|
|
83
|
+
export declare function getReplaceValue(layerId: any, suffix: string): string;
|
|
84
|
+
export declare function postProcessWorkforceTemplates(templates: IItemTemplate[]): IItemTemplate[];
|
|
85
|
+
export declare function _templatizeWorkforceProject(t: IItemTemplate, groupUpdates: any): any;
|
|
86
|
+
export declare function _templatizeWorkforceDispatcherOrWorker(t: IItemTemplate, type: string): IItemTemplate;
|
|
87
|
+
export declare function isWorkforceProject(itemTemplate: IItemTemplate): boolean;
|
|
88
|
+
export declare function getKeyWorkforceProperties(version: number): string[];
|
|
89
|
+
/**
|
|
90
|
+
* Test the provided value for any urls and submit a request to obtain the service item id for the url
|
|
91
|
+
*
|
|
92
|
+
* @param v a string value to test for urls
|
|
93
|
+
* @param authentication credentials for the requests
|
|
94
|
+
* @returns an object with any pending requests and the urls that requests were made to
|
|
95
|
+
*/
|
|
96
|
+
export declare function urlTest(v: any, authentication: UserSession): any;
|
|
97
|
+
export declare function _getURLs(v: string): string[];
|
|
98
|
+
/**
|
|
99
|
+
* Gets the current user and updates the dispatchers service
|
|
100
|
+
*
|
|
101
|
+
* @param newlyCreatedItem Item to be created; n.b.: this item is modified
|
|
102
|
+
* @param destinationAuthentication The session used to create the new item(s)
|
|
103
|
+
* @returns A promise that will resolve with \{ "success" === true || false \}
|
|
104
|
+
*/
|
|
105
|
+
export declare function fineTuneCreatedWorkforceItem(newlyCreatedItem: IItemTemplate, destinationAuthentication: UserSession, url: string, templateDictionary: any): Promise<any>;
|
|
106
|
+
export declare function _getFields(url: string, ids: number[], authentication: UserSession): Promise<any>;
|
|
107
|
+
export declare function _updateUrl(url: string): string;
|
|
108
|
+
export declare function _getAddFeatures(updateInfos: any, fields: any[]): any;
|
|
109
|
+
export declare function _getField(name: string, fields: string[]): string;
|
|
110
|
+
/**
|
|
111
|
+
* Updates the dispatchers service to include the current user as a dispatcher
|
|
112
|
+
*
|
|
113
|
+
* @param dispatchers The dispatchers object from the workforce items data
|
|
114
|
+
* @param name Current users name
|
|
115
|
+
* @param fullName Current users full name
|
|
116
|
+
* @param destinationAuthentication The session used to create the new item(s)
|
|
117
|
+
* @returns A promise that will resolve with true || false
|
|
118
|
+
* @private
|
|
119
|
+
*/
|
|
120
|
+
export declare function _updateDispatchers(url: any, name: string, fullName: string, authentication: UserSession, isPortal: boolean): Promise<boolean>;
|
|
121
|
+
export declare function _applyEdits(url: string, adds: any[], authentication: UserSession, useGlobalIds?: boolean): any;
|