@@ -2,24 +2,45 @@ import 'dotenv/config';
22import { z } from 'zod' ;
33
44const envSchema = z . object ( {
5- NETWORK_NAME : z . string ( ) . min ( 1 , 'NETWORK_NAME is required' ) . default ( 'bellecour' ) ,
5+ NETWORK_NAME : z
6+ . string ( )
7+ . min ( 1 , 'NETWORK_NAME is required' )
8+ . default ( 'bellecour' ) ,
69
7- GRAPHNODE_URL : z
8- . string ( )
9- . url ( 'GRAPHNODE_URL must be a valid URL' )
10- . default ( 'http://localhost:8020' ) ,
10+ GRAPHNODE_URL : z
11+ . string ( )
12+ . url ( 'GRAPHNODE_URL must be a valid URL' )
13+ . default ( 'http://localhost:8020' ) ,
1114
12- IPFS_URL : z . string ( ) . url ( 'IPFS_URL must be a valid URL' ) . default ( 'http://localhost:5001' ) ,
15+ IPFS_URL : z
16+ . string ( )
17+ . url ( 'IPFS_URL must be a valid URL' )
18+ . default ( 'http://localhost:5001' ) ,
1319
14- VERSION_LABEL : z . string ( ) . min ( 1 , 'VERSION_LABEL is required' ) . default ( 'bellecour/poco-v5 ' ) ,
20+ VERSION_LABEL : z . string ( ) . min ( 1 , 'VERSION_LABEL is required' ) . default ( 'dev ' ) ,
1521
16- START_BLOCK : z
17- . string ( )
18- . transform ( ( val ) => parseInt ( val , 10 ) )
19- . refine ( ( val ) => ! isNaN ( val ) && val >= 0 , {
20- message : 'START_BLOCK must be a valid non-negative integer' ,
21- } )
22- . or ( z . undefined ( ) ) ,
22+ START_BLOCK : z
23+ . string ( )
24+ . transform ( ( val ) => parseInt ( val , 10 ) )
25+ . refine ( ( val ) => ! isNaN ( val ) && val >= 0 , {
26+ message : 'START_BLOCK must be a valid non-negative integer' ,
27+ } )
28+ . or ( z . undefined ( ) ) ,
29+
30+ SUBGRAPH_SLUG : z
31+ . string ( )
32+ . min ( 1 , 'SUBGRAPH_SLUG must not be empty' )
33+ . optional ( ) ,
34+
35+ SUBGRAPH_DEPLOY_KEY : z
36+ . string ( )
37+ . min ( 1 , 'SUBGRAPH_DEPLOY_KEY must not be empty' )
38+ . optional ( ) ,
39+
40+ SUBGRAPH_NETWORK_NAME : z
41+ . string ( )
42+ . min ( 1 , 'SUBGRAPH_NETWORK_NAME must not be empty' )
43+ . optional ( ) ,
2344} ) ;
2445
2546export const env = envSchema . parse ( process . env ) ;
0 commit comments