-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* move pdf types to /common folder * move pdf v2 types to /common folder * move png v2 types to /common folder * move png types to /common * move csv_searchsource_immediate types to /common * move csv_searchsource type sto /common * move csv types to /common folder * export job params types on server and client * use JobParamsPDF in example app * use JobParamsPDFV2 in Canvas * dont export twice * export JobId * improve export syntax * update jest snapshot * fix imports * add JobAppParamsPDFV2 type * add JobAppParamsPDF type * update test snapshot Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
- Loading branch information
1 parent
c92257d
commit 9e14095
Showing
23 changed files
with
248 additions
and
114 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
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,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { Ensure, SerializableRecord } from '@kbn/utility-types'; | ||
import type { LayoutParams } from './layout'; | ||
|
||
export type JobId = string; | ||
|
||
export type BaseParams = Ensure< | ||
{ | ||
layout?: LayoutParams; | ||
objectType: string; | ||
title: string; | ||
browserTimezone: string; // to format dates in the user's time zone | ||
version: string; // to handle any state migrations | ||
}, | ||
SerializableRecord | ||
>; | ||
|
||
// base params decorated with encrypted headers that come into runJob functions | ||
export interface BasePayload extends BaseParams { | ||
headers: string; | ||
spaceId?: string; | ||
isDeprecated?: boolean; | ||
} |
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
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
x-pack/plugins/reporting/common/types/export_types/index.ts
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,14 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export * from './csv'; | ||
export * from './csv_searchsource'; | ||
export * from './csv_searchsource_immediate'; | ||
export * from './png'; | ||
export * from './png_v2'; | ||
export * from './printable_pdf'; | ||
export * from './printable_pdf_v2'; |
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
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
33 changes: 33 additions & 0 deletions
33
x-pack/plugins/reporting/common/types/export_types/printable_pdf_v2.ts
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,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { LocatorParams } from '../url'; | ||
import type { LayoutParams } from '../layout'; | ||
import type { BaseParams, BasePayload } from '../base'; | ||
|
||
interface BaseParamsPDFV2 { | ||
layout: LayoutParams; | ||
|
||
/** | ||
* This value is used to re-create the same visual state as when the report was requested as well as navigate to the correct page. | ||
*/ | ||
locatorParams: LocatorParams[]; | ||
} | ||
|
||
// Job params: structure of incoming user request data, after being parsed from RISON | ||
export type JobParamsPDFV2 = BaseParamsPDFV2 & BaseParams; | ||
|
||
export type JobAppParamsPDFV2 = Omit<JobParamsPDFV2, 'browserTimezone' | 'version'>; | ||
|
||
// Job payload: structure of stored job data provided by create_job | ||
export interface TaskPayloadPDFV2 extends BasePayload, BaseParamsPDFV2 { | ||
layout: LayoutParams; | ||
/** | ||
* The value of forceNow is injected server-side every time a given report is generated. | ||
*/ | ||
forceNow: string; | ||
} |
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,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { Ensure, SerializableRecord } from '@kbn/utility-types'; | ||
|
||
export type Size = Ensure< | ||
{ | ||
width: number; | ||
height: number; | ||
}, | ||
SerializableRecord | ||
>; | ||
|
||
export type LayoutParams = Ensure< | ||
{ | ||
id: string; | ||
dimensions?: Size; | ||
}, | ||
SerializableRecord | ||
>; |
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,34 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { SerializableRecord } from '@kbn/utility-types'; | ||
import type { JobId } from './base'; | ||
|
||
type DownloadLink = string; | ||
export type DownloadReportFn = (jobId: JobId) => DownloadLink; | ||
|
||
type ManagementLink = string; | ||
export type ManagementLinkFn = () => ManagementLink; | ||
|
||
export interface LocatorParams< | ||
P extends SerializableRecord = SerializableRecord & { forceNow?: string } | ||
> { | ||
id: string; | ||
version: string; | ||
params: P; | ||
} | ||
|
||
export type IlmPolicyMigrationStatus = 'policy-not-found' | 'indices-not-managed-by-policy' | 'ok'; | ||
|
||
export interface IlmPolicyStatusResponse { | ||
status: IlmPolicyMigrationStatus; | ||
} | ||
|
||
type Url = string; | ||
type UrlLocatorTuple = [url: Url, locatorParams: LocatorParams]; | ||
|
||
export type UrlOrUrlLocatorTuple = Url | UrlLocatorTuple; |
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.