-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate App services plugins to TS projects #87294
Changes from all commits
575f615
60ace67
ec63c40
63a41f5
e3eb995
ed123e1
6f89403
a37458a
8cce148
1cde72d
d693686
e9e65e7
9fea2ce
b017b13
e9d7fa0
eda816b
a39e6c0
b4f9b28
62c1403
11e89da
1bde8d5
6d887b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"extends": "../../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"composite": true, | ||
"outDir": "./target/types", | ||
"emitDeclarationOnly": true, | ||
"declaration": true, | ||
"declarationMap": true | ||
}, | ||
"include": ["common/**/*", "public/**/*", "server/**/*", "index.ts"], | ||
"references": [ | ||
{ "path": "../../core/tsconfig.json" }, | ||
{ "path": "../kibana_utils/tsconfig.json" }, | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | ||
import { shouldReadFieldFromDocValues, castEsToKbnFieldTypeName } from '../../../../server'; | ||
|
||
function stubbedLogstashFields() { | ||
return [ | ||
// |aggregatable | ||
// | |searchable | ||
// name esType | | |metadata | subType | ||
mshustov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
['bytes', 'long', true, true, { count: 10 }], | ||
['ssl', 'boolean', true, true, { count: 20 }], | ||
['@timestamp', 'date', true, true, { count: 30 }], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixture still exists in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So what would be the rule of thumb of what goes into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
nothing. it should be removed eventually. global folders won't exist when we move to domain-based folder structure #71566 |
||
['time', 'date', true, true, { count: 30 }], | ||
['@tags', 'keyword', true, true], | ||
['utc_time', 'date', true, true], | ||
['phpmemory', 'integer', true, true], | ||
['ip', 'ip', true, true], | ||
['request_body', 'attachment', true, true], | ||
['point', 'geo_point', true, true], | ||
['area', 'geo_shape', true, true], | ||
['hashed', 'murmur3', false, true], | ||
['geo.coordinates', 'geo_point', true, true], | ||
['extension', 'text', true, true], | ||
['extension.keyword', 'keyword', true, true, {}, { multi: { parent: 'extension' } }], | ||
['machine.os', 'text', true, true], | ||
['machine.os.raw', 'keyword', true, true, {}, { multi: { parent: 'machine.os' } }], | ||
['geo.src', 'keyword', true, true], | ||
['_id', '_id', true, true], | ||
['_type', '_type', true, true], | ||
['_source', '_source', true, true], | ||
['non-filterable', 'text', true, false], | ||
['non-sortable', 'text', false, false], | ||
['custom_user_field', 'conflict', true, true], | ||
['script string', 'text', true, false, { script: "'i am a string'" }], | ||
['script number', 'long', true, false, { script: '1234' }], | ||
['script date', 'date', true, false, { script: '1234', lang: 'painless' }], | ||
['script murmur3', 'murmur3', true, false, { script: '1234' }], | ||
].map(function (row) { | ||
const [name, esType, aggregatable, searchable, metadata = {}, subType = undefined] = row; | ||
|
||
const { | ||
count = 0, | ||
script, | ||
lang = script ? 'expression' : undefined, | ||
scripted = !!script, | ||
} = metadata; | ||
|
||
// the conflict type is actually a kbnFieldType, we | ||
// don't have any other way to represent it here | ||
const type = esType === 'conflict' ? esType : castEsToKbnFieldTypeName(esType); | ||
|
||
return { | ||
name, | ||
type, | ||
esTypes: [esType], | ||
readFromDocValues: shouldReadFieldFromDocValues(aggregatable, esType), | ||
aggregatable, | ||
searchable, | ||
count, | ||
script, | ||
lang, | ||
scripted, | ||
subType, | ||
}; | ||
}); | ||
} | ||
|
||
export default stubbedLogstashFields; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
// @ts-expect-error | ||
import stubbedLogstashFields from './logstash_fields'; | ||
|
||
const mockLogstashFields = stubbedLogstashFields(); | ||
|
||
export function stubbedSavedObjectIndexPattern(id: string | null = null) { | ||
return { | ||
id, | ||
type: 'index-pattern', | ||
attributes: { | ||
timeFieldName: 'timestamp', | ||
customFormats: {}, | ||
fields: mockLogstashFields, | ||
title: 'title', | ||
}, | ||
version: '2', | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there an issue with the default JSON parser?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsconfig.json
is not strict JSON https://www.reddit.com/r/typescript/comments/8na5vb/tsconfigjson_isnt_strict_json_what_now/