@esri/hub-common 9.31.2 → 9.32.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 (59) hide show
  1. package/dist/es2017/content/_internal.js +1 -1
  2. package/dist/es2017/content/_internal.js.map +1 -1
  3. package/dist/es2017/core/types/index.js +1 -0
  4. package/dist/es2017/core/types/index.js.map +1 -1
  5. package/dist/es2017/core/types/types.js +1 -0
  6. package/dist/es2017/core/types/types.js.map +1 -0
  7. package/dist/es2017/search/types/IHubApiSearchRequest.js +1 -0
  8. package/dist/es2017/search/types/IHubApiSearchRequest.js.map +1 -0
  9. package/dist/es2017/search/types/IHubSearchOptions.js +1 -0
  10. package/dist/es2017/search/types/IHubSearchOptions.js.map +1 -0
  11. package/dist/es2017/search/types/IHubSearchResult.js +1 -0
  12. package/dist/es2017/search/types/IHubSearchResult.js.map +1 -0
  13. package/dist/es2017/search/types/index.js +3 -0
  14. package/dist/es2017/search/types/index.js.map +1 -1
  15. package/dist/esm/content/_internal.js +1 -1
  16. package/dist/esm/content/_internal.js.map +1 -1
  17. package/dist/esm/core/types/index.js +1 -0
  18. package/dist/esm/core/types/index.js.map +1 -1
  19. package/dist/esm/core/types/types.js +1 -0
  20. package/dist/esm/core/types/types.js.map +1 -0
  21. package/dist/esm/search/types/IHubApiSearchRequest.js +1 -0
  22. package/dist/esm/search/types/IHubApiSearchRequest.js.map +1 -0
  23. package/dist/esm/search/types/IHubSearchOptions.js +1 -0
  24. package/dist/esm/search/types/IHubSearchOptions.js.map +1 -0
  25. package/dist/esm/search/types/IHubSearchResult.js +1 -0
  26. package/dist/esm/search/types/IHubSearchResult.js.map +1 -0
  27. package/dist/esm/search/types/index.js +3 -0
  28. package/dist/esm/search/types/index.js.map +1 -1
  29. package/dist/node/content/_internal.js +1 -1
  30. package/dist/node/content/_internal.js.map +1 -1
  31. package/dist/node/core/types/index.js +1 -0
  32. package/dist/node/core/types/index.js.map +1 -1
  33. package/dist/node/core/types/types.js +3 -0
  34. package/dist/node/core/types/types.js.map +1 -0
  35. package/dist/node/search/types/IHubApiSearchRequest.js +3 -0
  36. package/dist/node/search/types/IHubApiSearchRequest.js.map +1 -0
  37. package/dist/node/search/types/IHubSearchOptions.js +3 -0
  38. package/dist/node/search/types/IHubSearchOptions.js.map +1 -0
  39. package/dist/node/search/types/IHubSearchResult.js +3 -0
  40. package/dist/node/search/types/IHubSearchResult.js.map +1 -0
  41. package/dist/node/search/types/index.js +3 -0
  42. package/dist/node/search/types/index.js.map +1 -1
  43. package/dist/types/content/_internal.d.ts +1 -0
  44. package/dist/types/core/types/IHubEntityBase.d.ts +15 -5
  45. package/dist/types/core/types/IHubEntityManager.d.ts +2 -1
  46. package/dist/types/core/types/IHubTimeline.d.ts +2 -4
  47. package/dist/types/core/types/index.d.ts +1 -0
  48. package/dist/types/core/types/types.d.ts +4 -0
  49. package/dist/types/search/types/IFacet.d.ts +46 -5
  50. package/dist/types/search/types/IFacetOption.d.ts +23 -1
  51. package/dist/types/search/types/IHubApiSearchRequest.d.ts +16 -0
  52. package/dist/types/search/types/IHubSearchOptions.d.ts +26 -0
  53. package/dist/types/search/types/IHubSearchResult.d.ts +60 -0
  54. package/dist/types/search/types/index.d.ts +3 -0
  55. package/dist/types/search/types/types.d.ts +20 -25
  56. package/dist/types/types.d.ts +1 -1
  57. package/dist/umd/common.umd.js +2 -2
  58. package/dist/umd/common.umd.js.map +1 -1
  59. package/package.json +1 -1
