@esri/hub-common 14.90.0 → 14.91.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/ArcGISContext.js +123 -1
- package/dist/esm/ArcGISContext.js.map +1 -1
- package/dist/esm/core/hubHistory.js +64 -0
- package/dist/esm/core/hubHistory.js.map +1 -0
- package/dist/esm/core/index.js +3 -2
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/items/slugs.js +42 -25
- package/dist/esm/items/slugs.js.map +1 -1
- package/dist/esm/permissions/HubPermissionPolicies.js +7 -0
- package/dist/esm/permissions/HubPermissionPolicies.js.map +1 -1
- package/dist/esm/permissions/checkPermission.js +2 -2
- package/dist/esm/permissions/checkPermission.js.map +1 -1
- package/dist/esm/permissions/types/Permission.js +1 -0
- package/dist/esm/permissions/types/Permission.js.map +1 -1
- package/dist/esm/utils/hubUserAppResources.js.map +1 -1
- package/dist/node/ArcGISContext.js +123 -1
- package/dist/node/ArcGISContext.js.map +1 -1
- package/dist/node/core/hubHistory.js +69 -0
- package/dist/node/core/hubHistory.js.map +1 -0
- package/dist/node/core/index.js +3 -2
- package/dist/node/core/index.js.map +1 -1
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/items/slugs.js +42 -25
- package/dist/node/items/slugs.js.map +1 -1
- package/dist/node/permissions/HubPermissionPolicies.js +7 -0
- package/dist/node/permissions/HubPermissionPolicies.js.map +1 -1
- package/dist/node/permissions/checkPermission.js +2 -2
- package/dist/node/permissions/checkPermission.js.map +1 -1
- package/dist/node/permissions/types/Permission.js +1 -0
- package/dist/node/permissions/types/Permission.js.map +1 -1
- package/dist/node/utils/hubUserAppResources.js.map +1 -1
- package/dist/types/ArcGISContext.d.ts +75 -3
- package/dist/types/core/hubHistory.d.ts +62 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/items/slugs.d.ts +6 -5
- package/dist/types/utils/hubUserAppResources.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { HubEntityType } from "./types/HubEntityType";
|
|
2
|
+
/**
|
|
3
|
+
* History is a way to track a set of sites/projects/initiatives/pages that a user has visited
|
|
4
|
+
* Any content can be added to the history, but there will be different limits for different types
|
|
5
|
+
* Please see the addHistoryEntry function for more details
|
|
6
|
+
*/
|
|
7
|
+
export interface IHubHistory {
|
|
8
|
+
entries: IHubHistoryEntry[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* History entry
|
|
12
|
+
*/
|
|
13
|
+
export interface IHubHistoryEntry {
|
|
14
|
+
/**
|
|
15
|
+
* Entity Type
|
|
16
|
+
*/
|
|
17
|
+
type: HubEntityType;
|
|
18
|
+
/**
|
|
19
|
+
* What action was last taken on the entity
|
|
20
|
+
* In the future this can expand to "replied to", "shared with" etc
|
|
21
|
+
*/
|
|
22
|
+
action: "view" | "workspace";
|
|
23
|
+
/**
|
|
24
|
+
* Url the user visited
|
|
25
|
+
*/
|
|
26
|
+
url: string;
|
|
27
|
+
/**
|
|
28
|
+
* Unique identifier for the entity
|
|
29
|
+
*/
|
|
30
|
+
id: string;
|
|
31
|
+
/**
|
|
32
|
+
* Title of the entity
|
|
33
|
+
*/
|
|
34
|
+
title: string;
|
|
35
|
+
/**
|
|
36
|
+
* Owner of the entity
|
|
37
|
+
*/
|
|
38
|
+
owner?: string;
|
|
39
|
+
/**
|
|
40
|
+
* timestamp the entity was last visited
|
|
41
|
+
*/
|
|
42
|
+
visited?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Additional parameters that can be used to rehydrate the entity
|
|
45
|
+
*/
|
|
46
|
+
params?: any;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Add an entry to the history. This handles the limits per type,
|
|
50
|
+
* and ensures that the most recent entry is at the top of the list.
|
|
51
|
+
* This function does not persist the history, it only updates the object.
|
|
52
|
+
* @param entry
|
|
53
|
+
* @param history
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
export declare function addHistoryEntry(entry: IHubHistoryEntry, history: IHubHistory): IHubHistory;
|
|
57
|
+
/**
|
|
58
|
+
* Remove a specific entry from the user's history
|
|
59
|
+
* @param entry
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
export declare function removeHistoryEntry(entry: IHubHistoryEntry, history: IHubHistory): IHubHistory;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export * from "./core/updateHubEntity";
|
|
|
38
38
|
export * from "./urls/getCardModelUrl";
|
|
39
39
|
export * from "./core/EntityEditor";
|
|
40
40
|
export * from "./search/explainQueryResult";
|
|
41
|
+
export * from "./core/hubHistory";
|
|
41
42
|
import OperationStack from "./OperationStack";
|
|
42
43
|
import OperationError from "./OperationError";
|
|
43
44
|
import HubError from "./HubError";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
2
|
import { IItem } from "@esri/arcgis-rest-types";
|
|
3
3
|
/**
|
|
4
|
-
* Create a slug, namespaced to an org
|
|
5
|
-
* Typically used to lookup items by a human readable name in urls
|
|
4
|
+
* Create a slug, namespaced to an org and accounting for the 256 character limit
|
|
5
|
+
* of individual typekeywords. Typically used to lookup items by a human readable name in urls
|
|
6
6
|
*
|
|
7
7
|
* @param title
|
|
8
8
|
* @param orgKey
|
|
@@ -12,9 +12,10 @@ export declare function constructSlug(title: string, orgKey: string): string;
|
|
|
12
12
|
/**
|
|
13
13
|
* Adds/Updates the slug typekeyword
|
|
14
14
|
* Returns a new array of keywords
|
|
15
|
-
*
|
|
16
|
-
* @param
|
|
17
|
-
* @
|
|
15
|
+
*
|
|
16
|
+
* @param typeKeywords A collection of typekeywords
|
|
17
|
+
* @param slug The slug to add/update
|
|
18
|
+
* @returns An updated collection of typekeywords
|
|
18
19
|
*/
|
|
19
20
|
export declare function setSlugKeyword(typeKeywords: string[], slug: string): string[];
|
|
20
21
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IArcGISContext } from "../ArcGISContext";
|
|
2
|
+
import { IHubHistory } from "../core/hubHistory";
|
|
2
3
|
/**
|
|
3
4
|
* Site Level Settings
|
|
4
5
|
*/
|
|
@@ -33,6 +34,10 @@ export interface IUserHubSettings {
|
|
|
33
34
|
*/
|
|
34
35
|
workspace: boolean;
|
|
35
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Optional history of sites/content the user has visited
|
|
39
|
+
*/
|
|
40
|
+
history?: IHubHistory;
|
|
36
41
|
}
|
|
37
42
|
/**
|
|
38
43
|
* @private
|