UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 802 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import e from"../../request.js";import r from"../../core/Error.js";import{parseUrl as o,asValidOptions as s,encode as t}from"../utils.js";import{addServerVersion as i}from"./gdbVersion/serverVersionUtils.js";const n=new Map;async function a(a,m,p){n.has(a)||await i(n,a);const c=n.get(a);if((c?.serverVersion??0)<=11.1)throw new r("deleteVersion:enterprise-version","versioning API requires ArcGIS Enterprise version 11.2 or higher");const u=o(a),d=m.toJSON(),f=s(u.query,{query:t({...d,f:"json"}),...p,authMode:"immediate",method:"post"}),h=`${u.path}/delete`,{data:j}=await e(h,f);return j.success}export{a as deleteVersion,n as serverVersionCacheMap};