Skip to content

Commit

Permalink
Merge branch 'main' into assign-access-grps-123
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Oct 16, 2024
2 parents 9d9ec42 + 1de6fb5 commit 67e3038
Show file tree
Hide file tree
Showing 85 changed files with 8,950 additions and 472 deletions.
12 changes: 12 additions & 0 deletions oas_docs/output/kibana.serverless.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35266,6 +35266,10 @@ paths:
schema:
nullable: true
type: string
- in: query
name: associatedFilter
schema:
$ref: '#/components/schemas/Security_Timeline_API_AssociatedFilterType'
responses:
'200':
content:
Expand Down Expand Up @@ -49419,6 +49423,14 @@ components:
Security_Osquery_API_VersionOrUndefined:
$ref: '#/components/schemas/Security_Osquery_API_Version'
nullable: true
Security_Timeline_API_AssociatedFilterType:
description: Filter notes based on their association with a document or saved object.
enum:
- document_only
- saved_object_only
- document_and_saved_object
- orphan
type: string
Security_Timeline_API_BareNote:
type: object
properties:
Expand Down
12 changes: 12 additions & 0 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35266,6 +35266,10 @@ paths:
schema:
nullable: true
type: string
- in: query
name: associatedFilter
schema:
$ref: '#/components/schemas/Security_Timeline_API_AssociatedFilterType'
responses:
'200':
content:
Expand Down Expand Up @@ -49419,6 +49423,14 @@ components:
Security_Osquery_API_VersionOrUndefined:
$ref: '#/components/schemas/Security_Osquery_API_Version'
nullable: true
Security_Timeline_API_AssociatedFilterType:
description: Filter notes based on their association with a document or saved object.
enum:
- document_only
- saved_object_only
- document_and_saved_object
- orphan
type: string
Security_Timeline_API_BareNote:
type: object
properties:
Expand Down
12 changes: 12 additions & 0 deletions oas_docs/output/kibana.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38697,6 +38697,10 @@ paths:
schema:
nullable: true
type: string
- in: query
name: associatedFilter
schema:
$ref: '#/components/schemas/Security_Timeline_API_AssociatedFilterType'
responses:
'200':
content:
Expand Down Expand Up @@ -58185,6 +58189,14 @@ components:
Security_Osquery_API_VersionOrUndefined:
$ref: '#/components/schemas/Security_Osquery_API_Version'
nullable: true
Security_Timeline_API_AssociatedFilterType:
description: Filter notes based on their association with a document or saved object.
enum:
- document_only
- saved_object_only
- document_and_saved_object
- orphan
type: string
Security_Timeline_API_BareNote:
type: object
properties:
Expand Down
12 changes: 12 additions & 0 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38697,6 +38697,10 @@ paths:
schema:
nullable: true
type: string
- in: query
name: associatedFilter
schema:
$ref: '#/components/schemas/Security_Timeline_API_AssociatedFilterType'
responses:
'200':
content:
Expand Down Expand Up @@ -58185,6 +58189,14 @@ components:
Security_Osquery_API_VersionOrUndefined:
$ref: '#/components/schemas/Security_Osquery_API_Version'
nullable: true
Security_Timeline_API_AssociatedFilterType:
description: Filter notes based on their association with a document or saved object.
enum:
- document_only
- saved_object_only
- document_and_saved_object
- orphan
type: string
Security_Timeline_API_BareNote:
type: object
properties:
Expand Down
34 changes: 5 additions & 29 deletions packages/kbn-elastic-agent-utils/src/agent_names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,37 +38,13 @@ export const ELASTIC_AGENT_NAMES: ElasticAgentName[] = [
];

export type OpenTelemetryAgentName =
| 'otlp'
| 'opentelemetry'
| 'opentelemetry/cpp'
| 'opentelemetry/dotnet'
| 'opentelemetry/erlang'
| 'opentelemetry/go'
| 'opentelemetry/java'
| 'opentelemetry/nodejs'
| 'opentelemetry/php'
| 'opentelemetry/python'
| 'opentelemetry/ruby'
| 'opentelemetry/rust'
| 'opentelemetry/swift'
| 'opentelemetry/android'
| 'opentelemetry/webjs'
| 'otlp/cpp'
| 'otlp/dotnet'
| 'otlp/erlang'
| 'otlp/go'
| 'otlp/java'
| 'otlp/nodejs'
| 'otlp/php'
| 'otlp/python'
| 'otlp/ruby'
| 'otlp/rust'
| 'otlp/swift'
| 'otlp/android'
| 'otlp/webjs';
| 'otlp'
| `opentelemetry/${string}`
| `otlp/${string}`;
export const OPEN_TELEMETRY_BASE_AGENT_NAMES: OpenTelemetryAgentName[] = ['otlp', 'opentelemetry'];
export const OPEN_TELEMETRY_AGENT_NAMES: OpenTelemetryAgentName[] = [
'otlp',
'opentelemetry',
...OPEN_TELEMETRY_BASE_AGENT_NAMES,
'opentelemetry/cpp',
'opentelemetry/dotnet',
'opentelemetry/erlang',
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-es-types/src/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ export interface ESQLSearchParams {
query: string;
filter?: unknown;
locale?: string;
include_ccs_metadata?: boolean;
dropNullColumns?: boolean;
params?: Array<Record<string, string | undefined>>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export interface MappedTypes {
mappedTypeWithOneInlineProp: {
[key in 'prop3']: number;
};
mappedTypeWithLiteralTemplates: {
[key in MappedTypeProps | `templated_prop/${string}`]: number;
};
}

export type RecordWithKnownProps = Record<MappedTypeProps, number>;
Expand Down
7 changes: 7 additions & 0 deletions packages/kbn-telemetry-tools/src/tools/serializer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ describe('getDescriptor', () => {
mappedTypeWithOneInlineProp: {
prop3: { kind: ts.SyntaxKind.NumberKeyword, type: 'NumberKeyword' },
},
mappedTypeWithLiteralTemplates: {
prop1: { kind: ts.SyntaxKind.NumberKeyword, type: 'NumberKeyword' },
prop2: { kind: ts.SyntaxKind.NumberKeyword, type: 'NumberKeyword' },
// ideally, it'd be `templated_prop/@@INDEX@@` to be more explicit. But we're going with the fuzzier approach
// for now as it may require more changes downstream that are not worth it.
'@@INDEX@@': { kind: ts.SyntaxKind.NumberKeyword, type: 'NumberKeyword' },
},
});
});

