@esri/hub-common 14.80.1 → 14.81.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 (108) hide show
  1. package/dist/esm/content/_internal/computeProps.js +3 -25
  2. package/dist/esm/content/_internal/computeProps.js.map +1 -1
  3. package/dist/esm/content/_internal/internalContentUtils.js +69 -1
  4. package/dist/esm/content/_internal/internalContentUtils.js.map +1 -1
  5. package/dist/esm/content/search.js +2 -15
  6. package/dist/esm/content/search.js.map +1 -1
  7. package/dist/esm/core/_internal/computeBaseProps.js +15 -0
  8. package/dist/esm/core/_internal/computeBaseProps.js.map +1 -0
  9. package/dist/esm/discussions/_internal/computeProps.js +3 -0
  10. package/dist/esm/discussions/_internal/computeProps.js.map +1 -1
  11. package/dist/esm/discussions/edit.js +2 -2
  12. package/dist/esm/discussions/edit.js.map +1 -1
  13. package/dist/esm/extent.js +39 -0
  14. package/dist/esm/extent.js.map +1 -1
  15. package/dist/esm/initiative-templates/_internal/computeProps.js +3 -0
  16. package/dist/esm/initiative-templates/_internal/computeProps.js.map +1 -1
  17. package/dist/esm/initiative-templates/fetch.js +2 -0
  18. package/dist/esm/initiative-templates/fetch.js.map +1 -1
  19. package/dist/esm/initiatives/HubInitiative.js +16 -9
  20. package/dist/esm/initiatives/HubInitiative.js.map +1 -1
  21. package/dist/esm/initiatives/HubInitiatives.js +2 -1
  22. package/dist/esm/initiatives/HubInitiatives.js.map +1 -1
  23. package/dist/esm/initiatives/_internal/computeProps.js +4 -2
  24. package/dist/esm/initiatives/_internal/computeProps.js.map +1 -1
  25. package/dist/esm/pages/HubPages.js +2 -1
  26. package/dist/esm/pages/HubPages.js.map +1 -1
  27. package/dist/esm/pages/_internal/computeProps.js +3 -0
  28. package/dist/esm/pages/_internal/computeProps.js.map +1 -1
  29. package/dist/esm/projects/HubProject.js +16 -9
  30. package/dist/esm/projects/HubProject.js.map +1 -1
  31. package/dist/esm/projects/_internal/computeProps.js +4 -2
  32. package/dist/esm/projects/_internal/computeProps.js.map +1 -1
  33. package/dist/esm/projects/fetch.js +2 -0
  34. package/dist/esm/projects/fetch.js.map +1 -1
  35. package/dist/esm/resources/doesResourceExist.js +19 -0
  36. package/dist/esm/resources/doesResourceExist.js.map +1 -0
  37. package/dist/esm/resources/index.js +1 -0
  38. package/dist/esm/resources/index.js.map +1 -1
  39. package/dist/esm/resources/upsertResource.js +4 -12
  40. package/dist/esm/resources/upsertResource.js.map +1 -1
  41. package/dist/esm/search/_internal/hubSearchItemsHelpers/ogcItemToSearchResult.js +1 -16
  42. package/dist/esm/search/_internal/hubSearchItemsHelpers/ogcItemToSearchResult.js.map +1 -1
  43. package/dist/esm/sites/HubSites.js +2 -1
  44. package/dist/esm/sites/HubSites.js.map +1 -1
  45. package/dist/esm/sites/_internal/computeProps.js +3 -0
  46. package/dist/esm/sites/_internal/computeProps.js.map +1 -1
  47. package/dist/esm/templates/_internal/computeProps.js +10 -7
  48. package/dist/esm/templates/_internal/computeProps.js.map +1 -1
  49. package/dist/esm/templates/fetch.js +2 -0
  50. package/dist/esm/templates/fetch.js.map +1 -1
  51. package/dist/node/content/_internal/computeProps.js +4 -27
  52. package/dist/node/content/_internal/computeProps.js.map +1 -1
  53. package/dist/node/content/_internal/internalContentUtils.js +69 -1
  54. package/dist/node/content/_internal/internalContentUtils.js.map +1 -1
  55. package/dist/node/content/search.js +1 -14
  56. package/dist/node/content/search.js.map +1 -1
  57. package/dist/node/core/_internal/computeBaseProps.js +19 -0
  58. package/dist/node/core/_internal/computeBaseProps.js.map +1 -0
  59. package/dist/node/discussions/_internal/computeProps.js +3 -0
  60. package/dist/node/discussions/_internal/computeProps.js.map +1 -1
  61. package/dist/node/discussions/edit.js +2 -2
  62. package/dist/node/discussions/edit.js.map +1 -1
  63. package/dist/node/extent.js +40 -1
  64. package/dist/node/extent.js.map +1 -1
  65. package/dist/node/initiative-templates/_internal/computeProps.js +3 -0
  66. package/dist/node/initiative-templates/_internal/computeProps.js.map +1 -1
  67. package/dist/node/initiative-templates/fetch.js +2 -0
  68. package/dist/node/initiative-templates/fetch.js.map +1 -1
  69. package/dist/node/initiatives/HubInitiative.js +16 -9
  70. package/dist/node/initiatives/HubInitiative.js.map +1 -1
  71. package/dist/node/initiatives/HubInitiatives.js +1 -0
  72. package/dist/node/initiatives/HubInitiatives.js.map +1 -1
  73. package/dist/node/initiatives/_internal/computeProps.js +4 -2
  74. package/dist/node/initiatives/_internal/computeProps.js.map +1 -1
  75. package/dist/node/pages/HubPages.js +1 -0
  76. package/dist/node/pages/HubPages.js.map +1 -1
  77. package/dist/node/pages/_internal/computeProps.js +3 -0
  78. package/dist/node/pages/_internal/computeProps.js.map +1 -1
  79. package/dist/node/projects/HubProject.js +16 -9
  80. package/dist/node/projects/HubProject.js.map +1 -1
  81. package/dist/node/projects/_internal/computeProps.js +4 -2
  82. package/dist/node/projects/_internal/computeProps.js.map +1 -1
  83. package/dist/node/projects/fetch.js +2 -0
  84. package/dist/node/projects/fetch.js.map +1 -1
  85. package/dist/node/resources/doesResourceExist.js +23 -0
  86. package/dist/node/resources/doesResourceExist.js.map +1 -0
  87. package/dist/node/resources/index.js +1 -0
  88. package/dist/node/resources/index.js.map +1 -1
  89. package/dist/node/resources/upsertResource.js +2 -10
  90. package/dist/node/resources/upsertResource.js.map +1 -1
  91. package/dist/node/search/_internal/hubSearchItemsHelpers/ogcItemToSearchResult.js +1 -16
  92. package/dist/node/search/_internal/hubSearchItemsHelpers/ogcItemToSearchResult.js.map +1 -1
  93. package/dist/node/sites/HubSites.js +1 -0
  94. package/dist/node/sites/HubSites.js.map +1 -1
  95. package/dist/node/sites/_internal/computeProps.js +3 -0
  96. package/dist/node/sites/_internal/computeProps.js.map +1 -1
  97. package/dist/node/templates/_internal/computeProps.js +10 -7
  98. package/dist/node/templates/_internal/computeProps.js.map +1 -1
  99. package/dist/node/templates/fetch.js +2 -0
  100. package/dist/node/templates/fetch.js.map +1 -1
  101. package/dist/types/content/_internal/computeProps.d.ts +0 -4
  102. package/dist/types/content/_internal/internalContentUtils.d.ts +16 -2
  103. package/dist/types/core/_internal/computeBaseProps.d.ts +9 -0
  104. package/dist/types/extent.d.ts +14 -0
  105. package/dist/types/resources/doesResourceExist.d.ts +10 -0
  106. package/dist/types/resources/index.d.ts +1 -0
  107. package/dist/types/search/types/IHubSearchResult.d.ts +4 -0
  108. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { IItem, IPortal } from "@esri/arcgis-rest-portal";
