import{validation}from"../../Validation.js";import{isArcGisApiVersion3x}from"./ArcGisApiVersion.js";import{inline,schedulePromiseCancellation,addToPath,post}from"./tools.js";class UpdateFeatures{execute(e,t){var a=validation.urlOrLayer(e,isArcGisApiVersion3x),a=addToPath(a,"applyEdits"),i=(validation.array("features",e.features,validation.never),validation.string("gdbVersion",e.gdbVersion)),s=validation.number("timeout",e.timeout),i={updates:validation.array("features",e.features,validation.never),gdbVersion:i},s=post(a,i,s,t.cancellationToken.signal);schedulePromiseCancellation(t,s);const r=this;return inline(s,function(e){r.onApplyEditsComplete(e);var t=e.updateResults&&e.updateResults.every(e=>e.success);return{results:e.updateResults,success:t}})}onApplyEditsComplete(e){}}UpdateFeatures.action="gcx:wf:arcgis::UpdateFeatures",UpdateFeatures.suite="gcx:wf:builtin";export{UpdateFeatures};