@esri/solution-common 4.1.2 → 5.0.0

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 (261) hide show
  1. package/dist/cjs/completeItem.d.ts +29 -29
  2. package/dist/cjs/completeItem.js +81 -81
  3. package/dist/cjs/create-hub-request-options.d.ts +29 -29
  4. package/dist/cjs/create-hub-request-options.js +63 -63
  5. package/dist/cjs/deleteHelpers/deleteEmptyGroups.d.ts +24 -24
  6. package/dist/cjs/deleteHelpers/deleteEmptyGroups.js +41 -41
  7. package/dist/cjs/deleteHelpers/deleteGroupIfEmpty.d.ts +27 -27
  8. package/dist/cjs/deleteHelpers/deleteGroupIfEmpty.js +96 -96
  9. package/dist/cjs/deleteHelpers/deleteSolutionContents.d.ts +38 -38
  10. package/dist/cjs/deleteHelpers/deleteSolutionContents.js +129 -129
  11. package/dist/cjs/deleteHelpers/deleteSolutionFolder.d.ts +29 -29
  12. package/dist/cjs/deleteHelpers/deleteSolutionFolder.js +78 -78
  13. package/dist/cjs/deleteHelpers/deleteSolutionItem.d.ts +30 -30
  14. package/dist/cjs/deleteHelpers/deleteSolutionItem.js +53 -53
  15. package/dist/cjs/deleteHelpers/index.d.ts +22 -22
  16. package/dist/cjs/deleteHelpers/index.js +25 -25
  17. package/dist/cjs/deleteHelpers/reconstructBuildOrderIds.d.ts +27 -27
  18. package/dist/cjs/deleteHelpers/reconstructBuildOrderIds.js +33 -33
  19. package/dist/cjs/deleteHelpers/removeItems.d.ts +34 -34
  20. package/dist/cjs/deleteHelpers/removeItems.js +111 -111
  21. package/dist/cjs/deleteHelpers/reportProgress.d.ts +27 -27
  22. package/dist/cjs/deleteHelpers/reportProgress.js +45 -45
  23. package/dist/cjs/deleteSolution.d.ts +55 -55
  24. package/dist/cjs/deleteSolution.js +106 -106
  25. package/dist/cjs/dependencies.d.ts +26 -26
  26. package/dist/cjs/dependencies.js +170 -170
  27. package/dist/cjs/featureServiceHelpers.d.ts +791 -791
  28. package/dist/cjs/featureServiceHelpers.js +2420 -2420
  29. package/dist/cjs/generalHelpers.d.ts +392 -385
  30. package/dist/cjs/generalHelpers.js +857 -854
  31. package/dist/cjs/generalHelpers.js.map +1 -1
  32. package/dist/cjs/get-subscription-info.d.ts +27 -27
  33. package/dist/cjs/get-subscription-info.js +38 -38
  34. package/dist/cjs/getDeletableSolutionInfo.d.ts +29 -29
  35. package/dist/cjs/getDeletableSolutionInfo.js +52 -52
  36. package/dist/cjs/getItemTypeAbbrev.d.ts +19 -19
  37. package/dist/cjs/getItemTypeAbbrev.js +184 -184
  38. package/dist/cjs/getSolutionSummary.d.ts +27 -27
  39. package/dist/cjs/getSolutionSummary.js +100 -100
  40. package/dist/cjs/index.d.ts +43 -44
  41. package/dist/cjs/index.js +46 -47
  42. package/dist/cjs/index.js.map +1 -1
  43. package/dist/cjs/interfaces.d.ts +1334 -1334
  44. package/dist/cjs/interfaces.js +74 -74
  45. package/dist/cjs/interfaces.js.map +1 -1
  46. package/dist/cjs/libConnectors.d.ts +73 -73
  47. package/dist/cjs/libConnectors.js +114 -114
  48. package/dist/cjs/migrations/apply-schema.d.ts +24 -24
  49. package/dist/cjs/migrations/apply-schema.js +35 -35
  50. package/dist/cjs/migrations/is-legacy-solution.d.ts +24 -24
  51. package/dist/cjs/migrations/is-legacy-solution.js +39 -39
  52. package/dist/cjs/migrations/upgrade-three-dot-one.d.ts +27 -27
  53. package/dist/cjs/migrations/upgrade-three-dot-one.js +48 -48
  54. package/dist/cjs/migrations/upgrade-three-dot-zero.d.ts +27 -27
  55. package/dist/cjs/migrations/upgrade-three-dot-zero.js +42 -42
  56. package/dist/cjs/migrations/upgrade-two-dot-five.d.ts +24 -24
  57. package/dist/cjs/migrations/upgrade-two-dot-five.js +72 -72
  58. package/dist/cjs/migrations/upgrade-two-dot-four.d.ts +24 -24
  59. package/dist/cjs/migrations/upgrade-two-dot-four.js +71 -71
  60. package/dist/cjs/migrations/upgrade-two-dot-one.d.ts +7 -7
  61. package/dist/cjs/migrations/upgrade-two-dot-one.js +38 -38
  62. package/dist/cjs/migrations/upgrade-two-dot-seven.d.ts +23 -23
  63. package/dist/cjs/migrations/upgrade-two-dot-seven.js +57 -57
  64. package/dist/cjs/migrations/upgrade-two-dot-six.d.ts +27 -27
  65. package/dist/cjs/migrations/upgrade-two-dot-six.js +60 -60
  66. package/dist/cjs/migrations/upgrade-two-dot-three.d.ts +23 -23
  67. package/dist/cjs/migrations/upgrade-two-dot-three.js +54 -54
  68. package/dist/cjs/migrations/upgrade-two-dot-two.d.ts +23 -23
  69. package/dist/cjs/migrations/upgrade-two-dot-two.js +57 -57
  70. package/dist/cjs/migrations/upgrade-two-dot-zero.d.ts +44 -44
  71. package/dist/cjs/migrations/upgrade-two-dot-zero.js +94 -94
  72. package/dist/cjs/migrator.d.ts +25 -25
  73. package/dist/cjs/migrator.js +76 -76
  74. package/dist/cjs/resourceHelpers.d.ts +191 -191
  75. package/dist/cjs/resourceHelpers.js +383 -390
  76. package/dist/cjs/resourceHelpers.js.map +1 -1
  77. package/dist/cjs/resources/add-resource-from-blob.d.ts +26 -26
  78. package/dist/cjs/resources/add-resource-from-blob.js +51 -51
  79. package/dist/cjs/resources/addMetadataFromBlob.d.ts +25 -25
  80. package/dist/cjs/resources/addMetadataFromBlob.js +42 -42
  81. package/dist/cjs/resources/convert-item-resource-to-storage-resource.d.ts +32 -32
  82. package/dist/cjs/resources/convert-item-resource-to-storage-resource.js +69 -69
  83. package/dist/cjs/resources/convert-storage-resource-to-item-resource.d.ts +29 -29
  84. package/dist/cjs/resources/convert-storage-resource-to-item-resource.js +69 -69
  85. package/dist/cjs/resources/copyAssociatedFiles.d.ts +67 -67
  86. package/dist/cjs/resources/copyAssociatedFiles.js +301 -301
  87. package/dist/cjs/resources/copyDataIntoItem.d.ts +33 -33
  88. package/dist/cjs/resources/copyDataIntoItem.js +61 -62
  89. package/dist/cjs/resources/copyDataIntoItem.js.map +1 -1
  90. package/dist/cjs/resources/copyMetadataIntoItem.d.ts +26 -26
  91. package/dist/cjs/resources/copyMetadataIntoItem.js +45 -45
  92. package/dist/cjs/resources/copyResourceIntoZip.d.ts +33 -33
  93. package/dist/cjs/resources/copyResourceIntoZip.js +77 -77
  94. package/dist/cjs/resources/copyZipIntoItem.d.ts +25 -25
  95. package/dist/cjs/resources/copyZipIntoItem.js +53 -53
  96. package/dist/cjs/resources/createCopyResults.d.ts +25 -25
  97. package/dist/cjs/resources/createCopyResults.js +35 -35
  98. package/dist/cjs/resources/get-blob.d.ts +26 -26
  99. package/dist/cjs/resources/get-blob.js +26 -26
  100. package/dist/cjs/resources/getItemResourcesFilesFromPaths.d.ts +24 -24
  101. package/dist/cjs/resources/getItemResourcesFilesFromPaths.js +48 -48
  102. package/dist/cjs/resources/getItemResourcesPaths.d.ts +26 -26
  103. package/dist/cjs/resources/getItemResourcesPaths.js +72 -72
  104. package/dist/cjs/resources/index.d.ts +29 -29
  105. package/dist/cjs/resources/index.js +32 -32
  106. package/dist/cjs/resources/solution-resource.d.ts +35 -35
  107. package/dist/cjs/resources/solution-resource.js +30 -30
  108. package/dist/cjs/resources/solution-resource.js.map +1 -1
  109. package/dist/cjs/resources/transform-resource-paths-to-solution-resources.d.ts +56 -56
  110. package/dist/cjs/resources/transform-resource-paths-to-solution-resources.js +145 -145
  111. package/dist/cjs/restHelpers.d.ts +586 -585
  112. package/dist/cjs/restHelpers.js +1888 -1883
  113. package/dist/cjs/restHelpers.js.map +1 -1
  114. package/dist/cjs/restHelpersGet.d.ts +288 -288
  115. package/dist/cjs/restHelpersGet.js +803 -803
  116. package/dist/cjs/sharing/index.d.ts +16 -16
  117. package/dist/cjs/sharing/index.js +19 -19
  118. package/dist/cjs/sharing/share-item-to-groups.d.ts +26 -26
  119. package/dist/cjs/sharing/share-item-to-groups.js +43 -43
  120. package/dist/cjs/templatization.d.ts +139 -139
  121. package/dist/cjs/templatization.js +313 -313
  122. package/dist/cjs/trackingHelpers.d.ts +116 -116
  123. package/dist/cjs/trackingHelpers.js +216 -216
  124. package/dist/cjs/velocityHelpers.d.ts +57 -57
  125. package/dist/cjs/velocityHelpers.js +134 -134
  126. package/dist/cjs/workforceHelpers.d.ts +115 -115
  127. package/dist/cjs/workforceHelpers.js +746 -746
  128. package/dist/cjs/workforceHelpers.js.map +1 -1
  129. package/dist/esm/completeItem.d.ts +29 -29
  130. package/dist/esm/completeItem.js +76 -76
  131. package/dist/esm/create-hub-request-options.d.ts +29 -29
  132. package/dist/esm/create-hub-request-options.js +59 -59
  133. package/dist/esm/deleteHelpers/deleteEmptyGroups.d.ts +24 -24
  134. package/dist/esm/deleteHelpers/deleteEmptyGroups.js +37 -37
  135. package/dist/esm/deleteHelpers/deleteGroupIfEmpty.d.ts +27 -27
  136. package/dist/esm/deleteHelpers/deleteGroupIfEmpty.js +91 -91
  137. package/dist/esm/deleteHelpers/deleteSolutionContents.d.ts +38 -38
  138. package/dist/esm/deleteHelpers/deleteSolutionContents.js +124 -124
  139. package/dist/esm/deleteHelpers/deleteSolutionFolder.d.ts +29 -29
  140. package/dist/esm/deleteHelpers/deleteSolutionFolder.js +73 -73
  141. package/dist/esm/deleteHelpers/deleteSolutionItem.d.ts +30 -30
  142. package/dist/esm/deleteHelpers/deleteSolutionItem.js +48 -48
  143. package/dist/esm/deleteHelpers/index.d.ts +22 -22
  144. package/dist/esm/deleteHelpers/index.js +22 -22
  145. package/dist/esm/deleteHelpers/reconstructBuildOrderIds.d.ts +27 -27
  146. package/dist/esm/deleteHelpers/reconstructBuildOrderIds.js +28 -28
  147. package/dist/esm/deleteHelpers/removeItems.d.ts +34 -34
  148. package/dist/esm/deleteHelpers/removeItems.js +106 -106
  149. package/dist/esm/deleteHelpers/reportProgress.d.ts +27 -27
  150. package/dist/esm/deleteHelpers/reportProgress.js +41 -41
  151. package/dist/esm/deleteSolution.d.ts +55 -55
  152. package/dist/esm/deleteSolution.js +100 -100
  153. package/dist/esm/dependencies.d.ts +26 -26
  154. package/dist/esm/dependencies.js +166 -166
  155. package/dist/esm/featureServiceHelpers.d.ts +791 -791
  156. package/dist/esm/featureServiceHelpers.js +2336 -2336
  157. package/dist/esm/generalHelpers.d.ts +392 -385
  158. package/dist/esm/generalHelpers.js +810 -808
  159. package/dist/esm/generalHelpers.js.map +1 -1
  160. package/dist/esm/get-subscription-info.d.ts +27 -27
  161. package/dist/esm/get-subscription-info.js +34 -34
  162. package/dist/esm/getDeletableSolutionInfo.d.ts +29 -29
  163. package/dist/esm/getDeletableSolutionInfo.js +47 -47
  164. package/dist/esm/getItemTypeAbbrev.d.ts +19 -19
  165. package/dist/esm/getItemTypeAbbrev.js +180 -180
  166. package/dist/esm/getSolutionSummary.d.ts +27 -27
  167. package/dist/esm/getSolutionSummary.js +95 -95
  168. package/dist/esm/index.d.ts +43 -44
  169. package/dist/esm/index.js +43 -44
  170. package/dist/esm/index.js.map +1 -1
  171. package/dist/esm/interfaces.d.ts +1334 -1334
  172. package/dist/esm/interfaces.js +70 -70
  173. package/dist/esm/libConnectors.d.ts +73 -73
  174. package/dist/esm/libConnectors.js +104 -104
  175. package/dist/esm/migrations/apply-schema.d.ts +24 -24
  176. package/dist/esm/migrations/apply-schema.js +31 -31
  177. package/dist/esm/migrations/is-legacy-solution.d.ts +24 -24
  178. package/dist/esm/migrations/is-legacy-solution.js +35 -35
  179. package/dist/esm/migrations/upgrade-three-dot-one.d.ts +27 -27
  180. package/dist/esm/migrations/upgrade-three-dot-one.js +44 -44
  181. package/dist/esm/migrations/upgrade-three-dot-zero.d.ts +27 -27
  182. package/dist/esm/migrations/upgrade-three-dot-zero.js +38 -38
  183. package/dist/esm/migrations/upgrade-two-dot-five.d.ts +24 -24
  184. package/dist/esm/migrations/upgrade-two-dot-five.js +68 -68
  185. package/dist/esm/migrations/upgrade-two-dot-four.d.ts +24 -24
  186. package/dist/esm/migrations/upgrade-two-dot-four.js +67 -67
  187. package/dist/esm/migrations/upgrade-two-dot-one.d.ts +7 -7
  188. package/dist/esm/migrations/upgrade-two-dot-one.js +34 -34
  189. package/dist/esm/migrations/upgrade-two-dot-seven.d.ts +23 -23
  190. package/dist/esm/migrations/upgrade-two-dot-seven.js +53 -53
  191. package/dist/esm/migrations/upgrade-two-dot-six.d.ts +27 -27
  192. package/dist/esm/migrations/upgrade-two-dot-six.js +56 -56
  193. package/dist/esm/migrations/upgrade-two-dot-three.d.ts +23 -23
  194. package/dist/esm/migrations/upgrade-two-dot-three.js +50 -50
  195. package/dist/esm/migrations/upgrade-two-dot-two.d.ts +23 -23
  196. package/dist/esm/migrations/upgrade-two-dot-two.js +53 -53
  197. package/dist/esm/migrations/upgrade-two-dot-zero.d.ts +44 -44
  198. package/dist/esm/migrations/upgrade-two-dot-zero.js +87 -87
  199. package/dist/esm/migrator.d.ts +25 -25
  200. package/dist/esm/migrator.js +72 -72
  201. package/dist/esm/resourceHelpers.d.ts +191 -191
  202. package/dist/esm/resourceHelpers.js +364 -371
  203. package/dist/esm/resourceHelpers.js.map +1 -1
  204. package/dist/esm/resources/add-resource-from-blob.d.ts +26 -26
  205. package/dist/esm/resources/add-resource-from-blob.js +47 -47
  206. package/dist/esm/resources/addMetadataFromBlob.d.ts +25 -25
  207. package/dist/esm/resources/addMetadataFromBlob.js +38 -38
  208. package/dist/esm/resources/convert-item-resource-to-storage-resource.d.ts +32 -32
  209. package/dist/esm/resources/convert-item-resource-to-storage-resource.js +65 -65
  210. package/dist/esm/resources/convert-storage-resource-to-item-resource.d.ts +29 -29
  211. package/dist/esm/resources/convert-storage-resource-to-item-resource.js +65 -65
  212. package/dist/esm/resources/copyAssociatedFiles.d.ts +67 -67
  213. package/dist/esm/resources/copyAssociatedFiles.js +293 -293
  214. package/dist/esm/resources/copyDataIntoItem.d.ts +33 -33
  215. package/dist/esm/resources/copyDataIntoItem.js +56 -57
  216. package/dist/esm/resources/copyDataIntoItem.js.map +1 -1
  217. package/dist/esm/resources/copyMetadataIntoItem.d.ts +26 -26
  218. package/dist/esm/resources/copyMetadataIntoItem.js +41 -41
  219. package/dist/esm/resources/copyResourceIntoZip.d.ts +33 -33
  220. package/dist/esm/resources/copyResourceIntoZip.js +72 -72
  221. package/dist/esm/resources/copyZipIntoItem.d.ts +25 -25
  222. package/dist/esm/resources/copyZipIntoItem.js +49 -49
  223. package/dist/esm/resources/createCopyResults.d.ts +25 -25
  224. package/dist/esm/resources/createCopyResults.js +31 -31
  225. package/dist/esm/resources/get-blob.d.ts +26 -26
  226. package/dist/esm/resources/get-blob.js +22 -22
  227. package/dist/esm/resources/getItemResourcesFilesFromPaths.d.ts +24 -24
  228. package/dist/esm/resources/getItemResourcesFilesFromPaths.js +44 -44
  229. package/dist/esm/resources/getItemResourcesPaths.d.ts +26 -26
  230. package/dist/esm/resources/getItemResourcesPaths.js +68 -68
  231. package/dist/esm/resources/index.d.ts +29 -29
  232. package/dist/esm/resources/index.js +29 -29
  233. package/dist/esm/resources/solution-resource.d.ts +35 -35
  234. package/dist/esm/resources/solution-resource.js +27 -27
  235. package/dist/esm/resources/transform-resource-paths-to-solution-resources.d.ts +56 -56
  236. package/dist/esm/resources/transform-resource-paths-to-solution-resources.js +137 -137
  237. package/dist/esm/restHelpers.d.ts +586 -585
  238. package/dist/esm/restHelpers.js +1827 -1823
  239. package/dist/esm/restHelpers.js.map +1 -1
  240. package/dist/esm/restHelpersGet.d.ts +288 -288
  241. package/dist/esm/restHelpersGet.js +763 -763
  242. package/dist/esm/sharing/index.d.ts +16 -16
  243. package/dist/esm/sharing/index.js +16 -16
  244. package/dist/esm/sharing/share-item-to-groups.d.ts +26 -26
  245. package/dist/esm/sharing/share-item-to-groups.js +39 -39
  246. package/dist/esm/templatization.d.ts +139 -139
  247. package/dist/esm/templatization.js +293 -293
  248. package/dist/esm/trackingHelpers.d.ts +116 -116
  249. package/dist/esm/trackingHelpers.js +204 -204
  250. package/dist/esm/velocityHelpers.d.ts +57 -57
  251. package/dist/esm/velocityHelpers.js +128 -128
  252. package/dist/esm/workforceHelpers.d.ts +115 -115
  253. package/dist/esm/workforceHelpers.js +717 -717
  254. package/dist/esm/workforceHelpers.js.map +1 -1
  255. package/package.json +2 -2
  256. package/dist/cjs/polyfills.d.ts +0 -40
  257. package/dist/cjs/polyfills.js +0 -98
  258. package/dist/cjs/polyfills.js.map +0 -1
  259. package/dist/esm/polyfills.d.ts +0 -40
  260. package/dist/esm/polyfills.js +0 -93
  261. package/dist/esm/polyfills.js.map +0 -1
