mirror of
https://github.com/tcgdex/compiler.git
synced 2025-04-22 02:32:10 +00:00
Updated to V2 :D
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
parent
2d40b72218
commit
39a69d5d56
6
.env.example
Normal file
6
.env.example
Normal file
@ -0,0 +1,6 @@
|
||||
UPLOAD_REMOTE=sftp.server.com
|
||||
UPLOAD_DIST=/path/to/remote
|
||||
UPLOAD_USERNAME=username
|
||||
UPLOAD_PASSWORD=password
|
||||
|
||||
TCGDEX_COMPILER_LANG=en
|
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1 +1 @@
|
||||
* eol=lf
|
||||
* text=auto eol=lf
|
||||
|
@ -1,6 +1,8 @@
|
||||
# TCGdex/Compile
|
||||
# TCGdex/Compiler
|
||||
|
||||
_The Compiler for the TCGdex Database_
|
||||
_The Compiler for the [TCGdex Database](https://github.com/tcgdex/cards-database)_
|
||||
|
||||
# V2 Changes
|
||||
|
||||
## Endpoints Made
|
||||
|
||||
@ -14,7 +16,7 @@ _The Compiler for the TCGdex Database_
|
||||
- `sets`
|
||||
- `types`
|
||||
|
||||
## Endpoints TODO list
|
||||
## Endpoints coming during V2 life
|
||||
|
||||
- `abilities`
|
||||
- `abilities-type`
|
||||
|
@ -140,26 +140,7 @@ export default class SFTPPromise {
|
||||
return res
|
||||
}
|
||||
|
||||
private lastTimeDiff: Array<number> = [
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 50
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 100
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 150
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 200
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 250
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 300
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 50
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 100
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 150
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 200
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 250
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 300
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 50
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 100
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 150
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 200
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 250
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 300
|
||||
]
|
||||
private lastTimeDiff: Array<number> = Array.from(new Array(900), () => 0)
|
||||
public async uploadDir(localPath: string, remotePath: string, exclude?: RegExp, root = true) {
|
||||
if (root) {
|
||||
this.filesToUpload = 0
|
||||
|
2
db
2
db
@ -1 +1 @@
|
||||
Subproject commit 9a1ae318f19c2c2d8e0d7d9069e9a34f1142ae82
|
||||
Subproject commit b826798c3b8acda84be12604a1c11fef7abdf67c
|
2
dist
2
dist
@ -1 +1 @@
|
||||
Subproject commit c44123ec85c70043b72e5f4cfed860c74346fbb5
|
||||
Subproject commit 04d198136bf93109442bee82f0b3abf038d9f4c8
|
@ -1,11 +1,7 @@
|
||||
import { CardList, Card as CardSingle } from '@tcgdex/sdk/interfaces'
|
||||
import { Card, Languages } from '../db/interfaces'
|
||||
import { Endpoint } from '../interfaces'
|
||||
import Logger from '@dzeio/logger'
|
||||
import { cardToCardSimple, cardToCardSingle, getCards } from '../utils/cardUtil'
|
||||
import { basename } from 'path'
|
||||
|
||||
const logger = new Logger(basename(__filename))
|
||||
|
||||
export default class implements Endpoint<CardList, CardSingle, {}, Array<[string, Card]>> {
|
||||
public constructor(
|
||||
@ -25,6 +21,6 @@ export default class implements Endpoint<CardList, CardSingle, {}, Array<[string
|
||||
}
|
||||
|
||||
public async common() {
|
||||
return getCards()
|
||||
return getCards(this.lang)
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,8 @@
|
||||
import { CardList, Card as CardSingle, StringEndpointList, StringEndpoint } from '@tcgdex/sdk/interfaces'
|
||||
import { StringEndpointList, StringEndpoint } from '@tcgdex/sdk/interfaces'
|
||||
import translate from '../utils/translationUtil'
|
||||
import { Card, Languages } from '../db/interfaces'
|
||||
import { Endpoint } from '../interfaces'
|
||||
import Logger from '@dzeio/logger'
|
||||
import { cardToCardSimple, cardToCardSingle, getCards } from '../utils/cardUtil'
|
||||
import { basename } from 'path'
|
||||
|
||||
const logger = new Logger(basename(__filename))
|
||||
import { cardToCardSimple, getCards } from '../utils/cardUtil'
|
||||
|
||||
export default class implements Endpoint<StringEndpointList, StringEndpoint, {}, Record<string, Array<[string, Card]>>> {
|
||||
public constructor(
|
||||
@ -30,8 +27,8 @@ export default class implements Endpoint<StringEndpointList, StringEndpoint, {},
|
||||
}
|
||||
|
||||
public async common() {
|
||||
return (await getCards()).reduce((p, c) => {
|
||||
const category = c[1].category
|
||||
return (await getCards(this.lang)).reduce((p, c) => {
|
||||
const category = translate('category', c[1].category, this.lang)
|
||||
if (!category) return p
|
||||
if (!p[category]) {
|
||||
p[category] = []
|
||||
|
@ -1,13 +1,7 @@
|
||||
import { StringEndpointList, StringEndpoint } from '@tcgdex/sdk/interfaces'
|
||||
import { getSet, getSets, isSetAvailable, setToSetSimple, setToSetSingle } from "../utils/setUtil"
|
||||
import { Card, Languages, Set } from '../db/interfaces'
|
||||
import { Card, Languages } from '../db/interfaces'
|
||||
import { Endpoint } from '../interfaces'
|
||||
import Logger from '@dzeio/logger'
|
||||
import { cardToCardSimple, cardToCardSingle, getCards } from '../utils/cardUtil'
|
||||
import { basename } from 'path'
|
||||
import { objectLoop } from '@dzeio/object-util'
|
||||
|
||||
const logger = new Logger(basename(__filename))
|
||||
import { cardToCardSimple, getCards } from '../utils/cardUtil'
|
||||
|
||||
export default class implements Endpoint<StringEndpointList, StringEndpoint, {}, Record<string, Array<[string, Card]>>> {
|
||||
public constructor(
|
||||
@ -31,7 +25,7 @@ export default class implements Endpoint<StringEndpointList, StringEndpoint, {},
|
||||
}
|
||||
|
||||
public async common() {
|
||||
return (await getCards()).reduce((p, c) => {
|
||||
return (await getCards(this.lang)).reduce((p, c) => {
|
||||
const hp = c[1].hp
|
||||
if (!hp) return p
|
||||
if (!p[hp]) {
|
||||
|
@ -1,13 +1,7 @@
|
||||
import { StringEndpointList, StringEndpoint } from '@tcgdex/sdk/interfaces'
|
||||
import { getSet, getSets, isSetAvailable, setToSetSimple, setToSetSingle } from "../utils/setUtil"
|
||||
import { Card, Languages, Set } from '../db/interfaces'
|
||||
import { Card, Languages } from '../db/interfaces'
|
||||
import { Endpoint } from '../interfaces'
|
||||
import Logger from '@dzeio/logger'
|
||||
import { cardToCardSimple, cardToCardSingle, getCards } from '../utils/cardUtil'
|
||||
import { basename } from 'path'
|
||||
import { objectLoop } from '@dzeio/object-util'
|
||||
|
||||
const logger = new Logger(basename(__filename))
|
||||
import { cardToCardSimple, getCards } from '../utils/cardUtil'
|
||||
|
||||
export default class implements Endpoint<StringEndpointList, StringEndpoint, {}, Record<string, Array<[string, Card]>>> {
|
||||
public constructor(
|
||||
@ -31,7 +25,7 @@ export default class implements Endpoint<StringEndpointList, StringEndpoint, {},
|
||||
}
|
||||
|
||||
public async common() {
|
||||
return (await getCards()).reduce((p, c) => {
|
||||
return (await getCards(this.lang)).reduce((p, c) => {
|
||||
const illustrator = c[1].illustrator
|
||||
if (!illustrator) return p
|
||||
if (!p[illustrator]) {
|
||||
|
@ -1,13 +1,8 @@
|
||||
import { StringEndpointList, StringEndpoint } from '@tcgdex/sdk/interfaces'
|
||||
import { getSet, getSets, isSetAvailable, setToSetSimple, setToSetSingle } from "../utils/setUtil"
|
||||
import { Card, Languages, Set } from '../db/interfaces'
|
||||
import translate from '../utils/translationUtil'
|
||||
import { Card, Languages } from '../db/interfaces'
|
||||
import { Endpoint } from '../interfaces'
|
||||
import Logger from '@dzeio/logger'
|
||||
import { cardToCardSimple, cardToCardSingle, getCards } from '../utils/cardUtil'
|
||||
import { basename } from 'path'
|
||||
import { objectLoop } from '@dzeio/object-util'
|
||||
|
||||
const logger = new Logger(basename(__filename))
|
||||
import { cardToCardSimple, getCards } from '../utils/cardUtil'
|
||||
|
||||
export default class implements Endpoint<StringEndpointList, StringEndpoint, {}, Record<string, Array<[string, Card]>>> {
|
||||
public constructor(
|
||||
@ -31,8 +26,8 @@ export default class implements Endpoint<StringEndpointList, StringEndpoint, {},
|
||||
}
|
||||
|
||||
public async common() {
|
||||
return (await getCards()).reduce((p, c) => {
|
||||
const rarity = c[1].rarity // TODO: translate using this.lang
|
||||
return (await getCards(this.lang)).reduce((p, c) => {
|
||||
const rarity = translate('rarity', c[1].rarity, this.lang)
|
||||
if (!rarity) return p
|
||||
if (!p[rarity]) {
|
||||
p[rarity] = []
|
||||
|
@ -1,11 +1,7 @@
|
||||
import { StringEndpointList, StringEndpoint } from '@tcgdex/sdk/interfaces'
|
||||
import { Card, Languages } from '../db/interfaces'
|
||||
import { Endpoint } from '../interfaces'
|
||||
import Logger from '@dzeio/logger'
|
||||
import { cardToCardSimple, getCards } from '../utils/cardUtil'
|
||||
import { basename } from 'path'
|
||||
|
||||
const logger = new Logger(basename(__filename))
|
||||
|
||||
export default class implements Endpoint<StringEndpointList, StringEndpoint, {}, Record<string, Array<[string, Card]>>> {
|
||||
public constructor(
|
||||
@ -29,7 +25,7 @@ export default class implements Endpoint<StringEndpointList, StringEndpoint, {},
|
||||
}
|
||||
|
||||
public async common() {
|
||||
return (await getCards()).reduce((p, c) => {
|
||||
return (await getCards(this.lang)).reduce((p, c) => {
|
||||
const retreat = c[1].retreat
|
||||
if (!retreat) return p
|
||||
if (!p[retreat]) {
|
||||
|
@ -1,13 +1,8 @@
|
||||
import { Serie as SerieSingle, StringEndpoint, SerieList } from '@tcgdex/sdk/interfaces'
|
||||
import { Card, Languages, Serie } from '../db/interfaces'
|
||||
import { Serie as SerieSingle, SerieList } from '@tcgdex/sdk/interfaces'
|
||||
import { Languages, Serie } from '../db/interfaces'
|
||||
import { Endpoint } from '../interfaces'
|
||||
import Logger from '@dzeio/logger'
|
||||
import { cardToCardSimple, cardToCardSingle, getCards } from '../utils/cardUtil'
|
||||
import { basename } from 'path'
|
||||
import { getSeries, serieToSerieSimple, serieToSerieSingle } from '../utils/serieUtil'
|
||||
|
||||
const logger = new Logger(basename(__filename))
|
||||
|
||||
export default class implements Endpoint<SerieList, SerieSingle, {}, Array<Serie>> {
|
||||
public constructor(
|
||||
private lang: keyof Languages
|
||||
@ -21,7 +16,12 @@ export default class implements Endpoint<SerieList, SerieSingle, {}, Array<Serie
|
||||
const items: Record<string, SerieSingle> = {}
|
||||
for (let key = 0; key < common.length; key++) {
|
||||
const val = common[key];
|
||||
items[key] = await serieToSerieSingle(val, this.lang)
|
||||
const gen = await serieToSerieSingle(val, this.lang)
|
||||
const name = val.name[this.lang]
|
||||
if (name) {
|
||||
items[name] = gen
|
||||
}
|
||||
items[key] = gen
|
||||
}
|
||||
return items
|
||||
}
|
||||
|
@ -2,11 +2,7 @@ import { SetList, Set as SetSingle, Card as CardSingle } from '@tcgdex/sdk/inter
|
||||
import { getSet, getSets, isSetAvailable, setToSetSimple, setToSetSingle } from "../utils/setUtil"
|
||||
import { Languages, Set } from '../db/interfaces'
|
||||
import { Endpoint } from '../interfaces'
|
||||
import Logger from '@dzeio/logger'
|
||||
import { cardToCardSingle, getCards } from '../utils/cardUtil'
|
||||
import { basename } from 'path'
|
||||
|
||||
const logger = new Logger(basename(__filename))
|
||||
|
||||
export default class implements Endpoint<SetList, SetSingle, CardSingle, Array<Set>> {
|
||||
public constructor(
|
||||
@ -41,11 +37,11 @@ export default class implements Endpoint<SetList, SetSingle, CardSingle, Array<S
|
||||
}
|
||||
|
||||
public async sub(common: Array<Set>, item: string) {
|
||||
const set = await getSet(item)
|
||||
const set = common.find((s) => s.name[this.lang] === item)
|
||||
|
||||
if (!isSetAvailable(set, this.lang)) return undefined
|
||||
if (!set || !isSetAvailable(set, this.lang)) return undefined
|
||||
|
||||
const lit = await getCards(set)
|
||||
const lit = await getCards(this.lang, set)
|
||||
const l: Record<string, CardSingle> = {}
|
||||
for (let i of lit) {
|
||||
l[i[0]] = await cardToCardSingle(i[0], i[1], this.lang)
|
||||
|
@ -1,13 +1,8 @@
|
||||
import { StringEndpointList, StringEndpoint } from '@tcgdex/sdk/interfaces'
|
||||
import { getSet, getSets, isSetAvailable, setToSetSimple, setToSetSingle } from "../utils/setUtil"
|
||||
import { Card, Languages, Set } from '../db/interfaces'
|
||||
import translate from '../utils/translationUtil'
|
||||
import { Card, Languages } from '../db/interfaces'
|
||||
import { Endpoint } from '../interfaces'
|
||||
import Logger from '@dzeio/logger'
|
||||
import { cardToCardSimple, cardToCardSingle, getCards } from '../utils/cardUtil'
|
||||
import { basename } from 'path'
|
||||
import { objectLoop } from '@dzeio/object-util'
|
||||
|
||||
const logger = new Logger(basename(__filename))
|
||||
import { cardToCardSimple, getCards } from '../utils/cardUtil'
|
||||
|
||||
export default class implements Endpoint<StringEndpointList, StringEndpoint, {}, Record<string, Array<[string, Card]>>> {
|
||||
public constructor(
|
||||
@ -31,8 +26,8 @@ export default class implements Endpoint<StringEndpointList, StringEndpoint, {},
|
||||
}
|
||||
|
||||
public async common() {
|
||||
return (await getCards()).reduce((p, c) => {
|
||||
const types = c[1].types
|
||||
return (await getCards(this.lang)).reduce((p, c) => {
|
||||
const types = c[1].types?.map((t) => translate('types', t, this.lang) as string)
|
||||
if (!types) return p
|
||||
for (const type of types) {
|
||||
if (!p[type]) {
|
||||
|
17
main.ts
17
main.ts
@ -1,10 +1,13 @@
|
||||
import { SupportedLanguages } from 'db/interfaces'
|
||||
import { Endpoint } from 'interfaces'
|
||||
import { promises as fs} from 'fs'
|
||||
import { objectLoop, objectMap } from '@dzeio/object-util'
|
||||
import { getCardPictures } from './utils/cardUtil'
|
||||
import { urlize } from './utils/util'
|
||||
const lang: SupportedLanguages = 'en'
|
||||
import { objectMap } from '@dzeio/object-util'
|
||||
import { urlize, fetchRemoteFile } from './utils/util'
|
||||
import { config } from 'dotenv'
|
||||
|
||||
config()
|
||||
|
||||
const lang: SupportedLanguages = process.env.TCGDEX_COMPILER_LANG as SupportedLanguages ?? 'en'
|
||||
|
||||
const VERSION = 'v2'
|
||||
|
||||
@ -12,8 +15,7 @@ const VERSION = 'v2'
|
||||
const paths = (await fs.readdir('./endpoints')).filter((f) => f.endsWith('.ts'))
|
||||
|
||||
console.log('Prefetching pictures')
|
||||
await getCardPictures('1', (await import('./db/data/Base/Base Set/1.js')).default, lang)
|
||||
|
||||
await fetchRemoteFile(`https://assets.tcgdex.net/data-${lang}.json`)
|
||||
|
||||
for (const file of paths) {
|
||||
const path = `./endpoints/${file}`
|
||||
@ -31,8 +33,7 @@ const VERSION = 'v2'
|
||||
await fs.writeFile(`${folder}/index.json`, JSON.stringify(
|
||||
await endpoint.index(common)
|
||||
))
|
||||
console.log(file, 'Finished Index')
|
||||
console.log(file, 'Running Item')
|
||||
console.log(file, 'Finished Index', 'Running Item')
|
||||
const item = await endpoint.item(common)
|
||||
console.log(file, 'Finished Item')
|
||||
if (item) {
|
||||
|
@ -2,14 +2,15 @@
|
||||
"name": "@tcgdex/compiler",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"repository": "git@git.delta-wings.net:tcgdex/compiler.git",
|
||||
"repository": "https://github.com/tcgdex/compiler.git",
|
||||
"author": "Avior <florian.bouillon@delta-wings.net>",
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"scripts": {
|
||||
"db:compile": "cd db && tsc --project tsconfig.json",
|
||||
"db:test": "cd db && tsc --noEmit --project tsconfig.json",
|
||||
"gen": "ts-node --transpile-only all.ts"
|
||||
"start": "ts-node --transpile-only main.ts",
|
||||
"upload": "ts-node --transpile-only upload.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dzeio/logger": "^2.0.0-alpha.0",
|
||||
@ -19,8 +20,7 @@
|
||||
"dotenv": "^8.2.0",
|
||||
"glob": "^7.1.6",
|
||||
"node-fetch": "^2.6.0",
|
||||
"ssh2": "^0.8.9",
|
||||
"ssh2-sftp-client": "^6.0.1"
|
||||
"ssh2": "^0.8.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob": "^7.1.1",
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { getSet, setToSetSimple } from "./setUtil"
|
||||
import { setToSetSimple } from "./setUtil"
|
||||
import { fetchRemoteFile, smartGlob } from "./util"
|
||||
import { Set, SupportedLanguages, Card } from 'db/interfaces'
|
||||
import fetch from 'node-fetch'
|
||||
import { Set, SupportedLanguages, Card, Types } from 'db/interfaces'
|
||||
import { Card as CardSingle, CardResume } from '@tcgdex/sdk/interfaces'
|
||||
import translate, { translateType } from './translationUtil'
|
||||
|
||||
interface ObjectList<T = any> {
|
||||
[key: string]: T
|
||||
@ -53,8 +53,8 @@ export async function cardToCardSingle(localId: string, card: Card, lang: Suppor
|
||||
image: image,
|
||||
|
||||
illustrator: card.illustrator,
|
||||
rarity: card.rarity, // translate
|
||||
category: card.category, // translate
|
||||
rarity: translate('rarity', card.rarity, lang) as any,
|
||||
category: translate('category', card.category, lang) as any,
|
||||
variants: {
|
||||
normal: typeof card.variants?.normal === 'boolean' ? card.variants.normal : typeof card.set.variants?.normal === 'boolean' ? card.set.variants.normal : true,
|
||||
reverse: typeof card.variants?.reverse === 'boolean' ? card.variants.reverse : typeof card.set.variants?.reverse === 'boolean' ? card.set.variants.reverse : true,
|
||||
@ -66,38 +66,38 @@ export async function cardToCardSingle(localId: string, card: Card, lang: Suppor
|
||||
|
||||
dexId: card.dexId,
|
||||
hp: card.hp,
|
||||
types: card.types, // translate
|
||||
types: card.types?.map((t) => translateType(t, lang)) as Array<Types>,
|
||||
evolveFrom: card.evolveFrom && card.evolveFrom[lang],
|
||||
weight: card.weight,
|
||||
description: card.description ? card.description[lang] as string : undefined,
|
||||
level: card.level,
|
||||
stage: card.stage, // translate
|
||||
suffix: card.suffix, // translate
|
||||
stage: translate('stage', card.stage, lang) as any,
|
||||
suffix: translate('suffix', card.suffix, lang) as any,
|
||||
item: card.item ? {
|
||||
name: card.item.name[lang] as string,
|
||||
effect: card.item.effect[lang] as string
|
||||
} : undefined,
|
||||
|
||||
abilities: card.abilities?.map((el) => ({
|
||||
type: el.type, // translate
|
||||
type: translate('abilityType', el.type, lang) as any,
|
||||
name: el.name[lang] as string,
|
||||
effect: el.effect[lang] as string
|
||||
})),
|
||||
|
||||
attacks: card.attacks?.map((el) => ({
|
||||
cost: el.cost,
|
||||
cost: el.cost?.map((t) => translateType(t, lang)) as Types[],
|
||||
name: el.name[lang] as string,
|
||||
effect: el.effect ? el.effect[lang] : undefined,
|
||||
damage: el.damage
|
||||
})),
|
||||
|
||||
weaknesses: card.weaknesses?.map((el) => ({
|
||||
type: el.type, // translate
|
||||
type: translate('types', el.type, lang) as Types,
|
||||
value: el.value
|
||||
})),
|
||||
|
||||
resistances: card.resistances?.map((el) => ({
|
||||
type: el.type, // translate
|
||||
type: translate('types', el.type, lang) as Types,
|
||||
value: el.value
|
||||
})),
|
||||
|
||||
@ -105,8 +105,8 @@ export async function cardToCardSingle(localId: string, card: Card, lang: Suppor
|
||||
|
||||
effect: card.effect ? card.effect[lang] : undefined,
|
||||
|
||||
trainerType: card.trainerType, // translate
|
||||
energyType: card.energyType // translate
|
||||
trainerType: translate('trainerType', card.trainerType, lang) as any,
|
||||
energyType: translate('energyType', card.energyType, lang) as any
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ export async function getCard(serie: string, setName: string, id: string): Promi
|
||||
return (await import(`../db/data/${serie}/${setName}/${id}.js`)).default
|
||||
}
|
||||
|
||||
export async function getCards(set?: Set): Promise<Array<[string, Card]>> {
|
||||
export async function getCards(lang: SupportedLanguages,set?: Set): Promise<Array<[string, Card]>> {
|
||||
const cards = (await smartGlob(`./db/data/${(set && set.serie.name.en) ?? '*'}/${(set && set.name.en) ?? '*'}/*.js`))
|
||||
const list: Array<[string, Card]> = []
|
||||
for (const path of cards) {
|
||||
@ -135,7 +135,7 @@ export async function getCards(set?: Set): Promise<Array<[string, Card]>> {
|
||||
})()
|
||||
console.log(path, id, setName)
|
||||
const c = await getCard(serieName, setName, id)
|
||||
if (!c.name.en) {
|
||||
if (!c.name[lang]) {
|
||||
continue
|
||||
}
|
||||
list.push([id, c])
|
||||
|
@ -1,11 +1,8 @@
|
||||
import { smartGlob } from "./util"
|
||||
import { setToSetSimple, getSets } from "./setUtil"
|
||||
import Logger from "@dzeio/logger"
|
||||
import { Serie, SupportedLanguages } from 'db/interfaces'
|
||||
import { Serie as SerieSingle, SerieResume } from '@tcgdex/sdk/interfaces'
|
||||
|
||||
const logger = new Logger('ExpansionUtils')
|
||||
|
||||
export async function getSeries(): Promise<Array<Serie>> {
|
||||
return Promise.all((await smartGlob('./db/data/*.js'))
|
||||
.map((it) => it.substring(it.lastIndexOf('/') + 1, it.length - 3))
|
||||
|
@ -76,6 +76,6 @@ export async function setToSetSingle(set: Set, lang: SupportedLanguages): Promis
|
||||
// symbol: set.images.symbol,
|
||||
// logo: set.images.logo
|
||||
// },
|
||||
cards: await Promise.all((await getCards(set)).map(([id, card]) => cardToCardSimple(id, card, lang)))
|
||||
cards: await Promise.all((await getCards(lang, set)).map(([id, card]) => cardToCardSimple(id, card, lang)))
|
||||
}
|
||||
}
|
||||
|
101
utils/translationUtil.ts
Normal file
101
utils/translationUtil.ts
Normal file
@ -0,0 +1,101 @@
|
||||
import { SupportedLanguages, Types } from 'db/interfaces'
|
||||
|
||||
type translatable = 'types' | 'rarity' | 'stage' | 'category' | 'suffix' | 'abilityType' | 'trainerType' | 'energyType'
|
||||
|
||||
const translations: Record<string, Record<translatable, Record<string, string>>> = {
|
||||
fr: {
|
||||
types: {
|
||||
'Colorless': 'Incolore',
|
||||
'Darkness': 'Obscurité',
|
||||
'Dragon': 'Dragon',
|
||||
'Fairy': 'Fée',
|
||||
'Fightning': 'Combat',
|
||||
'Fire': 'Feu',
|
||||
'Grass': 'Plante',
|
||||
'Lightning': 'Électrique',
|
||||
'Metal': 'Métal',
|
||||
'Psychic': 'Psy',
|
||||
'Water': 'Eau'
|
||||
},
|
||||
rarity: {
|
||||
'None': 'Rien',
|
||||
'Common': 'Commune',
|
||||
'Uncommon': 'Non Commune',
|
||||
'Rare': 'Rare',
|
||||
'Ultra Rare': 'Ultra Rare',
|
||||
'Secret Rare': 'Magnifique rare'
|
||||
},
|
||||
stage: {
|
||||
"Basic": 'Base',
|
||||
"BREAK": 'TURBO',
|
||||
"LEVEL-UP": 'Niveau Sup',
|
||||
"MEGA": 'MÉGA',
|
||||
"RESTORED": 'RECRÉE',
|
||||
"Stage1": 'Niveau1',
|
||||
"Stage2": 'Biveau2',
|
||||
"VMAX": 'VMAX'
|
||||
},
|
||||
category: {
|
||||
Pokemon: 'Pokémon',
|
||||
Trainer: 'Dresseur',
|
||||
Energy: 'Énergie'
|
||||
},
|
||||
suffix: {
|
||||
'EX': 'EX',
|
||||
'GX': 'GX',
|
||||
'V': 'V',
|
||||
'Legend': 'LÉGENDE',
|
||||
'Prime': 'Prime',
|
||||
'SP': 'SP',
|
||||
'TAG TEAM-GX': 'TAG TEAM-GX',
|
||||
},
|
||||
abilityType: {
|
||||
'Pokemon Power': 'Pouvoir Pokémon',
|
||||
'Poke-BODY': 'Poké-BODY',
|
||||
'Poke-POWER': 'Poké-POWER',
|
||||
'Ability': 'Talent',
|
||||
'Ancient Trait': 'Trait Antique'
|
||||
},
|
||||
trainerType: {
|
||||
'Supporter': 'Supporter',
|
||||
'Item': 'Objet',
|
||||
'Stadium': 'Stade',
|
||||
'Tool': 'Outil',
|
||||
'Ace Spec': 'High-Tech',
|
||||
'Technical Machine': 'Machine Technique',
|
||||
'Goldenred Game Corner': 'Salle de jeu de Doublonville',
|
||||
'Rocket\'s Secret Machine': 'Machine secrète des Rocket'
|
||||
},
|
||||
energyType: {
|
||||
Normal: 'Normal',
|
||||
Special: 'Spécial'
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default function translate(item: translatable, key: string | undefined, lang: SupportedLanguages) {
|
||||
if (!key) {
|
||||
return key
|
||||
}
|
||||
if (lang === 'en') {
|
||||
return key
|
||||
}
|
||||
const res = translations[lang]?.[item]?.[key]
|
||||
if (!res) {
|
||||
throw new Error(`Could not find translation for ${lang}${item}.${key}`);
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
export function translateType(type: Types, lang: SupportedLanguages) {
|
||||
return translate('types', type, lang)
|
||||
|
||||
}
|
||||
|
||||
export function translateStage(stage: string, lang: SupportedLanguages) {
|
||||
return translate('stage', stage, lang)
|
||||
}
|
||||
|
||||
export function translateRarity(rarity: string, lang: SupportedLanguages) {
|
||||
return translate('rarity', rarity, lang)
|
||||
}
|
274
yarn.lock
274
yarn.lock
@ -2,15 +2,6 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@dabh/diagnostics@^2.0.2":
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31"
|
||||
integrity sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==
|
||||
dependencies:
|
||||
colorspace "1.1.x"
|
||||
enabled "2.0.x"
|
||||
kuler "^2.0.0"
|
||||
|
||||
"@dzeio/logger@^2.0.0-alpha.0":
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@dzeio/logger/-/logger-2.0.4.tgz#a8761a057198376fad768e604e370f5cb3415107"
|
||||
@ -98,11 +89,6 @@ asn1@~0.2.0:
|
||||
dependencies:
|
||||
safer-buffer "~2.1.0"
|
||||
|
||||
async@^3.1.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720"
|
||||
integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==
|
||||
|
||||
asynckit@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
||||
@ -133,52 +119,6 @@ buffer-from@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
||||
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
|
||||
|
||||
color-convert@^1.9.1:
|
||||
version "1.9.3"
|
||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
|
||||
integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
|
||||
dependencies:
|
||||
color-name "1.1.3"
|
||||
|
||||
color-name@1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
|
||||
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
|
||||
|
||||
color-name@^1.0.0:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||
|
||||
color-string@^1.5.2:
|
||||
version "1.5.5"
|
||||
resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.5.tgz#65474a8f0e7439625f3d27a6a19d89fc45223014"
|
||||
integrity sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg==
|
||||
dependencies:
|
||||
color-name "^1.0.0"
|
||||
simple-swizzle "^0.2.2"
|
||||
|
||||
color@3.0.x:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/color/-/color-3.0.0.tgz#d920b4328d534a3ac8295d68f7bd4ba6c427be9a"
|
||||
integrity sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==
|
||||
dependencies:
|
||||
color-convert "^1.9.1"
|
||||
color-string "^1.5.2"
|
||||
|
||||
colors@^1.2.1:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
|
||||
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==
|
||||
|
||||
colorspace@1.1.x:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/colorspace/-/colorspace-1.1.2.tgz#e0128950d082b86a2168580796a0aa5d6c68d8c5"
|
||||
integrity sha512-vt+OoIP2d76xLhjwbBaucYlNSpPsrJWPlBTtwCpQKIu6/CSMutyzX93O/Do0qzpH3YoHEes8YEFXyZ797rEhzQ==
|
||||
dependencies:
|
||||
color "3.0.x"
|
||||
text-hex "1.0.x"
|
||||
|
||||
combined-stream@^1.0.8:
|
||||
version "1.0.8"
|
||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
|
||||
@ -191,21 +131,6 @@ concat-map@0.0.1:
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
|
||||
|
||||
concat-stream@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-2.0.0.tgz#414cf5af790a48c60ab9be4527d56d5e41133cb1"
|
||||
integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==
|
||||
dependencies:
|
||||
buffer-from "^1.0.0"
|
||||
inherits "^2.0.3"
|
||||
readable-stream "^3.0.2"
|
||||
typedarray "^0.0.6"
|
||||
|
||||
core-util-is@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
|
||||
|
||||
create-require@^1.1.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
|
||||
@ -226,31 +151,6 @@ dotenv@^8.2.0:
|
||||
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
|
||||
integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==
|
||||
|
||||
enabled@2.0.x:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2"
|
||||
integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==
|
||||
|
||||
err-code@^2.0.2:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9"
|
||||
integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==
|
||||
|
||||
fast-safe-stringify@^2.0.4:
|
||||
version "2.0.7"
|
||||
resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743"
|
||||
integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==
|
||||
|
||||
fecha@^4.2.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.0.tgz#3ffb6395453e3f3efff850404f0a59b6747f5f41"
|
||||
integrity sha512-aN3pcx/DSmtyoovUudctc8+6Hl4T+hI9GBBHLjA76jdZl7+b1sgh5g4k+u/GL3dTy1/pnYzKp69FpJ0OicE3Wg==
|
||||
|
||||
fn.name@1.x.x:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc"
|
||||
integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==
|
||||
|
||||
form-data@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682"
|
||||
@ -285,26 +185,11 @@ inflight@^1.0.4:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2, inherits@^2.0.3, inherits@~2.0.3:
|
||||
inherits@2:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
|
||||
is-arrayish@^0.3.1:
|
||||
version "0.3.2"
|
||||
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03"
|
||||
integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==
|
||||
|
||||
is-stream@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3"
|
||||
integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==
|
||||
|
||||
isarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
||||
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
|
||||
|
||||
isomorphic-unfetch@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz#87341d5f4f7b63843d468438128cb087b7c3e98f"
|
||||
@ -313,22 +198,6 @@ isomorphic-unfetch@^3.1.0:
|
||||
node-fetch "^2.6.1"
|
||||
unfetch "^4.2.0"
|
||||
|
||||
kuler@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3"
|
||||
integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==
|
||||
|
||||
logform@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/logform/-/logform-2.2.0.tgz#40f036d19161fc76b68ab50fdc7fe495544492f2"
|
||||
integrity sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg==
|
||||
dependencies:
|
||||
colors "^1.2.1"
|
||||
fast-safe-stringify "^2.0.4"
|
||||
fecha "^4.2.0"
|
||||
ms "^2.1.1"
|
||||
triple-beam "^1.3.0"
|
||||
|
||||
make-error@^1.1.1:
|
||||
version "1.3.6"
|
||||
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
|
||||
@ -353,11 +222,6 @@ minimatch@^3.0.4:
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
ms@^2.1.1:
|
||||
version "2.1.3"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
|
||||
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
|
||||
|
||||
node-fetch@^2.6.0, node-fetch@^2.6.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
|
||||
@ -370,80 +234,16 @@ once@^1.3.0:
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
one-time@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/one-time/-/one-time-1.0.0.tgz#e06bc174aed214ed58edede573b433bbf827cb45"
|
||||
integrity sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==
|
||||
dependencies:
|
||||
fn.name "1.x.x"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
|
||||
|
||||
process-nextick-args@~2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
|
||||
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
|
||||
|
||||
promise-retry@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22"
|
||||
integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==
|
||||
dependencies:
|
||||
err-code "^2.0.2"
|
||||
retry "^0.12.0"
|
||||
|
||||
readable-stream@^2.3.7:
|
||||
version "2.3.7"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
|
||||
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
|
||||
dependencies:
|
||||
core-util-is "~1.0.0"
|
||||
inherits "~2.0.3"
|
||||
isarray "~1.0.0"
|
||||
process-nextick-args "~2.0.0"
|
||||
safe-buffer "~5.1.1"
|
||||
string_decoder "~1.1.1"
|
||||
util-deprecate "~1.0.1"
|
||||
|
||||
readable-stream@^3.0.2, readable-stream@^3.4.0:
|
||||
version "3.6.0"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198"
|
||||
integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==
|
||||
dependencies:
|
||||
inherits "^2.0.3"
|
||||
string_decoder "^1.1.1"
|
||||
util-deprecate "^1.0.1"
|
||||
|
||||
retry@^0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b"
|
||||
integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=
|
||||
|
||||
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||
|
||||
safe-buffer@~5.2.0:
|
||||
version "5.2.1"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
|
||||
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
|
||||
|
||||
safer-buffer@~2.1.0:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
|
||||
|
||||
simple-swizzle@^0.2.2:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"
|
||||
integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=
|
||||
dependencies:
|
||||
is-arrayish "^0.3.1"
|
||||
|
||||
source-map-support@^0.5.17:
|
||||
version "0.5.19"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
|
||||
@ -457,16 +257,6 @@ source-map@^0.6.0:
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
|
||||
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
|
||||
|
||||
ssh2-sftp-client@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ssh2-sftp-client/-/ssh2-sftp-client-6.0.1.tgz#cd901acfd5303ec5da0e10436d5dc484f34e464c"
|
||||
integrity sha512-Glut2SmK/XpNOBiEuzqlKZGKkIyha2XMbuWVXR2hFUJkNsbyl/wmlZSeUEPxKFp/dC9UEvUKzanKydgLmNdfkw==
|
||||
dependencies:
|
||||
concat-stream "^2.0.0"
|
||||
promise-retry "^2.0.1"
|
||||
ssh2 "^0.8.9"
|
||||
winston "^3.3.3"
|
||||
|
||||
ssh2-streams@~0.4.10:
|
||||
version "0.4.10"
|
||||
resolved "https://registry.yarnpkg.com/ssh2-streams/-/ssh2-streams-0.4.10.tgz#48ef7e8a0e39d8f2921c30521d56dacb31d23a34"
|
||||
@ -483,40 +273,11 @@ ssh2@^0.8.9:
|
||||
dependencies:
|
||||
ssh2-streams "~0.4.10"
|
||||
|
||||
stack-trace@0.0.x:
|
||||
version "0.0.10"
|
||||
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
|
||||
integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=
|
||||
|
||||
streamsearch@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-0.1.2.tgz#808b9d0e56fc273d809ba57338e929919a1a9f1a"
|
||||
integrity sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=
|
||||
|
||||
string_decoder@^1.1.1:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
|
||||
integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
|
||||
dependencies:
|
||||
safe-buffer "~5.2.0"
|
||||
|
||||
string_decoder@~1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
|
||||
integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
|
||||
dependencies:
|
||||
safe-buffer "~5.1.0"
|
||||
|
||||
text-hex@1.0.x:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5"
|
||||
integrity sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==
|
||||
|
||||
triple-beam@^1.2.0, triple-beam@^1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9"
|
||||
integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==
|
||||
|
||||
ts-node@^9.1.1:
|
||||
version "9.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d"
|
||||
@ -534,11 +295,6 @@ tweetnacl@^0.14.3:
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=
|
||||
|
||||
typedarray@^0.0.6:
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
typescript@^4.2.3:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.3.tgz#39062d8019912d43726298f09493d598048c1ce3"
|
||||
@ -549,34 +305,6 @@ unfetch@^4.2.0:
|
||||
resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be"
|
||||
integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==
|
||||
|
||||
util-deprecate@^1.0.1, util-deprecate@~1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
|
||||
|
||||
winston-transport@^4.4.0:
|
||||
version "4.4.0"
|
||||
resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.4.0.tgz#17af518daa690d5b2ecccaa7acf7b20ca7925e59"
|
||||
integrity sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw==
|
||||
dependencies:
|
||||
readable-stream "^2.3.7"
|
||||
triple-beam "^1.2.0"
|
||||
|
||||
winston@^3.3.3:
|
||||
version "3.3.3"
|
||||
resolved "https://registry.yarnpkg.com/winston/-/winston-3.3.3.tgz#ae6172042cafb29786afa3d09c8ff833ab7c9170"
|
||||
integrity sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw==
|
||||
dependencies:
|
||||
"@dabh/diagnostics" "^2.0.2"
|
||||
async "^3.1.0"
|
||||
is-stream "^2.0.0"
|
||||
logform "^2.2.0"
|
||||
one-time "^1.0.0"
|
||||
readable-stream "^3.4.0"
|
||||
stack-trace "0.0.x"
|
||||
triple-beam "^1.3.0"
|
||||
winston-transport "^4.4.0"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
|
Loading…
x
Reference in New Issue
Block a user