trello-for-wolves
Version:
Node.js wrapper for Trello API...for wolves.
64 lines (63 loc) • 2.55 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Comment = void 0;
var BaseResource_1 = require("./BaseResource");
/**
* Comments are Action records with a "type" of "commentCard". They are the
* only type of action that can be added, updated, and deleted. They're also
* only available on a `Card` resource.
* @see https://developers.trello.com/reference#actionsid
* @class
*/
var Comment = /** @class */ (function (_super) {
__extends(Comment, _super);
function Comment() {
return _super !== null && _super.apply(this, arguments) || this;
}
Comment.prototype.getComment = function (params) {
return this.apiGet("/", params);
};
Comment.prototype.getComments = function (params) {
return this.apiGet("/", __assign(__assign({}, params), { filter: "commentCard" }));
};
Comment.prototype.addComment = function (text) {
return this.apiPost("/comments", { text: text });
};
Comment.prototype.updateComment = function (text) {
return this.apiPut("/comments", { text: text });
};
Comment.prototype.updateText = function (value) {
return this.apiPut("/text", { value: value });
};
Comment.prototype.deleteComment = function () {
return this.apiDelete("/comments");
};
return Comment;
}(BaseResource_1.BaseResource));
exports.Comment = Comment;