@@ -14,6 +14,7 @@ import type { ParsedQs } from "qs";
1414import type { NoteParams } from "../services/note-interface.js" ;
1515import type { SearchParams } from "../services/search/services/types.js" ;
1616import type { ValidatorMap } from "./etapi-interface.js" ;
17+ import type { ExportFormat } from "../services/export/zip/abstract_provider.js" ;
1718
1819function register ( router : Router ) {
1920 eu . route ( router , "get" , "/etapi/notes" , ( req , res , next ) => {
@@ -149,8 +150,8 @@ function register(router: Router) {
149150 const note = eu . getAndCheckNote ( req . params . noteId ) ;
150151 const format = req . query . format || "html" ;
151152
152- if ( typeof format !== "string" || ! [ "html" , "markdown" ] . includes ( format ) ) {
153- throw new eu . EtapiError ( 400 , "UNRECOGNIZED_EXPORT_FORMAT" , `Unrecognized export format '${ format } ', supported values are 'html' (default) or 'markdown '.` ) ;
153+ if ( typeof format !== "string" || ! [ "html" , "markdown" , "share" ] . includes ( format ) ) {
154+ throw new eu . EtapiError ( 400 , "UNRECOGNIZED_EXPORT_FORMAT" , `Unrecognized export format '${ format } ', supported values are 'html' (default), 'markdown' or 'share '.` ) ;
154155 }
155156
156157 const taskContext = new TaskContext ( "no-progress-reporting" , "export" , null ) ;
@@ -159,7 +160,7 @@ function register(router: Router) {
159160 // (e.g. branchIds are not seen in UI), that we export "note export" instead.
160161 const branch = note . getParentBranches ( ) [ 0 ] ;
161162
162- zipExportService . exportToZip ( taskContext , branch , format as "html" | "markdown" , res ) ;
163+ zipExportService . exportToZip ( taskContext , branch , format as ExportFormat , res ) ;
163164 } ) ;
164165
165166 eu . route ( router , "post" , "/etapi/notes/:noteId/import" , ( req , res , next ) => {
0 commit comments