@esri/hub-common 9.43.3 → 9.44.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 (71) hide show
  1. package/dist/es2017/ArcGISContext.js +1 -1
  2. package/dist/es2017/ArcGISContext.js.map +1 -1
  3. package/dist/es2017/search/Collection.js +71 -0
  4. package/dist/es2017/search/Collection.js.map +1 -0
  5. package/dist/es2017/search/_internal/ifilter-utils.js +221 -0
  6. package/dist/es2017/search/_internal/ifilter-utils.js.map +1 -0
  7. package/dist/es2017/search/_internal/portalSearchGroups.js +47 -2
  8. package/dist/es2017/search/_internal/portalSearchGroups.js.map +1 -1
  9. package/dist/es2017/search/_internal/portalSearchItems.js +95 -6
  10. package/dist/es2017/search/_internal/portalSearchItems.js.map +1 -1
  11. package/dist/es2017/search/_internal/portalSearchUsers.js +46 -1
  12. package/dist/es2017/search/_internal/portalSearchUsers.js.map +1 -1
  13. package/dist/es2017/search/filter-utils.js +1 -0
  14. package/dist/es2017/search/filter-utils.js.map +1 -1
  15. package/dist/es2017/search/hubSearch.js +38 -3
  16. package/dist/es2017/search/hubSearch.js.map +1 -1
  17. package/dist/es2017/search/types/IHubCatalog.js +1 -0
  18. package/dist/es2017/search/types/IHubCatalog.js.map +1 -0
  19. package/dist/es2017/search/types/index.js +1 -0
  20. package/dist/es2017/search/types/index.js.map +1 -1
  21. package/dist/esm/ArcGISContext.js +1 -1
  22. package/dist/esm/ArcGISContext.js.map +1 -1
  23. package/dist/esm/search/Collection.js +106 -0
  24. package/dist/esm/search/Collection.js.map +1 -0
  25. package/dist/esm/search/_internal/ifilter-utils.js +222 -0
  26. package/dist/esm/search/_internal/ifilter-utils.js.map +1 -0
  27. package/dist/esm/search/_internal/portalSearchGroups.js +50 -2
  28. package/dist/esm/search/_internal/portalSearchGroups.js.map +1 -1
  29. package/dist/esm/search/_internal/portalSearchItems.js +97 -6
  30. package/dist/esm/search/_internal/portalSearchItems.js.map +1 -1
  31. package/dist/esm/search/_internal/portalSearchUsers.js +49 -1
  32. package/dist/esm/search/_internal/portalSearchUsers.js.map +1 -1
  33. package/dist/esm/search/filter-utils.js +1 -0
  34. package/dist/esm/search/filter-utils.js.map +1 -1
  35. package/dist/esm/search/hubSearch.js +41 -3
  36. package/dist/esm/search/hubSearch.js.map +1 -1
  37. package/dist/esm/search/types/IHubCatalog.js +1 -0
  38. package/dist/esm/search/types/IHubCatalog.js.map +1 -0
  39. package/dist/esm/search/types/index.js +1 -0
  40. package/dist/esm/search/types/index.js.map +1 -1
  41. package/dist/node/ArcGISContext.js +1 -1
  42. package/dist/node/ArcGISContext.js.map +1 -1
  43. package/dist/node/search/Collection.js +75 -0
  44. package/dist/node/search/Collection.js.map +1 -0
  45. package/dist/node/search/_internal/ifilter-utils.js +226 -0
  46. package/dist/node/search/_internal/ifilter-utils.js.map +1 -0
  47. package/dist/node/search/_internal/portalSearchGroups.js +49 -3
  48. package/dist/node/search/_internal/portalSearchGroups.js.map +1 -1
  49. package/dist/node/search/_internal/portalSearchItems.js +98 -6
  50. package/dist/node/search/_internal/portalSearchItems.js.map +1 -1
  51. package/dist/node/search/_internal/portalSearchUsers.js +48 -2
  52. package/dist/node/search/_internal/portalSearchUsers.js.map +1 -1
  53. package/dist/node/search/filter-utils.js +1 -0
  54. package/dist/node/search/filter-utils.js.map +1 -1
  55. package/dist/node/search/hubSearch.js +39 -3
  56. package/dist/node/search/hubSearch.js.map +1 -1
  57. package/dist/node/search/types/IHubCatalog.js +3 -0
  58. package/dist/node/search/types/IHubCatalog.js.map +1 -0
  59. package/dist/node/search/types/index.js +1 -0
  60. package/dist/node/search/types/index.js.map +1 -1
  61. package/dist/types/search/Collection.d.ts +18 -0
  62. package/dist/types/search/_internal/ifilter-utils.d.ts +4 -0
  63. package/dist/types/search/_internal/portalSearchGroups.d.ts +12 -3
  64. package/dist/types/search/_internal/portalSearchItems.d.ts +28 -4
  65. package/dist/types/search/_internal/portalSearchUsers.d.ts +11 -2
  66. package/dist/types/search/hubSearch.d.ts +2 -1
  67. package/dist/types/search/types/IHubCatalog.d.ts +71 -0
  68. package/dist/types/search/types/index.d.ts +1 -0
  69. package/dist/umd/common.umd.js +485 -44
  70. package/dist/umd/common.umd.js.map +1 -1
  71. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hubSearch = void 0;
