@esri/hub-common 17.2.0 → 17.4.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.
- package/dist/esm/content/_internal/ContentBusinessRules.js +34 -0
- package/dist/esm/content/_internal/ContentBusinessRules.js.map +1 -1
- package/dist/esm/core/types/HubEntityType.js +9 -6
- package/dist/esm/core/types/HubEntityType.js.map +1 -1
- package/dist/esm/initiative-templates/_internal/InitiativeTemplateBusinessRules.js +13 -0
- package/dist/esm/initiative-templates/_internal/InitiativeTemplateBusinessRules.js.map +1 -1
- package/dist/esm/search/_internal/commonHelpers/getApi.js +1 -1
- package/dist/esm/search/_internal/commonHelpers/getApi.js.map +1 -1
- package/dist/esm/search/_internal/commonHelpers/getOgcApiDefinition.js +2 -2
- package/dist/esm/search/_internal/commonHelpers/getOgcApiDefinition.js.map +1 -1
- package/dist/esm/search/_internal/hubSearchItems.js +6 -2
- package/dist/esm/search/_internal/hubSearchItems.js.map +1 -1
- package/dist/esm/search/_internal/hubSearchItemsHelpers/formatOgcItemsResponse.js +7 -7
- package/dist/esm/search/_internal/hubSearchItemsHelpers/formatOgcItemsResponse.js.map +1 -1
- package/dist/esm/search/_internal/hubSearchItemsHelpers/getNextOgcCallback.js +2 -2
- package/dist/esm/search/_internal/hubSearchItemsHelpers/getNextOgcCallback.js.map +1 -1
- package/dist/esm/search/_internal/hubSearchItemsHelpers/getOgcItemQueryParams.js +1 -1
- package/dist/esm/search/_internal/hubSearchItemsHelpers/getOgcItemQueryParams.js.map +1 -1
- package/dist/esm/search/_internal/hubSearchItemsHelpers/getSortByQueryParam.js +1 -1
- package/dist/esm/search/_internal/hubSearchItemsHelpers/getSortByQueryParam.js.map +1 -1
- package/dist/esm/search/_internal/hubSearchItemsHelpers/ogcApiRequest.js +5 -2
- package/dist/esm/search/_internal/hubSearchItemsHelpers/ogcApiRequest.js.map +1 -1
- package/dist/esm/search/_internal/hubSearchItemsHelpers/searchOgcItems.js +2 -4
- package/dist/esm/search/_internal/hubSearchItemsHelpers/searchOgcItems.js.map +1 -1
- package/dist/esm/search/index.js +1 -0
- package/dist/esm/search/index.js.map +1 -1
- package/dist/esm/search/searchAssociatedContent.js +44 -0
- package/dist/esm/search/searchAssociatedContent.js.map +1 -0
- package/dist/esm/sites/HubSites.js.map +1 -1
- package/dist/esm/surveys/_internal/SurveyBusinessRules.js +13 -0
- package/dist/esm/surveys/_internal/SurveyBusinessRules.js.map +1 -1
- package/dist/esm/templates/_internal/TemplateBusinessRules.js +13 -0
- package/dist/esm/templates/_internal/TemplateBusinessRules.js.map +1 -1
- package/dist/node/content/_internal/ContentBusinessRules.js +34 -0
- package/dist/node/content/_internal/ContentBusinessRules.js.map +1 -1
- package/dist/node/core/types/HubEntityType.js +10 -7
- package/dist/node/core/types/HubEntityType.js.map +1 -1
- package/dist/node/initiative-templates/_internal/InitiativeTemplateBusinessRules.js +13 -0
- package/dist/node/initiative-templates/_internal/InitiativeTemplateBusinessRules.js.map +1 -1
- package/dist/node/search/_internal/commonHelpers/getApi.js +1 -1
- package/dist/node/search/_internal/commonHelpers/getApi.js.map +1 -1
- package/dist/node/search/_internal/commonHelpers/getOgcApiDefinition.js +2 -2
- package/dist/node/search/_internal/commonHelpers/getOgcApiDefinition.js.map +1 -1
- package/dist/node/search/_internal/hubSearchItems.js +6 -2
- package/dist/node/search/_internal/hubSearchItems.js.map +1 -1
- package/dist/node/search/_internal/hubSearchItemsHelpers/formatOgcItemsResponse.js +7 -7
- package/dist/node/search/_internal/hubSearchItemsHelpers/formatOgcItemsResponse.js.map +1 -1
- package/dist/node/search/_internal/hubSearchItemsHelpers/getNextOgcCallback.js +2 -2
- package/dist/node/search/_internal/hubSearchItemsHelpers/getNextOgcCallback.js.map +1 -1
- package/dist/node/search/_internal/hubSearchItemsHelpers/getOgcItemQueryParams.js +1 -1
- package/dist/node/search/_internal/hubSearchItemsHelpers/getOgcItemQueryParams.js.map +1 -1
- package/dist/node/search/_internal/hubSearchItemsHelpers/getSortByQueryParam.js +1 -1
- package/dist/node/search/_internal/hubSearchItemsHelpers/getSortByQueryParam.js.map +1 -1
- package/dist/node/search/_internal/hubSearchItemsHelpers/ogcApiRequest.js +5 -2
- package/dist/node/search/_internal/hubSearchItemsHelpers/ogcApiRequest.js.map +1 -1
- package/dist/node/search/_internal/hubSearchItemsHelpers/searchOgcItems.js +2 -4
- package/dist/node/search/_internal/hubSearchItemsHelpers/searchOgcItems.js.map +1 -1
- package/dist/node/search/index.js +1 -0
- package/dist/node/search/index.js.map +1 -1
- package/dist/node/search/searchAssociatedContent.js +48 -0
- package/dist/node/search/searchAssociatedContent.js.map +1 -0
- package/dist/node/sites/HubSites.js.map +1 -1
- package/dist/node/surveys/_internal/SurveyBusinessRules.js +13 -0
- package/dist/node/surveys/_internal/SurveyBusinessRules.js.map +1 -1
- package/dist/node/templates/_internal/TemplateBusinessRules.js +13 -0
- package/dist/node/templates/_internal/TemplateBusinessRules.js.map +1 -1
- package/dist/types/content/_internal/ContentBusinessRules.d.ts +1 -1
- package/dist/types/content/_internal/internalContentUtils.d.ts +1 -1
- package/dist/types/content/get-family.d.ts +1 -1
- package/dist/types/core/types/HubEntityType.d.ts +3 -1
- package/dist/types/initiative-templates/_internal/InitiativeTemplateBusinessRules.d.ts +1 -1
- package/dist/types/search/_internal/commonHelpers/getOgcApiDefinition.d.ts +2 -2
- package/dist/types/search/_internal/hubSearchItemsHelpers/formatOgcItemsResponse.d.ts +2 -3
- package/dist/types/search/_internal/hubSearchItemsHelpers/getNextOgcCallback.d.ts +2 -3
- package/dist/types/search/_internal/hubSearchItemsHelpers/getOgcItemQueryParams.d.ts +3 -3
- package/dist/types/search/_internal/hubSearchItemsHelpers/getSortByQueryParam.d.ts +3 -3
- package/dist/types/search/_internal/hubSearchItemsHelpers/interfaces.d.ts +8 -0
- package/dist/types/search/_internal/hubSearchItemsHelpers/ogcApiRequest.d.ts +2 -2
- package/dist/types/search/_internal/hubSearchItemsHelpers/searchOgcItems.d.ts +2 -2
- package/dist/types/search/index.d.ts +1 -0
- package/dist/types/search/searchAssociatedContent.d.ts +12 -0
- package/dist/types/search/types/types.d.ts +32 -2
- package/dist/types/sites/HubSites.d.ts +1 -1
- package/dist/types/surveys/_internal/SurveyBusinessRules.d.ts +1 -1
- package/dist/types/templates/_internal/TemplateBusinessRules.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IQuery } from "../../types/IHubCatalog";
|
|
2
|
-
import { IHubSearchOptions } from "../../types/IHubSearchOptions";
|
|
3
2
|
import { IHubSearchResponse } from "../../types/IHubSearchResponse";
|
|
4
3
|
import { IHubSearchResult } from "../../types/IHubSearchResult";
|
|
5
|
-
import { IOgcItemsResponse } from "./interfaces";
|
|
6
|
-
export declare function getNextOgcCallback(response: IOgcItemsResponse, originalQuery: IQuery, originalOptions:
|
|
4
|
+
import { IOgcItemsResponse, ISearchOgcItemsOptions } from "./interfaces";
|
|
5
|
+
export declare function getNextOgcCallback(response: IOgcItemsResponse, url: string, originalQuery: IQuery, originalOptions: ISearchOgcItemsOptions): (params?: any) => Promise<IHubSearchResponse<IHubSearchResult>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IQuery } from "../../types/IHubCatalog";
|
|
2
|
-
import {
|
|
2
|
+
import { ISearchOgcItemsOptions } from "./interfaces";
|
|
3
3
|
export interface IOgcItemQueryParams {
|
|
4
4
|
filter?: string;
|
|
5
5
|
token?: string;
|
|
@@ -17,7 +17,7 @@ export interface IOgcItemQueryParams {
|
|
|
17
17
|
* to the /items endpoint of an OGC API collection
|
|
18
18
|
*
|
|
19
19
|
* @param query an IQuery to derive query params from
|
|
20
|
-
* @param options an
|
|
20
|
+
* @param options an ISearchOgcItemsOptions object to derive query params from
|
|
21
21
|
* @returns a hash of query params to be included in the request
|
|
22
22
|
*/
|
|
23
|
-
export declare function getOgcItemQueryParams(query: IQuery, options:
|
|
23
|
+
export declare function getOgcItemQueryParams(query: IQuery, options: ISearchOgcItemsOptions): IOgcItemQueryParams;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ISearchOgcItemsOptions } from "./interfaces";
|
|
2
2
|
/**
|
|
3
3
|
* @private
|
|
4
4
|
* Serializes the sort options provided from the request options
|
|
5
5
|
* object into a string that the OGC API can understand
|
|
6
6
|
*
|
|
7
|
-
* @param options
|
|
7
|
+
* @param options ISearchOgcItemsOptions that contain sorting information
|
|
8
8
|
* @returns a serialized sort string
|
|
9
9
|
*/
|
|
10
|
-
export declare function getSortByQueryParam(options:
|
|
10
|
+
export declare function getSortByQueryParam(options: ISearchOgcItemsOptions): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IHubSearchOptions } from "../../types/IHubSearchOptions";
|
|
1
2
|
export interface IOgcItem {
|
|
2
3
|
id: string;
|
|
3
4
|
type: "Feature";
|
|
@@ -34,4 +35,11 @@ export interface IOgcAggregationsResponse {
|
|
|
34
35
|
timestamp: string;
|
|
35
36
|
links: IOgcLink[];
|
|
36
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* @private
|
|
40
|
+
* Interface for the options object passed to the searchOgcItems function.
|
|
41
|
+
* Unlike IHubSearchOptions, this interface does not accept aggregation
|
|
42
|
+
* properties or properties marked for deprecation.
|
|
43
|
+
*/
|
|
44
|
+
export declare type ISearchOgcItemsOptions = Omit<IHubSearchOptions, "aggFields" | "aggLimit" | "api" | "authentication" | "page">;
|
|
37
45
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ISearchOgcItemsOptions } from "./interfaces";
|
|
2
2
|
/**
|
|
3
3
|
* Wrapper over fetch for performing common operations when executing a request to an OGC API, such as:
|
|
4
4
|
* - Creating the query string
|
|
@@ -23,4 +23,4 @@ import { IHubSearchOptions } from "../../types/IHubSearchOptions";
|
|
|
23
23
|
* @param options options to customize the search, such as the site whose catalogs we're targeting
|
|
24
24
|
* @returns the JSON response from the endpoint
|
|
25
25
|
*/
|
|
26
|
-
export declare function ogcApiRequest(url: string, queryParams: Record<string, any>, options:
|
|
26
|
+
export declare function ogcApiRequest(url: string, queryParams: Record<string, any>, options: ISearchOgcItemsOptions): Promise<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IQuery } from "../../types/IHubCatalog";
|
|
2
|
-
import { IHubSearchOptions } from "../../types/IHubSearchOptions";
|
|
3
2
|
import { IHubSearchResponse } from "../../types/IHubSearchResponse";
|
|
4
3
|
import { IHubSearchResult } from "../../types/IHubSearchResult";
|
|
5
|
-
|
|
4
|
+
import { ISearchOgcItemsOptions } from "./interfaces";
|
|
5
|
+
export declare function searchOgcItems(url: string, query: IQuery, options: ISearchOgcItemsOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IHubSearchResponse, IHubSearchResult, ISearchAssociatedContentOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Searches for content that is associated with a given entity.
|
|
4
|
+
* Current associations supported are "related" and "connected".
|
|
5
|
+
*
|
|
6
|
+
* If unspecified, the number of results returned is 4.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: only item based entities are supported for now.
|
|
9
|
+
*
|
|
10
|
+
* @returns Search results for the associated content
|
|
11
|
+
*/
|
|
12
|
+
export declare function searchAssociatedContent(opts: ISearchAssociatedContentOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { HubEntityType } from "../../core";
|
|
2
|
-
import {
|
|
1
|
+
import { HubEntity, HubEntityType } from "../../core";
|
|
2
|
+
import { IHubRequestOptions } from "../../hub-types";
|
|
3
|
+
import { EntityType, IHubCatalog, IQuery } from "./IHubCatalog";
|
|
3
4
|
import { IHubSearchResponse } from "./IHubSearchResponse";
|
|
4
5
|
import { IHubSearchResult } from "./IHubSearchResult";
|
|
5
6
|
/**
|
|
@@ -141,3 +142,32 @@ export interface ISearchResponseHash extends Record<string, IHubSearchResponse<I
|
|
|
141
142
|
* with units as a type
|
|
142
143
|
*/
|
|
143
144
|
export declare type Kilobyte = number;
|
|
145
|
+
/**
|
|
146
|
+
* Options for searching associated content for a given entity
|
|
147
|
+
*/
|
|
148
|
+
export interface ISearchAssociatedContentOptions {
|
|
149
|
+
/**
|
|
150
|
+
* The entity to search for associated content
|
|
151
|
+
*/
|
|
152
|
+
entity: HubEntity;
|
|
153
|
+
/**
|
|
154
|
+
* The type of association to search for (e.g., "related", "connected")
|
|
155
|
+
*/
|
|
156
|
+
association: "related" | "connected";
|
|
157
|
+
/**
|
|
158
|
+
* The request options to use for the search
|
|
159
|
+
*/
|
|
160
|
+
requestOptions: IHubRequestOptions;
|
|
161
|
+
/**
|
|
162
|
+
* The scope of the search. Must have targetEntity of "item"
|
|
163
|
+
*/
|
|
164
|
+
scope: IQuery;
|
|
165
|
+
/**
|
|
166
|
+
* Which layer within the entity should be searched. Required for "connected" associations
|
|
167
|
+
*/
|
|
168
|
+
layerId?: string;
|
|
169
|
+
/**
|
|
170
|
+
* The number of results to return
|
|
171
|
+
*/
|
|
172
|
+
num?: number;
|
|
173
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IItem } from "@esri/arcgis-rest-portal";
|
|
2
|
-
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
|
+
import type { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
3
3
|
import { IHubSite } from "../core/types/IHubSite";
|
|
4
4
|
import { IHubRequestOptions, IModel } from "../hub-types";
|
|
5
5
|
import { IHubSearchResult } from "../search/types/IHubSearchResult";
|
|
@@ -4,7 +4,7 @@ import { IPermissionPolicy } from "../../permissions/types/IPermissionPolicy";
|
|
|
4
4
|
* These define the requirements any user must meet to perform related actions
|
|
5
5
|
* @private
|
|
6
6
|
*/
|
|
7
|
-
export declare const SurveyPermissions: readonly ["hub:survey", "hub:survey:create", "hub:survey:delete", "hub:survey:edit", "hub:survey:view", "hub:survey:owner", "hub:survey:canChangeAccess", "hub:survey:workspace", "hub:survey:workspace:dashboard", "hub:survey:workspace:details", "hub:survey:workspace:settings", "hub:survey:workspace:collaborators", "hub:survey:manage"];
|
|
7
|
+
export declare const SurveyPermissions: readonly ["hub:survey", "hub:survey:create", "hub:survey:delete", "hub:survey:edit", "hub:survey:view", "hub:survey:view:related", "hub:survey:owner", "hub:survey:canChangeAccess", "hub:survey:workspace", "hub:survey:workspace:dashboard", "hub:survey:workspace:details", "hub:survey:workspace:settings", "hub:survey:workspace:collaborators", "hub:survey:manage"];
|
|
8
8
|
/**
|
|
9
9
|
* Survey permission policies
|
|
10
10
|
* @private
|
|
@@ -9,7 +9,7 @@ export declare const TemplateDefaultFeatures: IFeatureFlags;
|
|
|
9
9
|
* Template permissions: these define the requirements
|
|
10
10
|
* any user must meet to perform related actions
|
|
11
11
|
*/
|
|
12
|
-
export declare const TemplatePermissions: readonly ["hub:template", "hub:template:create", "hub:template:delete", "hub:template:edit", "hub:template:manage", "hub:template:view", "hub:template:canChangeAccess", "hub:template:workspace", "hub:template:workspace:details", "hub:template:workspace:dashboard", "hub:template:workspace:collaborators", "hub:template:workspace:settings"];
|
|
12
|
+
export declare const TemplatePermissions: readonly ["hub:template", "hub:template:create", "hub:template:delete", "hub:template:edit", "hub:template:manage", "hub:template:view", "hub:template:view:related", "hub:template:canChangeAccess", "hub:template:workspace", "hub:template:workspace:details", "hub:template:workspace:dashboard", "hub:template:workspace:collaborators", "hub:template:workspace:settings"];
|
|
13
13
|
/**
|
|
14
14
|
* @private
|
|
15
15
|
* Template permission policies
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esri/hub-common",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.4.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,9 +22,9 @@
|
|
|
22
22
|
"tslib": "^1.13.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@esri/arcgis-rest-feature-service": "
|
|
26
|
-
"@esri/arcgis-rest-portal": "
|
|
27
|
-
"@esri/arcgis-rest-request": "
|
|
25
|
+
"@esri/arcgis-rest-feature-service": "^4.0.0",
|
|
26
|
+
"@esri/arcgis-rest-portal": "^4.0.0",
|
|
27
|
+
"@esri/arcgis-rest-request": "^4.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/adlib": "^3.0.1",
|