@esri/hub-common 11.0.0-beta.1 → 11.0.0-beta.4
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/Hub.js +0 -30
- package/dist/esm/Hub.js.map +1 -1
- package/dist/esm/core/PermissionManager.js +4 -4
- package/dist/esm/core/PermissionManager.js.map +1 -1
- package/dist/esm/core/_internal/PropertyMapper.js +1 -0
- package/dist/esm/core/_internal/PropertyMapper.js.map +1 -1
- package/dist/esm/core/_internal/sharedWith.js +14 -0
- package/dist/esm/core/_internal/sharedWith.js.map +1 -0
- package/dist/esm/core/behaviors/IWithPermissionBehavior.js +2 -2
- package/dist/esm/core/behaviors/IWithPermissionBehavior.js.map +1 -1
- package/dist/esm/core/behaviors/IWithSharingBehavior.js +1 -0
- package/dist/esm/core/behaviors/IWithSharingBehavior.js.map +1 -0
- package/dist/esm/core/behaviors/index.js +1 -0
- package/dist/esm/core/behaviors/index.js.map +1 -1
- package/dist/esm/projects/HubProject.js +57 -174
- package/dist/esm/projects/HubProject.js.map +1 -1
- package/dist/esm/projects/HubProjectManager.js +1 -0
- package/dist/esm/projects/HubProjectManager.js.map +1 -1
- package/dist/esm/projects/HubProjects.js +1 -4
- package/dist/esm/projects/HubProjects.js.map +1 -1
- package/dist/esm/projects/defaults.js +2 -2
- package/dist/esm/projects/defaults.js.map +1 -1
- package/dist/esm/projects/index.js +0 -1
- package/dist/esm/projects/index.js.map +1 -1
- package/dist/esm/sites/index.js +0 -1
- package/dist/esm/sites/index.js.map +1 -1
- package/dist/node/Hub.js +0 -30
- package/dist/node/Hub.js.map +1 -1
- package/dist/node/core/PermissionManager.js +4 -4
- package/dist/node/core/PermissionManager.js.map +1 -1
- package/dist/node/core/_internal/PropertyMapper.js +1 -0
- package/dist/node/core/_internal/PropertyMapper.js.map +1 -1
- package/dist/node/core/_internal/sharedWith.js +18 -0
- package/dist/node/core/_internal/sharedWith.js.map +1 -0
- package/dist/node/core/behaviors/IWithPermissionBehavior.js +2 -2
- package/dist/node/core/behaviors/IWithPermissionBehavior.js.map +1 -1
- package/dist/node/core/behaviors/IWithSharingBehavior.js +3 -0
- package/dist/node/core/behaviors/IWithSharingBehavior.js.map +1 -0
- package/dist/node/core/behaviors/index.js +1 -0
- package/dist/node/core/behaviors/index.js.map +1 -1
- package/dist/node/projects/HubProject.js +57 -174
- package/dist/node/projects/HubProject.js.map +1 -1
- package/dist/node/projects/HubProjectManager.js +1 -0
- package/dist/node/projects/HubProjectManager.js.map +1 -1
- package/dist/node/projects/HubProjects.js +1 -4
- package/dist/node/projects/HubProjects.js.map +1 -1
- package/dist/node/projects/defaults.js +2 -2
- package/dist/node/projects/defaults.js.map +1 -1
- package/dist/node/projects/index.js +0 -1
- package/dist/node/projects/index.js.map +1 -1
- package/dist/node/sites/index.js +0 -1
- package/dist/node/sites/index.js.map +1 -1
- package/dist/types/Hub.d.ts +0 -18
- package/dist/types/core/PermissionManager.d.ts +1 -1
- package/dist/types/core/_internal/PropertyMapper.d.ts +1 -0
- package/dist/types/core/_internal/sharedWith.d.ts +10 -0
- package/dist/types/core/behaviors/IWithPermissionBehavior.d.ts +1 -1
- package/dist/types/core/behaviors/IWithSharingBehavior.d.ts +27 -0
- package/dist/types/core/behaviors/index.d.ts +1 -0
- package/dist/types/core/traits/IWithCatalogDefinition.d.ts +2 -2
- package/dist/types/core/traits/IWithPermissions.d.ts +1 -1
- package/dist/types/core/types/IHubProject.d.ts +2 -2
- package/dist/types/core/types/types.d.ts +5 -1
- package/dist/types/projects/HubProject.d.ts +23 -2
- package/dist/types/projects/HubProjectManager.d.ts +1 -0
- package/dist/types/projects/index.d.ts +0 -1
- package/dist/types/sites/index.d.ts +0 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IGroup } from "@esri/arcgis-rest-portal";
|
|
2
|
+
import { AccessLevel } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Sharing behavior for Item-Backed Entities
|
|
5
|
+
*/
|
|
6
|
+
export interface IWithSharingBehavior {
|
|
7
|
+
/**
|
|
8
|
+
* Share the item with the specified group
|
|
9
|
+
* @param groupId
|
|
10
|
+
*/
|
|
11
|
+
shareWithGroup(groupId: string): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Unshare the item with the specified group
|
|
14
|
+
* @param groupId
|
|
15
|
+
*/
|
|
16
|
+
unshareWithGroup(groupId: string): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Set the access level for the item
|
|
19
|
+
* @param access
|
|
20
|
+
*/
|
|
21
|
+
setAccess(access: AccessLevel): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Get the list of groups that the item is shared to.
|
|
24
|
+
* Limited to Groups that the user has access to
|
|
25
|
+
*/
|
|
26
|
+
sharedWith(): Promise<IGroup[]>;
|
|
27
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IHubTimeline, IHubItemEntity } from "./index";
|
|
2
2
|
import { IWithLayout, IWithPermissionDefinition, IWithSlug } from "../traits/index";
|
|
3
|
-
import {
|
|
3
|
+
import { IWithCatalog } from "../traits/IWithCatalogDefinition";
|
|
4
4
|
/**
|
|
5
5
|
* Defines the properties of a Hub Project object
|
|
6
6
|
*/
|
|
7
|
-
export interface IHubProject extends IHubItemEntity, IWithSlug,
|
|
7
|
+
export interface IHubProject extends IHubItemEntity, IWithSlug, IWithCatalog, IWithLayout, IWithPermissionDefinition {
|
|
8
8
|
/**
|
|
9
9
|
* Timeline for the project
|
|
10
10
|
*/
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Access levels that can be set on an item
|
|
3
|
+
*/
|
|
4
|
+
export declare type SettableAccessLevel = "public" | "org" | "private";
|
|
1
5
|
/**
|
|
2
6
|
* Access level for Platform Entities
|
|
3
7
|
*/
|
|
4
|
-
export declare type AccessLevel =
|
|
8
|
+
export declare type AccessLevel = SettableAccessLevel | "shared";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { IHubProject, IWithPermissionBehavior, IWithCatalogBehavior, PermissionManager, IWithStoreBehavior } from "../core";
|
|
1
|
+
import { IHubProject, IWithPermissionBehavior, IWithCatalogBehavior, PermissionManager, IWithStoreBehavior, IWithSharingBehavior, SettableAccessLevel } from "../core";
|
|
2
2
|
import { Catalog } from "../search/Catalog";
|
|
3
3
|
import { IArcGISContext } from "../ArcGISContext";
|
|
4
|
+
import { IGroup } from "@esri/arcgis-rest-types";
|
|
4
5
|
/**
|
|
5
6
|
* Hub Project Class
|
|
6
7
|
*/
|
|
7
|
-
export declare class HubProject implements IWithStoreBehavior<IHubProject>, IWithPermissionBehavior, IWithCatalogBehavior {
|
|
8
|
+
export declare class HubProject implements IWithStoreBehavior<IHubProject>, IWithPermissionBehavior, IWithCatalogBehavior, IWithSharingBehavior {
|
|
8
9
|
private context;
|
|
9
10
|
private entity;
|
|
10
11
|
private isDestroyed;
|
|
@@ -68,4 +69,24 @@ export declare class HubProject implements IWithStoreBehavior<IHubProject>, IWit
|
|
|
68
69
|
* @returns
|
|
69
70
|
*/
|
|
70
71
|
delete(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Share the Project with the specified group id
|
|
74
|
+
* @param groupId
|
|
75
|
+
*/
|
|
76
|
+
shareWithGroup(groupId: string): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Unshare the Project with the specified group id
|
|
79
|
+
* @param groupId
|
|
80
|
+
*/
|
|
81
|
+
unshareWithGroup(groupId: string): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Set the access level of the backing item
|
|
84
|
+
* @param access
|
|
85
|
+
*/
|
|
86
|
+
setAccess(access: SettableAccessLevel): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Return a list of groups the Project is shared to.
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
91
|
+
sharedWith(): Promise<IGroup[]>;
|
|
71
92
|
}
|
|
@@ -7,6 +7,7 @@ import { IHubItemEntityManager } from "../core/types/IHubItemEntityManager";
|
|
|
7
7
|
import { IGroup, IItem } from "@esri/arcgis-rest-types";
|
|
8
8
|
import { ISharingResponse } from "@esri/arcgis-rest-portal";
|
|
9
9
|
/**
|
|
10
|
+
* @private
|
|
10
11
|
* Centralized functions used to manage IHubProject instances
|
|
11
12
|
*
|
|
12
13
|
* This class is a convenience wrapper over util functions which
|
|
@@ -3,7 +3,6 @@ export * from "./domains";
|
|
|
3
3
|
export * from "./drafts";
|
|
4
4
|
export * from "./fetchSiteModel";
|
|
5
5
|
export * from "./get-site-by-id";
|
|
6
|
-
export * from "./HubSiteManager";
|
|
7
6
|
export * from "./HubSites";
|
|
8
7
|
export * from "./registerSiteAsApplication";
|
|
9
8
|
export * from "./site-schema-version";
|
package/package.json
CHANGED