kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
chore: knip; remove unused files/deps/exports
rodzic
31c6a54169
commit
795616fab5
|
@ -27,7 +27,6 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@agentic/platform-core": "workspace:*",
|
"@agentic/platform-core": "workspace:*",
|
||||||
"@agentic/platform-openapi": "workspace:*",
|
|
||||||
"@agentic/platform-schemas": "workspace:*",
|
"@agentic/platform-schemas": "workspace:*",
|
||||||
"@agentic/platform-validators": "workspace:*",
|
"@agentic/platform-validators": "workspace:*",
|
||||||
"@fisch0920/drizzle-orm": "^0.43.7",
|
"@fisch0920/drizzle-orm": "^0.43.7",
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
import type { OpenAPIHono } from '@hono/zod-openapi'
|
|
||||||
import { assert } from '@agentic/platform-core'
|
|
||||||
|
|
||||||
// TODO: Unused in favor of `better-auth`
|
|
||||||
export function registerV1OAuthRedirect(app: OpenAPIHono) {
|
|
||||||
return app.all('oauth', async (ctx) => {
|
|
||||||
if (ctx.req.query('state')) {
|
|
||||||
const { state: state64, ...query } = ctx.req.query()
|
|
||||||
|
|
||||||
// google oauth + others
|
|
||||||
const { uri, ...state } = JSON.parse(
|
|
||||||
Buffer.from(state64!, 'base64').toString()
|
|
||||||
) as any
|
|
||||||
|
|
||||||
assert(
|
|
||||||
uri,
|
|
||||||
404,
|
|
||||||
`Error oauth redirect not found "${new URLSearchParams(ctx.req.query()).toString()}"`
|
|
||||||
)
|
|
||||||
|
|
||||||
const searchParams = new URLSearchParams({
|
|
||||||
...state,
|
|
||||||
...query
|
|
||||||
})
|
|
||||||
|
|
||||||
ctx.redirect(`${uri}?${searchParams.toString()}`)
|
|
||||||
} else {
|
|
||||||
// github oauth
|
|
||||||
// https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#redirect-urls
|
|
||||||
const { uri, ...params } = ctx.req.query()
|
|
||||||
|
|
||||||
assert(
|
|
||||||
uri,
|
|
||||||
404,
|
|
||||||
`Error oauth redirect not found "${new URLSearchParams(ctx.req.query()).toString()}"`
|
|
||||||
)
|
|
||||||
|
|
||||||
const searchParams = new URLSearchParams(params)
|
|
||||||
ctx.redirect(`${uri}?${searchParams.toString()}`)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -25,29 +25,29 @@ export type * from './types'
|
||||||
export * from './utils'
|
export * from './utils'
|
||||||
export {
|
export {
|
||||||
and,
|
and,
|
||||||
arrayContained,
|
// arrayContained,
|
||||||
arrayContains,
|
// arrayContains,
|
||||||
arrayOverlaps,
|
// arrayOverlaps,
|
||||||
asc,
|
asc,
|
||||||
between,
|
// between,
|
||||||
desc,
|
desc,
|
||||||
eq,
|
eq,
|
||||||
exists,
|
// exists,
|
||||||
gt,
|
gt,
|
||||||
gte,
|
// gte,
|
||||||
ilike,
|
// ilike,
|
||||||
inArray,
|
// inArray,
|
||||||
isNotNull,
|
// isNotNull,
|
||||||
isNull,
|
isNull,
|
||||||
like,
|
like,
|
||||||
lt,
|
// lt,
|
||||||
lte,
|
// lte,
|
||||||
ne,
|
// ne,
|
||||||
not,
|
not,
|
||||||
notBetween,
|
// notBetween,
|
||||||
notExists,
|
// notExists,
|
||||||
notIlike,
|
// notIlike,
|
||||||
notInArray,
|
// notInArray,
|
||||||
notLike,
|
// notLike,
|
||||||
or
|
or
|
||||||
} from '@fisch0920/drizzle-orm'
|
} from '@fisch0920/drizzle-orm'
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
export * from './mock-sentry-node'
|
|
||||||
export * from './setup-mock-logger'
|
|
|
@ -1,25 +0,0 @@
|
||||||
import { vi } from 'vitest'
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mocks the entire @sentry/node module so that captureException is a spy.
|
|
||||||
*/
|
|
||||||
export function mockSentryNode(): void {
|
|
||||||
vi.mock('@sentry/node', async () => {
|
|
||||||
const actual = await vi.importActual('@sentry/node')
|
|
||||||
return {
|
|
||||||
...actual,
|
|
||||||
captureException: vi.fn(),
|
|
||||||
setTags: vi.fn(),
|
|
||||||
setTag: vi.fn(),
|
|
||||||
withIsolationScope: vi.fn((fn) => fn()),
|
|
||||||
startSpan: vi.fn((_, fn) => {
|
|
||||||
const fakeSpan = {
|
|
||||||
setAttributes: vi.fn(),
|
|
||||||
end: vi.fn()
|
|
||||||
}
|
|
||||||
const callbackResult = fn(fakeSpan)
|
|
||||||
return callbackResult
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
import type { Logger } from '@agentic/platform-core'
|
|
||||||
import { vi } from 'vitest'
|
|
||||||
|
|
||||||
export function setupMockLogger() {
|
|
||||||
return {
|
|
||||||
trace: vi.fn(),
|
|
||||||
debug: vi.fn(),
|
|
||||||
info: vi.fn(),
|
|
||||||
warn: vi.fn(),
|
|
||||||
error: vi.fn()
|
|
||||||
} as Logger
|
|
||||||
}
|
|
|
@ -27,8 +27,7 @@
|
||||||
"@agentic/platform-schemas": "workspace:*",
|
"@agentic/platform-schemas": "workspace:*",
|
||||||
"@openauthjs/openauth": "^0.4.3",
|
"@openauthjs/openauth": "^0.4.3",
|
||||||
"ky": "catalog:",
|
"ky": "catalog:",
|
||||||
"type-fest": "catalog:",
|
"type-fest": "catalog:"
|
||||||
"zod": "catalog:"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"openapi-typescript": "^7.8.0"
|
"openapi-typescript": "^7.8.0"
|
||||||
|
|
|
@ -42,8 +42,7 @@
|
||||||
"open": "^10.1.2",
|
"open": "^10.1.2",
|
||||||
"ora": "^8.2.0",
|
"ora": "^8.2.0",
|
||||||
"restore-cursor": "catalog:",
|
"restore-cursor": "catalog:",
|
||||||
"unconfig": "^7.3.2",
|
"unconfig": "^7.3.2"
|
||||||
"zod": "catalog:"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@agentic/platform-fixtures": "workspace:*",
|
"@agentic/platform-fixtures": "workspace:*",
|
||||||
|
|
Ładowanie…
Reference in New Issue