@esri/solution-common 1.1.2 → 1.2.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 (258) hide show
  1. package/dist/esm/completeItem.js +6 -7
  2. package/dist/esm/completeItem.js.map +1 -1
  3. package/dist/esm/create-hub-request-options.d.ts +4 -4
  4. package/dist/esm/create-hub-request-options.js +9 -12
  5. package/dist/esm/create-hub-request-options.js.map +1 -1
  6. package/dist/esm/deleteHelpers/deleteEmptyGroups.js +2 -2
  7. package/dist/esm/deleteHelpers/deleteEmptyGroups.js.map +1 -1
  8. package/dist/esm/deleteHelpers/deleteGroupIfEmpty.js +15 -15
  9. package/dist/esm/deleteHelpers/deleteGroupIfEmpty.js.map +1 -1
  10. package/dist/esm/deleteHelpers/deleteSolutionContents.js +20 -22
  11. package/dist/esm/deleteHelpers/deleteSolutionContents.js.map +1 -1
  12. package/dist/esm/deleteHelpers/deleteSolutionFolder.js +10 -10
  13. package/dist/esm/deleteHelpers/deleteSolutionFolder.js.map +1 -1
  14. package/dist/esm/deleteHelpers/deleteSolutionItem.js +4 -4
  15. package/dist/esm/deleteHelpers/deleteSolutionItem.js.map +1 -1
  16. package/dist/esm/deleteHelpers/reconstructBuildOrderIds.js +1 -1
  17. package/dist/esm/deleteHelpers/reconstructBuildOrderIds.js.map +1 -1
  18. package/dist/esm/deleteHelpers/removeItems.js +20 -29
  19. package/dist/esm/deleteHelpers/removeItems.js.map +1 -1
  20. package/dist/esm/deleteHelpers/reportProgress.js +3 -6
  21. package/dist/esm/deleteHelpers/reportProgress.js.map +1 -1
  22. package/dist/esm/deleteSolution.js +10 -12
  23. package/dist/esm/deleteSolution.js.map +1 -1
  24. package/dist/esm/dependencies.js +27 -19
  25. package/dist/esm/dependencies.js.map +1 -1
  26. package/dist/esm/featureServiceHelpers.d.ts +6 -0
  27. package/dist/esm/featureServiceHelpers.js +530 -500
  28. package/dist/esm/featureServiceHelpers.js.map +1 -1
  29. package/dist/esm/generalHelpers.js +72 -76
  30. package/dist/esm/generalHelpers.js.map +1 -1
  31. package/dist/esm/get-subscription-info.js +5 -3
  32. package/dist/esm/get-subscription-info.js.map +1 -1
  33. package/dist/esm/getDeletableSolutionInfo.js +6 -10
  34. package/dist/esm/getDeletableSolutionInfo.js.map +1 -1
  35. package/dist/esm/getSolutionSummary.js +15 -19
  36. package/dist/esm/getSolutionSummary.js.map +1 -1
  37. package/dist/esm/index.d.ts +1 -0
  38. package/dist/esm/index.js +1 -0
  39. package/dist/esm/index.js.map +1 -1
  40. package/dist/esm/interfaces.d.ts +39 -1
  41. package/dist/esm/interfaces.js +3 -3
  42. package/dist/esm/interfaces.js.map +1 -1
  43. package/dist/esm/libConnectors.js +5 -7
  44. package/dist/esm/libConnectors.js.map +1 -1
  45. package/dist/esm/migrations/apply-schema.js +3 -3
  46. package/dist/esm/migrations/apply-schema.js.map +1 -1
  47. package/dist/esm/migrations/is-legacy-solution.js +2 -2
  48. package/dist/esm/migrations/is-legacy-solution.js.map +1 -1
  49. package/dist/esm/migrations/upgrade-three-dot-one.js +3 -3
  50. package/dist/esm/migrations/upgrade-three-dot-one.js.map +1 -1
  51. package/dist/esm/migrations/upgrade-three-dot-zero.js +1 -1
  52. package/dist/esm/migrations/upgrade-three-dot-zero.js.map +1 -1
  53. package/dist/esm/migrations/upgrade-two-dot-five.js +17 -8
  54. package/dist/esm/migrations/upgrade-two-dot-five.js.map +1 -1
  55. package/dist/esm/migrations/upgrade-two-dot-four.js +12 -12
  56. package/dist/esm/migrations/upgrade-two-dot-four.js.map +1 -1
  57. package/dist/esm/migrations/upgrade-two-dot-one.js +1 -1
  58. package/dist/esm/migrations/upgrade-two-dot-one.js.map +1 -1
  59. package/dist/esm/migrations/upgrade-two-dot-seven.js +1 -1
  60. package/dist/esm/migrations/upgrade-two-dot-seven.js.map +1 -1
  61. package/dist/esm/migrations/upgrade-two-dot-six.js +9 -12
  62. package/dist/esm/migrations/upgrade-two-dot-six.js.map +1 -1
  63. package/dist/esm/migrations/upgrade-two-dot-three.js +3 -3
  64. package/dist/esm/migrations/upgrade-two-dot-three.js.map +1 -1
  65. package/dist/esm/migrations/upgrade-two-dot-two.js +3 -3
  66. package/dist/esm/migrations/upgrade-two-dot-two.js.map +1 -1
  67. package/dist/esm/migrations/upgrade-two-dot-zero.js +8 -9
  68. package/dist/esm/migrations/upgrade-two-dot-zero.js.map +1 -1
  69. package/dist/esm/migrator.js +5 -7
  70. package/dist/esm/migrator.js.map +1 -1
  71. package/dist/esm/polyfills.js +5 -5
  72. package/dist/esm/polyfills.js.map +1 -1
  73. package/dist/esm/resourceHelpers.js +54 -57
  74. package/dist/esm/resourceHelpers.js.map +1 -1
  75. package/dist/esm/resources/add-resource-from-blob.js +2 -2
  76. package/dist/esm/resources/add-resource-from-blob.js.map +1 -1
  77. package/dist/esm/resources/addMetadataFromBlob.js +1 -1
  78. package/dist/esm/resources/addMetadataFromBlob.js.map +1 -1
  79. package/dist/esm/resources/convert-item-resource-to-storage-resource.js +6 -7
  80. package/dist/esm/resources/convert-item-resource-to-storage-resource.js.map +1 -1
  81. package/dist/esm/resources/convert-storage-resource-to-item-resource.js +8 -9
  82. package/dist/esm/resources/convert-storage-resource-to-item-resource.js.map +1 -1
  83. package/dist/esm/resources/copyAssociatedFiles.js +44 -53
  84. package/dist/esm/resources/copyAssociatedFiles.js.map +1 -1
  85. package/dist/esm/resources/copyDataIntoItem.js +5 -11
  86. package/dist/esm/resources/copyDataIntoItem.js.map +1 -1
  87. package/dist/esm/resources/copyMetadataIntoItem.js +4 -10
  88. package/dist/esm/resources/copyMetadataIntoItem.js.map +1 -1
  89. package/dist/esm/resources/copyResourceIntoZip.js +5 -7
  90. package/dist/esm/resources/copyResourceIntoZip.js.map +1 -1
  91. package/dist/esm/resources/copyZipIntoItem.js +5 -9
  92. package/dist/esm/resources/copyZipIntoItem.js.map +1 -1
  93. package/dist/esm/resources/createCopyResults.js +5 -2
  94. package/dist/esm/resources/createCopyResults.js.map +1 -1
  95. package/dist/esm/resources/get-blob.js +7 -5
  96. package/dist/esm/resources/get-blob.js.map +1 -1
  97. package/dist/esm/resources/getItemResourcesFilesFromPaths.js +7 -7
  98. package/dist/esm/resources/getItemResourcesFilesFromPaths.js.map +1 -1
  99. package/dist/esm/resources/getItemResourcesPaths.js +7 -8
  100. package/dist/esm/resources/getItemResourcesPaths.js.map +1 -1
  101. package/dist/esm/resources/transform-resource-paths-to-solution-resources.js +8 -9
  102. package/dist/esm/resources/transform-resource-paths-to-solution-resources.js.map +1 -1
  103. package/dist/esm/restHelpers.d.ts +65 -5
  104. package/dist/esm/restHelpers.js +422 -276
  105. package/dist/esm/restHelpers.js.map +1 -1
  106. package/dist/esm/restHelpersGet.js +102 -111
  107. package/dist/esm/restHelpersGet.js.map +1 -1
  108. package/dist/esm/sharing/share-item-to-groups.d.ts +2 -1
  109. package/dist/esm/sharing/share-item-to-groups.js +12 -6
  110. package/dist/esm/sharing/share-item-to-groups.js.map +1 -1
  111. package/dist/esm/templatization.js +64 -40
  112. package/dist/esm/templatization.js.map +1 -1
  113. package/dist/esm/trackingHelpers.d.ts +116 -0
  114. package/dist/esm/trackingHelpers.js +205 -0
  115. package/dist/esm/trackingHelpers.js.map +1 -0
  116. package/dist/esm/velocityHelpers.d.ts +2 -0
  117. package/dist/esm/velocityHelpers.js +30 -12
  118. package/dist/esm/velocityHelpers.js.map +1 -1
  119. package/dist/esm/workforceHelpers.d.ts +11 -0
  120. package/dist/esm/workforceHelpers.js +208 -180
  121. package/dist/esm/workforceHelpers.js.map +1 -1
  122. package/dist/node/completeItem.js +8 -9
  123. package/dist/node/completeItem.js.map +1 -1
  124. package/dist/node/create-hub-request-options.d.ts +4 -4
  125. package/dist/node/create-hub-request-options.js +11 -14
  126. package/dist/node/create-hub-request-options.js.map +1 -1
  127. package/dist/node/deleteHelpers/deleteEmptyGroups.js +3 -3
  128. package/dist/node/deleteHelpers/deleteEmptyGroups.js.map +1 -1
  129. package/dist/node/deleteHelpers/deleteGroupIfEmpty.js +16 -16
  130. package/dist/node/deleteHelpers/deleteGroupIfEmpty.js.map +1 -1
  131. package/dist/node/deleteHelpers/deleteSolutionContents.js +26 -28
  132. package/dist/node/deleteHelpers/deleteSolutionContents.js.map +1 -1
  133. package/dist/node/deleteHelpers/deleteSolutionFolder.js +11 -11
  134. package/dist/node/deleteHelpers/deleteSolutionFolder.js.map +1 -1
  135. package/dist/node/deleteHelpers/deleteSolutionItem.js +6 -6
  136. package/dist/node/deleteHelpers/deleteSolutionItem.js.map +1 -1
  137. package/dist/node/deleteHelpers/index.js +1 -1
  138. package/dist/node/deleteHelpers/reconstructBuildOrderIds.js +2 -2
  139. package/dist/node/deleteHelpers/reconstructBuildOrderIds.js.map +1 -1
  140. package/dist/node/deleteHelpers/removeItems.js +26 -35
  141. package/dist/node/deleteHelpers/removeItems.js.map +1 -1
  142. package/dist/node/deleteHelpers/reportProgress.js +4 -7
  143. package/dist/node/deleteHelpers/reportProgress.js.map +1 -1
  144. package/dist/node/deleteSolution.js +12 -14
  145. package/dist/node/deleteSolution.js.map +1 -1
  146. package/dist/node/dependencies.js +29 -21
  147. package/dist/node/dependencies.js.map +1 -1
  148. package/dist/node/featureServiceHelpers.d.ts +6 -0
  149. package/dist/node/featureServiceHelpers.js +535 -504
  150. package/dist/node/featureServiceHelpers.js.map +1 -1
  151. package/dist/node/generalHelpers.js +75 -79
  152. package/dist/node/generalHelpers.js.map +1 -1
  153. package/dist/node/get-subscription-info.js +7 -5
  154. package/dist/node/get-subscription-info.js.map +1 -1
  155. package/dist/node/getDeletableSolutionInfo.js +8 -12
  156. package/dist/node/getDeletableSolutionInfo.js.map +1 -1
  157. package/dist/node/getSolutionSummary.js +19 -23
  158. package/dist/node/getSolutionSummary.js.map +1 -1
  159. package/dist/node/index.d.ts +1 -0
  160. package/dist/node/index.js +2 -1
  161. package/dist/node/index.js.map +1 -1
  162. package/dist/node/interfaces.d.ts +39 -1
  163. package/dist/node/interfaces.js.map +1 -1
  164. package/dist/node/libConnectors.js +8 -10
  165. package/dist/node/libConnectors.js.map +1 -1
  166. package/dist/node/migrations/apply-schema.js +4 -4
  167. package/dist/node/migrations/apply-schema.js.map +1 -1
  168. package/dist/node/migrations/is-legacy-solution.js +3 -3
  169. package/dist/node/migrations/is-legacy-solution.js.map +1 -1
  170. package/dist/node/migrations/upgrade-three-dot-one.js +5 -5
  171. package/dist/node/migrations/upgrade-three-dot-one.js.map +1 -1
  172. package/dist/node/migrations/upgrade-three-dot-zero.js +2 -2
  173. package/dist/node/migrations/upgrade-three-dot-zero.js.map +1 -1
  174. package/dist/node/migrations/upgrade-two-dot-five.js +18 -9
  175. package/dist/node/migrations/upgrade-two-dot-five.js.map +1 -1
  176. package/dist/node/migrations/upgrade-two-dot-four.js +13 -13
  177. package/dist/node/migrations/upgrade-two-dot-four.js.map +1 -1
  178. package/dist/node/migrations/upgrade-two-dot-one.js +2 -2
  179. package/dist/node/migrations/upgrade-two-dot-one.js.map +1 -1
  180. package/dist/node/migrations/upgrade-two-dot-seven.js +2 -2
  181. package/dist/node/migrations/upgrade-two-dot-seven.js.map +1 -1
  182. package/dist/node/migrations/upgrade-two-dot-six.js +10 -13
  183. package/dist/node/migrations/upgrade-two-dot-six.js.map +1 -1
  184. package/dist/node/migrations/upgrade-two-dot-three.js +5 -5
  185. package/dist/node/migrations/upgrade-two-dot-three.js.map +1 -1
  186. package/dist/node/migrations/upgrade-two-dot-two.js +5 -5
  187. package/dist/node/migrations/upgrade-two-dot-two.js.map +1 -1
  188. package/dist/node/migrations/upgrade-two-dot-zero.js +9 -10
  189. package/dist/node/migrations/upgrade-two-dot-zero.js.map +1 -1
  190. package/dist/node/migrator.js +16 -18
  191. package/dist/node/migrator.js.map +1 -1
  192. package/dist/node/polyfills.js +5 -5
  193. package/dist/node/polyfills.js.map +1 -1
  194. package/dist/node/resourceHelpers.js +62 -65
  195. package/dist/node/resourceHelpers.js.map +1 -1
  196. package/dist/node/resources/add-resource-from-blob.js +4 -4
  197. package/dist/node/resources/add-resource-from-blob.js.map +1 -1
  198. package/dist/node/resources/addMetadataFromBlob.js +2 -2
  199. package/dist/node/resources/addMetadataFromBlob.js.map +1 -1
  200. package/dist/node/resources/convert-item-resource-to-storage-resource.js +6 -7
  201. package/dist/node/resources/convert-item-resource-to-storage-resource.js.map +1 -1
  202. package/dist/node/resources/convert-storage-resource-to-item-resource.js +9 -10
  203. package/dist/node/resources/convert-storage-resource-to-item-resource.js.map +1 -1
  204. package/dist/node/resources/copyAssociatedFiles.js +52 -61
  205. package/dist/node/resources/copyAssociatedFiles.js.map +1 -1
  206. package/dist/node/resources/copyDataIntoItem.js +9 -15
  207. package/dist/node/resources/copyDataIntoItem.js.map +1 -1
  208. package/dist/node/resources/copyMetadataIntoItem.js +7 -13
  209. package/dist/node/resources/copyMetadataIntoItem.js.map +1 -1
  210. package/dist/node/resources/copyResourceIntoZip.js +7 -9
  211. package/dist/node/resources/copyResourceIntoZip.js.map +1 -1
  212. package/dist/node/resources/copyZipIntoItem.js +8 -12
  213. package/dist/node/resources/copyZipIntoItem.js.map +1 -1
  214. package/dist/node/resources/createCopyResults.js +5 -2
  215. package/dist/node/resources/createCopyResults.js.map +1 -1
  216. package/dist/node/resources/get-blob.js +8 -6
  217. package/dist/node/resources/get-blob.js.map +1 -1
  218. package/dist/node/resources/getItemResourcesFilesFromPaths.js +8 -8
  219. package/dist/node/resources/getItemResourcesFilesFromPaths.js.map +1 -1
  220. package/dist/node/resources/getItemResourcesPaths.js +9 -10
  221. package/dist/node/resources/getItemResourcesPaths.js.map +1 -1
  222. package/dist/node/resources/index.js +1 -1
  223. package/dist/node/resources/transform-resource-paths-to-solution-resources.js +10 -11
  224. package/dist/node/resources/transform-resource-paths-to-solution-resources.js.map +1 -1
  225. package/dist/node/restHelpers.d.ts +65 -5
  226. package/dist/node/restHelpers.js +437 -285
  227. package/dist/node/restHelpers.js.map +1 -1
  228. package/dist/node/restHelpersGet.js +107 -116
  229. package/dist/node/restHelpersGet.js.map +1 -1
  230. package/dist/node/sharing/index.js +1 -1
  231. package/dist/node/sharing/share-item-to-groups.d.ts +2 -1
  232. package/dist/node/sharing/share-item-to-groups.js +13 -7
  233. package/dist/node/sharing/share-item-to-groups.js.map +1 -1
  234. package/dist/node/templatization.js +61 -37
  235. package/dist/node/templatization.js.map +1 -1
  236. package/dist/node/trackingHelpers.d.ts +116 -0
  237. package/dist/node/trackingHelpers.js +217 -0
  238. package/dist/node/trackingHelpers.js.map +1 -0
  239. package/dist/node/velocityHelpers.d.ts +2 -0
  240. package/dist/node/velocityHelpers.js +33 -15
  241. package/dist/node/velocityHelpers.js.map +1 -1
  242. package/dist/node/workforceHelpers.d.ts +11 -0
  243. package/dist/node/workforceHelpers.js +214 -185
  244. package/dist/node/workforceHelpers.js.map +1 -1
  245. package/dist/umd/common.umd.js +14830 -14466
  246. package/dist/umd/common.umd.js.map +1 -1
  247. package/dist/umd/common.umd.min.js +3 -3
  248. package/dist/umd/common.umd.min.js.map +1 -1
  249. package/dist/umd/create-hub-request-options.d.ts +4 -4
  250. package/dist/umd/featureServiceHelpers.d.ts +6 -0
  251. package/dist/umd/index.d.ts +1 -0
  252. package/dist/umd/interfaces.d.ts +39 -1
  253. package/dist/umd/restHelpers.d.ts +65 -5
  254. package/dist/umd/sharing/share-item-to-groups.d.ts +2 -1
  255. package/dist/umd/trackingHelpers.d.ts +116 -0
  256. package/dist/umd/velocityHelpers.d.ts +2 -0
  257. package/dist/umd/workforceHelpers.d.ts +11 -0
  258. package/package.json +24 -24