@@ -1,585 +1,586 @@
1
- /** @license
2
- * Copyright 2018 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { IAddFolderResponse, IAddGroupResponse, IAdditionalGroupSearchOptions, ICreateItemResponse, ICreateServiceResult, IDependency, IExtent, IFeatureServiceProperties, IFolderStatusResponse, IGroup, IGroupAdd, IItem, IItemTemplate, IItemUpdate, IPostProcessArgs, IRelatedItems, ISpatialReference, IStatusResponse, ItemRelationshipType, IUpdate, IUpdateItemResponse, UserSession } from "./interfaces";
17
- import { IUserSessionOptions } from "@esri/arcgis-rest-auth";
18
- import { IPagingParams, ISearchOptions, ISearchResult, SearchQueryBuilder } from "@esri/arcgis-rest-portal";
19
- import { IParams } from "@esri/arcgis-rest-request";
20
- export { request as rest_request } from "@esri/arcgis-rest-request";
21
- /**
22
- * Creates a UserSession via a function so that the global arcgisSolution variable can access authentication.
23
- *
24
- * @param options See https://esri.github.io/arcgis-rest-js/api/auth/IUserSessionOptions/
25
- * @returns UserSession
26
- */
27
- export declare function getUserSession(options?: IUserSessionOptions): UserSession;
28
- /**
29
- * Adds a forward relationship between two items.
30
- *
31
- * @param originItemId Origin of relationship
32
- * @param destinationItemId Destination of relationship
33
- * @param relationshipType Type of relationship
34
- * @param authentication Credentials for the request
35
- * @returns A Promise to add item resources.
36
- */
37
- export declare function addForwardItemRelationship(originItemId: string, destinationItemId: string, relationshipType: ItemRelationshipType, authentication: UserSession): Promise<IStatusResponse>;
38
- /**
39
- * Adds forward relationships for an item.
40
- *
41
- * @param originItemId Origin of relationship
42
- * @param destinationRelationships Destinations
43
- * @param authentication Credentials for the request
44
- * @returns A Promise to add item resources.
45
- */
46
- export declare function addForwardItemRelationships(originItemId: string, destinationRelationships: IRelatedItems[], authentication: UserSession): Promise<IStatusResponse[]>;
47
- /**
48
- * Adds a token to the query parameters of a URL.
49
- *
50
- * @param url URL to use as base
51
- * @param authentication Credentials to be used to generate token for URL
52
- * @returns A promise that will resolve with the supplied URL with `token=&lt;token&gt;` added to its query params
53
- * unless either the URL doesn't exist or the token can't be generated
54
- */
55
- export declare function addTokenToUrl(url: string, authentication: UserSession): Promise<string>;
56
- /**
57
- * Calls addToDefinition for the service.
58
- *
59
- * Added retry due to some solutions failing to deploy in specific orgs/hives due to timeouts.
60
- * On the first pass we will use the quicker sync request to add.
61
- * If it fails we will use an async request that will avoid the timeout errors.
62
- *
63
- * @param url URL to use as base
64
- * @param options the info to add to the services definition
65
- * @param skipRetry a boolean to control if retry logic will be used. Defaults to false.
66
- * @param useAsync a boolean to control if we will use an async request
67
- * @returns A promise that will resolve when the request has completed
68
- */
69
- export declare function addToServiceDefinition(url: string, options: any, skipRetry?: boolean, useAsync?: boolean): Promise<void>;
70
- /**
71
- * When using an async request we need to poll the status url to know when the request has completed or failed.
72
- *
73
- * @param result the result returned from the addToDefinition request.
74
- * This will contain a status url or the standard sync result.
75
- * @param authentication Credentials to be used to generate token for URL
76
- * @returns A promise that will resolve when the request has completed
77
- */
78
- export declare function checkRequestStatus(result: any, authentication: any): Promise<void>;
79
- /**
80
- * Converts a general search into an ISearchOptions structure.
81
- *
82
- * @param search Search specified in one of three ways
83
- * @returns Recast search
84
- */
85
- export declare function convertToISearchOptions(search: string | ISearchOptions | SearchQueryBuilder): ISearchOptions;
86
- /**
87
- * Simple validate function to ensure all coordinates are numbers
88
- * In some cases orgs can have null or undefined coordinate values associated with the org extent
89
- *
90
- * @param extent the extent to validate
91
- * @returns the provided extent or a default global extent if some coordinates are not numbers
92
- * @private
93
- */
94
- export declare function _validateExtent(extent: IExtent): IExtent;
95
- /**
96
- * If the request to convert the extent fails it has commonly been due to an invalid extent.
97
- * This function will first attempt to use the provided extent. If it fails it will default to
98
- * the source items extent and if that fails it will then use a default global extent.
99
- *
100
- * @param extent the extent to convert
101
- * @param fallbackExtent the extent to convert if the main extent does not project to the outSR
102
- * @param outSR the spatial reference to project to
103
- * @param geometryServiceUrl the service url for the geometry service to use
104
- * @param authentication the credentials for the requests
105
- * @returns the extent projected to the provided spatial reference
106
- * or the world extent projected to the provided spatial reference
107
- * @private
108
- */
109
- export declare function convertExtentWithFallback(extent: IExtent, fallbackExtent: any, outSR: ISpatialReference, geometryServiceUrl: string, authentication: UserSession): Promise<any>;
110
- /**
111
- * Converts an extent to a specified spatial reference.
112
- *
113
- * @param extent Extent object to check and (possibly) to project
114
- * @param outSR Desired spatial reference
115
- * @param geometryServiceUrl Path to geometry service providing `findTransformations` and `project` services
116
- * @param authentication Credentials for the request
117
- * @returns Original extent if it's already using outSR or the extents projected into the outSR
118
- */
119
- export declare function convertExtent(extent: IExtent, outSR: ISpatialReference, geometryServiceUrl: string, authentication: UserSession): Promise<any>;
120
- /**
121
- * Publishes a feature service as an AGOL item; it does not include its layers and tables
122
- *
123
- * @param newItemTemplate Template of item to be created
124
- * @param authentication Credentials for the request
125
- * @param templateDictionary Hash of facts: org URL, adlib replacements, user; .user.folders property contains a list
126
- * @returns A promise that will resolve with an object reporting success and the Solution id
127
- */
128
- export declare function createFeatureService(newItemTemplate: IItemTemplate, authentication: UserSession, templateDictionary: any): Promise<ICreateServiceResult>;
129
- /**
130
- * Publishes an item and its data, metadata, and resources as an AGOL item.
131
- *
132
- * @param itemInfo Item's `item` section
133
- * @param folderId Id of folder to receive item; null indicates that the item goes into the root
134
- * folder; ignored for Group item type
135
- * @param destinationAuthentication Credentials for for requests to where the item is to be created
136
- * @param itemThumbnailUrl URL to image to use for item thumbnail
137
- * @param itemThumbnailAuthentication Credentials for requests to the thumbnail source
138
- * @param dataFile Item's `data` section
139
- * @param metadataFile Item's metadata file
140
- * @param resourcesFiles Item's resources
141
- * @param access Access to set for item: "public", "org", "private"
142
- * @returns A promise that will resolve with an object reporting success or failure and the Solution id
143
- */
144
- export declare function createFullItem(itemInfo: any, folderId: string | undefined, destinationAuthentication: UserSession, itemThumbnailUrl?: string, itemThumbnailAuthentication?: UserSession, dataFile?: File, metadataFile?: File, resourcesFiles?: File[], access?: string): Promise<ICreateItemResponse>;
145
- /**
146
- * Publishes an item and its data as an AGOL item.
147
- *
148
- * @param itemInfo Item's `item` section
149
- * @param dataInfo Item's `data` section
150
- * @param authentication Credentials for the request
151
- * @param folderId Id of folder to receive item; null indicates that the item goes into the root
152
- * folder; ignored for Group item type
153
- * @param access Access to set for item: "public", "org", "private"
154
- * @returns A promise that will resolve with an object reporting success and the Solution id
155
- */
156
- export declare function createItemWithData(itemInfo: any, dataInfo: any, authentication: UserSession, folderId: string | undefined, access?: string): Promise<ICreateItemResponse>;
157
- /**
158
- * Creates a folder using a numeric suffix to ensure uniqueness if necessary.
159
- *
160
- * @param title Folder title, used as-is if possible and with suffix otherwise
161
- * @param templateDictionary Hash of facts: org URL, adlib replacements, user; .user.folders property contains a list
162
- * of known folder names; function updates list with existing names not yet known, and creates .user.folders if it
163
- * doesn't exist in the dictionary
164
- * @param authentication Credentials for creating folder
165
- * @returns Id of created folder
166
- */
167
- export declare function createUniqueFolder(title: string, templateDictionary: any, authentication: UserSession): Promise<IAddFolderResponse>;
168
- /**
169
- * Creates a group using numeric suffix to ensure uniqueness.
170
- *
171
- * @param title Group title, used as-is if possible and with suffix otherwise
172
- * @param templateDictionary Hash of facts: org URL, adlib replacements, user
173
- * @param authentication Credentials for creating group
174
- * @param owner Optional arg for the Tracking owner
175
- * If the tracking owner is not the one deploying the solution
176
- * tracker groups will be created under the deployment user but
177
- * will be reassigned to the tracking owner.
178
- * @returns Information about created group
179
- */
180
- export declare function createUniqueGroup(title: string, groupItem: IGroupAdd, templateDictionary: any, authentication: UserSession, owner?: string): Promise<IAddGroupResponse>;
181
- /**
182
- * Gets the ids of the dependencies of an AGOL feature service item.
183
- * Dependencies will only exist when the service is a view.
184
- *
185
- * @param itemTemplate Template of item to be created
186
- * @param authentication Credentials for the request
187
- * @returns A promise that will resolve a list of dependencies
188
- */
189
- export declare function extractDependencies(itemTemplate: IItemTemplate, authentication?: UserSession): Promise<IDependency[]>;
190
- /**
191
- * Get json info for the services layers
192
- *
193
- * @param serviceUrl the url for the service
194
- * @param layerList list of base layer info
195
- * @param authentication Credentials for the request
196
- * @returns A promise that will resolve a list of dependencies
197
- */
198
- export declare function getLayers(serviceUrl: string, layerList: any[], authentication: UserSession): Promise<any[]>;
199
- /**
200
- * Add additional options to a layers definition.
201
- *
202
- * @param args The IPostProcessArgs for the request(s)
203
- * @param isPortal boolean to indicate if we are deploying to portal
204
- *
205
- * @returns An array of update instructions
206
- * @private
207
- */
208
- export declare function getLayerUpdates(args: IPostProcessArgs, isPortal: boolean): IUpdate[];
209
- /**
210
- * Sorts relationships based on order of supporting layers and tables in the service definition
211
- *
212
- * @param layers the layers from the service
213
- * @param tables the tables from the service
214
- * @param relUpdates the relationships to add for the service
215
- *
216
- * @returns An array with relationships that have been sorted
217
- * @private
218
- */
219
- export declare function _sortRelationships(layers: any[], tables: any[], relUpdates: any): any[];
220
- /**
221
- * Add additional options to a layers definition
222
- *
223
- * Added retry due to some solutions failing to deploy in specific orgs/hives
224
- *
225
- *
226
- * @param Update will contain either add, update, or delete from service definition call
227
- * @param skipRetry defaults to false. when true the retry logic will be ignored
228
- * @returns A promise that will resolve when service definition call has completed
229
- * @private
230
- */
231
- export declare function getRequest(update: IUpdate, skipRetry?: boolean, useAsync?: boolean): Promise<void>;
232
- /**
233
- * Fills in missing data, including full layer and table definitions, in a feature services' definition.
234
- *
235
- * @param itemTemplate Feature service item, data, dependencies definition to be modified
236
- * @param authentication Credentials for the request to AGOL
237
- * @returns A promise that will resolve when fullItem has been updated
238
- * @private
239
- */
240
- export declare function getServiceLayersAndTables(itemTemplate: IItemTemplate, authentication: UserSession): Promise<IItemTemplate>;
241
- /**
242
- * Get service properties for the given url and update key props
243
- *
244
- * @param serviceUrl the feature service url
245
- * @param authentication Credentials for the request to AGOL
246
- * @param workforceService boolean to indicate if extra workforce service steps should be handled
247
- * @returns A promise that will resolve with the service properties
248
- * @private
249
- */
250
- export declare function getFeatureServiceProperties(serviceUrl: string, authentication: UserSession, workforceService?: boolean): Promise<IFeatureServiceProperties>;
251
- /**
252
- * Parses the layers array and will filter subsets of Layers and Tables
253
- * Layers and Tables are both returned in the layers array when we access a feature service from the admin api.
254
- *
255
- * @param adminData The data of the feature service
256
- * @returns A mutated version of the provided adminData
257
- * @private
258
- */
259
- export declare function _parseAdminServiceData(adminData: any): any;
260
- /**
261
- * livingatlas designation test.
262
- * These layers should not be templatized or depolyed
263
- *
264
- * @param groupDesignations the items group designations to evaluate
265
- * @returns A boolean indicating if the invalid designation is found in the item info
266
- */
267
- export declare function hasInvalidGroupDesignations(groupDesignations: string): boolean;
268
- /**
269
- * Removes a folder from AGO.
270
- *
271
- * @param folderId Id of a folder to delete
272
- * @param authentication Credentials for the request to AGO
273
- * @returns A promise that will resolve with the result of the request
274
- */
275
- export declare function removeFolder(folderId: string, authentication: UserSession): Promise<IFolderStatusResponse>;
276
- /**
277
- * Removes a group from AGO.
278
- *
279
- * @param groupId Id of a group to delete
280
- * @param authentication Credentials for the request to AGO
281
- * @returns A promise that will resolve with the result of the request
282
- */
283
- export declare function removeGroup(groupId: string, authentication: UserSession): Promise<IStatusResponse>;
284
- /**
285
- * Removes an item from AGO.
286
- *
287
- * @param itemId Id of an item to delete
288
- * @param authentication Credentials for the request to AGO
289
- * @returns A promise that will resolve with the result of the request
290
- */
291
- export declare function removeItem(itemId: string, authentication: UserSession): Promise<IStatusResponse>;
292
- /**
293
- * Removes an item or group from AGO.
294
- *
295
- * @param itemId Id of an item or group to delete
296
- * @param authentication Credentials for the request to AGO
297
- * @returns A promise that will resolve with the result of the request
298
- */
299
- export declare function removeItemOrGroup(itemId: string, authentication: UserSession): Promise<IStatusResponse>;
300
- /**
301
- * Searches for items matching a query and that the caller has access to.
302
- *
303
- * @param search Search string (e.g., "q=redlands+map") or a more detailed structure that can include authentication
304
- * @returns Promise resolving with search results
305
- * @see https://developers.arcgis.com/rest/users-groups-and-items/search.htm
306
- */
307
- export declare function searchItems(search: string | ISearchOptions | SearchQueryBuilder): Promise<ISearchResult<IItem>>;
308
- /**
309
- * Searches for items matching a query and that the caller has access to, continuing recursively until done.
310
- *
311
- * @param search Search string (e.g., "q=redlands+map") or a more detailed structure that can include authentication
312
- * @param accumulatedResponse Response built from previous requests
313
- * @returns Promise resolving with search results
314
- * @see https://developers.arcgis.com/rest/users-groups-and-items/search.htm
315
- */
316
- export declare function searchAllItems(search: string | ISearchOptions | SearchQueryBuilder, accumulatedResponse?: ISearchResult<IItem>): Promise<ISearchResult<IItem>>;
317
- /**
318
- * Searches for groups matching criteria.
319
- *
320
- * @param searchString Text for which to search, e.g., 'redlands+map', 'type:"Web Map" -type:"Web Mapping Application"'
321
- * @param authentication Credentials for the request to AGO
322
- * @param additionalSearchOptions Adjustments to search, such as tranche size
323
- * @returns A promise that will resolve with a structure with a tranche of results and
324
- * describing how many items are available
325
- * @see https://developers.arcgis.com/rest/users-groups-and-items/group-search.htm
326
- * @see https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm
327
- */
328
- export declare function searchGroups(searchString: string, authentication: UserSession, additionalSearchOptions?: IAdditionalGroupSearchOptions): Promise<ISearchResult<IGroup>>;
329
- /**
330
- * Searches for groups matching criteria recurusively.
331
- *
332
- * @param searchString Text for which to search, e.g., 'redlands+map', 'type:"Web Map" -type:"Web Mapping Application"'
333
- * @param authentication Credentials for the request to AGO
334
- * @param groups List of groups that have been found from previous requests
335
- * @param inPagingParams The paging params for the recurisve searching
336
- *
337
- * @returns A promise that will resolve with all groups that meet the search criteria
338
- */
339
- export declare function searchAllGroups(searchString: string, authentication: UserSession, groups?: IGroup[], inPagingParams?: IPagingParams): Promise<IGroup[]>;
340
- /**
341
- * Searches for group contents matching criteria recursively.
342
- *
343
- * @param groupId Group whose contents are to be searched
344
- * @param searchString Text for which to search, e.g., 'redlands+map', 'type:"Web Map" -type:"Web Mapping Application"'
345
- * @param authentication Credentials for the request to AGO
346
- * @param additionalSearchOptions Adjustments to search, such as tranche size and categories of interest; categories
347
- * are supplied as an array: each array element consists of one or more categories to be ORed; array elements are ANDed
348
- * @param portalUrl Rest Url of the portal to perform the search
349
- * @param accumulatedResponse Response built from previous requests
350
- * @returns A promise that will resolve with a structure with a tranche of results and
351
- * describing how many items are available
352
- * @see https://developers.arcgis.com/rest/users-groups-and-items/group-content-search.htm
353
- * @see https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm
354
- */
355
- export declare function searchGroupAllContents(groupId: string, searchString: string, authentication: UserSession, additionalSearchOptions?: IAdditionalGroupSearchOptions, portalUrl?: string, accumulatedResponse?: ISearchResult<IItem>): Promise<ISearchResult<IItem>>;
356
- /**
357
- * Searches for group contents matching criteria.
358
- *
359
- * @param groupId Group whose contents are to be searched
360
- * @param searchString Text for which to search, e.g., 'redlands+map', 'type:"Web Map" -type:"Web Mapping Application"'
361
- * @param authentication Credentials for the request to AGO
362
- * @param additionalSearchOptions Adjustments to search, such as tranche size and categories of interest; categories
363
- * are supplied as an array: each array element consists of one or more categories to be ORed; array elements are ANDed
364
- * @param portalUrl Rest Url of the portal to perform the search
365
- * @returns A promise that will resolve with a structure with a tranche of results and
366
- * describing how many items are available
367
- * @see https://developers.arcgis.com/rest/users-groups-and-items/group-content-search.htm
368
- * @see https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm
369
- */
370
- export declare function searchGroupContents(groupId: string, searchString: string, authentication: UserSession, additionalSearchOptions?: IAdditionalGroupSearchOptions, portalUrl?: string): Promise<ISearchResult<IItem>>;
371
- /**
372
- * Reassign ownership of a group
373
- *
374
- * @param groupId Group to remove users from
375
- * @param userName The new owner for the group
376
- * @param authentication Credentials for the request to
377
- *
378
- * @returns A promise that will resolve after the group ownership has been assigned
379
- *
380
- */
381
- export declare function reassignGroup(groupId: string, userName: string, authentication: UserSession): Promise<any>;
382
- /**
383
- * Remove users from a group
384
- *
385
- * @param groupId Group to remove users from
386
- * @param users List of users to remove from the group
387
- * @param authentication Credentials for the request to
388
- *
389
- * @returns A promise that will resolve after the users have been removed
390
- *
391
- */
392
- export declare function removeUsers(groupId: string, users: string[], authentication: UserSession): Promise<any>;
393
- /**
394
- * Shares an item to the defined group
395
- *
396
- * @param groupId Group to share with
397
- * @param id the item id to share with the group
398
- * @param destinationAuthentication Credentials for the request to AGO
399
- * @param owner owner of the group when sharing tracking items (can be different from the deploying user)
400
- *
401
- * @returns A promise that will resolve after the item has been shared
402
- *
403
- */
404
- export declare function shareItem(groupId: string, id: string, destinationAuthentication: UserSession, owner?: string): Promise<void>;
405
- /**
406
- * Updates an item.
407
- *
408
- * @param itemInfo The base info of an item; note that this content will be serialized, which doesn't work
409
- * for binary content
410
- * @param authentication Credentials for request
411
- * @param folderId Item's folder
412
- * @param additionalParams Updates that are put under the `params` property, which is not serialized
413
- * @return
414
- */
415
- export declare function updateItem(itemInfo: IItemUpdate, authentication: UserSession, folderId?: string, additionalParams?: any): Promise<IUpdateItemResponse>;
416
- /**
417
- * Updates a group.
418
- *
419
- * @param groupInfo The base info of a group; note that this content will be serialized, which doesn't work
420
- * for binary content
421
- * @param authentication Credentials for request
422
- * @param additionalParams Updates that are put under the `params` property, which is not serialized
423
- * @returns A Promise that will resolve with the success/failure status of the request
424
- */
425
- export declare function updateGroup(groupInfo: IGroup, authentication: UserSession, additionalParams?: any): Promise<{
426
- success: boolean;
427
- groupId: string;
428
- }>;
429
- /**
430
- * Updates an item.
431
- *
432
- * @param itemInfo The base info of an item
433
- * @param data The items data section
434
- * @param authentication Credentials for requests
435
- * @param thumbnail optional thumbnail to update
436
- * @param access "public" or "org"
437
- * @return
438
- */
439
- export declare function updateItemExtended(itemInfo: IItemUpdate, data: any, authentication: UserSession, thumbnail?: File, access?: string | undefined, templateDictionary?: any): Promise<IUpdateItemResponse>;
440
- /**
441
- * Update an item's base and data using a dictionary.
442
- *
443
- * @param {string} itemId The item ID
444
- * @param {any} templateDictionary The template dictionary
445
- * @param {UserSession} authentication The destination session info
446
- * @returns Promise resolving to successfulness of update
447
- */
448
- export declare function updateItemTemplateFromDictionary(itemId: string, templateDictionary: any, authentication: UserSession): Promise<IUpdateItemResponse>;
449
- /**
450
- * Updates the URL of an item.
451
- *
452
- * @param id AGOL id of item to update
453
- * @param url URL to assign to item's base section
454
- * @param authentication Credentials for the request
455
- * @returns A promise that will resolve with the item id when the item has been updated or an AGO-style JSON failure
456
- * response
457
- */
458
- export declare function updateItemURL(id: string, url: string, authentication: UserSession): Promise<string>;
459
- /**
460
- * Adds a data section to an item.
461
- *
462
- * @param itemId Id of item to receive data file
463
- * @param dataFile Data to be added
464
- * @param authentication Credentials for the request
465
- * @returns Promise reporting success or failure
466
- * @private
467
- */
468
- export declare function _addItemDataFile(itemId: string, dataFile: File, authentication: UserSession): Promise<IUpdateItemResponse>;
469
- /**
470
- * Adds a metadata file to an item.
471
- *
472
- * @param itemId Id of item to receive data file
473
- * @param metadataFile Metadata to be added
474
- * @param authentication Credentials for the request
475
- * @returns Promise reporting success or failure
476
- * @private
477
- */
478
- export declare function _addItemMetadataFile(itemId: string, metadataFile: File, authentication: UserSession): Promise<IUpdateItemResponse>;
479
- /**
480
- * Accumulates the number of relationships in a collection of layers.
481
- *
482
- * @param List of layers to examine
483
- * @returns The number of relationships
484
- * @private
485
- */
486
- export declare function _countRelationships(layers: any[]): number;
487
- /**
488
- * Gets the full definitions of the layers affiliated with a hosted service.
489
- *
490
- * @param serviceUrl URL to hosted service
491
- * @param layerList List of layers at that service...must contain id
492
- * @param authentication Credentials for the request
493
- * @returns A promise that will resolve with a list of the layers from the admin api
494
- * @private
495
- */
496
- export declare function _getCreateServiceOptions(newItemTemplate: IItemTemplate, authentication: UserSession, templateDictionary: any): Promise<any>;
497
- /**
498
- * When the services spatial reference does not match that of it's default extent
499
- * use the out SRs default extent if it exists in the templateDictionary
500
- * this should be set when adding a custom out wkid to the params before calling deploy
501
- * this will help avoid situations where the orgs default extent and default world extent
502
- * will not project successfully to the out SR
503
- *
504
- * @param serviceInfo the object that contains the spatial reference to evaluate
505
- * @param templateDictionary the template dictionary
506
- * @returns the extent to use as the fallback
507
- * @private
508
- */
509
- export declare function _getFallbackExtent(serviceInfo: any, templateDictionary: any): any;
510
- /**
511
- * Add relationships to all layers in one call to retain fully functioning composite relationships
512
- *
513
- * @param args The IPostProcessArgs for the request(s)
514
- * @returns Any relationships that should be updated for the service
515
- * @private
516
- */
517
- export declare function _getRelationshipUpdates(args: IPostProcessArgs): any;
518
- /**
519
- * Get the stored contingent values and structure them to be added to the services layers.
520
- *
521
- * @param args The IPostProcessArgs for the request(s)
522
- * @returns Any contingent values that should be added to the service.
523
- * @private
524
- */
525
- export declare function _getContingentValuesUpdates(args: IPostProcessArgs): any;
526
- /**
527
- * Get refresh, add, update, or delete definition info
528
- *
529
- * @param url the base admin url for the service
530
- * @param id the id of the layer
531
- * @param obj parameters for the request
532
- * @param args various arguments to help support the request
533
- * @param type type of update the request will handle
534
- * @returns IUpdate that has the request url and arguments
535
- * @private
536
- */
537
- export declare function _getUpdate(url: string, id: any, obj: any, args: any, type: "delete" | "update" | "add" | "refresh"): IUpdate;
538
- /**
539
- * Changes just the domain part of a URL to lowercase.
540
- *
541
- * @param url URL to modify
542
- * @return Adjusted URL
543
- * @see From `getServerRootUrl` in arcgis-rest-js' ArcGISIdentityManager.ts
544
- * @private
545
- */
546
- export declare function _lowercaseDomain(url: string): string;
547
- /**
548
- * Checks the two main parts of an item for unresolved variables and reports any found.
549
- *
550
- * @param base Item's base section
551
- * @param data Item's data section
552
- * @private
553
- */
554
- export declare function _reportVariablesInItem(itemId: string, itemType: string, base: any, data: any): void;
555
- /**
556
- * Updates a feature service item.
557
- *
558
- * @param item Item to update
559
- * @param itemTemplate item template for the new item
560
- * @param serviceInfo Service information
561
- * @param params arcgis-rest-js params to update
562
- * @param isPortal Is the service hosted in a portal?
563
- * @returns Updated item
564
- * @private
565
- */
566
- export declare function _setItemProperties(item: any, itemTemplate: IItemTemplate, serviceInfo: any, params: IParams, isPortal: boolean): any;
567
- /**
568
- * Set isUnique as true for indexes that reference origin relationship keyFields.
569
- *
570
- * @param serviceInfo Service information
571
- * @private
572
- */
573
- export declare function _updateIndexesForRelationshipKeyFields(serviceInfo: any): void;
574
- /**
575
- * Updates the URL of an item.
576
- *
577
- * @param id AGOL id of item to update
578
- * @param url URL to assign to item's base section
579
- * @param authentication Credentials for the request
580
- * @param numAttempts Number of times to try to set the URL if AGO says that it updated the URL, but really didn't
581
- * @returns A promise that will resolve with the item id when the item has been updated or an AGO-style JSON failure
582
- * response
583
- * @private
584
- */
585
- export declare function _updateItemURL(id: string, url: string, authentication: UserSession, numAttempts?: number): Promise<string>;
1
+ /** @license
2
+ * Copyright 2018 Esri
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { IAddFolderResponse, IAddGroupResponse, IAdditionalGroupSearchOptions, ICreateItemResponse, ICreateServiceResult, IDependency, IExtent, IFeatureServiceProperties, IFolderStatusResponse, IGroup, IGroupAdd, IItem, IItemTemplate, IItemUpdate, IPostProcessArgs, IRelatedItems, ISpatialReference, IStatusResponse, ItemRelationshipType, IUpdate, IUpdateItemResponse, UserSession } from "./interfaces";
17
+ import { IUserSessionOptions } from "@esri/arcgis-rest-auth";
18
+ import { IPagingParams, ISearchOptions, ISearchResult, SearchQueryBuilder } from "@esri/arcgis-rest-portal";
19
+ import { IParams } from "@esri/arcgis-rest-request";
20
+ export { request as rest_request } from "@esri/arcgis-rest-request";
21
+ export declare function addItemData(id: string, data: any, authentication: UserSession): Promise<IUpdateItemResponse>;
22
+ /**
23
+ * Creates a UserSession via a function so that the global arcgisSolution variable can access authentication.
24
+ *
25
+ * @param options See https://esri.github.io/arcgis-rest-js/api/auth/IUserSessionOptions/
26
+ * @returns UserSession
27
+ */
28
+ export declare function getUserSession(options?: IUserSessionOptions): UserSession;
29
+ /**
30
+ * Adds a forward relationship between two items.
31
+ *
32
+ * @param originItemId Origin of relationship
33
+ * @param destinationItemId Destination of relationship
34
+ * @param relationshipType Type of relationship
35
+ * @param authentication Credentials for the request
36
+ * @returns A Promise to add item resources.
37
+ */
38
+ export declare function addForwardItemRelationship(originItemId: string, destinationItemId: string, relationshipType: ItemRelationshipType, authentication: UserSession): Promise<IStatusResponse>;
39
+ /**
40
+ * Adds forward relationships for an item.
41
+ *
42
+ * @param originItemId Origin of relationship
43
+ * @param destinationRelationships Destinations
44
+ * @param authentication Credentials for the request
45
+ * @returns A Promise to add item resources.
46
+ */
47
+ export declare function addForwardItemRelationships(originItemId: string, destinationRelationships: IRelatedItems[], authentication: UserSession): Promise<IStatusResponse[]>;
48
+ /**
49
+ * Adds a token to the query parameters of a URL.
50
+ *
51
+ * @param url URL to use as base
52
+ * @param authentication Credentials to be used to generate token for URL
53
+ * @returns A promise that will resolve with the supplied URL with `token=&lt;token&gt;` added to its query params
54
+ * unless either the URL doesn't exist or the token can't be generated
55
+ */
56
+ export declare function addTokenToUrl(url: string, authentication: UserSession): Promise<string>;
57
+ /**
58
+ * Calls addToDefinition for the service.
59
+ *
60
+ * Added retry due to some solutions failing to deploy in specific orgs/hives due to timeouts.
61
+ * On the first pass we will use the quicker sync request to add.
62
+ * If it fails we will use an async request that will avoid the timeout errors.
63
+ *
64
+ * @param url URL to use as base
65
+ * @param options the info to add to the services definition
66
+ * @param skipRetry a boolean to control if retry logic will be used. Defaults to false.
67
+ * @param useAsync a boolean to control if we will use an async request
68
+ * @returns A promise that will resolve when the request has completed
69
+ */
70
+ export declare function addToServiceDefinition(url: string, options: any, skipRetry?: boolean, useAsync?: boolean): Promise<void>;
71
+ /**
72
+ * When using an async request we need to poll the status url to know when the request has completed or failed.
73
+ *
74
+ * @param result the result returned from the addToDefinition request.
75
+ * This will contain a status url or the standard sync result.
76
+ * @param authentication Credentials to be used to generate token for URL
77
+ * @returns A promise that will resolve when the request has completed
78
+ */
79
+ export declare function checkRequestStatus(result: any, authentication: any): Promise<void>;
80
+ /**
81
+ * Converts a general search into an ISearchOptions structure.
82
+ *
83
+ * @param search Search specified in one of three ways
84
+ * @returns Recast search
85
+ */
86
+ export declare function convertToISearchOptions(search: string | ISearchOptions | SearchQueryBuilder): ISearchOptions;
87
+ /**
88
+ * Simple validate function to ensure all coordinates are numbers
89
+ * In some cases orgs can have null or undefined coordinate values associated with the org extent
90
+ *
91
+ * @param extent the extent to validate
92
+ * @returns the provided extent or a default global extent if some coordinates are not numbers
93
+ * @private
94
+ */
95
+ export declare function _validateExtent(extent: IExtent): IExtent;
96
+ /**
97
+ * If the request to convert the extent fails it has commonly been due to an invalid extent.
98
+ * This function will first attempt to use the provided extent. If it fails it will default to
99
+ * the source items extent and if that fails it will then use a default global extent.
100
+ *
101
+ * @param extent the extent to convert
102
+ * @param fallbackExtent the extent to convert if the main extent does not project to the outSR
103
+ * @param outSR the spatial reference to project to
104
+ * @param geometryServiceUrl the service url for the geometry service to use
105
+ * @param authentication the credentials for the requests
106
+ * @returns the extent projected to the provided spatial reference
107
+ * or the world extent projected to the provided spatial reference
108
+ * @private
109
+ */
110
+ export declare function convertExtentWithFallback(extent: IExtent, fallbackExtent: any, outSR: ISpatialReference, geometryServiceUrl: string, authentication: UserSession): Promise<any>;
111
+ /**
112
+ * Converts an extent to a specified spatial reference.
113
+ *
114
+ * @param extent Extent object to check and (possibly) to project
115
+ * @param outSR Desired spatial reference
116
+ * @param geometryServiceUrl Path to geometry service providing `findTransformations` and `project` services
117
+ * @param authentication Credentials for the request
118
+ * @returns Original extent if it's already using outSR or the extents projected into the outSR
119
+ */
120
+ export declare function convertExtent(extent: IExtent, outSR: ISpatialReference, geometryServiceUrl: string, authentication: UserSession): Promise<any>;
121
+ /**
122
+ * Publishes a feature service as an AGOL item; it does not include its layers and tables
123
+ *
124
+ * @param newItemTemplate Template of item to be created
125
+ * @param authentication Credentials for the request
126
+ * @param templateDictionary Hash of facts: org URL, adlib replacements, user; .user.folders property contains a list
127
+ * @returns A promise that will resolve with an object reporting success and the Solution id
128
+ */
129
+ export declare function createFeatureService(newItemTemplate: IItemTemplate, authentication: UserSession, templateDictionary: any): Promise<ICreateServiceResult>;
130
+ /**
131
+ * Publishes an item and its data, metadata, and resources as an AGOL item.
132
+ *
133
+ * @param itemInfo Item's `item` section
134
+ * @param folderId Id of folder to receive item; null indicates that the item goes into the root
135
+ * folder; ignored for Group item type
136
+ * @param destinationAuthentication Credentials for for requests to where the item is to be created
137
+ * @param itemThumbnailUrl URL to image to use for item thumbnail
138
+ * @param itemThumbnailAuthentication Credentials for requests to the thumbnail source
139
+ * @param dataFile Item's `data` section
140
+ * @param metadataFile Item's metadata file
141
+ * @param resourcesFiles Item's resources
142
+ * @param access Access to set for item: "public", "org", "private"
143
+ * @returns A promise that will resolve with an object reporting success or failure and the Solution id
144
+ */
145
+ export declare function createFullItem(itemInfo: any, folderId: string | undefined, destinationAuthentication: UserSession, itemThumbnailUrl?: string, itemThumbnailAuthentication?: UserSession, dataFile?: File, metadataFile?: File, resourcesFiles?: File[], access?: string): Promise<ICreateItemResponse>;
146
+ /**
147
+ * Publishes an item and its data as an AGOL item.
148
+ *
149
+ * @param itemInfo Item's `item` section
150
+ * @param dataInfo Item's `data` section
151
+ * @param authentication Credentials for the request
152
+ * @param folderId Id of folder to receive item; null indicates that the item goes into the root
153
+ * folder; ignored for Group item type
154
+ * @param access Access to set for item: "public", "org", "private"
155
+ * @returns A promise that will resolve with an object reporting success and the Solution id
156
+ */
157
+ export declare function createItemWithData(itemInfo: any, dataInfo: any, authentication: UserSession, folderId: string | undefined, access?: string): Promise<ICreateItemResponse>;
158
+ /**
159
+ * Creates a folder using a numeric suffix to ensure uniqueness if necessary.
160
+ *
161
+ * @param title Folder title, used as-is if possible and with suffix otherwise
162
+ * @param templateDictionary Hash of facts: org URL, adlib replacements, user; .user.folders property contains a list
163
+ * of known folder names; function updates list with existing names not yet known, and creates .user.folders if it
164
+ * doesn't exist in the dictionary
165
+ * @param authentication Credentials for creating folder
166
+ * @returns Id of created folder
167
+ */
168
+ export declare function createUniqueFolder(title: string, templateDictionary: any, authentication: UserSession): Promise<IAddFolderResponse>;
169
+ /**
170
+ * Creates a group using numeric suffix to ensure uniqueness.
171
+ *
172
+ * @param title Group title, used as-is if possible and with suffix otherwise
173
+ * @param templateDictionary Hash of facts: org URL, adlib replacements, user
174
+ * @param authentication Credentials for creating group
175
+ * @param owner Optional arg for the Tracking owner
176
+ * If the tracking owner is not the one deploying the solution
177
+ * tracker groups will be created under the deployment user but
178
+ * will be reassigned to the tracking owner.
179
+ * @returns Information about created group
180
+ */
181
+ export declare function createUniqueGroup(title: string, groupItem: IGroupAdd, templateDictionary: any, authentication: UserSession, owner?: string): Promise<IAddGroupResponse>;
182
+ /**
183
+ * Gets the ids of the dependencies of an AGOL feature service item.
184
+ * Dependencies will only exist when the service is a view.
185
+ *
186
+ * @param itemTemplate Template of item to be created
187
+ * @param authentication Credentials for the request
188
+ * @returns A promise that will resolve a list of dependencies
189
+ */
190
+ export declare function extractDependencies(itemTemplate: IItemTemplate, authentication?: UserSession): Promise<IDependency[]>;
191
+ /**
192
+ * Get json info for the services layers
193
+ *
194
+ * @param serviceUrl the url for the service
195
+ * @param layerList list of base layer info
196
+ * @param authentication Credentials for the request
197
+ * @returns A promise that will resolve a list of dependencies
198
+ */
199
+ export declare function getLayers(serviceUrl: string, layerList: any[], authentication: UserSession): Promise<any[]>;
200
+ /**
201
+ * Add additional options to a layers definition.
202
+ *
203
+ * @param args The IPostProcessArgs for the request(s)
204
+ * @param isPortal boolean to indicate if we are deploying to portal
205
+ *
206
+ * @returns An array of update instructions
207
+ * @private
208
+ */
209
+ export declare function getLayerUpdates(args: IPostProcessArgs, isPortal: boolean): IUpdate[];
210
+ /**
211
+ * Sorts relationships based on order of supporting layers and tables in the service definition
212
+ *
213
+ * @param layers the layers from the service
214
+ * @param tables the tables from the service
215
+ * @param relUpdates the relationships to add for the service
216
+ *
217
+ * @returns An array with relationships that have been sorted
218
+ * @private
219
+ */
220
+ export declare function _sortRelationships(layers: any[], tables: any[], relUpdates: any): any[];
221
+ /**
222
+ * Add additional options to a layers definition
223
+ *
224
+ * Added retry due to some solutions failing to deploy in specific orgs/hives
225
+ *
226
+ *
227
+ * @param Update will contain either add, update, or delete from service definition call
228
+ * @param skipRetry defaults to false. when true the retry logic will be ignored
229
+ * @returns A promise that will resolve when service definition call has completed
230
+ * @private
231
+ */
232
+ export declare function getRequest(update: IUpdate, skipRetry?: boolean, useAsync?: boolean): Promise<void>;
233
+ /**
234
+ * Fills in missing data, including full layer and table definitions, in a feature services' definition.
235
+ *
236
+ * @param itemTemplate Feature service item, data, dependencies definition to be modified
237
+ * @param authentication Credentials for the request to AGOL
238
+ * @returns A promise that will resolve when fullItem has been updated
239
+ * @private
240
+ */
241
+ export declare function getServiceLayersAndTables(itemTemplate: IItemTemplate, authentication: UserSession): Promise<IItemTemplate>;
242
+ /**
243
+ * Get service properties for the given url and update key props
244
+ *
245
+ * @param serviceUrl the feature service url
246
+ * @param authentication Credentials for the request to AGOL
247
+ * @param workforceService boolean to indicate if extra workforce service steps should be handled
248
+ * @returns A promise that will resolve with the service properties
249
+ * @private
250
+ */
251
+ export declare function getFeatureServiceProperties(serviceUrl: string, authentication: UserSession, workforceService?: boolean): Promise<IFeatureServiceProperties>;
252
+ /**
253
+ * Parses the layers array and will filter subsets of Layers and Tables
254
+ * Layers and Tables are both returned in the layers array when we access a feature service from the admin api.
255
+ *
256
+ * @param adminData The data of the feature service
257
+ * @returns A mutated version of the provided adminData
258
+ * @private
259
+ */
260
+ export declare function _parseAdminServiceData(adminData: any): any;
261
+ /**
262
+ * livingatlas designation test.
263
+ * These layers should not be templatized or depolyed
264
+ *
265
+ * @param groupDesignations the items group designations to evaluate
266
+ * @returns A boolean indicating if the invalid designation is found in the item info
267
+ */
268
+ export declare function hasInvalidGroupDesignations(groupDesignations: string): boolean;
269
+ /**
270
+ * Removes a folder from AGO.
271
+ *
272
+ * @param folderId Id of a folder to delete
273
+ * @param authentication Credentials for the request to AGO
274
+ * @returns A promise that will resolve with the result of the request
275
+ */
276
+ export declare function removeFolder(folderId: string, authentication: UserSession): Promise<IFolderStatusResponse>;
277
+ /**
278
+ * Removes a group from AGO.
279
+ *
280
+ * @param groupId Id of a group to delete
281
+ * @param authentication Credentials for the request to AGO
282
+ * @returns A promise that will resolve with the result of the request
283
+ */
284
+ export declare function removeGroup(groupId: string, authentication: UserSession): Promise<IStatusResponse>;
285
+ /**
286
+ * Removes an item from AGO.
287
+ *
288
+ * @param itemId Id of an item to delete
289
+ * @param authentication Credentials for the request to AGO
290
+ * @returns A promise that will resolve with the result of the request
291
+ */
292
+ export declare function removeItem(itemId: string, authentication: UserSession): Promise<IStatusResponse>;
293
+ /**
294
+ * Removes an item or group from AGO.
295
+ *
296
+ * @param itemId Id of an item or group to delete
297
+ * @param authentication Credentials for the request to AGO
298
+ * @returns A promise that will resolve with the result of the request
299
+ */
300
+ export declare function removeItemOrGroup(itemId: string, authentication: UserSession): Promise<IStatusResponse>;
301
+ /**
302
+ * Searches for items matching a query and that the caller has access to.
303
+ *
304
+ * @param search Search string (e.g., "q=redlands+map") or a more detailed structure that can include authentication
305
+ * @returns Promise resolving with search results
306
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/search.htm
307
+ */
308
+ export declare function searchItems(search: string | ISearchOptions | SearchQueryBuilder): Promise<ISearchResult<IItem>>;
309
+ /**
310
+ * Searches for items matching a query and that the caller has access to, continuing recursively until done.
311
+ *
312
+ * @param search Search string (e.g., "q=redlands+map") or a more detailed structure that can include authentication
313
+ * @param accumulatedResponse Response built from previous requests
314
+ * @returns Promise resolving with search results
315
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/search.htm
316
+ */
317
+ export declare function searchAllItems(search: string | ISearchOptions | SearchQueryBuilder, accumulatedResponse?: ISearchResult<IItem>): Promise<ISearchResult<IItem>>;
318
+ /**
319
+ * Searches for groups matching criteria.
320
+ *
321
+ * @param searchString Text for which to search, e.g., 'redlands+map', 'type:"Web Map" -type:"Web Mapping Application"'
322
+ * @param authentication Credentials for the request to AGO
323
+ * @param additionalSearchOptions Adjustments to search, such as tranche size
324
+ * @returns A promise that will resolve with a structure with a tranche of results and
325
+ * describing how many items are available
326
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/group-search.htm
327
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm
328
+ */
329
+ export declare function searchGroups(searchString: string, authentication: UserSession, additionalSearchOptions?: IAdditionalGroupSearchOptions): Promise<ISearchResult<IGroup>>;
330
+ /**
331
+ * Searches for groups matching criteria recurusively.
332
+ *
333
+ * @param searchString Text for which to search, e.g., 'redlands+map', 'type:"Web Map" -type:"Web Mapping Application"'
334
+ * @param authentication Credentials for the request to AGO
335
+ * @param groups List of groups that have been found from previous requests
336
+ * @param inPagingParams The paging params for the recurisve searching
337
+ *
338
+ * @returns A promise that will resolve with all groups that meet the search criteria
339
+ */
340
+ export declare function searchAllGroups(searchString: string, authentication: UserSession, groups?: IGroup[], inPagingParams?: IPagingParams): Promise<IGroup[]>;
341
+ /**
342
+ * Searches for group contents matching criteria recursively.
343
+ *
344
+ * @param groupId Group whose contents are to be searched
345
+ * @param searchString Text for which to search, e.g., 'redlands+map', 'type:"Web Map" -type:"Web Mapping Application"'
346
+ * @param authentication Credentials for the request to AGO
347
+ * @param additionalSearchOptions Adjustments to search, such as tranche size and categories of interest; categories
348
+ * are supplied as an array: each array element consists of one or more categories to be ORed; array elements are ANDed
349
+ * @param portalUrl Rest Url of the portal to perform the search
350
+ * @param accumulatedResponse Response built from previous requests
351
+ * @returns A promise that will resolve with a structure with a tranche of results and
352
+ * describing how many items are available
353
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/group-content-search.htm
354
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm
355
+ */
356
+ export declare function searchGroupAllContents(groupId: string, searchString: string, authentication: UserSession, additionalSearchOptions?: IAdditionalGroupSearchOptions, portalUrl?: string, accumulatedResponse?: ISearchResult<IItem>): Promise<ISearchResult<IItem>>;
357
+ /**
358
+ * Searches for group contents matching criteria.
359
+ *
360
+ * @param groupId Group whose contents are to be searched
361
+ * @param searchString Text for which to search, e.g., 'redlands+map', 'type:"Web Map" -type:"Web Mapping Application"'
362
+ * @param authentication Credentials for the request to AGO
363
+ * @param additionalSearchOptions Adjustments to search, such as tranche size and categories of interest; categories
364
+ * are supplied as an array: each array element consists of one or more categories to be ORed; array elements are ANDed
365
+ * @param portalUrl Rest Url of the portal to perform the search
366
+ * @returns A promise that will resolve with a structure with a tranche of results and
367
+ * describing how many items are available
368
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/group-content-search.htm
369
+ * @see https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm
370
+ */
371
+ export declare function searchGroupContents(groupId: string, searchString: string, authentication: UserSession, additionalSearchOptions?: IAdditionalGroupSearchOptions, portalUrl?: string): Promise<ISearchResult<IItem>>;
372
+ /**
373
+ * Reassign ownership of a group
374
+ *
375
+ * @param groupId Group to remove users from
376
+ * @param userName The new owner for the group
377
+ * @param authentication Credentials for the request to
378
+ *
379
+ * @returns A promise that will resolve after the group ownership has been assigned
380
+ *
381
+ */
382
+ export declare function reassignGroup(groupId: string, userName: string, authentication: UserSession): Promise<any>;
383
+ /**
384
+ * Remove users from a group
385
+ *
386
+ * @param groupId Group to remove users from
387
+ * @param users List of users to remove from the group
388
+ * @param authentication Credentials for the request to
389
+ *
390
+ * @returns A promise that will resolve after the users have been removed
391
+ *
392
+ */
393
+ export declare function removeUsers(groupId: string, users: string[], authentication: UserSession): Promise<any>;
394
+ /**
395
+ * Shares an item to the defined group
396
+ *
397
+ * @param groupId Group to share with
398
+ * @param id the item id to share with the group
399
+ * @param destinationAuthentication Credentials for the request to AGO
400
+ * @param owner owner of the group when sharing tracking items (can be different from the deploying user)
401
+ *
402
+ * @returns A promise that will resolve after the item has been shared
403
+ *
404
+ */
405
+ export declare function shareItem(groupId: string, id: string, destinationAuthentication: UserSession, owner?: string): Promise<void>;
406
+ /**
407
+ * Updates an item.
408
+ *
409
+ * @param itemInfo The base info of an item; note that this content will be serialized, which doesn't work
410
+ * for binary content
411
+ * @param authentication Credentials for request
412
+ * @param folderId Item's folder
413
+ * @param additionalParams Updates that are put under the `params` property, which is not serialized
414
+ * @return
415
+ */
416
+ export declare function updateItem(itemInfo: IItemUpdate, authentication: UserSession, folderId?: string, additionalParams?: any): Promise<IUpdateItemResponse>;
417
+ /**
418
+ * Updates a group.
419
+ *
420
+ * @param groupInfo The base info of a group; note that this content will be serialized, which doesn't work
421
+ * for binary content
422
+ * @param authentication Credentials for request
423
+ * @param additionalParams Updates that are put under the `params` property, which is not serialized
424
+ * @returns A Promise that will resolve with the success/failure status of the request
425
+ */
426
+ export declare function updateGroup(groupInfo: IGroup, authentication: UserSession, additionalParams?: any): Promise<{
427
+ success: boolean;
428
+ groupId: string;
429
+ }>;
430
+ /**
431
+ * Updates an item.
432
+ *
433
+ * @param itemInfo The base info of an item
434
+ * @param data The items data section
435
+ * @param authentication Credentials for requests
436
+ * @param thumbnail optional thumbnail to update
437
+ * @param access "public" or "org"
438
+ * @return
439
+ */
440
+ export declare function updateItemExtended(itemInfo: IItemUpdate, data: any, authentication: UserSession, thumbnail?: File, access?: string | undefined, templateDictionary?: any): Promise<IUpdateItemResponse>;
441
+ /**
442
+ * Update an item's base and data using a dictionary.
443
+ *
444
+ * @param {string} itemId The item ID
445
+ * @param {any} templateDictionary The template dictionary
446
+ * @param {UserSession} authentication The destination session info
447
+ * @returns Promise resolving to successfulness of update
448
+ */
449
+ export declare function updateItemTemplateFromDictionary(itemId: string, templateDictionary: any, authentication: UserSession): Promise<IUpdateItemResponse>;
450
+ /**
451
+ * Updates the URL of an item.
452
+ *
453
+ * @param id AGOL id of item to update
454
+ * @param url URL to assign to item's base section
455
+ * @param authentication Credentials for the request
456
+ * @returns A promise that will resolve with the item id when the item has been updated or an AGO-style JSON failure
457
+ * response
458
+ */
459
+ export declare function updateItemURL(id: string, url: string, authentication: UserSession): Promise<string>;
460
+ /**
461
+ * Adds a data section to an item.
462
+ *
463
+ * @param itemId Id of item to receive data file
464
+ * @param dataFile Data to be added
465
+ * @param authentication Credentials for the request
466
+ * @returns Promise reporting success or failure
467
+ * @private
468
+ */
469
+ export declare function _addItemDataFile(itemId: string, dataFile: File, authentication: UserSession): Promise<IUpdateItemResponse>;
470
+ /**
471
+ * Adds a metadata file to an item.
472
+ *
473
+ * @param itemId Id of item to receive data file
474
+ * @param metadataFile Metadata to be added
475
+ * @param authentication Credentials for the request
476
+ * @returns Promise reporting success or failure
477
+ * @private
478
+ */
479
+ export declare function _addItemMetadataFile(itemId: string, metadataFile: File, authentication: UserSession): Promise<IUpdateItemResponse>;
480
+ /**
481
+ * Accumulates the number of relationships in a collection of layers.
482
+ *
483
+ * @param List of layers to examine
484
+ * @returns The number of relationships
485
+ * @private
486
+ */
487
+ export declare function _countRelationships(layers: any[]): number;
488
+ /**
489
+ * Gets the full definitions of the layers affiliated with a hosted service.
490
+ *
491
+ * @param serviceUrl URL to hosted service
492
+ * @param layerList List of layers at that service...must contain id
493
+ * @param authentication Credentials for the request
494
+ * @returns A promise that will resolve with a list of the layers from the admin api
495
+ * @private
496
+ */
497
+ export declare function _getCreateServiceOptions(newItemTemplate: IItemTemplate, authentication: UserSession, templateDictionary: any): Promise<any>;
498
+ /**
499
+ * When the services spatial reference does not match that of it's default extent
500
+ * use the out SRs default extent if it exists in the templateDictionary
501
+ * this should be set when adding a custom out wkid to the params before calling deploy
502
+ * this will help avoid situations where the orgs default extent and default world extent
503
+ * will not project successfully to the out SR
504
+ *
505
+ * @param serviceInfo the object that contains the spatial reference to evaluate
506
+ * @param templateDictionary the template dictionary
507
+ * @returns the extent to use as the fallback
508
+ * @private
509
+ */
510
+ export declare function _getFallbackExtent(serviceInfo: any, templateDictionary: any): any;
511
+ /**
512
+ * Add relationships to all layers in one call to retain fully functioning composite relationships
513
+ *
514
+ * @param args The IPostProcessArgs for the request(s)
515
+ * @returns Any relationships that should be updated for the service
516
+ * @private
517
+ */
518
+ export declare function _getRelationshipUpdates(args: IPostProcessArgs): any;
519
+ /**
520
+ * Get the stored contingent values and structure them to be added to the services layers.
521
+ *
522
+ * @param args The IPostProcessArgs for the request(s)
523
+ * @returns Any contingent values that should be added to the service.
524
+ * @private
525
+ */
526
+ export declare function _getContingentValuesUpdates(args: IPostProcessArgs): any;
527
+ /**
528
+ * Get refresh, add, update, or delete definition info
529
+ *
530
+ * @param url the base admin url for the service
531
+ * @param id the id of the layer
532
+ * @param obj parameters for the request
533
+ * @param args various arguments to help support the request
534
+ * @param type type of update the request will handle
535
+ * @returns IUpdate that has the request url and arguments
536
+ * @private
537
+ */
538
+ export declare function _getUpdate(url: string, id: any, obj: any, args: any, type: "delete" | "update" | "add" | "refresh"): IUpdate;
539
+ /**
540
+ * Changes just the domain part of a URL to lowercase.
541
+ *
542
+ * @param url URL to modify
543
+ * @return Adjusted URL
544
+ * @see From `getServerRootUrl` in arcgis-rest-js' ArcGISIdentityManager.ts
545
+ * @private
546
+ */
547
+ export declare function _lowercaseDomain(url: string): string;
548
+ /**
549
+ * Checks the two main parts of an item for unresolved variables and reports any found.
550
+ *
551
+ * @param base Item's base section
552
+ * @param data Item's data section
553
+ * @private
554
+ */
555
+ export declare function _reportVariablesInItem(itemId: string, itemType: string, base: any, data: any): void;
556
+ /**
557
+ * Updates a feature service item.
558
+ *
559
+ * @param item Item to update
560
+ * @param itemTemplate item template for the new item
561
+ * @param serviceInfo Service information
562
+ * @param params arcgis-rest-js params to update
563
+ * @param isPortal Is the service hosted in a portal?
564
+ * @returns Updated item
565
+ * @private
566
+ */
567
+ export declare function _setItemProperties(item: any, itemTemplate: IItemTemplate, serviceInfo: any, params: IParams, isPortal: boolean): any;
568
+ /**
569
+ * Set isUnique as true for indexes that reference origin relationship keyFields.
570
+ *
571
+ * @param serviceInfo Service information
572
+ * @private
573
+ */
574
+ export declare function _updateIndexesForRelationshipKeyFields(serviceInfo: any): void;
575
+ /**
576
+ * Updates the URL of an item.
577
+ *
578
+ * @param id AGOL id of item to update
579
+ * @param url URL to assign to item's base section
580
+ * @param authentication Credentials for the request
581
+ * @param numAttempts Number of times to try to set the URL if AGO says that it updated the URL, but really didn't
582
+ * @returns A promise that will resolve with the item id when the item has been updated or an AGO-style JSON failure
583
+ * response
584
+ * @private
585
+ */
586
+ export declare function _updateItemURL(id: string, url: string, authentication: UserSession, numAttempts?: number): Promise<string>;