@@ -0,0 +1,60 @@
1
+ import { HubFamily, IHubGeography } from "../..";
2
+ import { AccessLevel, IHubEntityBase } from "../../core";
3
+ /**
4
+ * Standardized light-weight search result structure, applicable to all
5
+ * types of search results - users, groups, content, events etc
6
+ */
7
+ export interface IHubSearchResult extends IHubEntityBase {
8
+ /**
9
+ * Access level of the backing entity
10
+ */
11
+ access: AccessLevel;
12
+ /**
13
+ * Hub Family
14
+ */
15
+ family: HubFamily;
16
+ /**
17
+ * Owner; Applies to Items and Groups
18
+ */
19
+ owner?: string;
20
+ /**
21
+ * Fully qualified thumbnail url for items, groups, users
22
+ * Will not have the token appended. Consuming app needs to
23
+ * check the value of `access` and apply the token as needed
24
+ */
25
+ thumbnailUrl: string;
26
+ /**
27
+ * Hash of pre-computed urls
28
+ */
29
+ urls: {
30
+ /**
31
+ * Canononical ArcGIS Online Url for this entity (if applicable)
32
+ */
33
+ portalHome?: string;
34
+ /**
35
+ * Relative url, which can be appended to a Site's root Url
36
+ * e.g. /datasets/3ef8c7a, or /events/june-meeting
37
+ * This is much easier than passing a Site into the search
38
+ * system so the full url can be computed
39
+ */
40
+ relative: string;
41
+ /**
42
+ * Allow for arbitrary other urls, including `.customUrl` which
43
+ * can ben generated client-side in the gallery via a callback
44
+ */
45
+ [key: string]: string;
46
+ };
47
+ /**
48
+ * Geometry connected to this entity
49
+ * For items, it will default to the extent,
50
+ * but may be derived from a boundary resource
51
+ * or the extent of a layer
52
+ */
53
+ geometry?: IHubGeography;
54
+ /**
55
+ * Optional metadata hash
56
+ * Any specified enrichments will be attached in here, as well
57
+ * as tags, typekeywords and culture
58
+ */
59
+ metadata?: Record<string, any>;
60
+ }
@@ -2,4 +2,7 @@ export * from "./ICatalog";
2
2
  export * from "./ICollection";
3
3
  export * from "./IFacet";
4
4
  export * from "./IFacetOption";
5
+ export * from "./IHubApiSearchRequest";
6
+ export * from "./IHubSearchOptions";
7
+ export * from "./IHubSearchResult";
5
8
  export * from "./types";
@@ -1,5 +1,5 @@
1
1
  import { UserSession } from "@esri/arcgis-rest-auth";
2
- import { IHubContent, IModel } from "../..";
2
+ import { IHubContent, AccessLevel } from "../..";
3
3
  import { IFacet } from "./IFacet";
4
4
  /**
5
5
  * Generic filter used with various search functions.
@@ -24,12 +24,20 @@ import { IFacet } from "./IFacet";
24
24
  export declare type Filter<T extends FilterType> = IFilterTypeMap[T] & {
25
25
  filterType: T;
26
26
  };
27
+ /**
28
+ * Groups of filters with an operation specifying how the
29
+ * filters should be connected when serialized
30
+ */
31
+ export interface IFilterGroup<T extends FilterType> {
32
+ operation?: "AND" | "OR";
33
+ filters: Array<Filter<T>>;
34
+ }
27
35
  /**
28
36
  * Defines the valid FilterTypes for use with `Filter<T extends FilterType>`
29
37
  * See [Filter](../Filter)
30
38
  */
