File tree Expand file tree Collapse file tree 5 files changed +47
-1
lines changed
Expand file tree Collapse file tree 5 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 44 "version" : " 2.0.0" ,
55 "type" : " module" ,
66 "scripts" : {
7+ "gentypes" : " bun run src/lib/types/update.ts" ,
78 "dev" : " vite dev" ,
89 "build" : " vite build" ,
910 "preview" : " vite preview" ,
Original file line number Diff line number Diff line change 1+ import { unlink } from "fs/promises"
2+ import { writeFile } from "fs/promises"
3+ import { join } from "path"
4+
5+ const url =
6+ "https://db.waspscripts.dev/api/v1/projects/default/types/typescript?included_schemas=public%2C%20storage"
7+ const outputPath = join ( __dirname , "supabase.ts" )
8+
9+ console . log ( outputPath )
10+
11+ try {
12+ await unlink ( outputPath )
13+ console . log ( "Old types file deleted successfully" )
14+ } catch ( err ) {
15+ console . error ( "Error deleting old types file:" , err )
16+ }
17+
18+ try {
19+ const response = await fetch ( url , {
20+ headers : {
21+ accept : "application/json" ,
22+ authorization :
23+ "Basic " +
24+ Buffer . from ( `${ process . env . BASIC_AUTH_USER } :${ process . env . BASIC_AUTH_PASS } ` ) . toString (
25+ "base64"
26+ )
27+ }
28+ } )
29+
30+ if ( ! response . ok ) {
31+ throw new Error ( `Request failed with status ${ response . status } ` )
32+ }
33+
34+ const json = await response . json ( )
35+ const tsCode = json . types
36+ await writeFile ( outputPath , tsCode )
37+
38+ console . log ( `Types file updated!` )
39+ } catch ( err ) {
40+ console . error ( "Error:" , err )
41+ }
Original file line number Diff line number Diff line change 257257 </form >
258258</nav >
259259<a href =" https://waspscripts.com" class =" bg-surface-300-700 py-2 text-center" >
260- This website is for <b >Simba 2.0 </b >. Click here to visit the legacy version of the website.
260+ This website is for <b >Simba 2000 </b >. Click here to visit the legacy version of the website.
261261</a >
Original file line number Diff line number Diff line change 287287 value ={[$form .simba ]}
288288 onValueChange ={(e ) => ($form .simba = e .value [0 ])}
289289 label =" Simba:"
290+ ids ={{ input : " simba" }}
290291 allowCustomValue ={true }
291292 defaultInputValue ={$form .simba }
292293 zIndex =" 1"
302303 value ={[$form .wasplib ]}
303304 onValueChange ={(e ) => ($form .wasplib = e .value [0 ])}
304305 label =" WaspLib:"
306+ ids ={{ input : " wasplib" }}
305307 allowCustomValue ={true }
306308 defaultInputValue ={$form .wasplib }
307309 zIndex =" 1"
Original file line number Diff line number Diff line change 328328 value ={[$form .simba ]}
329329 onValueChange ={(e ) => ($form .simba = e .value [0 ])}
330330 label =" Simba:"
331+ ids ={{ input : " simba" }}
331332 allowCustomValue ={true }
332333 defaultInputValue ={$form .simba }
333334 zIndex =" 1"
343344 value ={[$form .wasplib ]}
344345 onValueChange ={(e ) => ($form .wasplib = e .value [0 ])}
345346 label =" WaspLib:"
347+ ids ={{ input : " wasplib" }}
346348 allowCustomValue ={true }
347349 defaultInputValue ={$form .wasplib }
348350 zIndex =" 1"
You can’t perform that action at this time.
0 commit comments