@@ -45,7 +45,7 @@ const uploadNoteToS3 = async (note, creds) => {
4545 if ( ! creds ?. secretAccessKey ) return ;
4646
4747 const s3 = await getS3Client ( creds ) ;
48- const body = note . html || JSON . stringify ( note , null , 2 ) ;
48+ const body = note . html || YAML . stringify ( note ) ;
4949
5050 const date = new Date ( note . createdAt || note . updatedAt || Date . now ( ) ) ;
5151 const y = date . getFullYear ( ) ;
@@ -133,7 +133,7 @@ const downloadNoteFromS3 = async (noteOrId, creds) => {
133133 const data = await s3 . getObject ( params ) . promise ( ) ;
134134 if ( data ?. Body ) {
135135 const str = ( new TextDecoder ( ) ) . decode ( data . Body ) ;
136- return JSON . parse ( str ) ;
136+ return YAML . parse ( str ) ;
137137 }
138138 } catch ( err ) {
139139 // If it failed and we didn't try the flat ID yet, try it
@@ -143,7 +143,7 @@ const downloadNoteFromS3 = async (noteOrId, creds) => {
143143 const data = await s3 . getObject ( flatParams ) . promise ( ) ;
144144 if ( data ?. Body ) {
145145 const str = ( new TextDecoder ( ) ) . decode ( data . Body ) ;
146- return JSON . parse ( str ) ;
146+ return YAML . parse ( str ) ;
147147 }
148148 }
149149 throw err ;
@@ -348,7 +348,7 @@ const uploadDeletedNotesToS3 = async (deletedIds, creds) => {
348348 const params = {
349349 Bucket : creds . bucket ,
350350 Key : key ,
351- Body : JSON . stringify ( { ids : deletedIds , updatedAt : new Date ( ) . toISOString ( ) } , null , 2 ) ,
351+ Body : YAML . stringify ( { ids : deletedIds , updatedAt : new Date ( ) . toISOString ( ) } ) ,
352352 ContentType : 'application/json' ,
353353 } ;
354354
@@ -371,7 +371,7 @@ const downloadDeletedNotesFromS3 = async (creds) => {
371371 const data = await s3 . getObject ( params ) . promise ( ) ;
372372 if ( data ?. Body ) {
373373 const str = ( new TextDecoder ( ) ) . decode ( data . Body ) ;
374- const parsed = JSON . parse ( str ) ;
374+ const parsed = YAML . parse ( str ) ;
375375 // Return the full object including the updatedAt from the file content
376376 return {
377377 ids : parsed . ids || [ ] ,
0 commit comments