Skip to content

Commit 3f24617

Browse files
committed
chore: fix types in sandbox-container app
1 parent 9d0c435 commit 3f24617

File tree

4 files changed

+5714
-5
lines changed

4 files changed

+5714
-5
lines changed

apps/sandbox-container/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"build": "docker build .",
1111
"start": "wrangler dev",
1212
"start:container": "tsx container/index.ts",
13-
"postinstall": "mkdir -p workdir"
13+
"postinstall": "mkdir -p workdir",
14+
"types": "wrangler types"
1415
},
1516
"dependencies": {
1617
"@cloudflare/workers-oauth-provider": "0.0.2",

apps/sandbox-container/server/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import OAuthProvider from '@cloudflare/workers-oauth-provider'
2+
import { env } from 'cloudflare:workers'
23

34
import {
4-
AccountSchema,
55
CloudflareAuthHandler,
66
handleTokenExchangeCallback,
7-
UserSchema,
87
} from '@repo/mcp-common/src/cloudflare-oauth-handler'
98

109
import { ContainerManager } from './containerManager'
1110
import { ContainerMcpAgent } from './containerMcp'
1211

12+
import type { AccountSchema, UserSchema } from '@repo/mcp-common/src/cloudflare-oauth-handler'
13+
1314
export { ContainerManager, ContainerMcpAgent }
1415

1516
export type Env = {
@@ -34,7 +35,8 @@ export default new OAuthProvider({
3435
defaultHandler: CloudflareAuthHandler,
3536
authorizeEndpoint: '/oauth/authorize',
3637
tokenEndpoint: '/token',
37-
tokenExchangeCallback: handleTokenExchangeCallback,
38+
tokenExchangeCallback: (options) =>
39+
handleTokenExchangeCallback(options, env.CLOUDFLARE_CLIENT_ID, env.CLOUDFLARE_CLIENT_SECRET),
3840
// Cloudflare access token TTL
3941
accessTokenTTL: 3600,
4042
clientRegistrationEndpoint: '/register',

apps/sandbox-container/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"jsx": "react-jsx",
66
"module": "ESNext",
77
"moduleResolution": "bundler",
8-
"types": ["@cloudflare/workers-types/2023-07-01"],
8+
"types": ["./worker-configuration.d.ts", "@cloudflare/workers-types/2023-07-01"],
99
"noEmit": true,
1010
"esModuleInterop": true,
1111
"forceConsistentCasingInFileNames": true,

0 commit comments

Comments
 (0)