Expand Down
11 changes: 8 additions & 3 deletions packages/kbn-telemetry-tools/src/tools/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,15 @@ export function getConstraints(node: ts.Node, program: ts.Program): any {
return node.literal.text;
}

if (ts.isStringLiteral(node)) {
if (ts.isStringLiteral(node) || ts.isStringLiteralLike(node)) {
return node.text;
}

// template literals such as `smth/${string}`
if (ts.isTemplateLiteralTypeNode(node) || ts.isTemplateExpression(node)) {
return '@@INDEX@@'; // just map it to any kind of string. We can enforce it further in the future if we see fit.
}

if (ts.isImportSpecifier(node) || ts.isExportSpecifier(node)) {
const source = node.getSourceFile();
const importedModuleName = getModuleSpecifier(node);
Expand Down Expand Up @@ -180,9 +185,9 @@ export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor |
const constraintsArray = Array.isArray(constraints) ? constraints : [constraints];
if (typeof constraintsArray[0] === 'string') {
return constraintsArray.reduce((acc, c) => {
(acc as Record<string, unknown>)[c] = descriptor;
acc[c] = descriptor;
return acc;
}, {});
}, {} as Record<string, unknown>);
}
}
return { '@@INDEX@@': descriptor };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"patterns": [
"_capabilities"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/capabilities.html",
"documentation": "https://github.com/elastic/elasticsearch/blob/main/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/README.asciidoc#require-or-skip-api-capabilities",
"availability": {
"stack": false,
"serverless": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"filter_path": [],
"human": "__flag__",
"pretty": "__flag__",
"flat_settings": "__flag__",
"include_remotes": "__flag__",
"timeout": [
"-1",
"0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-last-sync-api.html",
"availability": {
"stack": true,
"serverless": true
"stack": false,
"serverless": false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html",
"availability": {
"stack": true,
"serverless": true
"serverless": false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"smile",
"arrow"
],
"delimiter": ""
"delimiter": "",
"drop_null_columns": "__flag__"
},
"methods": [
"POST"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
"error_trace": "__flag__",
"filter_path": [],
"human": "__flag__",
"pretty": "__flag__"
"pretty": "__flag__",
"master_timeout": [
"30s",
"-1",
"0"
],
"timeout": [
"30s",
"-1",
"0"
]
},
"methods": [
"PUT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html",
"availability": {
"stack": true,
"serverless": true
"serverless": false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams-delete-lifecycle.html",
"availability": {
"stack": true,
"serverless": true
"serverless": false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"filter_path": [],
"human": "__flag__",
"pretty": "__flag__",
"master_timeout": [
"30s",
"-1",
"0"
],
"expand_wildcards": [
"all",
"open",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
"hidden",
"none"
],
"include_defaults": "__flag__"
"include_defaults": "__flag__",
"master_timeout": [
"30s",
"-1",
"0"
]
},
"methods": [
"GET"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
"hidden",
"none"
],
"include_defaults": "__flag__"
"include_defaults": "__flag__",
"master_timeout": [
"30s",
"-1",
"0"
],
"verbose": "__flag__"
},
"methods": [
"GET"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
"error_trace": "__flag__",
"filter_path": [],
"human": "__flag__",
"pretty": "__flag__"
"pretty": "__flag__",
"master_timeout": [
"30s",
"-1",
"0"
],
"timeout": [
"30s",
"-1",
"0"
]
},
"methods": [
"POST"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
"error_trace": "__flag__",
"filter_path": [],
"human": "__flag__",
"pretty": "__flag__"
"pretty": "__flag__",
"master_timeout": [
"30s",
"-1",
"0"
]
},
"methods": [
"POST"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates-v1.html",
"availability": {
"stack": true,
"serverless": true
"serverless": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"inference.stream_inference": {
"methods": [
"POST"
],
"patterns": [
"_inference/{inference_id}/_stream",
"_inference/{task_type}/{inference_id}/_stream"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-stream-inference-api.html",
"availability": {
"stack": true,
"serverless": false
}
}
}
Loading

0 comments on commit 67e3038

Please sign in to comment.