@esri/hub-common 9.24.2 → 9.25.2

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 (277) hide show
  1. package/README.md +6 -6
  2. package/dist/es2017/ArcGISContext.js +7 -8
  3. package/dist/es2017/ArcGISContext.js.map +1 -1
  4. package/dist/es2017/Hub.js +19 -2
  5. package/dist/es2017/Hub.js.map +1 -1
  6. package/dist/es2017/content/_fetch.js +16 -3
  7. package/dist/es2017/content/_fetch.js.map +1 -1
  8. package/dist/es2017/content/_internal.js +7 -17
  9. package/dist/es2017/content/_internal.js.map +1 -1
  10. package/dist/es2017/content/compose.js +5 -8
  11. package/dist/es2017/content/compose.js.map +1 -1
  12. package/dist/es2017/content/fetch.js +27 -23
  13. package/dist/es2017/content/fetch.js.map +1 -1
  14. package/dist/es2017/core/{helpers → _internal}/PropertyMapper.js +0 -0
  15. package/dist/es2017/core/_internal/PropertyMapper.js.map +1 -0
  16. package/dist/es2017/core/types/IHubSiteTheme.js +1 -0
  17. package/dist/es2017/core/types/IHubSiteTheme.js.map +1 -0
  18. package/dist/es2017/core/types/index.js +5 -3
  19. package/dist/es2017/core/types/index.js.map +1 -1
  20. package/dist/es2017/items/_enrichments.js +29 -14
  21. package/dist/es2017/items/_enrichments.js.map +1 -1
  22. package/dist/es2017/items/index.js +1 -0
  23. package/dist/es2017/items/index.js.map +1 -1
  24. package/dist/es2017/items/registerBrowserApp.js +25 -0
  25. package/dist/es2017/items/registerBrowserApp.js.map +1 -0
  26. package/dist/es2017/projects/HubProjectManager.js +11 -1
  27. package/dist/es2017/projects/HubProjectManager.js.map +1 -1
  28. package/dist/es2017/projects/HubProjects.js +34 -82
  29. package/dist/es2017/projects/HubProjects.js.map +1 -1
  30. package/dist/es2017/search/_internal/searchContentEntities.js +77 -0
  31. package/dist/es2017/search/_internal/searchContentEntities.js.map +1 -0
  32. package/dist/es2017/search/_searchContent.js +1 -0
  33. package/dist/es2017/search/_searchContent.js.map +1 -1
  34. package/dist/es2017/search/group-utils.js.map +1 -1
  35. package/dist/es2017/search/utils.js.map +1 -1
  36. package/dist/es2017/sites/HubSiteManager.js +155 -0
  37. package/dist/es2017/sites/HubSiteManager.js.map +1 -0
  38. package/dist/es2017/sites/HubSites.js +396 -0
  39. package/dist/es2017/sites/HubSites.js.map +1 -0
  40. package/dist/es2017/sites/{_apply-site-schema.js → _internal/_apply-site-schema.js} +2 -2
  41. package/dist/es2017/sites/_internal/_apply-site-schema.js.map +1 -0
  42. package/dist/es2017/sites/{_enforce-lowercase-domains.js → _internal/_enforce-lowercase-domains.js} +1 -1
  43. package/dist/es2017/sites/_internal/_enforce-lowercase-domains.js.map +1 -0
  44. package/dist/es2017/sites/{_ensure-catalog.js → _internal/_ensure-catalog.js} +1 -1
  45. package/dist/es2017/sites/_internal/_ensure-catalog.js.map +1 -0
  46. package/dist/es2017/sites/{_ensure-telemetry.js → _internal/_ensure-telemetry.js} +1 -1
  47. package/dist/es2017/sites/_internal/_ensure-telemetry.js.map +1 -0
  48. package/dist/es2017/sites/{_migrate-feed-config.js → _internal/_migrate-feed-config.js} +1 -1
  49. package/dist/es2017/sites/_internal/_migrate-feed-config.js.map +1 -0
  50. package/dist/es2017/sites/{_purge-non-guids-from-catalog.js → _internal/_purge-non-guids-from-catalog.js} +1 -1
  51. package/dist/es2017/sites/_internal/_purge-non-guids-from-catalog.js.map +1 -0
  52. package/dist/es2017/sites/_internal/handleDomainChanges.js +44 -0
  53. package/dist/es2017/sites/_internal/handleDomainChanges.js.map +1 -0
  54. package/dist/es2017/sites/_internal/index.js +2 -0
  55. package/dist/es2017/sites/_internal/index.js.map +1 -0
  56. package/dist/es2017/sites/domains/addSiteDomains.js +36 -0
  57. package/dist/es2017/sites/domains/addSiteDomains.js.map +1 -0
  58. package/dist/es2017/sites/domains/index.js +2 -0
  59. package/dist/es2017/sites/domains/index.js.map +1 -1
  60. package/dist/es2017/sites/domains/removeDomainByHostname.js +29 -0
  61. package/dist/es2017/sites/domains/removeDomainByHostname.js.map +1 -0
  62. package/dist/es2017/sites/fetchSiteModel.js +31 -0
  63. package/dist/es2017/sites/fetchSiteModel.js.map +1 -0
  64. package/dist/es2017/sites/index.js +6 -25
  65. package/dist/es2017/sites/index.js.map +1 -1
  66. package/dist/es2017/sites/registerSiteAsApplication.js +23 -0
  67. package/dist/es2017/sites/registerSiteAsApplication.js.map +1 -0
  68. package/dist/es2017/sites/themes.js +46 -0
  69. package/dist/es2017/sites/themes.js.map +1 -0
  70. package/dist/es2017/sites/upgrade-site-schema.js +6 -6
  71. package/dist/es2017/sites/upgrade-site-schema.js.map +1 -1
  72. package/dist/es2017/utils/_array.js +13 -0
  73. package/dist/es2017/utils/_array.js.map +1 -0
  74. package/dist/esm/ArcGISContext.js +7 -8
  75. package/dist/esm/ArcGISContext.js.map +1 -1
  76. package/dist/esm/Hub.js +23 -2
  77. package/dist/esm/Hub.js.map +1 -1
  78. package/dist/esm/content/_fetch.js +14 -3
  79. package/dist/esm/content/_fetch.js.map +1 -1
  80. package/dist/esm/content/_internal.js +7 -17
  81. package/dist/esm/content/_internal.js.map +1 -1
  82. package/dist/esm/content/compose.js +6 -7
  83. package/dist/esm/content/compose.js.map +1 -1
  84. package/dist/esm/content/fetch.js +40 -31
  85. package/dist/esm/content/fetch.js.map +1 -1
  86. package/dist/esm/core/{helpers → _internal}/PropertyMapper.js +0 -0
  87. package/dist/esm/core/_internal/PropertyMapper.js.map +1 -0
  88. package/dist/esm/core/types/IHubSiteTheme.js +1 -0
  89. package/dist/esm/core/types/IHubSiteTheme.js.map +1 -0
  90. package/dist/esm/core/types/index.js +5 -3
  91. package/dist/esm/core/types/index.js.map +1 -1
  92. package/dist/esm/items/_enrichments.js +29 -14
  93. package/dist/esm/items/_enrichments.js.map +1 -1
  94. package/dist/esm/items/index.js +1 -0
  95. package/dist/esm/items/index.js.map +1 -1
  96. package/dist/esm/items/registerBrowserApp.js +25 -0
  97. package/dist/esm/items/registerBrowserApp.js.map +1 -0
  98. package/dist/esm/projects/HubProjectManager.js +16 -1
  99. package/dist/esm/projects/HubProjectManager.js.map +1 -1
  100. package/dist/esm/projects/HubProjects.js +38 -81
  101. package/dist/esm/projects/HubProjects.js.map +1 -1
  102. package/dist/esm/search/_internal/searchContentEntities.js +89 -0
  103. package/dist/esm/search/_internal/searchContentEntities.js.map +1 -0
  104. package/dist/esm/search/_searchContent.js +1 -0
  105. package/dist/esm/search/_searchContent.js.map +1 -1
  106. package/dist/esm/search/group-utils.js.map +1 -1
  107. package/dist/esm/search/utils.js.map +1 -1
  108. package/dist/esm/sites/HubSiteManager.js +201 -0
  109. package/dist/esm/sites/HubSiteManager.js.map +1 -0
  110. package/dist/esm/sites/HubSites.js +448 -0
  111. package/dist/esm/sites/HubSites.js.map +1 -0
  112. package/dist/esm/sites/{_apply-site-schema.js → _internal/_apply-site-schema.js} +2 -2
  113. package/dist/esm/sites/_internal/_apply-site-schema.js.map +1 -0
  114. package/dist/esm/sites/{_enforce-lowercase-domains.js → _internal/_enforce-lowercase-domains.js} +1 -1
  115. package/dist/esm/sites/_internal/_enforce-lowercase-domains.js.map +1 -0
  116. package/dist/esm/sites/{_ensure-catalog.js → _internal/_ensure-catalog.js} +1 -1
  117. package/dist/esm/sites/_internal/_ensure-catalog.js.map +1 -0
  118. package/dist/esm/sites/{_ensure-telemetry.js → _internal/_ensure-telemetry.js} +1 -1
  119. package/dist/esm/sites/_internal/_ensure-telemetry.js.map +1 -0
  120. package/dist/esm/sites/{_migrate-feed-config.js → _internal/_migrate-feed-config.js} +1 -1
  121. package/dist/esm/sites/_internal/_migrate-feed-config.js.map +1 -0
  122. package/dist/esm/sites/{_purge-non-guids-from-catalog.js → _internal/_purge-non-guids-from-catalog.js} +1 -1
  123. package/dist/esm/sites/_internal/_purge-non-guids-from-catalog.js.map +1 -0
  124. package/dist/esm/sites/_internal/handleDomainChanges.js +49 -0
  125. package/dist/esm/sites/_internal/handleDomainChanges.js.map +1 -0
  126. package/dist/esm/sites/_internal/index.js +2 -0
  127. package/dist/esm/sites/_internal/index.js.map +1 -0
  128. package/dist/esm/sites/domains/addSiteDomains.js +36 -0
  129. package/dist/esm/sites/domains/addSiteDomains.js.map +1 -0
  130. package/dist/esm/sites/domains/index.js +2 -0
  131. package/dist/esm/sites/domains/index.js.map +1 -1
  132. package/dist/esm/sites/domains/removeDomainByHostname.js +42 -0
  133. package/dist/esm/sites/domains/removeDomainByHostname.js.map +1 -0
  134. package/dist/esm/sites/fetchSiteModel.js +34 -0
  135. package/dist/esm/sites/fetchSiteModel.js.map +1 -0
  136. package/dist/esm/sites/index.js +6 -28
  137. package/dist/esm/sites/index.js.map +1 -1
  138. package/dist/esm/sites/registerSiteAsApplication.js +23 -0
  139. package/dist/esm/sites/registerSiteAsApplication.js.map +1 -0
  140. package/dist/esm/sites/themes.js +46 -0
  141. package/dist/esm/sites/themes.js.map +1 -0
  142. package/dist/esm/sites/upgrade-site-schema.js +6 -6
  143. package/dist/esm/sites/upgrade-site-schema.js.map +1 -1
  144. package/dist/esm/utils/_array.js +13 -0
  145. package/dist/esm/utils/_array.js.map +1 -0
  146. package/dist/node/ArcGISContext.js +7 -8
  147. package/dist/node/ArcGISContext.js.map +1 -1
  148. package/dist/node/Hub.js +19 -2
  149. package/dist/node/Hub.js.map +1 -1
  150. package/dist/node/content/_fetch.js +16 -3
  151. package/dist/node/content/_fetch.js.map +1 -1
  152. package/dist/node/content/_internal.js +8 -18
  153. package/dist/node/content/_internal.js.map +1 -1
  154. package/dist/node/content/compose.js +4 -7
  155. package/dist/node/content/compose.js.map +1 -1
  156. package/dist/node/content/fetch.js +27 -23
  157. package/dist/node/content/fetch.js.map +1 -1
  158. package/dist/node/core/{helpers → _internal}/PropertyMapper.js +0 -0
  159. package/dist/node/core/_internal/PropertyMapper.js.map +1 -0
  160. package/dist/node/core/types/IHubSiteTheme.js +3 -0
  161. package/dist/node/core/types/IHubSiteTheme.js.map +1 -0
  162. package/dist/node/core/types/index.js +5 -3
  163. package/dist/node/core/types/index.js.map +1 -1
  164. package/dist/node/items/_enrichments.js +30 -15
  165. package/dist/node/items/_enrichments.js.map +1 -1
  166. package/dist/node/items/index.js +1 -0
  167. package/dist/node/items/index.js.map +1 -1
  168. package/dist/node/items/registerBrowserApp.js +29 -0
  169. package/dist/node/items/registerBrowserApp.js.map +1 -0
  170. package/dist/node/projects/HubProjectManager.js +10 -0
  171. package/dist/node/projects/HubProjectManager.js.map +1 -1
  172. package/dist/node/projects/HubProjects.js +32 -79
  173. package/dist/node/projects/HubProjects.js.map +1 -1
  174. package/dist/node/search/_internal/searchContentEntities.js +82 -0
  175. package/dist/node/search/_internal/searchContentEntities.js.map +1 -0
  176. package/dist/node/search/_searchContent.js +1 -0
  177. package/dist/node/search/_searchContent.js.map +1 -1
  178. package/dist/node/search/group-utils.js.map +1 -1
  179. package/dist/node/search/utils.js.map +1 -1
  180. package/dist/node/sites/HubSiteManager.js +159 -0
  181. package/dist/node/sites/HubSiteManager.js.map +1 -0
  182. package/dist/node/sites/HubSites.js +405 -0
  183. package/dist/node/sites/HubSites.js.map +1 -0
  184. package/dist/node/sites/{_apply-site-schema.js → _internal/_apply-site-schema.js} +2 -2
  185. package/dist/node/sites/_internal/_apply-site-schema.js.map +1 -0
  186. package/dist/node/sites/{_enforce-lowercase-domains.js → _internal/_enforce-lowercase-domains.js} +1 -1
  187. package/dist/node/sites/_internal/_enforce-lowercase-domains.js.map +1 -0
  188. package/dist/node/sites/{_ensure-catalog.js → _internal/_ensure-catalog.js} +1 -1
  189. package/dist/node/sites/_internal/_ensure-catalog.js.map +1 -0
  190. package/dist/node/sites/{_ensure-telemetry.js → _internal/_ensure-telemetry.js} +1 -1
  191. package/dist/node/sites/_internal/_ensure-telemetry.js.map +1 -0
  192. package/dist/node/sites/{_migrate-feed-config.js → _internal/_migrate-feed-config.js} +1 -1
  193. package/dist/node/sites/_internal/_migrate-feed-config.js.map +1 -0
  194. package/dist/node/sites/{_purge-non-guids-from-catalog.js → _internal/_purge-non-guids-from-catalog.js} +1 -1
  195. package/dist/node/sites/_internal/_purge-non-guids-from-catalog.js.map +1 -0
  196. package/dist/node/sites/_internal/handleDomainChanges.js +48 -0
  197. package/dist/node/sites/_internal/handleDomainChanges.js.map +1 -0
  198. package/dist/node/sites/_internal/index.js +5 -0
  199. package/dist/node/sites/_internal/index.js.map +1 -0
  200. package/dist/node/sites/domains/addSiteDomains.js +40 -0
  201. package/dist/node/sites/domains/addSiteDomains.js.map +1 -0
  202. package/dist/node/sites/domains/index.js +2 -0
  203. package/dist/node/sites/domains/index.js.map +1 -1
  204. package/dist/node/sites/domains/removeDomainByHostname.js +33 -0
  205. package/dist/node/sites/domains/removeDomainByHostname.js.map +1 -0
  206. package/dist/node/sites/fetchSiteModel.js +36 -0
  207. package/dist/node/sites/fetchSiteModel.js.map +1 -0
  208. package/dist/node/sites/index.js +6 -27
  209. package/dist/node/sites/index.js.map +1 -1
  210. package/dist/node/sites/registerSiteAsApplication.js +27 -0
  211. package/dist/node/sites/registerSiteAsApplication.js.map +1 -0
  212. package/dist/node/sites/themes.js +50 -0
  213. package/dist/node/sites/themes.js.map +1 -0
  214. package/dist/node/sites/upgrade-site-schema.js +6 -6
  215. package/dist/node/sites/upgrade-site-schema.js.map +1 -1
  216. package/dist/node/utils/_array.js +16 -0
  217. package/dist/node/utils/_array.js.map +1 -0
  218. package/dist/types/Hub.d.ts +15 -2
  219. package/dist/types/content/_fetch.d.ts +9 -4
  220. package/dist/types/content/_internal.d.ts +0 -8
  221. package/dist/types/core/{helpers → _internal}/PropertyMapper.d.ts +0 -0
  222. package/dist/types/core/types/IHubEntityManager.d.ts +2 -5
  223. package/dist/types/core/types/IHubItemEntityManager.d.ts +10 -0
  224. package/dist/types/core/types/IHubSite.d.ts +68 -4
  225. package/dist/types/core/types/IHubSiteTheme.d.ts +28 -0
  226. package/dist/types/core/types/index.d.ts +5 -3
  227. package/dist/types/items/_enrichments.d.ts +10 -1
  228. package/dist/types/items/index.d.ts +1 -0
  229. package/dist/types/items/registerBrowserApp.d.ts +11 -0
  230. package/dist/types/projects/HubProjectManager.d.ts +8 -0
  231. package/dist/types/projects/HubProjects.d.ts +18 -0
  232. package/dist/types/search/_internal/searchContentEntities.d.ts +32 -0
  233. package/dist/types/search/utils.d.ts +1 -1
  234. package/dist/types/sites/HubSiteManager.d.ts +104 -0
  235. package/dist/types/sites/HubSites.d.ts +56 -0
  236. package/dist/types/sites/{_apply-site-schema.d.ts → _internal/_apply-site-schema.d.ts} +1 -1
  237. package/dist/types/sites/{_enforce-lowercase-domains.d.ts → _internal/_enforce-lowercase-domains.d.ts} +1 -1
  238. package/dist/types/sites/{_ensure-catalog.d.ts → _internal/_ensure-catalog.d.ts} +1 -1
  239. package/dist/types/sites/{_ensure-telemetry.d.ts → _internal/_ensure-telemetry.d.ts} +1 -1
  240. package/dist/types/sites/{_migrate-feed-config.d.ts → _internal/_migrate-feed-config.d.ts} +1 -1
  241. package/dist/types/sites/{_purge-non-guids-from-catalog.d.ts → _internal/_purge-non-guids-from-catalog.d.ts} +1 -1
  242. package/dist/types/sites/_internal/handleDomainChanges.d.ts +9 -0
  243. package/dist/types/sites/_internal/index.d.ts +1 -0
  244. package/dist/types/sites/domains/addSiteDomains.d.ts +11 -0
  245. package/dist/types/sites/domains/index.d.ts +2 -0
  246. package/dist/types/sites/domains/removeDomainByHostname.d.ts +10 -0
  247. package/dist/types/sites/fetchSiteModel.d.ts +12 -0
  248. package/dist/types/sites/index.d.ts +6 -9
  249. package/dist/types/sites/registerSiteAsApplication.d.ts +8 -0
  250. package/dist/types/sites/themes.d.ts +11 -0
  251. package/dist/types/utils/_array.d.ts +9 -0
  252. package/dist/umd/common.umd.js +3002 -2018
  253. package/dist/umd/common.umd.js.map +1 -1
  254. package/dist/umd/common.umd.min.js +1 -1
  255. package/dist/umd/common.umd.min.js.map +1 -1
  256. package/package.json +1 -1
  257. package/dist/es2017/core/helpers/PropertyMapper.js.map +0 -1
  258. package/dist/es2017/sites/_apply-site-schema.js.map +0 -1
  259. package/dist/es2017/sites/_enforce-lowercase-domains.js.map +0 -1
  260. package/dist/es2017/sites/_ensure-catalog.js.map +0 -1
  261. package/dist/es2017/sites/_ensure-telemetry.js.map +0 -1
  262. package/dist/es2017/sites/_migrate-feed-config.js.map +0 -1
  263. package/dist/es2017/sites/_purge-non-guids-from-catalog.js.map +0 -1
  264. package/dist/esm/core/helpers/PropertyMapper.js.map +0 -1
  265. package/dist/esm/sites/_apply-site-schema.js.map +0 -1
  266. package/dist/esm/sites/_enforce-lowercase-domains.js.map +0 -1
  267. package/dist/esm/sites/_ensure-catalog.js.map +0 -1
  268. package/dist/esm/sites/_ensure-telemetry.js.map +0 -1
  269. package/dist/esm/sites/_migrate-feed-config.js.map +0 -1
  270. package/dist/esm/sites/_purge-non-guids-from-catalog.js.map +0 -1
  271. package/dist/node/core/helpers/PropertyMapper.js.map +0 -1
  272. package/dist/node/sites/_apply-site-schema.js.map +0 -1
  273. package/dist/node/sites/_enforce-lowercase-domains.js.map +0 -1
  274. package/dist/node/sites/_ensure-catalog.js.map +0 -1
  275. package/dist/node/sites/_ensure-telemetry.js.map +0 -1
  276. package/dist/node/sites/_migrate-feed-config.js.map +0 -1
  277. package/dist/node/sites/_purge-non-guids-from-catalog.js.map +0 -1
