@esri/hub-common 12.33.0 → 13.0.0-next.1

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 (104) hide show
  1. package/dist/esm/items/index.js +4 -1
  2. package/dist/esm/items/index.js.map +1 -1
  3. package/dist/esm/items/registerBrowserApp.js +2 -0
  4. package/dist/esm/items/registerBrowserApp.js.map +1 -1
  5. package/dist/esm/projects/edit.js +0 -16
  6. package/dist/esm/projects/edit.js.map +1 -1
  7. package/dist/esm/search/Catalog.js +0 -1
  8. package/dist/esm/search/Catalog.js.map +1 -1
  9. package/dist/esm/search/_internal/commonHelpers/getApi.js +4 -12
  10. package/dist/esm/search/_internal/commonHelpers/getApi.js.map +1 -1
  11. package/dist/esm/search/_internal/expandPredicate.js +1 -1
  12. package/dist/esm/search/_internal/expandPredicate.js.map +1 -1
  13. package/dist/esm/search/_internal/hubSearchItems.js +3 -3
  14. package/dist/esm/search/_internal/hubSearchItems.js.map +1 -1
  15. package/dist/esm/search/_internal/hubSearchItemsHelpers/formatOgcItemsResponse.js +2 -2
  16. package/dist/esm/search/_internal/hubSearchItemsHelpers/formatOgcItemsResponse.js.map +1 -1
  17. package/dist/esm/search/_internal/hubSearchItemsHelpers/getNextOgcCallback.js +2 -2
  18. package/dist/esm/search/_internal/hubSearchItemsHelpers/getNextOgcCallback.js.map +1 -1
  19. package/dist/esm/search/_internal/hubSearchItemsHelpers/getOgcCollectionUrl.js +3 -4
  20. package/dist/esm/search/_internal/hubSearchItemsHelpers/getOgcCollectionUrl.js.map +1 -1
  21. package/dist/esm/search/_internal/hubSearchItemsHelpers/searchOgcAggregations.js +2 -2
  22. package/dist/esm/search/_internal/hubSearchItemsHelpers/searchOgcAggregations.js.map +1 -1
  23. package/dist/esm/search/_internal/hubSearchItemsHelpers/searchOgcItems.js +3 -3
  24. package/dist/esm/search/_internal/hubSearchItemsHelpers/searchOgcItems.js.map +1 -1
  25. package/dist/esm/search/_internal/portalSearchGroups.js +1 -1
  26. package/dist/esm/search/_internal/portalSearchGroups.js.map +1 -1
  27. package/dist/esm/search/_internal/portalSearchItems.js +1 -1
  28. package/dist/esm/search/_internal/portalSearchItems.js.map +1 -1
  29. package/dist/esm/search/_internal/portalSearchUsers.js +1 -1
  30. package/dist/esm/search/_internal/portalSearchUsers.js.map +1 -1
  31. package/dist/esm/search/_internal/utils.js +95 -0
  32. package/dist/esm/search/_internal/utils.js.map +1 -0
  33. package/dist/esm/search/hubSearch.js +4 -12
  34. package/dist/esm/search/hubSearch.js.map +1 -1
  35. package/dist/esm/search/utils.js +0 -156
  36. package/dist/esm/search/utils.js.map +1 -1
  37. package/dist/esm/sites/HubSites.js +5 -21
  38. package/dist/esm/sites/HubSites.js.map +1 -1
  39. package/dist/esm/sites/index.js +3 -1
  40. package/dist/esm/sites/index.js.map +1 -1
  41. package/dist/esm/sites/registerSiteAsApplication.js +2 -0
  42. package/dist/esm/sites/registerSiteAsApplication.js.map +1 -1
  43. package/dist/node/items/index.js +4 -1
  44. package/dist/node/items/index.js.map +1 -1
  45. package/dist/node/items/registerBrowserApp.js +2 -0
  46. package/dist/node/items/registerBrowserApp.js.map +1 -1
  47. package/dist/node/projects/edit.js +1 -18
  48. package/dist/node/projects/edit.js.map +1 -1
  49. package/dist/node/search/Catalog.js +0 -1
  50. package/dist/node/search/Catalog.js.map +1 -1
  51. package/dist/node/search/_internal/commonHelpers/getApi.js +4 -12
  52. package/dist/node/search/_internal/commonHelpers/getApi.js.map +1 -1
  53. package/dist/node/search/_internal/expandPredicate.js +1 -1
  54. package/dist/node/search/_internal/expandPredicate.js.map +1 -1
  55. package/dist/node/search/_internal/hubSearchItems.js +3 -3
  56. package/dist/node/search/_internal/hubSearchItems.js.map +1 -1
  57. package/dist/node/search/_internal/hubSearchItemsHelpers/formatOgcItemsResponse.js +2 -2
  58. package/dist/node/search/_internal/hubSearchItemsHelpers/formatOgcItemsResponse.js.map +1 -1
  59. package/dist/node/search/_internal/hubSearchItemsHelpers/getNextOgcCallback.js +2 -2
  60. package/dist/node/search/_internal/hubSearchItemsHelpers/getNextOgcCallback.js.map +1 -1
  61. package/dist/node/search/_internal/hubSearchItemsHelpers/getOgcCollectionUrl.js +3 -4
  62. package/dist/node/search/_internal/hubSearchItemsHelpers/getOgcCollectionUrl.js.map +1 -1
  63. package/dist/node/search/_internal/hubSearchItemsHelpers/searchOgcAggregations.js +2 -2
  64. package/dist/node/search/_internal/hubSearchItemsHelpers/searchOgcAggregations.js.map +1 -1
  65. package/dist/node/search/_internal/hubSearchItemsHelpers/searchOgcItems.js +3 -3
  66. package/dist/node/search/_internal/hubSearchItemsHelpers/searchOgcItems.js.map +1 -1
  67. package/dist/node/search/_internal/portalSearchGroups.js +1 -1
  68. package/dist/node/search/_internal/portalSearchGroups.js.map +1 -1
  69. package/dist/node/search/_internal/portalSearchItems.js +1 -1
  70. package/dist/node/search/_internal/portalSearchItems.js.map +1 -1
  71. package/dist/node/search/_internal/portalSearchUsers.js +1 -1
  72. package/dist/node/search/_internal/portalSearchUsers.js.map +1 -1
  73. package/dist/node/search/_internal/utils.js +101 -0
  74. package/dist/node/search/_internal/utils.js.map +1 -0
  75. package/dist/node/search/hubSearch.js +4 -12
  76. package/dist/node/search/hubSearch.js.map +1 -1
  77. package/dist/node/search/utils.js +1 -162
  78. package/dist/node/search/utils.js.map +1 -1
  79. package/dist/node/sites/HubSites.js +6 -23
  80. package/dist/node/sites/HubSites.js.map +1 -1
  81. package/dist/node/sites/index.js +3 -1
  82. package/dist/node/sites/index.js.map +1 -1
  83. package/dist/node/sites/registerSiteAsApplication.js +2 -0
  84. package/dist/node/sites/registerSiteAsApplication.js.map +1 -1
  85. package/dist/types/core/behaviors/IWithEditorBehavior.d.ts +0 -6
  86. package/dist/types/core/types/IHubLocation.d.ts +0 -5
  87. package/dist/types/items/index.d.ts +0 -1
  88. package/dist/types/items/registerBrowserApp.d.ts +2 -0
  89. package/dist/types/projects/edit.d.ts +0 -13
  90. package/dist/types/search/_internal/commonHelpers/getApi.d.ts +1 -2
  91. package/dist/types/search/_internal/hubSearchItems.d.ts +2 -2
  92. package/dist/types/search/_internal/hubSearchItemsHelpers/formatOgcItemsResponse.d.ts +2 -1
  93. package/dist/types/search/_internal/hubSearchItemsHelpers/getNextOgcCallback.d.ts +2 -1
  94. package/dist/types/search/_internal/hubSearchItemsHelpers/getOgcCollectionUrl.d.ts +3 -3
  95. package/dist/types/search/_internal/hubSearchItemsHelpers/searchOgcAggregations.d.ts +2 -1
  96. package/dist/types/search/_internal/hubSearchItemsHelpers/searchOgcItems.d.ts +2 -1
  97. package/dist/types/search/_internal/utils.d.ts +28 -0
  98. package/dist/types/search/types/IHubSearchOptions.d.ts +0 -12
  99. package/dist/types/search/utils.d.ts +2 -48
  100. package/dist/types/sites/HubSites.d.ts +0 -12
  101. package/dist/types/sites/index.d.ts +0 -1
  102. package/dist/types/sites/registerSiteAsApplication.d.ts +2 -0
  103. package/dist/types/types.d.ts +1 -1
  104. package/package.json +1 -1
