@esri/hub-common 9.48.0 → 10.0.0-next.2
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/es2017/core/traits/WithCatalog.js +1 -0
- package/dist/es2017/core/traits/WithCatalog.js.map +1 -0
- package/dist/es2017/index.js +1 -0
- package/dist/es2017/index.js.map +1 -1
- package/dist/es2017/projects/HubProjects.js.map +1 -1
- package/dist/es2017/search/Catalog.js +346 -0
- package/dist/es2017/search/Catalog.js.map +1 -0
- package/dist/es2017/search/Collection.js +38 -19
- package/dist/es2017/search/Collection.js.map +1 -1
- package/dist/es2017/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
- package/dist/es2017/search/_internal/expandPredicate.js.map +1 -0
- package/dist/es2017/search/_internal/hubSearchItems.js +3 -137
- package/dist/es2017/search/_internal/hubSearchItems.js.map +1 -1
- package/dist/es2017/search/_internal/index.js +0 -1
- package/dist/es2017/search/_internal/index.js.map +1 -1
- package/dist/es2017/search/_internal/portalSearchGroups.js +1 -2
- package/dist/es2017/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/es2017/search/_internal/portalSearchItems.js +5 -30
- package/dist/es2017/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/es2017/search/_internal/portalSearchUsers.js +1 -2
- package/dist/es2017/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/es2017/search/fetchCatalog.js +46 -0
- package/dist/es2017/search/fetchCatalog.js.map +1 -0
- package/dist/es2017/search/hubSearch.js +1 -1
- package/dist/es2017/search/hubSearch.js.map +1 -1
- package/dist/es2017/search/index.js +3 -9
- package/dist/es2017/search/index.js.map +1 -1
- package/dist/es2017/search/serializeQueryForPortal.js +1 -1
- package/dist/es2017/search/serializeQueryForPortal.js.map +1 -1
- package/dist/es2017/search/types/index.js +0 -5
- package/dist/es2017/search/types/index.js.map +1 -1
- package/dist/es2017/search/upgradeCatalogSchema.js +66 -0
- package/dist/es2017/search/upgradeCatalogSchema.js.map +1 -0
- package/dist/es2017/search/utils.js +1 -207
- package/dist/es2017/search/utils.js.map +1 -1
- package/dist/es2017/types/IMessage.js +1 -0
- package/dist/es2017/types/IMessage.js.map +1 -0
- package/dist/es2017/types/index.js +2 -0
- package/dist/es2017/types/index.js.map +1 -0
- package/dist/es2017/types.js.map +1 -1
- package/dist/esm/core/traits/WithCatalog.js +1 -0
- package/dist/esm/core/traits/WithCatalog.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/projects/HubProjects.js.map +1 -1
- package/dist/esm/search/Catalog.js +404 -0
- package/dist/esm/search/Catalog.js.map +1 -0
- package/dist/esm/search/Collection.js +40 -24
- package/dist/esm/search/Collection.js.map +1 -1
- package/dist/esm/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
- package/dist/esm/search/_internal/expandPredicate.js.map +1 -0
- package/dist/esm/search/_internal/hubSearchItems.js +4 -146
- package/dist/esm/search/_internal/hubSearchItems.js.map +1 -1
- package/dist/esm/search/_internal/index.js +0 -1
- package/dist/esm/search/_internal/index.js.map +1 -1
- package/dist/esm/search/_internal/portalSearchGroups.js +1 -2
- package/dist/esm/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/esm/search/_internal/portalSearchItems.js +6 -30
- package/dist/esm/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/esm/search/_internal/portalSearchUsers.js +1 -2
- package/dist/esm/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/esm/search/fetchCatalog.js +59 -0
- package/dist/esm/search/fetchCatalog.js.map +1 -0
- package/dist/esm/search/hubSearch.js +1 -1
- package/dist/esm/search/hubSearch.js.map +1 -1
- package/dist/esm/search/index.js +3 -9
- package/dist/esm/search/index.js.map +1 -1
- package/dist/esm/search/serializeQueryForPortal.js +1 -1
- package/dist/esm/search/serializeQueryForPortal.js.map +1 -1
- package/dist/esm/search/types/index.js +0 -5
- package/dist/esm/search/types/index.js.map +1 -1
- package/dist/esm/search/upgradeCatalogSchema.js +66 -0
- package/dist/esm/search/upgradeCatalogSchema.js.map +1 -0
- package/dist/esm/search/utils.js +1 -204
- package/dist/esm/search/utils.js.map +1 -1
- package/dist/esm/types/IMessage.js +1 -0
- package/dist/esm/types/IMessage.js.map +1 -0
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/node/{search/types/ICollection.js → core/traits/WithCatalog.js} +1 -1
- package/dist/node/core/traits/WithCatalog.js.map +1 -0
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/projects/HubProjects.js.map +1 -1
- package/dist/node/search/Catalog.js +350 -0
- package/dist/node/search/Catalog.js.map +1 -0
- package/dist/node/search/Collection.js +37 -18
- package/dist/node/search/Collection.js.map +1 -1
- package/dist/node/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
- package/dist/node/search/_internal/expandPredicate.js.map +1 -0
- package/dist/node/search/_internal/hubSearchItems.js +4 -139
- package/dist/node/search/_internal/hubSearchItems.js.map +1 -1
- package/dist/node/search/_internal/index.js +0 -1
- package/dist/node/search/_internal/index.js.map +1 -1
- package/dist/node/search/_internal/portalSearchGroups.js +2 -3
- package/dist/node/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/node/search/_internal/portalSearchItems.js +6 -31
- package/dist/node/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/node/search/_internal/portalSearchUsers.js +2 -3
- package/dist/node/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/node/search/fetchCatalog.js +50 -0
- package/dist/node/search/fetchCatalog.js.map +1 -0
- package/dist/node/search/hubSearch.js +1 -1
- package/dist/node/search/hubSearch.js.map +1 -1
- package/dist/node/search/index.js +3 -9
- package/dist/node/search/index.js.map +1 -1
- package/dist/node/search/serializeQueryForPortal.js +2 -2
- package/dist/node/search/serializeQueryForPortal.js.map +1 -1
- package/dist/node/search/types/index.js +0 -5
- package/dist/node/search/types/index.js.map +1 -1
- package/dist/node/search/upgradeCatalogSchema.js +71 -0
- package/dist/node/search/upgradeCatalogSchema.js.map +1 -0
- package/dist/node/search/utils.js +1 -213
- package/dist/node/search/utils.js.map +1 -1
- package/dist/node/{search/types/ICatalog.js → types/IMessage.js} +1 -1
- package/dist/node/types/IMessage.js.map +1 -0
- package/dist/node/types/index.js +5 -0
- package/dist/node/types/index.js.map +1 -0
- package/dist/node/types.js.map +1 -1
- package/dist/types/core/traits/WithCatalog.d.ts +7 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/search/Catalog.d.ts +143 -0
- package/dist/types/search/Collection.d.ts +23 -2
- package/dist/types/search/_internal/{ipredicate-utils.d.ts → expandPredicate.d.ts} +0 -0
- package/dist/types/search/_internal/hubSearchItems.d.ts +3 -4
- package/dist/types/search/_internal/index.d.ts +0 -1
- package/dist/types/search/_internal/portalSearchItems.d.ts +15 -15
- package/dist/types/search/fetchCatalog.d.ts +10 -0
- package/dist/types/search/index.d.ts +3 -9
- package/dist/types/search/types/IHubSearchOptions.d.ts +5 -1
- package/dist/types/search/types/IHubSearchResponse.d.ts +3 -3
- package/dist/types/search/types/index.d.ts +0 -5
- package/dist/types/search/types/types.d.ts +0 -206
- package/dist/types/search/upgradeCatalogSchema.d.ts +12 -0
- package/dist/types/search/utils.d.ts +2 -58
- package/dist/types/types/IMessage.d.ts +32 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types.d.ts +0 -2
- package/dist/umd/common.umd.js +1374 -2450
- package/dist/umd/common.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/es2017/search/_internal/ipredicate-utils.js.map +0 -1
- package/dist/es2017/search/_internal/state.js +0 -155
- package/dist/es2017/search/_internal/state.js.map +0 -1
- package/dist/es2017/search/_searchContent.js +0 -116
- package/dist/es2017/search/_searchContent.js.map +0 -1
- package/dist/es2017/search/_searchGroups.js +0 -88
- package/dist/es2017/search/_searchGroups.js.map +0 -1
- package/dist/es2017/search/_searchUsers.js +0 -89
- package/dist/es2017/search/_searchUsers.js.map +0 -1
- package/dist/es2017/search/collectionState.js +0 -60
- package/dist/es2017/search/collectionState.js.map +0 -1
- package/dist/es2017/search/content-utils.js +0 -455
- package/dist/es2017/search/content-utils.js.map +0 -1
- package/dist/es2017/search/convertCatalog.js +0 -33
- package/dist/es2017/search/convertCatalog.js.map +0 -1
- package/dist/es2017/search/filter-utils.js +0 -31
- package/dist/es2017/search/filter-utils.js.map +0 -1
- package/dist/es2017/search/group-utils.js +0 -142
- package/dist/es2017/search/group-utils.js.map +0 -1
- package/dist/es2017/search/types/ICatalog.js +0 -1
- package/dist/es2017/search/types/ICatalog.js.map +0 -1
- package/dist/es2017/search/types/ICollection.js +0 -1
- package/dist/es2017/search/types/ICollection.js.map +0 -1
- package/dist/es2017/search/types/IFacet.js +0 -1
- package/dist/es2017/search/types/IFacet.js.map +0 -1
- package/dist/es2017/search/types/IFacetOption.js +0 -1
- package/dist/es2017/search/types/IFacetOption.js.map +0 -1
- package/dist/es2017/search/types/IHubApiSearchRequest.js +0 -1
- package/dist/es2017/search/types/IHubApiSearchRequest.js.map +0 -1
- package/dist/es2017/search/user-utils.js +0 -139
- package/dist/es2017/search/user-utils.js.map +0 -1
- package/dist/esm/search/_internal/ipredicate-utils.js.map +0 -1
- package/dist/esm/search/_internal/state.js +0 -155
- package/dist/esm/search/_internal/state.js.map +0 -1
- package/dist/esm/search/_searchContent.js +0 -118
- package/dist/esm/search/_searchContent.js.map +0 -1
- package/dist/esm/search/_searchGroups.js +0 -91
- package/dist/esm/search/_searchGroups.js.map +0 -1
- package/dist/esm/search/_searchUsers.js +0 -92
- package/dist/esm/search/_searchUsers.js.map +0 -1
- package/dist/esm/search/collectionState.js +0 -61
- package/dist/esm/search/collectionState.js.map +0 -1
- package/dist/esm/search/content-utils.js +0 -462
- package/dist/esm/search/content-utils.js.map +0 -1
- package/dist/esm/search/convertCatalog.js +0 -33
- package/dist/esm/search/convertCatalog.js.map +0 -1
- package/dist/esm/search/filter-utils.js +0 -31
- package/dist/esm/search/filter-utils.js.map +0 -1
- package/dist/esm/search/group-utils.js +0 -146
- package/dist/esm/search/group-utils.js.map +0 -1
- package/dist/esm/search/types/ICatalog.js +0 -1
- package/dist/esm/search/types/ICatalog.js.map +0 -1
- package/dist/esm/search/types/ICollection.js +0 -1
- package/dist/esm/search/types/ICollection.js.map +0 -1
- package/dist/esm/search/types/IFacet.js +0 -1
- package/dist/esm/search/types/IFacet.js.map +0 -1
- package/dist/esm/search/types/IFacetOption.js +0 -1
- package/dist/esm/search/types/IFacetOption.js.map +0 -1
- package/dist/esm/search/types/IHubApiSearchRequest.js +0 -1
- package/dist/esm/search/types/IHubApiSearchRequest.js.map +0 -1
- package/dist/esm/search/user-utils.js +0 -143
- package/dist/esm/search/user-utils.js.map +0 -1
- package/dist/node/search/_internal/ipredicate-utils.js.map +0 -1
- package/dist/node/search/_internal/state.js +0 -166
- package/dist/node/search/_internal/state.js.map +0 -1
- package/dist/node/search/_searchContent.js +0 -120
- package/dist/node/search/_searchContent.js.map +0 -1
- package/dist/node/search/_searchGroups.js +0 -92
- package/dist/node/search/_searchGroups.js.map +0 -1
- package/dist/node/search/_searchUsers.js +0 -93
- package/dist/node/search/_searchUsers.js.map +0 -1
- package/dist/node/search/collectionState.js +0 -65
- package/dist/node/search/collectionState.js.map +0 -1
- package/dist/node/search/content-utils.js +0 -466
- package/dist/node/search/content-utils.js.map +0 -1
- package/dist/node/search/convertCatalog.js +0 -37
- package/dist/node/search/convertCatalog.js.map +0 -1
- package/dist/node/search/filter-utils.js +0 -36
- package/dist/node/search/filter-utils.js.map +0 -1
- package/dist/node/search/group-utils.js +0 -148
- package/dist/node/search/group-utils.js.map +0 -1
- package/dist/node/search/types/ICatalog.js.map +0 -1
- package/dist/node/search/types/ICollection.js.map +0 -1
- package/dist/node/search/types/IFacet.js +0 -3
- package/dist/node/search/types/IFacet.js.map +0 -1
- package/dist/node/search/types/IFacetOption.js +0 -3
- package/dist/node/search/types/IFacetOption.js.map +0 -1
- package/dist/node/search/types/IHubApiSearchRequest.js +0 -3
- package/dist/node/search/types/IHubApiSearchRequest.js.map +0 -1
- package/dist/node/search/user-utils.js +0 -145
- package/dist/node/search/user-utils.js.map +0 -1
- package/dist/types/search/_internal/state.d.ts +0 -70
- package/dist/types/search/_searchContent.d.ts +0 -9
- package/dist/types/search/_searchGroups.d.ts +0 -17
- package/dist/types/search/_searchUsers.d.ts +0 -31
- package/dist/types/search/collectionState.d.ts +0 -19
- package/dist/types/search/content-utils.d.ts +0 -83
- package/dist/types/search/convertCatalog.d.ts +0 -6
- package/dist/types/search/filter-utils.d.ts +0 -13
- package/dist/types/search/group-utils.d.ts +0 -36
- package/dist/types/search/types/ICatalog.d.ts +0 -87
- package/dist/types/search/types/ICollection.d.ts +0 -28
- package/dist/types/search/types/IFacet.d.ts +0 -62
- package/dist/types/search/types/IFacetOption.d.ts +0 -30
- package/dist/types/search/types/IHubApiSearchRequest.d.ts +0 -16
- package/dist/types/search/user-utils.d.ts +0 -35
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
export * from "./hub-api-search";
|
|
2
|
-
export * from "./content-utils";
|
|
3
|
-
export * from "./group-utils";
|
|
4
|
-
export * from "./user-utils";
|
|
5
2
|
export * from "./utils";
|
|
6
|
-
export * from "./_searchContent";
|
|
7
|
-
export * from "./_searchGroups";
|
|
8
|
-
export * from "./_searchUsers";
|
|
9
3
|
export * from "./types";
|
|
10
|
-
export * from "./
|
|
11
|
-
export * from "./convertCatalog";
|
|
12
|
-
export * from "./filter-utils";
|
|
4
|
+
export * from "./upgradeCatalogSchema";
|
|
13
5
|
export * from "./serializeQueryForPortal";
|
|
14
6
|
export * from "./hubSearch";
|
|
7
|
+
export * from "./Catalog";
|
|
8
|
+
export * from "./Collection";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UserSession } from "@esri/arcgis-rest-auth";
|
|
2
|
-
import { IHubRequestOptions, IModel } from "
|
|
2
|
+
import { EntityType, IHubRequestOptions, IModel } from "../../index";
|
|
3
3
|
import { NamedApis, IApiDefinition } from "./types";
|
|
4
4
|
export declare type Enrichments = "data" | "metadata" | "org" | "service" | "layers";
|
|
5
5
|
/**
|
|
@@ -42,6 +42,10 @@ export interface IHubSearchOptions {
|
|
|
42
42
|
* DEPRECATED: Use `include` instead
|
|
43
43
|
*/
|
|
44
44
|
enrichments?: Enrichments[];
|
|
45
|
+
/**
|
|
46
|
+
* Specify what entity to search for; For use with hubSearch
|
|
47
|
+
*/
|
|
48
|
+
targetEntity?: EntityType;
|
|
45
49
|
/**
|
|
46
50
|
* Maximum number of results to return, per-page
|
|
47
51
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IMessage } from "../../types/IMessage";
|
|
2
2
|
import { IHubAggregation } from "./IHubAggregation";
|
|
3
3
|
/**
|
|
4
4
|
* Defines a generic search response interface with parameterized result type
|
|
@@ -31,7 +31,7 @@ export interface IHubSearchResponse<T> {
|
|
|
31
31
|
*/
|
|
32
32
|
aggregations?: IHubAggregation[];
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Array of messages / warnings
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
messages?: IMessage[];
|
|
37
37
|
}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
export * from "./ICatalog";
|
|
2
|
-
export * from "./ICollection";
|
|
3
|
-
export * from "./IFacet";
|
|
4
|
-
export * from "./IFacetOption";
|
|
5
1
|
export * from "./IHubAggregation";
|
|
6
|
-
export * from "./IHubApiSearchRequest";
|
|
7
2
|
export * from "./IHubSearchOptions";
|
|
8
3
|
export * from "./IHubSearchResult";
|
|
9
4
|
export * from "./IHubSearchResponse";
|
|
@@ -1,179 +1,3 @@
|
|
|
1
|
-
import { UserSession } from "@esri/arcgis-rest-auth";
|
|
2
|
-
import { IHubContent, AccessLevel } from "../..";
|
|
3
|
-
import { IFacet } from "./IFacet";
|
|
4
|
-
/**
|
|
5
|
-
* Generic filter used with various search functions.
|
|
6
|
-
*
|
|
7
|
-
* `Filter<T extends FilterType>` [FilterType](../FilterType) is constrained to
|
|
8
|
-
*
|
|
9
|
-
* - `Filter<"item">` [IContentFilterDefinition](../IContentFilterDefinition)
|
|
10
|
-
* - `Filter<"user">` [IUserFilterDefinition](../IUserFilterDefinition)
|
|
11
|
-
* - `Filter<"group">` [IGroupFilterDefinition](../IGroupFilterDefinition)
|
|
12
|
-
*
|
|
13
|
-
* When constructing a Filter as json, the `filterType` must be specified,
|
|
14
|
-
* and it must be `keyof` [FilterTypeMap](../FilterTypeMap)
|
|
15
|
-
*
|
|
16
|
-
* ```ts
|
|
17
|
-
* const f:Filter<"item"> = {
|
|
18
|
-
* filterType: "item" // must match the FilterType
|
|
19
|
-
* term: "water"
|
|
20
|
-
* }
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare type Filter<T extends FilterType> = IFilterTypeMap[T] & {
|
|
24
|
-
filterType: T;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Groups of filters with an operation specifying how the
|
|
28
|
-
* filters should be connected when serialized
|
|
29
|
-
*/
|
|
30
|
-
export interface IFilterGroup<T extends FilterType> {
|
|
31
|
-
filterType: T;
|
|
32
|
-
operation?: "AND" | "OR";
|
|
33
|
-
filters: Array<Filter<T>>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Defines the valid FilterTypes for use with `Filter<T extends FilterType>`
|
|
37
|
-
* See [Filter](../Filter)
|
|
38
|
-
*/
|
|
39
|
-
export interface IFilterTypeMap {
|
|
40
|
-
item: IItemFilter;
|
|
41
|
-
user: IUserFilterDefinition;
|
|
42
|
-
group: IGroupFilterDefinition;
|
|
43
|
-
groupMember: IGroupMemberFilterDefinition;
|
|
44
|
-
event: IEventFilterDefinition;
|
|
45
|
-
/**
|
|
46
|
-
* DEPRECATED use item
|
|
47
|
-
* // TODO: Remove with _searchContent
|
|
48
|
-
*/
|
|
49
|
-
content: IContentFilterDefinition;
|
|
50
|
-
}
|
|
51
|
-
export declare type FilterType = keyof IFilterTypeMap;
|
|
52
|
-
export interface IItemFilter {
|
|
53
|
-
access?: AccessLevel | AccessLevel[] | IMatchOptions;
|
|
54
|
-
owner?: string | string[] | IMatchOptions;
|
|
55
|
-
tags?: string | string[] | IMatchOptions;
|
|
56
|
-
categories?: string | string[] | IMatchOptions;
|
|
57
|
-
created?: IDateRange<number> | IRelativeDate;
|
|
58
|
-
description?: string | string[] | IMatchOptions;
|
|
59
|
-
snippet?: string | string[] | IMatchOptions;
|
|
60
|
-
group?: string | string[] | IMatchOptions;
|
|
61
|
-
id?: string | string[] | IMatchOptions;
|
|
62
|
-
modified?: IDateRange<number> | IRelativeDate;
|
|
63
|
-
orgid?: string | string[] | IMatchOptions;
|
|
64
|
-
term?: string;
|
|
65
|
-
title?: string | string[] | IMatchOptions;
|
|
66
|
-
type?: string | string[] | IMatchOptions;
|
|
67
|
-
typekeywords?: string | string[] | IMatchOptions;
|
|
68
|
-
[key: string]: any;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Fields related to Content based searches
|
|
72
|
-
* // TODO: Remove with _searchContent
|
|
73
|
-
*/
|
|
74
|
-
export interface IContentFilterDefinition {
|
|
75
|
-
access?: string | string[] | IMatchOptions;
|
|
76
|
-
owner?: string | string[] | IMatchOptions;
|
|
77
|
-
tags?: string | string[] | IMatchOptions;
|
|
78
|
-
categories?: string | string[] | IMatchOptions;
|
|
79
|
-
created?: IDateRange<number> | IRelativeDate;
|
|
80
|
-
description?: string | string[] | IMatchOptions;
|
|
81
|
-
snippet?: string | string[] | IMatchOptions;
|
|
82
|
-
group?: string | string[] | IMatchOptions;
|
|
83
|
-
id?: string | string[] | IMatchOptions;
|
|
84
|
-
modified?: IDateRange<number> | IRelativeDate;
|
|
85
|
-
orgid?: string | string[] | IMatchOptions;
|
|
86
|
-
term?: string;
|
|
87
|
-
title?: string | string[] | IMatchOptions;
|
|
88
|
-
type?: string | NamedContentFilter | Array<string | NamedContentFilter> | IMatchOptions;
|
|
89
|
-
typekeywords?: string | string[] | IMatchOptions;
|
|
90
|
-
[key: string]: any;
|
|
91
|
-
/**
|
|
92
|
-
* @internal
|
|
93
|
-
* Support for complex OR queries; Used with various expansions
|
|
94
|
-
*/
|
|
95
|
-
subFilters?: Array<IContentFilterDefinition | NamedContentFilter>;
|
|
96
|
-
}
|
|
97
|
-
export interface IContentFilter {
|
|
98
|
-
access?: IMatchOptions;
|
|
99
|
-
created?: IDateRange<number>;
|
|
100
|
-
description?: IMatchOptions;
|
|
101
|
-
group?: IMatchOptions;
|
|
102
|
-
id?: IMatchOptions;
|
|
103
|
-
modified?: IDateRange<number>;
|
|
104
|
-
orgid?: IMatchOptions;
|
|
105
|
-
owner?: IMatchOptions;
|
|
106
|
-
tags?: IMatchOptions;
|
|
107
|
-
term?: string;
|
|
108
|
-
title?: IMatchOptions;
|
|
109
|
-
type?: IMatchOptions;
|
|
110
|
-
typekeywords?: IMatchOptions;
|
|
111
|
-
[key: string]: any;
|
|
112
|
-
subFilters?: IContentFilter[];
|
|
113
|
-
}
|
|
114
|
-
export interface IWellKnownContentFilters {
|
|
115
|
-
$apps: IContentFilterDefinition[];
|
|
116
|
-
$dashboard: IContentFilterDefinition[];
|
|
117
|
-
$dataset: IContentFilterDefinition[];
|
|
118
|
-
$experience: IContentFilterDefinition[];
|
|
119
|
-
$site: IContentFilterDefinition[];
|
|
120
|
-
$storymap: IContentFilterDefinition[];
|
|
121
|
-
$initiative: IContentFilterDefinition[];
|
|
122
|
-
$document: IContentFilterDefinition[];
|
|
123
|
-
}
|
|
124
|
-
export declare type NamedContentFilter = keyof IWellKnownContentFilters;
|
|
125
|
-
export interface IUserFilterDefinition {
|
|
126
|
-
created?: IDateRange<number> | IRelativeDate;
|
|
127
|
-
disabled?: boolean;
|
|
128
|
-
email?: string | string[] | IMatchOptions;
|
|
129
|
-
firstname?: string | string[] | IMatchOptions;
|
|
130
|
-
fullname?: string | string[] | IMatchOptions;
|
|
131
|
-
group?: string | string[] | IMatchOptions;
|
|
132
|
-
lastlogin?: IDateRange<number> | IRelativeDate;
|
|
133
|
-
lastname?: string | string[] | IMatchOptions;
|
|
134
|
-
modified?: IDateRange<number> | IRelativeDate;
|
|
135
|
-
role?: string | string[] | IMatchOptions;
|
|
136
|
-
term?: string;
|
|
137
|
-
userlicensetype?: string | string[] | IMatchOptions;
|
|
138
|
-
username?: string | string[] | IMatchOptions;
|
|
139
|
-
emailstatus?: string | string[] | IMatchOptions;
|
|
140
|
-
provider?: string | string[] | IMatchOptions;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* These properties must all be passed through
|
|
144
|
-
* so they are sent in separate fields and *not*
|
|
145
|
-
* serialized into a q
|
|
146
|
-
* Also `joined` does not take the same format as
|
|
147
|
-
* dates in `q`
|
|
148
|
-
*/
|
|
149
|
-
export interface IGroupMemberFilterDefinition {
|
|
150
|
-
memberType?: "admin" | "member";
|
|
151
|
-
joined?: IDateRange<number> | IRelativeDate;
|
|
152
|
-
name?: string | string[] | IMatchOptions;
|
|
153
|
-
orgIds?: string | string[] | IMatchOptions;
|
|
154
|
-
}
|
|
155
|
-
export interface IGroupFilterDefinition {
|
|
156
|
-
access?: string | string[] | IMatchOptions;
|
|
157
|
-
created?: IDateRange<number> | IRelativeDate;
|
|
158
|
-
id?: string | string[] | IMatchOptions;
|
|
159
|
-
isInvitationOnly?: boolean;
|
|
160
|
-
modified?: IDateRange<number> | IRelativeDate;
|
|
161
|
-
orgid?: string | string[] | IMatchOptions;
|
|
162
|
-
owner?: string | string[] | IMatchOptions;
|
|
163
|
-
searchUserAccess?: "groupMember";
|
|
164
|
-
searchUserName?: string;
|
|
165
|
-
tags?: string | string[] | IMatchOptions;
|
|
166
|
-
term?: string;
|
|
167
|
-
title?: string | string[] | IMatchOptions;
|
|
168
|
-
typekeywords?: string | string[] | IMatchOptions;
|
|
169
|
-
isopendata?: boolean;
|
|
170
|
-
}
|
|
171
|
-
export interface IEventFilterDefinition {
|
|
172
|
-
created?: IDateRange<number> | IRelativeDate;
|
|
173
|
-
modified?: IDateRange<number> | IRelativeDate;
|
|
174
|
-
orgid?: string | string[] | IMatchOptions;
|
|
175
|
-
title?: string | string[] | IMatchOptions;
|
|
176
|
-
}
|
|
177
1
|
/**
|
|
178
2
|
* Sort Option to be displayed in a UI
|
|
179
3
|
*/
|
|
@@ -228,17 +52,6 @@ export interface IMatchOptions {
|
|
|
228
52
|
*/
|
|
229
53
|
exact?: string | string[];
|
|
230
54
|
}
|
|
231
|
-
/**
|
|
232
|
-
* searchContent return
|
|
233
|
-
* // TODO: Remove with _searchContent
|
|
234
|
-
*/
|
|
235
|
-
export interface IContentSearchResult {
|
|
236
|
-
total: number;
|
|
237
|
-
results: IHubContent[];
|
|
238
|
-
facets?: IFacet[];
|
|
239
|
-
hasNext: boolean;
|
|
240
|
-
next: (params?: any) => Promise<IContentSearchResult>;
|
|
241
|
-
}
|
|
242
55
|
export interface IWellKnownApis {
|
|
243
56
|
arcgis: IApiDefinition;
|
|
244
57
|
arcgisQA: IApiDefinition;
|
|
@@ -252,23 +65,4 @@ export interface IApiDefinition {
|
|
|
252
65
|
label?: string;
|
|
253
66
|
url: string;
|
|
254
67
|
type: "arcgis" | "arcgis-hub";
|
|
255
|
-
authentication?: UserSession;
|
|
256
|
-
}
|
|
257
|
-
export interface IFacetState {
|
|
258
|
-
[key: string]: string;
|
|
259
|
-
}
|
|
260
|
-
export interface ICollectionState {
|
|
261
|
-
query?: string;
|
|
262
|
-
sort?: string;
|
|
263
|
-
[key: string]: string;
|
|
264
|
-
}
|
|
265
|
-
export interface ICatalogState {
|
|
266
|
-
collection: string;
|
|
267
|
-
collectionState?: ICollectionState;
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Generic key/value type for storing component state
|
|
271
|
-
*/
|
|
272
|
-
export interface IComponentState {
|
|
273
|
-
[key: string]: string;
|
|
274
68
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IHubCatalog } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Apply schema upgrades to Catalog objects
|
|
4
|
+
* @param catalog
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function upgradeCatalogSchema(catalog: any): IHubCatalog;
|
|
8
|
+
/**
|
|
9
|
+
* DEPRECATED: Use upgradeCatalogSchema(...)
|
|
10
|
+
* @param original
|
|
11
|
+
*/
|
|
12
|
+
export declare function convertCatalog(original: any): IHubCatalog;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUser } from "@esri/arcgis-rest-auth";
|
|
1
|
+
import { IUser, UserSession } from "@esri/arcgis-rest-auth";
|
|
2
2
|
import { IGroup, ISearchOptions } from "@esri/arcgis-rest-portal";
|
|
3
3
|
import { ISearchResponse } from "../types";
|
|
4
4
|
import { IMatchOptions, IDateRange, IRelativeDate, IWellKnownApis, IApiDefinition, NamedApis } from "./types/types";
|
|
@@ -22,25 +22,6 @@ export declare function expandApis(apis: Array<NamedApis | IApiDefinition>): IAp
|
|
|
22
22
|
* @returns
|
|
23
23
|
*/
|
|
24
24
|
export declare function expandApi(api: NamedApis | IApiDefinition): IApiDefinition;
|
|
25
|
-
/**
|
|
26
|
-
* @private
|
|
27
|
-
* Merge two date ranges by taking the longest span
|
|
28
|
-
* @param dr1
|
|
29
|
-
* @param dr2
|
|
30
|
-
* @returns
|
|
31
|
-
*/
|
|
32
|
-
export declare function mergeDateRange(dr1: IDateRange<number>, dr2: IDateRange<number>): IDateRange<number>;
|
|
33
|
-
/**
|
|
34
|
-
* @private
|
|
35
|
-
* Merge two [`MatchOptions`](../MatchOptions)
|
|
36
|
-
*
|
|
37
|
-
* Currently a naieve implementation where the arrays are simply merged
|
|
38
|
-
*
|
|
39
|
-
* @param mo1
|
|
40
|
-
* @param mo2
|
|
41
|
-
* @returns
|
|
42
|
-
*/
|
|
43
|
-
export declare function mergeMatchOptions(mo1: IMatchOptions, mo2: IMatchOptions): IMatchOptions;
|
|
44
25
|
/**
|
|
45
26
|
* @private
|
|
46
27
|
* Convert a field value into a MatchOptions if it's not already one
|
|
@@ -55,43 +36,6 @@ export declare function valueToMatchOptions(value: string | string[] | IMatchOpt
|
|
|
55
36
|
* @returns
|
|
56
37
|
*/
|
|
57
38
|
export declare function relativeDateToDateRange(relative: IRelativeDate): IDateRange<number>;
|
|
58
|
-
/**
|
|
59
|
-
* @private
|
|
60
|
-
* As a final `ISearchOptions` object gets created, many such objects are created, and
|
|
61
|
-
* need to be systematically "merged" so as to return consistently structured `q` and `filter`
|
|
62
|
-
* values.
|
|
63
|
-
* @param so1
|
|
64
|
-
* @param so2
|
|
65
|
-
* @param join
|
|
66
|
-
* @returns
|
|
67
|
-
*/
|
|
68
|
-
export declare function mergeSearchOptions(so1: ISearchOptions, so2: ISearchOptions, join: "AND" | "OR"): ISearchOptions;
|
|
69
|
-
/**
|
|
70
|
-
* @private
|
|
71
|
-
* Serialize a `MatchOptions` into `q` or `filter` on an `ISearchOptions`
|
|
72
|
-
* DEPRECATED: Serialization should be handled in filter-utils.ts
|
|
73
|
-
* @param key
|
|
74
|
-
* @param opts
|
|
75
|
-
* @returns
|
|
76
|
-
*/
|
|
77
|
-
export declare function serializeMatchOptions(key: string, opts: IMatchOptions): ISearchOptions;
|
|
78
|
-
/**
|
|
79
|
-
* @private
|
|
80
|
-
* Serialize a DateRange<number> into a Portal Query string
|
|
81
|
-
* @param key
|
|
82
|
-
* @param range
|
|
83
|
-
* @returns
|
|
84
|
-
*/
|
|
85
|
-
export declare function serializeDateRange(key: string, range: IDateRange<number>): ISearchOptions;
|
|
86
|
-
/**
|
|
87
|
-
* @private
|
|
88
|
-
* Serialize a `string` or `string[]` into a string
|
|
89
|
-
* @param join
|
|
90
|
-
* @param key
|
|
91
|
-
* @param value
|
|
92
|
-
* @returns
|
|
93
|
-
*/
|
|
94
|
-
export declare function serializeStringOrArray(join: "AND" | "OR", key: string, value: string | string[]): string;
|
|
95
39
|
/**
|
|
96
40
|
* Create a `.next()` function for a type
|
|
97
41
|
* @param request
|
|
@@ -100,7 +44,7 @@ export declare function serializeStringOrArray(join: "AND" | "OR", key: string,
|
|
|
100
44
|
* @param fn
|
|
101
45
|
* @returns
|
|
102
46
|
*/
|
|
103
|
-
export declare function getNextFunction<T>(request: ISearchOptions, nextStart: number, total: number, fn: (r: any) => Promise<ISearchResponse<T>>): () => Promise<ISearchResponse<T>>;
|
|
47
|
+
export declare function getNextFunction<T>(request: ISearchOptions, nextStart: number, total: number, fn: (r: any) => Promise<ISearchResponse<T>>): (authentication?: UserSession) => Promise<ISearchResponse<T>>;
|
|
104
48
|
/**
|
|
105
49
|
* Construct a the full url to a group thumbnail
|
|
106
50
|
*
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic structure for returning a translatable message from
|
|
3
|
+
* one package to another, such that the calling package is responsible
|
|
4
|
+
* for the translation
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IMessage
|
|
8
|
+
*/
|
|
9
|
+
export interface IMessage {
|
|
10
|
+
/**
|
|
11
|
+
* Unique key that can be used with a i18n system in a consuming application
|
|
12
|
+
*
|
|
13
|
+
* @type {string}
|
|
14
|
+
* @memberof IMessage
|
|
15
|
+
*/
|
|
16
|
+
code: string;
|
|
17
|
+
/**
|
|
18
|
+
* English message describing the issue, for debugging only. Not intended to be shown
|
|
19
|
+
* in an application interface.
|
|
20
|
+
*
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof IMessage
|
|
23
|
+
*/
|
|
24
|
+
message: string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional data that can be sent along
|
|
27
|
+
*
|
|
28
|
+
* @type {Record<string, unknown>}
|
|
29
|
+
* @memberof IMessage
|
|
30
|
+
*/
|
|
31
|
+
data?: Record<string, unknown>;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./IMessage";
|
package/dist/types/types.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { IItem, IUser, IGroup, IPolygon, ISpatialReference, IGeometry } from "@e
|
|
|
2
2
|
import { IPortal, ISearchResult } from "@esri/arcgis-rest-portal";
|
|
3
3
|
import { UserSession } from "@esri/arcgis-rest-auth";
|
|
4
4
|
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
5
|
-
import { IFacet } from "./search";
|
|
6
5
|
/**
|
|
7
6
|
* Generic Model, used with all items that have a json
|
|
8
7
|
* `/data` payload
|
|
@@ -337,7 +336,6 @@ export interface ISearchResponse<T> {
|
|
|
337
336
|
results: T[];
|
|
338
337
|
hasNext: boolean;
|
|
339
338
|
next: (params?: any) => Promise<ISearchResponse<T>>;
|
|
340
|
-
facets?: IFacet[];
|
|
341
339
|
}
|
|
342
340
|
/**
|
|
343
341
|
* ENUM which defines File extensions.
|