fix@sdk: types export

This commit is contained in:
Artemy 2024-05-13 12:54:14 +03:00
parent 1a8eadea7b
commit 494d1c8134
11 changed files with 3875 additions and 3026 deletions

View File

@ -1,7 +1,6 @@
import { Readability as OReadability } from '@mozilla/readability';
import { EngineParseError } from '@txtdot/sdk/dist/types/errors';
import { Engine } from '@txtdot/sdk';
import { Engine, EngineParseError } from '@txtdot/sdk';
const Readability = new Engine(
'Readability',

View File

@ -1,5 +1,5 @@
import { Engine } from '@txtdot/sdk';
import { HandlerInput, Route } from '@txtdot/sdk/dist/types/handler';
import { HandlerInput, Route } from '@txtdot/sdk';
const SearX = new Engine('SearX', "Engine for searching with 'SearXNG'", [
'searx.*',

View File

@ -1,4 +1,4 @@
import { HandlerInput, Route } from '@txtdot/sdk/dist/types/handler';
import { HandlerInput, Route } from '@txtdot/sdk';
async function questions(
input: HandlerInput,

View File

@ -1,4 +1,4 @@
import { HandlerInput, Route } from '@txtdot/sdk/dist/types/handler';
import { HandlerInput, Route } from '@txtdot/sdk';
async function users(
input: HandlerInput,

View File

@ -1,6 +1,6 @@
{
"name": "@txtdot/sdk",
"version": "1.1.1",
"version": "1.1.2",
"description": "SDK for creating plugins for TxtDot",
"main": "dist/lib.js",
"types": "dist/lib.d.ts",

View File

@ -1,3 +1,35 @@
import { Engine } from './engine';
export { Engine };
import {
EngineParseError,
NoHandlerFoundError,
TxtDotError,
} from './types/errors';
import {
EngineFunction,
EngineMatch,
Engines,
RouteValues,
EnginesMatch,
HandlerInput,
IHandlerOutput,
Route,
handlerSchema,
} from './types/handler';
export {
Engine,
EngineParseError,
NoHandlerFoundError,
TxtDotError,
EngineFunction,
EngineMatch,
Engines,
RouteValues,
EnginesMatch,
HandlerInput,
IHandlerOutput,
Route,
handlerSchema,
};

View File

@ -8,7 +8,7 @@ import replaceHref from './utils/replace-href';
import { parseHTML } from 'linkedom';
import { Engine } from '@txtdot/sdk';
import { HandlerInput, IHandlerOutput } from '@txtdot/sdk/dist/types/handler';
import { HandlerInput, IHandlerOutput } from '@txtdot/sdk';
import config from './config';
interface IEngineId {

View File

@ -2,7 +2,7 @@ import { FastifyReply, FastifyRequest } from 'fastify';
import { NotHtmlMimetypeError } from './main';
import { getFastifyError } from './validation';
import { TxtDotError } from '@txtdot/sdk/dist/types/errors';
import { TxtDotError } from '@txtdot/sdk';
import { IGetSchema } from '../types/requests/browser';
import config from '../config';

View File

@ -1,5 +1,5 @@
import config from '../config';
import { TxtDotError } from '@txtdot/sdk/dist/types/errors';
import { TxtDotError } from '@txtdot/sdk';
export class LocalResourceError extends TxtDotError {
constructor() {

View File

@ -2,7 +2,7 @@ import { FastifySchema, FastifyRequest } from 'fastify';
import { IApiError, errorResponseSchema } from '../../errors/api';
import { engineList } from '../../plugin_manager';
import { FromSchema } from 'json-schema-to-ts';
import { handlerSchema } from '@txtdot/sdk/dist/types/handler';
import { handlerSchema } from '@txtdot/sdk';
export interface IApiResponse<T> {
data?: T;

File diff suppressed because it is too large Load Diff