@catladder/cli
Version:
Panter cli tool for cloud CI/CD and DevOps
1 lines • 688 kB
JavaScript
(()=>{var e={1123:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.runCatCi=void 0;const i=n(r(1491));const s=n(r(2260));const o=n(r(4288));function reconstructArgs(e){return[e[0],...e.slice(1).map((e=>`"${e}"`))].join(" ")}async function runCatCi(){const e=new i.default;process.exitCode=0;e.delimiter("catci $").history("catci").version(s.default.version);(0,o.default)(e);const t=process.argv.length<=2;if(t){e.log(`Catladder CI Tools 😻🔨 version ${s.default.version}`).show()}else{process.exitCode=1;const t=reconstructArgs(process.argv.slice(2));await e.exec(t);process.exit()}}t.runCatCi=runCatCi},2488:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.evaluateDocument=t.makeTemplate=void 0;const i=n(r(1888));const s=i.default;const o="✅";const a="❌";const u=`${o}/${a}`;const c="@...";const l=[["Responsible",u,"Description","Note","More Information"]].concat(s.map((e=>[Array(e.responsibles).fill(c).join(", "),u,e.description,"",e.more])));function makeTable(e){const t=calculateColumnWidths(e);return`\n${makeRow(e[0],t," ")}\n${makeRow(e[0].map((()=>"")),t,"-")}\n${e.slice(1).map((e=>makeRow(e,t," "))).join("\n")}\n`}function calculateColumnWidths(e){const t=e[0].length;return Array.from({length:t},((e,t)=>t)).map((t=>Math.max(...e.map((e=>e[t].length)))))}function makeRow(e,t,r){return`| ${e.map(((e,n)=>e.padEnd(t[n],r))).join(" | ")} |`}function makeTemplate(){return`\n# Security Audit Report\n\nA security audit report document is a comprehensive assessment of an application's security posture, containing security topics that auditors can mark to indicate the state of various security aspects.\n\nIt serves as a structured guide for security team to evaluate different security factors such as authentication, authorization, data encryption, input validation, and more.\n\n## General Information\n\n- Project Owner is @...\n- Dev team:\n - @...\n - @...\n - @...\n\n## Project Security\n\n${makeTable(l)}\n\n`}t.makeTemplate=makeTemplate;function evaluateDocument(e){var t,r;const n=(r=(t=e.match(/^\s*\|.*?\|\s*$/gm))===null||t===void 0?void 0:t.map((e=>e.trim())))!==null&&r!==void 0?r:[];const i=n.map((e=>e.split("|").map((e=>e.trim())))).slice(2);const a=new Set(s.map((e=>e.description)));const l=i.map((e=>{const t=e[1].split(", ");const r=e[2];const n=e[3];const i=e[4];const s=!a.has(n);const l=!s&&!r.includes(u)&&!t.some((e=>e.includes(c)));const p=!s&&l&&r.includes(o);return{responsibles:t,answer:r,description:n,note:i,isUnknown:s,isAnswered:l,isSecured:p}}));const p=s.length;const h=l.filter((e=>e.isAnswered)).length;const d=l.filter((e=>e.isSecured)).length;const v=l.filter((e=>e.isUnknown)).length;const g=Math.round(d/p*100);return{topics:l,score:{rating:g,totalTopics:p,answeredTopics:h,securedTopics:d,unknownTopics:v}}}t.evaluateDocument=evaluateDocument},4288:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(6725);const i=r(1084);const s=r(8933);const o=r(2807);const a="https://git.panter.ch";function default_1(e){commandCiJob(e);commandEvaluate(e);commandCreate(e)}t["default"]=default_1;function resultAsExitCode(e){return async t=>{const r=await e(t);process.exitCode=r.isErr()?1:0}}async function commandCiJob(e){e.command("security-audit-ci-job <path> <token> <mainBranch> <projectId> <userId>",`Evaluates security audit document. If the document can't be evaluated or does not exist, creates a new MR with security audit document template.\n\n<path> root path of a project with security audit document (${s.SECURITY_AUDIT_FILE_NAME})\n<token> gitlab token with 'api' scopes and permissions to create a new branch\n<main-branch> main branch name\n<project-id> project id to create security audit for\n<user-id> gitlab user id that will be assignee of the audit\n`).action(resultAsExitCode((async e=>{const t=await(0,n.evaluateSecurityAudit)({path:e.path});if(t.isErr()){console.log("could not evaluate security audit document");console.log("creating new merge request with security audit template...");const{token:t,mainBranch:r,projectId:n,userId:u}=e;const c=new i.Gitlab({host:a,token:t});const l=await(0,s.createSecurityAuditMergeRequest)({api:c,mainBranch:r,projectId:n,userId:parseInt(u)});if(l.isErr()){console.error(`could not create merge request with security audit template: ${l.error}`);return l}console.log("security audit merge request created successfully");console.log(`please finish the MR by updating SECURITY.md document: ${l.value.web_url}`);return(0,o.Err)("merge request created")}if(t.value.score.answeredTopics===0){console.error("audit document has no answered topics");console.error(`please answer security topics in ${s.SECURITY_AUDIT_FILE_NAME} by adding responsible people and check/cross in the table`);return(0,o.Err)("audit document has no answered topics")}console.log((0,n.makeSecurityAuditOverview)(t.value));return(0,o.Ok)({})})))}async function commandEvaluate(e){e.command("security-audit-evaluate <path>","Evaluates security audit document in given <path>").action(resultAsExitCode((async e=>{console.log("evaluating security audit document...");const t=await(0,n.evaluateSecurityAudit)({path:e.path});if(t.isErr()){console.error(t.error);console.error(`please make sure the security audit document ${s.SECURITY_AUDIT_FILE_NAME} is in the repository`)}else{console.log((0,n.makeSecurityAuditOverview)(t.value))}return t})))}async function commandCreate(e){e.command("security-audit-create <token> <mainBranch> <projectId> <userId>",`Creates a MR in given project with the latest security audit template document\n\n<token> gitlab token with 'api' scopes and permissions to create a new branch\n<main-branch> main branch name\n<project-id> project id to create security audit for\n<user-id> gitlab user id that will be assignee of the audit\n`).action(resultAsExitCode((async e=>{const{token:t,mainBranch:r,projectId:n,userId:o}=e;const u=new i.Gitlab({host:a,token:t});const c=await(0,s.createSecurityAuditMergeRequest)({api:u,mainBranch:r,projectId:n,userId:parseInt(o)});if(c.isErr()){console.error(`could not create security audit merge request: ${c.error}`)}else{console.log("security audit merge request created successfully");console.log(`please finish the MR by updating SECURITY.md document: ${c.value.web_url}`)}return c})))}},8933:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createSecurityAuditMergeRequest=t.SECURITY_AUDIT_FILE_NAME=void 0;const n=r(2807);const i=r(2488);function makeDatedBranchName(e){const t=(new Date).toISOString().slice(0,-5).replaceAll(/[:.T]/g,"-");return`${e}-${t}`}const s="Draft: chore(security): add security audit document";t.SECURITY_AUDIT_FILE_NAME="SECURITY.md";async function createSecurityAuditMergeRequest({projectId:e,mainBranch:r,userId:o,api:a}){const u=(await n.Result.wrapAsync((()=>a.MergeRequests.all({state:"opened",wip:"yes",labels:"security-audit"})))).mapErr((()=>`could not search for existing merge requests`));if(u.isErr())return u;const c=u.value[0];if(c)return(0,n.Err)(`open merge request with security audit already exists: ${c.web_url}`);const l=n.Result.wrap((()=>(0,i.makeTemplate)())).mapErr((()=>"could not make security audit template document"));if(l.isErr())return l;const p=(await n.Result.wrapAsync((()=>a.Branches.create(e,makeDatedBranchName("chore/security-audit"),r)))).mapErr((e=>{console.log(e);return"could not create branch"}));if(p.isErr())return p;const h=(await n.Result.wrapAsync((()=>a.Commits.create(e,p.value.name,"chore(security): add empty security audit document template",[{action:"create",filePath:t.SECURITY_AUDIT_FILE_NAME,content:l.value,encoding:"text"}])))).mapErr((()=>"could not create commit"));if(h.isErr())return h;const d=(await n.Result.wrapAsync((()=>a.MergeRequests.create(e,p.value.name,r,s,{description:`Please follow and update security audit document in \`${t.SECURITY_AUDIT_FILE_NAME}\`.`,assigneeId:o,squash:true,labels:"security-audit",removeSourceBranch:true})))).mapErr((()=>"could not create merge request"));return d}t.createSecurityAuditMergeRequest=createSecurityAuditMergeRequest},6725:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.makeSecurityAuditOverview=t.evaluateSecurityAudit=void 0;const n=r(2807);const i=r(1017);const s=r(3292);const o=r(8933);const a=r(2488);async function evaluateSecurityAudit({path:e}){return(await n.Result.wrapAsync((async()=>{const t=(0,i.join)(e,o.SECURITY_AUDIT_FILE_NAME);const r=await(0,s.readFile)(t);const n=r.toString("utf-8");return(0,a.evaluateDocument)(n)}))).mapErr((e=>`could not evaluate ${o.SECURITY_AUDIT_FILE_NAME}: ${e}`))}t.evaluateSecurityAudit=evaluateSecurityAudit;function makeSecurityAuditOverview(e){const ratingToEmo=e=>e<33?"🟥":e<66?"🟨":"🟩";return`Project security posture overview:\n 🧐 Total topics: ${e.score.totalTopics}\n 🔒 Secured topics: ${e.score.securedTopics}\n 📢 Answered topics: ${e.score.answeredTopics}\n ❔ Unknown topics: ${e.score.unknownTopics}\n 📊 Rating: ${ratingToEmo(e.score.rating)} ${e.score.rating}/100`}t.makeSecurityAuditOverview=makeSecurityAuditOverview},2260:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:true});const n=((r=require.main)===null||r===void 0?void 0:r.path)+"/../package.json";const i=require(n);t["default"]=i},4007:(e,t,r)=>{"use strict";var n=r(5024);var i=r(48);var s=r(9241);function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var o=_interopDefault(s);function appendFormFromObject(e){const t=new FormData;Object.entries(e).forEach((([e,r])=>{if(!r)return;if(Array.isArray(r))t.append(e,r[0],r[1]);else t.append(e,r)}));return t}function endpoint(e,...t){return t.reduce(((t,r,n)=>t+encodeURIComponent(r)+e[n+1]),e[0])}function parseLinkHeader(e){const t={};const r=/<([^>]+)>; rel="([^"]+)"/g;let n;while(n=r.exec(e)){const[,e,r]=n;t[r]=e}return t}function reformatObjectOptions(e,t,r=false){const n=r?i.decamelizeKeys(e):e;return o.default.stringify({[t]:n},{encode:false}).split("&").reduce(((e,t)=>{const[r,n]=t.split("=");e[r]=n;return e}),{})}function packageResponse(e,t){return t?{data:e.body,status:e.status,headers:e.headers}:e.body}function getStream(e,t){return packageResponse(e,t)}function getSingle(e,t,r){const{status:n,headers:s}=t;let{body:o}=t;if(e)o=i.camelizeKeys(o);return packageResponse({body:o,status:n,headers:s},r)}async function getManyMore(e,t,r,n,o,a){const{sudo:u,showExpanded:c,maxPages:l,pagination:p,page:h,perPage:d,idAfter:v,orderBy:g,sort:y}=o;if(e)n.body=i.camelizeKeys(n?.body);const m=[...a||[],...n.body];const b=l&&d?m.length/+d<l:true;const{next:_=""}=parseLinkHeader(n.headers.link);if(!(h&&(a||[]).length===0)&&_&&b){const n=s.parse(_.split("?")[1]);const o={...i.camelizeKeys(n)};const a={...o,maxPages:l,sudo:u,showExpanded:c};const p=await t(r,{searchParams:o,sudo:u});return getManyMore(e,t,r,p,a,m)}if(!c)return m;const w=p==="keyset"?{idAfter:v?+v:null,perPage:d?+d:null,orderBy:g,sort:y}:{total:parseInt(n.headers["x-total"],10),next:parseInt(n.headers["x-next-page"],10)||null,current:parseInt(n.headers["x-page"],10)||1,previous:parseInt(n.headers["x-prev-page"],10)||null,perPage:parseInt(n.headers["x-per-page"],10),totalPages:parseInt(n.headers["x-total-pages"],10)};return{data:m,paginationInfo:w}}function get(){return async(e,t,r)=>{const{asStream:n,sudo:i,showExpanded:s,maxPages:o,...a}=r||{};const u=e.queryTimeout?AbortSignal.timeout(e.queryTimeout):void 0;const c=await e.requester.get(t,{searchParams:a,sudo:i,asStream:n,signal:u});const l=e.camelize||false;if(n)return getStream(c,s);if(!Array.isArray(c.body))return getSingle(l,c,s);const p={sudo:i,showExpanded:s,maxPages:o,...a};return getManyMore(l,((t,r)=>e.requester.get(t,{...r,signal:u})),t,c,p)}}function post(){return async(e,t,{searchParams:r,isForm:n,sudo:s,showExpanded:o,...a}={})=>{const u=n?appendFormFromObject(a):a;const c=await e.requester.post(t,{searchParams:r,body:u,sudo:s,signal:e.queryTimeout?AbortSignal.timeout(e.queryTimeout):void 0});if(e.camelize)c.body=i.camelizeKeys(c.body);return packageResponse(c,o)}}function put(){return async(e,t,{searchParams:r,isForm:n,sudo:s,showExpanded:o,...a}={})=>{const u=n?appendFormFromObject(a):a;const c=await e.requester.put(t,{body:u,searchParams:r,sudo:s,signal:e.queryTimeout?AbortSignal.timeout(e.queryTimeout):void 0});if(e.camelize)c.body=i.camelizeKeys(c.body);return packageResponse(c,o)}}function patch(){return async(e,t,{searchParams:r,isForm:n,sudo:s,showExpanded:o,...a}={})=>{const u=n?appendFormFromObject(a):a;const c=await e.requester.patch(t,{body:u,searchParams:r,sudo:s,signal:e.queryTimeout?AbortSignal.timeout(e.queryTimeout):void 0});if(e.camelize)c.body=i.camelizeKeys(c.body);return packageResponse(c,o)}}function del(){return async(e,t,{sudo:r,showExpanded:n,searchParams:i,...s}={})=>{const o=await e.requester.delete(t,{body:s,searchParams:i,sudo:r,signal:e.queryTimeout?AbortSignal.timeout(e.queryTimeout):void 0});return packageResponse(o,n)}}var a={post:post,put:put,patch:patch,get:get,del:del};var u=class extends n.BaseResource{all(e,t){return a.get()(this,endpoint`projects/${e}/cluster_agents`,t)}allTokens(e,t,r){return a.get()(this,endpoint`projects/${e}/cluster_agents/${t}/tokens`,r)}createToken(e,t,r,n){return a.get()(this,endpoint`projects/${e}/cluster_agents/${t}/tokens`,{name:r,...n})}show(e,t,r){return a.get()(this,endpoint`projects/${e}/cluster_agents/${t}`,r)}showToken(e,t,r,n){return a.get()(this,endpoint`projects/${e}/cluster_agents/${t}/tokens/${r}`,n)}register(e,t,r){return a.post()(this,endpoint`projects/${e}/cluster_agents`,{name:t,...r})}removeToken(e,t,r,n){return a.del()(this,endpoint`projects/${e}/cluster_agents/${t}/tokens/${r}`,n)}unregister(e,t,r){return a.del()(this,endpoint`projects/${e}/cluster_agents/${t}`,r)}};var c=class extends n.BaseResource{allMetricImages(e,t,r){return a.get()(this,endpoint`projects/${e}/alert_management_alerts/${t}/metric_images`,r)}editMetricImage(e,t,r,n){return a.put()(this,endpoint`projects/${e}/alert_management_alerts/${t}/metric_images/${r}`,n)}removeMetricImage(e,t,r,n){return a.del()(this,endpoint`projects/${e}/alert_management_alerts/${t}/metric_images/${r}`,n)}uploadMetricImage(e,t,r,n){return a.post()(this,endpoint`projects/${e}/alert_management_alerts/${t}/metric_images`,{isForm:true,file:[r.content,r.filename],...n})}};var l=class extends n.BaseResource{show(e){return a.get()(this,"application/appearence",e)}edit({logo:e,pwaIcon:t,...r}={}){if(e||t){const n={...r,isForm:true};if(e)n.logo=[e.content,e.filename];if(t)n.pwaIcon=[t.content,t.filename];return a.put()(this,"application/appearence",n)}return a.put()(this,"application/appearence",r)}};var p=class extends n.BaseResource{show(e){return a.get()(this,"application/plan_limits",e)}edit(e,t={}){const{ciPipelineSize:r,ciActiveJobs:n,ciActivePipelines:i,ciProjectSubscriptions:s,ciPipelineSchedules:o,ciNeedsSizeLimit:u,ciRegisteredGroupRunners:c,ciRegisteredProjectRunners:l,conanMaxFileSize:p,genericPackagesMaxFileSize:h,helmMaxFileSize:d,mavenMaxFileSize:v,npmMaxFileSize:g,nugetMaxFileSize:y,pypiMaxFileSize:m,terraformModuleMaxFileSize:b,storageSizeLimit:_,...w}=t;return a.put()(this,"application/plan_limits",{...w,searchParams:{planName:e,ciPipelineSize:r,ciActiveJobs:n,ciActivePipelines:i,ciProjectSubscriptions:s,ciPipelineSchedules:o,ciNeedsSizeLimit:u,ciRegisteredGroupRunners:c,ciRegisteredProjectRunners:l,conanMaxFileSize:p,genericPackagesMaxFileSize:h,helmMaxFileSize:d,mavenMaxFileSize:v,npmMaxFileSize:g,nugetMaxFileSize:y,pypiMaxFileSize:m,terraformModuleMaxFileSize:b,storageSizeLimit:_}})}};var h=class extends n.BaseResource{all(e){return a.get()(this,"applications",e)}create(e,t,r,n){return a.post()(this,"applications",{name:e,redirectUri:t,scopes:r,...n})}remove(e,t){return a.del()(this,`applications/${e}`,t)}};var d=class extends n.BaseResource{show(e){return a.get()(this,"application/settings",e)}edit(e){return a.put()(this,"application/settings",e)}};var v=class extends n.BaseResource{show(e){return a.get()(this,"application/statistics",e)}};function url({projectId:e,groupId:t}={}){let r="";if(e)r=endpoint`projects/${e}/`;else if(t)r=endpoint`groups/${t}/`;return`${r}audit_events`}var g=class extends n.BaseResource{all({projectId:e,groupId:t,...r}={}){const n=url({projectId:e,groupId:t});return a.get()(this,n,r)}show(e,{projectId:t,groupId:r,...n}={}){const i=url({projectId:t,groupId:r});return a.get()(this,`${i}/${e}`,n)}};var y=class extends n.BaseResource{show(e,t){return a.get()(this,"avatar",{email:e,...t})}};var m=class extends n.BaseResource{all(e){return a.get()(this,"broadcast_messages",e)}create(e){return a.post()(this,"broadcast_messages",e)}edit(e,t){return a.put()(this,`broadcast_messages/${e}`,t)}remove(e,t){return a.del()(this,`broadcast_messages/${e}`,t)}show(e,t){return a.get()(this,`broadcast_messages/${e}`,t)}};var b=class extends n.BaseResource{createAccessToken(e){return a.post()(this,"code_suggestions/tokens",e)}generateCompletion(e){return a.post()(this,"code_suggestions/completions",e)}};var _=class extends n.BaseResource{create(e,t){return a.post()(this,endpoint`projects/${e}/packages/composer`,t)}download(e,t,r,n){return a.get()(this,endpoint`projects/${e}/packages/composer/archives/${t}`,{searchParams:{sha:r},...n})}showMetadata(e,t,r){let n;if(r&&r.sha){n=endpoint`groups/${e}/-/packages/composer/${t}$${r.sha}`}else{n=endpoint`groups/${e}/-/packages/composer/p2/${t}`}return a.get()(this,n,r)}showPackages(e,t,r){return a.get()(this,endpoint`groups/${e}/-/packages/composer/p/${t}`,r)}showBaseRepository(e,t){const r={...this};if(t&&t.composerVersion==="2"){r.headers["User-Agent"]="Composer/2"}return a.get()(r,endpoint`groups/${e}/-/packages/composer/packages`,t)}};function url2(e){return e?endpoint`projects/${e}/packages/conan/v1`:"packages/conan/v1"}var w=class extends n.BaseResource{authenticate({projectId:e,...t}={}){return a.get()(this,`${url2(e)}/users/authenticate`,t)}checkCredentials({projectId:e,...t}={}){const r=url2(e);return a.get()(this,`${r}/users/check_credentials`,t)}downloadPackageFile(e,t,r,n,i,s,o,u,{projectId:c,...l}={}){const p=url2(c);return a.get()(this,`${p}/conans/${e}/${t}/${r}/${n}/${s}/package/${i}/${o}/${u}`,l)}downloadRecipeFile(e,t,r,n,i,s,{projectId:o,...u}={}){const c=url2(o);return a.get()(this,`${c}/conans/${e}/${t}/${r}/${n}/${i}/export/${s}`,u)}showPackageUploadUrls(e,t,r,n,i,{projectId:s,...o}={}){const u=url2(s);return a.get()(this,`${u}/conans/${e}/${t}/${r}/${n}/packages/${i}/upload_urls`,o)}showPackageDownloadUrls(e,t,r,n,i,{projectId:s,...o}={}){const u=url2(s);return a.get()(this,`${u}/conans/${e}/${t}/${r}/${n}/packages/${i}/download_urls`,o)}showPackageManifest(e,t,r,n,i,{projectId:s,...o}={}){const u=url2(s);return a.get()(this,`${u}/conans/${e}/${t}/${r}/${n}/packages/${i}/digest`,o)}showPackageSnapshot(e,t,r,n,i,{projectId:s,...o}={}){const u=url2(s);return a.get()(this,`${u}/conans/${e}/${t}/${r}/${n}/packages/${i}`,o)}ping({projectId:e,...t}={}){return a.post()(this,`${url2(e)}/ping`,t)}showRecipeUploadUrls(e,t,r,n,{projectId:i,...s}={}){const o=url2(i);return a.get()(this,`${o}/conans/${e}/${t}/${r}/${n}/upload_urls`,s)}showRecipeDownloadUrls(e,t,r,n,{projectId:i,...s}={}){const o=url2(i);return a.get()(this,`${o}/conans/${e}/${t}/${r}/${n}/download_urls`,s)}showRecipeManifest(e,t,r,n,{projectId:i,...s}={}){const o=url2(i);return a.get()(this,`${o}/conans/${e}/${t}/${r}/${n}/digest`,s)}showRecipeSnapshot(e,t,r,n,{projectId:i,...s}={}){const o=url2(i);return a.get()(this,`${o}/conans/${e}/${t}/${r}/${n}`,s)}removePackageFile(e,t,r,n,{projectId:i,...s}={}){const o=url2(i);return a.get()(this,`${o}/conans/${e}/${t}/${r}/${n}`,s)}search({projectId:e,...t}={}){const r=url2(e);return a.get()(this,`${r}/conans/search`,t)}uploadPackageFile(e,t,r,n,i,s,o,u,c){const l=url2();return a.get()(this,`${l}/files/${t}/${r}/${n}/${i}/${o}/package/${s}/${u}/${e.filename}`,{isForm:true,...c,file:[e.content,e.filename]})}uploadRecipeFile(e,t,r,n,i,s,o){const u=url2();return a.get()(this,`${u}/files/${t}/${r}/${n}/${i}/${s}/export/${e.filename}`,{isForm:true,...o,file:[e.content,e.filename]})}};var S=class extends n.BaseResource{create(e,t,r,{environmentId:n,clusterId:i,...s}={}){let o;if(n)o=endpoint`environments/${n}/metrics_dashboard/annotations`;else if(i)o=endpoint`clusters/${i}/metrics_dashboard/annotations`;else throw new Error("Missing required argument. Please supply a environmentId or a cluserId in the options parameter.");return a.post()(this,o,{dashboardPath:e,startingAt:t,description:r,...s})}};function url3({projectId:e,groupId:t}={}){if(e)return endpoint`/projects/${e}/packages/debian`;if(t)return endpoint`/groups/${t}/-/packages/debian`;throw new Error("Missing required argument. Please supply a projectId or a groupId in the options parameter")}var x=class extends n.BaseResource{downloadBinaryFileIndex(e,t,r,{projectId:n,groupId:i,...s}){const o=url3({projectId:n,groupId:i});return a.get()(this,`${o}/dists/${e}/${t}/binary-${r}/Packages`,s)}downloadDistributionReleaseFile(e,{projectId:t,groupId:r,...n}){const i=url3({projectId:t,groupId:r});return a.get()(this,`${i}/dists/${e}/Release`,n)}downloadSignedDistributionReleaseFile(e,{projectId:t,groupId:r,...n}){const i=url3({projectId:t,groupId:r});return a.get()(this,`${i}/dists/${e}/InRelease`,n)}downloadReleaseFileSignature(e,{projectId:t,groupId:r,...n}){const i=url3({projectId:t,groupId:r});return a.get()(this,`${i}/dists/${e}/Release.gpg`,n)}downloadPackageFile(e,t,r,n,i,s,o){return a.get()(this,endpoint`projects/${e}/packages/debian/pool/${t}/${r}/${n}/${i}/${s}`,o)}uploadPackageFile(e,t,r){return a.put()(this,endpoint`projects/${e}/packages/debian/${t.filename}`,{isForm:true,...r,file:[t.content,t.filename]})}};var A=class extends n.BaseResource{remove(e,t){return a.post()(this,`groups/${e}/dependency_proxy/cache`,t)}};var I=class extends n.BaseResource{all({projectId:e,userId:t,...r}={}){let n;if(e){n=endpoint`projects/${e}/deploy_keys`}else if(t){n=endpoint`users/${t}/project_deploy_keys`}else{n="deploy_keys"}return a.get()(this,n,r)}create(e,t,r,n){return a.post()(this,endpoint`projects/${e}/deploy_keys`,{title:t,key:r,...n})}edit(e,t,r){return a.put()(this,endpoint`projects/${e}/deploy_keys/${t}`,r)}enable(e,t,r){return a.post()(this,endpoint`projects/${e}/deploy_keys/${t}/enable`,r)}remove(e,t,r){return a.del()(this,endpoint`projects/${e}/deploy_keys/${t}`,r)}show(e,t,r){return a.get()(this,endpoint`projects/${e}/deploy_keys/${t}`,r)}};var E=class extends n.BaseResource{all({projectId:e,groupId:t,...r}={}){let n;if(e)n=endpoint`projects/${e}/deploy_tokens`;else if(t)n=endpoint`groups/${t}/deploy_tokens`;else n="deploy_tokens";return a.get()(this,n,r)}create(e,t,{projectId:r,groupId:n,...i}={}){let s;if(r)s=endpoint`projects/${r}/deploy_tokens`;else if(n)s=endpoint`groups/${n}/deploy_tokens`;else{throw new Error("Missing required argument. Please supply a projectId or a groupId in the options parameter.")}return a.post()(this,s,{name:e,scopes:t,...i})}remove(e,{projectId:t,groupId:r,...n}={}){let i;if(t)i=endpoint`projects/${t}/deploy_tokens/${e}`;else if(r)i=endpoint`groups/${r}/deploy_tokens/${e}`;else{throw new Error("Missing required argument. Please supply a projectId or a groupId in the options parameter.")}return a.del()(this,i,n)}show(e,{projectId:t,groupId:r,...n}={}){let i;if(t)i=endpoint`projects/${t}/deploy_tokens/${e}`;else if(r)i=endpoint`groups/${r}/deploy_tokens/${e}`;else{throw new Error("Missing required argument. Please supply a projectId or a groupId in the options parameter.")}return a.get()(this,i,n)}};var j=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}all(e,t){return a.get()(this,endpoint`${e}/access_requests`,t)}request(e,t){return a.post()(this,endpoint`${e}/access_requests`,t)}approve(e,t,r){return a.post()(this,endpoint`${e}/access_requests/${t}/approve`,r)}deny(e,t,r){return a.del()(this,endpoint`${e}/access_requests/${t}`,r)}};var O=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}all(e,t){return a.get()(this,endpoint`${e}/access_tokens`,t)}create(e,t,r,n){return a.post()(this,endpoint`${e}/access_tokens`,{name:t,scopes:r,...n})}revoke(e,t,r){return a.del()(this,endpoint`${e}/access_tokens/${t}`,r)}show(e,t,r){return a.get()(this,endpoint`${e}/access_tokens/${t}`,r)}};function url4(e,t,r,n){const[i,s]=[e,r].map(encodeURIComponent);const o=[i,t,s];o.push("award_emoji");if(n)o.push(n);return o.join("/")}var k=class extends n.BaseResource{resourceType2;constructor(e,t,r){super({prefixUrl:e,...r});this.resourceType2=t}all(e,t,r){return a.get()(this,url4(e,this.resourceType2,t),r)}award(e,t,r,n){return a.post()(this,url4(e,this.resourceType2,t),{name:r,...n})}remove(e,t,r,n){return a.del()(this,url4(e,this.resourceType2,t,r),n)}show(e,t,r,n){return a.get()(this,url4(e,this.resourceType2,t,r),n)}};function url5(e,t,r,n,i){const[s,o]=[e,r].map(encodeURIComponent);const a=[s,t,o];a.push("notes");a.push(n);a.push("award_emoji");if(i)a.push(i);return a.join("/")}var $=class extends n.BaseResource{resourceType;constructor(e,t){super({prefixUrl:"projects",...t});this.resourceType=e}all(e,t,r,n){return a.get()(this,url5(e,this.resourceType,t,r),n)}award(e,t,r,n,i){return a.post()(this,url5(e,this.resourceType,t,r),{name:n,...i})}remove(e,t,r,n,i){return a.del()(this,url5(e,this.resourceType,t,r,n),i)}show(e,t,r,n,i){return a.get()(this,url5(e,this.resourceType,t,r,n),i)}};var C=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}add(e,t,r,n){return a.post()(this,endpoint`${e}/badges`,{linkUrl:t,imageUrl:r,...n})}all(e,t){return a.get()(this,endpoint`${e}/badges`,t)}edit(e,t,r){return a.put()(this,endpoint`${e}/badges/${t}`,r)}preview(e,t,r,n){return a.get()(this,endpoint`${e}/badges/render`,{linkUrl:t,imageUrl:r,...n})}remove(e,t,r){return a.del()(this,endpoint`${e}/badges/${t}`,r)}show(e,t,r){return a.get()(this,endpoint`${e}/badges/${t}`,r)}};var R=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}all(e,t){return a.get()(this,endpoint`${e}/custom_attributes`,t)}remove(e,t,r){return a.del()(this,endpoint`${e}/custom_attributes/${t}`,r)}set(e,t,r,n){return a.put()(this,endpoint`${e}/custom_attributes/${t}`,{value:r,...n})}show(e,t,r){return a.get()(this,endpoint`${e}/custom_attributes/${t}`,r)}};var P=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}all(e,t,r){return a.get()(this,endpoint`${e}/dora/metrics`,{metric:t,...r})}};var M=class extends n.BaseResource{resource2Type;constructor(e,t,r){super({prefixUrl:e,...r});this.resource2Type=t}addNote(e,t,r,n,i,s){return a.post()(this,endpoint`${e}/${this.resource2Type}/${t}/discussions/${r}/notes`,{...s,body:i,noteId:n})}all(e,t,r){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/discussions`,r)}create(e,t,r,{position:n,...i}={}){const s={...i,body:r};if(n){Object.assign(s,reformatObjectOptions(n,"position",true));s.isForm=true}return a.post()(this,endpoint`${e}/${this.resource2Type}/${t}/discussions`,s)}editNote(e,t,r,n,i){return a.put()(this,endpoint`${e}/${this.resource2Type}/${t}/discussions/${r}/notes/${n}`,i)}removeNote(e,t,r,n,i){return a.del()(this,endpoint`${e}/${this.resource2Type}/${t}/discussions/${r}/notes/${n}`,i)}show(e,t,r,n){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/discussions/${r}`,n)}};var T=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}all(e,t){return a.get()(this,endpoint`${e}/boards`,t)}allLists(e,t,r){return a.get()(this,endpoint`${e}/boards/${t}/lists`,r)}create(e,t,r){return a.post()(this,endpoint`${e}/boards`,{name:t,...r})}createList(e,t,r){return a.post()(this,endpoint`${e}/boards/${t}/lists`,r)}edit(e,t,r){return a.put()(this,endpoint`${e}/boards/${t}`,r)}editList(e,t,r,n,i){return a.put()(this,endpoint`${e}/boards/${t}/lists/${r}`,{position:n,...i})}remove(e,t,r){return a.del()(this,endpoint`${e}/boards/${t}`,r)}removeList(e,t,r,n){return a.del()(this,endpoint`${e}/boards/${t}/lists/${r}`,n)}show(e,t,r){return a.get()(this,endpoint`${e}/boards/${t}`,r)}showList(e,t,r,n){return a.get()(this,endpoint`${e}/boards/${t}/lists/${r}`,n)}};var L=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}all(e,t){return a.get()(this,endpoint`${e}/labels`,t)}create(e,t,r,n){return a.post()(this,endpoint`${e}/labels`,{name:t,color:r,...n})}edit(e,t,r){if(!r?.newName&&!r?.color)throw new Error("Missing required argument. Please supply a color or a newName in the options parameter.");return a.put()(this,endpoint`${e}/labels/${t}`,r)}promote(e,t,r){return a.put()(this,endpoint`${e}/labels/${t}/promote`,r)}remove(e,t,r){return a.del()(this,endpoint`${e}/labels/${t}`,r)}show(e,t,r){return a.get()(this,endpoint`${e}/labels/${t}`,r)}subscribe(e,t,r){return a.post()(this,endpoint`${e}/issues/${t}/subscribe`,r)}unsubscribe(e,t,r){return a.post()(this,endpoint`${e}/issues/${t}/unsubscribe`,r)}};var N=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}add(e,t,r,n){return a.post()(this,endpoint`${e}/members`,{userId:String(t),accessLevel:r,...n})}all(e,{includeInherited:t,...r}={}){let n=endpoint`${e}/members`;if(t)n+="/all";return a.get()(this,n,r)}edit(e,t,r,n){return a.put()(this,endpoint`${e}/members/${t}`,{accessLevel:r,...n})}show(e,t,{includeInherited:r,...n}={}){const[i,s]=[e,t].map(encodeURIComponent);const o=[i,"members"];if(r)o.push("all");o.push(s);return a.get()(this,o.join("/"),n)}remove(e,t,r){return a.del()(this,endpoint`${e}/members/${t}`,r)}};var D=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}all(e,t){return a.get()(this,endpoint`${e}/milestones`,t)}allAssignedIssues(e,t,r){return a.get()(this,endpoint`${e}/milestones/${t}/issues`,r)}allAssignedMergeRequests(e,t,r){return a.get()(this,endpoint`${e}/milestones/${t}/merge_requests`,r)}allBurndownChartEvents(e,t,r){return a.get()(this,endpoint`${e}/milestones/${t}/burndown_events`,r)}create(e,t,r){return a.post()(this,endpoint`${e}/milestones`,{title:t,...r})}edit(e,t,r){return a.put()(this,endpoint`${e}/milestones/${t}`,r)}remove(e,t,r){return a.del()(this,endpoint`${e}/milestones/${t}`,r)}show(e,t,r){return a.get()(this,endpoint`${e}/milestones/${t}`,r)}};var B=class extends n.BaseResource{resource2Type;constructor(e,t,r){super({prefixUrl:e,...r});this.resource2Type=t}all(e,t,r){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/notes`,r)}create(e,t,r,n){return a.post()(this,endpoint`${e}/${this.resource2Type}/${t}/notes`,{body:r,...n})}edit(e,t,r,n){return a.put()(this,endpoint`${e}/${this.resource2Type}/${t}/notes/${r}`,n)}remove(e,t,r,n){return a.del()(this,endpoint`${e}/${this.resource2Type}/${t}/notes/${r}`,n)}show(e,t,r,n){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/notes/${r}`,n)}};var q=class extends n.BaseResource{constructor(e,t){super({prefixUrl:["templates",e].join("/"),...t})}all(e){process.emitWarning('This API will be deprecated as of Gitlabs v5 API. Please make the switch to "ProjectTemplates".',"DeprecationWarning");return a.get()(this,"",e)}show(e,t){process.emitWarning('This API will be deprecated as of Gitlabs v5 API. Please make the switch to "ProjectTemplates".',"DeprecationWarning");return a.get()(this,encodeURIComponent(e),t)}};var W=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}all(e,t){return a.get()(this,endpoint`${e}/variables`,t)}create(e,t,r,n){return a.post()(this,endpoint`${e}/variables`,{key:t,value:r,...n})}edit(e,t,r,n){return a.put()(this,endpoint`${e}/variables/${t}`,{value:r,...n})}show(e,t,r){return a.get()(this,endpoint`${e}/variables/${t}`,r)}remove(e,t,r){return a.del()(this,endpoint`${e}/variables/${t}`,r)}};var U=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}all(e,t){return a.get()(this,endpoint`${e}/wikis`,t)}create(e,t,r,n){return a.post()(this,endpoint`${e}/wikis`,{content:t,title:r,...n})}edit(e,t,r){return a.put()(this,endpoint`${e}/wikis/${t}`,r)}remove(e,t,r){return a.del()(this,endpoint`${e}/wikis/${t}`,r)}show(e,t,r){return a.get()(this,endpoint`${e}/wikis/${t}`,r)}uploadAttachment(e,t,r){return a.post()(this,endpoint`${e}/wikis/attachments`,{...r,isForm:true,file:[t.content,t.filename]})}};var G=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}add(e,t,r){return a.post()(this,endpoint`${e}/hooks`,{url:t,...r})}all(e,t){return a.get()(this,endpoint`${e}/hooks`,t)}edit(e,t,r,n){return a.put()(this,endpoint`${e}/hooks/${t}`,{url:r,...n})}remove(e,t,r){return a.del()(this,endpoint`${e}/hooks/${t}`,r)}show(e,t,r){return a.get()(this,endpoint`${e}/hooks/${t}`,r)}};var z=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}create(e,t){return a.post()(this,endpoint`${e}/push_rule`,t)}edit(e,t){return a.put()(this,endpoint`${e}/push_rule`,t)}remove(e,t){return a.del()(this,endpoint`${e}/push_rule`,t)}show(e,t){return a.get()(this,endpoint`${e}/push_rule`,t)}};var H=class extends n.BaseResource{resourceType;resourceTypeSingular;constructor(e,t){super(t);this.resourceType=e;this.resourceTypeSingular=e.substring(0,e.length-1)}all(e){const t=e?.[`${this.resourceTypeSingular}Id`];const r=t?endpoint`${this.resourceType}/${t}/repository_storage_moves`:`${this.resourceTypeSingular}_repository_storage_moves`;return a.get()(this,r,e)}show(e,t){const r=t?.[`${this.resourceTypeSingular}Id`];const n=r?endpoint`${this.resourceType}/${r}/repository_storage_moves`:`${this.resourceTypeSingular}_repository_storage_moves`;return a.get()(this,`${n}/${e}`,t)}schedule(e,t){const r=t?.[`${this.resourceTypeSingular}Id`];const n=r?endpoint`${this.resourceType}/${r}/repository_storage_moves`:`${this.resourceTypeSingular}_repository_storage_moves`;return a.post()(this,n,{sourceStorageName:e,...t})}};var K=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}add(e,t,r){if(!r?.email&&!r?.userId)throw new Error("Missing required argument. Please supply a email or a userId in the options parameter.");return a.post()(this,endpoint`${e}/invitations`,{accessLevel:t,...r})}all(e,t){return a.get()(this,endpoint`${e}/invitations`,t)}edit(e,t,r){return a.put()(this,endpoint`${e}/invitations/${t}`,r)}remove(e,t,r){return a.put()(this,endpoint`${e}/invitations/${t}`,r)}};var V=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}all(e,t){return a.get()(this,endpoint`${e}/iterations`,t)}};var Q=class extends n.BaseResource{constructor(e,t){super({prefixUrl:e,...t})}all(e,t){return a.get()(this,`${e}/protected_environments`,t)}create(e,t,r,n){return a.post()(this,`${e}/protected_environments`,{name:t,deployAccessLevel:r,...n})}edit(e,t,r){return a.put()(this,`${e}/protected_environments/${t}`,r)}show(e,t,r){return a.get()(this,`${e}/protected_environments/${t}`,r)}remove(e,t,r){return a.del()(this,`${e}/protected_environments/${t}`,r)}};var J=class extends n.BaseResource{resource2Type;constructor(e,t,r){super({prefixUrl:e,...r});this.resource2Type=t}all(e,t,r){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/resource_iteration_events`,r)}show(e,t,r,n){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/resource_iteration_events/${r}`,n)}};var Y=class extends n.BaseResource{resource2Type;constructor(e,t,r){super({prefixUrl:e,...r});this.resource2Type=t}all(e,t,r){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/resource_label_events`,r)}show(e,t,r,n){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/resource_label_events/${r}`,n)}};var X=class extends n.BaseResource{resource2Type;constructor(e,t,r){super({prefixUrl:e,...r});this.resource2Type=t}all(e,t,r){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/resource_milestone_events`,r)}show(e,t,r,n){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/resource_milestone_events/${r}`,n)}};var Z=class extends n.BaseResource{resource2Type;constructor(e,t,r){super({prefixUrl:e,...r});this.resource2Type=t}all(e,t,r){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/resource_state_events`,r)}show(e,t,r,n){return a.get()(this,endpoint`${e}/${this.resource2Type}/${t}/resource_state_events/${r}`,n)}};var ee=class extends q{constructor(e){super("dockerfiles",e)}};var te=class extends n.BaseResource{all({projectId:e,userId:t,...r}={}){let n;if(e)n=endpoint`projects/${e}/events`;else if(t)n=endpoint`users/${t}/events`;else n="events";return a.get()(this,n,r)}};var re=class extends n.BaseResource{all(e){return a.get()(this,"experiments",e)}};var ne=class extends n.BaseResource{all(e){return a.get()(this,"geo_nodes",e)}allStatuses(e){return a.get()(this,"geo_nodes/statuses",e)}allFailures(e){return a.get()(this,"geo_nodes/current/failures",e)}create(e,t,r){return a.post()(this,"geo_nodes",{name:e,url:t,...r})}edit(e,t){return a.put()(this,`geo_nodes/${e}`,t)}repair(e,t){return a.post()(this,`geo_nodes/${e}/repair`,t)}remove(e,t){return a.del()(this,`geo_nodes/${e}`,t)}show(e,t){return a.get()(this,`geo_nodes/${e}`,t)}showStatus(e,t){return a.get()(this,`geo_nodes/${e}/status`,t)}};var ie=class extends n.BaseResource{all(e){return a.get()(this,"geo_sites",e)}allStatuses(e){return a.get()(this,"geo_sites/statuses",e)}allFailures(e){return a.get()(this,"geo_sites/current/failures",e)}create(e,t,r){return a.post()(this,"geo_sites",{name:e,url:t,...r})}edit(e,t){return a.put()(this,`geo_sites/${e}`,t)}repair(e,t){return a.post()(this,`geo_sites/${e}/repair`,t)}remove(e,t){return a.del()(this,`geo_sites/${e}`,t)}show(e,t){return a.get()(this,`geo_sites/${e}`,t)}showStatus(e,t){return a.get()(this,`geo_sites/${e}/status`,t)}};var se=class extends q{constructor(e){super("gitignores",e)}};var oe=class extends q{constructor(e){super("gitlab_ci_ymls",e)}};var ae=class extends n.BaseResource{importGithubRepository(e,t,r,n){return a.post()(this,"import/github",{personalAccessToken:e,repoId:t,targetNamespace:r,...n})}cancelGithubRepositoryImport(e,t){return a.post()(this,"import/github/cancel",{projectId:e,...t})}importGithubGists(e,t){return a.post()(this,"import/github/gists",{personalAccessToken:e,...t})}importBitbucketServerRepository(e,t,r,n,i,s){return a.post()(this,"import/bitbucket_server",{bitbucketServerUrl:e,bitbucketServerUsername:t,personalAccessToken:r,bitbucketServerProject:n,bitbucketServerRepo:i,...s})}};var ue=class extends n.BaseResource{all(e){return a.get()(this,"admin/ci/variables",e)}create(e,t,r){return a.post()(this,"admin/ci/variables",{key:e,value:t,...r})}edit(e,t,r){return a.put()(this,endpoint`admin/ci/variables/${e}`,{value:t,...r})}show(e,t){return a.get()(this,endpoint`admin/ci/variables/${e}`,t)}remove(e,t){return a.get()(this,endpoint`admin/ci/variables/${e}`,t)}};var ce=class extends n.BaseResource{show({keyId:e,fingerprint:t,...r}={}){let n;if(e)n=`keys/${e}`;else if(t)n=`keys?fingerprint=${t}`;else{throw new Error("Missing required argument. Please supply a fingerprint or a keyId in the options parameter")}return a.get()(this,n,r)}};var le=class extends n.BaseResource{add(e,t){return a.post()(this,"license",{searchParams:{license:e},...t})}all(e){return a.get()(this,"licenses",e)}show(e){return a.get()(this,"license",e)}remove(e,t){return a.del()(this,`license/${e}`,t)}recalculateBillableUsers(e,t){return a.put()(this,`license/${e}/refresh_billable_users`,t)}};var pe=class extends q{constructor(e){super("Licenses",e)}};var fe=class extends n.BaseResource{check(e,t){return a.get()(this,endpoint`projects/${e}/ci/lint`,t)}lint(e,t,r){return a.post()(this,endpoint`projects/${e}/ci/lint`,{...r,content:t})}};var he=class extends n.BaseResource{render(e,t){return a.post()(this,"markdown",{text:e,...t})}};var de=class extends n.BaseResource{downloadPackageFile(e,t,{projectId:r,groupId:n,...i}){let s=endpoint`packages/maven/${e}/${t}`;if(r)s=endpoint`projects/${r}/${s}`;else if(n)s=endpoint`groups/${n}/-/${s}`;return a.get()(this,s,i)}uploadPackageFile(e,t,r,n){return a.put()(this,endpoint`projects/${e}/packages/maven/${t}/${r.filename}`,{isForm:true,...n,file:[r.content,r.filename]})}};var ve=class extends n.BaseResource{show(e){return a.get()(this,"metadata",e)}};var ge=class extends n.BaseResource{all(e){return a.get()(this,"bulk_imports",e)}create(e,t,r){return a.post()(this,"bulk_imports",{configuration:e,entities:t,...r})}allEntities({bulkImportId:e,...t}={}){const r=e?endpoint`bulk_imports/${e}/entities`:"bulk_imports/entities";return a.get()(this,r,t)}show(e,t){return a.get()(this,`bulk_imports/${e}`,t)}showEntity(e,t,r){return a.get()(this,`bulk_imports/${e}/entities/${t}`,r)}};var ye=class extends n.BaseResource{all(e){return a.get()(this,"namespaces",e)}exists(e,t){return a.get()(this,endpoint`namespaces/${e}/exists`,t)}show(e,t){return a.get()(this,endpoint`namespaces/${e}`,t)}};function url6({projectId:e,groupId:t}={}){let r="";if(e)r=endpoint`projects/${e}/`;if(t)r=endpoint`groups/${t}/`;return`${r}notification_settings`}var me=class extends n.BaseResource{edit({groupId:e,projectId:t,...r}={}){const n=url6({groupId:e,projectId:t});return a.put()(this,n,r)}show({groupId:e,projectId:t,...r}={}){const n=url6({groupId:e,projectId:t});return a.get()(this,n,r)}};function url7(e){return e?endpoint`/projects/${e}/packages/npm`:"packages/npm"}var be=class extends n.BaseResource{downloadPackageFile(e,t,r,n){return a.get()(this,endpoint`projects/${e}/packages/npm/${t}/-/${r}`,n)}removeDistTag(e,t,r){const n=url7(r?.projectId);return a.del()(this,`${n}/-/package/${e}/dist-tags/${t}`,r)}setDistTag(e,t,r){const n=url7(r?.projectId);return a.put()(this,`${n}/-/package/${e}/dist-tags/${t}`,r)}showDistTags(e,t){const r=url7(t?.projectId);return a.get()(this,`${r}/-/package/${e}/dist-tags`,t)}showMetadata(e,t){const r=url7(t?.projectId);return a.get()(this,`${r}/${e}`,t)}uploadPackageFile(e,t,r,n,i){return a.put()(this,endpoint`projects/${e}/packages/npm/${t}`,{...i,versions:r,...n})}};function url8({projectId:e,groupId:t}={}){if(e)return endpoint`/projects/${e}/packages/nuget`;if(t)return endpoint`/groups/${t}/-/packages/nuget`;throw new Error("Missing required argument. Please supply a projectId or a groupId in the options parameter")}var _e=class extends n.BaseResource{downloadPackageFile(e,t,r,n,i){return a.get()(this,endpoint`projects/${e}/packages/nuget/download/${t}/${r}/${n}`,i)}search(e,{projectId:t,groupId:r,...n}){const i=url8({projectId:t,groupId:r});return a.get()(this,`${i}/query`,{q:e,...n})}showMetadata(e,{projectId:t,groupId:r,...n}){const i=url8({projectId:t,groupId:r});return a.get()(this,`${i}/metadata/${e}/index`,n)}showPackageIndex(e,t,r){return a.get()(this,endpoint`projects/${e}/packages/nuget/download/${t}/index`,r)}showServiceIndex({projectId:e,groupId:t,...r}){const n=url8({projectId:e,groupId:t});return a.get()(this,`${n}/index`,r)}showVersionMetadata(e,t,{projectId:r,groupId:n,...i}){const s=url8({projectId:r,groupId:n});return a.get()(this,`${s}/metadata/${e}/${t}`,i)}uploadPackageFile(e,t,r,n,i){return a.put()(this,endpoint`projects/${e}/packages/nuget`,{isForm:true,...i,packageName:t,packageVersion:r,file:[n.content,n.filename]})}uploadSymbolPackage(e,t,r,n,i){return a.put()(this,endpoint`projects/${e}/packages/nuget/symbolpackage`,{isForm:true,...i,packageName:t,packageVersion:r,file:[n.content,n.filename]})}};var we=class extends n.BaseResource{all(e){return a.get()(this,"personal_access_tokens",e)}create(e,t,r,n){return a.post()(this,endpoint`users/${e}/personal_access_tokens`,{name:t,scopes:r,...n})}remove({tokenId:e,...t}={}){const r=e?endpoint`personal_access_tokens/${e}`:"personal_access_tokens/self";return a.del()(this,r,t)}rotate(e,t){return a.post()(this,endpoint`personal_access_tokens/${e}/rotate`,t)}show({tokenId:e,...t}={}){const r=e?endpoint`personal_access_tokens/${e}`:"personal_access_tokens/self";return a.get()(this,r,t)}};var Se=class extends n.BaseResource{downloadPackageFile(e,t,{projectId:r,groupId:n,...i}={}){let s;if(r){s=endpoint`projects/${r}/packages/pypi/files/${e}/${t}`}else if(n){s=endpoint`groups/${n}/packages/pypi/files/${e}/${t}`}else{throw new Error("Missing required argument. Please supply a projectId or a groupId in the options parameter")}return a.get()(this,s,i)}showPackageDescriptor(e,{projectId:t,groupId:r,...n}){let i;if(t){i=endpoint`projects/${t}/packages/pypi/simple/${e}`}else if(r){i=endpoint`groups/${r}/packages/pypi/simple/${e}`}else{throw new Error("Missing required argument. Please supply a projectId or a groupId in the options parameter")}return a.get()(this,i,n)}uploadPackageFile(e,t,r){return a.put()(this,endpoint`projects/${e}/packages/pypi`,{...r,isForm:true,file:[t.content,t.filename]})}};var xe=class extends n.BaseResource{allDependencies(e,t){return a.get()(this,endpoint`projects/${e}/packages/rubygems/api/v1/dependencies`,t)}downloadGemFile(e,t,r){return a.get()(this,endpoint`projects/${e}/packages/rubygems/gems/${t}`,r)}uploadGemFile(e,t,r){return a.post()(this,`projects/${e}/packages/rubygems/api/v1/gems`,{isForm:true,...r,file:[t.content,t.filename]})}};var Ae=class extends n.BaseResource{all(e,t,r){const{projectId:n,groupId:i,...s}=r||{};let o;if(n)o=endpoint`projects/${n}/`;else if(i)o=endpoint`groups/${i}/`;else o="";return a.get()(this,`${o}search`,{scope:e,search:t,...s})}};var Ie=class extends n.BaseResource{all(e){return a.get()(this,"admin/search/migrations",e)}show(e,t){return a.get()(this,endpoint`admin/search/migrations/${e}`,t)}};var Ee=class extends n.BaseResource{create(e){return a.post()(this,endpoint`service_accounts`,e)}};var je=class extends n.BaseResource{showMetricDefinitions(e){return a.get()(this,"usage_data/metric_definitions",e)}showServicePingSQLQueries(e){return a.get()(this,"usage_data/queries",e)}showUsageDataNonSQLMetrics(e){return a.get()(this,"usage_data/non_sql_metrics",e)}};var Oe=class extends n.BaseResource{queueMetrics(){return a.get()(this,"sidekiq/queue_metrics")}processMetrics(){return a.get()(this,"sidekiq/process_metrics")}jobStats(){return a.get()(this,"sidekiq/job_stats")}compoundMetrics(){return a.get()(this,"sidekiq/compound_metrics")}};var ke=class extends n.BaseResource{remove(e,t){return a.get()(this,endpoint`admin/sidekiq/queues/${e}`,t)}};var $e=class extends H{constructor(e){super("snippets",e)}};var Ce=class extends n.BaseResource{all({public:e,...t}={}){const r=e?"snippets/public":"snippets";return a.get()(this,r,t)}create(e,t){return a.post()(this,"snippets",{title:e,...t})}edit(e,t){return a.put()(this,`snippets/${e}`,t)}remove(e,t){return a.del()(this,`snippets/${e}`,t)}show(e,t){return a.get()(this,`snippets/${e}`,t)}showContent(e,t){return a.get()(this,`snippets/${e}/raw`,t)}showRepositoryFileContent(e,t,r,n){return a.get()(this,endpoint`snippets/${e}/files/${t}/${r}/raw`,n)}showUserAgentDetails(e,t){return a.get()(this,`snippets/${e}/user_agent_detail`,t)}};var Re=class extends n.BaseResource{edit(e,t){return a.put()(this,`suggestions/${e}/apply`,t)}editBatch(e,t){return a.put()(this,`suggestions/batch_apply`,{...t,ids:e})}};var Pe=class extends n.BaseResource{all(e){return a.get()(this,"hooks",e)}add(e,t){return this.create(e,t)}create(e,t){return a.post()(this,"hooks",{url:e,...t})}test(e,t){return a.post()(this,`hooks/${e}`,t)}remove(e,t){return a.del()(this,`hooks/${e}`,t)}show(e,t){return a.post()(this,`hooks/${e}`,t)}};var Me=class extends n.BaseResource{all(e){return a.get()(this,"todos",e)}done({todoId:e,...t}={}){let r="todos";if(e)r+=`/${e}`;return a.post()(this,`${r}/mark_as_done`,t)}};var Te=class extends n.BaseResource{all(e){return a.get()(this,"topics",e)}create(e,{avatar:t,...r}={}){const n={name:e,...r};if(t){n.isForm=true;n.file=[t.content,t.filename]}return a.post()(this,"topics",n)}edit(e,{avatar:t,...r}={}){const n={...r};if(t){n.isForm=true;n.file=[t.content,t.filename]}return a.put()(this,`topics/${e}`,n)}merge(e,t,r){return a.post()(this,`topics/merge`,{sourceTopicId:e,targetTopicId:t,...r})}remove(e,t){return a.del()(this,`topics/${e}`,t)}show(e,t){return a.get()(this,`topics/${e}`,t)}};var Le=class extends n.BaseResource{all(e,t){return a.get()(this,endpoint`projects/${e}/repository/branches`,t)}create(e,t,r,n){return a.post()(this,endpoint`projects/${e}/repository/branches`,{branch:t,ref:r,...n})}remove(e,t,r){return a.del()(this,endpoint`projects/${e}/repository/branches/${t}`,r)}removeMerged(e,t){return a.del()(this,endpoint`projects/${e}/repository/merged_branches`,t)}show(e,t,r){return a.get()(this,endpoint`projects/${e}/repository/branches/${t}`,r)}};var Fe=class extends M{constructor(e){super("projects","repository/commits",e)}};var Ne=class extends n.BaseResource{all(e,t){return a.get()(this,endpoint`projects/${e}/repository/commits`,t)}allComments(e,t,r){return a.get()(this,endpoint`projects/${e}/repository/commits/${t}/comments`,r)}allDiscussions(e,t,r){return a.get()(this,endpoint`projects/${e}/repository/commits/${t}/discussions`,r)}allMergeRequests(e,t,r){return a.get()(this,endpoint`projects/${e}/repository/commits/${t}/merge_requests`,r)}allReferences(e,t,r){return a.get()(this,endpoint`projects/${e}/repository/commits/${t}/refs`,r)}allStatuses(e,t,r){return a.get()(this,endpoint`projects/${e}/repository/commits/${t}/statuses`,r)}cherryPick(e,t,r,n){return a.post()(this,endpoint`projects/${e}/repository/commits/${t}/cherry_pick`,{branch:r,...n})}create(e,t,r,n=[],i={}){return a.post()(this,endpoint`projects/${e}/repository/commits`,{branch:t,commitMessage:r,actions:n,...i})}createComment(e,t,r,n){return a.post()(this,endpoint`projects/${e}/repository/commits/${t}/comments`,{note:r,...n})}editStatus(e,t,r,n){return a.post()(this,endpoint`projects/${e}/statuses/${t}`,{state:r,...n})}revert(e,t,r,n){return a.post()(this,endpoint`projects/${e}/repository/commits/${t}/revert`,{...n,branch:r})}show(e,t,r){return a.get()(this,endpoint`projects/${e}/repository/commits/${t}`,r)}showDif