@@ -1,11 +1,75 @@
1
+ import { IExtent } from "@esri/arcgis-rest-feature-layer";
2
+ import { IWithSlug } from "../traits/WithSlug";
1
3
  import { IWithLayout } from "../traits/WithLayout";
2
4
  import { IHubItemEntity } from "./IHubItemEntity";
3
5
  /**
4
6
  * DRAFT: Under development and more properties will likely be added
5
7
  * @internal
6
8
  */
7
- export interface IHubSite extends IHubItemEntity, IWithLayout {
8
- header: Record<string, any>;
9
- footer: Record<string, any>;
10
- pages: Record<string, any>;
9
+ export interface IHubSite extends IHubItemEntity, IWithSlug, IWithLayout {
10
+ /**
11
+ * Array of minimal page objects
12
+ */
13
+ pages: Array<{
14
+ title: string;
15
+ id: string;
16
+ slug: string;
17
+ }>;
18
+ /**
19
+ * Site Theme as json
20
+ */
21
+ theme: Record<string, any>;
22
+ /**
23
+ * Array of capabilities enabled for the site
24
+ */
25
+ capabilities: string[];
26
+ /**
27
+ * Currently not an actual ICatalog
28
+ */
29
+ catalog: {
30
+ groups: string[];
31
+ [key: string]: any;
32
+ };
33
+ /**
34
+ * Subdomain of the site
35
+ * Will be prepended to `<org-key>.hub.arcgis.com`
36
+ */
37
+ subdomain: string;
38
+ /**
39
+ * Full hostname
40
+ * Looks like`<subdomain>-<org-key>.hub.arcgis.com`
41
+ */
42
+ defaultHostname: string;
43
+ /**
44
+ * Custom Domain Name
45
+ */
46
+ customHostname: string;
47
+ /**
48
+ * oAuth Client Id for the Site
49
+ */
50
+ clientId: string;
51
+ /**
52
+ * Feed configurations
53
+ */
54
+ feeds: Record<string, any>;
55
+ /**
56
+ * Default extent used when loading maps on the site
57
+ */
58
+ defaultExtent: IExtent;
59
+ /**
60
+ * Default map configuration for the site
61
+ */
62
+ map: Record<string, any>;
63
+ /**
64
+ * Content Views settings
65
+ */
66
+ contentViews: Record<string, any>;
67
+ /**
68
+ * Site Telemetry Settings
69
+ */
70
+ telemetry: Record<string, any>;
71
+ /**
72
+ * Header CSS
73
+ */
74
+ headerSass: string;
11
75
  }
@@ -0,0 +1,28 @@
1
+ export interface IHubSiteTheme {
2
+ header: {
3
+ background: string;
4
+ text: string;
5
+ };
6
+ body: {
7
+ background: string;
8
+ text: string;
9
+ link: string;
10
+ };
11
+ button: {
12
+ background: string;
13
+ text: string;
14
+ };
15
+ logo: {
16
+ small: string;
17
+ };
18
+ fonts: {
19
+ base: {
20
+ url: string;
21
+ family: string;
22
+ };
23
+ heading: {
24
+ url: string;
25
+ family: string;
26
+ };
27
+ };
28
+ }
@@ -1,15 +1,17 @@
1
- export * from "./IItemEnrichments";
2
- export * from "./IHubContentEnrichments";
3
1
  export * from "./IHubContent";
2
+ export * from "./IHubContentEnrichments";
4
3
  export * from "./IHubEntityBase";
5
- export * from "./IHubItemEntity";
6
4
  export * from "./IHubEntityManager";
7
5
  export * from "./IHubEvent";
8
6
  export * from "./IHubImage";
9
7
  export * from "./IHubInitiative";
8
+ export * from "./IHubItemEntity";
9
+ export * from "./IHubItemEntityManager";
10
10
  export * from "./IHubLayout";
11
11
  export * from "./IHubPage";
12
12
  export * from "./IHubProject";
13
13
  export * from "./IHubSite";
14
+ export * from "./IHubSiteTheme";
14
15
  export * from "./IHubTimeline";
16
+ export * from "./IItemEnrichments";
15
17
  export * from "./IServerEnrichments";
@@ -1,6 +1,6 @@
1
1
  import { IItem } from "@esri/arcgis-rest-portal";
2
2
  import { IItemEnrichments, IServerEnrichments } from "../core";
3
- import { IHubRequestOptions } from "../types";
3
+ import { IEnrichmentErrorInfo, IHubRequestOptions } from "../types";
4
4
  /**
5
5
  * An object containing the item and fetched enrichments
6
6
  */
@@ -13,6 +13,15 @@ export interface IItemAndEnrichments extends IItemEnrichments, IServerEnrichment
13
13
  * or from the server that the item points to
14
14
  */
15
15
  export declare type ItemOrServerEnrichment = keyof IItemEnrichments | keyof IServerEnrichments;
16
+ /**
17
+ * convert an error to an enrichment error info format
18
+ * and optionally append it to an existing array of those
19
+ * @param error
20
+ * @param errors an array of existing enrichment error info
21
+ * @returns a new array of enrichment error info
22
+ * @private
23
+ */
24
+ export declare const getEnrichmentErrors: (error: Error | string, errors?: IEnrichmentErrorInfo[]) => IEnrichmentErrorInfo[];
16
25
  /**
17
26
  * Fetch enrichments for an item
18
27
  * @param item
@@ -16,3 +16,4 @@ export * from "./get-structured-license";
16
16
  export * from "./slugs";
17
17
  export * from "./normalize-solution-template-item";
18
18
  export * from "./setItemThumbnail";
19
+ export * from "./registerBrowserApp";
@@ -0,0 +1,11 @@
1
+ import { IRequestOptions } from "@esri/arcgis-rest-request";
2
+ /**
3
+ * Register an Item as an application, enabling oAuth flows at custom
4
+ * domains. Only item types with "Application" in the name are valid
5
+ * with this API call.
6
+ * @param {string} itemId Item Id of item to create an application for
7
+ * @param {Array} redirectUris Array of valid redirect uris for the app
8
+ * @param {string} appType Defaults to "browser"
9
+ * @param {IRequestOptions} requestOptions
10
+ */
11
+ export declare function registerBrowserApp(itemId: string, redirectUris: string[], requestOptions: IRequestOptions): Promise<any>;
@@ -4,6 +4,7 @@ import { ArcGISContextManager } from "../ArcGISContextManager";
4
4
  import { Filter, IArcGISContext, IHubSearchOptions, ISearchResponse } from "..";
5
5
  import { IHubEntityManager, IHubProject } from "../core/types";
6
6
  import { IHubItemEntityManager } from "../core/types/IHubItemEntityManager";
7
+ import { IItem } from "@esri/arcgis-rest-types";
7
8
  /**
8
9
  * Centralized functions used to manage IHubProject instances
9
10
  *
@@ -96,4 +97,11 @@ export declare class HubProjectManager implements IHubEntityManager<IHubProject>
96
97
  * @returns
97
98
  */
98
99
  updateThumbnail(project: IHubProject, file: any, filename: string, requestOptions?: IUserRequestOptions): Promise<IHubProject>;
100
+ /**
101
+ * Convert a Hub Project Item to a IHubProject
102
+ * @param item
103
+ * @param requestOptions
104
+ * @returns
105
+ */
106
+ fromItem(item: IItem, requestOptions?: IRequestOptions): Promise<IHubProject>;
99
107
  }
