@esri/hub-common 13.21.1 → 13.22.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/discussions/api/channels/channels.js +14 -0
- package/dist/esm/discussions/api/channels/channels.js.map +1 -0
- package/dist/esm/discussions/api/channels/index.js +2 -0
- package/dist/esm/discussions/api/channels/index.js.map +1 -0
- package/dist/esm/discussions/api/index.js +3 -0
- package/dist/esm/discussions/api/index.js.map +1 -0
- package/dist/esm/discussions/api/request.js +20 -0
- package/dist/esm/discussions/api/request.js.map +1 -0
- package/dist/esm/discussions/api/types.js +244 -0
- package/dist/esm/discussions/api/types.js.map +1 -0
- package/dist/esm/discussions/api/utils/request.js +77 -0
- package/dist/esm/discussions/api/utils/request.js.map +1 -0
- package/dist/esm/discussions/index.js +1 -0
- package/dist/esm/discussions/index.js.map +1 -1
- package/dist/esm/search/_internal/commonHelpers/getApi.js +5 -0
- package/dist/esm/search/_internal/commonHelpers/getApi.js.map +1 -1
- package/dist/esm/search/_internal/commonHelpers/getDiscussionsApiDefinition.js +10 -0
- package/dist/esm/search/_internal/commonHelpers/getDiscussionsApiDefinition.js.map +1 -0
- package/dist/esm/search/_internal/commonHelpers/shouldUseDiscussionsApi.js +13 -0
- package/dist/esm/search/_internal/commonHelpers/shouldUseDiscussionsApi.js.map +1 -0
- package/dist/esm/search/_internal/hubSearchChannels.js +116 -0
- package/dist/esm/search/_internal/hubSearchChannels.js.map +1 -0
- package/dist/esm/search/_internal/index.js +1 -0
- package/dist/esm/search/_internal/index.js.map +1 -1
- package/dist/esm/search/hubSearch.js +2 -1
- package/dist/esm/search/hubSearch.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/node/discussions/api/channels/channels.js +18 -0
- package/dist/node/discussions/api/channels/channels.js.map +1 -0
- package/dist/node/discussions/api/channels/index.js +5 -0
- package/dist/node/discussions/api/channels/index.js.map +1 -0
- package/dist/node/discussions/api/index.js +6 -0
- package/dist/node/discussions/api/index.js.map +1 -0
- package/dist/node/discussions/api/request.js +24 -0
- package/dist/node/discussions/api/request.js.map +1 -0
- package/dist/node/discussions/api/types.js +247 -0
- package/dist/node/discussions/api/types.js.map +1 -0
- package/dist/node/discussions/api/utils/request.js +83 -0
- package/dist/node/discussions/api/utils/request.js.map +1 -0
- package/dist/node/discussions/index.js +1 -0
- package/dist/node/discussions/index.js.map +1 -1
- package/dist/node/search/_internal/commonHelpers/getApi.js +5 -0
- package/dist/node/search/_internal/commonHelpers/getApi.js.map +1 -1
- package/dist/node/search/_internal/commonHelpers/getDiscussionsApiDefinition.js +14 -0
- package/dist/node/search/_internal/commonHelpers/getDiscussionsApiDefinition.js.map +1 -0
- package/dist/node/search/_internal/commonHelpers/shouldUseDiscussionsApi.js +17 -0
- package/dist/node/search/_internal/commonHelpers/shouldUseDiscussionsApi.js.map +1 -0
- package/dist/node/search/_internal/hubSearchChannels.js +119 -0
- package/dist/node/search/_internal/hubSearchChannels.js.map +1 -0
- package/dist/node/search/_internal/index.js +1 -0
- package/dist/node/search/_internal/index.js.map +1 -1
- package/dist/node/search/hubSearch.js +1 -0
- package/dist/node/search/hubSearch.js.map +1 -1
- package/dist/node/types.js.map +1 -1
- package/dist/types/discussions/api/channels/channels.d.ts +10 -0
- package/dist/types/discussions/api/channels/index.d.ts +1 -0
- package/dist/types/discussions/api/index.d.ts +2 -0
- package/dist/types/discussions/api/request.d.ts +11 -0
- package/dist/types/discussions/api/types.d.ts +986 -0
- package/dist/types/discussions/api/utils/request.d.ts +25 -0
- package/dist/types/discussions/index.d.ts +1 -0
- package/dist/types/search/_internal/commonHelpers/getDiscussionsApiDefinition.d.ts +2 -0
- package/dist/types/search/_internal/commonHelpers/shouldUseDiscussionsApi.d.ts +11 -0
- package/dist/types/search/_internal/hubSearchChannels.d.ts +30 -0
- package/dist/types/search/_internal/index.d.ts +1 -0
- package/dist/types/search/types/IHubCatalog.d.ts +1 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RemoteServerError as _RemoteServerError } from "../../../request";
|
|
2
|
+
import { IDiscussionsRequestOptions } from "../types";
|
|
3
|
+
export declare class RemoteServerError extends _RemoteServerError {
|
|
4
|
+
error: string;
|
|
5
|
+
constructor(message: string, url: string, status: number, error: string);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* returns Promise that resolves token to use in Discussions API requests
|
|
9
|
+
*
|
|
10
|
+
* @export
|
|
11
|
+
* @param {IDiscussionsRequestOptions} options
|
|
12
|
+
* @return {*} {Promise<string>}
|
|
13
|
+
*/
|
|
14
|
+
export declare function authenticateRequest(options: IDiscussionsRequestOptions): Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* parses IDiscussionsRequestOptions and makes request against Discussions API
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @template T
|
|
20
|
+
* @param {string} route
|
|
21
|
+
* @param {IDiscussionsRequestOptions} options
|
|
22
|
+
* @param {string} [token]
|
|
23
|
+
* @return {*} {Promise<T>}
|
|
24
|
+
*/
|
|
25
|
+
export declare function apiRequest<T>(route: string, options: IDiscussionsRequestOptions, token?: string): Promise<T>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntityType } from "../../types/IHubCatalog";
|
|
2
|
+
import { IHubSearchOptions } from "../../types/IHubSearchOptions";
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
* Determines if the Discussions API can be targeted with the given
|
|
6
|
+
* search parameters
|
|
7
|
+
* @param targetEntity
|
|
8
|
+
* @param options
|
|
9
|
+
* @returns boolean
|
|
10
|
+
*/
|
|
11
|
+
export declare function shouldUseDiscussionsApi(targetEntity: EntityType, options: IHubSearchOptions): boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IHubSearchOptions, IHubSearchResponse, IHubSearchResult, IQuery } from "../types";
|
|
2
|
+
import { IChannel, IPagedResponse, ISearchChannelsParams } from "../../discussions";
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
* Convert hubSearch IHubSearchOptions and IQuery interfaces to a
|
|
6
|
+
* ISearchChannelsParams structure that is needed for the Discussions API
|
|
7
|
+
* searchChannels(searchOptions: ISearchCHannelsParams) function
|
|
8
|
+
* @param {IHubSearchOptions} options
|
|
9
|
+
* @param {IQuery} query
|
|
10
|
+
* @returns ISearchChannelParams
|
|
11
|
+
*/
|
|
12
|
+
export declare const processSearchParams: (options: IHubSearchOptions, query: IQuery) => ISearchChannelsParams;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
* Convert the Discussions API searchChannels response into an
|
|
16
|
+
* IHubSearchResponse necessary for supporting hubSearch results
|
|
17
|
+
* @param {IPagedResponse{IChannel}} channelsResponse
|
|
18
|
+
* @param {IQuery} query
|
|
19
|
+
* @param {IHubSearchOptions} options
|
|
20
|
+
* @returns IHubSearchResponse<IHubSearchResult>
|
|
21
|
+
*/
|
|
22
|
+
export declare const toHubSearchResult: (channelsResponse: IPagedResponse<IChannel>, query: IQuery, options: IHubSearchOptions) => IHubSearchResponse<IHubSearchResult>;
|
|
23
|
+
/**
|
|
24
|
+
* @private
|
|
25
|
+
* Execute channel search against the Discussions API
|
|
26
|
+
* @param query
|
|
27
|
+
* @param options
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
export declare const hubSearchChannels: (query: IQuery, options: IHubSearchOptions) => Promise<IHubSearchResponse<IHubSearchResult>>;
|
|
@@ -50,6 +50,7 @@ export interface IHubCollection {
|
|
|
50
50
|
*/
|
|
51
51
|
targetEntity: EntityType;
|
|
52
52
|
}
|
|
53
|
+
export declare type EntityType = "item" | "group" | "user" | "groupMember" | "event" | "channel";
|
|
53
54
|
/**
|
|
54
55
|
* @private
|
|
55
56
|
*
|
|
@@ -60,7 +61,6 @@ export interface IHubCollection {
|
|
|
60
61
|
export interface IHubCollectionPersistance extends IHubCollection {
|
|
61
62
|
hidden?: boolean;
|
|
62
63
|
}
|
|
63
|
-
export declare type EntityType = "item" | "group" | "user" | "groupMember" | "event";
|
|
64
64
|
/**
|
|
65
65
|
* IQuery is the fundamental unit used to execute a search. By composing
|
|
66
66
|
* `Filter`'s and `IPredicate`s, we can express very complex queries
|
package/dist/types/types.d.ts
CHANGED
|
@@ -130,7 +130,7 @@ export interface IRevertableTaskFailed {
|
|
|
130
130
|
error: Error;
|
|
131
131
|
}
|
|
132
132
|
export declare type IRevertableTaskResult = IRevertableTaskSuccess | IRevertableTaskFailed;
|
|
133
|
-
export declare type HubFamily = "app" | "content" | "dataset" | "document" | "event" | "feedback" | "initiative" | "map" | "people" | "site" | "team" | "template" | "project";
|
|
133
|
+
export declare type HubFamily = "app" | "content" | "dataset" | "document" | "event" | "feedback" | "initiative" | "map" | "people" | "site" | "team" | "template" | "project" | "channel";
|
|
134
134
|
/**
|
|
135
135
|
* Visibility levels of a Hub resource
|
|
136
136
|
*/
|