@esri/arcgis-rest-feature-service
Advanced tools
Comparing version 4.0.3 to 4.0.4
/* @preserve | ||
* @esri/arcgis-rest-feature-service - v4.0.2 - Apache-2.0 | ||
* @esri/arcgis-rest-feature-service - v4.0.3 - Apache-2.0 | ||
* Copyright (c) 2017-2022 Esri, Inc. | ||
* Wed May 11 2022 17:55:21 GMT+0000 (Coordinated Universal Time) | ||
* Mon Dec 19 2022 22:18:35 GMT+0000 (Coordinated Universal Time) | ||
*/ | ||
@@ -6,0 +6,0 @@ import { cleanUrl, appendCustomParams, request } from '@esri/arcgis-rest-request'; |
/* @preserve | ||
* @esri/arcgis-rest-feature-service - v4.0.2 - Apache-2.0 | ||
* @esri/arcgis-rest-feature-service - v4.0.3 - Apache-2.0 | ||
* Copyright (c) 2017-2022 Esri, Inc. | ||
* Wed May 11 2022 17:55:21 GMT+0000 (Coordinated Universal Time) | ||
* Mon Dec 19 2022 22:18:35 GMT+0000 (Coordinated Universal Time) | ||
*/ | ||
import{cleanUrl as e,appendCustomParams as t,request as r}from"@esri/arcgis-rest-request";import{determineOwner as n,getPortalUrl as s}from"@esri/arcgis-rest-portal";function a(n){const s=`${e(n.url)}/addFeatures`,a=t(n,["features","gdbVersion","returnEditMoment","rollbackOnFailure"],{params:Object.assign({},n.params)});return r(s,a)}function i(t){const n=Object.assign({params:{}},t);return n.params.attachment=t.attachment,r(`${e(n.url)}/${n.featureId}/addAttachment`,n)}function o(t,n){const s=`${e(t).replace("/rest/services","/rest/admin/services")}/addToDefinition`;return n.params=Object.assign({addToDefinition:{}},n.params),n.layers&&n.layers.length>0&&(n.params.addToDefinition.layers=n.layers),n.tables&&n.tables.length>0&&(n.params.addToDefinition.tables=n.tables),r(s,n)}function u(n){const s=`${e(n.url)}/applyEdits`,a=t(n,["adds","updates","deletes","useGlobalIds","attachments","gdbVersion","returnEditMoment","rollbackOnFailure","trueCurveClient"],{params:Object.assign({},n.params)});return r(s,a)}function c(e){return n(e).then((t=>{const n=Object.assign(Object.assign({},e),{rawResponse:!1}),a=`${`${s(e)}/content/users/${t}`}${n.folderId&&"/"!==n.folderId?"/"+n.folderId:""}/createService`;return n.params=Object.assign({createParameters:n.item,outputType:"featureService"},n.params),r(a,n)}))}function l(t){return r(e(t.url),t)}function d(e){let t;return t=e.fields?Promise.resolve(e.fields):l({url:e.url}).then((e=>e.fields)),t.then((t=>{const r=function(e){return e.reduce(((e,t)=>{const r=t.domain;return r&&"codedValue"===r.type&&(e[t.name]=r),e}),{})}(t);if(Object.keys(r).length<1)return e.queryResponse;const n=e.queryResponse.features.map((e=>{const t={};for(const n in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,n))continue;const s=e.attributes[n],a=r[n];t[n]=null!==s&&a?p(s,a):s}return Object.assign(Object.assign({},e),{attributes:t})}));return Object.assign(Object.assign({},e.queryResponse),{features:n})}))}function p(e,t){const r=t.codedValues.find((t=>e===t.code));return r?r.name:e}function m(n){const s=`${e(n.url)}/deleteFeatures`,a=t(n,["where","objectIds","gdbVersion","returnEditMoment","rollbackOnFailure"],{params:Object.assign({},n.params)});return r(s,a)}function f(t){const n=Object.assign({params:{}},t);return n.params.attachmentIds=t.attachmentIds,r(`${e(n.url)}/${n.featureId}/deleteAttachments`,n)}const b=new RegExp(/.+(?:map|feature|image)server/i);function O(t){const r=t.match(b);return r?r[0]:function(t){const r=t.split("?")[0];return e(r)}(t)}function h(e){const{url:t}=e,n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}(e,["url"]),s=`${O(t)}/layers`;return r(s,n)}function g(t){const n=Object.assign({httpMethod:"GET"},t);return r(`${e(n.url)}/${n.featureId}/attachments`,n)}function y(t){return r(e(t.url),t)}function j(e,t){const n=e.replace("/rest/services","/rest/admin/services");return r(n,{authentication:t,params:{f:"json"}})}function $(e,t){return r(`${e}/sources`,{authentication:t})}function I(t){const n=`${e(t.url)}/${t.id}`,s=Object.assign({httpMethod:"GET"},t);return r(n,s).then((e=>s.rawResponse?e:e.feature))}function v(n){const s=t(n,["where","objectIds","relationParam","time","distance","units","outFields","geometry","geometryType","spatialRel","returnGeometry","maxAllowableOffset","geometryPrecision","inSR","outSR","gdbVersion","returnDistinctValues","returnIdsOnly","returnCountOnly","returnExtentOnly","orderByFields","groupByFieldsForStatistics","outStatistics","returnZ","returnM","multipatchOption","resultOffset","resultRecordCount","quantizationParameters","returnCentroid","resultType","historicMoment","returnTrueCurves","sqlFormat","returnExceededLimitFeatures","f"],{httpMethod:"GET",params:Object.assign({where:"1=1",outFields:"*"},n.params)});return r(`${e(n.url)}/query`,s)}function F(n){const s=t(n,["objectIds","relationshipId","definitionExpression","outFields"],{httpMethod:"GET",params:Object.assign({definitionExpression:"1=1",outFields:"*",relationshipId:0},n.params)});return r(`${e(n.url)}/queryRelatedRecords`,s)}function E(n){const s=`${e(n.url)}/updateFeatures`,a=t(n,["features","gdbVersion","returnEditMoment","rollbackOnFailure","trueCurveClient"],{params:Object.assign({},n.params)});return r(s,a)}function R(t){const n=Object.assign({params:{}},t);return n.params.attachment=t.attachment,n.params.attachmentId=t.attachmentId,r(`${e(n.url)}/${n.featureId}/updateAttachment`,n)}function T(t,n){const s=`${e(t).replace("/rest/services","/rest/admin/services")}/updateDefinition`;return n.params=Object.assign({updateDefinition:{}},n.params),n.updateDefinition&&(n.params.updateDefinition=n.updateDefinition),r(s,n)}export{i as addAttachment,a as addFeatures,o as addToServiceDefinition,u as applyEdits,c as createFeatureService,d as decodeValues,f as deleteAttachments,m as deleteFeatures,h as getAllLayersAndTables,g as getAttachments,I as getFeature,l as getLayer,y as getService,j as getServiceAdminInfo,$ as getViewSources,O as parseServiceUrl,v as queryFeatures,F as queryRelated,R as updateAttachment,E as updateFeatures,T as updateServiceDefinition}; | ||
//# sourceMappingURL=feature-service.esm.min.js.map |
/* @preserve | ||
* @esri/arcgis-rest-feature-service - v4.0.2 - Apache-2.0 | ||
* @esri/arcgis-rest-feature-service - v4.0.3 - Apache-2.0 | ||
* Copyright (c) 2017-2022 Esri, Inc. | ||
* Wed May 11 2022 17:55:21 GMT+0000 (Coordinated Universal Time) | ||
* Mon Dec 19 2022 22:18:35 GMT+0000 (Coordinated Universal Time) | ||
*/ | ||
@@ -6,0 +6,0 @@ (function (global, factory) { |
/* @preserve | ||
* @esri/arcgis-rest-feature-service - v4.0.2 - Apache-2.0 | ||
* @esri/arcgis-rest-feature-service - v4.0.3 - Apache-2.0 | ||
* Copyright (c) 2017-2022 Esri, Inc. | ||
* Wed May 11 2022 17:55:21 GMT+0000 (Coordinated Universal Time) | ||
* Mon Dec 19 2022 22:18:35 GMT+0000 (Coordinated Universal Time) | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@esri/arcgis-rest-request"),require("@esri/arcgis-rest-portal")):"function"==typeof define&&define.amd?define(["exports","@esri/arcgis-rest-request","@esri/arcgis-rest-portal"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arcgisRest=e.arcgisRest||{},e.arcgisRest,e.arcgisRest)}(this,(function(e,t,r){"use strict";function n(e){return t.request(t.cleanUrl(e.url),e)}function s(e,t){const r=t.codedValues.find((t=>e===t.code));return r?r.name:e}const a=new RegExp(/.+(?:map|feature|image)server/i);function i(e){const r=e.match(a);return r?r[0]:function(e){const r=e.split("?")[0];return t.cleanUrl(r)}(e)}e.addAttachment=function(e){const r=Object.assign({params:{}},e);return r.params.attachment=e.attachment,t.request(`${t.cleanUrl(r.url)}/${r.featureId}/addAttachment`,r)},e.addFeatures=function(e){const r=`${t.cleanUrl(e.url)}/addFeatures`,n=t.appendCustomParams(e,["features","gdbVersion","returnEditMoment","rollbackOnFailure"],{params:Object.assign({},e.params)});return t.request(r,n)},e.addToServiceDefinition=function(e,r){const n=`${t.cleanUrl(e).replace("/rest/services","/rest/admin/services")}/addToDefinition`;return r.params=Object.assign({addToDefinition:{}},r.params),r.layers&&r.layers.length>0&&(r.params.addToDefinition.layers=r.layers),r.tables&&r.tables.length>0&&(r.params.addToDefinition.tables=r.tables),t.request(n,r)},e.applyEdits=function(e){const r=`${t.cleanUrl(e.url)}/applyEdits`,n=t.appendCustomParams(e,["adds","updates","deletes","useGlobalIds","attachments","gdbVersion","returnEditMoment","rollbackOnFailure","trueCurveClient"],{params:Object.assign({},e.params)});return t.request(r,n)},e.createFeatureService=function(e){return r.determineOwner(e).then((n=>{const s=Object.assign(Object.assign({},e),{rawResponse:!1}),a=`${`${r.getPortalUrl(e)}/content/users/${n}`}${s.folderId&&"/"!==s.folderId?"/"+s.folderId:""}/createService`;return s.params=Object.assign({createParameters:s.item,outputType:"featureService"},s.params),t.request(a,s)}))},e.decodeValues=function(e){let t;return t=e.fields?Promise.resolve(e.fields):n({url:e.url}).then((e=>e.fields)),t.then((t=>{const r=function(e){return e.reduce(((e,t)=>{const r=t.domain;return r&&"codedValue"===r.type&&(e[t.name]=r),e}),{})}(t);if(Object.keys(r).length<1)return e.queryResponse;const n=e.queryResponse.features.map((e=>{const t={};for(const n in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,n))continue;const a=e.attributes[n],i=r[n];t[n]=null!==a&&i?s(a,i):a}return Object.assign(Object.assign({},e),{attributes:t})}));return Object.assign(Object.assign({},e.queryResponse),{features:n})}))},e.deleteAttachments=function(e){const r=Object.assign({params:{}},e);return r.params.attachmentIds=e.attachmentIds,t.request(`${t.cleanUrl(r.url)}/${r.featureId}/deleteAttachments`,r)},e.deleteFeatures=function(e){const r=`${t.cleanUrl(e.url)}/deleteFeatures`,n=t.appendCustomParams(e,["where","objectIds","gdbVersion","returnEditMoment","rollbackOnFailure"],{params:Object.assign({},e.params)});return t.request(r,n)},e.getAllLayersAndTables=function(e){const{url:r}=e,n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}(e,["url"]),s=`${i(r)}/layers`;return t.request(s,n)},e.getAttachments=function(e){const r=Object.assign({httpMethod:"GET"},e);return t.request(`${t.cleanUrl(r.url)}/${r.featureId}/attachments`,r)},e.getFeature=function(e){const r=`${t.cleanUrl(e.url)}/${e.id}`,n=Object.assign({httpMethod:"GET"},e);return t.request(r,n).then((e=>n.rawResponse?e:e.feature))},e.getLayer=n,e.getService=function(e){return t.request(t.cleanUrl(e.url),e)},e.getServiceAdminInfo=function(e,r){const n=e.replace("/rest/services","/rest/admin/services");return t.request(n,{authentication:r,params:{f:"json"}})},e.getViewSources=function(e,r){return t.request(`${e}/sources`,{authentication:r})},e.parseServiceUrl=i,e.queryFeatures=function(e){const r=t.appendCustomParams(e,["where","objectIds","relationParam","time","distance","units","outFields","geometry","geometryType","spatialRel","returnGeometry","maxAllowableOffset","geometryPrecision","inSR","outSR","gdbVersion","returnDistinctValues","returnIdsOnly","returnCountOnly","returnExtentOnly","orderByFields","groupByFieldsForStatistics","outStatistics","returnZ","returnM","multipatchOption","resultOffset","resultRecordCount","quantizationParameters","returnCentroid","resultType","historicMoment","returnTrueCurves","sqlFormat","returnExceededLimitFeatures","f"],{httpMethod:"GET",params:Object.assign({where:"1=1",outFields:"*"},e.params)});return t.request(`${t.cleanUrl(e.url)}/query`,r)},e.queryRelated=function(e){const r=t.appendCustomParams(e,["objectIds","relationshipId","definitionExpression","outFields"],{httpMethod:"GET",params:Object.assign({definitionExpression:"1=1",outFields:"*",relationshipId:0},e.params)});return t.request(`${t.cleanUrl(e.url)}/queryRelatedRecords`,r)},e.updateAttachment=function(e){const r=Object.assign({params:{}},e);return r.params.attachment=e.attachment,r.params.attachmentId=e.attachmentId,t.request(`${t.cleanUrl(r.url)}/${r.featureId}/updateAttachment`,r)},e.updateFeatures=function(e){const r=`${t.cleanUrl(e.url)}/updateFeatures`,n=t.appendCustomParams(e,["features","gdbVersion","returnEditMoment","rollbackOnFailure","trueCurveClient"],{params:Object.assign({},e.params)});return t.request(r,n)},e.updateServiceDefinition=function(e,r){const n=`${t.cleanUrl(e).replace("/rest/services","/rest/admin/services")}/updateDefinition`;return r.params=Object.assign({updateDefinition:{}},r.params),r.updateDefinition&&(r.params.updateDefinition=r.updateDefinition),t.request(n,r)},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=feature-service.umd.min.js.map |
@@ -32,2 +32,9 @@ import { IRequestOptions, GeometryType, IGeometry, ISpatialReference, IHasZM, IExtent, IField, IFeature } from "@esri/arcgis-rest-request"; | ||
success: boolean; | ||
/** | ||
* Error is optional and is only returned when `success` is `false`. | ||
*/ | ||
error?: { | ||
code: number; | ||
description: string; | ||
}; | ||
} | ||
@@ -34,0 +41,0 @@ /** |
{ | ||
"name": "@esri/arcgis-rest-feature-service", | ||
"version": "4.0.3", | ||
"version": "4.0.4", | ||
"description": "Feature layer query and edit helpers for @esri/arcgis-rest-js", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
692454
4298