@esri/hub-common 16.5.3 → 17.0.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 (156) hide show
  1. package/dist/esm/ArcGISContext.js +2 -2
  2. package/dist/esm/ArcGISContextManager.js +8 -8
  3. package/dist/esm/ArcGISContextManager.js.map +1 -1
  4. package/dist/esm/content/_internal/computeProps.js.map +1 -1
  5. package/dist/esm/content/_internal/internalContentUtils.js +1 -1
  6. package/dist/esm/content/_internal/internalContentUtils.js.map +1 -1
  7. package/dist/esm/content/compose.js +1 -1
  8. package/dist/esm/content/compose.js.map +1 -1
  9. package/dist/esm/content/contentUtils.js +1 -1
  10. package/dist/esm/content/contentUtils.js.map +1 -1
  11. package/dist/esm/content/edit.js +2 -2
  12. package/dist/esm/content/edit.js.map +1 -1
  13. package/dist/esm/content/fetchContent.js +1 -1
  14. package/dist/esm/content/fetchContent.js.map +1 -1
  15. package/dist/esm/core/_internal/computeItemLinks.js.map +1 -1
  16. package/dist/esm/core/_internal/getAuthedImageUrl.js.map +1 -1
  17. package/dist/esm/core/schemas/index.js +5 -0
  18. package/dist/esm/core/schemas/index.js.map +1 -1
  19. package/dist/esm/discussions/_internal/computeProps.js.map +1 -1
  20. package/dist/esm/extent.js +1 -1
  21. package/dist/esm/extent.js.map +1 -1
  22. package/dist/esm/groups/_internal/computeLinks.js.map +1 -1
  23. package/dist/esm/groups/_internal/computeProps.js.map +1 -1
  24. package/dist/esm/groups/_internal/enrichments.js +2 -2
  25. package/dist/esm/groups/_internal/enrichments.js.map +1 -1
  26. package/dist/esm/hub-types.js.map +1 -1
  27. package/dist/esm/initiative-templates/_internal/computeProps.js.map +1 -1
  28. package/dist/esm/initiatives/_internal/computeProps.js.map +1 -1
  29. package/dist/esm/items/_enrichments.js +2 -2
  30. package/dist/esm/items/_enrichments.js.map +1 -1
  31. package/dist/esm/items/is-services-directory-disabled.js +1 -1
  32. package/dist/esm/items/is-services-directory-disabled.js.map +1 -1
  33. package/dist/esm/metrics/resolveMetric.js +1 -1
  34. package/dist/esm/metrics/resolveMetric.js.map +1 -1
  35. package/dist/esm/org/fetch.js.map +1 -1
  36. package/dist/esm/pages/_internal/computeProps.js.map +1 -1
  37. package/dist/esm/projects/_internal/computeProps.js.map +1 -1
  38. package/dist/esm/search/hubSearch.js +1 -1
  39. package/dist/esm/search/hubSearch.js.map +1 -1
  40. package/dist/esm/search/utils.js +2 -2
  41. package/dist/esm/search/utils.js.map +1 -1
  42. package/dist/esm/search/wellKnownCatalog.js +161 -4
  43. package/dist/esm/search/wellKnownCatalog.js.map +1 -1
  44. package/dist/esm/sites/_internal/computeProps.js.map +1 -1
  45. package/dist/esm/surveys/_internal/computeProps.js.map +1 -1
  46. package/dist/esm/utils/internal/resolveServiceQueryValues.js +1 -1
  47. package/dist/esm/utils/internal/resolveServiceQueryValues.js.map +1 -1
  48. package/dist/esm/utils/internal/userAppResources.js +1 -1
  49. package/dist/esm/utils/internal/userAppResources.js.map +1 -1
  50. package/dist/node/ArcGISContext.js +2 -2
  51. package/dist/node/ArcGISContextManager.js +11 -11
  52. package/dist/node/ArcGISContextManager.js.map +1 -1
  53. package/dist/node/content/_internal/computeProps.js.map +1 -1
  54. package/dist/node/content/_internal/internalContentUtils.js +2 -2
  55. package/dist/node/content/_internal/internalContentUtils.js.map +1 -1
  56. package/dist/node/content/compose.js +2 -2
  57. package/dist/node/content/compose.js.map +1 -1
  58. package/dist/node/content/contentUtils.js +2 -2
  59. package/dist/node/content/contentUtils.js.map +1 -1
  60. package/dist/node/content/edit.js +4 -4
  61. package/dist/node/content/edit.js.map +1 -1
  62. package/dist/node/content/fetchContent.js +4 -4
  63. package/dist/node/content/fetchContent.js.map +1 -1
  64. package/dist/node/core/_internal/computeItemLinks.js.map +1 -1
  65. package/dist/node/core/_internal/getAuthedImageUrl.js.map +1 -1
  66. package/dist/node/core/schemas/index.js +5 -0
  67. package/dist/node/core/schemas/index.js.map +1 -1
  68. package/dist/node/discussions/_internal/computeProps.js.map +1 -1
  69. package/dist/node/extent.js +1 -1
  70. package/dist/node/extent.js.map +1 -1
  71. package/dist/node/groups/_internal/computeLinks.js.map +1 -1
  72. package/dist/node/groups/_internal/computeProps.js.map +1 -1
  73. package/dist/node/groups/_internal/enrichments.js +2 -2
  74. package/dist/node/groups/_internal/enrichments.js.map +1 -1
  75. package/dist/node/hub-types.js.map +1 -1
  76. package/dist/node/initiative-templates/_internal/computeProps.js.map +1 -1
  77. package/dist/node/initiatives/_internal/computeProps.js.map +1 -1
  78. package/dist/node/items/_enrichments.js +5 -5
  79. package/dist/node/items/_enrichments.js.map +1 -1
  80. package/dist/node/items/is-services-directory-disabled.js +2 -2
  81. package/dist/node/items/is-services-directory-disabled.js.map +1 -1
  82. package/dist/node/metrics/resolveMetric.js +2 -2
  83. package/dist/node/metrics/resolveMetric.js.map +1 -1
  84. package/dist/node/org/fetch.js.map +1 -1
  85. package/dist/node/pages/_internal/computeProps.js.map +1 -1
  86. package/dist/node/projects/_internal/computeProps.js.map +1 -1
  87. package/dist/node/search/hubSearch.js +1 -1
  88. package/dist/node/search/hubSearch.js.map +1 -1
  89. package/dist/node/search/utils.js +2 -2
  90. package/dist/node/search/utils.js.map +1 -1
  91. package/dist/node/search/wellKnownCatalog.js +162 -4
  92. package/dist/node/search/wellKnownCatalog.js.map +1 -1
  93. package/dist/node/sites/_internal/computeProps.js.map +1 -1
  94. package/dist/node/surveys/_internal/computeProps.js.map +1 -1
  95. package/dist/node/utils/internal/resolveServiceQueryValues.js +2 -2
  96. package/dist/node/utils/internal/resolveServiceQueryValues.js.map +1 -1
  97. package/dist/node/utils/internal/userAppResources.js +1 -1
  98. package/dist/node/utils/internal/userAppResources.js.map +1 -1
  99. package/dist/types/ArcGISContext.d.ts +4 -4
  100. package/dist/types/ArcGISContextManager.d.ts +6 -6
  101. package/dist/types/content/_internal/internalContentUtils.d.ts +3 -3
  102. package/dist/types/content/compose.d.ts +1 -1
  103. package/dist/types/content/contentUtils.d.ts +1 -1
  104. package/dist/types/content/edit.d.ts +1 -1
  105. package/dist/types/content/hostedServiceUtils.d.ts +1 -1
  106. package/dist/types/content/manageSchedule.d.ts +1 -1
  107. package/dist/types/core/schemas/index.d.ts +5 -0
  108. package/dist/types/core/schemas/internal/getLocationExtent.d.ts +1 -1
  109. package/dist/types/core/traits/IWithBannerImage.d.ts +1 -1
  110. package/dist/types/core/traits/IWithLayout.d.ts +1 -1
  111. package/dist/types/core/types/IHubContent.d.ts +1 -1
  112. package/dist/types/core/types/IHubEditableContent.d.ts +1 -1
  113. package/dist/types/core/types/IHubLocation.d.ts +1 -1
  114. package/dist/types/core/types/IHubSite.d.ts +1 -1
  115. package/dist/types/core/types/IServerEnrichments.d.ts +1 -1
  116. package/dist/types/core/types/Metrics.d.ts +2 -2
  117. package/dist/types/downloads/build-existing-exports-portal-query.d.ts +1 -1
  118. package/dist/types/extent.d.ts +2 -2
  119. package/dist/types/groups/HubGroups.d.ts +1 -1
  120. package/dist/types/groups/_internal/getUniqueGroupTitle.d.ts +1 -1
  121. package/dist/types/groups/addGroupMembers.d.ts +1 -1
  122. package/dist/types/groups/deleteGroupThumbnail.d.ts +1 -1
  123. package/dist/types/groups/setGroupThumbnail.d.ts +1 -1
  124. package/dist/types/hub-types.d.ts +8 -7
  125. package/dist/types/initiative-templates/edit.d.ts +1 -1
  126. package/dist/types/initiatives/HubInitiatives.d.ts +1 -1
  127. package/dist/types/items/_enrichments.d.ts +1 -1
  128. package/dist/types/items/_internal/_prepare-upload-requests.d.ts +1 -1
  129. package/dist/types/items/_internal/_wait-for-item-ready.d.ts +1 -1
  130. package/dist/types/items/create-item-from-file.d.ts +1 -1
  131. package/dist/types/items/create-item-from-url-or-file.d.ts +1 -1
  132. package/dist/types/items/create-item-from-url.d.ts +1 -1
  133. package/dist/types/items/deleteItemThumbnail.d.ts +1 -1
  134. package/dist/types/items/fail-safe-update.d.ts +1 -1
  135. package/dist/types/items/is-services-directory-disabled.d.ts +2 -2
  136. package/dist/types/items/setItemThumbnail.d.ts +1 -1
  137. package/dist/types/items/uploadImageResource.d.ts +1 -1
  138. package/dist/types/models/index.d.ts +1 -1
  139. package/dist/types/org/fetchOrgLimits.d.ts +1 -1
  140. package/dist/types/pages/HubPages.d.ts +1 -1
  141. package/dist/types/projects/edit.d.ts +1 -1
  142. package/dist/types/resources/_internal/_validate-url-helpers.d.ts +1 -1
  143. package/dist/types/resources/doesResourceExist.d.ts +1 -1
  144. package/dist/types/resources/fetch-and-upload-resource.d.ts +2 -2
  145. package/dist/types/resources/fetch-and-upload-thumbnail.d.ts +2 -2
  146. package/dist/types/resources/removeResource.d.ts +1 -1
  147. package/dist/types/resources/upsertResource.d.ts +1 -1
  148. package/dist/types/search/types/IHubSearchOptions.d.ts +2 -2
  149. package/dist/types/search/utils.d.ts +2 -2
  150. package/dist/types/search/wellKnownCatalog.d.ts +23 -5
  151. package/dist/types/surveys/edit.d.ts +1 -1
  152. package/dist/types/templates/edit.d.ts +1 -1
  153. package/dist/types/types/IArcGISContext.d.ts +3 -3
  154. package/dist/types/types/IArcGISContextManagerOptions.d.ts +6 -6
  155. package/dist/types/types/IArcGISContextOptions.d.ts +3 -3
  156. package/package.json +4 -7
