@esri/solution-common
Version:
Provides general helper functions for @esri/solution.js.
141 lines • 10.2 kB
JavaScript
;
/** @license
* Copyright 2024 Esri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.unprotectItem = exports.unprotectGroup = exports.updateItemResource = exports.svcAdminAddToServiceDefinition = exports.shareItemWithGroup = exports.restUpdateItem = exports.restUpdateGroup = exports.restSearchItems = exports.restRemoveGroup = exports.restRemoveFolder = exports.restGetUser = exports.request = exports.removeItemResource = exports.queryRelated = exports.getSelf = exports.getRelatedItems = exports.getGroupContent = exports.getGroup = exports.addItemResource = exports.UserSession = exports.encodeFormData = exports.ArcGISAuthError = exports.restRemoveItem = exports.removeGroupUsers = exports.restSearchGroups = exports.setItemAccess = exports.searchGroupContent = exports.getPortalUrl = exports.restGetPortal = exports.getUserContent = exports.restGetItemResources = exports.getItemData = exports.getItem = exports.restGetGroupCategorySchema = exports.SearchQueryBuilder = exports.protectItem = exports.moveItem = exports.createItemInFolder = exports.createItem = exports.createGroup = exports.createFolder = exports.addItemRelationship = exports.restAddItemData = exports.applyEdits = exports.addFeatures = exports.queryFeatures = exports.svcAdminCreateFeatureService = void 0;
/**
* Provides common functions and classes from ArcGIS REST JS.
*/
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
const arcgis_rest_request_1 = require("@esri/arcgis-rest-request");
const arcgis_rest_feature_service_1 = require("@esri/arcgis-rest-feature-service");
var arcgis_rest_feature_service_2 = require("@esri/arcgis-rest-feature-service");
Object.defineProperty(exports, "svcAdminCreateFeatureService", { enumerable: true, get: function () { return arcgis_rest_feature_service_2.createFeatureService; } });
Object.defineProperty(exports, "queryFeatures", { enumerable: true, get: function () { return arcgis_rest_feature_service_2.queryFeatures; } });
Object.defineProperty(exports, "addFeatures", { enumerable: true, get: function () { return arcgis_rest_feature_service_2.addFeatures; } });
Object.defineProperty(exports, "applyEdits", { enumerable: true, get: function () { return arcgis_rest_feature_service_2.applyEdits; } });
var arcgis_rest_portal_2 = require("@esri/arcgis-rest-portal");
Object.defineProperty(exports, "restAddItemData", { enumerable: true, get: function () { return arcgis_rest_portal_2.addItemData; } });
Object.defineProperty(exports, "addItemRelationship", { enumerable: true, get: function () { return arcgis_rest_portal_2.addItemRelationship; } });
Object.defineProperty(exports, "createFolder", { enumerable: true, get: function () { return arcgis_rest_portal_2.createFolder; } });
Object.defineProperty(exports, "createGroup", { enumerable: true, get: function () { return arcgis_rest_portal_2.createGroup; } });
Object.defineProperty(exports, "createItem", { enumerable: true, get: function () { return arcgis_rest_portal_2.createItem; } });
Object.defineProperty(exports, "createItemInFolder", { enumerable: true, get: function () { return arcgis_rest_portal_2.createItemInFolder; } });
Object.defineProperty(exports, "moveItem", { enumerable: true, get: function () { return arcgis_rest_portal_2.moveItem; } });
Object.defineProperty(exports, "protectItem", { enumerable: true, get: function () { return arcgis_rest_portal_2.protectItem; } });
Object.defineProperty(exports, "SearchQueryBuilder", { enumerable: true, get: function () { return arcgis_rest_portal_2.SearchQueryBuilder; } });
Object.defineProperty(exports, "restGetGroupCategorySchema", { enumerable: true, get: function () { return arcgis_rest_portal_2.getGroupCategorySchema; } });
Object.defineProperty(exports, "getItem", { enumerable: true, get: function () { return arcgis_rest_portal_2.getItem; } });
Object.defineProperty(exports, "getItemData", { enumerable: true, get: function () { return arcgis_rest_portal_2.getItemData; } });
Object.defineProperty(exports, "restGetItemResources", { enumerable: true, get: function () { return arcgis_rest_portal_2.getItemResources; } });
Object.defineProperty(exports, "getUserContent", { enumerable: true, get: function () { return arcgis_rest_portal_2.getUserContent; } });
Object.defineProperty(exports, "restGetPortal", { enumerable: true, get: function () { return arcgis_rest_portal_2.getPortal; } });
Object.defineProperty(exports, "getPortalUrl", { enumerable: true, get: function () { return arcgis_rest_portal_2.getPortalUrl; } });
Object.defineProperty(exports, "searchGroupContent", { enumerable: true, get: function () { return arcgis_rest_portal_2.searchGroupContent; } });
Object.defineProperty(exports, "setItemAccess", { enumerable: true, get: function () { return arcgis_rest_portal_2.setItemAccess; } });
Object.defineProperty(exports, "restSearchGroups", { enumerable: true, get: function () { return arcgis_rest_portal_2.searchGroups; } });
Object.defineProperty(exports, "removeGroupUsers", { enumerable: true, get: function () { return arcgis_rest_portal_2.removeGroupUsers; } });
Object.defineProperty(exports, "restRemoveItem", { enumerable: true, get: function () { return arcgis_rest_portal_2.removeItem; } });
var arcgis_rest_request_2 = require("@esri/arcgis-rest-request");
Object.defineProperty(exports, "ArcGISAuthError", { enumerable: true, get: function () { return arcgis_rest_request_2.ArcGISAuthError; } });
Object.defineProperty(exports, "encodeFormData", { enumerable: true, get: function () { return arcgis_rest_request_2.encodeFormData; } });
Object.defineProperty(exports, "UserSession", { enumerable: true, get: function () { return arcgis_rest_request_2.ArcGISIdentityManager; } });
//custom export functions that mimic the same export function from arcgis-rest-js
//to bypass unit test error:
//Error: <spyOn> : <functon or property> is not declared writable or has no setter
function addItemResource(requestOptions) {
return (0, arcgis_rest_portal_1.addItemResource)(requestOptions);
}
exports.addItemResource = addItemResource;
function getGroup(id, requestOptions) {
return (0, arcgis_rest_portal_1.getGroup)(id, requestOptions);
}
exports.getGroup = getGroup;
function getGroupContent(id, requestOptions) {
return (0, arcgis_rest_portal_1.getGroupContent)(id, requestOptions);
}
exports.getGroupContent = getGroupContent;
function getRelatedItems(requestOptions) {
return (0, arcgis_rest_portal_1.getRelatedItems)(requestOptions);
}
exports.getRelatedItems = getRelatedItems;
function getSelf(requestOptions) {
return (0, arcgis_rest_portal_1.getSelf)(requestOptions);
}
exports.getSelf = getSelf;
function queryRelated(requestOptions) {
return (0, arcgis_rest_feature_service_1.queryRelated)(requestOptions);
}
exports.queryRelated = queryRelated;
function removeItemResource(requestOptions) {
return (0, arcgis_rest_portal_1.removeItemResource)(requestOptions);
}
exports.removeItemResource = removeItemResource;
function request(url, requestOptions) {
return (0, arcgis_rest_request_1.request)(url, requestOptions);
}
exports.request = request;
//getUser already exists as an custom export in restHelperGet so this export has 'rest' prefix to denote it's from rest.
function restGetUser(requestOptions) {
return (0, arcgis_rest_portal_1.getUser)(requestOptions);
}
exports.restGetUser = restGetUser;
//removeFolder already exists as an custom export in restHelperGet so this export has 'rest' prefix to denote it's from rest.
function restRemoveFolder(requestOptions) {
return (0, arcgis_rest_portal_1.removeFolder)(requestOptions);
}
exports.restRemoveFolder = restRemoveFolder;
//removeGroup already exists as an custom export in restHelperGet so this export has 'rest' prefix to denote it's from rest.
function restRemoveGroup(requestOptions) {
return (0, arcgis_rest_portal_1.removeGroup)(requestOptions);
}
exports.restRemoveGroup = restRemoveGroup;
//searchItems already exists as an custom export in restHelperGet so this export has 'rest' prefix to denote it's from rest.
function restSearchItems(search) {
return (0, arcgis_rest_portal_1.searchItems)(search);
}
exports.restSearchItems = restSearchItems;
//updateGroup already exists as an custom export in restHelperGet so this export has 'rest' prefix to denote it's from rest.
function restUpdateGroup(requestOptions) {
return (0, arcgis_rest_portal_1.updateGroup)(requestOptions);
}
exports.restUpdateGroup = restUpdateGroup;
//supdateItem already exists as an custom export in restHelperGet so this export has 'rest' prefix to denote it's from rest.
function restUpdateItem(requestOptions) {
return (0, arcgis_rest_portal_1.updateItem)(requestOptions);
}
exports.restUpdateItem = restUpdateItem;
function shareItemWithGroup(requestOptions) {
return (0, arcgis_rest_portal_1.shareItemWithGroup)(requestOptions);
}
exports.shareItemWithGroup = shareItemWithGroup;
function svcAdminAddToServiceDefinition(url, requestOptions) {
return (0, arcgis_rest_feature_service_1.addToServiceDefinition)(url, requestOptions);
}
exports.svcAdminAddToServiceDefinition = svcAdminAddToServiceDefinition;
function updateItemResource(requestOptions) {
return (0, arcgis_rest_portal_1.updateItemResource)(requestOptions);
}
exports.updateItemResource = updateItemResource;
function unprotectGroup(requestOptions) {
return (0, arcgis_rest_portal_1.unprotectGroup)(requestOptions);
}
exports.unprotectGroup = unprotectGroup;
function unprotectItem(requestOptions) {
return (0, arcgis_rest_portal_1.unprotectItem)(requestOptions);
}
exports.unprotectItem = unprotectItem;
//# sourceMappingURL=arcgisRestJS.js.map