@esri/hub-common 10.0.0-next.7 → 10.0.2

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 (42) hide show
  1. package/README.md +0 -1
  2. package/dist/esm/content/_internal.js +2 -2
  3. package/dist/esm/content/_internal.js.map +1 -1
  4. package/dist/esm/content/index.js +1 -1
  5. package/dist/esm/content/index.js.map +1 -1
  6. package/dist/esm/items/_internal/_wait-for-item-ready.js +2 -2
  7. package/dist/esm/items/_internal/_wait-for-item-ready.js.map +1 -1
  8. package/dist/esm/items/get-structured-license.js +19 -19
  9. package/dist/esm/items/get-structured-license.js.map +1 -1
  10. package/dist/esm/projects/HubProjectManager.js +87 -0
  11. package/dist/esm/projects/HubProjectManager.js.map +1 -1
  12. package/dist/esm/projects/HubProjects.js +1 -0
  13. package/dist/esm/projects/HubProjects.js.map +1 -1
  14. package/dist/esm/resources/_internal/_validate-url-helpers.js +1 -1
  15. package/dist/esm/resources/_internal/_validate-url-helpers.js.map +1 -1
  16. package/dist/esm/search/_internal/portalSearchUsers.js +4 -4
  17. package/dist/esm/search/_internal/portalSearchUsers.js.map +1 -1
  18. package/dist/esm/sites/HubSites.js +1 -0
  19. package/dist/esm/sites/HubSites.js.map +1 -1
  20. package/dist/node/content/_internal.js +2 -2
  21. package/dist/node/content/_internal.js.map +1 -1
  22. package/dist/node/content/index.js +1 -1
  23. package/dist/node/content/index.js.map +1 -1
  24. package/dist/node/items/_internal/_wait-for-item-ready.js +2 -2
  25. package/dist/node/items/_internal/_wait-for-item-ready.js.map +1 -1
  26. package/dist/node/items/get-structured-license.js +19 -19
  27. package/dist/node/items/get-structured-license.js.map +1 -1
  28. package/dist/node/projects/HubProjectManager.js +87 -0
  29. package/dist/node/projects/HubProjectManager.js.map +1 -1
  30. package/dist/node/projects/HubProjects.js +1 -0
  31. package/dist/node/projects/HubProjects.js.map +1 -1
  32. package/dist/node/resources/_internal/_validate-url-helpers.js +1 -1
  33. package/dist/node/resources/_internal/_validate-url-helpers.js.map +1 -1
  34. package/dist/node/search/_internal/portalSearchUsers.js +4 -4
  35. package/dist/node/search/_internal/portalSearchUsers.js.map +1 -1
  36. package/dist/node/sites/HubSites.js +1 -0
  37. package/dist/node/sites/HubSites.js.map +1 -1
  38. package/dist/types/content/_internal.d.ts +2 -1
  39. package/dist/types/core/types/IHubItemEntity.d.ts +5 -0
  40. package/dist/types/items/_internal/_wait-for-item-ready.d.ts +1 -1
  41. package/dist/types/projects/HubProjectManager.d.ts +47 -1
  42. package/package.json +1 -7
@@ -1,5 +1,6 @@
1
1
  import { IHubEntityBase } from "./IHubEntityBase";
2
2
  import { IHubGeography } from "../../types";
3
+ import { AccessLevel } from "./types";
3
4
  /**
4
5
  * Properties exposed by Entities that are backed by Items
5
6
  */
@@ -39,4 +40,8 @@ export interface IHubItemEntity extends IHubEntityBase {
39
40
  * Canonical Url for the Entity
40
41
  */
41
42
  url?: string;
43
+ /**
44
+ * Access level of the item ("private" | "org" | "public")
45
+ */
46
+ access?: AccessLevel;
42
47
  }
@@ -7,4 +7,4 @@ import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
7
7
  * @param {string} itemId AGO item id
8
8
  * @param {IUserRequestOptions} requestOptions
9
9
  */
10
- export declare function _waitForItemReady(itemId: string, requestOptions: IUserRequestOptions): Promise<void>;
10
+ export declare function _waitForItemReady(itemId: string, requestOptions: IUserRequestOptions, milliseconds?: number): Promise<void>;
@@ -4,7 +4,8 @@ import { ArcGISContextManager } from "../ArcGISContextManager";
4
4
  import { IArcGISContext, IHubSearchOptions, IHubSearchResponse, IQuery } from "..";
