"use strict";var t=this&&this.__awaiter||function(t,e,s,i){return new(s||(s=Promise))((function(u,n){function o(t){try{a(i.next(t))}catch(t){n(t)}}function r(t){try{a(i.throw(t))}catch(t){n(t)}}function a(t){var e;t.done?u(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}a((i=i.apply(t,e||[])).next())}))},e=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.AccessTokenDistTagsApi=void 0;const s=require("./DistTagsApi"),i=require("../registry/registry"),u=require("./types"),n=e(require("../../log"));class o extends s.DistTagsApi{constructor(t){super(t)}add(e,s,o){return t(this,void 0,void 0,(function*(){const t=yield(0,i.getAuth)(this.publishRegistry,!0),r=this.getRequestUrl(e,o);yield this.fetchDistTagsRequest(r,t,u.DistTagsSubCommand.ADD,u.HttpMethod.POST,s),n.default.info("",`Package "${e}@${s}" add tag "${o}" success.`)}))}remove(e,s){return t(this,void 0,void 0,(function*(){const t=yield(0,i.getAuth)(this.publishRegistry,!0),o=this.getRequestUrl(e,s);yield this.fetchDistTagsRequest(o,t,u.DistTagsSubCommand.REMOVE,u.HttpMethod.DELETE),n.default.info("",`Package "${e}" remove tag "${s}" success.`)}))}update(e,s,o){return t(this,void 0,void 0,(function*(){const t=yield(0,i.getAuth)(this.publishRegistry,!0),r=this.getRequestUrl(e,o);yield this.fetchDistTagsRequest(r,t,u.DistTagsSubCommand.UPDATE,u.HttpMethod.PUT,s),n.default.info("",`Package "${e}@${s}" update tag "${o}" success.`)}))}}exports.AccessTokenDistTagsApi=o;