3
+ exports.hubSearchQuery = exports.hubSearch = void 0;
4
4
  const HubError_1 = require("../HubError");
5
5
  const objects_1 = require("../objects");
6
6
  const util_1 = require("../util");
@@ -35,6 +35,42 @@ async function hubSearch(filterGroups, options) {
35
35
  const filterType = filterGroups[0].filterType;
36
36
  // get the API
37
37
  const apiType = utils_1.expandApi(options.api || "arcgis").type;
38
+ const fnHash = {
39
+ arcgis: {
40
+ item: _internal_1.portalSearchItemsFilterGroups,
41
+ group: _internal_1.portalSearchGroupsFilterGroups,
42
+ user: portalSearchUsers_1.portalSearchUsersFilterGroups,
43
+ },
44
+ "arcgis-hub": {
45
+ item: _internal_1.hubSearchItems,
46
+ },
47
+ };
48
+ const fn = objects_1.getProp(fnHash, `${apiType}.${filterType}`);
49
+ if (!fn) {
50
+ throw new HubError_1.default(`hubSearch`, `Search via "${filterType}" filter against "${apiType}" api is not implemented`);
51
+ }
52
+ return fn(util_1.cloneObject(filterGroups), options);
53
+ }
54
+ exports.hubSearch = hubSearch;
55
+ async function hubSearchQuery(query, options) {
56
+ // Validate inputs
57
+ if (!query) {
58
+ throw new HubError_1.default("hubSearch", "Query is required.");
59
+ }
60
+ if (!query.filters || !query.filters.length) {
61
+ throw new HubError_1.default("hubSearch", "Query must contain at least one Filter.");
62
+ }
63
+ if (!options.requestOptions) {
64
+ throw new HubError_1.default("hubSearch", "requestOptions: IHubRequestOptions is required.");
65
+ }
66
+ // Ensure includes is an array
67
+ if (!options.include) {
68
+ options.include = [];
69
+ }
70
+ // Get the type of the first filterGroup
71
+ const filterType = query.targetEntity;
72
+ // get the API
73
+ const apiType = utils_1.expandApi(options.api || "arcgis").type;
38
74
  const fnHash = {
39
75
  arcgis: {
40
76
  item: _internal_1.portalSearchItems,
@@ -49,7 +85,7 @@ async function hubSearch(filterGroups, options) {
49
85
  if (!fn) {
50
86
  throw new HubError_1.default(`hubSearch`, `Search via "${filterType}" filter against "${apiType}" api is not implemented`);
51
87
  }
52
- return fn(util_1.cloneObject(filterGroups), options);
88
+ return fn(util_1.cloneObject(query), options);
53
89
  }
54
- exports.hubSearch = hubSearch;
90
+ exports.hubSearchQuery = hubSearchQuery;
55
91
  //# sourceMappingURL=hubSearch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hubSearch.js","sourceRoot":"","sources":["../../../src/search/hubSearch.ts"],"names":[],"mappings":";;;AAAA,0CAAmC;AACnC,wCAAqC;AACrC,kCAAsC;AAStC,mCAAoC;AACpC,2CAIqB;AACrB,qEAAkE;AAElE;;;;;;;;GAQG;AACI,KAAK,UAAU,SAAS,CAC7B,YAA6C,EAC7C,OAA0B;IAE1B,kBAAkB;IAClB,IAAI,CAAC,YAAY,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACjD,MAAM,IAAI,kBAAQ,CAChB,WAAW,EACX,iDAAiD,CAClD,CAAC;KACH;IACD,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;QACxB,MAAM,IAAI,kBAAQ,CAChB,WAAW,EACX,oDAAoD,CACrD,CAAC;KACH;IAED,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;QAC3B,MAAM,IAAI,kBAAQ,CAChB,WAAW,EACX,iDAAiD,CAClD,CAAC;KACH;IAED,8BAA8B;IAC9B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACpB,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;KACtB;IAED,wCAAwC;IACxC,MAAM,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,UAAwB,CAAC;IAC5D,cAAc;IACd,MAAM,OAAO,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AAO,EAAE;QACpB,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;KACtB;IAED,wCAAwC;IACxC,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC;IACtC,cAAc;IACd,MAAM,OAAO,GAAG,iBAAS,CAAC,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC,CAAC,IAAI,CAAC;IAExD,MAAM,MAAM,GAAG;QACb,MAAM,EAAE;YACN,IAAI,EAAE,6BAAiB;YACvB,KAAK,EAAE,8BAAkB;YACzB,IAAI,EAAE,qCAAiB;SACxB;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,0BAAc;SACrB;KACF,CAAC;IAEF,MAAM,EAAE,GAAG,iBAAO,CAAC,MAAM,EAAE,GAAG,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,EAAE;QACP,MAAM,IAAI,kBAAQ,CAChB,WAAW,EACX,eAAe,UAAU,qBAAqB,OAAO,0BAA0B,CAChF,CAAC;KACH;IACD,OAAO,EAAE,CAAC,kBAAW,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAhDD,wCAgDC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IHubCatalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IHubCatalog.js","sourceRoot":"","sources":["../../../../src/search/types/IHubCatalog.ts"],"names":[],"mappings":""}
@@ -10,4 +10,5 @@ tslib_1.__exportStar(require("./IHubSearchOptions"), exports);
10
10
  tslib_1.__exportStar(require("./IHubSearchResult"), exports);
11
11
  tslib_1.__exportStar(require("./IHubSearchResponse"), exports);
12
12
  tslib_1.__exportStar(require("./types"), exports);
13
+ tslib_1.__exportStar(require("./IHubCatalog"), exports);
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/search/types/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,wDAA8B;AAC9B,mDAAyB;AACzB,yDAA+B;AAC/B,iEAAuC;AACvC,8DAAoC;AACpC,6DAAmC;AACnC,+DAAqC;AACrC,kDAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/search/types/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,wDAA8B;AAC9B,mDAAyB;AACzB,yDAA+B;AAC/B,iEAAuC;AACvC,8DAAoC;AACpC,6DAAmC;AACnC,+DAAqC;AACrC,kDAAwB;AACxB,wDAA8B"}
@@ -0,0 +1,18 @@
1
+ import { IArcGISContext } from "..";
2
+ import { IHubCollection, IHubSearchOptions, IHubSearchResponse, IHubSearchResult, IQuery } from "./types";
3
+ /**
4
+ * Implements Collection behavior
5
+ */
6
+ export declare class Collection implements IHubCollection {
7
+ private _context;
8
+ private _collection;
9
+ private constructor();
10
+ static create(collection: IHubCollection, context?: IArcGISContext): Promise<Collection>;
11
+ get label(): string;
12
+ get key(): string;
13
+ get include(): string[];
14
+ get scope(): IQuery;
15
+ get sortField(): string;
16
+ get sortDirection(): "asc" | "desc";
17
+ search(query: string | IQuery, options?: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
18
+ }
@@ -0,0 +1,4 @@
1
+ import { ISearchOptions } from "@esri/arcgis-rest-portal";
2
+ import { IPredicate, IQuery } from "../types";
3
+ export declare function expandPredicate(predicate: IPredicate): IPredicate;
4
+ export declare function serializeQueryForPortal(query: IQuery): ISearchOptions;
@@ -1,9 +1,18 @@
1
- import { IFilterGroup, IHubSearchOptions, IHubSearchResponse, IHubSearchResult } from "../types";
1
+ import { IFilterGroup, IHubSearchOptions, IHubSearchResponse, IHubSearchResult, IQuery } from "../types";
2
2
  /**
3
3
  * @private
4
- * Portal Search Implementation for Items
4
+ * DEPRECATED: Use `portalSerchGroups`
5
+ * Portal Search Implementation for Groups
5
6
  * @param filterGroups
6
7
  * @param options
7
8
  * @returns
8
9
  */
9
- export declare function portalSearchGroups(filterGroups: Array<IFilterGroup<"group">>, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
10
+ export declare function portalSearchGroupsFilterGroups(filterGroups: Array<IFilterGroup<"group">>, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
11
+ /**
12
+ * @private
13
+ * Portal Search Implementation for Groups
14
+ * @param query
15
+ * @param options
16
+ * @returns
17
+ */
18
+ export declare function portalSearchGroups(query: IQuery, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
@@ -1,12 +1,20 @@
1
- import { Filter, IFilterGroup, IHubSearchOptions, IHubSearchResponse, IHubSearchResult } from "../types";
1
+ import { Filter, IFilterGroup, IHubSearchOptions, IHubSearchResponse, IHubSearchResult, IMatchOptions, IQuery } from "../types";
2
2
  /**
3
3
  * @private
4
- * Portal Search Implementation for Items
4
+ * DEPRECATED
5
5
  * @param filterGroups
6
6
  * @param options
7
7
  * @returns
8
8
  */
9
- export declare function portalSearchItems(filterGroups: Array<IFilterGroup<"item">>, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
9
+ export declare function portalSearchItemsFilterGroups(filterGroups: Array<IFilterGroup<"item">>, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
10
+ /**
11
+ * @private
12
+ * Portal Search Implementation for Items
13
+ * @param query
14
+ * @param options
15
+ * @returns
16
+ */
17
+ export declare function portalSearchItems(query: IQuery, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
10
18
  interface IWellKnownItemFilters {
11
19
  $application: Array<Filter<"item">>;
12
20
  $feedback: Array<Filter<"item">>;
@@ -39,5 +47,21 @@ export declare const WellKnownItemFilters: IWellKnownItemFilters;
39
47
  * Only exported to enable extensive testing
40
48
  * @param filterGroups
41
49
  */
42
- export declare function applyWellKnownItemFilters(filterGroups: Array<IFilterGroup<"item">>): Array<IFilterGroup<"item">>;
50
+ export declare function applyWellKnownItemPredicates(query: IQuery): IQuery;
51
+ /**
52
+ * DEPRECATED
53
+ * @param filterGroups
54
+ * @returns
55
+ */
56
+ export declare function applyWellKnownItemFilterGroups(filterGroups: Array<IFilterGroup<"item">>): Array<IFilterGroup<"item">>;
57
+ /**
58
+ * Is the argument a well-known type "key"
59
+ *
60
+ * Accepts `string`, `string[]` or `IMatchOptions`
61
+ * but only string values can possibly be keys
62
+ * on `WellKnownItemFilters`
63
+ * @param key
64
+ * @returns
65
+ */
66
+ export declare function isWellKnownTypeFilter(key: string | string[] | IMatchOptions): boolean;
43
67
  export {};
@@ -1,8 +1,17 @@
1
- import { IFilterGroup, IHubSearchOptions, IHubSearchResponse, IHubSearchResult } from "../types";
1
+ import { IFilterGroup, IHubSearchOptions, IHubSearchResponse, IHubSearchResult, IQuery } from "../types";
2
2
  /**
3
3
  * @private
4
+ * DEPRECATED: Use `portalSearchUsers`
4
5
  * Portal Search implementation for Users
5
6
  * @param filterGroups
6
7
  * @param options
7
8
  */
8
- export declare function portalSearchUsers(filterGroups: Array<IFilterGroup<"user">>, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
9
+ export declare function portalSearchUsersFilterGroups(filterGroups: Array<IFilterGroup<"user">>, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
10
+ /**
11
+ * @private
12
+ * Portal Search Implementation for Users
13
+ * @param filterGroups
14
+ * @param options
15
+ * @returns
16
+ */
17
+ export declare function portalSearchUsers(query: IQuery, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
@@ -1,4 +1,4 @@
1
- import { IFilterGroup, FilterType, IHubSearchOptions, IHubSearchResponse, IHubSearchResult } from "./types";
1
+ import { IFilterGroup, FilterType, IHubSearchOptions, IHubSearchResponse, IHubSearchResult, IQuery } from "./types";
2
2
  /**
3
3
  * Main Search function for ArcGIS Hub
4
4
  *
@@ -9,3 +9,4 @@ import { IFilterGroup, FilterType, IHubSearchOptions, IHubSearchResponse, IHubSe
9
9
  * @returns
10
10
  */
11
11
  export declare function hubSearch(filterGroups: Array<IFilterGroup<FilterType>>, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
12
+ export declare function hubSearchQuery(query: IQuery, options: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
@@ -0,0 +1,71 @@
1
+ export interface IHubCatalog {
2
+ /**
3
+ * Title for the Gallery
4
+ */
5
+ title?: string;
6
+ /**
7
+ * Filter defines the "scopes" of the Catalog, on a per entity type basis
8
+ */
9
+ scopes?: ICatalogScope;
10
+ /**
11
+ * Collections within the Catalog
12
+ */
13
+ collections?: IHubCollection[];
14
+ }
15
+ export interface ICatalogScope extends Record<EntityType, IQuery> {
16
+ }
17
+ export interface IHubCollection {
18
+ /**
19
+ * String to show in the UI. translated.
20
+ */
21
+ label: string;
22
+ /**
23
+ * Unique key, used for query params and telemetry
24
+ */
25
+ key: string;
26
+ /**
27
+ * Specify the includes to be requested when working with this collection
28
+ */
29
+ include?: string[];
30
+ /**
31
+ * Default query for the Collection
32
+ */
33
+ scope: IQuery;
34
+ /**
35
+ * Default sort field for the Collection
36
+ */
37
+ sortField?: string;
38
+ /**
39
+ * Default sort direction for the Collection
40
+ */
41
+ sortDirection?: "asc" | "desc";
42
+ }
43
+ export declare type EntityType = "item" | "group" | "user" | "groupMember" | "event";
44
+ export interface IQuery {
45
+ /**
46
+ * What entity is this query targeting. This is used internally to
47
+ * ensure we query the correct API
48
+ */
49
+ targetEntity: EntityType;
50
+ /**
51
+ * Filters that make up the query
52
+ */
53
+ filters: IFilter[];
54
+ /**
55
+ * Additional properties. Useful for groupMember queries
56
+ * where we need to send in the groupId to construct the url
57
+ */
58
+ properties?: Record<string, any>;
59
+ }
60
+ export interface IFilter {
61
+ /**
62
+ * Operation used to combine the predicates
63
+ */
64
+ operation?: "AND" | "OR";
65
+ /**
66
+ * Predicates
67
+ */
68
+ predicates: IPredicate[];
69
+ }
70
+ export interface IPredicate extends Record<string, any> {
71
+ }
@@ -7,3 +7,4 @@ export * from "./IHubSearchOptions";
7
7
  export * from "./IHubSearchResult";
8
8
  export * from "./IHubSearchResponse";
9
9
  export * from "./types";
10
+ export * from "./IHubCatalog";