mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Index patterns] Deprecate scripted field API functions (#100907)
* deprecate scripted field functions in index patterns api
This commit is contained in:
parent
675997731d
commit
9734d1cfe8
11 changed files with 50 additions and 4 deletions
|
@ -4,6 +4,10 @@
|
|||
|
||||
## IndexPattern.addScriptedField() method
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
||||
>
|
||||
|
||||
Add scripted field to field list
|
||||
|
||||
<b>Signature:</b>
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
## IndexPattern.getNonScriptedFields() method
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
||||
>
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
## IndexPattern.getScriptedFields() method
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
||||
>
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
## IndexPattern.removeScriptedField() method
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
||||
>
|
||||
|
||||
Remove scripted field from field list
|
||||
|
||||
<b>Signature:</b>
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
## IndexPattern.addScriptedField() method
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
||||
>
|
||||
|
||||
Add scripted field to field list
|
||||
|
||||
<b>Signature:</b>
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
## IndexPattern.getNonScriptedFields() method
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
||||
>
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
## IndexPattern.getScriptedFields() method
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
||||
>
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
## IndexPattern.removeScriptedField() method
|
||||
|
||||
> Warning: This API is now obsolete.
|
||||
>
|
||||
>
|
||||
|
||||
Remove scripted field from field list
|
||||
|
||||
<b>Signature:</b>
|
||||
|
|
|
@ -240,6 +240,7 @@ export class IndexPattern implements IIndexPattern {
|
|||
* @param script script code
|
||||
* @param fieldType
|
||||
* @param lang
|
||||
* @deprecated use runtime field instead
|
||||
*/
|
||||
async addScriptedField(name: string, script: string, fieldType: string = 'string') {
|
||||
const scriptedFields = this.getScriptedFields();
|
||||
|
@ -265,6 +266,7 @@ export class IndexPattern implements IIndexPattern {
|
|||
/**
|
||||
* Remove scripted field from field list
|
||||
* @param fieldName
|
||||
* @deprecated use runtime field instead
|
||||
*/
|
||||
|
||||
removeScriptedField(fieldName: string) {
|
||||
|
@ -274,10 +276,18 @@ export class IndexPattern implements IIndexPattern {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use runtime field instead
|
||||
*/
|
||||
getNonScriptedFields() {
|
||||
return [...this.fields.getAll().filter((field) => !field.scripted)];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use runtime field instead
|
||||
*/
|
||||
getScriptedFields() {
|
||||
return [...this.fields.getAll().filter((field) => field.scripted)];
|
||||
}
|
||||
|
|
|
@ -1307,6 +1307,7 @@ export class IndexPattern implements IIndexPattern {
|
|||
// Warning: (ae-forgotten-export) The symbol "IndexPatternDeps" needs to be exported by the entry point index.d.ts
|
||||
constructor({ spec, fieldFormats, shortDotsEnable, metaFields, }: IndexPatternDeps);
|
||||
addRuntimeField(name: string, runtimeField: RuntimeField): void;
|
||||
// @deprecated
|
||||
addScriptedField(name: string, script: string, fieldType?: string): Promise<void>;
|
||||
readonly allowNoIndex: boolean;
|
||||
// (undocumented)
|
||||
|
@ -1366,7 +1367,7 @@ export class IndexPattern implements IIndexPattern {
|
|||
getFieldByName(name: string): IndexPatternField | undefined;
|
||||
getFormatterForField(field: IndexPatternField | IndexPatternField['spec'] | IFieldType): FieldFormat;
|
||||
getFormatterForFieldNoDefault(fieldname: string): FieldFormat | undefined;
|
||||
// (undocumented)
|
||||
// @deprecated (undocumented)
|
||||
getNonScriptedFields(): IndexPatternField[];
|
||||
getOriginalSavedObjectBody: () => {
|
||||
fieldAttrs?: string | undefined;
|
||||
|
@ -1379,7 +1380,7 @@ export class IndexPattern implements IIndexPattern {
|
|||
typeMeta?: string | undefined;
|
||||
type?: string | undefined;
|
||||
};
|
||||
// (undocumented)
|
||||
// @deprecated (undocumented)
|
||||
getScriptedFields(): IndexPatternField[];
|
||||
getSourceFiltering(): {
|
||||
excludes: any[];
|
||||
|
@ -1397,6 +1398,7 @@ export class IndexPattern implements IIndexPattern {
|
|||
// (undocumented)
|
||||
metaFields: string[];
|
||||
removeRuntimeField(name: string): void;
|
||||
// @deprecated
|
||||
removeScriptedField(fieldName: string): void;
|
||||
resetOriginalSavedObjectBody: () => void;
|
||||
// (undocumented)
|
||||
|
|
|
@ -749,6 +749,7 @@ export class IndexPattern implements IIndexPattern {
|
|||
// Warning: (ae-forgotten-export) The symbol "IndexPatternDeps" needs to be exported by the entry point index.d.ts
|
||||
constructor({ spec, fieldFormats, shortDotsEnable, metaFields, }: IndexPatternDeps);
|
||||
addRuntimeField(name: string, runtimeField: RuntimeField): void;
|
||||
// @deprecated
|
||||
addScriptedField(name: string, script: string, fieldType?: string): Promise<void>;
|
||||
readonly allowNoIndex: boolean;
|
||||
// (undocumented)
|
||||
|
@ -812,7 +813,7 @@ export class IndexPattern implements IIndexPattern {
|
|||
getFormatterForFieldNoDefault(fieldname: string): FieldFormat | undefined;
|
||||
// Warning: (ae-forgotten-export) The symbol "IndexPatternField" needs to be exported by the entry point index.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
// @deprecated (undocumented)
|
||||
getNonScriptedFields(): IndexPatternField[];
|
||||
getOriginalSavedObjectBody: () => {
|
||||
fieldAttrs?: string | undefined;
|
||||
|
@ -825,7 +826,7 @@ export class IndexPattern implements IIndexPattern {
|
|||
typeMeta?: string | undefined;
|
||||
type?: string | undefined;
|
||||
};
|
||||
// (undocumented)
|
||||
// @deprecated (undocumented)
|
||||
getScriptedFields(): IndexPatternField[];
|
||||
getSourceFiltering(): {
|
||||
excludes: any[];
|
||||
|
@ -843,6 +844,7 @@ export class IndexPattern implements IIndexPattern {
|
|||
// (undocumented)
|
||||
metaFields: string[];
|
||||
removeRuntimeField(name: string): void;
|
||||
// @deprecated
|
||||
removeScriptedField(fieldName: string): void;
|
||||
resetOriginalSavedObjectBody: () => void;
|
||||
// (undocumented)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue