scryfall-sdk
Version:
A Node.js SDK for https://scryfall.com/docs/api written in Typescript.
159 lines (158 loc) • 5.87 kB
JavaScript
"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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const Cached_1 = require("../util/Cached");
const MagicQuerier_1 = require("../util/MagicQuerier");
class Catalog extends MagicQuerier_1.default {
cardNames() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/card-names")).data;
});
}
artistNames() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/artist-names")).data;
});
}
wordBank() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/word-bank")).data;
});
}
creatureTypes() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/creature-types")).data;
});
}
planeswalkerTypes() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/planeswalker-types")).data;
});
}
landTypes() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/land-types")).data;
});
}
artifactTypes() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/artifact-types")).data;
});
}
enchantmentTypes() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/enchantment-types")).data;
});
}
spellTypes() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/spell-types")).data;
});
}
powers() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/powers")).data;
});
}
toughnesses() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/toughnesses")).data;
});
}
loyalties() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/loyalties")).data;
});
}
watermarks() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/watermarks")).data;
});
}
keywordAbilities() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/keyword-abilities")).data;
});
}
keywordActions() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/keyword-actions")).data;
});
}
abilityWords() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/ability-words")).data;
});
}
supertypes() {
return __awaiter(this, void 0, void 0, function* () {
return (yield this.query("catalog/supertypes")).data;
});
}
}
__decorate([
Cached_1.default
], Catalog.prototype, "cardNames", null);
__decorate([
Cached_1.default
], Catalog.prototype, "artistNames", null);
__decorate([
Cached_1.default
], Catalog.prototype, "wordBank", null);
__decorate([
Cached_1.default
], Catalog.prototype, "creatureTypes", null);
__decorate([
Cached_1.default
], Catalog.prototype, "planeswalkerTypes", null);
__decorate([
Cached_1.default
], Catalog.prototype, "landTypes", null);
__decorate([
Cached_1.default
], Catalog.prototype, "artifactTypes", null);
__decorate([
Cached_1.default
], Catalog.prototype, "enchantmentTypes", null);
__decorate([
Cached_1.default
], Catalog.prototype, "spellTypes", null);
__decorate([
Cached_1.default
], Catalog.prototype, "powers", null);
__decorate([
Cached_1.default
], Catalog.prototype, "toughnesses", null);
__decorate([
Cached_1.default
], Catalog.prototype, "loyalties", null);
__decorate([
Cached_1.default
], Catalog.prototype, "watermarks", null);
__decorate([
Cached_1.default
], Catalog.prototype, "keywordAbilities", null);
__decorate([
Cached_1.default
], Catalog.prototype, "keywordActions", null);
__decorate([
Cached_1.default
], Catalog.prototype, "abilityWords", null);
__decorate([
Cached_1.default
], Catalog.prototype, "supertypes", null);
exports.default = new Catalog;