@@ -1,8 +1,5 @@
1
- import type { IItem, IUser, IGroup } from "@esri/arcgis-rest-portal";
2
- import type { IPolygon, ISpatialReference, IGeometry } from "@esri/arcgis-rest-types";
3
- import { IPortal, ISearchResult } from "@esri/arcgis-rest-portal";
4
- import type { UserSession } from "@esri/arcgis-rest-auth";
5
- import { IRequestOptions } from "@esri/arcgis-rest-request";
1
+ import type { IGroup, IItem, IPortal, ISearchResult, IUser } from "@esri/arcgis-rest-portal";
2
+ import type { ArcGISIdentityManager, IGeometry, IPolygon, IRequestOptions, ISpatialReference } from "@esri/arcgis-rest-request";
6
3
  /**
7
4
  * App keys for User Resources used in Hub
8
5
  */
@@ -96,16 +93,20 @@ export interface IHubRequestOptionsPortalSelf extends IPortal {
96
93
  user?: IUser;
97
94
  }
98
95
  export interface IHubRequestOptions extends IRequestOptions {
99
- authentication?: UserSession;
96
+ authentication?: ArcGISIdentityManager;
100
97
  isPortal?: boolean;
101
98
  hubApiUrl?: string;
102
99
  portalSelf?: IHubRequestOptionsPortalSelf;
100
+ /**
101
+ * The implementation of `fetch` to use. Defaults to a global `fetch`.
102
+ */
103
+ fetch?: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
103
104
  }