@@ -16,7 +16,6 @@ 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";
20
19
  export * from "./create-item-from-file";
21
20
  export * from "./create-item-from-url";
22
21
  export * from "./create-item-from-url-or-file";
@@ -1,5 +1,7 @@
1
1
  import { IRequestOptions } from "@esri/arcgis-rest-request";
2
2
  /**
3
+ * @private
4
+ * @internal
3
5
  * Register an Item as an application, enabling oAuth flows at custom
4
6
  * domains. Only item types with "Application" in the name are valid
5
7
  * with this API call.
@@ -1,7 +1,5 @@
1
1
  import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
2
2
  import { IHubProject } from "../core/types";
3
- import { UiSchemaElementOptions } from "../core/schemas";
4
- import { EditorConfigType, IEditorConfig } from "../core/behaviors/IWithEditorBehavior";
5
3
  /**
6
4
  * @private
7
5
  * Create a new Hub Project item
@@ -26,14 +24,3 @@ export declare function updateProject(project: IHubProject, requestOptions: IUse
26
24
  * @param requestOptions
27
25
  */
28
26
  export declare function deleteProject(id: string, requestOptions: IUserRequestOptions): Promise<void>;
29
- /**
30
- * DEPRECATED: the following will be removed at next breaking version
31
- * use the getEntityEditorSchemas function instead (which this function
32
- * has already been refactored to consume)
33
- *
34
- * Get the editor config for for the HubProject entity.
35
- * @param i18nScope translation scope to be interpolated into the uiSchema
36
- * @param type editor type - corresonds to the returned uiSchema
37
- * @param options optional hash of dynamic uiSchema element options
38
- */
39
- export declare function getHubProjectEditorConfig(i18nScope: string, type: EditorConfigType, options?: UiSchemaElementOptions[]): Promise<IEditorConfig>;
@@ -5,8 +5,7 @@ import { IApiDefinition } from "../../types/types";
5
5
  * @private