@@ -1,5 +1,6 @@
1
1
  import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
2
2
  import { Filter, IHubSearchOptions, ISearchResponse } from "..";
3
+ import { IItem } from "@esri/arcgis-rest-portal";
3
4
  import { IRequestOptions } from "@esri/arcgis-rest-request";
4
5
  import { IHubProject } from "../core/types";
5
6
  export declare const HUB_PROJECT_ITEM_TYPE = "Hub Project";
@@ -30,4 +31,21 @@ export declare function fetchProject(identifier: string, requestOptions: IReques
30
31
  * @param requestOptions
31
32
  */
32
33
  export declare function destroyProject(id: string, requestOptions: IUserRequestOptions): Promise<void>;
34
+ /**
35
+ * Search for Projects, and get IHubProject results
36
+ *
37
+ * Different from `searchContent` in that this returns the specific entity type
38
+ *
39
+ * @param filter
40
+ * @param options
41
+ * @returns
42
+ */
33
43
  export declare function searchProjects(filter: Filter<"content">, options: IHubSearchOptions): Promise<ISearchResponse<IHubProject>>;
44
+ /**
45
+ * Convert an Hub Project Item into a Hub Project, fetching any additional
46
+ * information that may be required
47
+ * @param item
48
+ * @param auth
49
+ * @returns
50
+ */
51
+ export declare function convertItemToProject(item: IItem, requestOptions: IRequestOptions): Promise<IHubProject>;
@@ -0,0 +1,32 @@
1
+ import { ISearchOptions } from "@esri/arcgis-rest-portal";
2
+ import { IRequestOptions } from "@esri/arcgis-rest-request";
3
+ import { IItem } from "@esri/arcgis-rest-types";
4
+ import { ISearchResponse } from "../../types";
5
+ import { Filter, IHubSearchOptions } from "../../search/types";
6
+ /**
7
+ * Definition of `convertItemTo<T>` functions
8
+ */
9
+ export declare type ItemToEntityFunction<T> = (i: IItem, ro?: IRequestOptions) => Promise<T>;
10
+ /**
11
+ * Generic search that returns Hub Entity types converted from items
12
+ * by the passed in `ItemToEntityFunction`
13
+ *
14
+ * This abstraction is used to ensure that searching from any of the
15
+ * entity managers / modules is consistent, and returns the entity
16
+ * types, instead of `IItem` or `IHubContent`
17
+ *
18
+ * @param filter
19
+ * @param convertFn
20
+ * @param options
21
+ * @returns
22
+ */
23
+ export declare function searchContentEntities<T>(filter: Filter<"content">, convertFn: ItemToEntityFunction<T>, options: IHubSearchOptions): Promise<ISearchResponse<T>>;
24
+ /**
25
+ * Return a function that holds a closure containing
26
+ * a hub entity specific conversion function. This
27
+ * allows the `.next()` function to use the function on
28
+ * subsequent calls
29
+ * @param convertFn
30
+ * @returns
31
+ */
32
+ export declare function createContentEntitySearchFn<T>(convertFn: ItemToEntityFunction<T>): (v: ISearchOptions) => Promise<ISearchResponse<T>>;
@@ -1,6 +1,6 @@
1
1
  import { IUser } from "@esri/arcgis-rest-auth";
2
2
  import { IGroup, ISearchOptions } from "@esri/arcgis-rest-portal";
3
- import { ISearchResponse } from "..";
3
+ import { ISearchResponse } from "../types";
4
4
  import { IMatchOptions, IDateRange, IRelativeDate, IWellKnownApis, IApiDefinition, NamedApis } from "./types";
5
5
  /**
6
6
  * Well known APIs
@@ -0,0 +1,104 @@
1
+ import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
2
+ import { IArcGISContext } from "../ArcGISContext";
3
+ import { IHubEntityManager, IHubItemEntityManager, IHubSite } from "../core/types";
4
+ import { ArcGISContextManager } from "../ArcGISContextManager";
5
+ import { Filter, IHubSearchOptions } from "../search";
6
+ import { IHubRequestOptions, ISearchResponse } from "../types";
7
+ import { IItem } from "@esri/arcgis-rest-types";
8
+ import { IRequestOptions } from "@esri/arcgis-rest-request";
9
+ export declare class HubSiteManager implements IHubEntityManager<IHubSite>, IHubItemEntityManager<IHubSite> {
10
+ /**
11
+ * Hold a context manager, which should be a single instance for
12
+ * an application. When authentication changes, the .context
13
+ * property on the context manager will be replaced. As long as
14
+ * all the fns in this class leverage properties on .context
15
+ * everything be kept in sync.
16
+ */
17
+ private _contextManager;
18
+ /**
19
+ * Hold context directly. Allows the class to be used in places
20
+ * where an `ArcGISContextManager` is not directly available, but
21
+ * an `IArcGISContext` is
22
+ */
23
+ private _context;
24
+ /**
25
+ * Private so we can employ a factory function should we need
26
+ * async work during creation
27
+ * @param contextOrManager
28
+ */
29
+ private constructor();
30
+ /**
31
+ * Factory function to construct a new HubProjectManager instance.
32
+ *
33
+ * Note: Used so that we could do async actions in the ctor.
34
+ * @param contextOrManager
35
+ * @returns
36
+ */
37
+ static init(contextOrManager: ArcGISContextManager | IArcGISContext): HubSiteManager;
38
+ /**
39
+ * Getter to abstract how we store the context
40
+ */
41
+ private get context();
42
+ /**
43
+ * Create and store a new Site
44
+ *
45
+ * This also registers the item for oAuth and
46
+ * registers domain names with the hub Domain system
47
+ *
48
+ * Sites are stored as Items in the Sharing API
49
+ * @param site
50
+ * @param requestOptions
51
+ * @returns
52
+ */
53
+ create(site: Partial<IHubSite>, requestOptions?: IHubRequestOptions): Promise<IHubSite>;
54
+ /**
55
+ * Update a Site
56
+ * @param site
57
+ * @param requestOptions
58
+ * @returns
59
+ */
60
+ update(site: IHubSite, requestOptions?: IHubRequestOptions): Promise<IHubSite>;
61
+ /**
62
+ * Destroy a Site
63
+ * This permanently removes the backing Item,
64
+ * and clears the domain entries for it.
65
+ * @param id
66
+ * @param requestOptions
67
+ * @returns
68
+ */
69
+ destroy(id: string, requestOptions?: IHubRequestOptions): Promise<void>;
70
+ /**
71
+ * Fetch a Site via Id, slug or domain
72
+ *
73
+ * This function does not require a user to be
74
+ * authenticated, but it does require an `IRequestOptions`
75
+ * which contains the portal instance to communicate with
76
+ * @param identifier
77
+ * @param requestOptions
78
+ * @returns
79
+ */
80
+ fetch(identifier: string, requestOptions?: IHubRequestOptions): Promise<IHubSite>;
81
+ /**
82
+ * Search for Sites
83
+ *
84
+ * @param filter
85
+ * @param opts
86
+ */
87
+ search(filter: Filter<"content">, options: IHubSearchOptions): Promise<ISearchResponse<IHubSite>>;
88
+ /**
89
+ * Set the thumbnail for the Site
90
+ * @param id
91
+ * @param file
92
+ * @param filename
93
+ * @param requestOptions
94
+ * @returns
95
+ */
96
+ updateThumbnail(site: IHubSite, file: any, filename: string, requestOptions?: IUserRequestOptions): Promise<IHubSite>;
97
+ /**
98
+ * Convert a Hub Project Item to a IHubProject
99
+ * @param item
100
+ * @param requestOptions
101
+ * @returns
102
+ */
103
+ fromItem(item: IItem, requestOptions?: IRequestOptions): Promise<IHubSite>;
104
+ }
@@ -0,0 +1,56 @@
1
+ import { IItem } from "@esri/arcgis-rest-portal";
2
+ import { Filter, IHubRequestOptions, IHubSearchOptions, IHubSite, ISearchResponse } from "..";
3
+ import { IRequestOptions } from "@esri/arcgis-rest-request";
4
+ export declare const HUB_SITE_ITEM_TYPE = "Hub Site Application";
5
+ export declare const ENTERPRISE_SITE_ITEM_TYPE = "Site Application";
6
+ /**
7
+ * Create a new Hub Site
8
+ *
9
+ * Minimum properties are `name` and `org`
10
+ * @param partialSite
11
+ * @param requestOptions
12
+ */
13
+ export declare function createSite(partialSite: Partial<IHubSite>, requestOptions: IHubRequestOptions): Promise<IHubSite>;
14
+ /**
15
+ * Update a Hub Site
16
+ *
17
+ * This checks for and applies domain changes
18
+ * @param site
19
+ * @param requestOptions
20
+ * @returns
21
+ */
22
+ export declare function updateSite(site: IHubSite, requestOptions: IHubRequestOptions): Promise<IHubSite>;
23
+ /**
24
+ * Remove a Hub Site
25
+ *
26
+ * This simply removes the Site item, and it's associated domain records.
27
+ * This does not remove any Teams/Groups or content associated with the
28
+ * Site
29
+ * @param id
30
+ * @param requestOptions
31
+ * @returns
32
+ */
33
+ export declare function destroySite(id: string, requestOptions: IHubRequestOptions): Promise<void>;
34
+ /**
35
+ * Returns site model given various kinds of identifier
36
+ *
37
+ * @param identifier - a site item ID, site hostname, enterprise site slug, or full site URL
38
+ * @param requestOptions
39
+ * @private // remove when we remove existing fetchSite function
40
+ */
41
+ export declare function _fetchSite(identifier: string, requestOptions: IHubRequestOptions): Promise<IHubSite>;
42
+ /**
43
+ * Convert a Hub Site Application item into a Hub Site, fetching any
44
+ * additional information that may be required
45
+ * @param item
46
+ * @param auth
47
+ * @returns
48
+ */
49
+ export declare function convertItemToSite(item: IItem, requestOptions: IRequestOptions): Promise<IHubSite>;
50
+ /**
51
+ * Search for Sites and get IHubSite results
52
+ * @param filter
53
+ * @param options
54
+ * @returns
55
+ */
56
+ export declare function searchSites(filter: Filter<"content">, options: IHubSearchOptions): Promise<ISearchResponse<IHubSite>>;
@@ -1,4 +1,4 @@
1
- import { IModel } from "../types";
1
+ import { IModel } from "../../types";
2
2
  /**
3
3
  * Apply the first schema version to the item
4
4
  * @param {Object} model Site Model
@@ -1,4 +1,4 @@
1
- import { IModel } from "..";
1
+ import { IModel } from "../..";
2
2
  /**
3
3
  * Enforce lowercase domains
4
4
  * @param {Object} model Site Model
@@ -1,4 +1,4 @@
1
- import { IModel } from "..";
1
+ import { IModel } from "../..";
2
2
  /**
3
3
  * Move the data.values.groups array into the
4
4
  * data.catalog object
@@ -1,4 +1,4 @@
1
- import { IModel, IDraft } from "..";
1
+ import { IModel, IDraft } from "../..";
2
2
  /**
3
3
  * Add telemetry config object
4
4
  * @private
@@ -1,4 +1,4 @@
1
- import { IModel } from "..";
1
+ import { IModel } from "../..";
2
2
  /**
3
3
  * Migrates the site so it can store configurations for multiple feed formats
4
4
  * (dcat-us-1.1, dcat-ap-2.0.1, etc.). If the site has an existing custom
@@ -1,4 +1,4 @@
1
- import { IModel } from "..";
1
+ import { IModel } from "../..";
2
2
  /**
3
3
  * Remove any non-guid entries from the data catalog groups array
4
4
  * @param {object} model Site Model
@@ -0,0 +1,9 @@
1
+ import { IHubRequestOptions, IModel } from "../..";
2
+ /**
3
+ * Given two site models, determine the domain changes and apply them
4
+ * @param currentModel
5
+ * @param updatedModel
6
+ * @param requestOptions
7
+ * @private
8
+ */
9
+ export declare function handleDomainChanges(updatedModel: IModel, currentModel: IModel, requestOptions: IHubRequestOptions): Promise<any[]>;
@@ -0,0 +1 @@
1
+ export * from "./handleDomainChanges";
@@ -0,0 +1,11 @@
1
+ import { IHubRequestOptions, IModel } from "../..";
2
+ /**
3
+ * Given a Site Model, register the domains with the Domain Service.
4
+ *
5
+ * This should only be used when creating a site. To update domains related
6
+ * to a site, use the `addDomain` and `removeDomain` functions directly
7
+ *
8
+ * @param {Object} model site model
9
+ * @param {IHubRequestOptions} hubRequestOptions
10
+ */
11
+ export declare function addSiteDomains(model: IModel, hubRequestOptions: IHubRequestOptions): Promise<any[]>;
@@ -17,3 +17,5 @@ export * from "./remove-domains-by-site-id";
17
17
  export * from "./update-domain";