@@ -14,9 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { UserSession } from "./interfaces";
17
- import { IHubRequestOptions } from "@esri/hub-common";
17
+ import { IHubUserRequestOptions } from "@esri/hub-common";
18
18
  /**
19
- * Create a IHubRequestOptions object from
19
+ * Create a IHubUserRequestOptions object from
20
20
  * the UserSession
21
21
  * If passed, it will use `templateDictionary`
22
22
  * values instead of making additional requests
@@ -24,6 +24,6 @@ import { IHubRequestOptions } from "@esri/hub-common";
24
24
  * @export
25
25
  * @param {UserSession} authentication
26
26
  * @param {*} templateDictionary
27
- * @returns {IHubRequestOptions}
27
+ * @returns {IHubUserRequestOptions}
28
28
  */
29
- export declare function createHubRequestOptions(authentication: UserSession, templateDictionary?: any): Promise<IHubRequestOptions>;
29
+ export declare function createHubRequestOptions(authentication: UserSession, templateDictionary?: any): Promise<IHubUserRequestOptions>;
@@ -749,3 +749,9 @@ export interface IPopupInfos {
749
749
  layers: INumberValuePair;
750
750
  tables: INumberValuePair;
751
751
  }
752
+ /**
753
+ * Helper function to ensure same chunk size value is used in multiple locations
754
+ *
755
+ * @return a number that represents how many layers should be included per addToDef call
756
+ */
757
+ export declare function _getLayerChunkSize(): number;
@@ -39,5 +39,6 @@ export * from "./restHelpers";
39
39
  export * from "./restHelpersGet";