2
- import { ILayerDefinition, ISpatialReference, IUser } from "@esri/arcgis-rest-types";
3
- import { IHubContent, PublisherSource } from "../../core";
2
+ import { IExtent, ILayerDefinition, ISpatialReference, IUser } from "@esri/arcgis-rest-types";
3
+ import { IHubContent, IHubLocation, PublisherSource } from "../../core";
4
4
  import { IHubGeography, GeographyProvenance, IHubRequestOptions } from "../../types";
5
5
  import { IHubAdditionalResource } from "../../core/types/IHubAdditionalResource";
6
6
  import { IRequestOptions } from "@esri/arcgis-rest-request";
@@ -110,6 +110,20 @@ export declare const setContentBoundary: (content: IHubContent, boundary: Geogra
110
110
  * @private
111
111
  */
112
112
  export declare const getContentBoundary: (item: IItem) => IHubGeography;
113
+ /**
114
+ * Constructs IExtent from numeric item extent array
115
+ * @param extent Raw item extent array
116
+ * @returns IExtent
117
+ */
118
+ export declare const getExtentObject: (extent: number[][]) => IExtent;
119
+ /**
120
+ * Derives proper IHubLocation given an ArcGIS Item. If no
121
+ * location (item.properties.location) is present, one will be
122
+ * constructed from the item's extent.
123
+ * @param item ArcGIS Item
124
+ * @returns IHubLocation
125
+ */
126
+ export declare const deriveLocationFromItem: (item: IItem) => IHubLocation;
113
127
  /**
114
128
  * Determine if we are in an enterprise environment
115
129
  * NOTE: when no request options are provided, the underlying
@@ -0,0 +1,9 @@
1
+ import { IItem } from "@esri/arcgis-rest-types";
2
+ import { IHubItemEntity } from "../types";
3
+ /**
4
+ * Base property mapping for item backed entity types
5
+ * @param item IItem
6
+ * @param entity IHubItemEntity
7
+ * @returns
8
+ */
9
+ export declare function computeBaseProps<T extends Partial<IHubItemEntity>>(item: IItem, entity: T): T;
@@ -1,5 +1,6 @@
1
1
  import { IExtent, IPoint, IPolygon } from "@esri/arcgis-rest-types";
2
2
  import { IHubRequestOptions, BBox } from "./types";
3
+ import { Polygon } from "geojson";
3
4
  /**
4
5
  * Turns an bounding box coordinate array into an extent object
5
6
  * @param bBox bounding box coordinate array
@@ -54,3 +55,16 @@ export declare const extentToPolygon: (extent: IExtent) => IPolygon;
54
55
  * @returns
55
56
  */
56
57
  export declare const getExtentCenter: (extent: IExtent) => IPoint;
58
+ /**
59
+ * Checks coordinate or coordinate array to determine if all coordinates are
60
+ * possibly WGS84. This is a best effert attempt, not a guarantee.
61
+ * @param bboxOrCoordinates
62
+ * @returns
63
+ */
64
+ export declare const allCoordinatesPossiblyWGS84: (bboxOrCoordinates: number[][] | number[]) => boolean;
65
+ /**
66
+ * Turns a geojson polygon in to a bounding box coordinate array
67
+ * @param polygon
68
+ * @returns BBox
69
+ */
70
+ export declare const GeoJSONPolygonToBBox: (polygon: Partial<Polygon>) => BBox;
@@ -0,0 +1,10 @@
1
+ import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
2
+ /**
3
+ * Given an item ID, and a resource name, check if the resource exists
4
+ *
5
+ * @param id Item ID
6
+ * @param name Resource name
7
+ * @param ro Request options
8
+ * @returns boolean
9
+ */
10
+ export declare function doesResourceExist(id: string, name: string, ro: IUserRequestOptions): Promise<boolean>;
@@ -12,3 +12,4 @@ export * from "./object-to-json-blob";
12
12
  export * from "./validate-url";
13
13
  export * from "./upsertResource";
14
14
  export * from "./removeResource";
15
+ export * from "./doesResourceExist";
@@ -33,6 +33,10 @@ export interface IHubSearchResult extends IHubEntityBase {
33
33
  */
34
34
  typeKeywords?: string[];
35
35
  /**
36
+ * @deprecated geometry is being dropped and replaced
37
+ * with 'location' for all location specific information
38
+ * on a search result
39
+ *
36
40
  * Geometry connected to this entity
37
41
  * For items, it will default to the extent,
38
42
  * but may be derived from a boundary resource
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "14.80.1",
3
+ "version": "14.81.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",