@esri/arcgis-rest-portal 4.4.0 → 4.5.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/README.md +1 -4
- package/dist/bundled/portal.esm.js +75 -46
- package/dist/bundled/portal.esm.js.map +1 -1
- package/dist/bundled/portal.esm.min.js +4 -4
- package/dist/bundled/portal.esm.min.js.map +1 -1
- package/dist/bundled/portal.umd.js +75 -45
- package/dist/bundled/portal.umd.js.map +1 -1
- package/dist/bundled/portal.umd.min.js +4 -4
- package/dist/bundled/portal.umd.min.js.map +1 -1
- package/dist/cjs/groups/update-user-membership.js +1 -0
- package/dist/cjs/groups/update-user-membership.js.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/items/helpers.js.map +1 -1
- package/dist/cjs/sharing/access.js +5 -4
- package/dist/cjs/sharing/access.js.map +1 -1
- package/dist/cjs/sharing/helpers.js +8 -9
- package/dist/cjs/sharing/helpers.js.map +1 -1
- package/dist/cjs/sharing/share-item-with-group.js +6 -5
- package/dist/cjs/sharing/share-item-with-group.js.map +1 -1
- package/dist/cjs/sharing/unshare-item-with-group.js +5 -4
- package/dist/cjs/sharing/unshare-item-with-group.js.map +1 -1
- package/dist/cjs/users/get-user-tags.js +4 -3
- package/dist/cjs/users/get-user-tags.js.map +1 -1
- package/dist/cjs/users/get-user-url.js +1 -0
- package/dist/cjs/users/get-user-url.js.map +1 -1
- package/dist/cjs/users/get-user.js +4 -3
- package/dist/cjs/users/get-user.js.map +1 -1
- package/dist/cjs/users/invitation.js +9 -8
- package/dist/cjs/users/invitation.js.map +1 -1
- package/dist/cjs/users/notification.js +5 -4
- package/dist/cjs/users/notification.js.map +1 -1
- package/dist/cjs/users/update.js +3 -2
- package/dist/cjs/users/update.js.map +1 -1
- package/dist/cjs/util/determine-username.js +28 -0
- package/dist/cjs/util/determine-username.js.map +1 -0
- package/dist/esm/groups/update-user-membership.d.ts +1 -0
- package/dist/esm/groups/update-user-membership.js +1 -0
- package/dist/esm/groups/update-user-membership.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/items/helpers.d.ts +3 -3
- package/dist/esm/items/helpers.js.map +1 -1
- package/dist/esm/sharing/access.js +5 -4
- package/dist/esm/sharing/access.js.map +1 -1
- package/dist/esm/sharing/helpers.d.ts +2 -2
- package/dist/esm/sharing/helpers.js +8 -9
- package/dist/esm/sharing/helpers.js.map +1 -1
- package/dist/esm/sharing/share-item-with-group.js +6 -5
- package/dist/esm/sharing/share-item-with-group.js.map +1 -1
- package/dist/esm/sharing/unshare-item-with-group.js +5 -4
- package/dist/esm/sharing/unshare-item-with-group.js.map +1 -1
- package/dist/esm/users/get-user-tags.js +4 -3
- package/dist/esm/users/get-user-tags.js.map +1 -1
- package/dist/esm/users/get-user-url.d.ts +1 -0
- package/dist/esm/users/get-user-url.js +1 -0
- package/dist/esm/users/get-user-url.js.map +1 -1
- package/dist/esm/users/get-user.d.ts +2 -2
- package/dist/esm/users/get-user.js +4 -3
- package/dist/esm/users/get-user.js.map +1 -1
- package/dist/esm/users/invitation.js +9 -8
- package/dist/esm/users/invitation.js.map +1 -1
- package/dist/esm/users/notification.js +5 -4
- package/dist/esm/users/notification.js.map +1 -1
- package/dist/esm/users/update.js +3 -2
- package/dist/esm/users/update.js.map +1 -1
- package/dist/esm/util/determine-username.d.ts +16 -0
- package/dist/esm/util/determine-username.js +24 -0
- package/dist/esm/util/determine-username.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
[![npm version][npm-img]][npm-url]
|
|
2
|
-
[![build status][travis-img]][travis-url]
|
|
3
2
|
[![gzip bundle size][gzip-image]][npm-url]
|
|
4
3
|
[![Coverage Status][coverage-img]][coverage-url]
|
|
5
4
|
[](https://raw.githubusercontent.com/Esri/arcgis-rest-js/master/LICENSE)
|
|
6
5
|
|
|
7
6
|
[npm-img]: https://img.shields.io/npm/v/@esri/arcgis-rest-portal.svg?style=flat-square
|
|
8
7
|
[npm-url]: https://www.npmjs.com/package/@esri/arcgis-rest-portal
|
|
9
|
-
[travis-img]: https://img.shields.io/travis/Esri/arcgis-rest-js/master.svg?style=flat-square
|
|
10
|
-
[travis-url]: https://travis-ci.org/Esri/arcgis-rest-js
|
|
11
8
|
[gzip-image]: https://img.badgesize.io/https://unpkg.com/@esri/arcgis-rest-portal/dist/bundled/portal.umd.min.js?compression=gzip
|
|
12
9
|
[coverage-img]: https://codecov.io/gh/Esri/arcgis-rest-js/branch/master/graph/badge.svg
|
|
13
10
|
[coverage-url]: https://codecov.io/gh/Esri/arcgis-rest-js
|
|
@@ -33,7 +30,7 @@ getItem(itemId).then((response) => {
|
|
|
33
30
|
});
|
|
34
31
|
```
|
|
35
32
|
|
|
36
|
-
### [API Reference](https://
|
|
33
|
+
### [API Reference](https://developers.arcgis.com/arcgis-rest-js/api-reference/arcgis-rest-portal/)
|
|
37
34
|
|
|
38
35
|
### Issues
|
|
39
36
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/arcgis-rest-portal - v4.
|
|
3
|
-
* Copyright (c) 2017-
|
|
4
|
-
*
|
|
2
|
+
* @esri/arcgis-rest-portal - v4.4.1 - Apache-2.0
|
|
3
|
+
* Copyright (c) 2017-2025 Esri, Inc.
|
|
4
|
+
* Thu Jan 23 2025 20:04:52 GMT+0000 (Coordinated Universal Time)
|
|
5
5
|
*/
|
|
6
6
|
import { cleanUrl, request, appendCustomParams, warn } from '@esri/arcgis-rest-request';
|
|
7
7
|
|
|
@@ -866,15 +866,15 @@ function searchGroupUsers(id, searchOptions) {
|
|
|
866
866
|
|
|
867
867
|
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
|
|
868
868
|
* Apache-2.0 */
|
|
869
|
-
function getSharingUrl(requestOptions) {
|
|
870
|
-
const
|
|
871
|
-
const owner = requestOptions.owner ||
|
|
869
|
+
function getSharingUrl(requestOptions, username) {
|
|
870
|
+
const providedUsername = username || requestOptions.authentication.username; // as any workaround for backward compatibility for discovering username from provided auth method
|
|
871
|
+
const owner = requestOptions.owner || providedUsername;
|
|
872
872
|
return `${getPortalUrl(requestOptions)}/content/users/${encodeURIComponent(owner)}/items/${requestOptions.id}/share`;
|
|
873
873
|
}
|
|
874
|
-
function isItemOwner(requestOptions) {
|
|
875
|
-
const
|
|
876
|
-
const owner = requestOptions.owner ||
|
|
877
|
-
return owner ===
|
|
874
|
+
function isItemOwner(requestOptions, username) {
|
|
875
|
+
const providedUsername = username || requestOptions.authentication.username; // as any workaround for backward compatibility for discovering username from provided auth method
|
|
876
|
+
const owner = requestOptions.owner || providedUsername;
|
|
877
|
+
return owner === providedUsername;
|
|
878
878
|
}
|
|
879
879
|
/**
|
|
880
880
|
* Check it the user is a full org_admin
|
|
@@ -882,8 +882,7 @@ function isItemOwner(requestOptions) {
|
|
|
882
882
|
* @returns Promise resolving in a boolean indicating if the user is an ArcGIS Organization administrator
|
|
883
883
|
*/
|
|
884
884
|
function isOrgAdmin(requestOptions) {
|
|
885
|
-
|
|
886
|
-
return session.getUser(requestOptions).then((user) => {
|
|
885
|
+
return requestOptions.authentication.getUser().then((user) => {
|
|
887
886
|
return user && user.role === "org_admin" && !user.roleId;
|
|
888
887
|
});
|
|
889
888
|
}
|
|
@@ -1937,6 +1936,7 @@ function updateGroup(requestOptions) {
|
|
|
1937
1936
|
* updateUserMemberships({
|
|
1938
1937
|
* id: groupId,
|
|
1939
1938
|
* admins: ["username3"],
|
|
1939
|
+
* newMemberType: "admin",
|
|
1940
1940
|
* authentication
|
|
1941
1941
|
* })
|
|
1942
1942
|
* .then(response);
|
|
@@ -2074,6 +2074,30 @@ function _combineResults(responses) {
|
|
|
2074
2074
|
return combined;
|
|
2075
2075
|
}
|
|
2076
2076
|
|
|
2077
|
+
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
|
|
2078
|
+
* Apache-2.0 */
|
|
2079
|
+
/**
|
|
2080
|
+
* Used to determine the username to use in a request. Will use the `username` passed in the
|
|
2081
|
+
* `requestOptions` if present, otherwise will use the username from the `authentication` option.
|
|
2082
|
+
* This method is used internally to determine the username to use in a request and is async to
|
|
2083
|
+
* support the case where the username is not immediately available.
|
|
2084
|
+
*
|
|
2085
|
+
* @param requestOptions the requests options
|
|
2086
|
+
* @returns the authentecated users username encoded for use in a URL.
|
|
2087
|
+
*/
|
|
2088
|
+
async function determineUsername(requestOptions) {
|
|
2089
|
+
var _a;
|
|
2090
|
+
if (requestOptions.username) {
|
|
2091
|
+
return encodeURIComponent(requestOptions.username);
|
|
2092
|
+
}
|
|
2093
|
+
if ((_a = requestOptions.authentication) === null || _a === void 0 ? void 0 : _a.username) {
|
|
2094
|
+
return encodeURIComponent(requestOptions.authentication.username);
|
|
2095
|
+
}
|
|
2096
|
+
if (requestOptions.authentication) {
|
|
2097
|
+
return requestOptions.authentication.getUsername().then(encodeURIComponent);
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2077
2101
|
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
|
|
2078
2102
|
* Apache-2.0 */
|
|
2079
2103
|
/**
|
|
@@ -2090,7 +2114,7 @@ function _combineResults(responses) {
|
|
|
2090
2114
|
* @param requestOptions - options to pass through in the request
|
|
2091
2115
|
* @returns A Promise that will resolve with metadata about the user
|
|
2092
2116
|
*/
|
|
2093
|
-
function getUser(requestOptions) {
|
|
2117
|
+
async function getUser(requestOptions) {
|
|
2094
2118
|
let url;
|
|
2095
2119
|
let options = { httpMethod: "GET" };
|
|
2096
2120
|
// if a username is passed, assume ArcGIS Online
|
|
@@ -2099,8 +2123,8 @@ function getUser(requestOptions) {
|
|
|
2099
2123
|
}
|
|
2100
2124
|
else {
|
|
2101
2125
|
// if an authenticated session is passed, default to that user/portal unless another username is provided manually
|
|
2102
|
-
const username =
|
|
2103
|
-
url = `${getPortalUrl(requestOptions)}/community/users/${
|
|
2126
|
+
const username = await determineUsername(requestOptions);
|
|
2127
|
+
url = `${getPortalUrl(requestOptions)}/community/users/${username}`;
|
|
2104
2128
|
options = Object.assign(Object.assign({}, requestOptions), options);
|
|
2105
2129
|
}
|
|
2106
2130
|
// send the request
|
|
@@ -2125,9 +2149,9 @@ function getUser(requestOptions) {
|
|
|
2125
2149
|
* @param IGetUserOptions - options to pass through in the request
|
|
2126
2150
|
* @returns A Promise that will resolve with the user tag array
|
|
2127
2151
|
*/
|
|
2128
|
-
function getUserTags(requestOptions) {
|
|
2129
|
-
const username =
|
|
2130
|
-
const url = `${getPortalUrl(requestOptions)}/community/users/${
|
|
2152
|
+
async function getUserTags(requestOptions) {
|
|
2153
|
+
const username = await determineUsername(requestOptions);
|
|
2154
|
+
const url = `${getPortalUrl(requestOptions)}/community/users/${username}/tags`;
|
|
2131
2155
|
// send the request
|
|
2132
2156
|
return request(url, requestOptions);
|
|
2133
2157
|
}
|
|
@@ -2139,6 +2163,7 @@ function getUserTags(requestOptions) {
|
|
|
2139
2163
|
*
|
|
2140
2164
|
* @param session
|
|
2141
2165
|
* @returns User url to be used in API requests.
|
|
2166
|
+
* @deprecated This function requires a synchronous `username` on the session object which is not guaranteed. Use `getUser` instead. This function will be removed in the next release.
|
|
2142
2167
|
*/
|
|
2143
2168
|
function getUserUrl(session) {
|
|
2144
2169
|
return `${getPortalUrl(session)}/community/users/${encodeURIComponent(session.username)}`;
|
|
@@ -2159,9 +2184,9 @@ function getUserUrl(session) {
|
|
|
2159
2184
|
* @param requestOptions - options to pass through in the request
|
|
2160
2185
|
* @returns A Promise that will resolve with the user's invitations
|
|
2161
2186
|
*/
|
|
2162
|
-
function getUserInvitations(requestOptions) {
|
|
2187
|
+
async function getUserInvitations(requestOptions) {
|
|
2163
2188
|
let options = { httpMethod: "GET" };
|
|
2164
|
-
const username =
|
|
2189
|
+
const username = await determineUsername(requestOptions);
|
|
2165
2190
|
const portalUrl = getPortalUrl(requestOptions);
|
|
2166
2191
|
const url = `${portalUrl}/community/users/${username}/invitations`;
|
|
2167
2192
|
options = Object.assign(Object.assign({}, requestOptions), options);
|
|
@@ -2184,8 +2209,8 @@ function getUserInvitations(requestOptions) {
|
|
|
2184
2209
|
* @param requestOptions - options to pass through in the request
|
|
2185
2210
|
* @returns A Promise that will resolve with the invitation
|
|
2186
2211
|
*/
|
|
2187
|
-
function getUserInvitation(requestOptions) {
|
|
2188
|
-
const username =
|
|
2212
|
+
async function getUserInvitation(requestOptions) {
|
|
2213
|
+
const username = await determineUsername(requestOptions);
|
|
2189
2214
|
const portalUrl = getPortalUrl(requestOptions);
|
|
2190
2215
|
const url = `${portalUrl}/community/users/${username}/invitations/${requestOptions.invitationId}`;
|
|
2191
2216
|
let options = { httpMethod: "GET" };
|
|
@@ -2209,8 +2234,8 @@ function getUserInvitation(requestOptions) {
|
|
|
2209
2234
|
* @param requestOptions - Options for the request
|
|
2210
2235
|
* @returns A Promise that will resolve with the success/failure status of the request
|
|
2211
2236
|
*/
|
|
2212
|
-
function acceptInvitation(requestOptions) {
|
|
2213
|
-
const username =
|
|
2237
|
+
async function acceptInvitation(requestOptions) {
|
|
2238
|
+
const username = await determineUsername(requestOptions);
|
|
2214
2239
|
const portalUrl = getPortalUrl(requestOptions);
|
|
2215
2240
|
const url = `${portalUrl}/community/users/${username}/invitations/${requestOptions.invitationId}/accept`;
|
|
2216
2241
|
const options = Object.assign({}, requestOptions);
|
|
@@ -2232,8 +2257,8 @@ function acceptInvitation(requestOptions) {
|
|
|
2232
2257
|
* @param requestOptions - Options for the request
|
|
2233
2258
|
* @returns A Promise that will resolve with the success/failure status of the request
|
|
2234
2259
|
*/
|
|
2235
|
-
function declineInvitation(requestOptions) {
|
|
2236
|
-
const username =
|
|
2260
|
+
async function declineInvitation(requestOptions) {
|
|
2261
|
+
const username = await determineUsername(requestOptions);
|
|
2237
2262
|
const portalUrl = getPortalUrl(requestOptions);
|
|
2238
2263
|
const url = `${portalUrl}/community/users/${username}/invitations/${requestOptions.invitationId}/decline`;
|
|
2239
2264
|
const options = Object.assign({}, requestOptions);
|
|
@@ -2256,9 +2281,9 @@ function declineInvitation(requestOptions) {
|
|
|
2256
2281
|
* @param requestOptions - options to pass through in the request
|
|
2257
2282
|
* @returns A Promise that will resolve with the user's notifications
|
|
2258
2283
|
*/
|
|
2259
|
-
function getUserNotifications(requestOptions) {
|
|
2284
|
+
async function getUserNotifications(requestOptions) {
|
|
2260
2285
|
let options = { httpMethod: "GET" };
|
|
2261
|
-
const username =
|
|
2286
|
+
const username = await determineUsername(requestOptions);
|
|
2262
2287
|
const portalUrl = getPortalUrl(requestOptions);
|
|
2263
2288
|
const url = `${portalUrl}/community/users/${username}/notifications`;
|
|
2264
2289
|
options = Object.assign(Object.assign({}, requestOptions), options);
|
|
@@ -2271,8 +2296,8 @@ function getUserNotifications(requestOptions) {
|
|
|
2271
2296
|
* @param requestOptions - Options for the request
|
|
2272
2297
|
* @returns A Promise that will resolve with the success/failure status of the request
|
|
2273
2298
|
*/
|
|
2274
|
-
function removeNotification(requestOptions) {
|
|
2275
|
-
const username =
|
|
2299
|
+
async function removeNotification(requestOptions) {
|
|
2300
|
+
const username = await determineUsername(requestOptions);
|
|
2276
2301
|
const portalUrl = getPortalUrl(requestOptions);
|
|
2277
2302
|
const url = `${portalUrl}/community/users/${username}/notifications/${requestOptions.id}/delete`;
|
|
2278
2303
|
return request(url, requestOptions);
|
|
@@ -2337,9 +2362,10 @@ function searchCommunityUsers(search) {
|
|
|
2337
2362
|
* @param requestOptions - options to pass through in the request
|
|
2338
2363
|
* @returns A Promise that will resolve with metadata about the user
|
|
2339
2364
|
*/
|
|
2340
|
-
function updateUser(requestOptions) {
|
|
2365
|
+
async function updateUser(requestOptions) {
|
|
2341
2366
|
// default to the authenticated username unless another username is provided manually
|
|
2342
|
-
const username = requestOptions.user.username ||
|
|
2367
|
+
const username = requestOptions.user.username ||
|
|
2368
|
+
(await requestOptions.authentication.getUsername());
|
|
2343
2369
|
const updateUrl = `${getPortalUrl(requestOptions)}/community/users/${encodeURIComponent(username)}/update`;
|
|
2344
2370
|
// mixin custom params and the user information, then drop the user info
|
|
2345
2371
|
requestOptions.params = Object.assign(Object.assign({}, requestOptions.user), requestOptions.params);
|
|
@@ -2408,9 +2434,10 @@ async function setUserProperties(username, properties, requestOptions) {
|
|
|
2408
2434
|
* @param requestOptions - Options for the request.
|
|
2409
2435
|
* @returns A Promise that will resolve with the data from the response.
|
|
2410
2436
|
*/
|
|
2411
|
-
function setItemAccess(requestOptions) {
|
|
2412
|
-
const
|
|
2413
|
-
|
|
2437
|
+
async function setItemAccess(requestOptions) {
|
|
2438
|
+
const username = await requestOptions.authentication.getUsername();
|
|
2439
|
+
const url = getSharingUrl(requestOptions, username);
|
|
2440
|
+
if (isItemOwner(requestOptions, username)) {
|
|
2414
2441
|
// if the user owns the item, proceed
|
|
2415
2442
|
return updateItemAccess(url, requestOptions);
|
|
2416
2443
|
}
|
|
@@ -2422,7 +2449,7 @@ function setItemAccess(requestOptions) {
|
|
|
2422
2449
|
}
|
|
2423
2450
|
else {
|
|
2424
2451
|
// if neither, updating the sharing isnt possible
|
|
2425
|
-
throw Error(`This item can not be shared by ${
|
|
2452
|
+
throw Error(`This item can not be shared by ${username}. They are neither the item owner nor an organization admin.`);
|
|
2426
2453
|
}
|
|
2427
2454
|
});
|
|
2428
2455
|
}
|
|
@@ -2503,9 +2530,9 @@ function isItemSharedWithGroup(requestOptions) {
|
|
|
2503
2530
|
* @param requestOptions - Options for the request.
|
|
2504
2531
|
* @returns A Promise that will resolve with the data from the response.
|
|
2505
2532
|
*/
|
|
2506
|
-
function shareItemWithGroup(requestOptions) {
|
|
2533
|
+
async function shareItemWithGroup(requestOptions) {
|
|
2507
2534
|
return isItemSharedWithGroup(requestOptions)
|
|
2508
|
-
.then((isShared) => {
|
|
2535
|
+
.then(async (isShared) => {
|
|
2509
2536
|
if (isShared) {
|
|
2510
2537
|
// already shared, exit early with success response
|
|
2511
2538
|
return {
|
|
@@ -2514,7 +2541,8 @@ function shareItemWithGroup(requestOptions) {
|
|
|
2514
2541
|
notSharedWith: []
|
|
2515
2542
|
};
|
|
2516
2543
|
}
|
|
2517
|
-
const {
|
|
2544
|
+
const { owner, confirmItemControl } = requestOptions;
|
|
2545
|
+
const username = await requestOptions.authentication.getUsername();
|
|
2518
2546
|
const itemOwner = owner || username;
|
|
2519
2547
|
// non-item owner
|
|
2520
2548
|
if (itemOwner !== username) {
|
|
@@ -2603,8 +2631,8 @@ function getMembershipAdjustments(currentUser, isSharedEditingGroup, membership,
|
|
|
2603
2631
|
}
|
|
2604
2632
|
return membershipGuarantees;
|
|
2605
2633
|
}
|
|
2606
|
-
function shareToGroup(requestOptions, isAdmin = false, isCrossOrgSharing = false) {
|
|
2607
|
-
const username = requestOptions.authentication.
|
|
2634
|
+
async function shareToGroup(requestOptions, isAdmin = false, isCrossOrgSharing = false) {
|
|
2635
|
+
const username = await requestOptions.authentication.getUsername();
|
|
2608
2636
|
const itemOwner = requestOptions.owner || username;
|
|
2609
2637
|
// decide what url to use
|
|
2610
2638
|
// default to the non-owner url...
|
|
@@ -2741,7 +2769,7 @@ function ensureMembership(currentUser, ownerUser, shouldPromote, errorMessage, r
|
|
|
2741
2769
|
* @returns A Promise that will resolve with the data from the response.
|
|
2742
2770
|
*/
|
|
2743
2771
|
function unshareItemWithGroup(requestOptions) {
|
|
2744
|
-
return isItemSharedWithGroup(requestOptions).then((isShared) => {
|
|
2772
|
+
return isItemSharedWithGroup(requestOptions).then(async (isShared) => {
|
|
2745
2773
|
// not shared
|
|
2746
2774
|
if (!isShared) {
|
|
2747
2775
|
// exit early with success response
|
|
@@ -2751,7 +2779,8 @@ function unshareItemWithGroup(requestOptions) {
|
|
|
2751
2779
|
notUnsharedFrom: []
|
|
2752
2780
|
});
|
|
2753
2781
|
}
|
|
2754
|
-
const {
|
|
2782
|
+
const { owner } = requestOptions;
|
|
2783
|
+
const username = await requestOptions.authentication.getUsername();
|
|
2755
2784
|
// next check if the user is a member of the group
|
|
2756
2785
|
return Promise.all([
|
|
2757
2786
|
getUserMembership(requestOptions),
|
|
@@ -2784,8 +2813,8 @@ function unshareItemWithGroup(requestOptions) {
|
|
|
2784
2813
|
});
|
|
2785
2814
|
});
|
|
2786
2815
|
}
|
|
2787
|
-
function unshareFromGroup(requestOptions) {
|
|
2788
|
-
const username = requestOptions.authentication.
|
|
2816
|
+
async function unshareFromGroup(requestOptions) {
|
|
2817
|
+
const username = await requestOptions.authentication.getUsername();
|
|
2789
2818
|
const itemOwner = requestOptions.owner || username;
|
|
2790
2819
|
// decide what url to use
|
|
2791
2820
|
// default to the non-owner url...
|
|
@@ -2913,5 +2942,5 @@ function getPortalSettings(id, requestOptions) {
|
|
|
2913
2942
|
return request(url, options);
|
|
2914
2943
|
}
|
|
2915
2944
|
|
|
2916
|
-
export { SearchQueryBuilder, acceptInvitation, addGroupUsers, addItemData, addItemPart, addItemRelationship, addItemResource, bboxToString, cancelItemUpload, commitItemUpload, createFolder, createGroup, createGroupNotification, createItem, createItemInFolder, createOrgNotification, declineInvitation, determineOwner, ensureMembership, exportItem, getGroup, getGroupCategorySchema, getGroupContent, getGroupUsers, getItem, getItemBaseUrl, getItemData, getItemGroups, getItemInfo, getItemMetadata, getItemParts, getItemResource, getItemResources, getItemStatus, getPortal, getPortalSettings, getPortalUrl, getRelatedItems, getSelf, getSharingUrl, getUniqueServiceName, getUser, getUserContent, getUserInvitation, getUserInvitations, getUserMembership, getUserNotifications, getUserProperties, getUserTags, getUserUrl, inviteGroupUsers, isBBox, isItemOwner, isItemSharedWithGroup, isOrgAdmin, isServiceNameAvailable, joinGroup, leaveGroup, moveItem, protectGroup, protectItem, reassignItem, removeFolder, removeGroup, removeGroupUsers, removeItem, removeItemRelationship, removeItemResource, removeNotification, scrubControlChars, searchCommunityUsers, searchGroupContent, searchGroupUsers, searchGroups, searchItems, searchUsers, setItemAccess, setUserProperties, shareItemWithGroup, unprotectGroup, unprotectItem, unshareItemWithGroup, updateGroup, updateItem, updateItemInfo, updateItemResource, updateUser, updateUserMemberships };
|
|
2945
|
+
export { SearchQueryBuilder, acceptInvitation, addGroupUsers, addItemData, addItemPart, addItemRelationship, addItemResource, bboxToString, cancelItemUpload, commitItemUpload, createFolder, createGroup, createGroupNotification, createItem, createItemInFolder, createOrgNotification, declineInvitation, determineOwner, determineUsername, ensureMembership, exportItem, getGroup, getGroupCategorySchema, getGroupContent, getGroupUsers, getItem, getItemBaseUrl, getItemData, getItemGroups, getItemInfo, getItemMetadata, getItemParts, getItemResource, getItemResources, getItemStatus, getPortal, getPortalSettings, getPortalUrl, getRelatedItems, getSelf, getSharingUrl, getUniqueServiceName, getUser, getUserContent, getUserInvitation, getUserInvitations, getUserMembership, getUserNotifications, getUserProperties, getUserTags, getUserUrl, inviteGroupUsers, isBBox, isItemOwner, isItemSharedWithGroup, isOrgAdmin, isServiceNameAvailable, joinGroup, leaveGroup, moveItem, protectGroup, protectItem, reassignItem, removeFolder, removeGroup, removeGroupUsers, removeItem, removeItemRelationship, removeItemResource, removeNotification, scrubControlChars, searchCommunityUsers, searchGroupContent, searchGroupUsers, searchGroups, searchItems, searchUsers, setItemAccess, setUserProperties, shareItemWithGroup, unprotectGroup, unprotectItem, unshareItemWithGroup, updateGroup, updateItem, updateItemInfo, updateItemResource, updateUser, updateUserMemberships };
|
|
2917
2946
|
//# sourceMappingURL=portal.esm.js.map
|