31
39
  export interface IFilterTypeMap {
32
- any: IAnyFilterDefinition;
40
+ item: IItemFilter;
33
41
  content: IContentFilterDefinition;
34
42
  user: IUserFilterDefinition;
35
43
  group: IGroupFilterDefinition;
@@ -40,17 +48,22 @@ export declare type FilterType = keyof IFilterTypeMap;
40
48
  * Common set of fields that are reasonable to apply at the
41
49
  * top level of a Catalog
42
50
  */
43
- export interface IAnyFilterDefinition {
44
- title?: string | string[] | IMatchOptions;
45
- access?: string | string[] | IMatchOptions;
51
+ export interface IItemFilter {
52
+ access?: AccessLevel | AccessLevel[] | IMatchOptions;
46
53
  owner?: string | string[] | IMatchOptions;
47
54
  tags?: string | string[] | IMatchOptions;
48
55
  created?: IDateRange<number> | IRelativeDate;
49
- modified?: IDateRange<number> | IRelativeDate;
50
56
  description?: string | string[] | IMatchOptions;
57
+ snippet?: string | string[] | IMatchOptions;
51
58
  group?: string | string[] | IMatchOptions;
59
+ id?: string | string[] | IMatchOptions;
60
+ modified?: IDateRange<number> | IRelativeDate;
52
61
  orgid?: string | string[] | IMatchOptions;
53
- type?: string | NamedContentFilter | Array<string | NamedContentFilter> | IMatchOptions;
62
+ term?: string;
63
+ title?: string | string[] | IMatchOptions;
64
+ type?: string | string[] | IMatchOptions;
65
+ typekeywords?: string | string[] | IMatchOptions;
66
+ [key: string]: any;
54
67
  }
55
68
  /**
56
69
  * Fields related to Content based searches
@@ -194,24 +207,6 @@ export interface IMatchOptions {
194
207
  */
195
208
  exact?: string | string[];
196
209
  }
197
- /**
198
- * Search Options
199
- */
200
- export interface IHubSearchOptions {
201
- site?: IModel;
202
- authentication?: UserSession;
203
- sortField?: string;
204
- sortOrder?: "desc" | "asc";
205
- page?: string;
206
- start?: number;
207
- num?: number;
208
- aggFields?: string[];
209
- aggLimit?: number;
210
- bbox?: string;
211
- fields?: string;
212
- api?: NamedApis | IApiDefinition;
213
- aggregations?: string[];
214
- }
215
210
  /**
216
211
  * searchContent return
217
212
  */
@@ -134,7 +134,7 @@ export declare type IRevertableTaskResult = IRevertableTaskSuccess | IRevertable
134
134
  * DEPRECATED: Use HubFamily instead
135
135
  */
136
136
  export declare type HubType = "member" | "team" | "event" | "dataset" | "document" | "map" | "app" | "site" | "initiative" | "template" | "organization";
137
- export declare type HubFamily = "people" | "team" | "event" | "dataset" | "document" | "feedback" | "map" | "app" | "site" | "initiative" | "template" | "content";
137
+ export declare type HubFamily = "app" | "content" | "dataset" | "document" | "event" | "feedback" | "initiative" | "map" | "people" | "site" | "team" | "template";
138
138
  /**
139
139
  * Visibility levels of a Hub resource
140
140
  */
@@ -1,5 +1,5 @@
1
1
  /* @preserve
2
- * @esri/hub-common - v9.31.1 - Thu May 12 2022 18:43:36 GMT+0000 (Coordinated Universal Time)
2
+ * @esri/hub-common - v9.32.0 - Wed May 18 2022 18:25:39 GMT+0000 (Coordinated Universal Time)
3
3
  * Copyright (c) 2022 Environmental Systems Research Institute, Inc.
4
4
  * Apache-2.0
5
5
  */
@@ -6885,7 +6885,7 @@
6885
6885
  */
6886
6886
  var isDataSourceOfItem = function (resource, item) {
6887
6887
  var serviceUrl = item.url && parseServiceUrl(item.url);
6888
- return serviceUrl && resource.linkage.includes(serviceUrl);
6888
+ return (serviceUrl && resource.linkage && resource.linkage.includes(serviceUrl));
6889
6889
  };
6890
6890
  /**
6891
6891
  * Returns the url for an additional resource.