@esri/hub-common 14.14.0 → 14.16.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 (250) hide show
  1. package/dist/esm/associations/addAssociation.js +16 -0
  2. package/dist/esm/associations/addAssociation.js.map +1 -0
  3. package/dist/esm/associations/index.js +5 -0
  4. package/dist/esm/associations/index.js.map +1 -0
  5. package/dist/esm/associations/internal/getTargetEntityFromAssociationType.js +18 -0
  6. package/dist/esm/associations/internal/getTargetEntityFromAssociationType.js.map +1 -0
  7. package/dist/esm/associations/internal/getTypeByIdsQuery.js +28 -0
  8. package/dist/esm/associations/internal/getTypeByIdsQuery.js.map +1 -0
  9. package/dist/esm/associations/internal/getTypeFromAssociationType.js +18 -0
  10. package/dist/esm/associations/internal/getTypeFromAssociationType.js.map +1 -0
  11. package/dist/esm/associations/internal/getTypeWithKeywordQuery.js +27 -0
  12. package/dist/esm/associations/internal/getTypeWithKeywordQuery.js.map +1 -0
  13. package/dist/esm/associations/internal/getTypeWithoutKeywordQuery.js +27 -0
  14. package/dist/esm/associations/internal/getTypeWithoutKeywordQuery.js.map +1 -0
  15. package/dist/esm/associations/listAssociations.js +17 -0
  16. package/dist/esm/associations/listAssociations.js.map +1 -0
  17. package/dist/esm/associations/removeAssociation.js +17 -0
  18. package/dist/esm/associations/removeAssociation.js.map +1 -0
  19. package/dist/esm/associations/types.js +2 -0
  20. package/dist/esm/associations/types.js.map +1 -0
  21. package/dist/esm/content/_internal/computeProps.js +4 -4
  22. package/dist/esm/content/_internal/computeProps.js.map +1 -1
  23. package/dist/esm/content/edit.js +8 -5
  24. package/dist/esm/content/edit.js.map +1 -1
  25. package/dist/esm/core/HubItemEntity.js +48 -1
  26. package/dist/esm/core/HubItemEntity.js.map +1 -1
  27. package/dist/esm/core/behaviors/IWIthAssociationBehavior.js +1 -0
  28. package/dist/esm/core/behaviors/IWIthAssociationBehavior.js.map +1 -0
  29. package/dist/esm/core/behaviors/IWithFollowersBehavior.js +1 -0
  30. package/dist/esm/core/behaviors/IWithFollowersBehavior.js.map +1 -0
  31. package/dist/esm/core/behaviors/index.js +1 -0
  32. package/dist/esm/core/behaviors/index.js.map +1 -1
  33. package/dist/esm/core/getTypeFromEntity.js +0 -5
  34. package/dist/esm/core/getTypeFromEntity.js.map +1 -1
  35. package/dist/esm/core/schemas/internal/getEntityEditorSchemas.js +1 -0
  36. package/dist/esm/core/schemas/internal/getEntityEditorSchemas.js.map +1 -1
  37. package/dist/esm/core/schemas/internal/getLocationExtent.js +2 -2
  38. package/dist/esm/core/schemas/internal/getLocationExtent.js.map +1 -1
  39. package/dist/esm/core/schemas/internal/getLocationOptions.js +12 -53
  40. package/dist/esm/core/schemas/internal/getLocationOptions.js.map +1 -1
  41. package/dist/esm/core/schemas/internal/subsetSchema.js +3 -0
  42. package/dist/esm/core/schemas/internal/subsetSchema.js.map +1 -1
  43. package/dist/esm/core/schemas/shared/HubItemEntitySchema.js +10 -0
  44. package/dist/esm/core/schemas/shared/HubItemEntitySchema.js.map +1 -1
  45. package/dist/esm/core/traits/IWithAssociations.js +1 -0
  46. package/dist/esm/core/traits/IWithAssociations.js.map +1 -0
  47. package/dist/esm/core/traits/index.js +1 -0
  48. package/dist/esm/core/traits/index.js.map +1 -1
  49. package/dist/esm/extent.js +6 -6
  50. package/dist/esm/extent.js.map +1 -1
  51. package/dist/esm/groups/HubGroups.js +1 -1
  52. package/dist/esm/groups/HubGroups.js.map +1 -1
  53. package/dist/esm/groups/_internal/computeProps.js +1 -1
  54. package/dist/esm/groups/_internal/computeProps.js.map +1 -1
  55. package/dist/esm/index.js +1 -0
  56. package/dist/esm/index.js.map +1 -1
  57. package/dist/esm/initiatives/HubInitiative.js +1 -1
  58. package/dist/esm/initiatives/HubInitiative.js.map +1 -1
  59. package/dist/esm/initiatives/HubInitiatives.js +129 -0
  60. package/dist/esm/initiatives/HubInitiatives.js.map +1 -1
  61. package/dist/esm/metrics/resolveMetric.js +6 -3
  62. package/dist/esm/metrics/resolveMetric.js.map +1 -1
  63. package/dist/esm/permissions/types/Permission.js +0 -2
  64. package/dist/esm/permissions/types/Permission.js.map +1 -1
  65. package/dist/esm/projects/HubProject.js +1 -1
  66. package/dist/esm/projects/HubProject.js.map +1 -1
  67. package/dist/esm/projects/fetch.js +26 -0
  68. package/dist/esm/projects/fetch.js.map +1 -1
  69. package/dist/esm/search/_internal/combineQueries.js +2 -0
  70. package/dist/esm/search/_internal/combineQueries.js.map +1 -1
  71. package/dist/esm/search/_internal/getEntityTypeFromType.js +21 -0
  72. package/dist/esm/search/_internal/getEntityTypeFromType.js.map +1 -0
  73. package/dist/esm/search/_internal/negateGroupPredicates.js +28 -0
  74. package/dist/esm/search/_internal/negateGroupPredicates.js.map +1 -0
  75. package/dist/esm/search/hubSearch.js +5 -1
  76. package/dist/esm/search/hubSearch.js.map +1 -1
  77. package/dist/esm/search/utils.js +16 -0
  78. package/dist/esm/search/utils.js.map +1 -1
  79. package/dist/esm/sites/HubSite.js +18 -8
  80. package/dist/esm/sites/HubSite.js.map +1 -1
  81. package/dist/esm/sites/HubSites.js +12 -0
  82. package/dist/esm/sites/HubSites.js.map +1 -1
  83. package/dist/esm/sites/_internal/SiteBusinessRules.js +7 -0
  84. package/dist/esm/sites/_internal/SiteBusinessRules.js.map +1 -1
  85. package/dist/esm/sites/_internal/SiteSchema.js +5 -1
  86. package/dist/esm/sites/_internal/SiteSchema.js.map +1 -1
  87. package/dist/esm/sites/_internal/SiteUiSchemaEdit.js +3 -3
  88. package/dist/esm/sites/_internal/SiteUiSchemaFollowers.js +56 -0
  89. package/dist/esm/sites/_internal/SiteUiSchemaFollowers.js.map +1 -0
  90. package/dist/esm/sites/_internal/capabilities/capabilityToFeatureMap.js +31 -0
  91. package/dist/esm/sites/_internal/capabilities/capabilityToFeatureMap.js.map +1 -0
  92. package/dist/esm/sites/_internal/capabilities/convertFeaturesToLegacyCapabilities.js +46 -0
  93. package/dist/esm/sites/_internal/capabilities/convertFeaturesToLegacyCapabilities.js.map +1 -0
  94. package/dist/esm/sites/_internal/capabilities/migrateLegacyCapabilitiesToFeatures.js +34 -0
  95. package/dist/esm/sites/_internal/capabilities/migrateLegacyCapabilitiesToFeatures.js.map +1 -0
  96. package/dist/esm/sites/_internal/capabilities/types.js +1 -0
  97. package/dist/esm/sites/_internal/capabilities/types.js.map +1 -0
  98. package/dist/esm/sites/upgrade-site-schema.js +2 -0
  99. package/dist/esm/sites/upgrade-site-schema.js.map +1 -1
  100. package/dist/esm/users/HubUsers.js +1 -1
  101. package/dist/esm/users/HubUsers.js.map +1 -1
  102. package/dist/esm/utils/memoize.js +2 -4
  103. package/dist/esm/utils/memoize.js.map +1 -1
  104. package/dist/node/associations/addAssociation.js +20 -0
  105. package/dist/node/associations/addAssociation.js.map +1 -0
  106. package/dist/node/associations/index.js +8 -0
  107. package/dist/node/associations/index.js.map +1 -0
  108. package/dist/node/associations/internal/getTargetEntityFromAssociationType.js +22 -0
  109. package/dist/node/associations/internal/getTargetEntityFromAssociationType.js.map +1 -0
  110. package/dist/node/associations/internal/getTypeByIdsQuery.js +32 -0
  111. package/dist/node/associations/internal/getTypeByIdsQuery.js.map +1 -0
  112. package/dist/node/associations/internal/getTypeFromAssociationType.js +22 -0
  113. package/dist/node/associations/internal/getTypeFromAssociationType.js.map +1 -0
  114. package/dist/node/associations/internal/getTypeWithKeywordQuery.js +31 -0
  115. package/dist/node/associations/internal/getTypeWithKeywordQuery.js.map +1 -0
  116. package/dist/node/associations/internal/getTypeWithoutKeywordQuery.js +31 -0
  117. package/dist/node/associations/internal/getTypeWithoutKeywordQuery.js.map +1 -0
  118. package/dist/node/associations/listAssociations.js +21 -0
  119. package/dist/node/associations/listAssociations.js.map +1 -0
  120. package/dist/node/associations/removeAssociation.js +21 -0
  121. package/dist/node/associations/removeAssociation.js.map +1 -0
  122. package/dist/node/associations/types.js +4 -0
  123. package/dist/node/associations/types.js.map +1 -0
  124. package/dist/node/content/_internal/computeProps.js +5 -5
  125. package/dist/node/content/_internal/computeProps.js.map +1 -1
  126. package/dist/node/content/edit.js +8 -5
  127. package/dist/node/content/edit.js.map +1 -1
  128. package/dist/node/core/HubItemEntity.js +47 -0
  129. package/dist/node/core/HubItemEntity.js.map +1 -1
  130. package/dist/node/core/behaviors/IWIthAssociationBehavior.js +3 -0
  131. package/dist/node/core/behaviors/IWIthAssociationBehavior.js.map +1 -0
  132. package/dist/node/core/behaviors/IWithFollowersBehavior.js +3 -0
  133. package/dist/node/core/behaviors/IWithFollowersBehavior.js.map +1 -0
  134. package/dist/node/core/behaviors/index.js +1 -0
  135. package/dist/node/core/behaviors/index.js.map +1 -1
  136. package/dist/node/core/getTypeFromEntity.js +0 -5
  137. package/dist/node/core/getTypeFromEntity.js.map +1 -1
  138. package/dist/node/core/schemas/internal/getEntityEditorSchemas.js +1 -0
  139. package/dist/node/core/schemas/internal/getEntityEditorSchemas.js.map +1 -1
  140. package/dist/node/core/schemas/internal/getLocationExtent.js +1 -1
  141. package/dist/node/core/schemas/internal/getLocationExtent.js.map +1 -1
  142. package/dist/node/core/schemas/internal/getLocationOptions.js +13 -55
  143. package/dist/node/core/schemas/internal/getLocationOptions.js.map +1 -1
  144. package/dist/node/core/schemas/internal/subsetSchema.js +3 -0
  145. package/dist/node/core/schemas/internal/subsetSchema.js.map +1 -1
  146. package/dist/node/core/schemas/shared/HubItemEntitySchema.js +10 -0
  147. package/dist/node/core/schemas/shared/HubItemEntitySchema.js.map +1 -1
  148. package/dist/node/core/traits/IWithAssociations.js +3 -0
  149. package/dist/node/core/traits/IWithAssociations.js.map +1 -0
  150. package/dist/node/core/traits/index.js +1 -0
  151. package/dist/node/core/traits/index.js.map +1 -1
  152. package/dist/node/extent.js +8 -8
  153. package/dist/node/extent.js.map +1 -1
  154. package/dist/node/groups/HubGroups.js +4 -4
  155. package/dist/node/groups/HubGroups.js.map +1 -1
  156. package/dist/node/groups/_internal/computeProps.js +2 -2
  157. package/dist/node/groups/_internal/computeProps.js.map +1 -1
  158. package/dist/node/index.js +1 -0
  159. package/dist/node/index.js.map +1 -1
  160. package/dist/node/initiatives/HubInitiative.js +3 -3
  161. package/dist/node/initiatives/HubInitiative.js.map +1 -1
  162. package/dist/node/initiatives/HubInitiatives.js +134 -1
  163. package/dist/node/initiatives/HubInitiatives.js.map +1 -1
  164. package/dist/node/metrics/resolveMetric.js +6 -3
  165. package/dist/node/metrics/resolveMetric.js.map +1 -1
  166. package/dist/node/permissions/types/Permission.js +0 -2
  167. package/dist/node/permissions/types/Permission.js.map +1 -1
  168. package/dist/node/projects/HubProject.js +3 -3
  169. package/dist/node/projects/HubProject.js.map +1 -1
  170. package/dist/node/projects/fetch.js +28 -1
  171. package/dist/node/projects/fetch.js.map +1 -1
  172. package/dist/node/search/_internal/combineQueries.js +2 -0
  173. package/dist/node/search/_internal/combineQueries.js.map +1 -1
  174. package/dist/node/search/_internal/getEntityTypeFromType.js +25 -0
  175. package/dist/node/search/_internal/getEntityTypeFromType.js.map +1 -0
  176. package/dist/node/search/_internal/negateGroupPredicates.js +32 -0
  177. package/dist/node/search/_internal/negateGroupPredicates.js.map +1 -0
  178. package/dist/node/search/hubSearch.js +10 -6
  179. package/dist/node/search/hubSearch.js.map +1 -1
  180. package/dist/node/search/utils.js +18 -1
  181. package/dist/node/search/utils.js.map +1 -1
  182. package/dist/node/sites/HubSite.js +18 -8
  183. package/dist/node/sites/HubSite.js.map +1 -1
  184. package/dist/node/sites/HubSites.js +12 -0
  185. package/dist/node/sites/HubSites.js.map +1 -1
  186. package/dist/node/sites/_internal/SiteBusinessRules.js +7 -0
  187. package/dist/node/sites/_internal/SiteBusinessRules.js.map +1 -1
  188. package/dist/node/sites/_internal/SiteSchema.js +5 -1
  189. package/dist/node/sites/_internal/SiteSchema.js.map +1 -1
  190. package/dist/node/sites/_internal/SiteUiSchemaEdit.js +3 -3
  191. package/dist/node/sites/_internal/SiteUiSchemaFollowers.js +59 -0
  192. package/dist/node/sites/_internal/SiteUiSchemaFollowers.js.map +1 -0
  193. package/dist/node/sites/_internal/capabilities/capabilityToFeatureMap.js +34 -0
  194. package/dist/node/sites/_internal/capabilities/capabilityToFeatureMap.js.map +1 -0
  195. package/dist/node/sites/_internal/capabilities/convertFeaturesToLegacyCapabilities.js +49 -0
  196. package/dist/node/sites/_internal/capabilities/convertFeaturesToLegacyCapabilities.js.map +1 -0
  197. package/dist/node/sites/_internal/capabilities/migrateLegacyCapabilitiesToFeatures.js +37 -0
  198. package/dist/node/sites/_internal/capabilities/migrateLegacyCapabilitiesToFeatures.js.map +1 -0
  199. package/dist/node/sites/_internal/capabilities/types.js +3 -0
  200. package/dist/node/sites/_internal/capabilities/types.js.map +1 -0
  201. package/dist/node/sites/upgrade-site-schema.js +2 -0
  202. package/dist/node/sites/upgrade-site-schema.js.map +1 -1
  203. package/dist/node/users/HubUsers.js +4 -4
  204. package/dist/node/users/HubUsers.js.map +1 -1
  205. package/dist/node/utils/memoize.js +2 -4
  206. package/dist/node/utils/memoize.js.map +1 -1
  207. package/dist/types/associations/addAssociation.d.ts +9 -0
  208. package/dist/types/associations/index.d.ts +4 -0
  209. package/dist/types/associations/internal/getTargetEntityFromAssociationType.d.ts +8 -0
  210. package/dist/types/associations/internal/getTypeByIdsQuery.d.ts +10 -0
  211. package/dist/types/associations/internal/getTypeFromAssociationType.d.ts +7 -0
  212. package/dist/types/associations/internal/getTypeWithKeywordQuery.d.ts +10 -0
  213. package/dist/types/associations/internal/getTypeWithoutKeywordQuery.d.ts +10 -0
  214. package/dist/types/associations/listAssociations.d.ts +8 -0
  215. package/dist/types/associations/removeAssociation.d.ts +9 -0
  216. package/dist/types/associations/types.d.ts +19 -0
  217. package/dist/types/content/_internal/computeProps.d.ts +1 -1
  218. package/dist/types/content/_internal/internalContentUtils.d.ts +10 -36
  219. package/dist/types/core/HubItemEntity.d.ts +32 -2
  220. package/dist/types/core/behaviors/IWIthAssociationBehavior.d.ts +23 -0
  221. package/dist/types/core/behaviors/IWithFollowersBehavior.d.ts +15 -0
  222. package/dist/types/core/behaviors/index.d.ts +1 -0
  223. package/dist/types/core/schemas/internal/getLocationOptions.d.ts +0 -1
  224. package/dist/types/core/schemas/types.d.ts +1 -1
  225. package/dist/types/core/traits/IWithAssociations.d.ts +4 -0
  226. package/dist/types/core/traits/IWithFollowers.d.ts +1 -1
  227. package/dist/types/core/traits/index.d.ts +1 -0
  228. package/dist/types/core/types/IHubItemEntity.d.ts +19 -1
  229. package/dist/types/core/types/IHubSite.d.ts +3 -10
  230. package/dist/types/extent.d.ts +1 -1
  231. package/dist/types/groups/HubGroups.d.ts +1 -1
  232. package/dist/types/index.d.ts +1 -0
  233. package/dist/types/initiatives/HubInitiative.d.ts +1 -1
  234. package/dist/types/initiatives/HubInitiatives.d.ts +40 -1
  235. package/dist/types/permissions/types/Permission.d.ts +14 -2
  236. package/dist/types/projects/HubProject.d.ts +1 -1
  237. package/dist/types/projects/fetch.d.ts +14 -0
  238. package/dist/types/search/_internal/getEntityTypeFromType.d.ts +9 -0
  239. package/dist/types/search/_internal/negateGroupPredicates.d.ts +9 -0
  240. package/dist/types/search/utils.d.ts +8 -0
  241. package/dist/types/sites/_internal/SiteBusinessRules.d.ts +1 -1
  242. package/dist/types/sites/_internal/SiteSchema.d.ts +1 -1
  243. package/dist/types/sites/_internal/SiteUiSchemaEdit.d.ts +3 -3
  244. package/dist/types/sites/_internal/SiteUiSchemaFollowers.d.ts +11 -0
  245. package/dist/types/sites/_internal/capabilities/capabilityToFeatureMap.d.ts +14 -0
  246. package/dist/types/sites/_internal/capabilities/convertFeaturesToLegacyCapabilities.d.ts +19 -0
  247. package/dist/types/sites/_internal/capabilities/migrateLegacyCapabilitiesToFeatures.d.ts +12 -0
  248. package/dist/types/sites/_internal/capabilities/types.d.ts +29 -0
  249. package/dist/types/users/HubUsers.d.ts +1 -1
  250. package/package.json +1 -1
