@esri/solution-common 6.1.1 → 6.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/package.json +2 -2
  2. package/dist/cjs/arcgisRestJS.d.ts +0 -61
  3. package/dist/cjs/arcgisRestJS.js +0 -144
  4. package/dist/cjs/arcgisRestJS.js.map +0 -1
  5. package/dist/cjs/completeItem.d.ts +0 -30
  6. package/dist/cjs/completeItem.js +0 -72
  7. package/dist/cjs/completeItem.js.map +0 -1
  8. package/dist/cjs/create-hub-request-options.d.ts +0 -29
  9. package/dist/cjs/create-hub-request-options.js +0 -64
  10. package/dist/cjs/create-hub-request-options.js.map +0 -1
  11. package/dist/cjs/deleteHelpers/deleteEmptyGroups.d.ts +0 -24
  12. package/dist/cjs/deleteHelpers/deleteEmptyGroups.js +0 -42
  13. package/dist/cjs/deleteHelpers/deleteEmptyGroups.js.map +0 -1
  14. package/dist/cjs/deleteHelpers/deleteGroupIfEmpty.d.ts +0 -27
  15. package/dist/cjs/deleteHelpers/deleteGroupIfEmpty.js +0 -99
  16. package/dist/cjs/deleteHelpers/deleteGroupIfEmpty.js.map +0 -1
  17. package/dist/cjs/deleteHelpers/deleteSolutionContents.d.ts +0 -39
  18. package/dist/cjs/deleteHelpers/deleteSolutionContents.js +0 -127
  19. package/dist/cjs/deleteHelpers/deleteSolutionContents.js.map +0 -1
  20. package/dist/cjs/deleteHelpers/deleteSolutionFolder.d.ts +0 -29
  21. package/dist/cjs/deleteHelpers/deleteSolutionFolder.js +0 -81
  22. package/dist/cjs/deleteHelpers/deleteSolutionFolder.js.map +0 -1
  23. package/dist/cjs/deleteHelpers/deleteSolutionItem.d.ts +0 -31
  24. package/dist/cjs/deleteHelpers/deleteSolutionItem.js +0 -52
  25. package/dist/cjs/deleteHelpers/deleteSolutionItem.js.map +0 -1
  26. package/dist/cjs/deleteHelpers/index.d.ts +0 -22
  27. package/dist/cjs/deleteHelpers/index.js +0 -26
  28. package/dist/cjs/deleteHelpers/index.js.map +0 -1
  29. package/dist/cjs/deleteHelpers/reconstructBuildOrderIds.d.ts +0 -27
  30. package/dist/cjs/deleteHelpers/reconstructBuildOrderIds.js +0 -34
  31. package/dist/cjs/deleteHelpers/reconstructBuildOrderIds.js.map +0 -1
  32. package/dist/cjs/deleteHelpers/removeItems.d.ts +0 -35
  33. package/dist/cjs/deleteHelpers/removeItems.js +0 -116
  34. package/dist/cjs/deleteHelpers/removeItems.js.map +0 -1
  35. package/dist/cjs/deleteHelpers/reportProgress.d.ts +0 -27
  36. package/dist/cjs/deleteHelpers/reportProgress.js +0 -46
  37. package/dist/cjs/deleteHelpers/reportProgress.js.map +0 -1
  38. package/dist/cjs/deleteSolution.d.ts +0 -56
  39. package/dist/cjs/deleteSolution.js +0 -107
  40. package/dist/cjs/deleteSolution.js.map +0 -1
  41. package/dist/cjs/dependencies.d.ts +0 -26
  42. package/dist/cjs/dependencies.js +0 -171
  43. package/dist/cjs/dependencies.js.map +0 -1
  44. package/dist/cjs/featureServiceHelpers.d.ts +0 -847
  45. package/dist/cjs/featureServiceHelpers.js +0 -2553
  46. package/dist/cjs/featureServiceHelpers.js.map +0 -1
  47. package/dist/cjs/formHelpers.d.ts +0 -26
  48. package/dist/cjs/formHelpers.js +0 -40
  49. package/dist/cjs/formHelpers.js.map +0 -1
  50. package/dist/cjs/generalHelpers.d.ts +0 -447
  51. package/dist/cjs/generalHelpers.js +0 -959
  52. package/dist/cjs/generalHelpers.js.map +0 -1
  53. package/dist/cjs/get-subscription-info.d.ts +0 -27
  54. package/dist/cjs/get-subscription-info.js +0 -38
  55. package/dist/cjs/get-subscription-info.js.map +0 -1
  56. package/dist/cjs/getDeletableSolutionInfo.d.ts +0 -30
  57. package/dist/cjs/getDeletableSolutionInfo.js +0 -53
  58. package/dist/cjs/getDeletableSolutionInfo.js.map +0 -1
  59. package/dist/cjs/getItemTypeAbbrev.d.ts +0 -19
  60. package/dist/cjs/getItemTypeAbbrev.js +0 -186
  61. package/dist/cjs/getItemTypeAbbrev.js.map +0 -1
  62. package/dist/cjs/getSolutionSummary.d.ts +0 -28
  63. package/dist/cjs/getSolutionSummary.js +0 -100
  64. package/dist/cjs/getSolutionSummary.js.map +0 -1
  65. package/dist/cjs/index.d.ts +0 -49
  66. package/dist/cjs/index.js +0 -53
  67. package/dist/cjs/index.js.map +0 -1
  68. package/dist/cjs/interfaces.d.ts +0 -1446
  69. package/dist/cjs/interfaces.js +0 -72
  70. package/dist/cjs/interfaces.js.map +0 -1
  71. package/dist/cjs/item-reuse.d.ts +0 -140
  72. package/dist/cjs/item-reuse.js +0 -176
  73. package/dist/cjs/item-reuse.js.map +0 -1
  74. package/dist/cjs/libConnectors.d.ts +0 -73
  75. package/dist/cjs/libConnectors.js +0 -115
  76. package/dist/cjs/libConnectors.js.map +0 -1
  77. package/dist/cjs/migrations/apply-schema.d.ts +0 -24
  78. package/dist/cjs/migrations/apply-schema.js +0 -36
  79. package/dist/cjs/migrations/apply-schema.js.map +0 -1
  80. package/dist/cjs/migrations/is-legacy-solution.d.ts +0 -24
  81. package/dist/cjs/migrations/is-legacy-solution.js +0 -39
  82. package/dist/cjs/migrations/is-legacy-solution.js.map +0 -1
  83. package/dist/cjs/migrations/upgrade-three-dot-one.d.ts +0 -26
  84. package/dist/cjs/migrations/upgrade-three-dot-one.js +0 -48
  85. package/dist/cjs/migrations/upgrade-three-dot-one.js.map +0 -1
  86. package/dist/cjs/migrations/upgrade-three-dot-zero.d.ts +0 -27
  87. package/dist/cjs/migrations/upgrade-three-dot-zero.js +0 -43
  88. package/dist/cjs/migrations/upgrade-three-dot-zero.js.map +0 -1
  89. package/dist/cjs/migrations/upgrade-two-dot-five.d.ts +0 -24
  90. package/dist/cjs/migrations/upgrade-two-dot-five.js +0 -73
  91. package/dist/cjs/migrations/upgrade-two-dot-five.js.map +0 -1
  92. package/dist/cjs/migrations/upgrade-two-dot-four.d.ts +0 -24
  93. package/dist/cjs/migrations/upgrade-two-dot-four.js +0 -72
  94. package/dist/cjs/migrations/upgrade-two-dot-four.js.map +0 -1
  95. package/dist/cjs/migrations/upgrade-two-dot-one.d.ts +0 -7
  96. package/dist/cjs/migrations/upgrade-two-dot-one.js +0 -39
  97. package/dist/cjs/migrations/upgrade-two-dot-one.js.map +0 -1
  98. package/dist/cjs/migrations/upgrade-two-dot-seven.d.ts +0 -23
  99. package/dist/cjs/migrations/upgrade-two-dot-seven.js +0 -58
  100. package/dist/cjs/migrations/upgrade-two-dot-seven.js.map +0 -1
  101. package/dist/cjs/migrations/upgrade-two-dot-six.d.ts +0 -27
  102. package/dist/cjs/migrations/upgrade-two-dot-six.js +0 -61
  103. package/dist/cjs/migrations/upgrade-two-dot-six.js.map +0 -1
  104. package/dist/cjs/migrations/upgrade-two-dot-three.d.ts +0 -23
  105. package/dist/cjs/migrations/upgrade-two-dot-three.js +0 -55
  106. package/dist/cjs/migrations/upgrade-two-dot-three.js.map +0 -1
  107. package/dist/cjs/migrations/upgrade-two-dot-two.d.ts +0 -23
  108. package/dist/cjs/migrations/upgrade-two-dot-two.js +0 -58
  109. package/dist/cjs/migrations/upgrade-two-dot-two.js.map +0 -1
  110. package/dist/cjs/migrations/upgrade-two-dot-zero.d.ts +0 -44
  111. package/dist/cjs/migrations/upgrade-two-dot-zero.js +0 -95
  112. package/dist/cjs/migrations/upgrade-two-dot-zero.js.map +0 -1
  113. package/dist/cjs/migrator.d.ts +0 -25
  114. package/dist/cjs/migrator.js +0 -75
  115. package/dist/cjs/migrator.js.map +0 -1
  116. package/dist/cjs/resourceHelpers.d.ts +0 -192
  117. package/dist/cjs/resourceHelpers.js +0 -380
  118. package/dist/cjs/resourceHelpers.js.map +0 -1
  119. package/dist/cjs/resources/add-resource.d.ts +0 -38
  120. package/dist/cjs/resources/add-resource.js +0 -84
  121. package/dist/cjs/resources/add-resource.js.map +0 -1
  122. package/dist/cjs/resources/addMetadataFromBlob.d.ts +0 -25
  123. package/dist/cjs/resources/addMetadataFromBlob.js +0 -43
  124. package/dist/cjs/resources/addMetadataFromBlob.js.map +0 -1
  125. package/dist/cjs/resources/convert-item-resource-to-storage-resource.d.ts +0 -32
  126. package/dist/cjs/resources/convert-item-resource-to-storage-resource.js +0 -70
  127. package/dist/cjs/resources/convert-item-resource-to-storage-resource.js.map +0 -1
  128. package/dist/cjs/resources/convert-storage-resource-to-item-resource.d.ts +0 -29
  129. package/dist/cjs/resources/convert-storage-resource-to-item-resource.js +0 -70
  130. package/dist/cjs/resources/convert-storage-resource-to-item-resource.js.map +0 -1
  131. package/dist/cjs/resources/copyAssociatedFiles.d.ts +0 -79
  132. package/dist/cjs/resources/copyAssociatedFiles.js +0 -348
  133. package/dist/cjs/resources/copyAssociatedFiles.js.map +0 -1
  134. package/dist/cjs/resources/copyDataIntoItem.d.ts +0 -34
  135. package/dist/cjs/resources/copyDataIntoItem.js +0 -45
  136. package/dist/cjs/resources/copyDataIntoItem.js.map +0 -1
  137. package/dist/cjs/resources/copyMetadataIntoItem.d.ts +0 -27
  138. package/dist/cjs/resources/copyMetadataIntoItem.js +0 -44
  139. package/dist/cjs/resources/copyMetadataIntoItem.js.map +0 -1
  140. package/dist/cjs/resources/copyResourceIntoZip.d.ts +0 -34
  141. package/dist/cjs/resources/copyResourceIntoZip.js +0 -74
  142. package/dist/cjs/resources/copyResourceIntoZip.js.map +0 -1
  143. package/dist/cjs/resources/copyZipIntoItem.d.ts +0 -26
  144. package/dist/cjs/resources/copyZipIntoItem.js +0 -53
  145. package/dist/cjs/resources/copyZipIntoItem.js.map +0 -1
  146. package/dist/cjs/resources/createCopyResults.d.ts +0 -25
  147. package/dist/cjs/resources/createCopyResults.js +0 -36
  148. package/dist/cjs/resources/createCopyResults.js.map +0 -1
  149. package/dist/cjs/resources/get-blob.d.ts +0 -25
  150. package/dist/cjs/resources/get-blob.js +0 -42
  151. package/dist/cjs/resources/get-blob.js.map +0 -1
  152. package/dist/cjs/resources/getItemResourcesFilesFromPaths.d.ts +0 -25
  153. package/dist/cjs/resources/getItemResourcesFilesFromPaths.js +0 -49
  154. package/dist/cjs/resources/getItemResourcesFilesFromPaths.js.map +0 -1
  155. package/dist/cjs/resources/getItemResourcesPaths.d.ts +0 -27
  156. package/dist/cjs/resources/getItemResourcesPaths.js +0 -80
  157. package/dist/cjs/resources/getItemResourcesPaths.js.map +0 -1
  158. package/dist/cjs/resources/index.d.ts +0 -30
  159. package/dist/cjs/resources/index.js +0 -34
  160. package/dist/cjs/resources/index.js.map +0 -1
  161. package/dist/cjs/resources/solution-resource.d.ts +0 -35
  162. package/dist/cjs/resources/solution-resource.js +0 -31
  163. package/dist/cjs/resources/solution-resource.js.map +0 -1
  164. package/dist/cjs/resources/transform-resource-paths-to-solution-resources.d.ts +0 -56
  165. package/dist/cjs/resources/transform-resource-paths-to-solution-resources.js +0 -140
  166. package/dist/cjs/resources/transform-resource-paths-to-solution-resources.js.map +0 -1
  167. package/dist/cjs/resources/update-resource.d.ts +0 -27
  168. package/dist/cjs/resources/update-resource.js +0 -52
  169. package/dist/cjs/resources/update-resource.js.map +0 -1
  170. package/dist/cjs/restHelpers.d.ts +0 -634
  171. package/dist/cjs/restHelpers.js +0 -2008
  172. package/dist/cjs/restHelpers.js.map +0 -1
  173. package/dist/cjs/restHelpersGet.d.ts +0 -303
  174. package/dist/cjs/restHelpersGet.js +0 -835
  175. package/dist/cjs/restHelpersGet.js.map +0 -1
  176. package/dist/cjs/sharing/index.d.ts +0 -16
  177. package/dist/cjs/sharing/index.js +0 -20
  178. package/dist/cjs/sharing/index.js.map +0 -1
  179. package/dist/cjs/sharing/share-item-to-groups.d.ts +0 -26
  180. package/dist/cjs/sharing/share-item-to-groups.js +0 -44
  181. package/dist/cjs/sharing/share-item-to-groups.js.map +0 -1
  182. package/dist/cjs/templatization.d.ts +0 -139
  183. package/dist/cjs/templatization.js +0 -311
  184. package/dist/cjs/templatization.js.map +0 -1
  185. package/dist/cjs/trackingHelpers.d.ts +0 -115
  186. package/dist/cjs/trackingHelpers.js +0 -212
  187. package/dist/cjs/trackingHelpers.js.map +0 -1
  188. package/dist/cjs/velocityHelpers.d.ts +0 -68
  189. package/dist/cjs/velocityHelpers.js +0 -151
  190. package/dist/cjs/velocityHelpers.js.map +0 -1
  191. package/dist/cjs/webtoolHelpers.d.ts +0 -57
  192. package/dist/cjs/webtoolHelpers.js +0 -102
  193. package/dist/cjs/webtoolHelpers.js.map +0 -1
  194. package/dist/cjs/workflowHelpers.d.ts +0 -112
  195. package/dist/cjs/workflowHelpers.js +0 -284
  196. package/dist/cjs/workflowHelpers.js.map +0 -1
  197. package/dist/cjs/workforceHelpers.d.ts +0 -121
  198. package/dist/cjs/workforceHelpers.js +0 -720
  199. package/dist/cjs/workforceHelpers.js.map +0 -1
  200. package/dist/cjs/zip-utils.d.ts +0 -85
  201. package/dist/cjs/zip-utils.js +0 -154
  202. package/dist/cjs/zip-utils.js.map +0 -1
  203. package/dist/esm/arcgisRestJS.d.ts +0 -61
  204. package/dist/esm/arcgisRestJS.js +0 -95
  205. package/dist/esm/arcgisRestJS.js.map +0 -1
  206. package/dist/esm/completeItem.d.ts +0 -30
  207. package/dist/esm/completeItem.js +0 -67
  208. package/dist/esm/completeItem.js.map +0 -1
  209. package/dist/esm/create-hub-request-options.d.ts +0 -29
  210. package/dist/esm/create-hub-request-options.js +0 -60
  211. package/dist/esm/create-hub-request-options.js.map +0 -1
  212. package/dist/esm/deleteHelpers/deleteEmptyGroups.d.ts +0 -24
  213. package/dist/esm/deleteHelpers/deleteEmptyGroups.js +0 -38
  214. package/dist/esm/deleteHelpers/deleteEmptyGroups.js.map +0 -1
  215. package/dist/esm/deleteHelpers/deleteGroupIfEmpty.d.ts +0 -27
  216. package/dist/esm/deleteHelpers/deleteGroupIfEmpty.js +0 -95
  217. package/dist/esm/deleteHelpers/deleteGroupIfEmpty.js.map +0 -1
  218. package/dist/esm/deleteHelpers/deleteSolutionContents.d.ts +0 -39
  219. package/dist/esm/deleteHelpers/deleteSolutionContents.js +0 -122
  220. package/dist/esm/deleteHelpers/deleteSolutionContents.js.map +0 -1
  221. package/dist/esm/deleteHelpers/deleteSolutionFolder.d.ts +0 -29
  222. package/dist/esm/deleteHelpers/deleteSolutionFolder.js +0 -77
  223. package/dist/esm/deleteHelpers/deleteSolutionFolder.js.map +0 -1
  224. package/dist/esm/deleteHelpers/deleteSolutionItem.d.ts +0 -31
  225. package/dist/esm/deleteHelpers/deleteSolutionItem.js +0 -48
  226. package/dist/esm/deleteHelpers/deleteSolutionItem.js.map +0 -1
  227. package/dist/esm/deleteHelpers/index.d.ts +0 -22
  228. package/dist/esm/deleteHelpers/index.js +0 -23
  229. package/dist/esm/deleteHelpers/index.js.map +0 -1
  230. package/dist/esm/deleteHelpers/reconstructBuildOrderIds.d.ts +0 -27
  231. package/dist/esm/deleteHelpers/reconstructBuildOrderIds.js +0 -29
  232. package/dist/esm/deleteHelpers/reconstructBuildOrderIds.js.map +0 -1
  233. package/dist/esm/deleteHelpers/removeItems.d.ts +0 -35
  234. package/dist/esm/deleteHelpers/removeItems.js +0 -111
  235. package/dist/esm/deleteHelpers/removeItems.js.map +0 -1
  236. package/dist/esm/deleteHelpers/reportProgress.d.ts +0 -27
  237. package/dist/esm/deleteHelpers/reportProgress.js +0 -42
  238. package/dist/esm/deleteHelpers/reportProgress.js.map +0 -1
  239. package/dist/esm/deleteSolution.d.ts +0 -56
  240. package/dist/esm/deleteSolution.js +0 -101
  241. package/dist/esm/deleteSolution.js.map +0 -1
  242. package/dist/esm/dependencies.d.ts +0 -26
  243. package/dist/esm/dependencies.js +0 -167
  244. package/dist/esm/dependencies.js.map +0 -1
  245. package/dist/esm/featureServiceHelpers.d.ts +0 -847
  246. package/dist/esm/featureServiceHelpers.js +0 -2466
  247. package/dist/esm/featureServiceHelpers.js.map +0 -1
  248. package/dist/esm/formHelpers.d.ts +0 -26
  249. package/dist/esm/formHelpers.js +0 -35
  250. package/dist/esm/formHelpers.js.map +0 -1
  251. package/dist/esm/generalHelpers.d.ts +0 -447
  252. package/dist/esm/generalHelpers.js +0 -903
  253. package/dist/esm/generalHelpers.js.map +0 -1
  254. package/dist/esm/get-subscription-info.d.ts +0 -27
  255. package/dist/esm/get-subscription-info.js +0 -34
  256. package/dist/esm/get-subscription-info.js.map +0 -1
  257. package/dist/esm/getDeletableSolutionInfo.d.ts +0 -30
  258. package/dist/esm/getDeletableSolutionInfo.js +0 -48
  259. package/dist/esm/getDeletableSolutionInfo.js.map +0 -1
  260. package/dist/esm/getItemTypeAbbrev.d.ts +0 -19
  261. package/dist/esm/getItemTypeAbbrev.js +0 -182
  262. package/dist/esm/getItemTypeAbbrev.js.map +0 -1
  263. package/dist/esm/getSolutionSummary.d.ts +0 -28
  264. package/dist/esm/getSolutionSummary.js +0 -95
  265. package/dist/esm/getSolutionSummary.js.map +0 -1
  266. package/dist/esm/index.d.ts +0 -49
  267. package/dist/esm/index.js +0 -50
  268. package/dist/esm/index.js.map +0 -1
  269. package/dist/esm/interfaces.d.ts +0 -1446
  270. package/dist/esm/interfaces.js +0 -69
  271. package/dist/esm/interfaces.js.map +0 -1
  272. package/dist/esm/item-reuse.d.ts +0 -140
  273. package/dist/esm/item-reuse.js +0 -167
  274. package/dist/esm/item-reuse.js.map +0 -1
  275. package/dist/esm/libConnectors.d.ts +0 -73
  276. package/dist/esm/libConnectors.js +0 -105
  277. package/dist/esm/libConnectors.js.map +0 -1
  278. package/dist/esm/migrations/apply-schema.d.ts +0 -24
  279. package/dist/esm/migrations/apply-schema.js +0 -32
  280. package/dist/esm/migrations/apply-schema.js.map +0 -1
  281. package/dist/esm/migrations/is-legacy-solution.d.ts +0 -24
  282. package/dist/esm/migrations/is-legacy-solution.js +0 -35
  283. package/dist/esm/migrations/is-legacy-solution.js.map +0 -1
  284. package/dist/esm/migrations/upgrade-three-dot-one.d.ts +0 -26
  285. package/dist/esm/migrations/upgrade-three-dot-one.js +0 -44
  286. package/dist/esm/migrations/upgrade-three-dot-one.js.map +0 -1
  287. package/dist/esm/migrations/upgrade-three-dot-zero.d.ts +0 -27
  288. package/dist/esm/migrations/upgrade-three-dot-zero.js +0 -39
  289. package/dist/esm/migrations/upgrade-three-dot-zero.js.map +0 -1
  290. package/dist/esm/migrations/upgrade-two-dot-five.d.ts +0 -24
  291. package/dist/esm/migrations/upgrade-two-dot-five.js +0 -69
  292. package/dist/esm/migrations/upgrade-two-dot-five.js.map +0 -1
  293. package/dist/esm/migrations/upgrade-two-dot-four.d.ts +0 -24
  294. package/dist/esm/migrations/upgrade-two-dot-four.js +0 -68
  295. package/dist/esm/migrations/upgrade-two-dot-four.js.map +0 -1
  296. package/dist/esm/migrations/upgrade-two-dot-one.d.ts +0 -7
  297. package/dist/esm/migrations/upgrade-two-dot-one.js +0 -35
  298. package/dist/esm/migrations/upgrade-two-dot-one.js.map +0 -1
  299. package/dist/esm/migrations/upgrade-two-dot-seven.d.ts +0 -23
  300. package/dist/esm/migrations/upgrade-two-dot-seven.js +0 -54
  301. package/dist/esm/migrations/upgrade-two-dot-seven.js.map +0 -1
  302. package/dist/esm/migrations/upgrade-two-dot-six.d.ts +0 -27
  303. package/dist/esm/migrations/upgrade-two-dot-six.js +0 -57
  304. package/dist/esm/migrations/upgrade-two-dot-six.js.map +0 -1
  305. package/dist/esm/migrations/upgrade-two-dot-three.d.ts +0 -23
  306. package/dist/esm/migrations/upgrade-two-dot-three.js +0 -51
  307. package/dist/esm/migrations/upgrade-two-dot-three.js.map +0 -1
  308. package/dist/esm/migrations/upgrade-two-dot-two.d.ts +0 -23
  309. package/dist/esm/migrations/upgrade-two-dot-two.js +0 -54
  310. package/dist/esm/migrations/upgrade-two-dot-two.js.map +0 -1
  311. package/dist/esm/migrations/upgrade-two-dot-zero.d.ts +0 -44
  312. package/dist/esm/migrations/upgrade-two-dot-zero.js +0 -88
  313. package/dist/esm/migrations/upgrade-two-dot-zero.js.map +0 -1
  314. package/dist/esm/migrator.d.ts +0 -25
  315. package/dist/esm/migrator.js +0 -71
  316. package/dist/esm/migrator.js.map +0 -1
  317. package/dist/esm/resourceHelpers.d.ts +0 -192
  318. package/dist/esm/resourceHelpers.js +0 -361
  319. package/dist/esm/resourceHelpers.js.map +0 -1
  320. package/dist/esm/resources/add-resource.d.ts +0 -38
  321. package/dist/esm/resources/add-resource.js +0 -79
  322. package/dist/esm/resources/add-resource.js.map +0 -1
  323. package/dist/esm/resources/addMetadataFromBlob.d.ts +0 -25
  324. package/dist/esm/resources/addMetadataFromBlob.js +0 -39
  325. package/dist/esm/resources/addMetadataFromBlob.js.map +0 -1
  326. package/dist/esm/resources/convert-item-resource-to-storage-resource.d.ts +0 -32
  327. package/dist/esm/resources/convert-item-resource-to-storage-resource.js +0 -66
  328. package/dist/esm/resources/convert-item-resource-to-storage-resource.js.map +0 -1
  329. package/dist/esm/resources/convert-storage-resource-to-item-resource.d.ts +0 -29
  330. package/dist/esm/resources/convert-storage-resource-to-item-resource.js +0 -66
  331. package/dist/esm/resources/convert-storage-resource-to-item-resource.js.map +0 -1
  332. package/dist/esm/resources/copyAssociatedFiles.d.ts +0 -79
  333. package/dist/esm/resources/copyAssociatedFiles.js +0 -339
  334. package/dist/esm/resources/copyAssociatedFiles.js.map +0 -1
  335. package/dist/esm/resources/copyDataIntoItem.d.ts +0 -34
  336. package/dist/esm/resources/copyDataIntoItem.js +0 -40
  337. package/dist/esm/resources/copyDataIntoItem.js.map +0 -1
  338. package/dist/esm/resources/copyMetadataIntoItem.d.ts +0 -27
  339. package/dist/esm/resources/copyMetadataIntoItem.js +0 -40
  340. package/dist/esm/resources/copyMetadataIntoItem.js.map +0 -1
  341. package/dist/esm/resources/copyResourceIntoZip.d.ts +0 -34
  342. package/dist/esm/resources/copyResourceIntoZip.js +0 -69
  343. package/dist/esm/resources/copyResourceIntoZip.js.map +0 -1
  344. package/dist/esm/resources/copyZipIntoItem.d.ts +0 -26
  345. package/dist/esm/resources/copyZipIntoItem.js +0 -49
  346. package/dist/esm/resources/copyZipIntoItem.js.map +0 -1
  347. package/dist/esm/resources/createCopyResults.d.ts +0 -25
  348. package/dist/esm/resources/createCopyResults.js +0 -32
  349. package/dist/esm/resources/createCopyResults.js.map +0 -1
  350. package/dist/esm/resources/get-blob.d.ts +0 -25
  351. package/dist/esm/resources/get-blob.js +0 -38
  352. package/dist/esm/resources/get-blob.js.map +0 -1
  353. package/dist/esm/resources/getItemResourcesFilesFromPaths.d.ts +0 -25
  354. package/dist/esm/resources/getItemResourcesFilesFromPaths.js +0 -45
  355. package/dist/esm/resources/getItemResourcesFilesFromPaths.js.map +0 -1
  356. package/dist/esm/resources/getItemResourcesPaths.d.ts +0 -27
  357. package/dist/esm/resources/getItemResourcesPaths.js +0 -76
  358. package/dist/esm/resources/getItemResourcesPaths.js.map +0 -1
  359. package/dist/esm/resources/index.d.ts +0 -30
  360. package/dist/esm/resources/index.js +0 -31
  361. package/dist/esm/resources/index.js.map +0 -1
  362. package/dist/esm/resources/solution-resource.d.ts +0 -35
  363. package/dist/esm/resources/solution-resource.js +0 -28
  364. package/dist/esm/resources/solution-resource.js.map +0 -1
  365. package/dist/esm/resources/transform-resource-paths-to-solution-resources.d.ts +0 -56
  366. package/dist/esm/resources/transform-resource-paths-to-solution-resources.js +0 -132
  367. package/dist/esm/resources/transform-resource-paths-to-solution-resources.js.map +0 -1
  368. package/dist/esm/resources/update-resource.d.ts +0 -27
  369. package/dist/esm/resources/update-resource.js +0 -48
  370. package/dist/esm/resources/update-resource.js.map +0 -1
  371. package/dist/esm/restHelpers.d.ts +0 -634
  372. package/dist/esm/restHelpers.js +0 -1943
  373. package/dist/esm/restHelpers.js.map +0 -1
  374. package/dist/esm/restHelpersGet.d.ts +0 -303
  375. package/dist/esm/restHelpersGet.js +0 -793
  376. package/dist/esm/restHelpersGet.js.map +0 -1
  377. package/dist/esm/sharing/index.d.ts +0 -16
  378. package/dist/esm/sharing/index.js +0 -17
  379. package/dist/esm/sharing/index.js.map +0 -1
  380. package/dist/esm/sharing/share-item-to-groups.d.ts +0 -26
  381. package/dist/esm/sharing/share-item-to-groups.js +0 -40
  382. package/dist/esm/sharing/share-item-to-groups.js.map +0 -1
  383. package/dist/esm/templatization.d.ts +0 -139
  384. package/dist/esm/templatization.js +0 -291
  385. package/dist/esm/templatization.js.map +0 -1
  386. package/dist/esm/trackingHelpers.d.ts +0 -115
  387. package/dist/esm/trackingHelpers.js +0 -200
  388. package/dist/esm/trackingHelpers.js.map +0 -1
  389. package/dist/esm/velocityHelpers.d.ts +0 -68
  390. package/dist/esm/velocityHelpers.js +0 -144
  391. package/dist/esm/velocityHelpers.js.map +0 -1
  392. package/dist/esm/webtoolHelpers.d.ts +0 -57
  393. package/dist/esm/webtoolHelpers.js +0 -95
  394. package/dist/esm/webtoolHelpers.js.map +0 -1
  395. package/dist/esm/workflowHelpers.d.ts +0 -112
  396. package/dist/esm/workflowHelpers.js +0 -270
  397. package/dist/esm/workflowHelpers.js.map +0 -1
  398. package/dist/esm/workforceHelpers.d.ts +0 -121
  399. package/dist/esm/workforceHelpers.js +0 -691
  400. package/dist/esm/workforceHelpers.js.map +0 -1
  401. package/dist/esm/zip-utils.d.ts +0 -85
  402. package/dist/esm/zip-utils.js +0 -142
  403. package/dist/esm/zip-utils.js.map +0 -1
  404. package/dist/solution.js_commit.txt +0 -7
