@@ -17,11 +17,7 @@ export interface Env {
1717
1818 // External database source details
1919 EXTERNAL_DB_TYPE ?: string ;
20- EXTERNAL_DB_HOST ?: string ;
21- EXTERNAL_DB_NAME ?: string ;
22- EXTERNAL_DB_USER ?: string ;
23- EXTERNAL_DB_PASS ?: string ;
24- EXTERNAL_DB_PORT ?: string ;
20+ OUTERBASE_API_KEY ?: string ;
2521
2622 // ## DO NOT REMOVE: TEMPLATE INTERFACE ##
2723}
@@ -50,6 +46,19 @@ type DatabaseStub = DurableObjectStub & {
5046 executeTransaction ( queries : { sql : string ; params ?: any [ ] } [ ] , isRaw : boolean ) : any [ ] ;
5147} ;
5248
49+ enum RegionLocationHint {
50+ AUTO = 'auto' ,
51+ WNAM = 'wnam' , // Western North America
52+ ENAM = 'enam' , // Eastern North America
53+ SAM = 'sam' , // South America
54+ WEUR = 'weur' , // Western Europe
55+ EEUR = 'eeur' , // Eastern Europe
56+ APAC = 'apac' , // Asia Pacific
57+ OC = 'oc' , // Oceania
58+ AFR = 'afr' , // Africa
59+ ME = 'me' , // Middle East
60+ }
61+
5362export default {
5463 /**
5564 * This is the standard fetch handler for a Cloudflare Worker
@@ -113,8 +122,7 @@ export default {
113122 durableObject : stub as unknown as DatabaseStub ,
114123 } ,
115124 externalConnection : {
116- // TODO: Should the API key instead live in the `wrangler.toml` file instead of request headers?
117- outerbaseApiKey : request . headers . get ( 'X-Outerbase-Source-Token' ) ?? url . searchParams . get ( 'outerbaseApiKey' ) ?? '' ,
125+ outerbaseApiKey : env . OUTERBASE_API_KEY ?? ''
118126 } ,
119127 } ;
120128
0 commit comments