18
18
  export * from "./_ensure-safe-domain-length";
19
19
  export * from "./ensure-unique-domain-name";
20
+ export * from "./addSiteDomains";
21
+ export * from "./removeDomainByHostname";
@@ -0,0 +1,10 @@
1
+ import { IHubRequestOptions } from "../../types";
2
+ /**
3
+ * Remove an entry from the domain service, based on a hostname
4
+ *
5
+ * Callers must ensure the user is a member of the org that
6
+ * owns the domain entry else the call will fail.
7
+ * @param hostname
8
+ * @param hubRequestOptions
9
+ */
10
+ export declare function removeDomainByHostname(hostname: string, hubRequestOptions: IHubRequestOptions): Promise<void>;
@@ -0,0 +1,12 @@
1
+ import { IHubRequestOptions, IModel } from "..";
2
+ /**
3
+ * Returns site model given various kinds of identifier
4
+ *
5
+ * @param identifier - a site item ID, site hostname, enterprise site slug, or full site URL
6
+ * @param hubRequestOptions
7
+ */
8
+ export declare function fetchSiteModel(identifier: string, hubRequestOptions: IHubRequestOptions): Promise<IModel>;
9
+ /**
10
+ * @private // keep out of docs
11
+ */
12
+ export declare function fetchSite(identifier: string, hubRequestOptions: IHubRequestOptions): Promise<IModel>;
@@ -1,14 +1,11 @@
1
- import { IHubRequestOptions } from "../types";
2
- /**
3
- * Returns site model given various kinds of identifier
4
- *
5
- * @param identifier - a site item ID, site hostname, enterprise site slug, or full site URL
6
- * @param hubRequestOptions
7
- */
8
- export declare function fetchSite(identifier: string, hubRequestOptions: IHubRequestOptions): Promise<import("../types").IModel>;
1
+ export * from "./_internal/_ensure-telemetry";
9
2
  export * from "./domains";
