UNPKG

@atomist/automation-client

Version:
45 lines 2.15 kB
"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 decorators_1 = require("../../../decorators"); const GitHubRepoRef_1 = require("../GitHubRepoRef"); const TargetsParams_1 = require("./TargetsParams"); /** * Base parameters for working with GitHub repo(s). * Allows use of regex. */ let GitHubTargetsParams = class GitHubTargetsParams extends TargetsParams_1.TargetsParams { get credentials() { return { token: this.githubToken }; } /** * Return a single RepoRef or undefined if we're not identifying a single repo * @return {RepoRef} */ get repoRef() { return (!!this.owner && !!this.repo && !this.usesRegex) ? new GitHubRepoRef_1.GitHubRepoRef(this.owner, this.repo, this.sha, this.apiUrl) : undefined; } }; __decorate([ decorators_1.MappedParameter(decorators_1.MappedParameters.GitHubApiUrl, false), __metadata("design:type", String) ], GitHubTargetsParams.prototype, "apiUrl", void 0); __decorate([ decorators_1.Secret(decorators_1.Secrets.userToken(["repo", "user:email", "read:user"])), __metadata("design:type", String) ], GitHubTargetsParams.prototype, "githubToken", void 0); GitHubTargetsParams = __decorate([ decorators_1.Parameters() ], GitHubTargetsParams); exports.GitHubTargetsParams = GitHubTargetsParams; //# sourceMappingURL=GitHubTargetsParams.js.map