"use strict";var t=this&&this.__awaiter||function(t,e,s,i){return new(s||(s=Promise))((function(n,o){function u(t){try{a(i.next(t))}catch(t){o(t)}}function r(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(u,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.SshDistTagsApi=void 0;const s=require("./DistTagsApi"),i=require("./types"),n=e(require("../../log")),o=require("../registry");class u extends s.DistTagsApi{constructor(t){super(t)}add(e,s,u){return t(this,void 0,void 0,(function*(){const{token:t}=yield(0,o.loginRequest)(this.publishRegistry),r=this.getRequestUrl(e,u);yield this.fetchDistTagsRequest(r,t,i.DistTagsSubCommand.ADD,i.HttpMethod.POST,s),n.default.info("",`Package "${e}@${s}" add tag "${u}" success.`)}))}remove(e,s){return t(this,void 0,void 0,(function*(){const{token:t}=yield(0,o.loginRequest)(this.publishRegistry),u=this.getRequestUrl(e,s);yield this.fetchDistTagsRequest(u,t,i.DistTagsSubCommand.ADD,i.HttpMethod.DELETE),n.default.info("",`Package "${e}" remove tag "${s}" success.`)}))}update(e,s,u){return t(this,void 0,void 0,(function*(){const{token:t}=yield(0,o.loginRequest)(this.publishRegistry),r=this.getRequestUrl(e,u);yield this.fetchDistTagsRequest(r,t,i.DistTagsSubCommand.ADD,i.HttpMethod.PUT,s),n.default.info("",`Package "${e}@${s}" update tag "${u}" success.`)}))}}exports.SshDistTagsApi=u;