/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/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};
