@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
@@ -0,0 +1,4 @@
1
+ export interface IWithAssociations {
2
+ typeKeywords?: string[];
3
+ [key: string]: any;
4
+ }
@@ -3,5 +3,5 @@
3
3
  */
4
4
  export interface IWithFollowers {
5
5
  /** followers group id */
6
- followersGroupId: string;
6
+ followersGroupId?: string;
7
7
  }
@@ -1,3 +1,4 @@
1
+ export * from "./IWithAssociations";
1
2
  export * from "./IWithBannerImage";
2
3
  export * from "./IWithLayout";
3
4
  export * from "./IWithSlug";
@@ -3,10 +3,12 @@ import { IHubGeography } from "../../types";
3
3
  import { AccessLevel } from "./types";
4
4
  import { IWithPermissions, IWithViewSettings, IWithDiscussions } from "../traits";
5
5
  import { IHubLocation } from "./IHubLocation";
6
+ import { IWithFollowers } from "../traits/IWithFollowers";
7
+ import { IWithAssociations } from "../traits/IWithAssociations";
6
8
  /**
7
9
  * Properties exposed by Entities that are backed by Items
8
10
  */
9
- export interface IHubItemEntity extends IHubEntityBase, IWithPermissions, IWithDiscussions {
11
+ export interface IHubItemEntity extends IHubEntityBase, IWithPermissions, IWithDiscussions, IWithFollowers, IWithAssociations {
10
12
  /**
11
13
  * Access level of the item ("private" | "org" | "public")
12
14
  */
@@ -101,3 +103,19 @@ export interface IHubItemEntity extends IHubEntityBase, IWithPermissions, IWithD
101
103
  */
102
104
  protected?: boolean;
103
105
  }
106
+ export declare type IHubItemEntityEditor<T> = Omit<T, "extent"> & {
107
+ /**
108
+ * Thumbnail image. This is only used on the Editor and is
109
+ * persisted in the fromEditor method on the Class
110
+ */
111
+ _thumbnail?: any;
112
+ /**
113
+ * Follower group settings. These settings are only used in the
114
+ * Editor and is persisted appropriately in the fromEditor
115
+ * method on the Class
116
+ */
117
+ _followers?: {
118
+ groupAccess?: AccessLevel;
119
+ showFollowAction?: boolean;
120
+ };
121
+ };
@@ -1,13 +1,12 @@
1
1
  import { IExtent } from "@esri/arcgis-rest-feature-layer";
2
2
  import { IWithVersioningBehavior } from "../behaviors";
3
3
  import { IWithCatalog, IWithLayout, IWithPermissions, IWithSlug } from "../traits/index";
4
- import { IHubItemEntity } from "./IHubItemEntity";
5
- import { IWithFollowers } from "../traits/IWithFollowers";
4
+ import { IHubItemEntity, IHubItemEntityEditor } from "./IHubItemEntity";
6
5
  /**
7
6
  * DRAFT: Under development and more properties will likely be added
8
7
  * @internal
9
8
  */
10
- export interface IHubSite extends IHubItemEntity, IWithSlug, IWithCatalog, IWithLayout, IWithPermissions, IWithVersioningBehavior, IWithFollowers {
9
+ export interface IHubSite extends IHubItemEntity, IWithSlug, IWithCatalog, IWithLayout, IWithPermissions, IWithVersioningBehavior {
11
10
  /**
12
11
  * Array of minimal page objects
13
12
  */
@@ -70,10 +69,4 @@ export interface IHubSite extends IHubItemEntity, IWithSlug, IWithCatalog, IWith
70
69
  /** Legacy teams - list of ids */
71
70
  legacyTeams: string[];
72
71
  }
73
- export declare type IHubSiteEditor = Omit<IHubSite, "extent"> & {
74
- /**
75
- * Thumbnail image. This is only used on the Editor and is
76
- * persisted in the fromEditor method on the Class
77
- */
78
- _thumbnail?: any;
79
- };
72
+ export declare type IHubSiteEditor = IHubItemEntityEditor<IHubSite> & {};
@@ -24,7 +24,7 @@ export declare const GLOBAL_EXTENT: IExtent;
24
24
  * Gets the geographic extent for an org
25
25
  * @param hubRequestOptions
26
26
  */
27
- export declare function getGeographicOrgExtent(hubRequestOptions: IHubRequestOptions): Promise<IExtent>;
27
+ export declare function orgExtent(hubRequestOptions: IHubRequestOptions): Promise<IExtent>;
28
28
  /**
29
29
  * Get the default org extent as a bbox for use on item.extent
30
30
  * @param {IHubRequestOptions} hubRequestOptions
@@ -1,9 +1,9 @@
1
1
  import { IGroup } from "@esri/arcgis-rest-types";
2
- import { IHubSearchResult } from "../search";
3
2
  import { IHubRequestOptions } from "../types";
4
3
  import { IRequestOptions } from "@esri/arcgis-rest-request";
5
4
  import { IHubGroup } from "../core/types/IHubGroup";
6
5
  import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
6
+ import { IHubSearchResult } from "../search/types/IHubSearchResult";
7
7
  /**
8
8
  * Enrich a generic search result
9
9
  * @param group
@@ -1,3 +1,4 @@
1
+ export * from "./associations";
1
2
  export * from "./access";
2
3
  export * from "./api";
3
4
  export * from "./ArcGISContext";
@@ -1,5 +1,5 @@
1
1
  import { IEntityEditorContext } from "../core/types/HubEntityEditor";
2
- import { Catalog } from "../search";
2
+ import { Catalog } from "../search/Catalog";
3
3
  import { IArcGISContext } from "../ArcGISContext";
4
4
  import { HubItemEntity } from "../core/HubItemEntity";
5
5
  import { InitiativeEditorType } from "./_internal/InitiativeSchema";
@@ -1,8 +1,9 @@
1
1
  import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
2
2
  import { IHubRequestOptions } from "../index";
3
+ import { IQuery } from "../search/types/IHubCatalog";
3
4
  import { IItem } from "@esri/arcgis-rest-portal";
4
5
  import { IRequestOptions } from "@esri/arcgis-rest-request";
5
- import { IHubInitiative } from "../core/types";
6
+ import { IEntityInfo, IHubInitiative } from "../core/types";
6
7
  import { IHubSearchResult } from "../search";
7
8
  /**
8
9
  * @private
@@ -53,3 +54,41 @@ export declare function convertItemToInitiative(item: IItem, requestOptions: IRe
53
54
  * @returns
54
55
  */
55
56
  export declare function enrichInitiativeSearchResult(item: IItem, include: string[], requestOptions: IHubRequestOptions): Promise<IHubSearchResult>;
57
+ /**
58
+ * Fetch the Projects that are "Accepted" with an Initiative.
59
+ * This is a subset of the "Associated" projects, limited
60
+ * to those included in the Initiative's Catalog.
61
+ * @param initiative
62
+ * @param requestOptions
63
+ * @param query: Optional `IQuery` to further filter the results
64
+ * @returns
65
+ */
66
+ export declare function fetchAcceptedProjects(initiative: IHubInitiative, requestOptions: IHubRequestOptions, query?: IQuery): Promise<IEntityInfo[]>;
67
+ /**
68
+ * Fetch the Projects that are "Associated" to the Initiative but are not
69
+ * "Accepted", meaning they have the keyword but are not included in the Initiative's Catalog.
70
+ * This is how we can get the list of Projects awaiting Acceptance
71
+ * @param initiative
72
+ * @param requestOptions
73
+ * @param query
74
+ * @returns
75
+ */
76
+ export declare function fetchPendingProjects(initiative: IHubInitiative, requestOptions: IHubRequestOptions, query?: IQuery): Promise<IEntityInfo[]>;
77
+ /**
78
+ * Associated projects are those with the Initiative id in the typekeywords
79
+ * and is included in the Initiative's catalog.
80
+ * This is passed into the Gallery showing "Approved Projects"
81
+ * @param initiative
82
+ * @returns
83
+ */
84
+ export declare function getAcceptedProjectsQuery(initiative: IHubInitiative): IQuery;
85
+ /**
86
+ * Related Projects are those that have the Initiative id in the
87
+ * typekeywords but NOT in the catalog. We use this query to show
88
+ * Projects which want to be associated but are not yet included in
89
+ * the catalog
90
+ * This is passed into the Gallery showing "Pending Projects"
91
+ * @param initiative
92
+ * @returns
93
+ */
94
+ export declare function getPendingProjectsQuery(initiative: IHubInitiative): IQuery;
@@ -1,8 +1,20 @@
1
- declare const validPermissions: readonly string[];
1
+ import { ProjectPermissions } from "../../projects/_internal/ProjectBusinessRules";
2
+ import { SitePermissions } from "../../sites/_internal/SiteBusinessRules";
3
+ import { InitiativePermissions } from "../../initiatives/_internal/InitiativeBusinessRules";
4
+ import { ContentPermissions } from "../../content/_internal/ContentBusinessRules";
5
+ import { GroupPermissions } from "../../groups/_internal/GroupBusinessRules";
6
+ import { PagePermissions } from "../../pages/_internal/PageBusinessRules";
7
+ import { PlatformPermissions } from "../PlatformPermissionPolicies";
8
+ /**
9
+ * Defines the values for Permissions
10
+ * It's critical that the arrays defined in the modules use `as const`
11
+ * otherwise Permission devolves into just a string type
12
+ */
13
+ declare const TempPermissions: string[];
2
14
  /**
3
15
  * Defines the possible values for Permissions
4
16
  */
5
- export declare type Permission = (typeof validPermissions)[number];
17
+ export declare type Permission = (typeof SitePermissions)[number] | (typeof ProjectPermissions)[number] | (typeof InitiativePermissions)[number] | (typeof ContentPermissions)[number] | (typeof GroupPermissions)[number] | (typeof PagePermissions)[number] | (typeof PlatformPermissions)[number] | (typeof TempPermissions)[number];
6
18
  /**
7
19
  * Validate a Permission
8
20
  * @param permission
@@ -1,5 +1,5 @@
1
1
  import { IHubProject, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, IResolvedMetric, IWithCardBehavior, IHubProjectEditor, IEntityEditorContext } from "../core";
2
- import { Catalog } from "../search";
2
+ import { Catalog } from "../search/Catalog";
3
3
  import { IArcGISContext } from "../ArcGISContext";
4
4
  import { HubItemEntity } from "../core/HubItemEntity";
5
5
  import { IEditorConfig, IWithEditorBehavior } from "../core/behaviors/IWithEditorBehavior";
@@ -2,6 +2,7 @@ import { IRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import { IItem } from "@esri/arcgis-rest-portal";
3
3
  import { IHubProject } from "../core/types";
4
4
  import { IHubSearchResult } from "../search";
5
+ import { IQuery } from "../search/types/IHubCatalog";
5
6
  import { IHubRequestOptions } from "../types";
6
7
  /**
7
8
  * @private
@@ -28,3 +29,16 @@ export declare function convertItemToProject(item: IItem, requestOptions: IReque
28
29
  * @returns
29
30
  */
30
31
  export declare function enrichProjectSearchResult(item: IItem, include: string[], requestOptions: IHubRequestOptions): Promise<IHubSearchResult>;
32
+ /**
33
+ * Get a query that will fetch all the initiatives which the project has
34
+ * chosen to connect to. If project has not defined any associations
35
+ * to any Initiatives, will return `null`.
36
+ * Currently, we have not implemented a means to get the list of initiatives that have
37
+ * "Accepted" the Project via inclusion in it's catalog.
38
+ *
39
+ * If needed, this could be done by getting all the groups the project is shared into
40
+ * then cross-walking that into the catalogs of all the Associated Initiatives
41
+ * @param project
42
+ * @returns
43
+ */
44
+ export declare function getAssociatedInitiativesQuery(project: IHubProject): IQuery;
@@ -0,0 +1,9 @@
1
+ import { EntityType } from "../types";
2
+ /**
3
+ * @private
4
+ * Given a type (e.g. Hub Site Application) return the appropriate entity type
5
+ * that can be used as a `targetEntity` in an `IQuery`
6
+ * @param type
7
+ * @returns
8
+ */
9
+ export declare function getEntityTypeFromType(type: string): EntityType;
@@ -0,0 +1,9 @@
1
+ import { IQuery } from "../types/IHubCatalog";
2
+ /**
3
+ * @private
4
+ * Helper function that locates group predicates and "negates" them
5
+ * so we get a query that is `not in groups ...` vs `in groups ...`
6
+ * @param query
7
+ * @returns
8
+ */
9
+ export declare function negateGroupPredicates(query: IQuery): IQuery;
@@ -85,6 +85,7 @@ export declare function getUserThumbnailUrl(portalUrl: string, user: IUser, toke
85
85
  */
86
86
  export declare function migrateToCollectionKey(collectionOrSearchCategory: LegacySearchCategory | WellKnownCollection): WellKnownCollection;
87
87
  /**
88
+ * DEPRECATED: Please use `getGroupPredicate`
88
89
  * Searches through a catalog scope and retrieves the predicate responsible
89
90
  * for determining group sharing requirements.
90
91
  *
@@ -92,6 +93,13 @@ export declare function migrateToCollectionKey(collectionOrSearchCategory: Legac
92
93
  * @returns The first predicate with a `group` field (if present)
93
94
  */
94
95
  export declare function getScopeGroupPredicate(scope: IQuery): IPredicate;
96
+ /**
97
+ * Searches through an `IQuery` and retrieves the predicate with a `group` definition.
98
+ * If there is no group predicate, returns `null`
99
+ * @param query IQuery to search
100
+ * @returns
101
+ */
102
+ export declare function getGroupPredicate(query: IQuery): IPredicate;
95
103
  /**
96
104
  * Determines the canonical siteRelative link for a search result.
97
105
  *
@@ -7,7 +7,7 @@ export declare const SiteDefaultFeatures: IFeatureFlags;
7
7
  * Site Permissions
8
8
  * This feeds into the Permissions type
9
9
  */
10
- export declare const SitePermissions: readonly ["hub:site", "hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view", "hub:site:owner", "hub:site:events", "hub:site:content", "hub:site:discussions", "hub:site:workspace:overview", "hub:site:workspace:dashboard", "hub:site:workspace:details", "hub:site:workspace:settings", "hub:site:workspace:collaborators", "hub:site:workspace:content", "hub:site:workspace:metrics", "hub:site:workspace:followers", "hub:site:workspace:followers:member", "hub:site:workspace:followers:manager", "hub:site:manage"];
10
+ export declare const SitePermissions: readonly ["hub:site", "hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view", "hub:site:owner", "hub:site:events", "hub:site:content", "hub:site:discussions", "hub:site:feature:follow", "hub:site:workspace:overview", "hub:site:workspace:dashboard", "hub:site:workspace:details", "hub:site:workspace:settings", "hub:site:workspace:collaborators", "hub:site:workspace:content", "hub:site:workspace:metrics", "hub:site:workspace:followers", "hub:site:workspace:followers:member", "hub:site:workspace:followers:manager", "hub:site:manage"];
11
11
  /**
12
12
  * Site permission policies
13
13
  * @private
@@ -1,6 +1,6 @@
1
1
  import { IConfigurationSchema } from "../../core";
2
2
  export declare type SiteEditorType = (typeof SiteEditorTypes)[number];
3
- export declare const SiteEditorTypes: readonly ["hub:site:edit", "hub:site:create"];
3
+ export declare const SiteEditorTypes: readonly ["hub:site:edit", "hub:site:create", "hub:site:followers"];
4
4
  /**
5
5
  * defines the JSON schema for a Hub Site's editable fields
6
6
  */
@@ -3,8 +3,8 @@ import { IUiSchema } from "../../core/schemas/types";
3
3
  import { IHubSite } from "../../core/types";
4
4
  /**
5
5
  * @private
6
- * construct edit uiSchema for Hub Projects - this defines
7
- * how the schema properties should be rendered in the
8
- * project editing experience
6
+ * constructs the edit uiSchema for Hub Sites.
7
+ * This defines how the schema properties should
8
+ * be rendered in the site editing experience
9
9
  */
10
10
  export declare const buildUiSchema: (i18nScope: string, entity: IHubSite, context: IArcGISContext) => Promise<IUiSchema>;
@@ -0,0 +1,11 @@
1
+ import { IArcGISContext } from "../../ArcGISContext";
2
+ import { IUiSchema } from "../../core/schemas/types";
3
+ import { IHubSite } from "../../core/types";
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
+ export declare const buildUiSchema: (i18nScope: string, entity: IHubSite, context: IArcGISContext) => Promise<IUiSchema>;
@@ -0,0 +1,14 @@
1
+ import { ICapabilityToFeatureMap } from "./types";
2
+ /**
3
+ * Returns an array of ICapabilityToFeatureMap objects
4
+ * that define the projection of legacy capabilities
5
+ * to permission features.
6
+ *
7
+ * We use this map to manage foward and backard conversions
8
+ * and migration of legacy capablities to features when a
9
+ * site is fetched or updated
10
+ *
11
+ * NOTE: if you are porting a legacy capability over to
12
+ * workspaces, add it to this map
13
+ */
14
+ export declare const capabilityToFeatureMap: ICapabilityToFeatureMap[];
@@ -0,0 +1,19 @@
1
+ import { IModel } from "../../../types";
2
+ /**
3
+ * Site capabilities are currently saved as an array on the
4
+ * site.data.values.capabilities. We want to migragte these
5
+ * legacy capabilities over to features in the new permissions
6
+ * system; however, we must continue persisting updates to
7
+ * these features in the legacy capabilities array until the
8
+ * existing site capabilities in our application are plumbed
9
+ * to work off of permissions
10
+ *
11
+ * This function is called within updateSite to ensure
12
+ * the legacy capabilities array is kept up-to-date
13
+ *
14
+ * TODO: Remove once site capabilities use permissions
15
+ *
16
+ * @param modelToUpdate
17
+ * @param currentModel
18
+ */
19
+ export declare const convertFeaturesToLegacyCapabilities: (modelToUpdate: IModel, currentModel: IModel) => IModel;
@@ -0,0 +1,12 @@
1
+ import { IModel } from "../../../types";
2
+ /**
3
+ * Site capabilities are currently saved as an array on the
4
+ * site.data.values.capabilities. We want to migragte these
5
+ * legacy capabilities over to features in the new permissions
6
+ * system and expose them on the entity
7
+ *
8
+ * This function is called within fetchSite to ensure all
9
+ * sites have features that are kept up-to-date with the
10
+ * legacy capabilities array
11
+ */
12
+ export declare const migrateLegacyCapabilitiesToFeatures: (model: IModel) => IModel;
@@ -0,0 +1,29 @@
1
+ import { SitePermissions } from "../SiteBusinessRules";
2
+ /**
3
+ * legacy site capabilities
4
+ */
5
+ export declare type LegacyCapability = "hideFollow";
6
+ /**
7
+ * representation of legacy site capabilities as
8
+ * feature flags
9
+ */
10
+ export interface ILegacyCapabilityFeatureFlags extends Partial<Record<LegacyCapability, boolean>> {
11
+ }
12
+ /**
13
+ * capability to feature map entry that provides a
14
+ * "cross-walk" between a legacy site capability
15
+ * and site feature (using the new permissions
16
+ * system)
17
+ *
18
+ * This enables us to convert/migrate capabilities
19
+ * to features when sites are fetched and updated
20
+ */
21
+ export interface ICapabilityToFeatureMap {
22
+ capability: LegacyCapability;
23
+ feature: (typeof SitePermissions)[number];
24
+ /**
25
+ * whether to apply a ! when converting between the
26
+ * capability and feature
27
+ */
28
+ negate?: boolean;
29
+ }
@@ -1,6 +1,6 @@
1
1
  import { IUser } from "@esri/arcgis-rest-types";
2
- import { IHubSearchResult } from "../search";
3
2
  import { IHubRequestOptions } from "../types";
3
+ import { IHubSearchResult } from "../search/types/IHubSearchResult";
4
4
  /**
5
5
  * Enrich a User object
6
6
  * @param user
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "14.14.0",
3
+ "version": "14.16.0",
4
4
  "description": "Common TypeScript types and utility functions for @esri/hub.js.",
5
5
  "main": "dist/node/index.js",
6
6
  "module": "dist/esm/index.js",