5
5
  import { IHubEntityManager, IHubProject } from "../core/types";
6
6
  import { IHubItemEntityManager } from "../core/types/IHubItemEntityManager";
7
- import { IItem } from "@esri/arcgis-rest-types";
7
+ import { IGroup, IItem } from "@esri/arcgis-rest-types";
8
+ import { ISharingResponse } from "@esri/arcgis-rest-portal";
8
9
  /**
9
10
  * Centralized functions used to manage IHubProject instances
10
11
  *
@@ -103,4 +104,49 @@ export declare class HubProjectManager implements IHubEntityManager<IHubProject>
103
104
  * @returns
104
105
  */
105
106
  fromItem(item: IItem, requestOptions?: IRequestOptions): Promise<IHubProject>;
107
+ /**
108
+ * Sets the access level of a Hub Project
109
+ *
110
+ * @param {IHubProject} project
111
+ * @param {("public" | "org" | "private")} accessLevel
112
+ * @param {IUserRequestOptions} [requestOptions]
113
+ * @returns
114
+ */
115
+ setAccess(project: IHubProject, accessLevel: "public" | "org" | "private", requestOptions?: IUserRequestOptions): Promise<ISharingResponse>;
116
+ /**
117
+ * Shares a Hub Project to a group
118
+ *
119
+ * @param {IHubProject} project
120
+ * @param {IGroup} group
121
+ * @param {IUserRequestOptions} [requestOptions]
122
+ * @returns
123
+ */
124
+ shareToGroup(project: IHubProject, group: IGroup, requestOptions?: IUserRequestOptions): Promise<ISharingResponse>;
125
+ /**
126
+ * Shares a Hub Project to N Groups.
127
+ *
128
+ * @param {IHubProject} project
129
+ * @param {IGroup[]} groups
130
+ * @param {IUserRequestOptions} [requestOptions]
131
+ * @returns
132
+ */
133
+ shareToGroups(project: IHubProject, groups: IGroup[], requestOptions?: IUserRequestOptions): Promise<ISharingResponse[]>;
134
+ /**
135
+ * Unshares a Hub Project from a group
136
+ *
137
+ * @param {IHubProject} project
138
+ * @param {IGroup} group
139
+ * @param {IUserRequestOptions} [requestOptions]
140
+ * @returns
141
+ */
142
+ unshareFromGroup(project: IHubProject, group: IGroup, requestOptions?: IUserRequestOptions): Promise<ISharingResponse>;
143
+ /**
144
+ * Unshares a Hub Project from N groups.
145
+ *
146
+ * @param {IHubProject} project
147
+ * @param {IGroup[]} groups
148
+ * @param {IUserRequestOptions} [requestOptions]
149
+ * @returns
150
+ */
151
+ unshareFromGroups(project: IHubProject, groups: IGroup[], requestOptions?: IUserRequestOptions): Promise<ISharingResponse[]>;
106
152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "10.0.0-next.7",
3
+ "version": "10.0.2",
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",
@@ -31,19 +31,13 @@
31
31
  "@esri/arcgis-rest-portal": "^3.4.3",
32
32
  "@esri/arcgis-rest-request": "^3.1.1",
33
33
  "@esri/arcgis-rest-types": "^3.1.1",
34
- "@rollup/plugin-commonjs": "^15.0.0",
35
- "@rollup/plugin-json": "^4.1.0",
36
- "@rollup/plugin-node-resolve": "^9.0.0",
37
34
  "@types/adlib": "^3.0.1",
38
- "rollup": "^2.26.5",
39
- "rollup-plugin-filesize": "^9.0.2",
40
35
  "typescript": "^3.8.1"
41
36
  },
42
37
  "scripts": {
43
38
  "build": "npm run build:node && npm run build:esm",
44
39
  "build:esm": "tsc --outDir ./dist/esm --declaration --declarationDir ./dist/types",
45
40
  "build:node": "tsc --module commonjs --outDir ./dist/node",
46
- "build:umd": "rollup -c ../../umd-base-profile.js && rollup -c ../../umd-production-profile.js",
47
41
  "dev:esm": "npm run build:esm -- -w",
48
42
  "dev:node": "npm run build:node -- -w",
49
43
  "format": "prettier --write ./{src,test}/**/*.ts",