@toil/translate
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,3 +0,3 @@ | ||
import { FetchFunction, Lang, TranslationOpts, TranslationService } from "@/types/client"; | ||
import { BaseProvider } from "@/providers/base"; | ||
import { FetchFunction, Lang, TranslationOpts, TranslationService } from "./types/client.js"; | ||
import BaseProvider from "./providers/base.js"; | ||
export default class TranslationClient { | ||
@@ -10,6 +10,7 @@ service: TranslationService; | ||
apiExtra: unknown; | ||
origin: string | undefined; | ||
headers: Record<string, unknown>; | ||
provider: BaseProvider; | ||
constructor({ service, fetchFn, fetchOpts, apiUrl, apiKey, apiExtra, headers, }?: TranslationOpts); | ||
changeService({ service, fetchFn, fetchOpts, apiUrl, apiKey, apiExtra, headers, }?: TranslationOpts): void; | ||
constructor({ service, fetchFn, fetchOpts, apiUrl, apiKey, apiExtra, origin, headers, }?: TranslationOpts); | ||
changeService({ service, fetchFn, fetchOpts, apiUrl, apiKey, apiExtra, origin, headers, }?: TranslationOpts): void; | ||
translate(text: string | string[], lang?: Lang): Promise<import("./types/providers/base.js").TranslationResponse>; | ||
@@ -16,0 +17,0 @@ detect(text: string): Promise<import("./types/providers/base.js").DetectResponse>; |
@@ -1,4 +0,4 @@ | ||
import { fetchWithTimeout } from "@/utils/utils"; | ||
import { TranslationService, } from "@/types/client"; | ||
import TranslationProvider from "@/providers"; | ||
import { fetchWithTimeout } from "./utils/utils.js"; | ||
import { TranslationService, } from "./types/client.js"; | ||
import TranslationProvider from "./providers/index.js"; | ||
export default class TranslationClient { | ||
@@ -11,5 +11,6 @@ service; | ||
apiExtra; | ||
origin; | ||
headers = {}; | ||
provider; | ||
constructor({ service = TranslationService.yandexbrowser, fetchFn = fetchWithTimeout, fetchOpts = {}, apiUrl = undefined, apiKey = undefined, apiExtra = undefined, headers = {}, } = {}) { | ||
constructor({ service = TranslationService.yandexbrowser, fetchFn = fetchWithTimeout, fetchOpts = {}, apiUrl = undefined, apiKey = undefined, apiExtra = undefined, origin = undefined, headers = {}, } = {}) { | ||
this.changeService({ | ||
@@ -22,6 +23,7 @@ service, | ||
apiExtra, | ||
origin, | ||
headers, | ||
}); | ||
} | ||
changeService({ service = this.service, fetchFn = this.fetch, fetchOpts = this.fetchOpts, apiUrl = this.apiUrl, apiKey = this.apiKey, apiExtra = this.apiExtra, headers = this.headers, } = {}) { | ||
changeService({ service = this.service, fetchFn = this.fetch, fetchOpts = this.fetchOpts, apiUrl = this.apiUrl, apiKey = this.apiKey, apiExtra = this.apiExtra, origin = this.origin, headers = this.headers, } = {}) { | ||
this.service = service; | ||
@@ -34,2 +36,3 @@ this.fetch = fetchFn; | ||
this.headers = headers; | ||
this.origin = origin; | ||
this.provider = new TranslationProvider({ | ||
@@ -41,2 +44,3 @@ fetchFn: this.fetch, | ||
apiExtra: this.apiExtra ?? undefined, | ||
origin: this.origin ?? undefined, | ||
headers: this.headers, | ||
@@ -43,0 +47,0 @@ }).getProvider(this.service); |
export { default } from "./client.js"; | ||
export * as TranslationTypes from "@/types/index"; | ||
export * as TranslationProvider from "@/providers"; | ||
export * as TranslationTypes from "./types/index.js"; | ||
export * as TranslationProvider from "./providers/index.js"; | ||
//# sourceMappingURL=index.d.ts.map |
export { default } from "./client.js"; | ||
export * as TranslationTypes from "@/types/index"; | ||
export * as TranslationProvider from "@/providers"; | ||
export * as TranslationTypes from "./types/index.js"; | ||
export * as TranslationProvider from "./providers/index.js"; |
@@ -1,10 +0,17 @@ | ||
import { FetchFunction, Lang } from "@/types/client"; | ||
import { BaseProviderOpts, DetectResponse, GetLangsResponse, ProviderResponse, RequestMethod, TranslationResponse } from "@/types/providers/base"; | ||
export declare class BaseProvider { | ||
import { FetchFunction, Lang } from "../types/client.js"; | ||
import { BaseProviderOpts, DetectResponse, GetLangsResponse, ProviderResponse, RequestMethod, TranslationResponse } from "../types/providers/base.js"; | ||
export default class BaseProvider { | ||
apiUrl: string; | ||
apiExtra?: unknown; | ||
apiKey?: string; | ||
origin: string; | ||
apiUrlPlaceholder: string; | ||
originPlaceholder: string; | ||
fetch: FetchFunction; | ||
headers: Record<string, unknown>; | ||
fetchOpts: Record<string, unknown>; | ||
constructor({ fetchFn, fetchOpts, apiUrl, headers, }?: BaseProviderOpts); | ||
baseLang: string; | ||
constructor({ fetchFn, fetchOpts, apiUrl, apiExtra, apiKey, origin, headers, }?: BaseProviderOpts); | ||
updateData({ apiUrl, headers, origin }?: Partial<BaseProviderOpts>): void; | ||
isValidUrl(url: string | undefined): url is string; | ||
getOpts(body: unknown, headers?: Record<string, string>, method?: RequestMethod): { | ||
@@ -11,0 +18,0 @@ method: RequestMethod; |
@@ -1,22 +0,36 @@ | ||
import config from "@/config/config"; | ||
import { NotSupportMethodError } from "@/errors"; | ||
import { fetchWithTimeout } from "@/utils/utils"; | ||
export class BaseProvider { | ||
import config from "../config/config.js"; | ||
import { NotSupportMethodError } from "../errors.js"; | ||
import { fetchWithTimeout } from "../utils/utils.js"; | ||
export default class BaseProvider { | ||
apiUrl; | ||
apiExtra; | ||
apiKey; | ||
origin; | ||
apiUrlPlaceholder = config.originPlaceholder; | ||
originPlaceholder = config.originPlaceholder; | ||
fetch; | ||
headers = {}; | ||
fetchOpts; | ||
constructor({ fetchFn = fetchWithTimeout, fetchOpts = {}, apiUrl = config.originPlaceholder, headers = {}, } = {}) { | ||
baseLang = config.baseLang; | ||
constructor({ fetchFn = fetchWithTimeout, fetchOpts = {}, apiUrl = this.apiUrlPlaceholder, apiExtra, apiKey, origin, headers = {}, } = {}) { | ||
this.fetch = fetchFn; | ||
this.fetchOpts = fetchOpts; | ||
this.apiUrl = /^(http(s)?):\/\//.test(String(apiUrl)) | ||
? apiUrl | ||
: config.originPlaceholder; | ||
this.origin = this.apiUrl.split("/", 3).join("/"); | ||
this.apiExtra = apiExtra; | ||
this.apiKey = apiKey; | ||
this.updateData({ apiUrl, headers, origin }); | ||
} | ||
updateData({ apiUrl, headers, origin } = {}) { | ||
this.apiUrl = this.isValidUrl(apiUrl) ? apiUrl : this.apiUrlPlaceholder; | ||
const originPlaceholder = this.originPlaceholder !== config.originPlaceholder | ||
? this.originPlaceholder | ||
: this.apiUrl.split("/", 3).join("/"); | ||
this.origin = this.isValidUrl(origin) ? origin : originPlaceholder; | ||
this.headers = { | ||
...this.headers, | ||
headers, | ||
...headers, | ||
}; | ||
} | ||
isValidUrl(url) { | ||
return /^(http(s)?):\/\//.test(String(url)); | ||
} | ||
getOpts(body, headers = {}, method = "POST") { | ||
@@ -23,0 +37,0 @@ return { |
@@ -1,2 +0,2 @@ | ||
import { BaseProviderOpts } from "@/types/providers/base"; | ||
import { BaseProviderOpts } from "../types/providers/base.js"; | ||
import YandexBrowserProvider from "./yandexbrowser.js"; | ||
@@ -6,6 +6,7 @@ import YandexCloudProvider from "./yandexcloud.js"; | ||
import MSEdgeTranslateProvider from "./msedge.js"; | ||
export * as YandexBrowserProvider from "./yandexbrowser.js"; | ||
export * as YandexCloudProvider from "./yandexcloud.js"; | ||
export * as YandexTranslateProvider from "./yandextranslate.js"; | ||
export * as MSEdgeTranslateProvider from "./msedge.js"; | ||
export { default as BaseProvider } from "./base.js"; | ||
export { default as YandexBrowserProvider } from "./yandexbrowser.js"; | ||
export { default as YandexCloudProvider } from "./yandexcloud.js"; | ||
export { default as YandexTranslateProvider } from "./yandextranslate.js"; | ||
export { default as MSEdgeTranslateProvider } from "./msedge.js"; | ||
export declare const availableProviders: { | ||
@@ -12,0 +13,0 @@ yandexbrowser: typeof YandexBrowserProvider; |
@@ -1,2 +0,2 @@ | ||
import { TranslationService } from "@/types/client"; | ||
import { TranslationService } from "../types/client.js"; | ||
import YandexBrowserProvider from "./yandexbrowser.js"; | ||
@@ -6,6 +6,7 @@ import YandexCloudProvider from "./yandexcloud.js"; | ||
import MSEdgeTranslateProvider from "./msedge.js"; | ||
export * as YandexBrowserProvider from "./yandexbrowser.js"; | ||
export * as YandexCloudProvider from "./yandexcloud.js"; | ||
export * as YandexTranslateProvider from "./yandextranslate.js"; | ||
export * as MSEdgeTranslateProvider from "./msedge.js"; | ||
export { default as BaseProvider } from "./base.js"; | ||
export { default as YandexBrowserProvider } from "./yandexbrowser.js"; | ||
export { default as YandexCloudProvider } from "./yandexcloud.js"; | ||
export { default as YandexTranslateProvider } from "./yandextranslate.js"; | ||
export { default as MSEdgeTranslateProvider } from "./msedge.js"; | ||
export const availableProviders = { | ||
@@ -12,0 +13,0 @@ [TranslationService.yandexbrowser]: YandexBrowserProvider, |
@@ -1,9 +0,9 @@ | ||
import { BaseProvider } from "./base.js"; | ||
import { Lang } from "@/types/client"; | ||
import { DetectResponse, GetLangsResponse, ProviderResponse, ProviderSuccessResponse, RequestMethod, TranslationResponse } from "@/types/providers/base"; | ||
import { FailedResponse, ProfanityAction, RawTranslateResponse, Session } from "@/types/providers/msedge"; | ||
import BaseProvider from "./base.js"; | ||
import { Lang } from "../types/client.js"; | ||
import { BaseProviderOpts, DetectResponse, GetLangsResponse, ProviderResponse, ProviderSuccessResponse, RequestMethod, TranslationResponse } from "../types/providers/base.js"; | ||
import { FailedResponse, ProfanityAction, RawTranslateResponse, Session } from "../types/providers/msedge.js"; | ||
export default class MSEdgeTranslateProvider extends BaseProvider { | ||
apiOrigin: string; | ||
sessionOrigin: string; | ||
origin: string; | ||
apiUrlPlaceholder: string; | ||
sessionUrl: string; | ||
originPlaceholder: string; | ||
headers: { | ||
@@ -13,4 +13,4 @@ "Content-Type": string; | ||
}; | ||
baseLang: string; | ||
session: Session | null; | ||
constructor(options?: BaseProviderOpts); | ||
getSession(): Promise<Session>; | ||
@@ -17,0 +17,0 @@ getOpts(body: string | null, headers?: Record<string, string>, method?: RequestMethod): { |
@@ -1,10 +0,9 @@ | ||
import { BaseProvider } from "./base.js"; | ||
import config from "@/config/config"; | ||
import { ProfanityAction, } from "@/types/providers/msedge"; | ||
import { DetectError, GetLangsError, ProviderError, TranslateError, } from "@/errors"; | ||
import { getTimestamp } from "@/utils/utils"; | ||
import BaseProvider from "./base.js"; | ||
import { ProfanityAction, } from "../types/providers/msedge.js"; | ||
import { DetectError, GetLangsError, ProviderError, TranslateError, } from "../errors.js"; | ||
import { getTimestamp } from "../utils/utils.js"; | ||
export default class MSEdgeTranslateProvider extends BaseProvider { | ||
apiOrigin = "https://api-edge.cognitive.microsofttranslator.com"; | ||
sessionOrigin = "https://edge.microsoft.com"; | ||
origin = "https://www.bing.com"; | ||
apiUrlPlaceholder = "https://api-edge.cognitive.microsofttranslator.com"; | ||
sessionUrl = "https://edge.microsoft.com"; | ||
originPlaceholder = "https://www.bing.com"; | ||
headers = { | ||
@@ -14,4 +13,7 @@ "Content-Type": "application/json", | ||
}; | ||
baseLang = config.baseLang; | ||
session = null; | ||
constructor(options = {}) { | ||
super(options); | ||
this.updateData(options); | ||
} | ||
async getSession() { | ||
@@ -54,3 +56,3 @@ const timestamp = getTimestamp(); | ||
try { | ||
const res = await this.fetch(`${this.apiOrigin}${path}`, options); | ||
const res = await this.fetch(`${this.apiUrl}${path}`, options); | ||
const data = (await res.json()); | ||
@@ -74,3 +76,3 @@ if (this.isErrorRes(res, data)) { | ||
const options = this.getOpts(null, undefined, "GET"); | ||
const res = await this.fetch(`${this.sessionOrigin}/translate/auth`, options).catch(() => null); | ||
const res = await this.fetch(`${this.sessionUrl}/translate/auth`, options).catch(() => null); | ||
if (!res || res.status !== 200) { | ||
@@ -77,0 +79,0 @@ throw new ProviderError("Failed to request create session"); |
@@ -1,8 +0,8 @@ | ||
import { BaseProvider } from "./base.js"; | ||
import { Lang } from "@/types/client"; | ||
import { DetectResponse, GetLangsResponse, ProviderResponse, ProviderSuccessResponse, RequestMethod, TranslationResponse } from "@/types/providers/base"; | ||
import { FailedResponse, MinimalResponse } from "@/types/providers/yandextranslate"; | ||
import BaseProvider from "./base.js"; | ||
import { Lang } from "../types/client.js"; | ||
import { BaseProviderOpts, DetectResponse, GetLangsResponse, ProviderResponse, ProviderSuccessResponse, RequestMethod, TranslationResponse } from "../types/providers/base.js"; | ||
import { FailedResponse, MinimalResponse } from "../types/providers/yandextranslate.js"; | ||
export default class YandexBrowserProvider extends BaseProvider { | ||
apiOrigin: string; | ||
origin: string; | ||
apiUrlPlaceholder: string; | ||
originPlaceholder: string; | ||
headers: { | ||
@@ -13,2 +13,3 @@ "Content-Type": string; | ||
srv: string; | ||
constructor(options?: BaseProviderOpts); | ||
getOpts(body: unknown, headers?: Record<string, string>, method?: RequestMethod): { | ||
@@ -15,0 +16,0 @@ method: RequestMethod; |
@@ -1,7 +0,7 @@ | ||
import { BaseProvider } from "./base.js"; | ||
import config from "@/config/config"; | ||
import { DetectEmptyLangError, DetectError, GetLangsError, ProviderError, TranslateError, } from "@/errors"; | ||
import BaseProvider from "./base.js"; | ||
import config from "../config/config.js"; | ||
import { DetectEmptyLangError, DetectError, GetLangsError, ProviderError, TranslateError, } from "../errors.js"; | ||
export default class YandexBrowserProvider extends BaseProvider { | ||
apiOrigin = "https://browser.translate.yandex.net/api/v1/tr.json"; | ||
origin = "https://youtube.com"; | ||
apiUrlPlaceholder = "https://browser.translate.yandex.net/api/v1/tr.json"; | ||
originPlaceholder = "https://youtube.com"; | ||
headers = { | ||
@@ -12,2 +12,6 @@ "Content-Type": "application/x-www-form-urlencoded", | ||
srv = "browser_video_translation"; | ||
constructor(options = {}) { | ||
super(options); | ||
this.updateData(options); | ||
} | ||
getOpts(body, headers = {}, method = "POST") { | ||
@@ -52,3 +56,3 @@ return { | ||
try { | ||
const res = await this.fetch(`${this.apiOrigin}${path}`, options); | ||
const res = await this.fetch(`${this.apiUrl}${path}`, options); | ||
const data = (await res.json()); | ||
@@ -55,0 +59,0 @@ if (!this.isMinimalResponse(data)) { |
@@ -1,8 +0,8 @@ | ||
import { BaseProvider } from "./base.js"; | ||
import { Lang } from "@/types/client"; | ||
import { DetectResponse, GetLangsResponse, ProviderResponse, ProviderSuccessResponse, RequestMethod, TranslationResponse } from "@/types/providers/base"; | ||
import { FailedResponse } from "@/types/providers/yandexcloud"; | ||
import BaseProvider from "./base.js"; | ||
import { Lang } from "../types/client.js"; | ||
import { BaseProviderOpts, DetectResponse, GetLangsResponse, ProviderResponse, ProviderSuccessResponse, RequestMethod, TranslationResponse } from "../types/providers/base.js"; | ||
import { FailedResponse } from "../types/providers/yandexcloud.js"; | ||
export default class YandexCloudProvider extends BaseProvider { | ||
apiOrigin: string; | ||
origin: string; | ||
apiUrlPlaceholder: string; | ||
originPlaceholder: string; | ||
headers: { | ||
@@ -12,3 +12,3 @@ "Content-Type": string; | ||
}; | ||
baseLang: string; | ||
constructor(options?: BaseProviderOpts); | ||
getOpts(body: unknown, headers?: Record<string, string>, method?: RequestMethod): { | ||
@@ -15,0 +15,0 @@ method: RequestMethod; |
@@ -1,7 +0,7 @@ | ||
import { BaseProvider } from "./base.js"; | ||
import config from "@/config/config"; | ||
import { DetectEmptyLangError, DetectError, GetLangsError, ProviderError, TranslateError, } from "@/errors"; | ||
import BaseProvider from "./base.js"; | ||
import config from "../config/config.js"; | ||
import { DetectEmptyLangError, DetectError, GetLangsError, ProviderError, TranslateError, } from "../errors.js"; | ||
export default class YandexCloudProvider extends BaseProvider { | ||
apiOrigin = "https://cloud.yandex.ru/api/translate"; | ||
origin = "https://cloud.yandex.ru"; | ||
apiUrlPlaceholder = "https://cloud.yandex.ru/api/translate"; | ||
originPlaceholder = "https://cloud.yandex.ru"; | ||
headers = { | ||
@@ -11,3 +11,6 @@ "Content-Type": "application/json", | ||
}; | ||
baseLang = config.baseLang; | ||
constructor(options = {}) { | ||
super(options); | ||
this.updateData(options); | ||
} | ||
getOpts(body, headers = {}, method = "POST") { | ||
@@ -35,3 +38,3 @@ return { | ||
try { | ||
const res = await this.fetch(`${this.apiOrigin}${path}`, options); | ||
const res = await this.fetch(`${this.apiUrl}${path}`, options); | ||
const data = (await res.json()); | ||
@@ -38,0 +41,0 @@ if (this.isErrorRes(res, data)) { |
@@ -1,11 +0,11 @@ | ||
import { BaseProvider } from "./base.js"; | ||
import { Lang } from "@/types/client"; | ||
import { DetectResponse, GetLangsResponse, ProviderResponse, ProviderSuccessResponse, RequestMethod, TranslationResponse } from "@/types/providers/base"; | ||
import { DetectOptions, FailedResponse, Session, Srv, TranslateOptions } from "@/types/providers/yandextranslate"; | ||
import BaseProvider from "./base.js"; | ||
import { Lang } from "../types/client.js"; | ||
import { BaseProviderOpts, DetectResponse, GetLangsResponse, ProviderResponse, ProviderSuccessResponse, RequestMethod, TranslationResponse } from "../types/providers/base.js"; | ||
import { DetectOptions, FailedResponse, Session, Srv, TranslateOptions } from "../types/providers/yandextranslate.js"; | ||
export default class YandexTranslateProvider extends BaseProvider { | ||
MAX_UID: number; | ||
NANO_DIFF: number; | ||
apiOrigin: string; | ||
sessionOrigin: string; | ||
origin: string; | ||
sessionUrl: string; | ||
apiUrlPlaceholder: string; | ||
originPlaceholder: string; | ||
headers: { | ||
@@ -15,4 +15,4 @@ "Content-Type": string; | ||
}; | ||
baseLang: string; | ||
session: Session | null; | ||
constructor(options?: BaseProviderOpts); | ||
genYandexUID(): string; | ||
@@ -19,0 +19,0 @@ genYandexMetrikaUID(): string; |
@@ -1,12 +0,12 @@ | ||
import { BaseProvider } from "./base.js"; | ||
import config from "@/config/config"; | ||
import { DetectOptions, TranslateOptions, } from "@/types/providers/yandextranslate"; | ||
import { DetectEmptyLangError, DetectError, GetLangsError, ProviderError, TranslateError, } from "@/errors"; | ||
import { getTimestamp } from "@/utils/utils"; | ||
import BaseProvider from "./base.js"; | ||
import config from "../config/config.js"; | ||
import { DetectOptions, TranslateOptions, } from "../types/providers/yandextranslate.js"; | ||
import { DetectEmptyLangError, DetectError, GetLangsError, ProviderError, TranslateError, } from "../errors.js"; | ||
import { getTimestamp } from "../utils/utils.js"; | ||
export default class YandexTranslateProvider extends BaseProvider { | ||
MAX_UID = Number(10000000000000000000n); | ||
NANO_DIFF = 1000000; | ||
apiOrigin = "https://translate.yandex.net/api/v1/tr.json"; | ||
sessionOrigin = "https://translate.yandex.ru/props/api/v1.0"; | ||
origin = "https://translate.yandex.ru"; | ||
sessionUrl = "https://translate.yandex.ru/props/api/v1.0"; | ||
apiUrlPlaceholder = "https://translate.yandex.net/api/v1/tr.json"; | ||
originPlaceholder = "https://translate.yandex.ru"; | ||
headers = { | ||
@@ -16,4 +16,7 @@ "Content-Type": "application/x-www-form-urlencoded", | ||
}; | ||
baseLang = config.baseLang; | ||
session = null; | ||
constructor(options = {}) { | ||
super(options); | ||
this.updateData(options); | ||
} | ||
genYandexUID() { | ||
@@ -69,5 +72,3 @@ return BigInt(Math.floor(Math.random() * this.MAX_UID)).toString(); | ||
try { | ||
const origin = path.includes("/sessions") | ||
? this.sessionOrigin | ||
: this.apiOrigin; | ||
const origin = path.includes("/sessions") ? this.sessionUrl : this.apiUrl; | ||
const res = await this.fetch(`${origin}${path}`, options); | ||
@@ -74,0 +75,0 @@ const data = (await res.json()); |
@@ -30,3 +30,4 @@ import { Type, Static } from '@sinclair/typebox' | ||
apiExtra: Type.Optional(Type.Unknown()), | ||
origin: Type.Optional(Type.String()), | ||
headers: Type.Optional(Type.Record(Type.String(), Type.Unknown())) | ||
}) |
@@ -17,4 +17,5 @@ export type FetchFunction = (input: string | URL | Request, init?: any) => Promise<Response>; | ||
apiExtra?: unknown; | ||
origin?: string; | ||
headers?: Record<string, unknown>; | ||
}; | ||
//# sourceMappingURL=client.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import config from "@/config/config"; | ||
import config from "../config/config.js"; | ||
export async function fetchWithTimeout(url, options = { | ||
@@ -3,0 +3,0 @@ headers: { |
{ | ||
"name": "@toil/translate", | ||
"description": "An unofficial library to use Yandex Translation API for free", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": "Toil", | ||
"license": "MIT", | ||
"type": "module", | ||
"types": "./dist/index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/FOSWLY/translate" | ||
}, | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.js", | ||
"homepage": "https://github.com/FOSWLY/translate", | ||
"devDependencies": { | ||
@@ -18,7 +17,8 @@ "@sinclair/typebox-codegen": "^0.10.5", | ||
"eslint-plugin-oxlint": "0.10.0", | ||
"eslint-plugin-sonarjs": "2.0.4", | ||
"eslint-plugin-sonarjs": "^2.0.4", | ||
"husky": "^9.1.6", | ||
"oxlint": "0.10.0", | ||
"oxlint": "^0.10.0", | ||
"tsc-alias": "^1.8.10", | ||
"tsc-esm-fix": "^3.1.0", | ||
"typedoc": "0.26.10", | ||
"typedoc": "^0.26.10", | ||
"typedoc-plugin-include-example": "^1.3.0", | ||
@@ -28,6 +28,2 @@ "typedoc-plugin-rename-defaults": "^0.7.1", | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/FOSWLY/translate" | ||
}, | ||
"peerDependencies": { | ||
@@ -71,2 +67,3 @@ "typescript": "^5.6.2" | ||
}, | ||
"description": "A library for free and not only using various translation APIs", | ||
"engines": { | ||
@@ -78,2 +75,3 @@ "node": ">=18" | ||
], | ||
"homepage": "https://github.com/FOSWLY/translate", | ||
"keywords": [ | ||
@@ -88,2 +86,3 @@ "yandex", | ||
], | ||
"license": "MIT", | ||
"publishConfig": { | ||
@@ -94,3 +93,3 @@ "access": "public" | ||
"test": "bun test", | ||
"build:default": "tsc --project tsconfig.build.json --outdir ./dist && tsc-esm-fix --tsconfig tsconfig.build.json", | ||
"build:default": "tsc --project tsconfig.build.json --outdir ./dist && tsc-alias -p tsconfig.build.json && tsc-esm-fix --tsconfig tsconfig.build.json", | ||
"build:typebox": "bun run ./scripts/typebox-gen.ts", | ||
@@ -101,3 +100,5 @@ "build:doc": "typedoc --options typedoc.json --tsconfig tsconfig.build.json", | ||
"prepare": "husky" | ||
} | ||
}, | ||
"type": "module", | ||
"types": "./dist/index.d.ts" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
68661
1288
14