40
40
  export * from "./sharing";
41
41
  export * from "./templatization";
42
+ export * from "./trackingHelpers";
42
43
  export * from "./velocityHelpers";
43
44
  export * from "./workforceHelpers";
@@ -346,6 +346,13 @@ export interface IGroupCategory {
346
346
  description?: string;
347
347
  categories?: IGroupCategory[];
348
348
  }
349
+ /**
350
+ * Hierarchical arrangement of items and their dependencies.
351
+ */
352
+ export interface IHierarchyElement {
353
+ id: string;
354
+ dependencies: IHierarchyElement[];
355
+ }
349
356
  /**
350
357
  * Subset of portal.IItem containing just the properties that are stored in a template--the item's "base" section.
351
358
  */
@@ -424,7 +431,7 @@ export interface IItemTemplate {
424
431
  * Function signatures for use in a function lookup array.
425
432
  */
426
433
  export interface IItemTemplateConversions {
427
- convertItemToTemplate(solutionItemId: string, itemInfo: any, authentication: UserSession, templateDictionary?: any): Promise<IItemTemplate>;
434
+ convertItemToTemplate(solutionItemId: string, itemInfo: any, destAuthentication: UserSession, srcAuthentication: UserSession, templateDictionary?: any): Promise<IItemTemplate>;
428
435
  createItemFromTemplate(template: IItemTemplate, templateDictionary: any, destinationAuthentication: UserSession, itemProgressCallback: IItemProgressCallback): Promise<ICreateItemFromTemplateResponse>;
429
436
  postProcessDependencies?(templates: IItemTemplate[], clonedSolutionsResponse: ICreateItemFromTemplateResponse[], authentication: UserSession, templateDictionary: any): Promise<any>;
430
437
  }
@@ -432,6 +439,9 @@ export interface IItemTemplateConversions {
432
439
  * Structure for mapping from item type to module with type-specific template-handling code
433
440
  */
434
441
  export declare type moduleHandler = IItemTemplateConversions | undefined | null;
442
+ /**
443
+ * Mapping from an AGO item type to the code handling that type.
444
+ */
435
445
  export interface IItemTypeModuleMap {
436
446
  [itemType: string]: moduleHandler;
437
447
  }
@@ -443,9 +453,15 @@ export interface IItemUpdate {
443
453
  */
444
454
  [key: string]: any;
445
455
  }
456
+ /**
457
+ * Type with key access to lists of strings
458
+ */
446
459
  export interface IKeyedListsOfStrings {
447
460
  [key: string]: string[];
448
461
  }
462
+ /**
463
+ * Type with key access to strings
464
+ */
449
465
  export interface IMimeTypes {
450
466
  [key: string]: string;
451
467
  }
@@ -503,10 +519,16 @@ export interface IQuickCaptureDatasource {
503
519
  */
504
520
  url: number;
505
521
  }
522
+ /**
523
+ * A mapping between a relationship type and the list of item ids using that relationship.
524
+ */
506
525
  export interface IRelatedItems {
507
526
  relationshipType: string;
508
527
  relatedItemIds: string[];
509
528
  }
529
+ /**
530
+ * Summary of a resource.
531
+ */
510
532
  export interface IResource {
511
533
  resource: string;
512
534
  created: number;
@@ -576,6 +598,9 @@ export interface ISolutionProgressEvent {
576
598
  */
577
599
  data?: any;
578
600
  }
601
+ /**
602
+ * Information about a resource to be copied into an item.
603
+ */
579
604
  export interface ISourceFile {
580
605
  /**
581
606
  * The portal item id, e.g., "4efe5f693de34620934787ead6693f19", that supplies the resource
@@ -789,6 +814,9 @@ export interface ISurvey123CreateResult {
789
814
  */
790
815
  export interface IZipCopyResults extends IZipInfo, ICopyResults {
791
816
  }
817
+ /**
818
+ * Information about a zipped file.
819
+ */
792
820
  export interface IZipInfo {
793
821
  /**
794
822
  * Zip's filename
@@ -803,3 +831,13 @@ export interface IZipInfo {
803
831
  */
804
832
  filelist: any[];
805
833
  }
834
+ export interface IVelocityTitle {
835
+ /**
836
+ * The current label for the object
837
+ */
838
+ label: string;
839
+ /**
840
+ * Existing titles that have been used in the org
841
+ */
842
+ titles: string[];
843
+ }
@@ -14,9 +14,17 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { IAddFolderResponse, IAddGroupResponse, IAdditionalSearchOptions, ICreateItemResponse, ICreateServiceResult, IDependency, IExtent, IFeatureServiceProperties, IFolderStatusResponse, IGroup, IGroupAdd, IItem, IItemTemplate, IItemUpdate, IPostProcessArgs, IRelatedItems, ISpatialReference, IStatusResponse, ItemRelationshipType, IUpdate, IUpdateItemResponse, UserSession } from "./interfaces";
17
- import { ISearchOptions, ISearchResult, SearchQueryBuilder } from "@esri/arcgis-rest-portal";
17
+ import { IUserSessionOptions } from "@esri/arcgis-rest-auth";
18
+ import { IPagingParams, ISearchOptions, ISearchResult, SearchQueryBuilder } from "@esri/arcgis-rest-portal";
18
19
  import { IParams } from "@esri/arcgis-rest-request";
19
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
+ * @return UserSession
26
+ */
27
+ export declare function getUserSession(options?: IUserSessionOptions): UserSession;
20
28
  /**
21
29
  * Searches for items matching a query and that the caller has access to.
22
30
  *
@@ -164,9 +172,13 @@ export declare function createUniqueFolder(title: string, templateDictionary: an
164
172
  * @param title Group title, used as-is if possible and with suffix otherwise
165
173
  * @param templateDictionary Hash of facts: org URL, adlib replacements, user
166
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.
167
179
  * @return Information about created group
168
180
  */
169
- export declare function createUniqueGroup(title: string, groupItem: IGroupAdd, templateDictionary: any, authentication: UserSession): Promise<IAddGroupResponse>;
181
+ export declare function createUniqueGroup(title: string, groupItem: IGroupAdd, templateDictionary: any, authentication: UserSession, owner?: string): Promise<IAddGroupResponse>;
170
182
  /**
171
183
  * Gets the ids of the dependencies of an AGOL feature service item.
172
184
  * Dependencies will only exist when the service is a view.
@@ -189,10 +201,22 @@ export declare function getLayers(serviceUrl: string, layerList: any[], authenti
189
201
  * Add additional options to a layers definition.
190
202
  *
191
203
  * @param args The IPostProcessArgs for the request(s)
204
+ * @param isPortal boolean to indicate if we are deploying to portal
205
+ *
192
206
  * @return An array of update instructions
193
207
  * @private
194
208
  */
195
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
+ * @return An array with relationships that have been sorted
218
+ */
219
+ export declare function _sortRelationships(layers: any[], tables: any[], relUpdates: any): any[];
196
220
  /**
197
221
  * Update view service when sourceSchemaChangesAllowed is true.
198
222
  *
@@ -296,6 +320,17 @@ export declare function removeItemOrGroup(itemId: string, authentication: UserSe
296
320
  * @see https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm
297
321
  */
298
322
  export declare function searchGroups(searchString: string, authentication: UserSession, additionalSearchOptions?: IAdditionalSearchOptions): Promise<ISearchResult<IGroup>>;
323
+ /**
324
+ * Searches for groups matching criteria recurusively.
325
+ *
326
+ * @param searchString Text for which to search, e.g., 'redlands+map', 'type:"Web Map" -type:"Web Mapping Application"'
327
+ * @param authentication Credentials for the request to AGO
328
+ * @param groups List of groups that have been found from previous requests
329
+ * @param inPagingParams The paging params for the recurisve searching
330
+ *
331
+ * @return A promise that will resolve with all groups that meet the search criteria
332
+ */
333
+ export declare function searchAllGroups(searchString: string, authentication: UserSession, groups?: IGroup[], inPagingParams?: IPagingParams): Promise<IGroup[]>;
299
334
  /**
300
335
  * Searches for group contents matching criteria.
301
336
  *
@@ -311,16 +346,40 @@ export declare function searchGroups(searchString: string, authentication: UserS
311
346
  * @see https://developers.arcgis.com/rest/users-groups-and-items/search-reference.htm
312
347
  */
313
348
  export declare function searchGroupContents(groupId: string, searchString: string, authentication: UserSession, additionalSearchOptions?: IAdditionalSearchOptions, portalUrl?: string): Promise<ISearchResult<IItem>>;
349
+ /**
350
+ * Reassign ownership of a group
351
+ *
352
+ * @param groupId Group to remove users from
353
+ * @param userName The new owner for the group
354
+ * @param authentication Credentials for the request to
355
+ *
356
+ * @return A promise that will resolve after the group ownership has been assigned
357
+ *
358
+ */
359
+ export declare function reassignGroup(groupId: string, userName: string, authentication: UserSession): Promise<any>;
360
+ /**
361
+ * Remove users from a group
362
+ *
363
+ * @param groupId Group to remove users from
364
+ * @param users List of users to remove from the group
365
+ * @param authentication Credentials for the request to
366
+ *
367
+ * @return A promise that will resolve after the users have been removed
368
+ *
369
+ */
370
+ export declare function removeUsers(groupId: string, users: string[], authentication: UserSession): Promise<any>;
314
371
  /**
315
372
  * Shares an item to the defined group
316
373
  *
317
374
  * @param groupId Group to share with
318
375
  * @param id the item id to share with the group
319
376
  * @param destinationAuthentication Credentials for the request to AGO
377
+ * @param owner owner of the group when sharing tracking items (can be different from the deploying user)
378
+ *
320
379
  * @return A promise that will resolve after the item has been shared
321
380
  *
322
381
  */
323
- export declare function shareItem(groupId: string, id: string, destinationAuthentication: UserSession): Promise<void>;
382
+ export declare function shareItem(groupId: string, id: string, destinationAuthentication: UserSession, owner?: string): Promise<void>;
324
383
  /**
325
384
  * Updates an item.
326
385
  *
@@ -342,7 +401,7 @@ export declare function updateItem(itemInfo: IItemUpdate, authentication: UserSe
342
401
  * @param access "public" or "org"
343
402
  * @return
344
403
  */
345
- export declare function updateItemExtended(itemInfo: IItemUpdate, data: any, authentication: UserSession, thumbnail?: File, access?: string | undefined): Promise<IUpdateItemResponse>;
404
+ export declare function updateItemExtended(itemInfo: IItemUpdate, data: any, authentication: UserSession, thumbnail?: File, access?: string | undefined, templateDictionary?: any): Promise<IUpdateItemResponse>;
346
405
  /**
347
406
  * Update an item's base and data using a dictionary.
348
407
  *
@@ -444,12 +503,13 @@ export declare function _reportVariablesInItem(itemId: string, itemType: string,
444
503
  * Updates a feature service item.
445
504
  *
446
505
  * @param item Item to update
506
+ * @param itemTemplate item template for the new item
447
507
  * @param serviceInfo Service information
448
508
  * @param params arcgis-rest-js params to update
449
509
  * @param isPortal Is the service hosted in a portal?
450
510
  * @return Updated item
451
511
  */
452
- export declare function _setItemProperties(item: any, serviceInfo: any, params: IParams, isPortal: boolean): any;
512
+ export declare function _setItemProperties(item: any, itemTemplate: IItemTemplate, serviceInfo: any, params: IParams, isPortal: boolean): any;
453
513
  /**
454
514
  * Set isUnique as true for indexes that reference origin relationship keyFields.
455
515
  *
@@ -21,5 +21,6 @@ import { UserSession } from "../";
21
21
  * @param groups Array of Group Ids
22
22
  * @param itemId Item Id
23
23
  * @param authentication UserSession
24
+ * @param owner owner of the group when sharing tracking items (can be different from the deploying user)
24
25
  */
25
- export declare function shareItemToGroups(groupIds: string[], itemId: string, authentication: UserSession): Promise<any>;
26
+ export declare function shareItemToGroups(groupIds: string[], itemId: string, authentication: UserSession, owner?: string): Promise<any>;
@@ -0,0 +1,116 @@
1
+ /** @license
2
+ * Copyright 2021 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 { IItemTemplate, UserSession } from "./interfaces";
17
+ import { IItemUpdate } from "@esri/arcgis-rest-types";
18
+ import { ICreateServiceParams } from "@esri/arcgis-rest-service-admin";
19
+ /**
20
+ * Used by deploy to evaluate if we have everything we need to deploy tracking views.
21
+ *
22
+ * This function will update the input templateDictionary with a boolean
23
+ * indicating if tracking is enabled on the org and the user is an admin.
24
+ *
25
+ * @param portalResponse portal self response
26
+ * @param userResponse portal user response
27
+ * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
28
+ * @param templates the list of IItemTemplates from the solution
29
+ *
30
+ * @protected
31
+ */
32
+ export declare function setLocationTrackingEnabled(portalResponse: any, userResponse: any, templateDictionary: any, templates?: IItemTemplate[]): void;
33
+ /**
34
+ * Used by deploy to evaluate if we have everything we need to deploy tracking views.
35
+ *
36
+ * An error is thrown to prevent additional deployment work if we have Tracking items and tracking is
37
+ * not enabled or the deployment user is not an admin in the organization.
38
+ *
39
+ * @param templates the list of IItemTemplates from the solution
40
+ * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
41
+ *
42
+ * @protected
43
+ */
44
+ export declare function _validateTrackingTemplates(templates: IItemTemplate[], templateDictionary: any): void;
45
+ /**
46
+ * Used by deploy to determine the owner of the tracking service.
47
+ * Only one tracking service per org and all tracking views and tracking groups must be owned by the tracking service owner.
48
+ *
49
+ * This function will update the input templateDictionary with the owner as well as
50
+ * the item id for the source tracking service.
51
+ *
52
+ * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
53
+ * @param authentication Credentials for the requests
54
+ *
55
+ * @protected
56
+ */
57
+ export declare function getTackingServiceOwner(templateDictionary: any, authentication: UserSession): Promise<boolean>;
58
+ /**
59
+ * Check key properties to understand if we are dealing with a tracking template
60
+ *
61
+ * @param itemTemplate the template to evaluate
62
+ * @param itemUpdate the item update to evaluate
63
+ *
64
+ * @protected
65
+ */
66
+ export declare function isTrackingViewTemplate(itemTemplate?: IItemTemplate, itemUpdate?: IItemUpdate): boolean;
67
+ /**
68
+ * Check key properties to understand if we are dealing with a tracking group template
69
+ *
70
+ * @param itemTemplate the template to evaluate
71
+ *
72
+ * @protected
73
+ */
74
+ export declare function isTrackingViewGroup(itemTemplate: IItemTemplate): boolean;
75
+ /**
76
+ * Templatize the tracker view group id and view name for location tracking views.
77
+ * This function will update the itemTemplate that is passed in when it's a tracking view.
78
+ *
79
+ * @param itemTemplate Template for feature service item
80
+ *
81
+ * @protected
82
+ */
83
+ export declare function templatizeTracker(itemTemplate: IItemTemplate): void;
84
+ /**
85
+ * Templatize the tracker view group id and view name for location tracking views.
86
+ * This function will update the itemTemplate that is passed in when it's a tracking view.
87
+ *
88
+ * @param itemTemplate Template for the tracker view
89
+ * @param path the path to the property that stores the current name
90
+ * @param groupId the id of the associated tracker group
91
+ * @param groupIdVar the variable to replace the existing name with
92
+ *
93
+ * @protected
94
+ */
95
+ export declare function _setName(itemTemplate: IItemTemplate, path: string, groupId: string, groupIdVar: string): void;
96
+ /**
97
+ * Templatize the tracker view serviceItemId
98
+ *
99
+ * This function will update the input obj with the templatized variable
100
+ *
101
+ * @param obj the object that stores the serviceItemId
102
+ * @param path the path to the property that stores the serviceItemId
103
+ *
104
+ * @protected
105
+ */
106
+ export declare function templatizeServiceItemId(obj: any, path: string): void;
107
+ /**
108
+ * Used by deploy to update the request options with key details for deploying tracker views
109
+ *
110
+ * @param itemTemplate Template for feature service item
111
+ * @param options the current request options to update
112
+ * @param templateDictionary Hash of facts: org URL, adlib replacements, deferreds for dependencies
113
+ *
114
+ * @protected
115
+ */
116
+ export declare function setTrackingOptions(itemTemplate: IItemTemplate, options: any, templateDictionary: any): ICreateServiceParams;
@@ -14,6 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { UserSession } from "./interfaces";
17
+ export declare const BASE_NAMES: string[];
18
+ export declare const PROP_NAMES: string[];
17
19
  /**
18
20
  * Get the base velocity url from the current orgs subscription info
19
21
  *
@@ -49,6 +49,17 @@ export declare function templatizeWorkforce(data: any, keyProperties: string[],
49
49
  */
50
50
  export declare function getWorkforceDependencies(itemTemplate: IItemTemplate, dependencies: any[]): any;
51
51
  export declare function getWorkforceServiceInfo(properties: IFeatureServiceProperties, url: string, authentication: UserSession): Promise<IFeatureServiceProperties>;
52
+ /**
53
+ * Wrap global id and assignmenttype values in curly braces
54
+ *
55
+ * Added for issue #734
56
+ *
57
+ * This function will update the provided workforceInfos object
58
+ *
59
+ * @param workforceInfos the object that stores the integration and type info with global ids
60
+ *
61
+ */
62
+ export declare function _updateGlobalIdAndAssignmentType(workforceInfos: any): void;
52
63
  export declare function _getAssignmentTypeInfos(assignmentTypes: any): any[];
53
64
  export declare function _getAssignmentIntegrationInfos(assignmentIntegrations: any, authentication: UserSession): Promise<any>;
54
65
  export declare function getUrlDependencies(requests: Array<Promise<any>>, urls: string[]): Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solution-common",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "description": "Provides general helper functions for @esri/solution.js.",
5
5
  "main": "dist/node/index.js",
6
6
  "unpkg": "dist/umd/common.umd.min.js",
@@ -13,36 +13,36 @@
13
13
  "dist/**"
14
14
  ],
15
15
  "devDependencies": {
16
- "@esri/arcgis-rest-auth": "^3.3.0",
17
- "@esri/arcgis-rest-feature-layer": "^3.3.0",
18
- "@esri/arcgis-rest-portal": "^3.3.0",
19
- "@esri/arcgis-rest-request": "^3.3.0",
20
- "@esri/arcgis-rest-service-admin": "^3.3.0",
21
- "@esri/hub-common": "^8.16.0",
22
- "@esri/hub-initiatives": "^8.16.0",
23
- "@esri/hub-sites": "^8.16.0",
24
- "@esri/hub-teams": "^8.16.0",
16
+ "@esri/arcgis-rest-auth": "3.4.3",
17
+ "@esri/arcgis-rest-feature-layer": "3.4.3",
18
+ "@esri/arcgis-rest-portal": "3.4.3",
19
+ "@esri/arcgis-rest-request": "3.4.3",
20
+ "@esri/arcgis-rest-service-admin": "3.4.3",
21
+ "@esri/hub-common": "9.7.2",
22
+ "@esri/hub-initiatives": "9.7.2",
23
+ "@esri/hub-sites": "9.7.2",
24
+ "@esri/hub-teams": "9.7.2",
25
25
  "@types/adlib": "^3.0.1",
26
- "rollup": "^1.22.0"
26
+ "rollup": "^2.60.0"
27
27
  },
28
28
  "peerDependencies": {
29
- "@esri/arcgis-rest-auth": "^3.3.0",
30
- "@esri/arcgis-rest-feature-layer": "^3.3.0",
31
- "@esri/arcgis-rest-portal": "^3.3.0",
32
- "@esri/arcgis-rest-request": "^3.3.0",
33
- "@esri/arcgis-rest-service-admin": "^3.3.0",
34
- "@esri/hub-common": "^8.16.0",
35
- "@esri/hub-initiatives": "^8.16.0",
36
- "@esri/hub-sites": "^8.16.0",
37
- "@esri/hub-teams": "^8.16.0"
29
+ "@esri/arcgis-rest-auth": "3.4.3",
30
+ "@esri/arcgis-rest-feature-layer": "3.4.3",
31
+ "@esri/arcgis-rest-portal": "3.4.3",
32
+ "@esri/arcgis-rest-request": "3.4.3",
33
+ "@esri/arcgis-rest-service-admin": "3.4.3",
34
+ "@esri/hub-common": "9.7.2",
35
+ "@esri/hub-initiatives": "9.7.2",
36
+ "@esri/hub-sites": "9.7.2",
37
+ "@esri/hub-teams": "9.7.2"
38
38
  },
39
39
  "dependencies": {
40
- "@esri/arcgis-html-sanitizer": "~2.5.0",
40
+ "@esri/arcgis-html-sanitizer": "2.8.0",
41
41
  "@types/lodash.isplainobject": "^4.0.6",
42
42
  "adlib": "3.0.7",
43
- "jszip": "3.7.0",
43
+ "jszip": "3.7.1",
44
44
  "lodash.isplainobject": "^4.0.6",
45
- "tslib": "^1.13.0",
45
+ "tslib": "1.13.0",
46
46
  "xss": "^1.0.6"
47
47
  },
48
48
  "scripts": {
@@ -95,5 +95,5 @@
95
95
  "esri",
96
96
  "ES6"
97
97
  ],
98
- "gitHead": "c1ea3f67a733c7ee0b79cc19828347cfea9cd163"
98
+ "gitHead": "70f706fb28a50db0b9b13030f263f8e9e270b98d"
99
99
  }