diff --git a/apps/api/src/auth.ts b/apps/api/src/auth.ts index 0afb27f2..d6ddc528 100644 --- a/apps/api/src/auth.ts +++ b/apps/api/src/auth.ts @@ -59,7 +59,8 @@ export const authRouter = issuer({ console.log('Auth success', provider, ctx, JSON.stringify(value, null, 2)) function getPartialOAuthAccount() { - assert(provider === 'github', `Unsupported provider "${provider}"`) + assert(provider === 'github', `Unsupported OAuth provider "${provider}"`) + const now = Date.now() return { provider, @@ -67,19 +68,17 @@ export const authRouter = issuer({ refreshToken: value.tokenset.refresh, // `expires_in` and `refresh_token_expires_in` are given in seconds accessTokenExpiresAt: new Date( - Date.now() + value.tokenset.raw.expires_in * 1000 + now + value.tokenset.raw.expires_in * 1000 ), refreshTokenExpiresAt: new Date( - Date.now() + value.tokenset.raw.refresh_token_expires_in * 1000 + now + value.tokenset.raw.refresh_token_expires_in * 1000 ), scope: (value.tokenset.raw.scope as string) || undefined } } if (provider === 'github') { - const client = getGitHubClient({ - accessToken: value.tokenset.access - }) + const client = getGitHubClient({ accessToken: value.tokenset.access }) const { data: ghUser } = await client.rest.users.getAuthenticated() if (!ghUser.email) { @@ -125,14 +124,14 @@ export const authRouter = issuer({ assert( user, 400, - `Authentication error: unsupported provider "${provider}"` + `Authentication error: unsupported auth provider "${provider}"` ) } assert( user, 500, - `Authentication error for provider "${provider}": Unexpected error initializing user` + `Authentication error for auth provider "${provider}": Unexpected error initializing user` ) return ctx.subject('user', pick(user, 'id', 'username')) } diff --git a/apps/e2e/tsup.config.ts b/apps/e2e/tsup.config.ts deleted file mode 100644 index d468120a..00000000 --- a/apps/e2e/tsup.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'tsup' - -export default defineConfig([ - { - entry: ['src/server.ts'], - outDir: 'dist', - target: 'node18', - platform: 'node', - format: ['esm'], - splitting: false, - sourcemap: true, - minify: false, - shims: true, - dts: true - } -]) diff --git a/apps/e2e/vitest.config.ts b/apps/e2e/vitest.config.ts index ed9bf14b..57693adf 100644 --- a/apps/e2e/vitest.config.ts +++ b/apps/e2e/vitest.config.ts @@ -1,8 +1,6 @@ -import tsconfigPaths from 'vite-tsconfig-paths' import { defineConfig } from 'vitest/config' export default defineConfig({ - plugins: [tsconfigPaths()], test: { environment: 'node', globals: true, diff --git a/packages/types/package.json b/packages/types/package.json index 8effb138..fd69ae8c 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,7 +1,7 @@ { "name": "@agentic/platform-types", "version": "0.0.1", - "description": "Core zod schemas and types shared across the Agentic platform.", + "description": "Core schemas and types shared across the Agentic platform.", "author": "Travis Fischer ", "license": "UNLICENSED", "repository": { diff --git a/packages/types/src/types.ts b/packages/types/src/types.ts index 6eda8298..e7656670 100644 --- a/packages/types/src/types.ts +++ b/packages/types/src/types.ts @@ -26,10 +26,3 @@ export type AdminDeployment = Simplify< pricingPlans: PricingPlan[] } > - -export type ProjectIdentifier = components['schemas']['ProjectIdentifier'] -export type DeploymentIdentifier = components['schemas']['DeploymentIdentifier'] - -// export type PricingPlanName = components['schemas']['name'] -// export type PricingPlanSlug = components['schemas']['slug'] -// export type PricingPlanLabel = components['schemas']['label']