File tree Expand file tree Collapse file tree 7 files changed +17
-15
lines changed
x-pack/plugins/fleet/server/services/epm
elasticsearch/ingest_pipeline Expand file tree Collapse file tree 7 files changed +17
-15
lines changed Original file line number Diff line number Diff line change 77import tar from 'tar' ;
88import yauzl from 'yauzl' ;
99import { bufferToStream , streamToBuffer } from '../../../streams' ;
10-
11- export interface ArchiveEntry {
12- path : string ;
13- buffer ?: Buffer ;
14- }
10+ import { ArchiveEntry } from './index' ;
1511
1612export async function untarBuffer (
1713 buffer : Buffer ,
Original file line number Diff line number Diff line change @@ -13,10 +13,16 @@ import {
1313 setArchiveFilelist ,
1414 deleteArchiveFilelist ,
1515} from './cache' ;
16- import { ArchiveEntry , getBufferExtractor } from '../registry /extract' ;
16+ import { getBufferExtractor } from './extract' ;
1717import { parseAndVerifyArchiveEntries } from './validation' ;
1818
1919export * from './cache' ;
20+ export { untarBuffer , unzipBuffer , getBufferExtractor } from './extract' ;
21+
22+ export interface ArchiveEntry {
23+ path : string ;
24+ buffer ?: Buffer ;
25+ }
2026
2127export async function getArchivePackage ( {
2228 archiveBuffer,
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ import {
1515 RegistryVarsEntry ,
1616} from '../../../../common/types' ;
1717import { PackageInvalidArchiveError } from '../../../errors' ;
18- import { ArchiveEntry , pkgToPkgKey } from '../registry' ;
18+ import { ArchiveEntry } from './index' ;
19+ import { pkgToPkgKey } from '../registry' ;
1920
2021const MANIFESTS : Record < string , Buffer > = { } ;
2122const MANIFEST_NAME = 'manifest.yml' ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212 InstallablePackage ,
1313} from '../../../../types' ;
1414import * as Registry from '../../registry' ;
15+ import { ArchiveEntry } from '../../archive' ;
1516import { CallESAsCurrentUser } from '../../../../types' ;
1617import { saveInstalledEsRefs } from '../../packages/install' ;
1718import { getInstallationObject } from '../../packages' ;
@@ -192,7 +193,7 @@ async function installPipeline({
192193 return { id : pipeline . nameForInstallation , type : ElasticsearchAssetType . ingestPipeline } ;
193194}
194195
195- const isDirectory = ( { path } : Registry . ArchiveEntry ) => path . endsWith ( '/' ) ;
196+ const isDirectory = ( { path } : ArchiveEntry ) => path . endsWith ( '/' ) ;
196197
197198const isDataStreamPipeline = ( path : string , dataStreamDataset : string ) => {
198199 const pathParts = Registry . pathParts ( path ) ;
Original file line number Diff line number Diff line change 66
77import { InstallablePackage } from '../../../types' ;
88import * as Registry from '../registry' ;
9- import { getArchiveFilelist } from '../archive/cache ' ;
9+ import { ArchiveEntry , getArchiveFilelist } from '../archive' ;
1010
1111// paths from RegistryPackage are routes to the assets on EPR
1212// e.g. `/package/nginx/1.2.0/data_stream/access/fields/fields.yml`
@@ -51,14 +51,14 @@ export async function getAssetsData(
5151 packageInfo : InstallablePackage ,
5252 filter = ( path : string ) : boolean => true ,
5353 datasetName ?: string
54- ) : Promise < Registry . ArchiveEntry [ ] > {
54+ ) : Promise < ArchiveEntry [ ] > {
5555 // TODO: Needs to be called to fill the cache but should not be required
5656
5757 await Registry . ensureCachedArchiveInfo ( packageInfo . name , packageInfo . version , 'registry' ) ;
5858
5959 // Gather all asset data
6060 const assets = getAssets ( packageInfo , filter , datasetName ) ;
61- const entries : Registry . ArchiveEntry [ ] = assets . map ( ( path ) => {
61+ const entries : ArchiveEntry [ ] = assets . map ( ( path ) => {
6262 const buffer = Registry . getAsset ( path ) ;
6363
6464 return { path, buffer } ;
Original file line number Diff line number Diff line change 55 */
66
77import { AssetParts } from '../../../types' ;
8- import { getBufferExtractor , pathParts , splitPkgKey } from './index' ;
9- import { untarBuffer , unzipBuffer } from './extract ' ;
8+ import { pathParts , splitPkgKey } from './index' ;
9+ import { getBufferExtractor , untarBuffer , unzipBuffer } from '../archive ' ;
1010
1111const testPaths = [
1212 {
Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ import { getRegistryUrl } from './registry_url';
2626import { appContextService } from '../..' ;
2727import { PackageNotFoundError , PackageCacheError } from '../../../errors' ;
2828
29- export { ArchiveEntry , getBufferExtractor } from './extract' ;
30-
3129export interface SearchParams {
3230 category ?: CategoryId ;
3331 experimental ?: boolean ;
You can’t perform that action at this time.
0 commit comments