6
6
  * Determines Which API should be hit for the given search parameters.
7
7
  * Hierarchy:
8
- * - Target options.api if available
9
- * - Target the OGC API current parameters allow
8
+ * - Target the OGC API if current parameters allow
10
9
  * - Target the Portal API based off options.requestOptions.portal
11
10
  * @param targetEntity target entity of the query
12
11
  * @param options search options
@@ -1,4 +1,4 @@
1
- import { IHubSearchOptions, IHubSearchResponse, IHubSearchResult, IQuery } from "../types";
1
+ import { IApiDefinition, IHubSearchOptions, IHubSearchResponse, IHubSearchResult, IQuery } from "../types";
2
2
  /**
3
3
  * @private
4
4
  * Execute item search against the Hub API
@@ -6,4 +6,4 @@ import { IHubSearchOptions, IHubSearchResponse, IHubSearchResult, IQuery } from
6
6
  * @param options
7
7
  * @returns
8
8
  */
9
- export declare function hubSearchItems(query: IQuery, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
9
+ export declare function hubSearchItems(query: IQuery, options: IHubSearchOptions, api: IApiDefinition): Promise<IHubSearchResponse<IHubSearchResult>>;
@@ -1,6 +1,7 @@
1
+ import { IApiDefinition } from "../../types";
1
2
  import { IQuery } from "../../types/IHubCatalog";
2
3
  import { IHubSearchOptions } from "../../types/IHubSearchOptions";
3
4
  import { IHubSearchResponse } from "../../types/IHubSearchResponse";
4
5
  import { IHubSearchResult } from "../../types/IHubSearchResult";
5
6
  import { IOgcItemsResponse } from "./interfaces";
6
- export declare function formatOgcItemsResponse(response: IOgcItemsResponse, originalQuery: IQuery, originalOptions: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
7
+ export declare function formatOgcItemsResponse(response: IOgcItemsResponse, originalQuery: IQuery, originalOptions: IHubSearchOptions, api: IApiDefinition): Promise<IHubSearchResponse<IHubSearchResult>>;
@@ -1,6 +1,7 @@
1
+ import { IApiDefinition } from "../../types";
1
2
  import { IQuery } from "../../types/IHubCatalog";
2
3
  import { IHubSearchOptions } from "../../types/IHubSearchOptions";
3
4
  import { IHubSearchResponse } from "../../types/IHubSearchResponse";
4
5
  import { IHubSearchResult } from "../../types/IHubSearchResult";
5
6
  import { IOgcItemsResponse } from "./interfaces";
6
- export declare function getNextOgcCallback(response: IOgcItemsResponse, originalQuery: IQuery, originalOptions: IHubSearchOptions): (params?: any) => Promise<IHubSearchResponse<IHubSearchResult>>;
7
+ export declare function getNextOgcCallback(response: IOgcItemsResponse, originalQuery: IQuery, originalOptions: IHubSearchOptions, api: IApiDefinition): (params?: any) => Promise<IHubSearchResponse<IHubSearchResult>>;
@@ -1,5 +1,5 @@
1
1
  import { IQuery } from "../../types/IHubCatalog";
2
- import { IHubSearchOptions } from "../../types/IHubSearchOptions";
2
+ import { IApiDefinition } from "../../types/types";
3
3
  /**
4
4
  * @private
5
5
  *
@@ -8,7 +8,7 @@ import { IHubSearchOptions } from "../../types/IHubSearchOptions";
8
8
  * the all collection is targeted.
9
9
  *
10
10
  * @param query the query the request is based on
11
- * @param options request options, including the base OGC api url
11
+ * @param api definition object for the OGC API to be targeted
12
12
  * @returns the collection url
13
13
  */
14
- export declare function getOgcCollectionUrl(query: IQuery, options: IHubSearchOptions): string;
14
+ export declare function getOgcCollectionUrl(query: IQuery, api: IApiDefinition): string;
@@ -1,5 +1,6 @@
1
+ import { IApiDefinition } from "../../types";
1
2
  import { IQuery } from "../../types/IHubCatalog";
2
3
  import { IHubSearchOptions } from "../../types/IHubSearchOptions";
3
4
  import { IHubSearchResponse } from "../../types/IHubSearchResponse";
4
5
  import { IHubSearchResult } from "../../types/IHubSearchResult";
5
- export declare function searchOgcAggregations(query: IQuery, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
6
+ export declare function searchOgcAggregations(query: IQuery, options: IHubSearchOptions, api: IApiDefinition): Promise<IHubSearchResponse<IHubSearchResult>>;
@@ -1,5 +1,6 @@
1
+ import { IApiDefinition } from "../../types";
1
2
  import { IQuery } from "../../types/IHubCatalog";
2
3
  import { IHubSearchOptions } from "../../types/IHubSearchOptions";
3
4
  import { IHubSearchResponse } from "../../types/IHubSearchResponse";
4
5
  import { IHubSearchResult } from "../../types/IHubSearchResult";
5
- export declare function searchOgcItems(query: IQuery, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
6
+ export declare function searchOgcItems(query: IQuery, options: IHubSearchOptions, api: IApiDefinition): Promise<IHubSearchResponse<IHubSearchResult>>;
@@ -0,0 +1,28 @@
1
+ import { UserSession } from "@esri/arcgis-rest-auth";
2
+ import { ISearchOptions } from "@esri/arcgis-rest-portal";
3
+ import { ISearchResponse } from "../../types";
4
+ import { IMatchOptions, IDateRange, IRelativeDate } from "../types/types";
5
+ /**
6
+ * @private
7
+ * Convert a field value into a MatchOptions if it's not already one
8
+ * @param value
9
+ * @returns
10
+ */
11
+ export declare function valueToMatchOptions(value: string | string[] | IMatchOptions): IMatchOptions;
12
+ /**
13
+ * @private
14
+ * Convert a RelativeDate to a DateRange<number>
15
+ * @param relative
16
+ * @returns
17
+ */
18
+ export declare function relativeDateToDateRange(relative: IRelativeDate): IDateRange<number>;
19
+ /**
20
+ * @private
21
+ * Create a `.next()` function for a type
22
+ * @param request
23
+ * @param nextStart
24
+ * @param total
25
+ * @param fn
26
+ * @returns
27
+ */
28
+ export declare function getNextFunction<T>(request: ISearchOptions, nextStart: number, total: number, fn: (r: any) => Promise<ISearchResponse<T>>): (authentication?: UserSession) => Promise<ISearchResponse<T>>;
@@ -1,8 +1,5 @@
1
- import { UserSession } from "@esri/arcgis-rest-auth";
2
1
  import { IHubRequestOptions } from "../../types";
3
2
  import { EntityType } from "./IHubCatalog";
4
- import { NamedApis, IApiDefinition } from "./types";
5
- export declare type Enrichments = "data" | "metadata" | "org" | "service" | "layers";
6
3
  /**
7
4
  * Search Options
8
5
  */
@@ -16,20 +13,11 @@ export interface IHubSearchOptions {
16
13
  * Portal API only supports a single value
17
14
  */
18
15
  aggLimit?: number;
19
- /**
20
- * TODO: Deprecate in favor of `requestOptions` and `siteUrl`
21
- * Specify API to call. Defaults to ArcGIS Online Portal API
22
- */
23
- api?: NamedApis | IApiDefinition;
24
16
  /**
25
17
  * Site whose API should be targeted. Ignored in an enterprise context.
26
18
  * e.g., https://my-site.hub.arcgis.com
27
19
  */
28
20
  site?: string;
29
- /**
30
- * DEPRECATE in favor of requestOptions
31
- */
32
- authentication?: UserSession;
33
21
  /**
34
22
  * While hubSearch requires requestOptions, it is not marked
35
23
  * required because that is a breaking change to this
@@ -1,51 +1,5 @@
1
- import { IUser, UserSession } from "@esri/arcgis-rest-auth";
2
- import { IGroup, ISearchOptions } from "@esri/arcgis-rest-portal";
3
- import { ISearchResponse } from "../types";
4
- import { IMatchOptions, IDateRange, IRelativeDate, IWellKnownApis, IApiDefinition, NamedApis } from "./types/types";
5
- /**
6
- * Well known APIs
7
- * Short-forms for specifying common APIs
8
- * We will likely deprecate this
9
- */
10
- export declare const SEARCH_APIS: IWellKnownApis;
11
- /**
12
- * @private
13
- * Convert array of api "names" into full ApiDefinitions
14
- * @param apis
15
- * @returns
16
- */
17
- export declare function expandApis(apis: Array<NamedApis | IApiDefinition>): IApiDefinition[];
18
- /**
19
- * @private
20
- * Convert an api "name" into a full ApiDefinition
21
- * @param api
22
- * @returns
23
- */
24
- export declare function expandApi(api: NamedApis | IApiDefinition): IApiDefinition;
25
- /**
26
- * @private
27
- * Convert a field value into a MatchOptions if it's not already one
28
- * @param value
29
- * @returns
30
- */
31
- export declare function valueToMatchOptions(value: string | string[] | IMatchOptions): IMatchOptions;
32
- /**
33
- * @private
34
- * Convert a RelativeDate to a DateRange<number>
35
- * @param relative
36
- * @returns
37
- */
38
- export declare function relativeDateToDateRange(relative: IRelativeDate): IDateRange<number>;
39
- /**
40
- * @private
41
- * Create a `.next()` function for a type
42
- * @param request
43
- * @param nextStart
44
- * @param total
45
- * @param fn
46
- * @returns
47
- */
48
- export declare function getNextFunction<T>(request: ISearchOptions, nextStart: number, total: number, fn: (r: any) => Promise<ISearchResponse<T>>): (authentication?: UserSession) => Promise<ISearchResponse<T>>;
1
+ import { IUser } from "@esri/arcgis-rest-auth";
2
+ import { IGroup } from "@esri/arcgis-rest-portal";
49
3
  /**
50
4
  * Construct a the full url to a group thumbnail
51
5
  *
@@ -22,18 +22,6 @@ export declare function createSite(partialSite: Partial<IHubSite>, requestOption
22
22
  * @returns
23
23
  */
24
24
  export declare function updateSite(site: IHubSite, requestOptions: IHubRequestOptions): Promise<IHubSite>;
25
- /**
26
- * @private
27
- * Remove a Hub Site
28
- *
29
- * This simply removes the Site item, and it's associated domain records.
30
- * This does not remove any Teams/Groups or content associated with the
31
- * Site
32
- * @param id
33
- * @param requestOptions
34
- * @returns
35
- */
36
- export declare function destroySite(id: string, requestOptions: IHubRequestOptions): Promise<void>;
37
25
  /**
38
26
  * Remove a Hub Site
39
27
  *
@@ -7,7 +7,6 @@ export * from "./fetchSiteModel";
7
7
  export * from "./get-site-by-id";
8
8
  export * from "./HubSite";
9
9
  export * from "./HubSites";
10
- export * from "./registerSiteAsApplication";
11
10
  export * from "./site-schema-version";
12
11
  export * from "./themes";
13
12
  export * from "./upgrade-site-schema";
@@ -1,5 +1,7 @@
1
1
  import { IHubRequestOptions, IModel } from "../types";
2
2
  /**
3
+ * @private
4
+ * @internal
3
5
  * Register the Site item as an application so we can oauth against it
4
6
  * @param {string} siteId Item Id of the site
5
7
  * @param {Array} uris Arrayf valid uris for the site
@@ -239,7 +239,7 @@ export interface IUpdatePageOptions extends IHubUserRequestOptions {
239
239
  allowList?: string[];
240
240
  }
241
241
  export interface IDomainEntry {
242
- clientKey: string;
242
+ clientKey?: string;
243
243
  createdAt?: string;
244
244
  hostname: string;
245
245
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "12.33.0",
3
+ "version": "13.0.0-next.1",
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",