@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.
Files changed (40) hide show
  1. package/dist/esm/ArcGISContext.js +123 -1
  2. package/dist/esm/ArcGISContext.js.map +1 -1
  3. package/dist/esm/core/hubHistory.js +64 -0
  4. package/dist/esm/core/hubHistory.js.map +1 -0
  5. package/dist/esm/core/index.js +3 -2
  6. package/dist/esm/core/index.js.map +1 -1
  7. package/dist/esm/index.js +1 -0
  8. package/dist/esm/index.js.map +1 -1
  9. package/dist/esm/items/slugs.js +42 -25
  10. package/dist/esm/items/slugs.js.map +1 -1
  11. package/dist/esm/permissions/HubPermissionPolicies.js +7 -0
  12. package/dist/esm/permissions/HubPermissionPolicies.js.map +1 -1
  13. package/dist/esm/permissions/checkPermission.js +2 -2
  14. package/dist/esm/permissions/checkPermission.js.map +1 -1
  15. package/dist/esm/permissions/types/Permission.js +1 -0
  16. package/dist/esm/permissions/types/Permission.js.map +1 -1
  17. package/dist/esm/utils/hubUserAppResources.js.map +1 -1
  18. package/dist/node/ArcGISContext.js +123 -1
  19. package/dist/node/ArcGISContext.js.map +1 -1
  20. package/dist/node/core/hubHistory.js +69 -0
  21. package/dist/node/core/hubHistory.js.map +1 -0
  22. package/dist/node/core/index.js +3 -2
  23. package/dist/node/core/index.js.map +1 -1
  24. package/dist/node/index.js +1 -0
  25. package/dist/node/index.js.map +1 -1
  26. package/dist/node/items/slugs.js +42 -25
  27. package/dist/node/items/slugs.js.map +1 -1
  28. package/dist/node/permissions/HubPermissionPolicies.js +7 -0
  29. package/dist/node/permissions/HubPermissionPolicies.js.map +1 -1
  30. package/dist/node/permissions/checkPermission.js +2 -2
  31. package/dist/node/permissions/checkPermission.js.map +1 -1
  32. package/dist/node/permissions/types/Permission.js +1 -0
  33. package/dist/node/permissions/types/Permission.js.map +1 -1
  34. package/dist/node/utils/hubUserAppResources.js.map +1 -1
  35. package/dist/types/ArcGISContext.d.ts +75 -3
  36. package/dist/types/core/hubHistory.d.ts +62 -0
  37. package/dist/types/index.d.ts +1 -0
  38. package/dist/types/items/slugs.d.ts +6 -5
  39. package/dist/types/utils/hubUserAppResources.d.ts +5 -0
  40. 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;
@@ -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
- * @param typeKeywords
16
- * @param slug
17
- * @returns
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "14.90.0",
3
+ "version": "14.91.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",