@esri/hub-common 14.169.0 → 14.171.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 (161) hide show
  1. package/dist/esm/content/_internal/ContentBusinessRules.js +6 -0
  2. package/dist/esm/content/_internal/ContentBusinessRules.js.map +1 -1
  3. package/dist/esm/core/_internal/getBasePropertyMap.js +1 -1
  4. package/dist/esm/core/_internal/getBasePropertyMap.js.map +1 -1
  5. package/dist/esm/core/types/IHubProject.js.map +1 -1
  6. package/dist/esm/discussions/defaults.js +2 -0
  7. package/dist/esm/discussions/defaults.js.map +1 -1
  8. package/dist/esm/events/_internal/EventSchemaEdit.js +1 -1
  9. package/dist/esm/events/_internal/EventSchemaEdit.js.map +1 -1
  10. package/dist/esm/events/_internal/EventUiSchemaEdit.js +0 -8
  11. package/dist/esm/events/_internal/EventUiSchemaEdit.js.map +1 -1
  12. package/dist/esm/events/defaults.js +1 -1
  13. package/dist/esm/events/defaults.js.map +1 -1
  14. package/dist/esm/groups/index.js +1 -0
  15. package/dist/esm/groups/index.js.map +1 -1
  16. package/dist/esm/groups/isOpenDataGroup.js +2 -0
  17. package/dist/esm/groups/isOpenDataGroup.js.map +1 -0
  18. package/dist/esm/index.js +5 -0
  19. package/dist/esm/index.js.map +1 -1
  20. package/dist/esm/initiatives/defaults.js +2 -0
  21. package/dist/esm/initiatives/defaults.js.map +1 -1
  22. package/dist/esm/permissions/HubPermissionPolicies.js +4 -0
  23. package/dist/esm/permissions/HubPermissionPolicies.js.map +1 -1
  24. package/dist/esm/permissions/checkPermission.js +16 -14
  25. package/dist/esm/permissions/checkPermission.js.map +1 -1
  26. package/dist/esm/permissions/types/Permission.js +1 -0
  27. package/dist/esm/permissions/types/Permission.js.map +1 -1
  28. package/dist/esm/projects/defaults.js +2 -0
  29. package/dist/esm/projects/defaults.js.map +1 -1
  30. package/dist/esm/search/Catalog.js +85 -54
  31. package/dist/esm/search/Catalog.js.map +1 -1
  32. package/dist/esm/search/_internal/getCatalogGroups.js +51 -0
  33. package/dist/esm/search/_internal/getCatalogGroups.js.map +1 -0
  34. package/dist/esm/search/_internal/getEntityTypeFromType.js +1 -1
  35. package/dist/esm/search/_internal/getUserGroupsFromQuery.js +46 -0
  36. package/dist/esm/search/_internal/getUserGroupsFromQuery.js.map +1 -0
  37. package/dist/esm/search/_internal/getWorkflowForType.js +211 -0
  38. package/dist/esm/search/_internal/getWorkflowForType.js.map +1 -0
  39. package/dist/esm/search/_internal/index.js +2 -0
  40. package/dist/esm/search/_internal/index.js.map +1 -1
  41. package/dist/esm/search/_internal/negateGroupPredicates.js +2 -2
  42. package/dist/esm/search/_internal/negateGroupPredicates.js.map +1 -1
  43. package/dist/esm/search/_internal/portalSearchItems.js +12 -2
  44. package/dist/esm/search/_internal/portalSearchItems.js.map +1 -1
  45. package/dist/esm/search/getAddContentConfig.js +230 -0
  46. package/dist/esm/search/getAddContentConfig.js.map +1 -0
  47. package/dist/esm/search/getPredicateValues.js +32 -0
  48. package/dist/esm/search/getPredicateValues.js.map +1 -0
  49. package/dist/esm/search/searchCatalogs.js +66 -0
  50. package/dist/esm/search/searchCatalogs.js.map +1 -0
  51. package/dist/esm/search/searchEntityCatalogs.js +19 -0
  52. package/dist/esm/search/searchEntityCatalogs.js.map +1 -0
  53. package/dist/esm/search/serializeQueryForPortal.js +4 -4
  54. package/dist/esm/search/serializeQueryForPortal.js.map +1 -1
  55. package/dist/esm/search/types/AddContentWorkflowTypes.js +1 -0
  56. package/dist/esm/search/types/AddContentWorkflowTypes.js.map +1 -0
  57. package/dist/esm/search/types/IGroupsByMembership.js +4 -0
  58. package/dist/esm/search/types/IGroupsByMembership.js.map +1 -0
  59. package/dist/esm/search/types/index.js +1 -1
  60. package/dist/esm/search/types/index.js.map +1 -1
  61. package/dist/esm/sites/_internal/getPropertyMap.js +1 -0
  62. package/dist/esm/sites/_internal/getPropertyMap.js.map +1 -1
  63. package/dist/esm/sites/defaults.js +2 -0
  64. package/dist/esm/sites/defaults.js.map +1 -1
  65. package/dist/node/content/_internal/ContentBusinessRules.js +6 -0
  66. package/dist/node/content/_internal/ContentBusinessRules.js.map +1 -1
  67. package/dist/node/core/_internal/getBasePropertyMap.js +1 -1
  68. package/dist/node/core/_internal/getBasePropertyMap.js.map +1 -1
  69. package/dist/node/core/types/IHubProject.js.map +1 -1
  70. package/dist/node/discussions/defaults.js +2 -0
  71. package/dist/node/discussions/defaults.js.map +1 -1
  72. package/dist/node/events/_internal/EventSchemaEdit.js +1 -1
  73. package/dist/node/events/_internal/EventSchemaEdit.js.map +1 -1
  74. package/dist/node/events/_internal/EventUiSchemaEdit.js +0 -8
  75. package/dist/node/events/_internal/EventUiSchemaEdit.js.map +1 -1
  76. package/dist/node/events/defaults.js +1 -1
  77. package/dist/node/events/defaults.js.map +1 -1
  78. package/dist/node/groups/index.js +1 -0
  79. package/dist/node/groups/index.js.map +1 -1
  80. package/dist/node/groups/isOpenDataGroup.js +5 -0
  81. package/dist/node/groups/isOpenDataGroup.js.map +1 -0
  82. package/dist/node/index.js +5 -0
  83. package/dist/node/index.js.map +1 -1
  84. package/dist/node/initiatives/defaults.js +2 -0
  85. package/dist/node/initiatives/defaults.js.map +1 -1
  86. package/dist/node/permissions/HubPermissionPolicies.js +4 -0
  87. package/dist/node/permissions/HubPermissionPolicies.js.map +1 -1
  88. package/dist/node/permissions/checkPermission.js +16 -14
  89. package/dist/node/permissions/checkPermission.js.map +1 -1
  90. package/dist/node/permissions/types/Permission.js +1 -0
  91. package/dist/node/permissions/types/Permission.js.map +1 -1
  92. package/dist/node/projects/defaults.js +2 -0
  93. package/dist/node/projects/defaults.js.map +1 -1
  94. package/dist/node/search/Catalog.js +85 -54
  95. package/dist/node/search/Catalog.js.map +1 -1
  96. package/dist/node/search/_internal/getCatalogGroups.js +55 -0
  97. package/dist/node/search/_internal/getCatalogGroups.js.map +1 -0
  98. package/dist/node/search/_internal/getEntityTypeFromType.js +1 -1
  99. package/dist/node/search/_internal/getUserGroupsFromQuery.js +50 -0
  100. package/dist/node/search/_internal/getUserGroupsFromQuery.js.map +1 -0
  101. package/dist/node/search/_internal/getWorkflowForType.js +216 -0
  102. package/dist/node/search/_internal/getWorkflowForType.js.map +1 -0
  103. package/dist/node/search/_internal/index.js +2 -0
  104. package/dist/node/search/_internal/index.js.map +1 -1
  105. package/dist/node/search/_internal/negateGroupPredicates.js +1 -1
  106. package/dist/node/search/_internal/negateGroupPredicates.js.map +1 -1
  107. package/dist/node/search/_internal/portalSearchItems.js +15 -4
  108. package/dist/node/search/_internal/portalSearchItems.js.map +1 -1
  109. package/dist/node/search/getAddContentConfig.js +234 -0
  110. package/dist/node/search/getAddContentConfig.js.map +1 -0
  111. package/dist/node/search/getPredicateValues.js +36 -0
  112. package/dist/node/search/getPredicateValues.js.map +1 -0
  113. package/dist/node/search/searchCatalogs.js +70 -0
  114. package/dist/node/search/searchCatalogs.js.map +1 -0
  115. package/dist/node/search/searchEntityCatalogs.js +23 -0
  116. package/dist/node/search/searchEntityCatalogs.js.map +1 -0
  117. package/dist/node/search/serializeQueryForPortal.js +4 -4
  118. package/dist/node/search/serializeQueryForPortal.js.map +1 -1
  119. package/dist/node/search/types/{ISearchResponseHash.js → AddContentWorkflowTypes.js} +1 -1
  120. package/dist/node/search/types/AddContentWorkflowTypes.js.map +1 -0
  121. package/dist/node/search/types/IGroupsByMembership.js +6 -0
  122. package/dist/node/search/types/IGroupsByMembership.js.map +1 -0
  123. package/dist/node/search/types/index.js +1 -1
  124. package/dist/node/search/types/index.js.map +1 -1
  125. package/dist/node/sites/_internal/getPropertyMap.js +1 -0
  126. package/dist/node/sites/_internal/getPropertyMap.js.map +1 -1
  127. package/dist/node/sites/defaults.js +2 -0
  128. package/dist/node/sites/defaults.js.map +1 -1
  129. package/dist/types/content/_internal/ContentBusinessRules.d.ts +1 -1
  130. package/dist/types/core/traits/IWithCatalog.d.ts +9 -0
  131. package/dist/types/core/types/IHubDiscussion.d.ts +4 -2
  132. package/dist/types/core/types/IHubEvent.d.ts +4 -2
  133. package/dist/types/core/types/IHubInitiative.d.ts +5 -2
  134. package/dist/types/core/types/IHubItemEntity.d.ts +3 -1
  135. package/dist/types/core/types/IHubProject.d.ts +3 -2
  136. package/dist/types/core/types/IHubSite.d.ts +11 -3
  137. package/dist/types/groups/index.d.ts +1 -0
  138. package/dist/types/groups/isOpenDataGroup.d.ts +2 -0
  139. package/dist/types/index.d.ts +5 -0
  140. package/dist/types/search/Catalog.d.ts +15 -12
  141. package/dist/types/search/_internal/getCatalogGroups.d.ts +11 -0
  142. package/dist/types/search/_internal/getEntityTypeFromType.d.ts +1 -1
  143. package/dist/types/search/_internal/getUserGroupsFromQuery.d.ts +13 -0
  144. package/dist/types/search/_internal/getWorkflowForType.d.ts +61 -0
  145. package/dist/types/search/_internal/index.d.ts +2 -0
  146. package/dist/types/search/_internal/portalSearchItems.d.ts +7 -0
  147. package/dist/types/search/getAddContentConfig.d.ts +11 -0
  148. package/dist/types/search/getPredicateValues.d.ts +8 -0
  149. package/dist/types/search/searchCatalogs.d.ts +15 -0
  150. package/dist/types/search/searchEntityCatalogs.d.ts +15 -0
  151. package/dist/types/search/types/AddContentWorkflowTypes.d.ts +36 -0
  152. package/dist/types/search/types/IGroupsByMembership.d.ts +22 -0
  153. package/dist/types/search/types/IHubCatalog.d.ts +14 -0
  154. package/dist/types/search/types/IHubSearchOptions.d.ts +29 -17
  155. package/dist/types/search/types/index.d.ts +1 -1
  156. package/dist/types/search/types/types.d.ts +16 -0
  157. package/package.json +1 -1
  158. package/dist/esm/search/types/ISearchResponseHash.js +0 -1
  159. package/dist/esm/search/types/ISearchResponseHash.js.map +0 -1
  160. package/dist/node/search/types/ISearchResponseHash.js.map +0 -1
  161. package/dist/types/search/types/ISearchResponseHash.d.ts +0 -7
