11import {
22 defineBlueprint ,
33 defineDocumentFunction ,
4+ defineScheduledFunction ,
45} from "@sanity/blueprints" ;
56
67export default defineBlueprint ( {
78 resources : [
89 defineDocumentFunction ( {
910 name : "syndicate-content" ,
1011 displayName : "Syndicate Content (Dev.to & Hashnode)" ,
12+ project : process . env . SANITY_STUDIO_PROJECT_ID || "hfh83o0w" ,
1113 event : {
1214 on : [ "create" , "update" ] ,
1315 filter : '_type in ["post", "podcast"] && !(_id in path("drafts.**"))' ,
@@ -19,6 +21,7 @@ export default defineBlueprint({
1921 defineDocumentFunction ( {
2022 name : "sync-youtube-transcript" ,
2123 displayName : "Sync YouTube Transcripts & Video Intelligence" ,
24+ project : process . env . SANITY_STUDIO_PROJECT_ID || "hfh83o0w" ,
2225 event : {
2326 on : [ "create" , "update" ] ,
2427 filter : 'defined(youtube) && !(_id in path("drafts.**"))' ,
@@ -30,5 +33,22 @@ export default defineBlueprint({
3033 YOUTUBE_API_KEY : process . env . YOUTUBE_API_KEY || "" ,
3134 } ,
3235 } ) ,
36+ defineScheduledFunction ( {
37+ name : "sync-nightly-dataset" ,
38+ displayName : "Nightly Dataset Sync (Production -> Dev)" ,
39+ src : "./apps/sanity/functions/sync-nightly-dataset" ,
40+ event : {
41+ expression : "0 4 * * *" , // 4:00 AM UTC
42+ } ,
43+ runtime : "nodejs22.x" ,
44+ timeout : 300 ,
45+ env : {
46+ SANITY_AUTH_TOKEN : process . env . SANITY_AUTH_TOKEN || "" ,
47+ SANITY_STUDIO_PROJECT_ID :
48+ process . env . SANITY_STUDIO_PROJECT_ID || "hfh83o0w" ,
49+ SANITY_STUDIO_DATASET :
50+ process . env . SANITY_STUDIO_DATASET || "production" ,
51+ } ,
52+ } ) ,
3353 ] ,
3454} ) ;
0 commit comments