@esri/hub-common 14.223.0 → 14.225.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 (269) hide show
  1. package/dist/esm/associations/index.js +0 -3
  2. package/dist/esm/associations/index.js.map +1 -1
  3. package/dist/esm/associations/types.js.map +1 -1
  4. package/dist/esm/content/_internal/ContentBusinessRules.js +0 -5
  5. package/dist/esm/content/_internal/ContentBusinessRules.js.map +1 -1
  6. package/dist/esm/content/hostedServiceUtils.js +0 -22
  7. package/dist/esm/content/hostedServiceUtils.js.map +1 -1
  8. package/dist/esm/core/HubItemEntity.js +0 -37
  9. package/dist/esm/core/HubItemEntity.js.map +1 -1
  10. package/dist/esm/core/_internal/deepContains.js +40 -31
  11. package/dist/esm/core/_internal/deepContains.js.map +1 -1
  12. package/dist/esm/core/behaviors/index.js +0 -1
  13. package/dist/esm/core/behaviors/index.js.map +1 -1
  14. package/dist/esm/core/catalogContains.js +115 -0
  15. package/dist/esm/core/catalogContains.js.map +1 -0
  16. package/dist/esm/core/deepCatalogContains.js +4 -6
  17. package/dist/esm/core/deepCatalogContains.js.map +1 -1
  18. package/dist/esm/core/getEntityTypeFromHubEntityType.js +10 -0
  19. package/dist/esm/core/getEntityTypeFromHubEntityType.js.map +1 -0
  20. package/dist/esm/core/getHubTypeFromItemType.js +14 -0
  21. package/dist/esm/core/getHubTypeFromItemType.js.map +1 -0
  22. package/dist/esm/core/index.js +3 -1
  23. package/dist/esm/core/index.js.map +1 -1
  24. package/dist/esm/core/parseContainmentPath.js +19 -0
  25. package/dist/esm/core/parseContainmentPath.js.map +1 -1
  26. package/dist/esm/core/types/IHubProject.js +0 -13
  27. package/dist/esm/core/types/IHubProject.js.map +1 -1
  28. package/dist/esm/downloads/getDownloadFormats.js +1 -1
  29. package/dist/esm/downloads/index.js +0 -1
  30. package/dist/esm/downloads/index.js.map +1 -1
  31. package/dist/esm/index.js +1 -0
  32. package/dist/esm/index.js.map +1 -1
  33. package/dist/esm/initiative-templates/HubInitiativeTemplate.js +4 -3
  34. package/dist/esm/initiative-templates/HubInitiativeTemplate.js.map +1 -1
  35. package/dist/esm/initiative-templates/edit.js +0 -11
  36. package/dist/esm/initiative-templates/edit.js.map +1 -1
  37. package/dist/esm/initiatives/HubInitiatives.js +9 -79
  38. package/dist/esm/initiatives/HubInitiatives.js.map +1 -1
  39. package/dist/esm/initiatives/_internal/computeProps.js +3 -0
  40. package/dist/esm/initiatives/_internal/computeProps.js.map +1 -1
  41. package/dist/esm/initiatives/_internal/getPropertyMap.js +0 -1
  42. package/dist/esm/initiatives/_internal/getPropertyMap.js.map +1 -1
  43. package/dist/esm/initiatives/defaults.js +1 -2
  44. package/dist/esm/initiatives/defaults.js.map +1 -1
  45. package/dist/esm/permissions/HubPermissionPolicies.js +0 -18
  46. package/dist/esm/permissions/HubPermissionPolicies.js.map +1 -1
  47. package/dist/esm/permissions/types/Permission.js +0 -7
  48. package/dist/esm/permissions/types/Permission.js.map +1 -1
  49. package/dist/esm/projects/_internal/computeProps.js +3 -0
  50. package/dist/esm/projects/_internal/computeProps.js.map +1 -1
  51. package/dist/esm/projects/defaults.js +3 -2
  52. package/dist/esm/projects/defaults.js.map +1 -1
  53. package/dist/esm/projects/fetch.js +0 -29
  54. package/dist/esm/projects/fetch.js.map +1 -1
  55. package/dist/esm/search/Catalog.js +26 -107
  56. package/dist/esm/search/Catalog.js.map +1 -1
  57. package/dist/esm/search/fetchEntityCatalog.js +65 -0
  58. package/dist/esm/search/fetchEntityCatalog.js.map +1 -0
  59. package/dist/esm/search/index.js +0 -1
  60. package/dist/esm/search/index.js.map +1 -1
  61. package/dist/esm/search/types/IHubCatalog.js.map +1 -1
  62. package/dist/esm/search/upgradeCatalogSchema.js +1 -1
  63. package/dist/esm/search/upgradeCatalogSchema.js.map +1 -1
  64. package/dist/esm/search/utils.js +1 -1
  65. package/dist/esm/sites/HubSite.js +3 -3
  66. package/dist/esm/sites/HubSite.js.map +1 -1
  67. package/dist/esm/sites/_internal/SiteBusinessRules.js +5 -0
  68. package/dist/esm/sites/_internal/SiteBusinessRules.js.map +1 -1
  69. package/dist/esm/sites/defaults.js +1 -2
  70. package/dist/esm/sites/defaults.js.map +1 -1
  71. package/dist/esm/sites/feed-configuration.js +4 -3
  72. package/dist/esm/sites/feed-configuration.js.map +1 -1
  73. package/dist/esm/sites/feeds/_internal/defaults.js +56 -0
  74. package/dist/esm/sites/feeds/_internal/defaults.js.map +1 -0
  75. package/dist/esm/sites/feeds/_internal/getMajorVersion.js +11 -0
  76. package/dist/esm/sites/feeds/_internal/getMajorVersion.js.map +1 -0
  77. package/dist/esm/sites/feeds/getFeedTemplate.js +25 -0
  78. package/dist/esm/sites/feeds/getFeedTemplate.js.map +1 -0
  79. package/dist/esm/sites/feeds/previewFeed.js +35 -0
  80. package/dist/esm/sites/feeds/previewFeed.js.map +1 -0
  81. package/dist/esm/sites/feeds/setFeedTemplate.js +20 -0
  82. package/dist/esm/sites/feeds/setFeedTemplate.js.map +1 -0
  83. package/dist/esm/sites/feeds/types.js +1 -0
  84. package/dist/esm/sites/feeds/types.js.map +1 -0
  85. package/dist/esm/sites/index.js +4 -0
  86. package/dist/esm/sites/index.js.map +1 -1
  87. package/dist/esm/utils/hubUserAppResources.js +0 -52
  88. package/dist/esm/utils/hubUserAppResources.js.map +1 -1
  89. package/dist/esm/utils/index.js +0 -1
  90. package/dist/esm/utils/index.js.map +1 -1
  91. package/dist/node/associations/index.js +0 -3
  92. package/dist/node/associations/index.js.map +1 -1
  93. package/dist/node/associations/types.js.map +1 -1
  94. package/dist/node/content/_internal/ContentBusinessRules.js +0 -5
  95. package/dist/node/content/_internal/ContentBusinessRules.js.map +1 -1
  96. package/dist/node/content/hostedServiceUtils.js +1 -25
  97. package/dist/node/content/hostedServiceUtils.js.map +1 -1
  98. package/dist/node/core/HubItemEntity.js +0 -37
  99. package/dist/node/core/HubItemEntity.js.map +1 -1
  100. package/dist/node/core/_internal/deepContains.js +39 -30
  101. package/dist/node/core/_internal/deepContains.js.map +1 -1
  102. package/dist/node/core/behaviors/index.js +0 -1
  103. package/dist/node/core/behaviors/index.js.map +1 -1
  104. package/dist/node/core/catalogContains.js +119 -0
  105. package/dist/node/core/catalogContains.js.map +1 -0
  106. package/dist/node/core/deepCatalogContains.js +4 -6
  107. package/dist/node/core/deepCatalogContains.js.map +1 -1
  108. package/dist/node/core/getEntityTypeFromHubEntityType.js +14 -0
  109. package/dist/node/core/getEntityTypeFromHubEntityType.js.map +1 -0
  110. package/dist/node/core/getHubTypeFromItemType.js +18 -0
  111. package/dist/node/core/getHubTypeFromItemType.js.map +1 -0
  112. package/dist/node/core/index.js +3 -1
  113. package/dist/node/core/index.js.map +1 -1
  114. package/dist/node/core/parseContainmentPath.js +22 -1
  115. package/dist/node/core/parseContainmentPath.js.map +1 -1
  116. package/dist/node/core/types/IHubProject.js +0 -14
  117. package/dist/node/core/types/IHubProject.js.map +1 -1
  118. package/dist/node/downloads/getDownloadFormats.js +1 -1
  119. package/dist/node/downloads/index.js +0 -1
  120. package/dist/node/downloads/index.js.map +1 -1
  121. package/dist/node/index.js +1 -0
  122. package/dist/node/index.js.map +1 -1
  123. package/dist/node/initiative-templates/HubInitiativeTemplate.js +5 -4
  124. package/dist/node/initiative-templates/HubInitiativeTemplate.js.map +1 -1
  125. package/dist/node/initiative-templates/edit.js +1 -13
  126. package/dist/node/initiative-templates/edit.js.map +1 -1
  127. package/dist/node/initiatives/HubInitiatives.js +9 -82
  128. package/dist/node/initiatives/HubInitiatives.js.map +1 -1
  129. package/dist/node/initiatives/_internal/computeProps.js +3 -0
  130. package/dist/node/initiatives/_internal/computeProps.js.map +1 -1
  131. package/dist/node/initiatives/_internal/getPropertyMap.js +0 -1
  132. package/dist/node/initiatives/_internal/getPropertyMap.js.map +1 -1
  133. package/dist/node/initiatives/defaults.js +1 -2
  134. package/dist/node/initiatives/defaults.js.map +1 -1
  135. package/dist/node/permissions/HubPermissionPolicies.js +0 -18
  136. package/dist/node/permissions/HubPermissionPolicies.js.map +1 -1
  137. package/dist/node/permissions/types/Permission.js +0 -7
  138. package/dist/node/permissions/types/Permission.js.map +1 -1
  139. package/dist/node/projects/_internal/computeProps.js +3 -0
  140. package/dist/node/projects/_internal/computeProps.js.map +1 -1
  141. package/dist/node/projects/defaults.js +3 -2
  142. package/dist/node/projects/defaults.js.map +1 -1
  143. package/dist/node/projects/fetch.js +1 -31
  144. package/dist/node/projects/fetch.js.map +1 -1
  145. package/dist/node/search/Catalog.js +25 -106
  146. package/dist/node/search/Catalog.js.map +1 -1
  147. package/dist/node/search/fetchEntityCatalog.js +69 -0
  148. package/dist/node/search/fetchEntityCatalog.js.map +1 -0
  149. package/dist/node/search/index.js +0 -1
  150. package/dist/node/search/index.js.map +1 -1
  151. package/dist/node/search/types/IHubCatalog.js.map +1 -1
  152. package/dist/node/search/upgradeCatalogSchema.js +1 -1
  153. package/dist/node/search/upgradeCatalogSchema.js.map +1 -1
  154. package/dist/node/search/utils.js +1 -1
  155. package/dist/node/sites/HubSite.js +5 -5
  156. package/dist/node/sites/HubSite.js.map +1 -1
  157. package/dist/node/sites/_internal/SiteBusinessRules.js +5 -0
  158. package/dist/node/sites/_internal/SiteBusinessRules.js.map +1 -1
  159. package/dist/node/sites/defaults.js +1 -2
  160. package/dist/node/sites/defaults.js.map +1 -1
  161. package/dist/node/sites/feed-configuration.js +10 -9
  162. package/dist/node/sites/feed-configuration.js.map +1 -1
  163. package/dist/node/sites/feeds/_internal/defaults.js +60 -0
  164. package/dist/node/sites/feeds/_internal/defaults.js.map +1 -0
  165. package/dist/node/sites/feeds/_internal/getMajorVersion.js +15 -0
  166. package/dist/node/sites/feeds/_internal/getMajorVersion.js.map +1 -0
  167. package/dist/node/sites/feeds/getFeedTemplate.js +29 -0
  168. package/dist/node/sites/feeds/getFeedTemplate.js.map +1 -0
  169. package/dist/node/sites/feeds/previewFeed.js +39 -0
  170. package/dist/node/sites/feeds/previewFeed.js.map +1 -0
  171. package/dist/node/sites/feeds/setFeedTemplate.js +24 -0
  172. package/dist/node/sites/feeds/setFeedTemplate.js.map +1 -0
  173. package/dist/node/{core/behaviors/IWIthAssociationBehavior.js → sites/feeds/types.js} +1 -1
  174. package/dist/node/sites/feeds/types.js.map +1 -0
  175. package/dist/node/sites/index.js +4 -0
  176. package/dist/node/sites/index.js.map +1 -1
  177. package/dist/node/utils/hubUserAppResources.js +1 -57
  178. package/dist/node/utils/hubUserAppResources.js.map +1 -1
  179. package/dist/node/utils/index.js +0 -1
  180. package/dist/node/utils/index.js.map +1 -1
  181. package/dist/types/associations/index.d.ts +0 -3
  182. package/dist/types/associations/types.d.ts +0 -25
  183. package/dist/types/content/_fetch.d.ts +1 -1
  184. package/dist/types/content/_internal/ContentBusinessRules.d.ts +1 -1
  185. package/dist/types/content/hostedServiceUtils.d.ts +0 -14
  186. package/dist/types/core/HubItemEntity.d.ts +2 -31
  187. package/dist/types/core/_internal/deepContains.d.ts +3 -2
  188. package/dist/types/core/behaviors/IWithCatalogBehavior.d.ts +1 -1
  189. package/dist/types/core/behaviors/index.d.ts +0 -1
  190. package/dist/types/core/catalogContains.d.ts +11 -0
  191. package/dist/types/core/deepCatalogContains.d.ts +2 -2
  192. package/dist/types/core/getEntityTypeFromHubEntityType.d.ts +8 -0
  193. package/dist/types/core/getHubTypeFromItemType.d.ts +8 -0
  194. package/dist/types/core/index.d.ts +2 -1
  195. package/dist/types/core/parseContainmentPath.d.ts +14 -0
  196. package/dist/types/core/schemas/types.d.ts +0 -14
  197. package/dist/types/core/traits/IWithCatalog.d.ts +3 -9
  198. package/dist/types/core/types/IHubDiscussion.d.ts +2 -2
  199. package/dist/types/core/types/IHubEvent.d.ts +2 -2
  200. package/dist/types/core/types/IHubInitiative.d.ts +2 -3
  201. package/dist/types/core/types/IHubLocation.d.ts +1 -5
  202. package/dist/types/core/types/IHubProject.d.ts +2 -15
  203. package/dist/types/core/types/IHubSite.d.ts +2 -3
  204. package/dist/types/downloads/getDownloadFormats.d.ts +1 -1
  205. package/dist/types/downloads/index.d.ts +0 -1
  206. package/dist/types/index.d.ts +1 -0
  207. package/dist/types/initiative-templates/HubInitiativeTemplate.d.ts +1 -1
  208. package/dist/types/initiative-templates/edit.d.ts +1 -10
  209. package/dist/types/initiatives/HubInitiatives.d.ts +1 -38
  210. package/dist/types/permissions/types/Permission.d.ts +1 -2
  211. package/dist/types/projects/fetch.d.ts +0 -17
  212. package/dist/types/search/Catalog.d.ts +9 -13
  213. package/dist/types/search/fetchEntityCatalog.d.ts +18 -0
  214. package/dist/types/search/index.d.ts +0 -1
  215. package/dist/types/search/types/IHubCatalog.d.ts +2 -0
  216. package/dist/types/search/types/types.d.ts +6 -1
  217. package/dist/types/search/utils.d.ts +1 -1
  218. package/dist/types/sites/HubSite.d.ts +1 -1
  219. package/dist/types/sites/_internal/SiteBusinessRules.d.ts +1 -1
  220. package/dist/types/sites/feed-configuration.d.ts +3 -0
  221. package/dist/types/sites/feeds/_internal/defaults.d.ts +5 -0
  222. package/dist/types/sites/feeds/_internal/getMajorVersion.d.ts +8 -0
  223. package/dist/types/sites/feeds/getFeedTemplate.d.ts +15 -0
  224. package/dist/types/sites/feeds/previewFeed.d.ts +19 -0
  225. package/dist/types/sites/feeds/setFeedTemplate.d.ts +17 -0
  226. package/dist/types/sites/feeds/types.d.ts +21 -0
  227. package/dist/types/sites/index.d.ts +4 -0
  228. package/dist/types/utils/hubUserAppResources.d.ts +0 -36
  229. package/dist/types/utils/index.d.ts +0 -1
  230. package/package.json +1 -1
  231. package/dist/esm/associations/addAssociation.js +0 -19
  232. package/dist/esm/associations/addAssociation.js.map +0 -1
  233. package/dist/esm/associations/listAssociations.js +0 -21
  234. package/dist/esm/associations/listAssociations.js.map +0 -1
  235. package/dist/esm/associations/removeAssociation.js +0 -20
  236. package/dist/esm/associations/removeAssociation.js.map +0 -1
  237. package/dist/esm/core/behaviors/IWIthAssociationBehavior.js +0 -1
  238. package/dist/esm/core/behaviors/IWIthAssociationBehavior.js.map +0 -1
  239. package/dist/esm/core/getEntityDefaultWorkspacePane.js +0 -17
  240. package/dist/esm/core/getEntityDefaultWorkspacePane.js.map +0 -1
  241. package/dist/esm/downloads/fetchDownloadFormats.js +0 -39
  242. package/dist/esm/downloads/fetchDownloadFormats.js.map +0 -1
  243. package/dist/esm/search/fetchCatalog.js +0 -56
  244. package/dist/esm/search/fetchCatalog.js.map +0 -1
  245. package/dist/esm/utils/sessionLocalStorage.js +0 -57
  246. package/dist/esm/utils/sessionLocalStorage.js.map +0 -1
  247. package/dist/node/associations/addAssociation.js +0 -23
  248. package/dist/node/associations/addAssociation.js.map +0 -1
  249. package/dist/node/associations/listAssociations.js +0 -25
  250. package/dist/node/associations/listAssociations.js.map +0 -1
  251. package/dist/node/associations/removeAssociation.js +0 -24
  252. package/dist/node/associations/removeAssociation.js.map +0 -1
  253. package/dist/node/core/behaviors/IWIthAssociationBehavior.js.map +0 -1
  254. package/dist/node/core/getEntityDefaultWorkspacePane.js +0 -20
  255. package/dist/node/core/getEntityDefaultWorkspacePane.js.map +0 -1
  256. package/dist/node/downloads/fetchDownloadFormats.js +0 -43
  257. package/dist/node/downloads/fetchDownloadFormats.js.map +0 -1
  258. package/dist/node/search/fetchCatalog.js +0 -60
  259. package/dist/node/search/fetchCatalog.js.map +0 -1
  260. package/dist/node/utils/sessionLocalStorage.js +0 -63
  261. package/dist/node/utils/sessionLocalStorage.js.map +0 -1
  262. package/dist/types/associations/addAssociation.d.ts +0 -12
  263. package/dist/types/associations/listAssociations.d.ts +0 -12
  264. package/dist/types/associations/removeAssociation.d.ts +0 -12
  265. package/dist/types/core/behaviors/IWIthAssociationBehavior.d.ts +0 -32
  266. package/dist/types/core/getEntityDefaultWorkspacePane.d.ts +0 -11
  267. package/dist/types/downloads/fetchDownloadFormats.d.ts +0 -9
  268. package/dist/types/search/fetchCatalog.d.ts +0 -10
  269. package/dist/types/utils/sessionLocalStorage.d.ts +0 -29
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchDownloadFormats = void 0;
4
- const canUseExportImageFlow_1 = require("./_internal/canUseExportImageFlow");
5
- const canUseHubDownloadApi_1 = require("./canUseHubDownloadApi");
6
- /**
7
- * DEPRECATED: This will be removed in the next breaking version. Use "getDownloadFormats()" instead.
8
- *
9
- * Fetches download formats for the given entity. Also folds in any additional resources defined on the entity.
10
- * @param options options to refine / filter the results of the fetchDownloadFormats operation
11
- * @returns a promise that resolves with the download formats
12
- */
13
- async function fetchDownloadFormats(options) {
14
- /* tslint:disable no-console */
15
- console.warn(`"fetchDownloadFormats()" is deprecated. Please use "getDownloadFormats()"`);
16
- const { entity, context, layers } = options;
17
- // fetch base formats for the item
18
- let baseFormats = [];
19
- if (canUseHubDownloadApi_1.canUseHubDownloadApi(entity, context)) {
20
- const { getHubDownloadApiFormats } = await Promise.resolve().then(() => require("./getHubDownloadApiFormats"));
21
- baseFormats = getHubDownloadApiFormats(entity);
22
- }
23
- else if (canUseExportImageFlow_1.canUseExportImageFlow(entity)) {
24
- const { getExportImageFormats } = await Promise.resolve().then(() => require("./_internal/format-fetchers/getExportImageFormats"));
25
- baseFormats = getExportImageFormats(entity);
26
- }
27
- // add additional resource links as static formats
28
- // TODO: change to use `extendedProps.additionalResources`
29
- const additionalFormats = (entity.additionalResources || []).map(toStaticFormat);
30
- // combine formats into single list
31
- return [...baseFormats, ...additionalFormats];
32
- }
33
- exports.fetchDownloadFormats = fetchDownloadFormats;
34
- function toStaticFormat(resource) {
35
- return {
36
- type: "static",
37
- label: resource.name ||
38
- (resource.isDataSource && `{{dataSource:translate}}`) || // if the additional resource is the datasource
39
- `{{noTitle:translate}}`,
40
- url: resource.url,
41
- };
42
- }
43
- //# sourceMappingURL=fetchDownloadFormats.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetchDownloadFormats.js","sourceRoot":"","sources":["../../../src/downloads/fetchDownloadFormats.ts"],"names":[],"mappings":";;;AACA,6EAA0E;AAC1E,iEAA8D;AAO9D;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB,CACxC,OAAqC;IAErC,+BAA+B;IAC/B,OAAO,CAAC,IAAI,CACV,2EAA2E,CAC5E,CAAC;IAEF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC5C,kCAAkC;IAClC,IAAI,WAAW,GAAsB,EAAE,CAAC;IACxC,IAAI,2CAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;QACzC,MAAM,EAAE,wBAAwB,EAAE,GAAG,2CACnC,4BAA4B,EAC7B,CAAC;QACF,WAAW,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;KAChD;SAAM,IAAI,6CAAqB,CAAC,MAAM,CAAC,EAAE;QACxC,MAAM,EAAE,qBAAqB,EAAE,GAAG,2CAChC,mDAAmD,EACpD,CAAC;QACF,WAAW,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;KAC7C;IAED,kDAAkD;IAClD,0DAA0D;IAC1D,MAAM,iBAAiB,GAAG,CAAC,MAAM,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC,GAAG,CAC9D,cAAc,CACf,CAAC;IAEF,mCAAmC;IACnC,OAAO,CAAC,GAAG,WAAW,EAAE,GAAG,iBAAiB,CAAC,CAAC;AAChD,CAAC;AA/BD,oDA+BC;AAED,SAAS,cAAc,CACrB,QAAgC;IAEhC,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,EACH,QAAQ,CAAC,IAAI;YACb,CAAC,QAAQ,CAAC,YAAY,IAAI,0BAA0B,CAAC,IAAI,+CAA+C;YACxG,uBAAuB;QACzB,GAAG,EAAE,QAAQ,CAAC,GAAG;KAClB,CAAC;AACJ,CAAC"}
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchCatalog = void 0;
4
- const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
5
- const HubError_1 = require("../HubError");
6
- const lookup_domain_1 = require("../sites/domains/lookup-domain");
7
- const strip_protocol_1 = require("../urls/strip-protocol");
8
- const is_guid_1 = require("../utils/is-guid");
9
- const upgradeCatalogSchema_1 = require("./upgradeCatalogSchema");
10
- /**
11
- * Fetch a IHubCatalog from a backing item.
12
- * This will apply schema upgrades to the structure
13
- * @param identifier
14
- * @param requestOptions
15
- * @returns
16
- */
17
- async function fetchCatalog(identifier, requestOptions) {
18
- let getPrms;
19
- // identifier can be a guid or a url
20
- if (identifier.indexOf("http") === 0) {
21
- let url = identifier;
22
- // get down the the hostname
23
- url = strip_protocol_1.stripProtocol(url);
24
- // if url does not include a hash (i.e. it's not portal)
25
- // then we want to split on the first slash to get the hostname
26
- // lookupDomain will handle the enterprise base urls
27
- if (!url.includes("#")) {
28
- url = url.split("/")[0];
29
- }
30
- getPrms = lookup_domain_1.lookupDomain(url, requestOptions)
31
- // get the item's data, and read the catalog out of it
32
- .then(({ siteId }) => arcgis_rest_portal_1.getItemData(siteId, requestOptions))
33
- .then((data) => {
34
- return upgradeCatalogSchema_1.upgradeCatalogSchema(data.catalog || {});
35
- });
36
- }
37
- else if (is_guid_1.isGuid(identifier)) {
38
- // get the item's data, and read the catalog out of it
39
- // TODO: get the entity so the catalog migrations / mappings can be applied
40
- // however this requires the HubEntityType and context, which we don't have
41
- getPrms = arcgis_rest_portal_1.getItemData(identifier, requestOptions).then((data) => {
42
- // catalogs are moving to an array structure so we need to handle both
43
- let catalog = {};
44
- if (data.catalog) {
45
- catalog = data.catalog;
46
- }
47
- if (data.catalogs && data.catalogs.length > 0) {
48
- catalog = data.catalogs[0];
49
- }
50
- return upgradeCatalogSchema_1.upgradeCatalogSchema(catalog);
51
- });
52
- }
53
- else {
54
- throw new HubError_1.default("Catalog.create", "Identifier must be a url, guid");
55
- }
56
- const fetched = await getPrms;
57
- return fetched;
58
- }
59
- exports.fetchCatalog = fetchCatalog;
60
- //# sourceMappingURL=fetchCatalog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetchCatalog.js","sourceRoot":"","sources":["../../../src/search/fetchCatalog.ts"],"names":[],"mappings":";;;AAAA,iEAAuD;AACvD,0CAAmC;AACnC,kEAA8D;AAE9D,2DAAuD;AACvD,8CAA0C;AAE1C,iEAA8D;AAG9D;;;;;;GAMG;AACI,KAAK,UAAU,YAAY,CAChC,UAAkB,EAClB,cAAkC;IAElC,IAAI,OAAO,CAAC;IACZ,oCAAoC;IACpC,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QACpC,IAAI,GAAG,GAAG,UAAU,CAAC;QAErB,4BAA4B;QAC5B,GAAG,GAAG,8BAAa,CAAC,GAAG,CAAC,CAAC;QACzB,wDAAwD;QACxD,+DAA+D;QAC/D,oDAAoD;QACpD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACtB,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACzB;QAED,OAAO,GAAG,4BAAY,CAAC,GAAG,EAAE,cAAc,CAAC;YACzC,sDAAsD;aACrD,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,gCAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;aACzD,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACb,OAAO,2CAAoB,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;KACN;SAAM,IAAI,gBAAM,CAAC,UAAU,CAAC,EAAE;QAC7B,sDAAsD;QAEtD,2EAA2E;QAC3E,2EAA2E;QAC3E,OAAO,GAAG,gCAAW,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9D,sEAAsE;YACtE,IAAI,OAAO,GAAG,EAAE,CAAC;YACjB,IAAI,IAAI,CAAC,OAAO,EAAE;gBAChB,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;aACxB;YACD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC7C,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;aAC5B;YAED,OAAO,2CAAoB,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;KACJ;SAAM;QACL,MAAM,IAAI,kBAAQ,CAAC,gBAAgB,EAAE,gCAAgC,CAAC,CAAC;KACxE;IAED,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC;IAE9B,OAAO,OAAO,CAAC;AACjB,CAAC;AAhDD,oCAgDC"}
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.saveSession = exports.getSession = exports.clearSession = void 0;
4
- const arcgis_rest_auth_1 = require("@esri/arcgis-rest-auth");
5
- /**
6
- * DEPRECATED: Applications should manage storage/retrieval of serialized ArcGISContexts.
7
- * Please see ArcGISContextManager.serialize(...) and ArcGISContextManager.deserialize(...)
8
- * Remove any serialized sessions associated with the passed clientId
9
- * from a browser's local storage
10
- * @param clientId oAuth Client Id
11
- * @param win optional window (used for testing)
12
- */
13
- function clearSession(clientId,
14
- /* istanbul ignore next */
15
- win = window) {
16
- if (win.localStorage) {
17
- win.localStorage.removeItem(`__CONTEXT_${clientId}`);
18
- }
19
- }
20
- exports.clearSession = clearSession;
21
- /**
22
- * DEPRECATED: Applications should manage storage/retrieval of serialized ArcGISContexts.
23
- * Please see ArcGISContextManager.serialize(...) and ArcGISContextManager.deserialize(...)
24
- * Re-hydrate a UserSession from a browser's local storage.
25
- * If not found,
26
- * @param clientId oAuth Client Id
27
- * @param win optional window (used for testing)
28
- * @returns
29
- */
30
- function getSession(clientId,
31
- /* istanbul ignore next */
32
- win = window) {
33
- let result = null;
34
- // tslint:disable-next-line
35
- console.warn("getSession is deprecated. App should handle storage/retrieval and use ArcGISContextManager.deserialize(...) instead.");
36
- if (win.localStorage) {
37
- const serializedSession = win.localStorage.getItem(`__CONTEXT_${clientId}`);
38
- if (serializedSession) {
39
- result = arcgis_rest_auth_1.UserSession.deserialize(serializedSession);
40
- }
41
- }
42
- return result;
43
- }
44
- exports.getSession = getSession;
45
- /**
46
- * DEPRECATED: Applications should manage storage/retrieval of serialized ArcGISContexts.
47
- * Please see ArcGISContextManager.serialize(...) and ArcGISContextManager.deserialize(...)
48
- * Serialize a UserSession into a browser's local storage
49
- * @param clientId oAuth Client Id
50
- * @param session UserSession
51
- * @param win optional window (used for testing)
52
- */
53
- function saveSession(clientId, session,
54
- /* istanbul ignore next */
55
- win = window) {
56
- // tslint:disable-next-line
57
- console.warn("saveSession is deprecated. App should handle storage/retrieval and use ArcGISContextManager.serialize(...) instead.");
58
- if (win.localStorage) {
59
- win.localStorage.setItem(`__CONTEXT_${clientId}`, session.serialize());
60
- }
61
- }
62
- exports.saveSession = saveSession;
63
- //# sourceMappingURL=sessionLocalStorage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sessionLocalStorage.js","sourceRoot":"","sources":["../../../src/utils/sessionLocalStorage.ts"],"names":[],"mappings":";;;AAAA,6DAAqD;AAErD;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,QAAgB;AAChB,0BAA0B;AAC1B,MAAW,MAAM;IAEjB,IAAI,GAAG,CAAC,YAAY,EAAE;QACpB,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,QAAQ,EAAE,CAAC,CAAC;KACtD;AACH,CAAC;AARD,oCAQC;AAED;;;;;;;;GAQG;AACH,SAAgB,UAAU,CACxB,QAAgB;AAChB,0BAA0B;AAC1B,MAAW,MAAM;IAEjB,IAAI,MAAM,GAAuB,IAAI,CAAC;IACtC,2BAA2B;IAC3B,OAAO,CAAC,IAAI,CACV,sHAAsH,CACvH,CAAC;IACF,IAAI,GAAG,CAAC,YAAY,EAAE;QACpB,MAAM,iBAAiB,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,QAAQ,EAAE,CAAC,CAAC;QAC5E,IAAI,iBAAiB,EAAE;YACrB,MAAM,GAAG,8BAAW,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;SACrD;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAjBD,gCAiBC;AAED;;;;;;;GAOG;AACH,SAAgB,WAAW,CACzB,QAAgB,EAChB,OAAoB;AACpB,0BAA0B;AAC1B,MAAW,MAAM;IAEjB,2BAA2B;IAC3B,OAAO,CAAC,IAAI,CACV,qHAAqH,CACtH,CAAC;IACF,IAAI,GAAG,CAAC,YAAY,EAAE;QACpB,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,QAAQ,EAAE,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;KACxE;AACH,CAAC;AAbD,kCAaC"}
@@ -1,12 +0,0 @@
1
- import { IWithAssociations } from "../core/traits/IWithAssociations";
2
- import { IAssociationInfo } from "./types";
3
- /**
4
- * ** DEPRECATED: please use requestAssociation instead.
5
- * This will be removed in the next breaking version **
6
- *
7
- * Add an association to an entity
8
- * Persisted into the entity's `.typeKeywords` array
9
- * @param info
10
- * @param entity
11
- */
12
- export declare function addAssociation(entity: IWithAssociations, info: IAssociationInfo): void;
@@ -1,12 +0,0 @@
1
- import { IWithAssociations } from "../core/traits/IWithAssociations";
2
- import { AssociationType, IAssociationInfo } from "./types";
3
- /**
4
- * ** DEPRECATED: please use getAssociatedEntitiesQuery
5
- * to get a query for an entity's associations instead.
6
- * This will be removed in the next breaking version **
7
- *
8
- * Return a list of all associations on an entity for a type
9
- * @param entity
10
- * @returns
11
- */
12
- export declare function listAssociations(entity: IWithAssociations, type: AssociationType): IAssociationInfo[];
@@ -1,12 +0,0 @@
1
- import { IWithAssociations } from "../core/traits/IWithAssociations";
2
- import { IAssociationInfo } from "./types";
3
- /**
4
- * ** DEPRECATED: please use breakAssociation instead.
5
- * This will be removed in the next breaking version **
6
- *
7
- * Remove an association from an entity
8
- * @param info
9
- * @param entity
10
- * @returns
11
- */
12
- export declare function removeAssociation(entity: IWithAssociations, info: IAssociationInfo): void;
@@ -1,32 +0,0 @@
1
- import { AssociationType, IAssociationInfo } from "../../associations/types";
2
- /**
3
- * Composable behavior that adds permissions to an entity
4
- */
5
- export interface IWithAssociationBehavior {
6
- /**
7
- * ** DEPRECATED: This will be removed in the next
8
- * breaking version **
9
- *
10
- * Get a list of the associations for an AssociationType
11
- * @param type
12
- */
13
- listAssociations(type: AssociationType): IAssociationInfo[];
14
- /**
15
- * ** DEPRECATED: please use requestAssociation directly.
16
- * This will be removed in the next breaking version **
17
- *
18
- * Add an association to the entity.
19
- * Entity needs to be saved after calling this method
20
- * @param info
21
- */
22
- addAssociation(info: IAssociationInfo): void;
23
- /**
24
- * ** DEPRECATED: please use breakAssociation directly.
25
- * This will be removed in the next breaking version **
26
- *
27
- * Remove an association to the entity.
28
- * Entity needs to be saved after calling this method
29
- * @param info
30
- */
31
- removeAssociation(info: IAssociationInfo): void;
32
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * DEPRECATED
3
- *
4
- * This util has been deprecated. It was a duplicate of another util and is the concern of the UI,
5
- * so it was moved as such.
6
- *
7
- * It will be removed in the next breaking version.
8
- * @param entityType
9
- * @returns
10
- */
11
- export declare const getEntityDefaultWorkspacePane: (entityType: string) => string;
@@ -1,9 +0,0 @@
1
- import { IDownloadFormat, IFetchDownloadFormatsOptions } from "./types";
2
- /**
3
- * DEPRECATED: This will be removed in the next breaking version. Use "getDownloadFormats()" instead.
4
- *
5
- * Fetches download formats for the given entity. Also folds in any additional resources defined on the entity.
6
- * @param options options to refine / filter the results of the fetchDownloadFormats operation
7
- * @returns a promise that resolves with the download formats
8
- */
9
- export declare function fetchDownloadFormats(options: IFetchDownloadFormatsOptions): Promise<IDownloadFormat[]>;
@@ -1,10 +0,0 @@
1
- import { IHubRequestOptions } from "../types";
2
- import { IHubCatalog } from "./types/IHubCatalog";
3
- /**
4
- * Fetch a IHubCatalog from a backing item.
5
- * This will apply schema upgrades to the structure
6
- * @param identifier
7
- * @param requestOptions
8
- * @returns
9
- */
10
- export declare function fetchCatalog(identifier: string, requestOptions: IHubRequestOptions): Promise<IHubCatalog>;
@@ -1,29 +0,0 @@
1
- import { UserSession } from "@esri/arcgis-rest-auth";
2
- /**
3
- * DEPRECATED: Applications should manage storage/retrieval of serialized ArcGISContexts.
4
- * Please see ArcGISContextManager.serialize(...) and ArcGISContextManager.deserialize(...)
5
- * Remove any serialized sessions associated with the passed clientId
6
- * from a browser's local storage
7
- * @param clientId oAuth Client Id
8
- * @param win optional window (used for testing)
9
- */
10
- export declare function clearSession(clientId: string, win?: any): void;
11
- /**
12
- * DEPRECATED: Applications should manage storage/retrieval of serialized ArcGISContexts.
13
- * Please see ArcGISContextManager.serialize(...) and ArcGISContextManager.deserialize(...)
14
- * Re-hydrate a UserSession from a browser's local storage.
15
- * If not found,
16
- * @param clientId oAuth Client Id
17
- * @param win optional window (used for testing)
18
- * @returns
19
- */
20
- export declare function getSession(clientId: string, win?: any): UserSession | null;
21
- /**
22
- * DEPRECATED: Applications should manage storage/retrieval of serialized ArcGISContexts.
23
- * Please see ArcGISContextManager.serialize(...) and ArcGISContextManager.deserialize(...)
24
- * Serialize a UserSession into a browser's local storage
25
- * @param clientId oAuth Client Id
26
- * @param session UserSession
27
- * @param win optional window (used for testing)
28
- */
29
- export declare function saveSession(clientId: string, session: UserSession, win?: any): void;