@@ -1,12 +1,16 @@
1
1
  import { IExtent } from "@esri/arcgis-rest-feature-layer";
2
2
  import { IWithVersioningBehavior } from "../behaviors";
3
- import { IWithCatalog, IWithLayout, IWithPermissions, IWithSlug } from "../traits/index";
4
3
  import { IHubItemEntity, IHubItemEntityEditor } from "./IHubItemEntity";
4
+ import { IWithSlug } from "../traits/IWithSlug";
5
+ import { IWithCatalog, IWithCatalogs } from "../traits/IWithCatalog";
6
+ import { IWithLayout } from "../traits/IWithLayout";
7
+ import { IWithPermissions } from "../traits/IWithPermissions";
5
8
  /**
6
9
  * DRAFT: Under development and more properties will likely be added
7
10
  * @internal
8
11
  */
9
- export interface IHubSite extends IHubItemEntity, IWithSlug, IWithCatalog, IWithLayout, IWithPermissions, IWithVersioningBehavior {
12
+ export interface IHubSite extends IHubItemEntity, IWithSlug, IWithCatalog, // DEPRECATED: Use IWithCatalogs instead
13
+ IWithCatalogs, IWithLayout, IWithPermissions, IWithVersioningBehavior {
10
14
  /**
11
15
  * Array of minimal page objects
12
16
  */
@@ -69,9 +73,13 @@ export interface IHubSite extends IHubItemEntity, IWithSlug, IWithCatalog, IWith
69
73
  /** Legacy teams - list of ids */
70
74
  legacyTeams: string[];
71
75
  /**
72
- * True when the site is a "Hub Home" site
76
+ * True when the site is a "Hub Home" site for an organization
73
77
  */
74
78
  isHubHome: boolean;
79
+ /**
80
+ * True when the site is the "Umbrella" site for an environment (i.e. hub.arcgis.com)
81
+ */
82
+ isUmbrella: boolean;
75
83
  }
76
84
  export declare type IHubSiteEditor = IHubItemEntityEditor<IHubSite> & {
77
85
  _discussions?: boolean;
@@ -5,6 +5,7 @@ export * from "./HubGroups";
5
5
  export * from "./HubGroup";
6
6
  export * from "./addGroupMembers";
7
7
  export * from "./getWellKnownGroup";
8
+ export * from "./isOpenDataGroup";
8
9
  export * from "./autoAddUsers";
9
10
  export * from "./inviteUsers";
10
11
  export * from "./emailOrgUsers";
@@ -0,0 +1,2 @@
1
+ import { IGroup } from "@esri/arcgis-rest-types";
2
+ export declare const isOpenDataGroup: (group: IGroup) => boolean;
@@ -39,6 +39,11 @@ export * from "./core/updateHubEntity";
39
39
  export * from "./urls/getCardModelUrl";
40
40
  export * from "./core/EntityEditor";
41
41
  export * from "./search/explainQueryResult";
42
+ export * from "./search/searchEntityCatalogs";
43
+ export * from "./search/searchCatalogs";
44
+ export * from "./search/getAddContentConfig";
45
+ export * from "./search/_internal/getCatalogGroups";
46
+ export * from "./search/getPredicateValues";
42
47
  export * from "./core/hubHistory";
43
48
  import OperationStack from "./OperationStack";
44
49
  import OperationError from "./OperationError";
@@ -108,7 +108,7 @@ export declare class Catalog implements IHubCatalog {
108
108
  /**
109
109
  * Search for Items
110
110
  * Will throw if the Catalog does not have a scope defined for items
111
- * @param query
111
+ * @param query - string or IQuery
112
112
  * @param options
113
113
  * @returns
114
114
  */
@@ -123,7 +123,7 @@ export declare class Catalog implements IHubCatalog {
123
123
  /**
124
124
  * Search for Groups
125
125
  * Will throw if the Catalog does not have a scope defined for groups
126
- * @param query
126
+ * @param query - string or IQuery
127
127
  * @param options
128
128
  * @returns
129
129
  */
@@ -131,29 +131,32 @@ export declare class Catalog implements IHubCatalog {
131
131
  /**
132
132
  * Search for Users
133
133
  * Will throw if the Catalog does not have a scope defined for users
134
- * @param query
134
+ * @param query - string or IQuery
135
135
  * @param options
136
136
  * @returns
137
137
  */
138
138
  searchUsers(query: string | IQuery, options?: IHubSearchOptions): Promise<IHubSearchResponse<IHubSearchResult>>;
139
139
  /**
140
- * Execute a search against all the collections in the Catalog
141
- * @param query
140
+ * Execute a term search against all the collections in the Catalog
141
+ * or an IQuery against all collections that match the targetEntity.
142
+ * Note: This will not search scopes which do not have corresponding collections.
143
+ * If you want that behavior, use `searchCatalogs` function instead.
144
+ * @param query - string or IQuery
142
145
  * @param options
143
146
  * @returns
144
147
  */
145
- searchCollections(query: string, options?: IHubSearchOptions): Promise<ISearchResponseHash>;
148
+ searchCollections(query: string | IQuery, options?: IHubSearchOptions): Promise<ISearchResponseHash>;
146
149
  /**
147
- * Execute a search against all the scopes in the Catalog
148
- * @param query
150
+ * Execute a term search against all the scopes in the Catalog
151
+ * @param query - term or IQuery
149
152
  * @param options
150
153
  * @returns
151
154
  */
152
- searchScopes(query: string, options?: IHubSearchOptions): Promise<ISearchResponseHash>;
155
+ searchScopes(query: string | IQuery, options?: IHubSearchOptions, limitTo?: EntityType[]): Promise<ISearchResponseHash>;
153
156
  /**
154
- * Execute a search against the Catalog as a whole
155
- * @param query
156
- * @param targetEntity
157
+ * Execute a term search or IQuery search against the Catalog.
158
+ * @param query - term or IQuery
159
+ * @param options
157
160
  * @returns
158
161
  */
159
162
  private search;
@@ -0,0 +1,11 @@
1
+ import { IArcGISContext } from "../../ArcGISContext";
2
+ import { IGroupsByMembership } from "../types/IGroupsByMembership";
3
+ import { IHubCatalog } from "../types/IHubCatalog";
4
+ /**
5
+ * Return an IGroupsByMembership object that contains all the groups, from all the
6
+ * collections/scopes in the catalog, which the current user is an owner/member/admin of.
7
+ * @param catalog
8
+ * @param context
9
+ * @returns
10
+ */
11
+ export declare function getCatalogGroups(catalog: IHubCatalog, context: IArcGISContext): IGroupsByMembership;
@@ -1,7 +1,7 @@
1
1
  import { EntityType } from "../types";
2
2
  /**
3
3
  * @private
4
- * Given a type (e.g. Hub Site Application) return the appropriate entity type
4
+ * Given a type (e.g. "Hub Site Application") return the appropriate entity type
5
5
  * that can be used as a `targetEntity` in an `IQuery`
6
6
  * @param type
7
7
  * @returns
@@ -0,0 +1,13 @@
1
+ import { IUser } from "@esri/arcgis-rest-types";
2
+ import { IGroupsByMembership } from "../types/IGroupsByMembership";
3
+ import { IQuery } from "../types/IHubCatalog";
4
+ /**
5
+ * Given a query and a user, return an object with the set of groups
6
+ * that are in the Query, and which the user is a member of, split by
7
+ * membership type.
8
+ * NOTE: This excludes viewOnly groups the user is just a member of.
9
+ * @param query
10
+ * @param user
11
+ * @returns
12
+ */
13
+ export declare function getUserGroupsFromQuery(query: IQuery, user: IUser): IGroupsByMembership;
@@ -0,0 +1,61 @@
1
+ import { IArcGISContext } from "../../ArcGISContext";
2
+ import { Permission } from "../../permissions/types/Permission";
3
+ import { EntityType } from "../types/IHubCatalog";
4
+ /**
5
+ * @internal
6
+ * Define the workflows that are available for each content type
7
+ */
8
+ export interface ITypeWorkflow {
9
+ /**
10
+ * The "type" the workflow applies to. This is not strictly an Item Type,
11
+ * it can also be an abstraction like "document", as well as things like Group
12
+ * or Event which are not item-backed.
13
+ */
14
+ type: string;
15
+ /**
16
+ * The target entity type for the type
17
+ */
18
+ targetEntity: EntityType;
19
+ /**
20
+ * The workflows that are available for the type
21
+ */
22
+ workflows: ContentWorkflow[];
23
+ /**
24
+ * Additional properties that may apply to some workflows
25
+ * e.g. upload file types for the type
26
+ */
27
+ properties?: Record<string, any>;
28
+ }
29
+ /**
30
+ * @internal
31
+ * Structure that defines the permission checks and workflows for each content type
32
+ */
33
+ export interface ITypeWorkflowDefinition extends ITypeWorkflow {
34
+ /**
35
+ * The permission required to create content of this type
36
+ */
37
+ permission: Permission;
38
+ }
39
+ /**
40
+ * @internal
41
+ * Define the workflows
42
+ */
43
+ export declare type ContentWorkflow = "create" | "upload" | "existing";
44
+ /**
45
+ * Given a type and context, return the workflows that are available to the user.
46
+ * This checks the permissions for defined for the type, and if the user has the
47
+ * permission, returns the workflows defined for the type.
48
+ * @param type
49
+ * @param context
50
+ * @returns
51
+ */
52
+ export declare function getWorkflowForType(type: string, context: IArcGISContext): ITypeWorkflow;
53
+ /**
54
+ * Return a list of types to use as the "default" types a user could possibly
55
+ * create / add (depending on permissions and group access).
56
+ * This list is used when an IQuery does not have type predicates, which
57
+ * we interpret as "all types", which is this list.
58
+ * @param context
59
+ * @returns
60
+ */
61
+ export declare function getDefaultCreateableTypes(context: IArcGISContext, limitTo?: EntityType[]): string[];
@@ -5,3 +5,5 @@ export * from "./portalSearchUsers";
5
5
  export * from "./hubSearchChannels";
6
6
  export * from "./hubSearchEvents";
7
7
  export * from "./hubSearchEventAttendees";
8
+ export * from "./getWorkflowForType";
9
+ export * from "./getCatalogGroups";
@@ -25,6 +25,13 @@ export declare function portalSearchItemsAsItems(query: IQuery, options: IHubSea
25
25
  * @returns IQuery
26
26
  */
27
27
  export declare function expandQuery(query: IQuery): IQuery;
28
+ /**
29
+ * Expand the predicates in a query without applying
30
+ * the well-known type expansions
31
+ * @param query
32
+ * @returns
33
+ */
34
+ export declare function expandPredicates(query: IQuery): IQuery;
28
35
  /**
29
36
  * Convert an `IItem` to a `IHubSearchResult`
30
37
  * Fetches the enrichments, and attaches them as directed in the `include` list
@@ -0,0 +1,11 @@
1
+ import { IArcGISContext } from "../ArcGISContext";
2
+ import { IHubCatalog, IQuery } from "./types/IHubCatalog";
3
+ import { IAddContentWorkflowConfig } from "./types/AddContentWorkflowTypes";
4
+ /**
5
+ * Get the add content configuration, given nothing, or a catalog or query.
6
+ * Delegates to the appropriate function based on the type of the input.
7
+ * @param context
8
+ * @param catalogOrQuery
9
+ * @returns
10
+ */
11
+ export declare function getAddContentConfig(context: IArcGISContext, catalogOrQuery?: IQuery | IHubCatalog): IAddContentWorkflowConfig;
@@ -0,0 +1,8 @@
1
+ import { IQuery } from "..";
2
+ /**
3
+ * Get all the values for a predicate in a query
4
+ * @param predicateProp The predicate property to get the values for
5
+ * @param query The query to get the values from
6
+ * @returns An array of all the values for the predicate
7
+ */
8
+ export declare function getPredicateValues(predicateProp: string, query: IQuery, props?: string[]): string[];
@@ -0,0 +1,15 @@
1
+ import { IArcGISContext } from "../ArcGISContext";
2
+ import { ICatalogSearchResponse, IHubCatalog, IPagingOptions, IQuery, ISortOptions } from "./types";
3
+ /**
4
+ * Given an array of catalog json objects, execute a search on all the collections
5
+ * in all the catalogs. If a scope exists without any associated collections in the catalog,
6
+ * the scope will be searched as well.
7
+ * If passed an IQuery, only collections using the same targetEntity will be searched
8
+ * If passed a string, a query will be executed on all collections in all catalogs
9
+ * @param catalogs
10
+ * @param query - string or IQuery
11
+ * @param options - IPagingOptions & ISortOptions - only num is used
12
+ * @param context
13
+ * @returns
14
+ */
15
+ export declare function searchCatalogs(catalogs: IHubCatalog[], query: string | IQuery, options: IPagingOptions & ISortOptions, context: IArcGISContext): Promise<ICatalogSearchResponse[]>;
@@ -0,0 +1,15 @@
1
+ import { IArcGISContext } from "../ArcGISContext";
2
+ import { HubEntity } from "../core";
3
+ import { ICatalogSearchResponse, IPagingOptions, IQuery, ISortOptions } from "./types";
4
+ /**
5
+ * Given an entity, execute a search on all the catalogs, and their associated with the entity
6
+ * If the entity has no catalogs, an empty array is returned
7
+ * If passed an IQuery, only collections using the same targetEntity will be searched
8
+ * If passed a string, a query will be executed on all collections in all catalogs
9
+ * @param entity
10
+ * @param query - string or IQuery
11
+ * @param options - IPagingOptions & ISortOptions - only num is used
12
+ * @param context
13
+ * @returns
14
+ */
15
+ export declare function searchEntityCatalogs(entity: HubEntity, query: string | IQuery, options: IPagingOptions & ISortOptions, context: IArcGISContext): Promise<ICatalogSearchResponse[]>;
@@ -0,0 +1,36 @@
1
+ import { IGroupsByMembership } from "./IGroupsByMembership";
2
+ import { EntityType, IQuery } from "./IHubCatalog";
3
+ /**
4
+ * `AddContentWorkflow` is a string literal type that
5
+ * defines the possible "Add Content" workflows
6
+ */
7
+ export declare type AddContentWorkflow = "create" | "upload" | "existing";
8
+ /**
9
+ * `IAddContentWorkflowConfig` is an interface that defines the
10
+ * configuration for the "Add Content" workflows
11
+ */
12
+ export interface IAddContentWorkflowConfig {
13
+ create?: IAddContentCreateWorkflowConfig;
14
+ upload?: IAddContentUploadWorkflowConfig;
15
+ existing?: IAddContentExistingWorkflowConfig;
16
+ state: "enabled" | "disabled";
17
+ reason?: "no-permission" | "not-in-groups" | "invalid-object" | "unsupported-target-entity";
18
+ }
19
+ export declare type AddContentWorkflowConfig = IAddContentCreateWorkflowConfig | IAddContentExistingWorkflowConfig | IAddContentUploadWorkflowConfig;
20
+ interface IAddContentWorkflowBaseConfig {
21
+ targetEntity: EntityType;
22
+ workflow: AddContentWorkflow;
23
+ types: string[];
24
+ groups?: IGroupsByMembership;
25
+ }
26
+ export interface IAddContentCreateWorkflowConfig extends IAddContentWorkflowBaseConfig {
27
+ workflow: "create";
28
+ }
29
+ export interface IAddContentExistingWorkflowConfig extends IAddContentWorkflowBaseConfig {
30
+ workflow: "existing";
31
+ query: IQuery;
32
+ }
33
+ export interface IAddContentUploadWorkflowConfig extends IAddContentWorkflowBaseConfig {
34
+ workflow: "upload";
35
+ }
36
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Arrays of groupId's, based on the user's membership in the group
3
+ */
4
+ export interface IGroupsByMembership {
5
+ /**
6
+ * Groups where the user is the owner, allowing them
7
+ * to add / remove members, as well as share content
8
+ * they do not own
9
+ */
10
+ owner: string[];
11
+ /**
12
+ * Groups where the user is an admin, allowing them
13
+ * to add / remove members, as well as share content
14
+ * they do not own
15
+ */
16
+ admin: string[];
17
+ /**
18
+ * Groups where the user is a member. ViewOnly groups
19
+ * will not be included in this list.
20
+ */
21
+ member: string[];
22
+ }
@@ -4,6 +4,10 @@ export interface IHubCatalog {
4
4
  * Title for the Gallery
5
5
  */
6
6
  title?: string;
7
+ /**
8
+ * Optional Emoji to show in the UI
9
+ */
10
+ emojii?: string;
7
11
  /**
8
12
  * Filter defines the "scopes" of the Catalog, on a per entity type basis
9
13
  */
@@ -16,6 +20,16 @@ export interface IHubCatalog {
16
20
  * Schema Version
17
21
  */
18
22
  schemaVersion: number;
23
+ /**
24
+ * Hashes to verify the integrity of the catalog
25
+ * Only verified when the catalog is loaded into the editor
26
+ * If the hashes do not match, the catalog will not be loaded
27
+ * and the user will simply have the option to reset the catalog
28
+ */
29
+ integrity?: {
30
+ scopes: string;
31
+ collections: string;
32
+ };
19
33
  }
20
34
  export interface ICatalogScope extends Partial<Record<EntityType, IQuery>> {
21
35
  }
@@ -3,10 +3,38 @@ import { IHubRequestOptions } from "../../types";
3
3
  import { EntityType } from "./IHubCatalog";
4
4
  import { NamedApis, IApiDefinition } from "./types";
5
5
  export declare type Enrichments = "data" | "metadata" | "org" | "service" | "layers";
6
+ /**
7
+ * Paging Options
8
+ * Separated out from IHubSearchOptions to allow for reuse
9
+ */
10
+ export interface IPagingOptions {
11
+ /**
12
+ * Maximum number of results to return, per-page
13
+ */
14
+ num?: number;
15
+ /**
16
+ * The result number of the first entry in the result set response. The start parameter, along with the num parameter, can be used to paginate the search results.
17
+ */
18
+ start?: number;
19
+ }
20
+ /**
21
+ * Sorting Options
22
+ * Separated out from IHubSearchOptions to allow for reuse
23
+ */
24
+ export interface ISortOptions {
25
+ /**
26
+ * What field should the results be sorted on
27
+ */
28
+ sortField?: string;
29
+ /**
30
+ * Sort direction
31
+ */
32
+ sortOrder?: "desc" | "asc";
33
+ }
6
34
  /**
7
35
  * Search Options
8
36
  */
9
- export interface IHubSearchOptions {
37
+ export interface IHubSearchOptions extends IPagingOptions, ISortOptions {
10
38
  /**
11
39
  * Fields to return aggregations on
12
40
  */
@@ -49,24 +77,8 @@ export interface IHubSearchOptions {
49
77
  * Specify what entity to search for; For use with hubSearch
50
78
  */
51
79
  targetEntity?: EntityType;
52
- /**
53
- * Maximum number of results to return, per-page
54
- */
55
- num?: number;
56
80
  /**
57
81
  * LEGACY. Use `start` and `num` instead
58
82
  */
59
83
  page?: string;
60
- /**
61
- * What field should the results be sorted on
62
- */
63
- sortField?: string;
64
- /**
65
- * Sort direction
66
- */
67
- sortOrder?: "desc" | "asc";
68
- /**
69
- * The result number of the first entry in the result set response. The start parameter, along with the num parameter, can be used to paginate the search results.
70
- */
71
- start?: number;
72
84
  }
@@ -4,4 +4,4 @@ export * from "./IHubSearchResult";
4
4
  export * from "./IHubSearchResponse";
5
5
  export * from "./types";
6
6
  export * from "./IHubCatalog";
7
- export * from "./ISearchResponseHash";
7
+ export * from "./AddContentWorkflowTypes";
@@ -1,4 +1,6 @@
1
1
  import { EntityType, IHubCatalog } from "./IHubCatalog";
2
+ import { IHubSearchResponse } from "./IHubSearchResponse";
3
+ import { IHubSearchResult } from "./IHubSearchResult";
2
4
  /**
3
5
  * Sort Option to be displayed in a UI
4
6
  */
@@ -110,3 +112,17 @@ export interface IContainsResponse {
110
112
  */
111
113
  duration?: number;
112
114
  }
115
+ /**
116
+ * Response from a search operation on a Catalog
117
+ */
118
+ export interface ICatalogSearchResponse {
119
+ catalogTitle: string;
120
+ collectionResults: ISearchResponseHash;
121
+ scopeResults?: ISearchResponseHash;
122
+ }
123
+ /**
124
+ * Response from a Catalog search operation where the responses for different collections
125
+ * or entities are grouped into a single object.
126
+ */
127
+ export interface ISearchResponseHash extends Record<string, IHubSearchResponse<IHubSearchResult>> {
128
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "14.169.0",
3
+ "version": "14.171.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",
@@ -1 +0,0 @@
1
- //# sourceMappingURL=ISearchResponseHash.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ISearchResponseHash.js","sourceRoot":"","sources":["../../../../src/search/types/ISearchResponseHash.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ISearchResponseHash.js","sourceRoot":"","sources":["../../../../src/search/types/ISearchResponseHash.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- import { IHubSearchResponse, IHubSearchResult } from ".";
2
- /**
3
- * Response from a Catalog search operation where the responses for different collections
4
- * or entities are grouped into a single object.
5
- */
6
- export interface ISearchResponseHash extends Record<string, IHubSearchResponse<IHubSearchResult>> {
7
- }