@@ -7,9 +7,9 @@ const getLocationOptions_1 = require("../../core/schemas/internal/getLocationOpt
7
7
  const getTagItems_1 = require("../../core/schemas/internal/getTagItems");
8
8
  /**
9
9
  * @private
10
- * construct edit uiSchema for Hub Projects - this defines
11
- * how the schema properties should be rendered in the
12
- * project editing experience
10
+ * constructs the edit uiSchema for Hub Sites.
11
+ * This defines how the schema properties should
12
+ * be rendered in the site editing experience
13
13
  */
14
14
  exports.buildUiSchema = async (i18nScope, entity, context) => {
15
15
  return {
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildUiSchema = void 0;
4
+ /**
5
+ * @private
6
+ * constructs the followers uiSchema for Hub Sites.
7
+ * This defines how the schema properties should
8
+ * be rendered in the site followers > settings
9
+ * experience
10
+ */
11
+ exports.buildUiSchema = async (i18nScope, entity, context) => {
12
+ return {
13
+ type: "Layout",
14
+ elements: [
15
+ {
16
+ type: "Section",
17
+ elements: [
18
+ {
19
+ labelKey: `${i18nScope}.fields.followers.groupAccess.label`,
20
+ scope: "/properties/_followers/properties/groupAccess",
21
+ type: "Control",
22
+ options: {
23
+ control: "hub-field-input-tile-select",
24
+ layout: "horizontal",
25
+ helperText: {
26
+ labelKey: `${i18nScope}.fields.followers.groupAccess.helperText`,
27
+ },
28
+ labels: [
29
+ `{{${i18nScope}.fields.followers.groupAccess.private.label:translate}}`,
30
+ `{{${i18nScope}.fields.followers.groupAccess.org.label:translate}}`,
31
+ `{{${i18nScope}.fields.followers.groupAccess.public.label:translate}}`,
32
+ ],
33
+ descriptions: [
34
+ `{{${i18nScope}.fields.followers.groupAccess.private.description:translate}}`,
35
+ `{{${i18nScope}.fields.followers.groupAccess.org.description:translate}}`,
36
+ `{{${i18nScope}.fields.followers.groupAccess.public.description:translate}}`,
37
+ ],
38
+ icons: ["users", "organization", "globe"],
39
+ styles: { "max-width": "45rem" },
40
+ },
41
+ },
42
+ {
43
+ labelKey: `${i18nScope}.fields.followers.showFollowAction.label`,
44
+ scope: "/properties/_followers/properties/showFollowAction",
45
+ type: "Control",
46
+ options: {
47
+ control: "hub-field-input-switch",
48
+ layout: "inline-space-between",
49
+ helperText: {
50
+ labelKey: `${i18nScope}.fields.followers.showFollowAction.helperText`,
51
+ },
52
+ },
53
+ },
54
+ ],
55
+ },
56
+ ],
57
+ };
58
+ };
59
+ //# sourceMappingURL=SiteUiSchemaFollowers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteUiSchemaFollowers.js","sourceRoot":"","sources":["../../../../src/sites/_internal/SiteUiSchemaFollowers.ts"],"names":[],"mappings":";;;AAIA;;;;;;GAMG;AACU,QAAA,aAAa,GAAG,KAAK,EAChC,SAAiB,EACjB,MAAgB,EAChB,OAAuB,EACH,EAAE;IACtB,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE;oBACR;wBACE,QAAQ,EAAE,GAAG,SAAS,qCAAqC;wBAC3D,KAAK,EAAE,+CAA+C;wBACtD,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE;4BACP,OAAO,EAAE,6BAA6B;4BACtC,MAAM,EAAE,YAAY;4BACpB,UAAU,EAAE;gCACV,QAAQ,EAAE,GAAG,SAAS,0CAA0C;6BACjE;4BACD,MAAM,EAAE;gCACN,KAAK,SAAS,yDAAyD;gCACvE,KAAK,SAAS,qDAAqD;gCACnE,KAAK,SAAS,wDAAwD;6BACvE;4BACD,YAAY,EAAE;gCACZ,KAAK,SAAS,+DAA+D;gCAC7E,KAAK,SAAS,2DAA2D;gCACzE,KAAK,SAAS,8DAA8D;6BAC7E;4BACD,KAAK,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC;4BACzC,MAAM,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE;yBACjC;qBACF;oBACD;wBACE,QAAQ,EAAE,GAAG,SAAS,0CAA0C;wBAChE,KAAK,EAAE,oDAAoD;wBAC3D,IAAI,EAAE,SAAS;wBACf,OAAO,EAAE;4BACP,OAAO,EAAE,wBAAwB;4BACjC,MAAM,EAAE,sBAAsB;4BAC9B,UAAU,EAAE;gCACV,QAAQ,EAAE,GAAG,SAAS,+CAA+C;6BACtE;yBACF;qBACF;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.capabilityToFeatureMap = void 0;
4
+ /**
5
+ * Returns an array of ICapabilityToFeatureMap objects
6
+ * that define the projection of legacy capabilities
7
+ * to permission features.
8
+ *
9
+ * We use this map to manage foward and backard conversions
10
+ * and migration of legacy capablities to features when a
11
+ * site is fetched or updated
12
+ *
13
+ * NOTE: if you are porting a legacy capability over to
14
+ * workspaces, add it to this map
15
+ */
16
+ exports.capabilityToFeatureMap = [
17
+ {
18
+ /**
19
+ * Currently if the hideFollow capability is present
20
+ * on the site capabilities, the app interprets this
21
+ * to mean following is disabled for the site, and
22
+ * thus, in-page action "Follow" buttons are not
23
+ * displayed. Permissions, however, are structured
24
+ * in the positive, meaning that hub:site:feature:follow
25
+ * should return true if following is enabled, and
26
+ * false if it's disabled. We set "negate" to true
27
+ * to handle this forward/backward discrepancy
28
+ */
29
+ capability: "hideFollow",
30
+ feature: "hub:site:feature:follow",
31
+ negate: true,
32
+ },
33
+ ];
34
+ //# sourceMappingURL=capabilityToFeatureMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilityToFeatureMap.js","sourceRoot":"","sources":["../../../../../src/sites/_internal/capabilities/capabilityToFeatureMap.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACU,QAAA,sBAAsB,GAA8B;IAC/D;QACE;;;;;;;;;;WAUG;QACH,UAAU,EAAE,YAAY;QACxB,OAAO,EAAE,yBAAyB;QAClC,MAAM,EAAE,IAAI;KACb;CACF,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertFeaturesToLegacyCapabilities = void 0;
4
+ const get_prop_1 = require("../../../objects/get-prop");
5
+ const capabilityToFeatureMap_1 = require("./capabilityToFeatureMap");
6
+ const objects_1 = require("../../../objects");
7
+ /**
8
+ * Site capabilities are currently saved as an array on the
9
+ * site.data.values.capabilities. We want to migragte these
10
+ * legacy capabilities over to features in the new permissions
11
+ * system; however, we must continue persisting updates to
12
+ * these features in the legacy capabilities array until the
13
+ * existing site capabilities in our application are plumbed
14
+ * to work off of permissions
15
+ *
16
+ * This function is called within updateSite to ensure
17
+ * the legacy capabilities array is kept up-to-date
18
+ *
19
+ * TODO: Remove once site capabilities use permissions
20
+ *
21
+ * @param modelToUpdate
22
+ * @param currentModel
23
+ */
24
+ exports.convertFeaturesToLegacyCapabilities = (modelToUpdate, currentModel) => {
25
+ let legacyCapabilityFeatureFlags = {};
26
+ // 1. convert legacy capabilities to a feature flag hash
27
+ (get_prop_1.getProp(currentModel, "data.values.capabilities") || []).forEach((capability) => {
28
+ legacyCapabilityFeatureFlags[capability] = true;
29
+ });
30
+ // 2. override legacy capabilities that are driven by features
31
+ const features = get_prop_1.getProp(modelToUpdate, "data.settings.features") || {};
32
+ legacyCapabilityFeatureFlags = capabilityToFeatureMap_1.capabilityToFeatureMap.reduce((capabilities, map) => {
33
+ // TODO: remove istanbul exception once we include a
34
+ // legacy capability that satisfies the second condition
35
+ /* istanbul ignore next */
36
+ const featureFlag = map.negate
37
+ ? !features[map.feature]
38
+ : features[map.feature];
39
+ return Object.assign(Object.assign({}, capabilities), { [map.capability]: featureFlag });
40
+ }, legacyCapabilityFeatureFlags);
41
+ // 3. convert legacy capabilities back to an array and persist on model
42
+ const updatedCapabilities = Object.entries(legacyCapabilityFeatureFlags).reduce((acc, [key, value]) => {
43
+ value && acc.push(key);
44
+ return acc;
45
+ }, []);
46
+ objects_1.setProp("data.values.capabilities", updatedCapabilities, modelToUpdate);
47
+ return modelToUpdate;
48
+ };
49
+ //# sourceMappingURL=convertFeaturesToLegacyCapabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertFeaturesToLegacyCapabilities.js","sourceRoot":"","sources":["../../../../../src/sites/_internal/capabilities/convertFeaturesToLegacyCapabilities.ts"],"names":[],"mappings":";;;AACA,wDAAoD;AACpD,qEAAkE;AAMlE,8CAA2C;AAE3C;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,mCAAmC,GAAG,CACjD,aAAqB,EACrB,YAAoB,EACZ,EAAE;IACV,IAAI,4BAA4B,GAAkC,EAAE,CAAC;IAErE,wDAAwD;IACxD,CAAC,kBAAO,CAAC,YAAY,EAAE,0BAA0B,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAC/D,CAAC,UAA4B,EAAE,EAAE;QAC/B,4BAA4B,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAClD,CAAC,CACF,CAAC;IAEF,8DAA8D;IAC9D,MAAM,QAAQ,GAAG,kBAAO,CAAC,aAAa,EAAE,wBAAwB,CAAC,IAAI,EAAE,CAAC;IACxE,4BAA4B,GAAG,+CAAsB,CAAC,MAAM,CAC1D,CACE,YAA2C,EAC3C,GAA4B,EAC5B,EAAE;QACF,oDAAoD;QACpD,wDAAwD;QACxD,0BAA0B;QAC1B,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM;YAC5B,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC;YACxB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAE1B,uCACK,YAAY,KACf,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,WAAW,IAC7B;IACJ,CAAC,EACD,4BAA4B,CAC7B,CAAC;IAEF,uEAAuE;IACvE,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,CACxC,4BAA4B,CAC7B,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC7B,KAAK,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,iBAAO,CAAC,0BAA0B,EAAE,mBAAmB,EAAE,aAAa,CAAC,CAAC;IACxE,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.migrateLegacyCapabilitiesToFeatures = void 0;
4
+ const objects_1 = require("../../../objects");
5
+ const capabilityToFeatureMap_1 = require("./capabilityToFeatureMap");
6
+ /**
7
+ * Site capabilities are currently saved as an array on the
8
+ * site.data.values.capabilities. We want to migragte these
9
+ * legacy capabilities over to features in the new permissions
10
+ * system and expose them on the entity
11
+ *
12
+ * This function is called within fetchSite to ensure all
13
+ * sites have features that are kept up-to-date with the
14
+ * legacy capabilities array
15
+ */
16
+ exports.migrateLegacyCapabilitiesToFeatures = (model) => {
17
+ const legacyCapabilityFeatureFlags = {};
18
+ let updatedFeatures = {};
19
+ // 1. convert legacy capabilities to a feature flag hash
20
+ (objects_1.getProp(model, "data.values.capabilities") || []).forEach((capability) => {
21
+ legacyCapabilityFeatureFlags[capability] = true;
22
+ });
23
+ // 2. update/add features based on the legacy capabilities array
24
+ const currentFeatures = objects_1.getProp(model, "data.settings.features") || {};
25
+ updatedFeatures = capabilityToFeatureMap_1.capabilityToFeatureMap.reduce((features, map) => {
26
+ // TODO: remove istanbul exception once we include a
27
+ // legacy capability that satisfies the second condition
28
+ /* istanbul ignore next */
29
+ const capabilityFlag = map.negate
30
+ ? !legacyCapabilityFeatureFlags[map.capability]
31
+ : legacyCapabilityFeatureFlags[map.capability];
32
+ return Object.assign(Object.assign({}, features), { [map.feature]: capabilityFlag });
33
+ }, currentFeatures);
34
+ objects_1.setProp("data.settings.features", updatedFeatures, model);
35
+ return model;
36
+ };
37
+ //# sourceMappingURL=migrateLegacyCapabilitiesToFeatures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrateLegacyCapabilitiesToFeatures.js","sourceRoot":"","sources":["../../../../../src/sites/_internal/capabilities/migrateLegacyCapabilitiesToFeatures.ts"],"names":[],"mappings":";;;AAAA,8CAAoD;AAGpD,qEAAkE;AAOlE;;;;;;;;;GASG;AACU,QAAA,mCAAmC,GAAG,CAAC,KAAa,EAAU,EAAE;IAC3E,MAAM,4BAA4B,GAAkC,EAAE,CAAC;IACvE,IAAI,eAAe,GAAkB,EAAE,CAAC;IAExC,wDAAwD;IACxD,CAAC,iBAAO,CAAC,KAAK,EAAE,0BAA0B,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CACxD,CAAC,UAA4B,EAAE,EAAE;QAC/B,4BAA4B,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAClD,CAAC,CACF,CAAC;IAEF,gEAAgE;IAChE,MAAM,eAAe,GAAG,iBAAO,CAAC,KAAK,EAAE,wBAAwB,CAAC,IAAI,EAAE,CAAC;IACvE,eAAe,GAAG,+CAAsB,CAAC,MAAM,CAC7C,CAAC,QAAuB,EAAE,GAA4B,EAAE,EAAE;QACxD,oDAAoD;QACpD,wDAAwD;QACxD,0BAA0B;QAC1B,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM;YAC/B,CAAC,CAAC,CAAC,4BAA4B,CAAC,GAAG,CAAC,UAAU,CAAC;YAC/C,CAAC,CAAC,4BAA4B,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAEjD,uCACK,QAAQ,KACX,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,cAAc,IAC7B;IACJ,CAAC,EACD,eAAe,CAChB,CAAC;IAEF,iBAAO,CAAC,wBAAwB,EAAE,eAAe,EAAE,KAAK,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/sites/_internal/capabilities/types.ts"],"names":[],"mappings":""}
@@ -10,6 +10,7 @@ const _purge_non_guids_from_catalog_1 = require("./_internal/_purge-non-guids-fr
10
10
  const _ensure_telemetry_1 = require("./_internal/_ensure-telemetry");
11
11
  const _migrate_feed_config_1 = require("./_internal/_migrate-feed-config");
12
12
  const _migrate_event_list_card_configs_1 = require("./_internal/_migrate-event-list-card-configs");
13
+ const migrateLegacyCapabilitiesToFeatures_1 = require("./_internal/capabilities/migrateLegacyCapabilitiesToFeatures");
13
14
  /**
14
15
  * Upgrades the schema upgrades
15
16
  * @param model IModel
@@ -27,6 +28,7 @@ function upgradeSiteSchema(model) {
27
28
  model = _ensure_telemetry_1._ensureTelemetry(model);
28
29
  model = _migrate_feed_config_1._migrateFeedConfig(model);
29
30
  model = _migrate_event_list_card_configs_1._migrateEventListCardConfigs(model);
31
+ model = migrateLegacyCapabilitiesToFeatures_1.migrateLegacyCapabilitiesToFeatures(model);
30
32
  // WARNING - If you are writing a site schema migration,
31
33
  // you probably need to apply it to site drafts as well!
32
34
  // See https://github.com/Esri/hub.js/issues/498 for more details.
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-site-schema.js","sourceRoot":"","sources":["../../../src/sites/upgrade-site-schema.ts"],"names":[],"mappings":";;;AACA,wCAAqC;AACrC,+DAA4D;AAC5D,uEAAkE;AAClE,uFAAkF;AAClF,iEAA6D;AAC7D,6FAAsF;AACtF,qEAAiE;AACjE,2EAAsE;AACtE,mGAA4F;AAE5F;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,IAAI,iBAAO,CAAC,KAAK,EAAE,+BAA+B,CAAC,KAAK,yCAAmB,EAAE;QAC3E,OAAO,KAAK,CAAC;KACd;SAAM;QACL,sCAAsC;QACtC,KAAK,GAAG,qCAAgB,CAAC,KAAK,CAAC,CAAC;QAChC,KAAK,GAAG,qDAAwB,CAAC,KAAK,CAAC,CAAC;QACxC,KAAK,GAAG,gCAAc,CAAC,KAAK,CAAC,CAAC;QAC9B,KAAK,GAAG,yDAAyB,CAAC,KAAK,CAAC,CAAC;QACzC,KAAK,GAAG,oCAAgB,CAAS,KAAK,CAAC,CAAC;QACxC,KAAK,GAAG,yCAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,KAAK,GAAG,+DAA4B,CAAC,KAAK,CAAC,CAAC;QAC5C,wDAAwD;QACxD,wDAAwD;QACxD,kEAAkE;QAClE,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAjBD,8CAiBC"}
1
+ {"version":3,"file":"upgrade-site-schema.js","sourceRoot":"","sources":["../../../src/sites/upgrade-site-schema.ts"],"names":[],"mappings":";;;AACA,wCAAqC;AACrC,+DAA4D;AAC5D,uEAAkE;AAClE,uFAAkF;AAClF,iEAA6D;AAC7D,6FAAsF;AACtF,qEAAiE;AACjE,2EAAsE;AACtE,mGAA4F;AAC5F,sHAAmH;AAEnH;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,IAAI,iBAAO,CAAC,KAAK,EAAE,+BAA+B,CAAC,KAAK,yCAAmB,EAAE;QAC3E,OAAO,KAAK,CAAC;KACd;SAAM;QACL,sCAAsC;QACtC,KAAK,GAAG,qCAAgB,CAAC,KAAK,CAAC,CAAC;QAChC,KAAK,GAAG,qDAAwB,CAAC,KAAK,CAAC,CAAC;QACxC,KAAK,GAAG,gCAAc,CAAC,KAAK,CAAC,CAAC;QAC9B,KAAK,GAAG,yDAAyB,CAAC,KAAK,CAAC,CAAC;QACzC,KAAK,GAAG,oCAAgB,CAAS,KAAK,CAAC,CAAC;QACxC,KAAK,GAAG,yCAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,KAAK,GAAG,+DAA4B,CAAC,KAAK,CAAC,CAAC;QAC5C,KAAK,GAAG,yEAAmC,CAAC,KAAK,CAAC,CAAC;QAEnD,wDAAwD;QACxD,wDAAwD;QACxD,kEAAkE;QAClE,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAnBD,8CAmBC"}
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.enrichUserSearchResult = void 0;
4
4
  const enrichments_1 = require("./_internal/enrichments");
5
5
  const objects_1 = require("../objects");
6
- const search_1 = require("../search");
6
+ const utils_1 = require("../search/utils");
7
7
  const parseInclude_1 = require("../search/_internal/parseInclude");
8
8
  const urls_1 = require("../urls");
9
9
  const util_1 = require("../util");
10
- const utils_1 = require("../utils");
10
+ const utils_2 = require("../utils");
11
11
  /**
12
12
  * Enrich a User object
13
13
  * @param user
@@ -59,7 +59,7 @@ async function enrichUserSearchResult(user, include, requestOptions) {
59
59
  // Parse the includes into a valid set of enrichments
60
60
  const specs = include.map(parseInclude_1.parseInclude);
61
61
  // Extract out the low-level enrichments needed
62
- const enrichments = utils_1.mapBy("enrichment", specs).filter(util_1.unique);
62
+ const enrichments = utils_2.mapBy("enrichment", specs).filter(util_1.unique);
63
63
  // fetch the enrichments
64
64
  let enriched = {};
65
65
  // Ignoring the else, because we currently have defaults, but want the guards
@@ -76,7 +76,7 @@ async function enrichUserSearchResult(user, include, requestOptions) {
76
76
  // only construct thumbnail url if we have a thumbnail value
77
77
  // ui layer can decide how to handle a null thumbnail
78
78
  if (user.thumbnail) {
79
- result.links.thumbnail = search_1.getUserThumbnailUrl(requestOptions.portal, user, token);
79
+ result.links.thumbnail = utils_1.getUserThumbnailUrl(requestOptions.portal, user, token);
80
80
  }
81
81
  result.links.self = urls_1.getUserHomeUrl(result.id, requestOptions);
82
82
  result.links.siteRelative = `/people/${result.id}`;
@@ -1 +1 @@
1
- {"version":3,"file":"HubUsers.js","sourceRoot":"","sources":["../../../src/users/HubUsers.ts"],"names":[],"mappings":";;;AACA,yDAA+D;AAC/D,wCAAqC;AACrC,sCAAkE;AAClE,mEAAgE;AAEhE,kCAAyC;AACzC,kCAAiC;AACjC,oCAAiC;AAGjC;;;;;;GAMG;AACI,KAAK,UAAU,sBAAsB,CAC1C,IAAiC,EACjC,OAAiB,EACjB,cAAkC;;IAElC,6BAA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Q,GAAG,EAAE,CAAC;IAClB,6EAA6E;IAC7E,2DAA2D;IAC3D,0BAA0B;IAC1B,IAAI,WAAW,CAAC,MAAM,EAAE;QACtB,QAAQ,GAAG,MAAM,kCAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;KAC1E;IAED,yCAAyC;IACzC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,iBAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,SAAG,cAAc,CAAC,cAAc,0CAAE,KAAK,CAAC;IAEnD,4DAA4D;IAC5D,qDAAqD;IACrD,IAAI,IAAI,CAAC,SAAS,EAAE;QAClB,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,2BAAmB,CAC1C,cAAc,CAAC,MAAM,EACrB,IAAI,EACJ,KAAK,CACN,CAAC;KACH;IACD,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,qBAAc,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;IAC9D,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,WAAW,MAAM,CAAC,EAAE,EAAE,CAAC;IAEnD,OAAO,MAAM,CAAC;AAChB,CAAC;AAhFD,wDAgFC"}
@@ -7,7 +7,7 @@ exports.clearMemoizedCache = exports.memoize = void 0;
7
7
  * @returns
8
8
  */
9
9
  const createCacheKeyFromArgs = (args) => args.reduce((cacheKey, arg) => (cacheKey += `_${typeof arg === "object" ? JSON.stringify(args) : `${arg}`}_`), "");
10
- const memoizedFnCache = {};
10
+ let memoizedFnCache = {};
11
11
  /**
12
12
  * Wrap a function into a memoized version of itself. Multiple calls for the same function
13
13
  * will return the same memoized function - thus enabling a shared cache of results.
@@ -39,9 +39,7 @@ exports.memoize = (fn) => {
39
39
  */
40
40
  exports.clearMemoizedCache = (fnName) => {
41
41
  if (!fnName) {
42
- Object.keys(memoizedFnCache).forEach((key) => {
43
- delete memoizedFnCache[key];
44
- });
42
+ memoizedFnCache = {};
45
43
  return;
46
44
  }
47
45
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"memoize.js","sourceRoot":"","sources":["../../../src/utils/memoize.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,MAAM,sBAAsB,GAAG,CAAC,IAAW,EAAE,EAAE,CAC7C,IAAI,CAAC,MAAM,CACT,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,CAChB,CAAC,QAAQ,IAAI,IACX,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EACzD,GAAG,CAAC,EACN,EAAE,CACH,CAAC;AAEJ,MAAM,eAAe,GAAwB,EAAE,CAAC;AAChD;;;;;;GAMG;AACU,QAAA,OAAO,GAAG,CACrB,EAA0B,EAC1B,EAAE;IACF,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE;QACnC,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,MAAM,UAAU,GAAG,CAAC,GAAG,IAAU,EAAE,EAAE;YACnC,MAAM,QAAQ,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;YAC9C,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE;gBACnB,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC;aACxB;YAED,MAAM,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;YAC5C,KAAK,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC;YAC1B,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;QACF,eAAe,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC;KAC7C;IACD,OAAO,eAAe,CAAC,IAAI,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G,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;YAC5C,KAAK,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC;YAC1B,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;QACF,eAAe,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC;KAC7C;IACD,OAAO,eAAe,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG,CAAC,MAAe,EAAE,EAAE;IACpD,IAAI,CAAC,MAAM,EAAE;QACX,eAAe,GAAG,EAAE,CAAC;QACrB,OAAO;KACR;SAAM;QACL,OAAO,eAAe,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;KACtC;AACH,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { IWithAssociations } from "../core/traits/IWithAssociations";
2
+ import { IAssociationInfo } from "./types";
3
+ /**
4
+ * Add an association to an entity
5
+ * Persisted into the entity's `.typeKeywords` array
6
+ * @param info
7
+ * @param entity
8
+ */
9
+ export declare function addAssociation(entity: IWithAssociations, info: IAssociationInfo): void;
@@ -0,0 +1,4 @@
1
+ export * from "./addAssociation";
2
+ export * from "./listAssociations";
3
+ export * from "./removeAssociation";
4
+ export * from "./types";
@@ -0,0 +1,8 @@
1
+ import { EntityType } from "../../search/types/IHubCatalog";
2
+ import { AssociationType } from "../types";
3
+ /**
4
+ * Get the entity item type for an association type
5
+ * @param type
6
+ * @returns
7
+ */
8
+ export declare function getTargetEntityFromAssociationType(type: AssociationType): EntityType;
@@ -0,0 +1,10 @@
1
+ import { IQuery } from "../../search/types/IHubCatalog";
2
+ /**
3
+ * Get a query that can be used in a Gallery, and will return the associated
4
+ * entities, based on the AssociationType
5
+ *
6
+ * @param entity
7
+ * @param type
8
+ * @returns
9
+ */
10
+ export declare function getTypeByIdsQuery(itemType: string, ids: string[]): IQuery;
@@ -0,0 +1,7 @@
1
+ import { AssociationType } from "../types";
2
+ /**
3
+ * Get the item type for an association type
4
+ * @param type
5
+ * @returns
6
+ */
7
+ export declare function getTypeFromAssociationType(type: AssociationType): string;
@@ -0,0 +1,10 @@
1
+ import { IQuery } from "../../search/types/IHubCatalog";
2
+ /**
3
+ * @private
4
+ * Return an `IQuery` for a specific item type, with a specific typekeyword
5
+ * This is used internally to build queries for "Connected" entities
6
+ * @param itemType
7
+ * @param keyword
8
+ * @returns
9
+ */
10
+ export declare function getTypeWithKeywordQuery(itemType: string, keyword: string): IQuery;
@@ -0,0 +1,10 @@
1
+ import { IQuery } from "../../search/types/IHubCatalog";
2
+ /**
3
+ * @private
4
+ * Return an `IQuery` for a specific item type, without a specific typekeyword
5
+ * This is used internally to build queries for "Not Connected" entities
6
+ * @param itemType
7
+ * @param keyword
8
+ * @returns
9
+ */
10
+ export declare function getTypeWithoutKeywordQuery(itemType: string, keyword: string): IQuery;
@@ -0,0 +1,8 @@
1
+ import { IWithAssociations } from "../core/traits/IWithAssociations";
2
+ import { AssociationType, IAssociationInfo } from "./types";
3
+ /**
4
+ * Return a list of all associations on an entity for a type
5
+ * @param entity
6
+ * @returns
7
+ */
8
+ export declare function listAssociations(entity: IWithAssociations, type: AssociationType): IAssociationInfo[];
@@ -0,0 +1,9 @@
1
+ import { IWithAssociations } from "../core/traits/IWithAssociations";
2
+ import { IAssociationInfo } from "./types";
3
+ /**
4
+ * Remove an association from an entity
5
+ * @param info
6
+ * @param entity
7
+ * @returns
8
+ */
9
+ export declare function removeAssociation(entity: IWithAssociations, info: IAssociationInfo): void;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Definition of an Association
3
+ * This will be persisted in the item's typekeywords
4
+ * as `type|id`
5
+ */
6
+ export interface IAssociationInfo {
7
+ /**
8
+ * Type of the association. Currently only initiative is supported
9
+ */
10
+ type: AssociationType;
11
+ /**
12
+ * Id of the associated item
13
+ */
14
+ id: string;
15
+ }
16
+ /**
17
+ * Association type
18
+ */
19
+ export declare type AssociationType = "initiative";
@@ -4,6 +4,6 @@ import { IExtent } from "@esri/arcgis-rest-types";
4
4
  import { IHubLocation } from "../../core/types/IHubLocation";
5
5
  import { IHubEditableContent } from "../../core/types/IHubEditableContent";
6
6
  import { IItemAndIServerEnrichments } from "../../items/_enrichments";
7
- export declare const getItemExtent: (itemExtent: number[][]) => IExtent;
7
+ export declare const getExtentObject: (itemExtent: number[][]) => IExtent;
8
8
  export declare function deriveLocationFromItemExtent(itemExtent?: number[][]): IHubLocation;
9
9
  export declare function computeProps(model: IModel, content: Partial<IHubEditableContent>, requestOptions: IRequestOptions, enrichments?: IItemAndIServerEnrichments): IHubEditableContent;
@@ -76,42 +76,6 @@ export declare const setContentBoundary: (content: IHubContent, boundary: Geogra
76
76
  viewDefinition?: {
77
77
  definitionExpression?: string;
78
78
  };
79
- source?: string;
80
- summary?: string;
81
- view?: import("../../core").IWithViewSettings;
82
- owner: string;
83
- url?: string;
84
- id: string;
85
- canEdit: boolean;
86
- access?: import("../../core").AccessLevel;
87
- culture?: string;
88
- description?: string;
89
- extent?: number[][];
90
- itemControl: string;
91
- tags: string[];
92
- thumbnailUrl?: string;
93
- thumbnail?: string;
94
- typeKeywords?: string[];
95
- canDelete: boolean;
96
- location?: import("../../core").IHubLocation;
97
- orgId?: string;
98
- protected?: boolean;
99
- name: string;
100
- createdDate: Date;
101
- createdDateSource: string;
102
- updatedDate: Date;
103
- updatedDateSource: string;
104
- type: string;
105
- links?: {
106
- [key: string]: string | import("../../core").ILink;
107
- thumbnail?: string;
108
- self: string;
109
- siteRelative?: string;
110
- workspaceRelative?: string;
111
- layoutRelative?: string;
112
- };
113
- features?: import("../..").IFeatureFlags;
114
- isDiscussable?: boolean;
115
79
  statistics?: any;
116
80
  data?: {
117
81
  [propName: string]: any;
@@ -125,15 +89,25 @@ export declare const setContentBoundary: (content: IHubContent, boundary: Geogra
125
89
  layers?: Partial<ILayerDefinition>[];
126
90
  recordCount?: number;
127
91
  servicesDirectoryDisabled?: boolean;
92
+ id: string;
93
+ owner: string;
94
+ tags: string[];
128
95
  created: number;
129
96
  modified: number;
130
97
  numViews: number;
131
98
  size: number;
99
+ protected?: boolean;
132
100
  title: string;
101
+ type: string;
102
+ typeKeywords?: string[];
103
+ description?: string;
133
104
  snippet?: string;
134
105
  documentation?: string;
106
+ extent?: number[][];
135
107
  spatialReference?: ISpatialReference;
108
+ culture?: string;
136
109
  properties?: any;
110
+ url?: string;
137
111
  };
138
112
  /**
139
113
  * get a content's boundary based on the item's boundary property
@@ -1,14 +1,16 @@
1
1
  import { IGroup } from "@esri/arcgis-rest-portal";
2
2
  import { IArcGISContext } from "../ArcGISContext";
3
3
  import { IPermissionAccessResponse, IEntityPermissionPolicy, Permission } from "../permissions";
4
- import { IWithSharingBehavior, IWithStoreBehavior, IWithFeaturedImageBehavior, IWithPermissionBehavior } from "./behaviors";
4
+ import { IWithSharingBehavior, IWithStoreBehavior, IWithFeaturedImageBehavior, IWithPermissionBehavior, IWithAssociationBehavior } from "./behaviors";
5
5
  import { IWithThumbnailBehavior } from "./behaviors/IWithThumbnailBehavior";
6
6
  import { IHubItemEntity, SettableAccessLevel } from "./types";
7
7
  import { IWithDiscussionsBehavior } from "./behaviors/IWithDiscussionsBehavior";
8
+ import { IWithFollowersBehavior } from "./behaviors/IWithFollowersBehavior";
9
+ import { AssociationType, IAssociationInfo } from "../associations/types";
8
10
  /**
9
11
  * Base class for all Hub Entities backed by items
10
12
  */
11
- export declare abstract class HubItemEntity<T extends IHubItemEntity> implements IWithStoreBehavior<T>, IWithSharingBehavior, IWithThumbnailBehavior, IWithFeaturedImageBehavior, IWithPermissionBehavior, IWithDiscussionsBehavior {
13
+ export declare abstract class HubItemEntity<T extends IHubItemEntity> implements IWithStoreBehavior<T>, IWithSharingBehavior, IWithThumbnailBehavior, IWithFeaturedImageBehavior, IWithPermissionBehavior, IWithDiscussionsBehavior, IWithFollowersBehavior, IWithAssociationBehavior {
12
14
  protected context: IArcGISContext;
13
15
  protected entity: T;
14
16
  protected isDestroyed: boolean;
@@ -92,6 +94,15 @@ export declare abstract class HubItemEntity<T extends IHubItemEntity> implements
92
94
  * @param access
93
95
  */
94
96
  setAccess(access: SettableAccessLevel): Promise<void>;
97
+ /**
98
+ * Returns the followers group
99
+ */
100
+ getFollowersGroup(): Promise<IGroup>;
101
+ /**
102
+ * Sets the access level of the followers group
103
+ * @param access
104
+ */
105
+ setFollowersGroupAccess(access: SettableAccessLevel): Promise<void>;
95
106
  /**
96
107
  * Return a list of groups the Entity is shared to.
97
108
  * @returns
@@ -131,4 +142,23 @@ export declare abstract class HubItemEntity<T extends IHubItemEntity> implements
131
142
  * @param isDiscussable whether to enable or disable discussions
132
143
  */
133
144
  updateIsDiscussable(isDiscussable: boolean): void;
145
+ /**
146
+ * Return a list of IAssociationInfo objects representing
147
+ * the associations this entity has, to the specified type
148
+ * @param type
149
+ * @returns
150
+ */
151
+ listAssociations(type: AssociationType): IAssociationInfo[];
152
+ /**
153
+ * Add an association to this entity
154
+ * @param info
155
+ * @returns
156
+ */
157
+ addAssociation(info: IAssociationInfo): void;
158
+ /**
159
+ * Remove an association from this entity
160
+ * @param info
161
+ * @returns
162
+ */
163
+ removeAssociation(info: IAssociationInfo): void;
134
164
  }
@@ -0,0 +1,23 @@
1
+ import { AssociationType, IAssociationInfo } from "../../associations/types";
2
+ /**
3
+ * Composable behavior that adds permissions to an entity
4
+ */
5
+ export interface IWithAssociationBehavior {
6
+ /**
7
+ * Get a list of the associations for an AssociationType
8
+ * @param type
9
+ */
10
+ listAssociations(type: AssociationType): IAssociationInfo[];
11
+ /**
12
+ * Add an association to the entity.
13
+ * Entity needs to be saved after calling this method
14
+ * @param info
15
+ */
16
+ addAssociation(info: IAssociationInfo): void;
17
+ /**
18
+ * Remove an association to the entity.
19
+ * Entity needs to be saved after calling this method
20
+ * @param info
21
+ */
22
+ removeAssociation(info: IAssociationInfo): void;
23
+ }
@@ -0,0 +1,15 @@
1
+ import { IGroup } from "@esri/arcgis-rest-types";
2
+ import { SettableAccessLevel } from "../types";
3
+ /**
4
+ * Followers behavior for Item-Backed Entities
5
+ */
6
+ export interface IWithFollowersBehavior {
7
+ /**
8
+ * Get the followers group
9
+ */
10
+ getFollowersGroup(): Promise<IGroup>;
11
+ /**
12
+ * Set the access level of the followers group
13
+ */
14
+ setFollowersGroupAccess(access: SettableAccessLevel): Promise<void>;
15
+ }
@@ -6,3 +6,4 @@ export * from "./IWithEditorBehavior";
6
6
  export * from "./IWithFeaturedImageBehavior";
7
7
  export * from "./IWithVersioningBehavior";
8
8
  export * from "./IWithCardBehavior";
9
+ export * from "./IWIthAssociationBehavior";
@@ -14,4 +14,3 @@ import { IHubLocationOption } from "../../types/IHubLocation";
14
14
  * location
15
15
  */
16
16
  export declare function getLocationOptions(entity: ConfigurableEntity, portalName: string, hubRequestOptions: IHubRequestOptions): Promise<IHubLocationOption[]>;
17
- export declare function getDefaultLocationOptions(entity: ConfigurableEntity, portalName: string, hubRequestOptions: IHubRequestOptions): Promise<IHubLocationOption[]>;
@@ -5,7 +5,7 @@ import Ajv from "ajv";
5
5
  * to the supported/defined uiSchema configurations
6
6
  */
7
7
  export declare type EditorType = (typeof validEditorTypes)[number];
8
- export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:content:edit", "hub:content:settings", "hub:initiative:edit", "hub:initiative:create", "hub:site:edit", "hub:site:create", "hub:discussion:edit", "hub:discussion:create", "hub:page:edit", "hub:group:edit", "hub:group:settings"];
8
+ export declare const validEditorTypes: readonly ["hub:project:create", "hub:project:edit", "hub:content:edit", "hub:content:settings", "hub:initiative:edit", "hub:initiative:create", "hub:site:edit", "hub:site:create", "hub:site:followers", "hub:discussion:edit", "hub:discussion:create", "hub:page:edit", "hub:group:edit", "hub:group:settings"];
9
9
  export declare enum UiSchemaRuleEffects {
10
10
  SHOW = "SHOW",
11
11
  HIDE = "HIDE",