@@ -30,9 +30,9 @@ import {
3030 ResolvedGroupDocuments ,
3131 ResolvedOperations ,
3232 ResolvedVersionDocuments ,
33- ResolvedVersionOperationsHashMap ,
3433 VersionId ,
3534 VersionsComparison ,
35+ ZippableDocument ,
3636} from './types'
3737import {
3838 ApiBuilder ,
@@ -74,7 +74,7 @@ import { BuildStrategy, ChangelogStrategy, DocumentGroupStrategy, PrefixGroupsCh
7474import { BuilderStrategyContext } from './builder-strategy'
7575import { MergedDocumentGroupStrategy } from './strategies/merged-document-group.strategy'
7676import { asyncDebugPerformance } from './utils/logs'
77- import { ExportRestOperationsGroupStrategy } from './strategies/rest-operations-group.strategy'
77+ // import { ExportRestOperationsGroupStrategy } from './strategies/rest-operations-group.strategy'
7878import { ExportVersionStrategy } from './strategies/export-version.strategy'
7979import { ExportRestDocumentStrategy } from './strategies/export-rest-document.strategy'
8080
@@ -85,7 +85,7 @@ export const DEFAULT_RUN_OPTIONS: BuilderRunOptions = {
8585export class PackageVersionBuilder implements IPackageVersionBuilder {
8686 apiBuilders : ApiBuilder [ ] = [ ]
8787 documents = new Map < string , VersionDocument > ( )
88- exportDocuments : VersionDocument [ ] = [ ]
88+ exportDocuments : ZippableDocument [ ] = [ ]
8989 exportFileName : string = ''
9090 operations = new Map < string , ApiOperation > ( )
9191 comparisons : VersionsComparison [ ] = [ ]
@@ -263,6 +263,7 @@ export class PackageVersionBuilder implements IPackageVersionBuilder {
263263 // }
264264
265265 if ( buildType === BUILD_TYPE . EXPORT_REST_OPERATIONS_GROUP ) {
266+ const { ExportRestOperationsGroupStrategy } = await import ( './strategies/rest-operations-group.strategy' )
266267 builderStrategyContext . setStrategy ( new ExportRestOperationsGroupStrategy ( ) )
267268 }
268269
@@ -294,17 +295,17 @@ export class PackageVersionBuilder implements IPackageVersionBuilder {
294295 version : VersionId ,
295296 packageId : PackageId ,
296297 slug : string ,
297- ) : Promise < File | null > {
298+ ) : Promise < File > {
298299 if ( ! this . params . resolvers . rawDocumentResolver ) {
299- return null
300+ throw new Error ( 'rawDocumentResolver is not provided' )
300301 }
301302
302- const source = await this . params . resolvers . rawDocumentResolver ( version , packageId , slug )
303- if ( ! source ) {
304- return null
303+ const document = await this . params . resolvers . rawDocumentResolver ( version , packageId , slug )
304+ if ( ! document ) {
305+ throw new Error ( `Raw document ${ slug } is missing` )
305306 }
306307
307- return source
308+ return document
308309 }
309310
310311 async versionComparisonResolver (
0 commit comments