@@ -1,835 +0,0 @@
1
- "use strict";
2
- /** @license
3
- * Copyright 2018 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.getPortalDefaultBasemap = exports._getItemResourcesTranche = exports._getGroupContentsTranche = exports._fixTextBlobType = exports.getThumbnailFile = exports.getSolutionsRelatedToAnItem = exports.getPortalUrlFromAuth = exports.getPortalSharingUrlFromAuth = exports.getJson = exports.getItemThumbnailUrl = exports.getItemThumbnailAsFile = exports.getItemThumbnail = exports.getItemsRelatedToASolution = exports.getItemResourcesFiles = exports.getItemResources = exports.getItemRelatedItemsInSameDirection = exports.getItemRelatedItems = exports.getItemMetadataBlobUrl = exports.getItemMetadataBlob = exports.getItemMetadataAsFile = exports.getItemInfoFileUrlPrefix = exports.getItemDataBlobUrl = exports.getItemDataBlob = exports.getItemDataAsJson = exports.getItemDataAsFile = exports.getItemBase = exports.getGroupContents = exports.getGroupCategorySchema = exports.getGroupBase = exports.getFilenameFromUrl = exports.getEnterpriseServers = exports.getBlobCheckForError = exports.getBlobAsFile = exports.getFoldersAndGroups = exports.getUsername = exports.getUser = exports.getPortalUrls = exports.getPortal = exports.checkJsonForError = void 0;
19
- /**
20
- * Provides common item fetch functions involving the arcgis-rest-js library.
21
- *
22
- * @module restHelpersGet
23
- */
24
- const generalHelpers_1 = require("./generalHelpers");
25
- const arcgisRestJS_1 = require("./arcgisRestJS");
26
- const get_blob_1 = require("./resources/get-blob");
27
- const restHelpers_1 = require("./restHelpers");
28
- // ------------------------------------------------------------------------------------------------------------------ //
29
- const ZIP_FILE_HEADER_SIGNATURE = "PK";
30
- function checkJsonForError(json) {
31
- return typeof json?.error !== "undefined";
32
- }
33
- exports.checkJsonForError = checkJsonForError;
34
- function getPortal(id, authentication) {
35
- const requestOptions = {
36
- authentication: authentication,
37
- };
38
- return (0, arcgisRestJS_1.restGetPortal)(id, requestOptions);
39
- }
40
- exports.getPortal = getPortal;
41
- /**
42
- * Get the urls available on the portal self.
43
- *
44
- * @param authentication Credentials for the request to AGO
45
- * @returns List of http and https helper urls
46
- */
47
- function getPortalUrls(authentication) {
48
- return new Promise((resolve) => {
49
- const requestOptions = {
50
- httpMethod: "GET",
51
- authentication: authentication,
52
- rawResponse: false,
53
- };
54
- const url = `${authentication.portal}/portals/self/urls`;
55
- (0, arcgisRestJS_1.request)(url, requestOptions).then((response) => {
56
- resolve(response);
57
- }, () => resolve({}));
58
- });
59
- }
60
- exports.getPortalUrls = getPortalUrls;
61
- function getUser(authentication) {
62
- return authentication.getUser();
63
- }
64
- exports.getUser = getUser;
65
- function getUsername(authentication) {
66
- return new Promise((resolve, reject) => {
67
- getUser(authentication).then((user) => resolve(user.username), reject);
68
- });
69
- }
70
- exports.getUsername = getUsername;
71
- function getFoldersAndGroups(authentication) {
72
- return new Promise((resolve, reject) => {
73
- const requestOptions = {
74
- httpMethod: "GET",
75
- authentication: authentication,
76
- rawResponse: false,
77
- };
78
- // Folders
79
- const foldersUrl = `${authentication.portal}/content/users/${encodeURIComponent(authentication.username)}`;
80
- // Groups
81
- const groupsUrl = `${authentication.portal}/community/users/${encodeURIComponent(authentication.username)}`;
82
- Promise.all([(0, arcgisRestJS_1.request)(foldersUrl, requestOptions), (0, arcgisRestJS_1.request)(groupsUrl, requestOptions)]).then((responses) => {
83
- resolve({
84
- folders: responses[0].folders || [],
85
- groups: responses[1].groups || [],
86
- });
87
- }, (e) => reject(e));
88
- });
89
- }
90
- exports.getFoldersAndGroups = getFoldersAndGroups;
91
- /**
92
- * Gets a Blob from a web site and casts it as a file using the supplied name.
93
- *
94
- * @param url Address of Blob
95
- * @param filename Name to use for file
96
- * @param authentication Credentials for the request
97
- * @returns Promise that will resolve with a File, undefined if the Blob is null, or an AGO-style JSON failure response
98
- */
99
- function getBlobAsFile(url, filename, authentication, ignoreErrors = [], mimeType) {
100
- return new Promise((resolve, reject) => {
101
- // Get the blob from the URL
102
- getBlobCheckForError(url, authentication, ignoreErrors).then((blob) => (!blob ? resolve(null) : resolve((0, generalHelpers_1.blobToFile)(blob, filename, mimeType))), reject);
103
- });
104
- }
105
- exports.getBlobAsFile = getBlobAsFile;
106
- /**
107
- * Gets a Blob from a web site and checks for a JSON error packet in the Blob.
108
- *
109
- * @param url Address of Blob
110
- * @param authentication Credentials for the request
111
- * @param ignoreErrors List of HTTP error codes that should be ignored
112
- * @returns Promise that will resolve with Blob or an AGO-REST JSON failure response
113
- */
114
- function getBlobCheckForError(url, authentication, ignoreErrors = []) {
115
- return new Promise((resolve, reject) => {
116
- // Get the blob from the URL
117
- (0, get_blob_1.getBlob)(url, authentication).then((blob) => {
118
- // Reclassify text/plain blobs as needed
119
- _fixTextBlobType(blob).then((adjustedBlob) => {
120
- if (adjustedBlob.type === "application/json") {
121
- // Blob may be an error
122
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
123
- (0, generalHelpers_1.blobToJson)(adjustedBlob).then((json) => {
124
- // Check for valid JSON with an error
125
- if (json?.error) {
126
- const code = json.error.code;
127
- if (code !== undefined && ignoreErrors.indexOf(code) >= 0) {
128
- resolve(null); // Error, but ignored
129
- }
130
- else {
131
- reject(json); // Other error; fail with error
132
- }
133
- }
134
- else {
135
- resolve(adjustedBlob);
136
- }
137
- });
138
- }
139
- else {
140
- resolve(adjustedBlob);
141
- }
142
- }, reject);
143
- }, reject);
144
- });
145
- }
146
- exports.getBlobCheckForError = getBlobCheckForError;
147
- /**
148
- * Get the servers available on the Enterprise portal.
149
- *
150
- * @param portalRestUrl URL of the portal REST endpoint, e.g., "https://gisserver.domain.com/server/rest/services"
151
- * @param authentication Credentials for the request to AGO
152
- * @returns List of servers available on the portal
153
- */
154
- async function getEnterpriseServers(portalRestUrl, authentication) {
155
- // Get the servers
156
- const getServersURL = `${portalRestUrl}/portals/self/servers`;
157
- const serversJSON = await (0, arcgisRestJS_1.request)(getServersURL, {
158
- authentication,
159
- httpMethod: "GET",
160
- params: {
161
- f: "json",
162
- },
163
- });
164
- return serversJSON.servers;
165
- }
166
- exports.getEnterpriseServers = getEnterpriseServers;
167
- /**
168
- * Extracts the text in a url between the last forward slash and the beginning of the url's parameters.
169
- *
170
- * @param url URL to work with
171
- * @returns Text extracted; empty if url ends with a forward slash or has a "?" immediately after the last
172
- * forward slash
173
- */
174
- function getFilenameFromUrl(url) {
175
- if (!url) {
176
- return "";
177
- }
178
- let iParamsStart = url.indexOf("?");
179
- /* istanbul ignore else */
180
- if (iParamsStart < 0) {
181
- iParamsStart = url.length;
182
- }
183
- const iFilenameStart = url.lastIndexOf("/", iParamsStart) + 1;
184
- return iFilenameStart < iParamsStart ? url.substring(iFilenameStart, iParamsStart) : "";
185
- }
186
- exports.getFilenameFromUrl = getFilenameFromUrl;
187
- /**
188
- * Gets the primary information of an AGO group.
189
- *
190
- * @param groupId Id of an group whose primary information is sought
191
- * @param authentication Credentials for the request to AGO
192
- * @returns A promise that will resolve with group's JSON or error JSON or throws ArcGISRequestError in case of HTTP error
193
- * or response error code
194
- */
195
- function getGroupBase(groupId, authentication) {
196
- const requestOptions = {
197
- authentication: authentication,
198
- };
199
- return (0, arcgisRestJS_1.getGroup)(groupId, requestOptions);
200
- }
201
- exports.getGroupBase = getGroupBase;
202
- /**
203
- * Gets the category schema set on a group.
204
- *
205
- * @param groupId Id of an group whose category schema information is sought
206
- * @param authentication Credentials for the request to AGO
207
- * @returns A promise that will resolve with JSON of group's category schema
208
- * @see https://developers.arcgis.com/rest/users-groups-and-items/group-category-schema.htm
209
- */
210
- function getGroupCategorySchema(groupId, authentication) {
211
- const requestOptions = {
212
- authentication: authentication,
213
- };
214
- return (0, arcgisRestJS_1.restGetGroupCategorySchema)(groupId, requestOptions);
215
- }
216
- exports.getGroupCategorySchema = getGroupCategorySchema;
217
- /**
218
- * Gets the ids of the dependencies (contents) of an AGO group.
219
- *
220
- * @param groupId Id of a group whose contents are sought
221
- * @param authentication Credentials for the request to AGO
222
- * @returns A promise that will resolve with list of dependent ids or an empty list
223
- */
224
- function getGroupContents(groupId, authentication) {
225
- return new Promise((resolve, reject) => {
226
- const pagingParams = {
227
- start: 1,
228
- num: 100, // max allowed by REST API
229
- };
230
- // Fetch group items
231
- _getGroupContentsTranche(groupId, pagingParams, authentication).then((contents) => {
232
- resolve(contents);
233
- }, reject);
234
- });
235
- }
236
- exports.getGroupContents = getGroupContents;
237
- /**
238
- * Gets the primary information of an AGO item.
239
- *
240
- * @param itemId Id of an item whose primary information is sought
241
- * @param authentication Credentials for the request to AGO
242
- * @returns A promise that will resolve with item's JSON or error JSON or throws ArcGISRequestError in case of HTTP error
243
- * or response error code
244
- */
245
- function getItemBase(itemId, authentication) {
246
- const itemParam = {
247
- authentication: authentication,
248
- };
249
- return (0, arcgisRestJS_1.getItem)(itemId, itemParam);
250
- }
251
- exports.getItemBase = getItemBase;
252
- /**
253
- * Gets the data information of an AGO item in its raw (Blob) form and casts it as a file using the supplied name.
254
- *
255
- * @param itemId Id of an item whose data information is sought
256
- * @param filename Name to use for file
257
- * @param authentication Credentials for the request to AGO
258
- * @returns Promise that will resolve with a File, undefined if the Blob is null, or an AGO-style JSON failure response
259
- */
260
- function getItemDataAsFile(itemId, filename, authentication) {
261
- return new Promise((resolve) => {
262
- getItemDataBlob(itemId, authentication).then((blob) => resolve((0, generalHelpers_1.blobToFile)(blob, filename)), () => resolve(null));
263
- });
264
- }
265
- exports.getItemDataAsFile = getItemDataAsFile;
266
- /**
267
- * Gets the data information of an AGO item in its JSON form.
268
- *
269
- * @param itemId Id of an item whose data information is sought
270
- * @param filename Name to use for file
271
- * @param authentication Credentials for the request to AGO
272
- * @returns Promise that will resolve with JSON, or an AGO-style JSON failure response
273
- */
274
- function getItemDataAsJson(itemId, authentication) {
275
- return new Promise((resolve) => {
276
- getItemDataBlob(itemId, authentication).then((blob) => resolve((0, generalHelpers_1.blobToJson)(blob)), () => resolve(null));
277
- });
278
- }
279
- exports.getItemDataAsJson = getItemDataAsJson;
280
- /**
281
- * Gets the data information of an AGO item in its raw (Blob) form.
282
- *
283
- * @param itemId Id of an item whose data information is sought
284
- * @param authentication Credentials for the request to AGO
285
- * @returns A promise that will resolve with the data Blob or null if the item doesn't have a data section
286
- */
287
- function getItemDataBlob(itemId, authentication) {
288
- return new Promise((resolve) => {
289
- const url = getItemDataBlobUrl(itemId, authentication);
290
- getBlobCheckForError(url, authentication, [400, 500]).then((blob) => resolve(_fixTextBlobType(blob)), () => resolve(null));
291
- });
292
- }
293
- exports.getItemDataBlob = getItemDataBlob;
294
- /**
295
- * Gets the URL to the data information of an AGO item in its raw (Blob) form.
296
- *
297
- * @param itemId Id of an item whose data information is sought
298
- * @param authentication Credentials for the request to AGO
299
- * @returns URL string
300
- */
301
- function getItemDataBlobUrl(itemId, authentication) {
302
- return `${getPortalSharingUrlFromAuth(authentication)}/content/items/${itemId}/data`;
303
- }
304
- exports.getItemDataBlobUrl = getItemDataBlobUrl;
305
- /**
306
- * Gets the URL to an information item in an AGO item.
307
- *
308
- * @param itemId Id of an item whose data information is sought
309
- * @param authentication Credentials for the request to AGO
310
- * @returns URL string
311
- */
312
- function getItemInfoFileUrlPrefix(itemId, authentication) {
313
- return `${getPortalSharingUrlFromAuth(authentication)}/content/items/${itemId}/info/`;
314
- }
315
- exports.getItemInfoFileUrlPrefix = getItemInfoFileUrlPrefix;
316
- /**
317
- * Gets the metadata information of an AGO item.
318
- *
319
- * @param itemId Id of an item whose data information is sought
320
- * @param authentication Credentials for the request to AGO
321
- * @returns Promise that will resolve with `undefined` or a File containing the metadata
322
- */
323
- function getItemMetadataAsFile(itemId, authentication) {
324
- return new Promise((resolve) => {
325
- getItemMetadataBlob(itemId, authentication).then((blob) => {
326
- if (!blob || (blob && blob.type.startsWith("application/json"))) {
327
- resolve(null); // JSON error
328
- }
329
- else {
330
- resolve((0, generalHelpers_1.blobToFile)(blob, "metadata.xml"));
331
- }
332
- }, () => resolve(null));
333
- });
334
- }
335
- exports.getItemMetadataAsFile = getItemMetadataAsFile;
336
- /**
337
- * Gets the metadata information of an AGO item.
338
- *
339
- * @param itemId Id of an item whose data information is sought
340
- * @param authentication Credentials for the request to AGO
341
- * @returns A promise that will resolve with the metadata Blob or null if the item doesn't have a metadata file
342
- */
343
- function getItemMetadataBlob(itemId, authentication) {
344
- return new Promise((resolve, reject) => {
345
- const url = getItemMetadataBlobUrl(itemId, authentication);
346
- getBlobCheckForError(url, authentication, [400]).then(resolve, reject);
347
- });
348
- }
349
- exports.getItemMetadataBlob = getItemMetadataBlob;
350
- /**
351
- * Gets the URL to the metadata information of an AGO item.
352
- *
353
- * @param itemId Id of an item whose data information is sought
354
- * @param authentication Credentials for the request to AGO
355
- * @returns URL string
356
- */
357
- function getItemMetadataBlobUrl(itemId, authentication) {
358
- return getItemInfoFileUrlPrefix(itemId, authentication) + "metadata/metadata.xml";
359
- }
360
- exports.getItemMetadataBlobUrl = getItemMetadataBlobUrl;
361
- /**
362
- * Gets the related items of an AGO item.
363
- *
364
- * @param itemId Id of an item whose related items are sought
365
- * @param relationshipType Tag for relationship type, e.g., "Solution2Item"
366
- * @param direction Relationship direction
367
- * @param authentication Credentials for the request to AGO
368
- * @param num Number of related items to request per batch; maximum is 100
369
- * @returns A promise that will resolve with the list of related items
370
- */
371
- function getItemRelatedItems(itemId, relationshipType, direction, authentication, num = 100) {
372
- return new Promise((resolve) => {
373
- const itemRelatedItemsParam = {
374
- id: itemId,
375
- relationshipType,
376
- authentication: authentication,
377
- params: {
378
- direction,
379
- start: 1,
380
- num,
381
- },
382
- };
383
- // Fetch related items
384
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
385
- _getItemRelatedItemsTranche(itemRelatedItemsParam).then((response) => {
386
- resolve(response);
387
- });
388
- });
389
- }
390
- exports.getItemRelatedItems = getItemRelatedItems;
391
- /**
392
- * Gets all of the related items of an AGO item in the specified direction.
393
- *
394
- * @param itemId Id of an item whose related items are sought
395
- * @param direction
396
- * @param authentication Credentials for the request to AGO
397
- * @returns A promise that will resolve with a list of IRelatedItems
398
- */
399
- function getItemRelatedItemsInSameDirection(itemId, direction, authentication) {
400
- return new Promise((resolve) => {
401
- const relationshipTypes = [
402
- // from ItemRelationshipType
403
- "APIKey2Item",
404
- "Area2CustomPackage",
405
- "Area2Package",
406
- "Item2Attachment",
407
- "Item2Report",
408
- "Listed2Provisioned",
409
- "Map2AppConfig",
410
- "Map2Area",
411
- "Map2FeatureCollection",
412
- "Map2Service",
413
- "MobileApp2Code",
414
- "Service2Data",
415
- "Service2Layer",
416
- "Service2Route",
417
- "Service2Service",
418
- "Service2Style",
419
- "Solution2Item",
420
- "Style2Style",
421
- "Survey2Data",
422
- "Survey2Service",
423
- "SurveyAddIn2Data",
424
- "Theme2Story",
425
- "TrackView2Map",
426
- "WebStyle2DesktopStyle",
427
- "WMA2Code",
428
- "WorkforceMap2FeatureService",
429
- ];
430
- const relatedItemDefs = relationshipTypes.map((relationshipType) => getItemRelatedItems(itemId, relationshipType, direction, authentication));
431
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
432
- Promise.all(relatedItemDefs).then((relationshipResponses) => {
433
- const relatedItems = [];
434
- for (let i = 0; i < relationshipTypes.length; ++i) {
435
- if (relationshipResponses[i].total > 0) {
436
- relatedItems.push({
437
- relationshipType: relationshipTypes[i],
438
- relatedItemIds: relationshipResponses[i].relatedItems.map((item) => item.id),
439
- });
440
- }
441
- }
442
- resolve(relatedItems);
443
- });
444
- });
445
- }
446
- exports.getItemRelatedItemsInSameDirection = getItemRelatedItemsInSameDirection;
447
- function getItemResources(id, authentication) {
448
- return new Promise((resolve) => {
449
- const requestOptions = {
450
- authentication: authentication,
451
- };
452
- (0, arcgisRestJS_1.restGetItemResources)(id, requestOptions).then(resolve, () => {
453
- resolve({
454
- total: 0,
455
- start: 1,
456
- num: 0,
457
- nextStart: -1,
458
- resources: [],
459
- });
460
- });
461
- });
462
- }
463
- exports.getItemResources = getItemResources;
464
- /**
465
- * Gets the resources of an AGO item.
466
- *
467
- * @param itemId Id of an item whose resources are sought
468
- * @param authentication Credentials for the request to AGO
469
- * @returns Promise that will resolve with a list of Files or an AGO-style JSON failure response
470
- */
471
- function getItemResourcesFiles(itemId, authentication) {
472
- return new Promise((resolve, reject) => {
473
- const pagingParams = {
474
- start: 1,
475
- num: 100, // max allowed by REST API
476
- };
477
- // Fetch resources
478
- _getItemResourcesTranche(itemId, pagingParams, authentication).then((itemResourcesDef) => {
479
- Promise.all(itemResourcesDef).then(resolve, reject);
480
- }, reject);
481
- });
482
- }
483
- exports.getItemResourcesFiles = getItemResourcesFiles;
484
- /**
485
- * Gets all of the items associated with a Solution via a Solution2Item relationship.
486
- *
487
- * @param solutionItemId Id of a deployed Solution
488
- * @param authentication Credentials for the request
489
- * @returns Promise resolving to a list of detailed item information
490
- */
491
- function getItemsRelatedToASolution(solutionItemId, authentication) {
492
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
493
- return getItemRelatedItems(solutionItemId, "Solution2Item", "forward", authentication).then((relationshipResponse) => {
494
- return relationshipResponse.relatedItems;
495
- });
496
- }
497
- exports.getItemsRelatedToASolution = getItemsRelatedToASolution;
498
- /**
499
- * Gets the thumbnail of an AGO item.
500
- *
501
- * @param itemId Id of an item whose resources are sought
502
- * @param thumbnailUrlPart The partial name of the item's thumbnail as reported by the `thumbnail` property
503
- * in the item's base section
504
- * @param isGroup Switch indicating if the item is a group
505
- * @param authentication Credentials for the request to AGO
506
- * @returns Promise that will resolve with an image Blob or an AGO-style JSON failure response
507
- */
508
- function getItemThumbnail(itemId, thumbnailUrlPart, isGroup, authentication) {
509
- return new Promise((resolve, reject) => {
510
- if (!thumbnailUrlPart) {
511
- resolve(null);
512
- return;
513
- }
514
- const url = getItemThumbnailUrl(itemId, thumbnailUrlPart, isGroup, authentication);
515
- getBlobCheckForError(url, authentication, [500]).then((blob) => resolve(_fixTextBlobType(blob)), reject);
516
- });
517
- }
518
- exports.getItemThumbnail = getItemThumbnail;
519
- /**
520
- * Gets the thumbnail of an AGO item.
521
- *
522
- * @param itemId Id of an item whose resources are sought
523
- * @param thumbnailUrlPart The partial name of the item's thumbnail as reported by the `thumbnail` property
524
- * in the item's base section
525
- * @param isGroup Switch indicating if the item is a group
526
- * @param authentication Credentials for the request to AGO
527
- * @returns Promise that will resolve with an image Blob or an AGO-style JSON failure response
528
- */
529
- function getItemThumbnailAsFile(itemId, thumbnailUrlPart, isGroup, authentication) {
530
- return new Promise((resolve, reject) => {
531
- /* istanbul ignore else */
532
- if (!thumbnailUrlPart) {
533
- resolve(null);
534
- return;
535
- }
536
- const url = getItemThumbnailUrl(itemId, thumbnailUrlPart, isGroup, authentication);
537
- const iFilenameStart = thumbnailUrlPart.lastIndexOf("/") + 1;
538
- const filename = thumbnailUrlPart.substring(iFilenameStart);
539
- getBlobAsFile(url, filename, authentication, [400, 500]).then(resolve, reject);
540
- });
541
- }
542
- exports.getItemThumbnailAsFile = getItemThumbnailAsFile;
543
- /**
544
- * Gets the URL to the thumbnail of an AGO item.
545
- *
546
- * @param itemId Id of an item whose resources are sought
547
- * @param thumbnailUrlPart The partial name of the item's thumbnail as reported by the `thumbnail` property
548
- * in the item's base section
549
- * @param isGroup Switch indicating if the item is a group
550
- * @param authentication Credentials for the request to AGO
551
- * @returns URL string
552
- */
553
- function getItemThumbnailUrl(itemId, thumbnailUrlPart, isGroup, authentication) {
554
- return ((0, generalHelpers_1.checkUrlPathTermination)(getPortalSharingUrlFromAuth(authentication)) +
555
- (isGroup ? "community/groups/" : "content/items/") +
556
- itemId +
557
- "/info/" +
558
- thumbnailUrlPart);
559
- }
560
- exports.getItemThumbnailUrl = getItemThumbnailUrl;
561
- /**
562
- * Gets a JSON from a web site.
563
- *
564
- * @param url Address of JSON
565
- * @param authentication Credentials for the request
566
- * @returns Promise that will resolve with JSON
567
- */
568
- function getJson(url, authentication) {
569
- // Get the blob from the URL
570
- const requestOptions = { httpMethod: "GET" };
571
- return (0, get_blob_1.getBlob)(url, authentication, requestOptions)
572
- .then((blob) => {
573
- // Reclassify text/plain blobs as needed
574
- return _fixTextBlobType(blob);
575
- })
576
- .then((adjustedBlob) => {
577
- if (adjustedBlob.type === "application/json") {
578
- // Blob may be an error
579
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
580
- return (0, generalHelpers_1.blobToJson)(adjustedBlob);
581
- }
582
- else {
583
- return Promise.resolve(null);
584
- }
585
- });
586
- }
587
- exports.getJson = getJson;
588
- /**
589
- * Extracts the portal sharing url from a supplied authentication.
590
- *
591
- * @param authentication Credentials for the request to AGO
592
- * @returns Portal sharing url to be used in API requests, defaulting to `https://www.arcgis.com/sharing/rest`
593
- */
594
- function getPortalSharingUrlFromAuth(authentication) {
595
- // If auth was passed, use that portal
596
- return (0, generalHelpers_1.getProp)(authentication, "portal") || "https://www.arcgis.com/sharing/rest";
597
- }
598
- exports.getPortalSharingUrlFromAuth = getPortalSharingUrlFromAuth;
599
- /**
600
- * Extracts the portal url from a supplied authentication.
601
- *
602
- * @param authentication Credentials for the request to AGO
603
- * @returns Portal url to be used in API requests, defaulting to `https://www.arcgis.com`
604
- */
605
- function getPortalUrlFromAuth(authentication) {
606
- return getPortalSharingUrlFromAuth(authentication).replace("/sharing/rest", "");
607
- }
608
- exports.getPortalUrlFromAuth = getPortalUrlFromAuth;
609
- /**
610
- * Gets the ids of all Solution items associated with an AGO item via a Solution2Item relationship.
611
- *
612
- * @param itemId Id of an AGO item to query
613
- * @param authentication Credentials for the request
614
- * @returns Promise resolving to a list of Solution item ids
615
- */
616
- function getSolutionsRelatedToAnItem(itemId, authentication) {
617
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
618
- return getItemRelatedItems(itemId, "Solution2Item", "reverse", authentication).then((relationshipResponse) => {
619
- return relationshipResponse.relatedItems.map((item) => item.id);
620
- });
621
- }
622
- exports.getSolutionsRelatedToAnItem = getSolutionsRelatedToAnItem;
623
- function getThumbnailFile(url, filename, authentication) {
624
- return new Promise((resolve) => {
625
- getBlobAsFile(url, filename, authentication, [500]).then(resolve, () => resolve(null));
626
- });
627
- }
628
- exports.getThumbnailFile = getThumbnailFile;
629
- // ------------------------------------------------------------------------------------------------------------------ //
630
- /**
631
- * Fixes the types of Blobs incorrectly typed as text/plain.
632
- *
633
- * @param blob Blob to check
634
- * @returns Promise resolving to original Blob, unless it's originally typed as text/plain but is
635
- * really JSON, ZIP, or XML
636
- * @private
637
- */
638
- function _fixTextBlobType(blob) {
639
- return new Promise((resolve, reject) => {
640
- if (blob && blob.size > 0 && (blob.type.startsWith("text/plain") || blob.type.startsWith("application/json"))) {
641
- (0, generalHelpers_1.blobToText)(blob).then((blobText) => {
642
- // Convertible to JSON?
643
- try {
644
- JSON.parse(blobText);
645
- // Yes; reclassify as JSON
646
- resolve(new Blob([blob], { type: "application/json" }));
647
- }
648
- catch (ignored) {
649
- // Nope; test for ZIP file
650
- if (blobText.length > 4 && blobText.substr(0, 4) === ZIP_FILE_HEADER_SIGNATURE) {
651
- // Yes; reclassify as ZIP
652
- resolve(new Blob([blob], { type: "application/zip" }));
653
- }
654
- else if (blobText.startsWith("<")) {
655
- // Reclassify as XML; since the blob started out as text/plain, it's more likely that is
656
- // meant to be human-readable, so we'll use text/xml instead of application/xml
657
- resolve(new Blob([blob], { type: "text/xml" }));
658
- }
659
- else {
660
- // Leave as text
661
- resolve(blob);
662
- }
663
- }
664
- },
665
- // Faulty blob
666
- reject);
667
- }
668
- else {
669
- // Empty or not typed as plain text, so simply return
670
- if (blob) {
671
- resolve(blob);
672
- }
673
- else {
674
- reject();
675
- }
676
- }
677
- });
678
- }
679
- exports._fixTextBlobType = _fixTextBlobType;
680
- /**
681
- * Gets some of the ids of the dependencies (contents) of an AGO group.
682
- *
683
- * @param groupId Id of a group whose contents are sought
684
- * @param pagingParams Structure with start and num properties for the tranche to fetch
685
- * @param authentication Credentials for the request to AGO
686
- * @returns A promise that will resolve with list of dependent ids or an empty list
687
- * @private
688
- */
689
- function _getGroupContentsTranche(groupId, pagingParams, authentication) {
690
- return new Promise((resolve, reject) => {
691
- // Fetch group items
692
- const pagingRequest = {
693
- paging: pagingParams,
694
- authentication: authentication,
695
- };
696
- (0, arcgisRestJS_1.getGroupContent)(groupId, pagingRequest).then((contents) => {
697
- if (contents.num > 0) {
698
- // Extract the list of content ids from the JSON returned
699
- const trancheIds = contents.items.map((item) => item.id);
700
- // Are there more contents to fetch?
701
- if (contents.nextStart > 0) {
702
- pagingRequest.paging.start = contents.nextStart;
703
- _getGroupContentsTranche(groupId, pagingParams, authentication).then((allSubsequentTrancheIds) => {
704
- // Append all of the following tranches to the current tranche and return it
705
- resolve(trancheIds.concat(allSubsequentTrancheIds));
706
- }, reject);
707
- }
708
- else {
709
- resolve(trancheIds);
710
- }
711
- }
712
- else {
713
- resolve([]);
714
- }
715
- }, reject);
716
- });
717
- }
718
- exports._getGroupContentsTranche = _getGroupContentsTranche;
719
- /**
720
- * Gets some of the related items of an AGO item.
721
- *
722
- * @param requestOptions Item id, relationship type, relationship direction, authentication, and paging
723
- * @returns A promise that will resolve with the list of related items
724
- * @private
725
- */
726
- function _getItemRelatedItemsTranche(requestOptions) {
727
- return new Promise((resolve) => {
728
- const response = {
729
- total: 0,
730
- relatedItems: [],
731
- };
732
- (0, arcgisRestJS_1.getRelatedItems)(requestOptions).then(
733
- // Have to use `any` because `IGetRelatedItemsResponse` doesn't include all of the response properties
734
- (results) => {
735
- // IGetRelatedItemsResponseFull
736
- // Are there any results?
737
- if (results.aggregations.total.count > 0) {
738
- response.total = results.aggregations.total.count;
739
- response.relatedItems = results.relatedItems;
740
- // Are there more items to fetch?
741
- if (results.nextkey) {
742
- requestOptions.params.start += requestOptions.params.num;
743
- requestOptions.params.nextkey = results.nextkey;
744
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
745
- _getItemRelatedItemsTranche(requestOptions).then((allSubsequentResults) => {
746
- // Append all of the following tranches to the current tranche and return it
747
- response.total += allSubsequentResults.total;
748
- response.relatedItems = response.relatedItems.concat(allSubsequentResults.relatedItems);
749
- resolve(response);
750
- });
751
- }
752
- else {
753
- resolve(response);
754
- }
755
- }
756
- else {
757
- resolve(response);
758
- }
759
- }, () => {
760
- resolve(response);
761
- });
762
- });
763
- }
764
- /**
765
- * Gets some of the resources of an AGO item.
766
- *
767
- * @param itemId Id of an item whose resources are sought
768
- * @param pagingParams Structure with start and num properties for the tranche to fetch
769
- * @param authentication Credentials for the request to AGO
770
- * @returns Promise that will resolve with a list of File promises or an AGO-style JSON failure response
771
- * @private
772
- */
773
- function _getItemResourcesTranche(itemId, pagingParams, authentication) {
774
- return new Promise((resolve, reject) => {
775
- // Fetch resources
776
- const portalSharingUrl = getPortalSharingUrlFromAuth(authentication);
777
- const trancheUrl = `${portalSharingUrl}/content/items/${itemId}/resources`;
778
- const itemResourcesDef = [];
779
- const options = {
780
- params: {
781
- ...pagingParams,
782
- },
783
- authentication: authentication,
784
- };
785
- (0, arcgisRestJS_1.request)(trancheUrl, options).then((contents) => {
786
- if (contents.num > 0) {
787
- // Extract the list of resource filenames from the JSON returned
788
- contents.resources.forEach((resource) => {
789
- const itemResourceUrl = `${portalSharingUrl}/content/items/${itemId}/resources/${resource.resource}`;
790
- itemResourcesDef.push(getBlobAsFile(itemResourceUrl, resource.resource, authentication));
791
- });
792
- // Are there more resources to fetch?
793
- if (contents.nextStart > 0) {
794
- pagingParams.start = contents.nextStart;
795
- _getItemResourcesTranche(itemId, pagingParams, authentication).then((allSubsequentTrancheDefs) => {
796
- // Append all of the following tranches to the current tranche and return it
797
- resolve(itemResourcesDef.concat(allSubsequentTrancheDefs));
798
- }, reject);
799
- }
800
- else {
801
- resolve(itemResourcesDef);
802
- }
803
- }
804
- else {
805
- resolve([]);
806
- }
807
- }, reject);
808
- });
809
- }
810
- exports._getItemResourcesTranche = _getItemResourcesTranche;
811
- /**
812
- * Retrieves the default basemap for the given & basemapGalleryGroupQuery, basemapTitle
813
- *
814
- * @param {string} basemapGalleryGroupQuery The default basemap group query
815
- * @param {string} basemapTitle The default basemap title
816
- * @param {UserSession} authentication The session info
817
- * @returns {IItem}
818
- */
819
- function getPortalDefaultBasemap(basemapGalleryGroupQuery, basemapTitle, authentication) {
820
- return (0, restHelpers_1.searchGroups)(basemapGalleryGroupQuery, authentication, { num: 1 })
821
- .then(({ results: [basemapGroup] }) => {
822
- if (!basemapGroup) {
823
- throw new Error("No basemap group found");
824
- }
825
- return (0, restHelpers_1.searchGroupContents)(basemapGroup.id, `title:${basemapTitle}`, authentication, { num: 1 });
826
- })
827
- .then(({ results: [defaultBasemap] }) => {
828
- if (!defaultBasemap) {
829
- throw new Error("No basemap found");
830
- }
831
- return defaultBasemap;
832
- });
833
- }
834
- exports.getPortalDefaultBasemap = getPortalDefaultBasemap;
835
- //# sourceMappingURL=restHelpersGet.js.map