New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@esri/arcgis-rest-portal

Package Overview
Dependencies
Maintainers
6
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esri/arcgis-rest-portal - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

dist/esm/users/get-user-tags.d.ts

1

dist/esm/index.d.ts

@@ -20,2 +20,3 @@ export * from "./items/add";

export * from "./users/get-user";
export * from "./users/get-user-tags";
export * from "./users/get-user-url";

@@ -22,0 +23,0 @@ export * from "./users/invitation";

@@ -21,2 +21,3 @@ /* Copyright (c) 2018-2019 Environmental Systems Research Institute, Inc.

export * from "./users/get-user";
export * from "./users/get-user-tags";
export * from "./users/get-user-url";

@@ -23,0 +24,0 @@ export * from "./users/invitation";

@@ -1,2 +0,2 @@

import { IUserItemOptions, IItemResourceOptions, IUpdateItemResponse, IItemResourceResponse, IManageItemRelationshipOptions } from "./helpers";
import { IUserItemOptions, IItemResourceOptions, IUpdateItemResponse, IItemResourceResponse, IManageItemRelationshipOptions, IItemPartOptions } from "./helpers";
export interface IAddItemDataOptions extends IUserItemOptions {

@@ -74,1 +74,20 @@ /**

export declare function addItemResource(requestOptions: IItemResourceOptions): Promise<IItemResourceResponse>;
/**
* ```js
* import { addItemPart } from "@esri/arcgis-rest-portal";
* //
* addItemPart({
* id: "30e5fe3149c34df1ba922e6f5bbf808f",
* part: data,
* partNum: 1,
* authentication
* })
* .then(response)
* ```
* Inquire about status when publishing an item, adding an item in async mode, or adding with a multipart upload. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/add-item-part.htm) for more information.
*
* @param id - The Id of the item to get status for.
* @param requestOptions - Options for the request
* @returns A Promise to get the item status.
*/
export declare function addItemPart(requestOptions?: IItemPartOptions): Promise<IUpdateItemResponse>;

@@ -91,2 +91,26 @@ /* Copyright (c) 2018 Environmental Systems Research Institute, Inc.

}
/**
* ```js
* import { addItemPart } from "@esri/arcgis-rest-portal";
* //
* addItemPart({
* id: "30e5fe3149c34df1ba922e6f5bbf808f",
* part: data,
* partNum: 1,
* authentication
* })
* .then(response)
* ```
* Inquire about status when publishing an item, adding an item in async mode, or adding with a multipart upload. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/add-item-part.htm) for more information.
*
* @param id - The Id of the item to get status for.
* @param requestOptions - Options for the request
* @returns A Promise to get the item status.
*/
export function addItemPart(requestOptions) {
var owner = determineOwner(requestOptions);
var url = getPortalUrl(requestOptions) + "/content/users/" + owner + "/items/" + requestOptions.id + "/addPart";
var options = appendCustomParams(requestOptions, ["file", "partNum"], { params: tslib_1.__assign({}, requestOptions.params) });
return request(url, options);
}
//# sourceMappingURL=add.js.map

8

dist/esm/items/create.d.ts

@@ -35,7 +35,6 @@ import { IItemAdd } from "@esri/arcgis-rest-types";

