From b11a36279313eeb50270c76b2cdce4c2b8ce58e5 Mon Sep 17 00:00:00 2001 From: Ryan Edge Date: Fri, 11 Aug 2023 17:48:24 -0400 Subject: [PATCH] Add fern export of library --- src/index.ts | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/index.ts b/src/index.ts index 016fd84..d1df79a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,29 +1 @@ -import api from '@api/edenai' - -import type { - TextModerationCreateBodyParam, - TextModerationCreateResponse200, -} from '@api/edenai/types' -import { ResultAsync, err, ok } from 'neverthrow' - -export default class Client { - constructor(token: string) { - api.auth(token) - } - - public textModeration( - params: TextModerationCreateBodyParam, - ): ResultAsync { - return ResultAsync.fromPromise( - api.text_moderation_create(params), - (originalError) => new Error('issue', { cause: originalError }), - ).andThen((response) => { - if (response.status !== 200) err(response.data) - return ok(response.data) - }) - } -} - -export class TextModerationError extends Error {} - -export type TextModerationResult = TextModerationCreateResponse200 +export * from './generated/typescript'