@esri/hub-common 13.21.0 → 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/core/types/index.js +1 -0
- package/dist/esm/core/types/index.js.map +1 -1
- 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/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/initiatives/HubInitiative.js +5 -12
- package/dist/esm/initiatives/HubInitiative.js.map +1 -1
- package/dist/esm/initiatives/view.js +13 -35
- package/dist/esm/initiatives/view.js.map +1 -1
- package/dist/esm/projects/HubProject.js +4 -11
- package/dist/esm/projects/HubProject.js.map +1 -1
- package/dist/esm/projects/view.js +13 -35
- package/dist/esm/projects/view.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/esm/urls/getCardModelUrl.js +76 -0
- package/dist/esm/urls/getCardModelUrl.js.map +1 -0
- package/dist/esm/urls/index.js +3 -0
- package/dist/esm/urls/index.js.map +1 -1
- package/dist/node/core/types/index.js +1 -0
- package/dist/node/core/types/index.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/index.js +3 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/initiatives/HubInitiative.js +4 -11
- package/dist/node/initiatives/HubInitiative.js.map +1 -1
- package/dist/node/initiatives/view.js +13 -35
- package/dist/node/initiatives/view.js.map +1 -1
- package/dist/node/projects/HubProject.js +3 -10
- package/dist/node/projects/HubProject.js.map +1 -1
- package/dist/node/projects/view.js +13 -35
- package/dist/node/projects/view.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/node/urls/getCardModelUrl.js +81 -0
- package/dist/node/urls/getCardModelUrl.js.map +1 -0
- package/dist/node/urls/index.js +3 -0
- package/dist/node/urls/index.js.map +1 -1
- package/dist/types/core/behaviors/IWithCardBehavior.d.ts +3 -10
- package/dist/types/core/types/IHubCardViewModel.d.ts +16 -0
- package/dist/types/core/types/index.d.ts +1 -0
- 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/index.d.ts +1 -0
- package/dist/types/initiatives/HubInitiative.d.ts +6 -13
- package/dist/types/initiatives/view.d.ts +5 -10
- package/dist/types/projects/HubProject.d.ts +3 -10
- package/dist/types/projects/view.d.ts +5 -10
- 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/dist/types/urls/getCardModelUrl.d.ts +21 -0
- 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>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export * from "./utils";
|
|
|
33
33
|
export * from "./versioning";
|
|
34
34
|
export * from "./metrics";
|
|
35
35
|
export * from "./core/updateHubEntity";
|
|
36
|
+
export * from "./urls/getCardModelUrl";
|
|
36
37
|
import OperationStack from "./OperationStack";
|
|
37
38
|
import OperationError from "./OperationError";
|
|
38
39
|
import HubError from "./HubError";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IHubInitiative, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions, IEditorConfig, IResolvedMetric } from "../core";
|
|
1
|
+
import { IHubInitiative, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions, IEditorConfig, IResolvedMetric, IWithCardBehavior } from "../core";
|
|
2
2
|
import { Catalog } from "../search";
|
|
3
3
|
import { IArcGISContext } from "../ArcGISContext";
|
|
4
4
|
import { HubItemEntity } from "../core/HubItemEntity";
|
|
5
5
|
import { InitiativeEditorType } from "./_internal/InitiativeSchema";
|
|
6
6
|
import { IWithMetricsBehavior } from "../core/behaviors/IWithMetricsBehavior";
|
|
7
|
-
import {
|
|
7
|
+
import { IConvertToCardModelOpts, IHubCardViewModel } from "../core/types/IHubCardViewModel";
|
|
8
8
|
/**
|
|
9
9
|
* Hub Initiative Class
|
|
10
10
|
*/
|
|
11
|
-
export declare class HubInitiative extends HubItemEntity<IHubInitiative> implements IWithStoreBehavior<IHubInitiative>, IWithCatalogBehavior, IWithMetricsBehavior, IWithSharingBehavior {
|
|
11
|
+
export declare class HubInitiative extends HubItemEntity<IHubInitiative> implements IWithStoreBehavior<IHubInitiative>, IWithCatalogBehavior, IWithMetricsBehavior, IWithSharingBehavior, IWithCardBehavior {
|
|
12
12
|
private _catalog;
|
|
13
13
|
/**
|
|
14
14
|
* Private constructor so we don't have `new` all over the place. Allows for
|
|
@@ -80,16 +80,9 @@ export declare class HubInitiative extends HubItemEntity<IHubInitiative> impleme
|
|
|
80
80
|
resolveMetric(metricId: string): Promise<IResolvedMetric>;
|
|
81
81
|
/**
|
|
82
82
|
* Convert the initiative entity into a card view model that
|
|
83
|
-
* can be consumed by the
|
|
83
|
+
* can be consumed by the suite of hub gallery components
|
|
84
84
|
*
|
|
85
|
-
* @param
|
|
86
|
-
* @param actionLinks card action links
|
|
87
|
-
* @param locale internationalization locale
|
|
85
|
+
* @param opts view model options
|
|
88
86
|
*/
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* TODO: move transform logic to FE so we don't need to pass
|
|
92
|
-
* locale down (follow https://devtopia.esri.com/dc/hub/issues/7255)
|
|
93
|
-
*/
|
|
94
|
-
locale: string): IHubCardViewModel;
|
|
87
|
+
convertToCardModel(opts?: IConvertToCardModelOpts): IHubCardViewModel;
|
|
95
88
|
}
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import { IArcGISContext, IHubSearchResult } from "..";
|
|
2
1
|
import { IHubInitiative } from "../core";
|
|
3
|
-
import {
|
|
2
|
+
import { EntityToCardModelFn, ResultToCardModelFn } from "../core/types/IHubCardViewModel";
|
|
4
3
|
/**
|
|
5
4
|
* Convert an initiative entity in a card view model
|
|
6
5
|
* that can be consumed by the suite of hub gallery components
|
|
7
6
|
*
|
|
8
7
|
* @param initiative initiative entity
|
|
9
8
|
* @param context auth & portal information
|
|
10
|
-
* @param
|
|
11
|
-
* @param actionLinks card action links
|
|
12
|
-
* @param locale internationalization locale
|
|
9
|
+
* @param opts view model options
|
|
13
10
|
*/
|
|
14
|
-
export declare const
|
|
11
|
+
export declare const initiativeToCardModel: EntityToCardModelFn<IHubInitiative>;
|
|
15
12
|
/**
|
|
16
13
|
* Conver an initiative search result into a card view model
|
|
17
14
|
* that can be consumed by the suite of hub gallery components
|
|
18
15
|
*
|
|
19
16
|
* @param searchResult hub initiative search result
|
|
20
|
-
* @param
|
|
21
|
-
* @param actionLinks card action links
|
|
22
|
-
* @param locale internationalization locale
|
|
17
|
+
* @param opts view model options
|
|
23
18
|
*/
|
|
24
|
-
export declare const
|
|
19
|
+
export declare const initiativeResultToCardModel: ResultToCardModelFn;
|
|
@@ -5,7 +5,7 @@ import { HubItemEntity } from "../core/HubItemEntity";
|
|
|
5
5
|
import { IEditorConfig } from "../core/behaviors/IWithEditorBehavior";
|
|
6
6
|
import { ProjectEditorType } from "./_internal/ProjectSchema";
|
|
7
7
|
import { IWithMetricsBehavior } from "../core/behaviors/IWithMetricsBehavior";
|
|
8
|
-
import {
|
|
8
|
+
import { IConvertToCardModelOpts, IHubCardViewModel } from "../core/types/IHubCardViewModel";
|
|
9
9
|
/**
|
|
10
10
|
* Hub Project Class
|
|
11
11
|
*/
|
|
@@ -60,16 +60,9 @@ export declare class HubProject extends HubItemEntity<IHubProject> implements IW
|
|
|
60
60
|
* Convert the project entity into a card view model that can
|
|
61
61
|
* be consumed by the suite of hub gallery components
|
|
62
62
|
*
|
|
63
|
-
* @param
|
|
64
|
-
* @param actionLinks card action links
|
|
65
|
-
* @param locale internationalization locale
|
|
63
|
+
* @param opts view model options
|
|
66
64
|
*/
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* TODO: move transform logic to FE so we don't need to pass
|
|
70
|
-
* locale down (follow https://devtopia.esri.com/dc/hub/issues/7255)
|
|
71
|
-
*/
|
|
72
|
-
locale: string): IHubCardViewModel;
|
|
65
|
+
convertToCardModel(opts?: IConvertToCardModelOpts): IHubCardViewModel;
|
|
73
66
|
/**
|
|
74
67
|
* Apply a new state to the instance
|
|
75
68
|
* @param changes
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import { IArcGISContext, IHubSearchResult } from "..";
|
|
2
1
|
import { IHubProject } from "../core";
|
|
3
|
-
import {
|
|
2
|
+
import { ResultToCardModelFn, EntityToCardModelFn } from "../core/types/IHubCardViewModel";
|
|
4
3
|
/**
|
|
5
4
|
* Convert a project entity into a card view model that can
|
|
6
5
|
* be consumed by the suite of hub gallery components
|
|
7
6
|
*
|
|
8
7
|
* @param project project entity
|
|
9
8
|
* @param context auth & portal information
|
|
10
|
-
* @param
|
|
11
|
-
* @param actionLinks card action links
|
|
12
|
-
* @param locale internationalization locale
|
|
9
|
+
* @param opts view model options
|
|
13
10
|
*/
|
|
14
|
-
export declare const
|
|
11
|
+
export declare const projectToCardModel: EntityToCardModelFn<IHubProject>;
|
|
15
12
|
/**
|
|
16
13
|
* Convert a project hub search result into a card view model that
|
|
17
14
|
* can be consumed by the suite of hub gallery components
|
|
18
15
|
*
|
|
19
16
|
* @param searchResult hub project search result
|
|
20
|
-
* @param
|
|
21
|
-
* @param actionLinks card action links
|
|
22
|
-
* @param locale internationalization locale
|
|
17
|
+
* @param opts view model options
|
|
23
18
|
*/
|
|
24
|
-
export declare const
|
|
19
|
+
export declare const projectResultToCardModel: ResultToCardModelFn;
|
|
@@ -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
|
*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IArcGISContext } from "../ArcGISContext";
|
|
2
|
+
import { HubEntity } from "../core/types/HubEntity";
|
|
3
|
+
import { CardModelTarget } from "../core/types/IHubCardViewModel";
|
|
4
|
+
import { IHubSearchResult } from "../search/types/IHubSearchResult";
|
|
5
|
+
/**
|
|
6
|
+
* returns a gallery card's title url from a hub search result
|
|
7
|
+
*
|
|
8
|
+
* @param result hub search result
|
|
9
|
+
* @param target context the card should redirect to
|
|
10
|
+
* @param baseUrl base url to work in conjunction with the target
|
|
11
|
+
*/
|
|
12
|
+
export declare function getCardModelUrlFromResult(result: IHubSearchResult, target: CardModelTarget, baseUrl?: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* returns a gallery card's title url from an entity
|
|
15
|
+
*
|
|
16
|
+
* @param entity hub entity
|
|
17
|
+
* @param context auth & portal information
|
|
18
|
+
* @param target context the card should redirect to
|
|
19
|
+
* @param baseUrl base url to work in conjunction with the target
|
|
20
|
+
*/
|
|
21
|
+
export declare function getCardModelUrlFromEntity(entity: HubEntity, context: IArcGISContext, target: CardModelTarget, baseUrl?: string): string;
|