-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reporting/NP Migration] Remove server.expose of ExportTypeRegistry (#…
…50973) (#52813) * [Reporting/NPMigration] typescriptify ExportTypeRegistry, remove from server.expose * Minor routes registration cleanup * move the ETR test file * Re-pack the route registration, reduce LOC changes * add EnqueueJobFn type * Fix usage collector test * remove a throw error used for development/debugging * fix imports error * Fix execute job tests * wip test fixes * test fixes for real * fix more tests * fix diffs * Add TODOs about the ExportTypesRegistry.register unwrap the factory functions. * really make headlessbrowserdriver required as an execute job factory option * fix tests * Use constants for license type keywords
- Loading branch information
Showing
37 changed files
with
645 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 0 additions & 64 deletions
64
x-pack/legacy/plugins/reporting/common/export_types_registry.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { | ||
CSV_JOB_TYPE as jobType, | ||
LICENSE_TYPE_TRIAL, | ||
LICENSE_TYPE_BASIC, | ||
LICENSE_TYPE_STANDARD, | ||
LICENSE_TYPE_GOLD, | ||
LICENSE_TYPE_PLATINUM, | ||
} from '../../common/constants'; | ||
import { ExportTypeDefinition, ESQueueCreateJobFn, ESQueueWorkerExecuteFn } from '../../types'; | ||
import { metadata } from './metadata'; | ||
import { createJobFactory } from './server/create_job'; | ||
import { executeJobFactory } from './server/execute_job'; | ||
import { JobParamsDiscoverCsv, JobDocPayloadDiscoverCsv } from './types'; | ||
|
||
export const getExportType = (): ExportTypeDefinition< | ||
JobParamsDiscoverCsv, | ||
ESQueueCreateJobFn<JobParamsDiscoverCsv>, | ||
JobDocPayloadDiscoverCsv, | ||
ESQueueWorkerExecuteFn<JobDocPayloadDiscoverCsv> | ||
> => ({ | ||
...metadata, | ||
jobType, | ||
jobContentExtension: 'csv', | ||
createJobFactory, | ||
executeJobFactory, | ||
validLicenses: [ | ||
LICENSE_TYPE_TRIAL, | ||
LICENSE_TYPE_BASIC, | ||
LICENSE_TYPE_STANDARD, | ||
LICENSE_TYPE_GOLD, | ||
LICENSE_TYPE_PLATINUM, | ||
], | ||
}); |
22 changes: 0 additions & 22 deletions
22
x-pack/legacy/plugins/reporting/export_types/csv/server/index.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/index.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { | ||
PNG_JOB_TYPE as jobType, | ||
LICENSE_TYPE_TRIAL, | ||
LICENSE_TYPE_STANDARD, | ||
LICENSE_TYPE_GOLD, | ||
LICENSE_TYPE_PLATINUM, | ||
} from '../../common/constants'; | ||
import { ExportTypeDefinition, ESQueueCreateJobFn, ESQueueWorkerExecuteFn } from '../../types'; | ||
import { createJobFactory } from './server/create_job'; | ||
import { executeJobFactory } from './server/execute_job'; | ||
import { metadata } from './metadata'; | ||
import { JobParamsPNG, JobDocPayloadPNG } from './types'; | ||
|
||
export const getExportType = (): ExportTypeDefinition< | ||
JobParamsPNG, | ||
ESQueueCreateJobFn<JobParamsPNG>, | ||
JobDocPayloadPNG, | ||
ESQueueWorkerExecuteFn<JobDocPayloadPNG> | ||
> => ({ | ||
...metadata, | ||
jobType, | ||
jobContentEncoding: 'base64', | ||
jobContentExtension: 'PNG', | ||
createJobFactory, | ||
executeJobFactory, | ||
validLicenses: [ | ||
LICENSE_TYPE_TRIAL, | ||
LICENSE_TYPE_STANDARD, | ||
LICENSE_TYPE_GOLD, | ||
LICENSE_TYPE_PLATINUM, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
x-pack/legacy/plugins/reporting/export_types/png/server/index.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.