104
105
  /**
105
106
  * Options for requests that require an authenticated user.
106
107
  */
107
108
  export interface IHubUserRequestOptions extends IHubRequestOptions {
108
- authentication: UserSession;
109
+ authentication: ArcGISIdentityManager;
109
110
  }
110
111
  export interface IHubTrustedOrgsResponse {
111
112
  from: IHubTrustedOrgsRelationship;
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import { IHubInitiativeTemplate } from "../core/types/IHubInitiativeTemplate";
3
3
  /**
4
4
  * @private
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import { IHubRequestOptions, IHubInitiativeEditor } from "../index";
3
3
  import { IQuery } from "../search/types/IHubCatalog";
4
4
  import { IItem } from "@esri/arcgis-rest-portal";
@@ -1,4 +1,4 @@
1
- import { IItem } from "@esri/arcgis-rest-portal";
1
+ import type { IItem } from "@esri/arcgis-rest-portal";
2
2
  import { IItemEnrichments, IServerEnrichments } from "../core";
3
3
  import { IEnrichmentErrorInfo, IHubRequestOptions } from "../hub-types";
4
4
  import { IHubSchedule } from "../core/types/IHubSchedule";
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import { IBatch } from "../../hub-types";
3
3
  /**
4
4
  * Takes a file, file owner, and file AGO item id along with a size limit
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  /**
3
3
  * Helper function which takes an itemId and checks the status
4
4
  * of the item every 2 seconds until it is either complete or failed.
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import { ICreateItemResponse } from "@esri/arcgis-rest-portal";
3
3
  import type { IItemAdd } from "@esri/arcgis-rest-portal";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import { ICreateItemResponse, ISharingResponse } from "@esri/arcgis-rest-portal";
3
3
  import type { IGroup, IItemAdd } from "@esri/arcgis-rest-portal";
4
4
  interface ICreateItemFromUrlOrFileOptions extends IUserRequestOptions {
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import { ICreateItemResponse } from "@esri/arcgis-rest-portal";
3
3
  import type { IItemAdd } from "@esri/arcgis-rest-portal";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  /**
3
3
  * Delete an item's thumbnail
4
4
  * @param id
@@ -1,5 +1,5 @@
1
1
  import { IModel } from "../hub-types";
2
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
2
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
3
3
  /**
4
4
  * Update a model's item, wrapped in a failSafe so this will not blow up if
5
5
  * the user lacks rights somehow. This should be used in places where there is
@@ -1,4 +1,4 @@
1
- import { IRequestOptions } from "@esri/arcgis-rest-request";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import type { IItem } from "@esri/arcgis-rest-portal";
3
3
  /**
4
4
  * Checks if a server's services directory is disabled. Consider hoisting this to RESTJS
@@ -6,4 +6,4 @@ import type { IItem } from "@esri/arcgis-rest-portal";
6
6
  * @param requestOptions Request options
7
7
  * @returns Promise that resolves boolean
8
8
  */
9
- export declare const isServicesDirectoryDisabled: (idOrItem: string | IItem, requestOptions: IRequestOptions) => Promise<boolean>;
9
+ export declare const isServicesDirectoryDisabled: (idOrItem: string | IItem, requestOptions: IUserRequestOptions) => Promise<boolean>;
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  /**
3
3
  * Upload a file to be used as the thumbnail for an item
4
4
  * @param id
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  /**
3
3
  * Given an item, and owner, add a image resource to the item and returns its url
4
4
  * @param id
@@ -1,5 +1,5 @@
1
1
  export * from "./serializeModel";
2
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
2
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
3
3
  import { IItem } from "@esri/arcgis-rest-portal";
4
4
  import { IRequestOptions } from "@esri/arcgis-rest-request";
5
5
  import { IModel } from "../hub-types";
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  export declare type OrgLimitType = "ScheduleTask" | "Collaboration" | "Community" | "Groups" | "Content";
3
3
  /**
4
4
  * Definiton of the org limits response.
@@ -3,7 +3,7 @@ import { IHubRequestOptions, IModel } from "../hub-types";
3
3
  import { IRequestOptions } from "@esri/arcgis-rest-request";
4
4
  import { IItem } from "@esri/arcgis-rest-portal";
5
5
  import { IHubPage } from "../core";
6
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
6
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
7
7
  import { IFetchItemOptions } from "../items/fetch";
8
8
  /**
9
9
  * @private
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import { IPortal } from "@esri/arcgis-rest-portal";
3
3
  import { IHubProject, IHubProjectEditor } from "../core/types";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import type { IExtent, IFeatureServiceDefinition, ILayerDefinition } from "@esri/arcgis-rest-feature-layer";
1
+ import type { IExtent, IFeatureServiceDefinition, ILayerDefinition } from "@esri/arcgis-rest-feature-service";
2
2
  import { ItemType } from "../../hub-types";
3
3
  /**
4
4
  * Feature service / Doc Links Should not have data urls. Let"s exclude them from that.
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  /**
3
3
  * Given an item ID, and a resource name, check if the resource exists
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { IItemResourceResponse } from "@esri/arcgis-rest-portal";
2
- import type { UserSession } from "@esri/arcgis-rest-auth";
2
+ import type { ArcGISIdentityManager } from "@esri/arcgis-rest-request";
3
3
  /**
4
4
  * Fetch image from a url, and upload as a resource
5
5
  * @param {Object} options {id, owner, fileName, url, authentication}
@@ -9,5 +9,5 @@ export declare function fetchAndUploadResource(options: {
9
9
  owner: string;
10
10
  fileName: string;
11
11
  url: string;
12
- authentication: UserSession;
12
+ authentication: ArcGISIdentityManager;
13
13
  }): Promise<IItemResourceResponse>;
@@ -1,4 +1,4 @@
1
- import type { UserSession } from "@esri/arcgis-rest-auth";
1
+ import type { ArcGISIdentityManager } from "@esri/arcgis-rest-request";
2
2
  /**
3
3
  * Fetch image from a url, then upload to an item as it's thumbnail
4
4
  * @param {object} options
@@ -8,5 +8,5 @@ export declare function fetchAndUploadThumbnail(options: {
8
8
  owner: string;
9
9
  fileName: string;
10
10
  url: string;
11
- authentication: UserSession;
11
+ authentication: ArcGISIdentityManager;
12
12
  }): Promise<any>;
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  /**
3
3
  * Removes a resource associated with an item
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  /**
3
3
  * Given an item, and owner, Search for if the resource exists
4
4
  * and if does, update it, otherwise add it. Returns a url for the item.
@@ -1,4 +1,4 @@
1
- import type { UserSession } from "@esri/arcgis-rest-auth";
1
+ import type { ArcGISIdentityManager } from "@esri/arcgis-rest-request";
2
2
  import { IHubRequestOptions } from "../../hub-types";
3
3
  import { EntityType } from "./IHubCatalog";
4
4
  import { NamedApis, IApiDefinition } from "./types";
@@ -58,7 +58,7 @@ export interface IHubSearchOptions extends IPagingOptions, ISortOptions {
58
58
  /**
59
59
  * DEPRECATE in favor of requestOptions
60
60
  */
61
- authentication?: UserSession;
61
+ authentication?: ArcGISIdentityManager;
62
62
  /**
63
63
  * While hubSearch requires requestOptions, it is not marked
64
64
  * required because that is a breaking change to this
@@ -1,4 +1,4 @@
1
- import { IUser, UserSession } from "@esri/arcgis-rest-auth";
1
+ import { IUser, ArcGISIdentityManager } from "@esri/arcgis-rest-request";
2
2
  import { IGroup, ISearchGroupUsersOptions, ISearchOptions, SearchQueryBuilder } from "@esri/arcgis-rest-portal";
3
3
  import { IHubSite } from "../core";
4
4
  import { ISearchResponse } from "../hub-types";
@@ -50,7 +50,7 @@ export declare function relativeDateToDateRange(relative: IRelativeDate): IDateR
50
50
  * @param fn
51
51
  * @returns
52
52
  */
53
- export declare function getNextFunction<T>(request: ISearchOptions | ISearchGroupUsersOptions, nextStart: number, total: number, fn: (r: any) => Promise<ISearchResponse<T>>): (authentication?: UserSession) => Promise<ISearchResponse<T>>;
53
+ export declare function getNextFunction<T>(request: ISearchOptions | ISearchGroupUsersOptions, nextStart: number, total: number, fn: (r: any) => Promise<ISearchResponse<T>>): (authentication?: ArcGISIdentityManager) => Promise<ISearchResponse<T>>;
54
54
  /**
55
55
  * Construct a the full url to a group thumbnail
56
56
  *
@@ -2,11 +2,17 @@ import type { IUser } from "@esri/arcgis-rest-portal";
2
2
  import { HubFamily } from "../hub-types";
3
3
  import { EntityType, IFilter, IHubCatalog, IHubCollection } from "./types";
4
4
  import type { IArcGISContext } from "../types/IArcGISContext";
5
- /**
6
- * This is used to determine what IHubCatalog definition JSON object
7
- * can be created
8
- */
9
- export declare type WellKnownCatalog = "myContent" | "favorites" | "organization" | "world" | "editGroups" | "viewGroups" | "allGroups" | "partners" | "community" | "livingAtlas";
5
+ /** well-known item catalogs */
6
+ export declare const WELL_KNOWN_ITEM_CATALOGS: readonly ["myContent", "favorites", "organization", "world", "partners", "community", "livingAtlas"];
7
+ export declare type WellKnownItemCatalog = (typeof WELL_KNOWN_ITEM_CATALOGS)[number];
8
+ /** well-known group catalogs */
9
+ export declare const WELL_KNOWN_GROUP_CATALOGS: readonly ["editGroups", "viewGroups", "allGroups", "myGroups", "orgGroups", "communityGroups", "publicGroups"];
10
+ export declare type WellKnownGroupCatalog = (typeof WELL_KNOWN_GROUP_CATALOGS)[number];
11
+ /** well-known event catalogs */
12
+ export declare const WELL_KNOWN_EVENT_CATALOGS: readonly ["myEvents", "orgEvents", "worldEvents"];
13
+ export declare type WellKnownEventCatalog = (typeof WELL_KNOWN_EVENT_CATALOGS)[number];
14
+ /** well known catalogs */
15
+ export declare type WellKnownCatalog = WellKnownItemCatalog | WellKnownGroupCatalog | WellKnownEventCatalog;
10
16
  /**
11
17
  * This is used to determine what IHubCollection definition JSON object
12
18
  * can be created. We use HubFamily here to define most of the collections
@@ -38,6 +44,18 @@ export interface IGetWellKnownCatalogOptions {
38
44
  * @returns i18nScope with a "." at the end if it is defined
39
45
  */
40
46
  export declare function dotifyString(i18nScope: string): string;
47
+ /**
48
+ * Helper function to build an array of well-known Catalogs
49
+ * note: requested well-known Catalogs must be for the same
50
+ * targetEntity type
51
+ *
52
+ * @param i18nScope Translation scope to be interpolated into the catalog
53
+ * @param targetEntity The type of entity to query for
54
+ * @param catalogNames Names of the catalogs requested
55
+ * @param context contextual portal & auth information
56
+ * @param opts optional IGetWellKnownCatalogOptions args
57
+ */
58
+ export declare function getWellKnownCatalogs(i18nScope: string, targetEntity: EntityType, catalogNames: WellKnownCatalog[], context: IArcGISContext, opts?: Exclude<IGetWellKnownCatalogOptions, "context" | "user">): IHubCatalog[];
41
59
  /** Get a single catalog based on the catalog name, entity type and optional requests
42
60
  * @param i18nScope Translation scope to be interpolated into the catalog
43
61
  * @param name Name of the catalog requested
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import { IHubSurvey } from "../core/types/IHubSurvey";
3
3
  /**
4
4
  * @private
@@ -1,4 +1,4 @@
1
- import type { IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import type { IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import { IHubTemplate, IHubTemplateEditor } from "../core/types/IHubTemplate";
3
3
  import { IPortal } from "@esri/arcgis-rest-portal";
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { UserSession, IUserRequestOptions } from "@esri/arcgis-rest-auth";
1
+ import { ArcGISIdentityManager, IUserRequestOptions } from "@esri/arcgis-rest-request";
2
2
  import type { IPortal } from "@esri/arcgis-rest-portal";
3
3
  import type { IRequestOptions } from "@esri/arcgis-rest-request";
4
4
  import type { IUser } from "@esri/arcgis-rest-portal";
@@ -26,9 +26,9 @@ export interface IArcGISContext {
26
26
  */
27
27
  id: number;
28
28
  /**
29
- * Return the UserSession if authenticated
29
+ * Return the ArcGISIdentityManager if authenticated
30
30
  */
31
- session: UserSession;
31
+ session: ArcGISIdentityManager;
32
32
  /**
33
33
  * Return boolean indicating if authenticatio is present
34
34
  */
@@ -1,4 +1,4 @@
1
- import type { UserSession } from "@esri/arcgis-rest-auth";
1
+ import type { ArcGISIdentityManager } from "@esri/arcgis-rest-request";
2
2
  import { IPortal } from "@esri/arcgis-rest-portal";
3
3
  import type { IUser } from "@esri/arcgis-rest-portal";
4
4
  import { IUserResourceToken } from "./IUserResourceToken";
@@ -13,9 +13,9 @@ import { IUserHubSettings } from "../utils/IUserHubSettings";
13
13
  export interface IArcGISContextManagerOptions {
14
14
  /**
15
15
  * Existing user session, which may be created from Identity Manager
16
- * `const session = UserSession.fromCredential(idMgr.getCredential());`
16
+ * `const session = ArcGISIdentityManager.fromCredential(idMgr.getCredential());`
17
17
  */
18
- authentication?: UserSession;
18
+ authentication?: ArcGISIdentityManager;
19
19
  /**
20
20
  * ArcGIS Online or ArcGIS Enterprise portal url.
21
21
  * Do not include `/sharing/rest`
@@ -23,17 +23,17 @@ export interface IArcGISContextManagerOptions {
23
23
  * For ArcGIS Enterprise, you must include the webadaptor name.
24
24
  * i.e. https://gis.mytown.gov/portal
25
25
  *
26
- * When Authentication is present, the UserSession.portal value is
26
+ * When Authentication is present, the ArcGISIdentityManager.portal value is
27
27
  * used instead of this property.
28
28
  */
29
29
  portalUrl?: string;
30
30
  /**
31
31
  * Portal self for the authenticated user. If not passed into `.create`
32
- * with the UserSession, it will be fetched
32
+ * with the ArcGISIdentityManager, it will be fetched
33
33
  */
34
34
  portal?: IPortal;
35
35
  /**
36
- * Current user as `IUser`. If not passed into `.create` with the UserSession
36
+ * Current user as `IUser`. If not passed into `.create` with the ArcGISIdentityManager
37
37
  * it will be fetched.
38
38
  */
39
39
  currentUser?: IUser;
@@ -1,4 +1,4 @@
1
- import type { UserSession } from "@esri/arcgis-rest-auth";
1
+ import type { ArcGISIdentityManager } from "@esri/arcgis-rest-request";
2
2
  import type { IPortal } from "@esri/arcgis-rest-portal";
3
3
  import type { IUser } from "@esri/arcgis-rest-portal";
4
4
  import type { IUserResourceToken } from "./IUserResourceToken";
@@ -28,9 +28,9 @@ export interface IArcGISContextOptions {
28
28
  */
29
29
  hubUrl?: string;
30
30
  /**
31
- * The current UserSession
31
+ * The current ArcGISIdentityManager
32
32
  */
33
- authentication?: UserSession;
33
+ authentication?: ArcGISIdentityManager;
34
34
  /**
35
35
  * If the user is authenticated, the portal should be passed in
36
36
  * so various getters can work as expected.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "16.5.3",
3
+ "version": "17.0.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",
@@ -22,12 +22,9 @@
22
22
  "tslib": "^1.13.0"
23
23
  },
24
24
  "peerDependencies": {
25
- "@esri/arcgis-rest-auth": "^2.14.0 || 3",
26
- "@esri/arcgis-rest-feature-layer": "^3.2.0",
27
- "@esri/arcgis-rest-portal": "^2.18.0 || 3",
28
- "@esri/arcgis-rest-request": "^2.14.0 || 3",
29
- "@esri/arcgis-rest-service-admin": "^3.6.0",
30
- "@esri/arcgis-rest-types": "^2.15.0 || 3"
25
+ "@esri/arcgis-rest-feature-service": "~4.0.5",
26
+ "@esri/arcgis-rest-portal": "~4.4.0",
27
+ "@esri/arcgis-rest-request": "~4.2.3"
31
28
  },
32
29
  "devDependencies": {
33
30
  "@types/adlib": "^3.0.1",