pull/643/head^2
Travis Fischer 2024-06-01 21:11:07 -05:00
rodzic 8aa53fed71
commit 1d953a0ed2
5 zmienionych plików z 19 dodań i 23 usunięć

Wyświetl plik

@ -27,6 +27,11 @@
"types": "./dist/sdks/ai-sdk.d.ts",
"import": "./dist/sdks/ai-sdk.js",
"default": "./dist/sdks/ai-sdk.js"
},
"./dexter": {
"types": "./dist/sdks/dexter.d.ts",
"import": "./dist/sdks/dexter.js",
"default": "./dist/sdks/dexter.js"
}
},
"files": [
@ -50,16 +55,10 @@
},
"dependencies": {
"@nangohq/node": "^0.39.32",
"chalk": "^5.3.0",
"delay": "^6.0.0",
"dotenv": "^16.4.5",
"exit-hook": "^4.0.0",
"jsonrepair": "^3.6.1",
"ky": "^1.2.4",
"p-map": "^7.0.2",
"p-retry": "^6.2.0",
"p-throttle": "^6.1.0",
"restore-cursor": "^5.0.0",
"tiny-invariant": "^1.3.3",
"twitter-api-sdk": "^1.2.1",
"type-fest": "^4.18.3",
@ -73,23 +72,34 @@
"@types/node": "^20.12.7",
"ai": "^3.1.22",
"del-cli": "^5.1.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"exit-hook": "^4.0.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.5",
"np": "^10.0.5",
"npm-run-all2": "^6.2.0",
"only-allow": "^1.2.1",
"prettier": "^3.2.5",
"restore-cursor": "^5.0.0",
"ts-node": "^10.9.2",
"tsup": "^8.0.2",
"tsx": "^4.11.0",
"typescript": "^5.4.5",
"vitest": "2.0.0-beta.3"
},
"optionalDependencies": {
"peerDependencies": {
"@dexaai/dexter": "^2.0.3",
"ai": "^3.1.22"
},
"peerDependenciesMeta": {
"@dexaai/dexter": {
"optional": true
},
"ai": {
"optional": true
}
},
"lint-staged": {
"*.{ts,tsx}": [
"eslint --fix",

Wyświetl plik

@ -1,5 +1,3 @@
export { AbortError, type FailedAttemptError } from 'p-retry'
export class RetryableError extends Error {}
export class ParseError extends RetryableError {}

Wyświetl plik

@ -1,6 +1,6 @@
import './symbol-polyfill.js'
import type * as z from 'zod'
import type { z } from 'zod'
import type * as types from './types.js'
import { createAIFunction } from './ai-function.js'

Wyświetl plik

@ -1,5 +1,4 @@
import defaultKy, { type KyInstance } from 'ky'
import { AbortError } from 'p-retry'
import pThrottle from 'p-throttle'
import { assert, getEnv, throttleKy } from '../utils.js'
@ -391,17 +390,6 @@ export class DiffbotClient {
}
}
// TODO
const { url } = searchParams
if (url) {
const parsedUrl = new URL(url)
if (parsedUrl.hostname.includes('theguardian.com')) {
throw new AbortError(
`Diffbot does not support URLs from domain "${parsedUrl.hostname}"`
)
}
}
// console.log(`DiffbotClient._extract: ${endpoint}`, searchParams)
return this.ky

Wyświetl plik

@ -2,7 +2,7 @@ import { defineConfig } from 'tsup'
export default defineConfig([
{
entry: ['src/index.ts', 'src/sdks/ai-sdk.ts'],
entry: ['src/index.ts', 'src/sdks/ai-sdk.ts', 'src/sdks/dexter.ts'],
outDir: 'dist',
target: 'node18',
platform: 'node',