|
16 | 16 |
|
17 | 17 | import { FileId, KeyOfConstType, OperationsApiType, PackageId, VersionId } from './types' |
18 | 18 | import { BUILD_TYPE, VERSION_STATUS } from '../../consts' |
| 19 | +import { OpenApiExtensionKey } from '@netcracker/qubership-apihub-api-unifier' |
19 | 20 |
|
20 | 21 | export type BuildType = KeyOfConstType<typeof BUILD_TYPE> |
21 | 22 | export type VersionStatus = KeyOfConstType<typeof VERSION_STATUS> |
@@ -61,8 +62,63 @@ export interface BuildConfig { |
61 | 62 | format?: OperationsGroupExportFormat |
62 | 63 |
|
63 | 64 | validationRulesSeverity?: ValidationRulesSeverity |
| 65 | + operationsSpecTransformation?: OperationsSpecTransformation |
64 | 66 | } |
65 | 67 |
|
| 68 | +export interface BuildConfigBase { |
| 69 | +// export interface BuildConfig { |
| 70 | + buildType: BuildType |
| 71 | +} |
| 72 | + |
| 73 | +export interface PublishBuildConfig extends BuildConfigBase { |
| 74 | + buildType: typeof BUILD_TYPE.BUILD |
| 75 | + version: VersionId // @revision for rebuild |
| 76 | + previousVersion?: VersionId |
| 77 | + previousVersionPackageId?: PackageId |
| 78 | + status: VersionStatus |
| 79 | + versionLabels?: string[] |
| 80 | + refs?: BuildConfigRef[] |
| 81 | + files?: BuildConfigFile[] |
| 82 | + // apiType?: OperationsApiType //todo Document transformation is available only for apiType = REST |
| 83 | +} |
| 84 | + |
| 85 | +export interface ExportVersionBuildConfig extends BuildConfigBase { |
| 86 | + buildType: typeof BUILD_TYPE.EXPORT_VERSION |
| 87 | + packageId: PackageId |
| 88 | + version: VersionId // @revision for rebuild |
| 89 | + // apiType?: OperationsApiType //todo Document transformation is available only for apiType = REST |
| 90 | + format: OperationsGroupExportFormat |
| 91 | + allowedOasExtensions?: OpenApiExtensionKey |
| 92 | +} |
| 93 | + |
| 94 | +export interface ExportRestDocumentBuildConfig extends BuildConfigBase { |
| 95 | + buildType: typeof BUILD_TYPE.EXPORT_REST_DOCUMENT |
| 96 | + packageId: PackageId |
| 97 | + version: VersionId // @revision for rebuild |
| 98 | + documentId: string |
| 99 | + // apiType?: OperationsApiType //todo Document transformation is available only for apiType = REST |
| 100 | + format: OperationsGroupExportFormat |
| 101 | + allowedOasExtensions?: OpenApiExtensionKey |
| 102 | +} |
| 103 | + |
| 104 | +export interface ExportRestOperationsGroupBuildConfig extends BuildConfigBase { |
| 105 | + buildType: typeof BUILD_TYPE.EXPORT_REST_OPERATIONS_GROUP |
| 106 | + packageId: PackageId |
| 107 | + version: VersionId // @revision for rebuild |
| 108 | + // apiType?: OperationsApiType //todo Document transformation is available only for apiType = REST |
| 109 | + groupName: string |
| 110 | + operationsSpecTransformation: OperationsSpecTransformation |
| 111 | + format: OperationsGroupExportFormat |
| 112 | + allowedOasExtensions?: OpenApiExtensionKey |
| 113 | +} |
| 114 | + |
| 115 | +export const TRANSFORMATION_KIND_REDUCED = 'reducedSourceSpecifications' |
| 116 | +export const TRANSFORMATION_KIND_MERGED = 'mergedSpecification' |
| 117 | + |
| 118 | +export type OperationsSpecTransformation = |
| 119 | + | typeof TRANSFORMATION_KIND_REDUCED |
| 120 | + | typeof TRANSFORMATION_KIND_MERGED |
| 121 | + |
66 | 122 | export interface BuildConfigFile { |
67 | 123 | fileId: FileId |
68 | 124 | slug?: string // for rebuild |
|
0 commit comments