Move code to subfolders
This commit is contained in:
parent
5f85d3e0cf
commit
429cd927c4
9 changed files with 10 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { existsSync } from "fs";
|
import { existsSync } from "fs";
|
||||||
|
|
||||||
import { asyncLoadJSON, asyncSaveJSON } from "./utils";
|
import { asyncLoadJSON, asyncSaveJSON } from "../lib";
|
||||||
|
|
||||||
interface JSONCard {
|
interface JSONCard {
|
||||||
mcmId: number;
|
mcmId: number;
|
0
cmd/cube.ts
Normal file
0
cmd/cube.ts
Normal file
|
@ -1,5 +1,4 @@
|
||||||
import CardMarketApi from "./api";
|
import { asyncSaveJSON, CardMarketApi } from "../lib";
|
||||||
import { asyncSaveJSON } from "./utils";
|
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
if (process.argv.length < 3) {
|
if (process.argv.length < 3) {
|
|
@ -1,7 +1,6 @@
|
||||||
import { existsSync } from "fs";
|
import { existsSync } from "fs";
|
||||||
|
|
||||||
import { Article, MCMDB } from "./types";
|
import { Article, asyncLoadJSON, asyncSaveJSON, leanArticle, leanCard, MCMDB } from "../lib";
|
||||||
import { asyncLoadJSON, asyncSaveJSON, leanArticle, leanCard } from "./utils";
|
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
if (process.argv.length < 3) {
|
if (process.argv.length < 3) {
|
|
@ -5,7 +5,7 @@ import { Article } from "./types";
|
||||||
|
|
||||||
const URI = "https://api.cardmarket.com/ws/v2.0/output.json";
|
const URI = "https://api.cardmarket.com/ws/v2.0/output.json";
|
||||||
|
|
||||||
export default class CardMarketApi {
|
export class CardMarketApi {
|
||||||
private AppToken: string;
|
private AppToken: string;
|
||||||
private AppSecret: string;
|
private AppSecret: string;
|
||||||
private AccessToken: string;
|
private AccessToken: string;
|
3
lib/index.ts
Normal file
3
lib/index.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export * from "./api";
|
||||||
|
export * from "./types";
|
||||||
|
export * from "./utils";
|
|
@ -6,9 +6,9 @@
|
||||||
"author": "Hamcha <hamcha@crunchy.rocks>",
|
"author": "Hamcha <hamcha@crunchy.rocks>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"fetch": "ts-node fetch.ts",
|
"fetch": "ts-node cmd/fetch.ts",
|
||||||
"init-db": "ts-node convert.ts",
|
"init-db": "ts-node cmd/convert.ts",
|
||||||
"find": "ts-node find.ts"
|
"find": "ts-node cmd/find.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "^12.12.11",
|
"@types/node": "^12.12.11",
|
||||||
|
|
Loading…
Reference in a new issue