@atomist/rug
Advanced tools
Comparing version 1.0.0-m.5 to 1.0.0-m.6
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -10,3 +11,2 @@ * Module containing Scala types. | ||
*/ | ||
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
@@ -13,0 +13,0 @@ var extendStatics = Object.setPrototypeOf || |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright 2015-2017 Atomist Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -25,7 +25,10 @@ "use strict"; | ||
function get_metadata(obj, key) { | ||
if (obj == null) { | ||
return null; | ||
} | ||
var desc = Object.getOwnPropertyDescriptor(obj, key); | ||
if ((desc == null || desc === undefined) && (obj.prototype !== undefined)) { | ||
desc = Object.getOwnPropertyDescriptor(obj.prototype, key); | ||
if ((desc == null || desc === undefined) && (Object.getPrototypeOf(obj) !== undefined)) { | ||
desc = get_metadata(Object.getPrototypeOf(obj), key); | ||
} | ||
if (desc != null || desc !== undefined) { | ||
if (desc != null && desc !== undefined) { | ||
return desc.value; | ||
@@ -49,2 +52,11 @@ } | ||
} | ||
else { | ||
// remove any that have the same name already (i.e. if folk are calling declareParameter) | ||
// use a cheeky method so that we can reuse the same array | ||
var found = params.filter(function (p) { return p.name === propertyKey; }); | ||
if (found != null && found.length > 0) { | ||
var index = params.indexOf(found[0]); | ||
params.splice(index, 1); | ||
} | ||
} | ||
var copy = __assign({}, details); | ||
@@ -54,2 +66,12 @@ copy.name = propertyKey; | ||
params.push(copy); | ||
// merge parameters from parent if it has some | ||
var protoParams = get_metadata(Object.getPrototypeOf(target), "__parameters"); | ||
if (protoParams != null) { | ||
protoParams.forEach(function (protoParam) { | ||
// if we don't already have a parameter with the same name | ||
if (!params.some(function (param) { return param.name === protoParam.name; })) { | ||
params.push(protoParam); | ||
} | ||
}); | ||
} | ||
set_metadata(target, "__parameters", params); | ||
@@ -73,4 +95,23 @@ return target; | ||
} | ||
else { | ||
// remove any that have the same name already (i.e. if folk are calling declareParameter) | ||
// use a cheeky method so that we can reuse the same array | ||
var found = params.filter(function (p) { return p.localKey === localKey; }); | ||
if (found != null && found.length > 0) { | ||
var index = params.indexOf(found[0]); | ||
params.splice(index, 1); | ||
} | ||
} | ||
var param = { localKey: localKey, foreignKey: foreignKey }; | ||
params.push(param); | ||
// merge parameters from parent if it has some | ||
var protoParams = get_metadata(Object.getPrototypeOf(target), "__mappedParameters"); | ||
if (protoParams != null) { | ||
protoParams.forEach(function (protoParam) { | ||
// if we don't already have a parameter with the same name | ||
if (!params.some(function (p) { return p.localKey === protoParam.localKey; })) { | ||
params.push(protoParam); | ||
} | ||
}); | ||
} | ||
set_metadata(target, "__mappedParameters", params); | ||
@@ -77,0 +118,0 @@ return target; |
@@ -20,7 +20,10 @@ import { PathExpression } from "../tree/PathExpression"; | ||
function get_metadata(obj: any, key: string) { | ||
if (obj == null) { | ||
return null; | ||
} | ||
let desc = Object.getOwnPropertyDescriptor(obj, key); | ||
if ((desc == null || desc === undefined) && (obj.prototype !== undefined)) { | ||
desc = Object.getOwnPropertyDescriptor(obj.prototype, key); | ||
if ((desc == null || desc === undefined) && (Object.getPrototypeOf(obj) !== undefined)) { | ||
desc = get_metadata(Object.getPrototypeOf(obj), key); | ||
} | ||
if (desc != null || desc !== undefined) { | ||
if (desc != null && desc !== undefined) { | ||
return desc.value; | ||
@@ -41,5 +44,13 @@ } | ||
export function declareParameter(target: any, propertyKey: string, details: BaseParameter) { | ||
let params = get_metadata(target, "__parameters"); | ||
let params: any[] = get_metadata(target, "__parameters"); | ||
if (params == null) { | ||
params = []; | ||
} else { | ||
// remove any that have the same name already (i.e. if folk are calling declareParameter) | ||
// use a cheeky method so that we can reuse the same array | ||
const found: any[] = params.filter((p) => p.name === propertyKey); | ||
if (found != null && found.length > 0) { | ||
const index = params.indexOf(found[0]); | ||
params.splice(index, 1); | ||
} | ||
} | ||
@@ -50,2 +61,14 @@ const copy: any = { ...details }; | ||
params.push(copy); | ||
// merge parameters from parent if it has some | ||
const protoParams: any[] = get_metadata(Object.getPrototypeOf(target), "__parameters"); | ||
if (protoParams != null) { | ||
protoParams.forEach((protoParam) => { | ||
// if we don't already have a parameter with the same name | ||
if (!params.some((param) => param.name === protoParam.name)) { | ||
params.push(protoParam); | ||
} | ||
}); | ||
} | ||
set_metadata(target, "__parameters", params); | ||
@@ -67,5 +90,25 @@ return target; | ||
params = []; | ||
} else { | ||
// remove any that have the same name already (i.e. if folk are calling declareParameter) | ||
// use a cheeky method so that we can reuse the same array | ||
const found: any[] = params.filter((p) => p.localKey === localKey); | ||
if (found != null && found.length > 0) { | ||
const index = params.indexOf(found[0]); | ||
params.splice(index, 1); | ||
} | ||
} | ||
const param = { localKey, foreignKey }; | ||
params.push(param); | ||
// merge parameters from parent if it has some | ||
const protoParams: any[] = get_metadata(Object.getPrototypeOf(target), "__mappedParameters"); | ||
if (protoParams != null) { | ||
protoParams.forEach((protoParam) => { | ||
// if we don't already have a parameter with the same name | ||
if (!params.some((p) => p.localKey === protoParam.localKey)) { | ||
params.push(protoParam); | ||
} | ||
}); | ||
} | ||
set_metadata(target, "__mappedParameters", params); | ||
@@ -72,0 +115,0 @@ return target; |
@@ -126,6 +126,6 @@ "use strict"; | ||
} | ||
MessageMimeTypes.SLACK_JSON = "application/x-atomist-slack+json"; | ||
MessageMimeTypes.PLAIN_TEXT = "text/plain"; | ||
return MessageMimeTypes; | ||
}()); | ||
MessageMimeTypes.SLACK_JSON = "application/x-atomist-slack+json"; | ||
MessageMimeTypes.PLAIN_TEXT = "text/plain"; | ||
exports.MessageMimeTypes = MessageMimeTypes; | ||
@@ -154,2 +154,3 @@ var LocallyRenderedMessage = (function () { | ||
}()); | ||
exports.LocallyRenderedMessage = LocallyRenderedMessage; | ||
/** | ||
@@ -211,3 +212,2 @@ * Represents the response to the bot from a command | ||
var _this = _super.call(this, body, address, contentType) || this; | ||
_this.timestamp = new Date().getTime().toString(); | ||
_this.id = id; | ||
@@ -239,15 +239,18 @@ return _this; | ||
} | ||
MappedParameters.CORRELATION_ID = "atomist://correlation_id"; | ||
// GITHUB_REPO_OWNER is deprecated; instead use GITHUB_OWNER | ||
MappedParameters.GITHUB_REPO_OWNER = "atomist://github/repository/owner"; | ||
MappedParameters.GITHUB_OWNER = "atomist://github/repository/owner"; | ||
MappedParameters.GITHUB_REPOSITORY = "atomist://github/repository"; | ||
MappedParameters.GITHUB_WEBHOOK_URL = "atomist://github_webhook_url"; | ||
MappedParameters.GITHUB_URL = "atomist://github_url"; | ||
MappedParameters.GITHUB_API_URL = "atomist://github_api_url"; | ||
MappedParameters.GITHUB_DEFAULT_REPO_VISIBILITY = "atomist://github/default_repo_visibility"; | ||
MappedParameters.SLACK_CHANNEL = "atomist://slack/channel"; | ||
MappedParameters.SLACK_CHANNEL_NAME = "atomist://slack/channel_name"; | ||
MappedParameters.SLACK_TEAM = "atomist://slack/team"; | ||
MappedParameters.SLACK_USER = "atomist://slack/user"; | ||
MappedParameters.SLACK_USER_NAME = "atomist://slack/user_name"; | ||
return MappedParameters; | ||
}()); | ||
// GITHUB_REPO_OWNER is deprecated; instead use GITHUB_OWNER | ||
MappedParameters.GITHUB_REPO_OWNER = "atomist://github/repository/owner"; | ||
MappedParameters.GITHUB_OWNER = "atomist://github/repository/owner"; | ||
MappedParameters.GITHUB_REPOSITORY = "atomist://github/repository"; | ||
MappedParameters.GITHUB_WEBHOOK_URL = "atomist://github_webhook_url"; | ||
MappedParameters.GITHUB_API_URL = "atomist://github_api_url"; | ||
MappedParameters.SLACK_CHANNEL = "atomist://slack/channel"; | ||
MappedParameters.SLACK_CHANNEL_NAME = "atomist://slack/channel_name"; | ||
MappedParameters.SLACK_TEAM = "atomist://slack/team"; | ||
MappedParameters.SLACK_USER = "atomist://slack/user"; | ||
MappedParameters.SLACK_USER_NAME = "atomist://slack/user_name"; | ||
exports.MappedParameters = MappedParameters; |
import { | ||
GraphNode, | ||
Match, | ||
PathExpression, | ||
PathExpressionEngine, | ||
TreeNode, | ||
GraphNode, | ||
Match, | ||
PathExpression, | ||
PathExpressionEngine, | ||
TreeNode, | ||
} from "../tree/PathExpression"; | ||
import { GitProjectLoader } from "./GitProjectLoader"; | ||
import { Parameter } from "./RugOperation"; | ||
import { GitProjectLoader } from "./GitProjectLoader"; | ||
export interface RugCoordinate { | ||
readonly name: string; | ||
readonly group: string; | ||
readonly artifact: string; | ||
readonly name: string; | ||
readonly group: string; | ||
readonly artifact: string; | ||
} | ||
@@ -20,28 +20,29 @@ | ||
export interface Instruction<T extends InstructionKind> { | ||
readonly name: string | RugCoordinate; | ||
readonly parameters?: {}; | ||
readonly kind: T; | ||
readonly name: string | RugCoordinate; | ||
readonly parameters?: {}; | ||
readonly kind: T; | ||
} | ||
export class EventRespondable<T extends Edit | Generate | Execute> { | ||
public instruction: T; | ||
public onSuccess?: EventPlan | EventMessage | Respond; | ||
public onError?: EventPlan | EventMessage | Respond; | ||
public instruction: T; | ||
public onSuccess?: EventPlan | EventMessage | Respond; | ||
public onError?: EventPlan | EventMessage | Respond; | ||
} | ||
export class CommandRespondable<T extends Edit | Generate | Execute | Command> { | ||
public instruction: T; | ||
public onSuccess?: CommandPlan | CommandMessage | Respond; | ||
public onError?: CommandPlan | CommandMessage | Respond; | ||
public instruction: T; | ||
public onSuccess?: CommandPlan | CommandMessage | Respond; | ||
public onError?: CommandPlan | CommandMessage | Respond; | ||
} | ||
export class Presentable<T extends InstructionKind> { | ||
public instruction: Instruction<T> | PresentableGenerate | PresentableEdit; | ||
public label?: string; | ||
public id?: string; | ||
public instruction: Instruction<T> | PresentableGenerate | PresentableEdit; | ||
public label?: string; | ||
public id?: string; | ||
} | ||
export class Identifiable<T extends InstructionKind> { | ||
public instruction: Instruction<T> | PresentableGenerate | PresentableEdit; | ||
public id?: string; | ||
public instruction: Instruction<T> | PresentableGenerate | PresentableEdit; | ||
public parameterName?: string; | ||
public id?: string; | ||
} | ||
@@ -55,3 +56,3 @@ | ||
export interface ProjectInstruction<T extends InstructionKind> extends Instruction<T> { | ||
project: string | ProjectReference; | ||
project: string | ProjectReference; | ||
} | ||
@@ -64,4 +65,4 @@ | ||
export interface EditorTarget<T extends EditorTargetKind> { | ||
kind: T; | ||
baseBranch: string; | ||
kind: T; | ||
baseBranch: string; | ||
} | ||
@@ -73,7 +74,7 @@ | ||
export class GitHubPullRequest implements EditorTarget<"github-pull-request"> { | ||
public kind: "github-pull-request" = "github-pull-request"; | ||
public title?: string; // title of the PR | ||
public body?: string; // body of the PR (defaults to editor changelog) | ||
public headBranch?: string; // name of PR source branch (default auto-generated) | ||
constructor(public baseBranch: string = "master") { } | ||
public kind: "github-pull-request" = "github-pull-request"; | ||
public title?: string; // title of the PR | ||
public body?: string; // body of the PR (defaults to editor changelog) | ||
public headBranch?: string; // name of PR source branch (default auto-generated) | ||
constructor(public baseBranch: string = "master") { } | ||
} | ||
@@ -85,9 +86,9 @@ | ||
export class GitHubBranch implements EditorTarget<"github-branch"> { | ||
public kind: "github-branch" = "github-branch"; | ||
constructor(public baseBranch: string = "master", public headBranch?: string) { } | ||
public kind: "github-branch" = "github-branch"; | ||
constructor(public baseBranch: string = "master", public headBranch?: string) { } | ||
} | ||
// tslint:disable-next-line:no-empty-interface | ||
export interface Edit extends ProjectInstruction<"edit"> { | ||
target?: EditorTarget<EditorTargetKind>; | ||
commitMessage?: string; | ||
target?: EditorTarget<EditorTargetKind>; | ||
commitMessage?: string; | ||
} | ||
@@ -101,3 +102,3 @@ | ||
export interface PresentableGenerate extends Instruction<"generate"> { | ||
project?: string | ProjectReference; | ||
project?: string | ProjectReference; | ||
} | ||
@@ -107,3 +108,3 @@ | ||
export interface PresentableEdit extends Instruction<"edit"> { | ||
project?: string | ProjectReference; | ||
project?: string | ProjectReference; | ||
} | ||
@@ -119,11 +120,11 @@ | ||
export interface HandleCommand { | ||
handle(ctx: HandlerContext): CommandPlan; | ||
handle(ctx: HandlerContext): CommandPlan; | ||
} | ||
export interface HandleEvent<R extends GraphNode, M extends GraphNode> { | ||
handle(root: Match<R, M>): EventPlan; | ||
handle(root: Match<R, M>): EventPlan; | ||
} | ||
export interface HandleResponse<T> { | ||
handle(response: Response<T>, ctx?: HandlerContext): EventPlan | CommandPlan; | ||
handle(response: Response<T>, ctx?: HandlerContext): EventPlan | CommandPlan; | ||
} | ||
@@ -138,19 +139,19 @@ | ||
/** | ||
* Id of the team we're working on behalf of | ||
*/ | ||
teamId: string; | ||
/** | ||
* Id of the team we're working on behalf of | ||
*/ | ||
teamId: string; | ||
pathExpressionEngine: PathExpressionEngine; | ||
pathExpressionEngine: PathExpressionEngine; | ||
/** | ||
* The root of this team's context. Allows execution | ||
* of path expressions. | ||
*/ | ||
contextRoot: GraphNode; | ||
/** | ||
* The root of this team's context. Allows execution | ||
* of path expressions. | ||
*/ | ||
contextRoot: GraphNode; | ||
/** | ||
* RepoResolver to use in loading repositories. | ||
*/ | ||
gitProjectLoader: GitProjectLoader; | ||
/** | ||
* RepoResolver to use in loading repositories. | ||
*/ | ||
gitProjectLoader: GitProjectLoader; | ||
@@ -160,11 +161,11 @@ } | ||
export enum Status { | ||
failure, | ||
success, | ||
failure, | ||
success, | ||
} | ||
export interface Response<T> { | ||
msg: string; | ||
code: number; | ||
status: Status; | ||
body: T; | ||
msg: string; | ||
code: number; | ||
status: Status; | ||
body: T; | ||
} | ||
@@ -181,14 +182,14 @@ | ||
public instructions: Respondable[] = []; | ||
public instructions: Respondable[] = []; | ||
public messages: PlanMessage[] = []; | ||
public messages: PlanMessage[] = []; | ||
public add?(thing: Respondable | PlanMessage): this { | ||
if (thing instanceof ResponseMessage || thing instanceof DirectedMessage || thing instanceof LifecycleMessage) { | ||
this.messages.push(thing); | ||
} else { | ||
this.instructions.push(thing); | ||
public add?(thing: Respondable | PlanMessage): this { | ||
if (thing instanceof ResponseMessage || thing instanceof DirectedMessage || thing instanceof LifecycleMessage) { | ||
this.messages.push(thing); | ||
} else { | ||
this.instructions.push(thing); | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
} | ||
@@ -205,9 +206,9 @@ | ||
public static ofMessage(m: EventMessage): EventPlan { | ||
return new EventPlan().add(m); | ||
} | ||
public static ofMessage(m: EventMessage): EventPlan { | ||
return new EventPlan().add(m); | ||
} | ||
public add?(msg: EventMessage | EventRespondable<any>): this { | ||
return super.add(msg); | ||
} | ||
public add?(msg: EventMessage | EventRespondable<any>): this { | ||
return super.add(msg); | ||
} | ||
} | ||
@@ -220,9 +221,9 @@ | ||
public static ofMessage(m: CommandMessage): CommandPlan { | ||
return new CommandPlan().add(m); | ||
} | ||
public static ofMessage(m: CommandMessage): CommandPlan { | ||
return new CommandPlan().add(m); | ||
} | ||
public add?(msg: CommandMessage | CommandRespondable<any>): this { | ||
return super.add(msg); | ||
} | ||
public add?(msg: CommandMessage | CommandRespondable<any>): this { | ||
return super.add(msg); | ||
} | ||
} | ||
@@ -233,4 +234,4 @@ | ||
export abstract class MessageMimeTypes { | ||
public static SLACK_JSON: MessageMimeType = "application/x-atomist-slack+json"; | ||
public static PLAIN_TEXT: MessageMimeType = "text/plain"; | ||
public static SLACK_JSON: MessageMimeType = "application/x-atomist-slack+json"; | ||
public static PLAIN_TEXT: MessageMimeType = "text/plain"; | ||
} | ||
@@ -241,28 +242,28 @@ | ||
interface Message<T extends MessageKind> { | ||
kind: T; | ||
kind: T; | ||
} | ||
abstract class LocallyRenderedMessage<T extends MessageKind> implements Message<T> { | ||
public kind: T; | ||
export abstract class LocallyRenderedMessage<T extends MessageKind> implements Message<T> { | ||
public kind: T; | ||
public usernames?: string[] = []; | ||
public channelNames?: string[] = []; | ||
public usernames?: string[] = []; | ||
public channelNames?: string[] = []; | ||
public contentType: MessageMimeType = MessageMimeTypes.PLAIN_TEXT; | ||
public body: string; | ||
public instructions?: Array<Identifiable<any>> = []; | ||
public contentType: MessageMimeType = MessageMimeTypes.PLAIN_TEXT; | ||
public body: string; | ||
public instructions?: Array<Identifiable<any>> = []; | ||
public addAddress?(address: MessageAddress): this { | ||
if (address instanceof UserAddress) { | ||
this.usernames.push(address.username); | ||
} else { | ||
this.channelNames.push(address.channelName); | ||
public addAddress?(address: MessageAddress): this { | ||
if (address instanceof UserAddress) { | ||
this.usernames.push(address.username); | ||
} else { | ||
this.channelNames.push(address.channelName); | ||
} | ||
return this; | ||
} | ||
return this; | ||
} | ||
public addAction?(instruction: Identifiable<any>): this { | ||
this.instructions.push(instruction); | ||
return this; | ||
} | ||
public addAction?(instruction: Identifiable<any>): this { | ||
this.instructions.push(instruction); | ||
return this; | ||
} | ||
} | ||
@@ -274,19 +275,19 @@ | ||
export class ResponseMessage extends LocallyRenderedMessage<"response"> { | ||
public kind: "response" = "response"; | ||
public kind: "response" = "response"; | ||
constructor(body: string, contentType?: MessageMimeType) { | ||
super(); | ||
this.body = body; | ||
if (contentType) { | ||
this.contentType = contentType; | ||
constructor(body: string, contentType?: MessageMimeType) { | ||
super(); | ||
this.body = body; | ||
if (contentType) { | ||
this.contentType = contentType; | ||
} | ||
} | ||
} | ||
} | ||
export class UserAddress { | ||
constructor(public username: string) { } | ||
constructor(public username: string) { } | ||
} | ||
export class ChannelAddress { | ||
constructor(public channelName: string) { } | ||
constructor(public channelName: string) { } | ||
} | ||
@@ -301,12 +302,12 @@ | ||
public kind: "directed" = "directed"; | ||
public kind: "directed" = "directed"; | ||
constructor(body: string, address: MessageAddress, contentType?: MessageMimeType) { | ||
super(); | ||
this.body = body; | ||
if (contentType) { | ||
this.contentType = contentType; | ||
constructor(body: string, address: MessageAddress, contentType?: MessageMimeType) { | ||
super(); | ||
this.body = body; | ||
if (contentType) { | ||
this.contentType = contentType; | ||
} | ||
this.addAddress(address); | ||
} | ||
this.addAddress(address); | ||
} | ||
} | ||
@@ -319,11 +320,13 @@ | ||
public id: string; | ||
public timestamp: string = new Date().getTime().toString(); | ||
// Time after which the message will get re-posted instead of re-written | ||
public ttl?: string; | ||
public id: string; | ||
public timestamp: string; | ||
// Time after which the message will get re-posted instead of re-written | ||
public ttl?: string; | ||
// If message with id doesn't exist update_only wouldn't create it | ||
public post?: "always" | "update_only"; | ||
constructor(id: string, body: string, address: MessageAddress, contentType?: MessageMimeType) { | ||
super(body, address, contentType); | ||
this.id = id; | ||
} | ||
constructor(id: string, body: string, address: MessageAddress, contentType?: MessageMimeType) { | ||
super(body, address, contentType); | ||
this.id = id; | ||
} | ||
} | ||
@@ -336,16 +339,16 @@ | ||
public kind: "lifecycle" = "lifecycle"; | ||
public node: GraphNode; | ||
public instructions?: Array<Presentable<any>> = []; | ||
public lifecycleId: string; | ||
public kind: "lifecycle" = "lifecycle"; | ||
public node: GraphNode; | ||
public instructions?: Array<Presentable<any>> = []; | ||
public lifecycleId: string; | ||
constructor(node: GraphNode, lifecycleId: string) { | ||
this.node = node; | ||
this.lifecycleId = lifecycleId; | ||
} | ||
constructor(node: GraphNode, lifecycleId: string) { | ||
this.node = node; | ||
this.lifecycleId = lifecycleId; | ||
} | ||
public addAction?(instruction: Presentable<any>): this { | ||
this.instructions.push(instruction); | ||
return this; | ||
} | ||
public addAction?(instruction: Presentable<any>): this { | ||
this.instructions.push(instruction); | ||
return this; | ||
} | ||
} | ||
@@ -356,14 +359,18 @@ | ||
export abstract class MappedParameters { | ||
// GITHUB_REPO_OWNER is deprecated; instead use GITHUB_OWNER | ||
public static readonly GITHUB_REPO_OWNER: string = "atomist://github/repository/owner"; | ||
public static readonly GITHUB_OWNER: string = "atomist://github/repository/owner"; | ||
public static readonly GITHUB_REPOSITORY: string = "atomist://github/repository"; | ||
public static readonly GITHUB_WEBHOOK_URL: string = "atomist://github_webhook_url"; | ||
public static readonly GITHUB_API_URL: string = "atomist://github_api_url"; | ||
public static readonly SLACK_CHANNEL: string = "atomist://slack/channel"; | ||
public static readonly SLACK_CHANNEL_NAME: string = "atomist://slack/channel_name"; | ||
public static readonly SLACK_TEAM: string = "atomist://slack/team"; | ||
public static readonly SLACK_USER: string = "atomist://slack/user"; | ||
public static readonly SLACK_USER_NAME: string = "atomist://slack/user_name"; | ||
public static readonly CORRELATION_ID: string = "atomist://correlation_id"; | ||
// GITHUB_REPO_OWNER is deprecated; instead use GITHUB_OWNER | ||
public static readonly GITHUB_REPO_OWNER: string = "atomist://github/repository/owner"; | ||
public static readonly GITHUB_OWNER: string = "atomist://github/repository/owner"; | ||
public static readonly GITHUB_REPOSITORY: string = "atomist://github/repository"; | ||
public static readonly GITHUB_WEBHOOK_URL: string = "atomist://github_webhook_url"; | ||
public static readonly GITHUB_URL: string = "atomist://github_url"; | ||
public static readonly GITHUB_API_URL: string = "atomist://github_api_url"; | ||
public static readonly GITHUB_DEFAULT_REPO_VISIBILITY: string = "atomist://github/default_repo_visibility"; | ||
public static readonly SLACK_CHANNEL: string = "atomist://slack/channel"; | ||
public static readonly SLACK_CHANNEL_NAME: string = "atomist://slack/channel_name"; | ||
public static readonly SLACK_TEAM: string = "atomist://slack/team"; | ||
public static readonly SLACK_USER: string = "atomist://slack/user"; | ||
public static readonly SLACK_USER_NAME: string = "atomist://slack/user_name"; | ||
} |
@@ -9,29 +9,29 @@ "use strict"; | ||
} | ||
Pattern.url = "@url"; | ||
Pattern.any = "@any"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.group_id = "@group_id"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.artifact_id = "@artifact_id"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.java_class = "@java_class"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.java_identifier = "@java_identifier"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.java_package = "@java_package"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.project_name = "@project_name"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.port = "@port"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.ruby_class = "@ruby_class"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.ruby_identifier = "@ruby_identifier"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.semantic_version = "@semantic_version"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.version_range = "@version_range"; | ||
Pattern.uuid = "@uuid"; | ||
return Pattern; | ||
}()); | ||
Pattern.url = "@url"; | ||
Pattern.any = "@any"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.group_id = "@group_id"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.artifact_id = "@artifact_id"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.java_class = "@java_class"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.java_identifier = "@java_identifier"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.java_package = "@java_package"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.project_name = "@project_name"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.port = "@port"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.ruby_class = "@ruby_class"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.ruby_identifier = "@ruby_identifier"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.semantic_version = "@semantic_version"; | ||
// tslint:disable-next-line:variable-name | ||
Pattern.version_range = "@version_range"; | ||
Pattern.uuid = "@uuid"; | ||
exports.Pattern = Pattern; | ||
@@ -38,0 +38,0 @@ /** |
{ | ||
"name": "@atomist/rug", | ||
"version": "1.0.0-m.5", | ||
"version": "1.0.0-m.6", | ||
"description": "TypeScript model for Atomist Rugs, see http://docs.atomist.com/", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright © 2017 Atomist, Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -19,0 +19,0 @@ require("./WellKnownSteps"); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright © 2017 Atomist, Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -19,0 +19,0 @@ var Core_1 = require("./Core"); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright © 2017 Atomist, Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -19,0 +19,0 @@ require("./WellKnownSteps"); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright © 2017 Atomist, Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -19,0 +19,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright © 2017 Atomist, Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -19,0 +19,0 @@ var Core_1 = require("./Core"); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright © 2017 Atomist, Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -30,5 +30,5 @@ /** | ||
}; | ||
Result.Success = new Result(true, "OK"); | ||
return Result; | ||
}()); | ||
Result.Success = new Result(true, "OK"); | ||
exports.Result = Result; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/* | ||
@@ -16,3 +17,2 @@ * Copyright © 2017 Atomist, Inc. | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -19,0 +19,0 @@ /** |
import { DynamicType, GraphNode, Match, PathExpression, PathExpressionEngine, TreeNode } from "./PathExpression"; | ||
import { DynamicType, GraphNode, Match, PathExpression, PathExpressionEngine } from "./PathExpression"; | ||
@@ -11,3 +11,3 @@ /** | ||
constructor(protected delegate: PathExpressionEngine, | ||
private nodeTransform: (TreeNode) => TreeNode) { } | ||
private nodeTransform: (GraphNode) => GraphNode) { } | ||
@@ -21,3 +21,3 @@ public addType(dt: DynamicType): this { | ||
// because they're in Scala | ||
public evaluate<R extends TreeNode, N extends TreeNode>(root: R, expr: PathExpression<R, N> | string): Match<R, N> { | ||
public evaluate<R extends GraphNode, N extends GraphNode>(root: R, expr: PathExpression<R, N> | string): Match<R, N> { | ||
const m1 = this.delegate.evaluate(root, expr); | ||
@@ -35,4 +35,4 @@ const m2 = { | ||
public with<N extends TreeNode>(root: TreeNode, expr: PathExpression<GraphNode, N> | string, | ||
f: (n: N) => void): void { | ||
public with<N extends GraphNode>(root: GraphNode, expr: PathExpression<GraphNode, N> | string, | ||
f: (n: N) => void): void { | ||
this.delegate.with(root, expr, (n) => { | ||
@@ -44,7 +44,7 @@ const transformed = this.nodeTransform(n); | ||
public scalar<R extends TreeNode, N extends TreeNode>(root: R, expr: PathExpression<R, N> | string): N { | ||
public scalar<R extends GraphNode, N extends GraphNode>(root: R, expr: PathExpression<R, N> | string): N { | ||
return this.nodeTransform(this.delegate.scalar<R, N>(root, expr)) as N; | ||
} | ||
public as<N extends TreeNode>(root, name: string): N { | ||
public as<N extends GraphNode>(root, name: string): N { | ||
return this.nodeTransform(this.delegate.as<N>(root, name)) as N; | ||
@@ -54,3 +54,3 @@ } | ||
// Find the children of the current node of this time | ||
public children<N extends TreeNode>(root, name: string): N[] { | ||
public children<N extends GraphNode>(root, name: string): N[] { | ||
return this.delegate.children<N>(root, name) | ||
@@ -63,6 +63,6 @@ .map((n) => this.nodeTransform(n) as N); | ||
// ------------------------------------------------------------- | ||
public withExpression<N extends TreeNode>(root: TreeNode, pe: PathExpression<any, N>, | ||
f: (n: N) => void): void { | ||
public withExpression<N extends GraphNode>(root: GraphNode, pe: PathExpression<any, N>, | ||
f: (n: N) => void): void { | ||
this.with(root, pe.expression, f); | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
/** | ||
@@ -5,3 +6,2 @@ * Helper functions for working with TreeNodes in simple | ||
*/ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -8,0 +8,0 @@ function hasTag(n, t) { |
320968
8070