10
3
  export * from "./drafts";
11
- export * from "./_ensure-telemetry";
4
+ export * from "./fetchSiteModel";
12
5
  export * from "./get-site-by-id";
6
+ export * from "./HubSiteManager";
7
+ export * from "./HubSites";
8
+ export * from "./registerSiteAsApplication";
13
9
  export * from "./site-schema-version";
10
+ export * from "./themes";
14
11
  export * from "./upgrade-site-schema";
@@ -0,0 +1,8 @@
1
+ import { IHubRequestOptions, IModel } from "..";
2
+ /**
3
+ * Register the Site item as an application so we can oauth against it
4
+ * @param {string} siteId Item Id of the site
5
+ * @param {Array} uris Arrayf valid uris for the site
6
+ * @param {IHubRequestOptions} hubRequestOptions
7
+ */
8
+ export declare function registerSiteAsApplication(model: IModel, hubRequestOptions: IHubRequestOptions): Promise<any>;
@@ -0,0 +1,11 @@
1
+ import { IPortal } from "@esri/arcgis-rest-portal";
2
+ import { IHubSiteTheme } from "..";
3
+ /**
4
+ * Default Site Theme
5
+ */
6
+ export declare const DEFAULT_THEME: IHubSiteTheme;
7
+ /**
8
+ * Return the default theme, extended with values from the Org's shared theme
9
+ * @param {Object} portalSelf Org's Portal object
10
+ */
11
+ export declare function getOrgDefaultTheme(portalSelf: IPortal): IHubSiteTheme;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * concat an array of arrays
3
+ * excluding any elements of the top level array
4
+ * that are not actually arrays
5
+ * @param arrays An array of arrays
6
+ * @returns concatenated array
7
+ * @private
8
+ */
9
+ export declare const maybeConcat: (arrays: any[][]) => any[];