* //
* createItem({
* createItemInFolder({
* item: {
* title: "The Amazing Voyage",
* type: "Web Map",
* data: {}
* type: "Web Map"
* },

@@ -58,4 +57,3 @@ * folderId: 'fe8',

* title: "The Amazing Voyage",
* type: "Web Map",
* data: {}
* type: "Web Map"
* },

@@ -62,0 +60,0 @@ * authentication

/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */
import * as tslib_1 from "tslib";
import { request } from "@esri/arcgis-rest-request";
import { request, appendCustomParams } from "@esri/arcgis-rest-request";
import { getPortalUrl } from "../util/get-portal-url";

@@ -33,7 +33,6 @@ import { serializeItem, determineOwner } from "./helpers";

* //
* createItem({
* createItemInFolder({
* item: {
* title: "The Amazing Voyage",
* type: "Web Map",
* data: {}
* type: "Web Map"
* },

@@ -49,2 +48,8 @@ * folderId: 'fe8',

export function createItemInFolder(requestOptions) {
if (requestOptions.file && !requestOptions.multipart) {
return Promise.reject(new Error("The request must be a multipart request for file uploading."));
}
if (requestOptions.multipart && !requestOptions.filename) {
return Promise.reject(new Error("The file name is required for a multipart request."));
}
var owner = determineOwner(requestOptions);

@@ -56,5 +61,17 @@ var baseUrl = getPortalUrl(requestOptions) + "/content/users/" + owner;

}
requestOptions.params = tslib_1.__assign({}, requestOptions.params, serializeItem(requestOptions.item));
// serialize the item into something Portal will accept
requestOptions.params = tslib_1.__assign({}, requestOptions.params, serializeItem(requestOptions.item));
return request(url, requestOptions);
var options = appendCustomParams(requestOptions, [
"owner",
"folderId",
"file",
"dataUrl",
"text",
"async",
"multipart",
"filename"
], {
params: tslib_1.__assign({}, requestOptions.params)
});
return request(url, options);
}

@@ -68,4 +85,3 @@ /**

* title: "The Amazing Voyage",
* type: "Web Map",
* data: {}
* type: "Web Map"
* },

@@ -72,0 +88,0 @@ * authentication

import { IRequestOptions } from "@esri/arcgis-rest-request";
import { IItem, IGroup } from "@esri/arcgis-rest-types";
import { IItemDataOptions, IItemRelationshipOptions } from "./helpers";
import { IItemDataOptions, IItemRelationshipOptions, IUserItemOptions } from "./helpers";
/**

@@ -83,1 +83,57 @@ * ```

export declare function getItemGroups(id: string, requestOptions?: IRequestOptions): Promise<IGetItemGroupsResponse>;
export interface IItemStatusOptions extends IUserItemOptions {
/**
* The type of asynchronous job for which the status has to be checked. Default is none, which check the item's status.
*/
jobType?: "publish" | "generateFeatures" | "export" | "createService";
/**
* The job ID returned during publish, generateFeatures, export, and createService calls.
*/
jobId?: string;
/**
* The response format. The default and the only response format for this resource is HTML.
*/
format?: "html";
}
export interface IGetItemStatusResponse {
status: "partial" | "processing" | "failed" | "completed";
statusMessage: string;
itemId: string;
}
/**
* ```js
* import { getItemStatus } from "@esri/arcgis-rest-portal";
* //
* getItemStatus({
* id: "30e5fe3149c34df1ba922e6f5bbf808f",
* authentication
* })
* .then(response)
* ```
* Inquire about status when publishing an item, adding an item in async mode, or adding with a multipart upload. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/status.htm) for more information.
*
* @param id - The Id of the item to get status for.
* @param requestOptions - Options for the request
* @returns A Promise to get the item status.
*/
export declare function getItemStatus(requestOptions: IItemStatusOptions): Promise<IGetItemStatusResponse>;
export interface IGetItemPartsResponse {
parts: number[];
}
/**
* ```js
* import { getItemParts } from "@esri/arcgis-rest-portal";
* //
* getItemParts({
* id: "30e5fe3149c34df1ba922e6f5bbf808f",
* authentication
* })
* .then(response)
* ```
* Lists the part numbers of the file parts that have already been uploaded in a multipart file upload. This method can be used to verify the parts that have been received as well as those parts that were not received by the server. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/parts.htm) for more information.
*
* @param id - The Id of the item to get part list.
* @param requestOptions - Options for the request
* @returns A Promise to get the item part list.
*/
export declare function getItemParts(requestOptions: IUserItemOptions): Promise<IGetItemPartsResponse>;
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */
import * as tslib_1 from "tslib";
import { request } from "@esri/arcgis-rest-request";
import { request, appendCustomParams } from "@esri/arcgis-rest-request";
import { getPortalUrl } from "../util/get-portal-url";
import { determineOwner } from "./helpers";
/**

@@ -121,2 +122,45 @@ * ```

}
/**
* ```js
* import { getItemStatus } from "@esri/arcgis-rest-portal";
* //
* getItemStatus({
* id: "30e5fe3149c34df1ba922e6f5bbf808f",
* authentication
* })
* .then(response)
* ```
* Inquire about status when publishing an item, adding an item in async mode, or adding with a multipart upload. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/status.htm) for more information.
*
* @param id - The Id of the item to get status for.
* @param requestOptions - Options for the request
* @returns A Promise to get the item status.
*/
export function getItemStatus(requestOptions) {
var owner = determineOwner(requestOptions);
var url = getPortalUrl(requestOptions) + "/content/users/" + owner + "/items/" + requestOptions.id + "/status";
var options = appendCustomParams(requestOptions, ["jobId", "jobType"], { params: tslib_1.__assign({}, requestOptions.params) });
return request(url, options);
}
/**
* ```js
* import { getItemParts } from "@esri/arcgis-rest-portal";
* //
* getItemParts({
* id: "30e5fe3149c34df1ba922e6f5bbf808f",
* authentication
* })
* .then(response)
* ```
* Lists the part numbers of the file parts that have already been uploaded in a multipart file upload. This method can be used to verify the parts that have been received as well as those parts that were not received by the server. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/parts.htm) for more information.
*
* @param id - The Id of the item to get part list.
* @param requestOptions - Options for the request
* @returns A Promise to get the item part list.
*/
export function getItemParts(requestOptions) {
var owner = determineOwner(requestOptions);
var url = getPortalUrl(requestOptions) + "/content/users/" + owner + "/items/" + requestOptions.id + "/parts";
return request(url, requestOptions);
}
//# sourceMappingURL=get.js.map

@@ -74,2 +74,26 @@ import { IRequestOptions } from "@esri/arcgis-rest-request";

folderId?: string;
/**
* The file to be uploaded. If uploading a file, the request must be a multipart request.
*/
file?: any;
/**
* The URL where the item can be downloaded. The resource will be downloaded and stored as a file type. Similar to uploading a file to be added, but instead of transferring the contents of the file, the URL of the data file is referenced and creates a file item.
*/
dataUrl?: string;
/**
* The text content for the item to be submitted.
*/
text?: string;
/**
* If true, the file is uploaded asynchronously. If false, the file is uploaded synchronously.
*/
async?: boolean;
/**
* If true, the file is uploaded in multiple parts.
*/
multipart?: boolean;
/**
* The filename being uploaded in multipart mode. Required if multipart=true.
*/
filename?: string;
}

@@ -82,2 +106,12 @@ export interface IItemDataOptions extends IRequestOptions {

}
export interface IItemPartOptions extends IUserItemOptions {
/**
* The file part to be uploaded.
*/
file: any;
/**
* Part numbers can be any number from 1 to 10,000, inclusive. A part number uniquely identifies a part and also defines its position within the object being created. If you upload a new part using the same part number that was used with a previous part, the previously uploaded part is overwritten.
*/
partNum: number;
}
export interface IUpdateItemResponse {

@@ -84,0 +118,0 @@ success: boolean;

@@ -24,2 +24,3 @@ "use strict";

tslib_1.__exportStar(require("./users/get-user"), exports);
tslib_1.__exportStar(require("./users/get-user-tags"), exports);
tslib_1.__exportStar(require("./users/get-user-url"), exports);

@@ -26,0 +27,0 @@ tslib_1.__exportStar(require("./users/invitation"), exports);

@@ -96,2 +96,27 @@ "use strict";

exports.addItemResource = addItemResource;
/**
* ```js
* import { addItemPart } from "@esri/arcgis-rest-portal";
* //
* addItemPart({
* id: "30e5fe3149c34df1ba922e6f5bbf808f",
* part: data,
* partNum: 1,
* authentication
* })
* .then(response)
* ```
* Inquire about status when publishing an item, adding an item in async mode, or adding with a multipart upload. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/add-item-part.htm) for more information.
*
* @param id - The Id of the item to get status for.
* @param requestOptions - Options for the request
* @returns A Promise to get the item status.
*/
function addItemPart(requestOptions) {
var owner = helpers_1.determineOwner(requestOptions);
var url = get_portal_url_1.getPortalUrl(requestOptions) + "/content/users/" + owner + "/items/" + requestOptions.id + "/addPart";
var options = arcgis_rest_request_1.appendCustomParams(requestOptions, ["file", "partNum"], { params: tslib_1.__assign({}, requestOptions.params) });
return arcgis_rest_request_1.request(url, options);
}
exports.addItemPart = addItemPart;
//# sourceMappingURL=add.js.map

@@ -36,7 +36,6 @@ "use strict";

* //
* createItem({
* createItemInFolder({
* item: {
* title: "The Amazing Voyage",
* type: "Web Map",
* data: {}
* type: "Web Map"
* },

@@ -52,2 +51,8 @@ * folderId: 'fe8',

function createItemInFolder(requestOptions) {
if (requestOptions.file && !requestOptions.multipart) {
return Promise.reject(new Error("The request must be a multipart request for file uploading."));
}
if (requestOptions.multipart && !requestOptions.filename) {
return Promise.reject(new Error("The file name is required for a multipart request."));
}
var owner = helpers_1.determineOwner(requestOptions);

@@ -59,5 +64,17 @@ var baseUrl = get_portal_url_1.getPortalUrl(requestOptions) + "/content/users/" + owner;

}
requestOptions.params = tslib_1.__assign({}, requestOptions.params, helpers_1.serializeItem(requestOptions.item));
// serialize the item into something Portal will accept
requestOptions.params = tslib_1.__assign({}, requestOptions.params, helpers_1.serializeItem(requestOptions.item));
return arcgis_rest_request_1.request(url, requestOptions);
var options = arcgis_rest_request_1.appendCustomParams(requestOptions, [
"owner",
"folderId",
"file",
"dataUrl",
"text",
"async",
"multipart",
"filename"
], {
params: tslib_1.__assign({}, requestOptions.params)
});
return arcgis_rest_request_1.request(url, options);
}

@@ -72,4 +89,3 @@ exports.createItemInFolder = createItemInFolder;

* title: "The Amazing Voyage",
* type: "Web Map",
* data: {}
* type: "Web Map"
* },

@@ -76,0 +92,0 @@ * authentication

@@ -8,2 +8,3 @@ "use strict";

var get_portal_url_1 = require("../util/get-portal-url");
var helpers_1 = require("./helpers");
/**

@@ -129,2 +130,47 @@ * ```

exports.getItemGroups = getItemGroups;
/**
* ```js
* import { getItemStatus } from "@esri/arcgis-rest-portal";
* //
* getItemStatus({
* id: "30e5fe3149c34df1ba922e6f5bbf808f",
* authentication
* })
* .then(response)
* ```
* Inquire about status when publishing an item, adding an item in async mode, or adding with a multipart upload. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/status.htm) for more information.
*
* @param id - The Id of the item to get status for.
* @param requestOptions - Options for the request
* @returns A Promise to get the item status.
*/
function getItemStatus(requestOptions) {
var owner = helpers_1.determineOwner(requestOptions);
var url = get_portal_url_1.getPortalUrl(requestOptions) + "/content/users/" + owner + "/items/" + requestOptions.id + "/status";
var options = arcgis_rest_request_1.appendCustomParams(requestOptions, ["jobId", "jobType"], { params: tslib_1.__assign({}, requestOptions.params) });
return arcgis_rest_request_1.request(url, options);
}
exports.getItemStatus = getItemStatus;
/**
* ```js
* import { getItemParts } from "@esri/arcgis-rest-portal";
* //
* getItemParts({
* id: "30e5fe3149c34df1ba922e6f5bbf808f",
* authentication
* })
* .then(response)
* ```
* Lists the part numbers of the file parts that have already been uploaded in a multipart file upload. This method can be used to verify the parts that have been received as well as those parts that were not received by the server. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/parts.htm) for more information.
*
* @param id - The Id of the item to get part list.
* @param requestOptions - Options for the request
* @returns A Promise to get the item part list.
*/
function getItemParts(requestOptions) {
var owner = helpers_1.determineOwner(requestOptions);
var url = get_portal_url_1.getPortalUrl(requestOptions) + "/content/users/" + owner + "/items/" + requestOptions.id + "/parts";
return arcgis_rest_request_1.request(url, requestOptions);
}
exports.getItemParts = getItemParts;
//# sourceMappingURL=get.js.map
/* @preserve
* @esri/arcgis-rest-portal - v2.3.0 - Apache-2.0
* @esri/arcgis-rest-portal - v2.4.0 - Apache-2.0
* Copyright (c) 2017-2019 Esri, Inc.
* Thu Aug 08 2019 09:31:33 GMT-0700 (PDT)
* Thu Aug 29 2019 09:33:08 GMT-0600 (Mountain Daylight Time)
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@esri/arcgis-rest-request")):"function"==typeof define&&define.amd?define(["exports","@esri/arcgis-rest-request"],e):e((t=t||self).arcgisRest=t.arcgisRest||{},t.arcgisRest)}(this,function(t,s){"use strict";var u=function(){return(u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function c(t){return void 0===t&&(t={}),t.portal?s.cleanUrl(t.portal):t.authentication?t.authentication.portal:"https://www.arcgis.com/sharing/rest"}function o(t){var e=JSON.parse(JSON.stringify(t));return e.data&&("undefined"!=typeof Blob&&t.data instanceof Blob||"ReadStream"===t.data.constructor.name?e.file=t.data:e.text=t.data,delete e.data),e}function i(t){return t.owner?t.owner:t.item&&t.item.owner?t.item.owner:t.authentication.username}function r(t){var e=i(t),r=c(t)+"/content/users/"+e+"/items/"+t.item.id+"/update";return t.params=u({},t.params,o(t.item)),s.request(r,t)}function e(t){var e=i(t),r=c(t)+"/content/users/"+e,n=r+"/addItem";return t.folderId&&(n=r+"/"+t.folderId+"/addItem"),t.params=u({},t.params,o(t.item)),s.request(n,t)}var a=function(){function t(t){void 0===t&&(t=""),this.termStack=[],this.rangeStack=[],this.openGroups=0,this.q=t}return t.prototype.match=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.termStack=this.termStack.concat(t),this},t.prototype.in=function(t){var e="`in("+(t?'"'+t+'"':"")+")`";return this.hasRange||this.hasTerms?(t&&"*"!==t&&(this.q+=t+":"),this.commit()):(s.warn(e+" was called with no call to `match(...)` or `from(...)`/`to(...)`. Your query was not modified."),this)},t.prototype.startGroup=function(){return this.commit(),0<this.openGroups&&(this.q+=" "),this.openGroups++,this.q+="(",this},t.prototype.endGroup=function(){return this.openGroups<=0?s.warn("`endGroup(...)` was called without calling `startGroup(...)` first. Your query was not modified."):(this.commit(),this.openGroups--,this.q+=")"),this},t.prototype.and=function(){return this.addModifier("and")},t.prototype.or=function(){return this.addModifier("or")},t.prototype.not=function(){return this.addModifier("not")},t.prototype.from=function(t){return this.hasTerms?s.warn("`from(...)` is not allowed after `match(...)` try using `.from(...).to(...).in(...)`. Your query was not modified."):this.rangeStack[0]=t,this},t.prototype.to=function(t){return this.hasTerms?s.warn("`to(...)` is not allowed after `match(...)` try using `.from(...).to(...).in(...)`. Your query was not modified."):this.rangeStack[1]=t,this},t.prototype.boost=function(t){return this.commit(),this.q+="^"+t,this},t.prototype.toParam=function(){return this.commit(),this.cleanup(),this.q},t.prototype.clone=function(){return this.commit(),this.cleanup(),new t(this.q+"")},t.prototype.addModifier=function(t){return this.currentModifer?(s.warn("You have called `"+this.currentModifer+"()` after `"+t+"()`. Your current query was not modified."),this):(this.commit(),""===this.q&&"not"!==t?s.warn("You have called `"+t+"()` without calling another method to modify your query first. Try calling `match()` first."):(this.currentModifer=t,this.q+=""===this.q?"":" ",this.q+=t.toUpperCase()+" "),this)},t.prototype.hasWhiteSpace=function(t){return/\s/g.test(t)},t.prototype.formatTerm=function(t){return t instanceof Date?t.getTime():"string"==typeof t&&this.hasWhiteSpace(t)?'"'+t+'"':t},t.prototype.commit=function(){var e=this;return this.currentModifer=void 0,this.hasRange&&(this.q+="["+this.formatTerm(this.rangeStack[0])+" TO "+this.formatTerm(this.rangeStack[1])+"]",this.rangeStack=[void 0,void 0]),this.hasTerms&&(this.q+=this.termStack.map(function(t){return e.formatTerm(t)}).join(" "),this.termStack=[]),this},Object.defineProperty(t.prototype,"hasTerms",{get:function(){return 0<this.termStack.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasRange",{get:function(){return this.rangeStack.length&&this.rangeStack[0]&&this.rangeStack[1]},enumerable:!0,configurable:!0}),t.prototype.cleanup=function(){if(0<this.openGroups)for(s.warn("Automatically closing "+this.openGroups+" group(s). You can use `endGroup(...)` to remove this warning.");0<this.openGroups;)this.q+=")",this.openGroups--;var t=this.q;this.q=t.replace(/( AND ?| NOT ?| OR ?)*$/,""),t!==this.q&&s.warn("`startGroup(...)` was called without calling `endGroup(...)` first. Your query was not modified."),this.q=this.q.replace(/(\(\))*/,"")},t}();function m(r,n){var t,e;return t=c(e="string"==typeof r||r instanceof a?{httpMethod:"GET",params:{q:r}}:s.appendCustomParams(r,["q","num","start","sortField","sortOrder"],{httpMethod:"GET"}))+("item"===n?"/search":"/community/groups"),s.request(t,e).then(function(e){return e.nextStart&&-1!==e.nextStart&&(e.nextPage=function(){var t;return"string"==typeof r||r instanceof a?t={q:r,start:e.nextStart}:(t=r).start=e.nextStart,m(t,n)}),e})}function p(e,t,r){return!t||t.length<1?[]:function(t,e){if(0===t.length)return[];for(var r=[],n=0;n<t.length;n+=e)r.push(t.slice(n,n+e));return r}(t,25).map(function(t){return function(t,e,r){var n,o;return Object.assign({},r,((n={})[t]=e,n.params=u({},r.params,((o={})[t]=e,o)),n))}(e,t,r)})}function d(t){var e=t.filter(function(t){return t.notAdded}).reduce(function(t,e){return t.concat(e.notAdded)},[]),r=t.filter(function(t){return t.errors}).reduce(function(t,e){return t.concat(e.errors)},[]),n={notAdded:e};return 0<r.length&&(n.errors=r),n}function n(t,e){var r=c(e)+"/community/groups/"+t,n=u({httpMethod:"GET"},e);return s.request(r,n)}function h(t){var e=t.authentication.username,r=t.owner||e;return c(t)+"/content/users/"+encodeURIComponent(r)+"/items/"+t.id+"/share"}function f(t){var e=t.authentication.username;return(t.owner||e)===e}function l(t){return t.authentication.getUser(t).then(function(t){return!(!t||"org_admin"!==t.role)})}function g(t){return n(t.groupId,t).then(function(t){return t.userMembership.memberType}).catch(function(){return"nonmember"})}function v(t,e){return e.params=u({org:!1,everyone:!1},e.params),"private"===e.access&&(e.params.groups=" "),"org"===e.access&&(e.params.org=!0),"public"===e.access&&(e.params.account=!0,e.params.everyone=!0),s.request(t,e)}function y(o){var i=o.authentication.username,a=o.owner||i;return l(o).then(function(r){var n="share"===o.action?"notSharedWith":"notUnsharedFrom";return function(n){var t={q:"id: "+n.id+" AND group: "+n.groupId,start:1,num:10,sortField:"title"},e=u({},n,{rawResponse:!1});e.params=u({},t,n.params);var r=c(e)+"/search";return s.request(r,e).then(function(t){return 0!==t.total&&(t.results.some(function(t){var e=t.id===n.id;return e&&(r=t),e}),!!r);var r})}(o).then(function(t){if("share"===o.action&&!0===t||"unshare"===o.action&&!1===t){var e={itemId:o.id,shortcut:!0};return e[n]=[],e}return g(o).then(function(t){if("nonmember"===t)throw Error("This item can not be "+o.action+"d by "+i+" as they are not a member of the specified group "+o.groupId+".");if(a===i)return c(o)+"/content/users/"+a+"/items/"+o.id+"/"+o.action;if("admin"===t||"owner"===t||r)return c(o)+"/content/items/"+o.id+"/"+o.action;throw Error("This item can not be "+o.action+"d by "+i+" as they are neither the owner, a groupAdmin of "+o.groupId+", nor an org_admin.")}).then(function(t){return o.params={groups:o.groupId,confirmItemControl:o.confirmItemControl},s.request(t,o)}).then(function(t){if(t[n].length)throw Error("Item "+o.id+" could not be "+o.action+"d to group "+o.groupId+".");return t})})})}function q(t,e){var r=t||"self",n=c(e)+"/portals/"+r,o=u({httpMethod:"GET"},e);return s.request(n,o)}t.SearchQueryBuilder=a,t.acceptInvitation=function(t){var e=encodeURIComponent(t.authentication.username),r=c(t)+"/community/users/"+e+"/invitations/"+t.invitationId+"/accept",n=u({},t);return s.request(r,n)},t.addGroupUsers=function(t){var e=t.id,r=c(t)+"/community/groups/"+e+"/addUsers",n=Object.assign({},t,{admins:void 0,users:void 0}),o=p("users",t.users,n).concat(p("admins",t.admins,n)).map(function(t){return function(t,e){return s.request(t,e).catch(function(t){return{errors:[t]}})}(r,t)});return Promise.all(o).then(d)},t.addItemData=function(t){i(t);var e=u({item:{id:t.id,data:t.data}},t);return delete e.id,delete e.data,r(e)},t.addItemRelationship=function(t){var e=i(t),r=c(t)+"/content/users/"+e+"/addRelationship",n=s.appendCustomParams(t,["originItemId","destinationItemId","relationshipType"],{params:u({},t.params)});return s.request(r,n)},t.addItemResource=function(t){var e=i(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/addResources";return t.params=u({file:t.resource,fileName:t.name,text:t.content,access:t.private?"private":"inherit"},t.params),s.request(r,t)},t.createFolder=function(t){var e=i(t),r=c(t)+"/content/users/"+e+"/createFolder";return t.params=u({title:t.title},t.params),s.request(r,t)},t.createGroup=function(t){var e=c(t)+"/community/createGroup";return t.params=u({},t.params,t.group),s.request(e,t)},t.createGroupNotification=function(t){var e=c(t)+"/community/groups/"+t.id+"/createNotification",r=u({params:u({subject:t.subject,message:t.message,users:t.users,notificationChannelType:t.notificationChannelType||"email",clientId:t.clientId,silentNotification:t.silentNotification,notifyAll:!t.users||0===t.users.length},t.params)},t);return s.request(e,r)},t.createItem=function(t){return e(u({folderId:null},t))},t.createItemInFolder=e,t.declineInvitation=function(t){var e=encodeURIComponent(t.authentication.username),r=c(t)+"/community/users/"+e+"/invitations/"+t.invitationId+"/decline",n=u({},t);return s.request(r,n)},t.determineOwner=i,t.getGroup=n,t.getGroupContent=function(t,e){var r=c(e)+"/content/groups/"+t,n=u({httpMethod:"GET"},{params:{start:1,num:100}},e);return e&&e.paging&&(n.params=u({},e.paging)),s.request(r,n)},t.getGroupUsers=function(t,e){var r=c(e)+"/community/groups/"+t+"/users",n=u({httpMethod:"GET"},e);return s.request(r,n)},t.getItem=function(t,e){var r=c(e)+"/content/items/"+t,n=u({httpMethod:"GET"},e);return s.request(r,n)},t.getItemData=function(t,e){var r=c(e)+"/content/items/"+t+"/data",n=u({httpMethod:"GET",params:{}},e);return n.file&&(n.params.f=null),s.request(r,n).catch(function(t){if(!RegExp(/Unexpected end of (JSON input|data at line 1 column 1)/i).test(t.message))throw t})},t.getItemGroups=function(t,e){var r=c(e)+"/content/items/"+t+"/groups";return s.request(r,e)},t.getItemResources=function(t,e){var r=c(e)+"/content/items/"+t+"/resources";return e.params=u({},e.params,{num:1e3}),s.request(r,e)},t.getPortal=q,t.getPortalUrl=c,t.getRelatedItems=function(t){var e=c(t)+"/content/items/"+t.id+"/relatedItems",r=u({httpMethod:"GET",params:{direction:t.direction}},t);return"string"==typeof t.relationshipType?r.params.relationshipType=t.relationshipType:r.params.relationshipTypes=t.relationshipType,delete r.direction,delete r.relationshipType,s.request(e,r)},t.getSelf=function(t){return q(null,t)},t.getSharingUrl=h,t.getUser=function(t){var e,r={httpMethod:"GET"};if("string"==typeof t)e="https://www.arcgis.com/sharing/rest/community/users/"+t;else{var n=t.username||t.authentication.username;e=c(t)+"/community/users/"+encodeURIComponent(n),r=u({},t,r)}return s.request(e,r)},t.getUserInvitation=function(t){var e=encodeURIComponent(t.authentication.username),r=c(t)+"/community/users/"+e+"/invitations/"+t.invitationId,n={httpMethod:"GET"};return n=u({},t,n),s.request(r,n)},t.getUserInvitations=function(t){var e={httpMethod:"GET"},r=encodeURIComponent(t.authentication.username),n=c(t)+"/community/users/"+r+"/invitations";return e=u({},t,e),s.request(n,e)},t.getUserMembership=g,t.getUserNotifications=function(t){var e={httpMethod:"GET"},r=encodeURIComponent(t.authentication.username),n=c(t)+"/community/users/"+r+"/notifications";return e=u({},t,e),s.request(n,e)},t.getUserUrl=function(t){return c(t)+"/community/users/"+encodeURIComponent(t.username)},t.isItemOwner=f,t.isOrgAdmin=l,t.joinGroup=function(t){var e=c(t)+"/community/groups/"+t.id+"/join";return s.request(e,t)},t.leaveGroup=function(t){var e=c(t)+"/community/groups/"+t.id+"/leave";return s.request(e,t)},t.moveItem=function(t){var e=i(t),r=c(t)+"/content/users/"+e+"/items/"+t.itemId+"/move",n=t.folderId;return n||(n="/"),t.params=u({folder:n},t.params),s.request(r,t)},t.protectGroup=function(t){var e=c(t)+"/community/groups/"+t.id+"/protect";return s.request(e,t)},t.protectItem=function(t){var e=i(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/protect";return s.request(r,t)},t.removeFolder=function(t){var e=i(t),r=c(t)+"/content/users/"+encodeURIComponent(e)+"/"+t.folderId+"/delete";return s.request(r,t)},t.removeGroup=function(t){var e=c(t)+"/community/groups/"+t.id+"/delete",r=u({},t);return s.request(e,r)},t.removeItem=function(t){var e=i(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/delete";return s.request(r,t)},t.removeItemRelationship=function(t){var e=i(t),r=c(t)+"/content/users/"+e+"/removeRelationship",n=s.appendCustomParams(t,["originItemId","destinationItemId","relationshipType"],{params:u({},t.params)});return s.request(r,n)},t.removeItemResource=function(t){var e=i(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/removeResources";return t.params=u({},t.params,{resource:t.resource}),s.request(r,t)},t.removeNotification=function(t){var e=encodeURIComponent(t.authentication.username),r=c(t)+"/community/users/"+e+"/notifications/"+t.id+"/delete";return s.request(r,t)},t.searchGroupUsers=function(t,e){var r=c(e)+"/community/groups/"+t+"/userlist",n=s.appendCustomParams(e,["name","num","start","sortField","sortOrder","joined","memberType"],{httpMethod:"GET"});return s.request(r,n)},t.searchGroups=function(t){return m(t,"group")},t.searchItems=function(t){return m(t,"item")},t.serializeItem=o,t.setItemAccess=function(e){var r=h(e);return f(e)?v(r,e):l(e).then(function(t){if(t)return v(r,e);throw Error("This item can not be shared by "+e.authentication.username+". They are neither the item owner nor an organization admin.")})},t.shareItemWithGroup=function(t){return y(u({action:"share"},t))},t.unprotectGroup=function(t){var e=c(t)+"/community/groups/"+t.id+"/unprotect";return s.request(e,t)},t.unprotectItem=function(t){var e=i(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/unprotect";return s.request(r,t)},t.unshareItemWithGroup=function(t){return y(u({action:"unshare"},t))},t.updateGroup=function(t){var e=c(t)+"/community/groups/"+t.group.id+"/update";return t.params=u({},t.params,t.group),s.request(e,t)},t.updateItem=r,t.updateItemResource=function(t){var e=i(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/updateResources";return t.params=u({file:t.resource,fileName:t.name,text:t.content},t.params),void 0!==t.private&&(t.params.access=t.private?"private":"inherit"),s.request(r,t)},t.updateUser=function(t){var e=t.user.username||t.authentication.username,r=c(t)+"/community/users/"+encodeURIComponent(e)+"/update";return t.params=u({},t.user,t.params),delete t.user,s.request(r,t)},Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@esri/arcgis-rest-request")):"function"==typeof define&&define.amd?define(["exports","@esri/arcgis-rest-request"],e):e((t=t||self).arcgisRest=t.arcgisRest||{},t.arcgisRest)}(this,function(t,s){"use strict";var u=function(){return(u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function c(t){return void 0===t&&(t={}),t.portal?s.cleanUrl(t.portal):t.authentication?t.authentication.portal:"https://www.arcgis.com/sharing/rest"}function i(t){var e=JSON.parse(JSON.stringify(t));return e.data&&("undefined"!=typeof Blob&&t.data instanceof Blob||"ReadStream"===t.data.constructor.name?e.file=t.data:e.text=t.data,delete e.data),e}function a(t){return t.owner?t.owner:t.item&&t.item.owner?t.item.owner:t.authentication.username}function r(t){var e=a(t),r=c(t)+"/content/users/"+e+"/items/"+t.item.id+"/update";return t.params=u({},t.params,i(t.item)),s.request(r,t)}function e(t){if(t.file&&!t.multipart)return Promise.reject(new Error("The request must be a multipart request for file uploading."));if(t.multipart&&!t.filename)return Promise.reject(new Error("The file name is required for a multipart request."));var e=a(t),r=c(t)+"/content/users/"+e,n=r+"/addItem";t.folderId&&(n=r+"/"+t.folderId+"/addItem"),t.params=u({},t.params,i(t.item));var o=s.appendCustomParams(t,["owner","folderId","file","dataUrl","text","async","multipart","filename"],{params:u({},t.params)});return s.request(n,o)}var o=(n.prototype.match=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.termStack=this.termStack.concat(t),this},n.prototype.in=function(t){var e="`in("+(t?'"'+t+'"':"")+")`";return this.hasRange||this.hasTerms?(t&&"*"!==t&&(this.q+=t+":"),this.commit()):(s.warn(e+" was called with no call to `match(...)` or `from(...)`/`to(...)`. Your query was not modified."),this)},n.prototype.startGroup=function(){return this.commit(),0<this.openGroups&&(this.q+=" "),this.openGroups++,this.q+="(",this},n.prototype.endGroup=function(){return this.openGroups<=0?s.warn("`endGroup(...)` was called without calling `startGroup(...)` first. Your query was not modified."):(this.commit(),this.openGroups--,this.q+=")"),this},n.prototype.and=function(){return this.addModifier("and")},n.prototype.or=function(){return this.addModifier("or")},n.prototype.not=function(){return this.addModifier("not")},n.prototype.from=function(t){return this.hasTerms?s.warn("`from(...)` is not allowed after `match(...)` try using `.from(...).to(...).in(...)`. Your query was not modified."):this.rangeStack[0]=t,this},n.prototype.to=function(t){return this.hasTerms?s.warn("`to(...)` is not allowed after `match(...)` try using `.from(...).to(...).in(...)`. Your query was not modified."):this.rangeStack[1]=t,this},n.prototype.boost=function(t){return this.commit(),this.q+="^"+t,this},n.prototype.toParam=function(){return this.commit(),this.cleanup(),this.q},n.prototype.clone=function(){return this.commit(),this.cleanup(),new n(this.q+"")},n.prototype.addModifier=function(t){return this.currentModifer?s.warn("You have called `"+this.currentModifer+"()` after `"+t+"()`. Your current query was not modified."):(this.commit(),""===this.q&&"not"!==t?s.warn("You have called `"+t+"()` without calling another method to modify your query first. Try calling `match()` first."):(this.currentModifer=t,this.q+=""===this.q?"":" ",this.q+=t.toUpperCase()+" ")),this},n.prototype.hasWhiteSpace=function(t){return/\s/g.test(t)},n.prototype.formatTerm=function(t){return t instanceof Date?t.getTime():"string"==typeof t&&this.hasWhiteSpace(t)?'"'+t+'"':t},n.prototype.commit=function(){var e=this;return this.currentModifer=void 0,this.hasRange&&(this.q+="["+this.formatTerm(this.rangeStack[0])+" TO "+this.formatTerm(this.rangeStack[1])+"]",this.rangeStack=[void 0,void 0]),this.hasTerms&&(this.q+=this.termStack.map(function(t){return e.formatTerm(t)}).join(" "),this.termStack=[]),this},Object.defineProperty(n.prototype,"hasTerms",{get:function(){return 0<this.termStack.length},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasRange",{get:function(){return this.rangeStack.length&&this.rangeStack[0]&&this.rangeStack[1]},enumerable:!0,configurable:!0}),n.prototype.cleanup=function(){if(0<this.openGroups)for(s.warn("Automatically closing "+this.openGroups+" group(s). You can use `endGroup(...)` to remove this warning.");0<this.openGroups;)this.q+=")",this.openGroups--;var t=this.q;this.q=t.replace(/( AND ?| NOT ?| OR ?)*$/,""),t!==this.q&&s.warn("`startGroup(...)` was called without calling `endGroup(...)` first. Your query was not modified."),this.q=this.q.replace(/(\(\))*/,"")},n);function n(t){void 0===t&&(t=""),this.termStack=[],this.rangeStack=[],this.openGroups=0,this.q=t}function m(r,n){var t,e;return t=c(e="string"==typeof r||r instanceof o?{httpMethod:"GET",params:{q:r}}:s.appendCustomParams(r,["q","num","start","sortField","sortOrder"],{httpMethod:"GET"}))+("item"===n?"/search":"/community/groups"),s.request(t,e).then(function(e){return e.nextStart&&-1!==e.nextStart&&(e.nextPage=function(){var t;return"string"==typeof r||r instanceof o?t={q:r,start:e.nextStart}:(t=r).start=e.nextStart,m(t,n)}),e})}function p(e,t,r){return!t||t.length<1?[]:function(t,e){if(0===t.length)return[];for(var r=[],n=0;n<t.length;n+=e)r.push(t.slice(n,n+e));return r}(t,25).map(function(t){return function(t,e,r){var n,o;return Object.assign({},r,((n={})[t]=e,n.params=u({},r.params,((o={})[t]=e,o)),n))}(e,t,r)})}function d(t){var e=t.filter(function(t){return t.notAdded}).reduce(function(t,e){return t.concat(e.notAdded)},[]),r=t.filter(function(t){return t.errors}).reduce(function(t,e){return t.concat(e.errors)},[]),n={notAdded:e};return 0<r.length&&(n.errors=r),n}function h(t,e){var r=c(e)+"/community/groups/"+t,n=u({httpMethod:"GET"},e);return s.request(r,n)}function f(t){var e=t.authentication.username,r=t.owner||e;return c(t)+"/content/users/"+encodeURIComponent(r)+"/items/"+t.id+"/share"}function l(t){var e=t.authentication.username;return(t.owner||e)===e}function g(t){return t.authentication.getUser(t).then(function(t){return!(!t||"org_admin"!==t.role)})}function v(t){return h(t.groupId,t).then(function(t){return t.userMembership.memberType}).catch(function(){return"nonmember"})}function y(t,e){return e.params=u({org:!1,everyone:!1},e.params),"private"===e.access&&(e.params.groups=" "),"org"===e.access&&(e.params.org=!0),"public"===e.access&&(e.params.account=!0,e.params.everyone=!0),s.request(t,e)}function q(o){var i=o.authentication.username,a=o.owner||i;return g(o).then(function(r){var n="share"===o.action?"notSharedWith":"notUnsharedFrom";return function(n){var t={q:"id: "+n.id+" AND group: "+n.groupId,start:1,num:10,sortField:"title"},e=u({},n,{rawResponse:!1});e.params=u({},t,n.params);var r=c(e)+"/search";return s.request(r,e).then(function(t){return 0!==t.total&&(t.results.some(function(t){var e=t.id===n.id;return e&&(r=t),e}),!!r);var r})}(o).then(function(t){if("share"===o.action&&!0===t||"unshare"===o.action&&!1===t){var e={itemId:o.id,shortcut:!0};return e[n]=[],e}return v(o).then(function(t){if("nonmember"===t)throw Error("This item can not be "+o.action+"d by "+i+" as they are not a member of the specified group "+o.groupId+".");if(a===i)return c(o)+"/content/users/"+a+"/items/"+o.id+"/"+o.action;if("admin"===t||"owner"===t||r)return c(o)+"/content/items/"+o.id+"/"+o.action;throw Error("This item can not be "+o.action+"d by "+i+" as they are neither the owner, a groupAdmin of "+o.groupId+", nor an org_admin.")}).then(function(t){return o.params={groups:o.groupId,confirmItemControl:o.confirmItemControl},s.request(t,o)}).then(function(t){if(t[n].length)throw Error("Item "+o.id+" could not be "+o.action+"d to group "+o.groupId+".");return t})})})}function I(t,e){var r=t||"self",n=c(e)+"/portals/"+r,o=u({httpMethod:"GET"},e);return s.request(n,o)}t.SearchQueryBuilder=o,t.acceptInvitation=function(t){var e=encodeURIComponent(t.authentication.username),r=c(t)+"/community/users/"+e+"/invitations/"+t.invitationId+"/accept",n=u({},t);return s.request(r,n)},t.addGroupUsers=function(t){var e=t.id,r=c(t)+"/community/groups/"+e+"/addUsers",n=Object.assign({},t,{admins:void 0,users:void 0}),o=p("users",t.users,n).concat(p("admins",t.admins,n)).map(function(t){return function(t,e){return s.request(t,e).catch(function(t){return{errors:[t]}})}(r,t)});return Promise.all(o).then(d)},t.addItemData=function(t){a(t);var e=u({item:{id:t.id,data:t.data}},t);return delete e.id,delete e.data,r(e)},t.addItemPart=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/addPart",n=s.appendCustomParams(t,["file","partNum"],{params:u({},t.params)});return s.request(r,n)},t.addItemRelationship=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/addRelationship",n=s.appendCustomParams(t,["originItemId","destinationItemId","relationshipType"],{params:u({},t.params)});return s.request(r,n)},t.addItemResource=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/addResources";return t.params=u({file:t.resource,fileName:t.name,text:t.content,access:t.private?"private":"inherit"},t.params),s.request(r,t)},t.createFolder=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/createFolder";return t.params=u({title:t.title},t.params),s.request(r,t)},t.createGroup=function(t){var e=c(t)+"/community/createGroup";return t.params=u({},t.params,t.group),s.request(e,t)},t.createGroupNotification=function(t){var e=c(t)+"/community/groups/"+t.id+"/createNotification",r=u({params:u({subject:t.subject,message:t.message,users:t.users,notificationChannelType:t.notificationChannelType||"email",clientId:t.clientId,silentNotification:t.silentNotification,notifyAll:!t.users||0===t.users.length},t.params)},t);return s.request(e,r)},t.createItem=function(t){return e(u({folderId:null},t))},t.createItemInFolder=e,t.declineInvitation=function(t){var e=encodeURIComponent(t.authentication.username),r=c(t)+"/community/users/"+e+"/invitations/"+t.invitationId+"/decline",n=u({},t);return s.request(r,n)},t.determineOwner=a,t.getGroup=h,t.getGroupContent=function(t,e){var r=c(e)+"/content/groups/"+t,n=u({httpMethod:"GET"},{params:{start:1,num:100}},e);return e&&e.paging&&(n.params=u({},e.paging)),s.request(r,n)},t.getGroupUsers=function(t,e){var r=c(e)+"/community/groups/"+t+"/users",n=u({httpMethod:"GET"},e);return s.request(r,n)},t.getItem=function(t,e){var r=c(e)+"/content/items/"+t,n=u({httpMethod:"GET"},e);return s.request(r,n)},t.getItemData=function(t,e){var r=c(e)+"/content/items/"+t+"/data",n=u({httpMethod:"GET",params:{}},e);return n.file&&(n.params.f=null),s.request(r,n).catch(function(t){if(!RegExp(/Unexpected end of (JSON input|data at line 1 column 1)/i).test(t.message))throw t})},t.getItemGroups=function(t,e){var r=c(e)+"/content/items/"+t+"/groups";return s.request(r,e)},t.getItemParts=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/parts";return s.request(r,t)},t.getItemResources=function(t,e){var r=c(e)+"/content/items/"+t+"/resources";return e.params=u({},e.params,{num:1e3}),s.request(r,e)},t.getItemStatus=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/status",n=s.appendCustomParams(t,["jobId","jobType"],{params:u({},t.params)});return s.request(r,n)},t.getPortal=I,t.getPortalUrl=c,t.getRelatedItems=function(t){var e=c(t)+"/content/items/"+t.id+"/relatedItems",r=u({httpMethod:"GET",params:{direction:t.direction}},t);return"string"==typeof t.relationshipType?r.params.relationshipType=t.relationshipType:r.params.relationshipTypes=t.relationshipType,delete r.direction,delete r.relationshipType,s.request(e,r)},t.getSelf=function(t){return I(null,t)},t.getSharingUrl=f,t.getUser=function(t){var e,r={httpMethod:"GET"};if("string"==typeof t)e="https://www.arcgis.com/sharing/rest/community/users/"+t;else{var n=t.username||t.authentication.username;e=c(t)+"/community/users/"+encodeURIComponent(n),r=u({},t,r)}return s.request(e,r)},t.getUserInvitation=function(t){var e=encodeURIComponent(t.authentication.username),r=c(t)+"/community/users/"+e+"/invitations/"+t.invitationId,n={httpMethod:"GET"};return n=u({},t,n),s.request(r,n)},t.getUserInvitations=function(t){var e={httpMethod:"GET"},r=encodeURIComponent(t.authentication.username),n=c(t)+"/community/users/"+r+"/invitations";return e=u({},t,e),s.request(n,e)},t.getUserMembership=v,t.getUserNotifications=function(t){var e={httpMethod:"GET"},r=encodeURIComponent(t.authentication.username),n=c(t)+"/community/users/"+r+"/notifications";return e=u({},t,e),s.request(n,e)},t.getUserTags=function(t){var e=t.username||t.authentication.username,r=c(t)+"/community/users/"+encodeURIComponent(e)+"/tags";return s.request(r,t)},t.getUserUrl=function(t){return c(t)+"/community/users/"+encodeURIComponent(t.username)},t.isItemOwner=l,t.isOrgAdmin=g,t.joinGroup=function(t){var e=c(t)+"/community/groups/"+t.id+"/join";return s.request(e,t)},t.leaveGroup=function(t){var e=c(t)+"/community/groups/"+t.id+"/leave";return s.request(e,t)},t.moveItem=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/items/"+t.itemId+"/move",n=t.folderId;return n=n||"/",t.params=u({folder:n},t.params),s.request(r,t)},t.protectGroup=function(t){var e=c(t)+"/community/groups/"+t.id+"/protect";return s.request(e,t)},t.protectItem=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/protect";return s.request(r,t)},t.removeFolder=function(t){var e=a(t),r=c(t)+"/content/users/"+encodeURIComponent(e)+"/"+t.folderId+"/delete";return s.request(r,t)},t.removeGroup=function(t){var e=c(t)+"/community/groups/"+t.id+"/delete",r=u({},t);return s.request(e,r)},t.removeItem=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/delete";return s.request(r,t)},t.removeItemRelationship=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/removeRelationship",n=s.appendCustomParams(t,["originItemId","destinationItemId","relationshipType"],{params:u({},t.params)});return s.request(r,n)},t.removeItemResource=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/removeResources";return t.params=u({},t.params,{resource:t.resource}),s.request(r,t)},t.removeNotification=function(t){var e=encodeURIComponent(t.authentication.username),r=c(t)+"/community/users/"+e+"/notifications/"+t.id+"/delete";return s.request(r,t)},t.searchGroupUsers=function(t,e){var r=c(e)+"/community/groups/"+t+"/userlist",n=s.appendCustomParams(e,["name","num","start","sortField","sortOrder","joined","memberType"],{httpMethod:"GET"});return s.request(r,n)},t.searchGroups=function(t){return m(t,"group")},t.searchItems=function(t){return m(t,"item")},t.serializeItem=i,t.setItemAccess=function(e){var r=f(e);return l(e)?y(r,e):g(e).then(function(t){if(t)return y(r,e);throw Error("This item can not be shared by "+e.authentication.username+". They are neither the item owner nor an organization admin.")})},t.shareItemWithGroup=function(t){return q(u({action:"share"},t))},t.unprotectGroup=function(t){var e=c(t)+"/community/groups/"+t.id+"/unprotect";return s.request(e,t)},t.unprotectItem=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/unprotect";return s.request(r,t)},t.unshareItemWithGroup=function(t){return q(u({action:"unshare"},t))},t.updateGroup=function(t){var e=c(t)+"/community/groups/"+t.group.id+"/update";return t.params=u({},t.params,t.group),s.request(e,t)},t.updateItem=r,t.updateItemResource=function(t){var e=a(t),r=c(t)+"/content/users/"+e+"/items/"+t.id+"/updateResources";return t.params=u({file:t.resource,fileName:t.name,text:t.content},t.params),void 0!==t.private&&(t.params.access=t.private?"private":"inherit"),s.request(r,t)},t.updateUser=function(t){var e=t.user.username||t.authentication.username,r=c(t)+"/community/users/"+encodeURIComponent(e)+"/update";return t.params=u({},t.user,t.params),delete t.user,s.request(r,t)},Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=portal.umd.min.js.map
{
"name": "@esri/arcgis-rest-portal",
"version": "2.3.0",
"version": "2.4.0",
"description": "ArcGIS Online and Enterprise content and user helpers for @esri/arcgis-rest-request",

@@ -16,8 +16,8 @@ "main": "dist/node/index.js",

"dependencies": {
"@esri/arcgis-rest-types": "^2.3.0",
"@esri/arcgis-rest-types": "^2.4.0",
"tslib": "^1.9.3"
},
"devDependencies": {
"@esri/arcgis-rest-auth": "^2.3.0",
"@esri/arcgis-rest-request": "^2.3.0"
"@esri/arcgis-rest-auth": "^2.4.0",
"@esri/arcgis-rest-request": "^2.4.0"
},

@@ -24,0 +24,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc