{"size": 5253, "ext": "js", "max_stars_repo_path": "dist/controller/package.js", "max_stars_repo_name": "nilppm/npm", "max_stars_repo_stars_event_min_datetime": "2019-07-04T12:12:14.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-11T13:55:25.000Z", "max_issues_repo_path": "dist/controller/package.js", "max_issues_repo_name": "Silin956/npm", "max_issues_repo_issues_event_min_datetime": "2019-08-09T08:52:15.000Z", "max_issues_repo_issues_event_max_datetime": "2019-12-10T03:13:49.000Z", "max_forks_repo_path": "dist/controller/package.js", "max_forks_repo_name": "Silin956/npm", "max_forks_repo_forks_event_min_datetime": "2019-08-30T08:25:37.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-12T03:56:30.000Z"}
{"max_stars_count": 36, "max_issues_count": 2, "max_forks_count": 6, "avg_line_length": 53.6020408163, "max_line_length": 150, "alphanum_fraction": 0.6727584238}
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
const nelts_1 = require("@nelts/nelts");
const Controller = nelts_1.Decorator.Controller;
exports.default = nelts_1.Scope(app => {
    let IndexController = class IndexController extends nelts_1.Component.Controller {
        constructor(app) {
            super(app);
        }
        async getPackageDistTagsWithScope(ctx) {
            const service = new this.service.TagService(ctx);
            ctx.body = await service.getDistTags(ctx.pkg);
        }
        async getPackageDistTagsWithScopeAndPkgname(ctx) {
            const service = new this.service.TagService(ctx);
            ctx.body = await service.getDistTags(ctx.pkg);
        }
        async putPackageDistTagsWithScope(ctx) {
            const service = new this.service.TagService(ctx);
            ctx.body = await service.putDistTags(ctx.pkg, ctx.params.tag, ctx.request.body);
        }
        async putPackageDistTagsWithScopeAndPkgname(ctx) {
            const service = new this.service.TagService(ctx);
            ctx.body = await service.putDistTags(ctx.pkg, ctx.params.tag, ctx.request.body);
        }
        async deletePackageDistTagsWithScope(ctx) {
            const service = new this.service.TagService(ctx);
            ctx.body = await service.deleteDistTags(ctx.pkg, ctx.params.tag);
        }
        async deletePackageDistTagsWithScopeAndPkgname(ctx) {
            const service = new this.service.PackageService(ctx);
            ctx.body = await service.unPublish(ctx.pkg.pathname, ctx.params.tag, ctx.account);
        }
    };
    __decorate([
        Controller.Get('/@:scope/dist-tags'),
        Controller.Request.Static.Filter(app.middleware.decodePackageWithScope),
        __metadata("design:type", Function),
        __metadata("design:paramtypes", [Object]),
        __metadata("design:returntype", Promise)
    ], IndexController.prototype, "getPackageDistTagsWithScope", null);
    __decorate([
        Controller.Get('/@:scope/:pkgname/dist-tags'),
        Controller.Request.Static.Filter(app.middleware.decodePackageWithScopeAndPkgname),
        __metadata("design:type", Function),
        __metadata("design:paramtypes", [Object]),
        __metadata("design:returntype", Promise)
    ], IndexController.prototype, "getPackageDistTagsWithScopeAndPkgname", null);
    __decorate([
        Controller.Put('/@:scope/dist-tags/:tag'),
        Controller.Request.Static.Filter(app.middleware.decodePackageWithScope),
        Controller.Request.Dynamic.Loader(nelts_1.Extra.Body({ istext: true })),
        Controller.Middleware(app.middleware.UserLoginMiddleware),
        __metadata("design:type", Function),
        __metadata("design:paramtypes", [Object]),
        __metadata("design:returntype", Promise)
    ], IndexController.prototype, "putPackageDistTagsWithScope", null);
    __decorate([
        Controller.Put('/@:scope/:pkgname/dist-tags/:tag'),
        Controller.Request.Static.Filter(app.middleware.decodePackageWithScopeAndPkgname),
        Controller.Request.Dynamic.Loader(nelts_1.Extra.Body({ istext: true })),
        Controller.Middleware(app.middleware.UserLoginMiddleware),
        __metadata("design:type", Function),
        __metadata("design:paramtypes", [Object]),
        __metadata("design:returntype", Promise)
    ], IndexController.prototype, "putPackageDistTagsWithScopeAndPkgname", null);
    __decorate([
        Controller.Delete('/@:scope/dist-tags/:tag'),
        Controller.Request.Static.Filter(app.middleware.decodePackageWithScope),
        Controller.Middleware(app.middleware.UserLoginMiddleware),
        __metadata("design:type", Function),
        __metadata("design:paramtypes", [Object]),
        __metadata("design:returntype", Promise)
    ], IndexController.prototype, "deletePackageDistTagsWithScope", null);
    __decorate([
        Controller.Delete('/@:scope/:pkgname/dist-tags/:tag'),
        Controller.Request.Static.Filter(app.middleware.decodePackageWithScopeAndPkgname),
        Controller.Middleware(app.middleware.UserLoginMiddleware),
        __metadata("design:type", Function),
        __metadata("design:paramtypes", [Object]),
        __metadata("design:returntype", Promise)
    ], IndexController.prototype, "deletePackageDistTagsWithScopeAndPkgname", null);
    IndexController = __decorate([
        Controller.Prefix('/-/package'),
        __metadata("design:paramtypes", [Object])
    ], IndexController);
    return IndexController;
});
